diff --git a/README.md b/README.md index e797889999e112a4910b22ed5c91c8f40f0749ef..850041f6a18de194bef84ed80433135a0f2c38a5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@

- - + + @@ -55,20 +55,20 @@ oauthserver是一个基于Spring Boot Oauth2的完整的独立的Oauth2 Server **更多历史更新日志查看[CHANGE_LOG.md](tutorial/CHANGE_LOG.md)** ## 使用流程 +### 准备 +IntelliJ IDEA或Eclipse请先安装lombok插件。 +- IntelliJ IDEA安装请参考[https://projectlombok.org/setup/intellij](https://projectlombok.org/setup/intellij); +- Eclipse安装请参考[https://projectlombok.org/setup/eclipse](https://projectlombok.org/setup/eclipse)。 ### 1. 安装jar 有部分自建jar在中央仓库是没有的,需要使用`mvn install`安装到本地。执行“需要安装的jars”文件夹下的`install.bat`安装。 ### 2. 建表 - MySQL -请执行`schema-mysql.sql`,完成数据表的创建和测试数据的导入。 -- PostgreSQL -请执行`schema-pg.sql`,完成数据表的创建和测试数据的导入。 +请执行`schema-mysql.sql`,完成数据表的创建和测试数据的导入。之后,请执行SQL增量更新目录下的增量更新SQL。 - Oracle -请执行`schema-oracle.sql`,完成数据表的创建和测试数据的导入。 +请执行`schema-oracle.sql`,完成数据表的创建和测试数据的导入。之后,请执行SQL增量更新目录下的增量更新SQL。 ### 3. 修改数据库连接信息 - MySQL -连接信息在`application-mysql.yml`里。修改完数据库连接信息后,还需要设置`application-common.yml`的`spring.profiles.active=mysql`。 -- PostgreSQL -连接信息在`application-pg.yml`里。修改完数据库连接信息后,还需要设置`application-common.yml`的`spring.profiles.active=pg`。 +连接信息在`application-mysql.yml`里。修改完数据库连接信息后,还需要设置`application-common.yml`的`spring.profiles.active=mysql`。 - Oracle 连接信息在`application-oracle.yml`里。修改完数据库连接信息后,还需要设置`application-common.yml`的`spring.profiles.active=oracle`。 ### 4. 运行 diff --git "a/SQL\345\242\236\351\207\217\346\233\264\346\226\260/schema-mysql-20190512.sql" "b/SQL\345\242\236\351\207\217\346\233\264\346\226\260/schema-mysql-20190512.sql" new file mode 100644 index 0000000000000000000000000000000000000000..e1e09015b068b651b5e5ef23cd9a8dcbb73d7428 --- /dev/null +++ "b/SQL\345\242\236\351\207\217\346\233\264\346\226\260/schema-mysql-20190512.sql" @@ -0,0 +1,2 @@ +-- 2019-05-11 by simon 修改t_s_column_ui的id列为long类型 +ALTER TABLE t_s_column_ui MODIFY COLUMN id INT(20); \ No newline at end of file diff --git "a/SQL\345\242\236\351\207\217\346\233\264\346\226\260/schema-oracle-20190509.sql" "b/SQL\345\242\236\351\207\217\346\233\264\346\226\260/schema-oracle-20190509.sql" new file mode 100644 index 0000000000000000000000000000000000000000..eafb428c44f17508ce7c8e0ccc64f97c94882bcb --- /dev/null +++ "b/SQL\345\242\236\351\207\217\346\233\264\346\226\260/schema-oracle-20190509.sql" @@ -0,0 +1,24 @@ +-- 2019-05-11 by simon 修改T_USERS表的sex列为boolean +ALTER TABLE T_USERS ADD SEX_TEMP CHAR (1) CHECK (SEX_TEMP IN(0, 1)); +UPDATE T_USERS SET SEX_TEMP = SEX; +ALTER TABLE T_USERS MODIFY SEX NULL; +UPDATE T_USERS SET SEX = NULL; +ALTER TABLE T_USERS MODIFY (SEX CHAR (1) CHECK (SEX IN(0, 1))); +UPDATE T_USERS SET SEX = SEX_TEMP; +UPDATE T_USERS SET SEX = '1' WHERE SEX IS NULL; +ALTER TABLE T_USERS MODIFY SEX NOT NULL; +ALTER TABLE T_USERS DROP COLUMN SEX_TEMP; + +-- 2019-05-11 by simon 修改T_USERS表的enabled列为boolean +ALTER TABLE T_USERS ADD ENABLED_TEMP CHAR (1) CHECK (ENABLED_TEMP IN(0, 1)); +UPDATE T_USERS SET ENABLED_TEMP = ENABLED; +ALTER TABLE T_USERS MODIFY ENABLED NULL; +UPDATE T_USERS SET ENABLED = NULL; +ALTER TABLE T_USERS MODIFY (ENABLED CHAR (1) CHECK (ENABLED IN(0, 1))); +UPDATE T_USERS SET ENABLED = ENABLED_TEMP; +UPDATE T_USERS SET ENABLED = '1' WHERE enabled IS NULL; +ALTER TABLE T_USERS MODIFY ENABLED NOT NULL; +ALTER TABLE T_USERS DROP COLUMN ENABLED_TEMP; + +-- 2019-05-11 by simon 修改T_S_COLUMN_UI表的id列为long类型 +ALTER TABLE T_S_COLUMN_UI MODIFY (ID NUMBER(20)); \ No newline at end of file diff --git a/api/pom.xml b/api/pom.xml index 1e4c19bb634adc579f6f10eaa650f075fbdc42a3..628dccb9f51e289f16f7a552f4819fba54676b66 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -326,22 +326,6 @@ popper.js 1.12.5 - - - org.webjars - easyui - 1.7.0 - - - - - - - com.github.jeesun.thymeleaf.extras - thymeleaf-extras-db - 0.0.1 - - com.simon diff --git a/api/src/main/java/com/simon/common/config/CustomDialectConfig.java b/api/src/main/java/com/simon/common/config/CustomDialectConfig.java index c42bb21359dd0db11843a55d3a812ccbd55da454..931ac245a1296c4cd24f275b44a9165da648f82a 100644 --- a/api/src/main/java/com/simon/common/config/CustomDialectConfig.java +++ b/api/src/main/java/com/simon/common/config/CustomDialectConfig.java @@ -1,6 +1,5 @@ package com.simon.common.config; -import com.github.jeesun.thymeleaf.extras.dialect.DbDialect; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Bean; @@ -23,11 +22,6 @@ public class CustomDialectConfig { @Autowired private CacheManager cacheManager; - @Bean - public DbDialect helloDialect(){ - return new DbDialect(jdbcTemplate, cacheManager); - } - /*@Bean public com.jeesun.thymeleaf.extras.dialect.HelloDialect helloDialect(){ return new com.jeesun.thymeleaf.extras.dialect.HelloDialect(jdbcTemplate); diff --git a/api/src/main/java/com/simon/common/config/RedisConfig.java b/api/src/main/java/com/simon/common/config/RedisConfig.java index 82c8602728afc4bff66d5a0b343b9551bd739613..ce1e881bb5e19fae8ffb2e2f14c3c5ac8e3cb527 100644 --- a/api/src/main/java/com/simon/common/config/RedisConfig.java +++ b/api/src/main/java/com/simon/common/config/RedisConfig.java @@ -39,7 +39,7 @@ public class RedisConfig extends CachingConfigurerSupport { public CacheManager cacheManager(RedisTemplate redisTemplate){ RedisCacheManager cacheManager = new RedisCacheManager(redisTemplate); //设置缓存过期时间 - //1小时 + //2小时 cacheManager.setDefaultExpiration(7200); //将key的前后缀合并在一起 cacheManager.setUsePrefix(true); diff --git a/api/src/main/java/com/simon/common/config/Swagger2.java b/api/src/main/java/com/simon/common/config/Swagger2.java index d55a08b7b2e02ca8e53ab15d2e086c8723fd5c93..e985ff477ac91948f9e9240f3f27c4f56f1f0ded 100644 --- a/api/src/main/java/com/simon/common/config/Swagger2.java +++ b/api/src/main/java/com/simon/common/config/Swagger2.java @@ -1,5 +1,7 @@ package com.simon.common.config; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -23,9 +25,6 @@ import java.util.List; @Configuration @EnableSwagger2 public class Swagger2 { - @Value("${swagger2.base-package}") - private String basePackage; - @Value("${swagger2.title}") private String title; @@ -59,8 +58,8 @@ public class Swagger2 { .useDefaultResponseMessages(false) .apiInfo(apiInfo()) .select() - .apis(RequestHandlerSelectors - .basePackage(basePackage)) + .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) .paths(PathSelectors.regex("^(?!oauth).*$")) .build() .securitySchemes(securitySchemes()) diff --git a/api/src/main/java/com/simon/controller/AliPayController.java b/api/src/main/java/com/simon/controller/AliPayController.java index 922e747f2ab75c79276f6ab952458f6b34df66c0..21214b92c4e11bac30300a543c2565ba3d9e6c68 100644 --- a/api/src/main/java/com/simon/controller/AliPayController.java +++ b/api/src/main/java/com/simon/controller/AliPayController.java @@ -236,10 +236,10 @@ public class AliPayController extends BaseController { //请在这里加上商户的业务逻辑程序代码 //判断total_amount是否确实为该订单的实际金额(即商户订单创建时的金额) - if(Float.parseFloat(receiptAmount) < Float.parseFloat(totalAmount)){//如果实付金额小于订单金额 + /*if(Float.parseFloat(receiptAmount) < Float.parseFloat(totalAmount)){//如果实付金额小于订单金额 log.error("实付金额小于订单金额!"); return "fail"; - } + }*/ //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— diff --git a/api/src/main/java/com/simon/controller/TableController.java b/api/src/main/java/com/simon/controller/TableController.java deleted file mode 100644 index f08a5fbba838cbfca30c5a1e001bd60f8e2f5ccc..0000000000000000000000000000000000000000 --- a/api/src/main/java/com/simon/controller/TableController.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.simon.controller; - -import com.alibaba.fastjson.JSON; -import com.google.common.base.CaseFormat; -import com.simon.common.code.CodeGenerator; -import com.simon.common.code.Column; -import com.simon.common.code.EntityDataModel; -import com.simon.common.code.TableInfo; -import com.simon.common.controller.BaseController; -import com.simon.common.domain.ResultMsg; -import com.simon.common.domain.UserEntity; -import com.simon.common.utils.DbUtil; -import com.simon.service.DictTypeService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.core.Authentication; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import javax.sql.DataSource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 数据表 - * - * @author simon - * @date 2018-10-06 - **/ -@ApiIgnore -@Api(description = "数据表") -@Slf4j -@Controller -@RequestMapping("/tables") -public class TableController extends BaseController { - @Autowired - private DataSource dataSource; - - @Autowired - private DictTypeService dictTypeService; - - @RequestMapping(params = "list", method = RequestMethod.GET) - public String list(){ - return "table_list"; - } - - @RequestMapping(params = "easyui-list", method = RequestMethod.GET) - public String easyUiList(){ - return "easyui/table_list"; - } - - @RequestMapping(value = "data", method = RequestMethod.GET) - @ResponseBody - public Object getTables( - @ApiParam(value = "模糊查询表名") @RequestParam(required = false) String tableName, - @ApiParam(value = "模糊查询表标注") @RequestParam(required = false) String tableComment, - @ApiParam(value = "页码", defaultValue = "1", required = true) @RequestParam Integer pageNo, - @ApiParam(value = "每页条数", defaultValue = "10", required = true)@RequestParam Integer pageSize) throws Exception { - String driver = "com.mysql.jdbc.Driver"; - /*String url = "jdbc:mysql://127.0.0.1:3306/thymelte?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false"; - String user = "root"; - String pwd = "19941017";*/ - /*String url = "jdbc:mysql://47.105.43.147:3306/top_dev?characterEncoding=utf8&useSSL=true"; - String user = "root"; - String pwd = "top@123456";*/ - List tableInfoList = DbUtil.getTables(CodeGenerator.JDBC_DIVER_CLASS_NAME, CodeGenerator.JDBC_URL, CodeGenerator.JDBC_USERNAME, CodeGenerator.JDBC_PASSWORD, tableName, tableComment); - - if (null != pageNo && null != pageSize){ - Map resultMap = new HashMap<>(2); - resultMap.put("total", tableInfoList.size()); - int toIndex = (pageNo - 1) * pageSize + pageSize; - if (toIndex > tableInfoList.size()){ - toIndex = tableInfoList.size(); - } - resultMap.put("rows", tableInfoList.subList((pageNo - 1) * pageSize, toIndex)); - return resultMap; - }else{ - return tableInfoList; - } - } - - @RequestMapping(value = "generate", method = RequestMethod.GET) - @ResponseBody - public ResultMsg generate( - @RequestParam String tableName, - @RequestParam String entityName, - @ApiParam(value = "表id列类型", required = false, example = "Long") @RequestParam(required = false, defaultValue = "Long") String idType, - @RequestParam(required = false) String genModules, - Authentication authentication){ - if(null != authentication){ - UserEntity userEntity = getCurrentUser(authentication); - CodeGenerator.genCodeByCustomModelName(tableName, entityName, idType, genModules, userEntity.getUsername()); - }else{ - CodeGenerator.genCodeByCustomModelName(tableName, entityName, idType, genModules); - } - return ResultMsg.success(); - } - - @GetMapping(value = "codeGenerate") - public String codeGenerate( - Model model, - @RequestParam String tableName, - @RequestParam(required = false) String tableComment, - @RequestParam String entityName){ - model.addAttribute("tableName", tableName); - model.addAttribute("tableComment", tableComment); - model.addAttribute("entityName", entityName); - try { - EntityDataModel entityDataModel = DbUtil.getEntityModel(dataSource.getConnection(), tableName, CodeGenerator.BASE_PACKAGE, entityName); - - //想隐藏显示的列 - List hiddenColumns = new ArrayList<>(); - hiddenColumns.add("createDate"); - hiddenColumns.add("createBy"); - hiddenColumns.add("updateDate"); - hiddenColumns.add("updateBy"); - - //想不在页面上输入的列 - List denyInputColumns = new ArrayList<>(); - denyInputColumns.add("createDate"); - denyInputColumns.add("createBy"); - denyInputColumns.add("updateDate"); - denyInputColumns.add("updateBy"); - - for(Column column : entityDataModel.getColumns()){ - if(hiddenColumns.contains(column.getName())){ - column.setHidden(true); - } - if (denyInputColumns.contains(column.getName())){ - column.setAllowInput(false); - } - } - - log.info(JSON.toJSONString(entityDataModel.getColumns())); - model.addAttribute("tableEntity", entityDataModel); - - } catch (Exception e) { - e.printStackTrace(); - } - - model.addAttribute("easyuiComponents", dictTypeService.getTypeByGroupCode("easyui_component")); - return "easyui/code_generate"; - } - - @RequestMapping(value = "genCode", method = {RequestMethod.GET, RequestMethod.POST}) - @ResponseBody - public ResultMsg genCode( - @ApiParam(value = "允许访问的角色,多个逗号隔开", required = true) @RequestParam String allowedRoles, - @ApiParam(value = "要生成的页面的父菜单id", required = true) @RequestParam Long pid, - @RequestParam String tableName, - @RequestParam String entityName, - @ApiParam(value = "表注释", required = true) @RequestParam String tableComment, - @RequestParam String idType, - @RequestParam String genModules, - @RequestParam String columns){ - List columnList = JSON.parseArray(columns, Column.class); - EntityDataModel entityDataModel = new EntityDataModel(); - entityDataModel.setBasePackage(CodeGenerator.BASE_PACKAGE); - entityDataModel.setEntityPackage(CodeGenerator.BASE_PACKAGE + ".entity"); - entityDataModel.setFileSuffix(".java"); - entityDataModel.setEntityName(entityName); - entityDataModel.setTableName(tableName); - entityDataModel.setTableComment(tableComment); - entityDataModel.setColumns(columnList); - entityDataModel.setModelNameUpperCamel(entityName); - entityDataModel.setModelNameLowerCamel(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, entityDataModel.getEntityName())); - CodeGenerator.genCodeByCustomModelName(tableName, entityName, idType, genModules, null, entityDataModel); - return ResultMsg.success(); - } -} diff --git a/api/src/main/resources/application.properties b/api/src/main/resources/application.properties index 959e78dad0b37977b3084b66ad22ea429c10d9d1..15e98fb9b82ec6121eac6699c975a6e483b19574 100644 --- a/api/src/main/resources/application.properties +++ b/api/src/main/resources/application.properties @@ -4,7 +4,6 @@ spring.profiles.include=common server.port=8181 # swagger2 -swagger2.base-package=@base.package@.controller swagger2.title=restful api documentation swagger2.description=api service for app swagger2.terms-of-service-url=NO terms of service diff --git a/api/src/main/resources/code-gen.properties b/api/src/main/resources/code-gen.properties index d7cfc93f5c49f54ef6e76be59db3ed5ddee4fca3..232d5d25036437169ebbd0014d487ff214c413f9 100644 --- a/api/src/main/resources/code-gen.properties +++ b/api/src/main/resources/code-gen.properties @@ -23,16 +23,5 @@ jdbc_driver_class_name=com.mysql.cj.jdbc.Driver #jdbc_driver_class_name=oracle.jdbc.driver.OracleDriver # Spring BootģĿ¼ -spring_boot_module_dir=/api -# ߣɵĴ@authorע -author=SimonSun -# ɵjavaļ洢· -java_path=/src/test/java -# ɵԴļ洢· -resources_path=/src/test/resources -# ĿƣԼĿ޸ -base_package=@base.package@ # Mapperӿڵȫ޶(ڶᵽĺļ̳нӿMapper) -mapper_interface_reference=@base.package@.common.mapper.MyMapper -# Ҫɵģ飬ѡֵmodelAndMapper,repository,service,controller,controllerAndPageָmodelAndMapper,repository,service -gen_modules=modelAndMapper \ No newline at end of file +mapper_interface_reference=@base.package@.common.mapper.MyMapper \ No newline at end of file diff --git a/api/src/main/resources/static/css/common.css b/api/src/main/resources/static/css/common.css deleted file mode 100644 index 44ca45f2f0c80173e8427b5806f699111a4dfc6c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/common.css +++ /dev/null @@ -1,78 +0,0 @@ -/** -* -* User: simon -* Date: 2018/06/09 -* Time: 1:14 -**/ -.outer-wrapper { - display: table; - width: 100%; - height: 100%; -} - -.inner-wrapper { - display:table-cell; - vertical-align:middle; - padding:15px; -} -.form-signin { - max-width: 380px; - padding: 10px 10px 45px; - margin: 0 auto; -} -.form-signin .form-signin-heading, -.form-signin .checkbox { - margin-bottom: 30px; -} -.form-signin .checkbox { - font-weight: normal; -} -.form-signin .form-control { - position: relative; - font-size: 16px; - height: auto; - padding: 10px; -} -.form-signin .form-control:focus { - z-index: 2; -} -.form-signin input[type="text"] { - margin-bottom: -1px; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; -} -.form-signin input[type="password"] { - margin-bottom: -1px; - border-top-left-radius: 0; - border-top-right-radius: 0; -} - -/** -jquery validate 错误提示 - */ -.error{ - color:red; -} - -/** -adminlte主体内容的背景色,解决bootstrap table行分隔线显示问题。 - */ -.bg-color-white{ - background-color: white; -} - -table img{ - max-width: 100px; - max-height: 100px; -} - -.modal img{ - max-width: 300px; - max-height: 300px; -} - -.content-header{ - padding: 3px; - background-color: #F9F9F9; - font-weight: bold; -} \ No newline at end of file diff --git a/api/src/main/resources/static/css/coverr.css b/api/src/main/resources/static/css/coverr.css deleted file mode 100644 index decab9412c2addf89ca459435ba193fe3fa5d390..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/coverr.css +++ /dev/null @@ -1,47 +0,0 @@ -/** -* -* User: simon -* Date: 2018/06/09 -* Time: 3:14 -**/ -.homepage-hero-module { - border-right: none; - border-left: none; - position: relative; -} -.no-video .video-container video, -.touch .video-container video { - display: none; -} -.no-video .video-container .poster, -.touch .video-container .poster { - display: block !important; -} -.video-container { - position: relative; - bottom: 0%; - left: 0%; - height: 100%; - width: 100%; - overflow: hidden; - background: #000; -} -.video-container .poster img { - width: 100%; - bottom: 0; - position: absolute; -} -.video-container .filter { - z-index: 100; - position: absolute; - background: rgba(0, 0, 0, 0.4); - width: 100%; -} -.video-container video { - position: absolute; - z-index: 0; - bottom: 0; -} -.video-container video.fillWidth { - width: 100%; -} \ No newline at end of file diff --git a/api/src/main/resources/static/css/easyui/common.css b/api/src/main/resources/static/css/easyui/common.css deleted file mode 100644 index 0df2d83cb29361281c4792369323b5c1fb5b1412..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/easyui/common.css +++ /dev/null @@ -1,22 +0,0 @@ -/** -* -* User: simon -* Date: 2018/11/04 -* Time: 17:24 -**/ -@import url("navbar.css"); - -form>div{ - margin-bottom: 20px; -} - -/** -字体大小同步 - */ -.button-group i.fa{ - font-size:12px; -} - -.c-primary,.c-secondary,.c-success,.c-info,.c-warning,.c-danger,.c-dark,.c-light,.c-basic{ - -} \ No newline at end of file diff --git a/api/src/main/resources/static/css/easyui/dropdown.css b/api/src/main/resources/static/css/easyui/dropdown.css deleted file mode 100644 index bc96ec84fe2f6188ad1dc92dfda1fa8db035af3e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/easyui/dropdown.css +++ /dev/null @@ -1,44 +0,0 @@ -/** -* -* User: simon -* Date: 2018/11/04 -* Time: 21:37 -**/ -.dropbtn { - background-color: #3498DB; - color: white; - padding: 16px; - font-size: 16px; - border: none; - cursor: pointer; -} - -.dropbtn:hover, .dropbtn:focus { - background-color: #2980B9; -} - -.dropdown { - position: fixed; - display: inline-block; -} - -.dropdown-content { - display: none; - position: absolute; - background-color: #f1f1f1; - min-width: 160px; - overflow: auto; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); - z-index: 1; -} - -.dropdown-content a { - color: black; - padding: 12px 16px; - text-decoration: none; - display: block; -} - -.dropdown a:hover {background-color: #ddd;} - -.show {display: block;} \ No newline at end of file diff --git a/api/src/main/resources/static/css/easyui/navbar.css b/api/src/main/resources/static/css/easyui/navbar.css deleted file mode 100644 index d6acd06dad8f4e42f8bd4020b68255694db5d5c2..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/easyui/navbar.css +++ /dev/null @@ -1,63 +0,0 @@ -/** -* -* User: simon -* Date: 2018/11/05 -* Time: 0:23 -**/ -.navbar { - overflow: hidden; - background-color: #333; - font-family: Arial, Helvetica, sans-serif; -} - -.navbar a { - float: left; - font-size: 16px; - color: white; - text-align: center; - padding: 14px 16px; - text-decoration: none; -} - -.dropdown { - float: left; - overflow: auto; -} - -.dropdown .dropbtn { - font-size: 16px; - border: none; - outline: none; - color: white; - padding: 7px 16px; - background-color: inherit; - font-family: inherit; - margin: 0; -} - -.navbar a:hover, .dropdown:hover .dropbtn { - background-color: #2980B9; -} - -.dropdown-content { - display: none; - /*解决jQuery easyui下拉菜单被layout遮挡*/ - position: fixed; - background-color: #f9f9f9; - min-width: 160px; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); - z-index: 1; -} - -.dropdown-content a { - float: none; - color: black; - padding: 12px 16px; - text-decoration: none; - display: block; - text-align: left; -} - -.dropdown-content a:hover { - background-color: #ddd; -} \ No newline at end of file diff --git a/api/src/main/resources/static/css/easyui/select2-material.css b/api/src/main/resources/static/css/easyui/select2-material.css deleted file mode 100644 index 74f18b20f05032fad40690917a7ae8bd17a16db6..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/easyui/select2-material.css +++ /dev/null @@ -1,257 +0,0 @@ -/** - * Basic styles - */ -body { - overflow-x: hidden; - overflow-y: scroll; - max-width: 600px; - margin: 2rem auto; -} - -ul { - margin: 0; - padding: 0; -} - -:focus { - outline: none; -} - -:disabled { - background-color: transparent; -} - -/** - * Multiple Select2 - */ -.select2-container--material { - width: 100% !important; - /** - * Textbox - */ - /** - * Dropdown - */ - /** - * Options - */ - /** - * Focused textbox - */ - /** - * Disabled textbox - */ -} -.select2-container--material ::-webkit-input-placeholder { - color: inherit; -} -.select2-container--material :-ms-input-placeholder { - color: inherit; -} -.select2-container--material ::-ms-input-placeholder { - color: inherit; -} -.select2-container--material ::placeholder { - color: inherit; -} -.select2-container--material .select2-selection { - /* @extend input */ - overflow: visible; - font: inherit; - touch-action: manipulation; - margin: 0; - line-height: inherit; - border-radius: 0; - box-sizing: inherit; - /* @extend .form-control */ - display: block; - width: 100%; - color: #55595c; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, 0.15); - padding: .5rem 0 .6rem; - font-size: 1rem; - line-height: 1.5; - background-color: transparent; - background-image: none; - border-radius: 0; - margin-top: .2rem; - margin-bottom: 1rem; - /* @extend input[type=text] */ - background-color: transparent; - border: none; - border-bottom: 1px solid #ccc; - border-radius: 0; - outline: 0; - width: 100%; - font-size: 1rem; - box-shadow: none; - transition: all .3s; - min-height: 2.1rem; -} -.select2-container--material .select2-selection .select2-selection__rendered { - padding-left: 0; -} -.select2-container--material .select2-selection--single .select2-selection__rendered { - float: left; -} -.select2-container--material .select2-selection--single .select2-selection__arrow { - float: right; -} -.select2-container--material .select2-selection--multiple { - /** - * Multiple selected options - */ - /** - * Multiple selected option clear button - */ -} -.select2-container--material .select2-selection--multiple .select2-selection__rendered { - width: 100%; -} -.select2-container--material .select2-selection--multiple .select2-selection__rendered li { - list-style: none; -} -.select2-container--material .select2-selection--multiple .select2-selection__choice { - /* @extend .mdl-chip */ - height: 32px; - line-height: 32px; - padding: 0 12px; - border: 0; - border-radius: 16px; - background-color: #dedede; - display: inline-block; - color: rgba(0, 0, 0, 0.87); - margin: 2px 0; - font-size: 0; - white-space: nowrap; - /* @extend .mdl-chip__text */ - font-size: 13px; - vertical-align: middle; - display: inline-block; - float: left; - margin-right: 8px; - margin-bottom: 4px; -} -.select2-container--material .select2-selection--multiple .select2-selection__choice__remove { - /* Hide default content */ - font-size: 0; - opacity: 0.38; - cursor: pointer; - float: right; - margin-top: 4px; - margin-right: -6px; - margin-left: 6px; - transition: opacity; -} -.select2-container--material .select2-selection--multiple .select2-selection__choice__remove::before { - content: "cancel"; - /* @extend .material-icons */ - font-family: 'Material Icons'; - font-weight: normal; - font-style: normal; - font-size: 24px; - line-height: 1; - letter-spacing: normal; - text-transform: none; - display: inline-block; - white-space: nowrap; - word-wrap: normal; - direction: ltr; - -webkit-font-feature-settings: 'liga'; - -webkit-font-smoothing: antialiased; - color: #000; -} -.select2-container--material .select2-selection--multiple .select2-selection__choice__remove:hover { - opacity: 0.54; -} -.select2-container--material .select2-search--inline .select2-search__field { - width: 100%; - margin-top: 0; - /* Match input[type=text] */ - height: 34px; - line-height: 1; -} -.select2-container--material .select2-dropdown { - border: 0; -} -.select2-container--material .select2-dropdown .select2-search__field { - min-height: 2.1rem; - margin-bottom: 16px; - border: 0; - border-bottom: 1px solid #ccc; - transition: all .3s; -} -.select2-container--material .select2-dropdown .select2-search__field:focus { - border-bottom: 1px solid #4285f4; - box-shadow: 0 1px 0 0 #4585f4; -} -.select2-container--material .select2-results__options { - /* @extend .zf-shadow-depth* */ - box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); - /* @extend .dropdown-content */ - background-color: #fff; - margin: 0; - min-width: 100px; - max-height: 650px; - overflow-y: auto; - z-index: 999; - will-change: width,height; - /* @extend .dropdown-content inline styles */ -} -.select2-container--material .select2-results__option { - /* @extend .dropdown-content li */ - cursor: pointer; - clear: both; - color: rgba(0, 0, 0, 0.87); - line-height: 1.5rem; - text-align: left; - text-transform: none; - /* @extend .dropdown-content li>a, .dropdown-content li>span */ - font-size: 1.2rem; - display: block; - padding: 1rem; - /** - * Disabled options - */ - /** - * Selected option - */ - /** - * Active/hovered option - */ -} -.select2-container--material .select2-results__option[aria-disabled=true] { - /* @extend .select-dropdown li.disabled */ - color: rgba(0, 0, 0, 0.3); - background-color: transparent !important; - cursor: context-menu; - /* @extend .disabled */ - cursor: not-allowed; -} -.select2-container--material .select2-results__option[aria-selected=true] { - /* @extend .dropdown-content li:active, .dropdow-content li:hover */ - color: #4285f4; - background-color: #eee; -} -.select2-container--material .select2-results__option--highlighted[aria-selected] { - background-color: #ddd; -} -.select2-container--material.select2-container--focus .select2-selection { - /* @extend input[type=text]:focus */ - border-bottom: 1px solid #4285f4; - box-shadow: 0 1px 0 0 #4585f4; -} -.select2-container--material.select2-container--disabled .select2-selection { - /* @extend .select-wrapper input.select-dropdown:disabled */ - color: rgba(0, 0, 0, 0.3); - cursor: default; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - border-bottom: 1px solid rgba(0, 0, 0, 0.3); -} -.select2-container--material.select2-container--disabled.select2-container--focus .select2-selection { - box-shadow: none; -} \ No newline at end of file diff --git a/api/src/main/resources/static/css/easyui/select2.css b/api/src/main/resources/static/css/easyui/select2.css deleted file mode 100644 index 63c284bc3f85a2bcd7a82136c449f9f90315b68a..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/easyui/select2.css +++ /dev/null @@ -1,172 +0,0 @@ -/** -* -* User: simon -* Date: 2018/10/25 -* Time: 16:25 -**/ -/*@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,700"); -@import url("https://fonts.googleapis.com/css?family=Pacifico"); -body { - background: #e0e0e0; - font-family: "Open Sans", sans-serif; - font-size: 14px; - line-height: 21px; - padding: 15px 0; -} - -h1 { - color: #333; - font-family: "Pacifico", cursive; - font-size: 28px; - line-height: 42px; - margin: 0 0 15px; - text-align: center; -} - -.content { - background: #fff; - border-radius: 3px; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075), 0 2px 4px rgba(0, 0, 0, 0.0375); - padding: 30px 30px 20px; -} - -.form-control { - border: 1px solid #ccc; - border-radius: 3px; - box-shadow: none; - margin-bottom: 15px; -} -.form-control:hover, .form-control:focus, .form-control:active { - box-shadow: none; -} -.form-control:focus { - border: 1px solid #34495e; -}*/ - -/*.select2.select2-container { - width: 100% !important; -}*/ - -.select2.select2-container .select2-selection { - border: 1px solid #ccc; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - height: 34px; - margin-bottom: 0px; - outline: none; - transition: all 0.15s ease-in-out; -} - -.select2.select2-container .select2-selection .select2-selection__rendered { - color: #333; - line-height: 32px; - padding-right: 33px; -} - -.select2.select2-container .select2-selection .select2-selection__arrow { - background: #f8f8f8; - border-left: 1px solid #ccc; - -webkit-border-radius: 0 3px 3px 0; - -moz-border-radius: 0 3px 3px 0; - border-radius: 0 3px 3px 0; - height: 32px; - width: 33px; -} - -.select2.select2-container.select2-container--open .select2-selection.select2-selection--single { - background: #f8f8f8; -} - -.select2.select2-container.select2-container--open .select2-selection.select2-selection--single .select2-selection__arrow { - -webkit-border-radius: 0 3px 0 0; - -moz-border-radius: 0 3px 0 0; - border-radius: 0 3px 0 0; -} - -/*.select2.select2-container.select2-container--open .select2-selection.select2-selection--multiple { - border: 1px solid #34495e; -} - -.select2.select2-container.select2-container--focus .select2-selection { - border: 1px solid #34495e; -}*/ - -.select2.select2-container .select2-selection--multiple { - height: auto; - min-height: 34px; -} - -.select2.select2-container .select2-selection--multiple .select2-search--inline .select2-search__field { - margin-top: 0; - height: 32px; -} - -.select2.select2-container .select2-selection--multiple .select2-selection__rendered { - display: block; - padding: 0 4px; - line-height: 29px; -} - -.select2.select2-container .select2-selection--multiple .select2-selection__choice { - background-color: #f8f8f8; - border: 1px solid #ccc; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - margin: 4px 4px 0 0; - padding: 0 6px 0 22px; - height: 24px; - line-height: 24px; - font-size: 12px; - position: relative; -} - -.select2.select2-container .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove { - position: absolute; - top: 0; - left: 0; - height: 22px; - width: 22px; - margin: 0; - text-align: center; - color: #e74c3c; - font-weight: bold; - font-size: 16px; -} - -.select2-container .select2-dropdown { - background: transparent; - border: none; - margin-top: -5px; -} - -.select2-container .select2-dropdown .select2-search { - padding: 0; -} - -.select2-container .select2-dropdown .select2-search input { - outline: none; - border: 1px solid #34495e; - border-bottom: none; - padding: 4px 6px; -} - -.select2-container .select2-dropdown .select2-results { - padding: 0; -} - -.select2-container .select2-dropdown .select2-results ul { - background: #fff; - border: 1px solid #34495e; -} - -.select2-container .select2-dropdown .select2-results ul .select2-results__option--highlighted[aria-selected] { - background-color: #00BBEE; -} - -/* -.big-drop { - width: 600px !important; -} -*/ diff --git a/api/src/main/resources/static/css/login.css b/api/src/main/resources/static/css/login.css deleted file mode 100644 index 065db6be26bbb0322933eea13bcd83d2689e507a..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/login.css +++ /dev/null @@ -1,159 +0,0 @@ -#content-center{ - padding: 6px; - position:absolute; - width:360px; - height:420px; - top:50%; - left:50%; - margin-top:-210px; - margin-left:-180px; - background:white; -} - -.input_control{ - width:320px; - margin:20px auto; -} -.input_text, .button{ - box-sizing: border-box; - text-align:center; - font-size:16px; - height:40px; - border-radius:4px; - border:1px solid #c8cccf; - color:#6a6f77; - -web-kit-appearance:none; - -moz-appearance: none; - display:block; - outline:0; - padding:0 1em; - text-decoration:none; - width:100%; -} - -/** -验证码输入框 - */ -#input_vericode{ - vertical-align: middle; - text-align:center; - font-size:16px; - height:40px; - border-radius:4px; - border:1px solid #c8cccf; - color:#6a6f77; - -web-kit-appearance:none; - -moz-appearance: none; - outline:0; - padding:0 1em; - margin: auto; - text-decoration:none; - width:180px; -} - -.disabled { - opacity: 0.6; - cursor: not-allowed; -} -.button { - color: white; - background-color: skyblue; -} - -.button:active{ - background-color: deepskyblue; - padding: 0; - margin: 0; - opacity: 1; - transition: 0s -} - -/*.button2:hover { - box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19); -}*/ -.input-text:focus{ - border:1px solid #ff7496; -} -::-moz-placeholder { /* Mozilla Firefox 4 to 18 */ - color: #6a6f77; -} -::-moz-placeholder { /* Mozilla Firefox 19+ */ - color: #6a6f77; -} -input::-webkit-input-placeholder{ - color: #6a6f77; -} - -body{background-color: #2D2D2D} - -#mydiv{ - height: 100%; - width: 100%; -} - -#code,#codeimg{ - width:80px; - font-size:16px; - font-style:italic; - color:green; - border:0; - padding:6px; - letter-spacing:3px; - font-weight:bolder; -} - -#codeimg{ - float: right; -} - -h2{ - margin: 0 0 0 30px; - text-align: center; - padding: 0; - font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-weight: lighter; -} -.error{ - color:red; -} - -#qrcode { - width:200px; - height:200px; - text-align:center; - margin:0 auto; -} - -#refreshQrCode{ - visibility: hidden; - text-align:center; -} - -#jumpHint{ - display: none; - margin:0 auto 6px auto;//上右下左 -} - -.hint{ - color:white; - text-align:center; - margin: 0 auto; - border:1px solid #a1a1a1; - padding:6px 6px; - width:200px; - border-radius:25px; - -moz-border-radius:25px; /* 老的 Firefox */ -} - -.success{ - background-color: mediumseagreen; -} - -.warn{ - background-color: red; -} - -.paramInfo{ - text-align:center; - color:red; -} \ No newline at end of file diff --git a/api/src/main/resources/static/css/login/coverr.css b/api/src/main/resources/static/css/login/coverr.css deleted file mode 100644 index c4643ad8e39a6e636bcc630c19c495e5d3fc4cf9..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/login/coverr.css +++ /dev/null @@ -1,51 +0,0 @@ -/** -* -* User: simon -* Date: 2018/06/09 -* Time: 3:14 -**/ -/** -* -* User: simon -* Date: 2018/06/09 -* Time: 3:14 -**/ -.homepage-hero-module { - border-right: none; - border-left: none; - position: relative; -} -.no-video .video-container video, -.touch .video-container video { - display: none; -} -.no-video .video-container .poster, -.touch .video-container .poster { - display: block !important; -} -.video-container { - position: relative; - bottom: 0%; - left: 0%; - height: 100%; - width: 100%; - overflow: hidden; -} -.video-container .poster img { - width: 100%; - bottom: 0; - position: absolute; -} -.video-container .filter { - z-index: 100; - position: absolute; - width: 100%; -} -.video-container video { - position: absolute; - z-index: 0; - bottom: 0; -} -.video-container video.fillWidth { - width: 100%; -} \ No newline at end of file diff --git a/api/src/main/resources/static/css/login/login.css b/api/src/main/resources/static/css/login/login.css deleted file mode 100644 index aa0e69525820c2f842ab81f6995a443c36e03f51..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/login/login.css +++ /dev/null @@ -1,59 +0,0 @@ -/** -* -* User: simon -* Date: 2018/12/26 -* Time: 12:30 -**/ -body { - width: 100%; - height:100%; - overflow:scroll; - overflow-x:hidden; - overflow-y:hidden; -} - -#code,#codeimg{ - width:100%; - font-size:16px; - font-style:italic; - color:green; - border:0; - letter-spacing:3px; - font-weight:bolder; -} - -#qrcode { - width:200px; - height:200px; - text-align:center; - margin:0 auto; -} - -#refreshQrCode{ - visibility: hidden; - text-align:center; -} - -#jumpHint{ - display: none; - margin:0 auto 6px auto;//上右下左 -} - -.hint{ - color:white; - text-align:center; - margin: 0 auto; - border:1px solid #a1a1a1; - padding:6px 6px; - width:200px; - border-radius:25px; - -moz-border-radius:25px; /* 老的 Firefox */ -} - -.success{ - background-color: mediumseagreen; -} - -.warn{ - background-color: red; -} \ No newline at end of file diff --git a/api/src/main/resources/static/css/nth-icons.css b/api/src/main/resources/static/css/nth-icons.css deleted file mode 100644 index f0d325c0dc63f4f4aae546b83ff3f63ac8f2107c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/nth-icons.css +++ /dev/null @@ -1,704 +0,0 @@ - -@font-face { - font-family: "Nth Icons"; - font-style: normal; - font-weight: 400; - src: url(../font/nth-icons.eot?v=.2.3); - src: url(../font/nth-icons.eot?#iefix&v=.2.3) format("embedded-opentype"),url(../font/nth-icons.woff2?v=.2.3) format("woff2"),url(../font/nth-icons.woff?v=.2.3) format("woff"),url(../font/nth-icons.ttf?v=.2.3) format("truetype"),url(../font/nth-icons.svg?v=.2.3#web-icons) format("svg") -} - -[class*=" nth-icon-"],[class^=nth-icon-] { - position: relative; - display: inline-block; - font-family: "Nth Icons"; - font-style: normal; - font-weight: 400; - -webkit-transform: translate(0,0); - -ms-transform: translate(0,0); - -o-transform: translate(0,0); - transform: translate(0,0); - text-rendering: auto; - speak: none; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale -} - -.nth-icon-dashboard:before { - content: "\f101" -} - -.nth-icon-inbox:before { - content: "\f102" -} - -.nth-icon-cloud:before { - content: "\f103" -} - -.nth-icon-bell:before { - content: "\f104" -} - -.nth-icon-book:before { - content: "\f105" -} - -.nth-icon-bookmark:before { - content: "\f106" -} - -.nth-icon-tag:before { - content: "\f107" -} - -.nth-icon-library:before { - content: "\f108" -} - -.nth-icon-share:before { - content: "\f109" -} - -.nth-icon-reply:before { - content: "\f10a" -} - -.nth-icon-refresh:before { - content: "\f10b" -} - -.nth-icon-move:before { - content: "\f10c" -} - -.nth-icon-chat:before { - content: "\f10d" -} - -.nth-icon-chat-working:before { - content: "\f10e" -} - -.nth-icon-chat-text:before { - content: "\f10f" -} - -.nth-icon-chat-group:before { - content: "\f110" -} - -.nth-icon-envelope:before { - content: "\f111" -} - -.nth-icon-envelope-open:before { - content: "\f112" -} - -.nth-icon-user:before { - content: "\f113" -} - -.nth-icon-user-circle:before { - content: "\f114" -} - -.nth-icon-users:before { - content: "\f115" -} - -.nth-icon-user-add:before { - content: "\f116" -} - -.nth-icon-grid-9:before { - content: "\f117" -} - -.nth-icon-grid-4:before { - content: "\f118" -} - -.nth-icon-menu:before { - content: "\f119" -} - -.nth-icon-layout:before { - content: "\f11a" -} - -.nth-icon-fullscreen:before { - content: "\f11b" -} - -.nth-icon-fullscreen-exit:before { - content: "\f11c" -} - -.nth-icon-expand:before { - content: "\f11d" -} - -.nth-icon-contract:before { - content: "\f11e" -} - -.nth-icon-arrow-expand:before { - content: "\f11f" -} - -.nth-icon-arrow-shrink:before { - content: "\f120" -} - -.nth-icon-desktop:before { - content: "\f121" -} - -.nth-icon-mobile:before { - content: "\f122" -} - -.nth-icon-signal:before { - content: "\f123" -} - -.nth-icon-power:before { - content: "\f124" -} - -.nth-icon-more-horizontal:before { - content: "\f125" -} - -.nth-icon-more-vertical:before { - content: "\f126" -} - -.nth-icon-globe:before { - content: "\f127" -} - -.nth-icon-map:before { - content: "\f128" -} - -.nth-icon-flag:before { - content: "\f129" -} - -.nth-icon-pie-chart:before { - content: "\f12a" -} - -.nth-icon-stats-bars:before { - content: "\f12b" -} - -.nth-icon-pluse:before { - content: "\f12c" -} - -.nth-icon-home:before { - content: "\f12d" -} - -.nth-icon-shopping-cart:before { - content: "\f12e" -} - -.nth-icon-payment:before { - content: "\f12f" -} - -.nth-icon-briefcase:before { - content: "\f130" -} - -.nth-icon-search:before { - content: "\f131" -} - -.nth-icon-zoom-in:before { - content: "\f132" -} - -.nth-icon-zoom-out:before { - content: "\f133" -} - -.nth-icon-download:before { - content: "\f134" -} - -.nth-icon-upload:before { - content: "\f135" -} - -.nth-icon-sort-asc:before { - content: "\f136" -} - -.nth-icon-sort-des:before { - content: "\f137" -} - -.nth-icon-graph-up:before { - content: "\f138" -} - -.nth-icon-graph-down:before { - content: "\f139" -} - -.nth-icon-replay:before { - content: "\f13a" -} - -.nth-icon-edit:before { - content: "\f13b" -} - -.nth-icon-pencil:before { - content: "\f13c" -} - -.nth-icon-rubber:before { - content: "\f13d" -} - -.nth-icon-crop:before { - content: "\f13e" -} - -.nth-icon-eye:before { - content: "\f13f" -} - -.nth-icon-eye-close:before { - content: "\f140" -} - -.nth-icon-image:before { - content: "\f141" -} - -.nth-icon-gallery:before { - content: "\f142" -} - -.nth-icon-video:before { - content: "\f143" -} - -.nth-icon-camera:before { - content: "\f144" -} - -.nth-icon-folder:before { - content: "\f145" -} - -.nth-icon-clipboard:before { - content: "\f146" -} - -.nth-icon-order:before { - content: "\f147" -} - -.nth-icon-file:before { - content: "\f148" -} - -.nth-icon-copy:before { - content: "\f149" -} - -.nth-icon-add-file:before { - content: "\f14a" -} - -.nth-icon-print:before { - content: "\f14b" -} - -.nth-icon-calendar:before { - content: "\f14c" -} - -.nth-icon-time:before { - content: "\f14d" -} - -.nth-icon-trash:before { - content: "\f14e" -} - -.nth-icon-plugin:before { - content: "\f14f" -} - -.nth-icon-extension:before { - content: "\f150" -} - -.nth-icon-memory:before { - content: "\f151" -} - -.nth-icon-settings:before { - content: "\f152" -} - -.nth-icon-scissor:before { - content: "\f153" -} - -.nth-icon-wrench:before { - content: "\f154" -} - -.nth-icon-hammer:before { - content: "\f155" -} - -.nth-icon-lock:before { - content: "\f156" -} - -.nth-icon-unlock:before { - content: "\f157" -} - -.nth-icon-volume-low:before { - content: "\f158" -} - -.nth-icon-volume-high:before { - content: "\f159" -} - -.nth-icon-volume-off:before { - content: "\f15a" -} - -.nth-icon-pause:before { - content: "\f15b" -} - -.nth-icon-play:before { - content: "\f15c" -} - -.nth-icon-stop:before { - content: "\f15d" -} - -.nth-icon-musical:before { - content: "\f15e" -} - -.nth-icon-random:before { - content: "\f15f" -} - -.nth-icon-reload:before { - content: "\f160" -} - -.nth-icon-loop:before { - content: "\f161" -} - -.nth-icon-text:before { - content: "\f162" -} - -.nth-icon-bold:before { - content: "\f163" -} - -.nth-icon-italic:before { - content: "\f164" -} - -.nth-icon-underline:before { - content: "\f165" -} - -.nth-icon-format-clear:before { - content: "\f166" -} - -.nth-icon-text-type:before { - content: "\f167" -} - -.nth-icon-table:before { - content: "\f168" -} - -.nth-icon-attach-file:before { - content: "\f169" -} - -.nth-icon-paperclip:before { - content: "\f16a" -} - -.nth-icon-link-intact:before { - content: "\f16b" -} - -.nth-icon-link:before { - content: "\f16c" -} - -.nth-icon-link-broken:before { - content: "\f16d" -} - -.nth-icon-indent-increase:before { - content: "\f16e" -} - -.nth-icon-indent-decrease:before { - content: "\f16f" -} - -.nth-icon-align-justify:before { - content: "\f170" -} - -.nth-icon-align-left:before { - content: "\f171" -} - -.nth-icon-align-center:before { - content: "\f172" -} - -.nth-icon-align-right:before { - content: "\f173" -} - -.nth-icon-list-numbered:before { - content: "\f174" -} - -.nth-icon-list-bulleted:before { - content: "\f175" -} - -.nth-icon-list:before { - content: "\f176" -} - -.nth-icon-emoticon:before { - content: "\f177" -} - -.nth-icon-quote-right:before { - content: "\f178" -} - -.nth-icon-code:before { - content: "\f179" -} - -.nth-icon-code-working:before { - content: "\f17a" -} - -.nth-icon-code-unfold:before { - content: "\f17b" -} - -.nth-icon-chevron-right:before { - content: "\f17c" -} - -.nth-icon-chevron-left:before { - content: "\f17d" -} - -.nth-icon-chevron-left-mini:before { - content: "\f17e" -} - -.nth-icon-chevron-right-mini:before { - content: "\f17f" -} - -.nth-icon-chevron-up:before { - content: "\f180" -} - -.nth-icon-chevron-down:before { - content: "\f181" -} - -.nth-icon-chevron-up-mini:before { - content: "\f182" -} - -.nth-icon-chevron-down-mini:before { - content: "\f183" -} - -.nth-icon-arrow-left:before { - content: "\f184" -} - -.nth-icon-arrow-right:before { - content: "\f185" -} - -.nth-icon-arrow-up:before { - content: "\f186" -} - -.nth-icon-arrow-down:before { - content: "\f187" -} - -.nth-icon-dropdown:before { - content: "\f188" -} - -.nth-icon-dropup:before { - content: "\f189" -} - -.nth-icon-dropright:before { - content: "\f18a" -} - -.nth-icon-dropleft:before { - content: "\f18b" -} - -.nth-icon-sort-vertical:before { - content: "\f18c" -} - -.nth-icon-triangle-left:before { - content: "\f18d" -} - -.nth-icon-triangle-right:before { - content: "\f18e" -} - -.nth-icon-triangle-down:before { - content: "\f18f" -} - -.nth-icon-triangle-up:before { - content: "\f190" -} - -.nth-icon-check-circle:before { - content: "\f191" -} - -.nth-icon-check:before { - content: "\f192" -} - -.nth-icon-check-mini:before { - content: "\f193" -} - -.nth-icon-close:before { - content: "\f194" -} - -.nth-icon-close-mini:before { - content: "\f195" -} - -.nth-icon-plus-circle:before { - content: "\f196" -} - -.nth-icon-plus:before { - content: "\f197" -} - -.nth-icon-minus-circle:before { - content: "\f198" -} - -.nth-icon-minus:before { - content: "\f199" -} - -.nth-icon-alert-circle:before { - content: "\f19a" -} - -.nth-icon-alert:before { - content: "\f19b" -} - -.nth-icon-help-circle:before { - content: "\f19c" -} - -.nth-icon-help:before { - content: "\f19d" -} - -.nth-icon-info-circle:before { - content: "\f19e" -} - -.nth-icon-info:before { - content: "\f19f" -} - -.nth-icon-warning:before { - content: "\f1a0" -} - -.nth-icon-heart:before { - content: "\f1a1" -} - -.nth-icon-heart-outline:before { - content: "\f1a2" -} - -.nth-icon-star:before { - content: "\f1a3" -} - -.nth-icon-star-half:before { - content: "\f1a4" -} - -.nth-icon-star-outline:before { - content: "\f1a5" -} - -.nth-icon-thumb-up:before { - content: "\f1a6" -} - -.nth-icon-thumb-down:before { - content: "\f1a7" -} - -.nth-icon-small-point:before { - content: "\f1a8" -} - -.nth-icon-medium-point:before { - content: "\f1a9" -} - -.nth-icon-large-point:before { - content: "\f1aa" -} diff --git a/api/src/main/resources/static/css/nth-icons.min.css b/api/src/main/resources/static/css/nth-icons.min.css deleted file mode 100644 index bea48b42b6e824cec4b68c07954e7ff586c2d6e0..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/nth-icons.min.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:"Nth Icons";font-style:normal;font-weight:400;src:url(../font/nth-icons.eot?v=.2.3);src:url(../font/nth-icons.eot?#iefix&v=.2.3) format("embedded-opentype"),url(../font/nth-icons.woff2?v=.2.3) format("woff2"),url(../font/nth-icons.woff?v=.2.3) format("woff"),url(../font/nth-icons.ttf?v=.2.3) format("truetype"),url(../font/nth-icons.svg?v=.2.3#web-icons) format("svg");}[class*=" nth-icon-"],[class^=nth-icon-]{position:relative;display:inline-block;font-family:"Nth Icons";font-style:normal;font-weight:400;-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0);text-rendering:auto;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}.nth-icon-dashboard:before{content:"\f101";}.nth-icon-inbox:before{content:"\f102";}.nth-icon-cloud:before{content:"\f103";}.nth-icon-bell:before{content:"\f104";}.nth-icon-book:before{content:"\f105";}.nth-icon-bookmark:before{content:"\f106";}.nth-icon-tag:before{content:"\f107";}.nth-icon-library:before{content:"\f108";}.nth-icon-share:before{content:"\f109";}.nth-icon-reply:before{content:"\f10a";}.nth-icon-refresh:before{content:"\f10b";}.nth-icon-move:before{content:"\f10c";}.nth-icon-chat:before{content:"\f10d";}.nth-icon-chat-working:before{content:"\f10e";}.nth-icon-chat-text:before{content:"\f10f";}.nth-icon-chat-group:before{content:"\f110";}.nth-icon-envelope:before{content:"\f111";}.nth-icon-envelope-open:before{content:"\f112";}.nth-icon-user:before{content:"\f113";}.nth-icon-user-circle:before{content:"\f114";}.nth-icon-users:before{content:"\f115";}.nth-icon-user-add:before{content:"\f116";}.nth-icon-grid-9:before{content:"\f117";}.nth-icon-grid-4:before{content:"\f118";}.nth-icon-menu:before{content:"\f119";}.nth-icon-layout:before{content:"\f11a";}.nth-icon-fullscreen:before{content:"\f11b";}.nth-icon-fullscreen-exit:before{content:"\f11c";}.nth-icon-expand:before{content:"\f11d";}.nth-icon-contract:before{content:"\f11e";}.nth-icon-arrow-expand:before{content:"\f11f";}.nth-icon-arrow-shrink:before{content:"\f120";}.nth-icon-desktop:before{content:"\f121";}.nth-icon-mobile:before{content:"\f122";}.nth-icon-signal:before{content:"\f123";}.nth-icon-power:before{content:"\f124";}.nth-icon-more-horizontal:before{content:"\f125";}.nth-icon-more-vertical:before{content:"\f126";}.nth-icon-globe:before{content:"\f127";}.nth-icon-map:before{content:"\f128";}.nth-icon-flag:before{content:"\f129";}.nth-icon-pie-chart:before{content:"\f12a";}.nth-icon-stats-bars:before{content:"\f12b";}.nth-icon-pluse:before{content:"\f12c";}.nth-icon-home:before{content:"\f12d";}.nth-icon-shopping-cart:before{content:"\f12e";}.nth-icon-payment:before{content:"\f12f";}.nth-icon-briefcase:before{content:"\f130";}.nth-icon-search:before{content:"\f131";}.nth-icon-zoom-in:before{content:"\f132";}.nth-icon-zoom-out:before{content:"\f133";}.nth-icon-download:before{content:"\f134";}.nth-icon-upload:before{content:"\f135";}.nth-icon-sort-asc:before{content:"\f136";}.nth-icon-sort-des:before{content:"\f137";}.nth-icon-graph-up:before{content:"\f138";}.nth-icon-graph-down:before{content:"\f139";}.nth-icon-replay:before{content:"\f13a";}.nth-icon-edit:before{content:"\f13b";}.nth-icon-pencil:before{content:"\f13c";}.nth-icon-rubber:before{content:"\f13d";}.nth-icon-crop:before{content:"\f13e";}.nth-icon-eye:before{content:"\f13f";}.nth-icon-eye-close:before{content:"\f140";}.nth-icon-image:before{content:"\f141";}.nth-icon-gallery:before{content:"\f142";}.nth-icon-video:before{content:"\f143";}.nth-icon-camera:before{content:"\f144";}.nth-icon-folder:before{content:"\f145";}.nth-icon-clipboard:before{content:"\f146";}.nth-icon-order:before{content:"\f147";}.nth-icon-file:before{content:"\f148";}.nth-icon-copy:before{content:"\f149";}.nth-icon-add-file:before{content:"\f14a";}.nth-icon-print:before{content:"\f14b";}.nth-icon-calendar:before{content:"\f14c";}.nth-icon-time:before{content:"\f14d";}.nth-icon-trash:before{content:"\f14e";}.nth-icon-plugin:before{content:"\f14f";}.nth-icon-extension:before{content:"\f150";}.nth-icon-memory:before{content:"\f151";}.nth-icon-settings:before{content:"\f152";}.nth-icon-scissor:before{content:"\f153";}.nth-icon-wrench:before{content:"\f154";}.nth-icon-hammer:before{content:"\f155";}.nth-icon-lock:before{content:"\f156";}.nth-icon-unlock:before{content:"\f157";}.nth-icon-volume-low:before{content:"\f158";}.nth-icon-volume-high:before{content:"\f159";}.nth-icon-volume-off:before{content:"\f15a";}.nth-icon-pause:before{content:"\f15b";}.nth-icon-play:before{content:"\f15c";}.nth-icon-stop:before{content:"\f15d";}.nth-icon-musical:before{content:"\f15e";}.nth-icon-random:before{content:"\f15f";}.nth-icon-reload:before{content:"\f160";}.nth-icon-loop:before{content:"\f161";}.nth-icon-text:before{content:"\f162";}.nth-icon-bold:before{content:"\f163";}.nth-icon-italic:before{content:"\f164";}.nth-icon-underline:before{content:"\f165";}.nth-icon-format-clear:before{content:"\f166";}.nth-icon-text-type:before{content:"\f167";}.nth-icon-table:before{content:"\f168";}.nth-icon-attach-file:before{content:"\f169";}.nth-icon-paperclip:before{content:"\f16a";}.nth-icon-link-intact:before{content:"\f16b";}.nth-icon-link:before{content:"\f16c";}.nth-icon-link-broken:before{content:"\f16d";}.nth-icon-indent-increase:before{content:"\f16e";}.nth-icon-indent-decrease:before{content:"\f16f";}.nth-icon-align-justify:before{content:"\f170";}.nth-icon-align-left:before{content:"\f171";}.nth-icon-align-center:before{content:"\f172";}.nth-icon-align-right:before{content:"\f173";}.nth-icon-list-numbered:before{content:"\f174";}.nth-icon-list-bulleted:before{content:"\f175";}.nth-icon-list:before{content:"\f176";}.nth-icon-emoticon:before{content:"\f177";}.nth-icon-quote-right:before{content:"\f178";}.nth-icon-code:before{content:"\f179";}.nth-icon-code-working:before{content:"\f17a";}.nth-icon-code-unfold:before{content:"\f17b";}.nth-icon-chevron-right:before{content:"\f17c";}.nth-icon-chevron-left:before{content:"\f17d";}.nth-icon-chevron-left-mini:before{content:"\f17e";}.nth-icon-chevron-right-mini:before{content:"\f17f";}.nth-icon-chevron-up:before{content:"\f180";}.nth-icon-chevron-down:before{content:"\f181";}.nth-icon-chevron-up-mini:before{content:"\f182";}.nth-icon-chevron-down-mini:before{content:"\f183";}.nth-icon-arrow-left:before{content:"\f184";}.nth-icon-arrow-right:before{content:"\f185";}.nth-icon-arrow-up:before{content:"\f186";}.nth-icon-arrow-down:before{content:"\f187";}.nth-icon-dropdown:before{content:"\f188";}.nth-icon-dropup:before{content:"\f189";}.nth-icon-dropright:before{content:"\f18a";}.nth-icon-dropleft:before{content:"\f18b";}.nth-icon-sort-vertical:before{content:"\f18c";}.nth-icon-triangle-left:before{content:"\f18d";}.nth-icon-triangle-right:before{content:"\f18e";}.nth-icon-triangle-down:before{content:"\f18f";}.nth-icon-triangle-up:before{content:"\f190";}.nth-icon-check-circle:before{content:"\f191";}.nth-icon-check:before{content:"\f192";}.nth-icon-check-mini:before{content:"\f193";}.nth-icon-close:before{content:"\f194";}.nth-icon-close-mini:before{content:"\f195";}.nth-icon-plus-circle:before{content:"\f196";}.nth-icon-plus:before{content:"\f197";}.nth-icon-minus-circle:before{content:"\f198";}.nth-icon-minus:before{content:"\f199";}.nth-icon-alert-circle:before{content:"\f19a";}.nth-icon-alert:before{content:"\f19b";}.nth-icon-help-circle:before{content:"\f19c";}.nth-icon-help:before{content:"\f19d";}.nth-icon-info-circle:before{content:"\f19e";}.nth-icon-info:before{content:"\f19f";}.nth-icon-warning:before{content:"\f1a0";}.nth-icon-heart:before{content:"\f1a1";}.nth-icon-heart-outline:before{content:"\f1a2";}.nth-icon-star:before{content:"\f1a3";}.nth-icon-star-half:before{content:"\f1a4";}.nth-icon-star-outline:before{content:"\f1a5";}.nth-icon-thumb-up:before{content:"\f1a6";}.nth-icon-thumb-down:before{content:"\f1a7";}.nth-icon-small-point:before{content:"\f1a8";}.nth-icon-medium-point:before{content:"\f1a9";}.nth-icon-large-point:before{content:"\f1aa";} \ No newline at end of file diff --git a/api/src/main/resources/static/css/nth-tabs.css b/api/src/main/resources/static/css/nth-tabs.css deleted file mode 100644 index a074df35da7532c75b355bac518573104a9d0872..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/nth-tabs.css +++ /dev/null @@ -1,275 +0,0 @@ -/** - * nth-tabs - * author:nethuige - * version:2.0 -*/ - -.nth-tabs { - color: #76838f; - font-family: "Helvetica Neue",Helvetica,Tahoma,Arial,"Microsoft Yahei","Hiragino Sans GB","WenQuanYi Micro Hei",sans-serif; - border: 1px solid #E4EAEC !important; -} - -.nth-tabs .page-tabs { - width: 100%; - height: 42px; - background: #fafafa; - line-height: 40px; - position: relative; -} - -.nth-tabs .content-tabs { - width: 100%; - position: relative; - height: 42px; - background: #fafafa; - line-height: 40px; - overflow: hidden; -} - -.nth-tabs .content-tabs-container { - width: 100000px; - margin-left: 40px; - overflow: hidden; - height: 42px; - transition: margin-left 1s; - -moz-transition: margin-left 1s; - -webkit-transition: margin-left 1s; - -o-transition: margin-left 1s; -} -.tab-content{ - overflow-x: auto; - overflow-y: hidden; -} -.nth-tabs,.tab-content,.tab-pane{ - height: 100%; - /*height: calc(100% - 42px);*/ -} -.nth-tabs-content{ - width:100%; - /*height: calc(100% - 42px);*/ - height: 100%; - position: relative; - overflow-x: hidden; - overflow-y: hidden; -} -.nth-tabs-frame{ - width:100%; - /*height: calc(100% - 42px);*/ - height: 100%; - position: relative; - overflow-x: hidden; - overflow-y: hidden; -} - - -/*选项卡操作相关*/ -.nth-tabs .roll-nav { - position: absolute; - width: 40px; - height: 42px; - text-align: center; - color: #999; - background-color: #FFFFFF; - z-index: 2; - top: 0; -} - -.nth-tabs a.roll-nav:hover { - color: #797979 !important; -} - -.nth-tabs a.roll-nav:active,.nth-tabs a.roll-nav:visited { - color: #95A0AA; -} - -.nth-tabs .roll-nav-left { - left: 0; - border-bottom: 1px solid #E4EAEC; -} - -.nth-tabs .roll-nav-right { - right: 40px; - border-bottom: 1px solid #E4EAEC; -} - -.nth-tabs .tab-close { - position: absolute; - top: 13px; - right: 10px; - width: 16px; - height: 16px; - text-align: center; - line-height: 16px; - color: #95A0AA; -} - -.nth-tabs .tab-close:hover { - background-color: #f96868; - border-radius: 16px; - color: #fff; - cursor: pointer; -} - -.nth-tabs .tab-down{ - border-top: 4px solid; - -webkit-transition: .25s; - -o-transition: .25s; - transition: .25s; - -webkit-transform: scale(1.001); - -ms-transform: scale(1.001); - -o-transform: scale(1.001); - transform: scale(1.001); - display: inline-block; - width: 0; - height: 0; - margin-left: 2px; - vertical-align: middle; - border-top: 4px dashed; - border-right: 4px solid transparent; - border-left: 4px solid transparent; -} - -/*tab list*/ -.nth-tabs .right-nav-list { - right: 0; - /*border-left: 1px solid #E4EAEC;*/ - border-bottom: 1px solid #E4EAEC; -} - -.nth-tabs .right-nav-list a { - color: #999; -} - -.nth-tabs .right-nav-list a:hover { - color: #797979; - text-decoration: none; -} - -.tab-list-scrollbar { - max-height: 250px; - max-width: 180px; -} -.dropdown-menu{ - z-index: 99999999 !important; - left: -141px !important; -} - -.dropdown-menu ul { - list-style: none; - margin: 0px; - text-align: left; - padding: 0px; -} - -.dropdown-menu ul li { - line-height: 30px; - padding: 0px 20px; - white-space: nowrap; -} - -.dropdown-menu ul li:hover { - background-color: #ececec; - cursor: pointer; -} - -.scrollbar-outer { - overflow: hidden; -} - - -/*重写tab*/ -.nav-tabs { - background-color: #FFFFFF; - border-bottom: 1px solid #E4EAEC!important; -} - -.nav-tabs a { - color: #76838f; - border-radius: 0; -} - -.nav-tabs>li{ - width:8.1em; -} - -.nav-tabs>li>a { - border-radius: 0; - margin-right: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - padding-right:25px; - padding-left: 10px; - text-align: center; -} - -.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover { - border-top:1px solid transparent; - border-bottom: 1px solid #E4EAEC; - border-left:1px solid #E4EAEC; - border-right:1px solid #E4EAEC; - background-color: #F1F4F5; - color: #76838f; - -webkit-transition-property: background-color,border-bottom; - -webkit-transition-duration: 0.2s; - -webkit-transition-timing-function: ease; - -moz-transition-property: background-color,border-bottom; - -moz-transition-duration: 0.2s; - -moz-transition-timing-function: ease; - -o-transition-property: background-color,border-bottom; - -o-transition-duration: 0.2s; - -o-transition-timing-function: ease; -} - -.nav>li>a:focus, .nav>li>a:hover { - background-color: #F3F7F9; -} - -/*animation*/ - -[class*=animation-] { - -webkit-animation-duration: .5s; - -o-animation-duration: .5s; - animation-duration: .5s; - -webkit-animation-timing-function: ease-out; - -o-animation-timing-function: ease-out; - animation-timing-function: ease-out; -} -.animation-fade { - -webkit-animation-name: fadeIn; - -o-animation-name: fadeIn; - animation-name: fadeIn; - -webkit-animation-duration: .8s; - -o-animation-duration: .8s; - animation-duration: .8s; - -webkit-animation-timing-function: linear; - -o-animation-timing-function: linear; - animation-timing-function: linear; -} - -@-webkit-keyframes fadeIn { - from { - opacity: 0; - } - - to { - opacity: 1; - } -} - -@keyframes fadeIn { - from { - opacity: 0; - } - - to { - opacity: 1; - } -} - -.fadeIn { - -webkit-animation-name: fadeIn; - animation-name: fadeIn; -} - diff --git a/api/src/main/resources/static/css/nth-tabs.min.css b/api/src/main/resources/static/css/nth-tabs.min.css deleted file mode 100644 index fdcc16b8018352ce48feb5d22ee55d392df7515a..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/nth-tabs.min.css +++ /dev/null @@ -1 +0,0 @@ -.nth-tabs{color:#76838f;font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,"Microsoft Yahei","Hiragino Sans GB","WenQuanYi Micro Hei",sans-serif;border:1px solid #E4EAEC!important;}.nth-tabs .page-tabs{width:100%;height:42px;background:#fafafa;line-height:40px;position:relative;}.nth-tabs .content-tabs{width:100%;position:relative;height:42px;background:#fafafa;line-height:40px;overflow:hidden;}.nth-tabs .content-tabs-container{width:100000px;margin-left:40px;overflow:hidden;height:42px;transition:margin-left 1s;-moz-transition:margin-left 1s;-webkit-transition:margin-left 1s;-o-transition:margin-left 1s;}.tab-content{overflow:auto;}.nth-tabs,.tab-content,.tab-pane{height:100%;}.nth-tabs-content{width:100%;height:calc(100% - 42px);position:relative;overflow-x:hidden;}.nth-tabs-frame{width:100%;height:calc(100% - 42px);position:relative;overflow-x:hidden;}.nth-tabs .roll-nav{position:absolute;width:40px;height:42px;text-align:center;color:#999;background-color:#FFF;z-index:2;top:0;}.nth-tabs a.roll-nav:hover{color:#797979!important;}.nth-tabs a.roll-nav:active,.nth-tabs a.roll-nav:visited{color:#95A0AA;}.nth-tabs .roll-nav-left{left:0;border-bottom:1px solid #E4EAEC;}.nth-tabs .roll-nav-right{right:40px;border-bottom:1px solid #E4EAEC;}.nth-tabs .tab-close{position:absolute;top:13px;right:10px;width:16px;height:16px;text-align:center;line-height:16px;color:#95A0AA;}.nth-tabs .tab-close:hover{background-color:#f96868;border-radius:16px;color:#fff;cursor:pointer;}.nth-tabs .tab-down{border-top:4px solid;-webkit-transition:.25s;-o-transition:.25s;transition:.25s;-webkit-transform:scale(1.001);-ms-transform:scale(1.001);-o-transform:scale(1.001);transform:scale(1.001);display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-right:4px solid transparent;border-left:4px solid transparent;}.nth-tabs .right-nav-list{right:0;border-bottom:1px solid #E4EAEC;}.nth-tabs .right-nav-list a{color:#999;}.nth-tabs .right-nav-list a:hover{color:#797979;text-decoration:none;}.tab-list-scrollbar{max-height:250px;max-width:180px;}.dropdown-menu{z-index:99999999!important;left:-141px!important;}.dropdown-menu ul{list-style:none;margin:0;text-align:left;padding:0;}.dropdown-menu ul li{line-height:30px;padding:0 20px;white-space:nowrap;}.dropdown-menu ul li:hover{background-color:#ececec;cursor:pointer;}.scrollbar-outer{overflow:hidden;}.nav-tabs{background-color:#FFF;border-bottom:1px solid #E4EAEC!important;}.nav-tabs a{color:#76838f;border-radius:0;}.nav-tabs>li{width:8.1em;}.nav-tabs>li>a{border-radius:0;margin-right:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-right:25px;padding-left:10px;text-align:center;}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{border-top:1px solid transparent;border-bottom:1px solid #E4EAEC;border-left:1px solid #E4EAEC;border-right:1px solid #E4EAEC;background-color:#F1F4F5;color:#76838f;-webkit-transition-property:background-color,border-bottom;-webkit-transition-duration:.2s;-webkit-transition-timing-function:ease;-moz-transition-property:background-color,border-bottom;-moz-transition-duration:.2s;-moz-transition-timing-function:ease;-o-transition-property:background-color,border-bottom;-o-transition-duration:.2s;-o-transition-timing-function:ease;}.nav>li>a:focus,.nav>li>a:hover{background-color:#F3F7F9;}[class*=animation-]{-webkit-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s;-webkit-animation-timing-function:ease-out;-o-animation-timing-function:ease-out;animation-timing-function:ease-out;}.animation-fade{-webkit-animation-name:fadeIn;-o-animation-name:fadeIn;animation-name:fadeIn;-webkit-animation-duration:.8s;-o-animation-duration:.8s;animation-duration:.8s;-webkit-animation-timing-function:linear;-o-animation-timing-function:linear;animation-timing-function:linear;}@-webkit-keyframes fadeIn{from{opacity:0;}to{opacity:1;}}@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}.fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn;} \ No newline at end of file diff --git a/api/src/main/resources/static/css/patterns/header-profile-skin-1.png b/api/src/main/resources/static/css/patterns/header-profile-skin-1.png deleted file mode 100644 index 41c5c089bbf7ea03e71b19fe86d590d9e5e9f471..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/css/patterns/header-profile-skin-1.png and /dev/null differ diff --git a/api/src/main/resources/static/css/patterns/header-profile-skin-3.png b/api/src/main/resources/static/css/patterns/header-profile-skin-3.png deleted file mode 100644 index 7a80132da83d9390a435359e8e02a6b28ef54996..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/css/patterns/header-profile-skin-3.png and /dev/null differ diff --git a/api/src/main/resources/static/css/patterns/header-profile.png b/api/src/main/resources/static/css/patterns/header-profile.png deleted file mode 100644 index 7dea7f2c76294013243f4956526a0409e82da9d2..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/css/patterns/header-profile.png and /dev/null differ diff --git a/api/src/main/resources/static/css/patterns/shattered.png b/api/src/main/resources/static/css/patterns/shattered.png deleted file mode 100644 index 90ed42b85b7bdc8bd3147b9b21f53d3c57fdac26..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/css/patterns/shattered.png and /dev/null differ diff --git a/api/src/main/resources/static/css/select2.css b/api/src/main/resources/static/css/select2.css deleted file mode 100644 index 527e13a88b9a9abddd02d02f12df9ca39a4ca7ce..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/select2.css +++ /dev/null @@ -1,481 +0,0 @@ -.select2-container { - box-sizing: border-box; - display: inline-block; - margin: 0; - position: relative; - vertical-align: middle; } - .select2-container .select2-selection--single { - box-sizing: border-box; - cursor: pointer; - display: block; - user-select: none; - -webkit-user-select: none; } - .select2-container .select2-selection--single .select2-selection__rendered { - display: block; - padding-left: 8px; - padding-right: 20px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; } - .select2-container .select2-selection--single .select2-selection__clear { - position: relative; } - .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { - padding-right: 8px; - padding-left: 20px; } - .select2-container .select2-selection--multiple { - box-sizing: border-box; - cursor: pointer; - display: block; - min-height: 32px; - user-select: none; - -webkit-user-select: none; } - .select2-container .select2-selection--multiple .select2-selection__rendered { - display: inline-block; - overflow: hidden; - padding-left: 8px; - text-overflow: ellipsis; - white-space: nowrap; } - .select2-container .select2-search--inline { - float: left; } - .select2-container .select2-search--inline .select2-search__field { - box-sizing: border-box; - border: none; - font-size: 100%; - margin-top: 5px; - padding: 0; } - .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button { - -webkit-appearance: none; } - -.select2-dropdown { - background-color: white; - border: 1px solid #aaa; - border-radius: 4px; - box-sizing: border-box; - display: block; - position: absolute; - left: -100000px; - width: 100%; - z-index: 1051; } - -.select2-results { - display: block; } - -.select2-results__options { - list-style: none; - margin: 0; - padding: 0; } - -.select2-results__option { - padding: 6px; - user-select: none; - -webkit-user-select: none; } - .select2-results__option[aria-selected] { - cursor: pointer; } - -.select2-container--open .select2-dropdown { - left: 0; } - -.select2-container--open .select2-dropdown--above { - border-bottom: none; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; } - -.select2-container--open .select2-dropdown--below { - border-top: none; - border-top-left-radius: 0; - border-top-right-radius: 0; } - -.select2-search--dropdown { - display: block; - padding: 4px; } - .select2-search--dropdown .select2-search__field { - padding: 4px; - width: 100%; - box-sizing: border-box; } - .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button { - -webkit-appearance: none; } - .select2-search--dropdown.select2-search--hide { - display: none; } - -.select2-close-mask { - border: 0; - margin: 0; - padding: 0; - display: block; - position: fixed; - left: 0; - top: 0; - min-height: 100%; - min-width: 100%; - height: auto; - width: auto; - opacity: 0; - z-index: 99; - background-color: #fff; - filter: alpha(opacity=0); } - -.select2-hidden-accessible { - border: 0 !important; - clip: rect(0 0 0 0) !important; - height: 1px !important; - margin: -1px !important; - overflow: hidden !important; - padding: 0 !important; - position: absolute !important; - width: 1px !important; } - -.select2-container--default .select2-selection--single { - background-color: #fff; } - .select2-container--default .select2-selection--single .select2-selection__rendered { - color: #444; - line-height: 28px; } - .select2-container--default .select2-selection--single .select2-selection__clear { - cursor: pointer; - float: right; - font-weight: bold; } - .select2-container--default .select2-selection--single .select2-selection__placeholder { - color: #999; } - .select2-container--default .select2-selection--single .select2-selection__arrow { - height: 26px; - position: absolute; - top: 1px; - right: 1px; - width: 20px; } - .select2-container--default .select2-selection--single .select2-selection__arrow b { - border-color: #888 transparent transparent transparent; - border-style: solid; - border-width: 5px 4px 0 4px; - height: 0; - left: 50%; - margin-left: -4px; - margin-top: -2px; - position: absolute; - top: 50%; - width: 0; } - -.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear { - float: left; } - -.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow { - left: 1px; - right: auto; } - -.select2-container--default.select2-container--disabled .select2-selection--single { - background-color: #eee; - cursor: default; } - .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear { - display: none; } - -.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { - border-color: transparent transparent #888 transparent; - border-width: 0 4px 5px 4px; } - -.select2-container--default .select2-selection--multiple { - background-color: white; - border: 1px solid #aaa; - border-radius: 4px; - cursor: text; } - .select2-container--default .select2-selection--multiple .select2-selection__rendered { - box-sizing: border-box; - list-style: none; - margin: 0; - padding: 0 5px; - width: 100%; } - .select2-container--default .select2-selection--multiple .select2-selection__rendered li { - list-style: none; } - .select2-container--default .select2-selection--multiple .select2-selection__placeholder { - color: #999; - margin-top: 5px; - float: left; } - .select2-container--default .select2-selection--multiple .select2-selection__clear { - cursor: pointer; - float: right; - font-weight: bold; - margin-top: 5px; - margin-right: 10px; } - .select2-container--default .select2-selection--multiple .select2-selection__choice { - background-color: #e4e4e4; - border: 1px solid #aaa; - border-radius: 4px; - cursor: default; - float: left; - margin-right: 5px; - margin-top: 5px; - padding: 0 5px; } - .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { - color: #999; - cursor: pointer; - display: inline-block; - font-weight: bold; - margin-right: 2px; } - .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { - color: #333; } - -.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline { - float: right; } - -.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice { - margin-left: 5px; - margin-right: auto; } - -.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { - margin-left: 2px; - margin-right: auto; } - -.select2-container--default.select2-container--focus .select2-selection--multiple { - border: solid black 1px; - outline: 0; } - -.select2-container--default.select2-container--disabled .select2-selection--multiple { - background-color: #eee; - cursor: default; } - -.select2-container--default.select2-container--disabled .select2-selection__choice__remove { - display: none; } - -.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple { - border-top-left-radius: 0; - border-top-right-radius: 0; } - -.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple { - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; } - -.select2-container--default .select2-search--dropdown .select2-search__field { - border: 1px solid #aaa; } - -.select2-container--default .select2-search--inline .select2-search__field { - background: transparent; - border: none; - outline: 0; - box-shadow: none; - -webkit-appearance: textfield; } - -.select2-container--default .select2-results > .select2-results__options { - max-height: 200px; - overflow-y: auto; } - -.select2-container--default .select2-results__option[role=group] { - padding: 0; } - -.select2-container--default .select2-results__option[aria-disabled=true] { - color: #999; } - -.select2-container--default .select2-results__option[aria-selected=true] { - background-color: #ddd; } - -.select2-container--default .select2-results__option .select2-results__option { - padding-left: 1em; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__group { - padding-left: 0; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option { - margin-left: -1em; - padding-left: 2em; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option { - margin-left: -2em; - padding-left: 3em; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { - margin-left: -3em; - padding-left: 4em; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { - margin-left: -4em; - padding-left: 5em; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { - margin-left: -5em; - padding-left: 6em; } - -.select2-container--default .select2-results__option--highlighted[aria-selected] { - background-color: #5897fb; - color: white; } - -.select2-container--default .select2-results__group { - cursor: default; - display: block; - padding: 6px; } - -.select2-container--classic .select2-selection--single { - background-color: #f7f7f7; - border: 1px solid #aaa; - border-radius: 4px; - outline: 0; - background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%); - background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%); - background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); } - .select2-container--classic .select2-selection--single:focus { - border: 1px solid #5897fb; } - .select2-container--classic .select2-selection--single .select2-selection__rendered { - color: #444; - line-height: 28px; } - .select2-container--classic .select2-selection--single .select2-selection__clear { - cursor: pointer; - float: right; - font-weight: bold; - margin-right: 10px; } - .select2-container--classic .select2-selection--single .select2-selection__placeholder { - color: #999; } - .select2-container--classic .select2-selection--single .select2-selection__arrow { - background-color: #ddd; - border: none; - border-left: 1px solid #aaa; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - height: 26px; - position: absolute; - top: 1px; - right: 1px; - width: 20px; - background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%); - background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%); - background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); } - .select2-container--classic .select2-selection--single .select2-selection__arrow b { - border-color: #888 transparent transparent transparent; - border-style: solid; - border-width: 5px 4px 0 4px; - height: 0; - left: 50%; - margin-left: -4px; - margin-top: -2px; - position: absolute; - top: 50%; - width: 0; } - -.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear { - float: left; } - -.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { - border: none; - border-right: 1px solid #aaa; - border-radius: 0; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; - left: 1px; - right: auto; } - -.select2-container--classic.select2-container--open .select2-selection--single { - border: 1px solid #5897fb; } - .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow { - background: transparent; - border: none; } - .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b { - border-color: transparent transparent #888 transparent; - border-width: 0 4px 5px 4px; } - -.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single { - border-top: none; - border-top-left-radius: 0; - border-top-right-radius: 0; - background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%); - background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%); - background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); } - -.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single { - border-bottom: none; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%); - background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%); - background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); } - -.select2-container--classic .select2-selection--multiple { - background-color: white; - border: 1px solid #aaa; - border-radius: 4px; - cursor: text; - outline: 0; } - .select2-container--classic .select2-selection--multiple:focus { - border: 1px solid #5897fb; } - .select2-container--classic .select2-selection--multiple .select2-selection__rendered { - list-style: none; - margin: 0; - padding: 0 5px; } - .select2-container--classic .select2-selection--multiple .select2-selection__clear { - display: none; } - .select2-container--classic .select2-selection--multiple .select2-selection__choice { - background-color: #e4e4e4; - border: 1px solid #aaa; - border-radius: 4px; - cursor: default; - float: left; - margin-right: 5px; - margin-top: 5px; - padding: 0 5px; } - .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove { - color: #888; - cursor: pointer; - display: inline-block; - font-weight: bold; - margin-right: 2px; } - .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover { - color: #555; } - -.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { - float: right; } - -.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { - margin-left: 5px; - margin-right: auto; } - -.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { - margin-left: 2px; - margin-right: auto; } - -.select2-container--classic.select2-container--open .select2-selection--multiple { - border: 1px solid #5897fb; } - -.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple { - border-top: none; - border-top-left-radius: 0; - border-top-right-radius: 0; } - -.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple { - border-bottom: none; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; } - -.select2-container--classic .select2-search--dropdown .select2-search__field { - border: 1px solid #aaa; - outline: 0; } - -.select2-container--classic .select2-search--inline .select2-search__field { - outline: 0; - box-shadow: none; } - -.select2-container--classic .select2-dropdown { - background-color: white; - border: 1px solid transparent; } - -.select2-container--classic .select2-dropdown--above { - border-bottom: none; } - -.select2-container--classic .select2-dropdown--below { - border-top: none; } - -.select2-container--classic .select2-results > .select2-results__options { - max-height: 200px; - overflow-y: auto; } - -.select2-container--classic .select2-results__option[role=group] { - padding: 0; } - -.select2-container--classic .select2-results__option[aria-disabled=true] { - color: grey; } - -.select2-container--classic .select2-results__option--highlighted[aria-selected] { - background-color: #3875d7; - color: white; } - -.select2-container--classic .select2-results__group { - cursor: default; - display: block; - padding: 6px; } - -.select2-container--classic.select2-container--open .select2-dropdown { - border-color: #5897fb; } diff --git a/api/src/main/resources/static/css/style.css b/api/src/main/resources/static/css/style.css deleted file mode 100644 index 5816bbac7a4fcc1dfdfe5910ed27a136e5fb979f..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/style.css +++ /dev/null @@ -1,7368 +0,0 @@ -/* - * - * H+ - 后台主题UI框架 - * version 4.0 - * 修改记录 - * .checkbox-inline input[type=checkbox] 去掉margin-top:-4px - * .checkbox-inline 添加font-size: 14px;默认是13px - * .onoffswitch-inner:before, ; /* height: 16px; 两处 - * - * .file-control { - * color: inherit; - * font-size: 14px; - * add nopadding class - * - * - * -*/ -h1, h2, h3, h4, h5, h6 { - font-weight: 100; -} - -h1 { - font-size: 30px; -} - -h2 { - font-size: 24px; -} - -h3 { - font-size: 16px; -} - -h4 { - font-size: 14px; -} - -h5 { - font-size: 12px; -} - -h6 { - font-size: 10px; -} - -h3, h4, h5 { - margin-top: 5px; - font-weight: 600; -} - -a:focus { - outline: none; -} - -.nav>li>a { - color: #a7b1c2; - font-weight: 600; - padding: 14px 20px 14px 25px; -} - -.nav li>a { - display: block; - /*white-space: nowrap;*/ -} - -.nav.navbar-right>li>a { - color: #999c9e; -} - -.nav>li.active>a { - color: #ffffff; -} - -.navbar-default .nav>li>a:hover, .navbar-default .nav>li>a:focus { - background-color: #293846; - color: white; -} - -.nav .open>a, .nav .open>a:hover, .nav .open>a:focus { - background: #fff; -} - -.nav>li>a i { - margin-right: 6px; -} - -.navbar { - border: 0; -} - -.navbar-default { - background-color: transparent; - border-color: #2f4050; - position: relative; -} - -.navbar-top-links li { - display: inline-block; -} - -.navbar-top-links li:last-child { - margin-right: 30px; -} - -body.body-small .navbar-top-links li:last-child { - margin-right: 10px; -} - -.navbar-top-links li a { - padding: 20px 10px; - min-height: 50px; -} - -.dropdown-menu { - border: medium none; - display: none; - float: left; - font-size: 12px; - left: 0; - list-style: none outside none; - padding: 0; - position: absolute; - text-shadow: none; - top: 100%; - z-index: 1000; - border-radius: 0; - box-shadow: 0 0 3px rgba(86, 96, 117, 0.3); -} - -.dropdown-menu>li>a { - border-radius: 3px; - color: inherit; - line-height: 25px; - margin: 4px; - text-align: left; - font-weight: normal; -} - -.dropdown-menu>li>a.font-bold { - font-weight: 600; -} - -.navbar-top-links .dropdown-menu li { - display: block; -} - -.navbar-top-links .dropdown-menu li:last-child { - margin-right: 0; -} - -.navbar-top-links .dropdown-menu li a { - padding: 3px 20px; - min-height: 0; -} - -.navbar-top-links .dropdown-menu li a div { - white-space: normal; -} - -.navbar-top-links .dropdown-messages, .navbar-top-links .dropdown-tasks, .navbar-top-links .dropdown-alerts { - width: 310px; - min-width: 0; -} - -.navbar-top-links .dropdown-messages { - margin-left: 5px; -} - -.navbar-top-links .dropdown-tasks { - margin-left: -59px; -} - -.navbar-top-links .dropdown-alerts { - margin-left: -123px; -} - -.navbar-top-links .dropdown-user { - right: 0; - left: auto; -} - -.dropdown-messages, .dropdown-alerts { - padding: 10px 10px 10px 10px; -} - -.dropdown-messages li a, .dropdown-alerts li a { - font-size: 12px; -} - -.dropdown-messages li em, .dropdown-alerts li em { - font-size: 10px; -} - -.nav.navbar-top-links .dropdown-alerts a { - font-size: 12px; -} - -.nav-header { - padding: 33px 25px; - background: url("patterns/header-profile.png") no-repeat; -} - -.pace-done .nav-header { - -webkit-transition: all 0.5s; - transition: all 0.5s; -} - -.nav>li.active { - border-left: 4px solid #19aa8d; - background: #293846; -} - -.nav.nav-second-level>li.active { - border: none; -} - -.nav.nav-second-level.collapse[style] { - height: auto !important; -} - -.nav-header a { - color: #DFE4ED; -} - -.nav-header .text-muted { - color: #8095a8; -} - -.minimalize-styl-2 { - padding: 4px 12px; - margin: 14px 5px 5px 20px; - font-size: 14px; - float: left; -} - -.navbar-form-custom { - float: left; - height: 50px; - padding: 0; - width: 200px; - display: inline-table; -} - -.navbar-form-custom .form-group { - margin-bottom: 0; -} - -.nav.navbar-top-links a { - font-size: 14px; -} - -.navbar-form-custom .form-control { - background: none repeat scroll 0 0 rgba(0, 0, 0, 0); - border: medium none; - font-size: 14px; - height: 60px; - margin: 0; - z-index: 2000; -} - -.count-info .label { - line-height: 12px; - padding: 1px 5px; - position: absolute; - right: 6px; - top: 12px; -} - -.arrow { - float: right; - margin-top: 2px; -} - -.fa.arrow:before { - content: "\f104"; -} - -.active>a>.fa.arrow:before { - content: "\f107"; -} - -.nav-second-level li, .nav-third-level li { - border-bottom: none !important; -} - -.nav-second-level li a { - padding: 7px 15px 7px 10px; - padding-left: 52px; -} - -.nav-third-level li a { - padding-left: 62px; -} - -.nav-second-level li:last-child { - margin-bottom: 10px; -} - -body:not(.fixed-sidebar ):not(.canvas-menu ).mini-navbar .nav li:hover>.nav-second-level,.mini-navbar .nav li:focus>.nav-second-level { - display: block; - border-radius: 0 2px 2px 0; - min-width: 140px; - height: auto; -} - -body.mini-navbar .navbar-default .nav>li>.nav-second-level li a { - font-size: 12px; - border-radius: 0 2px 2px 0; -} - -.fixed-nav .slimScrollDiv #side-menu { - padding-bottom: 60px; - position: relative; -} - -.fixed-sidebar.mini-navbar .slimScrollDiv>* { - overflow: visible!important; -} - -.fixed-sidebar .slimScrollDiv>* { - overflow-y: hidden; - overflow-x: visible; -} - -.mini-navbar .nav-second-level li a { - padding: 10px 10px 10px 15px; -} - -.canvas-menu.mini-navbar .nav-second-level { - background: #293846; -} - -.mini-navbar li.active .nav-second-level { - left: 65px; -} - -.navbar-default .special_link a { - background: #1ab394; - color: white; -} - -.navbar-default .special_link a:hover { - background: #17987e !important; - color: white; -} - -.navbar-default .special_link a span.label { - background: #fff; - color: #1ab394; -} - -.navbar-default .landing_link a { - background: #1cc09f; - color: white; -} - -.navbar-default .landing_link a:hover { - background: #1ab394 !important; - color: white; -} - -.navbar-default .landing_link a span.label { - background: #fff; - color: #1cc09f; -} - -.logo-element { - text-align: center; - font-size: 18px; - font-weight: 600; - color: white; - display: none; - padding: 18px 0; -} - -.pace-done .navbar-static-side, .pace-done .nav-header, .pace-done li.active, .pace-done #page-wrapper, .pace-done .footer { - -webkit-transition: all 0.5s; - transition: all 0.5s; -} - -.navbar-fixed-top { - background: #fff; - -webkit-transition-duration: 0.5s; - transition-duration: 0.5s; - z-index: 2030; -} - -.navbar-fixed-top, .navbar-static-top { - background: #f3f3f4; -} - -.fixed-nav #wrapper { - padding-top: 60px; - box-sizing: border-box; -} - -.fixed-nav .minimalize-styl-2 { - margin: 14px 5px 5px 15px; -} - -.body-small .navbar-fixed-top { - margin-left: 0px; -} - -body.mini-navbar .navbar-static-side { - width: 70px; -} - -body.mini-navbar .profile-element, body.mini-navbar .nav-label, body.mini-navbar .navbar-default .nav li a span { - display: none; -} - -body.canvas-menu .profile-element { - display: block; -} - -body:not(.fixed-sidebar ):not(.canvas-menu ).mini-navbar .nav-second-level { - display: none; -} - -body.mini-navbar .navbar-default .nav>li>a { - font-size: 16px; -} - -body.mini-navbar .logo-element { - display: block; -} - -body.canvas-menu .logo-element { - display: none; -} - -body.mini-navbar .nav-header { - padding: 0; - background-color: #1ab394; -} - -body.canvas-menu .nav-header { - padding: 33px 25px; -} - -body.mini-navbar #page-wrapper { - margin: 0 0 0 70px; -} - -body.canvas-menu.mini-navbar #page-wrapper, body.canvas-menu.mini-navbar .footer { - margin: 0 0 0 0; -} - -body.fixed-sidebar .navbar-static-side, body.canvas-menu .navbar-static-side { - position: fixed; - width: 220px; - z-index: 2001; - height: 100%; -} - -body.fixed-sidebar.mini-navbar .navbar-static-side { - width: 70px; -} - -body.fixed-sidebar.mini-navbar #page-wrapper { - margin: 0 0 0 70px; -} - -body.body-small.fixed-sidebar.mini-navbar #page-wrapper { - margin: 0 0 0 70px; -} - -body.body-small.fixed-sidebar.mini-navbar .navbar-static-side { - width: 70px; -} - -.fixed-sidebar.mini-navbar .nav li>.nav-second-level { - display: none; -} - -.fixed-sidebar.mini-navbar .nav li.active { - border-left-width: 0; -} -/*.fixed-sidebar.mini-navbar .nav li:hover>.nav-second-level, .canvas-menu.mini-navbar .nav li:hover>.nav-second-level*/ -/*{*/ -/*position: absolute;*/ -/*left: 70px;*/ -/*top: 40px;*/ -/*background-color: #2f4050;*/ -/*padding: 10px 10px 0 10px;*/ -/*font-size: 12px;*/ -/*display: block;*/ -/*min-width: 140px;*/ -/*border-radius: 2px;*/ -/*}*/ - -/*伸缩菜单*/ -.fixed-sidebar.mini-navbar .nav li:hover>a> span.nav-label { - top: 0px; - padding: 10px 10px 10px 10px; - text-align: center; - background-color: #243747; - border-bottom: dashed 1px #fff; -} - -.fixed-sidebar.mini-navbar .nav li:hover>.nav-second-level { - top: 40px; - font-size: 12px; - /*padding: 10px 10px 0 10px;*/ - background-color: #2f4050; -} - -.fixed-sidebar.mini-navbar .nav li:hover>.nav-second-level, .fixed-sidebar.mini-navbar .nav li:hover>a> span.nav-label { - position: absolute; - left: 70px; - display: block; - min-width: 140px; - border-radius: 2px; -} -/*伸缩菜单结束*/ - -body.fixed-sidebar.mini-navbar .navbar-default .nav>li>.nav-second-level li a { - font-size: 12px; - border-radius: 3px; -} - -body.canvas-menu.mini-navbar .navbar-default .nav>li>.nav-second-level li a { - font-size: 13px; - border-radius: 3px; -} - -.fixed-sidebar.mini-navbar .nav-second-level li a, .canvas-menu.mini-navbar .nav-second-level li a { - padding: 10px 10px 10px 15px; -} - -.fixed-sidebar.mini-navbar .nav-second-level, .canvas-menu.mini-navbar .nav-second-level { - position: relative; - padding: 0; - font-size: 13px; -} - -.fixed-sidebar.mini-navbar li.active .nav-second-level, .canvas-menu.mini-navbar li.active .nav-second-level { - left: 0px; -} - -body.canvas-menu nav.navbar-static-side { - z-index: 2001; - background: #2f4050; - height: 100%; - position: fixed; - display: none; -} - -body.canvas-menu.mini-navbar nav.navbar-static-side { - display: block; - width: 70px; -} - -.top-navigation #page-wrapper { - margin-left: 0; -} - -.top-navigation .navbar-nav .dropdown-menu>.active>a { - background: white; - color: #1ab394; - font-weight: bold; -} - -.white-bg .navbar-fixed-top, .white-bg .navbar-static-top { - background: #fff; -} - -.top-navigation .navbar { - margin-bottom: 0; -} - -.top-navigation .nav>li>a { - padding: 15px 20px; - color: #676a6c; -} - -.top-navigation .nav>li a:hover, .top-navigation .nav>li a:focus { - background: #fff; - color: #1ab394; -} - -.top-navigation .nav>li.active { - background: #fff; - border: none; -} - -.top-navigation .nav>li.active>a { - color: #1ab394; -} - -.top-navigation .navbar-right { - padding-right: 10px; -} - -.top-navigation .navbar-nav .dropdown-menu { - box-shadow: none; - border: 1px solid #e7eaec; -} - -.top-navigation .dropdown-menu>li>a { - margin: 0; - padding: 7px 20px; -} - -.navbar .dropdown-menu { - margin-top: 0px; -} - -.top-navigation .navbar-brand { - background: #1ab394; - color: #fff; - padding: 15px 25px; -} - -.top-navigation .navbar-top-links li:last-child { - margin-right: 0; -} - -.top-navigation.mini-navbar #page-wrapper, .top-navigation.body-small.fixed-sidebar.mini-navbar #page-wrapper, .mini-navbar .top-navigation #page-wrapper, .body-small.fixed-sidebar.mini-navbar .top-navigation #page-wrapper, .canvas-menu #page-wrapper { - margin: 0; -} - -.top-navigation.fixed-nav #wrapper, .fixed-nav #wrapper.top-navigation { - margin-top: 50px; -} - -.top-navigation .footer.fixed { - margin-left: 0 !important; -} - -.top-navigation .wrapper.wrapper-content { - padding: 40px; -} - -.top-navigation.body-small .wrapper.wrapper-content, .body-small .top-navigation .wrapper.wrapper-content { - padding: 40px 0px 40px 0px; -} - -.navbar-toggle { - background-color: #1ab394; - color: #fff; - padding: 6px 12px; - font-size: 14px; -} - -.top-navigation .navbar-nav .open .dropdown-menu>li>a, .top-navigation .navbar-nav .open .dropdown-menu .dropdown-header { - padding: 10px 15px 10px 20px; -} - -@media ( max-width : 768px) { - .top-navigation .navbar-header { - display: block; - float: none; - } -} - -.menu-visible-lg, .menu-visible-md { - display: none !important; -} - -@media ( min-width : 1200px) { - .menu-visible-lg { - display: block !important; - } -} - -@media ( min-width : 992px) { - .menu-visible-md { - display: block !important; - } -} - -@media ( max-width : 767px) { - .menu-visible-md { - display: block !important; - } - - .menu-visible-lg { - display: block !important; - } -} - -.btn { - border-radius: 3px; -} - -.float-e-margins .btn { - margin-bottom: 5px; -} - -.btn-w-m { - min-width: 120px; -} - -.btn-primary.btn-outline { - color: #1ab394; -} - -.btn-success.btn-outline { - color: #1c84c6; -} - -.btn-info.btn-outline { - color: #23c6c8; -} - -.btn-warning.btn-outline { - color: #f8ac59; -} - -.btn-danger.btn-outline { - color: #ed5565; -} - -.btn-primary.btn-outline:hover, .btn-success.btn-outline:hover, .btn-info.btn-outline:hover, .btn-warning.btn-outline:hover, .btn-danger.btn-outline:hover { - color: #fff; -} - -.btn-primary { - background-color: #1ab394; - border-color: #1ab394; - color: #FFFFFF; -} - -.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { - background-color: #18a689; - border-color: #18a689; - color: #FFFFFF; -} - -.btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { - background-image: none; -} - -.btn-primary.disabled, .btn-primary.disabled:hover, .btn-primary.disabled:focus, .btn-primary.disabled:active, .btn-primary.disabled.active, .btn-primary[disabled], .btn-primary[disabled]:hover, .btn-primary[disabled]:focus, .btn-primary[disabled]:active, .btn-primary.active[disabled], fieldset[disabled] .btn-primary, fieldset[disabled] .btn-primary:hover, fieldset[disabled] .btn-primary:focus, fieldset[disabled] .btn-primary:active, fieldset[disabled] .btn-primary.active { - background-color: #1dc5a3; - border-color: #1dc5a3; -} - -.btn-success { - background-color: #1c84c6; - border-color: #1c84c6; - color: #FFFFFF; -} - -.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success { - background-color: #1a7bb9; - border-color: #1a7bb9; - color: #FFFFFF; -} - -.btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success { - background-image: none; -} - -.btn-success.disabled, .btn-success.disabled:hover, .btn-success.disabled:focus, .btn-success.disabled:active, .btn-success.disabled.active, .btn-success[disabled], .btn-success[disabled]:hover, .btn-success[disabled]:focus, .btn-success[disabled]:active, .btn-success.active[disabled], fieldset[disabled] .btn-success, fieldset[disabled] .btn-success:hover, fieldset[disabled] .btn-success:focus, fieldset[disabled] .btn-success:active, fieldset[disabled] .btn-success.active { - background-color: #1f90d8; - border-color: #1f90d8; -} - -.btn-info { - background-color: #23c6c8; - border-color: #23c6c8; - color: #FFFFFF; -} - -.btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .open .dropdown-toggle.btn-info { - background-color: #21b9bb; - border-color: #21b9bb; - color: #FFFFFF; -} - -.btn-info:active, .btn-info.active, .open .dropdown-toggle.btn-info { - background-image: none; -} - -.btn-info.disabled, .btn-info.disabled:hover, .btn-info.disabled:focus, .btn-info.disabled:active, .btn-info.disabled.active, .btn-info[disabled], .btn-info[disabled]:hover, .btn-info[disabled]:focus, .btn-info[disabled]:active, .btn-info.active[disabled], fieldset[disabled] .btn-info, fieldset[disabled] .btn-info:hover, fieldset[disabled] .btn-info:focus, fieldset[disabled] .btn-info:active, fieldset[disabled] .btn-info.active { - background-color: #26d7d9; - border-color: #26d7d9; -} - -.btn-default { - background-color: #c2c2c2; - border-color: #c2c2c2; - color: #FFFFFF; -} - -.btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active, .open .dropdown-toggle.btn-default { - background-color: #bababa; - border-color: #bababa; - color: #FFFFFF; -} - -.btn-default:active, .btn-default.active, .open .dropdown-toggle.btn-default { - background-image: none; -} - -.btn-default.disabled, .btn-default.disabled:hover, .btn-default.disabled:focus, .btn-default.disabled:active, .btn-default.disabled.active, .btn-default[disabled], .btn-default[disabled]:hover, .btn-default[disabled]:focus, .btn-default[disabled]:active, .btn-default.active[disabled], fieldset[disabled] .btn-default, fieldset[disabled] .btn-default:hover, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default.active { - background-color: #cccccc; - border-color: #cccccc; -} - -.btn-warning { - background-color: #f8ac59; - border-color: #f8ac59; - color: #FFFFFF; -} - -.btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .open .dropdown-toggle.btn-warning { - background-color: #f7a54a; - border-color: #f7a54a; - color: #FFFFFF; -} - -.btn-warning:active, .btn-warning.active, .open .dropdown-toggle.btn-warning { - background-image: none; -} - -.btn-warning.disabled, .btn-warning.disabled:hover, .btn-warning.disabled:focus, .btn-warning.disabled:active, .btn-warning.disabled.active, .btn-warning[disabled], .btn-warning[disabled]:hover, .btn-warning[disabled]:focus, .btn-warning[disabled]:active, .btn-warning.active[disabled], fieldset[disabled] .btn-warning, fieldset[disabled] .btn-warning:hover, fieldset[disabled] .btn-warning:focus, fieldset[disabled] .btn-warning:active, fieldset[disabled] .btn-warning.active { - background-color: #f9b66d; - border-color: #f9b66d; -} - -.btn-danger { - background-color: #ed5565; - border-color: #ed5565; - color: #FFFFFF; -} - -.btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .open .dropdown-toggle.btn-danger { - background-color: #ec4758; - border-color: #ec4758; - color: #FFFFFF; -} - -.btn-danger:active, .btn-danger.active, .open .dropdown-toggle.btn-danger { - background-image: none; -} - -.btn-danger.disabled, .btn-danger.disabled:hover, .btn-danger.disabled:focus, .btn-danger.disabled:active, .btn-danger.disabled.active, .btn-danger[disabled], .btn-danger[disabled]:hover, .btn-danger[disabled]:focus, .btn-danger[disabled]:active, .btn-danger.active[disabled], fieldset[disabled] .btn-danger, fieldset[disabled] .btn-danger:hover, fieldset[disabled] .btn-danger:focus, fieldset[disabled] .btn-danger:active, fieldset[disabled] .btn-danger.active { - background-color: #ef6776; - border-color: #ef6776; -} - -.btn-link { - color: inherit; -} - -.btn-link:hover, .btn-link:focus, .btn-link:active, .btn-link.active, .open .dropdown-toggle.btn-link { - color: #1ab394; - text-decoration: none; -} - -.btn-link:active, .btn-link.active, .open .dropdown-toggle.btn-link { - background-image: none; -} - -.btn-link.disabled, .btn-link.disabled:hover, .btn-link.disabled:focus, .btn-link.disabled:active, .btn-link.disabled.active, .btn-link[disabled], .btn-link[disabled]:hover, .btn-link[disabled]:focus, .btn-link[disabled]:active, .btn-link.active[disabled], fieldset[disabled] .btn-link, fieldset[disabled] .btn-link:hover, fieldset[disabled] .btn-link:focus, fieldset[disabled] .btn-link:active, fieldset[disabled] .btn-link.active { - color: #cacaca; -} - -.btn-white { - color: inherit; - background: white; - border: 1px solid #e7eaec; -} - -.btn-white:hover, .btn-white:focus, .btn-white:active, .btn-white.active, .open .dropdown-toggle.btn-white { - color: inherit; - border: 1px solid #d2d2d2; -} - -.btn-white:active, .btn-white.active { - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) inset; -} - -.btn-white:active, .btn-white.active, .open .dropdown-toggle.btn-white { - background-image: none; -} - -.btn-white.disabled, .btn-white.disabled:hover, .btn-white.disabled:focus, .btn-white.disabled:active, .btn-white.disabled.active, .btn-white[disabled], .btn-white[disabled]:hover, .btn-white[disabled]:focus, .btn-white[disabled]:active, .btn-white.active[disabled], fieldset[disabled] .btn-white, fieldset[disabled] .btn-white:hover, fieldset[disabled] .btn-white:focus, fieldset[disabled] .btn-white:active, fieldset[disabled] .btn-white.active { - color: #cacaca; -} - -.form-control, .form-control:focus, .has-error .form-control:focus, .has-success .form-control:focus, .has-warning .form-control:focus, .navbar-collapse, .navbar-form, .navbar-form-custom .form-control:focus, .navbar-form-custom .form-control:hover, .open .btn.dropdown-toggle, .panel, .popover, .progress, .progress-bar { - box-shadow: none; -} - -.btn-outline { - color: inherit; - background-color: transparent; - -webkit-transition: all .5s; - transition: all .5s; -} - -.btn-rounded { - border-radius: 50px; -} - -.btn-large-dim { - width: 90px; - height: 90px; - font-size: 42px; -} - -button.dim { - display: inline-block; - color: #fff; - text-decoration: none; - text-transform: uppercase; - text-align: center; - padding-top: 6px; - margin-right: 10px; - position: relative; - cursor: pointer; - border-radius: 5px; - font-weight: 600; - margin-bottom: 20px !important; -} - -button.dim:active { - top: 3px; -} - -button.btn-primary.dim { - box-shadow: inset 0px 0px 0px #16987e, 0px 5px 0px 0px #16987e, 0px 10px 5px #999999; -} - -button.btn-primary.dim:active { - box-shadow: inset 0px 0px 0px #16987e, 0px 2px 0px 0px #16987e, 0px 5px 3px #999999; -} - -button.btn-default.dim { - box-shadow: inset 0px 0px 0px #b3b3b3, 0px 5px 0px 0px #b3b3b3, 0px 10px 5px #999999; -} - -button.btn-default.dim:active { - box-shadow: inset 0px 0px 0px #b3b3b3, 0px 2px 0px 0px #b3b3b3, 0px 5px 3px #999999; -} - -button.btn-warning.dim { - box-shadow: inset 0px 0px 0px #f79d3c, 0px 5px 0px 0px #f79d3c, 0px 10px 5px #999999; -} - -button.btn-warning.dim:active { - box-shadow: inset 0px 0px 0px #f79d3c, 0px 2px 0px 0px #f79d3c, 0px 5px 3px #999999; -} - -button.btn-info.dim { - box-shadow: inset 0px 0px 0px #1eacae, 0px 5px 0px 0px #1eacae, 0px 10px 5px #999999; -} - -button.btn-info.dim:active { - box-shadow: inset 0px 0px 0px #1eacae, 0px 2px 0px 0px #1eacae, 0px 5px 3px #999999; -} - -button.btn-success.dim { - box-shadow: inset 0px 0px 0px #1872ab, 0px 5px 0px 0px #1872ab, 0px 10px 5px #999999; -} - -button.btn-success.dim:active { - box-shadow: inset 0px 0px 0px #1872ab, 0px 2px 0px 0px #1872ab, 0px 5px 3px #999999; -} - -button.btn-danger.dim { - box-shadow: inset 0px 0px 0px #ea394c, 0px 5px 0px 0px #ea394c, 0px 10px 5px #999999; -} - -button.btn-danger.dim:active { - box-shadow: inset 0px 0px 0px #ea394c, 0px 2px 0px 0px #ea394c, 0px 5px 3px #999999; -} - -button.dim:before { - font-size: 50px; - line-height: 1em; - font-weight: normal; - color: #fff; - display: block; - padding-top: 10px; -} - -button.dim:active:before { - top: 7px; - font-size: 50px; -} - -.label { - background-color: #d1dade; - color: #5e5e5e; - font-size: 10px; - font-weight: 600; - padding: 3px 8px; - text-shadow: none; -} - -.badge { - background-color: #d1dade; - color: #5e5e5e; - font-size: 11px; - font-weight: 600; - padding-bottom: 4px; - padding-left: 6px; - padding-right: 6px; - text-shadow: none; -} - -.label-primary, .badge-primary { - background-color: #1ab394; - color: #FFFFFF; -} - -.label-success, .badge-success { - background-color: #1c84c6; - color: #FFFFFF; -} - -.label-warning, .badge-warning { - background-color: #f8ac59; - color: #FFFFFF; -} - -.label-warning-light, .badge-warning-light { - background-color: #f8ac59; - color: #ffffff; -} - -.label-danger, .badge-danger { - background-color: #ed5565; - color: #FFFFFF; -} - -.label-info, .badge-info { - background-color: #23c6c8; - color: #FFFFFF; -} - -.label-inverse, .badge-inverse { - background-color: #262626; - color: #FFFFFF; -} - -.label-white, .badge-white { - background-color: #FFFFFF; - color: #5E5E5E; -} - -.label-white, .badge-disable { - background-color: #2A2E36; - color: #8B91A0; -} -/* TOOGLE SWICH */ -.onoffswitch { - position: relative; - width: 64px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; -} - -.onoffswitch-checkbox { - display: none; -} - -.onoffswitch-label { - display: block; - overflow: hidden; - cursor: pointer; - border: 2px solid #1ab394; - border-radius: 2px; -} - -.onoffswitch-inner { - width: 200%; - margin-left: -100%; - -webkit-transition: margin 0.3s ease-in 0s; - transition: margin 0.3s ease-in 0s; -} - -.onoffswitch-inner:before, .onoffswitch-inner:after { - float: left; - width: 50%; - height: 20px; - padding: 0; - line-height: 20px; - font-size: 12px; - color: white; - font-family: Trebuchet, Arial, sans-serif; - font-weight: bold; - box-sizing: border-box; -} - -.onoffswitch-inner:before { - content: "ON"; - padding-left: 10px; - background-color: #1ab394; - color: #FFFFFF; -} - -.onoffswitch-inner:after { - content: "OFF"; - padding-right: 10px; - background-color: #FFFFFF; - color: #999999; - text-align: right; -} - -.onoffswitch-switch { - width: 20px; - margin: 0px; - background: #FFFFFF; - border: 2px solid #1ab394; - border-radius: 2px; - position: absolute; - top: 0; - bottom: 0; - right: 44px; - -webkit-transition: all 0.3s ease-in 0s; - transition: all 0.3s ease-in 0s; -} - -.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner { - margin-left: 0; -} - -.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch { - right: 0px; -} -/* CHOSEN PLUGIN */ -.chosen-container-single .chosen-single { - background: #ffffff; - box-shadow: none; - -moz-box-sizing: border-box; - background-color: #FFFFFF; - border: 1px solid #CBD5DD; - border-radius: 2px; - cursor: text; - height: auto !important; - margin: 0; - min-height: 30px; - overflow: hidden; - padding: 4px 12px; - position: relative; - width: 100%; -} - -.chosen-container-multi .chosen-choices li.search-choice { - background: #f1f1f1; - border: 1px solid #ededed; - border-radius: 2px; - box-shadow: none; - color: #333333; - cursor: default; - line-height: 13px; - margin: 3px 0 3px 5px; - padding: 3px 20px 3px 5px; - position: relative; -} -/* PAGINATIN */ -.pagination>.active>a, .pagination>.active>span, .pagination>.active>a:hover, .pagination>.active>span:hover, .pagination>.active>a:focus, .pagination>.active>span:focus { - background-color: #f4f4f4; - border-color: #DDDDDD; - color: inherit; - cursor: default; - z-index: 2; -} - -.pagination>li>a, .pagination>li>span { - background-color: #FFFFFF; - border: 1px solid #DDDDDD; - color: inherit; - float: left; - line-height: 1.42857; - margin-left: -1px; - padding: 4px 10px; - position: relative; - text-decoration: none; -} -/* TOOLTIPS */ -.tooltip-inner { - background-color: #2F4050; -} - -.tooltip.top .tooltip-arrow { - border-top-color: #2F4050; -} - -.tooltip.right .tooltip-arrow { - border-right-color: #2F4050; -} - -.tooltip.bottom .tooltip-arrow { - border-bottom-color: #2F4050; -} - -.tooltip.left .tooltip-arrow { - border-left-color: #2F4050; -} -/* EASY PIE CHART*/ -.easypiechart { - position: relative; - text-align: center; -} - -.easypiechart .h2 { - margin-left: 10px; - margin-top: 10px; - display: inline-block; -} - -.easypiechart canvas { - top: 0; - left: 0; -} - -.easypiechart .easypie-text { - line-height: 1; - position: absolute; - top: 33px; - width: 100%; - z-index: 1; -} - -.easypiechart img { - margin-top: -4px; -} - -.jqstooltip { - box-sizing: content-box; -} -/* FULLCALENDAR */ -.fc-state-default { - background-color: #ffffff; - background-image: none; - background-repeat: repeat-x; - box-shadow: none; - color: #333333; - text-shadow: none; -} - -.fc-state-default { - border: 1px solid; -} - -.fc-button { - color: inherit; - border: 1px solid #e7eaec; - cursor: pointer; - display: inline-block; - height: 1.9em; - line-height: 1.9em; - overflow: hidden; - padding: 0 0.6em; - position: relative; - white-space: nowrap; -} - -.fc-state-active { - background-color: #1ab394; - border-color: #1ab394; - color: #ffffff; -} - -.fc-header-title h2 { - font-size: 16px; - font-weight: 600; - color: inherit; -} - -.fc-content .fc-widget-header, .fc-content .fc-widget-content { - border-color: #e7eaec; - font-weight: normal; -} - -.fc-border-separate tbody { - background-color: #F8F8F8; -} - -.fc-state-highlight { - background: none repeat scroll 0 0 #FCF8E3; -} - -.external-event { - padding: 5px 10px; - border-radius: 2px; - cursor: pointer; - margin-bottom: 5px; -} - -.fc-ltr .fc-event-hori.fc-event-end, .fc-rtl .fc-event-hori.fc-event-start { - border-radius: 2px; -} - -.fc-event, .fc-agenda .fc-event-time, .fc-event a { - padding: 4px 6px; - background-color: #1ab394; - /* background color */ - border-color: #1ab394; - /* border color */ -} - -.fc-event-time, .fc-event-title { - color: #717171; - padding: 0 1px; -} - -.ui-calendar .fc-event-time, .ui-calendar .fc-event-title { - color: #fff; -} -/* Chat */ -.chat-activity-list .chat-element { - border-bottom: 1px solid #e7eaec; -} - -.chat-element:first-child { - margin-top: 0; -} - -.chat-element { - padding-bottom: 15px; -} - -.chat-element, .chat-element .media { - margin-top: 15px; -} - -.chat-element, .media-body { - overflow: hidden; -} - -.media-body { - display: block; - width: auto; -} - -.chat-element>.pull-left { - margin-right: 10px; -} - -.chat-element img.img-circle, .dropdown-messages-box img.img-circle { - width: 38px; - height: 38px; -} - -.chat-element .well { - border: 1px solid #e7eaec; - box-shadow: none; - margin-top: 10px; - margin-bottom: 5px; - padding: 10px 20px; - font-size: 11px; - line-height: 16px; -} - -.chat-element .actions { - margin-top: 10px; -} - -.chat-element .photos { - margin: 10px 0; -} - -.right.chat-element>.pull-right { - margin-left: 10px; -} - -.chat-photo { - max-height: 180px; - border-radius: 4px; - overflow: hidden; - margin-right: 10px; - margin-bottom: 10px; -} - -.chat { - margin: 0; - padding: 0; - list-style: none; -} - -.chat li { - margin-bottom: 10px; - padding-bottom: 5px; - border-bottom: 1px dotted #B3A9A9; -} - -.chat li.left .chat-body { - margin-left: 60px; -} - -.chat li.right .chat-body { - margin-right: 60px; -} - -.chat li .chat-body p { - margin: 0; - color: #777777; -} - -.panel .slidedown .glyphicon, .chat .glyphicon { - margin-right: 5px; -} - -.chat-panel .panel-body { - height: 350px; - overflow-y: scroll; -} -/* LIST GROUP */ -a.list-group-item.active, a.list-group-item.active:hover, a.list-group-item.active:focus { - background-color: #1ab394; - border-color: #1ab394; - color: #FFFFFF; - z-index: 2; -} - -.list-group-item-heading { - margin-top: 10px; -} - -.list-group-item-text { - margin: 0 0 10px; - color: inherit; - font-size: 12px; - line-height: inherit; -} - -.no-padding .list-group-item { - border-left: none; - border-right: none; - border-bottom: none; -} - -.no-padding .list-group-item:first-child { - border-left: none; - border-right: none; - border-bottom: none; - border-top: none; -} - -.no-padding .list-group { - margin-bottom: 0; -} - -.list-group-item { - background-color: inherit; - border: 1px solid #e7eaec; - display: block; - margin-bottom: -1px; - padding: 10px 15px; - position: relative; -} - -.elements-list .list-group-item { - border-left: none; - border-right: none; - /*border-top: none;*/ - padding: 15px 25px; -} - -.elements-list .list-group-item:first-child { - border-left: none; - border-right: none; - border-top: none !important; -} - -.elements-list .list-group { - margin-bottom: 0; -} - -.elements-list a { - color: inherit; -} - -.elements-list .list-group-item.active, .elements-list .list-group-item:hover { - background: #f3f3f4; - color: inherit; - border-color: #e7eaec; - /*border-bottom: 1px solid #e7eaec;*/ - /*border-top: 1px solid #e7eaec;*/ - border-radius: 0; -} - -.elements-list li.active { - -webkit-transition: none; - transition: none; -} - -.element-detail-box { - padding: 25px; -} -/* FLOT CHART */ -.flot-chart { - display: block; - height: 200px; -} - -.widget .flot-chart.dashboard-chart { - display: block; - height: 120px; - margin-top: 40px; -} - -.flot-chart.dashboard-chart { - display: block; - height: 180px; - margin-top: 40px; -} - -.flot-chart-content { - width: 100%; - height: 100%; -} - -.flot-chart-pie-content { - width: 200px; - height: 200px; - margin: auto; -} - -.jqstooltip { - position: absolute; - display: block; - left: 0px; - top: 0px; - visibility: hidden; - background: #2b303a; - background-color: rgba(43, 48, 58, 0.8); - color: white; - text-align: left; - white-space: nowrap; - z-index: 10000; - padding: 5px 5px 5px 5px; - min-height: 22px; - border-radius: 3px; -} - -.jqsfield { - color: white; - text-align: left; -} - -.h-200 { - min-height: 200px; -} - -.legendLabel { - padding-left: 5px; -} - -.stat-list li:first-child { - margin-top: 0; -} - -.stat-list { - list-style: none; - padding: 0; - margin: 0; -} - -.stat-percent { - float: right; -} - -.stat-list li { - margin-top: 15px; - position: relative; -} -/* DATATABLES */ -table.dataTable thead .sorting, table.dataTable thead .sorting_asc:after, table.dataTable thead .sorting_desc, table.dataTable thead .sorting_asc_disabled, table.dataTable thead .sorting_desc_disabled { - background: transparent; -} - -table.dataTable thead .sorting_asc:after { - float: right; - font-family: fontawesome; -} - -table.dataTable thead .sorting_desc:after { - content: "\f0dd"; - float: right; - font-family: fontawesome; -} - -table.dataTable thead .sorting:after { - content: "\f0dc"; - float: right; - font-family: fontawesome; - color: rgba(50, 50, 50, 0.5); -} - -.dataTables_wrapper { - padding-bottom: 30px; -} -/* CIRCLE */ -.img-circle { - border-radius: 50%; -} - -.btn-circle { - width: 30px; - height: 30px; - padding: 6px 0; - border-radius: 15px; - text-align: center; - font-size: 12px; - line-height: 1.428571429; -} - -.btn-circle.btn-lg { - width: 50px; - height: 50px; - padding: 10px 16px; - border-radius: 25px; - font-size: 18px; - line-height: 1.33; -} - -.btn-circle.btn-xl { - width: 70px; - height: 70px; - padding: 10px 16px; - border-radius: 35px; - font-size: 24px; - line-height: 1.33; -} - -.show-grid [class^="col-"] { - padding-top: 10px; - padding-bottom: 10px; - border: 1px solid #ddd; - background-color: #eee !important; -} - -.show-grid { - margin: 15px 0; -} -/* ANIMATION */ -.css-animation-box h1 { - font-size: 44px; -} - -.animation-efect-links a { - padding: 4px 6px; - font-size: 12px; -} - -#animation_box { - background-color: #f9f8f8; - border-radius: 16px; - width: 80%; - margin: 0 auto; - padding-top: 80px; -} - -.animation-text-box { - position: absolute; - margin-top: 40px; - left: 50%; - margin-left: -100px; - width: 200px; -} - -.animation-text-info { - position: absolute; - margin-top: -60px; - left: 50%; - margin-left: -100px; - width: 200px; - font-size: 10px; -} - -.animation-text-box h2 { - font-size: 54px; - font-weight: 600; - margin-bottom: 5px; -} - -.animation-text-box p { - font-size: 12px; - text-transform: uppercase; -} -/* PEACE */ -.pace { - -webkit-pointer-events: none; - pointer-events: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.pace-inactive { - display: none; -} - -.pace .pace-progress { - background: #1ab394; - position: fixed; - z-index: 2000; - top: 0; - width: 100%; - height: 2px; -} - -.pace-inactive { - display: none; -} -/* WIDGETS */ -.widget { - border-radius: 5px; - padding: 15px 20px; - margin-bottom: 10px; - margin-top: 10px; -} - -.widget.style1 h2 { - font-size: 30px; -} - -.widget h2, .widget h3 { - margin-top: 5px; - margin-bottom: 0; -} - -.widget-text-box { - padding: 20px; - border: 1px solid #e7eaec; - background: #ffffff; -} - -.widget-head-color-box { - border-radius: 5px 5px 0px 0px; - margin-top: 10px; -} - -.widget .flot-chart { - height: 100px; -} - -.vertical-align div { - display: inline-block; - vertical-align: middle; -} - -.vertical-align h2, .vertical-align h3 { - margin: 0; -} - -.todo-list { - list-style: none outside none; - margin: 0; - padding: 0; - font-size: 14px; -} - -.todo-list.small-list { - font-size: 12px; -} - -.todo-list.small-list>li { - background: #f3f3f4; - border-left: none; - border-right: none; - border-radius: 4px; - color: inherit; - margin-bottom: 2px; - padding: 6px 6px 6px 12px; -} - -.todo-list.small-list .btn-xs, .todo-list.small-list .btn-group-xs>.btn { - border-radius: 5px; - font-size: 10px; - line-height: 1.5; - padding: 1px 2px 1px 5px; -} - -.todo-list>li { - background: #f3f3f4; - border-left: 6px solid #e7eaec; - border-right: 6px solid #e7eaec; - border-radius: 4px; - color: inherit; - margin-bottom: 2px; - padding: 10px; -} - -.todo-list .handle { - cursor: move; - display: inline-block; - font-size: 16px; - margin: 0 5px; -} - -.todo-list>li .label { - font-size: 9px; - margin-left: 10px; -} - -.check-link { - font-size: 16px; -} - -.todo-completed { - text-decoration: line-through; -} - -.geo-statistic h1 { - font-size: 36px; - margin-bottom: 0; -} - -.glyphicon.fa { - font-family: "FontAwesome"; -} -/* INPUTS */ -.inline { - display: inline-block !important; -} - -.input-s-sm { - width: 120px; -} - -.input-s { - width: 200px; -} - -.input-s-lg { - width: 250px; -} - -.i-checks { - padding-left: 0; -} - -.form-control, .single-line { - background: #FFFFFF none; - border: 1px solid #e5e6e7; - border-radius: 1px; - color: inherit; - display: block; - padding: 6px 12px; - -webkit-transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s; - transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s; - width: 100%; - font-size: 14px; -} - -.form-control:focus, .single-line:focus { - border-color: #1ab394 !important; -} - -.has-success .form-control { - border-color: #1ab394; -} - -.has-warning .form-control { - border-color: #f8ac59; -} - -.has-error .form-control { - border-color: #ed5565; -} - -.has-success .control-label { - color: #1ab394; -} - -.has-warning .control-label { - color: #f8ac59; -} - -.has-error .control-label { - color: #ed5565; -} - -.input-group-addon { - background-color: #fff; - border: 1px solid #E5E6E7; - border-radius: 1px; - color: inherit; - font-size: 14px; - font-weight: 400; - line-height: 1; - padding: 6px 12px; - text-align: center; -} - -.spinner-buttons.input-group-btn .btn-xs { - line-height: 1.13; -} - -.spinner-buttons.input-group-btn { - width: 20%; -} - -.noUi-connect { - background: none repeat scroll 0 0 #1ab394; - box-shadow: none; -} - -.slider_red .noUi-connect { - background: none repeat scroll 0 0 #ed5565; - box-shadow: none; -} -/* UI Sortable */ -.ui-sortable .ibox-title { - cursor: move; -} - -.ui-sortable-placeholder { - border: 1px dashed #cecece !important; - visibility: visible !important; - background: #e7eaec; -} - -.ibox.ui-sortable-placeholder { - margin: 0px 0px 23px !important; -} -/* Tabs */ -.tabs-container .panel-body { - background: #fff; - border: 1px solid #e7eaec; - border-radius: 2px; - padding: 20px; - position: relative; -} - -.tabs-container .nav-tabs>li.active>a, .tabs-container .nav-tabs>li.active>a:hover, .tabs-container .nav-tabs>li.active>a:focus { - border: 1px solid #e7eaec; - border-bottom-color: transparent; - background-color: #fff; -} - -.tabs-container .nav-tabs>li { - float: left; - margin-bottom: -1px; -} - -.tabs-container .tab-pane .panel-body { - border-top: none; -} - -.tabs-container .nav-tabs>li.active>a, .tabs-container .nav-tabs>li.active>a:hover, .tabs-container .nav-tabs>li.active>a:focus { - border: 1px solid #e7eaec; - border-bottom-color: transparent; -} - -.tabs-container .nav-tabs { - border-bottom: 1px solid #e7eaec; -} - -.tabs-container .tab-pane .panel-body { - border-top: none; -} - -.tabs-container .tabs-left .tab-pane .panel-body, .tabs-container .tabs-right .tab-pane .panel-body { - border-top: 1px solid #e7eaec; -} - -.tabs-container .nav-tabs>li a:hover { - background: transparent; - border-color: transparent; -} - -.tabs-container .tabs-below>.nav-tabs, .tabs-container .tabs-right>.nav-tabs, .tabs-container .tabs-left>.nav-tabs { - border-bottom: 0; -} - -.tabs-container .tabs-left .panel-body { - position: static; -} - -.tabs-container .tabs-left>.nav-tabs, .tabs-container .tabs-right>.nav-tabs { - width: 20%; -} - -.tabs-container .tabs-left .panel-body { - width: 80%; - margin-left: 20%; -} - -.tabs-container .tabs-right .panel-body { - width: 80%; - margin-right: 20%; -} - -.tabs-container .tab-content>.tab-pane, .tabs-container .pill-content>.pill-pane { - display: none; -} - -.tabs-container .tab-content>.active, .tabs-container .pill-content>.active { - display: block; -} - -.tabs-container .tabs-below>.nav-tabs { - border-top: 1px solid #e7eaec; -} - -.tabs-container .tabs-below>.nav-tabs>li { - margin-top: -1px; - margin-bottom: 0; -} - -.tabs-container .tabs-below>.nav-tabs>li>a { - border-radius: 0 0 4px 4px; -} - -.tabs-container .tabs-below>.nav-tabs>li>a:hover, .tabs-container .tabs-below>.nav-tabs>li>a:focus { - border-top-color: #e7eaec; - border-bottom-color: transparent; -} - -.tabs-container .tabs-left>.nav-tabs>li, .tabs-container .tabs-right>.nav-tabs>li { - float: none; -} - -.tabs-container .tabs-left>.nav-tabs>li>a, .tabs-container .tabs-right>.nav-tabs>li>a { - min-width: 74px; - margin-right: 0; - margin-bottom: 3px; -} - -.tabs-container .tabs-left>.nav-tabs { - float: left; - margin-right: 19px; -} - -.tabs-container .tabs-left>.nav-tabs>li>a { - margin-right: -1px; - border-radius: 4px 0 0 4px; -} - -.tabs-container .tabs-left>.nav-tabs .active>a, .tabs-container .tabs-left>.nav-tabs .active>a:hover, .tabs-container .tabs-left>.nav-tabs .active>a:focus { - border-color: #e7eaec transparent #e7eaec #e7eaec; - border-right-color: #ffffff; -} - -.tabs-container .tabs-right>.nav-tabs { - float: right; - margin-left: 19px; -} - -.tabs-container .tabs-right>.nav-tabs>li>a { - margin-left: -1px; - border-radius: 0 4px 4px 0; -} - -.tabs-container .tabs-right>.nav-tabs .active>a, .tabs-container .tabs-right>.nav-tabs .active>a:hover, .tabs-container .tabs-right>.nav-tabs .active>a:focus { - border-color: #e7eaec #e7eaec #e7eaec transparent; - border-left-color: #ffffff; - z-index: 1; -} -/*SWITCHES */ - -.onoffswitch{ - position: relative; - width: 54px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; -} - -.onoffswitch-checkbox { - display: none; -} - -.onoffswitch-label { - display: block; - overflow: hidden; - cursor: pointer; - border: 2px solid #1AB394; - border-radius: 3px; -} - -.onoffswitch-inner { - display: block; - width: 200%; - margin-left: -100%; - -webkit-transition: margin 0.3s ease-in 0s; - transition: margin 0.3s ease-in 0s; -} - -.onoffswitch-inner:before, .onoffswitch-inner:after { - display: block; - float: left; - width: 50%; - /* height: 16px; */ - padding: 0; - /* line-height: 16px; */ - font-size: 10px; - color: white; - font-family: Trebuchet, Arial, sans-serif; - font-weight: bold; - box-sizing: border-box; -} - -.onoffswitch-inner:before { - content: "ON"; - padding-left: 7px; - background-color: #1AB394; - color: #FFFFFF; -} - -.onoffswitch-inner:after { - content: "OFF"; - padding-right: 7px; - background-color: #FFFFFF; - color: #919191; - text-align: right; -} - -.onoffswitch-switch { - display: block; - width: 18px; - margin: 0px; - background: #FFFFFF; - border: 2px solid #1AB394; - border-radius: 3px; - position: absolute; - top: 0; - bottom: 0; - right: 36px; - -webkit-transition: all 0.3s ease-in 0s; - transition: all 0.3s ease-in 0s; -} - -.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner { - margin-left: 0; -} - -.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch { - right: 0px; -} -/* Nestable list */ -.dd { - position: relative; - display: block; - margin: 0; - padding: 0; - list-style: none; - font-size: 13px; - line-height: 20px; -} - -.dd-list { - display: block; - position: relative; - margin: 0; - padding: 0; - list-style: none; -} - -.dd-list .dd-list { - padding-left: 30px; -} - -.dd-collapsed .dd-list { - display: none; -} - -.dd-item, .dd-empty, .dd-placeholder { - display: block; - position: relative; - margin: 0; - padding: 0; - min-height: 20px; - font-size: 13px; - line-height: 20px; -} - -.dd-handle { - display: block; - margin: 5px 0; - padding: 5px 10px; - color: #333; - text-decoration: none; - border: 1px solid #e7eaec; - background: #f5f5f5; - border-radius: 3px; - box-sizing: border-box; - -moz-box-sizing: border-box; -} - -.dd-handle span { - font-weight: bold; -} - -.dd-handle:hover { - background: #f0f0f0; - cursor: pointer; - font-weight: bold; -} - -.dd-item>button { - display: block; - position: relative; - cursor: pointer; - float: left; - width: 25px; - height: 20px; - margin: 5px 0; - padding: 0; - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - border: 0; - background: transparent; - font-size: 12px; - line-height: 1; - text-align: center; - font-weight: bold; -} - -.dd-item>button:before { - content: '+'; - display: block; - position: absolute; - width: 100%; - text-align: center; - text-indent: 0; -} - -.dd-item>button[data-action="collapse"]:before { - content: '-'; -} - -#nestable2 .dd-item>button { - font-family: FontAwesome; - height: 34px; - width: 33px; - color: #c1c1c1; -} - -#nestable2 .dd-item>button:before { - content: "\f067"; -} - -#nestable2 .dd-item>button[data-action="collapse"]:before { - content: "\f068"; -} - -.dd-placeholder, .dd-empty { - margin: 5px 0; - padding: 0; - min-height: 30px; - background: #f2fbff; - border: 1px dashed #b6bcbf; - box-sizing: border-box; - -moz-box-sizing: border-box; -} - -.dd-empty { - border: 1px dashed #bbb; - min-height: 100px; - background-color: #e5e5e5; - background-image: -webkit-linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff), -webkit-linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff); - background-image: linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff), linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%, #ffffff); - background-size: 60px 60px; - background-position: 0 0, 30px 30px; -} - -.dd-dragel { - position: absolute; - z-index: 9999; - pointer-events: none; -} - -.dd-dragel>.dd-item .dd-handle { - margin-top: 0; -} - -.dd-dragel .dd-handle { - box-shadow: 2px 4px 6px 0 rgba(0, 0, 0, 0.1); -} -/** -* Nestable Extras -*/ -.nestable-lists { - display: block; - clear: both; - padding: 30px 0; - width: 100%; - border: 0; - border-top: 2px solid #ddd; - border-bottom: 2px solid #ddd; -} - -#nestable-menu { - padding: 0; - margin: 10px 0 20px 0; -} - -#nestable-output, #nestable2-output { - width: 100%; - font-size: 0.75em; - line-height: 1.333333em; - font-family: lucida grande, lucida sans unicode, helvetica, arial, sans-serif; - padding: 5px; - box-sizing: border-box; - -moz-box-sizing: border-box; -} - -#nestable2 .dd-handle { - color: inherit; - border: 1px dashed #e7eaec; - background: #f3f3f4; - padding: 10px; -} - -#nestable2 .dd-handle:hover { - /*background: #bbb;*/ -} - -#nestable2 span.label { - margin-right: 10px; -} - -#nestable-output, #nestable2-output { - font-size: 12px; - padding: 25px; - box-sizing: border-box; - -moz-box-sizing: border-box; -} -/* CodeMirror */ -.CodeMirror { - border: 1px solid #eee; - height: auto; -} - -.CodeMirror-scroll { - overflow-y: hidden; - overflow-x: auto; -} -/* Google Maps */ -.google-map { - height: 300px; -} -/* Validation */ -label.error { - color: #cc5965; - display: inline-block; - margin-left: 5px; -} - -.form-control.error { - border: 1px dotted #cc5965; -} -/* ngGrid */ -.gridStyle { - border: 1px solid #d4d4d4; - width: 100%; - height: 400px; -} - -.gridStyle2 { - border: 1px solid #d4d4d4; - width: 500px; - height: 300px; -} - -.ngH eaderCell { - border-right: none; - border-bottom: 1px solid #e7eaec; -} - -.ngCell { - border-right: none; -} - -.ngTopPanel { - background: #F5F5F6; -} - -.ngRow.even { - background: #f9f9f9; -} - -.ngRow.selected { - background: #EBF2F1; -} - -.ngRow { - border-bottom: 1px solid #e7eaec; -} - -.ngCell { - background-color: transparent; -} - -.ngHeaderCell { - border-right: none; -} -/* Toastr custom style */ -#toast-container>.toast { - background-image: none !important; -} - -#toast-container>.toast:before { - position: fixed; - font-family: FontAwesome; - font-size: 24px; - line-height: 24px; - float: left; - color: #FFF; - padding-right: 0.5em; - margin: auto 0.5em auto -1.5em; -} - -#toast-container>div { - box-shadow: 0 0 3px #999; - opacity: .9; - -ms-filter: alpha(opacity = 90); - filter: alpha(opacity = 90); -} - -#toast-container>:hover { - box-shadow: 0 0 4px #999; - opacity: 1; - -ms-filter: alpha(opacity = 100); - filter: alpha(opacity = 100); - cursor: pointer; -} - -.toast { - background-color: #1ab394; -} - -.toast-success { - background-color: #1ab394; -} - -.toast-error { - background-color: #ed5565; -} - -.toast-info { - background-color: #23c6c8; -} - -.toast-warning { - background-color: #f8ac59; -} - -.toast-top-full-width { - margin-top: 20px; -} - -.toast-bottom-full-width { - margin-bottom: 20px; -} -/* Image cropper style */ -.img-container, .img-preview { - overflow: hidden; - text-align: center; - width: 100%; -} - -.img-preview-sm { - height: 130px; - width: 200px; -} -/* Forum styles */ -.forum-post-container .media { - margin: 10px 10px 10px 10px; - padding: 20px 10px 20px 10px; - border-bottom: 1px solid #f1f1f1; -} - -.forum-avatar { - float: left; - margin-right: 20px; - text-align: center; - width: 110px; -} - -.forum-avatar .img-circle { - height: 48px; - width: 48px; -} - -.author-info { - color: #676a6c; - font-size: 11px; - margin-top: 5px; - text-align: center; -} - -.forum-post-info { - padding: 9px 12px 6px 12px; - background: #f9f9f9; - border: 1px solid #f1f1f1; -} - -.media-body>.media { - background: #f9f9f9; - border-radius: 3px; - border: 1px solid #f1f1f1; -} - -.forum-post-container .media-body .photos { - margin: 10px 0; -} - -.forum-photo { - max-width: 140px; - border-radius: 3px; -} - -.media-body>.media .forum-avatar { - width: 70px; - margin-right: 10px; -} - -.media-body>.media .forum-avatar .img-circle { - height: 38px; - width: 38px; -} - -.mid-icon { - font-size: 66px; -} - -.forum-item { - margin: 10px 0; - padding: 10px 0 20px; - border-bottom: 1px solid #f1f1f1; -} - -.views-number { - font-size: 24px; - line-height: 18px; - font-weight: 400; -} - -.forum-container, .forum-post-container { - padding: 30px !important; -} - -.forum-item small { - color: #999; -} - -.forum-item .forum-sub-title { - color: #999; - margin-left: 50px; -} - -.forum-title { - margin: 15px 0 15px 0; -} - -.forum-info { - text-align: center; -} - -.forum-desc { - color: #999; -} - -.forum-icon { - float: left; - width: 30px; - margin-right: 20px; - text-align: center; -} - -a.forum-item-title { - color: inherit; - display: block; - font-size: 18px; - font-weight: 600; -} - -a.forum-item-title:hover { - color: inherit; -} - -.forum-icon .fa { - font-size: 30px; - margin-top: 8px; - color: #9b9b9b; -} - -.forum-item.active .fa { - color: #1ab394; -} - -.forum-item.active a.forum-item-title { - color: #1ab394; -} - -@media ( max-width : 992px) { - .forum-info { - margin: 15px 0 10px 0px; - /* Comment this is you want to show forum info in small devices */ - display: none; - } - - .forum-desc { - float: none !important; - } -} -/* New Timeline style */ -.vertical-container { - /* this class is used to give a max-width to the element it is applied to, and center it horizontally when it reaches that max-width */ - width: 90%; - max-width: 1170px; - margin: 0 auto; -} - -.vertical-container::after { - /* clearfix */ - content: ''; - display: table; - clear: both; -} - -#vertical-timeline { - position: relative; - padding: 0; - margin-top: 2em; - margin-bottom: 2em; -} - -#vertical-timeline::before { - content: ''; - position: absolute; - top: 0; - left: 18px; - height: 100%; - width: 4px; - background: #f1f1f1; -} - -.vertical-timeline-content .btn { - float: right; -} - -#vertical-timeline.light-timeline:before { - background: #e7eaec; -} - -.dark-timeline .vertical-timeline-content:before { - border-color: transparent #f5f5f5 transparent transparent; -} - -.dark-timeline.center-orientation .vertical-timeline-content:before { - border-color: transparent transparent transparent #f5f5f5; -} - -.dark-timeline .vertical-timeline-block:nth-child(2n) .vertical-timeline-content:before, .dark-timeline.center-orientation .vertical-timeline-block:nth-child(2n) .vertical-timeline-content:before { - border-color: transparent #f5f5f5 transparent transparent; -} - -.dark-timeline .vertical-timeline-content, .dark-timeline.center-orientation .vertical-timeline-content { - background: #f5f5f5; -} - -@media only screen and (min-width: 1170px) { - #vertical-timeline.center-orientation { - margin-top: 3em; - margin-bottom: 3em; - } - - #vertical-timeline.center-orientation:before { - left: 50%; - margin-left: -2px; - } -} - -@media only screen and (max-width: 1170px) { - .center-orientation.dark-timeline .vertical-timeline-content:before { - border-color: transparent #f5f5f5 transparent transparent; - } -} - -.vertical-timeline-block { - position: relative; - margin: 2em 0; -} - -.vertical-timeline-block:after { - content: ""; - display: table; - clear: both; -} - -.vertical-timeline-block:first-child { - margin-top: 0; -} - -.vertical-timeline-block:last-child { - margin-bottom: 0; -} - -@media only screen and (min-width: 1170px) { - .center-orientation .vertical-timeline-block { - margin: 4em 0; - } - - .center-orientation .vertical-timeline-block:first-child { - margin-top: 0; - } - - .center-orientation .vertical-timeline-block:last-child { - margin-bottom: 0; - } -} - -.vertical-timeline-icon { - position: absolute; - top: 0; - left: 0; - width: 40px; - height: 40px; - border-radius: 50%; - font-size: 16px; - border: 3px solid #f1f1f1; - text-align: center; -} - -.vertical-timeline-icon i { - display: block; - width: 24px; - height: 24px; - position: relative; - left: 50%; - top: 50%; - margin-left: -12px; - margin-top: -9px; -} - -@media only screen and (min-width: 1170px) { - .center-orientation .vertical-timeline-icon { - width: 50px; - height: 50px; - left: 50%; - margin-left: -25px; - -webkit-transform: translateZ(0); - -webkit-backface-visibility: hidden; - font-size: 19px; - } - - .center-orientation .vertical-timeline-icon i { - margin-left: -12px; - margin-top: -10px; - } - - .center-orientation .cssanimations .vertical-timeline-icon.is-hidden { - visibility: hidden; - } -} - -.vertical-timeline-content { - position: relative; - margin-left: 60px; - background: white; - border-radius: 0.25em; - padding: 1em; -} - -.vertical-timeline-content:after { - content: ""; - display: table; - clear: both; -} - -.vertical-timeline-content h2 { - font-weight: 400; - margin-top: 4px; -} - -.vertical-timeline-content p { - margin: 1em 0; - line-height: 1.6; -} - -.vertical-timeline-content .vertical-date { - float: left; - font-weight: 500; -} - -.vertical-date small { - color: #1ab394; - font-weight: 400; -} - -.vertical-timeline-content::before { - content: ''; - position: absolute; - top: 16px; - right: 100%; - height: 0; - width: 0; - border: 7px solid transparent; - border-right: 7px solid white; -} - -@media only screen and (min-width: 768px) { - .vertical-timeline-content h2 { - font-size: 18px; - } - - .vertical-timeline-content p { - font-size: 13px; - } -} - -@media only screen and (min-width: 1170px) { - .center-orientation .vertical-timeline-content { - margin-left: 0; - padding: 1.6em; - width: 45%; - } - - .center-orientation .vertical-timeline-content::before { - top: 24px; - left: 100%; - border-color: transparent; - border-left-color: white; - } - - .center-orientation .vertical-timeline-content .btn { - float: left; - } - - .center-orientation .vertical-timeline-content .vertical-date { - position: absolute; - width: 100%; - left: 122%; - top: 2px; - font-size: 14px; - } - - .center-orientation .vertical-timeline-block:nth-child(even) .vertical-timeline-content { - float: right; - } - - .center-orientation .vertical-timeline-block:nth-child(even) .vertical-timeline-content::before { - top: 24px; - left: auto; - right: 100%; - border-color: transparent; - border-right-color: white; - } - - .center-orientation .vertical-timeline-block:nth-child(even) .vertical-timeline-content .btn { - float: right; - } - - .center-orientation .vertical-timeline-block:nth-child(even) .vertical-timeline-content .vertical-date { - left: auto; - right: 122%; - text-align: right; - } - - .center-orientation .cssanimations .vertical-timeline-content.is-hidden { - visibility: hidden; - } -} - -.sidebard-panel { - width: 220px; - background: #ebebed; - padding: 10px 20px; - position: absolute; - right: 0; -} - -.sidebard-panel .feed-element img.img-circle { - width: 32px; - height: 32px; -} - -.sidebard-panel .feed-element, .media-body, .sidebard-panel p { - font-size: 12px; -} - -.sidebard-panel .feed-element { - margin-top: 20px; - padding-bottom: 0; -} - -.sidebard-panel .list-group { - margin-bottom: 10px; -} - -.sidebard-panel .list-group .list-group-item { - padding: 5px 0; - font-size: 12px; - border: 0; -} - -.sidebar-content .wrapper, .wrapper.sidebar-content { - padding-right: 240px !important; -} - -#right-sidebar { - background-color: #fff; - border-left: 1px solid #e7eaec; - border-top: 1px solid #e7eaec; - overflow: hidden; - position: fixed; - top: 60px; - width: 260px !important; - z-index: 1009; - bottom: 0; - right: -260px; -} - -#right-sidebar.sidebar-open { - right: 0; -} - -#right-sidebar.sidebar-open.sidebar-top { - top: 0; - border-top: none; -} - -.sidebar-container ul.nav-tabs { - border: none; -} - -.sidebar-container ul.nav-tabs.navs-4 li { - width: 25%; -} - -.sidebar-container ul.nav-tabs.navs-3 li { - width: 33.3333%; -} - -.sidebar-container ul.nav-tabs.navs-2 li { - width: 50%; -} - -.sidebar-container ul.nav-tabs li { - border: none; -} - -.sidebar-container ul.nav-tabs li a { - border: none; - padding: 12px 10px; - margin: 0; - border-radius: 0; - background: #2f4050; - color: #fff; - text-align: center; - border-right: 1px solid #334556; -} - -.sidebar-container ul.nav-tabs li.active a { - border: none; - background: #f9f9f9; - color: #676a6c; - font-weight: bold; -} - -.sidebar-container .nav-tabs>li.active>a:hover, .sidebar-container .nav-tabs>li.active>a:focus { - border: none; -} - -.sidebar-container ul.sidebar-list { - margin: 0; - padding: 0; -} - -.sidebar-container ul.sidebar-list li { - border-bottom: 1px solid #e7eaec; - padding: 15px 20px; - list-style: none; - font-size: 12px; -} - -.sidebar-container .sidebar-message:nth-child(2n+2) { - background: #f9f9f9; -} - -.sidebar-container ul.sidebar-list li a { - text-decoration: none; - color: inherit; -} - -.sidebar-container .sidebar-content { - padding: 15px 20px; - font-size: 12px; -} - -.sidebar-container .sidebar-title { - background: #f9f9f9; - padding: 20px; - border-bottom: 1px solid #e7eaec; -} - -.sidebar-container .sidebar-title h3 { - margin-bottom: 3px; - padding-left: 2px; -} - -.sidebar-container .tab-content h4 { - margin-bottom: 5px; -} - -.sidebar-container .sidebar-message>a>.pull-left { - margin-right: 10px; -} - -.sidebar-container .sidebar-message>a { - text-decoration: none; - color: inherit; -} - -.sidebar-container .sidebar-message { - padding: 15px 20px; -} - -.sidebar-container .sidebar-message .message-avatar { - height: 38px; - width: 38px; - border-radius: 50%; -} - -.sidebar-container .setings-item { - padding: 15px 20px; - border-bottom: 1px solid #e7eaec; -} - -body { - font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 13px; - color: #676a6c; - overflow-x: hidden; -} - -html, body { - height: 100%; -} - -body.full-height-layout #wrapper, body.full-height-layout #page-wrapper { - height: 100%; -} - -#page-wrapper { - min-height: auto; -} - -body.boxed-layout { - background: url('patterns/shattered.png'); -} - -body.boxed-layout #wrapper { - background-color: #2f4050; - max-width: 1200px; - margin: 0 auto; -} - -.top-navigation.boxed-layout #wrapper, .boxed-layout #wrapper.top-navigation { - max-width: 1300px !important; -} - -.block { - display: block; -} - -.clear { - display: block; - overflow: hidden; -} - -a { - cursor: pointer; -} - -a:hover, a:focus { - text-decoration: none; -} - -.border-bottom { - border-bottom: 1px solid #e7eaec !important; -} - -.font-bold { - font-weight: 600; -} - -.font-noraml { - font-weight: 400; -} - -.text-uppercase { - text-transform: uppercase; -} - -.b-r { - border-right: 1px solid #e7eaec; -} - -.hr-line-dashed { - border-top: 1px dashed #e7eaec; - color: #ffffff; - background-color: #ffffff; - height: 1px; - margin: 20px 0; -} - -.hr-line-solid { - border-bottom: 1px solid #e7eaec; - background-color: rgba(0, 0, 0, 0); - border-style: solid !important; - margin-top: 15px; - margin-bottom: 15px; -} - -video { - width: 100% !important; - height: auto !important; -} -/* GALLERY */ -.gallery>.row>div { - margin-bottom: 15px; -} - -.fancybox img { - margin-bottom: 5px; - /* Only for demo */ - width: 24%; -} -/* Summernote text editor */ -.note-editor { - height: auto !important; - min-height: 100px; - border: solid 1px #e5e6e7; -} -/* MODAL */ -.modal-content { - background-clip: padding-box; - background-color: #FFFFFF; - border: 1px solid rgba(0, 0, 0, 0); - border-radius: 4px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); - outline: 0 none; -} - -.modal-dialog { - z-index: 1200; -} - -.modal-body { - padding: 20px 30px 30px 30px; -} - -.inmodal .modal-body { - background: #f8fafb; -} - -.inmodal .modal-header { - padding: 30px 15px; - text-align: center; -} - -.animated.modal.fade .modal-dialog { - -webkit-transform: none; - -ms-transform: none; - transform: none; -} - -.inmodal .modal-title { - font-size: 26px; -} - -.inmodal .modal-icon { - font-size: 84px; - color: #e2e3e3; -} - -.modal-footer { - margin-top: 0; -} -/* WRAPPERS */ -#wrapper { - width: 100%; - overflow-x: hidden; - background-color: #2f4050; -} - -.wrapper { - padding: 0 20px; -} - -.wrapper-content { - padding: 20px; -} - -#page-wrapper { - padding: 0 15px; - position: inherit; - margin: 0 0 0 220px; -} - -.title-action { - text-align: right; - padding-top: 30px; -} - -.ibox-content h1, .ibox-content h2, .ibox-content h3, .ibox-content h4, .ibox-content h5, .ibox-title h1, .ibox-title h2, .ibox-title h3, .ibox-title h4, .ibox-title h5 { - margin-top: 5px; -} - -ul.unstyled, ol.unstyled { - list-style: none outside none; - margin-left: 0; -} - -.big-icon { - font-size: 160px; - color: #e5e6e7; -} -/* FOOTER */ -.footer { - background: none repeat scroll 0 0 white; - border-top: 1px solid #e7eaec; - overflow: hidden; - padding: 10px 20px; - margin: 0 -15px; - height: 36px; -} - -.footer.fixed_full { - position: fixed; - bottom: 0; - left: 0; - right: 0; - z-index: 1000; - padding: 10px 20px; - background: white; - border-top: 1px solid #e7eaec; -} - -.footer.fixed { - position: fixed; - bottom: 0; - left: 0; - right: 0; - z-index: 1000; - padding: 10px 20px; - background: white; - border-top: 1px solid #e7eaec; - margin-left: 220px; -} - -body.mini-navbar .footer.fixed, body.body-small.mini-navbar .footer.fixed { - margin: 0 0 0 70px; -} - -body.mini-navbar.canvas-menu .footer.fixed, body.canvas-menu .footer.fixed { - margin: 0 !important; -} - -body.fixed-sidebar.body-small.mini-navbar .footer.fixed { - margin: 0 0 0 220px; -} - -body.body-small .footer.fixed { - margin-left: 0px; -} -/* PANELS */ -.page-heading { - border-top: 0; - padding: 0px 20px 20px; -} - -.panel-heading h1, .panel-heading h2 { - margin-bottom: 5px; -} -/*CONTENTTABS*/ -.content-tabs { - position: relative; - height: 42px; - background: #fafafa; - line-height: 40px; -} - -.content-tabs .roll-nav, .page-tabs-list { - position: absolute; - width: 40px; - height: 40px; - text-align: center; - color: #999; - z-index: 2; - top: 0; -} - -.content-tabs .roll-left { - left: 0; - border-right: solid 1px #eee; -} - -.content-tabs .roll-right { - right: 0; - border-left: solid 1px #eee; -} - -.content-tabs button { - background: #fff; - border: 0; - height: 40px; - width: 40px; - outline: none; -} - -.content-tabs button:hover { - background: #fafafa; -} - -nav.page-tabs { - margin-left: 40px; - width: 100000px; - height: 40px; - overflow: hidden; -} - -nav.page-tabs .page-tabs-content { - float: left; -} - -.page-tabs a { - display: block; - float: left; - border-right: solid 1px #eee; - padding: 0 15px; -} - -.page-tabs a i:hover { - color: #c00; -} - -.page-tabs a:hover, .content-tabs .roll-nav:hover { - color: #777; - background: #f2f2f2; - cursor: pointer; -} - -.roll-right.J_tabRight { - right: 140px; -} - -.roll-right.btn-group { - right: 60px; - width: 80px; - padding: 0; -} - -.roll-right.btn-group button { - width: 80px; -} - -.roll-right.J_tabExit { - background: #fff; - height: 40px; - width: 60px; - outline: none; -} - -.dropdown-menu-right { - left: auto; -} - -#content-main { - /*让标签页撑满,不保留footer高度。footer在每个标签页内部实现。*/ - height: calc(100% - 105px); - /*height: calc(100% - 140px);*/ - overflow: hidden; -} - -.fixed-nav #content-main { - height: calc(100% - 80px); - overflow: hidden; -} -/* TABLES */ -.table-bordered { - border: 1px solid #EBEBEB; -} - -.table-bordered>thead>tr>th, .table-bordered>thead>tr>td { - background-color: #F5F5F6; - border-bottom-width: 1px; -} - -.table-bordered>thead>tr>th, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>tbody>tr>td, .table-bordered>tfoot>tr>td { - border: 1px solid #e7e7e7; -} - -.table>thead>tr>th { - border-bottom: 1px solid #DDDDDD; - vertical-align: bottom; -} - -.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td { - border-top: 1px solid #e7eaec; - line-height: 1.42857; - padding: 8px; - vertical-align: middle; -} -/* PANELS */ -.panel.blank-panel { - background: none; - margin: 0; -} - -.blank-panel .panel-heading { - padding-bottom: 0; -} - -.nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, .nav-tabs>li.active>a:focus { - -moz-border-bottom-colors: none; - -moz-border-left-colors: none; - -moz-border-right-colors: none; - -moz-border-top-colors: none; - background: none; - border-color: #dddddd #dddddd rgba(0, 0, 0, 0); - border-bottom: #f3f3f4; - -webkit-border-image: none; - -o-border-image: none; - border-image: none; - border-style: solid; - border-width: 1px; - color: #555555; - cursor: default; -} - -.nav.nav-tabs li { - background: none; - border: none; -} - -.nav-tabs>li>a { - color: #A7B1C2; - font-weight: 600; - padding: 10px 20px 10px 25px; -} - -.nav-tabs>li>a:hover, .nav-tabs>li>a:focus { - background-color: #e6e6e6; - color: #676a6c; -} - -.ui-tab .tab-content { - padding: 20px 0px; -} -/* GLOBAL */ -.no-padding { - padding: 0 !important; -} - -.no-borders { - border: none !important; -} - -.no-margins { - margin: 0 !important; -} - -.no-top-border { - border-top: 0 !important; -} - -.ibox-content.text-box { - padding-bottom: 0px; - padding-top: 15px; -} - -.border-left-right { - border-left: 1px solid #e7eaec; - border-right: 1px solid #e7eaec; - border-top: none; - border-bottom: none; -} - -.border-left { - border-left: 1px solid #e7eaec; - border-right: none; - border-top: none; - border-bottom: none; -} - -.border-right { - border-left: none; - border-right: 1px solid #e7eaec; - border-top: none; - border-bottom: none; -} - -.full-width { - width: 100% !important; -} - -.link-block { - font-size: 12px; - padding: 10px; -} - -.nav.navbar-top-links .link-block a { - font-size: 12px; -} - -.link-block a { - font-size: 10px; - color: inherit; -} - -body.mini-navbar .branding { - display: none; -} - -img.circle-border { - border: 6px solid #FFFFFF; - border-radius: 50%; -} - -.branding { - float: left; - color: #FFFFFF; - font-size: 18px; - font-weight: 600; - padding: 17px 20px; - text-align: center; - background-color: #1ab394; -} - -.login-panel { - margin-top: 25%; -} - -.page-header { - padding: 20px 0 9px; - margin: 0 0 20px; - border-bottom: 1px solid #eeeeee; -} - -.fontawesome-icon-list { - margin-top: 22px; -} - -.fontawesome-icon-list .fa-hover a { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - display: block; - color: #222222; - line-height: 32px; - height: 32px; - padding-left: 10px; - border-radius: 4px; -} - -.fontawesome-icon-list .fa-hover a .fa { - width: 32px; - font-size: 14px; - display: inline-block; - text-align: right; - margin-right: 10px; -} - -.fontawesome-icon-list .fa-hover a:hover { - background-color: #1d9d74; - color: #ffffff; - text-decoration: none; -} - -.fontawesome-icon-list .fa-hover a:hover .fa { - font-size: 30px; - vertical-align: -6px; -} - -.fontawesome-icon-list .fa-hover a:hover .text-muted { - color: #bbe2d5; -} - -.feature-list .col-md-4 { - margin-bottom: 22px; -} - -.feature-list h4 .fa:before { - vertical-align: -10%; - font-size: 28px; - display: inline-block; - width: 1.07142857em; - text-align: center; - margin-right: 5px; -} - -.ui-draggable .ibox-title { - cursor: move; -} - -.breadcrumb { - background-color: #ffffff; - padding: 0; - margin-bottom: 0; -} - -.breadcrumb>li a { - color: inherit; -} - -.breadcrumb>.active { - color: inherit; -} - -code { - background-color: #F9F2F4; - border-radius: 4px; - color: #ca4440; - font-size: 90%; - padding: 2px 4px; - white-space: nowrap; -} - -.ibox { - clear: both; - margin-bottom: 25px; - margin-top: 0; - padding: 0; -} - -.ibox.collapsed .ibox-content { - display: none; -} - -.ibox.collapsed .fa.fa-chevron-up:before { - content: "\f078"; -} - -.ibox.collapsed .fa.fa-chevron-down:before { - content: "\f077"; -} - -.ibox:after, .ibox:before { - display: table; -} - -.ibox-title { - -moz-border-bottom-colors: none; - -moz-border-left-colors: none; - -moz-border-right-colors: none; - -moz-border-top-colors: none; - background-color: #ffffff; - border-color: #e7eaec; - -webkit-border-image: none; - -o-border-image: none; - border-image: none; - border-style: solid solid none; - border-width: 4px 0px 0; - color: inherit; - margin-bottom: 0; - padding: 14px 15px 7px; - min-height: 48px; -} - -.ibox-content { - background-color: #ffffff; - color: inherit; - padding: 15px 20px 20px 20px; - border-color: #e7eaec; - -webkit-border-image: none; - -o-border-image: none; - border-image: none; - border-style: solid solid none; - border-width: 1px 0px; -} - -table.table-mail tr td { - padding: 12px; -} - -.table-mail .check-mail { - padding-left: 20px; -} - -.table-mail .mail-date { - padding-right: 20px; -} - -.star-mail, .check-mail { - width: 40px; -} - -.unread td a, .unread td { - font-weight: 600; - color: inherit; -} - -.read td a, .read td { - font-weight: normal; - color: inherit; -} - -.unread td { - background-color: #f9f8f8; -} - -.ibox-content { - clear: both; -} - -.ibox-heading { - background-color: #f3f6fb; - border-bottom: none; -} - -.ibox-heading h3 { - font-weight: 200; - font-size: 24px; -} - -.ibox-title h5 { - display: inline-block; - font-size: 14px; - margin: 0 0 7px; - padding: 0; - text-overflow: ellipsis; - float: left; -} - -.ibox-title .label { - float: left; - margin-left: 4px; -} - -.ibox-tools { - display: inline-block; - float: right; - margin-top: 0; - position: relative; - padding: 0; -} - -.ibox-tools a { - cursor: pointer; - margin-left: 5px; - color: #c4c4c4; -} - -.ibox-tools a.btn-primary { - color: #fff; -} - -.ibox-tools .dropdown-menu>li>a { - padding: 4px 10px; - font-size: 12px; -} - -.ibox .open>.dropdown-menu { - left: auto; - right: 0; -} -/* BACKGROUNDS */ -.gray-bg { - background-color: #f3f3f4; -} - -.white-bg { - background-color: #ffffff; -} - -.navy-bg { - background-color: #1ab394; - color: #ffffff; -} - -.blue-bg { - background-color: #1c84c6; - color: #ffffff; -} - -.lazur-bg { - background-color: #23c6c8; - color: #ffffff; -} - -.yellow-bg { - background-color: #f8ac59; - color: #ffffff; -} - -.red-bg { - background-color: #ed5565; - color: #ffffff; -} - -.black-bg { - background-color: #262626; -} - -.panel-primary { - border-color: #1ab394; -} - -.panel-primary>.panel-heading { - background-color: #1ab394; - border-color: #1ab394; -} - -.panel-success { - border-color: #1c84c6; -} - -.panel-success>.panel-heading { - background-color: #1c84c6; - border-color: #1c84c6; - color: #ffffff; -} - -.panel-info { - border-color: #23c6c8; -} - -.panel-info>.panel-heading { - background-color: #23c6c8; - border-color: #23c6c8; - color: #ffffff; -} - -.panel-warning { - border-color: #f8ac59; -} - -.panel-warning>.panel-heading { - background-color: #f8ac59; - border-color: #f8ac59; - color: #ffffff; -} - -.panel-danger { - border-color: #ed5565; -} - -.panel-danger>.panel-heading { - background-color: #ed5565; - border-color: #ed5565; - color: #ffffff; -} - -.progress-bar { - background-color: #1ab394; -} - -.progress-small, .progress-small .progress-bar { - height: 10px; -} - -.progress-small, .progress-mini { - margin-top: 5px; -} - -.progress-mini, .progress-mini .progress-bar { - height: 5px; - margin-bottom: 0px; -} - -.progress-bar-navy-light { - background-color: #3dc7ab; -} - -.progress-bar-success { - background-color: #1c84c6; -} - -.progress-bar-info { - background-color: #23c6c8; -} - -.progress-bar-warning { - background-color: #f8ac59; -} - -.progress-bar-danger { - background-color: #ed5565; -} - -.panel-title { - font-size: inherit; -} - -.jumbotron { - border-radius: 6px; - padding: 40px; -} - -.jumbotron h1 { - margin-top: 0; -} -/* COLORS */ -.text-navy { - color: #1ab394; -} - -.text-primary { - color: inherit; -} - -.text-success { - color: #1c84c6; -} - -.text-info { - color: #23c6c8; -} - -.text-warning { - color: #f8ac59; -} - -.text-danger { - color: #ed5565; -} - -.text-muted { - color: #888888; -} - -.simple_tag { - background-color: #f3f3f4; - border: 1px solid #e7eaec; - border-radius: 2px; - color: inherit; - font-size: 10px; - margin-right: 5px; - margin-top: 5px; - padding: 5px 12px; - display: inline-block; -} - -.img-shadow { - box-shadow: 0px 0px 3px 0px #919191; -} -/* For handle diferent bg color in AngularJS version */ -.dashboards\.dashboard_2 nav.navbar, .dashboards\.dashboard_3 nav.navbar, .mailbox\.inbox nav.navbar, .mailbox\.email_view nav.navbar, .mailbox\.email_compose nav.navbar, .dashboards\.dashboard_4_1 nav.navbar { - background: #fff; -} -/* For handle diferent bg color in MVC version */ -.Dashboard_2 .navbar.navbar-static-top, .Dashboard_3 .navbar.navbar-static-top, .Dashboard_4_1 .navbar.navbar-static-top, .ComposeEmail .navbar.navbar-static-top, .EmailView .navbar.navbar-static-top, .Inbox .navbar.navbar-static-top { - background: #fff; -} - -a.close-canvas-menu { - position: absolute; - top: 10px; - right: 15px; - z-index: 1011; - color: #a7b1c2; -} - -a.close-canvas-menu:hover { - color: #fff; -} -/* FULL HEIGHT */ -.full-height { - height: 100%; -} - -.fh-breadcrumb { - height: calc(100% - 196px); - margin: 0 -15px; - position: relative; -} - -.fh-no-breadcrumb { - height: calc(100% - 99px); - margin: 0 -15px; - position: relative; -} - -.fh-column { - background: #fff; - height: 100%; - width: 240px; - float: left; -} - -.modal-backdrop { - z-index: 2040 !important; -} - -.modal { - z-index: 2050 !important; -} - -.spiner-example { - height: 200px; - padding-top: 70px; -} -/* MARGINS & PADDINGS */ -.p-xxs { - padding: 5px; -} - -.p-xs { - padding: 10px; -} - -.p-sm { - padding: 15px; -} - -.p-m { - padding: 20px; -} - -.p-md { - padding: 25px; -} - -.p-lg { - padding: 30px; -} - -.p-xl { - padding: 40px; -} - -.m-xxs { - margin: 2px 4px; -} - -.m-xs { - margin: 5px; -} - -.m-sm { - margin: 10px; -} - -.m { - margin: 15px; -} - -.m-md { - margin: 20px; -} - -.m-lg { - margin: 30px; -} - -.m-xl { - margin: 50px; -} - -.m-n { - margin: 0 !important; -} - -.m-l-none { - margin-left: 0; -} - -.m-l-xs { - margin-left: 5px; -} - -.m-l-sm { - margin-left: 10px; -} - -.m-l { - margin-left: 15px; -} - -.m-l-md { - margin-left: 20px; -} - -.m-l-lg { - margin-left: 30px; -} - -.m-l-xl { - margin-left: 40px; -} - -.m-l-n-xxs { - margin-left: -1px; -} - -.m-l-n-xs { - margin-left: -5px; -} - -.m-l-n-sm { - margin-left: -10px; -} - -.m-l-n { - margin-left: -15px; -} - -.m-l-n-md { - margin-left: -20px; -} - -.m-l-n-lg { - margin-left: -30px; -} - -.m-l-n-xl { - margin-left: -40px; -} - -.m-t-none { - margin-top: 0; -} - -.m-t-xxs { - margin-top: 1px; -} - -.m-t-xs { - margin-top: 5px; -} - -.m-t-sm { - margin-top: 10px; -} - -.m-t { - margin-top: 15px; -} - -.m-t-md { - margin-top: 20px; -} - -.m-t-lg { - margin-top: 30px; -} - -.m-t-xl { - margin-top: 40px; -} - -.m-t-n-xxs { - margin-top: -1px; -} - -.m-t-n-xs { - margin-top: -5px; -} - -.m-t-n-sm { - margin-top: -10px; -} - -.m-t-n { - margin-top: -15px; -} - -.m-t-n-md { - margin-top: -20px; -} - -.m-t-n-lg { - margin-top: -30px; -} - -.m-t-n-xl { - margin-top: -40px; -} - -.m-r-none { - margin-right: 0; -} - -.m-r-xxs { - margin-right: 1px; -} - -.m-r-xs { - margin-right: 5px; -} - -.m-r-sm { - margin-right: 10px; -} - -.m-r { - margin-right: 15px; -} - -.m-r-md { - margin-right: 20px; -} - -.m-r-lg { - margin-right: 30px; -} - -.m-r-xl { - margin-right: 40px; -} - -.m-r-n-xxs { - margin-right: -1px; -} - -.m-r-n-xs { - margin-right: -5px; -} - -.m-r-n-sm { - margin-right: -10px; -} - -.m-r-n { - margin-right: -15px; -} - -.m-r-n-md { - margin-right: -20px; -} - -.m-r-n-lg { - margin-right: -30px; -} - -.m-r-n-xl { - margin-right: -40px; -} - -.m-b-none { - margin-bottom: 0; -} - -.m-b-xxs { - margin-bottom: 1px; -} - -.m-b-xs { - margin-bottom: 5px; -} - -.m-b-sm { - margin-bottom: 10px; -} - -.m-b { - margin-bottom: 15px; -} - -.m-b-md { - margin-bottom: 20px; -} - -.m-b-lg { - margin-bottom: 30px; -} - -.m-b-xl { - margin-bottom: 40px; -} - -.m-b-n-xxs { - margin-bottom: -1px; -} - -.m-b-n-xs { - margin-bottom: -5px; -} - -.m-b-n-sm { - margin-bottom: -10px; -} - -.m-b-n { - margin-bottom: -15px; -} - -.m-b-n-md { - margin-bottom: -20px; -} - -.m-b-n-lg { - margin-bottom: -30px; -} - -.m-b-n-xl { - margin-bottom: -40px; -} - -.space-15 { - margin: 15px 0; -} - -.space-20 { - margin: 20px 0; -} - -.space-25 { - margin: 25px 0; -} - -.space-30 { - margin: 30px 0; -} - -body.modal-open { - padding-right: inherit !important; -} -/* SEARCH PAGE */ -.search-form { - margin-top: 10px; -} - -.search-result h3 { - margin-bottom: 0; - color: #1E0FBE; -} - -.search-result .search-link { - color: #006621; -} - -.search-result p { - font-size: 12px; - margin-top: 5px; -} -/* CONTACTS */ -.contact-box { - background-color: #ffffff; - border: 1px solid #e7eaec; - padding: 20px; - margin-bottom: 20px; -} - -.contact-box a { - color: inherit; -} - -/* INVOICE */ -.invoice-table tbody>tr>td:last-child, .invoice-table tbody>tr>td:nth-child(4), .invoice-table tbody>tr>td:nth-child(3), .invoice-table tbody>tr>td:nth-child(2) { - text-align: right; -} - -.invoice-table thead>tr>th:last-child, .invoice-table thead>tr>th:nth-child(4), .invoice-table thead>tr>th:nth-child(3), .invoice-table thead>tr>th:nth-child(2) { - text-align: right; -} - -.invoice-total>tbody>tr>td:first-child { - text-align: right; -} - -.invoice-total>tbody>tr>td { - border: 0 none; -} - -.invoice-total>tbody>tr>td:last-child { - border-bottom: 1px solid #DDDDDD; - text-align: right; - width: 15%; -} -/* ERROR & LOGIN & LOCKSCREEN*/ -.middle-box { - max-width: 400px; - z-index: 100; - margin: 0 auto; - padding-top: 40px; -} - -.lockscreen.middle-box { - width: 200px; - padding-top: 110px; -} - -.loginscreen.middle-box { - width: 300px; -} - -.loginColumns { - max-width: 800px; - margin: 0 auto; - padding: 100px 20px 20px 20px; -} - -.passwordBox { - max-width: 460px; - margin: 0 auto; - padding: 100px 20px 20px 20px; -} - -.logo-name { - color: #e6e6e6; - font-size: 180px; - font-weight: 800; - letter-spacing: -10px; - margin-bottom: 0px; -} - -.middle-box h1 { - font-size: 170px; -} - -.wrapper .middle-box { - margin-top: 140px; -} - -.lock-word { - z-index: 10; - position: absolute; - top: 110px; - left: 50%; - margin-left: -470px; -} - -.lock-word span { - font-size: 100px; - font-weight: 600; - color: #e9e9e9; - display: inline-block; -} - -.lock-word .first-word { - margin-right: 160px; -} -/* DASBOARD */ -.dashboard-header { - border-top: 0; - padding: 20px 20px 20px 20px; -} - -.dashboard-header h2 { - margin-top: 10px; - font-size: 26px; -} - -.fist-item { - border-top: none !important; -} - -.statistic-box { - margin-top: 40px; -} - -.dashboard-header .list-group-item span.label { - margin-right: 10px; -} - -.list-group.clear-list .list-group-item { - border-top: 1px solid #e7eaec; - border-bottom: 0; - border-right: 0; - border-left: 0; - padding: 10px 0; -} - -ul.clear-list:first-child { - border-top: none !important; -} -/* Intimeline */ -.timeline-item .date i { - position: absolute; - top: 0; - right: 0; - padding: 5px; - width: 30px; - text-align: center; - border-top: 1px solid #e7eaec; - border-bottom: 1px solid #e7eaec; - border-left: 1px solid #e7eaec; - background: #f8f8f8; -} - -.timeline-item .date { - text-align: right; - width: 110px; - position: relative; - padding-top: 30px; -} - -.timeline-item .content { - border-left: 1px solid #e7eaec; - border-top: 1px solid #e7eaec; - padding-top: 10px; - min-height: 100px; -} - -.timeline-item .content:hover { - background: #f6f6f6; -} -/* PIN BOARD */ -ul.notes li, ul.tag-list li { - list-style: none; -} - -ul.notes li h4 { - margin-top: 20px; - font-size: 16px; -} - -ul.notes li div { - text-decoration: none; - color: #000; - background: #ffc; - display: block; - height: 140px; - width: 140px; - padding: 1em; - position: relative; -} - -ul.notes li div small { - position: absolute; - top: 5px; - right: 5px; - font-size: 10px; -} - -ul.notes li div a { - position: absolute; - right: 10px; - bottom: 10px; - color: inherit; -} - -ul.notes li { - margin: 10px 40px 50px 0px; - float: left; -} - -ul.notes li div p { - font-size: 12px; -} - -ul.notes li div { - text-decoration: none; - color: #000; - background: #ffc; - display: block; - height: 140px; - width: 140px; - padding: 1em; - /* Firefox */ - /* Safari+Chrome */ - /* Opera */ - box-shadow: 5px 5px 2px rgba(33, 33, 33, 0.7); -} - -ul.notes li div { - -webkit-transform: rotate(-6deg); - -o-transform: rotate(-6deg); - -moz-transform: rotate(-6deg); -} - -ul.notes li:nth-child(even) div { - -o-transform: rotate(4deg); - -webkit-transform: rotate(4deg); - -moz-transform: rotate(4deg); - position: relative; - top: 5px; -} - -ul.notes li:nth-child(3n) div { - -o-transform: rotate(-3deg); - -webkit-transform: rotate(-3deg); - -moz-transform: rotate(-3deg); - position: relative; - top: -5px; -} - -ul.notes li:nth-child(5n) div { - -o-transform: rotate(5deg); - -webkit-transform: rotate(5deg); - -moz-transform: rotate(5deg); - position: relative; - top: -10px; -} - -ul.notes li div:hover, ul.notes li div:focus { - -webkit-transform: scale(1.1); - -moz-transform: scale(1.1); - -o-transform: scale(1.1); - position: relative; - z-index: 5; -} - -ul.notes li div { - text-decoration: none; - color: #000; - background: #ffc; - display: block; - height: 210px; - width: 210px; - padding: 1em; - box-shadow: 5px 5px 7px rgba(33, 33, 33, 0.7); - -webkit-transition: -webkit-transform 0.15s linear; -} -/* FILE MANAGER */ -.file-box { - float: left; - width: 220px; -} - -.file-manager h5 { - text-transform: uppercase; -} - -.file-manager { - list-style: none outside none; - margin: 0; - padding: 0; -} - -.folder-list li a { - color: #666666; - display: block; - padding: 5px 0; -} - -.folder-list li { - border-bottom: 1px solid #e7eaec; - display: block; -} - -.folder-list li i { - margin-right: 8px; - color: #3d4d5d; -} - -.category-list li a { - color: #666666; - display: block; - padding: 5px 0; -} - -.category-list li { - display: block; -} - -.category-list li i { - margin-right: 8px; - color: #3d4d5d; -} - -.category-list li a .text-navy { - color: #1ab394; -} - -.category-list li a .text-primary { - color: #1c84c6; -} - -.category-list li a .text-info { - color: #23c6c8; -} - -.category-list li a .text-danger { - color: #EF5352; -} - -.category-list li a .text-warning { - color: #F8AC59; -} - -.file-manager h5.tag-title { - margin-top: 20px; -} - -.tag-list li { - float: left; -} - -.tag-list li a { - font-size: 10px; - background-color: #f3f3f4; - padding: 5px 12px; - color: inherit; - border-radius: 2px; - border: 1px solid #e7eaec; - margin-right: 5px; - margin-top: 5px; - display: block; -} - -.file { - border: 1px solid #e7eaec; - padding: 0; - background-color: #ffffff; - position: relative; - margin-bottom: 20px; - margin-right: 20px; -} - -.file-manager .hr-line-dashed { - margin: 15px 0; -} - -.file .icon, .file .image { - height: 100px; - overflow: hidden; -} - -.file .icon { - padding: 15px 10px; - text-align: center; -} - -.file-control { - color: inherit; - font-size: 14px; - margin-right: 10px; -} - -.file-control.active { - text-decoration: underline; -} - -.file .icon i { - font-size: 70px; - color: #dadada; -} - -.file .file-name { - padding: 10px; - background-color: #f8f8f8; - border-top: 1px solid #e7eaec; -} - -.file-name small { - color: #676a6c; -} - -.corner { - position: absolute; - display: inline-block; - width: 0; - height: 0; - line-height: 0; - border: 0.6em solid transparent; - border-right: 0.6em solid #f1f1f1; - border-bottom: 0.6em solid #f1f1f1; - right: 0em; - bottom: 0em; -} - -a.compose-mail { - padding: 8px 10px; -} - -.mail-search { - max-width: 300px; -} -/* PROFILE */ -.profile-content { - border-top: none !important; -} - -.feed-activity-list .feed-element { - border-bottom: 1px solid #e7eaec; -} - -.feed-element:first-child { - margin-top: 0; -} - -.feed-element { - padding-bottom: 15px; -} - -.feed-element, .feed-element .media { - margin-top: 15px; -} - -.feed-element, .media-body { - overflow: hidden; -} - -.feed-element>.pull-left { - margin-right: 10px; -} - -.feed-element img.img-circle, .dropdown-messages-box img.img-circle { - width: 38px; - height: 38px; -} - -.feed-element .well { - border: 1px solid #e7eaec; - box-shadow: none; - margin-top: 10px; - margin-bottom: 5px; - padding: 10px 20px; - font-size: 11px; - line-height: 16px; -} - -.feed-element .actions { - margin-top: 10px; -} - -.feed-element .photos { - margin: 10px 0; -} - -.feed-photo { - max-height: 180px; - border-radius: 4px; - overflow: hidden; - margin-right: 10px; - margin-bottom: 10px; -} -/* MAILBOX */ -.mail-box { - background-color: #ffffff; - border: 1px solid #e7eaec; - border-top: 0; - padding: 0px; - margin-bottom: 20px; -} - -.mail-box-header { - background-color: #ffffff; - border: 1px solid #e7eaec; - border-bottom: 0; - padding: 30px 20px 20px 20px; -} - -.mail-box-header h2 { - margin-top: 0px; -} - -.mailbox-content .tag-list li a { - background: #ffffff; -} - -.mail-body { - border-top: 1px solid #e7eaec; - padding: 20px; -} - -.mail-text { - border-top: 1px solid #e7eaec; -} - -.mail-text .note-toolbar { - padding: 10px 15px; -} - -.mail-body .form-group { - margin-bottom: 5px; -} - -.mail-text .note-editor .note-toolbar { - background-color: #F9F8F8; -} - -.mail-attachment { - border-top: 1px solid #e7eaec; - padding: 20px; - font-size: 12px; -} - -.mailbox-content { - background: none; - border: none; - padding: 10px; -} - -.mail-ontact { - width: 23%; -} -/* PROJECTS */ -.project-people, .project-actions { - text-align: right; - vertical-align: middle; -} - -dd.project-people { - text-align: left; - margin-top: 5px; -} - -.project-people img { - width: 32px; - height: 32px; -} - -.project-title a { - font-size: 14px; - color: #676a6c; - font-weight: 600; -} - -.project-list table tr td { - border-top: none; - border-bottom: 1px solid #e7eaec; - padding: 15px 10px; - vertical-align: middle; -} - -.project-manager .tag-list li a { - font-size: 10px; - background-color: white; - padding: 5px 12px; - color: inherit; - border-radius: 2px; - border: 1px solid #e7eaec; - margin-right: 5px; - margin-top: 5px; - display: block; -} - -.project-files li a { - font-size: 11px; - color: #676a6c; - margin-left: 10px; - line-height: 22px; -} -/* FAQ */ -.faq-item { - padding: 20px; - margin-bottom: 2px; - background: #fff; -} - -.faq-question { - font-size: 18px; - font-weight: 600; - color: #1ab394; - display: block; -} - -.faq-question:hover { - color: #179d82; -} - -.faq-answer { - margin-top: 10px; - background: #f3f3f4; - border: 1px solid #e7eaec; - border-radius: 3px; - padding: 15px; -} - -.faq-item .tag-item { - background: #f3f3f4; - padding: 2px 6px; - font-size: 10px; - text-transform: uppercase; -} -/* Chat view */ -.message-input { - height: 90px !important; -} - -.chat-avatar { - white: 36px; - height: 36px; - float: left; - margin-right: 10px; -} - -.chat-user-name { - padding: 10px; -} - -.chat-user { - padding: 8px 10px; - border-bottom: 1px solid #e7eaec; -} - -.chat-user a { - color: inherit; -} - -.chat-view { - z-index: 20012; -} - -.chat-users, .chat-statistic { - margin-left: -30px; -} - -@media ( max-width : 992px) { - .chat-users, .chat-statistic { - margin-left: 0px; - } -} - -.chat-view .ibox-content { - padding: 0; -} - -.chat-message { - padding: 10px 20px; -} - -.message-avatar { - height: 48px; - width: 48px; - border: 1px solid #e7eaec; - border-radius: 4px; - margin-top: 1px; -} - -.chat-discussion .chat-message:nth-child(2n+1) .message-avatar { - float: left; - margin-right: 10px; -} - -.chat-discussion .chat-message:nth-child(2n) .message-avatar { - float: right; - margin-left: 10px; -} - -.message { - background-color: #fff; - border: 1px solid #e7eaec; - text-align: left; - display: block; - padding: 10px 20px; - position: relative; - border-radius: 4px; -} - -.chat-discussion .chat-message:nth-child(2n+1) .message-date { - float: right; -} - -.chat-discussion .chat-message:nth-child(2n) .message-date { - float: left; -} - -.chat-discussion .chat-message:nth-child(2n+1) .message { - text-align: left; - margin-left: 55px; -} - -.chat-discussion .chat-message:nth-child(2n) .message { - text-align: right; - margin-right: 55px; -} - -.message-date { - font-size: 10px; - color: #888888; -} - -.message-content { - display: block; -} - -.chat-discussion { - background: #eee; - padding: 15px; - height: 400px; - overflow-y: auto; -} - -.chat-users { - overflow-y: auto; - height: 400px; -} - -.chat-message-form .form-group { - margin-bottom: 0; -} -/* jsTree */ -.jstree-open>.jstree-anchor>.fa-folder:before { - content: "\f07c"; -} - -.jstree-default .jstree-icon.none { - width: 0; -} -/* CLIENTS */ -.clients-list { - margin-top: 20px; -} - -.clients-list .tab-pane { - position: relative; - height: 600px; -} - -.client-detail { - position: relative; - height: 620px; -} - -.clients-list table tr td { - height: 46px; - vertical-align: middle; - border: none; -} - -.client-link { - font-weight: 600; - color: inherit; -} - -.client-link:hover { - color: inherit; -} - -.client-avatar { - width: 42px; -} - -.client-avatar img { - width: 28px; - height: 28px; - border-radius: 50%; -} - -.contact-type { - width: 20px; - color: #c1c3c4; -} - -.client-status { - text-align: left; -} - -.client-detail .vertical-timeline-content p { - margin: 0; -} - -.client-detail .vertical-timeline-icon.gray-bg { - color: #a7aaab; -} - -.clients-list .nav-tabs>li.active>a, .clients-list .nav-tabs>li.active>a:hover, .clients-list .nav-tabs>li.active>a:focus { - border-bottom: 1px solid #fff; -} -/* BLOG ARTICLE */ -.blog h2 { - font-weight: 700; -} - -.blog h5 { - margin: 0 0 5px 0; -} - -.blog .btn { - margin: 0 0 5px 0; -} - -.article h1 { - font-size: 48px; - font-weight: 700; - color: #2F4050; -} - -.article p { - font-size: 15px; - line-height: 26px; -} - -.article-title { - text-align: center; - margin: 60px 0 40px 0; -} - -.article .ibox-content { - padding: 40px; -} -/* ISSUE TRACKER */ -.issue-tracker .btn-link { - color: #1ab394; -} - -table.issue-tracker tbody tr td { - vertical-align: middle; - height: 50px; -} - -.issue-info { - width: 50%; -} - -.issue-info a { - font-weight: 600; - color: #676a6c; -} - -.issue-info small { - display: block; -} -/* TEAMS */ -.team-members { - margin: 10px 0; -} - -.team-members img.img-circle { - width: 42px; - height: 42px; - margin-bottom: 5px; -} -/* AGILE BOARD */ -.sortable-list { - padding: 10px 0; -} - -.agile-list { - list-style: none; - margin: 0; -} - -.agile-list li { - background: #FAFAFB; - border: 1px solid #e7eaec; - margin: 0px 0 10px 0; - padding: 10px; - border-radius: 2px; -} - -.agile-list li:hover { - cursor: pointer; - background: #fff; -} - -.agile-list li.warning-element { - border-left: 3px solid #f8ac59; -} - -.agile-list li.danger-element { - border-left: 3px solid #ed5565; -} - -.agile-list li.info-element { - border-left: 3px solid #1c84c6; -} - -.agile-list li.success-element { - border-left: 3px solid #1ab394; -} - -.agile-detail { - margin-top: 5px; - font-size: 12px; -} -/* DIFF */ -ins { - background-color: #c6ffc6; - text-decoration: none; -} - -del { - background-color: #ffc6c6; -} - -#small-chat { - position: fixed; - bottom: 50px; - right: 26px; - z-index: 100; -} - -#small-chat .badge { - position: absolute; - top: -3px; - right: -4px; -} - -.open-small-chat { - height: 38px; - width: 38px; - display: block; - background: #1ab394; - padding: 9px 8px; - text-align: center; - color: #fff; - border-radius: 50%; -} - -.open-small-chat:hover { - color: white; - background: #1ab394; -} - -.small-chat-box { - display: none; - position: fixed; - bottom: 50px; - right: 80px; - background: #fff; - border: 1px solid #e7eaec; - width: 230px; - height: 320px; - border-radius: 4px; -} - -.small-chat-box.ng-small-chat { - display: block; -} - -.body-small .small-chat-box { - bottom: 70px; - right: 20px; -} - -.small-chat-box.active { - display: block; -} - -.small-chat-box .heading { - background: #2f4050; - padding: 8px 15px; - font-weight: bold; - color: #fff; -} - -.small-chat-box .chat-date { - opacity: 0.6; - font-size: 10px; - font-weight: normal; -} - -.small-chat-box .content { - padding: 15px 15px; -} - -.small-chat-box .content .author-name { - font-weight: bold; - margin-bottom: 3px; - font-size: 11px; -} - -.small-chat-box .content>div { - padding-bottom: 20px; -} - -.small-chat-box .content .chat-message { - padding: 5px 10px; - border-radius: 6px; - font-size: 11px; - line-height: 14px; - max-width: 80%; - background: #f3f3f4; - margin-bottom: 10px; -} - -.small-chat-box .content .chat-message.active { - background: #1ab394; - color: #fff; -} - -.small-chat-box .content .left { - text-align: left; - clear: both; -} - -.small-chat-box .content .left .chat-message { - float: left; -} - -.small-chat-box .content .right { - text-align: right; - clear: both; -} - -.small-chat-box .content .right .chat-message { - float: right; -} - -.small-chat-box .form-chat { - padding: 10px 10px; -} -/* - * Usage: - * - *

- * - */ -.sk-spinner-rotating-plane.sk-spinner { - width: 30px; - height: 30px; - background-color: #1ab394; - margin: 0 auto; - -webkit-animation: sk-rotatePlane 1.2s infinite ease-in-out; - animation: sk-rotatePlane 1.2s infinite ease-in-out; -} - -@-webkit-keyframes sk-rotatePlane { - 0% { - -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg); - transform: perspective(120px) rotateX(0deg) rotateY(0deg); - } - - 50% { - -webkit-transform: perspective(120px) rotateX(-180.1deg ) rotateY(0deg); - transform: perspective(120px) rotateX(-180.1deg ) rotateY(0deg); - } - - 100% { - -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-180deg); - transform: perspective(120px) rotateX(-180deg) rotateY(-180deg); - } -} - -@keyframes sk-rotatePlane { - 0% { - -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg); - transform: perspective(120px) rotateX(0deg) rotateY(0deg); - } - - 50% { - -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); - transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); - } - - 100% { - -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg ); - transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg ); - } -} -/* - * Usage: - * - *
- *
- *
- *
- * - */ -.sk-spinner-double-bounce.sk-spinner { - width: 40px; - height: 40px; - position: relative; - margin: 0 auto; -} - -.sk-spinner-double-bounce .sk-double-bounce1, .sk-spinner-double-bounce .sk-double-bounce2 { - width: 100%; - height: 100%; - border-radius: 50%; - background-color: #1ab394; - opacity: 0.6; - position: absolute; - top: 0; - left: 0; - -webkit-animation: sk-doubleBounce 2s infinite ease-in-out; - animation: sk-doubleBounce 2s infinite ease-in-out; -} - -.sk-spinner-double-bounce .sk-double-bounce2 { - -webkit-animation-delay: -1s; - animation-delay: -1s; -} - -@-webkit-keyframes sk-doubleBounce { - 0%, 100% { - -webkit-transform: scale(0); - transform: scale(0); - } - - 50% { - -webkit-transform: scale(1); - transform: scale(1); - } -} - -@keyframes sk-doubleBounce { - 0%, 100% { - -webkit-transform: scale(0); - transform: scale(0); - } - - 50% { - -webkit-transform: scale(1); - transform: scale(1); - } -} -/* - * Usage: - * - *
- *
- *
- *
- *
- *
- *
- * - */ -.sk-spinner-wave.sk-spinner { - margin: 0 auto; - width: 50px; - height: 30px; - text-align: center; - font-size: 10px; -} - -.sk-spinner-wave div { - background-color: #1ab394; - height: 100%; - width: 6px; - display: inline-block; - -webkit-animation: sk-waveStretchDelay 1.2s infinite ease-in-out; - animation: sk-waveStretchDelay 1.2s infinite ease-in-out; -} - -.sk-spinner-wave .sk-rect2 { - -webkit-animation-delay: -1.1s; - animation-delay: -1.1s; -} - -.sk-spinner-wave .sk-rect3 { - -webkit-animation-delay: -1s; - animation-delay: -1s; -} - -.sk-spinner-wave .sk-rect4 { - -webkit-animation-delay: -0.9s; - animation-delay: -0.9s; -} - -.sk-spinner-wave .sk-rect5 { - -webkit-animation-delay: -0.8s; - animation-delay: -0.8s; -} - -@-webkit-keyframes sk-waveStretchDelay { - 0%, 40%, 100% { - -webkit-transform: scaleY(0.4); - transform: scaleY(0.4); - } - - 20% { - -webkit-transform: scaleY(1); - transform: scaleY(1); - } -} - -@keyframes sk-waveStretchDelay { - 0%, 40%, 100% { - -webkit-transform: scaleY(0.4); - transform: scaleY(0.4); - } - - 20% { - -webkit-transform: scaleY(1); - transform: scaleY(1); - } -} -/* - * Usage: - * - *
- *
- *
- *
- * - */ -.sk-spinner-wandering-cubes.sk-spinner { - margin: 0 auto; - width: 32px; - height: 32px; - position: relative; -} - -.sk-spinner-wandering-cubes .sk-cube1, .sk-spinner-wandering-cubes .sk-cube2 { - background-color: #1ab394; - width: 10px; - height: 10px; - position: absolute; - top: 0; - left: 0; - -webkit-animation: sk-wanderingCubeMove 1.8s infinite ease-in-out; - animation: sk-wanderingCubeMove 1.8s infinite ease-in-out; -} - -.sk-spinner-wandering-cubes .sk-cube2 { - -webkit-animation-delay: -0.9s; - animation-delay: -0.9s; -} - -@-webkit-keyframes sk-wanderingCubeMove { - 25% { - -webkit-transform: translateX(42px) rotate(-90deg) scale(0.5); - transform: translateX(42px) rotate(-90deg) scale(0.5); - } - - 50% { - /* Hack to make FF rotate in the right direction */ - -webkit-transform: translateX(42px) translateY(42px) rotate(-179deg); - transform: translateX(42px) translateY(42px) rotate(-179deg); - } - -50.1% { - -webkit-transform: translateX(42px) translateY(42px) rotate(-180deg); - transform: translateX(42px) translateY(42px) rotate(-180deg); -} - -75% { - -webkit-transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0 .5 ); - transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0 .5 ); -} - -100% { - -webkit-transform: rotate(-360deg); - transform: rotate(-360deg); -} -} - -@keyframes sk-wanderingCubeMove { - 25% { - -webkit-transform: translateX(42px) rotate(-90deg) scale(0.5); - transform: translateX(42px) rotate(-90deg) scale(0.5); - } - - 50% { - /* Hack to make FF rotate in the right direction */ - -webkit-transform: translateX(42px) translateY(42px) rotate(-179deg); - transform: translateX(42px) translateY(42px) rotate(-179deg); - } - - 50.1%{ - -webkit-transform: translateX(42px) translateY(42px) rotate(-180deg); - transform: translateX(42px) translateY(42px) rotate(-180deg); - } - - 75% { - -webkit-transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0 .5 ); - transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0 .5 ); - } - - 100% { - -webkit-transform: rotate(-360deg); - transform: rotate(-360deg); - } -} -/* - * Usage: - * - *
- * - */ -.sk-spinner-pulse.sk-spinner { - width: 40px; - height: 40px; - margin: 0 auto; - background-color: #1ab394; - border-radius: 100%; - -webkit-animation: sk-pulseScaleOut 1s infinite ease-in-out; - animation: sk-pulseScaleOut 1s infinite ease-in-out; -} - -@-webkit-keyframes sk-pulseScaleOut { - 0% { - -webkit-transform: scale(0); - transform: scale(0); - } - - 100% { - -webkit-transform: scale(1); - transform: scale(1); - opacity: 0; - } -} - -@keyframes sk-pulseScaleOut { - 0% { - -webkit-transform: scale(0); - transform: scale(0); - } - - 100% { - -webkit-transform: scale(1); - transform: scale(1); - opacity: 0; - } -} -/* - * Usage: - * - *
- *
- *
- *
- * - */ -.sk-spinner-chasing-dots.sk-spinner { - margin: 0 auto; - width: 40px; - height: 40px; - position: relative; - text-align: center; - -webkit-animation: sk-chasingDotsRotate 2s infinite linear; - animation: sk-chasingDotsRotate 2s infinite linear; -} - -.sk-spinner-chasing-dots .sk-dot1, .sk-spinner-chasing-dots .sk-dot2 { - width: 60%; - height: 60%; - display: inline-block; - position: absolute; - top: 0; - background-color: #1ab394; - border-radius: 100%; - -webkit-animation: sk-chasingDotsBounce 2s infinite ease-in-out; - animation: sk-chasingDotsBounce 2s infinite ease-in-out; -} - -.sk-spinner-chasing-dots .sk-dot2 { - top: auto; - bottom: 0px; - -webkit-animation-delay: -1s; - animation-delay: -1s; -} - -@-webkit-keyframes sk-chasingDotsRotate { - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} - -@keyframes sk-chasingDotsRotate { - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} - -@-webkit-keyframes sk-chasingDotsBounce { - 0%, 100% { - -webkit-transform: scale(0); - transform: scale(0); - } - - 50% { - -webkit-transform: scale(1); - transform: scale(1); - } -} - -@keyframes sk-chasingDotsBounce { - 0%, 100% { - -webkit-transform: scale(0); - transform: scale(0); - } - - 50% { - -webkit-transform: scale(1); - transform: scale(1); - } -} -/* - * Usage: - * - *
- *
- *
- *
- *
- * - */ -.sk-spinner-three-bounce.sk-spinner { - margin: 0 auto; - width: 70px; - text-align: center; -} - -.sk-spinner-three-bounce div { - width: 18px; - height: 18px; - background-color: #1ab394; - border-radius: 100%; - display: inline-block; - -webkit-animation: sk-threeBounceDelay 1.4s infinite ease-in-out; - animation: sk-threeBounceDelay 1.4s infinite ease-in-out; - /* Prevent first frame from flickering when animation starts */ - -webkit-animation-fill-mode: both; - animation-fill-mode: both; -} - -.sk-spinner-three-bounce .sk-bounce1 { - -webkit-animation-delay: -0.32s; - animation-delay: -0.32s; -} - -.sk-spinner-three-bounce .sk-bounce2 { - -webkit-animation-delay: -0.16s; - animation-delay: -0.16s; -} - -@-webkit-keyframes sk-threeBounceDelay { - 0%, 80%, 100% { - -webkit-transform: scale(0); - transform: scale(0); - } - - 40% { - -webkit-transform: scale(1); - transform: scale(1); - } -} - -@keyframes sk-threeBounceDelay { - 0%, 80%, 100% { - -webkit-transform: scale(0); - transform: scale(0); - } - - 40% { - -webkit-transform: scale(1); - transform: scale(1); - } -} -/* - * Usage: - * - *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- * - */ -.sk-spinner-circle.sk-spinner { - margin: 0 auto; - width: 22px; - height: 22px; - position: relative; -} - -.sk-spinner-circle .sk-circle { - width: 100%; - height: 100%; - position: absolute; - left: 0; - top: 0; -} - -.sk-spinner-circle .sk-circle:before { - content: ''; - display: block; - margin: 0 auto; - width: 20%; - height: 20%; - background-color: #1ab394; - border-radius: 100%; - -webkit-animation: sk-circleBounceDelay 1.2s infinite ease-in-out; - animation: sk-circleBounceDelay 1.2s infinite ease-in-out; - /* Prevent first frame from flickering when animation starts */ - -webkit-animation-fill-mode: both; - animation-fill-mode: both; -} - -.sk-spinner-circle .sk-circle2 { - -webkit-transform: rotate(30deg); - -ms-transform: rotate(30deg); - transform: rotate(30deg); -} - -.sk-spinner-circle .sk-circle3 { - -webkit-transform: rotate(60deg); - -ms-transform: rotate(60deg); - transform: rotate(60deg); -} - -.sk-spinner-circle .sk-circle4 { - -webkit-transform: rotate(90deg); - -ms-transform: rotate(90deg); - transform: rotate(90deg); -} - -.sk-spinner-circle .sk-circle5 { - -webkit-transform: rotate(120deg); - -ms-transform: rotate(120deg); - transform: rotate(120deg); -} - -.sk-spinner-circle .sk-circle6 { - -webkit-transform: rotate(150deg); - -ms-transform: rotate(150deg); - transform: rotate(150deg); -} - -.sk-spinner-circle .sk-circle7 { - -webkit-transform: rotate(180deg); - -ms-transform: rotate(180deg); - transform: rotate(180deg); -} - -.sk-spinner-circle .sk-circle8 { - -webkit-transform: rotate(210deg); - -ms-transform: rotate(210deg); - transform: rotate(210deg); -} - -.sk-spinner-circle .sk-circle9 { - -webkit-transform: rotate(240deg); - -ms-transform: rotate(240deg); - transform: rotate(240deg); -} - -.sk-spinner-circle .sk-circle10 { - -webkit-transform: rotate(270deg); - -ms-transform: rotate(270deg); - transform: rotate(270deg); -} - -.sk-spinner-circle .sk-circle11 { - -webkit-transform: rotate(300deg); - -ms-transform: rotate(300deg); - transform: rotate(300deg); -} - -.sk-spinner-circle .sk-circle12 { - -webkit-transform: rotate(330deg); - -ms-transform: rotate(330deg); - transform: rotate(330deg); -} - -.sk-spinner-circle .sk-circle2:before { - -webkit-animation-delay: -1.1s; - animation-delay: -1.1s; -} - -.sk-spinner-circle .sk-circle3:before { - -webkit-animation-delay: -1s; - animation-delay: -1s; -} - -.sk-spinner-circle .sk-circle4:before { - -webkit-animation-delay: -0.9s; - animation-delay: -0.9s; -} - -.sk-spinner-circle .sk-circle5:before { - -webkit-animation-delay: -0.8s; - animation-delay: -0.8s; -} - -.sk-spinner-circle .sk-circle6:before { - -webkit-animation-delay: -0.7s; - animation-delay: -0.7s; -} - -.sk-spinner-circle .sk-circle7:before { - -webkit-animation-delay: -0.6s; - animation-delay: -0.6s; -} - -.sk-spinner-circle .sk-circle8:before { - -webkit-animation-delay: -0.5s; - animation-delay: -0.5s; -} - -.sk-spinner-circle .sk-circle9:before { - -webkit-animation-delay: -0.4s; - animation-delay: -0.4s; -} - -.sk-spinner-circle .sk-circle10:before { - -webkit-animation-delay: -0.3s; - animation-delay: -0.3s; -} - -.sk-spinner-circle .sk-circle11:before { - -webkit-animation-delay: -0.2s; - animation-delay: -0.2s; -} - -.sk-spinner-circle .sk-circle12:before { - -webkit-animation-delay: -0.1s; - animation-delay: -0.1s; -} - -@-webkit-keyframes sk-circleBounceDelay { - 0%, 80%, 100% { - -webkit-transform: scale(0); - transform: scale(0); - } - - 40% { - -webkit-transform: scale(1); - transform: scale(1); - } -} - -@keyframes sk-circleBounceDelay { - 0%, 80%, 100% { - -webkit-transform: scale(0); - transform: scale(0); - } - - 40% { - -webkit-transform: scale(1); - transform: scale(1); - } -} -/* - * Usage: - * - *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- * - */ -.sk-spinner-cube-grid { - /* - * Spinner positions - * 1 2 3 - * 4 5 6 - * 7 8 9 - */ -} - -.sk-spinner-cube-grid.sk-spinner { - width: 30px; - height: 30px; - margin: 0 auto; -} - -.sk-spinner-cube-grid .sk-cube { - width: 33%; - height: 33%; - background-color: #1ab394; - float: left; - -webkit-animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out; - animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out; -} - -.sk-spinner-cube-grid .sk-cube:nth-child(1) { - -webkit-animation-delay: 0.2s; - animation-delay: 0.2s; -} - -.sk-spinner-cube-grid .sk-cube:nth-child(2) { - -webkit-animation-delay: 0.3s; - animation-delay: 0.3s; -} - -.sk-spinner-cube-grid .sk-cube:nth-child(3) { - -webkit-animation-delay: 0.4s; - animation-delay: 0.4s; -} - -.sk-spinner-cube-grid .sk-cube:nth-child(4) { - -webkit-animation-delay: 0.1s; - animation-delay: 0.1s; -} - -.sk-spinner-cube-grid .sk-cube:nth-child(5) { - -webkit-animation-delay: 0.2s; - animation-delay: 0.2s; -} - -.sk-spinner-cube-grid .sk-cube:nth-child(6) { - -webkit-animation-delay: 0.3s; - animation-delay: 0.3s; -} - -.sk-spinner-cube-grid .sk-cube:nth-child(7) { - -webkit-animation-delay: 0s; - animation-delay: 0s; -} - -.sk-spinner-cube-grid .sk-cube:nth-child(8) { - -webkit-animation-delay: 0.1s; - animation-delay: 0.1s; -} - -.sk-spinner-cube-grid .sk-cube:nth-child(9) { - -webkit-animation-delay: 0.2s; - animation-delay: 0.2s; -} - -@-webkit-keyframes sk-cubeGridScaleDelay { - 0%, 70%, 100% { - -webkit-transform: scale3D(1, 1, 1); - transform: scale3D(1, 1, 1); - } - - 35% { - -webkit-transform: scale3D(0, 0, 1); - transform: scale3D(0, 0, 1); - } -} - -@keyframes sk-cubeGridScaleDelay { - 0%, 70%, 100% { - -webkit-transform: scale3D(1, 1, 1); - transform: scale3D(1, 1, 1); - } - - 35% { - -webkit-transform: scale3D(0, 0, 1); - transform: scale3D(0, 0, 1); - } -} -/* - * Usage: - * - *
- * - *
- * - */ -.sk-spinner-wordpress.sk-spinner { - background-color: #1ab394; - width: 30px; - height: 30px; - border-radius: 30px; - position: relative; - margin: 0 auto; - -webkit-animation: sk-innerCircle 1s linear infinite; - animation: sk-innerCircle 1s linear infinite; -} - -.sk-spinner-wordpress .sk-inner-circle { - display: block; - background-color: #fff; - width: 8px; - height: 8px; - position: absolute; - border-radius: 8px; - top: 5px; - left: 5px; -} - -@-webkit-keyframes sk-innerCircle { - 0% { - -webkit-transform: rotate(0); - transform: rotate(0); - } - - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} - -@keyframes sk-innerCircle { - 0% { - -webkit-transform: rotate(0); - transform: rotate(0); - } - - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} -/* - * Usage: - * - *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- * - */ -.sk-spinner-fading-circle.sk-spinner { - margin: 0 auto; - width: 22px; - height: 22px; - position: relative; -} - -.sk-spinner-fading-circle .sk-circle { - width: 100%; - height: 100%; - position: absolute; - left: 0; - top: 0; -} - -.sk-spinner-fading-circle .sk-circle:before { - content: ''; - display: block; - margin: 0 auto; - width: 18%; - height: 18%; - background-color: #1ab394; - border-radius: 100%; - -webkit-animation: sk-circleFadeDelay 1.2s infinite ease-in-out; - animation: sk-circleFadeDelay 1.2s infinite ease-in-out; - /* Prevent first frame from flickering when animation starts */ - -webkit-animation-fill-mode: both; - animation-fill-mode: both; -} - -.sk-spinner-fading-circle .sk-circle2 { - -webkit-transform: rotate(30deg); - -ms-transform: rotate(30deg); - transform: rotate(30deg); -} - -.sk-spinner-fading-circle .sk-circle3 { - -webkit-transform: rotate(60deg); - -ms-transform: rotate(60deg); - transform: rotate(60deg); -} - -.sk-spinner-fading-circle .sk-circle4 { - -webkit-transform: rotate(90deg); - -ms-transform: rotate(90deg); - transform: rotate(90deg); -} - -.sk-spinner-fading-circle .sk-circle5 { - -webkit-transform: rotate(120deg); - -ms-transform: rotate(120deg); - transform: rotate(120deg); -} - -.sk-spinner-fading-circle .sk-circle6 { - -webkit-transform: rotate(150deg); - -ms-transform: rotate(150deg); - transform: rotate(150deg); -} - -.sk-spinner-fading-circle .sk-circle7 { - -webkit-transform: rotate(180deg); - -ms-transform: rotate(180deg); - transform: rotate(180deg); -} - -.sk-spinner-fading-circle .sk-circle8 { - -webkit-transform: rotate(210deg); - -ms-transform: rotate(210deg); - transform: rotate(210deg); -} - -.sk-spinner-fading-circle .sk-circle9 { - -webkit-transform: rotate(240deg); - -ms-transform: rotate(240deg); - transform: rotate(240deg); -} - -.sk-spinner-fading-circle .sk-circle10 { - -webkit-transform: rotate(270deg); - -ms-transform: rotate(270deg); - transform: rotate(270deg); -} - -.sk-spinner-fading-circle .sk-circle11 { - -webkit-transform: rotate(300deg); - -ms-transform: rotate(300deg); - transform: rotate(300deg); -} - -.sk-spinner-fading-circle .sk-circle12 { - -webkit-transform: rotate(330deg); - -ms-transform: rotate(330deg); - transform: rotate(330deg); -} - -.sk-spinner-fading-circle .sk-circle2:before { - -webkit-animation-delay: -1.1s; - animation-delay: -1.1s; -} - -.sk-spinner-fading-circle .sk-circle3:before { - -webkit-animation-delay: -1s; - animation-delay: -1s; -} - -.sk-spinner-fading-circle .sk-circle4:before { - -webkit-animation-delay: -0.9s; - animation-delay: -0.9s; -} - -.sk-spinner-fading-circle .sk-circle5:before { - -webkit-animation-delay: -0.8s; - animation-delay: -0.8s; -} - -.sk-spinner-fading-circle .sk-circle6:before { - -webkit-animation-delay: -0.7s; - animation-delay: -0.7s; -} - -.sk-spinner-fading-circle .sk-circle7:before { - -webkit-animation-delay: -0.6s; - animation-delay: -0.6s; -} - -.sk-spinner-fading-circle .sk-circle8:before { - -webkit-animation-delay: -0.5s; - animation-delay: -0.5s; -} - -.sk-spinner-fading-circle .sk-circle9:before { - -webkit-animation-delay: -0.4s; - animation-delay: -0.4s; -} - -.sk-spinner-fading-circle .sk-circle10:before { - -webkit-animation-delay: -0.3s; - animation-delay: -0.3s; -} - -.sk-spinner-fading-circle .sk-circle11:before { - -webkit-animation-delay: -0.2s; - animation-delay: -0.2s; -} - -.sk-spinner-fading-circle .sk-circle12:before { - -webkit-animation-delay: -0.1s; - animation-delay: -0.1s; -} - -@-webkit-keyframes sk-circleFadeDelay { - 0%, 39%, 100% { - opacity: 0; - } - - 40% { - opacity: 1; - } -} - -@keyframes sk-circleFadeDelay { - 0%,39%,100% { - opacity: 0; - } - - 40% { - opacity: 1; - } -} - -body.rtls { - /* Theme config */ -} - -body.rtls #page-wrapper { - margin: 0 220px 0 0; -} - -body.rtls .nav-second-level li a { - padding: 7px 35px 7px 10px; -} - -body.rtls .ibox-title h5 { - float: right; -} - -body.rtls .pull-right { - float: left !important; -} - -body.rtls .pull-left { - float: right !important; -} - -body.rtls .ibox-tools { - float: left; -} - -body.rtls .stat-percent { - float: left; -} - -body.rtls .navbar-right { - float: left !important; -} - -body.rtls .navbar-top-links li:last-child { - margin-left: 40px; - margin-right: 0; -} - -body.rtls .minimalize-styl-2 { - float: right; - margin: 14px 20px 5px 5px; -} - -body.rtls .feed-element>.pull-left { - margin-left: 10px; - margin-right: 0; -} - -body.rtls .timeline-item .date { - text-align: left; -} - -body.rtls .timeline-item .date i { - left: 0; - right: auto; -} - -body.rtls .timeline-item .content { - border-right: 1px solid #e7eaec; - border-left: none; -} - -body.rtls .toast-close-button { - float: left; -} - -body.rtls #toast-container>.toast:before { - margin: auto -1.5em auto 0.5em; -} - -body.rtls #toast-container>div { - padding: 15px 50px 15px 15px; -} - -body.rtls .center-orientation .vertical-timeline-icon i { - margin-left: 0; - margin-right: -12px; -} - -body.rtls .vertical-timeline-icon i { - right: 50%; - left: auto; - margin-left: auto; - margin-right: -12px; -} - -body.rtls .file-box { - float: right; -} - -body.rtls ul.notes li { - float: right; -} - -body.rtls .chat-users, body.rtls .chat-statistic { - margin-right: -30px; - margin-left: auto; -} - -body.rtls .dropdown-menu>li>a { - text-align: right; -} - -body.rtls .b-r { - border-left: 1px solid #e7eaec; - border-right: none; -} - -body.rtls .dd-list .dd-list { - padding-right: 30px; - padding-left: 0; -} - -body.rtls .dd-item>button { - float: right; -} - -body.rtls .skin-setttings { - margin-right: 40px; - margin-left: 0; -} - -body.rtls .skin-setttings { - direction: ltr; -} - -body.rtls .footer.fixed { - margin-right: 220px; - margin-left: 0; -} - -@media ( max-width : 992px) { - body.rtls .chat-users, body.rtls .chat-statistic { - margin-right: 0px; - } -} - -body.rtls.mini-navbar .footer.fixed, body.body-small.mini-navbar .footer.fixed { - margin: 0 70px 0 0; -} - -body.rtls.mini-navbar.fixed-sidebar .footer.fixed, body.body-small.mini-navbar .footer.fixed { - margin: 0 0 0 0; -} - -body.rtls.top-navigation .navbar-toggle { - float: right; - margin-left: 15px; - margin-right: 15px; -} - -.body-small.rtls.top-navigation .navbar-header { - float: none; -} - -body.rtls.top-navigation #page-wrapper { - margin: 0; -} - -body.rtls.mini-navbar #page-wrapper { - margin: 0 70px 0 0; -} - -body.rtls.mini-navbar.fixed-sidebar #page-wrapper { - margin: 0 0 0 0; -} - -body.rtls.body-small.fixed-sidebar.mini-navbar #page-wrapper { - margin: 0 220px 0 0; -} - -body.rtls.body-small.fixed-sidebar.mini-navbar .navbar-static-side { - width: 220px; -} - -.body-small.rtls .navbar-fixed-top { - margin-right: 0px; -} - -.body-small.rtls .navbar-header { - float: right; -} - -body.rtls .navbar-top-links li:last-child { - margin-left: 20px; -} - -body.rtls .top-navigation #page-wrapper, body.rtls.mini-navbar .top-navigation #page-wrapper, body.rtls.mini-navbar.top-navigation #page-wrapper { - margin: 0; -} - -body.rtls .top-navigation .footer.fixed, body.rtls.top-navigation .footer.fixed { - margin: 0; -} - -@media ( max-width : 768px) { - body.rtls .navbar-top-links li:last-child { - margin-left: 20px; - } - - .body-small.rtls #page-wrapper { - position: inherit; - margin: 0 0 0 0px; - min-height: 1000px; - } - - .body-small.rtls .navbar-static-side { - display: none; - z-index: 2001; - position: absolute; - width: 70px; - } - - .body-small.rtls.mini-navbar .navbar-static-side { - display: block; - } - - .rtls.fixed-sidebar.body-small .navbar-static-side { - display: none; - z-index: 2001; - position: fixed; - width: 220px; - } - - .rtls.fixed-sidebar.body-small.mini-navbar .navbar-static-side { - display: block; - } -} - -.rtls .ltr-support { - direction: ltr; -} -/* - * - * This is style for skin config - * Use only in demo theme - * -*/ -.skin-setttings .title { - background: #efefef; - text-align: center; - text-transform: uppercase; - font-weight: 600; - display: block; - padding: 10px 15px; - font-size: 12px; -} - -.setings-item { - padding: 10px 30px; -} - -.setings-item.nb { - border: none; -} - -.setings-item.skin { - text-align: center; -} - -.setings-item .switch { - float: right; -} - -.skin-name a { - text-transform: uppercase; -} - -.setings-item a { - color: #fff; -} - -.default-skin, .blue-skin, .ultra-skin, .yellow-skin { - text-align: center; -} - -.default-skin { - font-weight: 600; - background: #1ab394; -} - -.default-skin:hover { - background: #199d82; -} - -.blue-skin { - font-weight: 600; - background: url("patterns/header-profile-skin-1.png") repeat scroll 0 0; -} - -.blue-skin:hover { - background: #0d8ddb; -} - -.yellow-skin { - font-weight: 600; - background: url("patterns/header-profile-skin-3.png") repeat scroll 0 100%; -} - -.yellow-skin:hover { - background: #ce8735; -} - -.content-tabs { - border-bottom: solid 2px #2f4050; -} - -.page-tabs a { - color: #999; -} - -.page-tabs a i { - color: #ccc; -} - -.page-tabs a.active { - background: #2f4050; - color: #a7b1c2; -} - -.page-tabs a.active:hover, .page-tabs a.active i:hover { - background: #293846; - color: #fff; -} -/* - * - * SKIN 1 - H+ - 后台主题UI框架 - * NAME - Blue light - * -*/ -.skin-1 .minimalize-styl-2 { - margin: 14px 5px 5px 30px; -} - -.skin-1 .navbar-top-links li:last-child { - margin-right: 30px; -} - -.skin-1.fixed-nav .minimalize-styl-2 { - margin: 14px 5px 5px 15px; -} - -.skin-1 .spin-icon { - background: #0e9aef !important; -} - -.skin-1 .nav-header { - background: #0e9aef; - background: url('patterns/header-profile-skin-1.png'); -} - -.skin-1.mini-navbar .nav-second-level { - background: #3e495f; -} - -.skin-1 .breadcrumb { - background: transparent; -} - -.skin-1 .page-heading { - border: none; -} - -.skin-1 .nav>li.active { - background: #3a4459; -} - -.skin-1 .nav>li>a { - color: #9ea6b9; -} - -.skin-1 .nav>li.active>a { - color: #fff; -} - -.skin-1 .navbar-minimalize { - background: #0e9aef; - border-color: #0e9aef; -} - -body.skin-1 { - background: #3e495f; -} - -.skin-1 .navbar-static-top { - background: #ffffff; -} - -.skin-1 .dashboard-header { - background: transparent; - border-bottom: none !important; - border-top: none; - padding: 20px 30px 10px 30px; -} - -.fixed-nav.skin-1 .navbar-fixed-top { - background: #fff; -} - -.skin-1 .wrapper-content { - padding: 30px 15px; -} - -.skin-1 #page-wrapper { - background: #f4f6fa; -} - -.skin-1 .ibox-title, .skin-1 .ibox-content { - border-width: 1px; -} - -.skin-1 .ibox-content:last-child { - border-style: solid solid solid solid; -} - -.skin-1 .nav>li.active { - border: none; -} - -.skin-1 .nav-header { - padding: 35px 25px 25px 25px; -} - -.skin-1 .nav-header a.dropdown-toggle { - color: #fff; - margin-top: 10px; -} - -.skin-1 .nav-header a.dropdown-toggle .text-muted { - color: #fff; - opacity: 0.8; -} - -.skin-1 .profile-element { - text-align: center; -} - -.skin-1 .img-circle { - border-radius: 5px; -} - -.skin-1 .navbar-default .nav>li>a:hover, .skin-1 .navbar-default .nav>li>a:focus { - background: #39aef5; - color: #fff; -} - -.skin-1 .nav.nav-tabs>li.active>a { - color: #555; -} - -.skin-1 .content-tabs { - border-bottom: solid 2px #39aef5; -} - -.skin-1 .nav.nav-tabs>li.active { - background: transparent; -} - -.skin-1 .page-tabs a.active { - background: #39aef5; - color: #fff; -} - -.skin-1 .page-tabs a.active:hover, .skin-1 .page-tabs a.active i:hover { - background: #0e9aef; - color: #fff; -} -/* - * - * SKIN 3 - H+ - 后台主题UI框架 - * NAME - Yellow/purple - * -*/ -.skin-3 .minimalize-styl-2 { - margin: 14px 5px 5px 30px; -} - -.skin-3 .navbar-top-links li:last-child { - margin-right: 30px; -} - -.skin-3.fixed-nav .minimalize-styl-2 { - margin: 14px 5px 5px 15px; -} - -.skin-3 .spin-icon { - background: #ecba52 !important; -} - -body.boxed-layout.skin-3 #wrapper { - background: #3e2c42; -} - -.skin-3 .nav-header { - background: #ecba52; - background: url('patterns/header-profile-skin-3.png'); -} - -.skin-3.mini-navbar .nav-second-level { - background: #3e2c42; -} - -.skin-3 .breadcrumb { - background: transparent; -} - -.skin-3 .page-heading { - border: none; -} - -.skin-3 .nav>li.active { - background: #38283c; -} - -.fixed-nav.skin-3 .navbar-fixed-top { - background: #fff; -} - -.skin-3 .nav>li>a { - color: #948b96; -} - -.skin-3 .nav>li.active>a { - color: #fff; -} - -.skin-3 .navbar-minimalize { - background: #ecba52; - border-color: #ecba52; -} - -body.skin-3 { - background: #3e2c42; -} - -.skin-3 .navbar-static-top { - background: #ffffff; -} - -.skin-3 .dashboard-header { - background: transparent; - border-bottom: none !important; - border-top: none; - padding: 20px 30px 10px 30px; -} - -.skin-3 .wrapper-content { - padding: 30px 15px; -} - -.skin-3 #page-wrapper { - background: #f4f6fa; -} - -.skin-3 .ibox-title, .skin-3 .ibox-content { - border-width: 1px; -} - -.skin-3 .ibox-content:last-child { - border-style: solid solid solid solid; -} - -.skin-3 .nav>li.active { - border: none; -} - -.skin-3 .nav-header { - padding: 35px 25px 25px 25px; -} - -.skin-3 .nav-header a.dropdown-toggle { - color: #fff; - margin-top: 10px; -} - -.skin-3 .nav-header a.dropdown-toggle .text-muted { - color: #fff; - opacity: 0.8; -} - -.skin-3 .profile-element { - text-align: center; -} - -.skin-3 .img-circle { - border-radius: 5px; -} - -.skin-3 .navbar-default .nav>li>a:hover, .skin-3 .navbar-default .nav>li>a:focus { - background: #38283c; - color: #fff; -} - -.skin-3 .nav.nav-tabs>li.active>a { - color: #555; -} - -.skin-3 .nav.nav-tabs>li.active { - background: transparent; -} - -.skin-3 .content-tabs { - border-bottom: solid 2px #3e2c42; -} - -.skin-3 .nav.nav-tabs>li.active { - background: transparent; -} - -.skin-3 .page-tabs a.active { - background: #3e2c42; - color: #fff; -} - -.skin-3 .page-tabs a.active:hover, .skin-3 .page-tabs a.active i:hover { - background: #38283c; - color: #fff; -} - -@media ( min-width : 768px) { - .navbar-top-links .dropdown-messages, .navbar-top-links .dropdown-tasks, .navbar-top-links .dropdown-alerts { - margin-left: auto; - } -} - -@media ( max-width : 768px) { - body.fixed-sidebar .navbar-static-side { - display: none; - } - - body.fixed-sidebar.mini-navbar .navbar-static-side { - width: 70px; - } - - .lock-word { - display: none; - } - - .navbar-form-custom { - display: none; - } - - .navbar-header { - display: inline; - float: left; - } - - .sidebard-panel { - z-index: 2; - position: relative; - width: auto; - min-height: 100% !important; - } - - .sidebar-content .wrapper { - padding-right: 0px; - z-index: 1; - } - - .fixed-sidebar.body-small .navbar-static-side { - display: none; - z-index: 2001; - position: fixed; - width: 220px; - } - - .fixed-sidebar.body-small.mini-navbar .navbar-static-side { - display: block; - } - - .ibox-tools { - float: none; - text-align: right; - display: block; - } - - .content-tabs { - display: none; - } - - #content-main { - height: calc(100% - 100px); - } - - .fixed-nav #content-main { - height: calc(100% - 38px); - } -} - -.navbar-static-side { - background: #2f4050; -} - -.nav-close { - padding: 10px; - display: block; - position: absolute; - right: 5px; - top: 5px; - font-size: 1.4em; - cursor: pointer; - z-index: 10; - display: none; - color: rgba(255, 255, 255, .3); -} - -@media ( max-width : 350px) { - body.fixed-sidebar.mini-navbar .navbar-static-side { - width: 0; - } - - .nav-close { - display: block; - } - - #page-wrapper { - margin-left: 0 !important; - } - - .timeline-item .date { - text-align: left; - width: 110px; - position: relative; - padding-top: 30px; - } - - .timeline-item .date i { - position: absolute; - top: 0; - left: 15px; - padding: 5px; - width: 30px; - text-align: center; - border: 1px solid #e7eaec; - background: #f8f8f8; - } - - .timeline-item .content { - border-left: none; - border-top: 1px solid #e7eaec; - padding-top: 10px; - min-height: 100px; - } - - .nav.navbar-top-links li.dropdown { - display: none; - } - - .ibox-tools { - float: none; - text-align: left; - display: inline-block; - } -} -/*JQGRID*/ -.ui-jqgrid-titlebar { - height: 40px; - line-height: 24px; - color: #676a6c; - background-color: #F9F9F9; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); -} - -.ui-jqgrid .ui-jqgrid-title { - float: left; - margin-left: 5px; - font-weight: 700; -} - -.ui-jqgrid .ui-jqgrid-titlebar { - position: relative; - border-left: 0px solid; - border-right: 0px solid; - border-top: 0px solid; -} -/* Social feed */ -.social-feed-separated .social-feed-box { - margin-left: 62px; -} - -.social-feed-separated .social-avatar { - float: left; - padding: 0; -} - -.social-feed-separated .social-avatar img { - width: 52px; - height: 52px; - border: 1px solid #e7eaec; -} - -.social-feed-separated .social-feed-box .social-avatar { - padding: 15px 15px 0 15px; - float: none; -} - -.social-feed-box { - /*padding: 15px;*/ - border: 1px solid #e7eaec; - background: #fff; - margin-bottom: 15px; -} - -.article .social-feed-box { - margin-bottom: 0; - border-bottom: none; -} - -.article .social-feed-box:last-child { - margin-bottom: 0; - border-bottom: 1px solid #e7eaec; -} - -.article .social-feed-box p { - font-size: 13px; - line-height: 18px; -} - -.social-action { - margin: 15px; -} - -.social-avatar { - padding: 15px 15px 0 15px; -} - -.social-comment .social-comment { - margin-left: 45px; -} - -.social-avatar img { - height: 40px; - width: 40px; - margin-right: 10px; -} - -.social-avatar .media-body a { - font-size: 14px; - display: block; -} - -.social-body { - padding: 15px; -} - -.social-body img { - margin-bottom: 10px; -} - -.social-footer { - border-top: 1px solid #e7eaec; - padding: 10px 15px; - background: #f9f9f9; -} - -.social-footer .social-comment img { - width: 32px; - margin-right: 10px; -} - -.social-comment:first-child { - margin-top: 0; -} - -.social-comment { - margin-top: 15px; -} - -.social-comment textarea { - font-size: 12px; -} - -.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] { - /* margin-top: -4px; */ -} - -/* Only demo */ -@media ( max-width : 1000px) { - .welcome-message { - display: none; - } -} -/* ECHARTS */ -.echarts { - height: 240px; -} - -.checkbox-inline, .radio-inline, .checkbox-inline+.checkbox-inline, .radio-inline+.radio-inline { - margin: 0 15px 0 0; - font-size: 14px; -} - -.navbar-toggle { - background-color: #fff; -} - -.J_menuTab { - -webkit-transition: all .3s ease-out 0s; - transition: all .3s ease-out 0s; -} - -::-webkit-scrollbar-track { - background-color: #F5F5F5; -} - -::-webkit-scrollbar { - width: 6px; - background-color: #F5F5F5; -} - -::-webkit-scrollbar-thumb { - background-color: #999; -} -/*GO HOME*/ -.gohome { - position: fixed; - top: 20px; - right: 20px; - z-index: 100; -} - -.gohome a { - height: 38px; - width: 38px; - display: block; - background: #2f4050; - padding: 9px 8px; - text-align: center; - color: #fff; - border-radius: 50%; - opacity: .5; -} - -.gohome a:hover { - opacity: 1; -} - -@media only screen and (-webkit-min-device-pixel-ratio : 2) { - #content-main { - -webkit-overflow-scrolling: touch; - } -} - -.navbar-header { - width: 60%; -} - -.bs-glyphicons { - margin: 0 -10px 20px; - overflow: hidden -} - -.bs-glyphicons-list { - padding-left: 0; - list-style: none -} - -.bs-glyphicons li { - float: left; - width: 25%; - height: 115px; - padding: 10px; - font-size: 10px; - line-height: 1.4; - text-align: center; - background-color: #f9f9f9; - border: 1px solid #fff -} - -.bs-glyphicons .glyphicon { - margin-top: 5px; - margin-bottom: 10px; - font-size: 24px -} - -.bs-glyphicons .glyphicon-class { - display: block; - text-align: center; - word-wrap: break-word -} - -.bs-glyphicons li:hover { - color: #fff; - background-color: #1ab394; -} - -@media ( min-width : 768px) { - .bs-glyphicons { - margin-right: 0; - margin-left: 0 - } - - .bs-glyphicons li { - width: 12.5%; - font-size: 12px - } -} - -.t-bar { - padding-bottom: 10px; -} -.nopadding{ - padding:0; -} - -/*编辑器按钮样式冲突*/ -.note-editor .btn-default { - color: #333333!important; - background-color: #ffffff!important; - border-color: #cccccc!important; -} - diff --git a/api/src/main/resources/static/css/user-manage.css b/api/src/main/resources/static/css/user-manage.css deleted file mode 100644 index 3abf6ab1790bef73c6821acd2a8b8d9f397c94f8..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/css/user-manage.css +++ /dev/null @@ -1,3 +0,0 @@ -#hint{ - visibility: hidden; -} \ No newline at end of file diff --git a/api/src/main/resources/static/font/nth-icons.eot b/api/src/main/resources/static/font/nth-icons.eot deleted file mode 100644 index a84a254c625626692127ff10497408a1ba8413de..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/font/nth-icons.eot and /dev/null differ diff --git a/api/src/main/resources/static/font/nth-icons.svg b/api/src/main/resources/static/font/nth-icons.svg deleted file mode 100644 index b20634e31b728fc5ef972efe2715959897f4b834..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/font/nth-icons.svg +++ /dev/null @@ -1,463 +0,0 @@ - - - - - Created by FontForge 20120731 at Thu Feb 25 19:14:59 2016 - By kaptinlin,,, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/api/src/main/resources/static/font/nth-icons.ttf b/api/src/main/resources/static/font/nth-icons.ttf deleted file mode 100644 index 7626bfa362506a3d363ab11b8b61e742dcb1e193..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/font/nth-icons.ttf and /dev/null differ diff --git a/api/src/main/resources/static/font/nth-icons.woff2 b/api/src/main/resources/static/font/nth-icons.woff2 deleted file mode 100644 index a0195f9d5e53da29fb212b8282dfb8b632ea085c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/font/nth-icons.woff2 and /dev/null differ diff --git a/api/src/main/resources/static/img/Concrete_Jungle.jpg b/api/src/main/resources/static/img/Concrete_Jungle.jpg deleted file mode 100644 index dfce8a1e9274c6acbcec87d03aebe043180fa32f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/Concrete_Jungle.jpg and /dev/null differ diff --git a/api/src/main/resources/static/img/bg_login.jpg b/api/src/main/resources/static/img/bg_login.jpg deleted file mode 100644 index 019c09522e6650607683b8c74f00e26c65cf01f2..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/bg_login.jpg and /dev/null differ diff --git a/api/src/main/resources/static/img/cross.png b/api/src/main/resources/static/img/cross.png deleted file mode 100644 index 6aa783cee89a4da25283b9374af5d5f0844d231f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/cross.png and /dev/null differ diff --git a/api/src/main/resources/static/img/loading.gif b/api/src/main/resources/static/img/loading.gif deleted file mode 100644 index 253a94d7b4bec3127c5417debba36994fba618d5..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/loading.gif and /dev/null differ diff --git a/api/src/main/resources/static/img/my_wx_qr.png b/api/src/main/resources/static/img/my_wx_qr.png deleted file mode 100644 index e7fc2ff32702bac82edd1530894071da240b690a..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/my_wx_qr.png and /dev/null differ diff --git a/api/src/main/resources/static/img/pc-40x40.png b/api/src/main/resources/static/img/pc-40x40.png deleted file mode 100644 index 0c313151719352c7be27d39a02f0a83bdd1b0c85..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/pc-40x40.png and /dev/null differ diff --git a/api/src/main/resources/static/img/photo_s.jpg b/api/src/main/resources/static/img/photo_s.jpg deleted file mode 100644 index 2af1461f47dce3a0e6f149930c65acd2ad300509..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/photo_s.jpg and /dev/null differ diff --git a/api/src/main/resources/static/img/qrcode-40x40.png b/api/src/main/resources/static/img/qrcode-40x40.png deleted file mode 100644 index aae4524a78594c7e8008887a849c65f1cb20d83d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/qrcode-40x40.png and /dev/null differ diff --git a/api/src/main/resources/static/img/tick.png b/api/src/main/resources/static/img/tick.png deleted file mode 100644 index ceda05bfb4082679a596381cd87d004e3feab4da..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/tick.png and /dev/null differ diff --git a/api/src/main/resources/static/img/user-160x160.png b/api/src/main/resources/static/img/user-160x160.png deleted file mode 100644 index fe8e01d8ba0414d9e58354418b08b1f5393f008c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/user-160x160.png and /dev/null differ diff --git a/api/src/main/resources/static/img/user2-160x160.jpg b/api/src/main/resources/static/img/user2-160x160.jpg deleted file mode 100644 index aec74cb233fcd2ba3be78fba57873ca877aa89b5..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/user2-160x160.jpg and /dev/null differ diff --git a/api/src/main/resources/static/img/user3-128x128.jpg b/api/src/main/resources/static/img/user3-128x128.jpg deleted file mode 100644 index caf5f9662419ff4bb7d6d067f017868b29b5fc05..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/user3-128x128.jpg and /dev/null differ diff --git a/api/src/main/resources/static/img/user4-128x128.jpg b/api/src/main/resources/static/img/user4-128x128.jpg deleted file mode 100644 index eb8e2bb73f4007edee164e50a7a582a4d8860c1c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/img/user4-128x128.jpg and /dev/null differ diff --git a/api/src/main/resources/static/js/app.js b/api/src/main/resources/static/js/app.js deleted file mode 100644 index c99a23abd48b0b6bba9e455477030f023e24d9eb..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/app.js +++ /dev/null @@ -1,278 +0,0 @@ -//自定义js - -//公共配置 - - -$(document).ready(function () { - - // MetsiMenu - $('#side-menu').metisMenu(); - - // 打开右侧边栏 - $('.right-sidebar-toggle').click(function () { - $('#right-sidebar').toggleClass('sidebar-open'); - }); - - // 右侧边栏使用slimscroll - $('.sidebar-container').slimScroll({ - height: '100%', - railOpacity: 0.4, - wheelStep: 10 - }); - - // 打开聊天窗口 - $('.open-small-chat').click(function () { - $(this).children().toggleClass('fa-comments').toggleClass('fa-remove'); - $('.small-chat-box').toggleClass('active'); - }); - - // 聊天窗口使用slimscroll - $('.small-chat-box .content').slimScroll({ - height: '234px', - railOpacity: 0.4 - }); - - // Small todo handler - $('.check-link').click(function () { - var button = $(this).find('i'); - var label = $(this).next('span'); - button.toggleClass('fa-check-square').toggleClass('fa-square-o'); - label.toggleClass('todo-completed'); - return false; - }); - - //固定菜单栏 - $(function () { - $('.sidebar-collapse').slimScroll({ - height: '100%', - railOpacity: 0.9, - alwaysVisible: false - }); - }); - - - // 菜单切换 - $('.navbar-minimalize').click(function () { - $("body").toggleClass("mini-navbar"); - SmoothlyMenu(); - }); - - - // 侧边栏高度 - function fix_height() { - var heightWithoutNavbar = $("body > #wrapper").height() - 61; - $(".sidebard-panel").css("min-height", heightWithoutNavbar + "px"); - } - fix_height(); - - $(window).bind("load resize click scroll", function () { - if (!$("body").hasClass('body-small')) { - fix_height(); - } - }); - - //侧边栏滚动 - $(window).scroll(function () { - if ($(window).scrollTop() > 0 && !$('body').hasClass('fixed-nav')) { - $('#right-sidebar').addClass('sidebar-top'); - } else { - $('#right-sidebar').removeClass('sidebar-top'); - } - }); - - $('.full-height-scroll').slimScroll({ - height: '100%' - }); - - $('#side-menu>li').click(function () { - if ($('body').hasClass('mini-navbar')) { - NavToggle(); - } - }); - $('#side-menu>li li a').click(function () { - if ($(window).width() < 769) { - NavToggle(); - } - }); - - $('.nav-close').click(NavToggle); - - //ios浏览器兼容性处理 - if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { - $('#content-main').css('overflow-y', 'auto'); - } - -}); - -$(window).bind("load resize", function () { - if ($(this).width() < 769) { - $('body').addClass('mini-navbar'); - $('.navbar-static-side').fadeIn(); - } -}); - -function NavToggle() { - $('.navbar-minimalize').trigger('click'); -} - -function SmoothlyMenu() { - if (!$('body').hasClass('mini-navbar')) { - $('#side-menu').hide(); - setTimeout( - function () { - $('#side-menu').fadeIn(500); - }, 100); - } else if ($('body').hasClass('fixed-sidebar')) { - $('#side-menu').hide(); - setTimeout( - function () { - $('#side-menu').fadeIn(500); - }, 300); - } else { - $('#side-menu').removeAttr('style'); - } -} - - -//主题设置 -$(function () { - - // 顶部菜单固定 - $('#fixednavbar').click(function () { - if ($('#fixednavbar').is(':checked')) { - $(".navbar-static-top").removeClass('navbar-static-top').addClass('navbar-fixed-top'); - $("body").removeClass('boxed-layout'); - $("body").addClass('fixed-nav'); - $('#boxedlayout').prop('checked', false); - - if (localStorageSupport) { - localStorage.setItem("boxedlayout", 'off'); - } - - if (localStorageSupport) { - localStorage.setItem("fixednavbar", 'on'); - } - } else { - $(".navbar-fixed-top").removeClass('navbar-fixed-top').addClass('navbar-static-top'); - $("body").removeClass('fixed-nav'); - - if (localStorageSupport) { - localStorage.setItem("fixednavbar", 'off'); - } - } - }); - - - // 收起左侧菜单 - $('#collapsemenu').click(function () { - if ($('#collapsemenu').is(':checked')) { - $("body").addClass('mini-navbar'); - SmoothlyMenu(); - - if (localStorageSupport) { - localStorage.setItem("collapse_menu", 'on'); - } - - } else { - $("body").removeClass('mini-navbar'); - SmoothlyMenu(); - - if (localStorageSupport) { - localStorage.setItem("collapse_menu", 'off'); - } - } - }); - - // 固定宽度 - $('#boxedlayout').click(function () { - if ($('#boxedlayout').is(':checked')) { - $("body").addClass('boxed-layout'); - $('#fixednavbar').prop('checked', false); - $(".navbar-fixed-top").removeClass('navbar-fixed-top').addClass('navbar-static-top'); - $("body").removeClass('fixed-nav'); - if (localStorageSupport) { - localStorage.setItem("fixednavbar", 'off'); - } - - - if (localStorageSupport) { - localStorage.setItem("boxedlayout", 'on'); - } - } else { - $("body").removeClass('boxed-layout'); - - if (localStorageSupport) { - localStorage.setItem("boxedlayout", 'off'); - } - } - }); - - // 默认主题 - $('.s-skin-0').click(function () { - $("body").removeClass("skin-1"); - $("body").removeClass("skin-2"); - $("body").removeClass("skin-3"); - return false; - }); - - // 蓝色主题 - $('.s-skin-1').click(function () { - $("body").removeClass("skin-2"); - $("body").removeClass("skin-3"); - $("body").addClass("skin-1"); - return false; - }); - - // 黄色主题 - $('.s-skin-3').click(function () { - $("body").removeClass("skin-1"); - $("body").removeClass("skin-2"); - $("body").addClass("skin-3"); - return false; - }); - - if (localStorageSupport) { - var collapse = localStorage.getItem("collapse_menu"); - var fixednavbar = localStorage.getItem("fixednavbar"); - var boxedlayout = localStorage.getItem("boxedlayout"); - - if (collapse == 'on') { - $('#collapsemenu').prop('checked', 'checked') - } - if (fixednavbar == 'on') { - $('#fixednavbar').prop('checked', 'checked') - } - if (boxedlayout == 'on') { - $('#boxedlayout').prop('checked', 'checked') - } - } - - if (localStorageSupport) { - - var collapse = localStorage.getItem("collapse_menu"); - var fixednavbar = localStorage.getItem("fixednavbar"); - var boxedlayout = localStorage.getItem("boxedlayout"); - - var body = $('body'); - - if (collapse == 'on') { - if (!body.hasClass('body-small')) { - body.addClass('mini-navbar'); - } - } - - if (fixednavbar == 'on') { - $(".navbar-static-top").removeClass('navbar-static-top').addClass('navbar-fixed-top'); - body.addClass('fixed-nav'); - } - - if (boxedlayout == 'on') { - body.addClass('boxed-layout'); - } - } -}); - -//判断浏览器是否支持html5本地存储 -function localStorageSupport() { - return (('localStorage' in window) && window['localStorage'] !== null) -} diff --git a/api/src/main/resources/static/js/bootstrap.min.js b/api/src/main/resources/static/js/bootstrap.min.js deleted file mode 100644 index e364a137eb19d1c80f9137e093e55621a0b539f2..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v3.3.6 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under the MIT license - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); diff --git a/api/src/main/resources/static/js/common.js b/api/src/main/resources/static/js/common.js deleted file mode 100644 index fedc62ad74c7135486eb47183f7252f6b73b4256..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/common.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * - * User: simon - * Date: 2018/06/07 - * Time: 13:01 - **/ -function setTokenInHeader() { - var token = $("meta[name='_csrf']").attr("content"); - var header = $("meta[name='_csrf_header']").attr("content"); - $(document).ajaxSend(function (e, xhr, options) { - xhr.setRequestHeader(header, token); - }); -} - -//左侧菜单栏选中事件初始化 -$('.sidebar-menu li').each(function () { - $(this).removeClass("active"); -}); -var pathValue = window.location.href; -var pathName = pathValue.substring(pathValue.lastIndexOf('/') + 1); -$('.sidebar-menu li').each(function () { - if(pathName == '' && $(this).children('a').attr('href').indexOf('index') != -1){ - $(this).addClass("active"); - $(this).parents(".treeview").addClass("active"); - }else if(pathName != '' && $(this).children('a').attr('href') && $(this).children('a').attr('href').indexOf(pathName) != -1){ - $(this).addClass("active"); - $(this).parents(".treeview").addClass("active"); - } -}); - -/*var theme = $.cookie('theme'); -console.log(theme); -if(!theme || null == theme){ - theme = 'blue'; - $.cookie('theme', theme); -} -changeTheme(theme);*/ - -function changeTheme(themeName) { - /*$('body').removeClass('skin-blue skin-blue-light skin-green skin-green-light skin-red skin-red-light skin-black skin-black-light skin-purple skin-purple-light skin-yellow skin-yellow-light');*/ - $('body').removeClass($.cookie('theme')); - $('body').addClass(themeName); - $.cookie('theme', themeName, {expires: 30}); -} - -function doRequest(options) { - let requestData = $(options.formId).serializeArray(); - let sideMenuGroup = {}; - let i; - for(i = 0; i < requestData.length; i++){ - //如果存在相同的属性,则该属性值是数组类型。 - if(sideMenuGroup[requestData[i].name]){ - sideMenuGroup[requestData[i].name] += ',' + requestData[i].value; - }else{ - sideMenuGroup[requestData[i].name] = requestData[i].value; - } - } - $.ajax({ - url: options.url, - type: options.type, - data: JSON.stringify(sideMenuGroup), - contentType: "application/json;charset=UTF-8", - beforeSend: function(){ - console.log('请稍候......'); - }, - complete: function(){ - console.log('close'); - }, - success:function (data) { - console.log(data); - if(data.code == 200){ - console.log('操作成功!'); - } - } - }); -} \ No newline at end of file diff --git a/api/src/main/resources/static/js/contabs.js b/api/src/main/resources/static/js/contabs.js deleted file mode 100644 index 2f3112bf814bb361171f8f0038722b6a79d858d4..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/contabs.js +++ /dev/null @@ -1,310 +0,0 @@ - -$(function () { - //计算元素集合的总宽度 - function calSumWidth(elements) { - var width = 0; - $(elements).each(function () { - width += $(this).outerWidth(true); - }); - return width; - } - //滚动到指定选项卡 - function scrollToTab(element) { - var marginLeftVal = calSumWidth($(element).prevAll()), marginRightVal = calSumWidth($(element).nextAll()); - // 可视区域非tab宽度 - var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".J_menuTabs")); - //可视区域tab宽度 - var visibleWidth = $(".content-tabs").outerWidth(true) - tabOuterWidth; - //实际滚动宽度 - var scrollVal = 0; - if ($(".page-tabs-content").outerWidth() < visibleWidth) { - scrollVal = 0; - } else if (marginRightVal <= (visibleWidth - $(element).outerWidth(true) - $(element).next().outerWidth(true))) { - if ((visibleWidth - $(element).next().outerWidth(true)) > marginRightVal) { - scrollVal = marginLeftVal; - var tabElement = element; - while ((scrollVal - $(tabElement).outerWidth()) > ($(".page-tabs-content").outerWidth() - visibleWidth)) { - scrollVal -= $(tabElement).prev().outerWidth(); - tabElement = $(tabElement).prev(); - } - } - } else if (marginLeftVal > (visibleWidth - $(element).outerWidth(true) - $(element).prev().outerWidth(true))) { - scrollVal = marginLeftVal - $(element).prev().outerWidth(true); - } - $('.page-tabs-content').animate({ - marginLeft: 0 - scrollVal + 'px' - }, "fast"); - } - //查看左侧隐藏的选项卡 - function scrollTabLeft() { - var marginLeftVal = Math.abs(parseInt($('.page-tabs-content').css('margin-left'))); - // 可视区域非tab宽度 - var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".J_menuTabs")); - //可视区域tab宽度 - var visibleWidth = $(".content-tabs").outerWidth(true) - tabOuterWidth; - //实际滚动宽度 - var scrollVal = 0; - if ($(".page-tabs-content").width() < visibleWidth) { - return false; - } else { - var tabElement = $(".J_menuTab:first"); - var offsetVal = 0; - while ((offsetVal + $(tabElement).outerWidth(true)) <= marginLeftVal) {//找到离当前tab最近的元素 - offsetVal += $(tabElement).outerWidth(true); - tabElement = $(tabElement).next(); - } - offsetVal = 0; - if (calSumWidth($(tabElement).prevAll()) > visibleWidth) { - while ((offsetVal + $(tabElement).outerWidth(true)) < (visibleWidth) && tabElement.length > 0) { - offsetVal += $(tabElement).outerWidth(true); - tabElement = $(tabElement).prev(); - } - scrollVal = calSumWidth($(tabElement).prevAll()); - } - } - $('.page-tabs-content').animate({ - marginLeft: 0 - scrollVal + 'px' - }, "fast"); - } - //查看右侧隐藏的选项卡 - function scrollTabRight() { - var marginLeftVal = Math.abs(parseInt($('.page-tabs-content').css('margin-left'))); - // 可视区域非tab宽度 - var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".J_menuTabs")); - //可视区域tab宽度 - var visibleWidth = $(".content-tabs").outerWidth(true) - tabOuterWidth; - //实际滚动宽度 - var scrollVal = 0; - if ($(".page-tabs-content").width() < visibleWidth) { - return false; - } else { - var tabElement = $(".J_menuTab:first"); - var offsetVal = 0; - while ((offsetVal + $(tabElement).outerWidth(true)) <= marginLeftVal) {//找到离当前tab最近的元素 - offsetVal += $(tabElement).outerWidth(true); - tabElement = $(tabElement).next(); - } - offsetVal = 0; - while ((offsetVal + $(tabElement).outerWidth(true)) < (visibleWidth) && tabElement.length > 0) { - offsetVal += $(tabElement).outerWidth(true); - tabElement = $(tabElement).next(); - } - scrollVal = calSumWidth($(tabElement).prevAll()); - if (scrollVal > 0) { - $('.page-tabs-content').animate({ - marginLeft: 0 - scrollVal + 'px' - }, "fast"); - } - } - } - - //通过遍历给菜单项加上data-index属性 - $(".J_menuItem").each(function (index) { - if (!$(this).attr('data-index')) { - $(this).attr('data-index', index); - } - }); - - function menuItem() { - // 获取标识数据 - var dataUrl = $(this).attr('href'), - dataIndex = $(this).data('index'), - menuName = $.trim($(this).text()), - flag = true; - if (dataUrl == undefined || $.trim(dataUrl).length == 0)return false; - - // 选项卡菜单已存在 - $('.J_menuTab').each(function () { - if ($(this).data('id') == dataUrl) { - if (!$(this).hasClass('active')) { - $(this).addClass('active').siblings('.J_menuTab').removeClass('active'); - scrollToTab(this); - // 显示tab对应的内容区 - $('.J_mainContent .J_iframe').each(function () { - if ($(this).data('id') == dataUrl) { - $(this).show().siblings('.J_iframe').hide(); - return false; - } - }); - } - flag = false; - return false; - } - }); - - // 选项卡菜单不存在 - if (flag) { - var str = '' + menuName + ' '; - $('.J_menuTab').removeClass('active'); - - // 添加选项卡对应的iframe - var str1 = ''; - $('.J_mainContent').find('iframe.J_iframe').hide().parents('.J_mainContent').append(str1); - - //显示loading提示 -// var loading = layer.load(); -// -// $('.J_mainContent iframe:visible').load(function () { -// //iframe加载完成后隐藏loading提示 -// layer.close(loading); -// }); - // 添加选项卡 - $('.J_menuTabs .page-tabs-content').append(str); - scrollToTab($('.J_menuTab.active')); - } - return false; - } - - $('.J_menuItem').on('click', menuItem); - - // 关闭选项卡菜单 - function closeTab() { - var closeTabId = $(this).parents('.J_menuTab').data('id'); - var currentWidth = $(this).parents('.J_menuTab').width(); - - // 当前元素处于活动状态 - if ($(this).parents('.J_menuTab').hasClass('active')) { - - // 当前元素后面有同辈元素,使后面的一个元素处于活动状态 - if ($(this).parents('.J_menuTab').next('.J_menuTab').size()) { - - var activeId = $(this).parents('.J_menuTab').next('.J_menuTab:eq(0)').data('id'); - $(this).parents('.J_menuTab').next('.J_menuTab:eq(0)').addClass('active'); - - $('.J_mainContent .J_iframe').each(function () { - if ($(this).data('id') == activeId) { - $(this).show().siblings('.J_iframe').hide(); - return false; - } - }); - - var marginLeftVal = parseInt($('.page-tabs-content').css('margin-left')); - if (marginLeftVal < 0) { - $('.page-tabs-content').animate({ - marginLeft: (marginLeftVal + currentWidth) + 'px' - }, "fast"); - } - - // 移除当前选项卡 - $(this).parents('.J_menuTab').remove(); - - // 移除tab对应的内容区 - $('.J_mainContent .J_iframe').each(function () { - if ($(this).data('id') == closeTabId) { - $(this).remove(); - return false; - } - }); - } - - // 当前元素后面没有同辈元素,使当前元素的上一个元素处于活动状态 - if ($(this).parents('.J_menuTab').prev('.J_menuTab').size()) { - var activeId = $(this).parents('.J_menuTab').prev('.J_menuTab:last').data('id'); - $(this).parents('.J_menuTab').prev('.J_menuTab:last').addClass('active'); - $('.J_mainContent .J_iframe').each(function () { - if ($(this).data('id') == activeId) { - $(this).show().siblings('.J_iframe').hide(); - return false; - } - }); - - // 移除当前选项卡 - $(this).parents('.J_menuTab').remove(); - - // 移除tab对应的内容区 - $('.J_mainContent .J_iframe').each(function () { - if ($(this).data('id') == closeTabId) { - $(this).remove(); - return false; - } - }); - } - } - // 当前元素不处于活动状态 - else { - // 移除当前选项卡 - $(this).parents('.J_menuTab').remove(); - - // 移除相应tab对应的内容区 - $('.J_mainContent .J_iframe').each(function () { - if ($(this).data('id') == closeTabId) { - $(this).remove(); - return false; - } - }); - scrollToTab($('.J_menuTab.active')); - } - return false; - } - - $('.J_menuTabs').on('click', '.J_menuTab i', closeTab); - - //关闭其他选项卡 - function closeOtherTabs(){ - $('.page-tabs-content').children("[data-id]").not(":first").not(".active").each(function () { - $('.J_iframe[data-id="' + $(this).data('id') + '"]').remove(); - $(this).remove(); - }); - $('.page-tabs-content').css("margin-left", "0"); - } - $('.J_tabCloseOther').on('click', closeOtherTabs); - - //滚动到已激活的选项卡 - function showActiveTab(){ - scrollToTab($('.J_menuTab.active')); - } - $('.J_tabShowActive').on('click', showActiveTab); - - - // 点击选项卡菜单 - function activeTab() { - if (!$(this).hasClass('active')) { - var currentId = $(this).data('id'); - // 显示tab对应的内容区 - $('.J_mainContent .J_iframe').each(function () { - if ($(this).data('id') == currentId) { - $(this).show().siblings('.J_iframe').hide(); - return false; - } - }); - $(this).addClass('active').siblings('.J_menuTab').removeClass('active'); - scrollToTab(this); - } - } - - $('.J_menuTabs').on('click', '.J_menuTab', activeTab); - - //刷新iframe - function refreshTab() { - var target = $('.J_iframe[data-id="' + $(this).data('id') + '"]'); - var url = target.attr('src'); -// //显示loading提示 -// var loading = layer.load(); -// target.attr('src', url).load(function () { -// //关闭loading提示 -// layer.close(loading); -// }); - } - - $('.J_menuTabs').on('dblclick', '.J_menuTab', refreshTab); - - // 左移按扭 - $('.J_tabLeft').on('click', scrollTabLeft); - - // 右移按扭 - $('.J_tabRight').on('click', scrollTabRight); - - // 关闭全部 - $('.J_tabCloseAll').on('click', function () { - $('.page-tabs-content').children("[data-id]").not(":first").each(function () { - $('.J_iframe[data-id="' + $(this).data('id') + '"]').remove(); - $(this).remove(); - }); - $('.page-tabs-content').children("[data-id]:first").each(function () { - $('.J_iframe[data-id="' + $(this).data('id') + '"]').show(); - $(this).addClass("active"); - }); - $('.page-tabs-content').css("margin-left", "0"); - }); - -}); diff --git a/api/src/main/resources/static/js/easyui/base_loading.js b/api/src/main/resources/static/js/easyui/base_loading.js deleted file mode 100644 index acdc6434b94c3a9dd94b4e2c1eff4a37ffc80292..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/easyui/base_loading.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * User: simon - * Date: 2018/10/31 - * Time: 0:00 - **/ -//获取浏览器页面可见高度和宽度 -let _PageHeight = document.documentElement.clientHeight, - _PageWidth = document.documentElement.clientWidth; -//计算loading框距离顶部和左部的距离(loading框的宽度为215px,高度为61px) -let _LoadingTop = _PageHeight > 61 ? (_PageHeight - 61) / 2 : 0, - _LoadingLeft = _PageWidth > 61 ? (_PageWidth - 61) / 2 : 0; -//加载gif地址 -let Loadimagerul = "/img/loading.gif"; -//在页面未加载完毕之前显示的loading Html自定义内容 -let _LoadingHtml = '
'; -//呈现loading效果 -document.write(_LoadingHtml); -//监听加载状态改变 -document.onreadystatechange = completeLoading; - -//加载状态为complete时移除loading效果 -function completeLoading() { - if (document.readyState == "complete") { - let loadingMask = document.getElementById('loadingDiv'); - loadingMask.parentNode.removeChild(loadingMask); - } -} \ No newline at end of file diff --git a/api/src/main/resources/static/js/easyui/common.js b/api/src/main/resources/static/js/easyui/common.js deleted file mode 100644 index 39f0c080aefda75b4bfbd6d1510790efc6ec6e10..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/easyui/common.js +++ /dev/null @@ -1,739 +0,0 @@ -/** - * - * User: simon - * Date: 2018/10/30 - * Time: 9:54 - **/ -document.write(''); - -function setTokenInHeader() { - let token = $("meta[name='_csrf']").attr("content"); - let header = $("meta[name='_csrf_header']").attr("content"); - $(document).ajaxSend(function (e, xhr, options) { - xhr.setRequestHeader(header, token); - }); -} - -$(function(){ - //setTokenInHeader(); - - //只用一种初始化方法来声明easyUI组件以避免重复的提交请求,即删除html中的class声明(class="easyui-datagrid") - $('#tt').datagrid({ - onBeforeLoad: function (param) { - let pageNo = param.page; - delete param.page; - param.pageNo = pageNo; - let pageSize = param.rows; - delete param.rows; - param.pageSize = pageSize; - let sort = param.sort; - delete param.sort; - let order = param.order; - delete param.order; - let orderBy = ((!sort) ? "" : sort) + " " + ((!order) ? "" : order); - orderBy = orderBy.trim(); - param.orderBy = orderBy; - }, - onLoadSuccess: function (data) { - //重新渲染 - $(".easyui-linkbutton").linkbutton(); - $(".easyui-numberbox").numberbox(); - } - }); - - $('#table_tg').treegrid({ - onBeforeLoad: function (row, param) { - let pageNo = param.page; - delete param.page; - param.pageNo = pageNo; - let pageSize = param.rows; - delete param.rows; - param.pageSize = pageSize; - let sort = param.sort; - delete param.sort; - let order = param.order; - delete param.order; - let orderBy = ((!sort) ? "" : sort) + " " + ((!order) ? "" : order); - orderBy = orderBy.trim(); - param.orderBy = orderBy; - }, - onLoadSuccess: function (row, data) { - //重新渲染 - $(".easyui-linkbutton").linkbutton(); - $(".easyui-numberbox").numberbox(); - } - }); - - $('body').on('click', 'img.image-thumb',function (event) { - $('#dlg').html('头像'); - $('#dlg').dialog('open'); - }); - -}); - -/*function initEditor() { - let token = $("meta[name='_csrf']").attr("content"); - $('textarea').froalaEditor({ - width: '100%', - language: 'zh_cn', - height: 300, - heightMax: 500, - heightMin: 200, - fileUploadParam: 'file', - fileUploadURL: '/fileUploads/uploadFile', - fileUploadParams: {}, - fileUploadMethod: 'POST', - fileMaxSize: 20 * 1024 * 1024, - fileAllowedTypes: ['*'], - imageAllowedTypes: ['jpeg', 'jpg', 'png'], - imageDefaultWidth: 600, - imageMaxSize: 1024 * 1024 * 3, - imageMinWidth: 600, - imageUploadParam: 'file', - imageUploadRemoteUrls: false, - imageUploadURL: '/fileUploads/uploadFile', - requestHeaders: { - 'X-CSRF-TOKEN':token - } - }); - - $('textarea').on('froalaEditor.contentChanged', function (e, editor) { - console.log($(this).froalaEditor('html.get', true)); - $('input[name="content"]').val($(this).froalaEditor('html.get', true)); - }); - - $('textarea').on('froalaEditor.file.uploaded', function (e, editor, response) { - console.log("uploaded=" + response); - }).on('froalaEditor.file.error', function (e, editor, error, response) { - console.log("error=" + JSON.stringify(error)); - console.log("response" + response); - // Bad link. - if (error.code == 1) { - console.log("bad link"); - } - - // No link in upload response. - else if (error.code == 2) { - console.log("No link in upload response."); - } - - // Error during file upload. - else if (error.code == 3) { - console.log("Error during file upload."); - } - - // Parsing response failed. - else if (error.code == 4) { - console.log("Parsing response failed."); - } - - // File too text-large. - else if (error.code == 5) { - console.log("File too text-large."); - } - - // Invalid file type. - else if (error.code == 6) { - console.log("Invalid file type."); - } - - // File can be uploaded only to same domain in IE 8 and IE 9. - else if (error.code == 7) { - console.log("File can be uploaded only to same domain in IE 8 and IE 9."); - } - - // Response contains the original server response to the request if available. - }); - - $('textarea').on('froalaEditor.image.uploaded', function (e, editor, response) { - console.log("uploaded=" + response); - var json = jQuery.parseJSON(response); - var img_URL = json['link']; - editor.image.insert(img_URL, false, {'class': 'image-thumb'}, editor.image.get(), null); - return false; - }); - - //$('textarea').off('froalaEditor.file.uploaded'); - $('textarea').off('froalaEditor.contentChanged'); - //$('textarea').off('froalaEditor.image.uploaded'); - $('textarea').off('froalaEditor.file.uploaded'); -}*/ - -function getLocalTime(timestamp) { - return new Date(parseInt(timestamp)).toLocaleString().replace(/:\d{1,2}$/, ' '); -} - -Date.prototype.format = function(format) { - let date = { - "M+": this.getMonth() + 1, - "d+": this.getDate(), - "h+": this.getHours(), - "m+": this.getMinutes(), - "s+": this.getSeconds(), - "q+": Math.floor((this.getMonth() + 3) / 3), - "S+": this.getMilliseconds() - }; - if (/(y+)/i.test(format)) { - format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)); - } - for (let k in date) { - if (new RegExp("(" + k + ")").test(format)) { - format = format.replace(RegExp.$1, RegExp.$1.length == 1 - ? date[k] : ("00" + date[k]).substr(("" + date[k]).length)); - } - } - return format; -}; - -function formatCheckBox(val, row) { - if(val==true){ - return ''; - }else if(val=false){ - return ''; - } -} - -function formatDate(val, row){ - return new Date(parseInt(val)).format('yyyy-MM-dd hh:mm:ss'); -} - -function commonRequest(options) { - $.ajax({ - url: options.url, - type: options.type, - data: JSON.stringify(options.extraData), - contentType: "application/json;charset=UTF-8", - beforeSend: function(){ - $.messager.progress({ - title: '提示信息', - msg: '请稍候......' - }); - }, - complete: function(){ - $.messager.progress('close'); - }, - success:function (data) { - console.log(data); - if(data.code == 200){ - $('#tt').datagrid('reload'); - $('#table_tg').treegrid('reload'); - /*$.messager.show({ - title:'提示信息', - msg:'操作成功!', - timeout:3000, - showType:'slide' - });*/ - parent.toastInfo({ - type: 'success', - title: '提示信息', - content: '操作成功!' - }); - let index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); - } - } - }); -} - -function doRequest(options) { - if($(options.formId).form('validate')){ - let requestData = $(options.formId).serializeArray(); - let sideMenuGroup = {}; - let i; - for(i = 0; i < requestData.length; i++){ - //如果存在相同的属性,则该属性值是数组类型。 - if(sideMenuGroup[requestData[i].name]){ - sideMenuGroup[requestData[i].name] += ',' + requestData[i].value; - }else{ - sideMenuGroup[requestData[i].name] = requestData[i].value; - } - } - - delete sideMenuGroup['editorValue']; - Object.assign(sideMenuGroup, options.extraData); - - $.ajax({ - url: options.url, - type: options.type, - data: JSON.stringify(sideMenuGroup), - contentType: "application/json;charset=UTF-8", - beforeSend: function(){ - $.messager.progress({ - title: '提示信息', - msg: '请稍候......' - }); - }, - complete: function(){ - $.messager.progress('close'); - }, - success:function (data) { - console.log(data); - if(data.code == 200){ - //清空表单 - $(options.formId).form('clear'); - - $('#addModal').window('close'); - $('#editModal').window('close'); - $('#tt').datagrid('reload'); - $('#table_tg').treegrid('reload'); - /*$.messager.show({ - title:'提示信息', - msg:'操作成功!', - timeout:3000, - showType:'slide' - });*/ - parent.toastInfo({ - type: 'success', - title: '提示信息', - content: '操作成功!' - }); - let index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); - }else{ - parent.toastInfo({ - type: 'success', - title: '提示信息', - content: data.message - }); - /*let index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index);*/ - } - }, - error: function (XMLHttpRequest, textStatus, errorThrown) { - // 状态码 - //console.log(XMLHttpRequest.status); - // 状态 - //console.log(XMLHttpRequest.readyState); - //console.log(XMLHttpRequest.responseText); - // 错误信息 - //console.log(textStatus); - let data = eval('(' + XMLHttpRequest.responseText + ')'); - parent.toastInfo({ - type: 'success', - title: '提示信息', - content: '操作成功!' - }); - /*let index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index);*/ - } - }); - }else{ - $.messager.alert('提示信息','存在校验项未通过!',"warning"); - } -} - -/** - * 清空 - * @param urlPrefix - */ -function emptyRequest(url) { - $.ajax({ - url: url, - type: 'DELETE', - beforeSend: function(){ - $.messager.progress({ - title: '提示信息', - msg: '请稍候......' - }); - }, - complete: function(){ - $.messager.progress('close'); - }, - success:function (data) { - console.log(data); - if(data.code == 200){ - $('#addModal').window('close'); - $('#editModal').window('close'); - $('#tt').datagrid('reload'); - $('#table_tg').treegrid('reload'); - $.messager.show({ - title:'提示信息', - msg:'操作成功!', - timeout:3000, - showType:'slide' - }); - } - } - }); -} - -function deleteRequest(urlPrefix){ - if(!urlPrefix.endsWith("/")){ - urlPrefix += '/'; - } - //获取选中的所有行数据 - let rows = $('#tt').datagrid('getSelections'); - if (rows.length <= 0){ - $.messager.alert('提示信息','请至少选择一条数据!','error'); - }else{ - $.messager.confirm('提示信息', '你确认删除吗?', function(r){ - if (r){ - let ids = []; - for(let i = 0; i < rows.length; i++){ - ids.push(rows[i].id); - } - $.ajax({ - url: urlPrefix + ids.join(','), - type: 'DELETE', - beforeSend: function(){ - $.messager.progress({ - title: '提示信息', - msg: '请稍候......' - }); - }, - complete: function(){ - $.messager.progress('close'); - }, - success:function (data) { - console.log(data); - if(data.code == 200){ - $('#addModal').window('close'); - $('#editModal').window('close'); - $('#tt').datagrid('reload'); - $('#table_tg').treegrid('reload'); - $.messager.show({ - title:'提示信息', - msg:'操作成功!', - timeout:3000, - showType:'slide' - }); - }else{ - $.messager.show({ - title:'提示信息', - msg: data.message, - timeout:3000, - showType:'slide' - }); - } - }, - error: function (XMLHttpRequest, textStatus, errorThrown) { - $.messager.progress('close'); - // 状态码 - //console.log(XMLHttpRequest.status); - // 状态 - //console.log(XMLHttpRequest.readyState); - //console.log(XMLHttpRequest.responseText); - // 错误信息 - //console.log(textStatus); - let data = eval('(' + XMLHttpRequest.responseText + ')'); - $.messager.show({ - title:'提示信息', - msg:data.message, - timeout:3000, - showType:'slide' - }); - } - }); - } - }); - } -} - -function deleteRequestByUserId(urlPrefix){ - if(!urlPrefix.endsWith("/")){ - urlPrefix += '/'; - } - //获取选中的所有行数据 - let rows = $('#tt').datagrid('getSelections'); - if (rows.length <= 0){ - $.messager.alert('提示信息','请至少选择一条数据!','error'); - }else{ - $.messager.confirm('提示信息', '你确认删除吗?', function(r){ - if (r){ - let ids = []; - for(let i = 0; i < rows.length; i++){ - ids.push(rows[i].userId); - } - $.ajax({ - url: urlPrefix + ids.join(','), - type: 'DELETE', - beforeSend: function(){ - $.messager.progress({ - title: '提示信息', - msg: '请稍候......' - }); - }, - complete: function(){ - $.messager.progress('close'); - }, - success:function (data) { - console.log(data); - if(data.code == 200){ - $('#addModal').window('close'); - $('#editModal').window('close'); - $('#tt').treegrid('reload'); - $('#table_tg').treegrid('reload'); - $.messager.show({ - title:'提示信息', - msg:'操作成功!', - timeout:3000, - showType:'slide' - }); - }else{ - $.messager.show({ - title:'提示信息', - msg: data.message, - timeout:3000, - showType:'slide' - }); - } - }, - error: function (XMLHttpRequest, textStatus, errorThrown) { - // 状态码 - //console.log(XMLHttpRequest.status); - // 状态 - //console.log(XMLHttpRequest.readyState); - //console.log(XMLHttpRequest.responseText); - // 错误信息 - //console.log(textStatus); - let data = eval('(' + XMLHttpRequest.responseText + ')'); - $.messager.show({ - title:'提示信息', - msg:data.message, - timeout:3000, - showType:'slide' - }); - } - }); - } - }); - } -} - -//自定义EasyUI校验规则 -$.extend($.fn.validatebox.defaults.rules, { - CHS: { - validator: function (value, param) { - return /^[\u0391-\uFFE5]+$/.test(value); - }, - message: '请输入汉字' - }, - english : {// 验证英语 - validator : function(value) { - return /^[A-Za-z]+$/i.test(value); - }, - message : '请输入英文' - }, - ip : {// 验证IP地址 - validator : function(value) { - return /\d+\.\d+\.\d+\.\d+/.test(value); - }, - message : 'IP地址格式不正确' - }, - ZIP: { - validator: function (value, param) { - return /^[0-9]\d{5}$/.test(value); - }, - message: '邮政编码不存在' - }, - QQ: { - validator: function (value, param) { - //QQ号正则,5至11位 - return /^[1-9]\d{4,10}$/.test(value); - }, - message: 'QQ号码不正确' - }, - mobile: { - validator: function (value, param) { - return /^(?:13\d|15\d|18\d)-?\d{5}(\d{3}|\*{3})$/.test(value); - }, - message: '手机号码不正确' - }, - tel:{ - validator:function(value,param){ - return /^(\d{3}-|\d{4}-)?(\d{8}|\d{7})?(-\d{1,6})?$/.test(value); - }, - message:'电话号码不正确' - }, - mobileAndTel: { - validator: function (value, param) { - return /(^([0\+]\d{2,3})\d{3,4}\-\d{3,8}$)|(^([0\+]\d{2,3})\d{3,4}\d{3,8}$)|(^([0\+]\d{2,3}){0,1}13\d{9}$)|(^\d{3,4}\d{3,8}$)|(^\d{3,4}\-\d{3,8}$)/.test(value); - }, - message: '请正确输入电话号码' - }, - number: { - validator: function (value, param) { - return /^[0-9]+.?[0-9]*$/.test(value); - }, - message: '请输入数字' - }, - money:{ - validator: function (value, param) { - return (/^(([1-9]\d*)|\d)(\.\d{1,2})?$/).test(value); - }, - message:'请输入正确的金额' - - }, - mone:{ - validator: function (value, param) { - return (/^(([1-9]\d*)|\d)(\.\d{1,2})?$/).test(value); - }, - message:'请输入整数或小数' - - }, - integer:{ - validator:function(value,param){ - return /^[+]?[1-9]\d*$/.test(value); - }, - message: '请输入最小为1的整数' - }, - integ:{ - validator:function(value,param){ - return /^[+]?[0-9]\d*$/.test(value); - }, - message: '请输入整数' - }, - range:{ - validator:function(value,param){ - if(/^[1-9]\d*$/.test(value)){ - return value >= param[0] && value <= param[1] - }else{ - return false; - } - }, - message:'输入的数字在{0}到{1}之间' - }, - minLength:{ - validator:function(value,param){ - return value.length >=param[0] - }, - message:'至少输入{0}个字' - }, - maxLength:{ - validator:function(value,param){ - return value.length<=param[0] - }, - message:'最多{0}个字' - }, - //select即选择框的验证 - selectValid:{ - validator:function(value,param){ - //console.log('selectValid' + value + '-' + param[0]); - if(value == param[0]){ - return false; - }else{ - return true ; - } - }, - message:'请选择' - }, - idCode:{ - validator:function(value,param){ - return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value); - }, - message: '请输入正确的身份证号' - }, - loginName: { - validator: function (value, param) { - return /^[\u0391-\uFFE5\w]+$/.test(value); - }, - message: '登录名称只允许汉字、英文字母、数字及下划线。' - }, - equalTo: { - validator: function (value, param) { - return value == $(param[0]).val(); - }, - message: '两次输入的字符不一至' - }, - englishOrNum : {// 只能输入英文和数字 - validator : function(value) { - return /^[a-zA-Z0-9_ ]{1,}$/.test(value); - }, - message : '请输入英文、数字、下划线或者空格' - }, - xiaoshu:{ - validator : function(value){ - return /^(([1-9]+)|([0-9]+\.[0-9]{1,2}))$/.test(value); - }, - message : '最多保留两位小数!' - }, - ddPrice:{ - validator:function(value,param){ - if(/^[1-9]\d*$/.test(value)){ - return value >= param[0] && value <= param[1]; - }else{ - return false; - } - }, - message:'请输入1到100之间正整数' - }, - jretailUpperLimit:{ - validator:function(value,param){ - if(/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)){ - return parseFloat(value) > parseFloat(param[0]) && parseFloat(value) <= parseFloat(param[1]); - }else{ - return false; - } - }, - message:'请输入0到100之间的最多俩位小数的数字' - }, - rateCheck:{ - validator:function(value,param){ - if(/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)){ - return parseFloat(value) > parseFloat(param[0]) && parseFloat(value) <= parseFloat(param[1]); - }else{ - return false; - } - }, - message:'请输入0到1000之间的最多俩位小数的数字' - }, - wx:{ - validator:function(value, param){ - //微信号正则,6至20位,以字母开头,字母,数字,减号,下划线 - return /^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/.test(value); - }, - message: '微信号不正确' - }, - identityCard: { - validator:function(value, param){ - //身份证号(18位)正则 - return /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(value); - }, - message: '身份证号不正确' - }, - username: { - validator:function(value, param){ - //用户名正则,4到16位(字母,数字,下划线,减号) - return /^[a-zA-Z0-9_-]{4,16}$/.test(value); - }, - message: '用户名格式不正确,4到16位(字母,数字,下划线,减号)' - }, - color: { - validator:function(value, param) { - //十六进制颜色正则 - return /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(value); - }, - message: '颜色格式不正确' - } -}); - -/** - * 解决ueditor被easyui-window遮盖问题 - * @param id - */ -function ueditorAdapter(id) { - if(id.indexOf('#') != 0){ - id = '#' + id; - } - - $(id).window({ - modal:false, - minimizable:true, - maximizable:true, - resizable:true, - closed:true, - collapsible:false, - onOpen:function(){ - $(".window").css("z-index","499"); - $(".window-shadow").css("z-index","498"); - }, - onMove:function(left,top){ - $(".window").css("z-index","499"); - $(".window-shadow").css("z-index","498"); - }, - onResize:function(width,height){ - $(".window").css("z-index","499"); - $(".window-shadow").css("z-index","498"); - }, - }); -} \ No newline at end of file diff --git a/api/src/main/resources/static/js/easyui/dropdown.js b/api/src/main/resources/static/js/easyui/dropdown.js deleted file mode 100644 index cb6bcb8bcfd1e491e4e461ca9a3d95b87db83a6b..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/easyui/dropdown.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * User: simon - * Date: 2018/11/04 - * Time: 21:40 - **/ -/* When the user clicks on the button, - toggle between hiding and showing the dropdown content */ -function myFunction(obj) { - console.log($(obj).next()); - $(obj).next().toggle("show"); - //document.getElementById("myDropdown").classList.toggle("show"); -} - -// Close the dropdown if the user clicks outside of it -window.onclick = function(event) { - if (!event.target.matches('.dropbtn')) { - - var dropdowns = document.getElementsByClassName("dropdown-content"); - var i; - for (i = 0; i < dropdowns.length; i++) { - var openDropdown = dropdowns[i]; - if (openDropdown.classList.contains('show')) { - openDropdown.classList.remove('show'); - } - } - } -} \ No newline at end of file diff --git a/api/src/main/resources/static/js/easyui/tabutil.js b/api/src/main/resources/static/js/easyui/tabutil.js deleted file mode 100644 index 70f089114954ce3bd424dcb3c9651dffcb339eca..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/easyui/tabutil.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @author {CaoGuangHui} - */ -$.extend($.fn.tabs.methods, { - /** - * 加载iframe内容 - * @param {jq Object} jq [description] - * @param {Object} params params.which:tab的标题或者index;params.iframe:iframe的相关参数 - * @return {jq Object} [description] - */ - loadTabIframe:function(jq,params){ - return jq.each(function(){ - var $tab = $(this).tabs('getTab',params.which); - if($tab==null) return; - - var $tabBody = $tab.panel('body'); - - //销毁已有的iframe - var $frame=$('iframe', $tabBody); - if($frame.length>0){ - try{//跨域会拒绝访问,这里处理掉该异常 - $frame[0].contentWindow.document.write(''); - $frame[0].contentWindow.close(); - }catch(e){ - //Do nothing - } - $frame.remove(); - if($.browser.msie){ - CollectGarbage(); - } - } - $tabBody.html(''); - - $tabBody.css({'overflow':'hidden','position':'relative'}); - var $mask = $('
').appendTo($tabBody); - var $maskMessage = $('
' + (params.iframe.message || 'Processing, please wait ...') + '
').appendTo($tabBody); - var $containterMask = $('
').appendTo($tabBody); - var $containter = $('
').appendTo($tabBody); - - var iframe = document.createElement("iframe"); - iframe.src = params.iframe.src; - iframe.frameBorder = params.iframe.frameBorder || 0; - iframe.height = params.iframe.height || '100%'; - iframe.width = params.iframe.width || '100%'; - if (iframe.attachEvent){ - iframe.attachEvent("onload", function(){ - $([$mask[0],$maskMessage[0]]).fadeOut(params.iframe.delay || 'slow',function(){ - $(this).remove(); - if($(this).hasClass('mask-message')){ - $containterMask.fadeOut(params.iframe.delay || 'slow',function(){ - $(this).remove(); - }); - } - }); - }); - } else { - iframe.onload = function(){ - $([$mask[0],$maskMessage[0]]).fadeOut(params.iframe.delay || 'slow',function(){ - $(this).remove(); - if($(this).hasClass('mask-message')){ - $containterMask.fadeOut(params.iframe.delay || 'slow',function(){ - $(this).remove(); - }); - } - }); - }; - } - $containter[0].appendChild(iframe); - }); - }, - /** - * 增加iframe模式的标签页 - * @param {[type]} jq [description] - * @param {[type]} params [description] - */ - addIframeTab:function(jq,params){ - return jq.each(function(){ - if(params.tab.href){ - delete params.tab.href; - } - $(this).tabs('add',params.tab); - $(this).tabs('loadTabIframe',{'which':params.tab.title,'iframe':params.iframe}); - }); - }, - /** - * 更新tab的iframe内容 - * @param {jq Object} jq [description] - * @param {Object} params [description] - * @return {jq Object} [description] - */ - updateIframeTab:function(jq,params){ - return jq.each(function(){ - params.iframe = params.iframe || {}; - if(!params.iframe.src){ - var $tab = $(this).tabs('getTab',params.which); - if($tab==null) return; - var $tabBody = $tab.panel('body'); - var $iframe = $tabBody.find('iframe'); - if($iframe.length===0) return; - $.extend(params.iframe,{'src':$iframe.attr('src')}); - } - $(this).tabs('loadTabIframe',params); - }); - } -}); \ No newline at end of file diff --git a/api/src/main/resources/static/js/file_upload.js b/api/src/main/resources/static/js/file_upload.js deleted file mode 100644 index 7d44bc7ea118dfe27f92f5f80b345ffe15d162e1..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/file_upload.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * - * User: simon - * Date: 2018/06/06 - * Time: 14:45 - **/ - -'use strict'; -//必须加这段代码,不然无法上传 -/*var token = $("meta[name='_csrf']").attr("content"); -var header = $("meta[name='_csrf_header']").attr("content"); -$(document).ajaxSend(function (e, xhr, options) { - xhr.setRequestHeader(header, token); -});*/ - -function initFileUpload(id, inputName){ - let uploader = $(id); - uploader.fileupload({ - url: "/fileUploads/upload", - dataType: 'json', - type: "post", - multipart: true, - acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, - maxFileSize: 1000 * 1024 * 1024, - maxNumberOfFiles: 50, - change: function (e, data){ - $(id + '-wrapper .preview').empty(); - $(id + '-wrapper .progress-bar').css('width', '0%'); - $(id + '-wrapper .proportion').html(''); - $(id + '-wrapper input[name="imageUrl"]').remove(); - }, - done: function (e, data) { - let result = data.result; - //done方法就是上传完毕的回调函数,其他回调函数可以自行查看api - //注意data要和jquery的ajax的data参数区分,这个对象包含了整个请求信息 - //返回的数据在data.result中,这里dataType中设置的返回的数据类型为json - if(200 == result.code) { - // 上传成功: - for(let i = 0; i < result.data.length; i++){ - $(id + '-wrapper .preview').append(''); - } - //重新渲染 - $(".easyui-linkbutton").linkbutton(); - $(".easyui-numberbox").numberbox(); - } else { - // 上传失败: - $(id + '-wrapper .upstatus').append("
"+result.msg+"
"); - } - },messages: { - maxFileSize: '文件大小超过限制', - acceptFileTypes: '文件格式不支持' - },progressall: function (e, data) { - let progress = parseInt(data.loaded / data.total * 100, 10); - $(id + '-wrapper .progress-bar').css("width", progress + "%"); - $(id + '-wrapper .proportion').html("上传总进度:"+progress+"%"); - },processfail: function (e, data) { - let currentFile = data.files[data.index]; - if (data.files.error && currentFile.error) { - alert(currentFile.error); - } - } - }); - - $(document).on('click', '.delete_file', function () { - console.log("clicked"); - $(this).parent().remove(); - if (!$(id + '-wrapper .preview').html()) { - $(id + '-wrapper .progress-bar').css('width', '0%'); - $(id + '-wrapper .proportion').html(''); - } - //$('input[name="imageUrl"]').remove(); - }); -} - -function imgPreview(id, inputName, imgUrl) { - if(id.indexOf('#') != 0){ - id = '#' + id; - } - $(id + '-wrapper .preview').empty(); - if(imgUrl){ - $(id + '-wrapper .preview').append(''); - } -} \ No newline at end of file diff --git a/api/src/main/resources/static/js/jquery.min.js b/api/src/main/resources/static/js/jquery.min.js deleted file mode 100644 index cfde167f9830b5105ae02efe39f2302f7784dbb2..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/jquery.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){ -return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*\s*$/g,ia={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("'); - frameName++; - }else{ - tabContent.push('
'+options.content+"
"); - } - tabContent.push('
'); - nthTabs.find(".tab-content").append(tabContent.join('')); - active && this.setActTab(options.id); - location && this.locationTab(options.id); - return this; - }, - - //新建多个选项卡 - addTabs: function (tabsOptions) { - for(var index in tabsOptions){ - this.addTab(tabsOptions[index]); - } - return this; - }, - - // 定位选项卡 - locationTab: function (tabId) { - tabId = tabId == undefined ? methods.getActiveId() : tabId; - tabId = tabId.indexOf('#') > -1 ? tabId : '#' + tabId; - var navTabOpt = nthTabs.find("[href='" + tabId + "']"); // 当前所操作选项卡对象 - // 计算存在于当前活动选项卡之前的所有同级选项卡的宽度之和 - var beforeTabsWidth = 0; - navTabOpt.parent().prevAll().each(function () { - beforeTabsWidth += $(this).width(); - }); - // 得到选项卡容器对象 - var contentTab = navTabOpt.parent().parent().parent(); - // 情况1:前面同级选项卡宽度之和小于选项卡可视区域的则默认40 - if (beforeTabsWidth <= settings.rollWidth) { - margin_left_total = 40; - } - // 情况2:前面同级选项卡宽度之和大于选项卡可视区域的,则margin为向左偏移整数倍的距离 - else{ - margin_left_total = 40 - Math.floor(beforeTabsWidth / settings.rollWidth) * settings.rollWidth; - } - contentTab.css("margin-left", margin_left_total); - return this; - }, - - // 删除单个选项卡 - delTab: function (tabId) { - tabId = tabId == undefined ? methods.getActiveId() : tabId; - tabId = tabId.indexOf('#') > -1 ? tabId : '#' + tabId; - var navTabA = nthTabs.find("[href='" + tabId + "']"); - // 如果关闭的是激活状态的选项卡 - if (navTabA.parent().attr('class') == 'active') { - // 激活选项卡,如果后面存在激活后面,否则激活前面 - var activeNavTab = navTabA.parent().next(); - var activeTabContent = $(tabId).next(); - if (activeNavTab.length < 1) { - activeNavTab = navTabA.parent().prev(); - activeTabContent = $(tabId).prev(); - } - activeNavTab.addClass('active'); - activeTabContent.addClass('active'); - } - // 移除旧选项卡 - navTabA.parent().remove(); - $(tabId).remove(); - return this; - }, - - // 删除其他选项卡 - delOtherTab: function () { - nthTabs.find(".nav-tabs li").not('[class="active"]').remove(); - nthTabs.find(".tab-content div.tab-pane").not('[class$="active"]').remove(); - nthTabs.find('.content-tabs-container').css("margin-left", 40); //重置位置 - return this; - }, - - // 删除全部选项卡 - delAllTab: function () { - nthTabs.find(".nav-tabs li").remove(); - nthTabs.find(".tab-content div").remove(); - return this; - }, - - // 设置活动选项卡 - setActTab: function (tabId) { - tabId = tabId == undefined ? methods.getActiveId() : tabId; - tabId = tabId.indexOf('#') > -1 ? tabId : '#' + tabId; - nthTabs.find('.active').removeClass('active'); - nthTabs.find("[href='" + tabId + "']").parent().addClass('active'); - nthTabs.find(tabId).addClass('active'); - return this; - }, - - // 切换选项卡 - toggleTab: function (tabId) { - this.setActTab(tabId).locationTab(tabId); - return this; - } - }; - - // 事件处理 - var event = { - - // 窗口变化 - onWindowsResize: function () { - $(window).resize(function () { - settings.rollWidth = nthTabs.width() - 120; - }); - return this; - }, - - // 定位选项卡 - onLocationTab: function () { - nthTabs.on("click", '.tab-location', function () { - methods.locationTab(); - }); - return this; - }, - - // 关闭选项卡按钮 - onTabClose: function () { - nthTabs.on("click", '.tab-close', function () { - var tabId = $(this).parent().find("a").attr('href'); - //当前操作的标签宽度 - var navTabOpt = nthTabs.find("[href='" + tabId + "']"); // 当前操作选项卡对象 - // 当前选项卡后有选项卡则不处理,如果无,则整体向左偏移一个选项卡 - if(navTabOpt.parent().next().length == 0){ - // 计算存在于当前操作选项卡之前的所有同级选项卡的宽度之和 - var beforeTabsWidth = 0; - navTabOpt.parent().prevAll().each(function () { - beforeTabsWidth += $(this).width(); - }); - //当前操作选项卡的宽度 - var optTabWidth = navTabOpt.parent().width(); - var margin_left_total = 40; // 默认偏移(总宽度未超过滚动区域) - // 得到选项卡容器对象 - var contentTab = navTabOpt.parent().parent().parent(); - // 满足此情况才需要做整体左偏移处理 - if (beforeTabsWidth > settings.rollWidth) { - var margin_left_origin = contentTab.css('marginLeft').replace('px', ''); - margin_left_total = parseFloat(margin_left_origin) + optTabWidth + 40; - } - contentTab.css("margin-left", margin_left_total); - } - methods.delTab(tabId); - }); - return this; - }, - - // 关闭当前选项卡操作 - onTabCloseOpt: function () { - nthTabs.on("click", '.tab-close-current', function () { - methods.delTab(); - }); - return this; - }, - - // 关闭其他选项卡 - onTabCloseOther: function () { - nthTabs.on("click", '.tab-close-other', function () { - methods.delOtherTab(); - }); - return this; - }, - - // 关闭全部选项卡 - onTabCloseAll: function () { - nthTabs.on("click", '.tab-close-all', function () { - methods.delAllTab(); - }); - return this; - }, - - // 左滑选项卡 - onTabRollLeft: function () { - nthTabs.on("click", '.roll-nav-left', function () { - var contentTab = $(this).parent().find('.content-tabs-container'); - var margin_left_total; - if (methods.getAllTabWidth() <= settings.rollWidth) { - //未超出可视区域宽度,不可滑动 - margin_left_total = 40; - }else{ - var margin_left_origin = contentTab.css('marginLeft').replace('px', ''); - margin_left_total = parseFloat(margin_left_origin) + methods.getMarginStep() + 40; - } - contentTab.css("margin-left", margin_left_total > 40 ? 40 : margin_left_total); - }); - return this; - }, - - // 右滑选项卡 - onTabRollRight: function () { - nthTabs.on("click", '.roll-nav-right', function () { - if (methods.getAllTabWidth() <= settings.rollWidth) return false; //未超出可视区域宽度,不可滑动 - var contentTab = $(this).parent().find('.content-tabs-container'); - var margin_left_origin = contentTab.css('marginLeft').replace('px', ''); - var margin_left_total = parseFloat(margin_left_origin) - methods.getMarginStep(); - if (methods.getAllTabWidth() - Math.abs(margin_left_origin) <= settings.rollWidth) return false; //已无隐藏无需滚动 - contentTab.css("margin-left", margin_left_total); - }); - return this; - }, - - // 选项卡清单 - onTabList: function () { - nthTabs.on("click", '.right-nav-list', function () { - var tabList = methods.getTabList(); - var html = []; - $.each(tabList, function (key, val) { - html.push('
  • ' + val.title + '
  • '); - }); - nthTabs.find(".tab-list").html(html.join('')); - }); - nthTabs.find(".tab-list-scrollbar").scrollbar(); - this.onTabListToggle(); - return this; - }, - - // 清单下切换选项卡 - onTabListToggle: function () { - nthTabs.on("click", '.toggle-tab', function () { - var tabId = $(this).data("id"); - methods.setActTab(tabId).locationTab(tabId); - }); - return this; - } - }; - return run(); - } -})(jQuery); \ No newline at end of file diff --git a/api/src/main/resources/static/js/nth-tabs.min.js b/api/src/main/resources/static/js/nth-tabs.min.js deleted file mode 100644 index 35285c722085e89bd7bc4674efa5594edd7d5b25..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/nth-tabs.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){a.fn.nthTabs=function(j){var g=this;var f={allowClose:true,active:true,location:true,fadeIn:true,rollWidth:g.width()-120};var e=a.extend({},f,j);var h=0;var i='
    ';var d=function(){g.html(i);b.onWindowsResize().onTabClose().onTabRollLeft().onTabRollRight().onTabList().onTabCloseOpt().onTabCloseAll().onTabCloseOther().onLocationTab();return c};var c={getAllTabWidth:function(){var k=0;g.find(".nav-tabs li").each(function(){k+=parseFloat(a(this).width())});return k},getMarginStep:function(){return e.rollWidth/2},getActiveId:function(){return g.find('li[class="active"]').find("a").attr("href").replace("#","")},getTabList:function(){var k=[];g.find(".nav-tabs li a").each(function(){k.push({id:a(this).attr("href"),title:a(this).children("span").html()})});return k},addTab:function(o){var p=[];var r=o.active==undefined?e.active:o.active;var m=o.allowClose==undefined?e.allowClose:o.allowClose;var l=o.location==undefined?e.location:o.location;var k=o.fadeIn==undefined?e.fadeIn:o.fadeIn;var n=o.url==undefined?"":o.url;p.push('
  • ');p.push('');p.push(""+o.title+"");p.push("");m?p.push(''):"";p.push("
  • ");g.find(".nav-tabs").append(p.join(""));var q=[];q.push('
    ');if(n.length>0){q.push('');h++}else{q.push('
    '+o.content+"
    ")}q.push("
    ");g.find(".tab-content").append(q.join(""));r&&this.setActTab(o.id);l&&this.locationTab(o.id);return this},addTabs:function(l){for(var k in l){this.addTab(l[k])}return this},locationTab:function(m){m=m==undefined?c.getActiveId():m;m=m.indexOf("#")>-1?m:"#"+m;var n=g.find("[href='"+m+"']");var l=0;n.parent().prevAll().each(function(){l+=a(this).width()});var k=n.parent().parent().parent();if(l<=e.rollWidth){margin_left_total=40}else{margin_left_total=40-Math.floor(l/e.rollWidth)*e.rollWidth}k.css("margin-left",margin_left_total);return this},delTab:function(l){l=l==undefined?c.getActiveId():l;l=l.indexOf("#")>-1?l:"#"+l;var m=g.find("[href='"+l+"']");if(m.parent().attr("class")=="active"){var k=m.parent().next();var n=a(l).next();if(k.length<1){k=m.parent().prev();n=a(l).prev()}k.addClass("active");n.addClass("active")}m.parent().remove();a(l).remove();return this},delOtherTab:function(){g.find(".nav-tabs li").not('[class="active"]').remove();g.find(".tab-content div.tab-pane").not('[class$="active"]').remove();g.find(".content-tabs-container").css("margin-left",40);return this},delAllTab:function(){g.find(".nav-tabs li").remove();g.find(".tab-content div").remove();return this},setActTab:function(k){k=k==undefined?c.getActiveId():k;k=k.indexOf("#")>-1?k:"#"+k;g.find(".active").removeClass("active");g.find("[href='"+k+"']").parent().addClass("active");g.find(k).addClass("active");return this},toggleTab:function(k){this.setActTab(k).locationTab(k);return this}};var b={onWindowsResize:function(){a(window).resize(function(){e.rollWidth=g.width()-120});return this},onLocationTab:function(){g.on("click",".tab-location",function(){c.locationTab()});return this},onTabClose:function(){g.on("click",".tab-close",function(){var n=a(this).parent().find("a").attr("href");var q=g.find("[href='"+n+"']");if(q.parent().next().length==0){var l=0;q.parent().prevAll().each(function(){l+=a(this).width()});var p=q.parent().width();var o=40;var k=q.parent().parent().parent();if(l>e.rollWidth){var m=k.css("marginLeft").replace("px","");o=parseFloat(m)+p+40}k.css("margin-left",o)}c.delTab(n)});return this},onTabCloseOpt:function(){g.on("click",".tab-close-current",function(){c.delTab()});return this},onTabCloseOther:function(){g.on("click",".tab-close-other",function(){c.delOtherTab()});return this},onTabCloseAll:function(){g.on("click",".tab-close-all",function(){c.delAllTab()});return this},onTabRollLeft:function(){g.on("click",".roll-nav-left",function(){var k=a(this).parent().find(".content-tabs-container");var m;if(c.getAllTabWidth()<=e.rollWidth){m=40}else{var l=k.css("marginLeft").replace("px","");m=parseFloat(l)+c.getMarginStep()+40}k.css("margin-left",m>40?40:m)});return this},onTabRollRight:function(){g.on("click",".roll-nav-right",function(){if(c.getAllTabWidth()<=e.rollWidth){return false}var k=a(this).parent().find(".content-tabs-container");var l=k.css("marginLeft").replace("px","");var m=parseFloat(l)-c.getMarginStep();if(c.getAllTabWidth()-Math.abs(l)<=e.rollWidth){return false}k.css("margin-left",m)});return this},onTabList:function(){g.on("click",".right-nav-list",function(){var k=c.getTabList();var l=[];a.each(k,function(m,n){l.push('
  • '+n.title+"
  • ")});g.find(".tab-list").html(l.join(""))});g.find(".tab-list-scrollbar").scrollbar();this.onTabListToggle();return this},onTabListToggle:function(){g.on("click",".toggle-tab",function(){var k=a(this).data("id");c.setActTab(k).locationTab(k)});return this}};return d()}})(jQuery); diff --git a/api/src/main/resources/static/js/plugins/layer/extend/layer.ext.js b/api/src/main/resources/static/js/plugins/layer/extend/layer.ext.js deleted file mode 100644 index ec9cf15b1b7baa651d3761e380f65e291bf598f5..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/extend/layer.ext.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! layer弹层组件拓展类 */ -;!function(){layer.use("skin/layer.ext.css",function(){layer.layui_layer_extendlayerextjs=!0});var a=layer.cache||{},b=function(b){return a.skin?" "+a.skin+" "+a.skin+"-"+b:""};layer.prompt=function(a,c){a=a||{},"function"==typeof a&&(c=a);var d,e=2==a.formType?'":function(){return''}();return layer.open($.extend({btn:["确定","取消"],content:e,skin:"layui-layer-prompt"+b("prompt"),success:function(a){d=a.find(".layui-layer-input"),d.focus()},yes:function(b){var e=d.val();""===e?d.focus():e.length>(a.maxlength||500)?layer.tips("最多输入"+(a.maxlength||500)+"个字数",d,{tips:1}):c&&c(e,b,d)}},a))},layer.tab=function(a){a=a||{};var c=a.tab||{};return layer.open($.extend({type:1,skin:"layui-layer-tab"+b("tab"),title:function(){var a=c.length,b=1,d="";if(a>0)for(d=''+c[0].title+"";a>b;b++)d+=""+c[b].title+"";return d}(),content:'
      '+function(){var a=c.length,b=1,d="";if(a>0)for(d='
    • '+(c[0].content||"no content")+"
    • ";a>b;b++)d+='
    • '+(c[b].content||"no content")+"
    • ";return d}()+"
    ",success:function(a){var b=a.find(".layui-layer-title").children(),c=a.find(".layui-layer-tabmain").children();b.on("mousedown",function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;var b=$(this),d=b.index();b.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),c.eq(d).show().siblings().hide()})}},a))},layer.photos=function(a,c,d){function e(a,b,c){var d=new Image;d.onload=function(){d.onload=null,b(d)},d.onerror=function(a){d.onerror=null,c(a)},d.src=a}var f={};if(a=a||{},a.photos){var g=a.photos.constructor===Object,h=g?a.photos:{},i=h.data||[],j=h.start||0;if(f.imgIndex=j+1,g){if(0===i.length)return void layer.msg("没有图片")}else{var k=$(a.photos),l=k.find(a.img||"img");if(0===l.length)return;if(c||k.find(h.img||"img").each(function(b){var c=$(this);i.push({alt:c.attr("alt"),pid:c.attr("layer-pid"),src:c.attr("layer-src")||c.attr("src"),thumb:c.attr("src")}),c.on("click",function(){layer.photos($.extend(a,{photos:{start:b,data:i,tab:a.tab},full:a.full}),!0)})}),!c)return}f.imgprev=function(a){f.imgIndex--,f.imgIndex<1&&(f.imgIndex=i.length),f.tabimg(a)},f.imgnext=function(a,b){f.imgIndex++,f.imgIndex>i.length&&(f.imgIndex=1,b)||f.tabimg(a)},f.keyup=function(a){if(!f.end){var b=a.keyCode;a.preventDefault(),37===b?f.imgprev(!0):39===b?f.imgnext(!0):27===b&&layer.close(f.index)}},f.tabimg=function(b){i.length<=1||(h.start=f.imgIndex-1,layer.close(f.index),layer.photos(a,!0,b))},f.event=function(){f.bigimg.hover(function(){f.imgsee.show()},function(){f.imgsee.hide()}),f.bigimg.find(".layui-layer-imgprev").on("click",function(a){a.preventDefault(),f.imgprev()}),f.bigimg.find(".layui-layer-imgnext").on("click",function(a){a.preventDefault(),f.imgnext()}),$(document).on("keyup",f.keyup)},f.loadi=layer.load(1,{shade:"shade"in a?!1:.9,scrollbar:!1}),e(i[j].src,function(c){layer.close(f.loadi),f.index=layer.open($.extend({type:1,area:function(){var b=[c.width,c.height],d=[$(window).width()-100,$(window).height()-100];return!a.full&&b[0]>d[0]&&(b[0]=d[0],b[1]=b[0]*d[1]/b[0]),[b[0]+"px",b[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,shift:5*Math.random()|0,skin:"layui-layer-photos"+b("photos"),content:'
    '+(i[j].alt||
    '+(i.length>1?'':"")+'
    '+(i[j].alt||"")+""+f.imgIndex+"/"+i.length+"
    ",success:function(b,c){f.bigimg=b.find(".layui-layer-phimg"),f.imgsee=b.find(".layui-layer-imguide,.layui-layer-imgbar"),f.event(b),a.tab&&a.tab(i[j],b)},end:function(){f.end=!0,$(document).off("keyup",f.keyup)}},a))},function(){layer.close(f.loadi),layer.msg("当前图片地址异常
    是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){i.length>1&&f.imgnext(!0,!0)}})})}}}(); diff --git a/api/src/main/resources/static/js/plugins/layer/laydate/laydate.js b/api/src/main/resources/static/js/plugins/layer/laydate/laydate.js deleted file mode 100644 index 2da091b9688c6ab3ac6460a62d47b964ba0c4686..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/laydate/laydate.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - - @Name : layDate v1.1 日期控件 - @Author: 贤心 - @Date: 2014-06-25 - @QQ群:176047195 - @Site:http://sentsin.com/layui/laydate - - */ - -;!function(a){var b={path:"",defSkin:"default",format:"YYYY-MM-DD",min:"1900-01-01 00:00:00",max:"2099-12-31 23:59:59",isv:!1},c={},d=document,e="createElement",f="getElementById",g="getElementsByTagName",h=["laydate_box","laydate_void","laydate_click","LayDateSkin","skins/","/laydate.css"];a.laydate=function(b){b=b||{};try{h.event=a.event?a.event:laydate.caller.arguments[0]}catch(d){}return c.run(b),laydate},laydate.v="1.1",c.getPath=function(){var a=document.scripts,c=a[a.length-1].src;return b.path?b.path:c.substring(0,c.lastIndexOf("/")+1)}(),c.use=function(a,b){var f=d[e]("link");f.type="text/css",f.rel="stylesheet",f.href=c.getPath+a+h[5],b&&(f.id=b),d[g]("head")[0].appendChild(f),f=null},c.trim=function(a){return a=a||"",a.replace(/^\s|\s$/g,"").replace(/\s+/g," ")},c.digit=function(a){return 10>a?"0"+(0|a):a},c.stopmp=function(b){return b=b||a.event,b.stopPropagation?b.stopPropagation():b.cancelBubble=!0,this},c.each=function(a,b){for(var c=0,d=a.length;d>c&&b(c,a[c])!==!1;c++);},c.hasClass=function(a,b){return a=a||{},new RegExp("\\b"+b+"\\b").test(a.className)},c.addClass=function(a,b){return a=a||{},c.hasClass(a,b)||(a.className+=" "+b),a.className=c.trim(a.className),this},c.removeClass=function(a,b){if(a=a||{},c.hasClass(a,b)){var d=new RegExp("\\b"+b+"\\b");a.className=a.className.replace(d,"")}return this},c.removeCssAttr=function(a,b){var c=a.style;c.removeProperty?c.removeProperty(b):c.removeAttribute(b)},c.shde=function(a,b){a.style.display=b?"none":"block"},c.query=function(a){var e,b,h,i,j;return a=c.trim(a).split(" "),b=d[f](a[0].substr(1)),b?a[1]?/^\./.test(a[1])?(i=a[1].substr(1),j=new RegExp("\\b"+i+"\\b"),e=[],h=d.getElementsByClassName?b.getElementsByClassName(i):b[g]("*"),c.each(h,function(a,b){j.test(b.className)&&e.push(b)}),e[0]?e:""):(e=b[g](a[1]),e[0]?b[g](a[1]):""):b:void 0},c.on=function(b,d,e){return b.attachEvent?b.attachEvent("on"+d,function(){e.call(b,a.even)}):b.addEventListener(d,e,!1),c},c.stopMosup=function(a,b){"mouseup"!==a&&c.on(b,"mouseup",function(a){c.stopmp(a)})},c.run=function(a){var d,e,g,b=c.query,f=h.event;try{g=f.target||f.srcElement||{}}catch(i){g={}}if(d=a.elem?b(a.elem):g,f&&g.tagName){if(!d||d===c.elem)return;c.stopMosup(f.type,d),c.stopmp(f),c.view(d,a),c.reshow()}else e=a.event||"click",c.each((0|d.length)>0?d:[d],function(b,d){c.stopMosup(e,d),c.on(d,e,function(b){c.stopmp(b),d!==c.elem&&(c.view(d,a),c.reshow())})})},c.scroll=function(a){return a=a?"scrollLeft":"scrollTop",d.body[a]|d.documentElement[a]},c.winarea=function(a){return document.documentElement[a?"clientWidth":"clientHeight"]},c.isleap=function(a){return 0===a%4&&0!==a%100||0===a%400},c.checkVoid=function(a,b,d){var e=[];return a=0|a,b=0|b,d=0|d,ac.maxs[0]?e=["y",1]:a>=c.mins[0]&&a<=c.maxs[0]&&(a==c.mins[0]&&(bc.maxs[1]?e=["m",1]:b==c.maxs[1]&&d>c.maxs[2]&&(e=["d",1]))),e},c.timeVoid=function(a,b){if(c.ymd[1]+1==c.mins[1]&&c.ymd[2]==c.mins[2]){if(0===b&&ac.maxs[3])return 1;if(1===b&&a>c.maxs[4])return 1;if(2===b&&a>c.maxs[5])return 1}return a>(b?59:23)?1:void 0},c.check=function(){var a=c.options.format.replace(/YYYY|MM|DD|hh|mm|ss/g,"\\d+\\").replace(/\\$/g,""),b=new RegExp(a),d=c.elem[h.elemv],e=d.match(/\d+/g)||[],f=c.checkVoid(e[0],e[1],e[2]);if(""!==d.replace(/\s/g,"")){if(!b.test(d))return c.elem[h.elemv]="",c.msg("日期不符合格式,请重新选择。"),1;if(f[0])return c.elem[h.elemv]="",c.msg("日期不在有效期内,请重新选择。"),1;f.value=c.elem[h.elemv].match(b).join(),e=f.value.match(/\d+/g),e[1]<1?(e[1]=1,f.auto=1):e[1]>12?(e[1]=12,f.auto=1):e[1].length<2&&(f.auto=1),e[2]<1?(e[2]=1,f.auto=1):e[2]>c.months[(0|e[1])-1]?(e[2]=31,f.auto=1):e[2].length<2&&(f.auto=1),e.length>3&&(c.timeVoid(e[3],0)&&(f.auto=1),c.timeVoid(e[4],1)&&(f.auto=1),c.timeVoid(e[5],2)&&(f.auto=1)),f.auto?c.creation([e[0],0|e[1],0|e[2]],1):f.value!==c.elem[h.elemv]&&(c.elem[h.elemv]=f.value)}},c.months=[31,null,31,30,31,30,31,31,30,31,30,31],c.viewDate=function(a,b,d){var f=(c.query,{}),g=new Date;a<(0|c.mins[0])&&(a=0|c.mins[0]),a>(0|c.maxs[0])&&(a=0|c.maxs[0]),g.setFullYear(a,b,d),f.ymd=[g.getFullYear(),g.getMonth(),g.getDate()],c.months[1]=c.isleap(f.ymd[0])?29:28,g.setFullYear(f.ymd[0],f.ymd[1],1),f.FDay=g.getDay(),f.PDay=c.months[0===b?11:b-1]-f.FDay+1,f.NDay=1,c.each(h.tds,function(a,b){var g,d=f.ymd[0],e=f.ymd[1]+1;b.className="",a=f.FDay&&a'+a+"年":'
  • '+(a-7+b)+"年
  • "}),b("#laydate_ys").innerHTML=d,c.each(b("#laydate_ys li"),function(a,b){"y"===c.checkVoid(b.getAttribute("y"))[0]?c.addClass(b,h[1]):c.on(b,"click",function(a){c.stopmp(a).reshow(),c.viewDate(0|this.getAttribute("y"),c.ymd[1],c.ymd[2])})})},c.initDate=function(){var d=(c.query,new Date),e=c.elem[h.elemv].match(/\d+/g)||[];e.length<3&&(e=c.options.start.match(/\d+/g)||[],e.length<3&&(e=[d.getFullYear(),d.getMonth()+1,d.getDate()])),c.inymd=e,c.viewDate(e[0],e[1]-1,e[2])},c.iswrite=function(){var a=c.query,b={time:a("#laydate_hms")};c.shde(b.time,!c.options.istime),c.shde(h.oclear,!("isclear"in c.options?c.options.isclear:1)),c.shde(h.otoday,!("istoday"in c.options?c.options.istoday:1)),c.shde(h.ok,!("issure"in c.options?c.options.issure:1))},c.orien=function(a,b){var d,e=c.elem.getBoundingClientRect();a.style.left=e.left+(b?0:c.scroll(1))+"px",d=e.bottom+a.offsetHeight/1.5<=c.winarea()?e.bottom-1:e.top>a.offsetHeight/1.5?e.top-a.offsetHeight+1:c.winarea()-a.offsetHeight,a.style.top=d+(b?0:c.scroll())+"px"},c.follow=function(a){c.options.fixed?(a.style.position="fixed",c.orien(a,1)):(a.style.position="absolute",c.orien(a))},c.viewtb=function(){var a,b=[],f=["日","一","二","三","四","五","六"],h={},i=d[e]("table"),j=d[e]("thead");return j.appendChild(d[e]("tr")),h.creath=function(a){var b=d[e]("th");b.innerHTML=f[a],j[g]("tr")[0].appendChild(b),b=null},c.each(new Array(6),function(d){b.push([]),a=i.insertRow(0),c.each(new Array(7),function(c){b[d][c]=0,0===d&&h.creath(c),a.insertCell(c)})}),i.insertBefore(j,i.children[0]),i.id=i.className="laydate_table",a=b=null,i.outerHTML.toLowerCase()}(),c.view=function(a,f){var i,g=c.query,j={};f=f||a,c.elem=a,c.options=f,c.options.format||(c.options.format=b.format),c.options.start=c.options.start||"",c.mm=j.mm=[c.options.min||b.min,c.options.max||b.max],c.mins=j.mm[0].match(/\d+/g),c.maxs=j.mm[1].match(/\d+/g),h.elemv=/textarea|input/.test(c.elem.tagName.toLocaleLowerCase())?"value":"innerHTML",c.box?c.shde(c.box):(i=d[e]("div"),i.id=h[0],i.className=h[0],i.style.cssText="position: absolute;",i.setAttribute("name","laydate-v"+laydate.v),i.innerHTML=j.html='
      '+function(){var a="";return c.each(new Array(12),function(b){a+=''+c.digit(b+1)+"月"}),a}()+"
      "+"
      "+"
      "+c.viewtb+'
      '+'
        '+'
      • 时间
      • '+"
      • :
      • "+"
      • :
      • "+"
      • "+"
      "+'
      '+'
      '+'清空'+'今天'+'确认'+"
      "+(b.isv?'laydate-v'+laydate.v+"":"")+"
      ",d.body.appendChild(i),c.box=g("#"+h[0]),c.events(),i=null),c.follow(c.box),f.zIndex?c.box.style.zIndex=f.zIndex:c.removeCssAttr(c.box,"z-index"),c.stopMosup("click",c.box),c.initDate(),c.iswrite(),c.check()},c.reshow=function(){return c.each(c.query("#"+h[0]+" .laydate_show"),function(a,b){c.removeClass(b,"laydate_show")}),this},c.close=function(){c.reshow(),c.shde(c.query("#"+h[0]),1),c.elem=null},c.parse=function(a,d,e){return a=a.concat(d),e=e||(c.options?c.options.format:b.format),e.replace(/YYYY|MM|DD|hh|mm|ss/g,function(){return a.index=0|++a.index,c.digit(a[a.index])})},c.creation=function(a,b){var e=(c.query,c.hmsin),f=c.parse(a,[e[0].value,e[1].value,e[2].value]);c.elem[h.elemv]=f,b||(c.close(),"function"==typeof c.options.choose&&c.options.choose(f))},c.events=function(){var b=c.query,e={box:"#"+h[0]};c.addClass(d.body,"laydate_body"),h.tds=b("#laydate_table td"),h.mms=b("#laydate_ms span"),h.year=b("#laydate_y"),h.month=b("#laydate_m"),c.each(b(e.box+" .laydate_ym"),function(a,b){c.on(b,"click",function(b){c.stopmp(b).reshow(),c.addClass(this[g]("div")[0],"laydate_show"),a||(e.YY=parseInt(h.year.value),c.viewYears(e.YY))})}),c.on(b(e.box),"click",function(){c.reshow()}),e.tabYear=function(a){0===a?c.ymd[0]--:1===a?c.ymd[0]++:2===a?e.YY-=14:e.YY+=14,2>a?(c.viewDate(c.ymd[0],c.ymd[1],c.ymd[2]),c.reshow()):c.viewYears(e.YY)},c.each(b("#laydate_YY .laydate_tab"),function(a,b){c.on(b,"click",function(b){c.stopmp(b),e.tabYear(a)})}),e.tabMonth=function(a){a?(c.ymd[1]++,12===c.ymd[1]&&(c.ymd[0]++,c.ymd[1]=0)):(c.ymd[1]--,-1===c.ymd[1]&&(c.ymd[0]--,c.ymd[1]=11)),c.viewDate(c.ymd[0],c.ymd[1],c.ymd[2])},c.each(b("#laydate_MM .laydate_tab"),function(a,b){c.on(b,"click",function(b){c.stopmp(b).reshow(),e.tabMonth(a)})}),c.each(b("#laydate_ms span"),function(a,b){c.on(b,"click",function(a){c.stopmp(a).reshow(),c.hasClass(this,h[1])||c.viewDate(c.ymd[0],0|this.getAttribute("m"),c.ymd[2])})}),c.each(b("#laydate_table td"),function(a,b){c.on(b,"click",function(a){c.hasClass(this,h[1])||(c.stopmp(a),c.creation([0|this.getAttribute("y"),0|this.getAttribute("m"),0|this.getAttribute("d")]))})}),h.oclear=b("#laydate_clear"),c.on(h.oclear,"click",function(){c.elem[h.elemv]="",c.close()}),h.otoday=b("#laydate_today"),c.on(h.otoday,"click",function(){c.elem[h.elemv]=laydate.now(0,c.options.format),c.close()}),h.ok=b("#laydate_ok"),c.on(h.ok,"click",function(){c.valid&&c.creation([c.ymd[0],c.ymd[1]+1,c.ymd[2]])}),e.times=b("#laydate_time"),c.hmsin=e.hmsin=b("#laydate_hms input"),e.hmss=["小时","分钟","秒数"],e.hmsarr=[],c.msg=function(a,d){var f='
      '+(d||"提示")+"×
      ";"string"==typeof a?(f+="

      "+a+"

      ",c.shde(b("#"+h[0])),c.removeClass(e.times,"laydate_time1").addClass(e.times,"laydate_msg")):(e.hmsarr[a]?f=e.hmsarr[a]:(f+='
      ',c.each(new Array(0===a?24:60),function(a){f+=""+a+""}),f+="
      ",e.hmsarr[a]=f),c.removeClass(e.times,"laydate_msg"),c[0===a?"removeClass":"addClass"](e.times,"laydate_time1")),c.addClass(e.times,"laydate_show"),e.times.innerHTML=f},e.hmson=function(a,d){var e=b("#laydate_hmsno span"),f=c.valid?null:1;c.each(e,function(b,e){f?c.addClass(e,h[1]):c.timeVoid(b,d)?c.addClass(e,h[1]):c.on(e,"click",function(){c.hasClass(this,h[1])||(a.value=c.digit(0|this.innerHTML))})}),c.addClass(e[0|a.value],"laydate_click")},c.each(e.hmsin,function(a,b){c.on(b,"click",function(b){c.stopmp(b).reshow(),c.msg(a,e.hmss[a]),e.hmson(this,a)})}),c.on(d,"mouseup",function(){var a=b("#"+h[0]);a&&"none"!==a.style.display&&(c.check()||c.close())}).on(d,"keydown",function(b){b=b||a.event;var d=b.keyCode;13===d&&c.creation([c.ymd[0],c.ymd[1]+1,c.ymd[2]])})},c.init=function(){c.use("need"),c.use(h[4]+b.defSkin,h[3]),c.skinLink=c.query("#"+h[3])}(),laydate.reset=function(){c.box&&c.elem&&c.follow(c.box)},laydate.now=function(a,b){var d=new Date(0|a?function(a){return 864e5>a?+new Date+864e5*a:a}(parseInt(a)):+new Date);return c.parse([d.getFullYear(),d.getMonth()+1,d.getDate()],[d.getHours(),d.getMinutes(),d.getSeconds()],b)},laydate.skin=function(a){c.skinLink.href=c.getPath+h[4]+a+h[5]}}(window); diff --git a/api/src/main/resources/static/js/plugins/layer/laydate/need/laydate.css b/api/src/main/resources/static/js/plugins/layer/laydate/need/laydate.css deleted file mode 100644 index 4d795c913fa54fc44b9d675c0f89301b6a87253f..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/laydate/need/laydate.css +++ /dev/null @@ -1,75 +0,0 @@ -/** - - @Name: laydate 核心样式 - @Author:贤心 - @Site:http://sentsin.com/layui/laydate - -**/ - -html{_background-image:url(about:blank); _background-attachment:fixed;} -.layer-date{display: inline-block!important;vertical-align:text-top;max-width:240px;} -.laydate_body .laydate_box, .laydate_body .laydate_box *{margin:0; padding:0;} -.laydate-icon, -.laydate-icon-default, -.laydate-icon-danlan, -.laydate-icon-dahong, -.laydate-icon-molv{height:34px; padding-right:20px;min-width:34px;vertical-align: text-top;border:1px solid #C6C6C6; background-repeat:no-repeat; background-position:right center; background-color:#fff; outline:0;} -.laydate-icon-default{ background-image:url(../skins/default/icon.png)} -.laydate-icon-danlan{border:1px solid #B1D2EC; background-image:url(../skins/danlan/icon.png)} -.laydate-icon-dahong{background-image:url(../skins/dahong/icon.png)} -.laydate-icon-molv{background-image:url(../skins/molv/icon.png)} -.laydate_body .laydate_box{width:240px; font:12px '\5B8B\4F53'; z-index:99999999; *margin:-2px 0 0 -2px; *overflow:hidden; _margin:0; _position:absolute!important; background-color:#fff;} -.laydate_body .laydate_box li{list-style:none;} -.laydate_body .laydate_box .laydate_void{cursor:text!important;} -.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{text-decoration:none; blr:expression(this.onFocus=this.blur()); cursor:pointer;} -.laydate_body .laydate_box a:hover{text-decoration:none;} -.laydate_body .laydate_box cite, .laydate_body .laydate_box label{position:absolute; width:0; height:0; border-width:5px; border-style:dashed; border-color:transparent; overflow:hidden; cursor:pointer;} -.laydate_body .laydate_box .laydate_yms, .laydate_body .laydate_box .laydate_time{display:none;} -.laydate_body .laydate_box .laydate_show{display:block;} -.laydate_body .laydate_box input{outline:0; font-size:14px; background-color:#fff;} -.laydate_body .laydate_top{position:relative; height:26px; padding:5px; *width:100%; z-index:99;} -.laydate_body .laydate_ym{position:relative; float:left; height:24px; cursor:pointer;} -.laydate_body .laydate_ym input{float:left; height:24px; line-height:24px; text-align:center; border:none; cursor:pointer;} -.laydate_body .laydate_ym .laydate_yms{position:absolute; left: -1px; top: 24px; height:181px;} -.laydate_body .laydate_y{width:121px;} -.laydate_body .laydate_y input{width:64px; margin-right:15px;} -.laydate_body .laydate_y .laydate_yms{width:121px; text-align:center;} -.laydate_body .laydate_y .laydate_yms a{position:relative; display:block; height:20px;} -.laydate_body .laydate_y .laydate_yms ul{height:139px; padding:0; *overflow:hidden;} -.laydate_body .laydate_y .laydate_yms ul li{float:left; width:60px; height:20px; line-height: 20px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;} -.laydate_box *{box-sizing:content-box!important;} -.laydate_body .laydate_m{width:99px;float: right;margin-right:-2px;} -.laydate_body .laydate_m .laydate_yms{width:99px; padding:0;} -.laydate_body .laydate_m input{width:42px; margin-right:15px;} -.laydate_body .laydate_m .laydate_yms span{display:block; float:left; width:42px; margin: 5px 0 0 5px; line-height:24px; text-align:center; _display:inline;} -.laydate_body .laydate_choose{display:block; float:left; position:relative; width:20px; height:24px;} -.laydate_body .laydate_choose cite, .laydate_body .laydate_tab cite{left:50%; top:50%;} -.laydate_body .laydate_chtop cite{margin:-7px 0 0 -5px; border-bottom-style:solid;} -.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{top:50%; margin:-2px 0 0 -5px; border-top-style:solid;} -.laydate_body .laydate_chprev cite{margin:-5px 0 0 -7px;} -.laydate_body .laydate_chnext cite{margin:-5px 0 0 -2px;} -.laydate_body .laydate_ym label{right:28px;} -.laydate_body .laydate_table{ width:230px; margin:0 5px; border-collapse:collapse; border-spacing:0px; } -.laydate_body .laydate_table td{width:31px; height:19px; line-height:19px; text-align: center; cursor:pointer; font-size: 12px;} -.laydate_body .laydate_table thead{height:22px; line-height:22px;} -.laydate_body .laydate_table thead th{font-weight:400; font-size:12px; text-align:center;} -.laydate_body .laydate_bottom{position:relative; height:22px; line-height:20px; padding:5px; font-size:12px;} -.laydate_body .laydate_bottom #laydate_hms{position: relative; z-index: 1; float:left; } -.laydate_body .laydate_time{ position:absolute; left:5px; bottom: 26px; width:129px; height:125px; *overflow:hidden;} -.laydate_body .laydate_time .laydate_hmsno{ padding:5px 0 0 5px;} -.laydate_body .laydate_time .laydate_hmsno span{display:block; float:left; width:24px; height:19px; line-height:19px; text-align:center; cursor:pointer; *margin-bottom:-5px;} -.laydate_body .laydate_time1{width:228px; height:154px;} -.laydate_body .laydate_time1 .laydate_hmsno{padding: 6px 0 0 8px;} -.laydate_body .laydate_time1 .laydate_hmsno span{width:21px; height:20px; line-height:20px;} -.laydate_body .laydate_msg{left:49px; bottom:67px; width:141px; height:auto; overflow: hidden;} -.laydate_body .laydate_msg p{padding:5px 10px;} -.laydate_body .laydate_bottom li{float:left; height:20px; line-height:20px; border-right:none; font-weight:900;} -.laydate_body .laydate_bottom .laydate_sj{width:33px; text-align:center; font-weight:400;} -.laydate_body .laydate_bottom input{float:left; width:21px; height:20px; line-height:20px; border:none; text-align:center; cursor:pointer; font-size:12px; font-weight:400;} -.laydate_body .laydate_bottom .laydte_hsmtex{height:20px; line-height:20px; text-align:center;} -.laydate_body .laydate_bottom .laydte_hsmtex span{position:absolute; width:20px; top:0; right:0px; cursor:pointer;} -.laydate_body .laydate_bottom .laydte_hsmtex span:hover{font-size:14px;} -.laydate_body .laydate_bottom .laydate_btn{position:absolute; right:5px; top:5px;} -.laydate_body .laydate_bottom .laydate_btn a{float:left; height:20px; padding:0 6px; _padding:0 5px;} -.laydate_body .laydate_bottom .laydate_v{position:absolute; left:10px; top:6px; font-family:Courier; z-index:0;} - diff --git a/api/src/main/resources/static/js/plugins/layer/laydate/skins/default/icon.png b/api/src/main/resources/static/js/plugins/layer/laydate/skins/default/icon.png deleted file mode 100644 index 948660fb555db0e80cb75d6c0e65bb2a73a07145..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/laydate/skins/default/icon.png and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/laydate/skins/default/laydate.css b/api/src/main/resources/static/js/plugins/layer/laydate/skins/default/laydate.css deleted file mode 100644 index a3ce4d4b26c2e855a3e6ae9baa4c2109864f482c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/laydate/skins/default/laydate.css +++ /dev/null @@ -1,59 +0,0 @@ -/** - - @Name: laydate皮肤:墨绿 - @Author:贤心 - @Site:http://sentsin.com/layui/laydate - -**/ - -.laydate-icon{border:1px solid #ccc; background-image:url(icon.png)} - -.laydate_body .laydate_bottom #laydate_hms, -.laydate_body .laydate_time{border:1px solid #ccc;} - -.laydate_body .laydate_box, -.laydate_body .laydate_ym .laydate_yms, -.laydate_body .laydate_time{box-shadow: 2px 2px 5px rgba(0,0,0,.1);} - -.laydate_body .laydate_box{border-top:none; border-bottom:none; background-color:#fff; color:#00625A;} -.laydate_body .laydate_box input{background:none!important; color:#fff;} -.laydate_body .laydate_box .laydate_void{color:#00E8D7!important;} -.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{color:#00625A;} -.laydate_body .laydate_box a:hover{color:#666;} -.laydate_body .laydate_click{background-color:#009F95!important; color:#fff!important;} -.laydate_body .laydate_top{border-top:1px solid #009F95; background-color:#009F95} -.laydate_body .laydate_ym{border:1px solid #009F95; background-color:#009F95;} -.laydate_body .laydate_ym .laydate_yms{border:1px solid #009F95; background-color:#009F95; color:#fff;} -.laydate_body .laydate_y .laydate_yms a{border-bottom:1px solid #009F95;} -.laydate_body .laydate_y .laydate_yms .laydate_chdown{border-top:1px solid #009F95; border-bottom:none;} -.laydate_body .laydate_choose{border-left:1px solid #009F95;} -.laydate_body .laydate_chprev{border-left:none; border-right:1px solid #009F95;} -.laydate_body .laydate_choose:hover, -.laydate_body .laydate_y .laydate_yms a:hover{background-color:#00C1B3;} -.laydate_body .laydate_chtop cite{border-bottom-color:#fff;} -.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{border-top-color:#fff;} -.laydate_body .laydate_chprev cite{border-right-style:solid; border-right-color:#fff;} -.laydate_body .laydate_chnext cite{border-left-style:solid; border-left-color:#fff;} -.laydate_body .laydate_table{width: 240px!important; margin: 0!important; border:1px solid #ccc; border-top:none; border-bottom:none;} -.laydate_body .laydate_table td{border:none; height:21px!important; line-height:21px!important; background-color:#fff; color:#00625A;} -.laydate_body .laydate_table .laydate_nothis{color:#999;} -.laydate_body .laydate_table thead{border-bottom:1px solid #ccc; height:21px!important; line-height:21px!important;} -.laydate_body .laydate_table thead th{} -.laydate_body .laydate_bottom{border:1px solid #ccc; border-top:none;} -.laydate_body .laydate_bottom #laydate_hms{background-color:#fff;} -.laydate_body .laydate_time{background-color:#fff;} -.laydate_body .laydate_time1{width: 226px!important; height: 152px!important;} -.laydate_body .laydate_bottom .laydate_sj{width:31px!important; border-right:1px solid #ccc; background-color:#fff;} -.laydate_body .laydate_bottom input{background-color:#fff; color:#00625A;} -.laydate_body .laydate_bottom .laydte_hsmtex{border-bottom:1px solid #ccc;} -.laydate_body .laydate_bottom .laydate_btn{border-right:1px solid #ccc;} -.laydate_body .laydate_bottom .laydate_v{color:#999} -.laydate_body .laydate_bottom .laydate_btn a{border: 1px solid #ccc; border-right:none; background-color:#fff;} -.laydate_body .laydate_bottom .laydate_btn a:hover{background-color:#F6F6F6; color:#00625A;} - -.laydate_body .laydate_m .laydate_yms span:hover, -.laydate_body .laydate_time .laydate_hmsno span:hover, -.laydate_body .laydate_y .laydate_yms ul li:hover, -.laydate_body .laydate_table td:hover{background-color:#00C1B3; color:#fff;} - - diff --git a/api/src/main/resources/static/js/plugins/layer/layer.js b/api/src/main/resources/static/js/plugins/layer/layer.js deleted file mode 100644 index 2373ba9f8fcdfe130c590092c0345c57567e9854..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/layer.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! layer-v3.1.0 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */ - ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.scripts,t=e[e.length-1],i=t.src;if(!t.getAttribute("merge"))return i.substring(0,i.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.0",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
      '+(f?r.title[0]:r.title)+"
      ":"";return r.zIndex=s,t([r.shade?'
      ':"",'
      '+(e&&2!=r.type?"":u)+'
      '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
      '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
      '+e+"
      "}():"")+(r.resize?'':"")+"
      "],u,i('
      ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
        '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
      • '+(t[0].content||"no content")+"
      • ";i'+(t[i].content||"no content")+"";return a}()+"
      ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(u[d].alt||
      '+(u.length>1?'':"")+'
      '+(u[d].alt||"")+""+s.imgIndex+"/"+u.length+"
      ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
      是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window); \ No newline at end of file diff --git a/api/src/main/resources/static/js/plugins/layer/layer.min.js b/api/src/main/resources/static/js/plugins/layer/layer.min.js deleted file mode 100644 index 56f5ae943b668323ebf09760b2f6f30ec54db993..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/layer.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! layer-v2.1 弹层组件 License LGPL http://layer.layui.com/ By 贤心 */ -;!function(a,b){"use strict";var c,d,e={getPath:function(){var a=document.scripts,b=a[a.length-1],c=b.src;if(!b.getAttribute("merge"))return c.substring(0,c.lastIndexOf("/")+1)}(),enter:function(a){13===a.keyCode&&a.preventDefault()},config:{},end:{},btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"]},f={v:"2.1",ie6:!!a.ActiveXObject&&!a.XMLHttpRequest,index:0,path:e.getPath,config:function(a,b){var d=0;return a=a||{},f.cache=e.config=c.extend(e.config,a),f.path=e.config.path||f.path,"string"==typeof a.extend&&(a.extend=[a.extend]),f.use("skin/layer.css",a.extend&&a.extend.length>0?function g(){var c=a.extend;f.use(c[c[d]?d:d-1],d'+(i?f.title[0]:f.title)+"":"";return f.zIndex=g,b([f.shade?'
      ':"",'
      '+(a&&2!=f.type?"":k)+'
      '+(0==f.type&&-1!==f.icon?'':"")+(1==f.type&&a?"":f.content||"")+'
      '+function(){var a=j?'':"";return f.closeBtn&&(a+=''),a}()+""+(f.btn?function(){var a="";"string"==typeof f.btn&&(f.btn=[f.btn]);for(var b=0,c=f.btn.length;c>b;b++)a+=''+f.btn[b]+"";return'
      '+a+"
      "}():"")+"
      "],k),c},g.pt.creat=function(){var a=this,b=a.config,g=a.index,i=b.content,j="object"==typeof i;switch("string"==typeof b.area&&(b.area="auto"===b.area?["",""]:[b.area,""]),b.type){case 0:b.btn="btn"in b?b.btn:e.btn[0],f.closeAll("dialog");break;case 2:var i=b.content=j?b.content:[b.content||"http://layer.layui.com","auto"];b.content='';break;case 3:b.title=!1,b.closeBtn=!1,-1===b.icon&&0===b.icon,f.closeAll("loading");break;case 4:j||(b.content=[b.content,"body"]),b.follow=b.content[1],b.content=b.content[0]+'',b.title=!1,b.shade=!1,b.fix=!1,b.tips="object"==typeof b.tips?b.tips:[b.tips,!0],b.tipsMore||f.closeAll("tips")}a.vessel(j,function(d,e){c("body").append(d[0]),j?function(){2==b.type||4==b.type?function(){c("body").append(d[1])}():function(){i.parents("."+h[0])[0]||(i.show().addClass("layui-layer-wrap").wrap(d[1]),c("#"+h[0]+g).find("."+h[5]).before(e))}()}():c("body").append(d[1]),a.layero=c("#"+h[0]+g),b.scrollbar||h.html.css("overflow","hidden").attr("layer-full",g)}).auto(g),2==b.type&&f.ie6&&a.layero.find("iframe").attr("src",i[0]),c(document).off("keydown",e.enter).on("keydown",e.enter),a.layero.on("keydown",function(a){c(document).off("keydown",e.enter)}),4==b.type?a.tips():a.offset(),b.fix&&d.on("resize",function(){a.offset(),(/^\d+%$/.test(b.area[0])||/^\d+%$/.test(b.area[1]))&&a.auto(g),4==b.type&&a.tips()}),b.time<=0||setTimeout(function(){f.close(a.index)},b.time),a.move().callback()},g.pt.auto=function(a){function b(a){a=g.find(a),a.height(i[1]-j-k-2*(0|parseFloat(a.css("padding"))))}var e=this,f=e.config,g=c("#"+h[0]+a);""===f.area[0]&&f.maxWidth>0&&(/MSIE 7/.test(navigator.userAgent)&&f.btn&&g.width(g.innerWidth()),g.outerWidth()>f.maxWidth&&g.width(f.maxWidth));var i=[g.innerWidth(),g.innerHeight()],j=g.find(h[1]).outerHeight()||0,k=g.find("."+h[6]).outerHeight()||0;switch(f.type){case 2:b("iframe");break;default:""===f.area[1]?f.fix&&i[1]>=d.height()&&(i[1]=d.height(),b("."+h[5])):b("."+h[5])}return e},g.pt.offset=function(){var a=this,b=a.config,c=a.layero,e=[c.outerWidth(),c.outerHeight()],f="object"==typeof b.offset;a.offsetTop=(d.height()-e[1])/2,a.offsetLeft=(d.width()-e[0])/2,f?(a.offsetTop=b.offset[0],a.offsetLeft=b.offset[1]||a.offsetLeft):"auto"!==b.offset&&(a.offsetTop=b.offset,"rb"===b.offset&&(a.offsetTop=d.height()-e[1],a.offsetLeft=d.width()-e[0])),b.fix||(a.offsetTop=/%$/.test(a.offsetTop)?d.height()*parseFloat(a.offsetTop)/100:parseFloat(a.offsetTop),a.offsetLeft=/%$/.test(a.offsetLeft)?d.width()*parseFloat(a.offsetLeft)/100:parseFloat(a.offsetLeft),a.offsetTop+=d.scrollTop(),a.offsetLeft+=d.scrollLeft()),c.css({top:a.offsetTop,left:a.offsetLeft})},g.pt.tips=function(){var a=this,b=a.config,e=a.layero,f=[e.outerWidth(),e.outerHeight()],g=c(b.follow);g[0]||(g=c("body"));var i={width:g.outerWidth(),height:g.outerHeight(),top:g.offset().top,left:g.offset().left},j=e.find(".layui-layer-TipsG"),k=b.tips[0];b.tips[1]||j.remove(),i.autoLeft=function(){i.left+f[0]-d.width()>0?(i.tipLeft=i.left+i.width-f[0],j.css({right:12,left:"auto"})):i.tipLeft=i.left},i.where=[function(){i.autoLeft(),i.tipTop=i.top-f[1]-10,j.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",b.tips[1])},function(){i.tipLeft=i.left+i.width+10,i.tipTop=i.top,j.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",b.tips[1])},function(){i.autoLeft(),i.tipTop=i.top+i.height+10,j.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",b.tips[1])},function(){i.tipLeft=i.left-f[0]-10,i.tipTop=i.top,j.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",b.tips[1])}],i.where[k-1](),1===k?i.top-(d.scrollTop()+f[1]+16)<0&&i.where[2]():2===k?d.width()-(i.left+i.width+f[0]+16)>0||i.where[3]():3===k?i.top-d.scrollTop()+i.height+f[1]+16-d.height()>0&&i.where[0]():4===k&&f[0]+16-i.left>0&&i.where[1](),e.find("."+h[5]).css({"background-color":b.tips[1],"padding-right":b.closeBtn?"30px":""}),e.css({left:i.tipLeft,top:i.tipTop})},g.pt.move=function(){var a=this,b=a.config,e={setY:0,moveLayer:function(){var a=e.layero,b=parseInt(a.css("margin-left")),c=parseInt(e.move.css("left"));0===b||(c-=b),"fixed"!==a.css("position")&&(c-=a.parent().offset().left,e.setY=0),a.css({left:c,top:parseInt(e.move.css("top"))-e.setY})}},f=a.layero.find(b.move);return b.move&&f.attr("move","ok"),f.css({cursor:b.move?"move":"auto"}),c(b.move).on("mousedown",function(a){if(a.preventDefault(),"ok"===c(this).attr("move")){e.ismove=!0,e.layero=c(this).parents("."+h[0]);var f=e.layero.offset().left,g=e.layero.offset().top,i=e.layero.outerWidth()-6,j=e.layero.outerHeight()-6;c("#layui-layer-moves")[0]||c("body").append('
      '),e.move=c("#layui-layer-moves"),b.moveType&&e.move.css({visibility:"hidden"}),e.moveX=a.pageX-e.move.position().left,e.moveY=a.pageY-e.move.position().top,"fixed"!==e.layero.css("position")||(e.setY=d.scrollTop())}}),c(document).mousemove(function(a){if(e.ismove){var c=a.pageX-e.moveX,f=a.pageY-e.moveY;if(a.preventDefault(),!b.moveOut){e.setY=d.scrollTop();var g=d.width()-e.move.outerWidth(),h=e.setY;0>c&&(c=0),c>g&&(c=g),h>f&&(f=h),f>d.height()-e.move.outerHeight()+e.setY&&(f=d.height()-e.move.outerHeight()+e.setY)}e.move.css({left:c,top:f}),b.moveType&&e.moveLayer(),c=f=g=h=null}}).mouseup(function(){try{e.ismove&&(e.moveLayer(),e.move.remove(),b.moveEnd&&b.moveEnd()),e.ismove=!1}catch(a){e.ismove=!1}}),a},g.pt.callback=function(){function a(){var a=g.cancel&&g.cancel(b.index);a===!1||f.close(b.index)}var b=this,d=b.layero,g=b.config;b.openLayer(),g.success&&(2==g.type?d.find("iframe").on("load",function(){g.success(d,b.index)}):g.success(d,b.index)),f.ie6&&b.IE6(d),d.find("."+h[6]).children("a").on("click",function(){var e=c(this).index();g["btn"+(e+1)]&&g["btn"+(e+1)](b.index,d),0===e?g.yes?g.yes(b.index,d):f.close(b.index):1===e?a():g["btn"+(e+1)]||f.close(b.index)}),d.find("."+h[7]).on("click",a),g.shadeClose&&c("#layui-layer-shade"+b.index).on("click",function(){f.close(b.index)}),d.find(".layui-layer-min").on("click",function(){f.min(b.index,g),g.min&&g.min(d)}),d.find(".layui-layer-max").on("click",function(){c(this).hasClass("layui-layer-maxmin")?(f.restore(b.index),g.restore&&g.restore(d)):(f.full(b.index,g),g.full&&g.full(d))}),g.end&&(e.end[b.index]=g.end)},e.reselect=function(){c.each(c("select"),function(a,b){var d=c(this);d.parents("."+h[0])[0]||1==d.attr("layer")&&c("."+h[0]).length<1&&d.removeAttr("layer").show(),d=null})},g.pt.IE6=function(a){function b(){a.css({top:f+(e.config.fix?d.scrollTop():0)})}var e=this,f=a.offset().top;b(),d.scroll(b),c("select").each(function(a,b){var d=c(this);d.parents("."+h[0])[0]||"none"===d.css("display")||d.attr({layer:"1"}).hide(),d=null})},g.pt.openLayer=function(){var a=this;f.zIndex=a.config.zIndex,f.setTop=function(a){var b=function(){f.zIndex++,a.css("z-index",f.zIndex+1)};return f.zIndex=parseInt(a[0].style.zIndex),a.on("mousedown",b),f.zIndex}},e.record=function(a){var b=[a.outerWidth(),a.outerHeight(),a.position().top,a.position().left+parseFloat(a.css("margin-left"))];a.find(".layui-layer-max").addClass("layui-layer-maxmin"),a.attr({area:b})},e.rescollbar=function(a){h.html.attr("layer-full")==a&&(h.html[0].style.removeProperty?h.html[0].style.removeProperty("overflow"):h.html[0].style.removeAttribute("overflow"),h.html.removeAttr("layer-full"))},a.layer=f,f.getChildFrame=function(a,b){return b=b||c("."+h[4]).attr("times"),c("#"+h[0]+b).find("iframe").contents().find(a)},f.getFrameIndex=function(a){return c("#"+a).parents("."+h[4]).attr("times")},f.iframeAuto=function(a){if(a){var b=f.getChildFrame("html",a).outerHeight(),d=c("#"+h[0]+a),e=d.find(h[1]).outerHeight()||0,g=d.find("."+h[6]).outerHeight()||0;d.css({height:b+e+g}),d.find("iframe").css({height:b})}},f.iframeSrc=function(a,b){c("#"+h[0]+a).find("iframe").attr("src",b)},f.style=function(a,b){var d=c("#"+h[0]+a),f=d.attr("type"),g=d.find(h[1]).outerHeight()||0,i=d.find("."+h[6]).outerHeight()||0;(f===e.type[1]||f===e.type[2])&&(d.css(b),f===e.type[2]&&d.find("iframe").css({height:parseFloat(b.height)-g-i}))},f.min=function(a,b){var d=c("#"+h[0]+a),g=d.find(h[1]).outerHeight()||0;e.record(d),f.style(a,{width:180,height:g,overflow:"hidden"}),d.find(".layui-layer-min").hide(),"page"===d.attr("type")&&d.find(h[4]).hide(),e.rescollbar(a)},f.restore=function(a){var b=c("#"+h[0]+a),d=b.attr("area").split(",");b.attr("type");f.style(a,{width:parseFloat(d[0]),height:parseFloat(d[1]),top:parseFloat(d[2]),left:parseFloat(d[3]),overflow:"visible"}),b.find(".layui-layer-max").removeClass("layui-layer-maxmin"),b.find(".layui-layer-min").show(),"page"===b.attr("type")&&b.find(h[4]).show(),e.rescollbar(a)},f.full=function(a){var b,g=c("#"+h[0]+a);e.record(g),h.html.attr("layer-full")||h.html.css("overflow","hidden").attr("layer-full",a),clearTimeout(b),b=setTimeout(function(){var b="fixed"===g.css("position");f.style(a,{top:b?0:d.scrollTop(),left:b?0:d.scrollLeft(),width:d.width(),height:d.height()}),g.find(".layui-layer-min").hide()},100)},f.title=function(a,b){var d=c("#"+h[0]+(b||f.index)).find(h[1]);d.html(a)},f.close=function(a){var b=c("#"+h[0]+a),d=b.attr("type");if(b[0]){if(d===e.type[1]&&"object"===b.attr("conType")){b.children(":not(."+h[5]+")").remove();for(var g=0;2>g;g++)b.find(".layui-layer-wrap").unwrap().hide()}else{if(d===e.type[2])try{var i=c("#"+h[4]+a)[0];i.contentWindow.document.write(""),i.contentWindow.close(),b.find("."+h[5])[0].removeChild(i)}catch(j){}b[0].innerHTML="",b.remove()}c("#layui-layer-moves, #layui-layer-shade"+a).remove(),f.ie6&&e.reselect(),e.rescollbar(a),c(document).off("keydown",e.enter),"function"==typeof e.end[a]&&e.end[a](),delete e.end[a]}},f.closeAll=function(a){c.each(c("."+h[0]),function(){var b=c(this),d=a?b.attr("type")===a:1;d&&f.close(b.attr("times")),d=null})},e.run=function(){c=jQuery,d=c(a),h.html=c("html"),f.open=function(a){var b=new g(a);return b.index}},"function"==typeof define?define(function(){return e.run(),f}):function(){e.run(),f.use("skin/layer.css")}()}(window); diff --git a/api/src/main/resources/static/js/plugins/layer/layim/data/chatlog.json b/api/src/main/resources/static/js/plugins/layer/layim/data/chatlog.json deleted file mode 100644 index 13954d79172462dcc8ee27f9f3d7242802ecad22..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/layim/data/chatlog.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "status": 1, - "msg": "ok", - "data": [ - { - "id": "100001", - "name": "Beaut-zihan", - "time": "10:23", - "face": "img/a1.jpg" - }, - { - "id": "100002", - "name": "慕容晓晓", - "time": "昨天", - "face": "img/a2.jpg" - }, - { - "id": "1000033", - "name": "乔峰", - "time": "2014-4.22", - "face": "img/a3.jpg" - }, - { - "id": "10000333", - "name": "高圆圆", - "time": "2014-4.21", - "face": "img/a4.jpg" - } - ] -} diff --git a/api/src/main/resources/static/js/plugins/layer/layim/data/friend.json b/api/src/main/resources/static/js/plugins/layer/layim/data/friend.json deleted file mode 100644 index 13a2b6587751067d6039d85b8f9eaf4a615576eb..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/layim/data/friend.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "status": 1, - "msg": "ok", - "data": [ - { - "name": "销售部", - "nums": 36, - "id": 1, - "item": [ - { - "id": "100001", - "name": "郭敬明", - "face": "img/a5.jpg" - }, - { - "id": "100002", - "name": "作家崔成浩", - "face": "img/a6.jpg" - }, - { - "id": "1000022", - "name": "韩寒", - "face": "img/a7.jpg" - }, - { - "id": "10000222", - "name": "范爷", - "face": "img/a8.jpg" - }, - { - "id": "100002222", - "name": "小马哥", - "face": "img/a9.jpg" - } - ] - }, - { - "name": "大学同窗", - "nums": 16, - "id": 2, - "item": [ - { - "id": "1000033", - "name": "苏醒", - "face": "img/a9.jpg" - }, - { - "id": "10000333", - "name": "马云", - "face": "img/a8.jpg" - }, - { - "id": "100003", - "name": "鬼脚七", - "face": "img/a7.jpg" - }, - { - "id": "100004", - "name": "谢楠", - "face": "img/a6.jpg" - }, - { - "id": "100005", - "name": "徐峥", - "face": "img/a5.jpg" - } - ] - }, - { - "name": "H+后台主题", - "nums": 38, - "id": 3, - "item": [ - { - "id": "100006", - "name": "柏雪近在它香", - "face": "img/a4.jpg" - }, - { - "id": "100007", - "name": "罗昌平", - "face": "img/a3.jpg" - }, - { - "id": "100008", - "name": "Crystal影子", - "face": "img/a2.jpg" - }, - { - "id": "100009", - "name": "艺小想", - "face": "img/a1.jpg" - }, - { - "id": "100010", - "name": "天猫", - "face": "img/a8.jpg" - }, - { - "id": "100011", - "name": "张泉灵", - "face": "img/a7.jpg" - } - ] - } - ] -} diff --git a/api/src/main/resources/static/js/plugins/layer/layim/data/group.json b/api/src/main/resources/static/js/plugins/layer/layim/data/group.json deleted file mode 100644 index 3352f656d7f52b63ba6f78a7f5e05571c781090b..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/layim/data/group.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "status": 1, - "msg": "ok", - "data": [ - { - "name": "H+交流群", - "nums": 36, - "id": 1, - "item": [ - { - "id": "101", - "name": "H+ Bug反馈", - "face": "http://tp2.sinaimg.cn/2211874245/180/40050524279/0" - }, - { - "id": "102", - "name": "H+ 技术交流", - "face": "http://tp3.sinaimg.cn/1820711170/180/1286855219/1" - } - ] - }, - { - "name": "Bootstrap", - "nums": 16, - "id": 2, - "item": [ - { - "id": "103", - "name": "Bootstrap中文", - "face": "http://tp2.sinaimg.cn/2211874245/180/40050524279/0" - }, - { - "id": "104", - "name": "Bootstrap资源", - "face": "http://tp3.sinaimg.cn/1820711170/180/1286855219/1" - } - ] - }, - { - "name": "WebApp", - "nums": 106, - "id": 3, - "item": [ - { - "id": "105", - "name": "移动开发", - "face": "http://tp2.sinaimg.cn/2211874245/180/40050524279/0" - }, - { - "id": "106", - "name": "H5前言", - "face": "http://tp3.sinaimg.cn/1820711170/180/1286855219/1" - } - ] - } - ] -} diff --git a/api/src/main/resources/static/js/plugins/layer/layim/data/groups.json b/api/src/main/resources/static/js/plugins/layer/layim/data/groups.json deleted file mode 100644 index fd0464ad69311ea6b225a11eb701cd6da489cd0c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/layim/data/groups.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "status": 1, - "msg": "ok", - "data": [ - { - "id": "100001", - "name": "無言的蒁説", - "face": "img/a1.jpg" - }, - { - "id": "100002", - "name": "婷宝奢侈品", - "face": "img/a2.jpg" - }, - { - "id": "100003", - "name": "忆恨思爱", - "face": "img/a3.jpg" - }, - { - "id": "100004", - "name": "天涯奥拓慢", - "face": "img/a4.jpg" - }, - { - "id": "100005", - "name": "雨落无声的天空", - "face": "img/a5.jpg" - }, - { - "id": "100006", - "name": "李越LycorisRadiate", - "face": "img/a6.jpg" - }, - { - "id": "100007", - "name": "冯胖妞张直丑", - "face": "img/a7.jpg" - }, - { - "id": "100008", - "name": "陈龙hmmm", - "face": "img/a8.jpg" - }, - { - "id": "100009", - "name": "别闹哥胆儿小", - "face": "img/a9.jpg" - }, - { - "id": "100010", - "name": "锅锅锅锅萌哒哒 ", - "face": "img/a10.jpg" - } - ] -} diff --git a/api/src/main/resources/static/js/plugins/layer/layim/layim.css b/api/src/main/resources/static/js/plugins/layer/layim/layim.css deleted file mode 100644 index a568a035858f0631529dde6abe87ad45731e628d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/layim/layim.css +++ /dev/null @@ -1,158 +0,0 @@ -/* - - @Name: layim WebIM 1.0.0 - @Author:贤心(子涵修改) - @Date: 2014-04-25 - @Blog: http://sentsin.com - - */ -body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,input,button,textarea,p,blockquote,th,td,form{margin:0; padding:0;} -input,button,textarea,select,optgroup,option{font-family:inherit; font-size:inherit; font-style:inherit; font-weight:inherit; outline: 0;} -li{list-style:none;} -.xxim_icon, .xxim_main i, .layim_chatbox i{position:absolute;} -.loading{background:url(loading.gif) no-repeat center center;} -.layim_chatbox a, .layim_chatbox a:hover{color:#343434; text-decoration:none; } -.layim_zero{position:absolute; width:0; height:0; border-style:dashed; border-color:transparent; overflow:hidden;} - -.xxim_main{position:fixed; right:1px; bottom:1px; width:230px; border:1px solid #BEBEBE; background-color:#fff; font-size:12px; box-shadow: 0 0 10px rgba(0,0,0,.2); z-index:99999999} -.layim_chatbox textarea{resize:none;} -.xxim_main em, .xxim_main i, .layim_chatbox em, .layim_chatbox i{font-style:normal; font-weight:400;} -.xxim_main h5{font-size:100%; font-weight:400;} - -/* 搜索栏 */ -.xxim_search{position:relative; padding-left:40px; height:40px; border-bottom:1px solid #DCDCDC; background-color:#fff;} -.xxim_search i{left:10px; top:12px; width:16px; height:16px;font-size: 16px;color:#999;} -.xxim_search input{border:none; background:none; width: 180px; margin-top:10px; line-height:20px;} -.xxim_search span{display:none; position:absolute; right:10px; top:10px; height:18px; line-height:18px;width:18px;text-align: center;background-color:#AFAFAF; color:#fff; cursor:pointer; border-radius:2px; font-size:12px; font-weight:900;} -.xxim_search span:hover{background-color:#FCBE00;} - -/* 主面板tab */ -.xxim_tabs{height:45px; border-bottom:1px solid #DBDBDB; background-color:#F4F4F4; font-size:0;} -.xxim_tabs span{position:relative; display:inline-block; *display:inline; *zoom:1; vertical-align:top; width:76px; height:45px; border-right:1px solid #DBDBDB; cursor:pointer; font-size:12px;} -.xxim_tabs span i{top:12px; left:50%; width:20px; margin-left:-10px; height:20px;font-size:20px;color:#ccc;} -.xxim_tabs .xxim_tabnow{height:46px; background-color:#fff;} -.xxim_tabs .xxim_tabnow i{color:#1ab394;} -.xxim_tabs .xxim_latechat{border-right:none;} -.xxim_tabs .xxim_tabfriend i{width:14px; margin-left:-7px;} - -/* 主面板列表 */ -.xxim_list{display:none; height:350px; padding:5px 0; overflow:hidden;} -.xxim_list:hover{ overflow-y:auto;} -.xxim_list h5{position:relative; padding-left:32px; height:26px; line-height:26px; cursor:pointer; color:#000; font-size:0;} -.xxim_list h5 span{display:inline-block; *display:inline; *zoom:1; vertical-align:top; max-width:140px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; font-size:12px;} -.xxim_list h5 i{left:15px; top:8px; width:10px; height:10px;font-size:10px;color:#666;} -.xxim_list h5 *{font-size:12px;} -.xxim_list .xxim_chatlist{display:none;} -.xxim_list .xxim_liston h5 i{width:8px; height:7px;} -.xxim_list .xxim_liston .xxim_chatlist{display:block;} -.xxim_chatlist {} -.xxim_chatlist li{position:relative; height:40px; line-height:30px; padding:5px 10px; font-size:0; cursor:pointer;} -.xxim_chatlist li:hover{background-color:#F2F4F8} -.xxim_chatlist li *{display:inline-block; *display:inline; *zoom:1; vertical-align:top; font-size:12px;} -.xxim_chatlist li span{padding-left:10px; max-width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;} -.xxim_chatlist li img{width:30px; height:30px;} -.xxim_chatlist li .xxim_time{position:absolute; right:10px; color:#999;} -.xxim_list .xxim_errormsg{text-align:center; margin:50px 0; color:#999;} -.xxim_searchmain{position:absolute; width:230px; height:491px; left:0; top:41px; z-index:10; background-color:#fff;} - -/* 主面板底部 */ -.xxim_bottom{height:34px; border-top:1px solid #D0DCF3; background-color:#F2F4F8;} -.xxim_expend{border-left:1px solid #D0DCF3; border-bottom:1px solid #D0DCF3;} -.xxim_bottom li{position:relative; width:50px; height:32px; line-height:32px; float:left; border-right:1px solid #D0DCF3; cursor:pointer;} -.xxim_bottom li i{ top:9px;} -.xxim_bottom .xxim_hide{border-right:none;} -.xxim_bottom .xxim_online{width:72px; padding-left:35px;} -.xxim_online i{left:13px; width:14px; height:14px;font-size:14px;color:#FFA00A;} -.xxim_setonline{display:none; position:absolute; left:-79px; bottom:-1px; border:1px solid #DCDCDC; background-color:#fff;} -.xxim_setonline span{position:relative; display:block; width:32px;width: 77px; padding:0 10px 0 35px;} -.xxim_setonline span:hover{background-color:#F2F4F8;} -.xxim_offline .xxim_nowstate, .xxim_setoffline i{color:#999;} -.xxim_mymsg i{left:18px; width:14px; height:14px;font-size: 14px;} -.xxim_mymsg a{position:absolute; left:0; top:0; width:50px; height:32px;} -.xxim_seter i{left:18px; width:14px; height:14px;font-size: 14px;} -.xxim_hide i{left:18px; width:14px; height:14px;font-size: 14px;} -.xxim_show i{} -.xxim_bottom .xxim_on{position:absolute; left:-17px; top:50%; width:16px;text-align: center;color:#999;line-height: 97px; height:97px; margin-top:-49px;border:solid 1px #BEBEBE;border-right: none; background:#F2F4F8;} -.xxim_bottom .xxim_off{} - -/* 聊天窗口 */ -.layim_chatbox{width:620px; border:1px solid #BEBEBE; background-color:#fff; font-size:12px; box-shadow: 0 0 10px rgba(0,0,0,.2);} -.layim_chatbox h6{position:relative; height:40px; border-bottom:1px solid #D9D9D9; background-color:#FCFDFA} -.layim_move{position:absolute; height:40px; width: 620px; z-index:0;} -.layim_face{position:absolute; bottom:-1px; left:10px; width:64px; height:64px;padding:1px;background: #fff; border:1px solid #ccc;} -.layim_face img{width:60px; height:60px;} -.layim_names{position:absolute; left:90px; max-width:300px; line-height:40px; color:#000; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; font-size:14px;} -.layim_rightbtn{position:absolute; right:15px; top:12px; font-size:20px;} -.layim_rightbtn i{position:relative; width:16px; height:16px; display:inline-block; *display:inline; *zoom:1; vertical-align:top; cursor:pointer; transition: all .3s;text-align: center;line-height: 16px;} -.layim_rightbtn .layim_close{background: #FFA00A;color:#fff;} -.layim_rightbtn .layim_close:hover{-webkit-transform: rotate(180deg); -moz-transform: rotate(180deg);} -.layim_rightbtn .layer_setmin{margin-right:5px;color:#999;font-size:14px;font-weight: 700;} -.layim_chat, .layim_chatmore,.layim_groups{height:450px; overflow:hidden;} -.layim_chatmore{display:none; float:left; width:135px; border-right:1px solid #BEBEBE; background-color:#F2F2F2} -.layim_chatlist li, .layim_groups li{position:relative; height:30px; line-height:30px; padding:0 10px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; cursor:pointer;} -.layim_chatlist li{padding:0 20px 0 10px;} -.layim_chatlist li:hover{background-color:#E3E3E3;} -.layim_chatlist li span{display:inline-block; *display:inline; *zoom:1; vertical-align:top; width:90px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;} -.layim_chatlist li em{display:none; position:absolute; top:6px; right:10px; height:18px; line-height:18px;width:18px;text-align: center;font-size:14px;font-weight:900; border-radius:3px;} -.layim_chatlist li em:hover{background-color: #FCBE00; color:#fff;} -.layim_chatlist .layim_chatnow,.layim_chatlist .layim_chatnow:hover{/*border-top:1px solid #D9D9D9; border-bottom:1px solid #D9D9D9;*/ background-color:#fff;} -.layim_chat{} -.layim_chatarea{height:280px;} -.layim_chatview{display:none; height:280px; overflow:hidden;} -.layim_chatmore:hover, .layim_groups:hover, .layim_chatview:hover{overflow-y:auto;} -.layim_chatview li{margin-bottom:10px; clear:both; *zoom:1;} -.layim_chatview li:after{content:'\20'; clear:both; *zoom:1; display:block; height:0;} - -.layim_chatthis{display:block;} -.layim_chatuser{float:left; padding:15px; font-size:0;} -.layim_chatuser *{display:inline-block; *display:inline; *zoom:1; vertical-align:top; line-height:30px; font-size:12px; padding-right:10px;} -.layim_chatuser img{width:30px; height:30px;padding-right: 0;margin-right: 15px;} -.layim_chatuser .layim_chatname{max-width:230px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;} -.layim_chatuser .layim_chattime{color:#999; padding-left:10px;} -.layim_chatsay{position:relative; float:left; margin:0 15px; padding:10px; line-height:20px; background-color:#F3F3F3; border-radius:3px; clear:both;} -.layim_chatsay .layim_zero{left:5px; top:-8px; border-width:8px; border-right-style:solid; border-right-color:#F3F3F3;} -.layim_chateme .layim_chatuser{float:right;} -.layim_chateme .layim_chatuser *{padding-right:0; padding-left:10px;} -.layim_chateme .layim_chatuser img{margin-left:15px;padding-left: 0;} -.layim_chateme .layim_chatsay .layim_zero{left:auto; right:10px;} -.layim_chateme .layim_chatuser .layim_chattime{padding-left:0; padding-right:10px;} -.layim_chateme .layim_chatsay{float:right; background-color:#EBFBE3} -.layim_chateme .layim_zero{border-right-color:#EBFBE3;} -.layim_groups{display:none; float:right; width:130px; border-left:1px solid #D9D9D9; background-color:#fff;} -.layim_groups ul{display:none;} -.layim_groups ul.layim_groupthis{display:block;} -.layim_groups li *{display:inline-block; *display:inline; *zoom:1; vertical-align:top; margin-right:10px;} -.layim_groups li img{width:20px; height:20px; margin-top:5px;} -.layim_groups li span{max-width:80px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;} -.layim_groups li:hover{background-color:#F3F3F3;} -.layim_groups .layim_errors{text-align:center; color:#999;} -.layim_tool{position:relative; height:35px; line-height:35px; padding-left:10px; background-color:#F3F3F3;} -.layim_tool i{position:relative; top:10px; display:inline-block; *display:inline; *zoom:1; vertical-align:top; width:16px; height:16px; margin-right:10px; cursor:pointer;font-size:16px;color:#999;font-weight: 700;} -.layim_tool i:hover{color:#FFA00A;} -.layim_tool .layim_seechatlog{position:absolute; right:15px;} -.layim_tool .layim_seechatlog i{} -.layim_write{display:block; border:none; width:98%; height:90px; line-height:20px; margin:5px auto 0;} -.layim_send{position:relative; height:40px; background-color:#F3F3F3;} -.layim_sendbtn{position:absolute; height:26px; line-height:26px; right:10px; top:8px; padding:0 40px 0 20px; background-color:#FFA00A; color:#fff; border-radius:3px; cursor:pointer;} -.layim_enter{position:absolute; right:0; border-left:1px solid #FFB94F; width:24px; height:26px;} -.layim_enter:hover{background-color:#E68A00; border-radius:0 3px 3px 0;} -.layim_enter .layim_zero{left:7px; top:11px; border-width:5px; border-top-style:solid; border-top-color:#FFE0B3;} -.layim_sendtype{display:none; position:absolute; right:10px; bottom:37px; border:1px solid #D9D9D9; background-color:#fff; text-align:left;} -.layim_sendtype span{display:block; line-height:24px; padding:0 10px 0 25px; cursor:pointer;} -.layim_sendtype span:hover{background-color:#F3F3F3;} -.layim_sendtype span i{left:5px;} - -.layim_min{display:none; position:absolute; left:-190px; bottom:-1px; width:160px; height:32px; line-height:32px; padding:0 10px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; border:1px solid #ccc; box-shadow: 0 0 5px rgba(0,0,75,.2); background-color:#FCFDFA; cursor:pointer;} - - - - - - - - - - - - - diff --git a/api/src/main/resources/static/js/plugins/layer/layim/layim.js b/api/src/main/resources/static/js/plugins/layer/layim/layim.js deleted file mode 100644 index 52f0083f256cafb4cf89ab780c3f0add5c37d859..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/layim/layim.js +++ /dev/null @@ -1,630 +0,0 @@ -/* - - @Name: layui WebIM 1.0.0 - @Author:贤心 - @Date: 2014-04-25 - @Blog: http://sentsin.com - - */ - -;!function(win, undefined){ - -var config = { - msgurl: 'mailbox.html?msg=', - chatlogurl: 'mailbox.html?user=', - aniTime: 200, - right: -232, - api: { - friend: 'js/plugins/layer/layim/data/friend.json', //好友列表接口 - group: 'js/plugins/layer/layim/data/group.json', //群组列表接口 - chatlog: 'js/plugins/layer/layim/data/chatlog.json', //聊天记录接口 - groups: 'js/plugins/layer/layim/data/groups.json', //群组成员接口 - sendurl: '' //发送消息接口 - }, - user: { //当前用户信息 - name: '游客', - face: 'img/a1.jpg' - }, - - //自动回复内置文案,也可动态读取数据库配置 - autoReplay: [ - '您好,我现在有事不在,一会再和您联系。', - '你没发错吧?', - '洗澡中,请勿打扰,偷窥请购票,个体四十,团体八折,订票电话:一般人我不告诉他!', - '你好,我是主人的美女秘书,有什么事就跟我说吧,等他回来我会转告他的。', - '我正在拉磨,没法招呼您,因为我们家毛驴去动物保护协会把我告了,说我剥夺它休产假的权利。', - '<(@ ̄︶ ̄@)>', - '你要和我说话?你真的要和我说话?你确定自己想说吗?你一定非说不可吗?那你说吧,这是自动回复。', - '主人正在开机自检,键盘鼠标看好机会出去凉快去了,我是他的电冰箱,我打字比较慢,你慢慢说,别急……', - '(*^__^*) 嘻嘻,是贤心吗?' - ], - - - chating: {}, - hosts: (function(){ - var dk = location.href.match(/\:\d+/); - dk = dk ? dk[0] : ''; - return 'http://' + document.domain + dk + '/'; - })(), - json: function(url, data, callback, error){ - return $.ajax({ - type: 'POST', - url: url, - data: data, - dataType: 'json', - success: callback, - error: error - }); - }, - stopMP: function(e){ - e ? e.stopPropagation() : e.cancelBubble = true; - } -}, dom = [$(window), $(document), $('html'), $('body')], xxim = {}; - -//主界面tab -xxim.tabs = function(index){ - var node = xxim.node; - node.tabs.eq(index).addClass('xxim_tabnow').siblings().removeClass('xxim_tabnow'); - node.list.eq(index).show().siblings('.xxim_list').hide(); - if(node.list.eq(index).find('li').length === 0){ - xxim.getDates(index); - } -}; - -//节点 -xxim.renode = function(){ - var node = xxim.node = { - tabs: $('#xxim_tabs>span'), - list: $('.xxim_list'), - online: $('.xxim_online'), - setonline: $('.xxim_setonline'), - onlinetex: $('#xxim_onlinetex'), - xximon: $('#xxim_on'), - layimFooter: $('#xxim_bottom'), - xximHide: $('#xxim_hide'), - xximSearch: $('#xxim_searchkey'), - searchMian: $('#xxim_searchmain'), - closeSearch: $('#xxim_closesearch'), - layimMin: $('#layim_min') - }; -}; - -//主界面缩放 -xxim.expend = function(){ - var node = xxim.node; - if(xxim.layimNode.attr('state') !== '1'){ - xxim.layimNode.stop().animate({right: config.right}, config.aniTime, function(){ - node.xximon.addClass('xxim_off'); - try{ - localStorage.layimState = 1; - }catch(e){} - xxim.layimNode.attr({state: 1}); - node.layimFooter.addClass('xxim_expend').stop().animate({marginLeft: config.right}, config.aniTime/2); - node.xximHide.addClass('xxim_show'); - }); - } else { - xxim.layimNode.stop().animate({right: 1}, config.aniTime, function(){ - node.xximon.removeClass('xxim_off'); - try{ - localStorage.layimState = 2; - }catch(e){} - xxim.layimNode.removeAttr('state'); - node.layimFooter.removeClass('xxim_expend'); - node.xximHide.removeClass('xxim_show'); - }); - node.layimFooter.stop().animate({marginLeft: 0}, config.aniTime); - } -}; - -//初始化窗口格局 -xxim.layinit = function(){ - var node = xxim.node; - - //主界面 - try{ - /* - if(!localStorage.layimState){ - config.aniTime = 0; - localStorage.layimState = 1; - } - */ - if(localStorage.layimState === '1'){ - xxim.layimNode.attr({state: 1}).css({right: config.right}); - node.xximon.addClass('xxim_off'); - node.layimFooter.addClass('xxim_expend').css({marginLeft: config.right}); - node.xximHide.addClass('xxim_show'); - } - }catch(e){ - //layer.msg(e.message, 5, -1); - } -}; - -//聊天窗口 -xxim.popchat = function(param){ - var node = xxim.node, log = {}; - - log.success = function(layero){ - layer.setMove(); - - xxim.chatbox = layero.find('#layim_chatbox'); - log.chatlist = xxim.chatbox.find('.layim_chatmore>ul'); - - log.chatlist.html('
    • '+ param.name +'×
    • ') - xxim.tabchat(param, xxim.chatbox); - - //最小化聊天窗 - xxim.chatbox.find('.layer_setmin').on('click', function(){ - var indexs = layero.attr('times'); - layero.hide(); - node.layimMin.text(xxim.nowchat.name).show(); - }); - - //关闭窗口 - xxim.chatbox.find('.layim_close').on('click', function(){ - var indexs = layero.attr('times'); - layer.close(indexs); - xxim.chatbox = null; - config.chating = {}; - config.chatings = 0; - }); - - //关闭某个聊天 - log.chatlist.on('mouseenter', 'li', function(){ - $(this).find('em').show(); - }).on('mouseleave', 'li', function(){ - $(this).find('em').hide(); - }); - log.chatlist.on('click', 'li em', function(e){ - var parents = $(this).parent(), dataType = parents.attr('type'); - var dataId = parents.attr('data-id'), index = parents.index(); - var chatlist = log.chatlist.find('li'), indexs; - - config.stopMP(e); - - delete config.chating[dataType + dataId]; - config.chatings--; - - parents.remove(); - $('#layim_area'+ dataType + dataId).remove(); - if(dataType === 'group'){ - $('#layim_group'+ dataType + dataId).remove(); - } - - if(parents.hasClass('layim_chatnow')){ - if(index === config.chatings){ - indexs = index - 1; - } else { - indexs = index + 1; - } - xxim.tabchat(config.chating[chatlist.eq(indexs).attr('type') + chatlist.eq(indexs).attr('data-id')]); - } - - if(log.chatlist.find('li').length === 1){ - log.chatlist.parent().hide(); - } - }); - - //聊天选项卡 - log.chatlist.on('click', 'li', function(){ - var othis = $(this), dataType = othis.attr('type'), dataId = othis.attr('data-id'); - xxim.tabchat(config.chating[dataType + dataId]); - }); - - //发送热键切换 - log.sendType = $('#layim_sendtype'), log.sendTypes = log.sendType.find('span'); - $('#layim_enter').on('click', function(e){ - config.stopMP(e); - log.sendType.show(); - }); - log.sendTypes.on('click', function(){ - log.sendTypes.find('i').text('') - $(this).find('i').text('√'); - }); - - xxim.transmit(); - }; - - log.html = '
      ' - +'
      ' - +'' - +' ' - +' '+ param.name +'' - +' ' - +' ' - +' ×' - +' ' - +'
      ' - +'
      ' - +'
        ' - +'
        ' - +'
        ' - +'
        ' - +'
        ' - +'
          ' - +'
          ' - +'
          ' - +' ' - +' ' - +' ' - +' 聊天记录' - +'
          ' - +' ' - +'
          ' - +'
          发送
          ' - +'
          ' - +' 按Enter键发送' - +' 按Ctrl+Enter键发送' - +'
          ' - +'
          ' - +'
          ' - +'
          '; - - if(config.chatings < 1){ - $.layer({ - type: 1, - border: [0], - title: false, - shade: [0], - area: ['620px', '493px'], - move: '.layim_chatbox .layim_move', - moveType: 1, - closeBtn: false, - offset: [(($(window).height() - 493)/2)+'px', ''], - page: { - html: log.html - }, success: function(layero){ - log.success(layero); - } - }) - } else { - log.chatmore = xxim.chatbox.find('#layim_chatmore'); - log.chatarea = xxim.chatbox.find('#layim_chatarea'); - - log.chatmore.show(); - - log.chatmore.find('ul>li').removeClass('layim_chatnow'); - log.chatmore.find('ul').append('
        • '+ param.name +'×
        • '); - - log.chatarea.find('.layim_chatview').removeClass('layim_chatthis'); - log.chatarea.append('
            '); - - xxim.tabchat(param); - } - - //群组 - log.chatgroup = xxim.chatbox.find('#layim_groups'); - if(param.type === 'group'){ - log.chatgroup.find('ul').removeClass('layim_groupthis'); - log.chatgroup.append('
              '); - xxim.getGroups(param); - } - //点击群员切换聊天窗 - log.chatgroup.on('click', 'ul>li', function(){ - xxim.popchatbox($(this)); - }); -}; - -//定位到某个聊天队列 -xxim.tabchat = function(param){ - var node = xxim.node, log = {}, keys = param.type + param.id; - xxim.nowchat = param; - - xxim.chatbox.find('#layim_user'+ keys).addClass('layim_chatnow').siblings().removeClass('layim_chatnow'); - xxim.chatbox.find('#layim_area'+ keys).addClass('layim_chatthis').siblings().removeClass('layim_chatthis'); - xxim.chatbox.find('#layim_group'+ keys).addClass('layim_groupthis').siblings().removeClass('layim_groupthis'); - - xxim.chatbox.find('.layim_face>img').attr('src', param.face); - xxim.chatbox.find('.layim_face, .layim_names').attr('href', param.href); - xxim.chatbox.find('.layim_names').text(param.name); - - xxim.chatbox.find('.layim_seechatlog').attr('href', config.chatlogurl + param.id); - - log.groups = xxim.chatbox.find('.layim_groups'); - if(param.type === 'group'){ - log.groups.show(); - } else { - log.groups.hide(); - } - - $('#layim_write').focus(); - -}; - -//弹出聊天窗 -xxim.popchatbox = function(othis){ - var node = xxim.node, dataId = othis.attr('data-id'), param = { - id: dataId, //用户ID - type: othis.attr('type'), - name: othis.find('.xxim_onename').text(), //用户名 - face: othis.find('.xxim_oneface').attr('src'), //用户头像 - href: 'profile.html?user=' + dataId //用户主页 - }, key = param.type + dataId; - if(!config.chating[key]){ - xxim.popchat(param); - config.chatings++; - } else { - xxim.tabchat(param); - } - config.chating[key] = param; - - var chatbox = $('#layim_chatbox'); - if(chatbox[0]){ - node.layimMin.hide(); - chatbox.parents('.xubox_layer').show(); - } -}; - -//请求群员 -xxim.getGroups = function(param){ - var keys = param.type + param.id, str = '', - groupss = xxim.chatbox.find('#layim_group'+ keys); - groupss.addClass('loading'); - config.json(config.api.groups, {}, function(datas){ - if(datas.status === 1){ - var ii = 0, lens = datas.data.length; - if(lens > 0){ - for(; ii < lens; ii++){ - str += '
            • '+ datas.data[ii].name +'
            • '; - } - } else { - str = '
            • 没有群员
            • '; - } - - } else { - str = '
            • '+ datas.msg +'
            • '; - } - groupss.removeClass('loading'); - groupss.html(str); - }, function(){ - groupss.removeClass('loading'); - groupss.html('
            • 请求异常
            • '); - }); -}; - -//消息传输 -xxim.transmit = function(){ - var node = xxim.node, log = {}; - node.sendbtn = $('#layim_sendbtn'); - node.imwrite = $('#layim_write'); - - //发送 - log.send = function(){ - var data = { - content: node.imwrite.val(), - id: xxim.nowchat.id, - sign_key: '', //密匙 - _: +new Date - }; - - if(data.content.replace(/\s/g, '') === ''){ - layer.tips('说点啥呗!', '#layim_write', 2); - node.imwrite.focus(); - } else { - //此处皆为模拟 - var keys = xxim.nowchat.type + xxim.nowchat.id; - - //聊天模版 - log.html = function(param, type){ - return '
            • ' - +'
              ' - + function(){ - if(type === 'me'){ - return ''+ param.time +'' - +''+ param.name +'' - +''; - } else { - return '' - +''+ param.name +'' - +''+ param.time +''; - } - }() - +'
              ' - +'
              '+ param.content +'
              ' - +'
            • '; - }; - - log.imarea = xxim.chatbox.find('#layim_area'+ keys); - - log.imarea.append(log.html({ - time: '2014-04-26 0:37', - name: config.user.name, - face: config.user.face, - content: data.content - }, 'me')); - node.imwrite.val('').focus(); - log.imarea.scrollTop(log.imarea[0].scrollHeight); - - setTimeout(function(){ - log.imarea.append(log.html({ - time: '2014-04-26 0:38', - name: xxim.nowchat.name, - face: xxim.nowchat.face, - content: config.autoReplay[(Math.random()*config.autoReplay.length) | 0] - })); - log.imarea.scrollTop(log.imarea[0].scrollHeight); - }, 500); - - /* - that.json(config.api.sendurl, data, function(datas){ - - }); - */ - } - - }; - node.sendbtn.on('click', log.send); - - node.imwrite.keyup(function(e){ - if(e.keyCode === 13){ - log.send(); - } - }); -}; - -//事件 -xxim.event = function(){ - var node = xxim.node; - - //主界面tab - node.tabs.eq(0).addClass('xxim_tabnow'); - node.tabs.on('click', function(){ - var othis = $(this), index = othis.index(); - xxim.tabs(index); - }); - - //列表展收 - node.list.on('click', 'h5', function(){ - var othis = $(this), chat = othis.siblings('.xxim_chatlist'), parentss = othis.find("i"); - if(parentss.hasClass('fa-caret-down')){ - chat.hide(); - parentss.attr('class','fa fa-caret-right'); - } else { - chat.show(); - parentss.attr('class','fa fa-caret-down'); - } - }); - - //设置在线隐身 - node.online.on('click', function(e){ - config.stopMP(e); - node.setonline.show(); - }); - node.setonline.find('span').on('click', function(e){ - var index = $(this).index(); - config.stopMP(e); - if(index === 0){ - node.onlinetex.html('在线'); - node.online.removeClass('xxim_offline'); - } else if(index === 1) { - node.onlinetex.html('隐身'); - node.online.addClass('xxim_offline'); - } - node.setonline.hide(); - }); - - node.xximon.on('click', xxim.expend); - node.xximHide.on('click', xxim.expend); - - //搜索 - node.xximSearch.keyup(function(){ - var val = $(this).val().replace(/\s/g, ''); - if(val !== ''){ - node.searchMian.show(); - node.closeSearch.show(); - //此处的搜索ajax参考xxim.getDates - node.list.eq(3).html('
            • 没有符合条件的结果
            • '); - } else { - node.searchMian.hide(); - node.closeSearch.hide(); - } - }); - node.closeSearch.on('click', function(){ - $(this).hide(); - node.searchMian.hide(); - node.xximSearch.val('').focus(); - }); - - //弹出聊天窗 - config.chatings = 0; - node.list.on('click', '.xxim_childnode', function(){ - var othis = $(this); - xxim.popchatbox(othis); - }); - - //点击最小化栏 - node.layimMin.on('click', function(){ - $(this).hide(); - $('#layim_chatbox').parents('.xubox_layer').show(); - }); - - - //document事件 - dom[1].on('click', function(){ - node.setonline.hide(); - $('#layim_sendtype').hide(); - }); -}; - -//请求列表数据 -xxim.getDates = function(index){ - var api = [config.api.friend, config.api.group, config.api.chatlog], - node = xxim.node, myf = node.list.eq(index); - myf.addClass('loading'); - config.json(api[index], {}, function(datas){ - if(datas.status === 1){ - var i = 0, myflen = datas.data.length, str = '', item; - if(myflen > 1){ - if(index !== 2){ - for(; i < myflen; i++){ - str += '
            • ' - +'
              '+ datas.data[i].name +'('+ datas.data[i].nums +')
              ' - +'
                '; - item = datas.data[i].item; - for(var j = 0; j < item.length; j++){ - str += '
              • '+ item[j].name +'
              • '; - } - str += '
            • '; - } - } else { - str += '
            • ' - +'
                '; - for(; i < myflen; i++){ - str += '
              • '+ datas.data[i].name +''+ datas.data[i].time +'
              • '; - } - str += '
            • '; - } - myf.html(str); - } else { - myf.html('
            • 没有任何数据
            • '); - } - myf.removeClass('loading'); - } else { - myf.html('
            • '+ datas.msg +'
            • '); - } - }, function(){ - myf.html('
            • 请求失败
            • '); - myf.removeClass('loading'); - }); -}; - -//渲染骨架 -xxim.view = (function(){ - var xximNode = xxim.layimNode = $('
              ' - +'
              ' - +' ' - +'
              ' - +'
                ' - +'
                  ' - +'
                    ' - +'
                      ' - +'
                      ' - +'
                        ' - +'
                      • ' - +'在线' - +'
                        ' - +'在线' - +'隐身' - +'
                        ' - +'
                      • ' - +'
                      • ' - +'
                      • ' - +'' - +'
                        ' - - +'
                        ' - +'
                      • ' - +'
                      • ' - +'
                      • ' - +'
                        ' - +'
                      ' - +'
                      '); - dom[3].append(xximNode); - - xxim.renode(); - xxim.getDates(0); - xxim.event(); - xxim.layinit(); -}()); - -}(window); - diff --git a/api/src/main/resources/static/js/plugins/layer/layim/loading.gif b/api/src/main/resources/static/js/plugins/layer/layim/loading.gif deleted file mode 100644 index 059b1ac3fe97fb18a3357018a06df0301ec0bc97..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/layim/loading.gif and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/mobile/layer.js b/api/src/main/resources/static/js/plugins/layer/mobile/layer.js deleted file mode 100644 index f9cf69313ea610b7e3260824d507701823101bb7..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/mobile/layer.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */ - ;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'

                      '+(e?n.title[0]:n.title)+"

                      ":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e=''+n.btn[0]+"",2===t&&(e=''+n.btn[1]+""+e),'
                      '+e+"
                      "):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='

                      '+(n.content||"")+"

                      "),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"
                      ':"")+'
                      "+l+'
                      '+n.content+"
                      "+c+"
                      ",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;odiv{line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px}.layui-m-layerbtn{display:box;display:-moz-box;display:-webkit-box;width:100%;height:50px;line-height:50px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2}.layui-m-layerbtn span{display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:14px;cursor:pointer}.layui-m-layerbtn span[yes]{color:#40AFFE}.layui-m-layerbtn span[no]{border-right:1px solid #D0D0D0;border-radius:0 0 0 5px}.layui-m-layerbtn span:active{background-color:#F6F6F6}.layui-m-layerend{position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px}.layui-m-layerend::after,.layui-m-layerend::before{position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px} \ No newline at end of file diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/icon-ext.png b/api/src/main/resources/static/js/plugins/layer/skin/default/icon-ext.png deleted file mode 100644 index bbbb669bb311514baa5db3a6a00b4644d0e280f1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/icon-ext.png and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/icon.png b/api/src/main/resources/static/js/plugins/layer/skin/default/icon.png deleted file mode 100644 index b5c8f1e1c13122e2f4dcf6a50781401fa993ada0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/icon.png and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/icon_ext.png b/api/src/main/resources/static/js/plugins/layer/skin/default/icon_ext.png deleted file mode 100644 index 8baee5979864b5e147f5b7173bd9afc1bc90d8e6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/icon_ext.png and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/loading-0.gif b/api/src/main/resources/static/js/plugins/layer/skin/default/loading-0.gif deleted file mode 100644 index 6f3c9539a22171cc2f12639492e346d97a9078e8..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/loading-0.gif and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/loading-1.gif b/api/src/main/resources/static/js/plugins/layer/skin/default/loading-1.gif deleted file mode 100644 index db3a483e4b74971fbfb1cc0fb6499852cedfe650..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/loading-1.gif and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/loading-2.gif b/api/src/main/resources/static/js/plugins/layer/skin/default/loading-2.gif deleted file mode 100644 index 5bb90fd6a49107a321c35b9cee4a7b810314b51f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/loading-2.gif and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/textbg.png b/api/src/main/resources/static/js/plugins/layer/skin/default/textbg.png deleted file mode 100644 index ad1040c425910722541188d387fe814816b85dae..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/textbg.png and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_ico0.png b/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_ico0.png deleted file mode 100644 index 7754a47f7ccd1eff1f854ffe9850f5ab38aa62ad..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_ico0.png and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading0.gif b/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading0.gif deleted file mode 100644 index 6f3c9539a22171cc2f12639492e346d97a9078e8..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading0.gif and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading1.gif b/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading1.gif deleted file mode 100644 index db3a483e4b74971fbfb1cc0fb6499852cedfe650..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading1.gif and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading2.gif b/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading2.gif deleted file mode 100644 index 5bb90fd6a49107a321c35b9cee4a7b810314b51f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading2.gif and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading3.gif b/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading3.gif deleted file mode 100644 index fbe57be3c2cd761a999fcf91698963b723916e28..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_loading3.gif and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_title0.png b/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_title0.png deleted file mode 100644 index 4ffbe3155dee8445994263519e411ba954e83fdd..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/default/xubox_title0.png and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/layer.css b/api/src/main/resources/static/js/plugins/layer/skin/layer.css deleted file mode 100644 index c6bc0004ce1315093958edef51015e2e5e097a2e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/skin/layer.css +++ /dev/null @@ -1,7 +0,0 @@ -/*! - - @Name: layer's style - @Author: 贤心 - @Blog: sentsin.com - - */*html{background-image:url(about:blank);background-attachment:fixed}html #layui_layer_skinlayercss{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{top:150px;left:50%;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;box-shadow:1px 1px 50px rgba(0,0,0,.3);border-radius:2px;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #B2B2B2;border:1px solid rgba(0,0,0,.3);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-moves{position:absolute;border:3px solid #666;border:3px solid rgba(0,0,0,.5);cursor:move;background-color:#fff;background-color:rgba(255,255,255,.3);filter:alpha(opacity=50)}.layui-layer-load{background:url(default/loading-0.gif) center center no-repeat #fff}.layui-layer-ico{background:url(default/icon.png) no-repeat}.layui-layer-btn a,.layui-layer-dialog .layui-layer-ico,.layui-layer-setwin a{display:inline-block;*display:inline;*zoom:1;vertical-align:top}@-webkit-keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layui-anim{-webkit-animation-name:bounceIn;animation-name:bounceIn}@-webkit-keyframes bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.03);transform:scale(1.03)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.03);-ms-transform:scale(1.03);transform:scale(1.03)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layui-anim-close{-webkit-animation-name:bounceOut;animation-name:bounceOut;-webkit-animation-duration:.2s;animation-duration:.2s}@-webkit-keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layui-anim-01{-webkit-animation-name:zoomInDown;animation-name:zoomInDown}@-webkit-keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layui-anim-02{-webkit-animation-name:fadeInUpBig;animation-name:fadeInUpBig}@-webkit-keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layui-anim-03{-webkit-animation-name:zoomInLeft;animation-name:zoomInLeft}@-webkit-keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layui-anim-04{-webkit-animation-name:rollIn;animation-name:rollIn}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-anim-05{-webkit-animation-name:fadeIn;animation-name:fadeIn}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layui-anim-06{-webkit-animation-name:shake;animation-name:shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-layer-title{padding:0 80px 0 20px;height:42px;line-height:42px;border-bottom:1px solid #eee;font-size:14px;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:#F8F8F8}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:15px;font-size:0;line-height:initial}.layui-layer-setwin a{position:relative;width:16px;height:16px;margin-left:10px;font-size:12px;_overflow:hidden}.layui-layer-setwin .layui-layer-min cite{position:absolute;width:14px;height:2px;left:0;top:50%;margin-top:-1px;background-color:#2E2D3C;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA}.layui-layer-setwin .layui-layer-max{background-position:-32px -40px}.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px}.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px}.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px}.layui-layer-setwin .layui-layer-close1{background-position:0 -40px;cursor:pointer}.layui-layer-setwin .layui-layer-close1:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;width:30px;height:30px;margin-left:0;background-position:-150px -31px;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{background-position:-181px -31px}.layui-layer-btn{text-align:right;padding:0 10px 12px;pointer-events:auto}.layui-layer-btn a{height:28px;line-height:28px;margin:0 6px;padding:0 15px;border:1px solid #dedede;background-color:#f1f1f1;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.7}.layui-layer-btn .layui-layer-btn0{border-color:#4898d5;background-color:#2e8ded;color:#fff}.layui-layer-dialog{min-width:260px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;font-size:14px;overflow:auto}.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute;top:16px;left:15px;_left:-40px;width:30px;height:30px}.layui-layer-ico1{background-position:-30px 0}.layui-layer-ico2{background-position:-60px 0}.layui-layer-ico3{background-position:-90px 0}.layui-layer-ico4{background-position:-120px 0}.layui-layer-ico5{background-position:-150px 0}.layui-layer-ico6{background-position:-180px 0}.layui-layer-rim{border:6px solid #8D8D8D;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #D3D4D3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-content{padding:12px 25px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:20px 20px 20px 55px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe .layui-layer-content{overflow:hidden}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:60px;height:24px;background:url(default/loading-0.gif) no-repeat}.layui-layer-loading .layui-layer-loading1{width:37px;height:37px;background:url(default/loading-1.gif) no-repeat}.layui-layer-ico16,.layui-layer-loading .layui-layer-loading2{width:32px;height:32px;background:url(default/loading-2.gif) no-repeat}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:5px 10px;font-size:12px;_float:left;border-radius:3px;box-shadow:1px 1px 3px rgba(0,0,0,.3);background-color:#F90;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#F90}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:1px;border-bottom-style:solid;border-bottom-color:#F90}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476A7;color:#fff;border:none}.layui-layer-lan .layui-layer-lan .layui-layer-btn{padding:10px;text-align:right;border-top:1px solid #E9E7E7}.layui-layer-lan .layui-layer-btn a{background:#BBB5B5;border:none}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1} diff --git a/api/src/main/resources/static/js/plugins/layer/skin/layer.ext.css b/api/src/main/resources/static/js/plugins/layer/skin/layer.ext.css deleted file mode 100644 index 95c9bb4b5575af98043c560727019f1d3a08ca9c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/skin/layer.ext.css +++ /dev/null @@ -1,8 +0,0 @@ -/*! - - @Name: layer拓展样式 - @Date: 2012.12.13 - @Author: 贤心 - @blog: sentsin.com - - */.layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span{text-overflow:ellipsis;white-space:nowrap}.layui-layer-iconext{background:url(default/icon-ext.png) no-repeat}html #layui_layer_skinlayerextcss{display:none;position:absolute;width:1989px}.layui-layer-prompt .layui-layer-input{display:block;width:220px;height:30px;margin:0 auto;line-height:30px;padding:0 5px;border:1px solid #ccc;box-shadow:1px 1px 5px rgba(0,0,0,.1) inset;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;border-bottom:1px solid #ccc;background-color:#eee;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;cursor:default;overflow:hidden}.layui-layer-tab .layui-layer-title span.layui-layer-tabnow{height:43px;border-left:1px solid #ccc;border-right:1px solid #ccc;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.xubox_tab_layer{display:block}.xubox_tabclose{position:absolute;right:10px;top:5px;cursor:pointer}.layui-layer-photos{-webkit-animation-duration:1s;animation-duration:1s;background:url(default/xubox_loading1.gif) center center no-repeat #000}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal} diff --git a/api/src/main/resources/static/js/plugins/layer/skin/moon/default.png b/api/src/main/resources/static/js/plugins/layer/skin/moon/default.png deleted file mode 100644 index 77dfaf3090f063501c8123bdc99aa048aab6d3b2..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/skin/moon/default.png and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/skin/moon/style.css b/api/src/main/resources/static/js/plugins/layer/skin/moon/style.css deleted file mode 100644 index 8a00dc3220cc78164b29003b63604695e811e448..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/skin/moon/style.css +++ /dev/null @@ -1,141 +0,0 @@ -/* - * layer皮肤 - * 作者:一☆隐☆一 - * QQ:9073194 - * 请保留这里的信息 谢谢!虽然你不保留我也不能把你怎么样! - */ - -html #layui_layer_skinmoonstylecss { - display: none; - position: absolute; - width: 1989px; -} -body .layer-ext-moon[type="dialog"] { - min-width: 320px; -} -body .layer-ext-moon-msg[type="dialog"]{min-width:200px;} -body .layer-ext-moon .layui-layer-title { - background: #f6f6f6; - color: #212a31; - font-size: 16px; - font-weight: bold; - height: 46px; - line-height: 46px; -} - - - -body .layer-ext-moon .layui-layer-content .layui-layer-ico { - height: 32px; - width: 32px; - top:18.5px; -} -body .layer-ext-moon .layui-layer-ico0 { - background: url(default.png) no-repeat -96px 0; - ; -} -body .layer-ext-moon .layui-layer-ico1 { - background: url(default.png) no-repeat -224px 0; - ; -} -body .layer-ext-moon .layui-layer-ico2 { - background: url(default.png) no-repeat -192px 0; -} -body .layer-ext-moon .layui-layer-ico3 { - background: url(default.png) no-repeat -160px 0; -} -body .layer-ext-moon .layui-layer-ico4 { - background: url(default.png) no-repeat -320px 0; -} -body .layer-ext-moon .layui-layer-ico5 { - background: url(default.png) no-repeat -288px 0; -} -body .layer-ext-moon .layui-layer-ico6 { - background: url(default.png) -256px 0; -} -body .layer-ext-moon .layui-layer-ico7 { - background: url(default.png) no-repeat -128px 0; -} -body .layer-ext-moon .layui-layer-setwin { - top: 15px; - right: 15px; -} -body .layer-ext-moon .layui-layer-setwin a { - width: 16px; - height: 16px; -} -body .layer-ext-moon .layui-layer-setwin .layui-layer-min cite:hover { - background-color: #56abe4; -} -body .layer-ext-moon .layui-layer-setwin .layui-layer-max { - background: url(default.png) no-repeat -80px 0; -} -body .layer-ext-moon .layui-layer-setwin .layui-layer-max:hover { - background: url(default.png) no-repeat -64px 0; -} -body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin { - background: url(default.png) no-repeat -32px 0; -} -body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin:hover { - background: url(default.png) no-repeat -16px 0; -} -body .layer-ext-moon .layui-layer-setwin .layui-layer-close1,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2 { - background: url(default.png) 0 0; -} -body .layer-ext-moon .layui-layer-setwin .layui-layer-close1:hover,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2:hover { - background: url(default.png) -48px 0; -} -body .layer-ext-moon .layui-layer-padding{padding-top: 24px;} -body .layer-ext-moon .layui-layer-btn { - padding: 15px 0; - background: #f0f4f7; - border-top: 1px #c7c7c7 solid; -} -body .layer-ext-moon .layui-layer-btn a { - font-size: 12px; - font-weight: normal; - margin: 0 3px; - margin-right: 7px; - margin-left: 7px; - padding: 6px 20px; - color: #fff; - border: 1px solid #0064b6; - background: #0071ce; - border-radius: 3px; - display: inline-block; - height: 20px; - line-height: 20px; - text-align: center; - vertical-align: middle; - background-repeat: no-repeat; - text-decoration: none; - outline: none; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - box-sizing: content-box; -} -body .layer-ext-moon .layui-layer-btn .layui-layer-btn0 { - background: #0071ce; -} -body .layer-ext-moon .layui-layer-btn .layui-layer-btn1 { - background: #fff; - color: #404a58; - border: 1px solid #c0c4cd; - border-radius: 3px; -} -body .layer-ext-moon .layui-layer-btn .layui-layer-btn2 { - background: #f60; - color: #fff; - border: 1px solid #f60; - border-radius: 3px; -} -body .layer-ext-moon .layui-layer-btn .layui-layer-btn3 { - background: #f00; - color: #fff; - border: 1px solid #f00; - border-radius: 3px; -} - -body .layer-ext-moon .layui-layer-title span.layui-layer-tabnow{ - height:46px; -} diff --git a/api/src/main/resources/static/js/plugins/layer/theme/default/icon-ext.png b/api/src/main/resources/static/js/plugins/layer/theme/default/icon-ext.png deleted file mode 100644 index bbbb669bb311514baa5db3a6a00b4644d0e280f1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/theme/default/icon-ext.png and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/theme/default/icon.png b/api/src/main/resources/static/js/plugins/layer/theme/default/icon.png deleted file mode 100644 index 3e17da8b1aaae2935e19ac97d9015f0fe24e8770..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/theme/default/icon.png and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/theme/default/layer.css b/api/src/main/resources/static/js/plugins/layer/theme/default/layer.css deleted file mode 100644 index 820b4a99b1225426bbb031ebcaea74f52777e5a4..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/layer/theme/default/layer.css +++ /dev/null @@ -1 +0,0 @@ -.layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span,.layui-layer-title{text-overflow:ellipsis;white-space:nowrap}html #layuicss-layer{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{-webkit-overflow-scrolling:touch;top:150px;left:0;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;border-radius:2px;box-shadow:1px 1px 50px rgba(0,0,0,.3)}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #B2B2B2;border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-load{background:url(loading-1.gif) center center no-repeat #eee}.layui-layer-ico{background:url(icon.png) no-repeat}.layui-layer-btn a,.layui-layer-dialog .layui-layer-ico,.layui-layer-setwin a{display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-move{display:none;position:fixed;*position:absolute;left:0;top:0;width:100%;height:100%;cursor:move;opacity:0;filter:alpha(opacity=0);background-color:#fff;z-index:2147483647}.layui-layer-resize{position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.layer-anim{-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-00{-webkit-animation-name:layer-bounceIn;animation-name:layer-bounceIn}@-webkit-keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:layer-zoomInDown;animation-name:layer-zoomInDown}@-webkit-keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:layer-fadeInUpBig;animation-name:layer-fadeInUpBig}@-webkit-keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:layer-zoomInLeft;animation-name:layer-zoomInLeft}@-webkit-keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layer-anim-04{-webkit-animation-name:layer-rollIn;animation-name:layer-rollIn}@keyframes layer-fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:layer-fadeIn;animation-name:layer-fadeIn}@-webkit-keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:layer-shake;animation-name:layer-shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-layer-title{padding:0 80px 0 20px;height:42px;line-height:42px;border-bottom:1px solid #eee;font-size:14px;color:#333;overflow:hidden;background-color:#F8F8F8;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:15px;font-size:0;line-height:initial}.layui-layer-setwin a{position:relative;width:16px;height:16px;margin-left:10px;font-size:12px;_overflow:hidden}.layui-layer-setwin .layui-layer-min cite{position:absolute;width:14px;height:2px;left:0;top:50%;margin-top:-1px;background-color:#2E2D3C;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA}.layui-layer-setwin .layui-layer-max{background-position:-32px -40px}.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px}.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px}.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px}.layui-layer-setwin .layui-layer-close1{background-position:1px -40px;cursor:pointer}.layui-layer-setwin .layui-layer-close1:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;width:30px;height:30px;margin-left:0;background-position:-149px -31px;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{background-position:-180px -31px}.layui-layer-btn{text-align:right;padding:0 15px 12px;pointer-events:auto;user-select:none;-webkit-user-select:none}.layui-layer-btn a{height:28px;line-height:28px;margin:5px 5px 0;padding:0 15px;border:1px solid #dedede;background-color:#fff;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.8}.layui-layer-btn .layui-layer-btn0{border-color:#1E9FFF;background-color:#1E9FFF;color:#fff}.layui-layer-btn-l{text-align:left}.layui-layer-btn-c{text-align:center}.layui-layer-dialog{min-width:260px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;overflow:hidden;font-size:14px;overflow-x:hidden;overflow-y:auto}.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute;top:16px;left:15px;_left:-40px;width:30px;height:30px}.layui-layer-ico1{background-position:-30px 0}.layui-layer-ico2{background-position:-60px 0}.layui-layer-ico3{background-position:-90px 0}.layui-layer-ico4{background-position:-120px 0}.layui-layer-ico5{background-position:-150px 0}.layui-layer-ico6{background-position:-180px 0}.layui-layer-rim{border:6px solid #8D8D8D;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #D3D4D3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-content{padding:12px 25px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:20px 20px 20px 55px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:60px;height:24px;background:url(loading-0.gif) no-repeat}.layui-layer-loading .layui-layer-loading1{width:37px;height:37px;background:url(loading-1.gif) no-repeat}.layui-layer-ico16,.layui-layer-loading .layui-layer-loading2{width:32px;height:32px;background:url(loading-2.gif) no-repeat}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:8px 15px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#000}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:5px;border-bottom-style:solid;border-bottom-color:#000}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476A7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:5px 10px 10px;text-align:right;border-top:1px solid #E9E7E7}.layui-layer-lan .layui-layer-btn a{background:#fff;border-color:#E9E7E7;color:#333}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95;border-color:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1}.layui-layer-iconext{background:url(icon-ext.png) no-repeat}.layui-layer-prompt .layui-layer-input{display:block;width:230px;height:36px;margin:0 auto;line-height:30px;padding-left:10px;border:1px solid #e6e6e6;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px;padding:6px 10px}.layui-layer-prompt .layui-layer-content{padding:20px}.layui-layer-prompt .layui-layer-btn{padding-top:0}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;overflow:hidden;cursor:pointer}.layui-layer-tab .layui-layer-title span.layui-this{height:43px;border-left:1px solid #eee;border-right:1px solid #eee;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.layui-this{display:block}.layui-layer-photos{-webkit-animation-duration:.8s;animation-duration:.8s}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}@-webkit-keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-close{-webkit-animation-name:layer-bounceOut;animation-name:layer-bounceOut;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}@media screen and (max-width:1100px){.layui-layer-iframe{overflow-y:auto;-webkit-overflow-scrolling:touch}} \ No newline at end of file diff --git a/api/src/main/resources/static/js/plugins/layer/theme/default/loading-0.gif b/api/src/main/resources/static/js/plugins/layer/theme/default/loading-0.gif deleted file mode 100644 index 6f3c9539a22171cc2f12639492e346d97a9078e8..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/theme/default/loading-0.gif and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/theme/default/loading-1.gif b/api/src/main/resources/static/js/plugins/layer/theme/default/loading-1.gif deleted file mode 100644 index db3a483e4b74971fbfb1cc0fb6499852cedfe650..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/theme/default/loading-1.gif and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/layer/theme/default/loading-2.gif b/api/src/main/resources/static/js/plugins/layer/theme/default/loading-2.gif deleted file mode 100644 index 5bb90fd6a49107a321c35b9cee4a7b810314b51f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/js/plugins/layer/theme/default/loading-2.gif and /dev/null differ diff --git a/api/src/main/resources/static/js/plugins/metisMenu/jquery.metisMenu.js b/api/src/main/resources/static/js/plugins/metisMenu/jquery.metisMenu.js deleted file mode 100644 index a04cdb08a75cb761557f3f768d23ffed49c87c2c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/metisMenu/jquery.metisMenu.js +++ /dev/null @@ -1,120 +0,0 @@ -/* - * metismenu - v1.1.3 - * Easy menu jQuery plugin for Twitter Bootstrap 3 - * https://github.com/onokumus/metisMenu - * - * Made by Osman Nuri Okumus - * Under MIT License - */ -;(function($, window, document, undefined) { - - var pluginName = "metisMenu", - defaults = { - toggle: true, - doubleTapToGo: false - }; - - function Plugin(element, options) { - this.element = $(element); - this.settings = $.extend({}, defaults, options); - this._defaults = defaults; - this._name = pluginName; - this.init(); - } - - Plugin.prototype = { - init: function() { - - var $this = this.element, - $toggle = this.settings.toggle, - obj = this; - - if (this.isIE() <= 9) { - $this.find("li.active").has("ul").children("ul").collapse("show"); - $this.find("li").not(".active").has("ul").children("ul").collapse("hide"); - } else { - $this.find("li.active").has("ul").children("ul").addClass("collapse in"); - $this.find("li").not(".active").has("ul").children("ul").addClass("collapse"); - } - - //add the "doubleTapToGo" class to active items if needed - if (obj.settings.doubleTapToGo) { - $this.find("li.active").has("ul").children("a").addClass("doubleTapToGo"); - } - - $this.find("li").has("ul").children("a").on("click" + "." + pluginName, function(e) { - e.preventDefault(); - - //Do we need to enable the double tap - if (obj.settings.doubleTapToGo) { - - //if we hit a second time on the link and the href is valid, navigate to that url - if (obj.doubleTapToGo($(this)) && $(this).attr("href") !== "#" && $(this).attr("href") !== "") { - e.stopPropagation(); - document.location = $(this).attr("href"); - return; - } - } - - $(this).parent("li").toggleClass("active").children("ul").collapse("toggle"); - - if ($toggle) { - $(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide"); - } - - }); - }, - - isIE: function() { //https://gist.github.com/padolsey/527683 - var undef, - v = 3, - div = document.createElement("div"), - all = div.getElementsByTagName("i"); - - while ( - div.innerHTML = "", - all[0] - ) { - return v > 4 ? v : undef; - } - }, - - //Enable the link on the second click. - doubleTapToGo: function(elem) { - var $this = this.element; - - //if the class "doubleTapToGo" exists, remove it and return - if (elem.hasClass("doubleTapToGo")) { - elem.removeClass("doubleTapToGo"); - return true; - } - - //does not exists, add a new class and return false - if (elem.parent().children("ul").length) { - //first remove all other class - $this.find(".doubleTapToGo").removeClass("doubleTapToGo"); - //add the class on the current element - elem.addClass("doubleTapToGo"); - return false; - } - }, - - remove: function() { - this.element.off("." + pluginName); - this.element.removeData(pluginName); - } - - }; - - $.fn[pluginName] = function(options) { - this.each(function () { - var el = $(this); - if (el.data(pluginName)) { - el.data(pluginName).remove(); - } - el.data(pluginName, new Plugin(this, options)); - }); - return this; - }; - -})(jQuery, window, document); diff --git a/api/src/main/resources/static/js/plugins/pace/pace.min.js b/api/src/main/resources/static/js/plugins/pace/pace.min.js deleted file mode 100644 index 134dcacdc538a533fc805a480c2ac62da129200e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/pace/pace.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! pace 0.5.1 */ -(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W=[].slice,X={}.hasOwnProperty,Y=function(a,b){function c(){this.constructor=a}for(var d in b)X.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},Z=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};for(t={catchupTime:500,initialRate:.03,minTime:500,ghostTime:500,maxProgressPerFrame:10,easeFactor:1.25,startOnPageLoad:!0,restartOnPushState:!0,restartOnRequestAfter:500,target:"body",elements:{checkInterval:100,selectors:["body"]},eventLag:{minSamples:10,sampleCount:3,lagThreshold:3},ajax:{trackMethods:["GET"],trackWebSockets:!0,ignoreURLs:[]}},B=function(){var a;return null!=(a="undefined"!=typeof performance&&null!==performance?"function"==typeof performance.now?performance.now():void 0:void 0)?a:+new Date},D=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,s=window.cancelAnimationFrame||window.mozCancelAnimationFrame,null==D&&(D=function(a){return setTimeout(a,50)},s=function(a){return clearTimeout(a)}),F=function(a){var b,c;return b=B(),(c=function(){var d;return d=B()-b,d>=33?(b=B(),a(d,function(){return D(c)})):setTimeout(c,33-d)})()},E=function(){var a,b,c;return c=arguments[0],b=arguments[1],a=3<=arguments.length?W.call(arguments,2):[],"function"==typeof c[b]?c[b].apply(c,a):c[b]},u=function(){var a,b,c,d,e,f,g;for(b=arguments[0],d=2<=arguments.length?W.call(arguments,1):[],f=0,g=d.length;g>f;f++)if(c=d[f])for(a in c)X.call(c,a)&&(e=c[a],null!=b[a]&&"object"==typeof b[a]&&null!=e&&"object"==typeof e?u(b[a],e):b[a]=e);return b},p=function(a){var b,c,d,e,f;for(c=b=0,e=0,f=a.length;f>e;e++)d=a[e],c+=Math.abs(d),b++;return c/b},w=function(a,b){var c,d,e;if(null==a&&(a="options"),null==b&&(b=!0),e=document.querySelector("[data-pace-"+a+"]")){if(c=e.getAttribute("data-pace-"+a),!b)return c;try{return JSON.parse(c)}catch(f){return d=f,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",d):void 0}}},g=function(){function a(){}return a.prototype.on=function(a,b,c,d){var e;return null==d&&(d=!1),null==this.bindings&&(this.bindings={}),null==(e=this.bindings)[a]&&(e[a]=[]),this.bindings[a].push({handler:b,ctx:c,once:d})},a.prototype.once=function(a,b,c){return this.on(a,b,c,!0)},a.prototype.off=function(a,b){var c,d,e;if(null!=(null!=(d=this.bindings)?d[a]:void 0)){if(null==b)return delete this.bindings[a];for(c=0,e=[];cP;P++)J=T[P],C[J]===!0&&(C[J]=t[J]);i=function(a){function b(){return U=b.__super__.constructor.apply(this,arguments)}return Y(b,a),b}(Error),b=function(){function a(){this.progress=0}return a.prototype.getElement=function(){var a;if(null==this.el){if(a=document.querySelector(C.target),!a)throw new i;this.el=document.createElement("div"),this.el.className="pace pace-active",document.body.className=document.body.className.replace(/pace-done/g,""),document.body.className+=" pace-running",this.el.innerHTML='
                      \n
                      \n
                      \n
                      ',null!=a.firstChild?a.insertBefore(this.el,a.firstChild):a.appendChild(this.el)}return this.el},a.prototype.finish=function(){var a;return a=this.getElement(),a.className=a.className.replace("pace-active",""),a.className+=" pace-inactive",document.body.className=document.body.className.replace("pace-running",""),document.body.className+=" pace-done"},a.prototype.update=function(a){return this.progress=a,this.render()},a.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(a){i=a}return this.el=void 0},a.prototype.render=function(){var a,b;return null==document.querySelector(C.target)?!1:(a=this.getElement(),a.children[0].style.width=""+this.progress+"%",(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(a.children[0].setAttribute("data-progress-text",""+(0|this.progress)+"%"),this.progress>=100?b="99":(b=this.progress<10?"0":"",b+=0|this.progress),a.children[0].setAttribute("data-progress",""+b)),this.lastRenderedProgress=this.progress)},a.prototype.done=function(){return this.progress>=100},a}(),h=function(){function a(){this.bindings={}}return a.prototype.trigger=function(a,b){var c,d,e,f,g;if(null!=this.bindings[a]){for(f=this.bindings[a],g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.call(this,b));return g}},a.prototype.on=function(a,b){var c;return null==(c=this.bindings)[a]&&(c[a]=[]),this.bindings[a].push(b)},a}(),O=window.XMLHttpRequest,N=window.XDomainRequest,M=window.WebSocket,v=function(a,b){var c,d,e,f;f=[];for(d in b.prototype)try{e=b.prototype[d],null==a[d]&&"function"!=typeof e?f.push(a[d]=e):f.push(void 0)}catch(g){c=g}return f},z=[],Pace.ignore=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?W.call(arguments,1):[],z.unshift("ignore"),c=b.apply(null,a),z.shift(),c},Pace.track=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?W.call(arguments,1):[],z.unshift("track"),c=b.apply(null,a),z.shift(),c},I=function(a){var b;if(null==a&&(a="GET"),"track"===z[0])return"force";if(!z.length&&C.ajax){if("socket"===a&&C.ajax.trackWebSockets)return!0;if(b=a.toUpperCase(),Z.call(C.ajax.trackMethods,b)>=0)return!0}return!1},j=function(a){function b(){var a,c=this;b.__super__.constructor.apply(this,arguments),a=function(a){var b;return b=a.open,a.open=function(d,e){return I(d)&&c.trigger("request",{type:d,url:e,request:a}),b.apply(a,arguments)}},window.XMLHttpRequest=function(b){var c;return c=new O(b),a(c),c},v(window.XMLHttpRequest,O),null!=N&&(window.XDomainRequest=function(){var b;return b=new N,a(b),b},v(window.XDomainRequest,N)),null!=M&&C.ajax.trackWebSockets&&(window.WebSocket=function(a,b){var d;return d=null!=b?new M(a,b):new M(a),I("socket")&&c.trigger("request",{type:"socket",url:a,protocols:b,request:d}),d},v(window.WebSocket,M))}return Y(b,a),b}(h),Q=null,x=function(){return null==Q&&(Q=new j),Q},H=function(a){var b,c,d,e;for(e=C.ajax.ignoreURLs,c=0,d=e.length;d>c;c++)if(b=e[c],"string"==typeof b){if(-1!==a.indexOf(b))return!0}else if(b.test(a))return!0;return!1},x().on("request",function(b){var c,d,e,f,g;return f=b.type,e=b.request,g=b.url,H(g)?void 0:Pace.running||C.restartOnRequestAfter===!1&&"force"!==I(f)?void 0:(d=arguments,c=C.restartOnRequestAfter||0,"boolean"==typeof c&&(c=0),setTimeout(function(){var b,c,g,h,i,j;if(b="socket"===f?e.readyState<2:0<(h=e.readyState)&&4>h){for(Pace.restart(),i=Pace.sources,j=[],c=0,g=i.length;g>c;c++){if(J=i[c],J instanceof a){J.watch.apply(J,d);break}j.push(void 0)}return j}},c))}),a=function(){function a(){var a=this;this.elements=[],x().on("request",function(){return a.watch.apply(a,arguments)})}return a.prototype.watch=function(a){var b,c,d,e;return d=a.type,b=a.request,e=a.url,H(e)?void 0:(c="socket"===d?new m(b):new n(b),this.elements.push(c))},a}(),n=function(){function a(a){var b,c,d,e,f,g,h=this;if(this.progress=0,null!=window.ProgressEvent)for(c=null,a.addEventListener("progress",function(a){return h.progress=a.lengthComputable?100*a.loaded/a.total:h.progress+(100-h.progress)/2}),g=["load","abort","timeout","error"],d=0,e=g.length;e>d;d++)b=g[d],a.addEventListener(b,function(){return h.progress=100});else f=a.onreadystatechange,a.onreadystatechange=function(){var b;return 0===(b=a.readyState)||4===b?h.progress=100:3===a.readyState&&(h.progress=50),"function"==typeof f?f.apply(null,arguments):void 0}}return a}(),m=function(){function a(a){var b,c,d,e,f=this;for(this.progress=0,e=["error","open"],c=0,d=e.length;d>c;c++)b=e[c],a.addEventListener(b,function(){return f.progress=100})}return a}(),d=function(){function a(a){var b,c,d,f;for(null==a&&(a={}),this.elements=[],null==a.selectors&&(a.selectors=[]),f=a.selectors,c=0,d=f.length;d>c;c++)b=f[c],this.elements.push(new e(b))}return a}(),e=function(){function a(a){this.selector=a,this.progress=0,this.check()}return a.prototype.check=function(){var a=this;return document.querySelector(this.selector)?this.done():setTimeout(function(){return a.check()},C.elements.checkInterval)},a.prototype.done=function(){return this.progress=100},a}(),c=function(){function a(){var a,b,c=this;this.progress=null!=(b=this.states[document.readyState])?b:100,a=document.onreadystatechange,document.onreadystatechange=function(){return null!=c.states[document.readyState]&&(c.progress=c.states[document.readyState]),"function"==typeof a?a.apply(null,arguments):void 0}}return a.prototype.states={loading:0,interactive:50,complete:100},a}(),f=function(){function a(){var a,b,c,d,e,f=this;this.progress=0,a=0,e=[],d=0,c=B(),b=setInterval(function(){var g;return g=B()-c-50,c=B(),e.push(g),e.length>C.eventLag.sampleCount&&e.shift(),a=p(e),++d>=C.eventLag.minSamples&&a=100&&(this.done=!0),b===this.last?this.sinceLastUpdate+=a:(this.sinceLastUpdate&&(this.rate=(b-this.last)/this.sinceLastUpdate),this.catchup=(b-this.progress)/C.catchupTime,this.sinceLastUpdate=0,this.last=b),b>this.progress&&(this.progress+=this.catchup*a),c=1-Math.pow(this.progress/100,C.easeFactor),this.progress+=c*this.rate*a,this.progress=Math.min(this.lastProgress+C.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},a}(),K=null,G=null,q=null,L=null,o=null,r=null,Pace.running=!1,y=function(){return C.restartOnPushState?Pace.restart():void 0},null!=window.history.pushState&&(S=window.history.pushState,window.history.pushState=function(){return y(),S.apply(window.history,arguments)}),null!=window.history.replaceState&&(V=window.history.replaceState,window.history.replaceState=function(){return y(),V.apply(window.history,arguments)}),k={ajax:a,elements:d,document:c,eventLag:f},(A=function(){var a,c,d,e,f,g,h,i;for(Pace.sources=K=[],g=["ajax","elements","document","eventLag"],c=0,e=g.length;e>c;c++)a=g[c],C[a]!==!1&&K.push(new k[a](C[a]));for(i=null!=(h=C.extraSources)?h:[],d=0,f=i.length;f>d;d++)J=i[d],K.push(new J(C));return Pace.bar=q=new b,G=[],L=new l})(),Pace.stop=function(){return Pace.trigger("stop"),Pace.running=!1,q.destroy(),r=!0,null!=o&&("function"==typeof s&&s(o),o=null),A()},Pace.restart=function(){return Pace.trigger("restart"),Pace.stop(),Pace.start()},Pace.go=function(){var a;return Pace.running=!0,q.render(),a=B(),r=!1,o=F(function(b,c){var d,e,f,g,h,i,j,k,m,n,o,p,s,t,u,v;for(k=100-q.progress,e=o=0,f=!0,i=p=0,t=K.length;t>p;i=++p)for(J=K[i],n=null!=G[i]?G[i]:G[i]=[],h=null!=(v=J.elements)?v:[J],j=s=0,u=h.length;u>s;j=++s)g=h[j],m=null!=n[j]?n[j]:n[j]=new l(g),f&=m.done,m.done||(e++,o+=m.tick(b));return d=o/e,q.update(L.tick(b,d)),q.done()||f||r?(q.update(100),Pace.trigger("done"),setTimeout(function(){return q.finish(),Pace.running=!1,Pace.trigger("hide")},Math.max(C.ghostTime,Math.max(C.minTime-(B()-a),0)))):c()})},Pace.start=function(a){u(C,a),Pace.running=!0;try{q.render()}catch(b){i=b}return document.querySelector(".pace")?(Pace.trigger("start"),Pace.go()):setTimeout(Pace.start,50)},"function"==typeof define&&define.amd?define(function(){return Pace}):"object"==typeof exports?module.exports=Pace:C.startOnPageLoad&&Pace.start()}).call(this); diff --git a/api/src/main/resources/static/js/plugins/slimscroll/jquery.slimscroll.min.js b/api/src/main/resources/static/js/plugins/slimscroll/jquery.slimscroll.min.js deleted file mode 100644 index 97f60c50a833465b778bd57641b02698c0e3f650..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/plugins/slimscroll/jquery.slimscroll.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * - * Version: 1.3.0 - * - */ -(function(f){jQuery.fn.extend({slimScroll:function(h){var a=f.extend({width:"auto",height:"250px",size:"4px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:0.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},h);this.each(function(){function r(d){if(s){d=d|| -window.event;var c=0;d.wheelDelta&&(c=-d.wheelDelta/120);d.detail&&(c=d.detail/3);f(d.target||d.srcTarget||d.srcElement).closest("."+a.wrapperClass).is(b.parent())&&m(c,!0);d.preventDefault&&!k&&d.preventDefault();k||(d.returnValue=!1)}}function m(d,f,h){k=!1;var e=d,g=b.outerHeight()-c.outerHeight();f&&(e=parseInt(c.css("top"))+d*parseInt(a.wheelStep)/100*c.outerHeight(),e=Math.min(Math.max(e,0),g),e=0=b.outerHeight()?k=!0:(c.stop(!0,!0).fadeIn("fast"),a.railVisible&&g.stop(!0,!0).fadeIn("fast"))}function p(){a.alwaysVisible||(A=setTimeout(function(){a.disableFadeOut&&s||(x||y)||(c.fadeOut("slow"),g.fadeOut("slow"))},1E3))}var s,x,y,A,z,u,l,B,D=30,k=!1,b=f(this);if(b.parent().hasClass(a.wrapperClass)){var n=b.scrollTop(), -c=b.parent().find("."+a.barClass),g=b.parent().find("."+a.railClass);w();if(f.isPlainObject(h)){if("height"in h&&"auto"==h.height){b.parent().css("height","auto");b.css("height","auto");var q=b.parent().parent().height();b.parent().css("height",q);b.css("height",q)}if("scrollTo"in h)n=parseInt(a.scrollTo);else if("scrollBy"in h)n+=parseInt(a.scrollBy);else if("destroy"in h){c.remove();g.remove();b.unwrap();return}m(n,!1,!0)}}else{a.height="auto"==a.height?b.parent().height():a.height;n=f("
                      ").addClass(a.wrapperClass).css({position:"relative",width:a.width,height:a.height});b.css({width:a.width,height:a.height});var g=f("
                      ").addClass(a.railClass).css({width:a.size,height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.railBorderRadius,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=f("
                      ").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible? -"block":"none","border-radius":a.borderRadius,BorderRadius:a.borderRadius,MozBorderRadius:a.borderRadius,WebkitBorderRadius:a.borderRadius,zIndex:99}),q="right"==a.position?{right:a.distance}:{left:a.distance};g.css(q);c.css(q);b.wrap(n);b.parent().append(c);b.parent().append(g);a.railDraggable&&c.bind("mousedown",function(a){var b=f(document);y=!0;t=parseFloat(c.css("top"));pageY=a.pageY;b.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY;c.css("top",currTop);m(0,c.position().top,!1)}); -b.bind("mouseup.slimscroll",function(a){y=!1;p();b.unbind(".slimscroll")});return!1}).bind("selectstart.slimscroll",function(a){a.stopPropagation();a.preventDefault();return!1});g.hover(function(){v()},function(){p()});c.hover(function(){x=!0},function(){x=!1});b.hover(function(){s=!0;v();p()},function(){s=!1;p()});b.bind("touchstart",function(a,b){a.originalEvent.touches.length&&(z=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){k||b.originalEvent.preventDefault();b.originalEvent.touches.length&& -(m((z-b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0),z=b.originalEvent.touches[0].pageY)});w();"bottom"===a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),m(0,!0)):"top"!==a.start&&(m(f(a.start).position().top,null,!0),a.alwaysVisible||c.hide());C()}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery); diff --git a/api/src/main/resources/static/js/table.js b/api/src/main/resources/static/js/table.js deleted file mode 100644 index f81f590922f7ed9a3b8bc6db02cbbbb82cfdc467..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/table.js +++ /dev/null @@ -1,154 +0,0 @@ -/** - * - * User: simon - * Date: 2018/06/07 - * Time: 12:34 - **/ -function initTable(tableId, option) { - $('#' + tableId).bootstrapTable({ - height: $(window).height(), - url: option.url, - toolbar: '#toolbar', - toolbarAlign: 'left', - cache: false,//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) - undefinedText: '', - search: false, - showRefresh: true, - searchAlign: 'right', - showToggle: false, - showColumns: true, - showHeader: true, - showFooter: false, - showFullscreen: false, - pagination: true, - paginationPreText: '上一页', - paginationNextText: '下一页', - sidePagination: option.sidePagination ? option.sidePagination : 'server', - pageNumber: 1, - pageSize: 10, - pageList: [10, 25, 50, 100], - showPaginationSwitch: true, - minimumCountColumns: 1, - smartDisplay: true, - clickToSelect: true, - sortable: true, - striped: false, - rowStyle: function rowStyle(row, index) { - return { - classes: 'text-nowrap another-class', - css: {"color": "black"} - }; - }, - showExport: true, - exportDataType: 'all', - exportTypes: ['json', 'xml', 'png', 'csv', 'txt', 'sql', 'doc', 'excel', 'xlsx', 'pdf'], - exportOptions: { - //pdf格式导出显示不全,只能先忽略列 - ignoreColumn: ((!option.ignoreColumn) ? [] : option.ignoreColumn), //忽略某一列的索引 - fileName: "报表", //文件名称设置 - worksheetName: 'sheet1', //表格工作区名称 - tableName: "报表", - excelstyles: ['background-color', 'color', 'font-size', 'font-weight'] - }, - columns: option.columns, - detailView: option.detailView ? option.detailView : false, - onExpandRow: function (index, row, $detail) { - loadDetail(index, row, $detail); - }, - resizable: true, - queryParams: option.queryParams,// 传递参数(*) - }); -} - -function initTableTreegrid(tableId, option) { - $('#' + tableId).bootstrapTable({ - height: $(window).height(), - url: option.url, - toolbar: '#toolbar', - toolbarAlign: 'left', - cache: false,//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) - undefinedText: '', - search: false, - showRefresh: true, - searchAlign: 'right', - showToggle: false, - showColumns: true, - showHeader: true, - showFooter: false, - showFullscreen: false, - pagination: true, - paginationPreText: '上一页', - paginationNextText: '下一页', - sidePagination: 'server', - pageNumber: 1, - pageSize: 10, - pageList: [10, 25, 50, 100], - showPaginationSwitch: true, - minimumCountColumns: 1, - smartDisplay: true, - clickToSelect: false, - sortable: true, - striped: false, - rowStyle: function rowStyle(row, index) { - return { - classes: 'text-nowrap another-class', - css: {"color": "black"} - }; - }, - showExport: true, - exportDataType: 'all', - exportTypes: ['json', 'xml', 'png', 'csv', 'txt', 'sql', 'doc', 'excel', 'xlsx', 'pdf'], - exportOptions: { - //pdf格式导出显示不全,只能先忽略列 - ignoreColumn: ((!option.ignoreColumn) ? [] : option.ignoreColumn), //忽略某一列的索引 - fileName: "报表", //文件名称设置 - worksheetName: 'sheet1', //表格工作区名称 - tableName: "报表", - excelstyles: ['background-color', 'color', 'font-size', 'font-weight'] - }, - columns: option.columns, - detailView: false, - resizable: false, - idField: option.idField ? option.idField : 'id', - // bootstrap-table-tree-column.js 插件配置 - // treeShowField: 'name', - // parentIdField: 'pid' - // bootstrap-table-tree-column.js 插件配置 - - // bootstrap-table-treegrid.js 插件配置 - treeShowField: option.treeShowField ? option.treeShowField : 'name', - parentIdField: option.parentIdField ? option.parentIdField : 'pid', - onLoadSuccess: function(data) { - console.log('load'); - // jquery.treegrid.js - $table.treegrid({ - initialState: 'collapsed', - treeColumn: 1, - expanderExpandedClass: 'fa fa-folder-open-o', - expanderCollapsedClass: 'fa fa-folder-o', - onChange: function() { - $table.bootstrapTable('resetWidth'); - } - }); - }, - // bootstrap-table-treetreegrid.js 插件配置 - queryParams: option.queryParams,// 传递参数(*) - }); -} - -//树形结构-子菜单 -function childMenuFormatter(value, row, index, field) { - if(row.pid){ - return ' ' + value; - }else{ - return value; - } -} - -/** - * 刷新table - * @param tableId - */ -function refreshTable(tableId) { - $('#' + tableId).bootstrapTable('refresh', {silent: false}); -} \ No newline at end of file diff --git a/api/src/main/resources/static/js/util.js b/api/src/main/resources/static/js/util.js deleted file mode 100644 index 49d5e3ea77575ae297c8f6045e440fbdfe94c2f6..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/js/util.js +++ /dev/null @@ -1,57 +0,0 @@ -function getUrlParam(name) { - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); - var r = window.location.search.substr(1).match(reg); - if (r != null)return decodeURI(r[2]); - return null; -} - -function getLocalTime(timestamp) { - return new Date(parseInt(timestamp)).toLocaleString().replace(/:\d{1,2}$/, ' '); -} - -Date.prototype.format = function(format) { - var date = { - "M+": this.getMonth() + 1, - "d+": this.getDate(), - "h+": this.getHours(), - "m+": this.getMinutes(), - "s+": this.getSeconds(), - "q+": Math.floor((this.getMonth() + 3) / 3), - "S+": this.getMilliseconds() - }; - if (/(y+)/i.test(format)) { - format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)); - } - for (var k in date) { - if (new RegExp("(" + k + ")").test(format)) { - format = format.replace(RegExp.$1, RegExp.$1.length == 1 - ? date[k] : ("00" + date[k]).substr(("" + date[k]).length)); - } - } - return format; -} - -//判断是否是数组 -function checkArray(o) { - return Object.prototype.toString.call(o) === '[object Array]'; -} - -//Command: toastr["success"]("操作成功!", "提示信息") -//toastr初始化配置 -toastr.options = { - "closeButton": true, - "debug": false, - "newestOnTop": false, - "progressBar": false, - "positionClass": "toast-bottom-right", - "preventDuplicates": false, - "onclick": null, - "showDuration": "300", - "hideDuration": "1000", - "timeOut": "2000", - "extendedTimeOut": "1000", - "showEasing": "swing", - "hideEasing": "linear", - "showMethod": "fadeIn", - "hideMethod": "fadeOut" -}; diff --git a/api/src/main/resources/static/json/data.json b/api/src/main/resources/static/json/data.json deleted file mode 100644 index b0e034333043f045ebc25796e434dc8f5e76e552..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/json/data.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "total": "28", - "rows": [{ - "itemid": "EST-1", - "productid": "FI-SW-01", - "listprice": "16.50", - "unitcost": "10.00", - "status": "P", - "attr1": "Large" - }, { - "itemid": "EST-10", - "productid": "K9-DL-01", - "listprice": "18.50", - "unitcost": "12.00", - "status": "P", - "attr1": "Spotted Adult Female" - }, { - "itemid": "EST-11", - "productid": "RP-SN-01", - "listprice": "18.50", - "unitcost": "12.00", - "status": "P", - "attr1": "Venomless" - }, { - "itemid": "EST-12", - "productid": "RP-SN-01", - "listprice": "18.50", - "unitcost": "12.00", - "status": "P", - "attr1": "Rattleless" - }, { - "itemid": "EST-13", - "productid": "RP-LI-02", - "listprice": "18.50", - "unitcost": "12.00", - "status": "P", - "attr1": "Green Adult" - }, { - "itemid": "EST-14", - "productid": "FL-DSH-01", - "listprice": "58.50", - "unitcost": "12.00", - "status": "P", - "attr1": "Tailless" - }, { - "itemid": "EST-15", - "productid": "FL-DSH-01", - "listprice": "23.50", - "unitcost": "12.00", - "status": "P", - "attr1": "With tail" - }, { - "itemid": "EST-16", - "productid": "FL-DLH-02", - "listprice": "93.50", - "unitcost": "12.00", - "status": "P", - "attr1": "Adult Female" - }, { - "itemid": "EST-17", - "productid": "FL-DLH-02", - "listprice": "93.50", - "unitcost": "12.00", - "status": "P", - "attr1": "Adult Male" - }, { - "itemid": "EST-18", - "productid": "AV-CB-01", - "listprice": "193.50", - "unitcost": "92.00", - "status": "P", - "attr1": "Adult Male" - }] -} \ No newline at end of file diff --git a/api/src/main/resources/static/json/tree_data1.json b/api/src/main/resources/static/json/tree_data1.json deleted file mode 100644 index 83fb0d6190d7582808fbde06f616a6e287d5fd7e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/json/tree_data1.json +++ /dev/null @@ -1,49 +0,0 @@ -[{ - "id":1, - "text":"My Documents", - "children":[{ - "id":11, - "text":"Photos", - "state":"closed", - "children":[{ - "id":111, - "text":"Friend" - },{ - "id":112, - "text":"Wife" - },{ - "id":113, - "text":"Company" - }] - },{ - "id":12, - "text":"Program Files", - "children":[{ - "id":121, - "text":"Intel" - },{ - "id":122, - "text":"Java", - "attributes":{ - "p1":"Custom Attribute1", - "p2":"Custom Attribute2" - } - },{ - "id":123, - "text":"Microsoft Office" - },{ - "id":124, - "text":"Games", - "checked":true - }] - },{ - "id":13, - "text":"index.html" - },{ - "id":14, - "text":"about.html" - },{ - "id":15, - "text":"welcome.html" - }] -}] diff --git a/api/src/main/resources/static/plug-in/ZoomPic.jquery.plugin/ZoomPic.js b/api/src/main/resources/static/plug-in/ZoomPic.jquery.plugin/ZoomPic.js deleted file mode 100644 index 47ca63b35a3f2746014045b7ecd244fcb5df21da..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/ZoomPic.jquery.plugin/ZoomPic.js +++ /dev/null @@ -1,45 +0,0 @@ -function ZoomPic() -{this.initialize.apply(this,arguments)} -ZoomPic.prototype={initialize:function(id) -{var _this=this;this.wrap=typeof id==="string"?document.getElementById(id):id;this.oUl=this.wrap.getElementsByTagName("ul")[0];this.aLi=this.wrap.getElementsByTagName("li");this.prev=this.wrap.getElementsByTagName("pre")[0];this.next=this.wrap.getElementsByTagName("pre")[1];this.timer=null;this.aSort=[];this.iCenter=3;this._doPrev=function(){return _this.doPrev.apply(_this)};this._doNext=function(){return _this.doNext.apply(_this)};this.options=[{width:262,height:389,top:152,left:0,zIndex:1},{width:262,height:389,top:152,left:0,zIndex:2},{width:262,height:389,top:152,left:200,zIndex:3},{width:300,height:445,top:124,left:388,zIndex:4},{width:262,height:389,top:152,left:668,zIndex:3},{width:262,height:389,top:152,left:834,zIndex:2},{width:262,height:389,top:152,left:450,zIndex:1},];for(var i=0;i_this.iCenter) -{for(var i=0;ithis.iCenter) -{this.css(this.aSort[i].getElementsByTagName("img")[0],"opacity",30) -this.aSort[i].onmouseover=function() -{_this.doMove(this.getElementsByTagName("img")[0],{opacity:100})};this.aSort[i].onmouseout=function() -{_this.doMove(this.getElementsByTagName("img")[0],{opacity:35})};this.aSort[i].onmouseout();} -else -{this.aSort[i].onmouseover=this.aSort[i].onmouseout=null}}},addEvent:function(oElement,sEventType,fnHandler) -{return oElement.addEventListener?oElement.addEventListener(sEventType,fnHandler,false):oElement.attachEvent("on"+sEventType,fnHandler)},css:function(oElement,attr,value) -{if(arguments.length==2) -{return oElement.currentStyle?oElement.currentStyle[attr]:getComputedStyle(oElement,null)[attr]} -else if(arguments.length==3) -{switch(attr) -{case"width":case"height":case"top":case"left":case"bottom":oElement.style[attr]=value+"px";break;default:oElement.style[attr]=value;break}}},doMove:function(oElement,oAttr,fnCallBack) -{var _this=this;clearInterval(oElement.timer);oElement.timer=setInterval(function() -{var bStop=true;for(var property in oAttr) -{var iCur=parseFloat(_this.css(oElement,property));property=="opacity"&&(iCur=parseInt(iCur.toFixed(2)*100));var iSpeed=(oAttr[property]-iCur)/5;iSpeed=iSpeed>0?Math.ceil(iSpeed):Math.floor(iSpeed);if(iCur!=oAttr[property]) -{bStop=false;_this.css(oElement,property,iCur+iSpeed)}} -if(bStop) -{clearInterval(oElement.timer);fnCallBack&&fnCallBack.apply(_this,arguments)}},30)}}; \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/buttonLoader/jquery/plugin/buttonLoader.css b/api/src/main/resources/static/plug-in/buttonLoader/jquery/plugin/buttonLoader.css deleted file mode 100644 index bd450ba61529ff52cab5b88dde2e5a4f712ae6e7..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/buttonLoader/jquery/plugin/buttonLoader.css +++ /dev/null @@ -1,22 +0,0 @@ -.spinner { - display: inline-block; - opacity: 0; - width: 0; - -webkit-transition: opacity 0.25s, width 0.25s; - -moz-transition: opacity 0.25s, width 0.25s; - -o-transition: opacity 0.25s, width 0.25s; - transition: opacity 0.25s, width 0.25s; -} - -.has-spinner.active { - cursor:progress; -} - -.has-spinner.active .spinner { - opacity: 1; - width: auto; -} - -.has-spinner.btn.active .spinner { - min-width: 20px; -} diff --git a/api/src/main/resources/static/plug-in/buttonLoader/jquery/plugin/jquery.buttonLoader.js b/api/src/main/resources/static/plug-in/buttonLoader/jquery/plugin/jquery.buttonLoader.js deleted file mode 100644 index 3711edca498644906ec0161e5a66f086a3784a87..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/buttonLoader/jquery/plugin/jquery.buttonLoader.js +++ /dev/null @@ -1,40 +0,0 @@ -/*A jQuery plugin which add loading indicators into buttons -* By Minoli Perera -* MIT Licensed. -*/ -(function ($) { - $('.has-spinner').attr("disabled", false); - $.fn.buttonLoader = function (action, message) { - var self = $(this); - if (action == 'loading') { - if ($(self).attr("disabled") == "disabled") { - return false; - } - $('.has-spinner').attr("disabled", true); - $(self).attr('data-btn-text', $(self).text()); - var text = message; - console.log($(self).attr('data-load-text')); - if($(self).attr('data-load-text') != undefined && $(self).attr('data-load-text') != ""){ - text = $(self).attr('data-load-text'); - } - $(self).html(' '+text); - $(self).addClass('active'); - } - - if (action == 'success') { - $(self).html(' ' + message); - $(self).removeClass('active'); - $('.has-spinner').attr("disabled", false); - $('.has-spinner').removeClass('btn-default btn-primary'); - $('.has-spinner').addClass('btn-success'); - } - - if (action == 'error') { - $(self).html(' ' + message); - $(self).removeClass('active'); - $('.has-spinner').attr("disabled", false); - $('.has-spinner').removeClass('btn-default btn-primary'); - $('.has-spinner').addClass('btn-danger'); - } - } -})(jQuery); diff --git a/api/src/main/resources/static/plug-in/buttonLoader/jquery/plugin/jquery.buttonLoader.min.js b/api/src/main/resources/static/plug-in/buttonLoader/jquery/plugin/jquery.buttonLoader.min.js deleted file mode 100644 index b3c13f41cb23771c037226e2c8dc4b0ab92274b1..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/buttonLoader/jquery/plugin/jquery.buttonLoader.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/*A jQuery plugin which add loading indicators into buttons -* By Minoli Perera -* MIT Licensed. -*/ -(function($){$('.has-spinner').attr("disabled",false);$.fn.buttonLoader=function(action,message){var self=$(this);if(action=='loading'){if($(self).attr("disabled")=="disabled"){return false;}$('.has-spinner').attr("disabled",true);$(self).attr('data-btn-text',$(self).text());var text=message;console.log($(self).attr('data-load-text'));if($(self).attr('data-load-text')!=undefined&&$(self).attr('data-load-text')!=""){text=$(self).attr('data-load-text');}$(self).html(' '+text);$(self).addClass('active');}if(action=='success'){$(self).html(' '+message);$(self).removeClass('active');$('.has-spinner').attr("disabled",false);$('.has-spinner').removeClass('btn-default btn-primary');$('.has-spinner').addClass('btn-success');}if(action=='error'){$(self).html(' '+message);$(self).removeClass('active');$('.has-spinner').attr("disabled",false);$('.has-spinner').removeClass('btn-default btn-primary');$('.has-spinner').addClass('btn-danger');}}})(jQuery); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/buttons.jquery.plugin/buttons.css b/api/src/main/resources/static/plug-in/buttons.jquery.plugin/buttons.css deleted file mode 100644 index 0959797e0de7c4de8ab4ce14c272a28999978578..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/buttons.jquery.plugin/buttons.css +++ /dev/null @@ -1,1492 +0,0 @@ -/*! @license -* -* Buttons -* Copyright 2012-2014 Alex Wolfe and Rob Levin -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/* -* Compass (optional) -* -* We recommend the use of autoprefixer instead of Compass -* when using buttons. However, buttons does support Compass. -* simply change $ubtn-use-compass to true and uncomment the -* @import 'compass' code below to use Compass. -*/ -/* -* Required Files -* -* These files include the variables and options -* and base css styles that are required to generate buttons. -*/ -/* -* $ubtn prefix (reserved) -* -* This prefix stands for Unicorn Button - ubtn -* We provide a prefix to the Sass Variables to -* prevent namespace collisions that could occur if -* you import buttons as part of your Sass build process. -* We kindly ask you not to use the prefix $ubtn in your project -* in order to avoid possilbe name conflicts. Thanks! -*/ -/* -* Button Namespace (ex .button or .btn) -* -*/ -/* -* Button Defaults -* -* Some default settings that are used throughout the button library. -* Changes to these settings will be picked up by all of the other modules. -* The colors used here are the default colors for the base button (gray). -* The font size and height are used to set the base size for the buttons. -* The size values will be used to calculate the larger and smaller button sizes. -*/ -/* -* Button Colors -* -* $ubtn-colors is used to generate the different button colors. -* Edit or add colors to the list below and recompile. -* Each block contains the (name, background, color) -* The class is generated using the name: (ex .button-primary) -*/ -/* -* Button Shapes -* -* $ubtn-shapes is used to generate the different button shapes. -* Edit or add shapes to the list below and recompile. -* Each block contains the (name, border-radius). -* The class is generated using the name: (ex .button-square). -*/ -/* -* Button Sizes -* -* $ubtn-sizes is used to generate the different button sizes. -* Edit or add colors to the list below and recompile. -* Each block contains the (name, size multiplier). -* The class is generated using the name: (ex .button-giant). -*/ -/* -* Color Mixin -* -* Iterates through the list of colors and creates -* -*/ -/* -* No Animation -* -* Sets animation property to none -*/ -/* -* Clearfix -* -* Clears floats inside the container -*/ -/* -* Base Button Style -* -* The default values for the .button class -*/ -.button { - color: #666; - background-color: #EEE; - border-color: #EEE; - font-weight: 300; - font-size: 16px; - font-family: "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; - text-decoration: none; - text-align: center; - line-height: 40px; - height: 40px; - padding: 0 40px; - margin: 0; - display: inline-block; - appearance: none; - cursor: pointer; - border: none; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - -webkit-transition-property: all; - transition-property: all; - -webkit-transition-duration: .3s; - transition-duration: .3s; - /* - * Disabled State - * - * The disabled state uses the class .disabled, is-disabled, - * and the form attribute disabled="disabled". - * The use of !important is only added because this is a state - * that must be applied to all buttons when in a disabled state. - */ } - .button:visited { - color: #666; } - .button:hover, .button:focus { - background-color: #f6f6f6; - text-decoration: none; - outline: none; } - .button:active, .button.active, .button.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3); - text-decoration: none; - background-color: #eeeeee; - border-color: #cfcfcf; - color: #d4d4d4; - -webkit-transition-duration: 0s; - transition-duration: 0s; - -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2); - box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2); } - .button.disabled, .button.is-disabled, .button:disabled { - top: 0 !important; - background: #EEE !important; - border: 1px solid #DDD !important; - text-shadow: 0 1px 1px white !important; - color: #CCC !important; - cursor: default !important; - appearance: none !important; - -webkit-box-shadow: none !important; - box-shadow: none !important; - opacity: .8 !important; } - -/* -* Base Button Tyography -* -*/ -.button-uppercase { - text-transform: uppercase; } - -.button-lowercase { - text-transform: lowercase; } - -.button-capitalize { - text-transform: capitalize; } - -.button-small-caps { - font-variant: small-caps; } - -.button-icon-txt-large { - font-size: 36px !important; } - -/* -* Base padding -* -*/ -.button-width-small { - padding: 0 10px !important; } - -/* -* Base Colors -* -* Create colors for buttons -* (.button-primary, .button-secondary, etc.) -*/ -.button-primary, -.button-primary-flat { - background-color: #1B9AF7; - border-color: #1B9AF7; - color: #FFF; } - .button-primary:visited, - .button-primary-flat:visited { - color: #FFF; } - .button-primary:hover, .button-primary:focus, - .button-primary-flat:hover, - .button-primary-flat:focus { - background-color: #4cb0f9; - border-color: #4cb0f9; - color: #FFF; } - .button-primary:active, .button-primary.active, .button-primary.is-active, - .button-primary-flat:active, - .button-primary-flat.active, - .button-primary-flat.is-active { - background-color: #2798eb; - border-color: #2798eb; - color: #0880d7; } - -.button-plain, -.button-plain-flat { - background-color: #FFF; - border-color: #FFF; - color: #1B9AF7; } - .button-plain:visited, - .button-plain-flat:visited { - color: #1B9AF7; } - .button-plain:hover, .button-plain:focus, - .button-plain-flat:hover, - .button-plain-flat:focus { - background-color: white; - border-color: white; - color: #1B9AF7; } - .button-plain:active, .button-plain.active, .button-plain.is-active, - .button-plain-flat:active, - .button-plain-flat.active, - .button-plain-flat.is-active { - background-color: white; - border-color: white; - color: #e6e6e6; } - -.button-inverse, -.button-inverse-flat { - background-color: #222; - border-color: #222; - color: #EEE; } - .button-inverse:visited, - .button-inverse-flat:visited { - color: #EEE; } - .button-inverse:hover, .button-inverse:focus, - .button-inverse-flat:hover, - .button-inverse-flat:focus { - background-color: #3c3c3c; - border-color: #3c3c3c; - color: #EEE; } - .button-inverse:active, .button-inverse.active, .button-inverse.is-active, - .button-inverse-flat:active, - .button-inverse-flat.active, - .button-inverse-flat.is-active { - background-color: #222222; - border-color: #222222; - color: #090909; } - -.button-action, -.button-action-flat { - background-color: #A5DE37; - border-color: #A5DE37; - color: #FFF; } - .button-action:visited, - .button-action-flat:visited { - color: #FFF; } - .button-action:hover, .button-action:focus, - .button-action-flat:hover, - .button-action-flat:focus { - background-color: #b9e563; - border-color: #b9e563; - color: #FFF; } - .button-action:active, .button-action.active, .button-action.is-active, - .button-action-flat:active, - .button-action-flat.active, - .button-action-flat.is-active { - background-color: #a1d243; - border-color: #a1d243; - color: #8bc220; } - -.button-highlight, -.button-highlight-flat { - background-color: #FEAE1B; - border-color: #FEAE1B; - color: #FFF; } - .button-highlight:visited, - .button-highlight-flat:visited { - color: #FFF; } - .button-highlight:hover, .button-highlight:focus, - .button-highlight-flat:hover, - .button-highlight-flat:focus { - background-color: #fec04e; - border-color: #fec04e; - color: #FFF; } - .button-highlight:active, .button-highlight.active, .button-highlight.is-active, - .button-highlight-flat:active, - .button-highlight-flat.active, - .button-highlight-flat.is-active { - background-color: #f3ab26; - border-color: #f3ab26; - color: #e59501; } - -.button-caution, -.button-caution-flat { - background-color: #FF4351; - border-color: #FF4351; - color: #FFF; } - .button-caution:visited, - .button-caution-flat:visited { - color: #FFF; } - .button-caution:hover, .button-caution:focus, - .button-caution-flat:hover, - .button-caution-flat:focus { - background-color: #ff7680; - border-color: #ff7680; - color: #FFF; } - .button-caution:active, .button-caution.active, .button-caution.is-active, - .button-caution-flat:active, - .button-caution-flat.active, - .button-caution-flat.is-active { - background-color: #f64c59; - border-color: #f64c59; - color: #ff1022; } - -.button-royal, -.button-royal-flat { - background-color: #7B72E9; - border-color: #7B72E9; - color: #FFF; } - .button-royal:visited, - .button-royal-flat:visited { - color: #FFF; } - .button-royal:hover, .button-royal:focus, - .button-royal-flat:hover, - .button-royal-flat:focus { - background-color: #a49ef0; - border-color: #a49ef0; - color: #FFF; } - .button-royal:active, .button-royal.active, .button-royal.is-active, - .button-royal-flat:active, - .button-royal-flat.active, - .button-royal-flat.is-active { - background-color: #827ae1; - border-color: #827ae1; - color: #5246e2; } - -/* -* Base Layout Styles -* -* Very Miminal Layout Styles -*/ -.button-block, -.button-stacked { - display: block; } - -/* -* Button Types (optional) -* -* All of the files below represent the various button -* types (including shapes & sizes). None of these files -* are required. Simple remove the uneeded type below and -* the button type will be excluded from the final build -*/ -/* -* Button Shapes -* -* This file creates the various button shapes -* (ex. Circle, Rounded, Pill) -*/ -.button-square { - border-radius: 0; } - -.button-box { - border-radius: 10px; } - -.button-rounded { - border-radius: 4px; } - -.button-pill { - border-radius: 200px; } - -.button-circle { - border-radius: 100%; } - -/* -* Size Adjustment for equal height & widht buttons -* -* Remove padding and set a fixed width. -*/ -.button-circle, -.button-box, -.button-square { - padding: 0 !important; - width: 40px; } - .button-circle.button-giant, - .button-box.button-giant, - .button-square.button-giant { - width: 70px; } - .button-circle.button-jumbo, - .button-box.button-jumbo, - .button-square.button-jumbo { - width: 60px; } - .button-circle.button-large, - .button-box.button-large, - .button-square.button-large { - width: 50px; } - .button-circle.button-normal, - .button-box.button-normal, - .button-square.button-normal { - width: 40px; } - .button-circle.button-small, - .button-box.button-small, - .button-square.button-small { - width: 30px; } - .button-circle.button-tiny, - .button-box.button-tiny, - .button-square.button-tiny { - width: 24px; } - -/* -* Border Buttons -* -* These buttons have no fill they only have a -* border to define their hit target. -*/ -.button-border, .button-border-thin, .button-border-thick { - background: none; - border-width: 2px; - border-style: solid; - line-height: 36px; } - .button-border:hover, .button-border-thin:hover, .button-border-thick:hover { - background-color: rgba(255, 255, 255, 0.9); } - .button-border:active, .button-border-thin:active, .button-border-thick:active, .button-border.active, .active.button-border-thin, .active.button-border-thick, .button-border.is-active, .is-active.button-border-thin, .is-active.button-border-thick { - -webkit-box-shadow: none; - box-shadow: none; - text-shadow: none; - -webkit-transition-property: all; - transition-property: all; - -webkit-transition-duration: .3s; - transition-duration: .3s; } - -/* -* Border Optional Sizes -* -* A slight variation in border thickness -*/ -.button-border-thin { - border-width: 1px; } - -.button-border-thick { - border-width: 3px; } - -/* -* Border Button Colors -* -* Create colors for buttons -* (.button-primary, .button-secondary, etc.) -*/ -.button-border, .button-border-thin, .button-border-thick, -.button-border-thin, -.button-border-thick { - /* - * Border Button Size Adjustment - * - * The line-height must be adjusted to compinsate for - * the width of the border. - */ } - .button-border.button-primary, .button-primary.button-border-thin, .button-primary.button-border-thick, - .button-border-thin.button-primary, - .button-border-thick.button-primary { - color: #1B9AF7; } - .button-border.button-primary:hover, .button-primary.button-border-thin:hover, .button-primary.button-border-thick:hover, .button-border.button-primary:focus, .button-primary.button-border-thin:focus, .button-primary.button-border-thick:focus, - .button-border-thin.button-primary:hover, - .button-border-thin.button-primary:focus, - .button-border-thick.button-primary:hover, - .button-border-thick.button-primary:focus { - background-color: rgba(76, 176, 249, 0.9); - color: rgba(255, 255, 255, 0.9); } - .button-border.button-primary:active, .button-primary.button-border-thin:active, .button-primary.button-border-thick:active, .button-border.button-primary.active, .button-primary.active.button-border-thin, .button-primary.active.button-border-thick, .button-border.button-primary.is-active, .button-primary.is-active.button-border-thin, .button-primary.is-active.button-border-thick, - .button-border-thin.button-primary:active, - .button-border-thin.button-primary.active, - .button-border-thin.button-primary.is-active, - .button-border-thick.button-primary:active, - .button-border-thick.button-primary.active, - .button-border-thick.button-primary.is-active { - background-color: rgba(39, 152, 235, 0.7); - color: rgba(255, 255, 255, 0.5); - opacity: .3; } - .button-border.button-plain, .button-plain.button-border-thin, .button-plain.button-border-thick, - .button-border-thin.button-plain, - .button-border-thick.button-plain { - color: #FFF; } - .button-border.button-plain:hover, .button-plain.button-border-thin:hover, .button-plain.button-border-thick:hover, .button-border.button-plain:focus, .button-plain.button-border-thin:focus, .button-plain.button-border-thick:focus, - .button-border-thin.button-plain:hover, - .button-border-thin.button-plain:focus, - .button-border-thick.button-plain:hover, - .button-border-thick.button-plain:focus { - background-color: rgba(255, 255, 255, 0.9); - color: rgba(27, 154, 247, 0.9); } - .button-border.button-plain:active, .button-plain.button-border-thin:active, .button-plain.button-border-thick:active, .button-border.button-plain.active, .button-plain.active.button-border-thin, .button-plain.active.button-border-thick, .button-border.button-plain.is-active, .button-plain.is-active.button-border-thin, .button-plain.is-active.button-border-thick, - .button-border-thin.button-plain:active, - .button-border-thin.button-plain.active, - .button-border-thin.button-plain.is-active, - .button-border-thick.button-plain:active, - .button-border-thick.button-plain.active, - .button-border-thick.button-plain.is-active { - background-color: rgba(255, 255, 255, 0.7); - color: rgba(27, 154, 247, 0.5); - opacity: .3; } - .button-border.button-inverse, .button-inverse.button-border-thin, .button-inverse.button-border-thick, - .button-border-thin.button-inverse, - .button-border-thick.button-inverse { - color: #222; } - .button-border.button-inverse:hover, .button-inverse.button-border-thin:hover, .button-inverse.button-border-thick:hover, .button-border.button-inverse:focus, .button-inverse.button-border-thin:focus, .button-inverse.button-border-thick:focus, - .button-border-thin.button-inverse:hover, - .button-border-thin.button-inverse:focus, - .button-border-thick.button-inverse:hover, - .button-border-thick.button-inverse:focus { - background-color: rgba(60, 60, 60, 0.9); - color: rgba(238, 238, 238, 0.9); } - .button-border.button-inverse:active, .button-inverse.button-border-thin:active, .button-inverse.button-border-thick:active, .button-border.button-inverse.active, .button-inverse.active.button-border-thin, .button-inverse.active.button-border-thick, .button-border.button-inverse.is-active, .button-inverse.is-active.button-border-thin, .button-inverse.is-active.button-border-thick, - .button-border-thin.button-inverse:active, - .button-border-thin.button-inverse.active, - .button-border-thin.button-inverse.is-active, - .button-border-thick.button-inverse:active, - .button-border-thick.button-inverse.active, - .button-border-thick.button-inverse.is-active { - background-color: rgba(34, 34, 34, 0.7); - color: rgba(238, 238, 238, 0.5); - opacity: .3; } - .button-border.button-action, .button-action.button-border-thin, .button-action.button-border-thick, - .button-border-thin.button-action, - .button-border-thick.button-action { - color: #A5DE37; } - .button-border.button-action:hover, .button-action.button-border-thin:hover, .button-action.button-border-thick:hover, .button-border.button-action:focus, .button-action.button-border-thin:focus, .button-action.button-border-thick:focus, - .button-border-thin.button-action:hover, - .button-border-thin.button-action:focus, - .button-border-thick.button-action:hover, - .button-border-thick.button-action:focus { - background-color: rgba(185, 229, 99, 0.9); - color: rgba(255, 255, 255, 0.9); } - .button-border.button-action:active, .button-action.button-border-thin:active, .button-action.button-border-thick:active, .button-border.button-action.active, .button-action.active.button-border-thin, .button-action.active.button-border-thick, .button-border.button-action.is-active, .button-action.is-active.button-border-thin, .button-action.is-active.button-border-thick, - .button-border-thin.button-action:active, - .button-border-thin.button-action.active, - .button-border-thin.button-action.is-active, - .button-border-thick.button-action:active, - .button-border-thick.button-action.active, - .button-border-thick.button-action.is-active { - background-color: rgba(161, 210, 67, 0.7); - color: rgba(255, 255, 255, 0.5); - opacity: .3; } - .button-border.button-highlight, .button-highlight.button-border-thin, .button-highlight.button-border-thick, - .button-border-thin.button-highlight, - .button-border-thick.button-highlight { - color: #FEAE1B; } - .button-border.button-highlight:hover, .button-highlight.button-border-thin:hover, .button-highlight.button-border-thick:hover, .button-border.button-highlight:focus, .button-highlight.button-border-thin:focus, .button-highlight.button-border-thick:focus, - .button-border-thin.button-highlight:hover, - .button-border-thin.button-highlight:focus, - .button-border-thick.button-highlight:hover, - .button-border-thick.button-highlight:focus { - background-color: rgba(254, 192, 78, 0.9); - color: rgba(255, 255, 255, 0.9); } - .button-border.button-highlight:active, .button-highlight.button-border-thin:active, .button-highlight.button-border-thick:active, .button-border.button-highlight.active, .button-highlight.active.button-border-thin, .button-highlight.active.button-border-thick, .button-border.button-highlight.is-active, .button-highlight.is-active.button-border-thin, .button-highlight.is-active.button-border-thick, - .button-border-thin.button-highlight:active, - .button-border-thin.button-highlight.active, - .button-border-thin.button-highlight.is-active, - .button-border-thick.button-highlight:active, - .button-border-thick.button-highlight.active, - .button-border-thick.button-highlight.is-active { - background-color: rgba(243, 171, 38, 0.7); - color: rgba(255, 255, 255, 0.5); - opacity: .3; } - .button-border.button-caution, .button-caution.button-border-thin, .button-caution.button-border-thick, - .button-border-thin.button-caution, - .button-border-thick.button-caution { - color: #FF4351; } - .button-border.button-caution:hover, .button-caution.button-border-thin:hover, .button-caution.button-border-thick:hover, .button-border.button-caution:focus, .button-caution.button-border-thin:focus, .button-caution.button-border-thick:focus, - .button-border-thin.button-caution:hover, - .button-border-thin.button-caution:focus, - .button-border-thick.button-caution:hover, - .button-border-thick.button-caution:focus { - background-color: rgba(255, 118, 128, 0.9); - color: rgba(255, 255, 255, 0.9); } - .button-border.button-caution:active, .button-caution.button-border-thin:active, .button-caution.button-border-thick:active, .button-border.button-caution.active, .button-caution.active.button-border-thin, .button-caution.active.button-border-thick, .button-border.button-caution.is-active, .button-caution.is-active.button-border-thin, .button-caution.is-active.button-border-thick, - .button-border-thin.button-caution:active, - .button-border-thin.button-caution.active, - .button-border-thin.button-caution.is-active, - .button-border-thick.button-caution:active, - .button-border-thick.button-caution.active, - .button-border-thick.button-caution.is-active { - background-color: rgba(246, 76, 89, 0.7); - color: rgba(255, 255, 255, 0.5); - opacity: .3; } - .button-border.button-royal, .button-royal.button-border-thin, .button-royal.button-border-thick, - .button-border-thin.button-royal, - .button-border-thick.button-royal { - color: #7B72E9; } - .button-border.button-royal:hover, .button-royal.button-border-thin:hover, .button-royal.button-border-thick:hover, .button-border.button-royal:focus, .button-royal.button-border-thin:focus, .button-royal.button-border-thick:focus, - .button-border-thin.button-royal:hover, - .button-border-thin.button-royal:focus, - .button-border-thick.button-royal:hover, - .button-border-thick.button-royal:focus { - background-color: rgba(164, 158, 240, 0.9); - color: rgba(255, 255, 255, 0.9); } - .button-border.button-royal:active, .button-royal.button-border-thin:active, .button-royal.button-border-thick:active, .button-border.button-royal.active, .button-royal.active.button-border-thin, .button-royal.active.button-border-thick, .button-border.button-royal.is-active, .button-royal.is-active.button-border-thin, .button-royal.is-active.button-border-thick, - .button-border-thin.button-royal:active, - .button-border-thin.button-royal.active, - .button-border-thin.button-royal.is-active, - .button-border-thick.button-royal:active, - .button-border-thick.button-royal.active, - .button-border-thick.button-royal.is-active { - background-color: rgba(130, 122, 225, 0.7); - color: rgba(255, 255, 255, 0.5); - opacity: .3; } - .button-border.button-giant, .button-giant.button-border-thin, .button-giant.button-border-thick, - .button-border-thin.button-giant, - .button-border-thick.button-giant { - line-height: 66px; } - .button-border.button-jumbo, .button-jumbo.button-border-thin, .button-jumbo.button-border-thick, - .button-border-thin.button-jumbo, - .button-border-thick.button-jumbo { - line-height: 56px; } - .button-border.button-large, .button-large.button-border-thin, .button-large.button-border-thick, - .button-border-thin.button-large, - .button-border-thick.button-large { - line-height: 46px; } - .button-border.button-normal, .button-normal.button-border-thin, .button-normal.button-border-thick, - .button-border-thin.button-normal, - .button-border-thick.button-normal { - line-height: 36px; } - .button-border.button-small, .button-small.button-border-thin, .button-small.button-border-thick, - .button-border-thin.button-small, - .button-border-thick.button-small { - line-height: 26px; } - .button-border.button-tiny, .button-tiny.button-border-thin, .button-tiny.button-border-thick, - .button-border-thin.button-tiny, - .button-border-thick.button-tiny { - line-height: 20px; } - -/* -* Border Buttons -* -* These buttons have no fill they only have a -* border to define their hit target. -*/ -.button-borderless { - background: none; - border: none; - padding: 0 8px !important; - color: #EEE; - font-size: 20.8px; - font-weight: 200; - /* - * Borderless Button Colors - * - * Create colors for buttons - * (.button-primary, .button-secondary, etc.) - */ - /* - * Borderles Size Adjustment - * - * The font-size must be large to compinsate for - * the lack of a hit target. - */ } - .button-borderless:hover, .button-borderless:focus { - background: none; } - .button-borderless:active, .button-borderless.active, .button-borderless.is-active { - -webkit-box-shadow: none; - box-shadow: none; - text-shadow: none; - -webkit-transition-property: all; - transition-property: all; - -webkit-transition-duration: .3s; - transition-duration: .3s; - opacity: .3; } - .button-borderless.button-primary { - color: #1B9AF7; } - .button-borderless.button-plain { - color: #FFF; } - .button-borderless.button-inverse { - color: #222; } - .button-borderless.button-action { - color: #A5DE37; } - .button-borderless.button-highlight { - color: #FEAE1B; } - .button-borderless.button-caution { - color: #FF4351; } - .button-borderless.button-royal { - color: #7B72E9; } - .button-borderless.button-giant { - font-size: 36.4px; - height: 52.4px; - line-height: 52.4px; } - .button-borderless.button-jumbo { - font-size: 31.2px; - height: 47.2px; - line-height: 47.2px; } - .button-borderless.button-large { - font-size: 26px; - height: 42px; - line-height: 42px; } - .button-borderless.button-normal { - font-size: 20.8px; - height: 36.8px; - line-height: 36.8px; } - .button-borderless.button-small { - font-size: 15.6px; - height: 31.6px; - line-height: 31.6px; } - .button-borderless.button-tiny { - font-size: 12.48px; - height: 28.48px; - line-height: 28.48px; } - -/* -* Raised Buttons -* -* A classic looking button that offers -* great depth and affordance. -*/ -.button-raised { - border-color: #e1e1e1; - border-style: solid; - border-width: 1px; - line-height: 38px; - background: -webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e1e1e1)); - background: linear-gradient(#f6f6f6, #e1e1e1); - -webkit-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.15); - box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.15); } - .button-raised:hover, .button-raised:focus { - background: -webkit-gradient(linear, left top, left bottom, from(white), to(gainsboro)); - background: linear-gradient(top, white, gainsboro); } - .button-raised:active, .button-raised.active, .button-raised.is-active { - background: #eeeeee; - -webkit-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 1px 0px white; - box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 1px 0px white; } - -/* -* Raised Button Colors -* -* Create colors for raised buttons -*/ -.button-raised.button-primary { - border-color: #088ef0; - background: -webkit-gradient(linear, left top, left bottom, from(#34a5f8), to(#088ef0)); - background: linear-gradient(#34a5f8, #088ef0); } - .button-raised.button-primary:hover, .button-raised.button-primary:focus { - background: -webkit-gradient(linear, left top, left bottom, from(#42abf8), to(#0888e6)); - background: linear-gradient(top, #42abf8, #0888e6); } - .button-raised.button-primary:active, .button-raised.button-primary.active, .button-raised.button-primary.is-active { - border-color: #0880d7; - background: #2798eb; } -.button-raised.button-plain { - border-color: #f2f2f2; - background: -webkit-gradient(linear, left top, left bottom, from(white), to(#f2f2f2)); - background: linear-gradient(white, #f2f2f2); } - .button-raised.button-plain:hover, .button-raised.button-plain:focus { - background: -webkit-gradient(linear, left top, left bottom, from(white), to(#ededed)); - background: linear-gradient(top, white, #ededed); } - .button-raised.button-plain:active, .button-raised.button-plain.active, .button-raised.button-plain.is-active { - border-color: #e6e6e6; - background: white; } -.button-raised.button-inverse { - border-color: #151515; - background: -webkit-gradient(linear, left top, left bottom, from(#2f2f2f), to(#151515)); - background: linear-gradient(#2f2f2f, #151515); } - .button-raised.button-inverse:hover, .button-raised.button-inverse:focus { - background: -webkit-gradient(linear, left top, left bottom, from(#363636), to(#101010)); - background: linear-gradient(top, #363636, #101010); } - .button-raised.button-inverse:active, .button-raised.button-inverse.active, .button-raised.button-inverse.is-active { - border-color: #090909; - background: #222222; } -.button-raised.button-action { - border-color: #9ad824; - background: -webkit-gradient(linear, left top, left bottom, from(#afe24d), to(#9ad824)); - background: linear-gradient(#afe24d, #9ad824); } - .button-raised.button-action:hover, .button-raised.button-action:focus { - background: -webkit-gradient(linear, left top, left bottom, from(#b5e45a), to(#94cf22)); - background: linear-gradient(top, #b5e45a, #94cf22); } - .button-raised.button-action:active, .button-raised.button-action.active, .button-raised.button-action.is-active { - border-color: #8bc220; - background: #a1d243; } -.button-raised.button-highlight { - border-color: #fea502; - background: -webkit-gradient(linear, left top, left bottom, from(#feb734), to(#fea502)); - background: linear-gradient(#feb734, #fea502); } - .button-raised.button-highlight:hover, .button-raised.button-highlight:focus { - background: -webkit-gradient(linear, left top, left bottom, from(#febc44), to(#f49f01)); - background: linear-gradient(top, #febc44, #f49f01); } - .button-raised.button-highlight:active, .button-raised.button-highlight.active, .button-raised.button-highlight.is-active { - border-color: #e59501; - background: #f3ab26; } -.button-raised.button-caution { - border-color: #ff2939; - background: -webkit-gradient(linear, left top, left bottom, from(#ff5c69), to(#ff2939)); - background: linear-gradient(#ff5c69, #ff2939); } - .button-raised.button-caution:hover, .button-raised.button-caution:focus { - background: -webkit-gradient(linear, left top, left bottom, from(#ff6c77), to(#ff1f30)); - background: linear-gradient(top, #ff6c77, #ff1f30); } - .button-raised.button-caution:active, .button-raised.button-caution.active, .button-raised.button-caution.is-active { - border-color: #ff1022; - background: #f64c59; } -.button-raised.button-royal { - border-color: #665ce6; - background: -webkit-gradient(linear, left top, left bottom, from(#9088ec), to(#665ce6)); - background: linear-gradient(#9088ec, #665ce6); } - .button-raised.button-royal:hover, .button-raised.button-royal:focus { - background: -webkit-gradient(linear, left top, left bottom, from(#9c95ef), to(#5e53e4)); - background: linear-gradient(top, #9c95ef, #5e53e4); } - .button-raised.button-royal:active, .button-raised.button-royal.active, .button-raised.button-royal.is-active { - border-color: #5246e2; - background: #827ae1; } - -/* -* 3D Buttons -* -* These buttons have a heavy three dimensional -* style that mimics the visual appearance of a -* real life button. -*/ -.button-3d { - position: relative; - top: 0; - -webkit-box-shadow: 0 7px 0 #bbbbbb, 0 8px 3px rgba(0, 0, 0, 0.2); - box-shadow: 0 7px 0 #bbbbbb, 0 8px 3px rgba(0, 0, 0, 0.2); } - .button-3d:hover, .button-3d:focus { - -webkit-box-shadow: 0 7px 0 #bbbbbb, 0 8px 3px rgba(0, 0, 0, 0.2); - box-shadow: 0 7px 0 #bbbbbb, 0 8px 3px rgba(0, 0, 0, 0.2); } - .button-3d:active, .button-3d.active, .button-3d.is-active { - top: 5px; - -webkit-transition-property: all; - transition-property: all; - -webkit-transition-duration: .15s; - transition-duration: .15s; - -webkit-box-shadow: 0 2px 0 #bbbbbb, 0 3px 3px rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 0 #bbbbbb, 0 3px 3px rgba(0, 0, 0, 0.2); } - -/* -* 3D Button Colors -* -* Create colors for buttons -* (.button-primary, .button-secondary, etc.) -*/ -.button-3d.button-primary { - -webkit-box-shadow: 0 7px 0 #0880d7, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #0880d7, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-primary:hover, .button-3d.button-primary:focus { - -webkit-box-shadow: 0 7px 0 #077ace, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #077ace, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-primary:active, .button-3d.button-primary.active, .button-3d.button-primary.is-active { - -webkit-box-shadow: 0 2px 0 #0662a6, 0 3px 3px rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 0 #0662a6, 0 3px 3px rgba(0, 0, 0, 0.2); } -.button-3d.button-plain { - -webkit-box-shadow: 0 7px 0 #e6e6e6, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #e6e6e6, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-plain:hover, .button-3d.button-plain:focus { - -webkit-box-shadow: 0 7px 0 #e0e0e0, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #e0e0e0, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-plain:active, .button-3d.button-plain.active, .button-3d.button-plain.is-active { - -webkit-box-shadow: 0 2px 0 #cccccc, 0 3px 3px rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 0 #cccccc, 0 3px 3px rgba(0, 0, 0, 0.2); } -.button-3d.button-inverse { - -webkit-box-shadow: 0 7px 0 #090909, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #090909, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-inverse:hover, .button-3d.button-inverse:focus { - -webkit-box-shadow: 0 7px 0 #030303, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #030303, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-inverse:active, .button-3d.button-inverse.active, .button-3d.button-inverse.is-active { - -webkit-box-shadow: 0 2px 0 black, 0 3px 3px rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 0 black, 0 3px 3px rgba(0, 0, 0, 0.2); } -.button-3d.button-action { - -webkit-box-shadow: 0 7px 0 #8bc220, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #8bc220, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-action:hover, .button-3d.button-action:focus { - -webkit-box-shadow: 0 7px 0 #84b91f, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #84b91f, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-action:active, .button-3d.button-action.active, .button-3d.button-action.is-active { - -webkit-box-shadow: 0 2px 0 #6b9619, 0 3px 3px rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 0 #6b9619, 0 3px 3px rgba(0, 0, 0, 0.2); } -.button-3d.button-highlight { - -webkit-box-shadow: 0 7px 0 #e59501, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #e59501, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-highlight:hover, .button-3d.button-highlight:focus { - -webkit-box-shadow: 0 7px 0 #db8e01, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #db8e01, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-highlight:active, .button-3d.button-highlight.active, .button-3d.button-highlight.is-active { - -webkit-box-shadow: 0 2px 0 #b27401, 0 3px 3px rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 0 #b27401, 0 3px 3px rgba(0, 0, 0, 0.2); } -.button-3d.button-caution { - -webkit-box-shadow: 0 7px 0 #ff1022, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #ff1022, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-caution:hover, .button-3d.button-caution:focus { - -webkit-box-shadow: 0 7px 0 #ff0618, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #ff0618, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-caution:active, .button-3d.button-caution.active, .button-3d.button-caution.is-active { - -webkit-box-shadow: 0 2px 0 #dc0010, 0 3px 3px rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 0 #dc0010, 0 3px 3px rgba(0, 0, 0, 0.2); } -.button-3d.button-royal { - -webkit-box-shadow: 0 7px 0 #5246e2, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #5246e2, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-royal:hover, .button-3d.button-royal:focus { - -webkit-box-shadow: 0 7px 0 #493de1, 0 8px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 7px 0 #493de1, 0 8px 3px rgba(0, 0, 0, 0.3); } - .button-3d.button-royal:active, .button-3d.button-royal.active, .button-3d.button-royal.is-active { - -webkit-box-shadow: 0 2px 0 #2f21d4, 0 3px 3px rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 0 #2f21d4, 0 3px 3px rgba(0, 0, 0, 0.2); } - -/* -* Glowing Buttons -* -* A pulse like glow that appears -* rythmically around the edges of -* a button. -*/ -/* -* Glow animation mixin for Compass users -* -*/ -/* -* Glowing Keyframes -* -*/ -@-webkit-keyframes glowing { - from { - -webkit-box-shadow: 0 0 0 rgba(44, 154, 219, 0.3); - box-shadow: 0 0 0 rgba(44, 154, 219, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(44, 154, 219, 0.8); - box-shadow: 0 0 20px rgba(44, 154, 219, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(44, 154, 219, 0.3); - box-shadow: 0 0 0 rgba(44, 154, 219, 0.3); } } -@keyframes glowing { - from { - -webkit-box-shadow: 0 0 0 rgba(44, 154, 219, 0.3); - box-shadow: 0 0 0 rgba(44, 154, 219, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(44, 154, 219, 0.8); - box-shadow: 0 0 20px rgba(44, 154, 219, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(44, 154, 219, 0.3); - box-shadow: 0 0 0 rgba(44, 154, 219, 0.3); } } -/* -* Glowing Keyframes for various colors -* -*/ -@-webkit-keyframes glowing-primary { - from { - -webkit-box-shadow: 0 0 0 rgba(27, 154, 247, 0.3); - box-shadow: 0 0 0 rgba(27, 154, 247, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(27, 154, 247, 0.8); - box-shadow: 0 0 20px rgba(27, 154, 247, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(27, 154, 247, 0.3); - box-shadow: 0 0 0 rgba(27, 154, 247, 0.3); } } -@keyframes glowing-primary { - from { - -webkit-box-shadow: 0 0 0 rgba(27, 154, 247, 0.3); - box-shadow: 0 0 0 rgba(27, 154, 247, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(27, 154, 247, 0.8); - box-shadow: 0 0 20px rgba(27, 154, 247, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(27, 154, 247, 0.3); - box-shadow: 0 0 0 rgba(27, 154, 247, 0.3); } } -@-webkit-keyframes glowing-plain { - from { - -webkit-box-shadow: 0 0 0 rgba(255, 255, 255, 0.3); - box-shadow: 0 0 0 rgba(255, 255, 255, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); - box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(255, 255, 255, 0.3); - box-shadow: 0 0 0 rgba(255, 255, 255, 0.3); } } -@keyframes glowing-plain { - from { - -webkit-box-shadow: 0 0 0 rgba(255, 255, 255, 0.3); - box-shadow: 0 0 0 rgba(255, 255, 255, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); - box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(255, 255, 255, 0.3); - box-shadow: 0 0 0 rgba(255, 255, 255, 0.3); } } -@-webkit-keyframes glowing-inverse { - from { - -webkit-box-shadow: 0 0 0 rgba(34, 34, 34, 0.3); - box-shadow: 0 0 0 rgba(34, 34, 34, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(34, 34, 34, 0.8); - box-shadow: 0 0 20px rgba(34, 34, 34, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(34, 34, 34, 0.3); - box-shadow: 0 0 0 rgba(34, 34, 34, 0.3); } } -@keyframes glowing-inverse { - from { - -webkit-box-shadow: 0 0 0 rgba(34, 34, 34, 0.3); - box-shadow: 0 0 0 rgba(34, 34, 34, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(34, 34, 34, 0.8); - box-shadow: 0 0 20px rgba(34, 34, 34, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(34, 34, 34, 0.3); - box-shadow: 0 0 0 rgba(34, 34, 34, 0.3); } } -@-webkit-keyframes glowing-action { - from { - -webkit-box-shadow: 0 0 0 rgba(165, 222, 55, 0.3); - box-shadow: 0 0 0 rgba(165, 222, 55, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(165, 222, 55, 0.8); - box-shadow: 0 0 20px rgba(165, 222, 55, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(165, 222, 55, 0.3); - box-shadow: 0 0 0 rgba(165, 222, 55, 0.3); } } -@keyframes glowing-action { - from { - -webkit-box-shadow: 0 0 0 rgba(165, 222, 55, 0.3); - box-shadow: 0 0 0 rgba(165, 222, 55, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(165, 222, 55, 0.8); - box-shadow: 0 0 20px rgba(165, 222, 55, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(165, 222, 55, 0.3); - box-shadow: 0 0 0 rgba(165, 222, 55, 0.3); } } -@-webkit-keyframes glowing-highlight { - from { - -webkit-box-shadow: 0 0 0 rgba(254, 174, 27, 0.3); - box-shadow: 0 0 0 rgba(254, 174, 27, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(254, 174, 27, 0.8); - box-shadow: 0 0 20px rgba(254, 174, 27, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(254, 174, 27, 0.3); - box-shadow: 0 0 0 rgba(254, 174, 27, 0.3); } } -@keyframes glowing-highlight { - from { - -webkit-box-shadow: 0 0 0 rgba(254, 174, 27, 0.3); - box-shadow: 0 0 0 rgba(254, 174, 27, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(254, 174, 27, 0.8); - box-shadow: 0 0 20px rgba(254, 174, 27, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(254, 174, 27, 0.3); - box-shadow: 0 0 0 rgba(254, 174, 27, 0.3); } } -@-webkit-keyframes glowing-caution { - from { - -webkit-box-shadow: 0 0 0 rgba(255, 67, 81, 0.3); - box-shadow: 0 0 0 rgba(255, 67, 81, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(255, 67, 81, 0.8); - box-shadow: 0 0 20px rgba(255, 67, 81, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(255, 67, 81, 0.3); - box-shadow: 0 0 0 rgba(255, 67, 81, 0.3); } } -@keyframes glowing-caution { - from { - -webkit-box-shadow: 0 0 0 rgba(255, 67, 81, 0.3); - box-shadow: 0 0 0 rgba(255, 67, 81, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(255, 67, 81, 0.8); - box-shadow: 0 0 20px rgba(255, 67, 81, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(255, 67, 81, 0.3); - box-shadow: 0 0 0 rgba(255, 67, 81, 0.3); } } -@-webkit-keyframes glowing-royal { - from { - -webkit-box-shadow: 0 0 0 rgba(123, 114, 233, 0.3); - box-shadow: 0 0 0 rgba(123, 114, 233, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(123, 114, 233, 0.8); - box-shadow: 0 0 20px rgba(123, 114, 233, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(123, 114, 233, 0.3); - box-shadow: 0 0 0 rgba(123, 114, 233, 0.3); } } -@keyframes glowing-royal { - from { - -webkit-box-shadow: 0 0 0 rgba(123, 114, 233, 0.3); - box-shadow: 0 0 0 rgba(123, 114, 233, 0.3); } - 50% { - -webkit-box-shadow: 0 0 20px rgba(123, 114, 233, 0.8); - box-shadow: 0 0 20px rgba(123, 114, 233, 0.8); } - to { - -webkit-box-shadow: 0 0 0 rgba(123, 114, 233, 0.3); - box-shadow: 0 0 0 rgba(123, 114, 233, 0.3); } } -/* -* Glowing Buttons Base Styes -* -* A pulse like glow that appears -* rythmically around the edges of -* a button. -*/ -.button-glow { - -webkit-animation-duration: 3s; - animation-duration: 3s; - -webkit-animation-iteration-count: infinite; - animation-iteration-count: infinite; - -webkit-animation-name: glowing; - animation-name: glowing; } - .button-glow:active, .button-glow.active, .button-glow.is-active { - -webkit-animation-name: none; - animation-name: none; } - -/* -* Glowing Button Colors -* -* Create colors for glowing buttons -*/ -.button-glow.button-primary { - -webkit-animation-name: glowing-primary; - animation-name: glowing-primary; } -.button-glow.button-plain { - -webkit-animation-name: glowing-plain; - animation-name: glowing-plain; } -.button-glow.button-inverse { - -webkit-animation-name: glowing-inverse; - animation-name: glowing-inverse; } -.button-glow.button-action { - -webkit-animation-name: glowing-action; - animation-name: glowing-action; } -.button-glow.button-highlight { - -webkit-animation-name: glowing-highlight; - animation-name: glowing-highlight; } -.button-glow.button-caution { - -webkit-animation-name: glowing-caution; - animation-name: glowing-caution; } -.button-glow.button-royal { - -webkit-animation-name: glowing-royal; - animation-name: glowing-royal; } - -/* -* Dropdown menu buttons -* -* A dropdown menu appears -* when a button is pressed -*/ -/* -* Dropdown Container -* -*/ -.button-dropdown { - position: relative; - overflow: visible; - display: inline-block; } - -/* -* Dropdown List Style -* -*/ -.button-dropdown-list { - display: none; - position: absolute; - padding: 0; - margin: 0; - top: 0; - left: 0; - z-index: 1000; - min-width: 100%; - list-style-type: none; - background: rgba(255, 255, 255, 0.95); - border-style: solid; - border-width: 1px; - border-color: #d4d4d4; - font-family: "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; - -webkit-box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2); - border-radius: 3px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - /* - * Dropdown Below - * - */ - /* - * Dropdown Above - * - */ } - .button-dropdown-list.is-below { - top: 100%; - border-top: none; - border-radius: 0 0 3px 3px; } - .button-dropdown-list.is-above { - bottom: 100%; - top: auto; - border-bottom: none; - border-radius: 3px 3px 0 0; - -webkit-box-shadow: 0 -2px 7px rgba(0, 0, 0, 0.2); - box-shadow: 0 -2px 7px rgba(0, 0, 0, 0.2); } - -/* -* Dropdown Buttons -* -*/ -.button-dropdown-list > li { - padding: 0; - margin: 0; - display: block; } - .button-dropdown-list > li > a { - display: block; - line-height: 40px; - font-size: 12.8px; - padding: 5px 10px; - float: none; - color: #666; - text-decoration: none; } - .button-dropdown-list > li > a:hover { - color: #5e5e5e; - background: #f6f6f6; - text-decoration: none; } - -.button-dropdown-divider { - border-top: 1px solid #e6e6e6; } - -/* -* Dropdown Colors -* -* Create colors for buttons -* (.button-primary, .button-secondary, etc.) -*/ -.button-dropdown.button-dropdown-primary .button-dropdown-list { - background: rgba(27, 154, 247, 0.95); - border-color: #0880d7; } - .button-dropdown.button-dropdown-primary .button-dropdown-list .button-dropdown-divider { - border-color: #0888e6; } - .button-dropdown.button-dropdown-primary .button-dropdown-list > li > a { - color: #FFF; } - .button-dropdown.button-dropdown-primary .button-dropdown-list > li > a:hover { - color: #f2f2f2; - background: #088ef0; } -.button-dropdown.button-dropdown-plain .button-dropdown-list { - background: rgba(255, 255, 255, 0.95); - border-color: #e6e6e6; } - .button-dropdown.button-dropdown-plain .button-dropdown-list .button-dropdown-divider { - border-color: #ededed; } - .button-dropdown.button-dropdown-plain .button-dropdown-list > li > a { - color: #1B9AF7; } - .button-dropdown.button-dropdown-plain .button-dropdown-list > li > a:hover { - color: #088ef0; - background: #f2f2f2; } -.button-dropdown.button-dropdown-inverse .button-dropdown-list { - background: rgba(34, 34, 34, 0.95); - border-color: #090909; } - .button-dropdown.button-dropdown-inverse .button-dropdown-list .button-dropdown-divider { - border-color: #101010; } - .button-dropdown.button-dropdown-inverse .button-dropdown-list > li > a { - color: #EEE; } - .button-dropdown.button-dropdown-inverse .button-dropdown-list > li > a:hover { - color: #e1e1e1; - background: #151515; } -.button-dropdown.button-dropdown-action .button-dropdown-list { - background: rgba(165, 222, 55, 0.95); - border-color: #8bc220; } - .button-dropdown.button-dropdown-action .button-dropdown-list .button-dropdown-divider { - border-color: #94cf22; } - .button-dropdown.button-dropdown-action .button-dropdown-list > li > a { - color: #FFF; } - .button-dropdown.button-dropdown-action .button-dropdown-list > li > a:hover { - color: #f2f2f2; - background: #9ad824; } -.button-dropdown.button-dropdown-highlight .button-dropdown-list { - background: rgba(254, 174, 27, 0.95); - border-color: #e59501; } - .button-dropdown.button-dropdown-highlight .button-dropdown-list .button-dropdown-divider { - border-color: #f49f01; } - .button-dropdown.button-dropdown-highlight .button-dropdown-list > li > a { - color: #FFF; } - .button-dropdown.button-dropdown-highlight .button-dropdown-list > li > a:hover { - color: #f2f2f2; - background: #fea502; } -.button-dropdown.button-dropdown-caution .button-dropdown-list { - background: rgba(255, 67, 81, 0.95); - border-color: #ff1022; } - .button-dropdown.button-dropdown-caution .button-dropdown-list .button-dropdown-divider { - border-color: #ff1f30; } - .button-dropdown.button-dropdown-caution .button-dropdown-list > li > a { - color: #FFF; } - .button-dropdown.button-dropdown-caution .button-dropdown-list > li > a:hover { - color: #f2f2f2; - background: #ff2939; } -.button-dropdown.button-dropdown-royal .button-dropdown-list { - background: rgba(123, 114, 233, 0.95); - border-color: #5246e2; } - .button-dropdown.button-dropdown-royal .button-dropdown-list .button-dropdown-divider { - border-color: #5e53e4; } - .button-dropdown.button-dropdown-royal .button-dropdown-list > li > a { - color: #FFF; } - .button-dropdown.button-dropdown-royal .button-dropdown-list > li > a:hover { - color: #f2f2f2; - background: #665ce6; } - -/* -* Buton Groups -* -* A group of related buttons -* displayed edge to edge -*/ -.button-group { - position: relative; - display: inline-block; } - .button-group:after { - content: " "; - display: block; - clear: both; } - .button-group .button, - .button-group .button-dropdown { - float: left; } - .button-group .button:not(:first-child):not(:last-child), - .button-group .button-dropdown:not(:first-child):not(:last-child) { - border-radius: 0; - border-right: none; } - .button-group .button:first-child, - .button-group .button-dropdown:first-child { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-right: none; } - .button-group .button:last-child, - .button-group .button-dropdown:last-child { - border-top-left-radius: 0; - border-bottom-left-radius: 0; } - -/* -* Button Wrapper -* -* A wrap around effect to highlight -* the shape of the button and offer -* a subtle visual effect. -*/ -.button-wrap { - border: 1px solid #e3e3e3; - display: inline-block; - padding: 9px; - background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#FFF)); - background: linear-gradient(#f2f2f2, #FFF); - border-radius: 200px; - -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04); - box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04); } - -/* -* Long Shadow Buttons -* -* A visual effect adding a flat shadow to the text of a button -*/ -/* -* Long Shadow Function -* -* Loops $length times building a long shadow. Defaults downward right -*/ -/* -* LONG SHADOW MIXIN -* -*/ -/* -* Shadow Right -* -*/ -.button-longshadow, -.button-longshadow-right { - overflow: hidden; } - .button-longshadow.button-primary, - .button-longshadow-right.button-primary { - text-shadow: 0px 0px #0880d7, 1px 1px #0880d7, 2px 2px #0880d7, 3px 3px #0880d7, 4px 4px #0880d7, 5px 5px #0880d7, 6px 6px #0880d7, 7px 7px #0880d7, 8px 8px #0880d7, 9px 9px #0880d7, 10px 10px #0880d7, 11px 11px #0880d7, 12px 12px #0880d7, 13px 13px #0880d7, 14px 14px #0880d7, 15px 15px #0880d7, 16px 16px #0880d7, 17px 17px #0880d7, 18px 18px #0880d7, 19px 19px #0880d7, 20px 20px #0880d7, 21px 21px #0880d7, 22px 22px #0880d7, 23px 23px #0880d7, 24px 24px #0880d7, 25px 25px #0880d7, 26px 26px #0880d7, 27px 27px #0880d7, 28px 28px #0880d7, 29px 29px #0880d7, 30px 30px #0880d7, 31px 31px #0880d7, 32px 32px #0880d7, 33px 33px #0880d7, 34px 34px #0880d7, 35px 35px #0880d7, 36px 36px #0880d7, 37px 37px #0880d7, 38px 38px #0880d7, 39px 39px #0880d7, 40px 40px #0880d7, 41px 41px #0880d7, 42px 42px #0880d7, 43px 43px #0880d7, 44px 44px #0880d7, 45px 45px #0880d7, 46px 46px #0880d7, 47px 47px #0880d7, 48px 48px #0880d7, 49px 49px #0880d7, 50px 50px #0880d7, 51px 51px #0880d7, 52px 52px #0880d7, 53px 53px #0880d7, 54px 54px #0880d7, 55px 55px #0880d7, 56px 56px #0880d7, 57px 57px #0880d7, 58px 58px #0880d7, 59px 59px #0880d7, 60px 60px #0880d7, 61px 61px #0880d7, 62px 62px #0880d7, 63px 63px #0880d7, 64px 64px #0880d7, 65px 65px #0880d7, 66px 66px #0880d7, 67px 67px #0880d7, 68px 68px #0880d7, 69px 69px #0880d7, 70px 70px #0880d7, 71px 71px #0880d7, 72px 72px #0880d7, 73px 73px #0880d7, 74px 74px #0880d7, 75px 75px #0880d7, 76px 76px #0880d7, 77px 77px #0880d7, 78px 78px #0880d7, 79px 79px #0880d7, 80px 80px #0880d7, 81px 81px #0880d7, 82px 82px #0880d7, 83px 83px #0880d7, 84px 84px #0880d7, 85px 85px #0880d7; } - .button-longshadow.button-primary:active, .button-longshadow.button-primary.active, .button-longshadow.button-primary.is-active, - .button-longshadow-right.button-primary:active, - .button-longshadow-right.button-primary.active, - .button-longshadow-right.button-primary.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow.button-plain, - .button-longshadow-right.button-plain { - text-shadow: 0px 0px #e6e6e6, 1px 1px #e6e6e6, 2px 2px #e6e6e6, 3px 3px #e6e6e6, 4px 4px #e6e6e6, 5px 5px #e6e6e6, 6px 6px #e6e6e6, 7px 7px #e6e6e6, 8px 8px #e6e6e6, 9px 9px #e6e6e6, 10px 10px #e6e6e6, 11px 11px #e6e6e6, 12px 12px #e6e6e6, 13px 13px #e6e6e6, 14px 14px #e6e6e6, 15px 15px #e6e6e6, 16px 16px #e6e6e6, 17px 17px #e6e6e6, 18px 18px #e6e6e6, 19px 19px #e6e6e6, 20px 20px #e6e6e6, 21px 21px #e6e6e6, 22px 22px #e6e6e6, 23px 23px #e6e6e6, 24px 24px #e6e6e6, 25px 25px #e6e6e6, 26px 26px #e6e6e6, 27px 27px #e6e6e6, 28px 28px #e6e6e6, 29px 29px #e6e6e6, 30px 30px #e6e6e6, 31px 31px #e6e6e6, 32px 32px #e6e6e6, 33px 33px #e6e6e6, 34px 34px #e6e6e6, 35px 35px #e6e6e6, 36px 36px #e6e6e6, 37px 37px #e6e6e6, 38px 38px #e6e6e6, 39px 39px #e6e6e6, 40px 40px #e6e6e6, 41px 41px #e6e6e6, 42px 42px #e6e6e6, 43px 43px #e6e6e6, 44px 44px #e6e6e6, 45px 45px #e6e6e6, 46px 46px #e6e6e6, 47px 47px #e6e6e6, 48px 48px #e6e6e6, 49px 49px #e6e6e6, 50px 50px #e6e6e6, 51px 51px #e6e6e6, 52px 52px #e6e6e6, 53px 53px #e6e6e6, 54px 54px #e6e6e6, 55px 55px #e6e6e6, 56px 56px #e6e6e6, 57px 57px #e6e6e6, 58px 58px #e6e6e6, 59px 59px #e6e6e6, 60px 60px #e6e6e6, 61px 61px #e6e6e6, 62px 62px #e6e6e6, 63px 63px #e6e6e6, 64px 64px #e6e6e6, 65px 65px #e6e6e6, 66px 66px #e6e6e6, 67px 67px #e6e6e6, 68px 68px #e6e6e6, 69px 69px #e6e6e6, 70px 70px #e6e6e6, 71px 71px #e6e6e6, 72px 72px #e6e6e6, 73px 73px #e6e6e6, 74px 74px #e6e6e6, 75px 75px #e6e6e6, 76px 76px #e6e6e6, 77px 77px #e6e6e6, 78px 78px #e6e6e6, 79px 79px #e6e6e6, 80px 80px #e6e6e6, 81px 81px #e6e6e6, 82px 82px #e6e6e6, 83px 83px #e6e6e6, 84px 84px #e6e6e6, 85px 85px #e6e6e6; } - .button-longshadow.button-plain:active, .button-longshadow.button-plain.active, .button-longshadow.button-plain.is-active, - .button-longshadow-right.button-plain:active, - .button-longshadow-right.button-plain.active, - .button-longshadow-right.button-plain.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow.button-inverse, - .button-longshadow-right.button-inverse { - text-shadow: 0px 0px #090909, 1px 1px #090909, 2px 2px #090909, 3px 3px #090909, 4px 4px #090909, 5px 5px #090909, 6px 6px #090909, 7px 7px #090909, 8px 8px #090909, 9px 9px #090909, 10px 10px #090909, 11px 11px #090909, 12px 12px #090909, 13px 13px #090909, 14px 14px #090909, 15px 15px #090909, 16px 16px #090909, 17px 17px #090909, 18px 18px #090909, 19px 19px #090909, 20px 20px #090909, 21px 21px #090909, 22px 22px #090909, 23px 23px #090909, 24px 24px #090909, 25px 25px #090909, 26px 26px #090909, 27px 27px #090909, 28px 28px #090909, 29px 29px #090909, 30px 30px #090909, 31px 31px #090909, 32px 32px #090909, 33px 33px #090909, 34px 34px #090909, 35px 35px #090909, 36px 36px #090909, 37px 37px #090909, 38px 38px #090909, 39px 39px #090909, 40px 40px #090909, 41px 41px #090909, 42px 42px #090909, 43px 43px #090909, 44px 44px #090909, 45px 45px #090909, 46px 46px #090909, 47px 47px #090909, 48px 48px #090909, 49px 49px #090909, 50px 50px #090909, 51px 51px #090909, 52px 52px #090909, 53px 53px #090909, 54px 54px #090909, 55px 55px #090909, 56px 56px #090909, 57px 57px #090909, 58px 58px #090909, 59px 59px #090909, 60px 60px #090909, 61px 61px #090909, 62px 62px #090909, 63px 63px #090909, 64px 64px #090909, 65px 65px #090909, 66px 66px #090909, 67px 67px #090909, 68px 68px #090909, 69px 69px #090909, 70px 70px #090909, 71px 71px #090909, 72px 72px #090909, 73px 73px #090909, 74px 74px #090909, 75px 75px #090909, 76px 76px #090909, 77px 77px #090909, 78px 78px #090909, 79px 79px #090909, 80px 80px #090909, 81px 81px #090909, 82px 82px #090909, 83px 83px #090909, 84px 84px #090909, 85px 85px #090909; } - .button-longshadow.button-inverse:active, .button-longshadow.button-inverse.active, .button-longshadow.button-inverse.is-active, - .button-longshadow-right.button-inverse:active, - .button-longshadow-right.button-inverse.active, - .button-longshadow-right.button-inverse.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow.button-action, - .button-longshadow-right.button-action { - text-shadow: 0px 0px #8bc220, 1px 1px #8bc220, 2px 2px #8bc220, 3px 3px #8bc220, 4px 4px #8bc220, 5px 5px #8bc220, 6px 6px #8bc220, 7px 7px #8bc220, 8px 8px #8bc220, 9px 9px #8bc220, 10px 10px #8bc220, 11px 11px #8bc220, 12px 12px #8bc220, 13px 13px #8bc220, 14px 14px #8bc220, 15px 15px #8bc220, 16px 16px #8bc220, 17px 17px #8bc220, 18px 18px #8bc220, 19px 19px #8bc220, 20px 20px #8bc220, 21px 21px #8bc220, 22px 22px #8bc220, 23px 23px #8bc220, 24px 24px #8bc220, 25px 25px #8bc220, 26px 26px #8bc220, 27px 27px #8bc220, 28px 28px #8bc220, 29px 29px #8bc220, 30px 30px #8bc220, 31px 31px #8bc220, 32px 32px #8bc220, 33px 33px #8bc220, 34px 34px #8bc220, 35px 35px #8bc220, 36px 36px #8bc220, 37px 37px #8bc220, 38px 38px #8bc220, 39px 39px #8bc220, 40px 40px #8bc220, 41px 41px #8bc220, 42px 42px #8bc220, 43px 43px #8bc220, 44px 44px #8bc220, 45px 45px #8bc220, 46px 46px #8bc220, 47px 47px #8bc220, 48px 48px #8bc220, 49px 49px #8bc220, 50px 50px #8bc220, 51px 51px #8bc220, 52px 52px #8bc220, 53px 53px #8bc220, 54px 54px #8bc220, 55px 55px #8bc220, 56px 56px #8bc220, 57px 57px #8bc220, 58px 58px #8bc220, 59px 59px #8bc220, 60px 60px #8bc220, 61px 61px #8bc220, 62px 62px #8bc220, 63px 63px #8bc220, 64px 64px #8bc220, 65px 65px #8bc220, 66px 66px #8bc220, 67px 67px #8bc220, 68px 68px #8bc220, 69px 69px #8bc220, 70px 70px #8bc220, 71px 71px #8bc220, 72px 72px #8bc220, 73px 73px #8bc220, 74px 74px #8bc220, 75px 75px #8bc220, 76px 76px #8bc220, 77px 77px #8bc220, 78px 78px #8bc220, 79px 79px #8bc220, 80px 80px #8bc220, 81px 81px #8bc220, 82px 82px #8bc220, 83px 83px #8bc220, 84px 84px #8bc220, 85px 85px #8bc220; } - .button-longshadow.button-action:active, .button-longshadow.button-action.active, .button-longshadow.button-action.is-active, - .button-longshadow-right.button-action:active, - .button-longshadow-right.button-action.active, - .button-longshadow-right.button-action.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow.button-highlight, - .button-longshadow-right.button-highlight { - text-shadow: 0px 0px #e59501, 1px 1px #e59501, 2px 2px #e59501, 3px 3px #e59501, 4px 4px #e59501, 5px 5px #e59501, 6px 6px #e59501, 7px 7px #e59501, 8px 8px #e59501, 9px 9px #e59501, 10px 10px #e59501, 11px 11px #e59501, 12px 12px #e59501, 13px 13px #e59501, 14px 14px #e59501, 15px 15px #e59501, 16px 16px #e59501, 17px 17px #e59501, 18px 18px #e59501, 19px 19px #e59501, 20px 20px #e59501, 21px 21px #e59501, 22px 22px #e59501, 23px 23px #e59501, 24px 24px #e59501, 25px 25px #e59501, 26px 26px #e59501, 27px 27px #e59501, 28px 28px #e59501, 29px 29px #e59501, 30px 30px #e59501, 31px 31px #e59501, 32px 32px #e59501, 33px 33px #e59501, 34px 34px #e59501, 35px 35px #e59501, 36px 36px #e59501, 37px 37px #e59501, 38px 38px #e59501, 39px 39px #e59501, 40px 40px #e59501, 41px 41px #e59501, 42px 42px #e59501, 43px 43px #e59501, 44px 44px #e59501, 45px 45px #e59501, 46px 46px #e59501, 47px 47px #e59501, 48px 48px #e59501, 49px 49px #e59501, 50px 50px #e59501, 51px 51px #e59501, 52px 52px #e59501, 53px 53px #e59501, 54px 54px #e59501, 55px 55px #e59501, 56px 56px #e59501, 57px 57px #e59501, 58px 58px #e59501, 59px 59px #e59501, 60px 60px #e59501, 61px 61px #e59501, 62px 62px #e59501, 63px 63px #e59501, 64px 64px #e59501, 65px 65px #e59501, 66px 66px #e59501, 67px 67px #e59501, 68px 68px #e59501, 69px 69px #e59501, 70px 70px #e59501, 71px 71px #e59501, 72px 72px #e59501, 73px 73px #e59501, 74px 74px #e59501, 75px 75px #e59501, 76px 76px #e59501, 77px 77px #e59501, 78px 78px #e59501, 79px 79px #e59501, 80px 80px #e59501, 81px 81px #e59501, 82px 82px #e59501, 83px 83px #e59501, 84px 84px #e59501, 85px 85px #e59501; } - .button-longshadow.button-highlight:active, .button-longshadow.button-highlight.active, .button-longshadow.button-highlight.is-active, - .button-longshadow-right.button-highlight:active, - .button-longshadow-right.button-highlight.active, - .button-longshadow-right.button-highlight.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow.button-caution, - .button-longshadow-right.button-caution { - text-shadow: 0px 0px #ff1022, 1px 1px #ff1022, 2px 2px #ff1022, 3px 3px #ff1022, 4px 4px #ff1022, 5px 5px #ff1022, 6px 6px #ff1022, 7px 7px #ff1022, 8px 8px #ff1022, 9px 9px #ff1022, 10px 10px #ff1022, 11px 11px #ff1022, 12px 12px #ff1022, 13px 13px #ff1022, 14px 14px #ff1022, 15px 15px #ff1022, 16px 16px #ff1022, 17px 17px #ff1022, 18px 18px #ff1022, 19px 19px #ff1022, 20px 20px #ff1022, 21px 21px #ff1022, 22px 22px #ff1022, 23px 23px #ff1022, 24px 24px #ff1022, 25px 25px #ff1022, 26px 26px #ff1022, 27px 27px #ff1022, 28px 28px #ff1022, 29px 29px #ff1022, 30px 30px #ff1022, 31px 31px #ff1022, 32px 32px #ff1022, 33px 33px #ff1022, 34px 34px #ff1022, 35px 35px #ff1022, 36px 36px #ff1022, 37px 37px #ff1022, 38px 38px #ff1022, 39px 39px #ff1022, 40px 40px #ff1022, 41px 41px #ff1022, 42px 42px #ff1022, 43px 43px #ff1022, 44px 44px #ff1022, 45px 45px #ff1022, 46px 46px #ff1022, 47px 47px #ff1022, 48px 48px #ff1022, 49px 49px #ff1022, 50px 50px #ff1022, 51px 51px #ff1022, 52px 52px #ff1022, 53px 53px #ff1022, 54px 54px #ff1022, 55px 55px #ff1022, 56px 56px #ff1022, 57px 57px #ff1022, 58px 58px #ff1022, 59px 59px #ff1022, 60px 60px #ff1022, 61px 61px #ff1022, 62px 62px #ff1022, 63px 63px #ff1022, 64px 64px #ff1022, 65px 65px #ff1022, 66px 66px #ff1022, 67px 67px #ff1022, 68px 68px #ff1022, 69px 69px #ff1022, 70px 70px #ff1022, 71px 71px #ff1022, 72px 72px #ff1022, 73px 73px #ff1022, 74px 74px #ff1022, 75px 75px #ff1022, 76px 76px #ff1022, 77px 77px #ff1022, 78px 78px #ff1022, 79px 79px #ff1022, 80px 80px #ff1022, 81px 81px #ff1022, 82px 82px #ff1022, 83px 83px #ff1022, 84px 84px #ff1022, 85px 85px #ff1022; } - .button-longshadow.button-caution:active, .button-longshadow.button-caution.active, .button-longshadow.button-caution.is-active, - .button-longshadow-right.button-caution:active, - .button-longshadow-right.button-caution.active, - .button-longshadow-right.button-caution.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow.button-royal, - .button-longshadow-right.button-royal { - text-shadow: 0px 0px #5246e2, 1px 1px #5246e2, 2px 2px #5246e2, 3px 3px #5246e2, 4px 4px #5246e2, 5px 5px #5246e2, 6px 6px #5246e2, 7px 7px #5246e2, 8px 8px #5246e2, 9px 9px #5246e2, 10px 10px #5246e2, 11px 11px #5246e2, 12px 12px #5246e2, 13px 13px #5246e2, 14px 14px #5246e2, 15px 15px #5246e2, 16px 16px #5246e2, 17px 17px #5246e2, 18px 18px #5246e2, 19px 19px #5246e2, 20px 20px #5246e2, 21px 21px #5246e2, 22px 22px #5246e2, 23px 23px #5246e2, 24px 24px #5246e2, 25px 25px #5246e2, 26px 26px #5246e2, 27px 27px #5246e2, 28px 28px #5246e2, 29px 29px #5246e2, 30px 30px #5246e2, 31px 31px #5246e2, 32px 32px #5246e2, 33px 33px #5246e2, 34px 34px #5246e2, 35px 35px #5246e2, 36px 36px #5246e2, 37px 37px #5246e2, 38px 38px #5246e2, 39px 39px #5246e2, 40px 40px #5246e2, 41px 41px #5246e2, 42px 42px #5246e2, 43px 43px #5246e2, 44px 44px #5246e2, 45px 45px #5246e2, 46px 46px #5246e2, 47px 47px #5246e2, 48px 48px #5246e2, 49px 49px #5246e2, 50px 50px #5246e2, 51px 51px #5246e2, 52px 52px #5246e2, 53px 53px #5246e2, 54px 54px #5246e2, 55px 55px #5246e2, 56px 56px #5246e2, 57px 57px #5246e2, 58px 58px #5246e2, 59px 59px #5246e2, 60px 60px #5246e2, 61px 61px #5246e2, 62px 62px #5246e2, 63px 63px #5246e2, 64px 64px #5246e2, 65px 65px #5246e2, 66px 66px #5246e2, 67px 67px #5246e2, 68px 68px #5246e2, 69px 69px #5246e2, 70px 70px #5246e2, 71px 71px #5246e2, 72px 72px #5246e2, 73px 73px #5246e2, 74px 74px #5246e2, 75px 75px #5246e2, 76px 76px #5246e2, 77px 77px #5246e2, 78px 78px #5246e2, 79px 79px #5246e2, 80px 80px #5246e2, 81px 81px #5246e2, 82px 82px #5246e2, 83px 83px #5246e2, 84px 84px #5246e2, 85px 85px #5246e2; } - .button-longshadow.button-royal:active, .button-longshadow.button-royal.active, .button-longshadow.button-royal.is-active, - .button-longshadow-right.button-royal:active, - .button-longshadow-right.button-royal.active, - .button-longshadow-right.button-royal.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - -/* -* Shadow Left -* -*/ -.button-longshadow-left { - overflow: hidden; } - .button-longshadow-left.button-primary { - text-shadow: 0px 0px #0880d7, -1px 1px #0880d7, -2px 2px #0880d7, -3px 3px #0880d7, -4px 4px #0880d7, -5px 5px #0880d7, -6px 6px #0880d7, -7px 7px #0880d7, -8px 8px #0880d7, -9px 9px #0880d7, -10px 10px #0880d7, -11px 11px #0880d7, -12px 12px #0880d7, -13px 13px #0880d7, -14px 14px #0880d7, -15px 15px #0880d7, -16px 16px #0880d7, -17px 17px #0880d7, -18px 18px #0880d7, -19px 19px #0880d7, -20px 20px #0880d7, -21px 21px #0880d7, -22px 22px #0880d7, -23px 23px #0880d7, -24px 24px #0880d7, -25px 25px #0880d7, -26px 26px #0880d7, -27px 27px #0880d7, -28px 28px #0880d7, -29px 29px #0880d7, -30px 30px #0880d7, -31px 31px #0880d7, -32px 32px #0880d7, -33px 33px #0880d7, -34px 34px #0880d7, -35px 35px #0880d7, -36px 36px #0880d7, -37px 37px #0880d7, -38px 38px #0880d7, -39px 39px #0880d7, -40px 40px #0880d7, -41px 41px #0880d7, -42px 42px #0880d7, -43px 43px #0880d7, -44px 44px #0880d7, -45px 45px #0880d7, -46px 46px #0880d7, -47px 47px #0880d7, -48px 48px #0880d7, -49px 49px #0880d7, -50px 50px #0880d7, -51px 51px #0880d7, -52px 52px #0880d7, -53px 53px #0880d7, -54px 54px #0880d7, -55px 55px #0880d7, -56px 56px #0880d7, -57px 57px #0880d7, -58px 58px #0880d7, -59px 59px #0880d7, -60px 60px #0880d7, -61px 61px #0880d7, -62px 62px #0880d7, -63px 63px #0880d7, -64px 64px #0880d7, -65px 65px #0880d7, -66px 66px #0880d7, -67px 67px #0880d7, -68px 68px #0880d7, -69px 69px #0880d7, -70px 70px #0880d7, -71px 71px #0880d7, -72px 72px #0880d7, -73px 73px #0880d7, -74px 74px #0880d7, -75px 75px #0880d7, -76px 76px #0880d7, -77px 77px #0880d7, -78px 78px #0880d7, -79px 79px #0880d7, -80px 80px #0880d7, -81px 81px #0880d7, -82px 82px #0880d7, -83px 83px #0880d7, -84px 84px #0880d7, -85px 85px #0880d7; } - .button-longshadow-left.button-primary:active, .button-longshadow-left.button-primary.active, .button-longshadow-left.button-primary.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow-left.button-plain { - text-shadow: 0px 0px #e6e6e6, -1px 1px #e6e6e6, -2px 2px #e6e6e6, -3px 3px #e6e6e6, -4px 4px #e6e6e6, -5px 5px #e6e6e6, -6px 6px #e6e6e6, -7px 7px #e6e6e6, -8px 8px #e6e6e6, -9px 9px #e6e6e6, -10px 10px #e6e6e6, -11px 11px #e6e6e6, -12px 12px #e6e6e6, -13px 13px #e6e6e6, -14px 14px #e6e6e6, -15px 15px #e6e6e6, -16px 16px #e6e6e6, -17px 17px #e6e6e6, -18px 18px #e6e6e6, -19px 19px #e6e6e6, -20px 20px #e6e6e6, -21px 21px #e6e6e6, -22px 22px #e6e6e6, -23px 23px #e6e6e6, -24px 24px #e6e6e6, -25px 25px #e6e6e6, -26px 26px #e6e6e6, -27px 27px #e6e6e6, -28px 28px #e6e6e6, -29px 29px #e6e6e6, -30px 30px #e6e6e6, -31px 31px #e6e6e6, -32px 32px #e6e6e6, -33px 33px #e6e6e6, -34px 34px #e6e6e6, -35px 35px #e6e6e6, -36px 36px #e6e6e6, -37px 37px #e6e6e6, -38px 38px #e6e6e6, -39px 39px #e6e6e6, -40px 40px #e6e6e6, -41px 41px #e6e6e6, -42px 42px #e6e6e6, -43px 43px #e6e6e6, -44px 44px #e6e6e6, -45px 45px #e6e6e6, -46px 46px #e6e6e6, -47px 47px #e6e6e6, -48px 48px #e6e6e6, -49px 49px #e6e6e6, -50px 50px #e6e6e6, -51px 51px #e6e6e6, -52px 52px #e6e6e6, -53px 53px #e6e6e6, -54px 54px #e6e6e6, -55px 55px #e6e6e6, -56px 56px #e6e6e6, -57px 57px #e6e6e6, -58px 58px #e6e6e6, -59px 59px #e6e6e6, -60px 60px #e6e6e6, -61px 61px #e6e6e6, -62px 62px #e6e6e6, -63px 63px #e6e6e6, -64px 64px #e6e6e6, -65px 65px #e6e6e6, -66px 66px #e6e6e6, -67px 67px #e6e6e6, -68px 68px #e6e6e6, -69px 69px #e6e6e6, -70px 70px #e6e6e6, -71px 71px #e6e6e6, -72px 72px #e6e6e6, -73px 73px #e6e6e6, -74px 74px #e6e6e6, -75px 75px #e6e6e6, -76px 76px #e6e6e6, -77px 77px #e6e6e6, -78px 78px #e6e6e6, -79px 79px #e6e6e6, -80px 80px #e6e6e6, -81px 81px #e6e6e6, -82px 82px #e6e6e6, -83px 83px #e6e6e6, -84px 84px #e6e6e6, -85px 85px #e6e6e6; } - .button-longshadow-left.button-plain:active, .button-longshadow-left.button-plain.active, .button-longshadow-left.button-plain.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow-left.button-inverse { - text-shadow: 0px 0px #090909, -1px 1px #090909, -2px 2px #090909, -3px 3px #090909, -4px 4px #090909, -5px 5px #090909, -6px 6px #090909, -7px 7px #090909, -8px 8px #090909, -9px 9px #090909, -10px 10px #090909, -11px 11px #090909, -12px 12px #090909, -13px 13px #090909, -14px 14px #090909, -15px 15px #090909, -16px 16px #090909, -17px 17px #090909, -18px 18px #090909, -19px 19px #090909, -20px 20px #090909, -21px 21px #090909, -22px 22px #090909, -23px 23px #090909, -24px 24px #090909, -25px 25px #090909, -26px 26px #090909, -27px 27px #090909, -28px 28px #090909, -29px 29px #090909, -30px 30px #090909, -31px 31px #090909, -32px 32px #090909, -33px 33px #090909, -34px 34px #090909, -35px 35px #090909, -36px 36px #090909, -37px 37px #090909, -38px 38px #090909, -39px 39px #090909, -40px 40px #090909, -41px 41px #090909, -42px 42px #090909, -43px 43px #090909, -44px 44px #090909, -45px 45px #090909, -46px 46px #090909, -47px 47px #090909, -48px 48px #090909, -49px 49px #090909, -50px 50px #090909, -51px 51px #090909, -52px 52px #090909, -53px 53px #090909, -54px 54px #090909, -55px 55px #090909, -56px 56px #090909, -57px 57px #090909, -58px 58px #090909, -59px 59px #090909, -60px 60px #090909, -61px 61px #090909, -62px 62px #090909, -63px 63px #090909, -64px 64px #090909, -65px 65px #090909, -66px 66px #090909, -67px 67px #090909, -68px 68px #090909, -69px 69px #090909, -70px 70px #090909, -71px 71px #090909, -72px 72px #090909, -73px 73px #090909, -74px 74px #090909, -75px 75px #090909, -76px 76px #090909, -77px 77px #090909, -78px 78px #090909, -79px 79px #090909, -80px 80px #090909, -81px 81px #090909, -82px 82px #090909, -83px 83px #090909, -84px 84px #090909, -85px 85px #090909; } - .button-longshadow-left.button-inverse:active, .button-longshadow-left.button-inverse.active, .button-longshadow-left.button-inverse.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow-left.button-action { - text-shadow: 0px 0px #8bc220, -1px 1px #8bc220, -2px 2px #8bc220, -3px 3px #8bc220, -4px 4px #8bc220, -5px 5px #8bc220, -6px 6px #8bc220, -7px 7px #8bc220, -8px 8px #8bc220, -9px 9px #8bc220, -10px 10px #8bc220, -11px 11px #8bc220, -12px 12px #8bc220, -13px 13px #8bc220, -14px 14px #8bc220, -15px 15px #8bc220, -16px 16px #8bc220, -17px 17px #8bc220, -18px 18px #8bc220, -19px 19px #8bc220, -20px 20px #8bc220, -21px 21px #8bc220, -22px 22px #8bc220, -23px 23px #8bc220, -24px 24px #8bc220, -25px 25px #8bc220, -26px 26px #8bc220, -27px 27px #8bc220, -28px 28px #8bc220, -29px 29px #8bc220, -30px 30px #8bc220, -31px 31px #8bc220, -32px 32px #8bc220, -33px 33px #8bc220, -34px 34px #8bc220, -35px 35px #8bc220, -36px 36px #8bc220, -37px 37px #8bc220, -38px 38px #8bc220, -39px 39px #8bc220, -40px 40px #8bc220, -41px 41px #8bc220, -42px 42px #8bc220, -43px 43px #8bc220, -44px 44px #8bc220, -45px 45px #8bc220, -46px 46px #8bc220, -47px 47px #8bc220, -48px 48px #8bc220, -49px 49px #8bc220, -50px 50px #8bc220, -51px 51px #8bc220, -52px 52px #8bc220, -53px 53px #8bc220, -54px 54px #8bc220, -55px 55px #8bc220, -56px 56px #8bc220, -57px 57px #8bc220, -58px 58px #8bc220, -59px 59px #8bc220, -60px 60px #8bc220, -61px 61px #8bc220, -62px 62px #8bc220, -63px 63px #8bc220, -64px 64px #8bc220, -65px 65px #8bc220, -66px 66px #8bc220, -67px 67px #8bc220, -68px 68px #8bc220, -69px 69px #8bc220, -70px 70px #8bc220, -71px 71px #8bc220, -72px 72px #8bc220, -73px 73px #8bc220, -74px 74px #8bc220, -75px 75px #8bc220, -76px 76px #8bc220, -77px 77px #8bc220, -78px 78px #8bc220, -79px 79px #8bc220, -80px 80px #8bc220, -81px 81px #8bc220, -82px 82px #8bc220, -83px 83px #8bc220, -84px 84px #8bc220, -85px 85px #8bc220; } - .button-longshadow-left.button-action:active, .button-longshadow-left.button-action.active, .button-longshadow-left.button-action.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow-left.button-highlight { - text-shadow: 0px 0px #e59501, -1px 1px #e59501, -2px 2px #e59501, -3px 3px #e59501, -4px 4px #e59501, -5px 5px #e59501, -6px 6px #e59501, -7px 7px #e59501, -8px 8px #e59501, -9px 9px #e59501, -10px 10px #e59501, -11px 11px #e59501, -12px 12px #e59501, -13px 13px #e59501, -14px 14px #e59501, -15px 15px #e59501, -16px 16px #e59501, -17px 17px #e59501, -18px 18px #e59501, -19px 19px #e59501, -20px 20px #e59501, -21px 21px #e59501, -22px 22px #e59501, -23px 23px #e59501, -24px 24px #e59501, -25px 25px #e59501, -26px 26px #e59501, -27px 27px #e59501, -28px 28px #e59501, -29px 29px #e59501, -30px 30px #e59501, -31px 31px #e59501, -32px 32px #e59501, -33px 33px #e59501, -34px 34px #e59501, -35px 35px #e59501, -36px 36px #e59501, -37px 37px #e59501, -38px 38px #e59501, -39px 39px #e59501, -40px 40px #e59501, -41px 41px #e59501, -42px 42px #e59501, -43px 43px #e59501, -44px 44px #e59501, -45px 45px #e59501, -46px 46px #e59501, -47px 47px #e59501, -48px 48px #e59501, -49px 49px #e59501, -50px 50px #e59501, -51px 51px #e59501, -52px 52px #e59501, -53px 53px #e59501, -54px 54px #e59501, -55px 55px #e59501, -56px 56px #e59501, -57px 57px #e59501, -58px 58px #e59501, -59px 59px #e59501, -60px 60px #e59501, -61px 61px #e59501, -62px 62px #e59501, -63px 63px #e59501, -64px 64px #e59501, -65px 65px #e59501, -66px 66px #e59501, -67px 67px #e59501, -68px 68px #e59501, -69px 69px #e59501, -70px 70px #e59501, -71px 71px #e59501, -72px 72px #e59501, -73px 73px #e59501, -74px 74px #e59501, -75px 75px #e59501, -76px 76px #e59501, -77px 77px #e59501, -78px 78px #e59501, -79px 79px #e59501, -80px 80px #e59501, -81px 81px #e59501, -82px 82px #e59501, -83px 83px #e59501, -84px 84px #e59501, -85px 85px #e59501; } - .button-longshadow-left.button-highlight:active, .button-longshadow-left.button-highlight.active, .button-longshadow-left.button-highlight.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow-left.button-caution { - text-shadow: 0px 0px #ff1022, -1px 1px #ff1022, -2px 2px #ff1022, -3px 3px #ff1022, -4px 4px #ff1022, -5px 5px #ff1022, -6px 6px #ff1022, -7px 7px #ff1022, -8px 8px #ff1022, -9px 9px #ff1022, -10px 10px #ff1022, -11px 11px #ff1022, -12px 12px #ff1022, -13px 13px #ff1022, -14px 14px #ff1022, -15px 15px #ff1022, -16px 16px #ff1022, -17px 17px #ff1022, -18px 18px #ff1022, -19px 19px #ff1022, -20px 20px #ff1022, -21px 21px #ff1022, -22px 22px #ff1022, -23px 23px #ff1022, -24px 24px #ff1022, -25px 25px #ff1022, -26px 26px #ff1022, -27px 27px #ff1022, -28px 28px #ff1022, -29px 29px #ff1022, -30px 30px #ff1022, -31px 31px #ff1022, -32px 32px #ff1022, -33px 33px #ff1022, -34px 34px #ff1022, -35px 35px #ff1022, -36px 36px #ff1022, -37px 37px #ff1022, -38px 38px #ff1022, -39px 39px #ff1022, -40px 40px #ff1022, -41px 41px #ff1022, -42px 42px #ff1022, -43px 43px #ff1022, -44px 44px #ff1022, -45px 45px #ff1022, -46px 46px #ff1022, -47px 47px #ff1022, -48px 48px #ff1022, -49px 49px #ff1022, -50px 50px #ff1022, -51px 51px #ff1022, -52px 52px #ff1022, -53px 53px #ff1022, -54px 54px #ff1022, -55px 55px #ff1022, -56px 56px #ff1022, -57px 57px #ff1022, -58px 58px #ff1022, -59px 59px #ff1022, -60px 60px #ff1022, -61px 61px #ff1022, -62px 62px #ff1022, -63px 63px #ff1022, -64px 64px #ff1022, -65px 65px #ff1022, -66px 66px #ff1022, -67px 67px #ff1022, -68px 68px #ff1022, -69px 69px #ff1022, -70px 70px #ff1022, -71px 71px #ff1022, -72px 72px #ff1022, -73px 73px #ff1022, -74px 74px #ff1022, -75px 75px #ff1022, -76px 76px #ff1022, -77px 77px #ff1022, -78px 78px #ff1022, -79px 79px #ff1022, -80px 80px #ff1022, -81px 81px #ff1022, -82px 82px #ff1022, -83px 83px #ff1022, -84px 84px #ff1022, -85px 85px #ff1022; } - .button-longshadow-left.button-caution:active, .button-longshadow-left.button-caution.active, .button-longshadow-left.button-caution.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - .button-longshadow-left.button-royal { - text-shadow: 0px 0px #5246e2, -1px 1px #5246e2, -2px 2px #5246e2, -3px 3px #5246e2, -4px 4px #5246e2, -5px 5px #5246e2, -6px 6px #5246e2, -7px 7px #5246e2, -8px 8px #5246e2, -9px 9px #5246e2, -10px 10px #5246e2, -11px 11px #5246e2, -12px 12px #5246e2, -13px 13px #5246e2, -14px 14px #5246e2, -15px 15px #5246e2, -16px 16px #5246e2, -17px 17px #5246e2, -18px 18px #5246e2, -19px 19px #5246e2, -20px 20px #5246e2, -21px 21px #5246e2, -22px 22px #5246e2, -23px 23px #5246e2, -24px 24px #5246e2, -25px 25px #5246e2, -26px 26px #5246e2, -27px 27px #5246e2, -28px 28px #5246e2, -29px 29px #5246e2, -30px 30px #5246e2, -31px 31px #5246e2, -32px 32px #5246e2, -33px 33px #5246e2, -34px 34px #5246e2, -35px 35px #5246e2, -36px 36px #5246e2, -37px 37px #5246e2, -38px 38px #5246e2, -39px 39px #5246e2, -40px 40px #5246e2, -41px 41px #5246e2, -42px 42px #5246e2, -43px 43px #5246e2, -44px 44px #5246e2, -45px 45px #5246e2, -46px 46px #5246e2, -47px 47px #5246e2, -48px 48px #5246e2, -49px 49px #5246e2, -50px 50px #5246e2, -51px 51px #5246e2, -52px 52px #5246e2, -53px 53px #5246e2, -54px 54px #5246e2, -55px 55px #5246e2, -56px 56px #5246e2, -57px 57px #5246e2, -58px 58px #5246e2, -59px 59px #5246e2, -60px 60px #5246e2, -61px 61px #5246e2, -62px 62px #5246e2, -63px 63px #5246e2, -64px 64px #5246e2, -65px 65px #5246e2, -66px 66px #5246e2, -67px 67px #5246e2, -68px 68px #5246e2, -69px 69px #5246e2, -70px 70px #5246e2, -71px 71px #5246e2, -72px 72px #5246e2, -73px 73px #5246e2, -74px 74px #5246e2, -75px 75px #5246e2, -76px 76px #5246e2, -77px 77px #5246e2, -78px 78px #5246e2, -79px 79px #5246e2, -80px 80px #5246e2, -81px 81px #5246e2, -82px 82px #5246e2, -83px 83px #5246e2, -84px 84px #5246e2, -85px 85px #5246e2; } - .button-longshadow-left.button-royal:active, .button-longshadow-left.button-royal.active, .button-longshadow-left.button-royal.is-active { - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); } - -/* -* Button Sizes -* -* This file creates the various button sizes -* (ex. .button-large, .button-small, etc.) -*/ -.button-giant { - font-size: 28px; - height: 70px; - line-height: 70px; - padding: 0 70px; } - -.button-jumbo { - font-size: 24px; - height: 60px; - line-height: 60px; - padding: 0 60px; } - -.button-large { - font-size: 20px; - height: 50px; - line-height: 50px; - padding: 0 50px; } - -.button-normal { - font-size: 16px; - height: 40px; - line-height: 40px; - padding: 0 30px; } - -.button-small { - font-size: 12px; - height: 30px; - line-height: 30px; - padding: 0 20px; } - -.button-tiny { - font-size: 9.6px; - height: 24px; - line-height: 24px; - padding: 0 24px; } diff --git a/api/src/main/resources/static/plug-in/colResizable.jquery.plugin/colResizable-1.5.source.js b/api/src/main/resources/static/plug-in/colResizable.jquery.plugin/colResizable-1.5.source.js deleted file mode 100644 index 22d335671fb97edcd5a544951a7cad2cfdefae21..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/colResizable.jquery.plugin/colResizable-1.5.source.js +++ /dev/null @@ -1,367 +0,0 @@ -/** - _ _____ _ _ _ - | | __ \ (_) | | | | - ___ ___ | | |__) |___ ___ _ ______ _| |__ | | ___ - / __/ _ \| | _ // _ \/ __| |_ / _` | '_ \| |/ _ \ - | (_| (_) | | | \ \ __/\__ \ |/ / (_| | |_) | | __/ - \___\___/|_|_| \_\___||___/_/___\__,_|_.__/|_|\___| - - v 1.5 - a jQuery plug-in by Alvaro Prieto Lauroba - - Licences: MIT & GPL - Feel free to use or modify this plugin as far as my full name is kept - - If you are going to use this plug-in in production environments it is - strongly recommended to use its minified version: colResizable.min.js - -*/ - -(function($){ - - var d = $(document); //window object - var h = $("head"); //head object - var drag = null; //reference to the current grip that is being dragged - var tables = []; //array of the already processed tables (table.id as key) - var count = 0; //internal count to create unique IDs when needed. - - //common strings for packing - var ID = "id"; - var PX = "px"; - var SIGNATURE ="JColResizer"; - var FLEX = "JCLRFlex"; - - //short-cuts - var I = parseInt; - var M = Math; - var ie = navigator.userAgent.indexOf('Trident/4.0')>0; - var S; - try{S = sessionStorage;}catch(e){} //Firefox crashes when executed as local file system - - //append required CSS rules - h.append(""); - - - /** - * Function to allow column resizing for table objects. It is the starting point to apply the plugin. - * @param {DOM node} tb - reference to the DOM table object to be enhanced - * @param {Object} options - some customization values - */ - var init = function( tb, options){ - var t = $(tb); //the table object is wrapped - t.opt = options; - if(t.opt.disable) return destroy(t); //the user is asking to destroy a previously colResized table - var id = t.id = t.attr(ID) || SIGNATURE+count++; //its id is obtained, if null new one is generated - t.p = t.opt.postbackSafe; //short-cut to detect postback safe - if(!t.is("table") || tables[id] && !t.opt.partialRefresh) return; //if the object is not a table or if it was already processed then it is ignored. - t.addClass(SIGNATURE).attr(ID, id).before('
                      '); //the grips container object is added. Signature class forces table rendering in fixed-layout mode to prevent column's min-width - t.g = []; t.c = []; t.w = t.width(); t.gc = t.prev(); t.f=t.opt.fixed; //t.c and t.g are arrays of columns and grips respectively - if(options.marginLeft) t.gc.css("marginLeft", options.marginLeft); //if the table contains margins, it must be specified - if(options.marginRight) t.gc.css("marginRight", options.marginRight); //since there is no (direct) way to obtain margin values in its original units (%, em, ...) - t.cs = I(ie? tb.cellSpacing || tb.currentStyle.borderSpacing :t.css('border-spacing'))||2; //table cellspacing (not even jQuery is fully cross-browser) - t.b = I(ie? tb.border || tb.currentStyle.borderLeftWidth :t.css('border-left-width'))||1; //outer border width (again cross-browser issues) - // if(!(tb.style.width || tb.width)) t.width(t.width()); //I am not an IE fan at all, but it is a pity that only IE has the currentStyle attribute working as expected. For this reason I can not check easily if the table has an explicit width or if it is rendered as "auto" - tables[id] = t; //the table object is stored using its id as key - createGrips(t); //grips are created - - }; - - - /** - * This function allows to remove any enhancements performed by this plugin on a previously processed table. - * @param {jQuery ref} t - table object - */ - var destroy = function(t){ - var id=t.attr(ID), t=tables[id]; //its table object is found - if(!t||!t.is("table")) return; //if none, then it wasn't processed - t.removeClass(SIGNATURE+" "+FLEX).gc.remove(); //class and grips are removed - delete tables[id]; //clean up data - }; - - - /** - * Function to create all the grips associated with the table given by parameters - * @param {jQuery ref} t - table object - */ - var createGrips = function(t){ - - var th = t.find(">thead>tr>th,>thead>tr>td"); //if table headers are specified in its semantically correct tag, are obtained - if(!th.length) th = t.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td"); //but headers can also be included in different ways - th = th.filter(":visible"); //filter invisible columns - t.cg = t.find("col"); //a table can also contain a colgroup with col elements - t.ln = th.length; //table length is stored - if(t.p && S && S[t.id])memento(t,th); //if 'postbackSafe' is enabled and there is data for the current table, its coloumn layout is restored - th.each(function(i){ //iterate through the table column headers - var c = $(this); //jquery wrap for the current column - var g = $(t.gc.append('
                      ')[0].lastChild); //add the visual node to be used as grip - g.append(t.opt.gripInnerHtml).append('
                      '); - if(i == t.ln-1){ - g.addClass("JCLRLastGrip"); - if(t.f) g.html(""); - } - g.bind('touchstart mousedown', onGripMouseDown); //bind the mousedown event to start dragging - - g.t = t; g.i = i; g.c = c; c.w =c.width(); //some values are stored in the grip's node data - t.g.push(g); t.c.push(c); //the current grip and column are added to its table object - c.width(c.w).removeAttr("width"); //the width of the column is converted into pixel-based measurements - g.data(SIGNATURE, {i:i, t:t.attr(ID), last: i == t.ln-1}); //grip index and its table name are stored in the HTML - }); - t.cg.removeAttr("width"); //remove the width attribute from elements in the colgroup - syncGrips(t); //the grips are positioned according to the current table layout - //there is a small problem, some cells in the table could contain dimension values interfering with the - //width value set by this plugin. Those values are removed - t.find('td, th').not(th).not('table th, table td').each(function(){ - $(this).removeAttr('width'); //the width attribute is removed from all table cells which are not nested in other tables and dont belong to the header - }); - if(!t.f){ - t.removeAttr('width').addClass(FLEX); //if not fixed, let the table grow as needed - } - - - }; - - - /** - * Function to allow the persistence of columns dimensions after a browser postback. It is based in - * the HTML5 sessionStorage object, which can be emulated for older browsers using sessionstorage.js - * @param {jQuery ref} t - table object - * @param {jQuery ref} th - reference to the first row elements (only set in deserialization) - */ - var memento = function(t, th){ - var w,m=0,i=0,aux =[],tw; - if(th){ //in deserialization mode (after a postback) - t.cg.removeAttr("width"); - if(t.opt.flush){ S[t.id] =""; return;} //if flush is activated, stored data is removed - w = S[t.id].split(";"); //column widths is obtained - tw = w[t.ln+1]; - if(!t.f && tw) t.width(tw); //it not fixed and table width data available its size is restored - for(;i*{cursor:"+ t.opt.dragCursor +"!important}"); //change the mouse cursor - g.addClass(t.opt.draggingClass); //add the dragging class (to allow some visual feedback) - drag = g; //the current grip is stored as the current dragging object - if(t.c[o.i].l) for(var i=0,c; i - - - - Export DataGrid - jQuery EasyUI Demo - - - - - - - - - - -

                      Export DataGrid

                      -

                      The PDF document is created using the pdfmake library.

                      - - - - - - - - - - - - -
                      Item IDProductList PriceUnit CostAttributeStatus
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/easyui/datagrid-export/datagrid-export.html b/api/src/main/resources/static/plug-in/easyui/datagrid-export/datagrid-export.html deleted file mode 100644 index 728ba5192b019ca3a9b5c9a38dccf64978e3a03f..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/easyui/datagrid-export/datagrid-export.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - Export DataGrid - jQuery EasyUI Demo - - - - - - - - -

                      Export DataGrid

                      - - - - - - - - - - - - -
                      Item IDProductList PriceUnit CostAttributeStatus
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/easyui/datagrid-export/datagrid-export.js b/api/src/main/resources/static/plug-in/easyui/datagrid-export/datagrid-export.js deleted file mode 100644 index e08748d6aea4ef8f980060e5d8ea343fa60c7991..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/easyui/datagrid-export/datagrid-export.js +++ /dev/null @@ -1,152 +0,0 @@ -(function($){ - function getRows(target){ - var state = $(target).data('datagrid'); - if (state.filterSource){ - return state.filterSource.rows; - } else { - return state.data.rows; - } - } - function toHtml(target, rows){ - rows = rows || getRows(target); - var dg = $(target); - var data = ['']; - var fields = dg.datagrid('getColumnFields',true).concat(dg.datagrid('getColumnFields',false)); - var trStyle = 'height:32px'; - var tdStyle0 = 'vertical-align:middle;padding:0 4px'; - data.push(''); - for(var i=0; i'+col.title+''); - } - data.push(''); - $.map(rows, function(row){ - data.push(''); - for(var i=0; i'+row[field]+'' - ); - } - data.push(''); - }); - data.push('
                      '); - return data.join(''); - } - - function toArray(target, rows){ - rows = rows || getRows(target); - var dg = $(target); - var fields = dg.datagrid('getColumnFields',true).concat(dg.datagrid('getColumnFields',false)); - var data = []; - var r = []; - for(var i=0; i' + - '' + - '' + - '' + - ''+title+'' + - '' + - '' + toHtml(target, rows) + '' + - ''; - document.write(content); - document.close(); - newWindow.print(); - } - - function b64toBlob(data){ - var sliceSize = 512; - var chars = atob(data); - var byteArrays = []; - for(var offset=0; offset').appendTo('body'); - alink[0].href = uri + data; - alink[0].download = filename; - alink[0].click(); - alink.remove(); - } - } - - $.extend($.fn.datagrid.methods, { - toHtml: function(jq, rows){ - return toHtml(jq[0], rows); - }, - toArray: function(jq, rows){ - return toArray(jq[0], rows); - }, - toExcel: function(jq, param){ - return jq.each(function(){ - toExcel(this, param); - }); - }, - print: function(jq, param){ - return jq.each(function(){ - print(this, param); - }); - } - }); -})(jQuery); diff --git a/api/src/main/resources/static/plug-in/easyui/jquery-easyui-color/color.html b/api/src/main/resources/static/plug-in/easyui/jquery-easyui-color/color.html deleted file mode 100644 index a289bc13549cd22c742b59e0d6355d8b6a55dfc2..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/easyui/jquery-easyui-color/color.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Color - jQuery EasyUI - - - - - - - -

                      Color

                      - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/easyui/jquery-easyui-color/jquery.color.js b/api/src/main/resources/static/plug-in/easyui/jquery-easyui-color/jquery.color.js deleted file mode 100644 index 89422f4a287c4f03abeca28aba5e4264abf12803..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/easyui/jquery-easyui-color/jquery.color.js +++ /dev/null @@ -1,112 +0,0 @@ -(function($){ - $(function(){ - if (!$('#easyui-color-style').length){ - $('head').append( - '' - ); - } - }); - - function create(target){ - var opts = $.data(target, 'color').options; - $(target).combo($.extend({}, opts, { - panelWidth: opts.cellWidth*8+2, - panelHeight: opts.cellHeight*7+2, - onShowPanel: function(){ - var p = $(this).combo('panel'); - if (p.is(':empty')){ - var colors = [ - "0,0,0","68,68,68","102,102,102","153,153,153","204,204,204","238,238,238","243,243,243","255,255,255", - "244,204,204","252,229,205","255,242,204","217,234,211","208,224,227","207,226,243","217,210,233","234,209,220", - "234,153,153","249,203,156","255,229,153","182,215,168","162,196,201","159,197,232","180,167,214","213,166,189", - "224,102,102","246,178,107","255,217,102","147,196,125","118,165,175","111,168,220","142,124,195","194,123,160", - "204,0,0","230,145,56","241,194,50","106,168,79","69,129,142","61,133,198","103,78,167","166,77,121", - "153,0,0","180,95,6","191,144,0","56,118,29","19,79,92","11,83,148","53,28,117","116,27,71", - "102,0,0","120,63,4","127,96,0","39,78,19","12,52,61","7,55,99","32,18,77","76,17,48" - ]; - for(var i=0; i').appendTo(p); - a.css('backgroundColor', 'rgb('+colors[i]+')'); - } - var cells = p.find('.color-cell'); - cells._outerWidth(opts.cellWidth)._outerHeight(opts.cellHeight); - cells.bind('click.color', function(e){ - var color = $(this).css('backgroundColor'); - $(target).color('setValue', color); - $(target).combo('hidePanel'); - }); - } - } - })); - if (opts.value){ - $(target).color('setValue', opts.value); - } - } - - $.fn.color = function(options, param){ - if (typeof options == 'string'){ - var method = $.fn.color.methods[options]; - if (method){ - return method(this, param); - } else { - return this.combo(options, param); - } - } - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'color'); - if (state){ - $.extend(state.options, options); - } else { - state = $.data(this, 'color', { - options: $.extend({}, $.fn.color.defaults, $.fn.color.parseOptions(this), options) - }); - } - create(this); - }); - }; - - $.fn.color.methods = { - options: function(jq){ - return jq.data('color').options; - }, - setValue: function(jq, value){ - return jq.each(function(){ - var tb = $(this).combo('textbox').css('backgroundColor', value); - value = tb.css('backgroundColor'); - if (value.indexOf('rgb') >= 0){ - var bg = value.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); - value = '#' + hex(bg[1]) + hex(bg[2]) + hex(bg[3]); - } - $(this).combo('setValue', value).combo('setText', value); - - function hex(x){ - return ('0'+parseInt(x).toString(16)).slice(-2); - } - }) - }, - clear: function(jq){ - return jq.each(function(){ - $(this).combo('clear'); - $(this).combo('textbox').css('backgroundColor', ''); - }); - } - }; - - $.fn.color.parseOptions = function(target){ - return $.extend({}, $.fn.combo.parseOptions(target), { - - }); - }; - - $.fn.color.defaults = $.extend({}, $.fn.combo.defaults, { - editable: false, - cellWidth: 20, - cellHeight: 20 - }); - - $.parser.plugins.push('color'); -})(jQuery); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/README.md b/api/src/main/resources/static/plug-in/neditor/2.1.10/README.md deleted file mode 100644 index dab8c932125f233e36390b89bec98acf494b2552..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/README.md +++ /dev/null @@ -1,156 +0,0 @@ - -

                      - - -

                      - -## 新版发布 - -2.1 发布,此次版本移除了后端相关代码,纯 ajax 提交,请配置 `neditor.config.js` `neditor.service.js`,支持各种后端或者云存储。 - -### 关于 HTTPS - -使用了 [又拍云CDN](https://console.upyun.com/register/?invite=r17EYO3BW) 服务,支持跨域 和 https。 - -如果有需要,也可将下面域名改成自己的。 -``` -imgbaidu.b0.upaiyun.com -tingapi.b0.upaiyun.com -``` -Neditor 是我们团队基于 Ueditor 的一款富文本编辑器。 -不论从功能还是从其它各方面来讲, Ueditor 都是一款无以替代的编辑器产品。 -只是已经不符合现代化样式的需求,于是我们修改它的样式,实现了这样的效果: - -![image](https://www.notadd.com/src/neditor.webp) - -## 第一步:下载编辑器 - -**方式一:完整安装包 (推荐)** - -* [Neditor.tar.xz](https://www.notadd.com/download/neditor/Neditor-next-master.tar.xz) - -**方式二: npm安装** - -`npm i @notadd/neditor -S` - -**方式三:编译安装** - -```shell -git clone https://github.com/notadd/neditor.git -npm install -npm run build -``` - -### 第二步:在浏览器打开 index.html ### - -进入到目录 `dist` , 使用浏览器打开文件 `index.html` 。 - -如果看到了下面这样的编辑器,恭喜你,初次部署成功! - -![部署成功](https://www.notadd.com/src/neditor-demo.webp) - -## 相关版本 - -[Angular 版 Neditor](https://github.com/notadd/ngx-neditor) - -其他版本待添加 - -### 自定义的参数 - -编辑器有很多可自定义的参数项,在实例化的时候可以传入给编辑器: - -```javascript -var ue = UE.getEditor('container', { - autoHeight: false -}); -``` - -配置项也可以通过 `neditor.config.js` 文件修改,具体的配置方法请看 [前端配置项说明](http://fex.baidu.com/ueditor/#start-config1.4 前端配置项说明.md)、[后端配置项说明](http://fex.baidu.com/ueditor/#server-config) - -### 编辑器图片、视频、涂鸦、附件上传service - -编辑器上传逻辑单独在 `neditor.service.js` 文件配置,具体的配置方法见注释 - -### 设置和读取编辑器的内容 - -通 getContent 和 setContent 方法可以设置和读取编辑器的内容 - -```javascript -var ue = UE.getContent(); -ue.ready(function(){ - //设置编辑器的内容 - ue.setContent('hello'); - //获取html内容,返回:

                      hello

                      - var html = ue.getContent(); - //获取纯文本内容,返回: hello - var txt = ue.getContentTxt(); -}); -``` - -Ueditor 的更多API请看[API 文档](http://ueditor.baidu.com/doc "ueditor API 文档") - -## 下载地址 - -Neditor 码云: [http://gitee.com/notadd/neditor](http://gitee.com/notadd/neditor "Neditor github 地址") - -Neditor github 地址:[http://github.com/notadd/neditor](http://github.com/notadd/neditor "Neditor github 地址") - -## 相关链接 - -Ueditor 官网:[http://ueditor.baidu.com](http://ueditor.baidu.com "ueditor 官网") - -Ueditor API 文档:[http://ueditor.baidu.com/doc](http://ueditor.baidu.com/doc "ueditor API 文档") - - - -## 详细文档 - -Ueditor 文档:[http://fex.baidu.com/ueditor/](http://fex.baidu.com/ueditor/) - -注: 对IE8以下版本不再承诺兼容 - -## 联系我们 ## - -Neditor官方交流群:257753500 - -QQ 群: 321735506 - -[issue](http://github.com/notadd/neditor/issues) - -## 捐赠 - - -欢迎通过 [捐赠](https://git.oschina.net/notadd/neditor?donate=true) 支持此项目的发展。 - -## Todo - -### 2.x - -- [x] 将上传封装为 service ,支持非 GraphQL 接口。 -- [ ] 细节样式修改(美化) -- [ ] word 内图片自动上传 -- [ ] 粘贴图片转为本地图片 - -### 3.0 - -- [ ] 使用 Typescript 重构 -- [ ] 草稿箱功能与离线保存 -- [ ] service worker 特性 -- [ ] 实现 2.0 的大部分功能 - -## 其他项目:Notadd - -https://github.com/notadd/notadd - - - ## 感谢提供赞助: - - -   - -**UCloud 云服务器限时优惠 — Notadd 项目用户福利** - -[【基础型】1核2G 1M带宽 50GB SSD数据盘 低至250元/年](https://www.ucloud.cn/site/active/gift.html?ytag=notadd ) - -[【标准型】2核4G 1M带宽 50GB SSD数据盘 低至550元/年](https://www.ucloud.cn/site/active/gift.html?ytag=notadd ) - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/anchor/anchor.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/anchor/anchor.html deleted file mode 100644 index bacffe94d7d11c7771dccd351411ca04f83d36e4..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/anchor/anchor.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - -
                      - -
                      - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/attachment.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/attachment.css deleted file mode 100644 index 15f49edde77447afcf9662bbe221ed18fe15dabc..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/attachment.css +++ /dev/null @@ -1,682 +0,0 @@ -@charset "utf-8"; -/* dialog样式 */ -.wrapper { - zoom: 1; - width: 630px; - *width: 626px; - height: 380px; - margin: 0 auto; - padding: 10px; - position: relative; - font-family: sans-serif; -} - -/*tab样式框大小*/ -.tabhead { - float:left; -} -.tabbody { - width: 100%; - height: 346px; - position: relative; - clear: both; -} - -.tabbody .panel { - position: absolute; - width: 0; - height: 0; - background: #fff; - overflow: hidden; - display: none; -} - -.tabbody .panel.focus { - width: 100%; - height: 346px; - display: block; -} - -/* 上传附件 */ -.tabbody #upload.panel { - width: 0; - height: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); - background: #fff; - display: block; -} - -.tabbody #upload.panel.focus { - width: 100%; - height: 346px; - display: block; - clip: auto; -} - -#upload .queueList { - margin: 0; - width: 100%; - height: 100%; - position: absolute; - overflow: hidden; -} - -#upload p { - margin: 0; -} - -.element-invisible { - width: 0 !important; - height: 0 !important; - border: 0; - padding: 0; - margin: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); -} - -#upload .placeholder { - margin: 10px; - /*border: 2px dashed #e6e6e6;*/ - height: 172px; - padding-top: 150px; - text-align: center; - /*background: url(./images/image.png) center 70px no-repeat;*/ - background-color: #f3f3f3; - color: #cccccc; - font-size: 18px; - position: relative; - top:0; - *top: 10px; -} - -#upload .placeholder .webuploader-pick { - font-size: 16px; - background: #f3f3f3; - border-radius: 3px; - line-height: 44px; - padding: 0 30px; - color: #646464; - display: inline-block; - margin: 0 auto 20px auto; - cursor: pointer; - /* box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); */ - border: 1px solid #ccc; -} - -#upload .placeholder .webuploader-pick-hover { - border: 1px solid #00a2d4; - color: #00a2d4; -} - - -#filePickerContainer { - text-align: center; -} - -#upload .placeholder .flashTip { - color: #666666; - font-size: 12px; - position: absolute; - width: 100%; - text-align: center; - bottom: 20px; -} - -#upload .placeholder .flashTip a { - color: #0785d1; - text-decoration: none; -} - -#upload .placeholder .flashTip a:hover { - text-decoration: underline; -} - -#upload .placeholder.webuploader-dnd-over { - border-color: #999999; -} - -#upload .filelist { - list-style: none; - margin: 0; - padding: 0; - overflow-x: hidden; - overflow-y: auto; - position: relative; - height: 300px; -} - -#upload .filelist:after { - content: ''; - display: block; - width: 0; - height: 0; - overflow: hidden; - clear: both; -} - -#upload .filelist li { - width: 113px; - height: 113px; - background: url(./images/bg.png); - text-align: center; - margin: 9px 0 0 9px; - *margin: 6px 0 0 6px; - position: relative; - display: block; - float: left; - overflow: hidden; - font-size: 12px; -} - -#upload .filelist li p.log { - position: relative; - top: -45px; -} - -#upload .filelist li p.title { - position: absolute; - top: 0; - left: 0; - width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - top: 5px; - text-indent: 5px; - text-align: left; -} - -#upload .filelist li p.progress { - position: absolute; - width: 100%; - bottom: 0; - left: 0; - height: 8px; - overflow: hidden; - z-index: 50; - margin: 0; - border-radius: 0; - background: none; - -webkit-box-shadow: 0 0 0; -} - -#upload .filelist li p.progress span { - display: none; - overflow: hidden; - width: 0; - height: 100%; - background: #1483d8 url(./images/progress.png) repeat-x; - - -webit-transition: width 200ms linear; - -moz-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; - transition: width 200ms linear; - - -webkit-animation: progressmove 2s linear infinite; - -moz-animation: progressmove 2s linear infinite; - -o-animation: progressmove 2s linear infinite; - -ms-animation: progressmove 2s linear infinite; - animation: progressmove 2s linear infinite; - - -webkit-transform: translateZ(0); -} - -@-webkit-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@-moz-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -#upload .filelist li p.imgWrap { - position: relative; - z-index: 2; - line-height: 113px; - vertical-align: middle; - overflow: hidden; - width: 113px; - height: 113px; - - -webkit-transform-origin: 50% 50%; - -moz-transform-origin: 50% 50%; - -o-transform-origin: 50% 50%; - -ms-transform-origin: 50% 50%; - transform-origin: 50% 50%; - - -webit-transition: 200ms ease-out; - -moz-transition: 200ms ease-out; - -o-transition: 200ms ease-out; - -ms-transition: 200ms ease-out; - transition: 200ms ease-out; -} -#upload .filelist li p.imgWrap.notimage { - margin-top: 0; - width: 111px; - height: 111px; - border: 1px #eeeeee solid; -} -#upload .filelist li p.imgWrap.notimage i.file-preview { - margin-top: 15px; -} - -#upload .filelist li img { - width: 100%; -} - -#upload .filelist li p.error { - background: #f43838; - color: #fff; - position: absolute; - bottom: 0; - left: 0; - height: 28px; - line-height: 28px; - width: 100%; - z-index: 100; - display:none; -} - -#upload .filelist li .success { - display: block; - position: absolute; - left: 0; - bottom: 0; - height: 40px; - width: 100%; - z-index: 200; - background: url(./images/success.png) no-repeat right bottom; - background-image: url(./images/success.gif) \9; -} - -#upload .filelist li.filePickerBlock { - width: 113px; - height: 113px; - background: url(../fonts/images/addfile.svg) no-repeat center; - border: 1px solid #eeeeee; - border-radius: 0; -} -#upload .filelist li.filePickerBlock div.webuploader-pick { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - opacity: 0; - background: none; - font-size: 0; -} - -#upload .filelist div.file-panel { - position: absolute; - height: 0; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0; - background: rgba(0, 0, 0, 0.5); - width: 100%; - top: 0; - left: 0; - overflow: hidden; - z-index: 300; -} - -#upload .filelist div.file-panel span { - width: 24px; - height: 24px; - display: inline; - float: right; - text-indent: -9999px; - overflow: hidden; - background: url(./images/icons.png) no-repeat; - background: url(./images/icons.gif) no-repeat \9; - margin: 5px 1px 1px; - cursor: pointer; - -webkit-tap-highlight-color: rgba(0,0,0,0); - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -#upload .filelist div.file-panel span.rotateLeft { - display:none; - background-position: 0 -24px; -} - -#upload .filelist div.file-panel span.rotateLeft:hover { - background-position: 0 0; -} - -#upload .filelist div.file-panel span.rotateRight { - display:none; - background-position: -24px -24px; -} - -#upload .filelist div.file-panel span.rotateRight:hover { - background-position: -24px 0; -} - -#upload .filelist div.file-panel span.cancel { - background-position: -48px -24px; -} - -#upload .filelist div.file-panel span.cancel:hover { - background-position: -48px 0; -} - -#upload .statusBar { - height: 45px; - border-bottom: 1px solid #dadada; - margin: 0 10px; - padding: 0; - line-height: 45px; - vertical-align: middle; - position: relative; -} - -#upload .statusBar .progress { - border: 1px solid #1483d8; - width: 198px; - background: #fff; - height: 18px; - position: absolute; - top: 12px; - display: none; - text-align: center; - line-height: 18px; - color: #6dbfff; - margin: 0 10px 0 0; -} -#upload .statusBar .progress span.percentage { - width: 0; - height: 100%; - left: 0; - top: 0; - background: #1483d8; - position: absolute; -} -#upload .statusBar .progress span.text { - position: relative; - z-index: 10; -} - -#upload .statusBar .info { - display: inline-block; - font-size: 14px; - color: #666666; -} - -#upload .statusBar .btns { - position: absolute; - top: 7px; - right: 0; - line-height: 30px; -} - -#filePickerBtn { - display: inline-block; - float: left; -} -#upload .statusBar .btns .webuploader-pick, -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-uploading, -#upload .statusBar .btns .uploadBtn.state-paused { - background: #ffffff; - border: 1px solid #cfcfcf; - color: #565656; - padding: 0 18px; - display: inline-block; - border-radius: 3px; - margin-left: 10px; - cursor: pointer; - font-size: 14px; - float: left; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -#upload .statusBar .btns .webuploader-pick-hover, -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-uploading:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover { - background: #f0f0f0; -} - -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-paused{ - background: #00b7ee; - color: #fff; - border-color: transparent; -} -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover{ - background: #00a2d4; -} - -#upload .statusBar .btns .uploadBtn.disabled { - pointer-events: none; - filter:alpha(opacity=60); - -moz-opacity:0.6; - -khtml-opacity: 0.6; - opacity: 0.6; -} - - - -/* 图片管理样式 */ -#online { - width: 100%; - height: 336px; - padding: 10px 0 0 0; -} -#online #fileList{ - width: 100%; - height: 100%; - overflow-x: hidden; - overflow-y: auto; - position: relative; -} -#online ul { - display: block; - list-style: none; - margin: 0; - padding: 0; -} -#online li { - float: left; - display: block; - list-style: none; - padding: 0; - width: 113px; - height: 113px; - margin: 0 0 9px 9px; - *margin: 0 0 6px 6px; - background-color: #eee; - overflow: hidden; - cursor: pointer; - position: relative; -} -#online li.clearFloat { - float: none; - clear: both; - display: block; - width:0; - height:0; - margin: 0; - padding: 0; -} -#online li img { - cursor: pointer; -} -#online li div.file-wrapper { - cursor: pointer; - position: absolute; - display: block; - width: 111px; - height: 111px; - border: 1px solid #eee; - background: url("./images/bg.png") repeat; -} -#online li div span.file-title{ - display: block; - padding: 0 3px; - margin: 3px 0 0 0; - font-size: 12px; - height: 15px; - color: #555555; - text-align: center; - width: 107px; - white-space: nowrap; - word-break: break-all; - overflow: hidden; - text-overflow: ellipsis; -} -#online li .icon { - cursor: pointer; - width: 113px; - height: 113px; - position: absolute; - top: 0; - left: 0; - z-index: 2; - border: 0; - background-repeat: no-repeat; -} -#online li .icon:hover { - width: 107px; - height: 107px; - border: 3px solid #1094fa; -} -#online li.selected .icon { - background-image: url(images/success.png); - background-image: url(images/success.gif) \9; - background-position: 75px 75px; -} -#online li.selected .icon:hover { - width: 107px; - height: 107px; - border: 3px solid #1094fa; - background-position: 72px 72px; -} - - -/* 在线文件的文件预览图标 */ -i.file-preview { - display: block; - margin: 10px auto; - width: 70px; - height: 70px; - background-image: url("./images/file-icons.png"); - background-image: url("./images/file-icons.gif") \9; - background-position: -140px center; - background-repeat: no-repeat; -} -i.file-preview.file-type-dir{ - background-position: 0 center; -} -i.file-preview.file-type-file{ - background-position: -140px center; -} -i.file-preview.file-type-filelist{ - background-position: -210px center; -} -i.file-preview.file-type-zip, -i.file-preview.file-type-rar, -i.file-preview.file-type-7z, -i.file-preview.file-type-tar, -i.file-preview.file-type-gz, -i.file-preview.file-type-bz2{ - background-position: -280px center; -} -i.file-preview.file-type-xls, -i.file-preview.file-type-xlsx{ - background-position: -350px center; -} -i.file-preview.file-type-doc, -i.file-preview.file-type-docx{ - background-position: -420px center; -} -i.file-preview.file-type-ppt, -i.file-preview.file-type-pptx{ - background-position: -490px center; -} -i.file-preview.file-type-vsd{ - background-position: -560px center; -} -i.file-preview.file-type-pdf{ - background-position: -630px center; -} -i.file-preview.file-type-txt, -i.file-preview.file-type-md, -i.file-preview.file-type-json, -i.file-preview.file-type-htm, -i.file-preview.file-type-xml, -i.file-preview.file-type-html, -i.file-preview.file-type-js, -i.file-preview.file-type-css, -i.file-preview.file-type-php, -i.file-preview.file-type-jsp, -i.file-preview.file-type-asp{ - background-position: -700px center; -} -i.file-preview.file-type-apk{ - background-position: -770px center; -} -i.file-preview.file-type-exe{ - background-position: -840px center; -} -i.file-preview.file-type-ipa{ - background-position: -910px center; -} -i.file-preview.file-type-mp4, -i.file-preview.file-type-swf, -i.file-preview.file-type-mkv, -i.file-preview.file-type-avi, -i.file-preview.file-type-flv, -i.file-preview.file-type-mov, -i.file-preview.file-type-mpg, -i.file-preview.file-type-mpeg, -i.file-preview.file-type-ogv, -i.file-preview.file-type-webm, -i.file-preview.file-type-rm, -i.file-preview.file-type-rmvb{ - background-position: -980px center; -} -i.file-preview.file-type-ogg, -i.file-preview.file-type-wav, -i.file-preview.file-type-wmv, -i.file-preview.file-type-mid, -i.file-preview.file-type-mp3{ - background-position: -1050px center; -} -i.file-preview.file-type-jpg, -i.file-preview.file-type-jpeg, -i.file-preview.file-type-gif, -i.file-preview.file-type-bmp, -i.file-preview.file-type-png, -i.file-preview.file-type-psd{ - background-position: -140px center; -} diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/attachment.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/attachment.html deleted file mode 100644 index f698f192c320a7316298b720d08607459ed61fca..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/attachment.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - neditor图片对话框 - - - - - - - - - - - - - - -
                      -
                      - - -
                      -
                      - -
                      -
                      -
                      -
                      - 0% - -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                        -
                      • -
                      -
                      -
                      - - -
                      -
                      -
                      - -
                      -
                      - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/attachment.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/attachment.js deleted file mode 100644 index d9598b049d7a31250d0a455ea82cd0df161418cd..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/attachment.js +++ /dev/null @@ -1,775 +0,0 @@ -/** - * User: Jinqn - * Date: 14-04-08 - * Time: 下午16:34 - * 上传图片对话框逻辑代码,包括tab: 远程图片/上传图片/在线图片/搜索图片 - */ - -(function () { - - var uploadFile, - onlineFile; - - window.onload = function () { - initTabs(); - initButtons(); - }; - - /* 初始化tab标签 */ - function initTabs() { - var tabs = $G('tabhead').children; - for (var i = 0; i < tabs.length; i++) { - domUtils.on(tabs[i], "click", function (e) { - var target = e.target || e.srcElement; - setTabFocus(target.getAttribute('data-content-id')); - }); - } - - setTabFocus('upload'); - } - - /* 初始化tabbody */ - function setTabFocus(id) { - if(!id) return; - var i, bodyId, tabs = $G('tabhead').children; - for (i = 0; i < tabs.length; i++) { - bodyId = tabs[i].getAttribute('data-content-id') - if (bodyId == id) { - domUtils.addClass(tabs[i], 'focus'); - domUtils.addClass($G(bodyId), 'focus'); - } else { - domUtils.removeClasses(tabs[i], 'focus'); - domUtils.removeClasses($G(bodyId), 'focus'); - } - } - switch (id) { - case 'upload': - uploadFile = uploadFile || new UploadFile('queueList'); - break; - case 'online': - onlineFile = onlineFile || new OnlineFile('fileList'); - break; - } - } - - /* 初始化onok事件 */ - function initButtons() { - - dialog.onok = function () { - var list = [], id, tabs = $G('tabhead').children; - for (var i = 0; i < tabs.length; i++) { - if (domUtils.hasClass(tabs[i], 'focus')) { - id = tabs[i].getAttribute('data-content-id'); - break; - } - } - - switch (id) { - case 'upload': - list = uploadFile.getInsertList(); - var count = uploadFile.getQueueCount(); - if (count) { - $('.info', '#queueList').html('' + '还有2个未上传文件'.replace(/[\d]/, count) + ''); - return false; - } - break; - case 'online': - list = onlineFile.getInsertList(); - break; - } - - editor.execCommand('insertfile', list); - }; - } - - - /* 上传附件 */ - function UploadFile(target) { - this.$wrap = target.constructor == String ? $('#' + target) : $(target); - this.init(); - } - UploadFile.prototype = { - init: function () { - this.fileList = []; - this.initContainer(); - this.initUploader(); - }, - initContainer: function () { - this.$queue = this.$wrap.find('.filelist'); - }, - /* 初始化容器 */ - initUploader: function () { - var _this = this, - $ = jQuery, // just in case. Make sure it's not an other libaray. - $wrap = _this.$wrap, - // 图片容器 - $queue = $wrap.find('.filelist'), - // 状态栏,包括进度和控制按钮 - $statusBar = $wrap.find('.statusBar'), - // 文件总体选择信息。 - $info = $statusBar.find('.info'), - // 上传按钮 - $upload = $wrap.find('.uploadBtn'), - // 上传按钮 - $filePickerBtn = $wrap.find('.filePickerBtn'), - // 上传按钮 - $filePickerBlock = $wrap.find('.filePickerBlock'), - // 没选择文件之前的内容。 - $placeHolder = $wrap.find('.placeholder'), - // 总体进度条 - $progress = $statusBar.find('.progress').hide(), - // 添加的文件数量 - fileCount = 0, - // 添加的文件总大小 - fileSize = 0, - // 优化retina, 在retina下这个值是2 - ratio = window.devicePixelRatio || 1, - // 缩略图大小 - thumbnailWidth = 113 * ratio, - thumbnailHeight = 113 * ratio, - // 可能有pedding, ready, uploading, confirm, done. - state = '', - // 所有文件的进度信息,key为file id - percentages = {}, - supportTransition = (function () { - var s = document.createElement('p').style, - r = 'transition' in s || - 'WebkitTransition' in s || - 'MozTransition' in s || - 'msTransition' in s || - 'OTransition' in s; - s = null; - return r; - })(), - // WebUploader实例 - uploader, - actionUrl = editor.getActionUrl(editor.getOpt('fileActionName')), - fileMaxSize = editor.getOpt('fileMaxSize'), - acceptExtensions = (editor.getOpt('fileAllowFiles') || - [".txt",".doc",".docs",".xls",".xlsx",".ppt",".pdf",".odt",".ott",".fodt",".uot",".xml",".dot",".htm",".html",".rtf",".docm",".zip",".rar",".tar",".7z",".tar.gz",".tar.bz",".tar.xz"]).join('').replace(/\./g, ',').replace(/^[,]/, '');; - if (!WebUploader.Uploader.support()) { - $('#filePickerReady').after($('
                      ').html(lang.errorNotSupport)).hide(); - return; - } else if (!editor.getOpt('fileActionName')) { - $('#filePickerReady').after($('
                      ').html(lang.errorLoadConfig)).hide(); - return; - } - - uploader = _this.uploader = WebUploader.create({ - pick: { - id: '#filePickerReady', - label: lang.uploadSelectFile - }, - swf: '../../third-party/webuploader/Uploader.swf', - server: actionUrl, - fileVal: editor.getOpt('fileFieldName'), - duplicate: true, - fileSingleSizeLimit: fileMaxSize, - compress: false - }); - uploader.addButton({ - id: '#filePickerBlock' - }); - uploader.addButton({ - id: '#filePickerBtn', - label: lang.uploadAddFile - }); - - setState('pedding'); - - // 当有文件添加进来时执行,负责view的创建 - function addFile(file) { - var $li = $('
                    • ' + - '

                      ' + file.name + '

                      ' + - '

                      ' + - '

                      ' + - '
                    • '), - - $btns = $('
                      ' + - '' + lang.uploadDelete + '' + - '' + lang.uploadTurnRight + '' + - '' + lang.uploadTurnLeft + '
                      ').appendTo($li), - $prgress = $li.find('p.progress span'), - $wrap = $li.find('p.imgWrap'), - $info = $('

                      ').hide().appendTo($li), - - showError = function (code) { - switch (code) { - case 'exceed_size': - text = lang.errorExceedSize; - break; - case 'interrupt': - text = lang.errorInterrupt; - break; - case 'http': - text = lang.errorHttp; - break; - case 'not_allow_type': - text = lang.errorFileType; - break; - default: - text = lang.errorUploadRetry; - break; - } - $info.text(text).show(); - }; - - if (file.getStatus() === 'invalid') { - showError(file.statusText); - } else { - $wrap.text(lang.uploadPreview); - if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|'+file.ext.toLowerCase()+'|') == -1) { - $wrap.empty().addClass('notimage').append('' + - '' + file.name + ''); - } else { - if (browser.ie && browser.version <= 7) { - $wrap.text(lang.uploadNoPreview); - } else { - uploader.makeThumb(file, function (error, src) { - if (error || !src) { - $wrap.text(lang.uploadNoPreview); - } else { - var $img = $(''); - $wrap.empty().append($img); - $img.on('error', function () { - $wrap.text(lang.uploadNoPreview); - }); - } - }, thumbnailWidth, thumbnailHeight); - } - } - percentages[ file.id ] = [ file.size, 0 ]; - file.rotation = 0; - - /* 检查文件格式 */ - if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) { - showError('not_allow_type'); - uploader.removeFile(file); - } - } - - file.on('statuschange', function (cur, prev) { - if (prev === 'progress') { - $prgress.hide().width(0); - } else if (prev === 'queued') { - $li.off('mouseenter mouseleave'); - $btns.remove(); - } - // 成功 - if (cur === 'error' || cur === 'invalid') { - showError(file.statusText); - percentages[ file.id ][ 1 ] = 1; - } else if (cur === 'interrupt') { - showError('interrupt'); - } else if (cur === 'queued') { - percentages[ file.id ][ 1 ] = 0; - } else if (cur === 'progress') { - $info.hide(); - $prgress.css('display', 'block'); - } else if (cur === 'complete') { - } - - $li.removeClass('state-' + prev).addClass('state-' + cur); - }); - - $li.on('mouseenter', function () { - $btns.stop().animate({height: 30}); - }); - $li.on('mouseleave', function () { - $btns.stop().animate({height: 0}); - }); - - $btns.on('click', 'span', function () { - var index = $(this).index(), - deg; - - switch (index) { - case 0: - uploader.removeFile(file); - return; - case 1: - file.rotation += 90; - break; - case 2: - file.rotation -= 90; - break; - } - - if (supportTransition) { - deg = 'rotate(' + file.rotation + 'deg)'; - $wrap.css({ - '-webkit-transform': deg, - '-mos-transform': deg, - '-o-transform': deg, - 'transform': deg - }); - } else { - $wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')'); - } - - }); - - $li.insertBefore($filePickerBlock); - } - - // 负责view的销毁 - function removeFile(file) { - var $li = $('#' + file.id); - delete percentages[ file.id ]; - updateTotalProgress(); - $li.off().find('.file-panel').off().end().remove(); - } - - function updateTotalProgress() { - var loaded = 0, - total = 0, - spans = $progress.children(), - percent; - - $.each(percentages, function (k, v) { - total += v[ 0 ]; - loaded += v[ 0 ] * v[ 1 ]; - }); - - percent = total ? loaded / total : 0; - - spans.eq(0).text(Math.round(percent * 100) + '%'); - spans.eq(1).css('width', Math.round(percent * 100) + '%'); - updateStatus(); - } - - function setState(val, files) { - - if (val != state) { - - var stats = uploader.getStats(); - - $upload.removeClass('state-' + state); - $upload.addClass('state-' + val); - - switch (val) { - - /* 未选择文件 */ - case 'pedding': - $queue.addClass('element-invisible'); - $statusBar.addClass('element-invisible'); - $placeHolder.removeClass('element-invisible'); - $progress.hide(); $info.hide(); - uploader.refresh(); - break; - - /* 可以开始上传 */ - case 'ready': - $placeHolder.addClass('element-invisible'); - $queue.removeClass('element-invisible'); - $statusBar.removeClass('element-invisible'); - $progress.hide(); $info.show(); - $upload.text(lang.uploadStart); - uploader.refresh(); - break; - - /* 上传中 */ - case 'uploading': - $progress.show(); $info.hide(); - $upload.text(lang.uploadPause); - break; - - /* 暂停上传 */ - case 'paused': - $progress.show(); $info.hide(); - $upload.text(lang.uploadContinue); - break; - - case 'confirm': - $progress.show(); $info.hide(); - $upload.text(lang.uploadStart); - - stats = uploader.getStats(); - if (stats.successNum && !stats.uploadFailNum) { - setState('finish'); - return; - } - break; - - case 'finish': - $progress.hide(); $info.show(); - if (stats.uploadFailNum) { - $upload.text(lang.uploadRetry); - } else { - $upload.text(lang.uploadStart); - } - break; - } - - state = val; - updateStatus(); - - } - - if (!_this.getQueueCount()) { - $upload.addClass('disabled') - } else { - $upload.removeClass('disabled') - } - - } - - function updateStatus() { - var text = '', stats; - - if (state === 'ready') { - text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)); - } else if (state === 'confirm') { - stats = uploader.getStats(); - if (stats.uploadFailNum) { - text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum); - } - } else { - stats = uploader.getStats(); - text = lang.updateStatusFinish.replace('_', fileCount). - replace('_KB', WebUploader.formatSize(fileSize)). - replace('_', stats.successNum); - - if (stats.uploadFailNum) { - text += lang.updateStatusError.replace('_', stats.uploadFailNum); - } - } - - $info.html(text); - } - - uploader.on('fileQueued', function (file) { - /* 选择文件后设置上传相关的url和自定义参数 */ - editor.getOpt("fileUploadService")(_this, editor).setUploadData(file); - - if (file.ext && acceptExtensions.indexOf(file.ext.toLowerCase()) != -1 && file.size <= fileMaxSize) { - fileCount++; - fileSize += file.size; - } - - if (fileCount === 1) { - $placeHolder.addClass('element-invisible'); - $statusBar.show(); - } - - addFile(file); - }); - - uploader.on('fileDequeued', function (file) { - if (file.ext && acceptExtensions.indexOf(file.ext.toLowerCase()) != -1 && file.size <= fileMaxSize) { - fileCount--; - fileSize -= file.size; - } - - removeFile(file); - updateTotalProgress(); - }); - - uploader.on('filesQueued', function (file) { - if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) { - setState('ready'); - } - updateTotalProgress(); - }); - - uploader.on('all', function (type, files) { - switch (type) { - case 'uploadFinished': - setState('confirm', files); - break; - case 'startUpload': - /* 设置Uploader配置项 */ - editor.getOpt("fileUploadService")(_this, editor).setUploaderOptions(uploader); - setState('uploading', files); - break; - case 'stopUpload': - setState('paused', files); - break; - } - }); - - uploader.on('uploadBeforeSend', function (object, data, headers) { - //这里可以通过data对象添加POST参数 - editor.getOpt("fileUploadService")(_this, editor).setFormData(object, data, headers); - }); - - uploader.on('uploadProgress', function (file, percentage) { - var $li = $('#' + file.id), - $percent = $li.find('.progress span'); - - $percent.css('width', percentage * 100 + '%'); - percentages[ file.id ][ 1 ] = percentage; - updateTotalProgress(); - }); - - uploader.on('uploadSuccess', function (file, res) { - var $file = $('#' + file.id); - try { - if (editor.getOpt("fileUploadService")(_this, editor).getResponseSuccess(res)) { - _this.fileList.push(res); - $file.append(''); - } else { - $file.find('.error').text(res.message).show(); - } - } catch (e) { - $file.find('.error').text(lang.errorServerUpload).show(); - } - }); - - uploader.on('uploadError', function (file, code) { - }); - uploader.on('error', function (code, file) { - if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { - addFile(file); - } - }); - uploader.on('uploadComplete', function (file, ret) { - }); - - $upload.on('click', function () { - if ($(this).hasClass('disabled')) { - return false; - } - - if (state === 'ready') { - uploader.upload(); - } else if (state === 'paused') { - uploader.upload(); - } else if (state === 'uploading') { - uploader.stop(); - } - }); - - $upload.addClass('state-' + state); - updateTotalProgress(); - }, - getQueueCount: function () { - var file, i, status, readyFile = 0, files = this.uploader.getFiles(); - for (i = 0; file = files[i++]; ) { - status = file.getStatus(); - if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; - } - return readyFile; - }, - getInsertList: function () { - var i, link, data, list = [], - prefix = editor.getOpt('fileUrlPrefix'), - fileSrcField = editor.getOpt("fileUploadService")(this, editor).fileSrcField || 'url', - fileSrc = '', - fileSrcFieldKeys = fileSrcField.split('.'); - - for (i = 0; i < this.fileList.length; i++) { - data = this.fileList[i]; - if(fileSrcFieldKeys.length > 1) { - function setFileSrc(obj, keys, index) { - obj = obj[keys[index]]; - if (index < keys.length - 1) { - setFileSrc(obj, keys, index += 1) - } else { - fileSrc = obj; - } - } - - setFileSrc(data, fileSrcFieldKeys, 0); - } else { - fileSrc = data[fileSrcField]; - } - link = fileSrc; - list.push({ - title: data.original || link.substr(link.lastIndexOf('/') + 1), - url: prefix + link - }); - } - return list; - } - }; - - - /* 在线附件 */ - function OnlineFile(target) { - this.container = utils.isString(target) ? document.getElementById(target) : target; - this.init(); - } - OnlineFile.prototype = { - init: function () { - this.initContainer(); - this.initEvents(); - this.initData(); - }, - /* 初始化容器 */ - initContainer: function () { - this.container.innerHTML = ''; - this.list = document.createElement('ul'); - this.clearFloat = document.createElement('li'); - - domUtils.addClass(this.list, 'list'); - domUtils.addClass(this.clearFloat, 'clearFloat'); - - this.list.appendChild(this.clearFloat); - this.container.appendChild(this.list); - }, - /* 初始化滚动事件,滚动到地步自动拉取数据 */ - initEvents: function () { - var _this = this; - - /* 滚动拉取图片 */ - domUtils.on($G('fileList'), 'scroll', function(e){ - var panel = this; - if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { - _this.getFileData(); - } - }); - /* 选中图片 */ - domUtils.on(this.list, 'click', function (e) { - var target = e.target || e.srcElement, - li = target.parentNode; - - if (li.tagName.toLowerCase() == 'li') { - if (domUtils.hasClass(li, 'selected')) { - domUtils.removeClasses(li, 'selected'); - } else { - domUtils.addClass(li, 'selected'); - } - } - }); - }, - /* 初始化第一次的数据 */ - initData: function () { - - /* 拉取数据需要使用的值 */ - this.state = 0; - this.listSize = editor.getOpt('fileManagerListSize'); - this.listIndex = 0; - this.listEnd = false; - - /* 第一次拉取数据 */ - this.getFileData(); - }, - /* 向后台拉取图片列表数据 */ - getFileData: function () { - var _this = this; - - if(!_this.listEnd && !this.isLoadingData) { - this.isLoadingData = true; - ajax.request(editor.getActionUrl(editor.getOpt('fileManagerActionName')), { - timeout: 100000, - data: utils.extend({ - start: this.listIndex, - size: this.listSize - }, editor.queryCommandValue('serverparam')), - method: 'get', - onsuccess: function (r) { - try { - var json = eval('(' + r.responseText + ')'); - if (json.state == 'SUCCESS') { - _this.pushData(json.list); - _this.listIndex = parseInt(json.start) + parseInt(json.list.length); - if(_this.listIndex >= json.total) { - _this.listEnd = true; - } - _this.isLoadingData = false; - } - } catch (e) { - if(r.responseText.indexOf('ue_separate_ue') != -1) { - var list = r.responseText.split(r.responseText); - _this.pushData(list); - _this.listIndex = parseInt(list.length); - _this.listEnd = true; - _this.isLoadingData = false; - } - } - }, - onerror: function () { - _this.isLoadingData = false; - } - }); - } - }, - /* 添加图片到列表界面上 */ - pushData: function (list) { - var i, item, img, filetype, preview, icon, _this = this, - urlPrefix = editor.getOpt('fileManagerUrlPrefix'); - for (i = 0; i < list.length; i++) { - if(list[i] && list[i].url) { - item = document.createElement('li'); - icon = document.createElement('span'); - filetype = list[i].url.substr(list[i].url.lastIndexOf('.') + 1); - - if ( "png|jpg|jpeg|gif|bmp".indexOf(filetype) != -1 ) { - preview = document.createElement('img'); - domUtils.on(preview, 'load', (function(image){ - return function(){ - _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); - }; - })(preview)); - preview.width = 113; - preview.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) ); - } else { - var ic = document.createElement('i'), - textSpan = document.createElement('span'); - textSpan.innerHTML = list[i].url.substr(list[i].url.lastIndexOf('/') + 1); - preview = document.createElement('div'); - preview.appendChild(ic); - preview.appendChild(textSpan); - domUtils.addClass(preview, 'file-wrapper'); - domUtils.addClass(textSpan, 'file-title'); - domUtils.addClass(ic, 'file-type-' + filetype); - domUtils.addClass(ic, 'file-preview'); - } - domUtils.addClass(icon, 'icon'); - item.setAttribute('data-url', urlPrefix + list[i].url); - if (list[i].original) { - item.setAttribute('data-title', list[i].original); - } - - item.appendChild(preview); - item.appendChild(icon); - this.list.insertBefore(item, this.clearFloat); - } - } - }, - /* 改变图片大小 */ - scale: function (img, w, h, type) { - var ow = img.width, - oh = img.height; - - if (type == 'justify') { - if (ow >= oh) { - img.width = w; - img.height = h * oh / ow; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w * ow / oh; - img.height = h; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } else { - if (ow >= oh) { - img.width = w * ow / oh; - img.height = h; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w; - img.height = h * oh / ow; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } - }, - getInsertList: function () { - var i, lis = this.list.children, list = []; - for (i = 0; i < lis.length; i++) { - if (domUtils.hasClass(lis[i], 'selected')) { - var url = lis[i].getAttribute('data-url'); - var title = lis[i].getAttribute('data-title') || url.substr(url.lastIndexOf('/') + 1); - list.push({ - title: title, - url: url - }); - } - } - return list; - } - }; - - -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_chm.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_chm.gif deleted file mode 100644 index 9ca4fb6a23c7ed528374426575c3e7f67730cfb7..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_chm.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_default.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_default.png deleted file mode 100644 index 50ac1cb1654c147225f6c99f98fa820d8b1d47d3..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_default.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_doc.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_doc.gif deleted file mode 100644 index 206fede4ee7495c3d4fa8dbbb76425e23566e9cc..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_doc.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_exe.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_exe.gif deleted file mode 100644 index 2e3b7a28e08d4be8c98dc54ec9c355a3f3d89ccb..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_exe.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_jpg.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_jpg.gif deleted file mode 100644 index 5d5dec02627672b415a936eb5ab6526c895646c6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_jpg.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_mp3.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_mp3.gif deleted file mode 100644 index b351a1f2a294cd0f8e145e20c2c455a38cad2001..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_mp3.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_mv.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_mv.gif deleted file mode 100644 index 26019b099d96b382a549fa383bd81315cd6d295c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_mv.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_pdf.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_pdf.gif deleted file mode 100644 index bbb65c837dea9a6c28d6209ca1b1140a37988423..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_pdf.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_ppt.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_ppt.gif deleted file mode 100644 index ccb26fbebdff5521eab7418d22e99fbae6c1d08c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_ppt.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_psd.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_psd.gif deleted file mode 100644 index 2e8743a2705b98b9c546c28c97fe724dd4668b16..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_psd.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_rar.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_rar.gif deleted file mode 100644 index 5359e46d2094b9dbb88566d4c5098e91665238ad..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_rar.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_txt.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_txt.gif deleted file mode 100644 index e7b8dd21d8ca8121e2c1629bb607cf2ab151c7a3..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_txt.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_xls.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_xls.gif deleted file mode 100644 index e86c1c6631b34ecd605b655baf3d7b1ae643d014..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/fileTypeImages/icon_xls.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/alignicon.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/alignicon.gif deleted file mode 100644 index 005a5ac65a3ddc9cdac037abdb5fe92267155a0d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/alignicon.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/alignicon.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/alignicon.png deleted file mode 100644 index 4b6c444b78f31f4e9b381ce440ef5c0231bcec1f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/alignicon.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/bg.png deleted file mode 100644 index 580be0a01dff4c70c72f78a3f40186660ee8eee0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/file-icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/file-icons.gif deleted file mode 100644 index d8c02c27e242f0584fc6b214f35b4f6d8caec332..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/file-icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/file-icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/file-icons.png deleted file mode 100644 index 3ff82c8c488f53a7aff67fbe39742e3321183eca..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/file-icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/icons.gif deleted file mode 100644 index 78459dea7b12ccbeec81d19ecdab22b1658e93b4..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/icons.png deleted file mode 100644 index 12e4700163ac87fa38ae3d92a2c39d0fb4690fed..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/image.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/image.png deleted file mode 100644 index 19699f6a9c6b09cb18ec0f488242d9753d2e341b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/image.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/progress.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/progress.png deleted file mode 100644 index 717c4865c90a959c6a0e9ad1af9c777d900a2e9c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/progress.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/success.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/success.gif deleted file mode 100644 index 8d4f3112b9d1df2147ed3b67d9736163dedd11e1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/success.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/success.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/success.png deleted file mode 100644 index 94f968dc8fd3c7ca8f6cb599d006ef3f23b62c7d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/attachment/images/success.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/background.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/background.css deleted file mode 100644 index f0fa943ed2a48ca5e66a74b3aaa413d41215339a..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/background.css +++ /dev/null @@ -1,97 +0,0 @@ -.wrapper{ width: 424px;margin: 20px; zoom:1;position: relative} -.tabbody{height:225px;} -.tabbody .panel { position: absolute;width:100%; height:100%;background: #fff; display: none;} -.tabbody .focus { display: block;} - -body{font-size: 12px;color: #888;overflow: hidden;} -input,label{vertical-align:middle} -.clear{clear: both;} -.pl{padding-left: 18px;padding-left: 23px\9;} - -#imageList {width: 420px;height: 215px;margin-top: 10px;overflow: hidden;overflow-y: auto;} -#imageList div {float: left;width: 100px;height: 95px;margin: 5px 10px;} -#imageList img {cursor: pointer;border: 2px solid white;} - -.bgarea{margin: 10px;padding: 5px;height: 84%;border: 1px solid #A8A297;border-radius: 4px;} -.content div{margin: 10px 0 10px 5px;} -.content .iptradio{margin: 0px 5px 5px 0px;} -.txt{width:280px; margin-left: 10px;height: 26px;line-height: 26px; border-radius: 5px;border: 1px solid #ccc;} - -.wrapcolor{height: 19px;} -div.color{float: left;margin: 0;} -#colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;margin: 0 0 0 10px;float: left;} -div.alignment,#custom{margin-left: 23px;margin-left: 28px\9;} -#custom input{height: 15px;min-height: 15px;width:20px;} -#repeatType{width:100px; - margin-left: 10px; - border-radius: 4px; - height: 23px;} - - -/* 图片管理样式 */ -#imgManager { - width: 100%; - height: 225px; -} -#imgManager #imageList{ - width: 100%; - overflow-x: hidden; - overflow-y: auto; -} -#imgManager ul { - display: block; - list-style: none; - margin: 0; - padding: 0; -} -#imgManager li { - float: left; - display: block; - list-style: none; - padding: 0; - width: 113px; - height: 113px; - margin: 9px 0 0 19px; - background-color: #eee; - overflow: hidden; - cursor: pointer; - position: relative; -} -#imgManager li.clearFloat { - float: none; - clear: both; - display: block; - width:0; - height:0; - margin: 0; - padding: 0; -} -#imgManager li img { - cursor: pointer; -} -#imgManager li .icon { - cursor: pointer; - width: 113px; - height: 113px; - position: absolute; - top: 0; - left: 0; - z-index: 2; - border: 0; - background-repeat: no-repeat; -} -#imgManager li .icon:hover { - width: 107px; - height: 107px; - border: 3px solid #1094fa; -} -#imgManager li.selected .icon { - background-image: url(images/success.png); - background-position: 75px 75px; -} -#imgManager li.selected .icon:hover { - width: 107px; - height: 107px; - border: 3px solid #1094fa; - background-position: 72px 72px; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/background.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/background.html deleted file mode 100644 index a611b970dd9bc5f2a2972835e62828fabaa5ad4b..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/background.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - -
                      -
                      - - -
                      -
                      -
                      -
                      - -
                      -
                      - - -
                      -
                      -
                      - : -
                      -
                      -
                      -
                      -
                      - -
                      -
                      - : -
                      -
                      - :x:px  y:px -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      -
                      - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/background.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/background.js deleted file mode 100644 index 9a4a1315d4aa04f1b2f5f4ac247869a8f62ab513..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/background.js +++ /dev/null @@ -1,376 +0,0 @@ -(function () { - - var onlineImage, - backupStyle = editor.queryCommandValue('background'); - - window.onload = function () { - initTabs(); - initColorSelector(); - }; - - /* 初始化tab标签 */ - function initTabs(){ - var tabs = $G('tabHeads').children; - for (var i = 0; i < tabs.length; i++) { - domUtils.on(tabs[i], "click", function (e) { - var target = e.target || e.srcElement; - for (var j = 0; j < tabs.length; j++) { - if(tabs[j] == target){ - tabs[j].className = "focus"; - var contentId = tabs[j].getAttribute('data-content-id'); - $G(contentId).style.display = "block"; - if(contentId == 'imgManager') { - initImagePanel(); - } - }else { - tabs[j].className = ""; - $G(tabs[j].getAttribute('data-content-id')).style.display = "none"; - } - } - }); - } - } - - /* 初始化颜色设置 */ - function initColorSelector () { - var obj = editor.queryCommandValue('background'); - if (obj) { - var color = obj['background-color'], - repeat = obj['background-repeat'] || 'repeat', - image = obj['background-image'] || '', - position = obj['background-position'] || 'center center', - pos = position.split(' '), - x = parseInt(pos[0]) || 0, - y = parseInt(pos[1]) || 0; - - if(repeat == 'no-repeat' && (x || y)) repeat = 'self'; - - image = image.match(/url[\s]*\(([^\)]*)\)/); - image = image ? image[1]:''; - updateFormState('colored', color, image, repeat, x, y); - } else { - updateFormState(); - } - - var updateHandler = function () { - updateFormState(); - updateBackground(); - } - domUtils.on($G('nocolorRadio'), 'click', updateBackground); - domUtils.on($G('coloredRadio'), 'click', updateHandler); - domUtils.on($G('url'), 'keyup', function(){ - if($G('url').value && $G('alignment').style.display == "none") { - utils.each($G('repeatType').children, function(item){ - item.selected = ('repeat' == item.getAttribute('value') ? 'selected':false); - }); - } - updateHandler(); - }); - domUtils.on($G('repeatType'), 'change', updateHandler); - domUtils.on($G('x'), 'keyup', updateBackground); - domUtils.on($G('y'), 'keyup', updateBackground); - - initColorPicker(); - } - - /* 初始化颜色选择器 */ - function initColorPicker() { - var me = editor, - cp = $G("colorPicker"); - - /* 生成颜色选择器ui对象 */ - var popup = new UE.ui.Popup({ - content: new UE.ui.ColorPicker({ - noColorText: me.getLang("clearColor"), - editor: me, - onpickcolor: function (t, color) { - updateFormState('colored', color); - updateBackground(); - UE.ui.Popup.postHide(); - }, - onpicknocolor: function (t, color) { - updateFormState('colored', 'transparent'); - updateBackground(); - UE.ui.Popup.postHide(); - } - }), - editor: me, - onhide: function () { - } - }); - - /* 设置颜色选择器 */ - domUtils.on(cp, "click", function () { - popup.showAnchor(this); - }); - domUtils.on(document, 'mousedown', function (evt) { - var el = evt.target || evt.srcElement; - UE.ui.Popup.postHide(el); - }); - domUtils.on(window, 'scroll', function () { - UE.ui.Popup.postHide(); - }); - } - - /* 初始化在线图片列表 */ - function initImagePanel() { - onlineImage = onlineImage || new OnlineImage('imageList'); - } - - /* 更新背景色设置面板 */ - function updateFormState (radio, color, url, align, x, y) { - var nocolorRadio = $G('nocolorRadio'), - coloredRadio = $G('coloredRadio'); - - if(radio) { - nocolorRadio.checked = (radio == 'colored' ? false:'checked'); - coloredRadio.checked = (radio == 'colored' ? 'checked':false); - } - if(color) { - domUtils.setStyle($G("colorPicker"), "background-color", color); - } - - if(url && /^\//.test(url)) { - var a = document.createElement('a'); - a.href = url; - browser.ie && (a.href = a.href); - url = browser.ie ? a.href:(a.protocol + '//' + a.host + a.pathname + a.search + a.hash); - } - - if(url || url === '') { - $G('url').value = url; - } - if(align) { - utils.each($G('repeatType').children, function(item){ - item.selected = (align == item.getAttribute('value') ? 'selected':false); - }); - } - if(x || y) { - $G('x').value = parseInt(x) || 0; - $G('y').value = parseInt(y) || 0; - } - - $G('alignment').style.display = coloredRadio.checked && $G('url').value ? '':'none'; - $G('custom').style.display = coloredRadio.checked && $G('url').value && $G('repeatType').value == 'self' ? '':'none'; - } - - /* 更新背景颜色 */ - function updateBackground () { - if ($G('coloredRadio').checked) { - var color = domUtils.getStyle($G("colorPicker"), "background-color"), - bgimg = $G("url").value, - align = $G("repeatType").value, - backgroundObj = { - "background-repeat": "no-repeat", - "background-position": "center center" - }; - - if (color) backgroundObj["background-color"] = color; - if (bgimg) backgroundObj["background-image"] = 'url(' + bgimg + ')'; - if (align == 'self') { - backgroundObj["background-position"] = $G("x").value + "px " + $G("y").value + "px"; - } else if (align == 'repeat-x' || align == 'repeat-y' || align == 'repeat') { - backgroundObj["background-repeat"] = align; - } - - editor.execCommand('background', backgroundObj); - } else { - editor.execCommand('background', null); - } - } - - - /* 在线图片 */ - function OnlineImage(target) { - this.container = utils.isString(target) ? document.getElementById(target) : target; - this.init(); - } - OnlineImage.prototype = { - init: function () { - this.reset(); - this.initEvents(); - }, - /* 初始化容器 */ - initContainer: function () { - this.container.innerHTML = ''; - this.list = document.createElement('ul'); - this.clearFloat = document.createElement('li'); - - domUtils.addClass(this.list, 'list'); - domUtils.addClass(this.clearFloat, 'clearFloat'); - - this.list.id = 'imageListUl'; - this.list.appendChild(this.clearFloat); - this.container.appendChild(this.list); - }, - /* 初始化滚动事件,滚动到地步自动拉取数据 */ - initEvents: function () { - var _this = this; - - /* 滚动拉取图片 */ - domUtils.on($G('imageList'), 'scroll', function(e){ - var panel = this; - if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { - _this.getImageData(); - } - }); - /* 选中图片 */ - domUtils.on(this.container, 'click', function (e) { - var target = e.target || e.srcElement, - li = target.parentNode, - nodes = $G('imageListUl').childNodes; - - if (li.tagName.toLowerCase() == 'li') { - updateFormState('nocolor', null, ''); - for (var i = 0, node; node = nodes[i++];) { - if (node == li && !domUtils.hasClass(node, 'selected')) { - domUtils.addClass(node, 'selected'); - updateFormState('colored', null, li.firstChild.getAttribute("_src"), 'repeat'); - } else { - domUtils.removeClasses(node, 'selected'); - } - } - updateBackground(); - } - }); - }, - /* 初始化第一次的数据 */ - initData: function () { - - /* 拉取数据需要使用的值 */ - this.state = 0; - this.listSize = editor.getOpt('imageManagerListSize'); - this.listIndex = 0; - this.listEnd = false; - - /* 第一次拉取数据 */ - this.getImageData(); - }, - /* 重置界面 */ - reset: function() { - this.initContainer(); - this.initData(); - }, - /* 向后台拉取图片列表数据 */ - getImageData: function () { - var _this = this; - - if(!_this.listEnd && !this.isLoadingData) { - this.isLoadingData = true; - var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')), - isJsonp = utils.isCrossDomainUrl(url); - ajax.request(url, { - 'timeout': 100000, - 'dataType': isJsonp ? 'jsonp':'', - 'data': utils.extend({ - start: this.listIndex, - size: this.listSize - }, editor.queryCommandValue('serverparam')), - 'method': 'get', - 'onsuccess': function (r) { - try { - var json = isJsonp ? r:eval('(' + r.responseText + ')'); - if (json.state == 'SUCCESS') { - _this.pushData(json.list); - _this.listIndex = parseInt(json.start) + parseInt(json.list.length); - if(_this.listIndex >= json.total) { - _this.listEnd = true; - } - _this.isLoadingData = false; - } - } catch (e) { - if(r.responseText.indexOf('ue_separate_ue') != -1) { - var list = r.responseText.split(r.responseText); - _this.pushData(list); - _this.listIndex = parseInt(list.length); - _this.listEnd = true; - _this.isLoadingData = false; - } - } - }, - 'onerror': function () { - _this.isLoadingData = false; - } - }); - } - }, - /* 添加图片到列表界面上 */ - pushData: function (list) { - var i, item, img, icon, _this = this, - urlPrefix = editor.getOpt('imageManagerUrlPrefix'); - for (i = 0; i < list.length; i++) { - if(list[i] && list[i].url) { - item = document.createElement('li'); - img = document.createElement('img'); - icon = document.createElement('span'); - - domUtils.on(img, 'load', (function(image){ - return function(){ - _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); - } - })(img)); - img.width = 113; - img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) ); - img.setAttribute('_src', urlPrefix + list[i].url); - domUtils.addClass(icon, 'icon'); - - item.appendChild(img); - item.appendChild(icon); - this.list.insertBefore(item, this.clearFloat); - } - } - }, - /* 改变图片大小 */ - scale: function (img, w, h, type) { - var ow = img.width, - oh = img.height; - - if (type == 'justify') { - if (ow >= oh) { - img.width = w; - img.height = h * oh / ow; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w * ow / oh; - img.height = h; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } else { - if (ow >= oh) { - img.width = w * ow / oh; - img.height = h; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w; - img.height = h * oh / ow; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } - }, - getInsertList: function () { - var i, lis = this.list.children, list = [], align = getAlign(); - for (i = 0; i < lis.length; i++) { - if (domUtils.hasClass(lis[i], 'selected')) { - var img = lis[i].firstChild, - src = img.getAttribute('_src'); - list.push({ - src: src, - _src: src, - floatStyle: align - }); - } - - } - return list; - } - }; - - dialog.onok = function () { - updateBackground(); - editor.fireEvent('saveScene'); - }; - dialog.oncancel = function () { - editor.execCommand('background', backupStyle); - }; - -})(); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/images/bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/images/bg.png deleted file mode 100644 index 580be0a01dff4c70c72f78a3f40186660ee8eee0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/images/bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/images/success.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/images/success.png deleted file mode 100644 index 94f968dc8fd3c7ca8f6cb599d006ef3f23b62c7d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/background/images/success.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/chart.config.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/chart.config.js deleted file mode 100644 index 678b00deb8a77bc445974641ccd6e6db380586df..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/chart.config.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 图表配置文件 - * */ - - -//不同类型的配置 -var typeConfig = [ - { - chart: { - type: 'line' - }, - plotOptions: { - line: { - dataLabels: { - enabled: false - }, - enableMouseTracking: true - } - } - }, { - chart: { - type: 'line' - }, - plotOptions: { - line: { - dataLabels: { - enabled: true - }, - enableMouseTracking: false - } - } - }, { - chart: { - type: 'area' - } - }, { - chart: { - type: 'bar' - } - }, { - chart: { - type: 'column' - } - }, { - chart: { - plotBackgroundColor: null, - plotBorderWidth: null, - plotShadow: false - }, - plotOptions: { - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: true, - color: '#000000', - connectorColor: '#000000', - formatter: function() { - return ''+ this.point.name +': '+ ( Math.round( this.point.percentage*100 ) / 100 ) +' %'; - } - } - } - } - } -]; diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/charts.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/charts.css deleted file mode 100644 index ac3c76458206126b54ca2c225f5481e2e9cbd524..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/charts.css +++ /dev/null @@ -1,165 +0,0 @@ -html, body { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - overflow-x: hidden; -} - -.main { - width: 100%; - overflow: hidden; -} - -.table-view { - height: 100%; - float: left; - margin: 20px; - width: 40%; -} - -.table-view .table-container { - width: 100%; - margin-bottom: 50px; - overflow: scroll; -} - -.table-view th { - padding: 5px 10px; - background-color: #F7F7F7; -} - -.table-view td { - width: 50px; - text-align: center; - padding:0; -} - -.table-container input { - width: 40px; - padding: 5px; - border: none; - outline: none; -} - -.table-view caption { - font-size: 18px; - text-align: left; -} - -.charts-view { - /*margin-left: 49%!important;*/ - width: 50%; - margin-left: 49%; - height: 400px; -} - -.charts-container { - border-left: 1px solid #c3c3c3; -} - -.charts-format fieldset { - padding-left: 20px; - margin-bottom: 50px; -} - -.charts-format legend { - padding-left: 10px; - padding-right: 10px; -} - -.format-item-container { - padding: 20px; -} - -.format-item-container label { - display: block; - margin: 10px 0; -} - -.charts-format .data-item { - border: 1px solid black; - outline: none; - padding: 2px 3px; -} - -/* 图表类型 */ - -.charts-type { - margin-top: 50px; - height: 300px; -} - -.scroll-view { - border: 1px solid #c3c3c3; - border-left: none; - border-right: none; - overflow: hidden; -} - -.scroll-container { - margin: 20px; - width: 100%; - overflow: hidden; -} - -.scroll-bed { - width: 10000px; - _margin-top: 20px; - -webkit-transition: margin-left .5s ease; - -moz-transition: margin-left .5s ease; - transition: margin-left .5s ease; -} - -.view-box { - display: inline-block; - *display: inline; - *zoom: 1; - margin-right: 20px; - border: 2px solid white; - line-height: 0; - overflow: hidden; - cursor: pointer; -} - -.view-box img { - border: 1px solid #cecece; -} - -.view-box.selected { - border-color: #7274A7; -} - -.button-container { - margin-bottom: 20px; - text-align: center; -} - -.button-container a { - display: inline-block; - width: 100px; - height: 25px; - line-height: 25px; - border: 1px solid #c2ccd1; - margin-right: 30px; - text-decoration: none; - color: black; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} - -.button-container a:HOVER { - background: #fcfcfc; -} - -.button-container a:ACTIVE { - border-top-color: #c2ccd1; - box-shadow:inset 0 5px 4px -4px rgba(49, 49, 64, 0.1); -} - -.edui-charts-not-data { - height: 100px; - line-height: 100px; - text-align: center; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/charts.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/charts.html deleted file mode 100644 index 70e23149f143b618a63f70265766f971f6339621..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/charts.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - chart - - - - - -
                      -
                      -

                      -
                      -

                      -
                      -
                      -
                      - -
                      - - -
                      -
                      -
                      -
                      - -
                      - - - - -
                      -
                      -
                      - -
                      - -

                      -
                      -
                      -
                      - -
                      - -

                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -

                      -
                      -
                      -
                      -
                      -
                      - - -
                      -
                      -
                      -
                      -
                      - - - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/charts.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/charts.js deleted file mode 100644 index 37344fd129db521348dfefd4b97e278e26144fab..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/charts.js +++ /dev/null @@ -1,519 +0,0 @@ -/* - * 图片转换对话框脚本 - **/ - -var tableData = [], - //编辑器页面table - editorTable = null, - chartsConfig = window.typeConfig, - resizeTimer = null, - //初始默认图表类型 - currentChartType = 0; - -window.onload = function () { - - editorTable = domUtils.findParentByTagName( editor.selection.getRange().startContainer, 'table', true); - - //未找到表格, 显示错误页面 - if ( !editorTable ) { - document.body.innerHTML = "
                      未找到数据
                      "; - return; - } - - //初始化图表类型选择 - initChartsTypeView(); - renderTable( editorTable ); - initEvent(); - initUserConfig( editorTable.getAttribute( "data-chart" ) ); - $( "#scrollBed .view-box:eq("+ currentChartType +")" ).trigger( "click" ); - updateViewType( currentChartType ); - - dialog.addListener( "resize", function () { - - if ( resizeTimer != null ) { - window.clearTimeout( resizeTimer ); - } - - resizeTimer = window.setTimeout( function () { - - resizeTimer = null; - - renderCharts(); - - }, 500 ); - - } ); - -}; - -function initChartsTypeView () { - - var contents = []; - - for ( var i = 0, len = chartsConfig.length; i
                      ' ); - - } - - $( "#scrollBed" ).html( contents.join( "" ) ); - -} - -//渲染table, 以便用户修改数据 -function renderTable ( table ) { - - var tableHtml = []; - - //构造数据 - for ( var i = 0, row; row = table.rows[ i ]; i++ ) { - - tableData[ i ] = []; - tableHtml[ i ] = []; - - for ( var j = 0, cell; cell = row.cells[ j ]; j++ ) { - - var value = getCellValue( cell ); - - if ( i > 0 && j > 0 ) { - value = +value; - } - - if ( i === 0 || j === 0 ) { - tableHtml[ i ].push( ''+ value +'' ); - } else { - tableHtml[ i ].push( '' ); - } - - tableData[ i ][ j ] = value; - - } - - tableHtml[ i ] = tableHtml[ i ].join( "" ); - - } - - //draw 表格 - $( "#tableContainer" ).html( ''+ tableHtml.join( "" ) +'
                      ' ); - -} - -/* - * 根据表格已有的图表属性初始化当前图表属性 - */ -function initUserConfig ( config ) { - - var parsedConfig = {}; - - if ( !config ) { - return; - } - - config = config.split( ";" ); - - $.each( config, function ( index, item ) { - - item = item.split( ":" ); - parsedConfig[ item[ 0 ] ] = item[ 1 ]; - - } ); - - setUserConfig( parsedConfig ); - -} - -function initEvent () { - - var cacheValue = null, - //图表类型数 - typeViewCount = chartsConfig.length- 1, - $chartsTypeViewBox = $( '#scrollBed .view-box' ); - - $( ".charts-format" ).delegate( ".format-ctrl", "change", function () { - - renderCharts(); - - } ) - - $( ".table-view" ).delegate( ".data-item", "focus", function () { - - cacheValue = this.value; - - } ).delegate( ".data-item", "blur", function () { - - if ( this.value !== cacheValue ) { - renderCharts(); - } - - cacheValue = null; - - } ); - - $( "#buttonContainer" ).delegate( "a", "click", function (e) { - - e.preventDefault(); - - if ( this.getAttribute( "data-title" ) === 'prev' ) { - - if ( currentChartType > 0 ) { - currentChartType--; - updateViewType( currentChartType ); - } - - } else { - - if ( currentChartType < typeViewCount ) { - currentChartType++; - updateViewType( currentChartType ); - } - - } - - } ); - - //图表类型变化 - $( '#scrollBed' ).delegate( ".view-box", "click", function (e) { - - var index = $( this ).attr( "data-chart-type" ); - $chartsTypeViewBox.removeClass( "selected" ); - $( $chartsTypeViewBox[ index ] ).addClass( "selected" ); - - currentChartType = index | 0; - - //饼图, 禁用部分配置 - if ( currentChartType === chartsConfig.length - 1 ) { - - disableNotPieConfig(); - - //启用完整配置 - } else { - - enableNotPieConfig(); - - } - - renderCharts(); - - } ); - -} - -function renderCharts () { - - var data = collectData(); - - $('#chartsContainer').highcharts( $.extend( {}, chartsConfig[ currentChartType ], { - - credits: { - enabled: false - }, - exporting: { - enabled: false - }, - title: { - text: data.title, - x: -20 //center - }, - subtitle: { - text: data.subTitle, - x: -20 - }, - xAxis: { - title: { - text: data.xTitle - }, - categories: data.categories - }, - yAxis: { - title: { - text: data.yTitle - }, - plotLines: [{ - value: 0, - width: 1, - color: '#808080' - }] - }, - tooltip: { - enabled: true, - valueSuffix: data.suffix - }, - legend: { - layout: 'vertical', - align: 'right', - verticalAlign: 'middle', - borderWidth: 1 - }, - series: data.series - - } )); - -} - -function updateViewType ( index ) { - - $( "#scrollBed" ).css( 'marginLeft', -index*324+'px' ); - -} - -function collectData () { - - var form = document.forms[ 'data-form' ], - data = null; - - if ( currentChartType !== chartsConfig.length - 1 ) { - - data = getSeriesAndCategories(); - $.extend( data, getUserConfig() ); - - //饼图数据格式 - } else { - data = getSeriesForPieChart(); - data.title = form[ 'title' ].value; - data.suffix = form[ 'unit' ].value; - } - - return data; - -} - -/** - * 获取用户配置信息 - */ -function getUserConfig () { - - var form = document.forms[ 'data-form' ], - info = { - title: form[ 'title' ].value, - subTitle: form[ 'sub-title' ].value, - xTitle: form[ 'x-title' ].value, - yTitle: form[ 'y-title' ].value, - suffix: form[ 'unit' ].value, - //数据对齐方式 - tableDataFormat: getTableDataFormat (), - //饼图提示文字 - tip: $( "#tipInput" ).val() - }; - - return info; - -} - -function setUserConfig ( config ) { - - var form = document.forms[ 'data-form' ]; - - config.title && ( form[ 'title' ].value = config.title ); - config.subTitle && ( form[ 'sub-title' ].value = config.subTitle ); - config.xTitle && ( form[ 'x-title' ].value = config.xTitle ); - config.yTitle && ( form[ 'y-title' ].value = config.yTitle ); - config.suffix && ( form[ 'unit' ].value = config.suffix ); - config.dataFormat == "-1" && ( form[ 'charts-format' ][ 1 ].checked = true ); - config.tip && ( form[ 'tip' ].value = config.tip ); - currentChartType = config.chartType || 0; - -} - -function getSeriesAndCategories () { - - var form = document.forms[ 'data-form' ], - series = [], - categories = [], - tmp = [], - tableData = getTableData(); - - //反转数据 - if ( getTableDataFormat() === "-1" ) { - - for ( var i = 0, len = tableData.length; i < len; i++ ) { - - for ( var j = 0, jlen = tableData[ i ].length; j < jlen; j++ ) { - - if ( !tmp[ j ] ) { - tmp[ j ] = []; - } - - tmp[ j ][ i ] = tableData[ i ][ j ]; - - } - - } - - tableData = tmp; - - } - - categories = tableData[0].slice( 1 ); - - for ( var i = 1, data; data = tableData[ i ]; i++ ) { - - series.push( { - name: data[ 0 ], - data: data.slice( 1 ) - } ); - - } - - return { - series: series, - categories: categories - }; - -} - -/* - * 获取数据源数据对齐方式 - */ -function getTableDataFormat () { - - var form = document.forms[ 'data-form' ], - items = form['charts-format']; - - return items[ 0 ].checked ? items[ 0 ].value : items[ 1 ].value; - -} - -/* - * 禁用非饼图类型的配置项 - */ -function disableNotPieConfig() { - - updateConfigItem( 'disable' ); - -} - -/* - * 启用非饼图类型的配置项 - */ -function enableNotPieConfig() { - - updateConfigItem( 'enable' ); - -} - -function updateConfigItem ( value ) { - - var table = $( "#showTable" )[ 0 ], - isDisable = value === 'disable' ? true : false; - - //table中的input处理 - for ( var i = 2 , row; row = table.rows[ i ]; i++ ) { - - for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) { - - $( "input", cell ).attr( "disabled", isDisable ); - - } - - } - - //其他项处理 - $( "input.not-pie-item" ).attr( "disabled", isDisable ); - $( "#tipInput" ).attr( "disabled", !isDisable ) - -} - -/* - * 获取饼图数据 - * 饼图的数据只取第一行的 - **/ -function getSeriesForPieChart () { - - var series = { - type: 'pie', - name: $("#tipInput").val(), - data: [] - }, - tableData = getTableData(); - - - for ( var j = 1, jlen = tableData[ 0 ].length; j < jlen; j++ ) { - - var title = tableData[ 0 ][ j ], - val = tableData[ 1 ][ j ]; - - series.data.push( [ title, val ] ); - - } - - return { - series: [ series ] - }; - -} - -function getTableData () { - - var table = document.getElementById( "showTable" ), - xCount = table.rows[0].cells.length - 1, - values = getTableInputValue(); - - for ( var i = 0, value; value = values[ i ]; i++ ) { - - tableData[ Math.floor( i / xCount ) + 1 ][ i % xCount + 1 ] = values[ i ]; - - } - - return tableData; - -} - -function getTableInputValue () { - - var table = document.getElementById( "showTable" ), - inputs = table.getElementsByTagName( "input" ), - values = []; - - for ( var i = 0, input; input = inputs[ i ]; i++ ) { - values.push( input.value | 0 ); - } - - return values; - -} - -function getCellValue ( cell ) { - - var value = utils.trim( ( cell.innerText || cell.textContent || '' ) ); - - return value.replace( new RegExp( UE.dom.domUtils.fillChar, 'g' ), '' ).replace( /^\s+|\s+$/g, '' ); - -} - - -//dialog确认事件 -dialog.onok = function () { - - //收集信息 - var form = document.forms[ 'data-form' ], - info = getUserConfig(); - - //添加图表类型 - info.chartType = currentChartType; - - //同步表格数据到编辑器 - syncTableData(); - - //执行图表命令 - editor.execCommand( 'charts', info ); - -}; - -/* - * 同步图表编辑视图的表格数据到编辑器里的原始表格 - */ -function syncTableData () { - - var tableData = getTableData(); - - for ( var i = 1, row; row = editorTable.rows[ i ]; i++ ) { - - for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) { - - cell.innerHTML = tableData[ i ] [ j ]; - - } - - } - -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts0.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts0.png deleted file mode 100644 index 9485e5ed8f83888e782eafae6f7505c79671a985..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts0.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts1.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts1.png deleted file mode 100644 index b5a00392866946feb7cf81da39f6c6ec6e0b50b7..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts1.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts2.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts2.png deleted file mode 100644 index 7c91a39ffac43e0867bec1df89b73e10e0b28c43..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts2.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts3.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts3.png deleted file mode 100644 index a6bc29bfc163974ece14f8f21a897fa908736b8f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts3.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts4.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts4.png deleted file mode 100644 index 742006adc9cee3c07b1a390da6991a84d1da99d6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts4.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts5.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts5.png deleted file mode 100644 index c49a29609d8e8f9bdf101e91021d40c1cb3d4175..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/charts/images/charts5.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/emotion.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/emotion.css deleted file mode 100644 index f801105ad0afd83266a71732cc5ffea1379977c7..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/emotion.css +++ /dev/null @@ -1,43 +0,0 @@ -.jd img{ - background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} -.pp img{ - background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:25px;height:25px;display:block; -} -.ldw img{ - background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} -.tsj img{ - background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} -.cat img{ - background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} -.bb img{ - background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} -.youa img{ - background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} - -.smileytable td {height: 37px;} -#tabPanel{margin-left:5px;overflow: hidden;} -#tabContent {float:left;background:#FFFFFF;} -#tabContent div{display: none;width:480px;overflow:hidden;} -#tabIconReview.show{left:17px;display:block;} -.menuFocus{background:#ACCD3C;} -.menuDefault{background:#FFFFFF;} -#tabIconReview{position:absolute;left:406px;left:398px \9;top:41px;z-index:65533;width:90px;height:76px;} -img.review{width:90px;height:76px;border:2px solid #9cb945;background:#FFFFFF;background-position:center;background-repeat:no-repeat;} - -.wrapper .tabbody{position:relative;float:left;clear:both;padding:10px;width: 95%;} -.tabbody table{width: 100%;} -.tabbody td{border:1px solid #BAC498;} -.tabbody td span{display: block;zoom:1;padding:0 4px;} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/emotion.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/emotion.html deleted file mode 100644 index 3a9584f9bd3380b13d05b4bf7f48f04bdc187c95..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/emotion.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - -
                      -
                      - - - - - - - -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      - -
                      - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/emotion.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/emotion.js deleted file mode 100644 index 2978faa64f0fefdabd3da8830ef7e0321617131f..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/emotion.js +++ /dev/null @@ -1,186 +0,0 @@ -window.onload = function () { - editor.setOpt({ - emotionLocalization:false - }); - - emotion.SmileyPath = editor.options.emotionLocalization === true ? 'images/' : "//imgbaidu.b0.upaiyun.com/hi/"; - emotion.SmileyBox = createTabList( emotion.tabNum ); - emotion.tabExist = createArr( emotion.tabNum ); - - initImgName(); - initEvtHandler( "tabHeads" ); -}; - -function initImgName() { - for ( var pro in emotion.SmilmgName ) { - var tempName = emotion.SmilmgName[pro], - tempBox = emotion.SmileyBox[pro], - tempStr = ""; - - if ( tempBox.length ) return; - for ( var i = 1; i <= tempName[1]; i++ ) { - tempStr = tempName[0]; - if ( i < 10 ) tempStr = tempStr + '0'; - tempStr = tempStr + i + '.gif'; - tempBox.push( tempStr ); - } - } -} - -function initEvtHandler( conId ) { - var tabHeads = $G( conId ); - for ( var i = 0, j = 0; i < tabHeads.childNodes.length; i++ ) { - var tabObj = tabHeads.childNodes[i]; - if ( tabObj.nodeType == 1 ) { - domUtils.on( tabObj, "click", (function ( index ) { - return function () { - switchTab( index ); - }; - })( j ) ); - j++; - } - } - switchTab( 0 ); - $G( "tabIconReview" ).style.display = 'none'; -} - -function InsertSmiley( url, evt ) { - var obj = { - src:editor.options.emotionLocalization ? editor.options.UEDITOR_HOME_URL + "dialogs/emotion/" + url : url - }; - obj._src = obj.src; - editor.execCommand( 'insertimage', obj ); - if ( !evt.ctrlKey ) { - dialog.popup.hide(); - } -} - -function switchTab( index ) { - - autoHeight( index ); - if ( emotion.tabExist[index] == 0 ) { - emotion.tabExist[index] = 1; - createTab( 'tab' + index ); - } - //获取呈现元素句柄数组 - var tabHeads = $G( "tabHeads" ).getElementsByTagName( "span" ), - tabBodys = $G( "tabBodys" ).getElementsByTagName( "div" ), - i = 0, L = tabHeads.length; - //隐藏所有呈现元素 - for ( ; i < L; i++ ) { - tabHeads[i].className = ""; - tabBodys[i].style.display = "none"; - } - //显示对应呈现元素 - tabHeads[index].className = "focus"; - tabBodys[index].style.display = "block"; -} - -function autoHeight( index ) { - var iframe = dialog.getDom( "iframe" ), - parent = iframe.parentNode.parentNode; - switch ( index ) { - case 0: - iframe.style.height = "380px"; - parent.style.height = "392px"; - break; - case 1: - iframe.style.height = "220px"; - parent.style.height = "232px"; - break; - case 2: - iframe.style.height = "260px"; - parent.style.height = "272px"; - break; - case 3: - iframe.style.height = "300px"; - parent.style.height = "312px"; - break; - case 4: - iframe.style.height = "140px"; - parent.style.height = "152px"; - break; - case 5: - iframe.style.height = "260px"; - parent.style.height = "272px"; - break; - case 6: - iframe.style.height = "230px"; - parent.style.height = "242px"; - break; - default: - - } -} - - -function createTab( tabName ) { - var faceVersion = "?v=1.1", //版本号 - tab = $G( tabName ), //获取将要生成的Div句柄 - imagePath = emotion.SmileyPath + emotion.imageFolders[tabName], //获取显示表情和预览表情的路径 - positionLine = 11 / 2, //中间数 - iWidth = iHeight = 35, //图片长宽 - iColWidth = 3, //表格剩余空间的显示比例 - tableCss = emotion.imageCss[tabName], - cssOffset = emotion.imageCssOffset[tabName], - textHTML = [''], - i = 0, imgNum = emotion.SmileyBox[tabName].length, imgColNum = 11, faceImage, - sUrl, realUrl, posflag, offset, infor; - - for ( ; i < imgNum; ) { - textHTML.push( '' ); - for ( var j = 0; j < imgColNum; j++, i++ ) { - faceImage = emotion.SmileyBox[tabName][i]; - if ( faceImage ) { - sUrl = imagePath + faceImage + faceVersion; - realUrl = imagePath + faceImage; - posflag = j < positionLine ? 0 : 1; - offset = cssOffset * i * (-1) - 1; - infor = emotion.SmileyInfor[tabName][i]; - - textHTML.push( '' ); - } - textHTML.push( '' ); - } - textHTML.push( '
                      ' ); - textHTML.push( '' ); - textHTML.push( '' ); - textHTML.push( '' ); - } else { - textHTML.push( '' ); - } - textHTML.push( '
                      ' ); - textHTML = textHTML.join( "" ); - tab.innerHTML = textHTML; -} - -function over( td, srcPath, posFlag ) { - td.style.backgroundColor = "#ACCD3C"; - $G( 'faceReview' ).style.backgroundImage = "url(" + srcPath + ")"; - if ( posFlag == 1 ) $G( "tabIconReview" ).className = "show"; - $G( "tabIconReview" ).style.display = 'block'; -} - -function out( td ) { - td.style.backgroundColor = "transparent"; - var tabIconRevew = $G( "tabIconReview" ); - tabIconRevew.className = ""; - tabIconRevew.style.display = 'none'; -} - -function createTabList( tabNum ) { - var obj = {}; - for ( var i = 0; i < tabNum; i++ ) { - obj["tab" + i] = []; - } - return obj; -} - -function createArr( tabNum ) { - var arr = []; - for ( var i = 0; i < tabNum; i++ ) { - arr[i] = 0; - } - return arr; -} - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/0.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/0.gif deleted file mode 100644 index 6964168b947afc2cf76780a85f43d4f77c257b77..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/0.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/bface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/bface.gif deleted file mode 100644 index 14fe618ab58a9d46fee90074386b5581d47b92c9..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/bface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/cface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/cface.gif deleted file mode 100644 index bff947f5216a49d8cd7fdd8d4e825808b3d14f6e..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/cface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/fface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/fface.gif deleted file mode 100644 index 0d8a6afeb1cb2cc40c5d76f90630d8a9c1323ffe..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/fface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/jxface2.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/jxface2.gif deleted file mode 100644 index a959c90f7eb17adc455982b040244fd583eed888..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/jxface2.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/neweditor-tab-bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/neweditor-tab-bg.png deleted file mode 100644 index 8f398b0958cdc5136a23b9745becc23a833aa325..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/neweditor-tab-bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/tface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/tface.gif deleted file mode 100644 index 1354f54b961211fb0253ccbd27a81da5dab5a639..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/tface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/wface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/wface.gif deleted file mode 100644 index 5667160d8b6228d301fccb56a8c1441b4c4e4b58..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/wface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/yface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/yface.gif deleted file mode 100644 index 51608be0e74434388bcfe1f55da5c3c019f0a708..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/emotion/images/yface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/buttoniconex.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/buttoniconex.css deleted file mode 100644 index 5a32251238195c7889c9b3837cbd74af0232dfbb..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/buttoniconex.css +++ /dev/null @@ -1,271 +0,0 @@ - -@font-face {font-family: "edui-notadd"; - src: url('../fonts/iconfont.eot?t=1506766254785'); /* IE9*/ - src: url('../fonts/iconfont.eot?t=1506766254785#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAADIwAAsAAAAAZAgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFZXZkiAY21hcAAAAYAAAAMGAAAIQN7zSFpnbHlmAAAEiAAAJ0cAAE5UD3hcJ2hlYWQAACvQAAAAMQAAADYQwGDiaGhlYQAALAQAAAAgAAAAJAmVBYlobXR4AAAsJAAAACIAAAHs9Hv/+2xvY2EAACxIAAAA+AAAAPjshwA0bWF4cAAALUAAAAAfAAAAIAGnALRuYW1lAAAtYAAAAVQAAAKR8lzSlXBvc3QAAC60AAADewAABicEr1jfeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkEWKcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGBwYKp5VMzf8b2CIYW5k+AEUZgTJAQDmcwx7eJzF1ddWFFEUhOF/SIpizhHFnDDnHMGECcWIOUcwjbh83bryHbT2FDc+gcP66OndzOL06b1rgE6g3bZaB7QN0/A7GkOuNlr1dqa16h2NPp93+a8atNHUzz9/fN4UraM/4mtdreNpLnGZmcxmHpsZ4gqnuMo1ZjCX+SxgNX2sZQvbuc5JprCQRSxhKctYzgpW0ssq1rCBjdxgmE3sZi/HOM4Jr6WT/Uyl22uazixucosRFnObdV7pNnawk13s4Q53uccA+zjAQe7zgEOM8pBHjPOYwzzhCE99F+uZ4/t55nUf5QzP6aGfF5zlJecY9OfPc8GrvcgrXvOGt7zjPR/4yCfG+MwXvvrnG99p8oMJ33oX/+3V+H//+t9XT/3q/D159suak7xEEe4R1Ah3C2oL9w1qD3cQ6gj3EuoMdxXqCvcXmhLuNDQ13HOoO9x9aFq4D9H0cEeinnBvoknuUjQz3K9oVrhz0exwV6A54W5Gc8N9jeaFOxzND/c6WhDuerQw3P9oUVD3sTio60uCur40qNqyoGrLg6qtCKq2Mqhab1C1VUHVVgdV6wvPHZrkCURrw7OI1oWnEq0PzyfaEJ5UtDE8s2hTeHrR5vAcoy3hiUZbw7ONtkXlkfqj8knbw5OPdgT1nHcG9Zx3RWWVdgf1nPcE9Qz3hlMD7QvnB9ofThJ0IKjncDCcLuhQUHtwOCozdSSotR8Nao3Hglrj8aDWeCKodZ0MpxU6Fc4tdDqcYOhMOIvQ2aDWfi6o9Q4Etd7BcOah8+H0QxeCuo+L4UREl8LZiC6HUxINhfMSXQknJ7oa1B5cC6cpuh7UftwIJywaDmq+bwbVO7eCmqGRqO8f3Q5nMroT9a2iu0Ht8b2g9uZ+OLvRg6gE0mhQffQwnOzoUVB7+Tic9uhJUPv6NKi9fBat/X8e1L6+CGpfX0YrE14Ftcevg6q9Car2Nqjau6Bq74OqfQiq9jGo2qegamNB1caDqn0O6vglqOPXoI7fovX+e1C1ZlC1H1HZrYmgaj+Dib9UUGIjAAB4nOV8eZwbxblgfVU6RpoZ3a2e0Yw0knokjT33tA6Pj3Hjc2xjbAPhMAaGQOxwmMQDCeF0E24WAoElL3aAmDPh5SVsNm85Qh70O5YkLzh52ZdsyEHibO77R5JfDpB69vuqpRnN4AuS/PaPlVRd1dXV1XV89/e1mJuxme+Lz4kOFmV9bJStYVsZA08/ZAM8CZlCcYj3g5JxK2osIApaIePVskNiBahZTyw+Vi7mVY/XE4QApEDPjJULQ7wApeIEXwZj8SRAZ1filEiuOyLuBn9HIXWTvZE/DEqP1h2cGLQ3DKyMjaWjLVe0RSKdkcgdLR63u4VzVzAAu9W4z+3ze+xH3cGE8rmeRbwH2joLiRPPbE93Rc67tXhpMqf6AEwTol3pwMdWhhNh/F2TiEcjnd5Qe0tHol3rjcEVP2ztiLYl8z9g+AGcqyUsYbBWPCn4wOsD7KQCwtpu77f3b4ed8gA78ZT/GA+yNHdhtg9W70PRhaZkSlpUL+FQcDB0EIZRY4YhmIHtvdjedDFhMsGCLMY6WJJl2CK8N5wJ481aSSvpJV3RoxmsoEpdw8MiLEFG0cP45QZYhmmY+MtVu1ysuhxc330QGKyxq+CqVW3DMixh2thshlErc4bVLG7YONiZeuKWYePoGHPPjsfFWlg7C7NOHMsRny1+dJQnLnyIXX9Ix+wz3Mwnn6HgU2jeBTbIdDbOVrAT2Fq2gW1m29jb2FnsPLaLXcyuYEwtaYpecuN4IKzJ7xtynZrkFMqi1Fhzv4V7aMZuRVcaG2AYFi6SgTNiODWwGgfbMC0D8KqJuW0dVysTsAKcnaALhovVjMYawWFKduPOev6mbgBzFjoIxsXMzIyFa38Ci7MuXG8GKkRxL4egkAmAN5wCdWQ0U8pER0Y9ZcDJ4xIg9JV0OMeElvsNSMWrH4+nAJJxfqLd9YFTU6IdZ0gzvdCCT80wFb5El1Px2iJEcIPfqiVrNl23GMd9nxH/UwBbzrYzlskWvJAvxErlCpQr2dGxuIp36GMqjsH5FYpKzOvx4ticXzmPtCZOdZoPShOwjMvG9ataPkvEB1YA/DDQJuy7FQ4KXN4Whbao25sqjgxuy8SWK/6kW7S1RQJxb6SU4SsW+/VCGQJtUftjMO7Jxr3jZ2wZ3pbuj2wdj2wd5S0RXyDYEfYCbA4mQHSHYbINWv3tQau9bSDdetqylj2bCm5PPNgOPNCWGgp4O7zgfcjt7gi3g2n/+D6lqztcyS1e967e1jgAtHeEP0z7wOVmWLgWFXY6Y7l8oVgpaR4v7kHZQ79sgarKlQmoeMr4W4ZkE0/1uAq4Sh4vaESEowrd0g+LQRvRsvJ2uiOPDXE5FYDX2wHKG1blVyV4MtASDoRbgwDxLb6t4/7VY8FMd9LbFueRdpiOi5j9QVdrgEeHwOftCLa1RFpg9Mx8aZ0/lD9Lb5sYHlczHlgajKge9wGItw+kWvqRgvL2cIfHfe+e6OouUDzgskJtYYA2+5lwtysRsJ/y8Hv3h9r9bd2Jxe9Z35fqawEfdCl/BwnGXAiLDh1IsmXsTMJvXAcCQyUFy8BLHGQlYFlXcU7hYiGKYNoPdL2QR/7SA5rTVkXOsgLccTWD7UoEChXkPNkgVKiMyxKOqSJMfY6VKwWV+NIwAlpZtpXPgyv8IfvfQ3Hgaujx54LJwcBzoAR7Agr4fBALZoIKPBMYSAaeeSTcAVzBnkNR8Pkpp3vCjz0XTA0EnwOIhXqCMeemVAjX/7PBfrzrUbwL4vSECPy+FYvhjlD8hcBgKvi5jwURLKIBGA/4YT30BmL43CeeDSQHgs+AGu4KxbCn+JCfbu/EDp8L4k3PfgxLsaD9hYDfftZ+JRhVQh9/hgb9jBrpwgFBLBAn8JJ0FnB9O1mK9RNPGwJcDYQeocRVWo8c4t4EFPPgjiKj80KlPNYDcXUsCOLbfwwP6AMhO5d0LYeu9mwsDGfk4vByOBarfc1+ZAXsgPRew37FaOnw/bGFg/Dw818LRaMhW1Pz9hNiMN0eNNxJeDnUr/fXvmhg+3Pt79+4HnoMr/c1X5vwEAoQv9krxxhnWTbAilK+yGQ9yshoOBbXMyOjuE9YHgLNHYBsvljWccMVyFTUqKoEQMtpJGosQ1qOmxlGAMjg9fA8ipYR36l9IagoQT6Om0Mr9xwMrhkczGYHAXz2wI1v+/SFEG6vfXQqEIkEpqyuXoDeLm5ibmChxpwKJLGWErRbqCf4U1B5NDswuGYIhrJgP3bwJuj/zCPtITPSHcF22LjeC9JjwynVqEbOeWYGgR/4CWwlW8+2sFPYOQj5OFYcMvIenAKOuVIHdTxdAVRWtILmRWLs1Su6qheQKBMAFwu0HHgLwnOK5LIcnlIXqlbR3TGsKGGDJIgfRPSeyhrXr37lWbekazDUHV+uic3v8F0Q64Atq81LjWXGssVGefH9fePGubduOB1ipZYLTupbFa/9d2OkCCNlw369NdZ2envcZ5juK+H9KyrrPhKKHoonALasL67fggAa7e3shl3nBBZ3ivFRy7JK1m03WtbKE4SWmNoFkE3C5vSJmTtzk73a+vzXghMDi+7xpSJuyRccOtDHVuPyFGjauBbeAuFvqYg4W6EpjtBUK6qX5hPzeFXIalIKjREsjxGpXIGgjDCuic8+OP6Bbe1b7ljy4LqHhsZAH3po3YPL7tkmtt655MC6h4eKpeFHbSZck9eeU1oyMnLdPdcNjyxZMjp8zaR5YKQEUBo5MHk/tvdvvn3JA5MHhosAxZGHJh+s3HFS67a7lt4vOipT10y2bLhuZBRvG7lug3/y2qGRMu6tZ3YurSjPRZmKXLYHIbqUUUhkQhGqlMOi0MI6yRiAeQnZLbdsE8UHYRo1k3g4skuHnQOzrBpisiB5oYqyKX6qlpQxZCKuTnj+nNiDPL0TV7CCsDQkCrheE1BwlgMfFKflgUyZlsobI0ZRyIDM6aqsFrvdydE1WnYsqoYgl+k7b5SktfGdxYGx2pPg0dalOjpdSkdqnWa/BodymezavP07iBY2ZbLJz+Y3LFvs9ueTydX5gTO0brVquruS2oV8F4TU6EgyO97REXXZrxXWd8SisBkrlVV1+kRr1cM0lPsQ7xsIq0ikJo2hiDy/RHQdERrlEZ3wJNOE6cKqmnX0NCT6giWRuI519jtI6m5CYkG5kDXUgvAVf3TOET+rJ5j13ngdax06igdTsLq8yqLhLtw82kdK5u4D8Dvao5rcL9w1ku8G7f+Usp8peT3qBAbqBAIlXabjPRB20B2FTwd9wxY3ayZn/OJTtryLm66nb7rpaRfCg23iKVaiLGHe/hmB9WDW5Qcpxxkop/sYQ0Ul40N1rKLyT9Te9gn4AHzeDtmHRix8bs1AedQ2x3/ww1m543qxGqX7MEJKWOOVgiusZBoFuGd/609W2b/iL8j81xx6odNa/YL93j/OlbAf5N0vSDkyy4awHxXnE52QDBdLOCcUIwqVXLRS57pqFBy6JufN//PE4vWTqfF1wC85+eRLOKwdhw179Z321we3nvTCJcFLXjjptAHEhA3l8gaQxx9ODhTdcJ8yZWy7RIhLthlTiv1ub2Vgot/+ycbla9avPAW6YU+jNR5xmq4mXFQRviqkuTJvnKllVskzgSNsjEloKE5WyigPaKNZL1WPqXEaKwlUqAZw9i37e243ZL71Lci43fb3vvV8ze2uPe8cDdfizAqX1rk5ekn7OyeDgX3tMNK3/Jx0FJU9kxo33VxdO3vb8zVY1l2YiAz1d2TOUNadCbzFHN4Y7btootes66M0CbAIAsMINahp4ZnJ6nNz9p8jVCosx1ilC/QuELM45OCMWIAv5oEDq+0Zo4E0ooE8CzAE1RWbwAYfveBSDZrYo0QQ9+xYSIftQhpUIlkjnAOJv1qGcDm6oFxB0rTgJABxgdjKqmlhBcPhYNWgY1N5mLPOPGhJmyU1LTl7QhkcmrJNVHbCqTD+qpaTc6Yl6epSbWa2xBDym+FCY8Mofa5HLnyulDxIwsiMxZE2NpXVN1kfPUK9ONQ0qa/U5NQ41Xz6r1QvDGfm1rEzPr9psy1i/rrMWxX3EcriCPVHunfeSth7mqYAe96w8cdqNe/K4ZfANo86+eOau/dIu/pm6w8dYYZ/SfktTfv/5bybtuyI8ztSm790ux0+6GL8etQ7UPLIlRzepTkSd0V3OFWmHxwmoaM64vC1kVGdzvGE/3HJJs43LfnwkhORyt+7+8Hd97oxsx/9kMspuerXx0/kpvueS81r+MbxJZsANo3vvluIu3fPHuddcHi7KSzcE0VqbVqpWZdxyHohjCubL6BiVK5kUNMnNhtXw8K0kA/Znu6CEIVu/nvKezvBW4v4ALzwy1bkDx3P+jk3v9DRg/JUd9Xs1ijnt3T2QG3Si/qQuBSPfgslQn/t3oaO5sBIl5TU8qinoUQrJbP6mpG8pkh9TclUwoAc00tSTkmvaChaZIQRCRxCXkEs45AU0tIoHNVM05Q8hps7ExaxG24cCETqghfeUjMDEQurgaHUW9u+EwUZY1YeO8ifYjHWixqjs3vFgocYt+rsnK7kUOBAXRbV3QAMQ77sxq1cCSjpQgqC4Mnzg/47/Jn+nuHONbmlK8D99r67qlfDb4KDUW/AFbHDWGgJuDnY4Yg70BIdDMJvIq6ANzq4ObnhxJ4EuHv07iTqBX3lSnrD+fBr2Qr15YhTmIBfhwaoh4gdcQpNeo7GNtAK6nVzRd3koepS7SnVObVCIlWmUYPXGsaOhpGjpNdb8S5PvuRylfL2807uAc+Oa93ua3fAmh3XeDD/s/1FWXPN2V5wO21gVb7oprZepwkKFjCSi+VGALNofgRMfuVZsbOu5JhFd1zJUdtwCmb9elMzqj7MvsDh9sX9t9oXMFOTtDGudNPG/MfxbEzdVuLI6F7mZwHCOqFXMqoOXag2KRm++cCvdo9DbPxOe92unfZuktZJtH78cWiHcfvz9mWG7GOv+BPubztiboej0yuOfI9qGHgLXtXHUU4Xd3l3eGHZ4OBywI2yWzquOu8q+zvwADxQ2wZRiP6s9ZmibwAvLh/wlZ/myxN7L9hrf90+Df4euuwfSXysukAQ9Q5Kr8wEaQDOcEWlXInFe8BdKqe9ajnu9RDgSP05rur5QgW3I1uu6OVKVB8Cb8mrlshUCH32y3s2weTk5fbLj+2I8FbfaVzl9h+ia1rua12ku6/2X92eKkUhsg7XY533zHHXKj6kqRvj3173xS/4Vl5eJPUHtQ1mG6/3jeWGI7/55eXv2xFZ0jIWhbbPCEBA7QgkF3sHjBajDTrg/JOKHEXRK1Pd7K81H0DCrZZUb4ksfm9tPvYn5IS+2PIXTUg0yeYR5C8s50N9eoFYTsq/VPX5G2TxqinFYFT9F4je1X8W8+kx8ew0W8RGjqzZAJlGivmsx90oCIe+HFWlsVdBb7kXf7C3XrgeWRNqA3cfXaHhy7qocW+Xk9k5yeDm+bnI31NAvjZc18hK2hwTUUjXIqbSD9L5kpF7SaqPdD8RIpKhL0wamUmmOTKpGabkEZHAucgkrHMDEUCaRM4nVHpJizHJZsJNs8FXTMuYYciFsNZCHpNuNGZg4gU+p1/N8eARtvzN8eFhQPxq1niPlzFf/8lw6wX2IN++Zs127hyPl1Xv/Ae1y/49TM3eyLc79qgXpH1V4B4Q/x5ECY/RStIX55RRcO0VXFLIhPUwKmI5p14L4+qT/6eUqYxoJMSNxZXRmEdD3dAky5Bt8gceqJkPBGMWAqtpxYI1zeHm4+vtb3xjzXLB0oDMvjtKRhlcbTj4mc9ANGivHpxhMAj/FIzCZZfZl73Pnvz8q++zTiFLTCAQadbbyQfZxhJ1D2ROD0vHXCVMbkiEAjKnRcXp1Sdc+FhCGXw4s0ySKzgjD2SV8Se+Qd5OMCzaX9sUztAt2uOstD2z+to02+u0Jghdxlay1SgTb5KW2tPZWagnni/9ke9il7Er2NVsL7uffYyxaEULcmUlwnFFw+TGI5VLmADLmrxcCddPYWGODZE9Vhq5RmW8W1RKQa5Xos3VWKZzDVPJq6/kJW8ursfJHkxCBBleHGKplolaetwKkshKnmjkM9N906np6dTdz+zrWQ9fmO7bY98+jR8Y2FOY3ogX76Ez/tqeRXtqw1i4dXrRdO0hLMSxAFhT+xU2gl9g4eo9fXv24Qn/Mt3yApb+bnra/grm+6nJ1dPTJ/WeuPFDz2PHvdh82vsZX+vIqT0QCrxbUQGEfXL37sD73u1ffXLLi3Ce/wM7hOcyvmGpCODwsINn7u57pqdvPXZt376nb3rfdGEPDNCT7sGLtZ/hAPlr0zS2RTTKaTtKhXh9BDjKaX42DrB2tZzPH/qm+3A+fTjMafBhjq1o1ldT21/09p34ob7n8bwXH/LS7ZDPRNL++Him/Vnr3uR2r/fsHoimBy/y6St8kF/gs2+GG9YJRKMQb+pJJyJfLzf7bCkZDu0nGy6dEqy6WNWQF+S1mskRZQhOAwvwYc5f3styiM+jzCC7OVHIjCjpCqUcnUBJum6VRu5Gbl9RCH3UFVxXohXknkh1SyiX4IWCXnDJoVmIPzajeAGb3MZEQRG31qnDBmLxuVN7zam0lZ4y907tndq8mZ8IRYlf1gyyy5caJ84pftascf3brVnYaR9Ikxe6Zp191dU7YvsPBHZcfdXZV7248U3Mj2iAG6VeSkKGJJBrHlMjj2qqhrMgHUQj8ThXIJGLlBG1gvNDZIGi/RJHnmBZZFh/qXHinFrWwbVrfc+Zmr0fptJXbLjxRm7I0d52lzPaZzcK84gL1LH+tN7v9A46C6R8JygXaPPmzU5MyA1yflKuCUB2iBel420sxWPkj0PqWoECXoml+JjjkhviWSkiK1hFmA0F8VLtTz1bdmxdkc2m4GtKaUVpUTyu2IPKysUKPFS0p2Kq2leaKMXgaz3Z7IqtO7b22Ep3emjbhcv1HTneW+RtNktls8u27DgpBQdj8XhfaUUxZo/EFk3E4H7dfkcM+yyoagy+ktpy1pbl+BxbzW0fW3HRloF0kqt6Pb5lb91Xgxwxn/W6iXvk61ZfYorxsUounNfmKop58b0W4XPVlLZQsrc8KW20k9zld/FPdudKk5xPlkuTIiL2AtzCQ+21+8KAVY4xF2YArrErEZis4D18bUn0EI8Qs/w5g/BxAo5FRyqHylJdeW+4z2Kkd9D6Ees4umWU95iLKi3vuAjefbansKZzSW6qEr3uCQHi8Vv84+/o+z6cN89CWjeams3W0DUfRMXj2u9eBZBMGL194uN721o//DjkNWiFX0rJbk7Sq14/vzOGkN+YUytSlAyu8DArI/dZxzazU9mZbApnObuqQ6DGY95CuVjwFkvFCoVO4Gm+VNHyBYqJQJke5WFH96p4dU9MLSCQqXpcxSmr2XxBD4Barki7PeGSlwgGkgyryTZxejgy5fU+4r3Mg79fbIsMLN2kPBXo9E35Ontzvk2J9f2PTXlbzgtHOg537Yraz8mfxQAJAmdN9o6P58/pg76z+s8APrBI5Ac88njDxKLuJdrWbCqVDQ6v7MkMeK4r7OgXhbP7/vcbrohTkLM/lag9Svjo2HPlurlQd4tI2lFgS9iqOs0Qzsw0RY8XinkVBYexSj4n6YeCJ2Wy41JOcBPzSrO/Rq0VeZmf1jSP2mkjY6fBwI/S6fcC1H4oLqqtLY/vXrlp47+8/ewW35rtgB9+1pp2ePCjN988/g0pgTxVux2ljlfs12+C9VrSa//u1ps/KUOjPnobXARj71tCGd++urXV17Z2O4el7xr5CFw067934iMG2QqS8YOgFYQmENLzmEd1crnoalzFklY5Fnx/2ecNuXpPunhzJMIDoQ2X/dcbDX+oxRNu8a+/7c6LP3EslwCcMzhwxqfhZPtTZ5x5+nY4uXY36APbR3YMDiAZffd/HBO8m+YTRBmr2OzvO/yI+4Hkl/wwaFGhrwQd1UBdzDn8jjTQu+7flEq6e9NvO/D1H99/iuEpaFMP/Ui6/I42wI+sPGHVxEfsD9rvevi21eseBnOWxlyPeLiRESGXXET1ylAkJM8elLFmJXzHUR2AJDhqGErS7pFRbKUEyEOtSBd1iYItCqhHCK9bTCoDZbMyEB+/a1tnamKxa+uqS/WJh192uV5+5JGXXZ3q1p6MGwIvvQQB98pxe18sAYFQKCA6cwkeCIcDvPMPl0KU74v3l8zygKJPeLtyhWSwtxQG1zcfefibLtc3H4axcxYX9fetEi/Zv0WFLfilsx5amUhEn/an82m/EVHViCGLz0Y7gL3ubt4jt+TCDLwFFGBAagMUC4bKGIoShD18/8GDZJszawYydm4ZZtXiJvzxIz+zr77f/iEqUog1FHhGthJWl5uaYz0m2UnsZIp9eFPxHtFZoCm9IeIDCCfCOZK2cTP0GMJLQfMeX/RHz6wfmVnzHGG9tXdsee+HB3lX/+V9v3dz4XKdN3h5/7FDQYTVgDijCcyceJDaN+Cimgn+pywr2h2OKaplNdZ+kaT/tEIs1yD1xF2lwYNIWR4FPYQt3AE854bjQZXH94v/ceu65RxJ1VkJeyU31mfsdwpzfabPbLSg463/6IIu2FFjS8W6KitvW0+xoeVt/BZWj1+4Hvd/L2pSHmkJi5DPOpdRSS0Mz6VFvADX2je8ACdIna8p2QKued6cmZmVZVHAbbJZcOwzwfJsjHrtanYzVJrKuSOUKVDCOlAzpfnflI4w6QoQhnQD2dJHAFQFrzY5DEhsMw/nJ2g4BA47Psi0gnyqJkfgbSq7j1Am5dg6IEcWlKP8tHCcF3JId8mRBeUo7WZ3Byfl9agDrO9Ni8stACXkLrYItdMV7CM4yrw2KkVFVAopEGiCvNZ1fd09gjjS0NwpNJBGmkUpYbaESOalIJFhni/E8wVtMd2dJ6GhPKZmdRkORnaPeLlAIhUKfI5XPKYWFSRrcRSuKmqZCjJmcxnIkMU4hSxWvOI1j687ZF+78aLkDYGWbSG4pb1tBtIj6fRouvYx6MxmxzLpjlPqNV+q5/DZxHceWLUs0S0Eb0uJnk7wBDyxoaKA6hOtiXbgZ5+yaG0htWFxN28deHuxpS0VvPjp9fpagE5lUdnTk2zxtbdwV3BJvnN9wT116opdeU8x5g5idxd73HH7uvN/asKpPlEOwE2t2d0dPZmRdKbjK7jV2WxnZ5p/We1JU83yev7ih//VAx2tnf62lvJi0c7BxdXCF74VBUjHssbu5GJ/C7hDEYC27ZMjj13Q3o7i3xhSqBYcULa1TRvztbaDljilxN++PrV2qTLr2xeP8m8zjXZwGDcRaWBMRRaXIZ5B9M2LQltcHaP1LOfFTaMX3h5JJPPu2Enba68mNOD5bu75ZCQSTXVEer430JWAx7FJCFlAe8fJZ2sJkczxf4hWogoEk98d1JbWn/kA/yY9M1peCWWy/MYoPj9D0fjEfUmopOBT3PF8+fqRC2+PdiZz4FZOOpO3dWn4yNprn5p7ZDc8OvvIbTu0Lnd3jn9y7pHLGEXBzzwpDorN8+K8c6yfVRB610j7Xz3KWqtrdJW6Rtec54jmhCsyEt5pnnNitksyPJkzfde+XbrYX7v51d/wV38D/X/6A//THyD185/yn//UvggO2rq+X9+PP3tk134dHty/swjX7N+l67tq+/Dqzo/rd9j7Gge89r/sg+dh8337XtL3XajrO+fbXf/S2HiwjhSA//+rH7rlCDaVnvlWlYX5QsvK4aLhyZw+z7xSs5ozx8ZCtPXHCKeJec9n0bqddOEXQa26kyPsvCFPFHfqu3SZUMKl2KzD9OvYGGXv4WMk+aRjpkRxhun44/I4w4qiWK85+tzch0nyiaDTbOyDhy/PnyXhxfvFueI67LsDOecSidcBYgeIsRoWtCGBVEzVS2oU+VGlVFHkJV1kCzAkvYSkepElREjW0gUUigVXcJfwJXn/UCi09+Js2uV3RcbF+MgXr9FCMCaCoJf/OeKzf6F2uF68774XXR2q/Qtf5KpHROHPfy6IR3jRrbZ1tsFFnsi1vrQ/lxnu4OvBrrVm4Ta42u+B22qBIHy378yh+14U4sX7hs7ss7NB8TnxyFWbV9nb4MlVm696pDlWn0nZQHpzyGoe1pVMSQ8LixC3aoJlWYjcEygBnACGUTPJ6dBky26svYzkUnFvvXVYoqguk7xNJpUoCTIq0UsbBnPev/qqUJr2rg6VYRl9SDtG1vyS2FfdBfvsXSiS49Hm8tymslD0XTYr4pbBTr0ROybfcyJfp+wxRzHFqFh2gTarMsP2gUODuy3T+t0pj8OhqiWVYMGM/ftlqGLUPsTbCbeqtDKEv++Xsn0BdaWt7FR2BtvBptgF2HehTCIschmFYva9hTyVPWTHQNEhBfooeYnzBeQ7o8gIvR4S68miMYYcqjgMUgHAO5A1NTR5x9xXqtsCVbJ5/p+720HcsrM4EBLi5pNvcHn9wh2hmoH8BwK5+MBSCAW0UEdn6LGANoCCsOdK4XeZQlypdm3bzSHqeTR0d1VaKmqWNWsSNKzhD/YO7LxFYAMhWsXN225yodLg79exLnB3IARLB5RcYDoEEHrME0bpukO9VgjT1eq6yst3bxsqtD8SGhb/rUoOJqL8htO3pPM/EV8RXQttyIfd23rSj7zHjSS6ijtthgyrCLv0l/SD+tHs1WH5DOdZygK6Q3DIHXleBrQ6sYfS5ikTwSjBuElvnzmElNCkpUmObugPcZSnU0gKBXFKPUxKpEzzypJUIxYgLjlLZNe3gaPsTl+JGNYMaRP4I8OPUzrqM3M+LqWKMAKLk5rLQnKIGuOmXX8o1PdHul+BzbfJI47PMgzPG9Y0j7qs9Ks1VlCEtbBwIiCQqKFEvQxSoMgYCJHVsvkC6nNj5VKRQvQpBLLeSkrTCr3UQ3HuAUCQtGqzCdVpCo/oKAT71RPyfNlKio8what3Qh1N9kdjvZ2dkQgUYpnWkfhEr6+ygnROVz4j1gkDl4x+tIjI/cyeTVvTXSCU8NKuFJQXL1maOdE2uztHu3kkmCi1BVMA4cBoIola9Wivu7vX05sQi8aOCE89jgcCZGR7afbrps11BKISbbCNWAWW4z90Us0yDGlH5+TzqPtiTcN5UVEYUi46NmwRXSB/cT01lwU7OgRx80hgcCzYkj4WMog4aV6ZHR2EzCPBuwNbTvxAK4tJ/36JPAfNEmDG0e/mh1cevVIg9MiwWQuP1fPxsFTTxPnHW8ktOjZ+tnnkMynzzMHH3IplEUekNOeW+EGhGhnRJMhBPYUdoU7uCu2Ebc3znNVfjJitc2Q7PJVvOdpm81rLlpgvGBPB7IIxNUuU0YKE1/BRBE3HDWSYC8ZyOFdeleDJphcx51GQ+TTEga04YZGk+uEcMQJKBcfPHRaO0xtHakqqTF2R/1A6Cy0kDgasrBkGvSEijSRA75IYuHjOMnLLeQUXDHrvTsY+Muln0Oht46gmaaJOpFh1kFVzewteqlR1tSLryeVe+sT0+Dj+9oyPj38CPv+2U0VlfHiDGFlSeQLPTfKFmSj9OB7O16tg/+sdd8Kdd8AKW77/O0/On+9tl9woJ9/HzdTfy3UUKw2f3QnOfuh1yu2gMu42wy0gr6UtnXIGlxkKJQat+GyiDbFNZ4PqC9JwwuLHf0TdQ5NvyJJbFUcTlW8M40bU08KvI70hDJooytHHqH+lF8BcCCjOOJwjtjAbic6Pw8d8NE3ocFoQKZwNyCSweaMK5NgH+JfhHwk0cpUMJ8X4xwcdOJX+lcZYMjLqcoHEAJl59ljkZvSClodstfQiT0W+vAlsobmQT9UMd27M5RrL8X938toyAHqLNNzG/62em3PWxBqD4Zw4rXcEMK/+PebCCrVVn2kLhdrEZFvosGsn3y8iRxfFppINwd2IgDmGD8KSTMqh0NKSLSP/2LF8EJwQz6hDgDCO6RxpfodiVs6nvSYCSTw0R5FRmCOEEZzQm/yNJIyGGG5K7ooDboo1JTvCvOiwqJferCtU6FW6NwSBrTLvf9B88H55fEOoV21X4xL+2GHgItccW1SXKBe9mbip+eAhQySON6KZyaVGQDnuyOaWJj67EOfr7+oRDSpoitqQ6wTtQr0c1cIVJDRVfKyLyYCHBmqbpjl3YlEQoUHSm/P+3gzYDjBbRL2IiMuGbOF/QZCVbJGMfnD+C6Jp16JSrqE3Bx28d8Kimlko/SdE7Kw9e86anpbHdVLQsWhZazhl5AyH46bOn0TYTzbuwqM9ZdVpBNIwabGqk436mBfoxhUfyX5SqMcxho16yBW9zmjRXyCAMasZN+jNO/lm6gUhgu96CUwkOfNtbU34QOuQkzOcgzByB2IiumY10FOSVIkUOGrhYOHx9ume3+c/zfZ5w/xeT5jTz4/Zp3qEPv9lfpcr6wMNHoUf9UpPMPnN3j5nnQrXc6IRpQXJrTXiPnOZRow+ah3hYp4Ayot6CJalrKg4w57faEpIqHUS3GXv4VOHZj+2YTTCRF+wGcX1c3mcevik93Q13sWEqaqBEzfoXNC7mSKdNtI1Cw+H0mbj68SL3hQJ2AfkjVOBSPWar55zJ70q4FRQL+lIYK4jlI2Pxrcb8XtL2AlsG67WTvbeN67YwtUqSSrrcIi3uIrR41nFqdkPPzRXPq71PHQcyznD5k7fysrWY1HesLYdMtpmFVvHTjsy9OX+JhD314C1A29tLd4yPh4Ouv7akDSHjXDgOFbob4aM7FgyjIQQlGOkbUnSPBTkSDqXkhWVmuQYrGKkChOPmJVjSBLXpLSpk6xrpw07DYcMwJnDofpZ410O556QlPwY0H+BFPIBeu9EGhVpTF5Pdhjy9C5KpZwCr7jH3+l/ZU973he8xZ/w/85fvcDFLv2tr8t3a8CXa9/zSnvOFwDV53tlT8CXb7/Fj00S9mUocl/4O7//FrwvsOcVaunYV50YubB8M5fehtVIHs4ojihMG+nwB2dzZ2VPx4s8CwDiq0OQiFV/hgexNtbVVd0o1lafo4QnVJUAvJSI1dRYIhHjP4slhFbFIww1rg9j88u7YniDbEq9VD/baJyI1fVi99OHhe15exdu2CERhhvwLfnl08nXbnBf+3ocXrWD8JS9UfyX6nt+/nPX6a8/Ab32d/ifai11tSMpXty11H4+eQ9+MTsDv/W9anr+vGfW+37t23Cu/dBcL/fife1HGXeD9s/rq9mO2iw/kKEoJ//tKSP/mWHefPgBeNre0Ei1KZoVf762Sqb+2m/5QO1pvgFb/hnn+jysmhvjGcvsG5tnyjccPJi0/3zwPe9JPjlryzrs+OeNWm3SVBaseJWeG3zoySftARpWc2paqqXLcAxnOIt91L1urAOE5+9589f189d/4FpKz3jtz/P3HfensTYyv1LOFl6dtxz1Yfxf+lunnwB4nGNgZGBgAOKOTs7l8fw2Xxm4WRhA4OrXvnUw+v///xys25kbgVwOBiaQKABpaQ3NAAAAeJxjYGRgYG7438AQw7rt////11m3MwBFUEA1AL1oCCd4nGNhYGBgfsnAwMKADf//T5hNjN5RTO+wYd2GiQFIsBBeAAAAAAAAAHYAmACwAPgBKgHoAiYCrAMuA94EMASqBTIFmAXSBi4GggaiBswG6AcMB14HvgfMCBIIagj2CXQJ8ApsCroLAgtKC6YMFgx0DJYMyg0yDZoNyg4kDnwO4A86D24QihDCETIRohIIEkwSthNSE74UJhR+FPgVJhW2FfgWJBZ0FsYXrBfmGCAYhhi4GTQZdBmgGeIaEhqCGqAawBrqGxQbrBviHBgcUhyMHQodRh2AHboeGh5kHq4e6h8oH3IfvB/2IAIgWiC0INwhDiFuIbYiECIuIjwiZiKQIrojTiP8JIIlFiVAJVolmiXwJjAmTCasJuYnKnicY2BkYGCoZljBoMQAAkxAzAWEDAz/wXwGACi5AlwAeJx1kMtKw0AUhv/0JibgQrHrcaOgNL1shIKrQuu6QvdpMmlTkkyYTAvd+AYufB6fwhfQp3Dv33SEUmzCHL7zzZkzhwFwiS842H/XXHt24DHbcw1nEJbr9HeWG+SB5Sb5yXKL/GzZxQNeLHu4wis7OI1zZvd4t+ygjQ/LNVzg03Kd/ttyg/xjuYm241lukW8su5g5j5Y93Dpv7kjLwMhIzLciCVUeq9y4MlonnVyZIIqmcrFOA31gDnAmdZmoXPT93oGdyFzqv57lZjEwJhaxVpkYs7lMUyUKrVYyNP7SmGLY7cbW+6HKOOIIGhIBDGPEZ51jy5gghEKOuIqGdbvdNX2HuaIJmEeY0i/oU+b6RM3/dkavUdLvbhDow0fvRO2EPq/qj+csseH9A1rDWQWX5rmMNLaTS86WkgWKam9FE9L7WFanCgzR5R8f1fvVC2S/Y2l2a3icbVSHlts2ENTYaiSlsy9npzi9VydxSe+9994DgisRFkjAAHi6s/PxWYA859698OkRg11wy8xCo1Oj/slH///cxCmcxhgTTDHDHBlyFFhgiR2cwVns4jbs4RzO43bcgTtxFy7gbtyDe3Ef7scDeBAP4WE8gkfxGB7HE3gST+FpPIOLeBbP4XlcwmVcwVW8gBfxEl7GK3gVr+F1vIE38Rbexjt4F+/hfXyAD/ERPsYn+BSf4XN8gS/xFb7GN/gW3+F7/IAf8RN+xi/4Fb/hd/yBP/EX/oZACYkKhBXWqKFwDRtoNGhhYHEdDh4BHfaxxQEOcQM38c8IBxOpjaepCkIruVStJxeksEGZ9ky/s8KJtRO23un3QQVN0uii36pGrGlhHe0r03kfyM5bOggR5F4KTaURrpqUrvN1Xgq5WTvTtdXSB6c2FGrereu5tyRr4XwuNQmXPhmXRlf5qtPaS0fUFivjGhH4J+uMI5DTqqWFo8bsU+/LS23k5npnAk1FK2vjxjVpmzNQN0zLPS68aqymzmojqqniKG1YXut8UKtDyZhcMew0rcLOgIdlMaxOresw5uybeSq3MnJaObEKPvNdydUqG6ZdGw8UvrPkelPGRUbijMsiDwkVwXSWT0jhibE22wH35O6risyMO4x65FZEVrVQ7SzxTduJdYob8FyErF30Sco8sT7cq84bcmuSxAxmFRtDzD4gZ7a5CEHIuuG2J03nlRyvG2GHzCsnGspsteqZHW8Ni0gHHGzMklPuW2F7XbLoSlMwpUqFUOVRl5oiSWc5jbdCqnZdmhBMs/zPEIydcgSx1WNHlRmzpKY4NmJ7J8YvuI5yntI161hqmqT3Xnona+zjYlTt/Albr+u5E9Yk4mlueLdSLEskmJ3h0AWe7NhN/1mWcGtaylc8QSX3ysbUaIzXu2PWPKEUNRuukdHLWyjeid1+l0JQpZUPF070WMZBpiFycjFfy1soBhlo6dpjYXqh+9wJVnw2s1xP6Uhspt50TlLhLTfI6VmCI8yV+cURjoMyEY79s57nqhBdMOHQkqcwjRc0xBvKfxjEp9xYGns4rkSgoh+qVPgJPnVweYrZl5eOJL4SSsYiwYHvNPLxQJHQcWtSIaH02TwQ32XOPhNVtVKa5v3kUzW3Sm4Etx7vieJj82G9dAQuH4ErR+DqaPQvVxUOegA=') format('woff'), - url('../fonts/iconfont.ttf?t=1506766254785') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ - url('../fonts/iconfont.svg?t=1506766254785#edui-notadd') format('svg'); /* iOS 4.1- */ -} - -.edui-notadd .edui-icon{ - font-family:"edui-notadd" !important; - font-size:16px; - font-style:normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.edui-iconfont { - width: 1em; - height: 1em; - vertical-align: -0.15em; - fill: currentColor; - overflow: hidden; -} -.edui-for-close .edui-icon:before { content: "\e654"; } - -.edui-for-italic .edui-icon:before { content: "\e62d"; } - -.edui-for-insertcaption .edui-icon:before { content: "\e657"; } - -.edui-for-insertparagraph .edui-icon:before { content: "\e62e"; } - -.edui-for-inserttitlecol .edui-icon:before { content: "\e659"; } - -.edui-for-insertimage .edui-icon:before { content: "\e617"; } - -.edui-for-previousstep .edui-icon:before { content: "\e630"; } - -.edui-for-nextstep .edui-icon:before { content: "\e631"; } - -.edui-for-scaleboard .edui-icon:before { content: "\e632"; } - -.edui-for-brush .edui-icon:before { content: "\e633"; } - -.edui-for-background .edui-icon:before { content: "\e65d"; } - -.edui-for-strikethrough .edui-icon:before { content: "\e60c"; } - -.edui-for-spechars .edui-icon:before { content: "\e603"; } - -.edui-for-clearboard .edui-icon:before { content: "\e634"; } - -.edui-for-bold .edui-icon:before { content: "\e604"; } - -.edui-for-fullscreen .edui-icon:before { content: "\e656"; } - -.edui-for-formatmatch .edui-icon:before { content: "\e60d"; } - -.edui-for-underline .edui-icon:before { content: "\e605"; } - -.edui-for-removeformat .edui-icon:before { content: "\e60e"; } - -.edui-for-blockquote .edui-icon:before { content: "\e60f"; } - -.edui-for-anchor .edui-icon:before { content: "\e618"; } - -.edui-for-help .edui-icon:before { content: "\e619"; } - -.edui-for-horizontal .edui-icon:before { content: "\e638"; } - -.edui-for-simpleupload .edui-icon:before { content: "\e61a"; } - -.edui-for-indent .edui-icon:before { content: "\e61b"; } - -.edui-for-justifycenter .edui-icon:before { content: "\e61c"; } - -.edui-for-justifyleft .edui-icon:before { content: "\e61d"; } - -.edui-for-justifyjustify .edui-icon:before { content: "\e61e"; } - -.edui-for-justifyright .edui-icon:before { content: "\e61f"; } - -.edui-for-link .edui-icon:before { content: "\e620"; } - -.edui-for-cleardoc .edui-icon:before { content: "\e621"; } - -.edui-for-drafts .edui-icon:before { content: "\e610"; } - -.edui-for-subscript .edui-icon:before { content: "\e611"; } - -.edui-for-unlink .edui-icon:before { content: "\e622"; } - -.edui-for-superscript .edui-icon:before { content: "\e612"; } - -.edui-for-forecolor .edui-icon:before { content: "\e63a"; } - -.edui-for-backcolor .edui-icon:before { content: "\e655"; } - -.edui-for-touppercase .edui-icon:before { content: "\e623"; } - -.edui-for-tolowercase .edui-icon:before { content: "\e624"; } - -.edui-for-insertvideo .edui-icon:before { content: "\e627"; } - -.edui-for-emotion .edui-icon:before { content: "\e606"; } - -.edui-for-pasteplain .edui-icon:before { content: "\e613"; } - -.edui-for-preview .edui-icon:before { content: "\e63b"; } - -.edui-for-print .edui-icon:before { content: "\e63c"; } - -.edui-for-searchreplace .edui-icon:before { content: "\e65e"; } - -.edui-for-selectall .edui-icon:before { content: "\e614"; } - -.edui-for-mergecells .edui-icon:before { content: "\e63d"; } - -.edui-for-deletecol .edui-icon:before { content: "\e63e"; } - -.edui-for-deleterow .edui-icon:before { content: "\e63f"; } - -.edui-for-attachment .edui-icon:before { content: "\e628"; } - -.edui-for-music .edui-icon:before { content: "\e640"; } - -.edui-for-gmap .edui-icon:before { content: "\e629"; } - -.edui-for-insertframe .edui-icon:before { content: "\e645"; } - -.edui-for-pdfformat .edui-icon:before { content: "\e62f"; } - -.edui-for-word .edui-icon:before { content: "\e646"; } - -.edui-for-excel .edui-icon:before { content: "\e647"; } - -.edui-for-time .edui-icon:before { content: "\e64a"; } - -.edui-for-snapscreen .edui-icon:before { content: "\e650"; } - -.edui-for-wordimage .edui-icon:before { content: "\e652"; } - -.edui-for-edittd .edui-icon:before { content: "\e65a"; } - -.edui-for-lineheight .edui-icon:before { content: "\e62a"; } - -.edui-for-rowspacingbottom .edui-icon:before { content: "\e62b"; } - -.edui-for-rowspacingtop .edui-icon:before { content: "\e62c"; } - -.edui-for-scrawl .edui-icon:before { content: "\e616"; } - -.edui-for-redo .edui-icon:before { content: "\e609"; } - -.edui-for-undo .edui-icon:before { content: "\e600"; } - -.edui-for-inserttitle .edui-icon:before { content: "\e65b"; } - -.edui-for-insertparagraphtrue .edui-icon:before { content: "\e660"; } - -.edui-for-aligntable .edui-icon:before { content: "\e662"; } - -.edui-for-table .edui-icon:before { content: "\e664"; } - -.edui-for-tablealignment-left .edui-icon:before { content: "\e663"; } - -.edui-for-tablealignment-center .edui-icon:before { content: "\e665"; } - -.edui-for-tablealignment-right .edui-icon:before { content: "\e666"; } - -.edui-for-paste .edui-icon:before { content: "\e667"; } - -.edui-for-map .edui-icon:before { content: "\e668"; } - -.edui-for-directionalityrtl .edui-icon:before { content: "\e601"; } - -.edui-for-imagecenter .edui-icon:before { content: "\e602"; } - -.edui-for-imagenone .edui-icon:before { content: "\e607"; } - -.edui-for-fontborder .edui-icon:before { content: "\e608"; } - -.edui-for-edittable .edui-icon:before { content: "\e60a"; } - -.edui-for-imageleft .edui-icon:before { content: "\e60b"; } - -.edui-for-imageright .edui-icon:before { content: "\e615"; } - -.edui-for-insertcol .edui-icon:before { content: "\e625"; } - -.edui-for-insertcolnext .edui-icon:before { content: "\e626"; } - -.edui-for-insertorderedlist .edui-icon:before { content: "\e635"; } - -.edui-for-insertparagraphbeforetable .edui-icon:before { content: "\e636"; } - -.edui-for-insertrow .edui-icon:before { content: "\e637"; } - -.edui-for-insertrownext .edui-icon:before { content: "\e639"; } - -.edui-for-insertunorderedlist .edui-icon:before { content: "\e641"; } - -.edui-for-mergeright .edui-icon:before { content: "\e642"; } - -.edui-for-mergedown .edui-icon:before { content: "\e643"; } - -.edui-for-inserttable .edui-icon:before { content: "\e644"; } - -.edui-for-pagebreak .edui-icon:before { content: "\e648"; } - -.edui-for-source .edui-icon:before { content: "\e649"; } - -.edui-for-splittorows .edui-icon:before { content: "\e64b"; } - -.edui-for-splittocols .edui-icon:before { content: "\e64c"; } - -.edui-for-splittocells .edui-icon:before { content: "\e64d"; } - -.edui-for-arrow .edui-icon:before { content: "\e64f"; } - -.edui-for-aligntd .edui-icon:before { content: "\e651"; } - -.edui-for-autotypeset .edui-icon:before { content: "\e653"; } - -.edui-for-charts .edui-icon:before { content: "\e658"; } - -.edui-for-closeerror .edui-icon:before { content: "\e65c"; } - -.edui-for-copy .edui-icon:before { content: "\e65f"; } - -.edui-for-date .edui-icon:before { content: "\e661"; } - -.edui-for-deletetable .edui-icon:before { content: "\e669"; } - -.edui-for-directionalityltr .edui-icon:before { content: "\e66a"; } - -.edui-for-arrowright .edui-icon:before { content: "\e66b"; } - -.edui-for-tableleft .edui-icon:before { content: "\e66c"; } - -.edui-for-tableright .edui-icon:before { content: "\e66d"; } - -.edui-for-tablecenter .edui-icon:before { content: "\e66e"; } - -.edui-for-videoleft .edui-icon:before { content: "\e66f"; } - -.edui-for-videocenter .edui-icon:before { content: "\e670"; } - -.edui-for-videonone .edui-icon:before { content: "\e671"; } - -.edui-for-videoright .edui-icon:before { content: "\e672"; } - -.edui-for-template .edui-icon:before { content: "\e64e"; } - -.edui-for-addfile .edui-icon:before { content: "\e673"; } - -.edui-for-selected .edui-icon:before { content: "\e674"; } - -.edui-for-pickarea .edui-icon:before { content: "\e675"; } - -.edui-for-overlay .edui-icon:before { content: "\e676"; } - -.edui-for-preitem .edui-icon:before { content: "\e677"; } - -.edui-for-preitem1 .edui-icon:before { content: "\e678"; } - -.edui-for-preitem2 .edui-icon:before { content: "\e679"; } - -.edui-for-preitem3 .edui-icon:before { content: "\e67a"; } - -.edui-for-preitem4 .edui-icon:before { content: "\e67b"; } - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.eot b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.eot deleted file mode 100644 index cd8f41f77c7d5f36d8bf42cebfaf30766103d6b2..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.eot and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.svg b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.svg deleted file mode 100644 index 7bbbafef1899338fd6b6a6b63d8a7573e28d028e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.svg +++ /dev/null @@ -1,410 +0,0 @@ - - - - - -Created by iconfont - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.ttf b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.ttf deleted file mode 100644 index f8a15465d6cd67623be8186f5bdb96988308ac0c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.ttf and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.woff b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.woff deleted file mode 100644 index 951c50e6bc5c3d8605710b0f86be22490bfb2554..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/iconfont.woff and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/images/addfile.svg b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/images/addfile.svg deleted file mode 100644 index 89b7ccdd2176d2ffec796d48244c4ba8d627357e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/images/addfile.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/images/selected.svg b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/images/selected.svg deleted file mode 100644 index f29c5a17501af768cb2c1d74b1eaee588090bdd0..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/fonts/images/selected.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/gmap/gmap.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/gmap/gmap.html deleted file mode 100644 index c8786f3697c65929dde7813bd73f7e66d804799a..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/gmap/gmap.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - -
                      - - - - - - -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/help/help.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/help/help.css deleted file mode 100644 index 4478475fdf60cc930ad0a6472601213f1abb6f54..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/help/help.css +++ /dev/null @@ -1,7 +0,0 @@ -.wrapper{width: 370px;margin: 10px auto;zoom: 1;} -.tabbody{height: 360px;} -.tabbody .panel{width:100%;height: 360px;position: absolute;background: #fff;} -.tabbody .panel h1{font-size:26px;margin: 5px 0 0 5px;} -.tabbody .panel p{font-size:12px;margin: 5px 0 0 5px;} -.tabbody table{width:90%;line-height: 20px;margin: 5px 0 0 5px;;} -.tabbody table thead{font-weight: bold;line-height: 25px;} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/help/help.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/help/help.html deleted file mode 100644 index 9e50060e727da6183ca33e0f93659214339ab2c2..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/help/help.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - 帮助 - - - - - -
                      -
                      - - -
                      -
                      -
                      -

                      UEditor

                      -

                      -

                      -
                      -
                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      ctrl+b
                      ctrl+c
                      ctrl+x
                      ctrl+v
                      ctrl+y
                      ctrl+z
                      ctrl+i
                      ctrl+u
                      ctrl+a
                      shift+enter
                      alt+z
                      -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/help/help.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/help/help.js deleted file mode 100644 index 9a2272e381042bb02c7041544819b370e54c8fdb..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/help/help.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-9-26 - * Time: 下午1:06 - * To change this template use File | Settings | File Templates. - */ -/** - * tab点击处理事件 - * @param tabHeads - * @param tabBodys - * @param obj - */ -function clickHandler( tabHeads,tabBodys,obj ) { - //head样式更改 - for ( var k = 0, len = tabHeads.length; k < len; k++ ) { - tabHeads[k].className = ""; - } - obj.className = "focus"; - //body显隐 - var tabSrc = obj.getAttribute( "tabSrc" ); - for ( var j = 0, length = tabBodys.length; j < length; j++ ) { - var body = tabBodys[j], - id = body.getAttribute( "id" ); - body.onclick = function(){ - this.style.zoom = 1; - }; - if ( id != tabSrc ) { - body.style.zIndex = 1; - } else { - body.style.zIndex = 200; - } - } - -} - -/** - * TAB切换 - * @param tabParentId tab的父节点ID或者对象本身 - */ -function switchTab( tabParentId ) { - var tabElements = $G( tabParentId ).children, - tabHeads = tabElements[0].children, - tabBodys = tabElements[1].children; - - for ( var i = 0, length = tabHeads.length; i < length; i++ ) { - var head = tabHeads[i]; - if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); - head.onclick = function () { - clickHandler(tabHeads,tabBodys,this); - } - } -} -switchTab("helptab"); - -document.getElementById('version').innerHTML = parent.UE.version; \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/image.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/image.css deleted file mode 100644 index 4a36f5cc516763634a046b47524800957740120d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/image.css +++ /dev/null @@ -1,936 +0,0 @@ -@charset "utf-8"; -/* dialog样式 */ -.wrapper { - zoom: 1; - width: 600px; - height: 412px; - margin: 0 auto; - padding: 20px; - position: relative; - font-family: sans-serif; -} - -/*tab样式框大小*/ -.tabhead { - float:left; -} -.tabbody { - width: 100%; - height: 346px; - position: relative; - clear: both; -} - -.tabbody .panel { - position: absolute; - width: 0; - height: 0; - background: #fff; - overflow: hidden; - display: none; -} - -.tabbody .panel.focus { - width: 100%; - height: 380px; - display: block; -} - -/* 图片对齐方式 */ -.alignBar{ - float:right; - margin-top: 5px; - position: relative; -} - -.alignBar .algnLabel{ - float:left; - height: 20px; - line-height: 20px; -} - -.alignBar #alignIcon{ - zoom:1; - _display: inline; - display: inline-block; - position: relative; -} -.alignBar #alignIcon span{ - float: left; - cursor: pointer; - display: block; - width: 19px; - height: 17px; - margin-right: 3px; - margin-left: 3px; - background-image: url(./images/alignicon.jpg); -} -.alignBar #alignIcon .none-align{ - background-position: 0 -18px; -} -.alignBar #alignIcon .left-align{ - background-position: -20px -18px; -} -.alignBar #alignIcon .right-align{ - background-position: -40px -18px; -} -.alignBar #alignIcon .center-align{ - background-position: -60px -18px; -} -.alignBar #alignIcon .none-align.focus{ - background-position: 0 0; -} -.alignBar #alignIcon .left-align.focus{ - background-position: -20px 0; -} -.alignBar #alignIcon .right-align.focus{ - background-position: -40px 0; -} -.alignBar #alignIcon .center-align.focus{ - background-position: -60px 0; -} - - - - -/* 远程图片样式 */ -#remote { - z-index: 200; -} - -#remote .top{ - width: 100%; - margin-top: 20px; -} -#remote .left{ - display: block; - float: left; - width: 240px; - height:10px; -} -#remote .right{ - display: block; - float: right; - width: 345px; - height:10px; -} -#remote .row{ - /*margin-left: 20px;*/ - display: flex; - clear: both; - height: 30px; - line-height: 30px; - margin-bottom: 20px; -} - -#remote .row label{ - text-align: center; - width: 50px; - zoom:1; - _display: inline; - display:inline-block; - vertical-align: middle; - margin-right: 10px; -} -#remote .row label.algnLabel{ - float: left; - -} - -#remote input.text{ - height: 28px; - width: 150px; - font-size: 14px; - line-height: 1.42857143; - color: #555; - background-color: #fff; - background-image: none; - border: 1px solid #ccc; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; - transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -} -#remote input.text:focus { - border-color: #66afe9; - outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); -} -#remote textarea.text{ - width: 160px; - height: 120px; - font-size: 14px; - line-height: 1.42857143; - color: #555; - background-color: #fff; - background-image: none; - border: 1px solid #ccc; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; - transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; - resize: none; -} -#remote textarea.text:focus { - border-color: #66afe9; - outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); -} -#remote #url{ - width: 537px; - height: 28px; -} -#remote #width, -#remote #height{ - width: 60px; - height: 28px; - margin-left: 8px; - margin-right: 8px; -} -#remote .top .row:nth-child(2) span:nth-child(1) , -#remote .top .row:nth-child(2) span:nth-child(2) { - display: block; - margin-right: 18px; -} - -#remote .top .row:nth-child(2) span:last-child { - margin-left: 15px; -} -#remote #border, -#remote #vhSpace, -#remote #title{ - width: 145px; - margin-right: 8px; -} -#remote #lock{ - margin-top: 11px; -} -#remote #lockicon{ - zoom: 1; - _display:inline; - display: inline-block; - height: 20px; - background: url("../../themes/notadd/images/lock.gif") -13px -13px no-repeat; - vertical-align: middle; -} -#remote #preview{ - clear: both; - width: 345px; - height: 261px; - z-index: 9999; - background-color: #f3f3f3; - overflow: hidden; -} - -/* 上传图片 */ -.tabbody #upload.panel { - width: 0; - height: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); - background: #fff; - display: block; -} - -.tabbody #upload.panel.focus { - width: 100%; - height: 373px; - display: block; - clip: auto; - margin-top: 12px; -} - -#upload .queueList { - margin: 0; - width: 100%; - height: 100%; - position: absolute; - overflow: hidden; -} - -#upload p { - margin: 0; -} - -.element-invisible { - width: 0 !important; - height: 0 !important; - border: 0; - padding: 0; - margin: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); -} - -#upload .placeholder { - margin: 10px; - height: 212px; - padding-top: 160px; - text-align: center; - /*background: url(./images/image.png) center 130px no-repeat #f3f3f3;*/ - background-color: #f3f3f3; - color: #cccccc; - font-size: 18px; - position: relative; - top: 0; -} - -#upload .placeholder .webuploader-pick { - font-size: 16px; - background: #f3f3f3; - border-radius: 3px; - line-height: 44px; - padding: 0 30px; - color: #646464; - display: inline-block; - margin: 0 auto 20px auto; - cursor: pointer; - /* box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); */ - border: 1px solid #ccc; -} - -#upload .placeholder .webuploader-pick-hover { - border: 1px solid #00a2d4; - color: #00a2d4; -} - - -#filePickerContainer { - text-align: center; -} - -#upload .placeholder .flashTip { - color: #666666; - font-size: 12px; - position: absolute; - width: 100%; - text-align: center; - bottom: 20px; -} - -#upload .placeholder .flashTip a { - color: #0785d1; - text-decoration: none; -} - -#upload .placeholder .flashTip a:hover { - text-decoration: underline; -} - -#upload .placeholder.webuploader-dnd-over { - border-color: #999999; -} - -#upload .filelist { - list-style: none; - margin: 0; - padding: 0; - overflow-x: hidden; - overflow-y: auto; - position: relative; - height: 300px; -} - -#upload .filelist:after { - content: ''; - display: block; - width: 0; - height: 0; - overflow: hidden; - clear: both; - position: relative; -} - -#upload .filelist li { - width: 135px; - height: 135px; - background: url(./images/bg.png); - text-align: center; - margin: 9px 0 0 9px; - *margin: 6px 0 0 6px; - position: relative; - display: block; - float: left; - overflow: hidden; - font-size: 12px; -} - -#upload .filelist li p.log { - position: relative; - top: -45px; -} - -#upload .filelist li p.title { - position: absolute; - top: 0; - left: 0; - width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - top: 5px; - text-indent: 5px; - text-align: left; -} - -#upload .filelist li p.progress { - position: absolute; - width: 100%; - bottom: 0; - left: 0; - height: 8px; - overflow: hidden; - z-index: 50; - margin: 0; - border-radius: 0; - background: none; - -webkit-box-shadow: 0 0 0; -} - -#upload .filelist li p.progress span { - display: none; - overflow: hidden; - width: 0; - height: 100%; - background: #1483d8 url(./images/progress.png) repeat-x; - - -webit-transition: width 200ms linear; - -moz-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; - transition: width 200ms linear; - - -webkit-animation: progressmove 2s linear infinite; - -moz-animation: progressmove 2s linear infinite; - -o-animation: progressmove 2s linear infinite; - -ms-animation: progressmove 2s linear infinite; - animation: progressmove 2s linear infinite; - - -webkit-transform: translateZ(0); -} - -@-webkit-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@-moz-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -#upload .filelist li p.imgWrap { - position: relative; - z-index: 2; - line-height: 135px; - vertical-align: middle; - overflow: hidden; - width: 135px; - height: 135px; - - -webkit-transform-origin: 50% 50%; - -moz-transform-origin: 50% 50%; - -o-transform-origin: 50% 50%; - -ms-transform-origin: 50% 50%; - transform-origin: 50% 50%; - - -webit-transition: 200ms ease-out; - -moz-transition: 200ms ease-out; - -o-transition: 200ms ease-out; - -ms-transition: 200ms ease-out; - transition: 200ms ease-out; -} - -#upload .filelist li img { - width: 100%; -} - -#upload .filelist li p.error { - background: #f43838; - color: #fff; - position: absolute; - bottom: 0; - left: 0; - height: 28px; - line-height: 28px; - width: 100%; - z-index: 100; - display:none; -} - -#upload .filelist li .success { - display: block; - position: absolute; - left: 0; - bottom: 0; - height: 40px; - width: 100%; - z-index: 200; - background: url(../fonts/images/selected.svg) no-repeat right bottom; -} - -#upload .filelist li.filePickerBlock { - width: 135px; - height: 135px; - background: url(../fonts/images/addfile.svg) no-repeat center; - border: 1px solid #eeeeee; - border-radius: 0; -} -#upload .filelist li.filePickerBlock div.webuploader-pick { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - opacity: 0; - background: none; - font-size: 0; -} - -#upload .filelist div.file-panel { - position: absolute; - height: 0; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0; - background: rgba(0, 0, 0, 0.5); - width: 100%; - top: 0; - left: 0; - overflow: hidden; - z-index: 300; -} - -#upload .filelist div.file-panel span { - width: 24px; - height: 24px; - display: inline; - float: right; - text-indent: -9999px; - overflow: hidden; - background: url(./images/icons.png) no-repeat; - background: url(./images/icons.gif) no-repeat \9; - margin: 5px 1px 1px; - cursor: pointer; - -webkit-tap-highlight-color: rgba(0,0,0,0); - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -#upload .filelist div.file-panel span.rotateLeft { - display:none; - background-position: 0 -24px; -} - -#upload .filelist div.file-panel span.rotateLeft:hover { - background-position: 0 0; -} - -#upload .filelist div.file-panel span.rotateRight { - display:none; - background-position: -24px -24px; -} - -#upload .filelist div.file-panel span.rotateRight:hover { - background-position: -24px 0; -} - -#upload .filelist div.file-panel span.cancel { - background-position: -48px -24px; -} - -#upload .filelist div.file-panel span.cancel:hover { - background-position: -48px 0; -} - -#upload .statusBar { - height: 45px; - border-bottom: 1px solid #dadada; - margin: 0 10px; - padding: 0; - line-height: 45px; - vertical-align: middle; - position: relative; -} - -#upload .statusBar .progress { - border: 1px solid #1483d8; - width: 198px; - background: #fff; - height: 18px; - position: absolute; - top: 12px; - display: none; - text-align: center; - line-height: 18px; - color: #6dbfff; - margin: 0 10px 0 0; -} -#upload .statusBar .progress span.percentage { - width: 0; - height: 100%; - left: 0; - top: 0; - background: #1483d8; - position: absolute; -} -#upload .statusBar .progress span.text { - position: relative; - z-index: 10; -} - -#upload .statusBar .info { - display: inline-block; - font-size: 14px; - color: #666666; -} - -#upload .statusBar .btns { - position: absolute; - top: 7px; - right: 0; - line-height: 30px; -} - -#filePickerBtn { - display: inline-block; - float: left; -} -#upload .statusBar .btns .webuploader-pick, -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-uploading, -#upload .statusBar .btns .uploadBtn.state-paused { - background: #ffffff; - border: 1px solid #cfcfcf; - color: #565656; - padding: 0 18px; - display: inline-block; - border-radius: 3px; - margin-left: 10px; - cursor: pointer; - font-size: 14px; - float: left; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -#upload .statusBar .btns .webuploader-pick-hover, -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-uploading:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover { - background: #f0f0f0; -} - -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-paused{ - background: #00b7ee; - color: #fff; - border-color: transparent; -} -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover{ - background: #00a2d4; -} - -#upload .statusBar .btns .uploadBtn.disabled { - pointer-events: none; - filter:alpha(opacity=60); - -moz-opacity:0.6; - -khtml-opacity: 0.6; - opacity: 0.6; -} - - - -/* 图片管理样式 */ -#online { - width: 100%; - height: 336px; - padding: 10px 0 0 0; -} -#online #imageList{ - width: 100%; - height: 100%; - overflow-x: hidden; - overflow-y: auto; - position: relative; -} -#online ul { - display: block; - list-style: none; - margin: 0; - padding: 0; -} -#online li { - float: left; - display: block; - list-style: none; - padding: 0; - width: 135px; - height: 135px; - margin: 0 0 9px 9px; - *margin: 0 0 6px 6px; - background-color: #eee; - overflow: hidden; - cursor: pointer; - position: relative; -} -#online li.clearFloat { - float: none; - clear: both; - display: block; - width:0; - height:0; - margin: 0; - padding: 0; -} -#online li img { - cursor: pointer; - width: 135px !important; - height: 135px !important; - margin-top: 0px !important; -} -#online li .icon { - cursor: pointer; - width: 135px; - height: 135px; - position: absolute; - top: 0; - left: 0; - z-index: 2; - border: 0; - background-repeat: no-repeat; -} -#online li .icon:hover { - width: 129px; - height: 129px; - border: 3px solid #1094fa; -} -#online li.selected .icon { - background-image: url(images/success.png); - background-image: url(images/success.gif)\9; - background-position: 95px 95px; -} -#online li.selected .icon:hover { - width: 129px; - height: 129px; - border: 3px solid #1094fa; - background-position: 92px 92px; -} - - -/* 图片搜索样式 */ -#search .searchBar { - width: 100%; - height: 30px; - margin: 10px 0 5px 0; - padding: 0; -} - -#search input.text{ - width: 150px; - padding: 3px 6px; - font-size: 14px; - line-height: 1.42857143; - color: #555; - background-color: #fff; - background-image: none; - border: 1px solid #ccc; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; - transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -} -#search input.text:focus { - border-color: #66afe9; - outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); -} -#search input.searchTxt { - margin-left:5px; - padding-left: 5px; - background: #FFF; - width: 300px; - *width: 260px; - height: 21px; - line-height: 21px; - float: left; - dislay: block; -} -#search .pagination{ - margin-top: 5px; -} -#search input.num{ - width: 80px; -} - -#search .searchType { - width: 95px; - height: 28px; - padding:0; - line-height: 28px; - border: 1px solid #d7d7d7; - border-radius: 0; - vertical-align: top; - margin-left: 5px; - float: left; - dislay: block; -} - -#search #searchBtn, -#search #searchReset { - display: inline-block; - margin-bottom: 0; - margin-right: 5px; - padding: 4px 10px; - font-weight: 400; - text-align: center; - vertical-align: middle; - cursor: pointer; - background-image: none; - border: 1px solid transparent; - white-space: nowrap; - font-size: 14px; - border-radius: 4px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - vertical-align: top; - float: right; -} - -#search #searchBtn { - color: white; - border-color: #285e8e; - background-color: #3b97d7; -} -#search #searchReset { - color: #333; - border-color: #ccc; - background-color: #fff; -} -#search #searchBtn:hover { - background-color: #3276b1; -} -#search #searchReset:hover { - background-color: #eee; -} - -#search .msg { - margin-left: 5px; -} - -#search .searchList{ - width: 100%; - height: 300px; - overflow: hidden; - clear: both; -} -#search .searchList ul{ - margin:0; - padding:0; - list-style:none; - clear: both; - width: 100%; - height: 100%; - overflow-x: hidden; - overflow-y: auto; - zoom: 1; - position: relative; -} - -#search .searchList li { - list-style:none; - float: left; - display: block; - width: 115px; - margin: 5px 10px 5px 20px; - *margin: 5px 10px 5px 15px; - padding:0; - font-size: 12px; - box-shadow: 0 1px 3px rgba(0, 0, 0, .3); - -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3); - -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3); - position: relative; - vertical-align: top; - text-align: center; - overflow: hidden; - cursor: pointer; - filter: alpha(Opacity=100); - -moz-opacity: 1; - opacity: 1; - border: 2px solid #eee; -} - -#search .searchList li.selected { - filter: alpha(Opacity=40); - -moz-opacity: 0.4; - opacity: 0.4; - border: 2px solid #00a0e9; -} - -#search .searchList li p { - background-color: #eee; - margin: 0; - padding: 0; - position: relative; - width:100%; - height:115px; - overflow: hidden; -} - -#search .searchList li p img { - cursor: pointer; - border: 0; -} - -#search .searchList li a { - color: #999; - border-top: 1px solid #F2F2F2; - background: #FAFAFA; - text-align: center; - display: block; - padding: 0 5px; - width: 105px; - height:32px; - line-height:32px; - white-space:nowrap; - text-overflow:ellipsis; - text-decoration: none; - overflow: hidden; - word-break: break-all; -} - -#search .searchList a:hover { - text-decoration: underline; - color: #333; -} -#search .searchList .clearFloat{ - clear: both; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/image.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/image.html deleted file mode 100644 index f490247974ee11293d366ceeb862ca6208e3655e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/image.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - neditor图片对话框 - - - - - - - - - - - - - - - -
                      -
                      - - - - -
                      -
                      - - - - - - - - - - -
                      -
                      - - -
                      -
                      -
                      - - -
                      -
                      - -   px -   px - -
                      -
                      -
                      -
                      - - px -
                      -
                      - - px -
                      -
                      - - -
                      -
                      -
                      -
                      - - -
                      -
                      -
                      -
                      - 0% - -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                        -
                      • -
                      -
                      -
                      - - -
                      -
                      -
                      - - - - -
                      -
                      - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/image.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/image.js deleted file mode 100644 index 18f70c9bfe0ca070f449e7726353cbaa9f78743f..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/image.js +++ /dev/null @@ -1,1131 +0,0 @@ -/** - * User: Jinqn - * Date: 14-04-08 - * Time: 下午16:34 - * 上传图片对话框逻辑代码,包括tab: 远程图片/上传图片/在线图片/搜索图片 - */ - -(function () { - - var remoteImage, - uploadImage, - onlineImage, - searchImage; - - window.onload = function () { - initTabs(); - initAlign(); - initButtons(); - }; - - /* 初始化tab标签 */ - function initTabs() { - var tabs = $G('tabhead').children; - for (var i = 0; i < tabs.length; i++) { - domUtils.on(tabs[i], "click", function (e) { - var target = e.target || e.srcElement; - setTabFocus(target.getAttribute('data-content-id')); - }); - } - - var img = editor.selection.getRange().getClosedNode(); - if (img && img.tagName && img.tagName.toLowerCase() == 'img') { - setTabFocus('remote'); - } else { - setTabFocus('upload'); - } - } - - /* 初始化tabbody */ - function setTabFocus(id) { - if(!id) return; - var i, bodyId, tabs = $G('tabhead').children; - for (i = 0; i < tabs.length; i++) { - bodyId = tabs[i].getAttribute('data-content-id'); - if (bodyId == id) { - domUtils.addClass(tabs[i], 'focus'); - domUtils.addClass($G(bodyId), 'focus'); - } else { - domUtils.removeClasses(tabs[i], 'focus'); - domUtils.removeClasses($G(bodyId), 'focus'); - } - } - switch (id) { - case 'remote': - remoteImage = remoteImage || new RemoteImage(); - break; - case 'upload': - setAlign(editor.getOpt('imageInsertAlign')); - uploadImage = uploadImage || new UploadImage('queueList'); - break; - case 'online': - setAlign(editor.getOpt('imageManagerInsertAlign')); - onlineImage = onlineImage || new OnlineImage('imageList'); - onlineImage.reset(); - break; - case 'search': - setAlign(editor.getOpt('imageManagerInsertAlign')); - searchImage = searchImage || new SearchImage(); - break; - } - } - - /* 初始化onok事件 */ - function initButtons() { - - dialog.onok = function () { - var remote = false, list = [], id, tabs = $G('tabhead').children; - for (var i = 0; i < tabs.length; i++) { - if (domUtils.hasClass(tabs[i], 'focus')) { - id = tabs[i].getAttribute('data-content-id'); - break; - } - } - - switch (id) { - case 'remote': - list = remoteImage.getInsertList(); - break; - case 'upload': - list = uploadImage.getInsertList(); - var count = uploadImage.getQueueCount(); - if (count) { - $('.info', '#queueList').html('' + '还有2个未上传文件'.replace(/[\d]/, count) + ''); - return false; - } - break; - case 'online': - list = onlineImage.getInsertList(); - break; - case 'search': - list = searchImage.getInsertList(); - remote = true; - break; - } - - if(list) { - editor.execCommand('insertimage', list); - remote && editor.fireEvent("catchRemoteImage"); - } - }; - } - - - /* 初始化对其方式的点击事件 */ - function initAlign(){ - /* 点击align图标 */ - domUtils.on($G("alignIcon"), 'click', function(e){ - var target = e.target || e.srcElement; - if(target.className && target.className.indexOf('-align') != -1) { - setAlign(target.getAttribute('data-align')); - } - }); - } - - /* 设置对齐方式 */ - function setAlign(align){ - align = align || 'none'; - var aligns = $G("alignIcon").children; - for(i = 0; i < aligns.length; i++){ - if(aligns[i].getAttribute('data-align') == align) { - domUtils.addClass(aligns[i], 'focus'); - $G("align").value = aligns[i].getAttribute('data-align'); - } else { - domUtils.removeClasses(aligns[i], 'focus'); - } - } - } - /* 获取对齐方式 */ - function getAlign(){ - var align = $G("align").value || 'none'; - return align == 'none' ? '':align; - } - - - /* 在线图片 */ - function RemoteImage(target) { - this.container = utils.isString(target) ? document.getElementById(target) : target; - this.init(); - } - RemoteImage.prototype = { - init: function () { - this.initContainer(); - this.initEvents(); - }, - initContainer: function () { - this.dom = { - 'url': $G('url'), - 'width': $G('width'), - 'height': $G('height'), - 'border': $G('border'), - 'vhSpace': $G('vhSpace'), - 'title': $G('title'), - 'align': $G('align') - }; - var img = editor.selection.getRange().getClosedNode(); - if (img) { - this.setImage(img); - } - }, - initEvents: function () { - var _this = this, - locker = $G('lock'); - - /* 改变url */ - domUtils.on($G("url"), 'keyup', updatePreview); - domUtils.on($G("border"), 'keyup', updatePreview); - domUtils.on($G("title"), 'keyup', updatePreview); - - domUtils.on($G("width"), 'keyup', function(){ - if(locker.checked) { - var proportion =locker.getAttribute('data-proportion'); - $G('height').value = Math.round(this.value / proportion); - } else { - _this.updateLocker(); - } - updatePreview(); - }); - domUtils.on($G("height"), 'keyup', function(){ - if(locker.checked) { - var proportion =locker.getAttribute('data-proportion'); - $G('width').value = Math.round(this.value * proportion); - } else { - _this.updateLocker(); - } - updatePreview(); - }); - domUtils.on($G("lock"), 'change', function(){ - var proportion = parseInt($G("width").value) /parseInt($G("height").value); - locker.setAttribute('data-proportion', proportion); - }); - - function updatePreview(){ - _this.setPreview(); - } - }, - updateLocker: function(){ - var width = $G('width').value, - height = $G('height').value, - locker = $G('lock'); - if(width && height && width == parseInt(width) && height == parseInt(height)) { - locker.disabled = false; - locker.title = ''; - } else { - locker.checked = false; - locker.disabled = 'disabled'; - locker.title = lang.remoteLockError; - } - }, - setImage: function(img){ - /* 不是正常的图片 */ - if (!img.tagName || img.tagName.toLowerCase() != 'img' && !img.getAttribute("src") || !img.src) return; - - var wordImgFlag = img.getAttribute("word_img"), - src = wordImgFlag ? wordImgFlag.replace("&", "&") : (img.getAttribute('_src') || img.getAttribute("src", 2).replace("&", "&")), - align = editor.queryCommandValue("imageFloat"); - - /* 防止onchange事件循环调用 */ - if (src !== $G("url").value) $G("url").value = src; - if(src) { - /* 设置表单内容 */ - $G("width").value = img.width || ''; - $G("height").value = img.height || ''; - $G("border").value = img.getAttribute("border") || '0'; - $G("vhSpace").value = img.getAttribute("vspace") || '0'; - $G("title").value = img.title || img.alt || ''; - setAlign(align); - this.setPreview(); - this.updateLocker(); - } - }, - getData: function(){ - var data = {}; - for(var k in this.dom){ - data[k] = this.dom[k].value; - } - return data; - }, - setPreview: function(){ - var url = $G('url').value, - ow = $G('width').value, - oh = $G('height').value, - border = $G('border').value, - title = $G('title').value, - preview = $G('preview'), - width, - height; - - width = ((!ow || !oh) ? preview.offsetWidth:Math.min(ow, preview.offsetWidth)); - width = width+(border*2) > preview.offsetWidth ? width:(preview.offsetWidth - (border*2)); - height = (!ow || !oh) ? '':width*oh/ow; - - if(url) { - preview.innerHTML = ''; - } - }, - getInsertList: function () { - var data = this.getData(); - if(data['url']) { - return [{ - src: data['url'], - _src: data['url'], - width: data['width'] || '', - height: data['height'] || '', - border: data['border'] || '', - floatStyle: data['align'] || '', - vspace: data['vhSpace'] || '', - alt: data['title'] || '', - style: "width:" + data['width'] + "px;height:" + data['height'] + "px;" - }]; - } else { - return []; - } - } - }; - - - - /* 上传图片 */ - function UploadImage(target) { - this.$wrap = target.constructor == String ? $('#' + target) : $(target); - this.init(); - } - UploadImage.prototype = { - init: function () { - this.imageList = []; - this.initContainer(); - this.initUploader(); - }, - initContainer: function () { - this.$queue = this.$wrap.find('.filelist'); - }, - /* 初始化容器 */ - initUploader: function () { - var _this = this, - $ = jQuery, // just in case. Make sure it's not an other libaray. - $wrap = _this.$wrap, - // 图片容器 - $queue = $wrap.find('.filelist'), - // 状态栏,包括进度和控制按钮 - $statusBar = $wrap.find('.statusBar'), - // 文件总体选择信息。 - $info = $statusBar.find('.info'), - // 上传按钮 - $upload = $wrap.find('.uploadBtn'), - // 上传按钮 - $filePickerBtn = $wrap.find('.filePickerBtn'), - // 上传按钮 - $filePickerBlock = $wrap.find('.filePickerBlock'), - // 没选择文件之前的内容。 - $placeHolder = $wrap.find('.placeholder'), - // 总体进度条 - $progress = $statusBar.find('.progress').hide(), - // 添加的文件数量 - fileCount = 0, - // 添加的文件总大小 - fileSize = 0, - // 优化retina, 在retina下这个值是2 - ratio = window.devicePixelRatio || 1, - // 缩略图大小 - thumbnailWidth = 113 * ratio, - thumbnailHeight = 113 * ratio, - // 可能有pedding, ready, uploading, confirm, done. - state = '', - // 所有文件的进度信息,key为file id - percentages = {}, - supportTransition = (function () { - var s = document.createElement('p').style, - r = 'transition' in s || - 'WebkitTransition' in s || - 'MozTransition' in s || - 'msTransition' in s || - 'OTransition' in s; - s = null; - return r; - })(), - // WebUploader实例 - uploader, - actionUrl = editor.getActionUrl(editor.getOpt('imageActionName')), - acceptExtensions = (editor.getOpt('imageAllowFiles') || [".png", ".jpg", ".jpeg", ".gif", ".bmp"]).join('').replace(/\./g, ',').replace(/^[,]/, ''), - imageMaxSize = editor.getOpt('imageMaxSize'), - imageCompressBorder = editor.getOpt('imageCompressBorder'); - if (!WebUploader.Uploader.support()) { - $('#filePickerReady').after($('
                      ').html(lang.errorNotSupport)).hide(); - return; - } else if (!editor.getOpt('imageActionName')) { - $('#filePickerReady').after($('
                      ').html(lang.errorLoadConfig)).hide(); - return; - } - - /* 上传插件 */ - uploader = _this.uploader = WebUploader.create({ - pick: { - id: '#filePickerReady', - label: lang.uploadSelectFile - }, - accept: { - title: 'Images', - extensions: acceptExtensions, - mimeTypes: 'image/jpeg,image/png,image/svg,image/webp,image/gif' - }, - swf: '../../third-party/webuploader/Uploader.swf', - server: actionUrl, - fileVal: editor.getOpt('imageFieldName'), - duplicate: true, - fileSingleSizeLimit: imageMaxSize, // 默认 2 M - compress: false - }); - uploader.addButton({ - id: '#filePickerBlock' - }); - uploader.addButton({ - id: '#filePickerBtn', - label: lang.uploadAddFile - }); - - setState('pedding'); - - // 当有文件添加进来时执行,负责view的创建 - function addFile(file) { - var $li = $('
                    • ' + - '

                      ' + file.name + '

                      ' + - '

                      ' + - '

                      ' + - '
                    • '), - - $btns = $('
                      ' + - '' + lang.uploadDelete + '' + - '' + lang.uploadTurnRight + '' + - '' + lang.uploadTurnLeft + '
                      ').appendTo($li), - $prgress = $li.find('p.progress span'), - $wrap = $li.find('p.imgWrap'), - $info = $('

                      ').hide().appendTo($li), - showError = function (code) { - switch (code) { - case 'exceed_size': - text = lang.errorExceedSize; - break; - case 'interrupt': - text = lang.errorInterrupt; - break; - case 'http': - text = lang.errorHttp; - break; - case 'not_allow_type': - text = lang.errorFileType; - break; - default: - text = lang.errorUploadRetry; - break; - } - $info.text(text).show(); - }; - if (file.getStatus() === 'invalid') { - showError(file.statusText); - } else { - $wrap.text(lang.uploadPreview); - if (browser.ie && browser.version <= 7) { - $wrap.text(lang.uploadNoPreview); - } else { - uploader.makeThumb(file, function (error, src) { - if (error || !src) { - $wrap.text(lang.uploadNoPreview); - } else { - var $img = $(''); - $wrap.empty().append($img); - $img.on('error', function () { - $wrap.text(lang.uploadNoPreview); - }); - } - }, thumbnailWidth, thumbnailHeight); - } - percentages[ file.id ] = [ file.size, 0 ]; - file.rotation = 0; - - /* 检查文件格式 */ - if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) { - showError('not_allow_type'); - uploader.removeFile(file); - } - } - - file.on('statuschange', function (cur, prev) { - if (prev === 'progress') { - $prgress.hide().width(0); - } else if (prev === 'queued') { - $li.off('mouseenter mouseleave'); - $btns.remove(); - } - // 成功 - if (cur === 'error' || cur === 'invalid') { - showError(file.statusText); - percentages[ file.id ][ 1 ] = 1; - } else if (cur === 'interrupt') { - showError('interrupt'); - } else if (cur === 'queued') { - percentages[ file.id ][ 1 ] = 0; - } else if (cur === 'progress') { - $info.hide(); - $prgress.css('display', 'block'); - } else if (cur === 'complete') { - } - - $li.removeClass('state-' + prev).addClass('state-' + cur); - }); - - $li.on('mouseenter', function () { - $btns.stop().animate({height: 30}); - }); - $li.on('mouseleave', function () { - $btns.stop().animate({height: 0}); - }); - - $btns.on('click', 'span', function () { - var index = $(this).index(), - deg; - - switch (index) { - case 0: - uploader.removeFile(file); - return; - case 1: - file.rotation += 90; - break; - case 2: - file.rotation -= 90; - break; - } - - if (supportTransition) { - deg = 'rotate(' + file.rotation + 'deg)'; - $wrap.css({ - '-webkit-transform': deg, - '-mos-transform': deg, - '-o-transform': deg, - 'transform': deg - }); - } else { - $wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')'); - } - - }); - - $li.insertBefore($filePickerBlock); - } - - // 负责view的销毁 - function removeFile(file) { - var $li = $('#' + file.id); - delete percentages[ file.id ]; - updateTotalProgress(); - $li.off().find('.file-panel').off().end().remove(); - } - - function updateTotalProgress() { - var loaded = 0, - total = 0, - spans = $progress.children(), - percent; - - $.each(percentages, function (k, v) { - total += v[ 0 ]; - loaded += v[ 0 ] * v[ 1 ]; - }); - - percent = total ? loaded / total : 0; - - spans.eq(0).text(Math.round(percent * 100) + '%'); - spans.eq(1).css('width', Math.round(percent * 100) + '%'); - updateStatus(); - } - - function setState(val, files) { - - if (val != state) { - - var stats = uploader.getStats(); - - $upload.removeClass('state-' + state); - $upload.addClass('state-' + val); - - switch (val) { - - /* 未选择文件 */ - case 'pedding': - $queue.addClass('element-invisible'); - $statusBar.addClass('element-invisible'); - $placeHolder.removeClass('element-invisible'); - $progress.hide(); $info.hide(); - uploader.refresh(); - break; - - /* 可以开始上传 */ - case 'ready': - $placeHolder.addClass('element-invisible'); - $queue.removeClass('element-invisible'); - $statusBar.removeClass('element-invisible'); - $progress.hide(); $info.show(); - $upload.text(lang.uploadStart); - uploader.refresh(); - break; - - /* 上传中 */ - case 'uploading': - $progress.show(); $info.hide(); - $upload.text(lang.uploadPause); - break; - - /* 暂停上传 */ - case 'paused': - $progress.show(); $info.hide(); - $upload.text(lang.uploadContinue); - break; - - case 'confirm': - $progress.show(); $info.hide(); - $upload.text(lang.uploadStart); - - stats = uploader.getStats(); - if (stats.successNum && !stats.uploadFailNum) { - setState('finish'); - return; - } - break; - - case 'finish': - $progress.hide(); $info.show(); - if (stats.uploadFailNum) { - $upload.text(lang.uploadRetry); - } else { - $upload.text(lang.uploadStart); - } - break; - } - - state = val; - updateStatus(); - - } - - if (!_this.getQueueCount()) { - $upload.addClass('disabled') - } else { - $upload.removeClass('disabled') - } - - } - - function updateStatus() { - var text = '', stats; - - if (state === 'ready') { - text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)); - } else if (state === 'confirm') { - stats = uploader.getStats(); - if (stats.uploadFailNum) { - text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum); - } - } else { - stats = uploader.getStats(); - text = lang.updateStatusFinish.replace('_', fileCount). - replace('_KB', WebUploader.formatSize(fileSize)). - replace('_', stats.successNum); - - if (stats.uploadFailNum) { - text += lang.updateStatusError.replace('_', stats.uploadFailNum); - } - } - - $info.html(text); - } - - uploader.on('fileQueued', function (file) { - /* 选择文件后设置上传相关的url和自定义参数 */ - editor.getOpt("imageUploadService")(_this, editor).setUploadData(file); - - fileCount++; - fileSize += file.size; - - if (fileCount === 1) { - $placeHolder.addClass('element-invisible'); - $statusBar.show(); - } - addFile(file); - }); - - uploader.on('fileDequeued', function (file) { - if (file.ext && acceptExtensions.indexOf(file.ext.toLowerCase()) != -1 && file.size <= imageMaxSize) { - fileCount--; - fileSize -= file.size; - } - - removeFile(file); - updateTotalProgress(); - }); - - uploader.on('filesQueued', function (file) { - if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) { - setState('ready'); - } - updateTotalProgress(); - }); - - uploader.on('all', function (type, files) { - switch (type) { - case 'uploadFinished': - setState('confirm', files); - break; - case 'startUpload': - /* 设置Uploader配置项 */ - editor.getOpt("imageUploadService")(_this, editor).setUploaderOptions(uploader); - setState('uploading', files); - break; - case 'stopUpload': - setState('paused', files); - break; - } - }); - - uploader.on('uploadBeforeSend', function (object, data, headers) { - //这里可以通过data对象添加POST参数 - editor.getOpt("imageUploadService")(_this, editor).setFormData(object, data, headers); - }); - - uploader.on('uploadProgress', function (file, percentage) { - var $li = $('#' + file.id), - $percent = $li.find('.progress span'); - - $percent.css('width', percentage * 100 + '%'); - percentages[ file.id ][ 1 ] = percentage; - updateTotalProgress(); - }); - - uploader.on('uploadSuccess', function (file, res) { - var $file = $('#' + file.id); - try { - if (editor.getOpt("imageUploadService")(_this, editor).getResponseSuccess(res)) { - _this.imageList.push(res); - $file.append(''); - } else { - $file.find('.error').text(res.message).show(); - } - } catch (e) { - $file.find('.error').text(lang.errorServerUpload).show(); - } - }); - - uploader.on('uploadError', function (file, code) { - }); - uploader.on('error', function (code, file) { - if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { - addFile(file); - } - }); - uploader.on('uploadComplete', function (file, ret) { - }); - - /* 上传按钮 */ - $upload.on('click', function () { - if ($(this).hasClass('disabled')) { - return false; - } - - if (state === 'ready') { - window.setTimeout(function() { - uploader.upload(); - }, 500); - } else if (state === 'paused') { - window.setTimeout(function() { - uploader.upload(); - }, 500); - } else if (state === 'uploading') { - uploader.stop(); - } - }); - - $upload.addClass('state-' + state); - updateTotalProgress(); - }, - getQueueCount: function () { - var file, i, status, readyFile = 0, files = this.uploader.getFiles(); - for (i = 0; file = files[i++]; ) { - status = file.getStatus(); - if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; - } - return readyFile; - }, - destroy: function () { - this.$wrap.remove(); - }, - getInsertList: function () { - var i, data, list = [], - align = getAlign(), - prefix = editor.getOpt('imageUrlPrefix'), - imageSrcField = editor.getOpt("imageUploadService")(this, editor).imageSrcField || 'url', - imageSrc = '', - imageSrcFieldKeys = imageSrcField.split('.'); - - for (i = 0; i < this.imageList.length; i++) { - data = this.imageList[i]; - - if(imageSrcFieldKeys.length > 1) { - function setImageSrc(obj, keys, index) { - obj = obj[keys[index]]; - if (index < keys.length - 1) { - setImageSrc(obj, keys, index += 1) - } else { - imageSrc = obj; - } - } - - setImageSrc(data, imageSrcFieldKeys, 0); - } else { - imageSrc = data[imageSrcField]; - } - - list.push({ - src: prefix + imageSrc, - _src: prefix + imageSrc, - alt: data.original, - floatStyle: align - }); - } - return list; - } - }; - - - /* 在线图片 */ - function OnlineImage(target) { - this.container = utils.isString(target) ? document.getElementById(target) : target; - this.init(); - } - OnlineImage.prototype = { - init: function () { - this.reset(); - this.initEvents(); - }, - /* 初始化容器 */ - initContainer: function () { - this.container.innerHTML = ''; - this.list = document.createElement('ul'); - this.clearFloat = document.createElement('li'); - - domUtils.addClass(this.list, 'list'); - domUtils.addClass(this.clearFloat, 'clearFloat'); - - this.list.appendChild(this.clearFloat); - this.container.appendChild(this.list); - }, - /* 初始化滚动事件,滚动到地步自动拉取数据 */ - initEvents: function () { - var _this = this; - - /* 滚动拉取图片 */ - domUtils.on($G('imageList'), 'scroll', function(e){ - var panel = this; - if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { - _this.getImageData(); - } - }); - /* 选中图片 */ - domUtils.on(this.container, 'click', function (e) { - var target = e.target || e.srcElement, - li = target.parentNode; - - if (li.tagName.toLowerCase() == 'li') { - if (domUtils.hasClass(li, 'selected')) { - domUtils.removeClasses(li, 'selected'); - } else { - domUtils.addClass(li, 'selected'); - } - } - }); - }, - /* 初始化第一次的数据 */ - initData: function () { - - /* 拉取数据需要使用的值 */ - this.state = 0; - this.listSize = editor.getOpt('imageManagerListSize'); - this.listIndex = 0; - this.listEnd = false; - - /* 第一次拉取数据 */ - this.getImageData(); - }, - /* 重置界面 */ - reset: function() { - this.initContainer(); - this.initData(); - }, - /* 向后台拉取图片列表数据 */ - getImageData: function () { - var _this = this; - - if(!_this.listEnd && !this.isLoadingData) { - this.isLoadingData = true; - var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')), - isJsonp = utils.isCrossDomainUrl(url); - ajax.request(url, { - 'timeout': 100000, - 'dataType': isJsonp ? 'jsonp':'', - 'data': utils.extend({ - start: this.listIndex, - size: this.listSize - }, editor.queryCommandValue('serverparam')), - 'method': 'get', - 'onsuccess': function (r) { - try { - var json = isJsonp ? r:eval('(' + r.responseText + ')'); - if (json.state == 'SUCCESS') { - _this.pushData(json.list); - _this.listIndex = parseInt(json.start) + parseInt(json.list.length); - if(_this.listIndex >= json.total) { - _this.listEnd = true; - } - _this.isLoadingData = false; - } - } catch (e) { - if(r.responseText.indexOf('ue_separate_ue') != -1) { - var list = r.responseText.split(r.responseText); - _this.pushData(list); - _this.listIndex = parseInt(list.length); - _this.listEnd = true; - _this.isLoadingData = false; - } - } - }, - 'onerror': function () { - _this.isLoadingData = false; - } - }); - } - }, - /* 添加图片到列表界面上 */ - pushData: function (list) { - var i, item, img, icon, _this = this, - urlPrefix = editor.getOpt('imageManagerUrlPrefix'); - for (i = 0; i < list.length; i++) { - if(list[i] && list[i].url) { - item = document.createElement('li'); - img = document.createElement('img'); - icon = document.createElement('span'); - - domUtils.on(img, 'load', (function(image){ - return function(){ - _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); - } - })(img)); - img.width = 113; - img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) ); - img.setAttribute('_src', urlPrefix + list[i].url); - domUtils.addClass(icon, 'icon'); - - item.appendChild(img); - item.appendChild(icon); - this.list.insertBefore(item, this.clearFloat); - } - } - }, - /* 改变图片大小 */ - scale: function (img, w, h, type) { - var ow = img.width, - oh = img.height; - - if (type == 'justify') { - if (ow >= oh) { - img.width = w; - img.height = h * oh / ow; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w * ow / oh; - img.height = h; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } else { - if (ow >= oh) { - img.width = w * ow / oh; - img.height = h; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w; - img.height = h * oh / ow; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } - }, - getInsertList: function () { - var i, lis = this.list.children, list = [], align = getAlign(); - for (i = 0; i < lis.length; i++) { - if (domUtils.hasClass(lis[i], 'selected')) { - var img = lis[i].firstChild, - src = img.getAttribute('_src'); - list.push({ - src: src, - _src: src, - alt: src.substr(src.lastIndexOf('/') + 1), - floatStyle: align - }); - } - - } - return list; - } - }; - - /*搜索图片 */ - function SearchImage() { - this.init(); - } - SearchImage.prototype = { - init: function () { - this.initEvents(); - }, - initEvents: function(){ - var _this = this; - - /* 点击搜索按钮 */ - domUtils.on($G('searchBtn'), 'click', function(){ - var key = $G('searchTxt').value; - if(key && key != lang.searchRemind) { - _this.getImageData(); - } - }); - /* 点击清除妞 */ - domUtils.on($G('searchReset'), 'click', function(){ - $G('searchTxt').value = lang.searchRemind; - $G('searchListUl').innerHTML = ''; - $G('searchType').selectedIndex = 0; - }); - /* 搜索框聚焦 */ - domUtils.on($G('searchTxt'), 'focus', function(){ - var key = $G('searchTxt').value; - if(key && key == lang.searchRemind) { - $G('searchTxt').value = ''; - } - }); - /* 搜索框回车键搜索 */ - domUtils.on($G('searchTxt'), 'keydown', function(e){ - var keyCode = e.keyCode || e.which; - if (keyCode == 13) { - $G('searchBtn').click(); - } - }); - - /* 选中图片 */ - domUtils.on($G('searchList'), 'click', function(e){ - var target = e.target || e.srcElement, - li = target.parentNode.parentNode; - - if (li.tagName.toLowerCase() == 'li') { - if (domUtils.hasClass(li, 'selected')) { - domUtils.removeClasses(li, 'selected'); - } else { - domUtils.addClass(li, 'selected'); - } - } - }); - }, - /* 改变图片大小 */ - scale: function (img, w, h) { - var ow = img.width, - oh = img.height; - - if (ow >= oh) { - img.width = w * ow / oh; - img.height = h; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w; - img.height = h * oh / ow; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - }, - getImageData: function(){ - var _this = this, - key = $G('searchTxt').value, - type = $G('searchType').value, - keepOriginName = editor.options.keepOriginName ? "1" : "0", - pageNum = $G('pageNum').value, - url = "https://image.baidu.com/search/acjson?tn=resultjson_com&ipn=rj&ct=201326592&is=&fp=result&queryWord=" + key + "&cl=2" + type + "&ie=utf-8&oe=utf-8&adpicid=&z=&ic=0&word=" + key + "&se=&tab=&width=&height=&istype=2&qc=&nc=1&fr=&pn=60&rn=" + pageNum + "&gsm=78&" + new Date() + "="; - - $G('searchListUl').innerHTML = lang.searchLoading; - ajax.request(url, { - 'dataType': 'jsonp', - 'onsuccess':function(json){ - var list = []; - if(json && json.data) { - for(var i = 0; i < json.data.length; i++) { - if(json.data[i].objURL) { - list.push({ - title: json.data[i].fromPageTitleEnc, - src: json.data[i].thumbURL, - url: json.data[i].thumbURL - }); - } - } - } - _this.setList(list); - }, - 'onerror':function(){ - $G('searchListUl').innerHTML = lang.searchRetry; - } - }); - }, - /* 添加图片到列表界面上 */ - setList: function (list) { - var i, item, p, img, link, _this = this, - listUl = $G('searchListUl'); - - listUl.innerHTML = ''; - if(list.length) { - for (i = 0; i < list.length; i++) { - item = document.createElement('li'); - p = document.createElement('p'); - img = document.createElement('img'); - link = document.createElement('a'); - - img.onload = function () { - _this.scale(this, 113, 113); - }; - img.width = 113; - img.setAttribute('src', list[i].src); - - link.href = list[i].url; - link.target = '_blank'; - link.title = list[i].title; - link.innerHTML = list[i].title; - - p.appendChild(img); - item.appendChild(p); - item.appendChild(link); - listUl.appendChild(item); - } - } else { - listUl.innerHTML = lang.searchRetry; - } - }, - getInsertList: function () { - var child, - src, - align = getAlign(), - list = [], - items = $G('searchListUl').children; - for(var i = 0; i < items.length; i++) { - child = items[i].firstChild && items[i].firstChild.firstChild; - if(child.tagName && child.tagName.toLowerCase() == 'img' && domUtils.hasClass(items[i], 'selected')) { - src = child.src; - list.push({ - src: src, - _src: src, - alt: src.substr(src.lastIndexOf('/') + 1), - floatStyle: align - }); - } - } - return list; - } - }; - -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/alignicon.jpg b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/alignicon.jpg deleted file mode 100644 index 754755b1b6e2b37d6090f68b80e91867fdcf1042..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/alignicon.jpg and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/bg.png deleted file mode 100644 index 580be0a01dff4c70c72f78a3f40186660ee8eee0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/icons.gif deleted file mode 100644 index 78459dea7b12ccbeec81d19ecdab22b1658e93b4..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/icons.png deleted file mode 100644 index 12e4700163ac87fa38ae3d92a2c39d0fb4690fed..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/image.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/image.png deleted file mode 100644 index 19699f6a9c6b09cb18ec0f488242d9753d2e341b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/image.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/progress.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/progress.png deleted file mode 100644 index 717c4865c90a959c6a0e9ad1af9c777d900a2e9c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/progress.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/success.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/success.gif deleted file mode 100644 index 8d4f3112b9d1df2147ed3b67d9736163dedd11e1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/success.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/success.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/success.png deleted file mode 100644 index 94f968dc8fd3c7ca8f6cb599d006ef3f23b62c7d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/image/images/success.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/insertframe/insertframe.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/insertframe/insertframe.html deleted file mode 100644 index 5170cbd05948b5a37345fc935e9397252d9a3427..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/insertframe/insertframe.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - -
                      - - - - - - - - - - - - - - - - - - - -
                      - - -
                      px
                      px
                      - -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/internal.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/internal.js deleted file mode 100644 index fb845c3ebc6fcd7a06024b5ef66d5aed3b5b63e7..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/internal.js +++ /dev/null @@ -1,81 +0,0 @@ -(function () { - var parent = window.parent; - //dialog对象 - dialog = parent.$EDITORUI[window.frameElement.id.replace( /_iframe$/, '' )]; - //当前打开dialog的编辑器实例 - editor = dialog.editor; - - UE = parent.UE; - - domUtils = UE.dom.domUtils; - - utils = UE.utils; - - browser = UE.browser; - - ajax = UE.ajax; - - $G = function ( id ) { - return document.getElementById( id ) - }; - //focus元素 - $focus = function ( node ) { - setTimeout( function () { - if ( browser.ie ) { - var r = node.createTextRange(); - r.collapse( false ); - r.select(); - } else { - node.focus() - } - }, 0 ) - }; - utils.loadFile(document,{ - href:"../../themes/" + editor.options.theme + "/dialogbase.css?cache="+Math.random(), - tag:"link", - type:"text/css", - rel:"stylesheet" - }); - lang = editor.getLang(dialog.className.split( "-" )[2]); - if(lang){ - domUtils.on(window,'load',function () { - - var langImgPath = editor.options.langPath + editor.options.lang + "/images/"; - //针对静态资源 - for ( var i in lang["static"] ) { - var dom = $G( i ); - if(!dom) continue; - var tagName = dom.tagName, - content = lang["static"][i]; - if(content.src){ - //clone - content = utils.extend({},content,false); - content.src = langImgPath + content.src; - } - if(content.style){ - content = utils.extend({},content,false); - content.style = content.style.replace(/url\s*\(/g,"url(" + langImgPath) - } - switch ( tagName.toLowerCase() ) { - case "var": - dom.parentNode.replaceChild( document.createTextNode( content ), dom ); - break; - case "select": - var ops = dom.options; - for ( var j = 0, oj; oj = ops[j]; ) { - oj.innerHTML = content.options[j++]; - } - for ( var p in content ) { - p != "options" && dom.setAttribute( p, content[p] ); - } - break; - default : - domUtils.setAttributes( dom, content); - } - } - } ); - } - - -})(); - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/link/link.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/link/link.html deleted file mode 100644 index 8da85504e8169eee4ea149db1db55e38e0a7573e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/link/link.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      - - -
                      - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/map/map.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/map/map.html deleted file mode 100644 index a4c6a9f8f19a621340b47485a718eca64253cece..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/map/map.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - -
                      - - - - - - - - - -
                      ::
                      -
                      - -
                      - - - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/map/show.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/map/show.html deleted file mode 100644 index b1508982a5bdb8c2ebf8e7c0ecf3cc8f3fe82ea5..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/map/show.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - 百度地图API自定义地图 - - - - - - - -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/balls.svg b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/balls.svg deleted file mode 100644 index 07130c6f1039d78327efd6446ef48b2d81ad4704..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/balls.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/music.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/music.css deleted file mode 100644 index 8ec98b990eeebbca8ee7ea597a78048d990c9478..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/music.css +++ /dev/null @@ -1,90 +0,0 @@ -.wrapper{margin: 20px;} - -.searchBar{height:30px;text-align:left;} -.searchBtn{ - font-size: 13px; - height: 28px; - border-radius: 5px; - border: 1px solid #3498db; - width: 80px; - background-color: #3498db; - color: #fff; - margin-left: 6px; -} - -.resultBar{width:589px;height:357px;margin-top: 20px;border: 1px solid #CCC;border-radius: 5px;box-shadow: 2px 2px 5px #D3D6DA;overflow: hidden;} - -.listPanel{overflow: hidden;} -.panelon{display:block;} -.paneloff{display:none} - -.page{width:220px;margin:20px auto;overflow: hidden;display: flex;justify-content: center;flex-direction: row-reverse;} -.pageon{float:right;width:26px;line-height:26px;height:26px;margin-right: 5px;border: none;color: #fff;font-weight: bold;text-align:center; - background-color: #3498db;border-radius: 5px;} -.pageoff{float:right;width:24px;line-height:24px;height:24px;cursor:pointer;background-color: #fff; - color: #ccc;margin-right: 5px;text-decoration: none;text-align:center;} - -.m-box{width:589px;} -.m-m{float: left;line-height: 26px;height: 26px;display: flex;} -.m-h{height:30px;line-height:30px;padding-left: 70px;background-color:#f3f3f3;font-weight: bold;font-size: 12px;color: #666;} -.m-l{float:left;width:40px; margin-top: 8px; margin-left: 17px;margin-right: 10px;} -.m-t{float:left;width:142px;} -.m-s{float:left;width:142px;} -.m-z{float:left;width:142px;} -.m-try-t{float: left;width: 60px;;} - -/*.m-try{float:left;width:20px;height:20px;background:url('http://static.tieba.baidu.com/tb/editor/images/try_music.gif') no-repeat ;}*/ -.m-try { - width: 4px; - display: flex; - height: 0; - border-top: 5px solid transparent; - border-left: 8px solid #9e9e9e; - border-bottom: 5px solid transparent; - margin-top: 8px; -} -/*.m-trying{float:left;width:20px;height:20px;background:url('http://static.tieba.baidu.com/tb/editor/images/stop_music.gif') no-repeat ;}*/ - -.m-trying { - display: flex; - width: 3px; - height: 12px; - background-color: #3498db; - margin-top: 8px; - position: relative; -} -.m-trying:after { - width: 3px; - height: 12px; - background-color: #3498db; - left : 5px; - display: block; - position: absolute; - content: " "; -} -.loading{ - width: 113px; - height: 95px; - font-size: 7px; - margin: 114px auto; - background: url(balls.svg) no-repeat; -} -.empty{ - width: 300px; - height: 40px; - padding: 2px; - margin: 157px auto; - line-height: 40px; - color: #666; - text-align: center; -} - -#J_searchName{ - height: 26px; - width: 295px; - border-radius: 5px; - border: 1px solid #ccc; -} -.listPanel input[type="radio"] { - background-color: #fff; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/music.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/music.html deleted file mode 100644 index e7ef04f3954f294e165455539c9f02c764165d2c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/music.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - 插入音乐 - - - - -
                      - -
                      - -
                      -
                      -
                      -
                      - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/music.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/music.js deleted file mode 100644 index 97cfc36afbe92764c978106a8cad16f1d58871fb..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/music/music.js +++ /dev/null @@ -1,192 +0,0 @@ -function Music() { - this.init(); -} -(function () { - var pages = [], - panels = [], - selectedItem = null; - Music.prototype = { - total:70, - pageSize:10, - dataUrl:"https://tingapi.b0.upaiyun.com/v1/restserver/ting?method=baidu.ting.search.common", - playerUrl:"http://box.baidu.com/widget/flash/bdspacesong.swf", - - init:function () { - var me = this; - domUtils.on($G("J_searchName"), "keyup", function (event) { - var e = window.event || event; - if (e.keyCode == 13) { - me.dosearch(); - } - }); - domUtils.on($G("J_searchBtn"), "click", function () { - me.dosearch(); - }); - }, - callback:function (data) { - var me = this; - me.data = data.song_list; - setTimeout(function () { - $G('J_resultBar').innerHTML = me._renderTemplate(data.song_list); - }, 300); - }, - dosearch:function () { - var me = this; - selectedItem = null; - var key = $G('J_searchName').value; - if (utils.trim(key) == "")return false; - key = encodeURIComponent(key); - me._sent(key); - }, - doselect:function (i) { - var me = this; - if (typeof i == 'object') { - selectedItem = i; - } else if (typeof i == 'number') { - selectedItem = me.data[i]; - } - }, - onpageclick:function (id) { - var me = this; - for (var i = 0; i < pages.length; i++) { - $G(pages[i]).className = 'pageoff'; - $G(panels[i]).className = 'paneloff'; - } - $G('page' + id).className = 'pageon'; - $G('panel' + id).className = 'panelon'; - }, - listenTest:function (elem) { - var me = this, - view = $G('J_preview'), - is_play_action = (elem.className == 'm-try'), - old_trying = me._getTryingElem(); - - if (old_trying) { - old_trying.className = 'm-try'; - view.innerHTML = ''; - } - if (is_play_action) { - elem.className = 'm-trying'; - view.innerHTML = me._buildMusicHtml(me._getUrl(true)); - } - }, - _sent:function (param) { - var me = this; - $G('J_resultBar').innerHTML = '
                      '; - - utils.loadFile(document, { - src:me.dataUrl + '&query=' + param + '&page_size=' + me.total + '&callback=music.callback&.r=' + Math.random(), - tag:"script", - type:"text/javascript", - defer:"defer" - }); - }, - _removeHtml:function (str) { - var reg = /<\s*\/?\s*[^>]*\s*>/gi; - return str.replace(reg, ""); - }, - _getUrl:function (isTryListen) { - var me = this; - var param = 'from=tiebasongwidget&url=&name=' + encodeURIComponent(me._removeHtml(selectedItem.title)) + '&artist=' - + encodeURIComponent(me._removeHtml(selectedItem.author)) + '&extra=' - + encodeURIComponent(me._removeHtml(selectedItem.album_title)) - + '&autoPlay='+isTryListen+'' + '&loop=true'; - return me.playerUrl + "?" + param; - }, - _getTryingElem:function () { - var s = $G('J_listPanel').getElementsByTagName('span'); - - for (var i = 0; i < s.length; i++) { - if (s[i].className == 'm-trying') - return s[i]; - } - return null; - }, - _buildMusicHtml:function (playerUrl) { - var html = ' 12) - return s.substring(0, 5) + '...'; - if (!s) s = " "; - return s; - }, - _rebuildData:function (data) { - var me = this, - newData = [], - d = me.pageSize, - itembox; - for (var i = 0; i < data.length; i++) { - if ((i + d) % d == 0) { - itembox = []; - newData.push(itembox) - } - itembox.push(data[i]); - } - return newData; - }, - _renderTemplate:function (data) { - var me = this; - if (data.length == 0)return '
                      ' + lang.emptyTxt + '
                      '; - data = me._rebuildData(data); - var s = [], p = [], t = []; - s.push('
                      '); - p.push('
                      '); - for (var i = 0, tmpList; tmpList = data[i++];) { - panels.push('panel' + i); - pages.push('page' + i); - if (i == 1) { - s.push('
                      '); - if (data.length != 1) { - t.push('
                      ' + (i ) + '
                      '); - } - } else { - s.push('
                      '); - t.push('
                      ' + (i ) + '
                      '); - } - s.push('
                      '); - s.push('
                      ' + lang.chapter + '' + lang.singer - + '' + lang.special + '' + lang.listenTest + '
                      '); - for (var j = 0, tmpObj; tmpObj = tmpList[j++];) { - s.push(''); - } - s.push('
                      '); - s.push('
                      '); - } - t.reverse(); - p.push(t.join('')); - s.push('
                      '); - p.push('
                      '); - return s.join('') + p.join(''); - }, - exec:function () { - var me = this; - if (selectedItem == null) return; - $G('J_preview').innerHTML = ""; - editor.execCommand('music', { - url:me._getUrl(false), - width:400, - height:95 - }); - } - }; -})(); - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/preview/preview.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/preview/preview.html deleted file mode 100644 index 42849bb77fc84b187c9d18904836866f75a5213d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/preview/preview.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - -
                      - -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/addimg.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/addimg.png deleted file mode 100644 index 03a87135bab65fa2633156789ed0f4a906d6c48b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/addimg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/brush.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/brush.png deleted file mode 100644 index efa6fdb01a8e5cf161dc62bfb20894689a1730bd..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/brush.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/delimg.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/delimg.png deleted file mode 100644 index 5a892e40ad3257f632b34a873b517dd5d590cc9f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/delimg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/delimgH.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/delimgH.png deleted file mode 100644 index 2f0c5c9de33a431d1c8e50cd12da74505921ad7e..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/delimgH.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/empty.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/empty.png deleted file mode 100644 index 0375196257ac3c859373b3ebebbabe6f16105587..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/empty.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/emptyH.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/emptyH.png deleted file mode 100644 index 838ca723119499465f29e881a745f4d8a051e22c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/emptyH.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/eraser.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/eraser.png deleted file mode 100644 index 63e87cecb90ed3ac0e4acbc257c6dddae5311e09..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/eraser.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/redo.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/redo.png deleted file mode 100644 index 12cd9bbefc637c7c0a394d00e9d70333ac0f6ea5..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/redo.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/redoH.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/redoH.png deleted file mode 100644 index d9f33d38a3d11ce10447830ce409a0890ecad264..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/redoH.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/scale.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/scale.png deleted file mode 100644 index 935a3f3e1eee04b8a3aa6f70681376298d11e22a..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/scale.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/scaleH.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/scaleH.png deleted file mode 100644 index 72e64a9d0f3ef081ffda153c755600dc4a758e5b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/scaleH.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/size.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/size.png deleted file mode 100644 index 8366845059c94089aef92aa3aeeee79e242732eb..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/size.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/undo.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/undo.png deleted file mode 100644 index 084c7cc73f4058c8084e5ea3ab4e51fd105b7991..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/undo.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/undoH.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/undoH.png deleted file mode 100644 index fde7eb3c2e8080be0224b603f65c3fa5552418be..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/images/undoH.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/scrawl.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/scrawl.css deleted file mode 100644 index f5d35d866d741fd44be96bf2fc794c80103dc2fa..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/scrawl.css +++ /dev/null @@ -1,372 +0,0 @@ -/*common -*/ -body { - margin: 0; -} - -table { - width: 100%; -} - -table td { - padding: 2px 4px; - vertical-align: middle; -} - -a { - text-decoration: none; -} - -em { - font-style: normal; -} - -.border_style1 { - border: 1px solid #ccc; - border-radius: 5px; - box-shadow: 2px 2px 5px #d3d6da; -} - -/*module -*/ -.main { - margin: 20px 20px 0; - overflow: hidden; -} - -.hot { - float: left; -} - -.drawBoard { - position: relative; - cursor: crosshair; -} - -.brushBorad { - position: absolute; - left: 0; - top: 0; - z-index: 998; -} - -.picBoard { - border: none; - text-align: center; - line-height: 300px; - cursor: default; -} - -.operateBar { - margin-top: 10px; - font-size: 12px; - text-align: center; -} - -.operateBar span { - margin-left: 10px; - margin-right: 18px; -} - -.drawToolbar { - float: right; - width: 175px; - height: 372px; - overflow: hidden; -} - -.colorBar { - margin-top: 10px; - margin-left: 10px; - font-size: 12px; - text-align: center; -} - -#J_removeImg { - display: block; - margin-top: 18px; -} - -#J_addImg { - display: block; - margin-top: 16px; -} - -.colorBar #J_colorList tr { - height: 32px; -} - -.colorBar a { - display: block; - width: 16px; - height: 16px; - border: 1px solid #1006F1; - border-radius: 8px; - box-shadow: 2px 2px 5px #d3d6da; - opacity: 0.6 -} - -.sectionBar { - margin-top: 20px; - font-size: 12px; - text-align: center; - display: flex; - justify-content: center; - align-items: center; -} - -/*.sectionBar a{display:inline-block;width:10px;height:12px;color: #888;text-indent: -999px;opacity: 0.3}*/ -/*.size1{background: url('images/size.png') 1px center no-repeat ;}*/ -/*.size2{background: url('images/size.png') -10px center no-repeat;}*/ -/*.size3{background: url('images/size.png') -22px center no-repeat;}*/ -/*.size4{background: url('images/size.png') -35px center no-repeat;}*/ - -.size1 { - width: 4px; - height: 4px; - border-radius: 2px; - text-indent: -999px; - opacity: 0.3; - display: block; - background-color: #3498db; - margin-right: 17px; - margin-left: 15px; -} - -.size2 { - width: 8px; - height: 8px; - border-radius: 4px; - text-indent: -999px; - opacity: 0.3; - display: block; - margin-right: 17px; - background-color: #3498db; - -} - -.size3 { - width: 12px; - height: 12px; - border-radius: 6px; - text-indent: -999px; - opacity: 0.3; - display: block; - background-color: #3498db; - margin-right: 17px; -} - -.size4 { - width: 16px; - height: 16px; - border-radius: 8px; - text-indent: -999px; - opacity: 0.3; - display: block; - background-color: #3498db; -} - -.addImgH { - position: relative; -} - -.addImgH_form { - position: absolute; - left: 18px; - top: -1px; - width: 75px; - height: 21px; - opacity: 0; - cursor: pointer; -} - -.addImgH_form input { - width: 100%; -} - -/*scrawl遮罩层 -*/ -.maskLayerNull { - display: none; -} - -.maskLayer { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - opacity: 0.7; - background-color: #fff; - text-align: center; - font-weight: bold; - line-height: 410px; - z-index: 1000; -} - -.maskLayer input { - border-radius: 2px; - border: 1px solid #ccc; - padding: 4px 12px; -} - -/*btn state -*/ -.previousStepH .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.previousStepH .text { - color: #888; - cursor: pointer; -} - -.previousStep .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.previousStep .text { - color: #ccc; - cursor: default; -} - -.nextStepH .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.nextStepH .text { - color: #888; - cursor: pointer; -} - -.nextStep .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.nextStep .text { - color: #ccc; - cursor: default; -} - -.clearBoardH .icon { - display: inline-block; - width: 16px; - height: 16px; - /*background-image: url('images/empty.png');*/ - cursor: default; -} - -.clearBoardH .text { - color: #888; - cursor: pointer; -} - -.clearBoard .icon { - display: inline-block; - width: 16px; - height: 16px; - /*background-image: url('images/empty.png');*/ - cursor: default; -} - -.clearBoard .text { - color: #ccc; - cursor: default; -} - -.scaleBoardH .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.scaleBoardH .text { - color: #888; - cursor: pointer; -} - -.scaleBoard .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.scaleBoard .text { - color: #ccc; - cursor: default; -} - -.removeImgH .icon { - display: inline-block; - width: 16px; - height: 16px; - background-image: url('images/delimgH.png'); - cursor: pointer; -} - -.removeImgH .text { - color: #888; - cursor: pointer; -} - -.removeImg .icon { - display: inline-block; - width: 16px; - height: 16px; - background-image: url('images/delimg.png'); - cursor: default; -} - -.removeImg .text { - color: #fff; - cursor: default; - padding: 7px 12px; - border-radius: 6px; - background-color: #f25f5f; -} - -.addImgH .icon { - vertical-align: top; - display: inline-block; - width: 16px; - height: 16px; - background-image: url('images/addimg.png') -} - -.addImgH .text { - color: #888; - cursor: pointer; - padding: 7px 12px; - border-radius: 6px; - background-color: #f3f3f3; -} - -/*icon -*/ -.brushIcon { - display: inline-block; - width: 16px; - height: 16px; - font-size: 16px; - margin-top: -5px; -} - -.eraserIcon { - display: inline-block; - width: 16px; - height: 16px; - font-size: 18px !important; - margin-top: -16px; -} - -.icon { - font-size: 18px; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/scrawl.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/scrawl.html deleted file mode 100644 index 6e8db0e325d892d8a8e9273d8909ef690bc80a5d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/scrawl.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - -
                      -
                      -
                      - -
                      -
                      -
                      - - - - - - - - - - - - - - - - - - - - -
                      -
                      -
                      -
                      -
                      - - 1 - 3 - 5 - 7 -
                      -
                      - - 1 - 3 - 5 - 7 -
                      -
                      -
                      - - -
                      - -
                      - -
                      -
                      -
                      - - - - -
                      -
                      -
                      -
                      - - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/scrawl.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/scrawl.js deleted file mode 100644 index a8cbce1536b9a6d2e16f5d25008dee64fe769fa1..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/scrawl/scrawl.js +++ /dev/null @@ -1,683 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-5-22 - * Time: 上午11:38 - * To change this template use File | Settings | File Templates. - */ -var scrawl = function (options) { - options && this.initOptions(options); -}; -(function () { - var canvas = $G("J_brushBoard"), - context = canvas.getContext('2d'), - drawStep = [], //undo redo存储 - drawStepIndex = 0; //undo redo指针 - - scrawl.prototype = { - isScrawl:false, //是否涂鸦 - brushWidth:-1, //画笔粗细 - brushColor:"", //画笔颜色 - - initOptions:function (options) { - var me = this; - me.originalState(options);//初始页面状态 - me._buildToolbarColor(options.colorList);//动态生成颜色选择集合 - - me._addBoardListener(options.saveNum);//添加画板处理 - me._addOPerateListener(options.saveNum);//添加undo redo clearBoard处理 - me._addColorBarListener();//添加颜色选择处理 - me._addBrushBarListener();//添加画笔大小处理 - me._addEraserBarListener();//添加橡皮大小处理 - me._addAddImgListener();//添加增添背景图片处理 - me._addRemoveImgListenter();//删除背景图片处理 - me._addScalePicListenter();//添加缩放处理 - me._addClearSelectionListenter();//添加清楚选中状态处理 - - me._originalColorSelect(options.drawBrushColor);//初始化颜色选中 - me._originalBrushSelect(options.drawBrushSize);//初始化画笔选中 - me._clearSelection();//清楚选中状态 - }, - - originalState:function (options) { - var me = this; - - me.brushWidth = options.drawBrushSize;//同步画笔粗细 - me.brushColor = options.drawBrushColor;//同步画笔颜色 - - context.lineWidth = me.brushWidth;//初始画笔大小 - context.strokeStyle = me.brushColor;//初始画笔颜色 - context.fillStyle = "transparent";//初始画布背景颜色 - context.lineCap = "round";//去除锯齿 - context.fill(); - }, - _buildToolbarColor:function (colorList) { - var tmp = null, arr = []; - arr.push(""); - for (var i = 0, color; color = colorList[i++];) { - if ((i - 1) % 5 == 0) { - if (i != 1) { - arr.push(""); - } - arr.push(""); - } - tmp = '#' + color; - arr.push(""); - } - arr.push("
                      "); - $G("J_colorBar").innerHTML = arr.join(""); - }, - - _addBoardListener:function (saveNum) { - var me = this, - margin = 0, - startX = -1, - startY = -1, - isMouseDown = false, - isMouseMove = false, - isMouseUp = false, - buttonPress = 0, button, flag = ''; - - margin = parseInt(domUtils.getComputedStyle($G("J_wrap"), "margin-left")); - drawStep.push(context.getImageData(0, 0, context.canvas.width, context.canvas.height)); - drawStepIndex += 1; - - domUtils.on(canvas, ["mousedown", "mousemove", "mouseup", "mouseout"], function (e) { - button = browser.webkit ? e.which : buttonPress; - switch (e.type) { - case 'mousedown': - buttonPress = 1; - flag = 1; - isMouseDown = true; - isMouseUp = false; - isMouseMove = false; - me.isScrawl = true; - startX = e.clientX - margin;//10为外边距总和 - startY = e.clientY - margin; - context.beginPath(); - break; - case 'mousemove' : - if (!flag && button == 0) { - return; - } - if (!flag && button) { - startX = e.clientX - margin;//10为外边距总和 - startY = e.clientY - margin; - context.beginPath(); - flag = 1; - } - if (isMouseUp || !isMouseDown) { - return; - } - var endX = e.clientX - margin, - endY = e.clientY - margin; - - context.moveTo(startX, startY); - context.lineTo(endX, endY); - context.stroke(); - startX = endX; - startY = endY; - isMouseMove = true; - break; - case 'mouseup': - buttonPress = 0; - if (!isMouseDown)return; - if (!isMouseMove) { - context.arc(startX, startY, context.lineWidth, 0, Math.PI * 2, false); - context.fillStyle = context.strokeStyle; - context.fill(); - } - context.closePath(); - me._saveOPerate(saveNum); - isMouseDown = false; - isMouseMove = false; - isMouseUp = true; - startX = -1; - startY = -1; - break; - case 'mouseout': - flag = ''; - buttonPress = 0; - if (button == 1) return; - context.closePath(); - break; - } - }); - }, - _addOPerateListener:function (saveNum) { - var me = this; - domUtils.on($G("J_previousStep"), "click", function () { - if (drawStepIndex > 1) { - drawStepIndex -= 1; - context.clearRect(0, 0, context.canvas.width, context.canvas.height); - context.putImageData(drawStep[drawStepIndex - 1], 0, 0); - // me.btn2Highlight("J_nextStep"); - // drawStepIndex == 1 && me.btn2disable("J_previousStep"); - } - }); - domUtils.on($G("J_nextStep"), "click", function () { - if (drawStepIndex > 0 && drawStepIndex < drawStep.length) { - context.clearRect(0, 0, context.canvas.width, context.canvas.height); - context.putImageData(drawStep[drawStepIndex], 0, 0); - drawStepIndex += 1; - // me.btn2Highlight("J_previousStep"); - // drawStepIndex == drawStep.length && me.btn2disable("J_nextStep"); - } - }); - domUtils.on($G("J_clearBoard"), "click", function () { - context.clearRect(0, 0, context.canvas.width, context.canvas.height); - drawStep = []; - me._saveOPerate(saveNum); - drawStepIndex = 1; - me.isScrawl = false; - // me.btn2disable("J_previousStep"); - // me.btn2disable("J_nextStep"); - // me.btn2disable("J_clearBoard"); - }); - }, - _addColorBarListener:function () { - var me = this; - domUtils.on($G("J_colorBar"), "click", function (e) { - var target = me.getTarget(e), - color = target.title; - if (!!color) { - me._addColorSelect(target); - - me.brushColor = color; - context.globalCompositeOperation = "source-over"; - context.lineWidth = me.brushWidth; - context.strokeStyle = color; - } - }); - }, - _addBrushBarListener:function () { - var me = this; - domUtils.on($G("J_brushBar"), "click", function (e) { - var target = me.getTarget(e), - size = browser.ie ? target.innerText : target.text; - if (!!size) { - me._addBESelect(target); - - context.globalCompositeOperation = "source-over"; - context.lineWidth = parseInt(size); - context.strokeStyle = me.brushColor; - me.brushWidth = context.lineWidth; - } - }); - }, - _addEraserBarListener:function () { - var me = this; - domUtils.on($G("J_eraserBar"), "click", function (e) { - var target = me.getTarget(e), - size = browser.ie ? target.innerText : target.text; - if (!!size) { - me._addBESelect(target); - - context.lineWidth = parseInt(size); - context.globalCompositeOperation = "destination-out"; - context.strokeStyle = "#FFF"; - } - }); - }, - _addAddImgListener:function () { - var file = $G("J_imgTxt"); - if (!window.FileReader) { - $G("J_addImg").style.display = 'none'; - $G("J_removeImg").style.display = 'none'; - $G("J_sacleBoard").style.display = 'none'; - } - domUtils.on(file, "change", function (e) { - var frm = file.parentNode; - addMaskLayer(lang.backgroundUploading); - - var target = e.target || e.srcElement, - reader = new FileReader(); - reader.onload = function(evt){ - var target = evt.target || evt.srcElement; - ue_callback(target.result, 'SUCCESS'); - }; - reader.readAsDataURL(target.files[0]); - frm.reset(); - }); - }, - _addRemoveImgListenter:function () { - var me = this; - domUtils.on($G("J_removeImg"), "click", function () { - $G("J_picBoard").innerHTML = ""; - // me.btn2disable("J_removeImg"); - // me.btn2disable("J_sacleBoard"); - }); - }, - _addScalePicListenter:function () { - domUtils.on($G("J_sacleBoard"), "click", function () { - var picBoard = $G("J_picBoard"), - scaleCon = $G("J_scaleCon"), - img = picBoard.children[0]; - - if (img) { - if (!scaleCon) { - picBoard.style.cssText = "position:relative;z-index:999;"+picBoard.style.cssText; - img.style.cssText = "position: absolute;top:" + (canvas.height - img.height) / 2 + "px;left:" + (canvas.width - img.width) / 2 + "px;"; - var scale = new ScaleBoy(); - picBoard.appendChild(scale.init()); - scale.startScale(img); - } else { - if (scaleCon.style.visibility == "visible") { - scaleCon.style.visibility = "hidden"; - picBoard.style.position = ""; - picBoard.style.zIndex = ""; - } else { - scaleCon.style.visibility = "visible"; - picBoard.style.cssText += "position:relative;z-index:999"; - } - } - } - }); - }, - _addClearSelectionListenter:function () { - var doc = document; - domUtils.on(doc, 'mousemove', function (e) { - if (browser.ie && browser.version < 11) - doc.selection.clear(); - else - window.getSelection().removeAllRanges(); - }); - }, - _clearSelection:function () { - var list = ["J_operateBar", "J_colorBar", "J_brushBar", "J_eraserBar", "J_picBoard"]; - for (var i = 0, group; group = list[i++];) { - domUtils.unSelectable($G(group)); - } - }, - - _saveOPerate:function (saveNum) { - var me = this; - if (drawStep.length <= saveNum) { - if(drawStepIndex"); - } - scale.innerHTML = arr.join(""); - return scale; - } - - var rect = [ - //[left, top, width, height] - [1, 1, -1, -1], - [0, 1, 0, -1], - [0, 1, 1, -1], - [1, 0, -1, 0], - [0, 0, 1, 0], - [1, 0, -1, 1], - [0, 0, 0, 1], - [0, 0, 1, 1] - ]; - ScaleBoy.prototype = { - init:function () { - _appendStyle(); - var me = this, - scale = me.dom = _getDom(); - - me.scaleMousemove.fp = me; - domUtils.on(scale, 'mousedown', function (e) { - var target = e.target || e.srcElement; - me.start = {x:e.clientX, y:e.clientY}; - if (target.className.indexOf('hand') != -1) { - me.dir = target.className.replace('hand', ''); - } - domUtils.on(document.body, 'mousemove', me.scaleMousemove); - e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true; - }); - domUtils.on(document.body, 'mouseup', function (e) { - if (me.start) { - domUtils.un(document.body, 'mousemove', me.scaleMousemove); - if (me.moved) { - me.updateScaledElement({position:{x:scale.style.left, y:scale.style.top}, size:{w:scale.style.width, h:scale.style.height}}); - } - delete me.start; - delete me.moved; - delete me.dir; - } - }); - return scale; - }, - startScale:function (objElement) { - var me = this, Idom = me.dom; - - Idom.style.cssText = 'visibility:visible;top:' + objElement.style.top + ';left:' + objElement.style.left + ';width:' + objElement.offsetWidth + 'px;height:' + objElement.offsetHeight + 'px;'; - me.scalingElement = objElement; - }, - updateScaledElement:function (objStyle) { - var cur = this.scalingElement, - pos = objStyle.position, - size = objStyle.size; - if (pos) { - typeof pos.x != 'undefined' && (cur.style.left = pos.x); - typeof pos.y != 'undefined' && (cur.style.top = pos.y); - } - if (size) { - size.w && (cur.style.width = size.w); - size.h && (cur.style.height = size.h); - } - }, - updateStyleByDir:function (dir, offset) { - var me = this, - dom = me.dom, tmp; - - rect['def'] = [1, 1, 0, 0]; - if (rect[dir][0] != 0) { - tmp = parseInt(dom.style.left) + offset.x; - dom.style.left = me._validScaledProp('left', tmp) + 'px'; - } - if (rect[dir][1] != 0) { - tmp = parseInt(dom.style.top) + offset.y; - dom.style.top = me._validScaledProp('top', tmp) + 'px'; - } - if (rect[dir][2] != 0) { - tmp = dom.clientWidth + rect[dir][2] * offset.x; - dom.style.width = me._validScaledProp('width', tmp) + 'px'; - } - if (rect[dir][3] != 0) { - tmp = dom.clientHeight + rect[dir][3] * offset.y; - dom.style.height = me._validScaledProp('height', tmp) + 'px'; - } - if (dir === 'def') { - me.updateScaledElement({position:{x:dom.style.left, y:dom.style.top}}); - } - }, - scaleMousemove:function (e) { - var me = arguments.callee.fp, - start = me.start, - dir = me.dir || 'def', - offset = {x:e.clientX - start.x, y:e.clientY - start.y}; - - me.updateStyleByDir(dir, offset); - arguments.callee.fp.start = {x:e.clientX, y:e.clientY}; - arguments.callee.fp.moved = 1; - }, - _validScaledProp:function (prop, value) { - var ele = this.dom, - wrap = $G("J_picBoard"); - - value = isNaN(value) ? 0 : value; - switch (prop) { - case 'left': - return value < 0 ? 0 : (value + ele.clientWidth) > wrap.clientWidth ? wrap.clientWidth - ele.clientWidth : value; - case 'top': - return value < 0 ? 0 : (value + ele.clientHeight) > wrap.clientHeight ? wrap.clientHeight - ele.clientHeight : value; - case 'width': - return value <= 0 ? 1 : (value + ele.offsetLeft) > wrap.clientWidth ? wrap.clientWidth - ele.offsetLeft : value; - case 'height': - return value <= 0 ? 1 : (value + ele.offsetTop) > wrap.clientHeight ? wrap.clientHeight - ele.offsetTop : value; - } - } - }; -})(); - -//后台回调 -function ue_callback(url, state) { - var doc = document, - picBorard = $G("J_picBoard"), - img = doc.createElement("img"); - - //图片缩放 - function scale(img, max, oWidth, oHeight) { - var width = 0, height = 0, percent, ow = img.width || oWidth, oh = img.height || oHeight; - if (ow > max || oh > max) { - if (ow >= oh) { - if (width = ow - max) { - percent = (width / ow).toFixed(2); - img.height = oh - oh * percent; - img.width = max; - } - } else { - if (height = oh - max) { - percent = (height / oh).toFixed(2); - img.width = ow - ow * percent; - img.height = max; - } - } - } - } - - //移除遮罩层 - removeMaskLayer(); - //状态响应 - if (state == "SUCCESS") { - picBorard.innerHTML = ""; - img.onload = function () { - scale(this, 300); - picBorard.appendChild(img); - - var obj = new scrawl(); - // obj.btn2Highlight("J_removeImg"); - //trace 2457 - // obj.btn2Highlight("J_sacleBoard"); - }; - img.src = url; - } else { - alert(state); - } -} -//去掉遮罩层 -function removeMaskLayer() { - var maskLayer = $G("J_maskLayer"); - maskLayer.className = "maskLayerNull"; - maskLayer.innerHTML = ""; - dialog.buttons[0].setDisabled(false); -} -//添加遮罩层 -function addMaskLayer(html) { - var maskLayer = $G("J_maskLayer"); - dialog.buttons[0].setDisabled(true); - maskLayer.className = "maskLayer"; - maskLayer.innerHTML = html; -} -//执行确认按钮方法 -function exec(scrawlObj) { - if (scrawlObj.isScrawl) { - addMaskLayer(lang.scrawlUpLoading); - var base64 = scrawlObj.getCanvasData(); - var file = scrawlObj.dataURLtoFile(base64, 'scrawl-image.png'); - /* 上传涂鸦图片 */ - editor.getOpt("scrawlUploadService")(scrawlObj, editor).uploadScraw(file, base64, function(data) { - if (!scrawlObj.isCancelScrawl) { - if (data.responseSuccess) { - var imgObj = {}, - srcField = data.scrawlSrcField || 'url', - src = '', - srcFieldKeys = srcField.split('.'), - prefix = editor.options.scrawlUrlPrefix; - - if(srcFieldKeys.length > 1) { - function setSrc(obj, keys, index) { - obj = obj[keys[index]]; - if (index < keys.length - 1) { - setSrc(obj, keys, index += 1) - } else { - src = obj; - } - } - setSrc(data, srcFieldKeys, 0); - } else { - src = data[srcField]; - } - - imgObj.src = prefix + src; - imgObj._src = prefix + src; - imgObj.alt = data.original || ''; - editor.execCommand("insertImage", imgObj); - dialog.close(); - } else { - addMaskLayer(data.message + "   "); - } - } - }, function(err) { - addMaskLayer(lang.imageError + "   "); - }); - } else { - addMaskLayer(lang.noScarwl + "   "); - } -} - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/searchreplace/searchreplace.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/searchreplace/searchreplace.html deleted file mode 100644 index 8234fe26a23075fcc094b35692ea2fbdebe399b8..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/searchreplace/searchreplace.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - -
                      - -
                      -
                      - - - - - - - - - - - - - - - - - - - - - - -
                      :
                      - -
                      - - -
                      -   -
                      - -
                      -
                      -
                      - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      :
                      :
                      - -
                      - - - - -
                      -   -
                      - -
                      -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/searchreplace/searchreplace.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/searchreplace/searchreplace.js deleted file mode 100644 index 02fa46c8cad3b543165534562498065a73cdd341..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/searchreplace/searchreplace.js +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-9-26 - * Time: 下午12:29 - * To change this template use File | Settings | File Templates. - */ - -//清空上次查选的痕迹 -editor.firstForSR = 0; -editor.currentRangeForSR = null; -//给tab注册切换事件 -/** - * tab点击处理事件 - * @param tabHeads - * @param tabBodys - * @param obj - */ -function clickHandler( tabHeads,tabBodys,obj ) { - //head样式更改 - for ( var k = 0, len = tabHeads.length; k < len; k++ ) { - tabHeads[k].className = ""; - } - obj.className = "focus"; - //body显隐 - var tabSrc = obj.getAttribute( "tabSrc" ); - for ( var j = 0, length = tabBodys.length; j < length; j++ ) { - var body = tabBodys[j], - id = body.getAttribute( "id" ); - if ( id != tabSrc ) { - body.style.zIndex = 1; - } else { - body.style.zIndex = 200; - } - } - -} - -/** - * TAB切换 - * @param tabParentId tab的父节点ID或者对象本身 - */ -function switchTab( tabParentId ) { - var tabElements = $G( tabParentId ).children, - tabHeads = tabElements[0].children, - tabBodys = tabElements[1].children; - - for ( var i = 0, length = tabHeads.length; i < length; i++ ) { - var head = tabHeads[i]; - if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); - head.onclick = function () { - clickHandler(tabHeads,tabBodys,this); - } - } -} -$G('searchtab').onmousedown = function(){ - $G('search-msg').innerHTML = ''; - $G('replace-msg').innerHTML = '' -} -//是否区分大小写 -function getMatchCase(id) { - return $G(id).checked ? true : false; -} -//查找 -$G("nextFindBtn").onclick = function (txt, dir, mcase) { - var findtxt = $G("findtxt").value, obj; - if (!findtxt) { - return false; - } - obj = { - searchStr:findtxt, - dir:1, - casesensitive:getMatchCase("matchCase") - }; - if (!frCommond(obj)) { - var bk = editor.selection.getRange().createBookmark(); - $G('search-msg').innerHTML = lang.getEnd; - editor.selection.getRange().moveToBookmark(bk).select(); - - - } -}; -$G("nextReplaceBtn").onclick = function (txt, dir, mcase) { - var findtxt = $G("findtxt1").value, obj; - if (!findtxt) { - return false; - } - obj = { - searchStr:findtxt, - dir:1, - casesensitive:getMatchCase("matchCase1") - }; - frCommond(obj); -}; -$G("preFindBtn").onclick = function (txt, dir, mcase) { - var findtxt = $G("findtxt").value, obj; - if (!findtxt) { - return false; - } - obj = { - searchStr:findtxt, - dir:-1, - casesensitive:getMatchCase("matchCase") - }; - if (!frCommond(obj)) { - $G('search-msg').innerHTML = lang.getStart; - } -}; -$G("preReplaceBtn").onclick = function (txt, dir, mcase) { - var findtxt = $G("findtxt1").value, obj; - if (!findtxt) { - return false; - } - obj = { - searchStr:findtxt, - dir:-1, - casesensitive:getMatchCase("matchCase1") - }; - frCommond(obj); -}; -//替换 -$G("repalceBtn").onclick = function () { - editor.trigger('clearLastSearchResult'); - var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj, - replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, ""); - if (!findtxt) { - return false; - } - if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) { - return false; - } - obj = { - searchStr:findtxt, - dir:1, - casesensitive:getMatchCase("matchCase1"), - replaceStr:replacetxt - }; - frCommond(obj); -}; -//全部替换 -$G("repalceAllBtn").onclick = function () { - var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj, - replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, ""); - if (!findtxt) { - return false; - } - if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) { - return false; - } - obj = { - searchStr:findtxt, - casesensitive:getMatchCase("matchCase1"), - replaceStr:replacetxt, - all:true - }; - var num = frCommond(obj); - if (num) { - $G('replace-msg').innerHTML = lang.countMsg.replace("{#count}", num); - } -}; -//执行 -var frCommond = function (obj) { - return editor.execCommand("searchreplace", obj); -}; -switchTab("searchtab"); - - -dialog.onclose = function(){ - editor.trigger('clearLastSearchResult') -}; \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/snapscreen/snapscreen.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/snapscreen/snapscreen.html deleted file mode 100644 index a05d10136ec71bb63aa380384a8bcfe444925c1e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/snapscreen/snapscreen.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - -
                      -

                      -
                      -
                      -
                      -
                      -
                      -
                      - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/spechars/spechars.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/spechars/spechars.html deleted file mode 100644 index 0b5c416f86d37836d11259bdec1dd8f895110cd0..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/spechars/spechars.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/spechars/spechars.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/spechars/spechars.js deleted file mode 100644 index f4c155e1598abfb8a6e475c6202f76e3fb5861ea..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/spechars/spechars.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-9-26 - * Time: 下午1:09 - * To change this template use File | Settings | File Templates. - */ -var charsContent = [ - { name:"tsfh", title:lang.tsfh, content:toArray("、,。,·,ˉ,ˇ,¨,〃,々,—,~,‖,…,‘,’,“,”,〔,〕,〈,〉,《,》,「,」,『,』,〖,〗,【,】,±,×,÷,∶,∧,∨,∑,∏,∪,∩,∈,∷,√,⊥,∥,∠,⌒,⊙,∫,∮,≡,≌,≈,∽,∝,≠,≮,≯,≤,≥,∞,∵,∴,♂,♀,°,′,″,℃,$,¤,¢,£,‰,§,№,☆,★,○,●,◎,◇,◆,□,■,△,▲,※,→,←,↑,↓,〓,〡,〢,〣,〤,〥,〦,〧,〨,〩,㊣,㎎,㎏,㎜,㎝,㎞,㎡,㏄,㏎,㏑,㏒,㏕,︰,¬,¦,℡,ˊ,ˋ,˙,–,―,‥,‵,℅,℉,↖,↗,↘,↙,∕,∟,∣,≒,≦,≧,⊿,═,║,╒,╓,╔,╕,╖,╗,╘,╙,╚,╛,╜,╝,╞,╟,╠,╡,╢,╣,╤,╥,╦,╧,╨,╩,╪,╫,╬,╭,╮,╯,╰,╱,╲,╳,▁,▂,▃,▄,▅,▆,▇,�,█,▉,▊,▋,▌,▍,▎,▏,▓,▔,▕,▼,▽,◢,◣,◤,◥,☉,⊕,〒,〝,〞")}, - { name:"lmsz", title:lang.lmsz, content:toArray("ⅰ,ⅱ,ⅲ,ⅳ,ⅴ,ⅵ,ⅶ,ⅷ,ⅸ,ⅹ,Ⅰ,Ⅱ,Ⅲ,Ⅳ,Ⅴ,Ⅵ,Ⅶ,Ⅷ,Ⅸ,Ⅹ,Ⅺ,Ⅻ")}, - { name:"szfh", title:lang.szfh, content:toArray("⒈,⒉,⒊,⒋,⒌,⒍,⒎,⒏,⒐,⒑,⒒,⒓,⒔,⒕,⒖,⒗,⒘,⒙,⒚,⒛,⑴,⑵,⑶,⑷,⑸,⑹,⑺,⑻,⑼,⑽,⑾,⑿,⒀,⒁,⒂,⒃,⒄,⒅,⒆,⒇,①,②,③,④,⑤,⑥,⑦,⑧,⑨,⑩,㈠,㈡,㈢,㈣,㈤,㈥,㈦,㈧,㈨,㈩")}, - { name:"rwfh", title:lang.rwfh, content:toArray("ぁ,あ,ぃ,い,ぅ,う,ぇ,え,ぉ,お,か,が,き,ぎ,く,ぐ,け,げ,こ,ご,さ,ざ,し,じ,す,ず,せ,ぜ,そ,ぞ,た,だ,ち,ぢ,っ,つ,づ,て,で,と,ど,な,に,ぬ,ね,の,は,ば,ぱ,ひ,び,ぴ,ふ,ぶ,ぷ,へ,べ,ぺ,ほ,ぼ,ぽ,ま,み,む,め,も,ゃ,や,ゅ,ゆ,ょ,よ,ら,り,る,れ,ろ,ゎ,わ,ゐ,ゑ,を,ん,ァ,ア,ィ,イ,ゥ,ウ,ェ,エ,ォ,オ,カ,ガ,キ,ギ,ク,グ,ケ,ゲ,コ,ゴ,サ,ザ,シ,ジ,ス,ズ,セ,ゼ,ソ,ゾ,タ,ダ,チ,ヂ,ッ,ツ,ヅ,テ,デ,ト,ド,ナ,ニ,ヌ,ネ,ノ,ハ,バ,パ,ヒ,ビ,ピ,フ,ブ,プ,ヘ,ベ,ペ,ホ,ボ,ポ,マ,ミ,ム,メ,モ,ャ,ヤ,ュ,ユ,ョ,ヨ,ラ,リ,ル,レ,ロ,ヮ,ワ,ヰ,ヱ,ヲ,ン,ヴ,ヵ,ヶ")}, - { name:"xlzm", title:lang.xlzm, content:toArray("Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,τ,υ,φ,χ,ψ,ω")}, - { name:"ewzm", title:lang.ewzm, content:toArray("А,Б,В,Г,Д,Е,Ё,Ж,З,И,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ъ,Ы,Ь,Э,Ю,Я,а,б,в,г,д,е,ё,ж,з,и,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ъ,ы,ь,э,ю,я")}, - { name:"pyzm", title:lang.pyzm, content:toArray("ā,á,ǎ,à,ē,é,ě,è,ī,í,ǐ,ì,ō,ó,ǒ,ò,ū,ú,ǔ,ù,ǖ,ǘ,ǚ,ǜ,ü")}, - { name:"yyyb", title:lang.yyyb, content:toArray("i:,i,e,æ,ʌ,ə:,ə,u:,u,ɔ:,ɔ,a:,ei,ai,ɔi,əu,au,iə,εə,uə,p,t,k,b,d,g,f,s,ʃ,θ,h,v,z,ʒ,ð,tʃ,tr,ts,dʒ,dr,dz,m,n,ŋ,l,r,w,j,")}, - { name:"zyzf", title:lang.zyzf, content:toArray("ㄅ,ㄆ,ㄇ,ㄈ,ㄉ,ㄊ,ㄋ,ㄌ,ㄍ,ㄎ,ㄏ,ㄐ,ㄑ,ㄒ,ㄓ,ㄔ,ㄕ,ㄖ,ㄗ,ㄘ,ㄙ,ㄚ,ㄛ,ㄜ,ㄝ,ㄞ,ㄟ,ㄠ,ㄡ,ㄢ,ㄣ,ㄤ,ㄥ,ㄦ,ㄧ,ㄨ")} -]; -(function createTab(content) { - for (var i = 0, ci; ci = content[i++];) { - var span = document.createElement("span"); - span.setAttribute("tabSrc", ci.name); - span.innerHTML = ci.title; - if (i == 1)span.className = "focus"; - domUtils.on(span, "click", function () { - var tmps = $G("tabHeads").children; - for (var k = 0, sk; sk = tmps[k++];) { - sk.className = ""; - } - tmps = $G("tabBodys").children; - for (var k = 0, sk; sk = tmps[k++];) { - sk.style.display = "none"; - } - this.className = "focus"; - $G(this.getAttribute("tabSrc")).style.display = ""; - }); - $G("tabHeads").appendChild(span); - domUtils.insertAfter(span, document.createTextNode("\n")); - var div = document.createElement("div"); - div.id = ci.name; - div.style.display = (i == 1) ? "" : "none"; - var cons = ci.content; - for (var j = 0, con; con = cons[j++];) { - var charSpan = document.createElement("span"); - charSpan.innerHTML = con; - domUtils.on(charSpan, "click", function () { - editor.execCommand("insertHTML", this.innerHTML); - dialog.close(); - }); - div.appendChild(charSpan); - } - $G("tabBodys").appendChild(div); - } -})(charsContent); -function toArray(str) { - return str.split(","); -} diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/dragicon.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/dragicon.png deleted file mode 100644 index f26203bf3f0026891fc8374f109724a69eb38b22..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/dragicon.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittable.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittable.css deleted file mode 100644 index c6f9396c9b04297b63775ef2b9abb68db330b43b..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittable.css +++ /dev/null @@ -1,84 +0,0 @@ -body{ - overflow: hidden; - width: 540px; -} -.wrapper { - margin: 10px auto 0; - font-size: 12px; - overflow: hidden; - width: 520px; - height: 315px; -} - -.clear { - clear: both; -} - -.wrapper .left { - float: left; - margin-left: 10px;; -} - -.wrapper .right { - float: right; - border-left: 2px dotted #EDEDED; - padding-left: 15px; -} - -.section { - margin-bottom: 15px; - width: 240px; - overflow: hidden; -} - -.section h3 { - font-weight: bold; - padding: 5px 0; - margin-bottom: 10px; - border-bottom: 1px solid #EDEDED; - font-size: 12px; -} - -.section ul { - list-style: none; - overflow: hidden; - clear: both; - -} - -.section li { - float: left; - width: 120px;; -} - -.section .tone { - width: 80px;; -} - -.section .preview { - width: 220px; -} - -.section .preview table { - text-align: center; - vertical-align: middle; - color: #666; -} - -.section .preview caption { - font-weight: bold; -} - -.section .preview td { - border-width: 1px; - border-style: solid; - height: 22px; -} - -.section .preview th { - border-style: solid; - border-color: #DDD; - border-width: 2px 1px 1px 1px; - height: 22px; - background-color: #F7F7F7; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittable.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittable.html deleted file mode 100644 index 3c412fb8273d3468f174e8960ea350665093fa44..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittable.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - -
                      -
                      -
                      -

                      -
                        -
                      • - -
                      • -
                      • - -
                      • -
                      -
                        -
                      • - -
                      • -
                      • - -
                      • -
                      -
                      -
                      -
                      -

                      -
                        -
                      • - -
                      • -
                      • - -
                      • -
                      -
                      -
                      -
                      -

                      -
                        -
                      • - - -
                      • -
                      -
                      -
                      -
                      -
                      -
                      -

                      -
                      -
                      -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittable.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittable.js deleted file mode 100644 index 11dbee7c50a1968d99dbeb4babf04974c83dacd7..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittable.js +++ /dev/null @@ -1,237 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-12-19 - * Time: 下午4:55 - * To change this template use File | Settings | File Templates. - */ -(function () { - var title = $G("J_title"), - titleCol = $G("J_titleCol"), - caption = $G("J_caption"), - sorttable = $G("J_sorttable"), - autoSizeContent = $G("J_autoSizeContent"), - autoSizePage = $G("J_autoSizePage"), - tone = $G("J_tone"), - me, - preview = $G("J_preview"); - - var editTable = function () { - me = this; - me.init(); - }; - editTable.prototype = { - init:function () { - var colorPiker = new UE.ui.ColorPicker({ - editor:editor - }), - colorPop = new UE.ui.Popup({ - editor:editor, - content:colorPiker - }); - - title.checked = editor.queryCommandState("inserttitle") == -1; - titleCol.checked = editor.queryCommandState("inserttitlecol") == -1; - caption.checked = editor.queryCommandState("insertcaption") == -1; - sorttable.checked = editor.queryCommandState("enablesort") == 1; - - var enablesortState = editor.queryCommandState("enablesort"), - disablesortState = editor.queryCommandState("disablesort"); - - sorttable.checked = !!(enablesortState < 0 && disablesortState >=0); - sorttable.disabled = !!(enablesortState < 0 && disablesortState < 0); - sorttable.title = enablesortState < 0 && disablesortState < 0 ? lang.errorMsg:''; - - me.createTable(title.checked, titleCol.checked, caption.checked); - me.setAutoSize(); - me.setColor(me.getColor()); - - domUtils.on(title, "click", me.titleHanler); - domUtils.on(titleCol, "click", me.titleColHanler); - domUtils.on(caption, "click", me.captionHanler); - domUtils.on(sorttable, "click", me.sorttableHanler); - domUtils.on(autoSizeContent, "click", me.autoSizeContentHanler); - domUtils.on(autoSizePage, "click", me.autoSizePageHanler); - - domUtils.on(tone, "click", function () { - colorPop.showAnchor(tone); - }); - domUtils.on(document, 'mousedown', function () { - colorPop.hide(); - }); - colorPiker.addListener("pickcolor", function () { - me.setColor(arguments[1]); - colorPop.hide(); - }); - colorPiker.addListener("picknocolor", function () { - me.setColor(""); - colorPop.hide(); - }); - }, - - createTable:function (hasTitle, hasTitleCol, hasCaption) { - var arr = [], - sortSpan = '^'; - arr.push(""); - if (hasCaption) { - arr.push("") - } - if (hasTitle) { - arr.push(""); - if(hasTitleCol) { arr.push(""); } - for (var j = 0; j < 5; j++) { - arr.push(""); - } - arr.push(""); - } - for (var i = 0; i < 6; i++) { - arr.push(""); - if(hasTitleCol) { arr.push("") } - for (var k = 0; k < 5; k++) { - arr.push("") - } - arr.push(""); - } - arr.push("
                      " + lang.captionName + "
                      " + lang.titleName + "" + lang.titleName + "
                      " + lang.titleName + "" + lang.cellsName + "
                      "); - preview.innerHTML = arr.join(""); - this.updateSortSpan(); - }, - titleHanler:function () { - var example = $G("J_example"), - frg=document.createDocumentFragment(), - color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"), - colCount = example.rows[0].children.length; - - if (title.checked) { - example.insertRow(0); - for (var i = 0, node; i < colCount; i++) { - node = document.createElement("th"); - node.innerHTML = lang.titleName; - frg.appendChild(node); - } - example.rows[0].appendChild(frg); - - } else { - domUtils.remove(example.rows[0]); - } - me.setColor(color); - me.updateSortSpan(); - }, - titleColHanler:function () { - var example = $G("J_example"), - color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"), - colArr = example.rows, - colCount = colArr.length; - - if (titleCol.checked) { - for (var i = 0, node; i < colCount; i++) { - node = document.createElement("th"); - node.innerHTML = lang.titleName; - colArr[i].insertBefore(node, colArr[i].children[0]); - } - } else { - for (var i = 0; i < colCount; i++) { - domUtils.remove(colArr[i].children[0]); - } - } - me.setColor(color); - me.updateSortSpan(); - }, - captionHanler:function () { - var example = $G("J_example"); - if (caption.checked) { - var row = document.createElement('caption'); - row.innerHTML = lang.captionName; - example.insertBefore(row, example.firstChild); - } else { - domUtils.remove(domUtils.getElementsByTagName(example, 'caption')[0]); - } - }, - sorttableHanler:function(){ - me.updateSortSpan(); - }, - autoSizeContentHanler:function () { - var example = $G("J_example"); - example.removeAttribute("width"); - }, - autoSizePageHanler:function () { - var example = $G("J_example"); - var tds = example.getElementsByTagName(example, "td"); - utils.each(tds, function (td) { - td.removeAttribute("width"); - }); - example.setAttribute('width', '100%'); - }, - updateSortSpan: function(){ - var example = $G("J_example"), - row = example.rows[0]; - - var spans = domUtils.getElementsByTagName(example,"span"); - utils.each(spans,function(span){ - span.parentNode.removeChild(span); - }); - if (sorttable.checked) { - utils.each(row.cells, function(cell, i){ - var span = document.createElement("span"); - span.innerHTML = "^"; - cell.appendChild(span); - }); - } - }, - getColor:function () { - var start = editor.selection.getStart(), color, - cell = domUtils.findParentByTagName(start, ["td", "th", "caption"], true); - color = cell && domUtils.getComputedStyle(cell, "border-color"); - if (!color) color = "#DDDDDD"; - return color; - }, - setColor:function (color) { - var example = $G("J_example"), - arr = domUtils.getElementsByTagName(example, "td").concat( - domUtils.getElementsByTagName(example, "th"), - domUtils.getElementsByTagName(example, "caption") - ); - - tone.value = color; - utils.each(arr, function (node) { - node.style.borderColor = color; - }); - - }, - setAutoSize:function () { - var me = this; - autoSizePage.checked = true; - me.autoSizePageHanler(); - } - }; - - new editTable; - - dialog.onok = function () { - editor.__hasEnterExecCommand = true; - - var checks = { - title:"inserttitle deletetitle", - titleCol:"inserttitlecol deletetitlecol", - caption:"insertcaption deletecaption", - sorttable:"enablesort disablesort" - }; - editor.fireEvent('saveScene'); - for(var i in checks){ - var cmds = checks[i].split(" "), - input = $G("J_" + i); - if(input["checked"]){ - editor.queryCommandState(cmds[0])!=-1 &&editor.execCommand(cmds[0]); - }else{ - editor.queryCommandState(cmds[1])!=-1 &&editor.execCommand(cmds[1]); - } - } - - editor.execCommand("edittable", tone.value); - autoSizeContent.checked ?editor.execCommand('adaptbytext') : ""; - autoSizePage.checked ? editor.execCommand("adaptbywindow") : ""; - editor.fireEvent('saveScene'); - - editor.__hasEnterExecCommand = false; - }; -})(); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittd.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittd.html deleted file mode 100644 index 49a52f71952e3f396120951a9504e287a14ad2b0..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittd.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - -
                      - - -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittip.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittip.html deleted file mode 100644 index 954f7bb66f01b0d58dda32a37cc59241e0671cc3..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/table/edittip.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - 表格删除提示 - - - - -
                      -
                      - -
                      -
                      - -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/config.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/config.js deleted file mode 100644 index 20d0d4cdeac3f21540c4ab5fefb5e8a711190957..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/config.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-8-8 - * Time: 下午2:00 - * To change this template use File | Settings | File Templates. - */ -var templates = [ - { - "pre":"pre0.png", - 'title':lang.blank, - 'preHtml':'

                       欢迎使用UEditor!

                      ', - "html":'

                      欢迎使用UEditor!

                      ' - - }, - { - "pre":"pre1.png", - 'title':lang.blog, - 'preHtml':'

                      深入理解Range

                      UEditor二次开发

                      什么是Range

                      对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。


                      Range能干什么

                      在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。

                      ', - "html":'

                      [键入文档标题]

                      [键入文档副标题]

                      [标题 1]

                      对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。

                      [标题 2]

                      在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。 您还可以使用“开始”选项卡上的其他控件来直接设置文本格式。大多数控件都允许您选择是使用当前主题外观,还是使用某种直接指定的格式。

                      [标题 3]

                      对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。


                      ' - - }, - { - "pre":"pre2.png", - 'title':lang.resume, - 'preHtml':'

                      WEB前端开发简历


                      联系电话:[键入您的电话]

                      电子邮件:[键入您的电子邮件地址]

                      家庭住址:[键入您的地址]

                      目标职位

                      WEB前端研发工程师

                      学历

                      1. [起止时间] [学校名称] [所学专业] [所获学位]

                      工作经验


                      ', - "html":'

                      [此处键入简历标题]


                      【此处插入照片】


                      联系电话:[键入您的电话]


                      电子邮件:[键入您的电子邮件地址]


                      家庭住址:[键入您的地址]


                      目标职位

                      [此处键入您的期望职位]

                      学历

                      1. [键入起止时间] [键入学校名称] [键入所学专业] [键入所获学位]

                      2. [键入起止时间] [键入学校名称] [键入所学专业] [键入所获学位]

                      工作经验

                      1. [键入起止时间] [键入公司名称] [键入职位名称]

                        1. [键入负责项目] [键入项目简介]

                        2. [键入负责项目] [键入项目简介]

                      2. [键入起止时间] [键入公司名称] [键入职位名称]

                        1. [键入负责项目] [键入项目简介]

                      掌握技能

                       [这里可以键入您所掌握的技能]

                      ' - - }, - { - "pre":"pre3.png", - 'title':lang.richText, - 'preHtml':'

                      [此处键入文章标题]

                      图文混排方法

                      图片居左,文字围绕图片排版

                      方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文


                      还有没有什么其他的环绕方式呢?这里是居右环绕


                      欢迎大家多多尝试,为UEditor提供更多高质量模板!

                      ', - "html":'


                      [此处键入文章标题]

                      图文混排方法

                      1. 图片居左,文字围绕图片排版

                      方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文本


                      2. 图片居右,文字围绕图片排版

                      方法:在文字前面插入图片,设置居右对齐,然后即可在左边输入多行文本


                      3. 图片居中环绕排版

                      方法:亲,这个真心没有办法。。。



                      还有没有什么其他的环绕方式呢?这里是居右环绕


                      欢迎大家多多尝试,为UEditor提供更多高质量模板!


                      占位


                      占位


                      占位


                      占位


                      占位



                      ' - }, - { - "pre":"pre4.png", - 'title':lang.sciPapers, - 'preHtml':'

                      [键入文章标题]

                      摘要:这里可以输入很长很长很长很长很长很长很长很长很差的摘要

                      标题 1

                      这里可以输入很多内容,可以图文混排,可以有列表等。

                      标题 2

                      1. 列表 1

                      2. 列表 2

                        1. 多级列表 1

                        2. 多级列表 2

                      3. 列表 3

                      标题 3

                      来个文字图文混排的


                      ', - 'html':'

                      [键入文章标题]

                      摘要:这里可以输入很长很长很长很长很长很长很长很长很差的摘要

                      标题 1

                      这里可以输入很多内容,可以图文混排,可以有列表等。

                      标题 2

                      来个列表瞅瞅:

                      1. 列表 1

                      2. 列表 2

                        1. 多级列表 1

                        2. 多级列表 2

                      3. 列表 3

                      标题 3

                      来个文字图文混排的

                      这里可以多行

                      右边是图片

                      绝对没有问题的,不信你也可以试试看


                      ' - } -]; \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/bg.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/bg.gif deleted file mode 100644 index 8c1d10ad1933e02086e8a1b3c807c7d1e57d51db..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/bg.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre0.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre0.png deleted file mode 100644 index 8f3c16ab121c6c9b6add955fd3de78247ccfd9a6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre0.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre1.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre1.png deleted file mode 100644 index 5a03f9699886deef9aa0f52a7d252dea84baafef..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre1.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre2.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre2.png deleted file mode 100644 index 5a55672c1f9c4d41d5b5cf52d76bb2b7e7c6b186..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre2.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre3.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre3.png deleted file mode 100644 index d852d29f13bcf743e15df824901ab568123a5aae..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre3.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre4.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre4.png deleted file mode 100644 index 0d7bc72ab99fe2c0ed9de1d89fd1c3e82ac3fd43..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/images/pre4.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/template.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/template.css deleted file mode 100644 index f2bae3c26f7cf4b7c351808efc66491e3c710cfc..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/template.css +++ /dev/null @@ -1,18 +0,0 @@ -.wrap{ padding: 20px;font-size: 14px;} -.left{width:425px;float: left;} -.right{width:160px;border: 1px solid #ccc;float: right;padding: 5px;margin-right: 5px;} -.right .pre{height: 332px;overflow-y: auto;} -.right .preitem{border: white 1px solid;margin: 5px 0;padding: 2px 0;} -.right .preitem:hover{background-color: #f3f3f3;cursor: pointer;border: #ccc 1px solid;} -.right .preitem img{display: block;margin: 0 auto;width:100px;} -.clear{clear: both;} -.top{height:26px;line-height: 26px;padding: 5px;} -.bottom{height:320px;width:100%;margin: 0 auto;} -.transparent{ background: url("images/bg.gif") repeat;} -.bottom table tr td{border:1px dashed #ccc;} -#colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;} -.border_style1{padding:2px;border: 1px solid #ccc;border-radius: 5px;box-shadow:2px 2px 5px #d3d6da;} -p{margin: 5px 0} -table{clear:both;margin-bottom:10px;border-collapse:collapse;word-break:break-all;} -li{clear:both} -ol{padding-left:40px; } \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/template.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/template.html deleted file mode 100644 index d9903a480df48735fe455cf2de668a280b30d52e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/template.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
                      -
                      -
                      - -
                      -
                      -
                      -
                      - -
                      -
                      -
                      -
                      - - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/template.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/template.js deleted file mode 100644 index d40e4ddf989c3be349d291bfa33c7a1bc83e043d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/template/template.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-8-8 - * Time: 下午2:09 - * To change this template use File | Settings | File Templates. - */ -(function () { - var me = editor, - preview = $G( "preview" ), - preitem = $G( "preitem" ), - tmps = templates, - currentTmp; - var initPre = function () { - var str = ""; - for ( var i = 0, tmp; tmp = tmps[i++]; ) { - str += '
                      '; - } - preitem.innerHTML = str; - }; - var pre = function ( n ) { - var tmp = tmps[n - 1]; - currentTmp = tmp; - clearItem(); - domUtils.setStyles( preitem.childNodes[n - 1], { - "background-color":"#f3f3f3", - "border":"#ccc 1px solid" - } ); - preview.innerHTML = tmp.preHtml ? tmp.preHtml : ""; - }; - var clearItem = function () { - var items = preitem.children; - for ( var i = 0, item; item = items[i++]; ) { - domUtils.setStyles( item, { - "background-color":"", - "border":"white 1px solid" - } ); - } - }; - dialog.onok = function () { - if ( !$G( "issave" ).checked ){ - me.execCommand( "cleardoc" ); - } - var obj = { - html:currentTmp && currentTmp.html - }; - me.execCommand( "template", obj ); - }; - initPre(); - window.pre = pre; - pre(2) - -})(); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/bg.png deleted file mode 100644 index 580be0a01dff4c70c72f78a3f40186660ee8eee0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/center_focus.jpg b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/center_focus.jpg deleted file mode 100644 index 858fdd72b5c9ef4169556a483627a0ec0ab63b32..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/center_focus.jpg and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/file-icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/file-icons.gif deleted file mode 100644 index d8c02c27e242f0584fc6b214f35b4f6d8caec332..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/file-icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/file-icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/file-icons.png deleted file mode 100644 index 3ff82c8c488f53a7aff67fbe39742e3321183eca..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/file-icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/icons.gif deleted file mode 100644 index 78459dea7b12ccbeec81d19ecdab22b1658e93b4..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/icons.png deleted file mode 100644 index 12e4700163ac87fa38ae3d92a2c39d0fb4690fed..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/image.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/image.png deleted file mode 100644 index 19699f6a9c6b09cb18ec0f488242d9753d2e341b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/image.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/left_focus.jpg b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/left_focus.jpg deleted file mode 100644 index e0b2834cc82184835d01a68de6caf30408b8b5fa..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/left_focus.jpg and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/none_focus.jpg b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/none_focus.jpg deleted file mode 100644 index 0e729fc59272fc2a5a5fcc8d3f09516e1bf8c14b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/none_focus.jpg and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/progress.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/progress.png deleted file mode 100644 index 717c4865c90a959c6a0e9ad1af9c777d900a2e9c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/progress.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/right_focus.jpg b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/right_focus.jpg deleted file mode 100644 index 0ce626c4babe9288c8ab5c84e4bf66fad7ee8ce2..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/right_focus.jpg and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/success.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/success.gif deleted file mode 100644 index 8d4f3112b9d1df2147ed3b67d9736163dedd11e1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/success.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/success.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/success.png deleted file mode 100644 index 94f968dc8fd3c7ca8f6cb599d006ef3f23b62c7d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/images/success.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/video.css b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/video.css deleted file mode 100644 index 550d3a15e595c5be2c27d13808d709446d2a843b..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/video.css +++ /dev/null @@ -1,644 +0,0 @@ -@charset "utf-8"; -.wrapper{ - width: 600px; - padding: 0 20px; - _width: 575px; - margin: 10px auto; - zoom: 1; - position: relative; -} -.tabbody{height: 390px;} -.tabbody .panel { - position: absolute; - width: 0; - height: 0; - background: #fff; - overflow: hidden; - display: none; -} -.tabbody .panel.focus { - width: 100%; - height: 406px; - display: block; -} - -.tabbody .panel table td{vertical-align: middle;} -#videoUrl { - width: 520px; - height: 28px; - line-height: 28px; - margin: 18px 0 18px 15px; - background: #FFF; - border: 1px solid #d7d7d7; - border-radius: 4px; -} -#videoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;} -#searchList{width: 570px;overflow: auto;zoom:1;height: 270px;} -#searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;} -#searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/ -#searchList p{margin-left: 10px;} -#videoType{ - width: 65px; - height: 23px; - line-height: 22px; - border: 1px solid #d7d7d7; -} -#videoSearchBtn,#videoSearchReset{ - /*width: 80px;*/ - height: 25px; - line-height: 25px; - background: #eee; - border: 1px solid #d7d7d7; - cursor: pointer; - padding: 0 5px; -} - - - -#preview{position: relative;width: 432px;padding:0;overflow: hidden; margin-left: 10px; height: 320px;background-color: #f3f3f3;float: left} -#preview .previewMsg {position:absolute;top:0;margin:0;padding:0;height:304px;width:100%;background-color: #ddd;padding-top: 14px} -#preview .previewMsg span{display:block;margin: 125px auto 0 auto;text-align:center;font-size:18px;color:#fff;} -#preview .previewVideo {position:absolute;top:0;margin:0;padding:0;height:320px;width:100%;} -.edui-video-wrapper fieldset{ - border: 1px solid #ddd; - padding-left: 5px; - margin-bottom: 20px; - padding-bottom: 5px; - width: 115px; -} - -#videoInfo {width: 120px;float: left;margin-left: 27px;} -fieldset{ - border: 1px solid #ddd; - padding-left: 5px; - margin-bottom: 20px; - padding-bottom: 5px; - width: 115px; -} -fieldset legend{font-weight: bold;} -fieldset p{line-height: 30px;} -fieldset input.txt{ - width: 65px; - height: 21px; - line-height: 21px; - margin: 8px 5px; - background: #FFF; - border: 1px solid #d7d7d7; -} -label.url{font-weight: bold;margin-left: 5px;color: #666;} -#videoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} -#videoFloat .focus{opacity: 1;filter: alpha(opacity = 100)} -span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue} - - - - -/* upload video */ -.tabbody #upload.panel { - width: 0; - height: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); - background: #fff; - display: block; -} -.tabbody #upload.panel.focus { - width: 100%; - height: 390px; - display: block; - clip: auto; -} -#upload_alignment div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} -#upload_alignment .focus{opacity: 1;filter: alpha(opacity = 100)} -#upload_left { width:427px; float:left; } -#upload_left .controller { height: 30px; clear: both; } -#uploadVideoInfo{margin-top:10px;float:right;padding-right:8px;} - -#upload .queueList { - margin: 0; -} - -#upload p { - margin: 0; -} - -.element-invisible { - width: 0 !important; - height: 0 !important; - border: 0; - padding: 0; - margin: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); -} - -#upload .placeholder { - margin-top: 20px; - margin-right: 0; - height: 220px; - padding-top: 150px; - text-align: center; - width: 100%; - float: left; - /*background: url(./images/image.png) center 70px no-repeat #f3f3f3;*/ - background-color: #f3f3f3; - color: #cccccc; - font-size: 18px; - position: relative; - top:0; - *margin-left: 0; - *left: 10px; -} - -#upload .placeholder .webuploader-pick { - font-size: 16px; - background: #f3f3f3; - border-radius: 3px; - line-height: 44px; - padding: 0 30px; - color: #646464; - display: inline-block; - margin: 0 auto 20px auto; - cursor: pointer; - /* box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); */ - border: 1px solid #ccc; -} - -#upload .placeholder .webuploader-pick-hover { - border: 1px solid #00a2d4; - color: #00a2d4; -} - - -#filePickerContainer { - text-align: center; -} - -#upload .placeholder .flashTip { - color: #666666; - font-size: 12px; - position: absolute; - width: 100%; - text-align: center; - bottom: 20px; -} - -#upload .placeholder .flashTip a { - color: #0785d1; - text-decoration: none; -} - -#upload .placeholder .flashTip a:hover { - text-decoration: underline; -} - -#upload .placeholder.webuploader-dnd-over { - border-color: #999999; -} - -#upload .filelist { - list-style: none; - margin: 0; - padding: 0; - overflow-x: hidden; - overflow-y: auto; - position: relative; - height: 285px; -} - -#upload .filelist:after { - content: ''; - display: block; - width: 0; - height: 0; - overflow: hidden; - clear: both; -} - -#upload .filelist li { - width: 113px; - height: 113px; - background: url(./images/bg.png); - text-align: center; - margin: 15px 0 0 20px; - *margin: 15px 0 0 15px; - position: relative; - display: block; - float: left; - overflow: hidden; - font-size: 12px; -} - -#upload .filelist li p.log { - position: relative; - top: -45px; -} - -#upload .filelist li p.title { - position: absolute; - top: 0; - left: 0; - width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - top: 5px; - text-indent: 5px; - text-align: left; -} - -#upload .filelist li p.progress { - position: absolute; - width: 100%; - bottom: 0; - left: 0; - height: 8px; - overflow: hidden; - z-index: 50; - margin: 0; - border-radius: 0; - background: none; - -webkit-box-shadow: 0 0 0; -} - -#upload .filelist li p.progress span { - display: none; - overflow: hidden; - width: 0; - height: 100%; - background: #1483d8 url(./images/progress.png) repeat-x; - - -webit-transition: width 200ms linear; - -moz-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; - transition: width 200ms linear; - - -webkit-animation: progressmove 2s linear infinite; - -moz-animation: progressmove 2s linear infinite; - -o-animation: progressmove 2s linear infinite; - -ms-animation: progressmove 2s linear infinite; - animation: progressmove 2s linear infinite; - - -webkit-transform: translateZ(0); -} - -@-webkit-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@-moz-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -#upload .filelist li p.imgWrap { - position: relative; - z-index: 2; - line-height: 113px; - vertical-align: middle; - overflow: hidden; - width: 113px; - height: 113px; - - -webkit-transform-origin: 50% 50%; - -moz-transform-origin: 50% 50%; - -o-transform-origin: 50% 50%; - -ms-transform-origin: 50% 50%; - transform-origin: 50% 50%; - - -webit-transition: 200ms ease-out; - -moz-transition: 200ms ease-out; - -o-transition: 200ms ease-out; - -ms-transition: 200ms ease-out; - transition: 200ms ease-out; -} -#upload .filelist li p.imgWrap.notimage { - margin-top: 0; - width: 111px; - height: 111px; - border: 1px #eeeeee solid; -} -#upload .filelist li p.imgWrap.notimage i.file-preview { - margin-top: 15px; -} - -#upload .filelist li img { - width: 100%; -} - -#upload .filelist li p.error { - background: #f43838; - color: #fff; - position: absolute; - bottom: 0; - left: 0; - height: 28px; - line-height: 28px; - width: 100%; - z-index: 100; - display:none; -} - -#upload .filelist li .success { - display: block; - position: absolute; - left: 0; - bottom: 0; - height: 40px; - width: 100%; - z-index: 200; - background: url(./images/success.png) no-repeat right bottom; - background-image: url(./images/success.gif) \9; -} - -#upload .filelist li.filePickerBlock { - width: 113px; - height: 113px; - background: url(../fonts/images/addfile.svg) no-repeat center; - border: 1px solid #eeeeee; - border-radius: 0; -} -#upload .filelist li.filePickerBlock div.webuploader-pick { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - opacity: 0; - background: none; - font-size: 0; -} - -#upload .filelist div.file-panel { - position: absolute; - height: 0; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0; - background: rgba(0, 0, 0, 0.5); - width: 100%; - top: 0; - left: 0; - overflow: hidden; - z-index: 300; -} - -#upload .filelist div.file-panel span { - width: 24px; - height: 24px; - display: inline; - float: right; - text-indent: -9999px; - overflow: hidden; - background: url(./images/icons.png) no-repeat; - background: url(./images/icons.gif) no-repeat \9; - margin: 5px 1px 1px; - cursor: pointer; - -webkit-tap-highlight-color: rgba(0,0,0,0); - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -#upload .filelist div.file-panel span.rotateLeft { - display:none; - background-position: 0 -24px; -} - -#upload .filelist div.file-panel span.rotateLeft:hover { - background-position: 0 0; -} - -#upload .filelist div.file-panel span.rotateRight { - display:none; - background-position: -24px -24px; -} - -#upload .filelist div.file-panel span.rotateRight:hover { - background-position: -24px 0; -} - -#upload .filelist div.file-panel span.cancel { - background-position: -48px -24px; -} - -#upload .filelist div.file-panel span.cancel:hover { - background-position: -48px 0; -} - -#upload .statusBar { - height: 45px; - border-bottom: 1px solid #dadada; - margin: 0 10px; - padding: 0; - line-height: 45px; - vertical-align: middle; - position: relative; -} - -#upload .statusBar .progress { - border: 1px solid #1483d8; - width: 198px; - background: #fff; - height: 18px; - position: absolute; - top: 12px; - display: none; - text-align: center; - line-height: 18px; - color: #6dbfff; - margin: 0 10px 0 0; - border-radius: 2px; -} -#upload .statusBar .progress span.percentage { - width: 0; - height: 100%; - left: 0; - top: 0; - background: #1483d8; - position: absolute; -} -#upload .statusBar .progress span.text { - position: relative; - z-index: 10; -} - -#upload .statusBar .info { - display: inline-block; - font-size: 14px; - color: #666666; -} - -#upload .statusBar .btns { - position: absolute; - top: 7px; - right: 0; - line-height: 30px; -} - -#filePickerBtn { - display: inline-block; - float: left; -} -#upload .statusBar .btns .webuploader-pick, -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-uploading, -#upload .statusBar .btns .uploadBtn.state-paused { - background: #ffffff; - border: 1px solid #cfcfcf; - color: #565656; - padding: 0 18px; - display: inline-block; - border-radius: 3px; - margin-left: 10px; - cursor: pointer; - font-size: 14px; - float: left; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -#upload .statusBar .btns .webuploader-pick-hover, -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-uploading:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover { - background: #f0f0f0; -} - -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-paused{ - background: #00b7ee; - color: #fff; - border-color: transparent; -} -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover{ - background: #00a2d4; -} - -#upload .statusBar .btns .uploadBtn.disabled { - pointer-events: none; - filter:alpha(opacity=60); - -moz-opacity:0.6; - -khtml-opacity: 0.6; - opacity: 0.6; -} - - -/* 在线文件的文件预览图标 */ -i.file-preview { - display: block; - margin: 10px auto; - width: 70px; - height: 70px; - background-image: url("./images/file-icons.png"); - background-image: url("./images/file-icons.gif") \9; - background-position: -140px center; - background-repeat: no-repeat; -} -i.file-preview.file-type-dir{ - background-position: 0 center; -} -i.file-preview.file-type-file{ - background-position: -140px center; -} -i.file-preview.file-type-filelist{ - background-position: -210px center; -} -i.file-preview.file-type-zip, -i.file-preview.file-type-rar, -i.file-preview.file-type-7z, -i.file-preview.file-type-tar, -i.file-preview.file-type-gz, -i.file-preview.file-type-bz2{ - background-position: -280px center; -} -i.file-preview.file-type-xls, -i.file-preview.file-type-xlsx{ - background-position: -350px center; -} -i.file-preview.file-type-doc, -i.file-preview.file-type-docx{ - background-position: -420px center; -} -i.file-preview.file-type-ppt, -i.file-preview.file-type-pptx{ - background-position: -490px center; -} -i.file-preview.file-type-vsd{ - background-position: -560px center; -} -i.file-preview.file-type-pdf{ - background-position: -630px center; -} -i.file-preview.file-type-txt, -i.file-preview.file-type-md, -i.file-preview.file-type-json, -i.file-preview.file-type-htm, -i.file-preview.file-type-xml, -i.file-preview.file-type-html, -i.file-preview.file-type-js, -i.file-preview.file-type-css, -i.file-preview.file-type-php, -i.file-preview.file-type-jsp, -i.file-preview.file-type-asp{ - background-position: -700px center; -} -i.file-preview.file-type-apk{ - background-position: -770px center; -} -i.file-preview.file-type-exe{ - background-position: -840px center; -} -i.file-preview.file-type-ipa{ - background-position: -910px center; -} -i.file-preview.file-type-mp4, -i.file-preview.file-type-swf, -i.file-preview.file-type-mkv, -i.file-preview.file-type-avi, -i.file-preview.file-type-flv, -i.file-preview.file-type-mov, -i.file-preview.file-type-mpg, -i.file-preview.file-type-mpeg, -i.file-preview.file-type-ogv, -i.file-preview.file-type-webm, -i.file-preview.file-type-rm, -i.file-preview.file-type-rmvb{ - background-position: -980px center; -} -i.file-preview.file-type-ogg, -i.file-preview.file-type-wav, -i.file-preview.file-type-wmv, -i.file-preview.file-type-mid, -i.file-preview.file-type-mp3{ - background-position: -1050px center; -} -i.file-preview.file-type-jpg, -i.file-preview.file-type-jpeg, -i.file-preview.file-type-gif, -i.file-preview.file-type-bmp, -i.file-preview.file-type-png, -i.file-preview.file-type-psd{ - background-position: -140px center; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/video.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/video.html deleted file mode 100644 index 347b42245115f2b896b044b8ae8c449448def5f0..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/video.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - -
                      -
                      -
                      - - -
                      -
                      -
                      -
                      -
                      -
                      -
                      - - - - -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      - 0% - -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                        -
                      • -
                      -
                      -
                      -
                      -
                      - - - - -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      -
                      -
                      - - - - - - - - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/video.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/video.js deleted file mode 100644 index 7772e431c7c790138019f6f7eeaf291095bf1113..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/video/video.js +++ /dev/null @@ -1,812 +0,0 @@ -/** - * Created by JetBrains PhpStorm. - * User: taoqili - * Date: 12-2-20 - * Time: 上午11:19 - * To change this template use File | Settings | File Templates. - */ - -(function(){ - - var video = {}, - uploadVideoList = [], - isModifyUploadVideo = false, - uploadFile; - - window.onload = function(){ - $focus($G("videoUrl")); - initTabs(); - initVideo(); - initUpload(); - }; - - /* 初始化tab标签 */ - function initTabs(){ - var tabs = $G('tabHeads').children; - for (var i = 0; i < tabs.length; i++) { - domUtils.on(tabs[i], "click", function (e) { - var j, bodyId, target = e.target || e.srcElement; - for (j = 0; j < tabs.length; j++) { - bodyId = tabs[j].getAttribute('data-content-id'); - if(tabs[j] == target){ - domUtils.addClass(tabs[j], 'focus'); - domUtils.addClass($G(bodyId), 'focus'); - }else { - domUtils.removeClasses(tabs[j], 'focus'); - domUtils.removeClasses($G(bodyId), 'focus'); - } - } - }); - } - } - - function initVideo(){ - createAlignButton( ["videoFloat", "upload_alignment"] ); - addUrlChangeListener($G("videoUrl")); - addOkListener(); - - //编辑视频时初始化相关信息 - (function(){ - var img = editor.selection.getRange().getClosedNode(),url; - if(img && img.className){ - var hasFakedClass = (img.className == "edui-faked-video"), - hasUploadClass = img.className.indexOf("edui-upload-video")!=-1; - if(hasFakedClass || hasUploadClass) { - $G("videoUrl").value = url = img.getAttribute("_url"); - $G("videoWidth").value = img.width; - $G("videoHeight").value = img.height; - var align = domUtils.getComputedStyle(img,"float"), - parentAlign = domUtils.getComputedStyle(img.parentNode,"text-align"); - updateAlignButton(parentAlign==="center"?"center":align); - } - if(hasUploadClass) { - isModifyUploadVideo = true; - } - } - createPreviewVideo(url); - })(); - } - - /** - * 监听确认和取消两个按钮事件,用户执行插入或者清空正在播放的视频实例操作 - */ - function addOkListener(){ - dialog.onok = function(){ - $G("preview").innerHTML = ""; - var currentTab = findFocus("tabHeads","tabSrc"); - switch(currentTab){ - case "video": - return insertSingle(); - break; - case "videoSearch": - return insertSearch("searchList"); - break; - case "upload": - return insertUpload(); - break; - } - }; - dialog.oncancel = function(){ - $G("preview").innerHTML = ""; - }; - } - - /** - * 依据传入的align值更新按钮信息 - * @param align - */ - function updateAlignButton( align ) { - var aligns = $G( "videoFloat" ).children; - for ( var i = 0, ci; ci = aligns[i++]; ) { - if ( ci.getAttribute( "name" ) == align ) { - if ( ci.className !="focus" ) { - ci.className = "focus"; - } - } else { - if ( ci.className =="focus" ) { - ci.className = ""; - } - } - } - } - - /** - * 将单个视频信息插入编辑器中 - */ - function insertSingle(){ - var width = $G("videoWidth"), - height = $G("videoHeight"), - url=$G('videoUrl').value, - align = findFocus("videoFloat","name"); - - var newurl = convert_url(url); - if (newurl.startsWith("")) { - var arr = newurl.split(" "); - for (var i=0; i>arr.length; i++) { - if (arr[i].startsWith("src")) { - newurl = arr[i].replace("src=", ""); - } - if (arr[i].startsWith("width")) { - if (!width) { - width = arr[i].replace("width=", ""); - } - } - if (arr[i].startsWith("height")) { - if (!height) { - height = arr[i].replace("height=", ""); - } - } - } - } - - if(!newurl) return false; - if ( !checkNum( [width, height] ) ) return false; - editor.execCommand('insertvideo', { - url: newurl, - width: width.value, - height: height.value, - align: align - }, isModifyUploadVideo ? 'upload':null); - } - - /** - * 将元素id下的所有代表视频的图片插入编辑器中 - * @param id - */ - function insertSearch(id){ - var imgs = domUtils.getElementsByTagName($G(id),"img"), - videoObjs=[]; - for(var i=0,img; img=imgs[i++];){ - if(img.getAttribute("selected")){ - videoObjs.push({ - url:img.getAttribute("ue_video_url"), - width:420, - height:280, - align:"none" - }); - } - } - editor.execCommand('insertvideo',videoObjs); - } - - /** - * 找到id下具有focus类的节点并返回该节点下的某个属性 - * @param id - * @param returnProperty - */ - function findFocus( id, returnProperty ) { - var tabs = $G( id ).children, - property; - for ( var i = 0, ci; ci = tabs[i++]; ) { - if ( ci.className=="focus" ) { - property = ci.getAttribute( returnProperty ); - break; - } - } - return property; - } - function convert_url(url){ - if ( !url ) return ''; - url = utils.trim(url) - .replace(/v\.youku\.com\/v_show\/id_([\w\-=]+)\.html/i, 'player.youku.com/player.php/sid/$1/v.swf') - .replace(/(www\.)?youtube\.com\/watch\?v=([\w\-]+)/i, "www.youtube.com/v/$2") - .replace(/youtu.be\/(\w+)$/i, "www.youtube.com/v/$1") - .replace(/v\.ku6\.com\/.+\/([\w\.]+)\.html.*$/i, "player.ku6.com/refer/$1/v.swf") - .replace(/www\.56\.com\/u\d+\/v_([\w\-]+)\.html/i, "player.56.com/v_$1.swf") - .replace(/www.56.com\/w\d+\/play_album\-aid\-\d+_vid\-([^.]+)\.html/i, "player.56.com/v_$1.swf") - .replace(/v\.pps\.tv\/play_([\w]+)\.html.*$/i, "player.pps.tv/player/sid/$1/v.swf") - .replace(/www\.letv\.com\/ptv\/vplay\/([\d]+)\.html.*$/i, "i7.imgs.letv.com/player/swfPlayer.swf?id=$1&autoplay=0") - .replace(/www\.tudou\.com\/programs\/view\/([\w\-]+)\/?/i, "www.tudou.com/v/$1") - .replace(/v\.qq\.com\/cover\/[\w]+\/[\w]+\/([\w]+)\.html/i, "static.video.qq.com/TPout.swf?vid=$1") - .replace(/v\.qq\.com\/.+[\?\&]vid=([^&]+).*$/i, "static.video.qq.com/TPout.swf?vid=$1") - .replace(/my\.tv\.sohu\.com\/[\w]+\/[\d]+\/([\d]+)\.shtml.*$/i, "share.vrs.sohu.com/my/v.swf&id=$1"); - return url; - } - - /** - * 检测传入的所有input框中输入的长宽是否是正数 - * @param nodes input框集合, - */ - function checkNum( nodes ) { - for ( var i = 0, ci; ci = nodes[i++]; ) { - var value = ci.value; - if ( !isNumber( value ) && value) { - alert( lang.numError ); - ci.value = ""; - ci.focus(); - return false; - } - } - return true; - } - - /** - * 数字判断 - * @param value - */ - function isNumber( value ) { - return /(0|^[1-9]\d*$)/.test( value ); - } - - /** - * 创建图片浮动选择按钮 - * @param ids - */ - function createAlignButton( ids ) { - for ( var i = 0, ci; ci = ids[i++]; ) { - var floatContainer = $G( ci ), - nameMaps = {"none":lang['default'], "left":lang.floatLeft, "right":lang.floatRight, "center":lang.block}; - for ( var j in nameMaps ) { - var div = document.createElement( "div" ); - div.setAttribute( "name", j ); - if ( j == "none" ) div.className="focus"; - div.style.cssText = "background:url(images/" + j + "_focus.jpg);"; - div.setAttribute( "title", nameMaps[j] ); - floatContainer.appendChild( div ); - } - switchSelect( ci ); - } - } - - /** - * 选择切换 - * @param selectParentId - */ - function switchSelect( selectParentId ) { - var selects = $G( selectParentId ).children; - for ( var i = 0, ci; ci = selects[i++]; ) { - domUtils.on( ci, "click", function () { - for ( var j = 0, cj; cj = selects[j++]; ) { - cj.className = ""; - cj.removeAttribute && cj.removeAttribute( "class" ); - } - this.className = "focus"; - } ) - } - } - - /** - * 监听url改变事件 - * @param url - */ - function addUrlChangeListener(url){ - if (browser.ie) { - url.onpropertychange = function () { - createPreviewVideo( this.value ); - } - } else { - url.addEventListener( "input", function () { - createPreviewVideo( this.value ); - }, false ); - } - } - - /** - * 根据url生成视频预览 - * @param url - */ - function createPreviewVideo(url){ - if ( !url ) return; - - if (url.startsWith("http") && url.indexOf(".mp4") > 0) { - $G("preview").innerHTML = '
                      '+lang.urlError+'
                      '+ - ''; - } - if (url.startsWith("")) { - $G("preview").innerHTML = '
                      '+lang.urlError+'
                      '+url; - } - } - - - /* 插入上传视频 */ - function insertUpload(){ - var videoObjs=[], - uploadDir = editor.getOpt('videoUrlPrefix'), - width = parseInt($G('upload_width').value, 10) || 420, - height = parseInt($G('upload_height').value, 10) || 280, - align = findFocus("upload_alignment","name") || 'none'; - for(var key in uploadVideoList) { - var file = uploadVideoList[key]; - videoObjs.push({ - url: uploadDir + file.url, - width:width, - height:height, - align:align - }); - } - - var count = uploadFile.getQueueCount(); - if (count) { - $('.info', '#queueList').html('' + '还有2个未上传文件'.replace(/[\d]/, count) + ''); - return false; - } else { - editor.execCommand('insertvideo', videoObjs, 'upload'); - } - } - - /*初始化上传标签*/ - function initUpload(){ - uploadFile = new UploadFile('queueList'); - } - - - /* 上传附件 */ - function UploadFile(target) { - this.$wrap = target.constructor == String ? $('#' + target) : $(target); - this.init(); - } - UploadFile.prototype = { - init: function () { - this.fileList = []; - this.initContainer(); - this.initUploader(); - }, - initContainer: function () { - this.$queue = this.$wrap.find('.filelist'); - }, - /* 初始化容器 */ - initUploader: function () { - var _this = this, - $ = jQuery, // just in case. Make sure it's not an other libaray. - $wrap = _this.$wrap, - // 图片容器 - $queue = $wrap.find('.filelist'), - // 状态栏,包括进度和控制按钮 - $statusBar = $wrap.find('.statusBar'), - // 文件总体选择信息。 - $info = $statusBar.find('.info'), - // 上传按钮 - $upload = $wrap.find('.uploadBtn'), - // 上传按钮 - $filePickerBtn = $wrap.find('.filePickerBtn'), - // 上传按钮 - $filePickerBlock = $wrap.find('.filePickerBlock'), - // 没选择文件之前的内容。 - $placeHolder = $wrap.find('.placeholder'), - // 总体进度条 - $progress = $statusBar.find('.progress').hide(), - // 添加的文件数量 - fileCount = 0, - // 添加的文件总大小 - fileSize = 0, - // 优化retina, 在retina下这个值是2 - ratio = window.devicePixelRatio || 1, - // 缩略图大小 - thumbnailWidth = 113 * ratio, - thumbnailHeight = 113 * ratio, - // 可能有pedding, ready, uploading, confirm, done. - state = '', - // 所有文件的进度信息,key为file id - percentages = {}, - supportTransition = (function () { - var s = document.createElement('p').style, - r = 'transition' in s || - 'WebkitTransition' in s || - 'MozTransition' in s || - 'msTransition' in s || - 'OTransition' in s; - s = null; - return r; - })(), - // WebUploader实例 - uploader, - actionUrl = editor.getActionUrl(editor.getOpt('videoActionName')), - fileMaxSize = editor.getOpt('videoMaxSize'), - acceptExtensions = (editor.getOpt('videoAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');; - - if (!WebUploader.Uploader.support()) { - $('#filePickerReady').after($('
                      ').html(lang.errorNotSupport)).hide(); - return; - } else if (!editor.getOpt('videoActionName')) { - $('#filePickerReady').after($('
                      ').html(lang.errorLoadConfig)).hide(); - return; - } - - uploader = _this.uploader = WebUploader.create({ - pick: { - id: '#filePickerReady', - label: lang.uploadSelectFile - }, - swf: '../../third-party/webuploader/Uploader.swf', - server: actionUrl, - fileVal: editor.getOpt('videoFieldName'), - duplicate: true, - fileSingleSizeLimit: fileMaxSize, - compress: false - }); - uploader.addButton({ - id: '#filePickerBlock' - }); - uploader.addButton({ - id: '#filePickerBtn', - label: lang.uploadAddFile - }); - - setState('pedding'); - - // 当有文件添加进来时执行,负责view的创建 - function addFile(file) { - var $li = $('
                    • ' + - '

                      ' + file.name + '

                      ' + - '

                      ' + - '

                      ' + - '
                    • '), - - $btns = $('
                      ' + - '' + lang.uploadDelete + '' + - '' + lang.uploadTurnRight + '' + - '' + lang.uploadTurnLeft + '
                      ').appendTo($li), - $prgress = $li.find('p.progress span'), - $wrap = $li.find('p.imgWrap'), - $info = $('

                      ').hide().appendTo($li), - - showError = function (code) { - switch (code) { - case 'exceed_size': - text = lang.errorExceedSize; - break; - case 'interrupt': - text = lang.errorInterrupt; - break; - case 'http': - text = lang.errorHttp; - break; - case 'not_allow_type': - text = lang.errorFileType; - break; - default: - text = lang.errorUploadRetry; - break; - } - $info.text(text).show(); - }; - - if (file.getStatus() === 'invalid') { - showError(file.statusText); - } else { - $wrap.text(lang.uploadPreview); - if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|'+file.ext.toLowerCase()+'|') == -1) { - $wrap.empty().addClass('notimage').append('' + - '' + file.name + ''); - } else { - if (browser.ie && browser.version <= 7) { - $wrap.text(lang.uploadNoPreview); - } else { - uploader.makeThumb(file, function (error, src) { - if (error || !src || (/^data:/.test(src) && browser.ie && browser.version <= 7)) { - $wrap.text(lang.uploadNoPreview); - } else { - var $img = $(''); - $wrap.empty().append($img); - $img.on('error', function () { - $wrap.text(lang.uploadNoPreview); - }); - } - }, thumbnailWidth, thumbnailHeight); - } - } - percentages[ file.id ] = [ file.size, 0 ]; - file.rotation = 0; - - /* 检查文件格式 */ - if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) { - showError('not_allow_type'); - uploader.removeFile(file); - } - } - - file.on('statuschange', function (cur, prev) { - if (prev === 'progress') { - $prgress.hide().width(0); - } else if (prev === 'queued') { - $li.off('mouseenter mouseleave'); - $btns.remove(); - } - // 成功 - if (cur === 'error' || cur === 'invalid') { - showError(file.statusText); - percentages[ file.id ][ 1 ] = 1; - } else if (cur === 'interrupt') { - showError('interrupt'); - } else if (cur === 'queued') { - percentages[ file.id ][ 1 ] = 0; - } else if (cur === 'progress') { - $info.hide(); - $prgress.css('display', 'block'); - } else if (cur === 'complete') { - } - - $li.removeClass('state-' + prev).addClass('state-' + cur); - }); - - $li.on('mouseenter', function () { - $btns.stop().animate({height: 30}); - }); - $li.on('mouseleave', function () { - $btns.stop().animate({height: 0}); - }); - - $btns.on('click', 'span', function () { - var index = $(this).index(), - deg; - - switch (index) { - case 0: - uploader.removeFile(file); - return; - case 1: - file.rotation += 90; - break; - case 2: - file.rotation -= 90; - break; - } - - if (supportTransition) { - deg = 'rotate(' + file.rotation + 'deg)'; - $wrap.css({ - '-webkit-transform': deg, - '-mos-transform': deg, - '-o-transform': deg, - 'transform': deg - }); - } else { - $wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')'); - } - - }); - - $li.insertBefore($filePickerBlock); - } - - // 负责view的销毁 - function removeFile(file) { - var $li = $('#' + file.id); - delete percentages[ file.id ]; - updateTotalProgress(); - $li.off().find('.file-panel').off().end().remove(); - } - - function updateTotalProgress() { - var loaded = 0, - total = 0, - spans = $progress.children(), - percent; - - $.each(percentages, function (k, v) { - total += v[ 0 ]; - loaded += v[ 0 ] * v[ 1 ]; - }); - - percent = total ? loaded / total : 0; - - spans.eq(0).text(Math.round(percent * 100) + '%'); - spans.eq(1).css('width', Math.round(percent * 100) + '%'); - updateStatus(); - } - - function setState(val, files) { - - if (val != state) { - - var stats = uploader.getStats(); - - $upload.removeClass('state-' + state); - $upload.addClass('state-' + val); - - switch (val) { - - /* 未选择文件 */ - case 'pedding': - $queue.addClass('element-invisible'); - $statusBar.addClass('element-invisible'); - $placeHolder.removeClass('element-invisible'); - $progress.hide(); $info.hide(); - uploader.refresh(); - break; - - /* 可以开始上传 */ - case 'ready': - $placeHolder.addClass('element-invisible'); - $queue.removeClass('element-invisible'); - $statusBar.removeClass('element-invisible'); - $progress.hide(); $info.show(); - $upload.text(lang.uploadStart); - uploader.refresh(); - break; - - /* 上传中 */ - case 'uploading': - $progress.show(); $info.hide(); - $upload.text(lang.uploadPause); - break; - - /* 暂停上传 */ - case 'paused': - $progress.show(); $info.hide(); - $upload.text(lang.uploadContinue); - break; - - case 'confirm': - $progress.show(); $info.hide(); - $upload.text(lang.uploadStart); - - stats = uploader.getStats(); - if (stats.successNum && !stats.uploadFailNum) { - setState('finish'); - return; - } - break; - - case 'finish': - $progress.hide(); $info.show(); - if (stats.uploadFailNum) { - $upload.text(lang.uploadRetry); - } else { - $upload.text(lang.uploadStart); - } - break; - } - - state = val; - updateStatus(); - - } - - if (!_this.getQueueCount()) { - $upload.addClass('disabled') - } else { - $upload.removeClass('disabled') - } - - } - - function updateStatus() { - var text = '', stats; - - if (state === 'ready') { - text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)); - } else if (state === 'confirm') { - stats = uploader.getStats(); - if (stats.uploadFailNum) { - text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum); - } - } else { - stats = uploader.getStats(); - text = lang.updateStatusFinish.replace('_', fileCount). - replace('_KB', WebUploader.formatSize(fileSize)). - replace('_', stats.successNum); - - if (stats.uploadFailNum) { - text += lang.updateStatusError.replace('_', stats.uploadFailNum); - } - } - - $info.html(text); - } - - uploader.on('fileQueued', function (file) { - fileCount++; - fileSize += file.size; - - if (fileCount === 1) { - $placeHolder.addClass('element-invisible'); - $statusBar.show(); - } - - addFile(file); - }); - - uploader.on('fileDequeued', function (file) { - fileCount--; - fileSize -= file.size; - - removeFile(file); - updateTotalProgress(); - }); - - uploader.on('filesQueued', function (file) { - if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) { - setState('ready'); - } - updateTotalProgress(); - }); - - uploader.on('all', function (type, files) { - switch (type) { - case 'uploadFinished': - setState('confirm', files); - break; - case 'startUpload': - /* 添加额外的GET参数 */ - var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '', - url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + 'encode=utf-8&' + params); - uploader.option('server', url); - setState('uploading', files); - break; - case 'stopUpload': - setState('paused', files); - break; - } - }); - - uploader.on('uploadBeforeSend', function (file, data, header) { - //这里可以通过data对象添加POST参数 - header['X_Requested_With'] = 'XMLHttpRequest'; - }); - - uploader.on('uploadProgress', function (file, percentage) { - var $li = $('#' + file.id), - $percent = $li.find('.progress span'); - - $percent.css('width', percentage * 100 + '%'); - percentages[ file.id ][ 1 ] = percentage; - updateTotalProgress(); - }); - - uploader.on('uploadSuccess', function (file, ret) { - var $file = $('#' + file.id); - try { - var responseText = (ret._raw || ret), - json = utils.str2json(responseText); - if (json.state == 'SUCCESS') { - uploadVideoList.push({ - 'url': json.url, - 'type': json.type, - 'original':json.original - }); - $file.append(''); - } else { - $file.find('.error').text(json.state).show(); - } - } catch (e) { - $file.find('.error').text(lang.errorServerUpload).show(); - } - }); - - uploader.on('uploadError', function (file, code) { - }); - uploader.on('error', function (code, file) { - if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { - addFile(file); - } - }); - uploader.on('uploadComplete', function (file, ret) { - }); - - $upload.on('click', function () { - if ($(this).hasClass('disabled')) { - return false; - } - - if (state === 'ready') { - uploader.upload(); - } else if (state === 'paused') { - uploader.upload(); - } else if (state === 'uploading') { - uploader.stop(); - } - }); - - $upload.addClass('state-' + state); - updateTotalProgress(); - }, - getQueueCount: function () { - var file, i, status, readyFile = 0, files = this.uploader.getFiles(); - for (i = 0; file = files[i++]; ) { - status = file.getStatus(); - if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; - } - return readyFile; - }, - refresh: function(){ - this.uploader.refresh(); - } - }; - -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/webapp/webapp.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/webapp/webapp.html deleted file mode 100644 index 161437790f5433da8dc3c085a7fbdc121410e873..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/webapp/webapp.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/fClipboard_ueditor.swf b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/fClipboard_ueditor.swf deleted file mode 100644 index ac5d27f81d2111c8581a042564c5275edd751e1c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/fClipboard_ueditor.swf and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/imageUploader.swf b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/imageUploader.swf deleted file mode 100644 index 2a554cadbd136ff622b612dbcf0460fb9a980f40..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/imageUploader.swf and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/tangram.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/tangram.js deleted file mode 100644 index 2ebd8fd3dc82629ecd4bbece4d5c83da6a86bf0f..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/tangram.js +++ /dev/null @@ -1,1495 +0,0 @@ -// Copyright (c) 2009, Baidu Inc. All rights reserved. -// -// Licensed under the BSD License -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http:// tangram.baidu.com/license.html -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS-IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - /** - * @namespace T Tangram七巧板 - * @name T - * @version 1.6.0 -*/ - -/** - * 声明baidu包 - * @author: allstar, erik, meizz, berg - */ -var T, - baidu = T = baidu || {version: "1.5.0"}; -baidu.guid = "$BAIDU$"; -baidu.$$ = window[baidu.guid] = window[baidu.guid] || {global:{}}; - -/** - * 使用flash资源封装的一些功能 - * @namespace baidu.flash - */ -baidu.flash = baidu.flash || {}; - -/** - * 操作dom的方法 - * @namespace baidu.dom - */ -baidu.dom = baidu.dom || {}; - - -/** - * 从文档中获取指定的DOM元素 - * @name baidu.dom.g - * @function - * @grammar baidu.dom.g(id) - * @param {string|HTMLElement} id 元素的id或DOM元素. - * @shortcut g,T.G - * @meta standard - * @see baidu.dom.q - * - * @return {HTMLElement|null} 获取的元素,查找不到时返回null,如果参数不合法,直接返回参数. - */ -baidu.dom.g = function(id) { - if (!id) return null; - if ('string' == typeof id || id instanceof String) { - return document.getElementById(id); - } else if (id.nodeName && (id.nodeType == 1 || id.nodeType == 9)) { - return id; - } - return null; -}; -baidu.g = baidu.G = baidu.dom.g; - - -/** - * 操作数组的方法 - * @namespace baidu.array - */ - -baidu.array = baidu.array || {}; - - -/** - * 遍历数组中所有元素 - * @name baidu.array.each - * @function - * @grammar baidu.array.each(source, iterator[, thisObject]) - * @param {Array} source 需要遍历的数组 - * @param {Function} iterator 对每个数组元素进行调用的函数,该函数有两个参数,第一个为数组元素,第二个为数组索引值,function (item, index)。 - * @param {Object} [thisObject] 函数调用时的this指针,如果没有此参数,默认是当前遍历的数组 - * @remark - * each方法不支持对Object的遍历,对Object的遍历使用baidu.object.each 。 - * @shortcut each - * @meta standard - * - * @returns {Array} 遍历的数组 - */ - -baidu.each = baidu.array.forEach = baidu.array.each = function (source, iterator, thisObject) { - var returnValue, item, i, len = source.length; - - if ('function' == typeof iterator) { - for (i = 0; i < len; i++) { - item = source[i]; - returnValue = iterator.call(thisObject || source, item, i); - - if (returnValue === false) { - break; - } - } - } - return source; -}; - -/** - * 对语言层面的封装,包括类型判断、模块扩展、继承基类以及对象自定义事件的支持。 - * @namespace baidu.lang - */ -baidu.lang = baidu.lang || {}; - - -/** - * 判断目标参数是否为function或Function实例 - * @name baidu.lang.isFunction - * @function - * @grammar baidu.lang.isFunction(source) - * @param {Any} source 目标参数 - * @version 1.2 - * @see baidu.lang.isString,baidu.lang.isObject,baidu.lang.isNumber,baidu.lang.isArray,baidu.lang.isElement,baidu.lang.isBoolean,baidu.lang.isDate - * @meta standard - * @returns {boolean} 类型判断结果 - */ -baidu.lang.isFunction = function (source) { - return '[object Function]' == Object.prototype.toString.call(source); -}; - -/** - * 判断目标参数是否string类型或String对象 - * @name baidu.lang.isString - * @function - * @grammar baidu.lang.isString(source) - * @param {Any} source 目标参数 - * @shortcut isString - * @meta standard - * @see baidu.lang.isObject,baidu.lang.isNumber,baidu.lang.isArray,baidu.lang.isElement,baidu.lang.isBoolean,baidu.lang.isDate - * - * @returns {boolean} 类型判断结果 - */ -baidu.lang.isString = function (source) { - return '[object String]' == Object.prototype.toString.call(source); -}; -baidu.isString = baidu.lang.isString; - - -/** - * 判断浏览器类型和特性的属性 - * @namespace baidu.browser - */ -baidu.browser = baidu.browser || {}; - - -/** - * 判断是否为opera浏览器 - * @property opera opera版本号 - * @grammar baidu.browser.opera - * @meta standard - * @see baidu.browser.ie,baidu.browser.firefox,baidu.browser.safari,baidu.browser.chrome - * @returns {Number} opera版本号 - */ - -/** - * opera 从10开始不是用opera后面的字符串进行版本的判断 - * 在Browser identification最后添加Version + 数字进行版本标识 - * opera后面的数字保持在9.80不变 - */ -baidu.browser.opera = /opera(\/| )(\d+(\.\d+)?)(.+?(version\/(\d+(\.\d+)?)))?/i.test(navigator.userAgent) ? + ( RegExp["\x246"] || RegExp["\x242"] ) : undefined; - - -/** - * 在目标元素的指定位置插入HTML代码 - * @name baidu.dom.insertHTML - * @function - * @grammar baidu.dom.insertHTML(element, position, html) - * @param {HTMLElement|string} element 目标元素或目标元素的id - * @param {string} position 插入html的位置信息,取值为beforeBegin,afterBegin,beforeEnd,afterEnd - * @param {string} html 要插入的html - * @remark - * - * 对于position参数,大小写不敏感
                      - * 参数的意思:beforeBegin<span>afterBegin this is span! beforeEnd</span> afterEnd
                      - * 此外,如果使用本函数插入带有script标签的HTML字符串,script标签对应的脚本将不会被执行。 - * - * @shortcut insertHTML - * @meta standard - * - * @returns {HTMLElement} 目标元素 - */ -baidu.dom.insertHTML = function (element, position, html) { - element = baidu.dom.g(element); - var range,begin; - if (element.insertAdjacentHTML && !baidu.browser.opera) { - element.insertAdjacentHTML(position, html); - } else { - range = element.ownerDocument.createRange(); - position = position.toUpperCase(); - if (position == 'AFTERBEGIN' || position == 'BEFOREEND') { - range.selectNodeContents(element); - range.collapse(position == 'AFTERBEGIN'); - } else { - begin = position == 'BEFOREBEGIN'; - range[begin ? 'setStartBefore' : 'setEndAfter'](element); - range.collapse(begin); - } - range.insertNode(range.createContextualFragment(html)); - } - return element; -}; - -baidu.insertHTML = baidu.dom.insertHTML; - -/** - * 操作flash对象的方法,包括创建flash对象、获取flash对象以及判断flash插件的版本号 - * @namespace baidu.swf - */ -baidu.swf = baidu.swf || {}; - - -/** - * 浏览器支持的flash插件版本 - * @property version 浏览器支持的flash插件版本 - * @grammar baidu.swf.version - * @return {String} 版本号 - * @meta standard - */ -baidu.swf.version = (function () { - var n = navigator; - if (n.plugins && n.mimeTypes.length) { - var plugin = n.plugins["Shockwave Flash"]; - if (plugin && plugin.description) { - return plugin.description - .replace(/([a-zA-Z]|\s)+/, "") - .replace(/(\s)+r/, ".") + ".0"; - } - } else if (window.ActiveXObject && !window.opera) { - for (var i = 12; i >= 2; i--) { - try { - var c = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.' + i); - if (c) { - var version = c.GetVariable("$version"); - return version.replace(/WIN/g,'').replace(/,/g,'.'); - } - } catch(e) {} - } - } -})(); - -/** - * 操作字符串的方法 - * @namespace baidu.string - */ -baidu.string = baidu.string || {}; - - -/** - * 对目标字符串进行html编码 - * @name baidu.string.encodeHTML - * @function - * @grammar baidu.string.encodeHTML(source) - * @param {string} source 目标字符串 - * @remark - * 编码字符有5个:&<>"' - * @shortcut encodeHTML - * @meta standard - * @see baidu.string.decodeHTML - * - * @returns {string} html编码后的字符串 - */ -baidu.string.encodeHTML = function (source) { - return String(source) - .replace(/&/g,'&') - .replace(//g,'>') - .replace(/"/g, """) - .replace(/'/g, "'"); -}; - -baidu.encodeHTML = baidu.string.encodeHTML; - -/** - * 创建flash对象的html字符串 - * @name baidu.swf.createHTML - * @function - * @grammar baidu.swf.createHTML(options) - * - * @param {Object} options 创建flash的选项参数 - * @param {string} options.id 要创建的flash的标识 - * @param {string} options.url flash文件的url - * @param {String} options.errorMessage 未安装flash player或flash player版本号过低时的提示 - * @param {string} options.ver 最低需要的flash player版本号 - * @param {string} options.width flash的宽度 - * @param {string} options.height flash的高度 - * @param {string} options.align flash的对齐方式,允许值:middle/left/right/top/bottom - * @param {string} options.base 设置用于解析swf文件中的所有相对路径语句的基本目录或URL - * @param {string} options.bgcolor swf文件的背景色 - * @param {string} options.salign 设置缩放的swf文件在由width和height设置定义的区域内的位置。允许值:l/r/t/b/tl/tr/bl/br - * @param {boolean} options.menu 是否显示右键菜单,允许值:true/false - * @param {boolean} options.loop 播放到最后一帧时是否重新播放,允许值: true/false - * @param {boolean} options.play flash是否在浏览器加载时就开始播放。允许值:true/false - * @param {string} options.quality 设置flash播放的画质,允许值:low/medium/high/autolow/autohigh/best - * @param {string} options.scale 设置flash内容如何缩放来适应设置的宽高。允许值:showall/noborder/exactfit - * @param {string} options.wmode 设置flash的显示模式。允许值:window/opaque/transparent - * @param {string} options.allowscriptaccess 设置flash与页面的通信权限。允许值:always/never/sameDomain - * @param {string} options.allownetworking 设置swf文件中允许使用的网络API。允许值:all/internal/none - * @param {boolean} options.allowfullscreen 是否允许flash全屏。允许值:true/false - * @param {boolean} options.seamlesstabbing 允许设置执行无缝跳格,从而使用户能跳出flash应用程序。该参数只能在安装Flash7及更高版本的Windows中使用。允许值:true/false - * @param {boolean} options.devicefont 设置静态文本对象是否以设备字体呈现。允许值:true/false - * @param {boolean} options.swliveconnect 第一次加载flash时浏览器是否应启动Java。允许值:true/false - * @param {Object} options.vars 要传递给flash的参数,支持JSON或string类型。 - * - * @see baidu.swf.create - * @meta standard - * @returns {string} flash对象的html字符串 - */ -baidu.swf.createHTML = function (options) { - options = options || {}; - var version = baidu.swf.version, - needVersion = options['ver'] || '6.0.0', - vUnit1, vUnit2, i, k, len, item, tmpOpt = {}, - encodeHTML = baidu.string.encodeHTML; - for (k in options) { - tmpOpt[k] = options[k]; - } - options = tmpOpt; - if (version) { - version = version.split('.'); - needVersion = needVersion.split('.'); - for (i = 0; i < 3; i++) { - vUnit1 = parseInt(version[i], 10); - vUnit2 = parseInt(needVersion[i], 10); - if (vUnit2 < vUnit1) { - break; - } else if (vUnit2 > vUnit1) { - return ''; - } - } - } else { - return ''; - } - - var vars = options['vars'], - objProperties = ['classid', 'codebase', 'id', 'width', 'height', 'align']; - options['align'] = options['align'] || 'middle'; - options['classid'] = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'; - options['codebase'] = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'; - options['movie'] = options['url'] || ''; - delete options['vars']; - delete options['url']; - if ('string' == typeof vars) { - options['flashvars'] = vars; - } else { - var fvars = []; - for (k in vars) { - item = vars[k]; - fvars.push(k + "=" + encodeURIComponent(item)); - } - options['flashvars'] = fvars.join('&'); - } - var str = [''); - var params = { - 'wmode' : 1, - 'scale' : 1, - 'quality' : 1, - 'play' : 1, - 'loop' : 1, - 'menu' : 1, - 'salign' : 1, - 'bgcolor' : 1, - 'base' : 1, - 'allowscriptaccess' : 1, - 'allownetworking' : 1, - 'allowfullscreen' : 1, - 'seamlesstabbing' : 1, - 'devicefont' : 1, - 'swliveconnect' : 1, - 'flashvars' : 1, - 'movie' : 1 - }; - - for (k in options) { - item = options[k]; - k = k.toLowerCase(); - if (params[k] && (item || item === false || item === 0)) { - str.push(''); - } - } - options['src'] = options['movie']; - options['name'] = options['id']; - delete options['id']; - delete options['movie']; - delete options['classid']; - delete options['codebase']; - options['type'] = 'application/x-shockwave-flash'; - options['pluginspage'] = 'http://www.macromedia.com/go/getflashplayer'; - str.push(''); - - return str.join(''); -}; - - -/** - * 在页面中创建一个flash对象 - * @name baidu.swf.create - * @function - * @grammar baidu.swf.create(options[, container]) - * - * @param {Object} options 创建flash的选项参数 - * @param {string} options.id 要创建的flash的标识 - * @param {string} options.url flash文件的url - * @param {String} options.errorMessage 未安装flash player或flash player版本号过低时的提示 - * @param {string} options.ver 最低需要的flash player版本号 - * @param {string} options.width flash的宽度 - * @param {string} options.height flash的高度 - * @param {string} options.align flash的对齐方式,允许值:middle/left/right/top/bottom - * @param {string} options.base 设置用于解析swf文件中的所有相对路径语句的基本目录或URL - * @param {string} options.bgcolor swf文件的背景色 - * @param {string} options.salign 设置缩放的swf文件在由width和height设置定义的区域内的位置。允许值:l/r/t/b/tl/tr/bl/br - * @param {boolean} options.menu 是否显示右键菜单,允许值:true/false - * @param {boolean} options.loop 播放到最后一帧时是否重新播放,允许值: true/false - * @param {boolean} options.play flash是否在浏览器加载时就开始播放。允许值:true/false - * @param {string} options.quality 设置flash播放的画质,允许值:low/medium/high/autolow/autohigh/best - * @param {string} options.scale 设置flash内容如何缩放来适应设置的宽高。允许值:showall/noborder/exactfit - * @param {string} options.wmode 设置flash的显示模式。允许值:window/opaque/transparent - * @param {string} options.allowscriptaccess 设置flash与页面的通信权限。允许值:always/never/sameDomain - * @param {string} options.allownetworking 设置swf文件中允许使用的网络API。允许值:all/internal/none - * @param {boolean} options.allowfullscreen 是否允许flash全屏。允许值:true/false - * @param {boolean} options.seamlesstabbing 允许设置执行无缝跳格,从而使用户能跳出flash应用程序。该参数只能在安装Flash7及更高版本的Windows中使用。允许值:true/false - * @param {boolean} options.devicefont 设置静态文本对象是否以设备字体呈现。允许值:true/false - * @param {boolean} options.swliveconnect 第一次加载flash时浏览器是否应启动Java。允许值:true/false - * @param {Object} options.vars 要传递给flash的参数,支持JSON或string类型。 - * - * @param {HTMLElement|string} [container] flash对象的父容器元素,不传递该参数时在当前代码位置创建flash对象。 - * @meta standard - * @see baidu.swf.createHTML,baidu.swf.getMovie - */ -baidu.swf.create = function (options, target) { - options = options || {}; - var html = baidu.swf.createHTML(options) - || options['errorMessage'] - || ''; - - if (target && 'string' == typeof target) { - target = document.getElementById(target); - } - baidu.dom.insertHTML( target || document.body ,'beforeEnd',html ); -}; -/** - * 判断是否为ie浏览器 - * @name baidu.browser.ie - * @field - * @grammar baidu.browser.ie - * @returns {Number} IE版本号 - */ -baidu.browser.ie = baidu.ie = /msie (\d+\.\d+)/i.test(navigator.userAgent) ? (document.documentMode || + RegExp['\x241']) : undefined; - -/** - * 移除数组中的项 - * @name baidu.array.remove - * @function - * @grammar baidu.array.remove(source, match) - * @param {Array} source 需要移除项的数组 - * @param {Any} match 要移除的项 - * @meta standard - * @see baidu.array.removeAt - * - * @returns {Array} 移除后的数组 - */ -baidu.array.remove = function (source, match) { - var len = source.length; - - while (len--) { - if (len in source && source[len] === match) { - source.splice(len, 1); - } - } - return source; -}; - -/** - * 判断目标参数是否Array对象 - * @name baidu.lang.isArray - * @function - * @grammar baidu.lang.isArray(source) - * @param {Any} source 目标参数 - * @meta standard - * @see baidu.lang.isString,baidu.lang.isObject,baidu.lang.isNumber,baidu.lang.isElement,baidu.lang.isBoolean,baidu.lang.isDate - * - * @returns {boolean} 类型判断结果 - */ -baidu.lang.isArray = function (source) { - return '[object Array]' == Object.prototype.toString.call(source); -}; - - - -/** - * 将一个变量转换成array - * @name baidu.lang.toArray - * @function - * @grammar baidu.lang.toArray(source) - * @param {mix} source 需要转换成array的变量 - * @version 1.3 - * @meta standard - * @returns {array} 转换后的array - */ -baidu.lang.toArray = function (source) { - if (source === null || source === undefined) - return []; - if (baidu.lang.isArray(source)) - return source; - if (typeof source.length !== 'number' || typeof source === 'string' || baidu.lang.isFunction(source)) { - return [source]; - } - if (source.item) { - var l = source.length, array = new Array(l); - while (l--) - array[l] = source[l]; - return array; - } - - return [].slice.call(source); -}; - -/** - * 获得flash对象的实例 - * @name baidu.swf.getMovie - * @function - * @grammar baidu.swf.getMovie(name) - * @param {string} name flash对象的名称 - * @see baidu.swf.create - * @meta standard - * @returns {HTMLElement} flash对象的实例 - */ -baidu.swf.getMovie = function (name) { - var movie = document[name], ret; - return baidu.browser.ie == 9 ? - movie && movie.length ? - (ret = baidu.array.remove(baidu.lang.toArray(movie),function(item){ - return item.tagName.toLowerCase() != "embed"; - })).length == 1 ? ret[0] : ret - : movie - : movie || window[name]; -}; - - -baidu.flash._Base = (function(){ - - var prefix = 'bd__flash__'; - - /** - * 创建一个随机的字符串 - * @private - * @return {String} - */ - function _createString(){ - return prefix + Math.floor(Math.random() * 2147483648).toString(36); - }; - - /** - * 检查flash状态 - * @private - * @param {Object} target flash对象 - * @return {Boolean} - */ - function _checkReady(target){ - if(typeof target !== 'undefined' && typeof target.flashInit !== 'undefined' && target.flashInit()){ - return true; - }else{ - return false; - } - }; - - /** - * 调用之前进行压栈的函数 - * @private - * @param {Array} callQueue 调用队列 - * @param {Object} target flash对象 - * @return {Null} - */ - function _callFn(callQueue, target){ - var result = null; - - callQueue = callQueue.reverse(); - baidu.each(callQueue, function(item){ - result = target.call(item.fnName, item.params); - item.callBack(result); - }); - }; - - /** - * 为传入的匿名函数创建函数名 - * @private - * @param {String|Function} fun 传入的匿名函数或者函数名 - * @return {String} - */ - function _createFunName(fun){ - var name = ''; - - if(baidu.lang.isFunction(fun)){ - name = _createString(); - window[name] = function(){ - fun.apply(window, arguments); - }; - - return name; - }else if(baidu.lang.isString){ - return fun; - } - }; - - /** - * 绘制flash - * @private - * @param {Object} options 创建参数 - * @return {Object} - */ - function _render(options){ - if(!options.id){ - options.id = _createString(); - } - - var container = options.container || ''; - delete(options.container); - - baidu.swf.create(options, container); - - return baidu.swf.getMovie(options.id); - }; - - return function(options, callBack){ - var me = this, - autoRender = (typeof options.autoRender !== 'undefined' ? options.autoRender : true), - createOptions = options.createOptions || {}, - target = null, - isReady = false, - callQueue = [], - timeHandle = null, - callBack = callBack || []; - - /** - * 将flash文件绘制到页面上 - * @public - * @return {Null} - */ - me.render = function(){ - target = _render(createOptions); - - if(callBack.length > 0){ - baidu.each(callBack, function(funName, index){ - callBack[index] = _createFunName(options[funName] || new Function()); - }); - } - me.call('setJSFuncName', [callBack]); - }; - - /** - * 返回flash状态 - * @return {Boolean} - */ - me.isReady = function(){ - return isReady; - }; - - /** - * 调用flash接口的统一入口 - * @param {String} fnName 调用的函数名 - * @param {Array} params 传入的参数组成的数组,若不许要参数,需传入空数组 - * @param {Function} [callBack] 异步调用后将返回值作为参数的调用回调函数,如无返回值,可以不传入此参数 - * @return {Null} - */ - me.call = function(fnName, params, callBack){ - if(!fnName) return null; - callBack = callBack || new Function(); - - var result = null; - - if(isReady){ - result = target.call(fnName, params); - callBack(result); - }else{ - callQueue.push({ - fnName: fnName, - params: params, - callBack: callBack - }); - - (!timeHandle) && (timeHandle = setInterval(_check, 200)); - } - }; - - /** - * 为传入的匿名函数创建函数名 - * @public - * @param {String|Function} fun 传入的匿名函数或者函数名 - * @return {String} - */ - me.createFunName = function(fun){ - return _createFunName(fun); - }; - - /** - * 检查flash是否ready, 并进行调用 - * @private - * @return {Null} - */ - function _check(){ - if(_checkReady(target)){ - clearInterval(timeHandle); - timeHandle = null; - _call(); - - isReady = true; - } - }; - - /** - * 调用之前进行压栈的函数 - * @private - * @return {Null} - */ - function _call(){ - _callFn(callQueue, target); - callQueue = []; - } - - autoRender && me.render(); - }; -})(); - - - -/** - * 创建flash based imageUploader - * @class - * @grammar baidu.flash.imageUploader(options) - * @param {Object} createOptions 创建flash时需要的参数,请参照baidu.swf.create文档 - * @config {Object} vars 创建imageUploader时所需要的参数 - * @config {Number} vars.gridWidth 每一个预览图片所占的宽度,应该为flash寛的整除 - * @config {Number} vars.gridHeight 每一个预览图片所占的高度,应该为flash高的整除 - * @config {Number} vars.picWidth 单张预览图片的宽度 - * @config {Number} vars.picHeight 单张预览图片的高度 - * @config {String} vars.uploadDataFieldName POST请求中图片数据的key,默认值'picdata' - * @config {String} vars.picDescFieldName POST请求中图片描述的key,默认值'picDesc' - * @config {Number} vars.maxSize 文件的最大体积,单位'MB' - * @config {Number} vars.compressSize 上传前如果图片体积超过该值,会先压缩 - * @config {Number} vars.maxNum:32 最大上传多少个文件 - * @config {Number} vars.compressLength 能接受的最大边长,超过该值会等比压缩 - * @config {String} vars.url 上传的url地址 - * @config {Number} vars.mode mode == 0时,是使用滚动条,mode == 1时,拉伸flash, 默认值为0 - * @see baidu.swf.createHTML - * @param {String} backgroundUrl 背景图片路径 - * @param {String} listBacgroundkUrl 布局控件背景 - * @param {String} buttonUrl 按钮图片不背景 - * @param {String|Function} selectFileCallback 选择文件的回调 - * @param {String|Function} exceedFileCallback文件超出限制的最大体积时的回调 - * @param {String|Function} deleteFileCallback 删除文件的回调 - * @param {String|Function} startUploadCallback 开始上传某个文件时的回调 - * @param {String|Function} uploadCompleteCallback 某个文件上传完成的回调 - * @param {String|Function} uploadErrorCallback 某个文件上传失败的回调 - * @param {String|Function} allCompleteCallback 全部上传完成时的回调 - * @param {String|Function} changeFlashHeight 改变Flash的高度,mode==1的时候才有用 - */ -baidu.flash.imageUploader = baidu.flash.imageUploader || function(options){ - - var me = this, - options = options || {}, - _flash = new baidu.flash._Base(options, [ - 'selectFileCallback', - 'exceedFileCallback', - 'deleteFileCallback', - 'startUploadCallback', - 'uploadCompleteCallback', - 'uploadErrorCallback', - 'allCompleteCallback', - 'changeFlashHeight' - ]); - /** - * 开始或回复上传图片 - * @public - * @return {Null} - */ - me.upload = function(){ - _flash.call('upload'); - }; - - /** - * 暂停上传图片 - * @public - * @return {Null} - */ - me.pause = function(){ - _flash.call('pause'); - }; - me.addCustomizedParams = function(index,obj){ - _flash.call('addCustomizedParams',[index,obj]); - } -}; - -/** - * 操作原生对象的方法 - * @namespace baidu.object - */ -baidu.object = baidu.object || {}; - - -/** - * 将源对象的所有属性拷贝到目标对象中 - * @author erik - * @name baidu.object.extend - * @function - * @grammar baidu.object.extend(target, source) - * @param {Object} target 目标对象 - * @param {Object} source 源对象 - * @see baidu.array.merge - * @remark - * -1.目标对象中,与源对象key相同的成员将会被覆盖。
                      -2.源对象的prototype成员不会拷贝。 - - * @shortcut extend - * @meta standard - * - * @returns {Object} 目标对象 - */ -baidu.extend = -baidu.object.extend = function (target, source) { - for (var p in source) { - if (source.hasOwnProperty(p)) { - target[p] = source[p]; - } - } - - return target; -}; - - - - - -/** - * 创建flash based fileUploader - * @class - * @grammar baidu.flash.fileUploader(options) - * @param {Object} options - * @config {Object} createOptions 创建flash时需要的参数,请参照baidu.swf.create文档 - * @config {String} createOptions.width - * @config {String} createOptions.height - * @config {Number} maxNum 最大可选文件数 - * @config {Function|String} selectFile - * @config {Function|String} exceedMaxSize - * @config {Function|String} deleteFile - * @config {Function|String} uploadStart - * @config {Function|String} uploadComplete - * @config {Function|String} uploadError - * @config {Function|String} uploadProgress - */ -baidu.flash.fileUploader = baidu.flash.fileUploader || function(options){ - var me = this, - options = options || {}; - - options.createOptions = baidu.extend({ - wmod: 'transparent' - },options.createOptions || {}); - - var _flash = new baidu.flash._Base(options, [ - 'selectFile', - 'exceedMaxSize', - 'deleteFile', - 'uploadStart', - 'uploadComplete', - 'uploadError', - 'uploadProgress' - ]); - - _flash.call('setMaxNum', options.maxNum ? [options.maxNum] : [1]); - - /** - * 设置当鼠标移动到flash上时,是否变成手型 - * @public - * @param {Boolean} isCursor - * @return {Null} - */ - me.setHandCursor = function(isCursor){ - _flash.call('setHandCursor', [isCursor || false]); - }; - - /** - * 设置鼠标相应函数名 - * @param {String|Function} fun - */ - me.setMSFunName = function(fun){ - _flash.call('setMSFunName',[_flash.createFunName(fun)]); - }; - - /** - * 执行上传操作 - * @param {String} url 上传的url - * @param {String} fieldName 上传的表单字段名 - * @param {Object} postData 键值对,上传的POST数据 - * @param {Number|Array|null|-1} [index]上传的文件序列 - * Int值上传该文件 - * Array一次串行上传该序列文件 - * -1/null上传所有文件 - * @return {Null} - */ - me.upload = function(url, fieldName, postData, index){ - - if(typeof url !== 'string' || typeof fieldName !== 'string') return null; - if(typeof index === 'undefined') index = -1; - - _flash.call('upload', [url, fieldName, postData, index]); - }; - - /** - * 取消上传操作 - * @public - * @param {Number|-1} index - */ - me.cancel = function(index){ - if(typeof index === 'undefined') index = -1; - _flash.call('cancel', [index]); - }; - - /** - * 删除文件 - * @public - * @param {Number|Array} [index] 要删除的index,不传则全部删除 - * @param {Function} callBack - * */ - me.deleteFile = function(index, callBack){ - - var callBackAll = function(list){ - callBack && callBack(list); - }; - - if(typeof index === 'undefined'){ - _flash.call('deleteFilesAll', [], callBackAll); - return; - }; - - if(typeof index === 'Number') index = [index]; - index.sort(function(a,b){ - return b-a; - }); - baidu.each(index, function(item){ - _flash.call('deleteFileBy', item, callBackAll); - }); - }; - - /** - * 添加文件类型,支持macType - * @public - * @param {Object|Array[Object]} type {description:String, extention:String} - * @return {Null}; - */ - me.addFileType = function(type){ - var type = type || [[]]; - - if(type instanceof Array) type = [type]; - else type = [[type]]; - _flash.call('addFileTypes', type); - }; - - /** - * 设置文件类型,支持macType - * @public - * @param {Object|Array[Object]} type {description:String, extention:String} - * @return {Null}; - */ - me.setFileType = function(type){ - var type = type || [[]]; - - if(type instanceof Array) type = [type]; - else type = [[type]]; - _flash.call('setFileTypes', type); - }; - - /** - * 设置可选文件的数量限制 - * @public - * @param {Number} num - * @return {Null} - */ - me.setMaxNum = function(num){ - _flash.call('setMaxNum', [num]); - }; - - /** - * 设置可选文件大小限制,以兆M为单位 - * @public - * @param {Number} num,0为无限制 - * @return {Null} - */ - me.setMaxSize = function(num){ - _flash.call('setMaxSize', [num]); - }; - - /** - * @public - */ - me.getFileAll = function(callBack){ - _flash.call('getFileAll', [], callBack); - }; - - /** - * @public - * @param {Number} index - * @param {Function} [callBack] - */ - me.getFileByIndex = function(index, callBack){ - _flash.call('getFileByIndex', [], callBack); - }; - - /** - * @public - * @param {Number} index - * @param {function} [callBack] - */ - me.getStatusByIndex = function(index, callBack){ - _flash.call('getStatusByIndex', [], callBack); - }; -}; - -/** - * 使用动态script标签请求服务器资源,包括由服务器端的回调和浏览器端的回调 - * @namespace baidu.sio - */ -baidu.sio = baidu.sio || {}; - -/** - * - * @param {HTMLElement} src script节点 - * @param {String} url script节点的地址 - * @param {String} [charset] 编码 - */ -baidu.sio._createScriptTag = function(scr, url, charset){ - scr.setAttribute('type', 'text/javascript'); - charset && scr.setAttribute('charset', charset); - scr.setAttribute('src', url); - document.getElementsByTagName('head')[0].appendChild(scr); -}; - -/** - * 删除script的属性,再删除script标签,以解决修复内存泄漏的问题 - * - * @param {HTMLElement} src script节点 - */ -baidu.sio._removeScriptTag = function(scr){ - if (scr.clearAttributes) { - scr.clearAttributes(); - } else { - for (var attr in scr) { - if (scr.hasOwnProperty(attr)) { - delete scr[attr]; - } - } - } - if(scr && scr.parentNode){ - scr.parentNode.removeChild(scr); - } - scr = null; -}; - - -/** - * 通过script标签加载数据,加载完成由浏览器端触发回调 - * @name baidu.sio.callByBrowser - * @function - * @grammar baidu.sio.callByBrowser(url, opt_callback, opt_options) - * @param {string} url 加载数据的url - * @param {Function|string} opt_callback 数据加载结束时调用的函数或函数名 - * @param {Object} opt_options 其他可选项 - * @config {String} [charset] script的字符集 - * @config {Integer} [timeOut] 超时时间,超过这个时间将不再响应本请求,并触发onfailure函数 - * @config {Function} [onfailure] timeOut设定后才生效,到达超时时间时触发本函数 - * @remark - * 1、与callByServer不同,callback参数只支持Function类型,不支持string。 - * 2、如果请求了一个不存在的页面,callback函数在IE/opera下也会被调用,因此使用者需要在onsuccess函数中判断数据是否正确加载。 - * @meta standard - * @see baidu.sio.callByServer - */ -baidu.sio.callByBrowser = function (url, opt_callback, opt_options) { - var scr = document.createElement("SCRIPT"), - scriptLoaded = 0, - options = opt_options || {}, - charset = options['charset'], - callback = opt_callback || function(){}, - timeOut = options['timeOut'] || 0, - timer; - scr.onload = scr.onreadystatechange = function () { - if (scriptLoaded) { - return; - } - - var readyState = scr.readyState; - if ('undefined' == typeof readyState - || readyState == "loaded" - || readyState == "complete") { - scriptLoaded = 1; - try { - callback(); - clearTimeout(timer); - } finally { - scr.onload = scr.onreadystatechange = null; - baidu.sio._removeScriptTag(scr); - } - } - }; - - if( timeOut ){ - timer = setTimeout(function(){ - scr.onload = scr.onreadystatechange = null; - baidu.sio._removeScriptTag(scr); - options.onfailure && options.onfailure(); - }, timeOut); - } - - baidu.sio._createScriptTag(scr, url, charset); -}; - -/** - * 通过script标签加载数据,加载完成由服务器端触发回调 - * @name baidu.sio.callByServer - * @function - * @grammar baidu.sio.callByServer(url, callback[, opt_options]) - * @param {string} url 加载数据的url. - * @param {Function|string} callback 服务器端调用的函数或函数名。如果没有指定本参数,将在URL中寻找options['queryField']做为callback的方法名. - * @param {Object} opt_options 加载数据时的选项. - * @config {string} [charset] script的字符集 - * @config {string} [queryField] 服务器端callback请求字段名,默认为callback - * @config {Integer} [timeOut] 超时时间(单位:ms),超过这个时间将不再响应本请求,并触发onfailure函数 - * @config {Function} [onfailure] timeOut设定后才生效,到达超时时间时触发本函数 - * @remark - * 如果url中已经包含key为“options['queryField']”的query项,将会被替换成callback中参数传递或自动生成的函数名。 - * @meta standard - * @see baidu.sio.callByBrowser - */ -baidu.sio.callByServer = /**@function*/function(url, callback, opt_options) { - var scr = document.createElement('SCRIPT'), - prefix = 'bd__cbs__', - callbackName, - callbackImpl, - options = opt_options || {}, - charset = options['charset'], - queryField = options['queryField'] || 'callback', - timeOut = options['timeOut'] || 0, - timer, - reg = new RegExp('(\\?|&)' + queryField + '=([^&]*)'), - matches; - - if (baidu.lang.isFunction(callback)) { - callbackName = prefix + Math.floor(Math.random() * 2147483648).toString(36); - window[callbackName] = getCallBack(0); - } else if(baidu.lang.isString(callback)){ - callbackName = callback; - } else { - if (matches = reg.exec(url)) { - callbackName = matches[2]; - } - } - - if( timeOut ){ - timer = setTimeout(getCallBack(1), timeOut); - } - url = url.replace(reg, '\x241' + queryField + '=' + callbackName); - - if (url.search(reg) < 0) { - url += (url.indexOf('?') < 0 ? '?' : '&') + queryField + '=' + callbackName; - } - baidu.sio._createScriptTag(scr, url, charset); - - /* - * 返回一个函数,用于立即(挂在window上)或者超时(挂在setTimeout中)时执行 - */ - function getCallBack(onTimeOut){ - /*global callbackName, callback, scr, options;*/ - return function(){ - try { - if( onTimeOut ){ - options.onfailure && options.onfailure(); - }else{ - callback.apply(window, arguments); - clearTimeout(timer); - } - window[callbackName] = null; - delete window[callbackName]; - } catch (exception) { - } finally { - baidu.sio._removeScriptTag(scr); - } - } - } -}; - -/** - * 通过请求一个图片的方式令服务器存储一条日志 - * @function - * @grammar baidu.sio.log(url) - * @param {string} url 要发送的地址. - * @author: int08h,leeight - */ -baidu.sio.log = function(url) { - var img = new Image(), - key = 'tangram_sio_log_' + Math.floor(Math.random() * - 2147483648).toString(36); - window[key] = img; - - img.onload = img.onerror = img.onabort = function() { - img.onload = img.onerror = img.onabort = null; - - window[key] = null; - img = null; - }; - img.src = url; -}; - - - -/* - * Tangram - * Copyright 2009 Baidu Inc. All rights reserved. - * - * path: baidu/json.js - * author: erik - * version: 1.1.0 - * date: 2009/12/02 - */ - - -/** - * 操作json对象的方法 - * @namespace baidu.json - */ -baidu.json = baidu.json || {}; -/* - * Tangram - * Copyright 2009 Baidu Inc. All rights reserved. - * - * path: baidu/json/parse.js - * author: erik, berg - * version: 1.2 - * date: 2009/11/23 - */ - - - -/** - * 将字符串解析成json对象。注:不会自动祛除空格 - * @name baidu.json.parse - * @function - * @grammar baidu.json.parse(data) - * @param {string} source 需要解析的字符串 - * @remark - * 该方法的实现与ecma-262第五版中规定的JSON.parse不同,暂时只支持传入一个参数。后续会进行功能丰富。 - * @meta standard - * @see baidu.json.stringify,baidu.json.decode - * - * @returns {JSON} 解析结果json对象 - */ -baidu.json.parse = function (data) { - //2010/12/09:更新至不使用原生parse,不检测用户输入是否正确 - return (new Function("return (" + data + ")"))(); -}; -/* - * Tangram - * Copyright 2009 Baidu Inc. All rights reserved. - * - * path: baidu/json/decode.js - * author: erik, cat - * version: 1.3.4 - * date: 2010/12/23 - */ - - - -/** - * 将字符串解析成json对象,为过时接口,今后会被baidu.json.parse代替 - * @name baidu.json.decode - * @function - * @grammar baidu.json.decode(source) - * @param {string} source 需要解析的字符串 - * @meta out - * @see baidu.json.encode,baidu.json.parse - * - * @returns {JSON} 解析结果json对象 - */ -baidu.json.decode = baidu.json.parse; -/* - * Tangram - * Copyright 2009 Baidu Inc. All rights reserved. - * - * path: baidu/json/stringify.js - * author: erik - * version: 1.1.0 - * date: 2010/01/11 - */ - - - -/** - * 将json对象序列化 - * @name baidu.json.stringify - * @function - * @grammar baidu.json.stringify(value) - * @param {JSON} value 需要序列化的json对象 - * @remark - * 该方法的实现与ecma-262第五版中规定的JSON.stringify不同,暂时只支持传入一个参数。后续会进行功能丰富。 - * @meta standard - * @see baidu.json.parse,baidu.json.encode - * - * @returns {string} 序列化后的字符串 - */ -baidu.json.stringify = (function () { - /** - * 字符串处理时需要转义的字符表 - * @private - */ - var escapeMap = { - "\b": '\\b', - "\t": '\\t', - "\n": '\\n', - "\f": '\\f', - "\r": '\\r', - '"' : '\\"', - "\\": '\\\\' - }; - - /** - * 字符串序列化 - * @private - */ - function encodeString(source) { - if (/["\\\x00-\x1f]/.test(source)) { - source = source.replace( - /["\\\x00-\x1f]/g, - function (match) { - var c = escapeMap[match]; - if (c) { - return c; - } - c = match.charCodeAt(); - return "\\u00" - + Math.floor(c / 16).toString(16) - + (c % 16).toString(16); - }); - } - return '"' + source + '"'; - } - - /** - * 数组序列化 - * @private - */ - function encodeArray(source) { - var result = ["["], - l = source.length, - preComma, i, item; - - for (i = 0; i < l; i++) { - item = source[i]; - - switch (typeof item) { - case "undefined": - case "function": - case "unknown": - break; - default: - if(preComma) { - result.push(','); - } - result.push(baidu.json.stringify(item)); - preComma = 1; - } - } - result.push("]"); - return result.join(""); - } - - /** - * 处理日期序列化时的补零 - * @private - */ - function pad(source) { - return source < 10 ? '0' + source : source; - } - - /** - * 日期序列化 - * @private - */ - function encodeDate(source){ - return '"' + source.getFullYear() + "-" - + pad(source.getMonth() + 1) + "-" - + pad(source.getDate()) + "T" - + pad(source.getHours()) + ":" - + pad(source.getMinutes()) + ":" - + pad(source.getSeconds()) + '"'; - } - - return function (value) { - switch (typeof value) { - case 'undefined': - return 'undefined'; - - case 'number': - return isFinite(value) ? String(value) : "null"; - - case 'string': - return encodeString(value); - - case 'boolean': - return String(value); - - default: - if (value === null) { - return 'null'; - } else if (value instanceof Array) { - return encodeArray(value); - } else if (value instanceof Date) { - return encodeDate(value); - } else { - var result = ['{'], - encode = baidu.json.stringify, - preComma, - item; - - for (var key in value) { - if (Object.prototype.hasOwnProperty.call(value, key)) { - item = value[key]; - switch (typeof item) { - case 'undefined': - case 'unknown': - case 'function': - break; - default: - if (preComma) { - result.push(','); - } - preComma = 1; - result.push(encode(key) + ':' + encode(item)); - } - } - } - result.push('}'); - return result.join(''); - } - } - }; -})(); -/* - * Tangram - * Copyright 2009 Baidu Inc. All rights reserved. - * - * path: baidu/json/encode.js - * author: erik, cat - * version: 1.3.4 - * date: 2010/12/23 - */ - - - -/** - * 将json对象序列化,为过时接口,今后会被baidu.json.stringify代替 - * @name baidu.json.encode - * @function - * @grammar baidu.json.encode(value) - * @param {JSON} value 需要序列化的json对象 - * @meta out - * @see baidu.json.decode,baidu.json.stringify - * - * @returns {string} 序列化后的字符串 - */ -baidu.json.encode = baidu.json.stringify; diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/wordimage.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/wordimage.html deleted file mode 100644 index 670db71eb09d969c2ff17b02ee9793a80dbd828d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/wordimage.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - -
                      -
                      - -
                      -
                      -
                      -
                      -
                      - -
                      - : -
                      -
                      -
                      - - - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/wordimage.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/wordimage.js deleted file mode 100644 index b3a075de8020ed131c8f4259f41e68393461439c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/dialogs/wordimage/wordimage.js +++ /dev/null @@ -1,157 +0,0 @@ -/** - * Created by JetBrains PhpStorm. - * User: taoqili - * Date: 12-1-30 - * Time: 下午12:50 - * To change this template use File | Settings | File Templates. - */ - - - -var wordImage = {}; -//(function(){ -var g = baidu.g, - flashObj,flashContainer; - -wordImage.init = function(opt, callbacks) { - showLocalPath("localPath"); - //createCopyButton("clipboard","localPath"); - createFlashUploader(opt, callbacks); - addUploadListener(); - addOkListener(); -}; - -function hideFlash(){ - flashObj = null; - flashContainer.innerHTML = ""; -} -function addOkListener() { - dialog.onok = function() { - if (!imageUrls.length) return; - var urlPrefix = editor.getOpt('imageUrlPrefix'), - images = domUtils.getElementsByTagName(editor.document,"img"); - editor.fireEvent('saveScene'); - for (var i = 0,img; img = images[i++];) { - var src = img.getAttribute("word_img"); - if (!src) continue; - for (var j = 0,url; url = imageUrls[j++];) { - if (src.indexOf(url.original.replace(" ","")) != -1) { - img.src = urlPrefix + url.url; - img.setAttribute("_src", urlPrefix + url.url); //同时修改"_src"属性 - img.setAttribute("title",url.title); - domUtils.removeAttributes(img, ["word_img","style","width","height"]); - editor.fireEvent("selectionchange"); - break; - } - } - } - editor.fireEvent('saveScene'); - hideFlash(); - }; - dialog.oncancel = function(){ - hideFlash(); - } -} - -/** - * 绑定开始上传事件 - */ -function addUploadListener() { - g("upload").onclick = function () { - flashObj.upload(); - this.style.display = "none"; - }; -} - -function showLocalPath(id) { - //单张编辑 - var img = editor.selection.getRange().getClosedNode(); - var images = editor.execCommand('wordimage'); - if(images.length==1 || img && img.tagName == 'IMG'){ - g(id).value = images[0]; - return; - } - var path = images[0]; - var leftSlashIndex = path.lastIndexOf("/")||0, //不同版本的doc和浏览器都可能影响到这个符号,故直接判断两种 - rightSlashIndex = path.lastIndexOf("\\")||0, - separater = leftSlashIndex > rightSlashIndex ? "/":"\\" ; - - path = path.substring(0, path.lastIndexOf(separater)+1); - g(id).value = path; -} - -function createFlashUploader(opt, callbacks) { - //由于lang.flashI18n是静态属性,不可以直接进行修改,否则会影响到后续内容 - var i18n = utils.extend({},lang.flashI18n); - //处理图片资源地址的编码,补全等问题 - for(var i in i18n){ - if(!(i in {"lang":1,"uploadingTF":1,"imageTF":1,"textEncoding":1}) && i18n[i]){ - i18n[i] = encodeURIComponent(editor.options.langPath + editor.options.lang + "/images/" + i18n[i]); - } - } - opt = utils.extend(opt,i18n,false); - var option = { - createOptions:{ - id:'flash', - url:opt.flashUrl, - width:opt.width, - height:opt.height, - errorMessage:lang.flashError, - wmode:browser.safari ? 'transparent' : 'window', - ver:'10.0.0', - vars:opt, - container:opt.container - } - }; - - option = extendProperty(callbacks, option); - flashObj = new baidu.flash.imageUploader(option); - flashContainer = $G(opt.container); -} - -function extendProperty(fromObj, toObj) { - for (var i in fromObj) { - if (!toObj[i]) { - toObj[i] = fromObj[i]; - } - } - return toObj; -} - -//})(); - -function getPasteData(id) { - baidu.g("msg").innerHTML = lang.copySuccess + "
                      "; - setTimeout(function() { - baidu.g("msg").innerHTML = ""; - }, 5000); - return baidu.g(id).value; -} - -function createCopyButton(id, dataFrom) { - baidu.swf.create({ - id:"copyFlash", - url:"fClipboard_neditor.swf", - width:"58", - height:"25", - errorMessage:"", - bgColor:"#CBCBCB", - wmode:"transparent", - ver:"10.0.0", - vars:{ - tid:dataFrom - } - }, id - ); - - var clipboard = baidu.swf.getMovie("copyFlash"); - var clipinterval = setInterval(function() { - if (clipboard && clipboard.flashInit) { - clearInterval(clipinterval); - clipboard.setHandCursor(true); - clipboard.setContentFuncName("getPasteData"); - //clipboard.setMEFuncName("mouseEventHandler"); - } - }, 500); -} -createCopyButton("clipboard", "localPath"); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/en.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/en.js deleted file mode 100644 index 0ccead18c631aa8eb482827b63ba957429bc0527..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/en.js +++ /dev/null @@ -1,684 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: taoqili - * Date: 12-6-12 - * Time: 下午6:57 - * To change this template use File | Settings | File Templates. - */ -UE.I18N['en'] = { - 'labelMap':{ - 'anchor':'Anchor', 'undo':'Undo', 'redo':'Redo', 'bold':'Bold', 'indent':'Indent', 'snapscreen':'SnapScreen', - 'italic':'Italic', 'underline':'Underline', 'strikethrough':'Strikethrough', 'subscript':'SubScript','fontborder':'text border', - 'superscript':'SuperScript', 'formatmatch':'Format Match', 'source':'Source', 'blockquote':'BlockQuote', - 'pasteplain':'PastePlain', 'selectall':'SelectAll', 'print':'Print', 'preview':'Preview', - 'horizontal':'Horizontal', 'removeformat':'RemoveFormat', 'time':'Time', 'date':'Date', - 'unlink':'Unlink', 'insertrow':'InsertRow', 'insertcol':'InsertCol', 'mergeright':'MergeRight', 'mergedown':'MergeDown', - 'deleterow':'DeleteRow', 'deletecol':'DeleteCol', 'splittorows':'SplitToRows','insertcode':'insert code', - 'splittocols':'SplitToCols', 'splittocells':'SplitToCells','deletecaption':'DeleteCaption','inserttitle':'InsertTitle', - 'mergecells':'MergeCells', 'deletetable':'DeleteTable', 'cleardoc':'Clear', 'insertparagraphbeforetable':"InsertParagraphBeforeTable", - 'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph','simpleupload':'Single Image','insertimage':'Multi Image','edittable':'Edit Table', 'edittd':'Edit Td','link':'Link', - 'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap', - 'insertvideo':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter', - 'justifyjustify':'Justify', 'forecolor':'FontColor', 'backcolor':'BackColor', 'insertorderedlist':'OL', - 'insertunorderedlist':'UL', 'fullscreen':'FullScreen', 'directionalityltr':'EnterFromLeft', 'directionalityrtl':'EnterFromRight', - 'rowspacingtop':'RowSpacingTop', 'rowspacingbottom':'RowSpacingBottom', 'pagebreak':'PageBreak', 'insertframe':'Iframe', 'imagenone':'Default', - 'imageleft':'ImageLeft', 'imageright':'ImageRight', 'attachment':'Attachment', 'imagecenter':'ImageCenter', 'wordimage':'WordImage', - 'lineheight':'LineHeight','edittip':'EditTip','customstyle':'CustomStyle', 'scrawl':'Scrawl', 'autotypeset':'AutoTypeset', - 'webapp':'WebAPP', 'touppercase':'UpperCase', 'tolowercase':'LowerCase','template':'Template','background':'Background','inserttable':'InsertTable', - 'music':'Music', 'charts': 'charts','drafts': 'Load from Drafts' - }, - 'insertorderedlist':{ - 'num':'1,2,3...', - 'num1':'1),2),3)...', - 'num2':'(1),(2),(3)...', - 'cn':'一,二,三....', - 'cn1':'一),二),三)....', - 'cn2':'(一),(二),(三)....', - 'decimal':'1,2,3...', - 'lower-alpha':'a,b,c...', - 'lower-roman':'i,ii,iii...', - 'upper-alpha':'A,B,C...', - 'upper-roman':'I,II,III...' - }, - 'insertunorderedlist':{ - 'circle':'○ Circle', - 'disc':'● Circle dot', - 'square':'■ Rectangle ', - 'dash' :'- Dash', - 'dot' : '。dot' - }, - 'paragraph':{'p':'Paragraph', 'h1':'Title 1', 'h2':'Title 2', 'h3':'Title 3', 'h4':'Title 4', 'h5':'Title 5', 'h6':'Title 6'}, - 'fontfamily':{ - 'songti':'Sim Sun', - 'kaiti':'Sim Kai', - 'heiti':'Sim Hei', - 'lishu':'Sim Li', - 'yahei': 'Microsoft YaHei', - 'andaleMono':'Andale Mono', - 'arial': 'Arial', - 'arialBlack':'Arial Black', - 'comicSansMs':'Comic Sans MS', - 'impact':'Impact', - 'timesNewRoman':'Times New Roman' - }, - 'customstyle':{ - 'tc':'Title center', - 'tl':'Title left', - 'im':'Important', - 'hi':'Highlight' - }, - 'autoupload': { - 'exceedSizeError': 'File Size Exceed', - 'exceedTypeError': 'File Type Not Allow', - 'jsonEncodeError': 'Server Return Format Error', - 'loading':"loading...", - 'loadError':"load error", - 'errorLoadConfig': 'Server config not loaded, upload can not work.', - }, - 'simpleupload':{ - 'exceedSizeError': 'File Size Exceed', - 'exceedTypeError': 'File Type Not Allow', - 'jsonEncodeError': 'Server Return Format Error', - 'loading':"loading...", - 'loadError':"load error", - 'errorLoadConfig': 'Server config not loaded, upload can not work.', - }, - 'elementPathTip':"Path", - 'wordCountTip':"Word Count", - 'wordCountMsg':'{#count} characters entered,{#leave} left. ', - 'wordOverFlowMsg':'The number of characters has exceeded allowable maximum values, the server may refuse to save!', - 'ok':"OK", - 'cancel':"Cancel", - 'closeDialog':"closeDialog", - 'tableDrag':"You must import the file uiUtils.js before drag! ", - 'autofloatMsg':"The plugin AutoFloat depends on EditorUI!", - 'loadconfigError': 'Get server config error.', - 'loadconfigFormatError': 'Server config format error.', - 'loadconfigHttpError': 'Get server config http error.', - 'snapScreen_plugin':{ - 'browserMsg':"Only IE supported!", - 'callBackErrorMsg':"The callback data is wrong,please check the config!", - 'uploadErrorMsg':"Upload error,please check your server environment! " - }, - 'insertcode':{ - 'as3':'ActionScript 3', - 'bash':'Bash/Shell', - 'cpp':'C/C++', - 'css':'CSS', - 'cf':'ColdFusion', - 'c#':'C#', - 'delphi':'Delphi', - 'diff':'Diff', - 'erlang':'Erlang', - 'groovy':'Groovy', - 'html':'HTML', - 'java':'Java', - 'jfx':'JavaFX', - 'js':'JavaScript', - 'pl':'Perl', - 'php':'PHP', - 'plain':'Plain Text', - 'ps':'PowerShell', - 'python':'Python', - 'ruby':'Ruby', - 'scala':'Scala', - 'sql':'SQL', - 'vb':'Visual Basic', - 'xml':'XML' - }, - 'confirmClear':"Do you confirm to clear the Document?", - 'contextMenu':{ - 'delete':"Delete", - 'selectall':"Select all", - 'deletecode':"Delete Code", - 'cleardoc':"Clear Document", - 'confirmclear':"Do you confirm to clear the Document?", - 'unlink':"Unlink", - 'paragraph':"Paragraph", - 'edittable':"Table property", - 'aligncell':'Align cell', - 'aligntable':'Table alignment', - 'tableleft':'Left float', - 'tablecenter':'Center', - 'tableright':'Right float', - 'aligntd':'Cell alignment', - 'edittd':"Cell property", - 'setbordervisible':'set table edge visible', - 'table':"Table", - 'justifyleft':'Justify Left', - 'justifyright':'Justify Right', - 'justifycenter':'Justify Center', - 'justifyjustify':'Default', - 'deletetable':"Delete table", - 'insertparagraphbefore':"InsertedBeforeLine", - 'insertparagraphafter':'InsertedAfterLine', - 'inserttable':'Insert table', - 'insertcaption':'Insert caption', - 'deletecaption':'Delete Caption', - 'inserttitle':'Insert Title', - 'deletetitle':'Delete Title', - 'inserttitlecol':'Insert Title Col', - 'deletetitlecol':'Delete Title Col', - 'averageDiseRow':'AverageDise Row', - 'averageDisCol':'AverageDis Col', - 'deleterow':"Delete row", - 'deletecol':"Delete col", - 'insertrow':"Insert row", - 'insertcol':"Insert col", - 'insertrownext':'Insert Row Next', - 'insertcolnext':'Insert Col Next', - 'mergeright':"Merge right", - 'mergeleft':"Merge left", - 'mergedown':"Merge down", - 'mergecells':"Merge cells", - 'splittocells':"Split to cells", - 'splittocols':"Split to Cols", - 'splittorows':"Split to Rows", - 'tablesort':'Table sorting', - 'enablesort':'Sorting Enable', - 'disablesort':'Sorting Disable', - 'reversecurrent':'Reverse current', - 'orderbyasc':'Order By ASCII', - 'reversebyasc':'Reverse By ASCII', - 'orderbynum':'Order By Num', - 'reversebynum':'Reverse By Num', - 'borderbk':'Border shading', - 'setcolor':'interlaced color', - 'unsetcolor':'Cancel interlacedcolor', - 'setbackground':'Background interlaced', - 'unsetbackground':'Cancel Bk interlaced', - 'redandblue':'Blue and red', - 'threecolorgradient':'Three-color gradient', - 'copy':"Copy(Ctrl + c)", - 'copymsg':"Browser does not support. Please use 'Ctrl + c' instead!", - 'paste':"Paste(Ctrl + v)", - 'pastemsg':"Browser does not support. Please use 'Ctrl + v' instead!" - }, - 'copymsg': "Browser does not support. Please use 'Ctrl + c' instead!", - 'pastemsg': "Browser does not support. Please use 'Ctrl + v' instead!", - 'anthorMsg':"Link", - 'clearColor':'Clear', - 'standardColor':'Standard color', - 'themeColor':'Theme color', - 'property':'Property', - 'default':'Default', - 'modify':'Modify', - 'justifyleft':'Justify Left', - 'justifyright':'Justify Right', - 'justifycenter':'Justify Center', - 'justify':'Default', - 'clear':'Clear', - 'anchorMsg':'Anchor', - 'delete':'Delete', - 'clickToUpload':"Click to upload", - 'unset':'Language hasn\'t been set!', - 't_row':'row', - 't_col':'col', - 'pasteOpt':'Paste Option', - 'pasteSourceFormat':"Keep Source Formatting", - 'tagFormat':'Keep tag', - 'pasteTextFormat':'Keep Text only', - 'more':'More', - 'autoTypeSet':{ - 'mergeLine':"Merge empty line", - 'delLine':"Del empty line", - 'removeFormat':"Remove format", - 'indent':"Indent", - 'alignment':"Alignment", - 'imageFloat':"Image float", - 'removeFontsize':"Remove font size", - 'removeFontFamily':"Remove fontFamily", - 'removeHtml':"Remove redundant HTML code", - 'pasteFilter':"Paste filter", - 'run':"Done", - 'symbol':'Symbol Conversion', - 'bdc2sb':'Full-width to Half-width', - 'tobdc':'Half-width to Full-width' - }, - - 'background':{ - 'static':{ - 'lang_background_normal':'Normal', - 'lang_background_local':'Online', - 'lang_background_set':'Background Set', - 'lang_background_none':'No Background', - 'lang_background_colored':'Colored Background', - 'lang_background_color':'Color Set', - 'lang_background_netimg':'Net-Image', - 'lang_background_align':'Align Type', - 'lang_background_position':'Position', - 'repeatType':{'options':["Center", "Repeat-x", "Repeat-y", "Tile","Custom"]} - }, - 'noUploadImage':"No pictures has been uploaded!", - 'toggleSelect':'Change the active state by click!\n Image Size: ' - }, - //===============dialog i18N======================= - 'insertimage':{ - 'static':{ - 'lang_tab_remote':"Insert", - 'lang_tab_upload':"Local", - 'lang_tab_online':"Manager", - 'lang_tab_search':"Search", - 'lang_input_url':"Address:", - 'lang_input_size':"Size:", - 'lang_input_width':"Width", - 'lang_input_height':"Height", - 'lang_input_border':"Border:", - 'lang_input_vhspace':"Margins:", - 'lang_input_title':"Title:", - 'lang_input_align':'Image Float Style:', - 'lang_imgLoading':"Loading...", - 'lang_start_upload':"Start Upload", - 'lock':{'title':"Lock rate"}, - 'searchType':{'title':"ImageType", 'options':["All", "Avatar", "Facial", "Cartoon", "StickFigure", "GIF", "StaticImage"]}, - 'searchTxt':{'value':"Enter the search keyword!"}, - 'searchBtn':{'value':"Search"}, - 'searchReset':{'value':"Clear"}, - 'noneAlign':{'title':'None Float'}, - 'leftAlign':{'title':'Left Float'}, - 'rightAlign':{'title':'Right Float'}, - 'centerAlign':{'title':'Center In A Line'} - }, - 'uploadSelectFile':'Select File', - 'uploadAddFile':'Add File', - 'uploadStart':'Start Upload', - 'uploadPause':'Pause Upload', - 'uploadContinue':'Continue Upload', - 'uploadRetry':'Retry Upload', - 'uploadDelete':'Delete', - 'uploadTurnLeft':'Turn Left', - 'uploadTurnRight':'Turn Right', - 'uploadPreview':'Doing Preview', - 'uploadNoPreview':'Can Not Preview', - 'updateStatusReady': 'Selected _ pictures, total _KB.', - 'updateStatusConfirm': '_ uploaded successfully and _ upload failed', - 'updateStatusFinish': 'Total _ pictures (_KB), _ uploaded successfully', - 'updateStatusError': ' and _ upload failed', - 'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', - 'errorLoadConfig': 'Server config not loaded, upload can not work.', - 'errorExceedSize':'File Size Exceed', - 'errorFileType':'File Type Not Allow', - 'errorInterrupt':'File Upload Interrupted', - 'errorUploadRetry':'Upload Error, Please Retry.', - 'errorHttp':'Http Error', - 'errorServerUpload':'Server Result Error.', - 'remoteLockError':"Cannot Lock the Proportion between width and height", - 'numError':"Please enter the correct Num. e.g 123,400", - 'imageUrlError':"The image format may be wrong!", - 'imageLoadError':"Error,please check the network or URL!", - 'searchRemind':"Enter the search keyword!", - 'searchLoading':"Image is loading,please wait...", - 'searchRetry':" Sorry,can't find the image,please try again!" - }, - 'attachment':{ - 'static':{ - 'lang_tab_upload': 'Upload', - 'lang_tab_online': 'Online', - 'lang_start_upload':"Start upload", - 'lang_drop_remind':"You can drop files here, a single maximum of 300 files" - }, - 'uploadSelectFile':'Select File', - 'uploadAddFile':'Add File', - 'uploadStart':'Start Upload', - 'uploadPause':'Pause Upload', - 'uploadContinue':'Continue Upload', - 'uploadRetry':'Retry Upload', - 'uploadDelete':'Delete', - 'uploadTurnLeft':'Turn Left', - 'uploadTurnRight':'Turn Right', - 'uploadPreview':'Doing Preview', - 'updateStatusReady': 'Selected _ files, total _KB.', - 'updateStatusConfirm': '_ uploaded successfully and _ upload failed', - 'updateStatusFinish': 'Total _ files (_KB), _ uploaded successfully', - 'updateStatusError': ' and _ upload failed', - 'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', - 'errorLoadConfig': 'Server config not loaded, upload can not work.', - 'errorExceedSize':'File Size Exceed', - 'errorFileType':'File Type Not Allow', - 'errorInterrupt':'File Upload Interrupted', - 'errorUploadRetry':'Upload Error, Please Retry.', - 'errorHttp':'Http Error', - 'errorServerUpload':'Server Result Error.' - }, - - 'insertvideo':{ - 'static':{ - 'lang_tab_insertV':"Video", - 'lang_tab_searchV':"Search", - 'lang_tab_uploadV':"Upload", - 'lang_video_url':" URL ", - 'lang_video_size':"Video Size", - 'lang_videoW':"Width", - 'lang_videoH':"Height", - 'lang_alignment':"Alignment", - 'videoSearchTxt':{'value':"Enter the search keyword!"}, - 'videoType':{'options':["All", "Hot", "Entertainment", "Funny", "Sports", "Science", "variety"]}, - 'videoSearchBtn':{'value':"Search in Baidu"}, - 'videoSearchReset':{'value':"Clear result"}, - - 'lang_input_fileStatus':' No file uploaded!', - 'startUpload':{'style':"background:url(upload.png) no-repeat;"}, - - 'lang_upload_size':"Video Size", - 'lang_upload_width':"Width", - 'lang_upload_height':"Height", - 'lang_upload_alignment':"Alignment", - 'lang_format_advice':"Recommends mp4 format." - }, - 'numError':"Please enter the correct Num. e.g 123,400", - 'floatLeft':"Float left", - 'floatRight':"Float right", - 'default':"Default", - 'block':"Display in block", - 'urlError':"The video url format may be wrong!", - 'loading':"  The video is loading, please wait…", - 'clickToSelect':"Click to select", - 'goToSource':'Visit source video ', - 'noVideo':"    Sorry,can't find the video,please try again!", - - 'browseFiles':'Open files', - 'uploadSuccess':'Upload Successful!', - 'delSuccessFile':'Remove from the success of the queue', - 'delFailSaveFile':'Remove the save failed file', - 'statusPrompt':' file(s) uploaded! ', - 'flashVersionError':'The current Flash version is too low, please update FlashPlayer,then try again!', - 'flashLoadingError':'The Flash failed loading! Please check the path or network state', - 'fileUploadReady':'Wait for uploading...', - 'delUploadQueue':'Remove from the uploading queue ', - 'limitPrompt1':'Can not choose more than single', - 'limitPrompt2':'file(s)!Please choose again!', - 'delFailFile':'Remove failure file', - 'fileSizeLimit':'File size exceeds the limit!', - 'emptyFile':'Can not upload an empty file!', - 'fileTypeError':'File type error!', - 'unknownError':'Unknown error!', - 'fileUploading':'Uploading,please wait...', - 'cancelUpload':'Cancel upload', - 'netError':'Network error', - 'failUpload':'Upload failed', - 'serverIOError':'Server IO error!', - 'noAuthority':'No Permission!', - 'fileNumLimit':'Upload limit to the number', - 'failCheck':'Authentication fails, the upload is skipped!', - 'fileCanceling':'Cancel, please wait...', - 'stopUploading':'Upload has stopped...', - - 'uploadSelectFile':'Select File', - 'uploadAddFile':'Add File', - 'uploadStart':'Start Upload', - 'uploadPause':'Pause Upload', - 'uploadContinue':'Continue Upload', - 'uploadRetry':'Retry Upload', - 'uploadDelete':'Delete', - 'uploadTurnLeft':'Turn Left', - 'uploadTurnRight':'Turn Right', - 'uploadPreview':'Doing Preview', - 'updateStatusReady': 'Selected _ files, total _KB.', - 'updateStatusConfirm': '_ uploaded successfully and _ upload failed', - 'updateStatusFinish': 'Total _ files (_KB), _ uploaded successfully', - 'updateStatusError': ' and _ upload failed', - 'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', - 'errorLoadConfig': 'Server config not loaded, upload can not work.', - 'errorExceedSize':'File Size Exceed', - 'errorFileType':'File Type Not Allow', - 'errorInterrupt':'File Upload Interrupted', - 'errorUploadRetry':'Upload Error, Please Retry.', - 'errorHttp':'Http Error', - 'errorServerUpload':'Server Result Error.' - }, - 'webapp':{ - 'tip1':"This function provided by Baidu APP,please apply for baidu APPKey webmaster first!", - 'tip2':"And then open the file neditor.config.js to set it! ", - 'applyFor':"APPLY FOR", - 'anthorApi':"Baidu API" - }, - 'template':{ - 'static':{ - 'lang_template_bkcolor':'Background Color', - 'lang_template_clear' : 'Keep Content', - 'lang_template_select':'Select Template' - }, - 'blank':"Blank", - 'blog':"Blog", - 'resume':"Resume", - 'richText':"Rich Text", - 'scrPapers':"Scientific Papers" - }, - scrawl:{ - 'static':{ - 'lang_input_previousStep':"Previous", - 'lang_input_nextsStep':"Next", - 'lang_input_clear':'Clear', - 'lang_input_addPic':'AddImage', - 'lang_input_ScalePic':'ScaleImage', - 'lang_input_removePic':'RemoveImage', - 'J_imgTxt':{title:'Add background image'} - }, - 'noScarwl':"No paint, a white paper...", - 'scrawlUpLoading':"Image is uploading, please wait...", - 'continueBtn':"Try again", - 'imageError':"Image failed to load!", - 'backgroundUploading':'Image is uploading,please wait...' - }, - 'music':{ - 'static':{ - 'lang_input_tips':"Input singer/song/album, search you interested in music!", - 'J_searchBtn':{value:'Search songs'} - }, - 'emptyTxt':'Not search to the relevant music results, please change a keyword try.', - 'chapter':'Songs', - 'singer':'Singer', - 'special':'Album', - 'listenTest':'Audition' - }, - anchor:{ - 'static':{ - 'lang_input_anchorName':'Anchor Name:' - } - }, - 'charts':{ - 'static':{ - 'lang_data_source':'Data source:', - 'lang_chart_format': 'Chart format:', - 'lang_data_align': 'Align', - 'lang_chart_align_same': 'Consistent with the X-axis Y-axis', - 'lang_chart_align_reverse': 'X-axis Y-axis opposite', - 'lang_chart_title': 'Title', - 'lang_chart_main_title': 'main title:', - 'lang_chart_sub_title': 'sub title:', - 'lang_chart_x_title': 'X-axis title:', - 'lang_chart_y_title': 'Y-axis title:', - 'lang_chart_tip': 'Prompt', - 'lang_cahrt_tip_prefix': 'prefix:', - 'lang_cahrt_tip_description': '仅饼图有效, 当鼠标移动到饼图中相应的块上时,提示框内的文字的前缀', - 'lang_chart_data_unit': 'Unit', - 'lang_chart_data_unit_title': 'unit:', - 'lang_chart_data_unit_description': '显示在每个数据点上的数据的单位, 比如: 温度的单位 ℃', - 'lang_chart_type': 'Chart type:', - 'lang_prev_btn': 'Previous', - 'lang_next_btn': 'Next' - } - }, - emotion:{ - 'static':{ - 'lang_input_choice':'Choice', - 'lang_input_Tuzki':'Tuzki', - 'lang_input_lvdouwa':'LvDouWa', - 'lang_input_BOBO':'BOBO', - 'lang_input_babyCat':'BabyCat', - 'lang_input_bubble':'Bubble', - 'lang_input_youa':'YouA' - } - }, - gmap:{ - 'static':{ - 'lang_input_address':'Address:', - 'lang_input_search':'Search', - 'address':{value:"Beijing"} - }, - searchError:'Unable to locate the address!' - }, - help:{ - 'static':{ - 'lang_input_about':'About', - 'lang_input_shortcuts':'Shortcuts', - 'lang_input_introduction':"UEditor is developed by Baidu Co.ltd. It is lightweight, customizable , focusing on user experience and etc. , UEditor is based on open source BSD license , allowing free use and redistribution.", - 'lang_Txt_shortcuts':'Shortcuts', - 'lang_Txt_func':'Function', - 'lang_Txt_bold':'Bold', - 'lang_Txt_copy':'Copy', - 'lang_Txt_cut':'Cut', - 'lang_Txt_Paste':'Paste', - 'lang_Txt_undo':'Undo', - 'lang_Txt_redo':'Redo', - 'lang_Txt_italic':'Italic', - 'lang_Txt_underline':'Underline', - 'lang_Txt_selectAll':'Select All', - 'lang_Txt_visualEnter':'Submit', - 'lang_Txt_fullscreen':'Fullscreen' - } - }, - insertframe:{ - 'static':{ - 'lang_input_address':'Address:', - 'lang_input_width':'Width:', - 'lang_input_height':'height:', - 'lang_input_isScroll':'Enable scrollbars:', - 'lang_input_frameborder':'Show frame border:', - 'lang_input_alignMode':'Alignment:', - 'align':{title:"Alignment", options:["Default", "Left", "Right", "Center"]} - }, - 'enterAddress':'Please enter an address!' - }, - link:{ - 'static':{ - 'lang_input_text':'Text:', - 'lang_input_url':'URL:', - 'lang_input_title':'Title:', - 'lang_input_target':'open in new window:' - }, - 'validLink':'Supports only effective when a link is selected', - 'httpPrompt':'The hyperlink you enter should start with "http|https|ftp://"!' - }, - map:{ - 'static':{ - lang_city:"City", - lang_address:"Address", - city:{value:"Beijing"}, - lang_search:"Search", - lang_dynamicmap:"Dynamic map" - }, - cityMsg:"Please enter the city name!", - errorMsg:"Can't find the place!" - }, - searchreplace:{ - 'static':{ - lang_tab_search:"Search", - lang_tab_replace:"Replace", - lang_search1:"Search", - lang_search2:"Search", - lang_replace:"Replace", - lang_searchReg:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"', - lang_searchReg1:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"', - lang_case_sensitive1:"Case sense", - lang_case_sensitive2:"Case sense", - nextFindBtn:{value:"Next"}, - preFindBtn:{value:"Preview"}, - nextReplaceBtn:{value:"Next"}, - preReplaceBtn:{value:"Preview"}, - repalceBtn:{value:"Replace"}, - repalceAllBtn:{value:"Replace all"} - }, - getEnd:"Has the search to the bottom!", - getStart:"Has the search to the top!", - countMsg:"Altogether replaced {#count} character(s)!" - }, - snapscreen:{ - 'static':{ - lang_showMsg:"You should install the UEditor screenshots program first!", - lang_download:"Download!", - lang_step1:"Step1:Download the program and then run it", - lang_step2:"Step2:After complete install,try to click the button again" - } - }, - spechars:{ - 'static':{}, - tsfh:"Special", - lmsz:"Roman", - szfh:"Numeral", - rwfh:"Japanese", - xlzm:"The Greek", - ewzm:"Russian", - pyzm:"Phonetic", - yyyb:"English", - zyzf:"Others" - }, - 'edittable':{ - 'static':{ - 'lang_tableStyle':'Table style', - 'lang_insertCaption':'Add table header row', - 'lang_insertTitle':'Add table title row', - 'lang_insertTitleCol':'Add table title col', - 'lang_tableSize':'Automatically adjust table size', - 'lang_autoSizeContent':'Adaptive by form text', - 'lang_orderbycontent':"Table of contents sortable", - 'lang_autoSizePage':'Page width adaptive', - 'lang_example':'Example', - 'lang_borderStyle':'Table Border', - 'lang_color':'Color:' - }, - captionName:'Caption', - titleName:'Title', - cellsName:'text', - errorMsg:'There are merged cells, can not sort.' - }, - 'edittip':{ - 'static':{ - lang_delRow:'Delete entire row', - lang_delCol:'Delete entire col' - } - }, - 'edittd':{ - 'static':{ - lang_tdBkColor:'Background Color:' - } - }, - 'formula':{ - 'static':{ - } - }, - wordimage:{ - 'static':{ - lang_resave:"The re-save step", - uploadBtn:{src:"upload.png", alt:"Upload"}, - clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"}, - lang_step:" 1. Click top button to copy the url and then open the dialog to paste it. 2. Open after choose photos uploaded process." - }, - fileType:"Image", - flashError:"Flash initialization failed!", - netError:"Network error! Please try again!", - copySuccess:"URL has been copied!", - - 'flashI18n':{ - lang:encodeURI( '{"UploadingState":"totalNum: ${a},uploadComplete: ${b}", "BeforeUpload":"waitingNum: ${a}", "ExceedSize":"Size exceed${a}", "ErrorInPreview":"Preview failed", "DefaultDescription":"Description", "LoadingImage":"Loading..."}' ), - uploadingTF:encodeURI( '{"font":"Arial", "size":12, "color":"0x000", "bold":"true", "italic":"false", "underline":"false"}' ), - imageTF:encodeURI( '{"font":"Arial", "size":11, "color":"red", "bold":"false", "italic":"false", "underline":"false"}' ), - textEncoding:"utf-8", - addImageSkinURL:"addImage.png", - allDeleteBtnUpSkinURL:"allDeleteBtnUpSkin.png", - allDeleteBtnHoverSkinURL:"allDeleteBtnHoverSkin.png", - rotateLeftBtnEnableSkinURL:"rotateLeftEnable.png", - rotateLeftBtnDisableSkinURL:"rotateLeftDisable.png", - rotateRightBtnEnableSkinURL:"rotateRightEnable.png", - rotateRightBtnDisableSkinURL:"rotateRightDisable.png", - deleteBtnEnableSkinURL:"deleteEnable.png", - deleteBtnDisableSkinURL:"deleteDisable.png", - backgroundURL:'', - listBackgroundURL:'', - buttonURL:'button.png' - } - }, - 'autosave': { - 'success':'Local conservation success' - } -}; diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/addimage.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/addimage.png deleted file mode 100644 index 3a2fd17121b9e0d435b2ca082d696c33b9f27b79..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/addimage.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/alldeletebtnhoverskin.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/alldeletebtnhoverskin.png deleted file mode 100644 index 355eeabbd8fc611ec984889883a2ec46e1cb6bb1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/alldeletebtnhoverskin.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/alldeletebtnupskin.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/alldeletebtnupskin.png deleted file mode 100644 index 61658ce6f10164478ce293c05f1f0485a8fa1fc4..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/alldeletebtnupskin.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/background.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/background.png deleted file mode 100644 index d5bf5fdd8ae94b603832031134b208c9bc72edf4..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/background.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/button.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/button.png deleted file mode 100644 index 098874cb1fa85852d77ba9acbb5850c91c341fb7..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/button.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/copy.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/copy.png deleted file mode 100644 index f982e8bcbc6e0d6dde115a2cd5d094b12ad50f4f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/copy.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/deletedisable.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/deletedisable.png deleted file mode 100644 index c8ee75094f59f0c1262806fd294d361f30f64f58..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/deletedisable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/deleteenable.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/deleteenable.png deleted file mode 100644 index 26acc883567c5d7fde8de3ba052d7754a5b1c539..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/deleteenable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/listbackground.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/listbackground.png deleted file mode 100644 index 4f82ccd88fca215709827937769cb4c9216323b1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/listbackground.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/localimage.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/localimage.png deleted file mode 100644 index 12c8e6aefa8fd16287ac77bbecd7d5b58c3fc837..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/localimage.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/music.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/music.png deleted file mode 100644 index 69c5a9a7e1cecdf78902fc11178313f7f33d1f85..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/music.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotateleftdisable.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotateleftdisable.png deleted file mode 100644 index 741526e0d5e6eb5c30eb0a62c9b1d6d558ed9cdf..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotateleftdisable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotateleftenable.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotateleftenable.png deleted file mode 100644 index e164ddbd62a232f3a89826158c9795f6c082cc89..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotateleftenable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotaterightdisable.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotaterightdisable.png deleted file mode 100644 index 5a78c26062ae546b046ca58d1c2b6647f62d2368..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotaterightdisable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotaterightenable.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotaterightenable.png deleted file mode 100644 index d768531fca400de87d148dca3b9b7ae88bce4b61..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/rotaterightenable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/upload.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/upload.png deleted file mode 100644 index 7bb15b3d6d6799504cf7093a1600bd7ece0d9ef5..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/en/images/upload.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/copy.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/copy.png deleted file mode 100644 index b2536aac72e763b9a872b507462458ecb96990f0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/copy.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/localimage.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/localimage.png deleted file mode 100644 index 7303c364318b6ac27dc4a8ae6717124d8dafaff9..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/localimage.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/music.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/music.png deleted file mode 100644 index 842cb938703092b9024e609a2cc55c270cf35092..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/music.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/upload.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/upload.png deleted file mode 100644 index 08d4d9268204a20ca343bf75784302cc706d2417..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/images/upload.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/zh-cn.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/zh-cn.js deleted file mode 100644 index 5210c079822e34d6b5e74c49ecda8898f0d17b28..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/i18n/zh-cn/zh-cn.js +++ /dev/null @@ -1,669 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: taoqili - * Date: 12-6-12 - * Time: 下午5:02 - * To change this template use File | Settings | File Templates. - */ -UE.I18N['zh-cn'] = { - 'labelMap':{ - 'anchor':'锚点', 'undo':'撤销', 'redo':'重做', 'bold':'加粗', 'indent':'首行缩进', 'snapscreen':'截图', - 'italic':'斜体', 'underline':'下划线', 'strikethrough':'删除线', 'subscript':'下标','fontborder':'字符边框', - 'superscript':'上标', 'formatmatch':'格式刷', 'source':'源代码', 'blockquote':'引用', - 'pasteplain':'纯文本粘贴模式', 'selectall':'全选', 'print':'打印', 'preview':'预览', - 'horizontal':'分隔线', 'removeformat':'清除格式', 'time':'时间', 'date':'日期', - 'unlink':'取消链接', 'insertrow':'前插入行', 'insertcol':'前插入列', 'mergeright':'右合并单元格', 'mergedown':'下合并单元格', - 'deleterow':'删除行', 'deletecol':'删除列', 'splittorows':'拆分成行', - 'splittocols':'拆分成列', 'splittocells':'完全拆分单元格','deletecaption':'删除表格标题','inserttitle':'插入标题', - 'mergecells':'合并多个单元格', 'deletetable':'删除表格', 'cleardoc':'清空文档','insertparagraphbeforetable':"表格前插入行",'insertcode':'代码语言', - 'fontfamily':'字体', 'fontsize':'字号', 'paragraph':'段落格式', 'simpleupload':'单图上传', 'insertimage':'多图上传','edittable':'表格属性','edittd':'单元格属性', 'link':'超链接', - 'emotion':'表情', 'spechars':'特殊字符', 'searchreplace':'查询替换', 'map':'Baidu地图', 'gmap':'Google地图', - 'insertvideo':'视频', 'help':'帮助', 'justifyleft':'居左对齐', 'justifyright':'居右对齐', 'justifycenter':'居中对齐', - 'justifyjustify':'两端对齐', 'forecolor':'字体颜色', 'backcolor':'背景色', 'insertorderedlist':'有序列表', - 'insertunorderedlist':'无序列表', 'fullscreen':'全屏', 'directionalityltr':'从左向右输入', 'directionalityrtl':'从右向左输入', - 'rowspacingtop':'段前距', 'rowspacingbottom':'段后距', 'pagebreak':'分页', 'insertframe':'插入Iframe', 'imagenone':'默认', - 'imageleft':'左浮动', 'imageright':'右浮动', 'attachment':'附件', 'imagecenter':'居中', 'wordimage':'图片转存', - 'lineheight':'行间距','edittip' :'编辑提示','customstyle':'自定义标题', 'autotypeset':'自动排版', - 'webapp':'百度应用','touppercase':'字母大写', 'tolowercase':'字母小写','background':'背景','template':'模板','scrawl':'涂鸦', - 'music':'音乐','inserttable':'插入表格','drafts': '从草稿箱加载', 'charts': '图表' - }, - 'insertorderedlist':{ - 'num':'1,2,3...', - 'num1':'1),2),3)...', - 'num2':'(1),(2),(3)...', - 'cn':'一,二,三....', - 'cn1':'一),二),三)....', - 'cn2':'(一),(二),(三)....', - 'decimal':'1,2,3...', - 'lower-alpha':'a,b,c...', - 'lower-roman':'i,ii,iii...', - 'upper-alpha':'A,B,C...', - 'upper-roman':'I,II,III...' - }, - 'insertunorderedlist':{ - 'circle':'○ 大圆圈', - 'disc':'● 小黑点', - 'square':'■ 小方块 ', - 'dash' :'— 破折号', - 'dot':' 。 小圆圈' - }, - 'paragraph':{'p':'段落', 'h1':'标题 1', 'h2':'标题 2', 'h3':'标题 3', 'h4':'标题 4', 'h5':'标题 5', 'h6':'标题 6'}, - 'fontfamily':{ - 'songti':'宋体', - 'kaiti':'楷体', - 'heiti':'黑体', - 'lishu':'隶书', - 'yahei':'微软雅黑', - 'andaleMono':'andale mono', - 'arial': 'arial', - 'arialBlack':'arial black', - 'comicSansMs':'comic sans ms', - 'impact':'impact', - 'timesNewRoman':'times new roman' - }, - 'customstyle':{ - 'tc':'标题居中', - 'tl':'标题居左', - 'im':'强调', - 'hi':'明显强调' - }, - 'autoupload': { - 'exceedSizeError': '文件大小超出限制', - 'exceedTypeError': '文件格式不允许', - 'jsonEncodeError': '服务器返回格式错误', - 'loading':"正在上传...", - 'loadError':"上传错误", - 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!' - }, - 'simpleupload':{ - 'exceedSizeError': '文件大小超出限制', - 'exceedTypeError': '文件格式不允许', - 'jsonEncodeError': '服务器返回格式错误', - 'loading':"正在上传...", - 'loadError':"上传错误", - 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!' - }, - 'elementPathTip':"元素路径", - 'wordCountTip':"字数统计", - 'wordCountMsg':'当前已输入{#count}个字符, 您还可以输入{#leave}个字符。 ', - 'wordOverFlowMsg':'字数超出最大允许值,服务器可能拒绝保存!', - 'ok':"确认", - 'cancel':"取消", - 'closeDialog':"关闭对话框", - 'tableDrag':"表格拖动必须引入uiUtils.js文件!", - 'autofloatMsg':"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!", - 'loadconfigError': '获取后台配置项请求出错,上传功能将不能正常使用!', - 'loadconfigFormatError': '后台配置项返回格式出错,上传功能将不能正常使用!', - 'loadconfigHttpError': '请求后台配置项http错误,上传功能将不能正常使用!', - 'snapScreen_plugin':{ - 'browserMsg':"仅支持IE浏览器!", - 'callBackErrorMsg':"服务器返回数据有误,请检查配置项之后重试。", - 'uploadErrorMsg':"截图上传失败,请检查服务器端环境! " - }, - 'insertcode':{ - 'as3':'ActionScript 3', - 'bash':'Bash/Shell', - 'cpp':'C/C++', - 'css':'CSS', - 'cf':'ColdFusion', - 'c#':'C#', - 'delphi':'Delphi', - 'diff':'Diff', - 'erlang':'Erlang', - 'groovy':'Groovy', - 'html':'HTML', - 'java':'Java', - 'jfx':'JavaFX', - 'js':'JavaScript', - 'pl':'Perl', - 'php':'PHP', - 'plain':'Plain Text', - 'ps':'PowerShell', - 'python':'Python', - 'ruby':'Ruby', - 'scala':'Scala', - 'sql':'SQL', - 'vb':'Visual Basic', - 'xml':'XML' - }, - 'confirmClear':"确定清空当前文档么?", - 'contextMenu':{ - 'delete':"删除", - 'selectall':"全选", - 'deletecode':"删除代码", - 'cleardoc':"清空文档", - 'confirmclear':"确定清空当前文档么?", - 'unlink':"删除超链接", - 'paragraph':"段落格式", - 'edittable':"表格属性", - 'aligntd':"单元格对齐方式", - 'aligntable':'表格对齐方式', - 'tableleft':'左浮动', - 'tablecenter':'居中显示', - 'tableright':'右浮动', - 'edittd':"单元格属性", - 'setbordervisible':'设置表格边线可见', - 'justifyleft':'左对齐', - 'justifyright':'右对齐', - 'justifycenter':'居中对齐', - 'justifyjustify':'两端对齐', - 'table':"表格", - 'inserttable':'插入表格', - 'deletetable':"删除表格", - 'insertparagraphbefore':"前插入段落", - 'insertparagraphafter':'后插入段落', - 'deleterow':"删除当前行", - 'deletecol':"删除当前列", - 'insertrow':"前插入行", - 'insertcol':"左插入列", - 'insertrownext':'后插入行', - 'insertcolnext':'右插入列', - 'insertcaption':'插入表格名称', - 'deletecaption':'删除表格名称', - 'inserttitle':'插入表格标题行', - 'deletetitle':'删除表格标题行', - 'inserttitlecol':'插入表格标题列', - 'deletetitlecol':'删除表格标题列', - 'averageDiseRow':'平均分布各行', - 'averageDisCol':'平均分布各列', - 'mergeright':"向右合并", - 'mergeleft':"向左合并", - 'mergedown':"向下合并", - 'mergecells':"合并单元格", - 'splittocells':"完全拆分单元格", - 'splittocols':"拆分成列", - 'splittorows':"拆分成行", - 'tablesort':'表格排序', - 'enablesort':'设置表格可排序', - 'disablesort':'取消表格可排序', - 'reversecurrent':'逆序当前', - 'orderbyasc':'按ASCII字符升序', - 'reversebyasc':'按ASCII字符降序', - 'orderbynum':'按数值大小升序', - 'reversebynum':'按数值大小降序', - 'borderbk':'边框底纹', - 'setcolor':'表格隔行变色', - 'unsetcolor':'取消表格隔行变色', - 'setbackground':'选区背景隔行', - 'unsetbackground':'取消选区背景', - 'redandblue':'红蓝相间', - 'threecolorgradient':'三色渐变', - 'copy':"复制(Ctrl + c)", - 'copymsg': "浏览器不支持,请使用 'Ctrl + c'", - 'paste':"粘贴(Ctrl + v)", - 'pastemsg': "浏览器不支持,请使用 'Ctrl + v'" - }, - 'copymsg': "浏览器不支持,请使用 'Ctrl + c'", - 'pastemsg': "浏览器不支持,请使用 'Ctrl + v'", - 'anthorMsg':"链接", - 'clearColor':'清空颜色', - 'standardColor':'标准颜色', - 'themeColor':'主题颜色', - 'property':'属性', - 'default':'默认', - 'modify':'修改', - 'justifyleft':'左对齐', - 'justifyright':'右对齐', - 'justifycenter':'居中', - 'justify':'默认', - 'clear':'清除', - 'anchorMsg':'锚点', - 'delete':'删除', - 'clickToUpload':"点击上传", - 'unset':'尚未设置语言文件', - 't_row':'行', - 't_col':'列', - 'more':'更多', - 'pasteOpt':'粘贴选项', - 'pasteSourceFormat':"保留源格式", - 'tagFormat':'只保留标签', - 'pasteTextFormat':'只保留文本', - 'autoTypeSet':{ - 'mergeLine':"合并空行", - 'delLine':"清除空行", - 'removeFormat':"清除格式", - 'indent':"首行缩进", - 'alignment':"对齐方式", - 'imageFloat':"图片浮动", - 'removeFontsize':"清除字号", - 'removeFontFamily':"清除字体", - 'removeHtml':"清除冗余HTML代码", - 'pasteFilter':"粘贴过滤", - 'run':"执行", - 'symbol':'符号转换', - 'bdc2sb':'全角转半角', - 'tobdc':'半角转全角' - }, - - 'background':{ - 'static':{ - 'lang_background_normal':'背景设置', - 'lang_background_local':'在线图片', - 'lang_background_set':'选项', - 'lang_background_none':'无背景色', - 'lang_background_colored':'有背景色', - 'lang_background_color':'颜色设置', - 'lang_background_netimg':'网络图片', - 'lang_background_align':'对齐方式', - 'lang_background_position':'精确定位', - 'repeatType':{'options':["居中", "横向重复", "纵向重复", "平铺","自定义"]} - - }, - 'noUploadImage':"当前未上传过任何图片!", - 'toggleSelect':"单击可切换选中状态\n原图尺寸: " - }, - //===============dialog i18N======================= - 'insertimage':{ - 'static':{ - 'lang_tab_remote':"插入图片", //节点 - 'lang_tab_upload':"本地上传", - 'lang_tab_online':"在线管理", - 'lang_tab_search':"图片搜索", - 'lang_input_url':"地 址:", - 'lang_input_size':"大 小:", - 'lang_input_width':"宽度", - 'lang_input_height':"高度", - 'lang_input_border':"边 框:", - 'lang_input_vhspace':"边 距:", - 'lang_input_title':"描 述:", - 'lang_input_align':'图片浮动方式:', - 'lang_imgLoading':" 图片加载中……", - 'lang_start_upload':"开始上传", - 'lock':{'title':"锁定宽高比例"}, //属性 - 'searchType':{'title':"图片类型", 'options':["全部类型", "头像图片", "面部特写", "卡通画", "简笔画", "动态图片", "静态图片"]}, //select的option - 'searchTxt':{'value':"请输入搜索关键词"}, - 'searchBtn':{'value':"百度一下"}, - 'searchReset':{'value':"清空搜索"}, - 'noneAlign':{'title':'无浮动'}, - 'leftAlign':{'title':'左浮动'}, - 'rightAlign':{'title':'右浮动'}, - 'centerAlign':{'title':'居中独占一行'} - }, - 'uploadSelectFile':'点击选择图片', - 'uploadAddFile':'继续添加', - 'uploadStart':'开始上传', - 'uploadPause':'暂停上传', - 'uploadContinue':'继续上传', - 'uploadRetry':'重试上传', - 'uploadDelete':'删除', - 'uploadTurnLeft':'向左旋转', - 'uploadTurnRight':'向右旋转', - 'uploadPreview':'预览中', - 'uploadNoPreview':'不能预览', - 'updateStatusReady': '选中_张图片,共_KB。', - 'updateStatusConfirm': '已成功上传_张照片,_张照片上传失败', - 'updateStatusFinish': '共_张(_KB),_张上传成功', - 'updateStatusError': ',_张上传失败。', - 'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', - 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', - 'errorExceedSize':'文件大小超出', - 'errorFileType':'文件格式不允许', - 'errorInterrupt':'文件传输中断', - 'errorUploadRetry':'上传失败,请重试', - 'errorHttp':'http请求错误', - 'errorServerUpload':'服务器返回出错', - 'remoteLockError':"宽高不正确,不能所定比例", - 'numError':"请输入正确的长度或者宽度值!例如:123,400", - 'imageUrlError':"不允许的图片格式或者图片域!", - 'imageLoadError':"图片加载失败!请检查链接地址或网络状态!", - 'searchRemind':"请输入搜索关键词", - 'searchLoading':"图片加载中,请稍后……", - 'searchRetry':" :( ,抱歉,没有找到图片!请重试一次!" - }, - 'attachment':{ - 'static':{ - 'lang_tab_upload': '上传附件', - 'lang_tab_online': '在线附件', - 'lang_start_upload':"开始上传", - 'lang_drop_remind':"可以将文件拖到这里,单次最多可选100个文件" - }, - 'uploadSelectFile':'点击选择文件', - 'uploadAddFile':'继续添加', - 'uploadStart':'开始上传', - 'uploadPause':'暂停上传', - 'uploadContinue':'继续上传', - 'uploadRetry':'重试上传', - 'uploadDelete':'删除', - 'uploadTurnLeft':'向左旋转', - 'uploadTurnRight':'向右旋转', - 'uploadPreview':'预览中', - 'updateStatusReady': '选中_个文件,共_KB。', - 'updateStatusConfirm': '已成功上传_个文件,_个文件上传失败', - 'updateStatusFinish': '共_个(_KB),_个上传成功', - 'updateStatusError': ',_张上传失败。', - 'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', - 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', - 'errorExceedSize':'文件大小超出', - 'errorFileType':'文件格式不允许', - 'errorInterrupt':'文件传输中断', - 'errorUploadRetry':'上传失败,请重试', - 'errorHttp':'http请求错误', - 'errorServerUpload':'服务器返回出错' - }, - 'insertvideo':{ - 'static':{ - 'lang_tab_insertV':"插入视频", - 'lang_tab_searchV':"搜索视频", - 'lang_tab_uploadV':"上传视频", - 'lang_video_url':"视频网址", - 'lang_video_size':"视频尺寸", - 'lang_videoW':"宽度", - 'lang_videoH':"高度", - 'lang_alignment':"对齐方式", - 'videoSearchTxt':{'value':"请输入搜索关键字!"}, - 'videoType':{'options':["全部", "热门", "娱乐", "搞笑", "体育", "科技", "综艺"]}, - 'videoSearchBtn':{'value':"百度一下"}, - 'videoSearchReset':{'value':"清空结果"}, - - 'lang_input_fileStatus':' 当前未上传文件', - 'startUpload':{'style':"background:url(upload.png) no-repeat;"}, - - 'lang_upload_size':"视频尺寸", - 'lang_upload_width':"宽度", - 'lang_upload_height':"高度", - 'lang_upload_alignment':"对齐方式", - 'lang_format_advice':"建议使用mp4格式." - - }, - 'numError':"请输入正确的数值,如123,400", - 'floatLeft':"左浮动", - 'floatRight':"右浮动", - 'default':"默认", - 'block':"独占一行", - 'urlError':"输入的视频地址有误,请检查后再试!", - 'loading':"  视频加载中,请等待……", - 'clickToSelect':"点击选中", - 'goToSource':'访问源视频', - 'noVideo':"    抱歉,找不到对应的视频,请重试!", - - 'browseFiles':'浏览文件', - 'uploadSuccess':'上传成功!', - 'delSuccessFile':'从成功队列中移除', - 'delFailSaveFile':'移除保存失败文件', - 'statusPrompt':' 个文件已上传! ', - 'flashVersionError':'当前Flash版本过低,请更新FlashPlayer后重试!', - 'flashLoadingError':'Flash加载失败!请检查路径或网络状态', - 'fileUploadReady':'等待上传……', - 'delUploadQueue':'从上传队列中移除', - 'limitPrompt1':'单次不能选择超过', - 'limitPrompt2':'个文件!请重新选择!', - 'delFailFile':'移除失败文件', - 'fileSizeLimit':'文件大小超出限制!', - 'emptyFile':'空文件无法上传!', - 'fileTypeError':'文件类型不允许!', - 'unknownError':'未知错误!', - 'fileUploading':'上传中,请等待……', - 'cancelUpload':'取消上传', - 'netError':'网络错误', - 'failUpload':'上传失败!', - 'serverIOError':'服务器IO错误!', - 'noAuthority':'无权限!', - 'fileNumLimit':'上传个数限制', - 'failCheck':'验证失败,本次上传被跳过!', - 'fileCanceling':'取消中,请等待……', - 'stopUploading':'上传已停止……', - - 'uploadSelectFile':'点击选择文件', - 'uploadAddFile':'继续添加', - 'uploadStart':'开始上传', - 'uploadPause':'暂停上传', - 'uploadContinue':'继续上传', - 'uploadRetry':'重试上传', - 'uploadDelete':'删除', - 'uploadTurnLeft':'向左旋转', - 'uploadTurnRight':'向右旋转', - 'uploadPreview':'预览中', - 'updateStatusReady': '选中_个文件,共_KB。', - 'updateStatusConfirm': '成功上传_个,_个失败', - 'updateStatusFinish': '共_个(_KB),_个成功上传', - 'updateStatusError': ',_张上传失败。', - 'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', - 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', - 'errorExceedSize':'文件大小超出', - 'errorFileType':'文件格式不允许', - 'errorInterrupt':'文件传输中断', - 'errorUploadRetry':'上传失败,请重试', - 'errorHttp':'http请求错误', - 'errorServerUpload':'服务器返回出错' - }, - 'webapp':{ - 'tip1':"本功能由百度APP提供,如看到此页面,请各位站长首先申请百度APPKey!", - 'tip2':"申请完成之后请至neditor.config.js中配置获得的appkey! ", - 'applyFor':"点此申请", - 'anthorApi':"百度API" - }, - 'template':{ - 'static':{ - 'lang_template_bkcolor':'背景颜色', - 'lang_template_clear' : '保留原有内容', - 'lang_template_select' : '选择模板' - }, - 'blank':"空白文档", - 'blog':"博客文章", - 'resume':"个人简历", - 'richText':"图文混排", - 'sciPapers':"科技论文" - - - }, - 'scrawl':{ - 'static':{ - 'lang_input_previousStep':"上一步", - 'lang_input_nextsStep':"下一步", - 'lang_input_clear':'清空', - 'lang_input_addPic':'添加背景', - 'lang_input_ScalePic':'缩放背景', - 'lang_input_removePic':'删除背景', - 'J_imgTxt':{title:'添加背景图片'} - }, - 'noScarwl':"尚未作画,白纸一张~", - 'scrawlUpLoading':"涂鸦上传中,别急哦~", - 'continueBtn':"继续", - 'imageError':"糟糕,图片读取失败了!", - 'backgroundUploading':'背景图片上传中,别急哦~' - }, - 'music':{ - 'static':{ - 'lang_input_tips':"输入歌手/歌曲/专辑,搜索您感兴趣的音乐!", - 'J_searchBtn':{value:'搜索歌曲'} - }, - 'emptyTxt':'未搜索到相关音乐结果,请换一个关键词试试。', - 'chapter':'歌曲', - 'singer':'歌手', - 'special':'专辑', - 'listenTest':'试听' - }, - 'anchor':{ - 'static':{ - 'lang_input_anchorName':'锚点名字:' - } - }, - 'charts':{ - 'static':{ - 'lang_data_source':'数据源:', - 'lang_chart_format': '图表格式:', - 'lang_data_align': '数据对齐方式', - 'lang_chart_align_same': '数据源与图表X轴Y轴一致', - 'lang_chart_align_reverse': '数据源与图表X轴Y轴相反', - 'lang_chart_title': '图表标题', - 'lang_chart_main_title': '主标题:', - 'lang_chart_sub_title': '子标题:', - 'lang_chart_x_title': 'X轴标题:', - 'lang_chart_y_title': 'Y轴标题:', - 'lang_chart_tip': '提示文字', - 'lang_cahrt_tip_prefix': '提示文字前缀:', - 'lang_cahrt_tip_description': '仅饼图有效, 当鼠标移动到饼图中相应的块上时,提示框内的文字的前缀', - 'lang_chart_data_unit': '数据单位', - 'lang_chart_data_unit_title': '单位:', - 'lang_chart_data_unit_description': '显示在每个数据点上的数据的单位, 比如: 温度的单位 ℃', - 'lang_chart_type': '图表类型:', - 'lang_prev_btn': '上一个', - 'lang_next_btn': '下一个' - } - }, - 'emotion':{ - 'static':{ - 'lang_input_choice':'精选', - 'lang_input_Tuzki':'兔斯基', - 'lang_input_BOBO':'BOBO', - 'lang_input_lvdouwa':'绿豆蛙', - 'lang_input_babyCat':'baby猫', - 'lang_input_bubble':'泡泡', - 'lang_input_youa':'有啊' - } - }, - 'gmap':{ - 'static':{ - 'lang_input_address':'地址', - 'lang_input_search':'搜索', - 'address':{value:"北京"} - }, - searchError:'无法定位到该地址!' - }, - 'help':{ - 'static':{ - 'lang_input_about':'关于UEditor', - 'lang_input_shortcuts':'快捷键', - 'lang_input_introduction':'UEditor是由百度web前端研发部开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点。开源基于BSD协议,允许自由使用和修改代码。', - 'lang_Txt_shortcuts':'快捷键', - 'lang_Txt_func':'功能', - 'lang_Txt_bold':'给选中字设置为加粗', - 'lang_Txt_copy':'复制选中内容', - 'lang_Txt_cut':'剪切选中内容', - 'lang_Txt_Paste':'粘贴', - 'lang_Txt_undo':'重新执行上次操作', - 'lang_Txt_redo':'撤销上一次操作', - 'lang_Txt_italic':'给选中字设置为斜体', - 'lang_Txt_underline':'给选中字加下划线', - 'lang_Txt_selectAll':'全部选中', - 'lang_Txt_visualEnter':'软回车', - 'lang_Txt_fullscreen':'全屏' - } - }, - 'insertframe':{ - 'static':{ - 'lang_input_address':'地址:', - 'lang_input_width':'宽度:', - 'lang_input_height':'高度:', - 'lang_input_isScroll':'允许滚动条:', - 'lang_input_frameborder':'显示框架边框:', - 'lang_input_alignMode':'对齐方式:', - 'align':{title:"对齐方式", options:["默认", "左对齐", "右对齐", "居中"]} - }, - 'enterAddress':'请输入地址!' - }, - 'link':{ - 'static':{ - 'lang_input_text':'文本内容:', - 'lang_input_url':'链接地址:', - 'lang_input_title':'标题:', - 'lang_input_target':'是否在新窗口打开:' - }, - 'validLink':'只支持选中一个链接时生效', - 'httpPrompt':'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀' - }, - 'map':{ - 'static':{ - lang_city:"城市", - lang_address:"地址", - city:{value:"北京"}, - lang_search:"搜索", - lang_dynamicmap:"插入动态地图" - }, - cityMsg:"请选择城市", - errorMsg:"抱歉,找不到该位置!" - }, - 'searchreplace':{ - 'static':{ - lang_tab_search:"查找", - lang_tab_replace:"替换", - lang_search1:"查找", - lang_search2:"查找", - lang_replace:"替换", - lang_searchReg:'支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”', - lang_searchReg1:'支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”', - lang_case_sensitive1:"区分大小写", - lang_case_sensitive2:"区分大小写", - nextFindBtn:{value:"下一个"}, - preFindBtn:{value:"上一个"}, - nextReplaceBtn:{value:"下一个"}, - preReplaceBtn:{value:"上一个"}, - repalceBtn:{value:"替换"}, - repalceAllBtn:{value:"全部替换"} - }, - getEnd:"已经搜索到文章末尾!", - getStart:"已经搜索到文章头部", - countMsg:"总共替换了{#count}处!" - }, - 'snapscreen':{ - 'static':{ - lang_showMsg:"截图功能需要首先安装UEditor截图插件! ", - lang_download:"点此下载", - lang_step1:"第一步,下载UEditor截图插件并运行安装。", - lang_step2:"第二步,插件安装完成后即可使用,如不生效,请重启浏览器后再试!" - } - }, - 'spechars':{ - 'static':{}, - tsfh:"特殊字符", - lmsz:"罗马字符", - szfh:"数学字符", - rwfh:"日文字符", - xlzm:"希腊字母", - ewzm:"俄文字符", - pyzm:"拼音字母", - yyyb:"英语音标", - zyzf:"其他" - }, - 'edittable':{ - 'static':{ - 'lang_tableStyle':'表格样式', - 'lang_insertCaption':'添加表格名称行', - 'lang_insertTitle':'添加表格标题行', - 'lang_insertTitleCol':'添加表格标题列', - 'lang_orderbycontent':"使表格内容可排序", - 'lang_tableSize':'自动调整表格尺寸', - 'lang_autoSizeContent':'按表格文字自适应', - 'lang_autoSizePage':'按页面宽度自适应', - 'lang_example':'示例', - 'lang_borderStyle':'表格边框', - 'lang_color':'颜色:' - }, - captionName:'表格名称', - titleName:'标题', - cellsName:'内容', - errorMsg:'有合并单元格,不可排序' - }, - 'edittip':{ - 'static':{ - lang_delRow:'删除整行', - lang_delCol:'删除整列' - } - }, - 'edittd':{ - 'static':{ - lang_tdBkColor:'背景颜色:' - } - }, - 'formula':{ - 'static':{ - } - }, - 'wordimage':{ - 'static':{ - lang_resave:"转存步骤", - uploadBtn:{src:"upload.png",alt:"上传"}, - clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"}, - lang_step:"1、点击顶部复制按钮,将地址复制到剪贴板;2、点击添加照片按钮,在弹出的对话框中使用Ctrl+V粘贴地址;3、点击打开后选择图片上传流程。" - }, - 'fileType':"图片", - 'flashError':"FLASH初始化失败,请检查FLASH插件是否正确安装!", - 'netError':"网络连接错误,请重试!", - 'copySuccess':"图片地址已经复制!", - 'flashI18n':{} //留空默认中文 - }, - 'autosave': { - 'saving':'保存中...', - 'success':'本地保存成功' - } -}; diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/index.html b/api/src/main/resources/static/plug-in/neditor/2.1.10/index.html deleted file mode 100644 index e87f959924e98a35937d7adc00eb9eb82f806060..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/index.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - 完整demo - - - - - - - - - - - - - -
                      -

                      完整demo

                      - -
                      -
                      -
                      - - - - - - - - - - - -
                      -
                      - - - - - - - - -
                      - -
                      - - -
                      - -
                      -
                      - - -
                      - - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.all.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.all.js deleted file mode 100644 index c4d0ac3b47de50186b76c4604dc89a79d3350465..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.all.js +++ /dev/null @@ -1,33077 +0,0 @@ -/*! - * neditor - * version: 2.1.6 - * build: Thu Nov 29 2018 09:38:10 GMT+0000 (UTC) - */ - -(function(){ - -// editor.js -UEDITOR_CONFIG = window.UEDITOR_CONFIG || {}; - -var baidu = window.baidu || {}; - -window.baidu = baidu; - -window.UE = baidu.editor = { - plugins: {}, - commands: {}, - instants: {}, - I18N: {}, - _customizeUI: {}, - version: "1.5.0" -}; -var dom = (UE.dom = {}); - - -// core/browser.js -/** - * 浏览器判断模块 - * @file - * @module UE.browser - * @since 1.2.6.1 - */ - -/** - * 提供浏览器检测的模块 - * @unfile - * @module UE.browser - */ -var browser = (UE.browser = (function() { - var agent = navigator.userAgent.toLowerCase(), - opera = window.opera, - browser = { - /** - * @property {boolean} ie 检测当前浏览器是否为IE - * @example - * ```javascript - * if ( UE.browser.ie ) { - * console.log( '当前浏览器是IE' ); - * } - * ``` - */ - ie: /(msie\s|trident.*rv:)([\w.]+)/i.test(agent), - - /** - * @property {boolean} opera 检测当前浏览器是否为Opera - * @example - * ```javascript - * if ( UE.browser.opera ) { - * console.log( '当前浏览器是Opera' ); - * } - * ``` - */ - opera: !!opera && opera.version, - - /** - * @property {boolean} webkit 检测当前浏览器是否是webkit内核的浏览器 - * @example - * ```javascript - * if ( UE.browser.webkit ) { - * console.log( '当前浏览器是webkit内核浏览器' ); - * } - * ``` - */ - webkit: agent.indexOf(" applewebkit/") > -1, - - /** - * @property {boolean} mac 检测当前浏览器是否是运行在mac平台下 - * @example - * ```javascript - * if ( UE.browser.mac ) { - * console.log( '当前浏览器运行在mac平台下' ); - * } - * ``` - */ - mac: agent.indexOf("macintosh") > -1, - - /** - * @property {boolean} quirks 检测当前浏览器是否处于“怪异模式”下 - * @example - * ```javascript - * if ( UE.browser.quirks ) { - * console.log( '当前浏览器运行处于“怪异模式”' ); - * } - * ``` - */ - quirks: document.compatMode == "BackCompat" - }; - - /** - * @property {boolean} gecko 检测当前浏览器内核是否是gecko内核 - * @example - * ```javascript - * if ( UE.browser.gecko ) { - * console.log( '当前浏览器内核是gecko内核' ); - * } - * ``` - */ - browser.gecko = - navigator.product == "Gecko" && - !browser.webkit && - !browser.opera && - !browser.ie; - - var version = 0; - - // Internet Explorer 6.0+ - if (browser.ie) { - var v1 = agent.match(/(?:msie\s([\w.]+))/); - var v2 = agent.match(/(?:trident.*rv:([\w.]+))/); - if (v1 && v2 && v1[1] && v2[1]) { - version = Math.max(v1[1] * 1, v2[1] * 1); - } else if (v1 && v1[1]) { - version = v1[1] * 1; - } else if (v2 && v2[1]) { - version = v2[1] * 1; - } else { - version = 0; - } - - browser.ie11Compat = document.documentMode == 11; - /** - * @property { boolean } ie9Compat 检测浏览器模式是否为 IE9 兼容模式 - * @warning 如果浏览器不是IE, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.ie9Compat ) { - * console.log( '当前浏览器运行在IE9兼容模式下' ); - * } - * ``` - */ - browser.ie9Compat = document.documentMode == 9; - - /** - * @property { boolean } ie8 检测浏览器是否是IE8浏览器 - * @warning 如果浏览器不是IE, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.ie8 ) { - * console.log( '当前浏览器是IE8浏览器' ); - * } - * ``` - */ - browser.ie8 = !!document.documentMode; - - /** - * @property { boolean } ie8Compat 检测浏览器模式是否为 IE8 兼容模式 - * @warning 如果浏览器不是IE, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.ie8Compat ) { - * console.log( '当前浏览器运行在IE8兼容模式下' ); - * } - * ``` - */ - browser.ie8Compat = document.documentMode == 8; - - /** - * @property { boolean } ie7Compat 检测浏览器模式是否为 IE7 兼容模式 - * @warning 如果浏览器不是IE, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.ie7Compat ) { - * console.log( '当前浏览器运行在IE7兼容模式下' ); - * } - * ``` - */ - browser.ie7Compat = - (version == 7 && !document.documentMode) || document.documentMode == 7; - - /** - * @property { boolean } ie6Compat 检测浏览器模式是否为 IE6 模式 或者怪异模式 - * @warning 如果浏览器不是IE, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.ie6Compat ) { - * console.log( '当前浏览器运行在IE6模式或者怪异模式下' ); - * } - * ``` - */ - browser.ie6Compat = version < 7 || browser.quirks; - - browser.ie9above = version > 8; - - browser.ie9below = version < 9; - - browser.ie11above = version > 10; - - browser.ie11below = version < 11; - } - - // Gecko. - if (browser.gecko) { - var geckoRelease = agent.match(/rv:([\d\.]+)/); - if (geckoRelease) { - geckoRelease = geckoRelease[1].split("."); - version = - geckoRelease[0] * 10000 + - (geckoRelease[1] || 0) * 100 + - (geckoRelease[2] || 0) * 1; - } - } - - /** - * @property { Number } chrome 检测当前浏览器是否为Chrome, 如果是,则返回Chrome的大版本号 - * @warning 如果浏览器不是chrome, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.chrome ) { - * console.log( '当前浏览器是Chrome' ); - * } - * ``` - */ - if (/chrome\/(\d+\.\d)/i.test(agent)) { - browser.chrome = +RegExp["\x241"]; - } - - /** - * @property { Number } safari 检测当前浏览器是否为Safari, 如果是,则返回Safari的大版本号 - * @warning 如果浏览器不是safari, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.safari ) { - * console.log( '当前浏览器是Safari' ); - * } - * ``` - */ - if ( - /(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(agent) && - !/chrome/i.test(agent) - ) { - browser.safari = +(RegExp["\x241"] || RegExp["\x242"]); - } - - // Opera 9.50+ - if (browser.opera) version = parseFloat(opera.version()); - - // WebKit 522+ (Safari 3+) - if (browser.webkit) - version = parseFloat(agent.match(/ applewebkit\/(\d+)/)[1]); - - /** - * @property { Number } version 检测当前浏览器版本号 - * @remind - *
                        - *
                      • IE系列返回值为5,6,7,8,9,10等
                      • - *
                      • gecko系列会返回10900,158900等
                      • - *
                      • webkit系列会返回其build号 (如 522等)
                      • - *
                      - * @example - * ```javascript - * console.log( '当前浏览器版本号是: ' + UE.browser.version ); - * ``` - */ - browser.version = version; - - /** - * @property { boolean } isCompatible 检测当前浏览器是否能够与UEditor良好兼容 - * @example - * ```javascript - * if ( UE.browser.isCompatible ) { - * console.log( '浏览器与UEditor能够良好兼容' ); - * } - * ``` - */ - browser.isCompatible = - !browser.mobile && - ((browser.ie && version >= 6) || - (browser.gecko && version >= 10801) || - (browser.opera && version >= 9.5) || - (browser.air && version >= 1) || - (browser.webkit && version >= 522) || - false); - return browser; -})()); -//快捷方式 -var ie = browser.ie, - webkit = browser.webkit, - gecko = browser.gecko, - opera = browser.opera; - - -// core/utils.js -/** - * 工具函数包 - * @file - * @module UE.utils - * @since 1.2.6.1 - */ - -/** - * UEditor封装使用的静态工具函数 - * @module UE.utils - * @unfile - */ - -var utils = (UE.utils = { - /** - * 用给定的迭代器遍历对象 - * @method each - * @param { Object } obj 需要遍历的对象 - * @param { Function } iterator 迭代器, 该方法接受两个参数, 第一个参数是当前所处理的value, 第二个参数是当前遍历对象的key - * @example - * ```javascript - * var demoObj = { - * key1: 1, - * key2: 2 - * }; - * - * //output: key1: 1, key2: 2 - * UE.utils.each( demoObj, funciton ( value, key ) { - * - * console.log( key + ":" + value ); - * - * } ); - * ``` - */ - - /** - * 用给定的迭代器遍历数组或类数组对象 - * @method each - * @param { Array } array 需要遍历的数组或者类数组 - * @param { Function } iterator 迭代器, 该方法接受两个参数, 第一个参数是当前所处理的value, 第二个参数是当前遍历对象的key - * @example - * ```javascript - * var divs = document.getElmentByTagNames( "div" ); - * - * //output: 0: DIV, 1: DIV ... - * UE.utils.each( divs, funciton ( value, key ) { - * - * console.log( key + ":" + value.tagName ); - * - * } ); - * ``` - */ - each: function(obj, iterator, context) { - if (obj == null) return; - if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === false) return false; - } - } else { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - if (iterator.call(context, obj[key], key, obj) === false) - return false; - } - } - } - }, - - /** - * 以给定对象作为原型创建一个新对象 - * @method makeInstance - * @param { Object } protoObject 该对象将作为新创建对象的原型 - * @return { Object } 新的对象, 该对象的原型是给定的protoObject对象 - * @example - * ```javascript - * - * var protoObject = { sayHello: function () { console.log('Hello UEditor!'); } }; - * - * var newObject = UE.utils.makeInstance( protoObject ); - * //output: Hello UEditor! - * newObject.sayHello(); - * ``` - */ - makeInstance: function(obj) { - var noop = new Function(); - noop.prototype = obj; - obj = new noop(); - noop.prototype = null; - return obj; - }, - - /** - * 将source对象中的属性扩展到target对象上 - * @method extend - * @remind 该方法将强制把source对象上的属性复制到target对象上 - * @see UE.utils.extend(Object,Object,Boolean) - * @param { Object } target 目标对象, 新的属性将附加到该对象上 - * @param { Object } source 源对象, 该对象的属性会被附加到target对象上 - * @return { Object } 返回target对象 - * @example - * ```javascript - * - * var target = { name: 'target', sex: 1 }, - * source = { name: 'source', age: 17 }; - * - * UE.utils.extend( target, source ); - * - * //output: { name: 'source', sex: 1, age: 17 } - * console.log( target ); - * - * ``` - */ - - /** - * 将source对象中的属性扩展到target对象上, 根据指定的isKeepTarget值决定是否保留目标对象中与 - * 源对象属性名相同的属性值。 - * @method extend - * @param { Object } target 目标对象, 新的属性将附加到该对象上 - * @param { Object } source 源对象, 该对象的属性会被附加到target对象上 - * @param { Boolean } isKeepTarget 是否保留目标对象中与源对象中属性名相同的属性 - * @return { Object } 返回target对象 - * @example - * ```javascript - * - * var target = { name: 'target', sex: 1 }, - * source = { name: 'source', age: 17 }; - * - * UE.utils.extend( target, source, true ); - * - * //output: { name: 'target', sex: 1, age: 17 } - * console.log( target ); - * - * ``` - */ - extend: function(t, s, b) { - if (s) { - for (var k in s) { - if (!b || !t.hasOwnProperty(k)) { - t[k] = s[k]; - } - } - } - return t; - }, - - /** - * 将给定的多个对象的属性复制到目标对象target上 - * @method extend2 - * @remind 该方法将强制把源对象上的属性复制到target对象上 - * @remind 该方法支持两个及以上的参数, 从第二个参数开始, 其属性都会被复制到第一个参数上。 如果遇到同名的属性, - * 将会覆盖掉之前的值。 - * @param { Object } target 目标对象, 新的属性将附加到该对象上 - * @param { Object... } source 源对象, 支持多个对象, 该对象的属性会被附加到target对象上 - * @return { Object } 返回target对象 - * @example - * ```javascript - * - * var target = {}, - * source1 = { name: 'source', age: 17 }, - * source2 = { title: 'dev' }; - * - * UE.utils.extend2( target, source1, source2 ); - * - * //output: { name: 'source', age: 17, title: 'dev' } - * console.log( target ); - * - * ``` - */ - extend2: function(t) { - var a = arguments; - for (var i = 1; i < a.length; i++) { - var x = a[i]; - for (var k in x) { - if (!t.hasOwnProperty(k)) { - t[k] = x[k]; - } - } - } - return t; - }, - - /** - * 模拟继承机制, 使得subClass继承自superClass - * @method inherits - * @param { Object } subClass 子类对象 - * @param { Object } superClass 超类对象 - * @warning 该方法只能让subClass继承超类的原型, subClass对象自身的属性和方法不会被继承 - * @return { Object } 继承superClass后的子类对象 - * @example - * ```javascript - * function SuperClass(){ - * this.name = "小李"; - * } - * - * SuperClass.prototype = { - * hello:function(str){ - * console.log(this.name + str); - * } - * } - * - * function SubClass(){ - * this.name = "小张"; - * } - * - * UE.utils.inherits(SubClass,SuperClass); - * - * var sub = new SubClass(); - * //output: '小张早上好! - * sub.hello("早上好!"); - * ``` - */ - inherits: function(subClass, superClass) { - var oldP = subClass.prototype, - newP = utils.makeInstance(superClass.prototype); - utils.extend(newP, oldP, true); - subClass.prototype = newP; - return (newP.constructor = subClass); - }, - - /** - * 用指定的context对象作为函数fn的上下文 - * @method bind - * @param { Function } fn 需要绑定上下文的函数对象 - * @param { Object } content 函数fn新的上下文对象 - * @return { Function } 一个新的函数, 该函数作为原始函数fn的代理, 将完成fn的上下文调换工作。 - * @example - * ```javascript - * - * var name = 'window', - * newTest = null; - * - * function test () { - * console.log( this.name ); - * } - * - * newTest = UE.utils.bind( test, { name: 'object' } ); - * - * //output: object - * newTest(); - * - * //output: window - * test(); - * - * ``` - */ - bind: function(fn, context) { - return function() { - return fn.apply(context, arguments); - }; - }, - - /** - * 创建延迟指定时间后执行的函数fn - * @method defer - * @param { Function } fn 需要延迟执行的函数对象 - * @param { int } delay 延迟的时间, 单位是毫秒 - * @warning 该方法的时间控制是不精确的,仅仅只能保证函数的执行是在给定的时间之后, - * 而不能保证刚好到达延迟时间时执行。 - * @return { Function } 目标函数fn的代理函数, 只有执行该函数才能起到延时效果 - * @example - * ```javascript - * var start = 0; - * - * function test(){ - * console.log( new Date() - start ); - * } - * - * var testDefer = UE.utils.defer( test, 1000 ); - * // - * start = new Date(); - * //output: (大约在1000毫秒之后输出) 1000 - * testDefer(); - * ``` - */ - - /** - * 创建延迟指定时间后执行的函数fn, 如果在延迟时间内再次执行该方法, 将会根据指定的exclusion的值, - * 决定是否取消前一次函数的执行, 如果exclusion的值为true, 则取消执行,反之,将继续执行前一个方法。 - * @method defer - * @param { Function } fn 需要延迟执行的函数对象 - * @param { int } delay 延迟的时间, 单位是毫秒 - * @param { Boolean } exclusion 如果在延迟时间内再次执行该函数,该值将决定是否取消执行前一次函数的执行, - * 值为true表示取消执行, 反之则将在执行前一次函数之后才执行本次函数调用。 - * @warning 该方法的时间控制是不精确的,仅仅只能保证函数的执行是在给定的时间之后, - * 而不能保证刚好到达延迟时间时执行。 - * @return { Function } 目标函数fn的代理函数, 只有执行该函数才能起到延时效果 - * @example - * ```javascript - * - * function test(){ - * console.log(1); - * } - * - * var testDefer = UE.utils.defer( test, 1000, true ); - * - * //output: (两次调用仅有一次输出) 1 - * testDefer(); - * testDefer(); - * ``` - */ - defer: function(fn, delay, exclusion) { - var timerID; - return function() { - if (exclusion) { - clearTimeout(timerID); - } - timerID = setTimeout(fn, delay); - }; - }, - - /** - * 获取元素item在数组array中首次出现的位置, 如果未找到item, 则返回-1 - * @method indexOf - * @remind 该方法的匹配过程使用的是恒等“===” - * @param { Array } array 需要查找的数组对象 - * @param { * } item 需要在目标数组中查找的值 - * @return { int } 返回item在目标数组array中首次出现的位置, 如果在数组中未找到item, 则返回-1 - * @example - * ```javascript - * var item = 1, - * arr = [ 3, 4, 6, 8, 1, 1, 2 ]; - * - * //output: 4 - * console.log( UE.utils.indexOf( arr, item ) ); - * ``` - */ - - /** - * 获取元素item数组array中首次出现的位置, 如果未找到item, 则返回-1。通过start的值可以指定搜索的起始位置。 - * @method indexOf - * @remind 该方法的匹配过程使用的是恒等“===” - * @param { Array } array 需要查找的数组对象 - * @param { * } item 需要在目标数组中查找的值 - * @param { int } start 搜索的起始位置 - * @return { int } 返回item在目标数组array中的start位置之后首次出现的位置, 如果在数组中未找到item, 则返回-1 - * @example - * ```javascript - * var item = 1, - * arr = [ 3, 4, 6, 8, 1, 2, 8, 3, 2, 1, 1, 4 ]; - * - * //output: 9 - * console.log( UE.utils.indexOf( arr, item, 5 ) ); - * ``` - */ - indexOf: function(array, item, start) { - var index = -1; - start = this.isNumber(start) ? start : 0; - this.each(array, function(v, i) { - if (i >= start && v === item) { - index = i; - return false; - } - }); - return index; - }, - - /** - * 移除数组array中所有的元素item - * @method removeItem - * @param { Array } array 要移除元素的目标数组 - * @param { * } item 将要被移除的元素 - * @remind 该方法的匹配过程使用的是恒等“===” - * @example - * ```javascript - * var arr = [ 4, 5, 7, 1, 3, 4, 6 ]; - * - * UE.utils.removeItem( arr, 4 ); - * //output: [ 5, 7, 1, 3, 6 ] - * console.log( arr ); - * - * ``` - */ - removeItem: function(array, item) { - for (var i = 0, l = array.length; i < l; i++) { - if (array[i] === item) { - array.splice(i, 1); - i--; - } - } - }, - - /** - * 删除字符串str的首尾空格 - * @method trim - * @param { String } str 需要删除首尾空格的字符串 - * @return { String } 删除了首尾的空格后的字符串 - * @example - * ```javascript - * - * var str = " UEdtior "; - * - * //output: 9 - * console.log( str.length ); - * - * //output: 7 - * console.log( UE.utils.trim( " UEdtior " ).length ); - * - * //output: 9 - * console.log( str.length ); - * - * ``` - */ - trim: function(str) { - return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, ""); - }, - - /** - * 将字符串str以','分隔成数组后,将该数组转换成哈希对象, 其生成的hash对象的key为数组中的元素, value为1 - * @method listToMap - * @warning 该方法在生成的hash对象中,会为每一个key同时生成一个另一个全大写的key。 - * @param { String } str 该字符串将被以','分割为数组, 然后进行转化 - * @return { Object } 转化之后的hash对象 - * @example - * ```javascript - * - * //output: Object {UEdtior: 1, UEDTIOR: 1, Hello: 1, HELLO: 1} - * console.log( UE.utils.listToMap( 'UEdtior,Hello' ) ); - * - * ``` - */ - - /** - * 将字符串数组转换成哈希对象, 其生成的hash对象的key为数组中的元素, value为1 - * @method listToMap - * @warning 该方法在生成的hash对象中,会为每一个key同时生成一个另一个全大写的key。 - * @param { Array } arr 字符串数组 - * @return { Object } 转化之后的hash对象 - * @example - * ```javascript - * - * //output: Object {UEdtior: 1, UEDTIOR: 1, Hello: 1, HELLO: 1} - * console.log( UE.utils.listToMap( [ 'UEdtior', 'Hello' ] ) ); - * - * ``` - */ - listToMap: function(list) { - if (!list) return {}; - list = utils.isArray(list) ? list : list.split(","); - for (var i = 0, ci, obj = {}; (ci = list[i++]); ) { - obj[ci.toUpperCase()] = obj[ci] = 1; - } - return obj; - }, - - /** - * 将str中的html符号转义,将转义“',&,<,",>,”,“”七个字符 - * @method unhtml - * @param { String } str 需要转义的字符串 - * @return { String } 转义后的字符串 - * @example - * ```javascript - * var html = '&'; - * - * //output: <body>&</body> - * console.log( UE.utils.unhtml( html ) ); - * - * ``` - */ - unhtml: function(str, reg) { - return str - ? str.replace( - reg || /[&<">'](?:(amp|lt|ldquo|rdquo|quot|gt|#39|nbsp|#\d+);)?/g, - function(a, b) { - if (b) { - return a; - } else { - return { - "<": "<", - "&": "&", - '"': """, - "“": "“", - "”": "”", - ">": ">", - "'": "'" - }[a]; - } - } - ) - : ""; - }, - - /** - * 将str中的转义字符还原成html字符 - * @see UE.utils.unhtml(String); - * @method html - * @param { String } str 需要逆转义的字符串 - * @return { String } 逆转义后的字符串 - * @example - * ```javascript - * - * var str = '<body>&</body>'; - * - * //output: & - * console.log( UE.utils.html( str ) ); - * - * ``` - */ - html: function(str) { - return str - ? str.replace(/&((g|l|quo|ldquo|rdquo)t|amp|#39|nbsp);/g, function(m) { - return { - "<": "<", - "&": "&", - """: '"', - "“": "“", - "”": "”", - ">": ">", - "'": "'", - " ": " " - }[m]; - }) - : ""; - }, - - /** - * 将css样式转换为驼峰的形式 - * @method cssStyleToDomStyle - * @param { String } cssName 需要转换的css样式名 - * @return { String } 转换成驼峰形式后的css样式名 - * @example - * ```javascript - * - * var str = 'border-top'; - * - * //output: borderTop - * console.log( UE.utils.cssStyleToDomStyle( str ) ); - * - * ``` - */ - cssStyleToDomStyle: (function() { - var test = document.createElement("div").style, - cache = { - float: test.cssFloat != undefined - ? "cssFloat" - : test.styleFloat != undefined ? "styleFloat" : "float" - }; - - return function(cssName) { - return ( - cache[cssName] || - (cache[cssName] = cssName.toLowerCase().replace(/-./g, function(match) { - return match.charAt(1).toUpperCase(); - })) - ); - }; - })(), - - /** - * 动态加载文件到doc中 - * @method loadFile - * @param { DomDocument } document 需要加载资源文件的文档对象 - * @param { Object } options 加载资源文件的属性集合, 取值请参考代码示例 - * @example - * ```javascript - * - * UE.utils.loadFile( document, { - * src:"test.js", - * tag:"script", - * type:"text/javascript", - * defer:"defer" - * } ); - * - * ``` - */ - - /** - * 动态加载文件到doc中,加载成功后执行的回调函数fn - * @method loadFile - * @param { DomDocument } document 需要加载资源文件的文档对象 - * @param { Object } options 加载资源文件的属性集合, 该集合支持的值是script标签和style标签支持的所有属性。 - * @param { Function } fn 资源文件加载成功之后执行的回调 - * @warning 对于在同一个文档中多次加载同一URL的文件, 该方法会在第一次加载之后缓存该请求, - * 在此之后的所有同一URL的请求, 将会直接触发回调。 - * @example - * ```javascript - * - * UE.utils.loadFile( document, { - * src:"test.js", - * tag:"script", - * type:"text/javascript", - * defer:"defer" - * }, function () { - * console.log('加载成功'); - * } ); - * - * ``` - */ - loadFile: (function() { - var tmpList = []; - - function getItem(doc, obj) { - try { - for (var i = 0, ci; (ci = tmpList[i++]); ) { - if (ci.doc === doc && ci.url == (obj.src || obj.href)) { - return ci; - } - } - } catch (e) { - return null; - } - } - - return function(doc, obj, fn) { - var item = getItem(doc, obj); - if (item) { - if (item.ready) { - fn && fn(); - } else { - item.funs.push(fn); - } - return; - } - tmpList.push({ - doc: doc, - url: obj.src || obj.href, - funs: [fn] - }); - if (!doc.body) { - var html = []; - for (var p in obj) { - if (p == "tag") continue; - html.push(p + '="' + obj[p] + '"'); - } - doc.write( - "<" + obj.tag + " " + html.join(" ") + " >" - ); - return; - } - if (obj.id && doc.getElementById(obj.id)) { - return; - } - var element = doc.createElement(obj.tag); - delete obj.tag; - for (var p in obj) { - element.setAttribute(p, obj[p]); - } - element.onload = element.onreadystatechange = function() { - if (!this.readyState || /loaded|complete/.test(this.readyState)) { - item = getItem(doc, obj); - if (item.funs.length > 0) { - item.ready = 1; - for (var fi; (fi = item.funs.pop()); ) { - fi(); - } - } - element.onload = element.onreadystatechange = null; - } - }; - element.onerror = function() { - throw Error( - "The load " + - (obj.href || obj.src) + - " fails,check the url settings of file neditor.config.js " - ); - }; - doc.getElementsByTagName("head")[0].appendChild(element); - }; - })(), - - /** - * 判断obj对象是否为空 - * @method isEmptyObject - * @param { * } obj 需要判断的对象 - * @remind 如果判断的对象是NULL, 将直接返回true, 如果是数组且为空, 返回true, 如果是字符串, 且字符串为空, - * 返回true, 如果是普通对象, 且该对象没有任何实例属性, 返回true - * @return { Boolean } 对象是否为空 - * @example - * ```javascript - * - * //output: true - * console.log( UE.utils.isEmptyObject( {} ) ); - * - * //output: true - * console.log( UE.utils.isEmptyObject( [] ) ); - * - * //output: true - * console.log( UE.utils.isEmptyObject( "" ) ); - * - * //output: false - * console.log( UE.utils.isEmptyObject( { key: 1 } ) ); - * - * //output: false - * console.log( UE.utils.isEmptyObject( [1] ) ); - * - * //output: false - * console.log( UE.utils.isEmptyObject( "1" ) ); - * - * ``` - */ - isEmptyObject: function(obj) { - if (obj == null) return true; - if (this.isArray(obj) || this.isString(obj)) return obj.length === 0; - for (var key in obj) if (obj.hasOwnProperty(key)) return false; - return true; - }, - - /** - * 把rgb格式的颜色值转换成16进制格式 - * @method fixColor - * @param { String } rgb格式的颜色值 - * @param { String } - * @example - * rgb(255,255,255) => "#ffffff" - */ - fixColor: function(name, value) { - if (/color/i.test(name) && /rgba?/.test(value)) { - var array = value.split(","); - if (array.length > 3) return ""; - value = "#"; - for (var i = 0, color; (color = array[i++]); ) { - color = parseInt(color.replace(/[^\d]/gi, ""), 10).toString(16); - value += color.length == 1 ? "0" + color : color; - } - value = value.toUpperCase(); - } - return value; - }, - /** - * 只针对border,padding,margin做了处理,因为性能问题 - * @public - * @function - * @param {String} val style字符串 - */ - optCss: function(val) { - var padding, margin, border; - val = val.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi, function( - str, - key, - name, - val - ) { - if (val.split(" ").length == 1) { - switch (key) { - case "padding": - !padding && (padding = {}); - padding[name] = val; - return ""; - case "margin": - !margin && (margin = {}); - margin[name] = val; - return ""; - case "border": - return val == "initial" ? "" : str; - } - } - return str; - }); - - function opt(obj, name) { - if (!obj) { - return ""; - } - var t = obj.top, - b = obj.bottom, - l = obj.left, - r = obj.right, - val = ""; - if (!t || !l || !b || !r) { - for (var p in obj) { - val += ";" + name + "-" + p + ":" + obj[p] + ";"; - } - } else { - val += - ";" + - name + - ":" + - (t == b && b == l && l == r - ? t - : t == b && l == r - ? t + " " + l - : l == r - ? t + " " + l + " " + b - : t + " " + r + " " + b + " " + l) + - ";"; - } - return val; - } - - val += opt(padding, "padding") + opt(margin, "margin"); - return val - .replace(/^[ \n\r\t;]*|[ \n\r\t]*$/, "") - .replace(/;([ \n\r\t]+)|\1;/g, ";") - .replace(/(&((l|g)t|quot|#39))?;{2,}/g, function(a, b) { - return b ? b + ";;" : ";"; - }); - }, - - /** - * 克隆对象 - * @method clone - * @param { Object } source 源对象 - * @return { Object } source的一个副本 - */ - - /** - * 深度克隆对象,将source的属性克隆到target对象, 会覆盖target重名的属性。 - * @method clone - * @param { Object } source 源对象 - * @param { Object } target 目标对象 - * @return { Object } 附加了source对象所有属性的target对象 - */ - clone: function(source, target) { - var tmp; - target = target || {}; - for (var i in source) { - if (source.hasOwnProperty(i)) { - tmp = source[i]; - if (typeof tmp == "object") { - target[i] = utils.isArray(tmp) ? [] : {}; - utils.clone(source[i], target[i]); - } else { - target[i] = tmp; - } - } - } - return target; - }, - - /** - * 把cm/pt为单位的值转换为px为单位的值 - * @method transUnitToPx - * @param { String } 待转换的带单位的字符串 - * @return { String } 转换为px为计量单位的值的字符串 - * @example - * ```javascript - * - * //output: 500px - * console.log( UE.utils.transUnitToPx( '20cm' ) ); - * - * //output: 27px - * console.log( UE.utils.transUnitToPx( '20pt' ) ); - * - * ``` - */ - transUnitToPx: function(val) { - if (!/(pt|cm)/.test(val)) { - return val; - } - var unit; - val.replace(/([\d.]+)(\w+)/, function(str, v, u) { - val = v; - unit = u; - }); - switch (unit) { - case "cm": - val = parseFloat(val) * 25; - break; - case "pt": - val = Math.round(parseFloat(val) * 96 / 72); - } - return val + (val ? "px" : ""); - }, - - /** - * 在dom树ready之后执行给定的回调函数 - * @method domReady - * @remind 如果在执行该方法的时候, dom树已经ready, 那么回调函数将立刻执行 - * @param { Function } fn dom树ready之后的回调函数 - * @example - * ```javascript - * - * UE.utils.domReady( function () { - * - * console.log('123'); - * - * } ); - * - * ``` - */ - domReady: (function() { - var fnArr = []; - - function doReady(doc) { - //确保onready只执行一次 - doc.isReady = true; - for (var ci; (ci = fnArr.pop()); ci()) {} - } - - return function(onready, win) { - win = win || window; - var doc = win.document; - onready && fnArr.push(onready); - if (doc.readyState === "complete") { - doReady(doc); - } else { - doc.isReady && doReady(doc); - if (browser.ie && browser.version != 11) { - (function() { - if (doc.isReady) return; - try { - doc.documentElement.doScroll("left"); - } catch (error) { - setTimeout(arguments.callee, 0); - return; - } - doReady(doc); - })(); - win.attachEvent("onload", function() { - doReady(doc); - }); - } else { - doc.addEventListener( - "DOMContentLoaded", - function() { - doc.removeEventListener( - "DOMContentLoaded", - arguments.callee, - false - ); - doReady(doc); - }, - false - ); - win.addEventListener( - "load", - function() { - doReady(doc); - }, - false - ); - } - } - }; - })(), - - /** - * 动态添加css样式 - * @method cssRule - * @param { String } 节点名称 - * @grammar UE.utils.cssRule('添加的样式的节点名称',['样式','放到哪个document上']) - * @grammar UE.utils.cssRule('body','body{background:#ccc}') => null //给body添加背景颜色 - * @grammar UE.utils.cssRule('body') =>样式的字符串 //取得key值为body的样式的内容,如果没有找到key值先关的样式将返回空,例如刚才那个背景颜色,将返回 body{background:#ccc} - * @grammar UE.utils.cssRule('body',document) => 返回指定key的样式,并且指定是哪个document - * @grammar UE.utils.cssRule('body','') =>null //清空给定的key值的背景颜色 - */ - cssRule: browser.ie && browser.version != 11 - ? function(key, style, doc) { - var indexList, index; - if ( - style === undefined || - (style && style.nodeType && style.nodeType == 9) - ) { - //获取样式 - doc = style && style.nodeType && style.nodeType == 9 - ? style - : doc || document; - indexList = doc.indexList || (doc.indexList = {}); - index = indexList[key]; - if (index !== undefined) { - return doc.styleSheets[index].cssText; - } - return undefined; - } - doc = doc || document; - indexList = doc.indexList || (doc.indexList = {}); - index = indexList[key]; - //清除样式 - if (style === "") { - if (index !== undefined) { - doc.styleSheets[index].cssText = ""; - delete indexList[key]; - return true; - } - return false; - } - - //添加样式 - if (index !== undefined) { - sheetStyle = doc.styleSheets[index]; - } else { - sheetStyle = doc.createStyleSheet( - "", - (index = doc.styleSheets.length) - ); - indexList[key] = index; - } - sheetStyle.cssText = style; - } - : function(key, style, doc) { - var head, node; - if ( - style === undefined || - (style && style.nodeType && style.nodeType == 9) - ) { - //获取样式 - doc = style && style.nodeType && style.nodeType == 9 - ? style - : doc || document; - node = doc.getElementById(key); - return node ? node.innerHTML : undefined; - } - doc = doc || document; - node = doc.getElementById(key); - - //清除样式 - if (style === "") { - if (node) { - node.parentNode.removeChild(node); - return true; - } - return false; - } - - //添加样式 - if (node) { - node.innerHTML = style; - } else { - node = doc.createElement("style"); - node.id = key; - node.innerHTML = style; - doc.getElementsByTagName("head")[0].appendChild(node); - } - }, - sort: function(array, compareFn) { - compareFn = - compareFn || - function(item1, item2) { - return item1.localeCompare(item2); - }; - for (var i = 0, len = array.length; i < len; i++) { - for (var j = i, length = array.length; j < length; j++) { - if (compareFn(array[i], array[j]) > 0) { - var t = array[i]; - array[i] = array[j]; - array[j] = t; - } - } - } - return array; - }, - serializeParam: function(json) { - var strArr = []; - for (var i in json) { - //忽略默认的几个参数 - if (i == "method" || i == "timeout" || i == "async") continue; - //传递过来的对象和函数不在提交之列 - if ( - !( - (typeof json[i]).toLowerCase() == "function" || - (typeof json[i]).toLowerCase() == "object" - ) - ) { - strArr.push(encodeURIComponent(i) + "=" + encodeURIComponent(json[i])); - } else if (utils.isArray(json[i])) { - //支持传数组内容 - for (var j = 0; j < json[i].length; j++) { - strArr.push( - encodeURIComponent(i) + "[]=" + encodeURIComponent(json[i][j]) - ); - } - } - } - return strArr.join("&"); - }, - formatUrl: function(url) { - var u = url.replace(/&&/g, "&"); - u = u.replace(/\?&/g, "?"); - u = u.replace(/&$/g, ""); - u = u.replace(/&#/g, "#"); - u = u.replace(/&+/g, "&"); - return u; - }, - isCrossDomainUrl: function(url) { - var a = document.createElement("a"); - a.href = url; - if (browser.ie) { - a.href = a.href; - } - return !( - a.protocol == location.protocol && - a.hostname == location.hostname && - (a.port == location.port || - (a.port == "80" && location.port == "") || - (a.port == "" && location.port == "80")) - ); - }, - clearEmptyAttrs: function(obj) { - for (var p in obj) { - if (obj[p] === "") { - delete obj[p]; - } - } - return obj; - }, - str2json: function(s) { - if (!utils.isString(s)) return null; - if (window.JSON) { - return JSON.parse(s); - } else { - return new Function("return " + utils.trim(s || ""))(); - } - }, - json2str: (function() { - if (window.JSON) { - return JSON.stringify; - } else { - var escapeMap = { - "\b": "\\b", - "\t": "\\t", - "\n": "\\n", - "\f": "\\f", - "\r": "\\r", - '"': '\\"', - "\\": "\\\\" - }; - - function encodeString(source) { - if (/["\\\x00-\x1f]/.test(source)) { - source = source.replace(/["\\\x00-\x1f]/g, function(match) { - var c = escapeMap[match]; - if (c) { - return c; - } - c = match.charCodeAt(); - return ( - "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16) - ); - }); - } - return '"' + source + '"'; - } - - function encodeArray(source) { - var result = ["["], - l = source.length, - preComma, - i, - item; - - for (i = 0; i < l; i++) { - item = source[i]; - - switch (typeof item) { - case "undefined": - case "function": - case "unknown": - break; - default: - if (preComma) { - result.push(","); - } - result.push(utils.json2str(item)); - preComma = 1; - } - } - result.push("]"); - return result.join(""); - } - - function pad(source) { - return source < 10 ? "0" + source : source; - } - - function encodeDate(source) { - return ( - '"' + - source.getFullYear() + - "-" + - pad(source.getMonth() + 1) + - "-" + - pad(source.getDate()) + - "T" + - pad(source.getHours()) + - ":" + - pad(source.getMinutes()) + - ":" + - pad(source.getSeconds()) + - '"' - ); - } - - return function(value) { - switch (typeof value) { - case "undefined": - return "undefined"; - - case "number": - return isFinite(value) ? String(value) : "null"; - - case "string": - return encodeString(value); - - case "boolean": - return String(value); - - default: - if (value === null) { - return "null"; - } else if (utils.isArray(value)) { - return encodeArray(value); - } else if (utils.isDate(value)) { - return encodeDate(value); - } else { - var result = ["{"], - encode = utils.json2str, - preComma, - item; - - for (var key in value) { - if (Object.prototype.hasOwnProperty.call(value, key)) { - item = value[key]; - switch (typeof item) { - case "undefined": - case "unknown": - case "function": - break; - default: - if (preComma) { - result.push(","); - } - preComma = 1; - result.push(encode(key) + ":" + encode(item)); - } - } - } - result.push("}"); - return result.join(""); - } - } - }; - } - })(), - renderTplstr: function(tpl, data) { - return tpl.replace(/\$\{\s*(\w*?)\s*\}/g, function (match, variable) { - if (data.hasOwnProperty(variable)) { - return data[variable]; - } - }); - } -}); -/** - * 判断给定的对象是否是字符串 - * @method isString - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是字符串 - */ - -/** - * 判断给定的对象是否是数组 - * @method isArray - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是数组 - */ - -/** - * 判断给定的对象是否是一个Function - * @method isFunction - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是Function - */ - -/** - * 判断给定的对象是否是Number - * @method isNumber - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是Number - */ - -/** - * 判断给定的对象是否是一个正则表达式 - * @method isRegExp - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是正则表达式 - */ - -/** - * 判断给定的对象是否是一个普通对象 - * @method isObject - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是普通对象 - */ -utils.each( - ["String", "Function", "Array", "Number", "RegExp", "Object", "Date"], - function(v) { - UE.utils["is" + v] = function(obj) { - return Object.prototype.toString.apply(obj) == "[object " + v + "]"; - }; - } -); - - -// core/EventBase.js -/** - * UE采用的事件基类 - * @file - * @module UE - * @class EventBase - * @since 1.2.6.1 - */ - -/** - * UEditor公用空间,UEditor所有的功能都挂载在该空间下 - * @unfile - * @module UE - */ - -/** - * UE采用的事件基类,继承此类的对应类将获取addListener,removeListener,fireEvent方法。 - * 在UE中,Editor以及所有ui实例都继承了该类,故可以在对应的ui对象以及editor对象上使用上述方法。 - * @unfile - * @module UE - * @class EventBase - */ - -/** - * 通过此构造器,子类可以继承EventBase获取事件监听的方法 - * @constructor - * @example - * ```javascript - * UE.EventBase.call(editor); - * ``` - */ -var EventBase = (UE.EventBase = function() {}); - -EventBase.prototype = { - /** - * 注册事件监听器 - * @method addListener - * @param { String } types 监听的事件名称,同时监听多个事件使用空格分隔 - * @param { Function } fn 监听的事件被触发时,会执行该回调函数 - * @waining 事件被触发时,监听的函数假如返回的值恒等于true,回调函数的队列中后面的函数将不执行 - * @example - * ```javascript - * editor.addListener('selectionchange',function(){ - * console.log("选区已经变化!"); - * }) - * editor.addListener('beforegetcontent aftergetcontent',function(type){ - * if(type == 'beforegetcontent'){ - * //do something - * }else{ - * //do something - * } - * console.log(this.getContent) // this是注册的事件的编辑器实例 - * }) - * ``` - * @see UE.EventBase:fireEvent(String) - */ - addListener: function(types, listener) { - types = utils.trim(types).split(/\s+/); - for (var i = 0, ti; (ti = types[i++]); ) { - getListener(this, ti, true).push(listener); - } - }, - - on: function(types, listener) { - return this.addListener(types, listener); - }, - off: function(types, listener) { - return this.removeListener(types, listener); - }, - trigger: function() { - return this.fireEvent.apply(this, arguments); - }, - /** - * 移除事件监听器 - * @method removeListener - * @param { String } types 移除的事件名称,同时移除多个事件使用空格分隔 - * @param { Function } fn 移除监听事件的函数引用 - * @example - * ```javascript - * //changeCallback为方法体 - * editor.removeListener("selectionchange",changeCallback); - * ``` - */ - removeListener: function(types, listener) { - types = utils.trim(types).split(/\s+/); - for (var i = 0, ti; (ti = types[i++]); ) { - utils.removeItem(getListener(this, ti) || [], listener); - } - }, - - /** - * 触发事件 - * @method fireEvent - * @param { String } types 触发的事件名称,同时触发多个事件使用空格分隔 - * @remind 该方法会触发addListener - * @return { * } 返回触发事件的队列中,最后执行的回调函数的返回值 - * @example - * ```javascript - * editor.fireEvent("selectionchange"); - * ``` - */ - - /** - * 触发事件 - * @method fireEvent - * @param { String } types 触发的事件名称,同时触发多个事件使用空格分隔 - * @param { *... } options 可选参数,可以传入一个或多个参数,会传给事件触发的回调函数 - * @return { * } 返回触发事件的队列中,最后执行的回调函数的返回值 - * @example - * ```javascript - * - * editor.addListener( "selectionchange", function ( type, arg1, arg2 ) { - * - * console.log( arg1 + " " + arg2 ); - * - * } ); - * - * //触发selectionchange事件, 会执行上面的事件监听器 - * //output: Hello World - * editor.fireEvent("selectionchange", "Hello", "World"); - * ``` - */ - fireEvent: function() { - var types = arguments[0]; - types = utils.trim(types).split(" "); - for (var i = 0, ti; (ti = types[i++]); ) { - var listeners = getListener(this, ti), - r, - t, - k; - if (listeners) { - k = listeners.length; - while (k--) { - if (!listeners[k]) continue; - t = listeners[k].apply(this, arguments); - if (t === true) { - return t; - } - if (t !== undefined) { - r = t; - } - } - } - if ((t = this["on" + ti.toLowerCase()])) { - r = t.apply(this, arguments); - } - } - return r; - } -}; -/** - * 获得对象所拥有监听类型的所有监听器 - * @unfile - * @module UE - * @since 1.2.6.1 - * @method getListener - * @public - * @param { Object } obj 查询监听器的对象 - * @param { String } type 事件类型 - * @param { Boolean } force 为true且当前所有type类型的侦听器不存在时,创建一个空监听器数组 - * @return { Array } 监听器数组 - */ -function getListener(obj, type, force) { - var allListeners; - type = type.toLowerCase(); - return ( - (allListeners = - obj.__allListeners || (force && (obj.__allListeners = {}))) && - (allListeners[type] || (force && (allListeners[type] = []))) - ); -} - - -// core/dtd.js -///import editor.js -///import core/dom/dom.js -///import core/utils.js -/** - * dtd html语义化的体现类 - * @constructor - * @namespace dtd - */ -var dtd = (dom.dtd = (function() { - function _(s) { - for (var k in s) { - s[k.toUpperCase()] = s[k]; - } - return s; - } - var X = utils.extend2; - var A = _({ isindex: 1, fieldset: 1 }), - B = _({ input: 1, button: 1, select: 1, textarea: 1, label: 1 }), - C = X(_({ a: 1 }), B), - D = X({ iframe: 1 }, C), - E = _({ - hr: 1, - ul: 1, - menu: 1, - div: 1, - blockquote: 1, - noscript: 1, - table: 1, - center: 1, - address: 1, - dir: 1, - pre: 1, - h5: 1, - dl: 1, - h4: 1, - noframes: 1, - h6: 1, - ol: 1, - h1: 1, - h3: 1, - h2: 1 - }), - F = _({ ins: 1, del: 1, script: 1, style: 1 }), - G = X( - _({ - mark: 1, - b: 1, - acronym: 1, - bdo: 1, - var: 1, - "#": 1, - abbr: 1, - code: 1, - br: 1, - i: 1, - cite: 1, - kbd: 1, - u: 1, - strike: 1, - s: 1, - tt: 1, - strong: 1, - q: 1, - samp: 1, - em: 1, - dfn: 1, - span: 1 - }), - F - ), - H = X( - _({ - sub: 1, - img: 1, - embed: 1, - object: 1, - sup: 1, - basefont: 1, - map: 1, - applet: 1, - font: 1, - big: 1, - small: 1 - }), - G - ), - I = X(_({ p: 1 }), H), - J = X(_({ iframe: 1 }), H, B), - K = _({ - img: 1, - embed: 1, - noscript: 1, - br: 1, - kbd: 1, - center: 1, - button: 1, - basefont: 1, - h5: 1, - h4: 1, - samp: 1, - h6: 1, - ol: 1, - h1: 1, - h3: 1, - h2: 1, - form: 1, - font: 1, - "#": 1, - select: 1, - menu: 1, - ins: 1, - abbr: 1, - label: 1, - code: 1, - table: 1, - script: 1, - cite: 1, - input: 1, - iframe: 1, - strong: 1, - textarea: 1, - noframes: 1, - big: 1, - small: 1, - span: 1, - hr: 1, - sub: 1, - bdo: 1, - var: 1, - div: 1, - object: 1, - sup: 1, - strike: 1, - dir: 1, - map: 1, - dl: 1, - applet: 1, - del: 1, - isindex: 1, - fieldset: 1, - ul: 1, - b: 1, - acronym: 1, - a: 1, - blockquote: 1, - i: 1, - u: 1, - s: 1, - tt: 1, - address: 1, - q: 1, - pre: 1, - p: 1, - em: 1, - dfn: 1 - }), - L = X(_({ a: 0 }), J), //a不能被切开,所以把他 - M = _({ tr: 1 }), - N = _({ "#": 1 }), - O = X(_({ param: 1 }), K), - P = X(_({ form: 1 }), A, D, E, I), - Q = _({ li: 1, ol: 1, ul: 1 }), - R = _({ style: 1, script: 1 }), - S = _({ base: 1, link: 1, meta: 1, title: 1 }), - T = X(S, R), - U = _({ head: 1, body: 1 }), - V = _({ html: 1 }); - - var block = _({ - address: 1, - blockquote: 1, - center: 1, - dir: 1, - div: 1, - dl: 1, - fieldset: 1, - form: 1, - h1: 1, - h2: 1, - h3: 1, - h4: 1, - h5: 1, - h6: 1, - hr: 1, - isindex: 1, - menu: 1, - noframes: 1, - ol: 1, - p: 1, - pre: 1, - table: 1, - ul: 1 - }), - empty = _({ - area: 1, - base: 1, - basefont: 1, - br: 1, - col: 1, - command: 1, - dialog: 1, - embed: 1, - hr: 1, - img: 1, - input: 1, - isindex: 1, - keygen: 1, - link: 1, - meta: 1, - param: 1, - source: 1, - track: 1, - wbr: 1 - }); - - return _({ - // $ 表示自定的属性 - - // body外的元素列表. - $nonBodyContent: X(V, U, S), - - //块结构元素列表 - $block: block, - - //内联元素列表 - $inline: L, - - $inlineWithA: X(_({ a: 1 }), L), - - $body: X(_({ script: 1, style: 1 }), block), - - $cdata: _({ script: 1, style: 1 }), - - //自闭和元素 - $empty: empty, - - //不是自闭合,但不能让range选中里边 - $nonChild: _({ iframe: 1, textarea: 1 }), - //列表元素列表 - $listItem: _({ dd: 1, dt: 1, li: 1 }), - - //列表根元素列表 - $list: _({ ul: 1, ol: 1, dl: 1 }), - - //不能认为是空的元素 - $isNotEmpty: _({ - table: 1, - ul: 1, - ol: 1, - dl: 1, - iframe: 1, - area: 1, - base: 1, - col: 1, - hr: 1, - img: 1, - embed: 1, - input: 1, - textarea: 1, - link: 1, - meta: 1, - param: 1, - h1: 1, - h2: 1, - h3: 1, - h4: 1, - h5: 1, - h6: 1 - }), - - //如果没有子节点就可以删除的元素列表,像span,a - $removeEmpty: _({ - a: 1, - abbr: 1, - acronym: 1, - address: 1, - b: 1, - bdo: 1, - big: 1, - cite: 1, - code: 1, - del: 1, - dfn: 1, - em: 1, - font: 1, - i: 1, - ins: 1, - label: 1, - kbd: 1, - q: 1, - s: 1, - samp: 1, - small: 1, - span: 1, - strike: 1, - strong: 1, - sub: 1, - sup: 1, - tt: 1, - u: 1, - var: 1 - }), - - $removeEmptyBlock: _({ p: 1, div: 1 }), - - //在table元素里的元素列表 - $tableContent: _({ - caption: 1, - col: 1, - colgroup: 1, - tbody: 1, - td: 1, - tfoot: 1, - th: 1, - thead: 1, - tr: 1, - table: 1 - }), - //不转换的标签 - $notTransContent: _({ pre: 1, script: 1, style: 1, textarea: 1 }), - html: U, - head: T, - style: N, - script: N, - body: P, - base: {}, - link: {}, - meta: {}, - title: N, - col: {}, - tr: _({ td: 1, th: 1 }), - img: {}, - embed: {}, - colgroup: _({ thead: 1, col: 1, tbody: 1, tr: 1, tfoot: 1 }), - noscript: P, - td: P, - br: {}, - th: P, - center: P, - kbd: L, - button: X(I, E), - basefont: {}, - h5: L, - h4: L, - samp: L, - h6: L, - ol: Q, - h1: L, - h3: L, - option: N, - h2: L, - form: X(A, D, E, I), - select: _({ optgroup: 1, option: 1 }), - font: L, - ins: L, - menu: Q, - abbr: L, - label: L, - table: _({ - thead: 1, - col: 1, - tbody: 1, - tr: 1, - colgroup: 1, - caption: 1, - tfoot: 1 - }), - code: L, - tfoot: M, - cite: L, - li: P, - input: {}, - iframe: P, - strong: L, - textarea: N, - noframes: P, - big: L, - small: L, - //trace: - span: _({ - "#": 1, - br: 1, - b: 1, - strong: 1, - u: 1, - i: 1, - em: 1, - sub: 1, - sup: 1, - strike: 1, - span: 1 - }), - hr: L, - dt: L, - sub: L, - optgroup: _({ option: 1 }), - param: {}, - bdo: L, - var: L, - div: P, - object: O, - sup: L, - dd: P, - strike: L, - area: {}, - dir: Q, - map: X(_({ area: 1, form: 1, p: 1 }), A, F, E), - applet: O, - dl: _({ dt: 1, dd: 1 }), - del: L, - isindex: {}, - fieldset: X(_({ legend: 1 }), K), - thead: M, - ul: Q, - acronym: L, - b: L, - a: X(_({ a: 1 }), J), - blockquote: X(_({ td: 1, tr: 1, tbody: 1, li: 1 }), P), - caption: L, - i: L, - u: L, - tbody: M, - s: L, - address: X(D, I), - tt: L, - legend: L, - q: L, - pre: X(G, C), - p: X(_({ a: 1 }), L), - em: L, - dfn: L, - mark: L - }); -})()); - - -// core/domUtils.js -/** - * Dom操作工具包 - * @file - * @module UE.dom.domUtils - * @since 1.2.6.1 - */ - -/** - * Dom操作工具包 - * @unfile - * @module UE.dom.domUtils - */ -function getDomNode(node, start, ltr, startFromChild, fn, guard) { - var tmpNode = startFromChild && node[start], - parent; - !tmpNode && (tmpNode = node[ltr]); - while (!tmpNode && (parent = (parent || node).parentNode)) { - if (parent.tagName == "BODY" || (guard && !guard(parent))) { - return null; - } - tmpNode = parent[ltr]; - } - if (tmpNode && fn && !fn(tmpNode)) { - return getDomNode(tmpNode, start, ltr, false, fn); - } - return tmpNode; -} -var attrFix = ie && browser.version < 9 - ? { - tabindex: "tabIndex", - readonly: "readOnly", - for: "htmlFor", - class: "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder" - } - : { - tabindex: "tabIndex", - readonly: "readOnly" - }, - styleBlock = utils.listToMap([ - "-webkit-box", - "-moz-box", - "block", - "list-item", - "table", - "table-row-group", - "table-header-group", - "table-footer-group", - "table-row", - "table-column-group", - "table-column", - "table-cell", - "table-caption" - ]); -var domUtils = (dom.domUtils = { - //节点常量 - NODE_ELEMENT: 1, - NODE_DOCUMENT: 9, - NODE_TEXT: 3, - NODE_COMMENT: 8, - NODE_DOCUMENT_FRAGMENT: 11, - - //位置关系 - POSITION_IDENTICAL: 0, - POSITION_DISCONNECTED: 1, - POSITION_FOLLOWING: 2, - POSITION_PRECEDING: 4, - POSITION_IS_CONTAINED: 8, - POSITION_CONTAINS: 16, - //ie6使用其他的会有一段空白出现 - fillChar: ie && browser.version == "6" ? "\ufeff" : "\u200B", - //-------------------------Node部分-------------------------------- - keys: { - /*Backspace*/ 8: 1, - /*Delete*/ 46: 1, - /*Shift*/ 16: 1, - /*Ctrl*/ 17: 1, - /*Alt*/ 18: 1, - 37: 1, - 38: 1, - 39: 1, - 40: 1, - 13: 1 /*enter*/ - }, - /** - * 获取节点A相对于节点B的位置关系 - * @method getPosition - * @param { Node } nodeA 需要查询位置关系的节点A - * @param { Node } nodeB 需要查询位置关系的节点B - * @return { Number } 节点A与节点B的关系 - * @example - * ```javascript - * //output: 20 - * var position = UE.dom.domUtils.getPosition( document.documentElement, document.body ); - * - * switch ( position ) { - * - * //0 - * case UE.dom.domUtils.POSITION_IDENTICAL: - * console.log('元素相同'); - * break; - * //1 - * case UE.dom.domUtils.POSITION_DISCONNECTED: - * console.log('两个节点在不同的文档中'); - * break; - * //2 - * case UE.dom.domUtils.POSITION_FOLLOWING: - * console.log('节点A在节点B之后'); - * break; - * //4 - * case UE.dom.domUtils.POSITION_PRECEDING; - * console.log('节点A在节点B之前'); - * break; - * //8 - * case UE.dom.domUtils.POSITION_IS_CONTAINED: - * console.log('节点A被节点B包含'); - * break; - * case 10: - * console.log('节点A被节点B包含且节点A在节点B之后'); - * break; - * //16 - * case UE.dom.domUtils.POSITION_CONTAINS: - * console.log('节点A包含节点B'); - * break; - * case 20: - * console.log('节点A包含节点B且节点A在节点B之前'); - * break; - * - * } - * ``` - */ - getPosition: function(nodeA, nodeB) { - // 如果两个节点是同一个节点 - if (nodeA === nodeB) { - // domUtils.POSITION_IDENTICAL - return 0; - } - var node, - parentsA = [nodeA], - parentsB = [nodeB]; - node = nodeA; - while ((node = node.parentNode)) { - // 如果nodeB是nodeA的祖先节点 - if (node === nodeB) { - // domUtils.POSITION_IS_CONTAINED + domUtils.POSITION_FOLLOWING - return 10; - } - parentsA.push(node); - } - node = nodeB; - while ((node = node.parentNode)) { - // 如果nodeA是nodeB的祖先节点 - if (node === nodeA) { - // domUtils.POSITION_CONTAINS + domUtils.POSITION_PRECEDING - return 20; - } - parentsB.push(node); - } - parentsA.reverse(); - parentsB.reverse(); - if (parentsA[0] !== parentsB[0]) { - // domUtils.POSITION_DISCONNECTED - return 1; - } - var i = -1; - while ((i++, parentsA[i] === parentsB[i])) {} - nodeA = parentsA[i]; - nodeB = parentsB[i]; - while ((nodeA = nodeA.nextSibling)) { - if (nodeA === nodeB) { - // domUtils.POSITION_PRECEDING - return 4; - } - } - // domUtils.POSITION_FOLLOWING - return 2; - }, - - /** - * 检测节点node在父节点中的索引位置 - * @method getNodeIndex - * @param { Node } node 需要检测的节点对象 - * @return { Number } 该节点在父节点中的位置 - * @see UE.dom.domUtils.getNodeIndex(Node,Boolean) - */ - - /** - * 检测节点node在父节点中的索引位置, 根据给定的mergeTextNode参数决定是否要合并多个连续的文本节点为一个节点 - * @method getNodeIndex - * @param { Node } node 需要检测的节点对象 - * @param { Boolean } mergeTextNode 是否合并多个连续的文本节点为一个节点 - * @return { Number } 该节点在父节点中的位置 - * @example - * ```javascript - * - * var node = document.createElement("div"); - * - * node.appendChild( document.createTextNode( "hello" ) ); - * node.appendChild( document.createTextNode( "world" ) ); - * node.appendChild( node = document.createElement( "div" ) ); - * - * //output: 2 - * console.log( UE.dom.domUtils.getNodeIndex( node ) ); - * - * //output: 1 - * console.log( UE.dom.domUtils.getNodeIndex( node, true ) ); - * - * ``` - */ - getNodeIndex: function(node, ignoreTextNode) { - var preNode = node, - i = 0; - while ((preNode = preNode.previousSibling)) { - if (ignoreTextNode && preNode.nodeType == 3) { - if (preNode.nodeType != preNode.nextSibling.nodeType) { - i++; - } - continue; - } - i++; - } - return i; - }, - - /** - * 检测节点node是否在给定的document对象上 - * @method inDoc - * @param { Node } node 需要检测的节点对象 - * @param { DomDocument } doc 需要检测的document对象 - * @return { Boolean } 该节点node是否在给定的document的dom树上 - * @example - * ```javascript - * - * var node = document.createElement("div"); - * - * //output: false - * console.log( UE.do.domUtils.inDoc( node, document ) ); - * - * document.body.appendChild( node ); - * - * //output: true - * console.log( UE.do.domUtils.inDoc( node, document ) ); - * - * ``` - */ - inDoc: function(node, doc) { - return domUtils.getPosition(node, doc) == 10; - }, - /** - * 根据给定的过滤规则filterFn, 查找符合该过滤规则的node节点的第一个祖先节点, - * 查找的起点是给定node节点的父节点。 - * @method findParent - * @param { Node } node 需要查找的节点 - * @param { Function } filterFn 自定义的过滤方法。 - * @warning 查找的终点是到body节点为止 - * @remind 自定义的过滤方法filterFn接受一个Node对象作为参数, 该对象代表当前执行检测的祖先节点。 如果该 - * 节点满足过滤条件, 则要求返回true, 这时将直接返回该节点作为findParent()的结果, 否则, 请返回false。 - * @return { Node | Null } 如果找到符合过滤条件的节点, 就返回该节点, 否则返回NULL - * @example - * ```javascript - * var filterNode = UE.dom.domUtils.findParent( document.body.firstChild, function ( node ) { - * - * //由于查找的终点是body节点, 所以永远也不会匹配当前过滤器的条件, 即这里永远会返回false - * return node.tagName === "HTML"; - * - * } ); - * - * //output: true - * console.log( filterNode === null ); - * ``` - */ - - /** - * 根据给定的过滤规则filterFn, 查找符合该过滤规则的node节点的第一个祖先节点, - * 如果includeSelf的值为true,则查找的起点是给定的节点node, 否则, 起点是node的父节点 - * @method findParent - * @param { Node } node 需要查找的节点 - * @param { Function } filterFn 自定义的过滤方法。 - * @param { Boolean } includeSelf 查找过程是否包含自身 - * @warning 查找的终点是到body节点为止 - * @remind 自定义的过滤方法filterFn接受一个Node对象作为参数, 该对象代表当前执行检测的祖先节点。 如果该 - * 节点满足过滤条件, 则要求返回true, 这时将直接返回该节点作为findParent()的结果, 否则, 请返回false。 - * @remind 如果includeSelf为true, 则过滤器第一次执行时的参数会是节点本身。 - * 反之, 过滤器第一次执行时的参数将是该节点的父节点。 - * @return { Node | Null } 如果找到符合过滤条件的节点, 就返回该节点, 否则返回NULL - * @example - * ```html - * - * - *
                      - *
                      - * - * - * - * ``` - */ - findParent: function(node, filterFn, includeSelf) { - if (node && !domUtils.isBody(node)) { - node = includeSelf ? node : node.parentNode; - while (node) { - if (!filterFn || filterFn(node) || domUtils.isBody(node)) { - return filterFn && !filterFn(node) && domUtils.isBody(node) - ? null - : node; - } - node = node.parentNode; - } - } - return null; - }, - /** - * 查找node的节点名为tagName的第一个祖先节点, 查找的起点是node节点的父节点。 - * @method findParentByTagName - * @param { Node } node 需要查找的节点对象 - * @param { Array } tagNames 需要查找的父节点的名称数组 - * @warning 查找的终点是到body节点为止 - * @return { Node | NULL } 如果找到符合条件的节点, 则返回该节点, 否则返回NULL - * @example - * ```javascript - * var node = UE.dom.domUtils.findParentByTagName( document.getElementsByTagName("div")[0], [ "BODY" ] ); - * //output: BODY - * console.log( node.tagName ); - * ``` - */ - - /** - * 查找node的节点名为tagName的祖先节点, 如果includeSelf的值为true,则查找的起点是给定的节点node, - * 否则, 起点是node的父节点。 - * @method findParentByTagName - * @param { Node } node 需要查找的节点对象 - * @param { Array } tagNames 需要查找的父节点的名称数组 - * @param { Boolean } includeSelf 查找过程是否包含node节点自身 - * @warning 查找的终点是到body节点为止 - * @return { Node | NULL } 如果找到符合条件的节点, 则返回该节点, 否则返回NULL - * @example - * ```javascript - * var queryTarget = document.getElementsByTagName("div")[0]; - * var node = UE.dom.domUtils.findParentByTagName( queryTarget, [ "DIV" ], true ); - * //output: true - * console.log( queryTarget === node ); - * ``` - */ - findParentByTagName: function(node, tagNames, includeSelf, excludeFn) { - tagNames = utils.listToMap(utils.isArray(tagNames) ? tagNames : [tagNames]); - return domUtils.findParent( - node, - function(node) { - return tagNames[node.tagName] && !(excludeFn && excludeFn(node)); - }, - includeSelf - ); - }, - /** - * 查找节点node的祖先节点集合, 查找的起点是给定节点的父节点,结果集中不包含给定的节点。 - * @method findParents - * @param { Node } node 需要查找的节点对象 - * @return { Array } 给定节点的祖先节点数组 - * @grammar UE.dom.domUtils.findParents(node) => Array //返回一个祖先节点数组集合,不包含自身 - * @grammar UE.dom.domUtils.findParents(node,includeSelf) => Array //返回一个祖先节点数组集合,includeSelf指定是否包含自身 - * @grammar UE.dom.domUtils.findParents(node,includeSelf,filterFn) => Array //返回一个祖先节点数组集合,filterFn指定过滤条件,返回true的node将被选取 - * @grammar UE.dom.domUtils.findParents(node,includeSelf,filterFn,closerFirst) => Array //返回一个祖先节点数组集合,closerFirst为true的话,node的直接父亲节点是数组的第0个 - */ - - /** - * 查找节点node的祖先节点集合, 如果includeSelf的值为true, - * 则返回的结果集中允许出现当前给定的节点, 否则, 该节点不会出现在其结果集中。 - * @method findParents - * @param { Node } node 需要查找的节点对象 - * @param { Boolean } includeSelf 查找的结果中是否允许包含当前查找的节点对象 - * @return { Array } 给定节点的祖先节点数组 - */ - findParents: function(node, includeSelf, filterFn, closerFirst) { - var parents = includeSelf && ((filterFn && filterFn(node)) || !filterFn) - ? [node] - : []; - while ((node = domUtils.findParent(node, filterFn))) { - parents.push(node); - } - return closerFirst ? parents : parents.reverse(); - }, - - /** - * 在节点node后面插入新节点newNode - * @method insertAfter - * @param { Node } node 目标节点 - * @param { Node } newNode 新插入的节点, 该节点将置于目标节点之后 - * @return { Node } 新插入的节点 - */ - insertAfter: function(node, newNode) { - return node.nextSibling - ? node.parentNode.insertBefore(newNode, node.nextSibling) - : node.parentNode.appendChild(newNode); - }, - - /** - * 删除节点node及其下属的所有节点 - * @method remove - * @param { Node } node 需要删除的节点对象 - * @return { Node } 返回刚删除的节点对象 - * @example - * ```html - *
                      - *
                      你好
                      - *
                      - * - * ``` - */ - - /** - * 删除节点node,并根据keepChildren的值决定是否保留子节点 - * @method remove - * @param { Node } node 需要删除的节点对象 - * @param { Boolean } keepChildren 是否需要保留子节点 - * @return { Node } 返回刚删除的节点对象 - * @example - * ```html - *
                      - *
                      你好
                      - *
                      - * - * ``` - */ - remove: function(node, keepChildren) { - var parent = node.parentNode, - child; - if (parent) { - if (keepChildren && node.hasChildNodes()) { - while ((child = node.firstChild)) { - parent.insertBefore(child, node); - } - } - parent.removeChild(node); - } - return node; - }, - - /** - * 取得node节点的下一个兄弟节点, 如果该节点其后没有兄弟节点, 则递归查找其父节点之后的第一个兄弟节点, - * 直到找到满足条件的节点或者递归到BODY节点之后才会结束。 - * @method getNextDomNode - * @param { Node } node 需要获取其后的兄弟节点的节点对象 - * @return { Node | NULL } 如果找满足条件的节点, 则返回该节点, 否则返回NULL - * @example - * ```html - * - *
                      - * - *
                      - * xxx - * - * - * ``` - * @example - * ```html - * - *
                      - * - * xxx - *
                      - * xxx - * - * - * ``` - */ - - /** - * 取得node节点的下一个兄弟节点, 如果startFromChild的值为ture,则先获取其子节点, - * 如果有子节点则直接返回第一个子节点;如果没有子节点或者startFromChild的值为false, - * 则执行getNextDomNode(Node node)的查找过程。 - * @method getNextDomNode - * @param { Node } node 需要获取其后的兄弟节点的节点对象 - * @param { Boolean } startFromChild 查找过程是否从其子节点开始 - * @return { Node | NULL } 如果找满足条件的节点, 则返回该节点, 否则返回NULL - * @see UE.dom.domUtils.getNextDomNode(Node) - */ - getNextDomNode: function(node, startFromChild, filterFn, guard) { - return getDomNode( - node, - "firstChild", - "nextSibling", - startFromChild, - filterFn, - guard - ); - }, - getPreDomNode: function(node, startFromChild, filterFn, guard) { - return getDomNode( - node, - "lastChild", - "previousSibling", - startFromChild, - filterFn, - guard - ); - }, - /** - * 检测节点node是否属是UEditor定义的bookmark节点 - * @method isBookmarkNode - * @private - * @param { Node } node 需要检测的节点对象 - * @return { Boolean } 是否是bookmark节点 - * @example - * ```html - * - * - * ``` - */ - isBookmarkNode: function(node) { - return node.nodeType == 1 && node.id && /^_baidu_bookmark_/i.test(node.id); - }, - /** - * 获取节点node所属的window对象 - * @method getWindow - * @param { Node } node 节点对象 - * @return { Window } 当前节点所属的window对象 - * @example - * ```javascript - * //output: true - * console.log( UE.dom.domUtils.getWindow( document.body ) === window ); - * ``` - */ - getWindow: function(node) { - var doc = node.ownerDocument || node; - return doc.defaultView || doc.parentWindow; - }, - /** - * 获取离nodeA与nodeB最近的公共的祖先节点 - * @method getCommonAncestor - * @param { Node } nodeA 第一个节点 - * @param { Node } nodeB 第二个节点 - * @remind 如果给定的两个节点是同一个节点, 将直接返回该节点。 - * @return { Node | NULL } 如果未找到公共节点, 返回NULL, 否则返回最近的公共祖先节点。 - * @example - * ```javascript - * var commonAncestor = UE.dom.domUtils.getCommonAncestor( document.body, document.body.firstChild ); - * //output: true - * console.log( commonAncestor.tagName.toLowerCase() === 'body' ); - * ``` - */ - getCommonAncestor: function(nodeA, nodeB) { - if (nodeA === nodeB) return nodeA; - var parentsA = [nodeA], - parentsB = [nodeB], - parent = nodeA, - i = -1; - while ((parent = parent.parentNode)) { - if (parent === nodeB) { - return parent; - } - parentsA.push(parent); - } - parent = nodeB; - while ((parent = parent.parentNode)) { - if (parent === nodeA) return parent; - parentsB.push(parent); - } - parentsA.reverse(); - parentsB.reverse(); - while ((i++, parentsA[i] === parentsB[i])) {} - return i == 0 ? null : parentsA[i - 1]; - }, - /** - * 清除node节点左右连续为空的兄弟inline节点 - * @method clearEmptySibling - * @param { Node } node 执行的节点对象, 如果该节点的左右连续的兄弟节点是空的inline节点, - * 则这些兄弟节点将被删除 - * @grammar UE.dom.domUtils.clearEmptySibling(node,ignoreNext) //ignoreNext指定是否忽略右边空节点 - * @grammar UE.dom.domUtils.clearEmptySibling(node,ignoreNext,ignorePre) //ignorePre指定是否忽略左边空节点 - * @example - * ```html - * - *
                      - * - * - * - * xxx - * - * - * - * ``` - */ - - /** - * 清除node节点左右连续为空的兄弟inline节点, 如果ignoreNext的值为true, - * 则忽略对右边兄弟节点的操作。 - * @method clearEmptySibling - * @param { Node } node 执行的节点对象, 如果该节点的左右连续的兄弟节点是空的inline节点, - * @param { Boolean } ignoreNext 是否忽略忽略对右边的兄弟节点的操作 - * 则这些兄弟节点将被删除 - * @see UE.dom.domUtils.clearEmptySibling(Node) - */ - - /** - * 清除node节点左右连续为空的兄弟inline节点, 如果ignoreNext的值为true, - * 则忽略对右边兄弟节点的操作, 如果ignorePre的值为true,则忽略对左边兄弟节点的操作。 - * @method clearEmptySibling - * @param { Node } node 执行的节点对象, 如果该节点的左右连续的兄弟节点是空的inline节点, - * @param { Boolean } ignoreNext 是否忽略忽略对右边的兄弟节点的操作 - * @param { Boolean } ignorePre 是否忽略忽略对左边的兄弟节点的操作 - * 则这些兄弟节点将被删除 - * @see UE.dom.domUtils.clearEmptySibling(Node) - */ - clearEmptySibling: function(node, ignoreNext, ignorePre) { - function clear(next, dir) { - var tmpNode; - while ( - next && - !domUtils.isBookmarkNode(next) && - (domUtils.isEmptyInlineElement(next) || - //这里不能把空格算进来会吧空格干掉,出现文字间的空格丢掉了 - !new RegExp("[^\t\n\r" + domUtils.fillChar + "]").test( - next.nodeValue - )) - ) { - tmpNode = next[dir]; - domUtils.remove(next); - next = tmpNode; - } - } - !ignoreNext && clear(node.nextSibling, "nextSibling"); - !ignorePre && clear(node.previousSibling, "previousSibling"); - }, - /** - * 将一个文本节点textNode拆分成两个文本节点,offset指定拆分位置 - * @method split - * @param { Node } textNode 需要拆分的文本节点对象 - * @param { int } offset 需要拆分的位置, 位置计算从0开始 - * @return { Node } 拆分后形成的新节点 - * @example - * ```html - *
                      abcdef
                      - * - * ``` - */ - split: function(node, offset) { - var doc = node.ownerDocument; - if (browser.ie && offset == node.nodeValue.length) { - var next = doc.createTextNode(""); - return domUtils.insertAfter(node, next); - } - var retval = node.splitText(offset); - //ie8下splitText不会跟新childNodes,我们手动触发他的更新 - if (browser.ie8) { - var tmpNode = doc.createTextNode(""); - domUtils.insertAfter(retval, tmpNode); - domUtils.remove(tmpNode); - } - return retval; - }, - - /** - * 检测文本节点textNode是否为空节点(包括空格、换行、占位符等字符) - * @method isWhitespace - * @param { Node } node 需要检测的节点对象 - * @return { Boolean } 检测的节点是否为空 - * @example - * ```html - *
                      - * - *
                      - * - * ``` - */ - isWhitespace: function(node) { - return !new RegExp("[^ \t\n\r" + domUtils.fillChar + "]").test( - node.nodeValue - ); - }, - /** - * 获取元素element相对于viewport的位置坐标 - * @method getXY - * @param { Node } element 需要计算位置的节点对象 - * @return { Object } 返回形如{x:left,y:top}的一个key-value映射对象, 其中键x代表水平偏移距离, - * y代表垂直偏移距离。 - * - * @example - * ```javascript - * var location = UE.dom.domUtils.getXY( document.getElementById("test") ); - * //output: test的坐标为: 12, 24 - * console.log( 'test的坐标为: ', location.x, ',', location.y ); - * ``` - */ - getXY: function(element) { - var x = 0, - y = 0; - while (element.offsetParent) { - y += element.offsetTop; - x += element.offsetLeft; - element = element.offsetParent; - } - return { x: x, y: y }; - }, - /** - * 为元素element绑定原生DOM事件,type为事件类型,handler为处理函数 - * @method on - * @param { Node } element 需要绑定事件的节点对象 - * @param { String } type 绑定的事件类型 - * @param { Function } handler 事件处理器 - * @example - * ```javascript - * UE.dom.domUtils.on(document.body,"click",function(e){ - * //e为事件对象,this为被点击元素对戏那个 - * }); - * ``` - */ - - /** - * 为元素element绑定原生DOM事件,type为事件类型,handler为处理函数 - * @method on - * @param { Node } element 需要绑定事件的节点对象 - * @param { Array } type 绑定的事件类型数组 - * @param { Function } handler 事件处理器 - * @example - * ```javascript - * UE.dom.domUtils.on(document.body,["click","mousedown"],function(evt){ - * //evt为事件对象,this为被点击元素对象 - * }); - * ``` - */ - on: function(element, type, handler) { - var types = utils.isArray(type) ? type : utils.trim(type).split(/\s+/), - k = types.length; - if (k) - while (k--) { - type = types[k]; - if (element.addEventListener) { - element.addEventListener(type, handler, false); - } else { - if (!handler._d) { - handler._d = { - els: [] - }; - } - var key = type + handler.toString(), - index = utils.indexOf(handler._d.els, element); - if (!handler._d[key] || index == -1) { - if (index == -1) { - handler._d.els.push(element); - } - if (!handler._d[key]) { - handler._d[key] = function(evt) { - return handler.call(evt.srcElement, evt || window.event); - }; - } - - element.attachEvent("on" + type, handler._d[key]); - } - } - } - element = null; - }, - /** - * 解除DOM事件绑定 - * @method un - * @param { Node } element 需要解除事件绑定的节点对象 - * @param { String } type 需要接触绑定的事件类型 - * @param { Function } handler 对应的事件处理器 - * @example - * ```javascript - * UE.dom.domUtils.un(document.body,"click",function(evt){ - * //evt为事件对象,this为被点击元素对象 - * }); - * ``` - */ - - /** - * 解除DOM事件绑定 - * @method un - * @param { Node } element 需要解除事件绑定的节点对象 - * @param { Array } type 需要接触绑定的事件类型数组 - * @param { Function } handler 对应的事件处理器 - * @example - * ```javascript - * UE.dom.domUtils.un(document.body, ["click","mousedown"],function(evt){ - * //evt为事件对象,this为被点击元素对象 - * }); - * ``` - */ - un: function(element, type, handler) { - var types = utils.isArray(type) ? type : utils.trim(type).split(/\s+/), - k = types.length; - if (k) - while (k--) { - type = types[k]; - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else { - var key = type + handler.toString(); - try { - element.detachEvent( - "on" + type, - handler._d ? handler._d[key] : handler - ); - } catch (e) {} - if (handler._d && handler._d[key]) { - var index = utils.indexOf(handler._d.els, element); - if (index != -1) { - handler._d.els.splice(index, 1); - } - handler._d.els.length == 0 && delete handler._d[key]; - } - } - } - }, - - /** - * 比较节点nodeA与节点nodeB是否具有相同的标签名、属性名以及属性值 - * @method isSameElement - * @param { Node } nodeA 需要比较的节点 - * @param { Node } nodeB 需要比较的节点 - * @return { Boolean } 两个节点是否具有相同的标签名、属性名以及属性值 - * @example - * ```html - * ssss - * bbbbb - * ssss - * bbbbb - * - * - * ``` - */ - isSameElement: function(nodeA, nodeB) { - if (nodeA.tagName != nodeB.tagName) { - return false; - } - var thisAttrs = nodeA.attributes, - otherAttrs = nodeB.attributes; - if (!ie && thisAttrs.length != otherAttrs.length) { - return false; - } - var attrA, - attrB, - al = 0, - bl = 0; - for (var i = 0; (attrA = thisAttrs[i++]); ) { - if (attrA.nodeName == "style") { - if (attrA.specified) { - al++; - } - if (domUtils.isSameStyle(nodeA, nodeB)) { - continue; - } else { - return false; - } - } - if (ie) { - if (attrA.specified) { - al++; - attrB = otherAttrs.getNamedItem(attrA.nodeName); - } else { - continue; - } - } else { - attrB = nodeB.attributes[attrA.nodeName]; - } - if (!attrB.specified || attrA.nodeValue != attrB.nodeValue) { - return false; - } - } - // 有可能attrB的属性包含了attrA的属性之外还有自己的属性 - if (ie) { - for (i = 0; (attrB = otherAttrs[i++]); ) { - if (attrB.specified) { - bl++; - } - } - if (al != bl) { - return false; - } - } - return true; - }, - - /** - * 判断节点nodeA与节点nodeB的元素的style属性是否一致 - * @method isSameStyle - * @param { Node } nodeA 需要比较的节点 - * @param { Node } nodeB 需要比较的节点 - * @return { Boolean } 两个节点是否具有相同的style属性值 - * @example - * ```html - * ssss - * bbbbb - * ssss - * bbbbb - * - * - * ``` - */ - isSameStyle: function(nodeA, nodeB) { - var styleA = nodeA.style.cssText - .replace(/( ?; ?)/g, ";") - .replace(/( ?: ?)/g, ":"), - styleB = nodeB.style.cssText - .replace(/( ?; ?)/g, ";") - .replace(/( ?: ?)/g, ":"); - if (browser.opera) { - styleA = nodeA.style; - styleB = nodeB.style; - if (styleA.length != styleB.length) return false; - for (var p in styleA) { - if (/^(\d+|csstext)$/i.test(p)) { - continue; - } - if (styleA[p] != styleB[p]) { - return false; - } - } - return true; - } - if (!styleA || !styleB) { - return styleA == styleB; - } - styleA = styleA.split(";"); - styleB = styleB.split(";"); - if (styleA.length != styleB.length) { - return false; - } - for (var i = 0, ci; (ci = styleA[i++]); ) { - if (utils.indexOf(styleB, ci) == -1) { - return false; - } - } - return true; - }, - /** - * 检查节点node是否为block元素 - * @method isBlockElm - * @param { Node } node 需要检测的节点对象 - * @return { Boolean } 是否是block元素节点 - * @warning 该方法的判断规则如下: 如果该元素原本是block元素, 则不论该元素当前的css样式是什么都会返回true; - * 否则,检测该元素的css样式, 如果该元素当前是block元素, 则返回true。 其余情况下都返回false。 - * @example - * ```html - * - * - *
                      - * - * - * ``` - */ - isBlockElm: function(node) { - return ( - node.nodeType == 1 && - (dtd.$block[node.tagName] || - styleBlock[domUtils.getComputedStyle(node, "display")]) && - !dtd.$nonChild[node.tagName] - ); - }, - /** - * 检测node节点是否为body节点 - * @method isBody - * @param { Element } node 需要检测的dom元素 - * @return { Boolean } 给定的元素是否是body元素 - * @example - * ```javascript - * //output: true - * console.log( UE.dom.domUtils.isBody( document.body ) ); - * ``` - */ - isBody: function(node) { - return node && node.nodeType == 1 && node.tagName.toLowerCase() == "body"; - }, - /** - * 以node节点为分界,将该节点的指定祖先节点parent拆分成两个独立的节点, - * 拆分形成的两个节点之间是node节点 - * @method breakParent - * @param { Node } node 作为分界的节点对象 - * @param { Node } parent 该节点必须是node节点的祖先节点, 且是block节点。 - * @return { Node } 给定的node分界节点 - * @example - * ```javascript - * - * var node = document.createElement("span"), - * wrapNode = document.createElement( "div" ), - * parent = document.createElement("p"); - * - * parent.appendChild( node ); - * wrapNode.appendChild( parent ); - * - * //拆分前 - * //output:

                      - * console.log( wrapNode.innerHTML ); - * - * - * UE.dom.domUtils.breakParent( node, parent ); - * //拆分后 - * //output:

                      - * console.log( wrapNode.innerHTML ); - * - * ``` - */ - breakParent: function(node, parent) { - var tmpNode, - parentClone = node, - clone = node, - leftNodes, - rightNodes; - do { - parentClone = parentClone.parentNode; - if (leftNodes) { - tmpNode = parentClone.cloneNode(false); - tmpNode.appendChild(leftNodes); - leftNodes = tmpNode; - tmpNode = parentClone.cloneNode(false); - tmpNode.appendChild(rightNodes); - rightNodes = tmpNode; - } else { - leftNodes = parentClone.cloneNode(false); - rightNodes = leftNodes.cloneNode(false); - } - while ((tmpNode = clone.previousSibling)) { - leftNodes.insertBefore(tmpNode, leftNodes.firstChild); - } - while ((tmpNode = clone.nextSibling)) { - rightNodes.appendChild(tmpNode); - } - clone = parentClone; - } while (parent !== parentClone); - tmpNode = parent.parentNode; - tmpNode.insertBefore(leftNodes, parent); - tmpNode.insertBefore(rightNodes, parent); - tmpNode.insertBefore(node, rightNodes); - domUtils.remove(parent); - return node; - }, - /** - * 检查节点node是否是空inline节点 - * @method isEmptyInlineElement - * @param { Node } node 需要检测的节点对象 - * @return { Number } 如果给定的节点是空的inline节点, 则返回1, 否则返回0。 - * @example - * ```html - * => 1 - * => 1 - * => 1 - * xx => 0 - * ``` - */ - isEmptyInlineElement: function(node) { - if (node.nodeType != 1 || !dtd.$removeEmpty[node.tagName]) { - return 0; - } - node = node.firstChild; - while (node) { - //如果是创建的bookmark就跳过 - if (domUtils.isBookmarkNode(node)) { - return 0; - } - if ( - (node.nodeType == 1 && !domUtils.isEmptyInlineElement(node)) || - (node.nodeType == 3 && !domUtils.isWhitespace(node)) - ) { - return 0; - } - node = node.nextSibling; - } - return 1; - }, - - /** - * 删除node节点下首尾两端的空白文本子节点 - * @method trimWhiteTextNode - * @param { Element } node 需要执行删除操作的元素对象 - * @example - * ```javascript - * var node = document.createElement("div"); - * - * node.appendChild( document.createTextNode( "" ) ); - * - * node.appendChild( document.createElement("div") ); - * - * node.appendChild( document.createTextNode( "" ) ); - * - * //3 - * console.log( node.childNodes.length ); - * - * UE.dom.domUtils.trimWhiteTextNode( node ); - * - * //1 - * console.log( node.childNodes.length ); - * ``` - */ - trimWhiteTextNode: function(node) { - function remove(dir) { - var child; - while ( - (child = node[dir]) && - child.nodeType == 3 && - domUtils.isWhitespace(child) - ) { - node.removeChild(child); - } - } - remove("firstChild"); - remove("lastChild"); - }, - - /** - * 合并node节点下相同的子节点 - * @name mergeChild - * @desc - * UE.dom.domUtils.mergeChild(node,tagName) //tagName要合并的子节点的标签 - * @example - *

                      xxaaxx

                      - * ==> UE.dom.domUtils.mergeChild(node,'span') - *

                      xxaaxx

                      - */ - mergeChild: function(node, tagName, attrs) { - var list = domUtils.getElementsByTagName(node, node.tagName.toLowerCase()); - for (var i = 0, ci; (ci = list[i++]); ) { - if (!ci.parentNode || domUtils.isBookmarkNode(ci)) { - continue; - } - //span单独处理 - if (ci.tagName.toLowerCase() == "span") { - if (node === ci.parentNode) { - domUtils.trimWhiteTextNode(node); - if (node.childNodes.length == 1) { - node.style.cssText = ci.style.cssText + ";" + node.style.cssText; - domUtils.remove(ci, true); - continue; - } - } - ci.style.cssText = node.style.cssText + ";" + ci.style.cssText; - if (attrs) { - var style = attrs.style; - if (style) { - style = style.split(";"); - for (var j = 0, s; (s = style[j++]); ) { - ci.style[utils.cssStyleToDomStyle(s.split(":")[0])] = s.split( - ":" - )[1]; - } - } - } - if (domUtils.isSameStyle(ci, node)) { - domUtils.remove(ci, true); - } - continue; - } - if (domUtils.isSameElement(node, ci)) { - domUtils.remove(ci, true); - } - } - }, - - /** - * 原生方法getElementsByTagName的封装 - * @method getElementsByTagName - * @param { Node } node 目标节点对象 - * @param { String } tagName 需要查找的节点的tagName, 多个tagName以空格分割 - * @return { Array } 符合条件的节点集合 - */ - getElementsByTagName: function(node, name, filter) { - if (filter && utils.isString(filter)) { - var className = filter; - filter = function(node) { - return domUtils.hasClass(node, className); - }; - } - name = utils.trim(name).replace(/[ ]{2,}/g, " ").split(" "); - var arr = []; - for (var n = 0, ni; (ni = name[n++]); ) { - var list = node.getElementsByTagName(ni); - for (var i = 0, ci; (ci = list[i++]); ) { - if (!filter || filter(ci)) arr.push(ci); - } - } - - return arr; - }, - /** - * 将节点node提取到父节点上 - * @method mergeToParent - * @param { Element } node 需要提取的元素对象 - * @example - * ```html - *
                      - *
                      - * - *
                      - *
                      - * - * - * ``` - */ - mergeToParent: function(node) { - var parent = node.parentNode; - while (parent && dtd.$removeEmpty[parent.tagName]) { - if (parent.tagName == node.tagName || parent.tagName == "A") { - //针对a标签单独处理 - domUtils.trimWhiteTextNode(parent); - //span需要特殊处理 不处理这样的情况 xxxxxxxxx - if ( - (parent.tagName == "SPAN" && !domUtils.isSameStyle(parent, node)) || - (parent.tagName == "A" && node.tagName == "SPAN") - ) { - if (parent.childNodes.length > 1 || parent !== node.parentNode) { - node.style.cssText = - parent.style.cssText + ";" + node.style.cssText; - parent = parent.parentNode; - continue; - } else { - parent.style.cssText += ";" + node.style.cssText; - //trace:952 a标签要保持下划线 - if (parent.tagName == "A") { - parent.style.textDecoration = "underline"; - } - } - } - if (parent.tagName != "A") { - parent === node.parentNode && domUtils.remove(node, true); - break; - } - } - parent = parent.parentNode; - } - }, - /** - * 合并节点node的左右兄弟节点 - * @method mergeSibling - * @param { Element } node 需要合并的目标节点 - * @example - * ```html - * xxxxoooxxxx - * - * - * ``` - */ - - /** - * 合并节点node的左右兄弟节点, 可以根据给定的条件选择是否忽略合并左节点。 - * @method mergeSibling - * @param { Element } node 需要合并的目标节点 - * @param { Boolean } ignorePre 是否忽略合并左节点 - * @example - * ```html - * xxxxoooxxxx - * - * - * ``` - */ - - /** - * 合并节点node的左右兄弟节点,可以根据给定的条件选择是否忽略合并左右节点。 - * @method mergeSibling - * @param { Element } node 需要合并的目标节点 - * @param { Boolean } ignorePre 是否忽略合并左节点 - * @param { Boolean } ignoreNext 是否忽略合并右节点 - * @remind 如果同时忽略左右节点, 则该操作什么也不会做 - * @example - * ```html - * xxxxoooxxxx - * - * - * ``` - */ - mergeSibling: function(node, ignorePre, ignoreNext) { - function merge(rtl, start, node) { - var next; - if ( - (next = node[rtl]) && - !domUtils.isBookmarkNode(next) && - next.nodeType == 1 && - domUtils.isSameElement(node, next) - ) { - while (next.firstChild) { - if (start == "firstChild") { - node.insertBefore(next.lastChild, node.firstChild); - } else { - node.appendChild(next.firstChild); - } - } - domUtils.remove(next); - } - } - !ignorePre && merge("previousSibling", "firstChild", node); - !ignoreNext && merge("nextSibling", "lastChild", node); - }, - - /** - * 设置节点node及其子节点不会被选中 - * @method unSelectable - * @param { Element } node 需要执行操作的dom元素 - * @remind 执行该操作后的节点, 将不能被鼠标选中 - * @example - * ```javascript - * UE.dom.domUtils.unSelectable( document.body ); - * ``` - */ - unSelectable: (ie && browser.ie9below) || browser.opera - ? function(node) { - //for ie9 - node.onselectstart = function() { - return false; - }; - node.onclick = node.onkeyup = node.onkeydown = function() { - return false; - }; - node.unselectable = "on"; - node.setAttribute("unselectable", "on"); - for (var i = 0, ci; (ci = node.all[i++]); ) { - switch (ci.tagName.toLowerCase()) { - case "iframe": - case "textarea": - case "input": - case "select": - break; - default: - ci.unselectable = "on"; - node.setAttribute("unselectable", "on"); - } - } - } - : function(node) { - node.style.MozUserSelect = node.style.webkitUserSelect = node.style.msUserSelect = node.style.KhtmlUserSelect = - "none"; - }, - /** - * 删除节点node上的指定属性名称的属性 - * @method removeAttributes - * @param { Node } node 需要删除属性的节点对象 - * @param { String } attrNames 可以是空格隔开的多个属性名称,该操作将会依次删除相应的属性 - * @example - * ```html - *
                      - * xxxxx - *
                      - * - * - * ``` - */ - - /** - * 删除节点node上的指定属性名称的属性 - * @method removeAttributes - * @param { Node } node 需要删除属性的节点对象 - * @param { Array } attrNames 需要删除的属性名数组 - * @example - * ```html - *
                      - * xxxxx - *
                      - * - * - * ``` - */ - removeAttributes: function(node, attrNames) { - attrNames = utils.isArray(attrNames) - ? attrNames - : utils.trim(attrNames).replace(/[ ]{2,}/g, " ").split(" "); - for (var i = 0, ci; (ci = attrNames[i++]); ) { - ci = attrFix[ci] || ci; - switch (ci) { - case "className": - node[ci] = ""; - break; - case "style": - node.style.cssText = ""; - var val = node.getAttributeNode("style"); - !browser.ie && val && node.removeAttributeNode(val); - } - node.removeAttribute(ci); - } - }, - /** - * 在doc下创建一个标签名为tag,属性为attrs的元素 - * @method createElement - * @param { DomDocument } doc 新创建的元素属于该document节点创建 - * @param { String } tagName 需要创建的元素的标签名 - * @param { Object } attrs 新创建的元素的属性key-value集合 - * @return { Element } 新创建的元素对象 - * @example - * ```javascript - * var ele = UE.dom.domUtils.createElement( document, 'div', { - * id: 'test' - * } ); - * - * //output: DIV - * console.log( ele.tagName ); - * - * //output: test - * console.log( ele.id ); - * - * ``` - */ - createElement: function(doc, tag, attrs) { - return domUtils.setAttributes(doc.createElement(tag), attrs); - }, - /** - * 为节点node添加属性attrs,attrs为属性键值对 - * @method setAttributes - * @param { Element } node 需要设置属性的元素对象 - * @param { Object } attrs 需要设置的属性名-值对 - * @return { Element } 设置属性的元素对象 - * @example - * ```html - * - * - * - * - */ - setAttributes: function(node, attrs) { - for (var attr in attrs) { - if (attrs.hasOwnProperty(attr)) { - var value = attrs[attr]; - switch (attr) { - case "class": - //ie下要这样赋值,setAttribute不起作用 - node.className = value; - break; - case "style": - node.style.cssText = node.style.cssText + ";" + value; - break; - case "innerHTML": - node[attr] = value; - break; - case "value": - node.value = value; - break; - default: - node.setAttribute(attrFix[attr] || attr, value); - } - } - } - return node; - }, - - /** - * 获取元素element经过计算后的样式值 - * @method getComputedStyle - * @param { Element } element 需要获取样式的元素对象 - * @param { String } styleName 需要获取的样式名 - * @return { String } 获取到的样式值 - * @example - * ```html - * - * - * - * - * - * ``` - */ - getComputedStyle: function(element, styleName) { - //一下的属性单独处理 - var pros = "width height top left"; - - if (pros.indexOf(styleName) > -1) { - return ( - element[ - "offset" + - styleName.replace(/^\w/, function(s) { - return s.toUpperCase(); - }) - ] + "px" - ); - } - //忽略文本节点 - if (element.nodeType == 3) { - element = element.parentNode; - } - //ie下font-size若body下定义了font-size,则从currentStyle里会取到这个font-size. 取不到实际值,故此修改. - if ( - browser.ie && - browser.version < 9 && - styleName == "font-size" && - !element.style.fontSize && - !dtd.$empty[element.tagName] && - !dtd.$nonChild[element.tagName] - ) { - var span = element.ownerDocument.createElement("span"); - span.style.cssText = "padding:0;border:0;font-family:simsun;"; - span.innerHTML = "."; - element.appendChild(span); - var result = span.offsetHeight; - element.removeChild(span); - span = null; - return result + "px"; - } - try { - var value = - domUtils.getStyle(element, styleName) || - (window.getComputedStyle - ? domUtils - .getWindow(element) - .getComputedStyle(element, "") - .getPropertyValue(styleName) - : (element.currentStyle || element.style)[ - utils.cssStyleToDomStyle(styleName) - ]); - } catch (e) { - return ""; - } - return utils.transUnitToPx(utils.fixColor(styleName, value)); - }, - /** - * 删除元素element指定的className - * @method removeClasses - * @param { Element } ele 需要删除class的元素节点 - * @param { String } classNames 需要删除的className, 多个className之间以空格分开 - * @example - * ```html - * xxx - * - * - * ``` - */ - - /** - * 删除元素element指定的className - * @method removeClasses - * @param { Element } ele 需要删除class的元素节点 - * @param { Array } classNames 需要删除的className数组 - * @example - * ```html - * xxx - * - * - * ``` - */ - removeClasses: function(elm, classNames) { - classNames = utils.isArray(classNames) - ? classNames - : utils.trim(classNames).replace(/[ ]{2,}/g, " ").split(" "); - for (var i = 0, ci, cls = elm.className; (ci = classNames[i++]); ) { - cls = cls.replace(new RegExp("\\b" + ci + "\\b"), ""); - } - cls = utils.trim(cls).replace(/[ ]{2,}/g, " "); - if (cls) { - elm.className = cls; - } else { - domUtils.removeAttributes(elm, ["class"]); - } - }, - /** - * 给元素element添加className - * @method addClass - * @param { Node } ele 需要增加className的元素 - * @param { String } classNames 需要添加的className, 多个className之间以空格分割 - * @remind 相同的类名不会被重复添加 - * @example - * ```html - * - * - * - * ``` - */ - - /** - * 判断元素element是否包含给定的样式类名className - * @method hasClass - * @param { Node } ele 需要检测的元素 - * @param { Array } classNames 需要检测的className数组 - * @return { Boolean } 元素是否包含所有给定的className - * @example - * ```html - * - * - * - * ``` - */ - hasClass: function(element, className) { - if (utils.isRegExp(className)) { - return className.test(element.className); - } - className = utils.trim(className).replace(/[ ]{2,}/g, " ").split(" "); - for (var i = 0, ci, cls = element.className; (ci = className[i++]); ) { - if (!new RegExp("\\b" + ci + "\\b", "i").test(cls)) { - return false; - } - } - return i - 1 == className.length; - }, - - /** - * 阻止事件默认行为 - * @method preventDefault - * @param { Event } evt 需要阻止默认行为的事件对象 - * @example - * ```javascript - * UE.dom.domUtils.preventDefault( evt ); - * ``` - */ - preventDefault: function(evt) { - evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); - }, - /** - * 删除元素element指定的样式 - * @method removeStyle - * @param { Element } element 需要删除样式的元素 - * @param { String } styleName 需要删除的样式名 - * @example - * ```html - * - * - * - * ``` - */ - removeStyle: function(element, name) { - if (browser.ie) { - //针对color先单独处理一下 - if (name == "color") { - name = "(^|;)" + name; - } - element.style.cssText = element.style.cssText.replace( - new RegExp(name + "[^:]*:[^;]+;?", "ig"), - "" - ); - } else { - if (element.style.removeProperty) { - element.style.removeProperty(name); - } else { - element.style.removeAttribute(utils.cssStyleToDomStyle(name)); - } - } - - if (!element.style.cssText) { - domUtils.removeAttributes(element, ["style"]); - } - }, - /** - * 获取元素element的style属性的指定值 - * @method getStyle - * @param { Element } element 需要获取属性值的元素 - * @param { String } styleName 需要获取的style的名称 - * @warning 该方法仅获取元素style属性中所标明的值 - * @return { String } 该元素包含指定的style属性值 - * @example - * ```html - *
                      - * - * - * ``` - */ - getStyle: function(element, name) { - var value = element.style[utils.cssStyleToDomStyle(name)]; - return utils.fixColor(name, value); - }, - /** - * 为元素element设置样式属性值 - * @method setStyle - * @param { Element } element 需要设置样式的元素 - * @param { String } styleName 样式名 - * @param { String } styleValue 样式值 - * @example - * ```html - *
                      - * - * - * ``` - */ - setStyle: function(element, name, value) { - element.style[utils.cssStyleToDomStyle(name)] = value; - if (!utils.trim(element.style.cssText)) { - this.removeAttributes(element, "style"); - } - }, - /** - * 为元素element设置多个样式属性值 - * @method setStyles - * @param { Element } element 需要设置样式的元素 - * @param { Object } styles 样式名值对 - * @example - * ```html - *
                      - * - * - * ``` - */ - setStyles: function(element, styles) { - for (var name in styles) { - if (styles.hasOwnProperty(name)) { - domUtils.setStyle(element, name, styles[name]); - } - } - }, - /** - * 删除_moz_dirty属性 - * @private - * @method removeDirtyAttr - */ - removeDirtyAttr: function(node) { - for ( - var i = 0, ci, nodes = node.getElementsByTagName("*"); - (ci = nodes[i++]); - - ) { - ci.removeAttribute("_moz_dirty"); - } - node.removeAttribute("_moz_dirty"); - }, - /** - * 获取子节点的数量 - * @method getChildCount - * @param { Element } node 需要检测的元素 - * @return { Number } 给定的node元素的子节点数量 - * @example - * ```html - *
                      - * - *
                      - * - * - * ``` - */ - - /** - * 根据给定的过滤规则, 获取符合条件的子节点的数量 - * @method getChildCount - * @param { Element } node 需要检测的元素 - * @param { Function } fn 过滤器, 要求对符合条件的子节点返回true, 反之则要求返回false - * @return { Number } 符合过滤条件的node元素的子节点数量 - * @example - * ```html - *
                      - * - *
                      - * - * - * ``` - */ - getChildCount: function(node, fn) { - var count = 0, - first = node.firstChild; - fn = - fn || - function() { - return 1; - }; - while (first) { - if (fn(first)) { - count++; - } - first = first.nextSibling; - } - return count; - }, - - /** - * 判断给定节点是否为空节点 - * @method isEmptyNode - * @param { Node } node 需要检测的节点对象 - * @return { Boolean } 节点是否为空 - * @example - * ```javascript - * UE.dom.domUtils.isEmptyNode( document.body ); - * ``` - */ - isEmptyNode: function(node) { - return ( - !node.firstChild || - domUtils.getChildCount(node, function(node) { - return ( - !domUtils.isBr(node) && - !domUtils.isBookmarkNode(node) && - !domUtils.isWhitespace(node) - ); - }) == 0 - ); - }, - clearSelectedArr: function(nodes) { - var node; - while ((node = nodes.pop())) { - domUtils.removeAttributes(node, ["class"]); - } - }, - /** - * 将显示区域滚动到指定节点的位置 - * @method scrollToView - * @param {Node} node 节点 - * @param {window} win window对象 - * @param {Number} offsetTop 距离上方的偏移量 - */ - scrollToView: function(node, win, offsetTop) { - var getViewPaneSize = function() { - var doc = win.document, - mode = doc.compatMode == "CSS1Compat"; - return { - width: - (mode ? doc.documentElement.clientWidth : doc.body.clientWidth) || 0, - height: - (mode ? doc.documentElement.clientHeight : doc.body.clientHeight) || 0 - }; - }, - getScrollPosition = function(win) { - if ("pageXOffset" in win) { - return { - x: win.pageXOffset || 0, - y: win.pageYOffset || 0 - }; - } else { - var doc = win.document; - return { - x: doc.documentElement.scrollLeft || doc.body.scrollLeft || 0, - y: doc.documentElement.scrollTop || doc.body.scrollTop || 0 - }; - } - }; - var winHeight = getViewPaneSize().height, - offset = winHeight * -1 + offsetTop; - offset += node.offsetHeight || 0; - var elementPosition = domUtils.getXY(node); - offset += elementPosition.y; - var currentScroll = getScrollPosition(win).y; - // offset += 50; - if (offset > currentScroll || offset < currentScroll - winHeight) { - win.scrollTo(0, offset + (offset < 0 ? -20 : 20)); - } - }, - /** - * 判断给定节点是否为br - * @method isBr - * @param { Node } node 需要判断的节点对象 - * @return { Boolean } 给定的节点是否是br节点 - */ - isBr: function(node) { - return node.nodeType == 1 && node.tagName == "BR"; - }, - /** - * 判断给定的节点是否是一个“填充”节点 - * @private - * @method isFillChar - * @param { Node } node 需要判断的节点 - * @param { Boolean } isInStart 是否从节点内容的开始位置匹配 - * @returns { Boolean } 节点是否是填充节点 - */ - isFillChar: function(node, isInStart) { - if (node.nodeType != 3) return false; - var text = node.nodeValue; - if (isInStart) { - return new RegExp("^" + domUtils.fillChar).test(text); - } - return !text.replace(new RegExp(domUtils.fillChar, "g"), "").length; - }, - isStartInblock: function(range) { - var tmpRange = range.cloneRange(), - flag = 0, - start = tmpRange.startContainer, - tmp; - if (start.nodeType == 1 && start.childNodes[tmpRange.startOffset]) { - start = start.childNodes[tmpRange.startOffset]; - var pre = start.previousSibling; - while (pre && domUtils.isFillChar(pre)) { - start = pre; - pre = pre.previousSibling; - } - } - if (this.isFillChar(start, true) && tmpRange.startOffset == 1) { - tmpRange.setStartBefore(start); - start = tmpRange.startContainer; - } - - while (start && domUtils.isFillChar(start)) { - tmp = start; - start = start.previousSibling; - } - if (tmp) { - tmpRange.setStartBefore(tmp); - start = tmpRange.startContainer; - } - if ( - start.nodeType == 1 && - domUtils.isEmptyNode(start) && - tmpRange.startOffset == 1 - ) { - tmpRange.setStart(start, 0).collapse(true); - } - while (!tmpRange.startOffset) { - start = tmpRange.startContainer; - if (domUtils.isBlockElm(start) || domUtils.isBody(start)) { - flag = 1; - break; - } - var pre = tmpRange.startContainer.previousSibling, - tmpNode; - if (!pre) { - tmpRange.setStartBefore(tmpRange.startContainer); - } else { - while (pre && domUtils.isFillChar(pre)) { - tmpNode = pre; - pre = pre.previousSibling; - } - if (tmpNode) { - tmpRange.setStartBefore(tmpNode); - } else { - tmpRange.setStartBefore(tmpRange.startContainer); - } - } - } - return flag && !domUtils.isBody(tmpRange.startContainer) ? 1 : 0; - }, - - /** - * 判断给定的元素是否是一个空元素 - * @method isEmptyBlock - * @param { Element } node 需要判断的元素 - * @return { Boolean } 是否是空元素 - * @example - * ```html - *
                      - * - * - * ``` - */ - - /** - * 根据指定的判断规则判断给定的元素是否是一个空元素 - * @method isEmptyBlock - * @param { Element } node 需要判断的元素 - * @param { RegExp } reg 对内容执行判断的正则表达式对象 - * @return { Boolean } 是否是空元素 - */ - isEmptyBlock: function(node, reg) { - if (node.nodeType != 1) return 0; - reg = reg || new RegExp("[ \xa0\t\r\n" + domUtils.fillChar + "]", "g"); - - if ( - node[browser.ie ? "innerText" : "textContent"].replace(reg, "").length > 0 - ) { - return 0; - } - for (var n in dtd.$isNotEmpty) { - if (node.getElementsByTagName(n).length) { - return 0; - } - } - return 1; - }, - - /** - * 移动元素使得该元素的位置移动指定的偏移量的距离 - * @method setViewportOffset - * @param { Element } element 需要设置偏移量的元素 - * @param { Object } offset 偏移量, 形如{ left: 100, top: 50 }的一个键值对, 表示该元素将在 - * 现有的位置上向水平方向偏移offset.left的距离, 在竖直方向上偏移 - * offset.top的距离 - * @example - * ```html - *
                      - * - * - * ``` - */ - setViewportOffset: function(element, offset) { - var left = parseInt(element.style.left) | 0; - var top = parseInt(element.style.top) | 0; - var rect = element.getBoundingClientRect(); - var offsetLeft = offset.left - rect.left; - var offsetTop = offset.top - rect.top; - if (offsetLeft) { - element.style.left = left + offsetLeft + "px"; - } - if (offsetTop) { - element.style.top = top + offsetTop + "px"; - } - }, - - /** - * 用“填充字符”填充节点 - * @method fillNode - * @private - * @param { DomDocument } doc 填充的节点所在的docment对象 - * @param { Node } node 需要填充的节点对象 - * @example - * ```html - *
                      - * - * - * ``` - */ - fillNode: function(doc, node) { - var tmpNode = browser.ie - ? doc.createTextNode(domUtils.fillChar) - : doc.createElement("br"); - node.innerHTML = ""; - node.appendChild(tmpNode); - }, - - /** - * 把节点src的所有子节点追加到另一个节点tag上去 - * @method moveChild - * @param { Node } src 源节点, 该节点下的所有子节点将被移除 - * @param { Node } tag 目标节点, 从源节点移除的子节点将被追加到该节点下 - * @example - * ```html - *
                      - * - *
                      - *
                      - *
                      - *
                      - * - * - * ``` - */ - - /** - * 把节点src的所有子节点移动到另一个节点tag上去, 可以通过dir参数控制附加的行为是“追加”还是“插入顶部” - * @method moveChild - * @param { Node } src 源节点, 该节点下的所有子节点将被移除 - * @param { Node } tag 目标节点, 从源节点移除的子节点将被附加到该节点下 - * @param { Boolean } dir 附加方式, 如果为true, 则附加进去的节点将被放到目标节点的顶部, 反之,则放到末尾 - * @example - * ```html - *
                      - * - *
                      - *
                      - *
                      - *
                      - * - * - * ``` - */ - moveChild: function(src, tag, dir) { - while (src.firstChild) { - if (dir && tag.firstChild) { - tag.insertBefore(src.lastChild, tag.firstChild); - } else { - tag.appendChild(src.firstChild); - } - } - }, - - /** - * 判断节点的标签上是否不存在任何属性 - * @method hasNoAttributes - * @private - * @param { Node } node 需要检测的节点对象 - * @return { Boolean } 节点是否不包含任何属性 - * @example - * ```html - *
                      xxxx
                      - * - * - * ``` - */ - hasNoAttributes: function(node) { - return browser.ie - ? /^<\w+\s*?>/.test(node.outerHTML) - : node.attributes.length == 0; - }, - - /** - * 检测节点是否是UEditor所使用的辅助节点 - * @method isCustomeNode - * @private - * @param { Node } node 需要检测的节点 - * @remind 辅助节点是指编辑器要完成工作临时添加的节点, 在输出的时候将会从编辑器内移除, 不会影响最终的结果。 - * @return { Boolean } 给定的节点是否是一个辅助节点 - */ - isCustomeNode: function(node) { - return node.nodeType == 1 && node.getAttribute("_ue_custom_node_"); - }, - - /** - * 检测节点的标签是否是给定的标签 - * @method isTagNode - * @param { Node } node 需要检测的节点对象 - * @param { String } tagName 标签 - * @return { Boolean } 节点的标签是否是给定的标签 - * @example - * ```html - *
                      - * - * - * ``` - */ - isTagNode: function(node, tagNames) { - return ( - node.nodeType == 1 && - new RegExp("\\b" + node.tagName + "\\b", "i").test(tagNames) - ); - }, - - /** - * 给定一个节点数组,在通过指定的过滤器过滤后, 获取其中满足过滤条件的第一个节点 - * @method filterNodeList - * @param { Array } nodeList 需要过滤的节点数组 - * @param { Function } fn 过滤器, 对符合条件的节点, 执行结果返回true, 反之则返回false - * @return { Node | NULL } 如果找到符合过滤条件的节点, 则返回该节点, 否则返回NULL - * @example - * ```javascript - * var divNodes = document.getElementsByTagName("div"); - * divNodes = [].slice.call( divNodes, 0 ); - * - * //output: null - * console.log( UE.dom.domUtils.filterNodeList( divNodes, function ( node ) { - * return node.tagName.toLowerCase() !== 'div'; - * } ) ); - * ``` - */ - - /** - * 给定一个节点数组nodeList和一组标签名tagNames, 获取其中能够匹配标签名的节点集合中的第一个节点 - * @method filterNodeList - * @param { Array } nodeList 需要过滤的节点数组 - * @param { String } tagNames 需要匹配的标签名, 多个标签名之间用空格分割 - * @return { Node | NULL } 如果找到标签名匹配的节点, 则返回该节点, 否则返回NULL - * @example - * ```javascript - * var divNodes = document.getElementsByTagName("div"); - * divNodes = [].slice.call( divNodes, 0 ); - * - * //output: null - * console.log( UE.dom.domUtils.filterNodeList( divNodes, 'a span' ) ); - * ``` - */ - - /** - * 给定一个节点数组,在通过指定的过滤器过滤后, 如果参数forAll为true, 则会返回所有满足过滤 - * 条件的节点集合, 否则, 返回满足条件的节点集合中的第一个节点 - * @method filterNodeList - * @param { Array } nodeList 需要过滤的节点数组 - * @param { Function } fn 过滤器, 对符合条件的节点, 执行结果返回true, 反之则返回false - * @param { Boolean } forAll 是否返回整个节点数组, 如果该参数为false, 则返回节点集合中的第一个节点 - * @return { Array | Node | NULL } 如果找到符合过滤条件的节点, 则根据参数forAll的值决定返回满足 - * 过滤条件的节点数组或第一个节点, 否则返回NULL - * @example - * ```javascript - * var divNodes = document.getElementsByTagName("div"); - * divNodes = [].slice.call( divNodes, 0 ); - * - * //output: 3(假定有3个div) - * console.log( divNodes.length ); - * - * var nodes = UE.dom.domUtils.filterNodeList( divNodes, function ( node ) { - * return node.tagName.toLowerCase() === 'div'; - * }, true ); - * - * //output: 3 - * console.log( nodes.length ); - * - * var node = UE.dom.domUtils.filterNodeList( divNodes, function ( node ) { - * return node.tagName.toLowerCase() === 'div'; - * }, false ); - * - * //output: div - * console.log( node.nodeName ); - * ``` - */ - filterNodeList: function(nodelist, filter, forAll) { - var results = []; - if (!utils.isFunction(filter)) { - var str = filter; - filter = function(n) { - return ( - utils.indexOf( - utils.isArray(str) ? str : str.split(" "), - n.tagName.toLowerCase() - ) != -1 - ); - }; - } - utils.each(nodelist, function(n) { - filter(n) && results.push(n); - }); - return results.length == 0 - ? null - : results.length == 1 || !forAll ? results[0] : results; - }, - - /** - * 查询给定的range选区是否在给定的node节点内,且在该节点的最末尾 - * @method isInNodeEndBoundary - * @param { UE.dom.Range } rng 需要判断的range对象, 该对象的startContainer不能为NULL - * @param node 需要检测的节点对象 - * @return { Number } 如果给定的选取range对象是在node内部的最末端, 则返回1, 否则返回0 - */ - isInNodeEndBoundary: function(rng, node) { - var start = rng.startContainer; - if (start.nodeType == 3 && rng.startOffset != start.nodeValue.length) { - return 0; - } - if (start.nodeType == 1 && rng.startOffset != start.childNodes.length) { - return 0; - } - while (start !== node) { - if (start.nextSibling) { - return 0; - } - start = start.parentNode; - } - return 1; - }, - isBoundaryNode: function(node, dir) { - var tmp; - while (!domUtils.isBody(node)) { - tmp = node; - node = node.parentNode; - if (tmp !== node[dir]) { - return false; - } - } - return true; - }, - fillHtml: browser.ie11below ? " " : "
                      " -}); -var fillCharReg = new RegExp(domUtils.fillChar, "g"); - - -// core/Range.js -/** - * Range封装 - * @file - * @module UE.dom - * @class Range - * @since 1.2.6.1 - */ - -/** - * dom操作封装 - * @unfile - * @module UE.dom - */ - -/** - * Range实现类,本类是UEditor底层核心类,封装不同浏览器之间的Range操作。 - * @unfile - * @module UE.dom - * @class Range - */ - -;(function() { - var guid = 0, - fillChar = domUtils.fillChar, - fillData; - - /** - * 更新range的collapse状态 - * @param {Range} range range对象 - */ - function updateCollapse(range) { - range.collapsed = - range.startContainer && - range.endContainer && - range.startContainer === range.endContainer && - range.startOffset == range.endOffset; - } - - function selectOneNode(rng) { - return ( - !rng.collapsed && - rng.startContainer.nodeType == 1 && - rng.startContainer === rng.endContainer && - rng.endOffset - rng.startOffset == 1 - ); - } - function setEndPoint(toStart, node, offset, range) { - //如果node是自闭合标签要处理 - if ( - node.nodeType == 1 && - (dtd.$empty[node.tagName] || dtd.$nonChild[node.tagName]) - ) { - offset = domUtils.getNodeIndex(node) + (toStart ? 0 : 1); - node = node.parentNode; - } - if (toStart) { - range.startContainer = node; - range.startOffset = offset; - if (!range.endContainer) { - range.collapse(true); - } - } else { - range.endContainer = node; - range.endOffset = offset; - if (!range.startContainer) { - range.collapse(false); - } - } - updateCollapse(range); - return range; - } - - function execContentsAction(range, action) { - //调整边界 - //range.includeBookmark(); - var start = range.startContainer, - end = range.endContainer, - startOffset = range.startOffset, - endOffset = range.endOffset, - doc = range.document, - frag = doc.createDocumentFragment(), - tmpStart, - tmpEnd; - if (start.nodeType == 1) { - start = - start.childNodes[startOffset] || - (tmpStart = start.appendChild(doc.createTextNode(""))); - } - if (end.nodeType == 1) { - end = - end.childNodes[endOffset] || - (tmpEnd = end.appendChild(doc.createTextNode(""))); - } - if (start === end && start.nodeType == 3) { - frag.appendChild( - doc.createTextNode( - start.substringData(startOffset, endOffset - startOffset) - ) - ); - //is not clone - if (action) { - start.deleteData(startOffset, endOffset - startOffset); - range.collapse(true); - } - return frag; - } - var current, - currentLevel, - clone = frag, - startParents = domUtils.findParents(start, true), - endParents = domUtils.findParents(end, true); - for (var i = 0; startParents[i] == endParents[i]; ) { - i++; - } - for (var j = i, si; (si = startParents[j]); j++) { - current = si.nextSibling; - if (si == start) { - if (!tmpStart) { - if (range.startContainer.nodeType == 3) { - clone.appendChild( - doc.createTextNode(start.nodeValue.slice(startOffset)) - ); - //is not clone - if (action) { - start.deleteData( - startOffset, - start.nodeValue.length - startOffset - ); - } - } else { - clone.appendChild(!action ? start.cloneNode(true) : start); - } - } - } else { - currentLevel = si.cloneNode(false); - clone.appendChild(currentLevel); - } - while (current) { - if (current === end || current === endParents[j]) { - break; - } - si = current.nextSibling; - clone.appendChild(!action ? current.cloneNode(true) : current); - current = si; - } - clone = currentLevel; - } - clone = frag; - if (!startParents[i]) { - clone.appendChild(startParents[i - 1].cloneNode(false)); - clone = clone.firstChild; - } - for (var j = i, ei; (ei = endParents[j]); j++) { - current = ei.previousSibling; - if (ei == end) { - if (!tmpEnd && range.endContainer.nodeType == 3) { - clone.appendChild( - doc.createTextNode(end.substringData(0, endOffset)) - ); - //is not clone - if (action) { - end.deleteData(0, endOffset); - } - } - } else { - currentLevel = ei.cloneNode(false); - clone.appendChild(currentLevel); - } - //如果两端同级,右边第一次已经被开始做了 - if (j != i || !startParents[i]) { - while (current) { - if (current === start) { - break; - } - ei = current.previousSibling; - clone.insertBefore( - !action ? current.cloneNode(true) : current, - clone.firstChild - ); - current = ei; - } - } - clone = currentLevel; - } - if (action) { - range - .setStartBefore( - !endParents[i] - ? endParents[i - 1] - : !startParents[i] ? startParents[i - 1] : endParents[i] - ) - .collapse(true); - } - tmpStart && domUtils.remove(tmpStart); - tmpEnd && domUtils.remove(tmpEnd); - return frag; - } - - /** - * 创建一个跟document绑定的空的Range实例 - * @constructor - * @param { Document } document 新建的选区所属的文档对象 - */ - - /** - * @property { Node } startContainer 当前Range的开始边界的容器节点, 可以是一个元素节点或者是文本节点 - */ - - /** - * @property { Node } startOffset 当前Range的开始边界容器节点的偏移量, 如果是元素节点, - * 该值就是childNodes中的第几个节点, 如果是文本节点就是文本内容的第几个字符 - */ - - /** - * @property { Node } endContainer 当前Range的结束边界的容器节点, 可以是一个元素节点或者是文本节点 - */ - - /** - * @property { Node } endOffset 当前Range的结束边界容器节点的偏移量, 如果是元素节点, - * 该值就是childNodes中的第几个节点, 如果是文本节点就是文本内容的第几个字符 - */ - - /** - * @property { Boolean } collapsed 当前Range是否闭合 - * @default true - * @remind Range是闭合的时候, startContainer === endContainer && startOffset === endOffset - */ - - /** - * @property { Document } document 当前Range所属的Document对象 - * @remind 不同range的的document属性可以是不同的 - */ - var Range = (dom.Range = function(document) { - var me = this; - me.startContainer = me.startOffset = me.endContainer = me.endOffset = null; - me.document = document; - me.collapsed = true; - }); - - /** - * 删除fillData - * @param doc - * @param excludeNode - */ - function removeFillData(doc, excludeNode) { - try { - if (fillData && domUtils.inDoc(fillData, doc)) { - if (!fillData.nodeValue.replace(fillCharReg, "").length) { - var tmpNode = fillData.parentNode; - domUtils.remove(fillData); - while ( - tmpNode && - domUtils.isEmptyInlineElement(tmpNode) && - //safari的contains有bug - (browser.safari - ? !( - domUtils.getPosition(tmpNode, excludeNode) & - domUtils.POSITION_CONTAINS - ) - : !tmpNode.contains(excludeNode)) - ) { - fillData = tmpNode.parentNode; - domUtils.remove(tmpNode); - tmpNode = fillData; - } - } else { - fillData.nodeValue = fillData.nodeValue.replace(fillCharReg, ""); - } - } - } catch (e) {} - } - - /** - * @param node - * @param dir - */ - function mergeSibling(node, dir) { - var tmpNode; - node = node[dir]; - while (node && domUtils.isFillChar(node)) { - tmpNode = node[dir]; - domUtils.remove(node); - node = tmpNode; - } - } - - Range.prototype = { - /** - * 克隆选区的内容到一个DocumentFragment里 - * @method cloneContents - * @return { DocumentFragment | NULL } 如果选区是闭合的将返回null, 否则, 返回包含所clone内容的DocumentFragment元素 - * @example - * ```html - * - * - * xx[xxx]x - * - * - * - * ``` - */ - cloneContents: function() { - return this.collapsed ? null : execContentsAction(this, 0); - }, - - /** - * 删除当前选区范围中的所有内容 - * @method deleteContents - * @remind 执行完该操作后, 当前Range对象变成了闭合状态 - * @return { UE.dom.Range } 当前操作的Range对象 - * @example - * ```html - * - * - * xx[xxx]x - * - * - * - * ``` - */ - deleteContents: function() { - var txt; - if (!this.collapsed) { - execContentsAction(this, 1); - } - if (browser.webkit) { - txt = this.startContainer; - if (txt.nodeType == 3 && !txt.nodeValue.length) { - this.setStartBefore(txt).collapse(true); - domUtils.remove(txt); - } - } - return this; - }, - - /** - * 将当前选区的内容提取到一个DocumentFragment里 - * @method extractContents - * @remind 执行该操作后, 选区将变成闭合状态 - * @warning 执行该操作后, 原来选区所选中的内容将从dom树上剥离出来 - * @return { DocumentFragment } 返回包含所提取内容的DocumentFragment对象 - * @example - * ```html - * - * - * xx[xxx]x - * - * - * - */ - extractContents: function() { - return this.collapsed ? null : execContentsAction(this, 2); - }, - - /** - * 设置Range的开始容器节点和偏移量 - * @method setStart - * @remind 如果给定的节点是元素节点,那么offset指的是其子元素中索引为offset的元素, - * 如果是文本节点,那么offset指的是其文本内容的第offset个字符 - * @remind 如果提供的容器节点是一个不能包含子元素的节点, 则该选区的开始容器将被设置 - * 为该节点的父节点, 此时, 其距离开始容器的偏移量也变成了该节点在其父节点 - * 中的索引 - * @param { Node } node 将被设为当前选区开始边界容器的节点对象 - * @param { int } offset 选区的开始位置偏移量 - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * xxxxxxxxxxxxx[xxx] - * - * - * ``` - * @example - * ```html - * - * xxx[xx]x - * - * - * ``` - */ - setStart: function(node, offset) { - return setEndPoint(true, node, offset, this); - }, - - /** - * 设置Range的结束容器和偏移量 - * @method setEnd - * @param { Node } node 作为当前选区结束边界容器的节点对象 - * @param { int } offset 结束边界的偏移量 - * @see UE.dom.Range:setStart(Node,int) - * @return { UE.dom.Range } 当前range对象 - */ - setEnd: function(node, offset) { - return setEndPoint(false, node, offset, this); - }, - - /** - * 将Range开始位置设置到node节点之后 - * @method setStartAfter - * @remind 该操作将会把给定节点的父节点作为range的开始容器, 且偏移量是该节点在其父节点中的位置索引+1 - * @param { Node } node 选区的开始边界将紧接着该节点之后 - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * xxxxxxx[xxxx] - * - * - * ``` - */ - setStartAfter: function(node) { - return this.setStart(node.parentNode, domUtils.getNodeIndex(node) + 1); - }, - - /** - * 将Range开始位置设置到node节点之前 - * @method setStartBefore - * @remind 该操作将会把给定节点的父节点作为range的开始容器, 且偏移量是该节点在其父节点中的位置索引 - * @param { Node } node 新的选区开始位置在该节点之前 - * @see UE.dom.Range:setStartAfter(Node) - * @return { UE.dom.Range } 当前range对象 - */ - setStartBefore: function(node) { - return this.setStart(node.parentNode, domUtils.getNodeIndex(node)); - }, - - /** - * 将Range结束位置设置到node节点之后 - * @method setEndAfter - * @remind 该操作将会把给定节点的父节点作为range的结束容器, 且偏移量是该节点在其父节点中的位置索引+1 - * @param { Node } node 目标节点 - * @see UE.dom.Range:setStartAfter(Node) - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * [xxxxxxx]xxxx - * - * - * ``` - */ - setEndAfter: function(node) { - return this.setEnd(node.parentNode, domUtils.getNodeIndex(node) + 1); - }, - - /** - * 将Range结束位置设置到node节点之前 - * @method setEndBefore - * @remind 该操作将会把给定节点的父节点作为range的结束容器, 且偏移量是该节点在其父节点中的位置索引 - * @param { Node } node 目标节点 - * @see UE.dom.Range:setEndAfter(Node) - * @return { UE.dom.Range } 当前range对象 - */ - setEndBefore: function(node) { - return this.setEnd(node.parentNode, domUtils.getNodeIndex(node)); - }, - - /** - * 设置Range的开始位置到node节点内的第一个子节点之前 - * @method setStartAtFirst - * @remind 选区的开始容器将变成给定的节点, 且偏移量为0 - * @remind 如果给定的节点是元素节点, 则该节点必须是允许包含子节点的元素。 - * @param { Node } node 目标节点 - * @see UE.dom.Range:setStartBefore(Node) - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * xxxxx[xx]xxxx - * - * - * ``` - */ - setStartAtFirst: function(node) { - return this.setStart(node, 0); - }, - - /** - * 设置Range的开始位置到node节点内的最后一个节点之后 - * @method setStartAtLast - * @remind 选区的开始容器将变成给定的节点, 且偏移量为该节点的子节点数 - * @remind 如果给定的节点是元素节点, 则该节点必须是允许包含子节点的元素。 - * @param { Node } node 目标节点 - * @see UE.dom.Range:setStartAtFirst(Node) - * @return { UE.dom.Range } 当前range对象 - */ - setStartAtLast: function(node) { - return this.setStart( - node, - node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length - ); - }, - - /** - * 设置Range的结束位置到node节点内的第一个节点之前 - * @method setEndAtFirst - * @param { Node } node 目标节点 - * @remind 选区的结束容器将变成给定的节点, 且偏移量为0 - * @remind node必须是一个元素节点, 且必须是允许包含子节点的元素。 - * @see UE.dom.Range:setStartAtFirst(Node) - * @return { UE.dom.Range } 当前range对象 - */ - setEndAtFirst: function(node) { - return this.setEnd(node, 0); - }, - - /** - * 设置Range的结束位置到node节点内的最后一个节点之后 - * @method setEndAtLast - * @param { Node } node 目标节点 - * @remind 选区的结束容器将变成给定的节点, 且偏移量为该节点的子节点数量 - * @remind node必须是一个元素节点, 且必须是允许包含子节点的元素。 - * @see UE.dom.Range:setStartAtFirst(Node) - * @return { UE.dom.Range } 当前range对象 - */ - setEndAtLast: function(node) { - return this.setEnd( - node, - node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length - ); - }, - - /** - * 选中给定节点 - * @method selectNode - * @remind 此时, 选区的开始容器和结束容器都是该节点的父节点, 其startOffset是该节点在父节点中的位置索引, - * 而endOffset为startOffset+1 - * @param { Node } node 需要选中的节点 - * @return { UE.dom.Range } 当前range对象,此时的range仅包含当前给定的节点对象 - * @example - * ```html - * - * xxxxx[xx]xxxx - * - * - * ``` - */ - selectNode: function(node) { - return this.setStartBefore(node).setEndAfter(node); - }, - - /** - * 选中给定节点内部的所有节点 - * @method selectNodeContents - * @remind 此时, 选区的开始容器和结束容器都是该节点, 其startOffset为0, - * 而endOffset是该节点的子节点数。 - * @param { Node } node 目标节点, 当前range将包含该节点内的所有节点 - * @return { UE.dom.Range } 当前range对象, 此时range仅包含给定节点的所有子节点 - * @example - * ```html - * - * xxxxx[xx]xxxx - * - * - * ``` - */ - selectNodeContents: function(node) { - return this.setStart(node, 0).setEndAtLast(node); - }, - - /** - * clone当前Range对象 - * @method cloneRange - * @remind 返回的range是一个全新的range对象, 其内部所有属性与当前被clone的range相同。 - * @return { UE.dom.Range } 当前range对象的一个副本 - */ - cloneRange: function() { - var me = this; - return new Range(me.document) - .setStart(me.startContainer, me.startOffset) - .setEnd(me.endContainer, me.endOffset); - }, - - /** - * 向当前选区的结束处闭合选区 - * @method collapse - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * xxxxx[xx]xxxx - * - * - * ``` - */ - - /** - * 闭合当前选区,根据给定的toStart参数项决定是向当前选区开始处闭合还是向结束处闭合, - * 如果toStart的值为true,则向开始位置闭合, 反之,向结束位置闭合。 - * @method collapse - * @param { Boolean } toStart 是否向选区开始处闭合 - * @return { UE.dom.Range } 当前range对象,此时range对象处于闭合状态 - * @see UE.dom.Range:collapse() - * @example - * ```html - * - * xxxxx[xx]xxxx - * - * - * ``` - */ - collapse: function(toStart) { - var me = this; - if (toStart) { - me.endContainer = me.startContainer; - me.endOffset = me.startOffset; - } else { - me.startContainer = me.endContainer; - me.startOffset = me.endOffset; - } - me.collapsed = true; - return me; - }, - - /** - * 调整range的开始位置和结束位置,使其"收缩"到最小的位置 - * @method shrinkBoundary - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * xxxx[xxxxx] => xxxx[xxxxx] - * ``` - * - * @example - * ```html - * - * x[xx]xxx - * - * - * ``` - * - * @example - * ```html - * [xxxxxxxxxxx] => [xxxxxxxxxxx] - * ``` - */ - - /** - * 调整range的开始位置和结束位置,使其"收缩"到最小的位置, - * 如果ignoreEnd的值为true,则忽略对结束位置的调整 - * @method shrinkBoundary - * @param { Boolean } ignoreEnd 是否忽略对结束位置的调整 - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.domUtils.Range:shrinkBoundary() - */ - shrinkBoundary: function(ignoreEnd) { - var me = this, - child, - collapsed = me.collapsed; - function check(node) { - return ( - node.nodeType == 1 && - !domUtils.isBookmarkNode(node) && - !dtd.$empty[node.tagName] && - !dtd.$nonChild[node.tagName] - ); - } - while ( - me.startContainer.nodeType == 1 && //是element - (child = me.startContainer.childNodes[me.startOffset]) && //子节点也是element - check(child) - ) { - me.setStart(child, 0); - } - if (collapsed) { - return me.collapse(true); - } - if (!ignoreEnd) { - while ( - me.endContainer.nodeType == 1 && //是element - me.endOffset > 0 && //如果是空元素就退出 endOffset=0那么endOffst-1为负值,childNodes[endOffset]报错 - (child = me.endContainer.childNodes[me.endOffset - 1]) && //子节点也是element - check(child) - ) { - me.setEnd(child, child.childNodes.length); - } - } - return me; - }, - - /** - * 获取离当前选区内包含的所有节点最近的公共祖先节点, - * @method getCommonAncestor - * @remind 返回的公共祖先节点一定不是range自身的容器节点, 但有可能是一个文本节点 - * @return { Node } 当前range对象内所有节点的公共祖先节点 - * @example - * ```html - * //选区示例 - * xxxx[xxx]xxxxxx - * - * ``` - */ - - /** - * 获取当前选区所包含的所有节点的公共祖先节点, 可以根据给定的参数 includeSelf 决定获取到 - * 的公共祖先节点是否可以是当前选区的startContainer或endContainer节点, 如果 includeSelf - * 的取值为true, 则返回的节点可以是自身的容器节点, 否则, 则不能是容器节点 - * @method getCommonAncestor - * @param { Boolean } includeSelf 是否允许获取到的公共祖先节点是当前range对象的容器节点 - * @return { Node } 当前range对象内所有节点的公共祖先节点 - * @see UE.dom.Range:getCommonAncestor() - * @example - * ```html - * - * - * - * xxxxxxxxx[xxx]xxxxxxxx - * - * - * - * - * ``` - */ - - /** - * 获取当前选区所包含的所有节点的公共祖先节点, 可以根据给定的参数 includeSelf 决定获取到 - * 的公共祖先节点是否可以是当前选区的startContainer或endContainer节点, 如果 includeSelf - * 的取值为true, 则返回的节点可以是自身的容器节点, 否则, 则不能是容器节点; 同时可以根据 - * ignoreTextNode 参数的取值决定是否忽略类型为文本节点的祖先节点。 - * @method getCommonAncestor - * @param { Boolean } includeSelf 是否允许获取到的公共祖先节点是当前range对象的容器节点 - * @param { Boolean } ignoreTextNode 获取祖先节点的过程中是否忽略类型为文本节点的祖先节点 - * @return { Node } 当前range对象内所有节点的公共祖先节点 - * @see UE.dom.Range:getCommonAncestor() - * @see UE.dom.Range:getCommonAncestor(Boolean) - * @example - * ```html - * - * - * - * xxxxxxxx[x]xxxxxxxxxxx - * - * - * - * - * ``` - */ - getCommonAncestor: function(includeSelf, ignoreTextNode) { - var me = this, - start = me.startContainer, - end = me.endContainer; - if (start === end) { - if (includeSelf && selectOneNode(this)) { - start = start.childNodes[me.startOffset]; - if (start.nodeType == 1) return start; - } - //只有在上来就相等的情况下才会出现是文本的情况 - return ignoreTextNode && start.nodeType == 3 ? start.parentNode : start; - } - return domUtils.getCommonAncestor(start, end); - }, - - /** - * 调整当前Range的开始和结束边界容器,如果是容器节点是文本节点,就调整到包含该文本节点的父节点上 - * @method trimBoundary - * @remind 该操作有可能会引起文本节点被切开 - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * //选区示例 - * xxx[xxxxx]xxx - * - * - * ``` - */ - - /** - * 调整当前Range的开始和结束边界容器,如果是容器节点是文本节点,就调整到包含该文本节点的父节点上, - * 可以根据 ignoreEnd 参数的值决定是否调整对结束边界的调整 - * @method trimBoundary - * @param { Boolean } ignoreEnd 是否忽略对结束边界的调整 - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * //选区示例 - * xxx[xxxxx]xxx - * - * - * ``` - */ - trimBoundary: function(ignoreEnd) { - this.txtToElmBoundary(); - var start = this.startContainer, - offset = this.startOffset, - collapsed = this.collapsed, - end = this.endContainer; - if (start.nodeType == 3) { - if (offset == 0) { - this.setStartBefore(start); - } else { - if (offset >= start.nodeValue.length) { - this.setStartAfter(start); - } else { - var textNode = domUtils.split(start, offset); - //跟新结束边界 - if (start === end) { - this.setEnd(textNode, this.endOffset - offset); - } else if (start.parentNode === end) { - this.endOffset += 1; - } - this.setStartBefore(textNode); - } - } - if (collapsed) { - return this.collapse(true); - } - } - if (!ignoreEnd) { - offset = this.endOffset; - end = this.endContainer; - if (end.nodeType == 3) { - if (offset == 0) { - this.setEndBefore(end); - } else { - offset < end.nodeValue.length && domUtils.split(end, offset); - this.setEndAfter(end); - } - } - } - return this; - }, - - /** - * 如果选区在文本的边界上,就扩展选区到文本的父节点上, 如果当前选区是闭合的, 则什么也不做 - * @method txtToElmBoundary - * @remind 该操作不会修改dom节点 - * @return { UE.dom.Range } 当前range对象 - */ - - /** - * 如果选区在文本的边界上,就扩展选区到文本的父节点上, 如果当前选区是闭合的, 则根据参数项 - * ignoreCollapsed 的值决定是否执行该调整 - * @method txtToElmBoundary - * @param { Boolean } ignoreCollapsed 是否忽略选区的闭合状态, 如果该参数取值为true, 则 - * 不论选区是否闭合, 都会执行该操作, 反之, 则不会对闭合的选区执行该操作 - * @return { UE.dom.Range } 当前range对象 - */ - txtToElmBoundary: function(ignoreCollapsed) { - function adjust(r, c) { - var container = r[c + "Container"], - offset = r[c + "Offset"]; - if (container.nodeType == 3) { - if (!offset) { - r[ - "set" + - c.replace(/(\w)/, function(a) { - return a.toUpperCase(); - }) + - "Before" - ](container); - } else if (offset >= container.nodeValue.length) { - r[ - "set" + - c.replace(/(\w)/, function(a) { - return a.toUpperCase(); - }) + - "After" - ](container); - } - } - } - - if (ignoreCollapsed || !this.collapsed) { - adjust(this, "start"); - adjust(this, "end"); - } - return this; - }, - - /** - * 在当前选区的开始位置前插入节点,新插入的节点会被该range包含 - * @method insertNode - * @param { Node } node 需要插入的节点 - * @remind 插入的节点可以是一个DocumentFragment依次插入多个节点 - * @return { UE.dom.Range } 当前range对象 - */ - insertNode: function(node) { - var first = node, - length = 1; - if (node.nodeType == 11) { - first = node.firstChild; - length = node.childNodes.length; - } - this.trimBoundary(true); - var start = this.startContainer, - offset = this.startOffset; - var nextNode = start.childNodes[offset]; - if (nextNode) { - start.insertBefore(node, nextNode); - } else { - start.appendChild(node); - } - if (first.parentNode === this.endContainer) { - this.endOffset = this.endOffset + length; - } - return this.setStartBefore(first); - }, - - /** - * 闭合选区到当前选区的开始位置, 并且定位光标到闭合后的位置 - * @method setCursor - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.Range:collapse() - */ - - /** - * 闭合选区,可以根据参数toEnd的值控制选区是向前闭合还是向后闭合, 并且定位光标到闭合后的位置。 - * @method setCursor - * @param { Boolean } toEnd 是否向后闭合, 如果为true, 则闭合选区时, 将向结束容器方向闭合, - * 反之,则向开始容器方向闭合 - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.Range:collapse(Boolean) - */ - setCursor: function(toEnd, noFillData) { - return this.collapse(!toEnd).select(noFillData); - }, - - /** - * 创建当前range的一个书签,记录下当前range的位置,方便当dom树改变时,还能找回原来的选区位置 - * @method createBookmark - * @param { Boolean } serialize 控制返回的标记位置是对当前位置的引用还是ID,如果该值为true,则 - * 返回标记位置的ID, 反之则返回标记位置节点的引用 - * @return { Object } 返回一个书签记录键值对, 其包含的key有: start => 开始标记的ID或者引用, - * end => 结束标记的ID或引用, id => 当前标记的类型, 如果为true,则表示 - * 返回的记录的类型为ID, 反之则为引用 - */ - createBookmark: function(serialize, same) { - var endNode, - startNode = this.document.createElement("span"); - startNode.style.cssText = "display:none;line-height:0px;"; - startNode.appendChild(this.document.createTextNode("\u200D")); - startNode.id = "_baidu_bookmark_start_" + (same ? "" : guid++); - - if (!this.collapsed) { - endNode = startNode.cloneNode(true); - endNode.id = "_baidu_bookmark_end_" + (same ? "" : guid++); - } - this.insertNode(startNode); - if (endNode) { - this.collapse().insertNode(endNode).setEndBefore(endNode); - } - this.setStartAfter(startNode); - return { - start: serialize ? startNode.id : startNode, - end: endNode ? (serialize ? endNode.id : endNode) : null, - id: serialize - }; - }, - - /** - * 调整当前range的边界到书签位置,并删除该书签对象所标记的位置内的节点 - * @method moveToBookmark - * @param { BookMark } bookmark createBookmark所创建的标签对象 - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.Range:createBookmark(Boolean) - */ - moveToBookmark: function(bookmark) { - var start = bookmark.id - ? this.document.getElementById(bookmark.start) - : bookmark.start, - end = bookmark.end && bookmark.id - ? this.document.getElementById(bookmark.end) - : bookmark.end; - this.setStartBefore(start); - domUtils.remove(start); - if (end) { - this.setEndBefore(end); - domUtils.remove(end); - } else { - this.collapse(true); - } - return this; - }, - - /** - * 调整range的边界,使其"放大"到最近的父节点 - * @method enlarge - * @remind 会引起选区的变化 - * @return { UE.dom.Range } 当前range对象 - */ - - /** - * 调整range的边界,使其"放大"到最近的父节点,根据参数 toBlock 的取值, 可以 - * 要求扩大之后的父节点是block节点 - * @method enlarge - * @param { Boolean } toBlock 是否要求扩大之后的父节点必须是block节点 - * @return { UE.dom.Range } 当前range对象 - */ - enlarge: function(toBlock, stopFn) { - var isBody = domUtils.isBody, - pre, - node, - tmp = this.document.createTextNode(""); - if (toBlock) { - node = this.startContainer; - if (node.nodeType == 1) { - if (node.childNodes[this.startOffset]) { - pre = node = node.childNodes[this.startOffset]; - } else { - node.appendChild(tmp); - pre = node = tmp; - } - } else { - pre = node; - } - while (1) { - if (domUtils.isBlockElm(node)) { - node = pre; - while ((pre = node.previousSibling) && !domUtils.isBlockElm(pre)) { - node = pre; - } - this.setStartBefore(node); - break; - } - pre = node; - node = node.parentNode; - } - node = this.endContainer; - if (node.nodeType == 1) { - if ((pre = node.childNodes[this.endOffset])) { - node.insertBefore(tmp, pre); - } else { - node.appendChild(tmp); - } - pre = node = tmp; - } else { - pre = node; - } - while (1) { - if (domUtils.isBlockElm(node)) { - node = pre; - while ((pre = node.nextSibling) && !domUtils.isBlockElm(pre)) { - node = pre; - } - this.setEndAfter(node); - break; - } - pre = node; - node = node.parentNode; - } - if (tmp.parentNode === this.endContainer) { - this.endOffset--; - } - domUtils.remove(tmp); - } - - // 扩展边界到最大 - if (!this.collapsed) { - while (this.startOffset == 0) { - if (stopFn && stopFn(this.startContainer)) { - break; - } - if (isBody(this.startContainer)) { - break; - } - this.setStartBefore(this.startContainer); - } - while ( - this.endOffset == - (this.endContainer.nodeType == 1 - ? this.endContainer.childNodes.length - : this.endContainer.nodeValue.length) - ) { - if (stopFn && stopFn(this.endContainer)) { - break; - } - if (isBody(this.endContainer)) { - break; - } - this.setEndAfter(this.endContainer); - } - } - return this; - }, - enlargeToBlockElm: function(ignoreEnd) { - while (!domUtils.isBlockElm(this.startContainer)) { - this.setStartBefore(this.startContainer); - } - if (!ignoreEnd) { - while (!domUtils.isBlockElm(this.endContainer)) { - this.setEndAfter(this.endContainer); - } - } - return this; - }, - /** - * 调整Range的边界,使其"缩小"到最合适的位置 - * @method adjustmentBoundary - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.Range:shrinkBoundary() - */ - adjustmentBoundary: function() { - if (!this.collapsed) { - while ( - !domUtils.isBody(this.startContainer) && - this.startOffset == - this.startContainer[ - this.startContainer.nodeType == 3 ? "nodeValue" : "childNodes" - ].length && - this.startContainer[ - this.startContainer.nodeType == 3 ? "nodeValue" : "childNodes" - ].length - ) { - this.setStartAfter(this.startContainer); - } - while ( - !domUtils.isBody(this.endContainer) && - !this.endOffset && - this.endContainer[ - this.endContainer.nodeType == 3 ? "nodeValue" : "childNodes" - ].length - ) { - this.setEndBefore(this.endContainer); - } - } - return this; - }, - - /** - * 给range选区中的内容添加给定的inline标签 - * @method applyInlineStyle - * @param { String } tagName 需要添加的标签名 - * @example - * ```html - *

                      xxxx[xxxx]x

                      ==> range.applyInlineStyle("strong") ==>

                      xxxx[xxxx]x

                      - * ``` - */ - - /** - * 给range选区中的内容添加给定的inline标签, 并且为标签附加上一些初始化属性。 - * @method applyInlineStyle - * @param { String } tagName 需要添加的标签名 - * @param { Object } attrs 跟随新添加的标签的属性 - * @return { UE.dom.Range } 当前选区 - * @example - * ```html - *

                      xxxx[xxxx]x

                      - * - * ==> - * - * - * range.applyInlineStyle("strong",{"style":"font-size:12px"}) - * - * ==> - * - *

                      xxxx[xxxx]x

                      - * ``` - */ - applyInlineStyle: function(tagName, attrs, list) { - if (this.collapsed) return this; - this.trimBoundary() - .enlarge(false, function(node) { - return node.nodeType == 1 && domUtils.isBlockElm(node); - }) - .adjustmentBoundary(); - var bookmark = this.createBookmark(), - end = bookmark.end, - filterFn = function(node) { - return node.nodeType == 1 - ? node.tagName.toLowerCase() != "br" - : !domUtils.isWhitespace(node); - }, - current = domUtils.getNextDomNode(bookmark.start, false, filterFn), - node, - pre, - range = this.cloneRange(); - while ( - current && - domUtils.getPosition(current, end) & domUtils.POSITION_PRECEDING - ) { - if (current.nodeType == 3 || dtd[tagName][current.tagName]) { - range.setStartBefore(current); - node = current; - while ( - node && - (node.nodeType == 3 || dtd[tagName][node.tagName]) && - node !== end - ) { - pre = node; - node = domUtils.getNextDomNode( - node, - node.nodeType == 1, - null, - function(parent) { - return dtd[tagName][parent.tagName]; - } - ); - } - var frag = range.setEndAfter(pre).extractContents(), - elm; - if (list && list.length > 0) { - var level, top; - top = level = list[0].cloneNode(false); - for (var i = 1, ci; (ci = list[i++]); ) { - level.appendChild(ci.cloneNode(false)); - level = level.firstChild; - } - elm = level; - } else { - elm = range.document.createElement(tagName); - } - if (attrs) { - domUtils.setAttributes(elm, attrs); - } - elm.appendChild(frag); - //针对嵌套span的全局样式指定,做容错处理 - if (elm.tagName == "SPAN" && attrs && attrs.style) { - utils.each(elm.getElementsByTagName("span"), function(s) { - s.style.cssText = s.style.cssText + ";" + attrs.style; - }); - } - range.insertNode(list ? top : elm); - //处理下滑线在a上的情况 - var aNode; - if ( - tagName == "span" && - attrs.style && - /text\-decoration/.test(attrs.style) && - (aNode = domUtils.findParentByTagName(elm, "a", true)) - ) { - domUtils.setAttributes(aNode, attrs); - domUtils.remove(elm, true); - elm = aNode; - } else { - domUtils.mergeSibling(elm); - domUtils.clearEmptySibling(elm); - } - //去除子节点相同的 - domUtils.mergeChild(elm, attrs); - current = domUtils.getNextDomNode(elm, false, filterFn); - domUtils.mergeToParent(elm); - if (node === end) { - break; - } - } else { - current = domUtils.getNextDomNode(current, true, filterFn); - } - } - return this.moveToBookmark(bookmark); - }, - - /** - * 移除当前选区内指定的inline标签,但保留其中的内容 - * @method removeInlineStyle - * @param { String } tagName 需要移除的标签名 - * @return { UE.dom.Range } 当前的range对象 - * @example - * ```html - * xx[xxxxyyyzz]z => range.removeInlineStyle(["em"]) => xx[xxxxyyyzz]z - * ``` - */ - - /** - * 移除当前选区内指定的一组inline标签,但保留其中的内容 - * @method removeInlineStyle - * @param { Array } tagNameArr 需要移除的标签名的数组 - * @return { UE.dom.Range } 当前的range对象 - * @see UE.dom.Range:removeInlineStyle(String) - */ - removeInlineStyle: function(tagNames) { - if (this.collapsed) return this; - tagNames = utils.isArray(tagNames) ? tagNames : [tagNames]; - this.shrinkBoundary().adjustmentBoundary(); - var start = this.startContainer, - end = this.endContainer; - while (1) { - if (start.nodeType == 1) { - if (utils.indexOf(tagNames, start.tagName.toLowerCase()) > -1) { - break; - } - if (start.tagName.toLowerCase() == "body") { - start = null; - break; - } - } - start = start.parentNode; - } - while (1) { - if (end.nodeType == 1) { - if (utils.indexOf(tagNames, end.tagName.toLowerCase()) > -1) { - break; - } - if (end.tagName.toLowerCase() == "body") { - end = null; - break; - } - } - end = end.parentNode; - } - var bookmark = this.createBookmark(), - frag, - tmpRange; - if (start) { - tmpRange = this.cloneRange() - .setEndBefore(bookmark.start) - .setStartBefore(start); - frag = tmpRange.extractContents(); - tmpRange.insertNode(frag); - domUtils.clearEmptySibling(start, true); - start.parentNode.insertBefore(bookmark.start, start); - } - if (end) { - tmpRange = this.cloneRange() - .setStartAfter(bookmark.end) - .setEndAfter(end); - frag = tmpRange.extractContents(); - tmpRange.insertNode(frag); - domUtils.clearEmptySibling(end, false, true); - end.parentNode.insertBefore(bookmark.end, end.nextSibling); - } - var current = domUtils.getNextDomNode(bookmark.start, false, function( - node - ) { - return node.nodeType == 1; - }), - next; - while (current && current !== bookmark.end) { - next = domUtils.getNextDomNode(current, true, function(node) { - return node.nodeType == 1; - }); - if (utils.indexOf(tagNames, current.tagName.toLowerCase()) > -1) { - domUtils.remove(current, true); - } - current = next; - } - return this.moveToBookmark(bookmark); - }, - - /** - * 获取当前选中的自闭合的节点 - * @method getClosedNode - * @return { Node | NULL } 如果当前选中的是自闭合节点, 则返回该节点, 否则返回NULL - */ - getClosedNode: function() { - var node; - if (!this.collapsed) { - var range = this.cloneRange().adjustmentBoundary().shrinkBoundary(); - if (selectOneNode(range)) { - var child = range.startContainer.childNodes[range.startOffset]; - if ( - child && - child.nodeType == 1 && - (dtd.$empty[child.tagName] || dtd.$nonChild[child.tagName]) - ) { - node = child; - } - } - } - return node; - }, - - /** - * 在页面上高亮range所表示的选区 - * @method select - * @return { UE.dom.Range } 返回当前Range对象 - */ - //这里不区分ie9以上,trace:3824 - select: browser.ie - ? function(noFillData, textRange) { - var nativeRange; - if (!this.collapsed) this.shrinkBoundary(); - var node = this.getClosedNode(); - if (node && !textRange) { - try { - nativeRange = this.document.body.createControlRange(); - nativeRange.addElement(node); - nativeRange.select(); - } catch (e) {} - return this; - } - var bookmark = this.createBookmark(), - start = bookmark.start, - end; - nativeRange = this.document.body.createTextRange(); - nativeRange.moveToElementText(start); - nativeRange.moveStart("character", 1); - if (!this.collapsed) { - var nativeRangeEnd = this.document.body.createTextRange(); - end = bookmark.end; - nativeRangeEnd.moveToElementText(end); - nativeRange.setEndPoint("EndToEnd", nativeRangeEnd); - } else { - if (!noFillData && this.startContainer.nodeType != 3) { - //使用|x固定住光标 - var tmpText = this.document.createTextNode(fillChar), - tmp = this.document.createElement("span"); - tmp.appendChild(this.document.createTextNode(fillChar)); - start.parentNode.insertBefore(tmp, start); - start.parentNode.insertBefore(tmpText, start); - //当点b,i,u时,不能清除i上边的b - removeFillData(this.document, tmpText); - fillData = tmpText; - mergeSibling(tmp, "previousSibling"); - mergeSibling(start, "nextSibling"); - nativeRange.moveStart("character", -1); - nativeRange.collapse(true); - } - } - this.moveToBookmark(bookmark); - tmp && domUtils.remove(tmp); - //IE在隐藏状态下不支持range操作,catch一下 - try { - nativeRange.select(); - } catch (e) {} - return this; - } - : function(notInsertFillData) { - function checkOffset(rng) { - function check(node, offset, dir) { - if (node.nodeType == 3 && node.nodeValue.length < offset) { - rng[dir + "Offset"] = node.nodeValue.length; - } - } - check(rng.startContainer, rng.startOffset, "start"); - check(rng.endContainer, rng.endOffset, "end"); - } - var win = domUtils.getWindow(this.document), - sel = win.getSelection(), - txtNode; - //FF下关闭自动长高时滚动条在关闭dialog时会跳 - //ff下如果不body.focus将不能定位闭合光标到编辑器内 - browser.gecko ? this.document.body.focus() : win.focus(); - if (sel) { - sel.removeAllRanges(); - // trace:870 chrome/safari后边是br对于闭合得range不能定位 所以去掉了判断 - // this.startContainer.nodeType != 3 &&! ((child = this.startContainer.childNodes[this.startOffset]) && child.nodeType == 1 && child.tagName == 'BR' - if (this.collapsed && !notInsertFillData) { - // //opear如果没有节点接着,原生的不能够定位,不能在body的第一级插入空白节点 - // if (notInsertFillData && browser.opera && !domUtils.isBody(this.startContainer) && this.startContainer.nodeType == 1) { - // var tmp = this.document.createTextNode(''); - // this.insertNode(tmp).setStart(tmp, 0).collapse(true); - // } - // - //处理光标落在文本节点的情况 - //处理以下的情况 - //|xxxx - //xxxx|xxxx - //xxxx| - var start = this.startContainer, - child = start; - if (start.nodeType == 1) { - child = start.childNodes[this.startOffset]; - } - if ( - !(start.nodeType == 3 && this.startOffset) && - (child - ? !child.previousSibling || - child.previousSibling.nodeType != 3 - : !start.lastChild || start.lastChild.nodeType != 3) - ) { - txtNode = this.document.createTextNode(fillChar); - //跟着前边走 - this.insertNode(txtNode); - removeFillData(this.document, txtNode); - mergeSibling(txtNode, "previousSibling"); - mergeSibling(txtNode, "nextSibling"); - fillData = txtNode; - this.setStart(txtNode, browser.webkit ? 1 : 0).collapse(true); - } - } - var nativeRange = this.document.createRange(); - if ( - this.collapsed && - browser.opera && - this.startContainer.nodeType == 1 - ) { - var child = this.startContainer.childNodes[this.startOffset]; - if (!child) { - //往前靠拢 - child = this.startContainer.lastChild; - if (child && domUtils.isBr(child)) { - this.setStartBefore(child).collapse(true); - } - } else { - //向后靠拢 - while (child && domUtils.isBlockElm(child)) { - if (child.nodeType == 1 && child.childNodes[0]) { - child = child.childNodes[0]; - } else { - break; - } - } - child && this.setStartBefore(child).collapse(true); - } - } - //是createAddress最后一位算的不准,现在这里进行微调 - checkOffset(this); - nativeRange.setStart(this.startContainer, this.startOffset); - nativeRange.setEnd(this.endContainer, this.endOffset); - sel.addRange(nativeRange); - } - return this; - }, - - /** - * 滚动到当前range开始的位置 - * @method scrollToView - * @param { Window } win 当前range对象所属的window对象 - * @return { UE.dom.Range } 当前Range对象 - */ - - /** - * 滚动到距离当前range开始位置 offset 的位置处 - * @method scrollToView - * @param { Window } win 当前range对象所属的window对象 - * @param { Number } offset 距离range开始位置处的偏移量, 如果为正数, 则向下偏移, 反之, 则向上偏移 - * @return { UE.dom.Range } 当前Range对象 - */ - scrollToView: function(win, offset) { - win = win ? window : domUtils.getWindow(this.document); - var me = this, - span = me.document.createElement("span"); - //trace:717 - span.innerHTML = " "; - me.cloneRange().insertNode(span); - domUtils.scrollToView(span, win, offset); - domUtils.remove(span); - return me; - }, - - /** - * 判断当前选区内容是否占位符 - * @private - * @method inFillChar - * @return { Boolean } 如果是占位符返回true,否则返回false - */ - inFillChar: function() { - var start = this.startContainer; - if ( - this.collapsed && - start.nodeType == 3 && - start.nodeValue.replace(new RegExp("^" + domUtils.fillChar), "") - .length + - 1 == - start.nodeValue.length - ) { - return true; - } - return false; - }, - - /** - * 保存 - * @method createAddress - * @private - * @return { Boolean } 返回开始和结束的位置 - * @example - * ```html - * - *

                      - * aaaa - * - * - * bbbb - * - * - *

                      - * - * - * - * ``` - */ - createAddress: function(ignoreEnd, ignoreTxt) { - var addr = {}, - me = this; - - function getAddress(isStart) { - var node = isStart ? me.startContainer : me.endContainer; - var parents = domUtils.findParents(node, true, function(node) { - return !domUtils.isBody(node); - }), - addrs = []; - for (var i = 0, ci; (ci = parents[i++]); ) { - addrs.push(domUtils.getNodeIndex(ci, ignoreTxt)); - } - var firstIndex = 0; - - if (ignoreTxt) { - if (node.nodeType == 3) { - var tmpNode = node.previousSibling; - while (tmpNode && tmpNode.nodeType == 3) { - firstIndex += tmpNode.nodeValue.replace(fillCharReg, "").length; - tmpNode = tmpNode.previousSibling; - } - firstIndex += isStart ? me.startOffset : me.endOffset; // - (fillCharReg.test(node.nodeValue) ? 1 : 0 ) - } else { - node = node.childNodes[isStart ? me.startOffset : me.endOffset]; - if (node) { - firstIndex = domUtils.getNodeIndex(node, ignoreTxt); - } else { - node = isStart ? me.startContainer : me.endContainer; - var first = node.firstChild; - while (first) { - if (domUtils.isFillChar(first)) { - first = first.nextSibling; - continue; - } - firstIndex++; - if (first.nodeType == 3) { - while (first && first.nodeType == 3) { - first = first.nextSibling; - } - } else { - first = first.nextSibling; - } - } - } - } - } else { - firstIndex = isStart - ? domUtils.isFillChar(node) ? 0 : me.startOffset - : me.endOffset; - } - if (firstIndex < 0) { - firstIndex = 0; - } - addrs.push(firstIndex); - return addrs; - } - addr.startAddress = getAddress(true); - if (!ignoreEnd) { - addr.endAddress = me.collapsed - ? [].concat(addr.startAddress) - : getAddress(); - } - return addr; - }, - - /** - * 保存 - * @method createAddress - * @private - * @return { Boolean } 返回开始和结束的位置 - * @example - * ```html - * - *

                      - * aaaa - * - * - * bbbb - * - * - *

                      - * - * - * - * ``` - */ - moveToAddress: function(addr, ignoreEnd) { - var me = this; - function getNode(address, isStart) { - var tmpNode = me.document.body, - parentNode, - offset; - for (var i = 0, ci, l = address.length; i < l; i++) { - ci = address[i]; - parentNode = tmpNode; - tmpNode = tmpNode.childNodes[ci]; - if (!tmpNode) { - offset = ci; - break; - } - } - if (isStart) { - if (tmpNode) { - me.setStartBefore(tmpNode); - } else { - me.setStart(parentNode, offset); - } - } else { - if (tmpNode) { - me.setEndBefore(tmpNode); - } else { - me.setEnd(parentNode, offset); - } - } - } - getNode(addr.startAddress, true); - !ignoreEnd && addr.endAddress && getNode(addr.endAddress); - return me; - }, - - /** - * 判断给定的Range对象是否和当前Range对象表示的是同一个选区 - * @method equals - * @param { UE.dom.Range } 需要判断的Range对象 - * @return { Boolean } 如果给定的Range对象与当前Range对象表示的是同一个选区, 则返回true, 否则返回false - */ - equals: function(rng) { - for (var p in this) { - if (this.hasOwnProperty(p)) { - if (this[p] !== rng[p]) return false; - } - } - return true; - }, - - /** - * 遍历range内的节点。每当遍历一个节点时, 都会执行参数项 doFn 指定的函数, 该函数的接受当前遍历的节点 - * 作为其参数。 - * @method traversal - * @param { Function } doFn 对每个遍历的节点要执行的方法, 该方法接受当前遍历的节点作为其参数 - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * - * - * - * - * - * - * - * - * - * ``` - */ - - /** - * 遍历range内的节点。 - * 每当遍历一个节点时, 都会执行参数项 doFn 指定的函数, 该函数的接受当前遍历的节点 - * 作为其参数。 - * 可以通过参数项 filterFn 来指定一个过滤器, 只有符合该过滤器过滤规则的节点才会触 - * 发doFn函数的执行 - * @method traversal - * @param { Function } doFn 对每个遍历的节点要执行的方法, 该方法接受当前遍历的节点作为其参数 - * @param { Function } filterFn 过滤器, 该函数接受当前遍历的节点作为参数, 如果该节点满足过滤 - * 规则, 请返回true, 该节点会触发doFn, 否则, 请返回false, 则该节点不 - * 会触发doFn。 - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.Range:traversal(Function) - * @example - * ```html - * - * - * - * - * - * - * - * - * - * - * ``` - */ - traversal: function(doFn, filterFn) { - if (this.collapsed) return this; - var bookmark = this.createBookmark(), - end = bookmark.end, - current = domUtils.getNextDomNode(bookmark.start, false, filterFn); - while ( - current && - current !== end && - domUtils.getPosition(current, end) & domUtils.POSITION_PRECEDING - ) { - var tmpNode = domUtils.getNextDomNode(current, false, filterFn); - doFn(current); - current = tmpNode; - } - return this.moveToBookmark(bookmark); - } - }; -})(); - - -// core/Selection.js -/** - * 选集 - * @file - * @module UE.dom - * @class Selection - * @since 1.2.6.1 - */ - -/** - * 选区集合 - * @unfile - * @module UE.dom - * @class Selection - */ -;(function() { - function getBoundaryInformation(range, start) { - var getIndex = domUtils.getNodeIndex; - range = range.duplicate(); - range.collapse(start); - var parent = range.parentElement(); - //如果节点里没有子节点,直接退出 - if (!parent.hasChildNodes()) { - return { container: parent, offset: 0 }; - } - var siblings = parent.children, - child, - testRange = range.duplicate(), - startIndex = 0, - endIndex = siblings.length - 1, - index = -1, - distance; - while (startIndex <= endIndex) { - index = Math.floor((startIndex + endIndex) / 2); - child = siblings[index]; - testRange.moveToElementText(child); - var position = testRange.compareEndPoints("StartToStart", range); - if (position > 0) { - endIndex = index - 1; - } else if (position < 0) { - startIndex = index + 1; - } else { - //trace:1043 - return { container: parent, offset: getIndex(child) }; - } - } - if (index == -1) { - testRange.moveToElementText(parent); - testRange.setEndPoint("StartToStart", range); - distance = testRange.text.replace(/(\r\n|\r)/g, "\n").length; - siblings = parent.childNodes; - if (!distance) { - child = siblings[siblings.length - 1]; - return { container: child, offset: child.nodeValue.length }; - } - - var i = siblings.length; - while (distance > 0) { - distance -= siblings[--i].nodeValue.length; - } - return { container: siblings[i], offset: -distance }; - } - testRange.collapse(position > 0); - testRange.setEndPoint(position > 0 ? "StartToStart" : "EndToStart", range); - distance = testRange.text.replace(/(\r\n|\r)/g, "\n").length; - if (!distance) { - return dtd.$empty[child.tagName] || dtd.$nonChild[child.tagName] - ? { - container: parent, - offset: getIndex(child) + (position > 0 ? 0 : 1) - } - : { - container: child, - offset: position > 0 ? 0 : child.childNodes.length - }; - } - while (distance > 0) { - try { - var pre = child; - child = child[position > 0 ? "previousSibling" : "nextSibling"]; - distance -= child.nodeValue.length; - } catch (e) { - return { container: parent, offset: getIndex(pre) }; - } - } - return { - container: child, - offset: position > 0 ? -distance : child.nodeValue.length + distance - }; - } - - /** - * 将ieRange转换为Range对象 - * @param {Range} ieRange ieRange对象 - * @param {Range} range Range对象 - * @return {Range} range 返回转换后的Range对象 - */ - function transformIERangeToRange(ieRange, range) { - if (ieRange.item) { - range.selectNode(ieRange.item(0)); - } else { - var bi = getBoundaryInformation(ieRange, true); - range.setStart(bi.container, bi.offset); - if (ieRange.compareEndPoints("StartToEnd", ieRange) != 0) { - bi = getBoundaryInformation(ieRange, false); - range.setEnd(bi.container, bi.offset); - } - } - return range; - } - - /** - * 获得ieRange - * @param {Selection} sel Selection对象 - * @return {ieRange} 得到ieRange - */ - function _getIERange(sel) { - var ieRange; - //ie下有可能报错 - try { - ieRange = sel.getNative().createRange(); - } catch (e) { - return null; - } - var el = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); - if ((el.ownerDocument || el) === sel.document) { - return ieRange; - } - return null; - } - - var Selection = (dom.Selection = function(doc) { - var me = this, - iframe; - me.document = doc; - if (browser.ie9below) { - iframe = domUtils.getWindow(doc).frameElement; - domUtils.on(iframe, "beforedeactivate", function() { - me._bakIERange = me.getIERange(); - }); - domUtils.on(iframe, "activate", function() { - try { - if (!_getIERange(me) && me._bakIERange) { - me._bakIERange.select(); - } - } catch (ex) {} - me._bakIERange = null; - }); - } - iframe = doc = null; - }); - - Selection.prototype = { - rangeInBody: function(rng, txtRange) { - var node = browser.ie9below || txtRange - ? rng.item ? rng.item() : rng.parentElement() - : rng.startContainer; - - return node === this.document.body || domUtils.inDoc(node, this.document); - }, - - /** - * 获取原生seleciton对象 - * @method getNative - * @return { Object } 获得selection对象 - * @example - * ```javascript - * editor.selection.getNative(); - * ``` - */ - getNative: function() { - var doc = this.document; - try { - return !doc - ? null - : browser.ie9below - ? doc.selection - : domUtils.getWindow(doc).getSelection(); - } catch (e) { - return null; - } - }, - - /** - * 获得ieRange - * @method getIERange - * @return { Object } 返回ie原生的Range - * @example - * ```javascript - * editor.selection.getIERange(); - * ``` - */ - getIERange: function() { - var ieRange = _getIERange(this); - if (!ieRange) { - if (this._bakIERange) { - return this._bakIERange; - } - } - return ieRange; - }, - - /** - * 缓存当前选区的range和选区的开始节点 - * @method cache - */ - cache: function() { - this.clear(); - this._cachedRange = this.getRange(); - this._cachedStartElement = this.getStart(); - this._cachedStartElementPath = this.getStartElementPath(); - }, - - /** - * 获取选区开始位置的父节点到body - * @method getStartElementPath - * @return { Array } 返回父节点集合 - * @example - * ```javascript - * editor.selection.getStartElementPath(); - * ``` - */ - getStartElementPath: function() { - if (this._cachedStartElementPath) { - return this._cachedStartElementPath; - } - var start = this.getStart(); - if (start) { - return domUtils.findParents(start, true, null, true); - } - return []; - }, - - /** - * 清空缓存 - * @method clear - */ - clear: function() { - this._cachedStartElementPath = this._cachedRange = this._cachedStartElement = null; - }, - - /** - * 编辑器是否得到了选区 - * @method isFocus - */ - isFocus: function() { - try { - if (browser.ie9below) { - var nativeRange = _getIERange(this); - return !!(nativeRange && this.rangeInBody(nativeRange)); - } else { - return !!this.getNative().rangeCount; - } - } catch (e) { - return false; - } - }, - - /** - * 获取选区对应的Range - * @method getRange - * @return { Object } 得到Range对象 - * @example - * ```javascript - * editor.selection.getRange(); - * ``` - */ - getRange: function() { - var me = this; - function optimze(range) { - var child = me.document.body.firstChild, - collapsed = range.collapsed; - while (child && child.firstChild) { - range.setStart(child, 0); - child = child.firstChild; - } - if (!range.startContainer) { - range.setStart(me.document.body, 0); - } - if (collapsed) { - range.collapse(true); - } - } - - if (me._cachedRange != null) { - return this._cachedRange; - } - var range = new baidu.editor.dom.Range(me.document); - - if (browser.ie9below) { - var nativeRange = me.getIERange(); - if (nativeRange) { - //备份的_bakIERange可能已经实效了,dom树发生了变化比如从源码模式切回来,所以try一下,实效就放到body开始位置 - try { - transformIERangeToRange(nativeRange, range); - } catch (e) { - optimze(range); - } - } else { - optimze(range); - } - } else { - var sel = me.getNative(); - if (sel && sel.rangeCount) { - var firstRange = sel.getRangeAt(0); - var lastRange = sel.getRangeAt(sel.rangeCount - 1); - range - .setStart(firstRange.startContainer, firstRange.startOffset) - .setEnd(lastRange.endContainer, lastRange.endOffset); - if ( - range.collapsed && - domUtils.isBody(range.startContainer) && - !range.startOffset - ) { - optimze(range); - } - } else { - //trace:1734 有可能已经不在dom树上了,标识的节点 - if ( - this._bakRange && - domUtils.inDoc(this._bakRange.startContainer, this.document) - ) { - return this._bakRange; - } - optimze(range); - } - } - return (this._bakRange = range); - }, - - /** - * 获取开始元素,用于状态反射 - * @method getStart - * @return { Element } 获得开始元素 - * @example - * ```javascript - * editor.selection.getStart(); - * ``` - */ - getStart: function() { - if (this._cachedStartElement) { - return this._cachedStartElement; - } - var range = browser.ie9below ? this.getIERange() : this.getRange(), - tmpRange, - start, - tmp, - parent; - if (browser.ie9below) { - if (!range) { - //todo 给第一个值可能会有问题 - return this.document.body.firstChild; - } - //control元素 - if (range.item) { - return range.item(0); - } - tmpRange = range.duplicate(); - //修正ie下x[xx] 闭合后 x|xx - tmpRange.text.length > 0 && tmpRange.moveStart("character", 1); - tmpRange.collapse(1); - start = tmpRange.parentElement(); - parent = tmp = range.parentElement(); - while ((tmp = tmp.parentNode)) { - if (tmp == start) { - start = parent; - break; - } - } - } else { - range.shrinkBoundary(); - start = range.startContainer; - if (start.nodeType == 1 && start.hasChildNodes()) { - start = - start.childNodes[ - Math.min(start.childNodes.length - 1, range.startOffset) - ]; - } - if (start.nodeType == 3) { - return start.parentNode; - } - } - return start; - }, - - /** - * 得到选区中的文本 - * @method getText - * @return { String } 选区中包含的文本 - * @example - * ```javascript - * editor.selection.getText(); - * ``` - */ - getText: function() { - var nativeSel, nativeRange; - if (this.isFocus() && (nativeSel = this.getNative())) { - nativeRange = browser.ie9below - ? nativeSel.createRange() - : nativeSel.getRangeAt(0); - return browser.ie9below ? nativeRange.text : nativeRange.toString(); - } - return ""; - }, - - /** - * 清除选区 - * @method clearRange - * @example - * ```javascript - * editor.selection.clearRange(); - * ``` - */ - clearRange: function() { - this.getNative()[browser.ie9below ? "empty" : "removeAllRanges"](); - } - }; -})(); - - -// core/Editor.js -/** - * 编辑器主类,包含编辑器提供的大部分公用接口 - * @file - * @module UE - * @class Editor - * @since 1.2.6.1 - */ - -/** - * UEditor公用空间,UEditor所有的功能都挂载在该空间下 - * @unfile - * @module UE - */ - -/** - * UEditor的核心类,为用户提供与编辑器交互的接口。 - * @unfile - * @module UE - * @class Editor - */ - -;(function() { - var uid = 0, - _selectionChangeTimer; - - /** - * 获取编辑器的html内容,赋值到编辑器所在表单的textarea文本域里面 - * @private - * @method setValue - * @param { UE.Editor } editor 编辑器事例 - */ - function setValue(form, editor) { - var textarea; - if (editor.options.textarea) { - if (utils.isString(editor.options.textarea)) { - for ( - var i = 0, ti, tis = domUtils.getElementsByTagName(form, "textarea"); - (ti = tis[i++]); - - ) { - if (ti.id == "ueditor_textarea_" + editor.options.textarea) { - textarea = ti; - break; - } - } - } else { - textarea = editor.textarea; - } - } - if (!textarea) { - form.appendChild( - (textarea = domUtils.createElement(document, "textarea", { - name: editor.options.textarea, - id: "ueditor_textarea_" + editor.options.textarea, - style: "display:none" - })) - ); - //不要产生多个textarea - editor.textarea = textarea; - } - !textarea.getAttribute("name") && - textarea.setAttribute("name", editor.options.textarea); - textarea.value = editor.hasContents() - ? editor.options.allHtmlEnabled - ? editor.getAllHtml() - : editor.getContent(null, null, true) - : ""; - } - function loadPlugins(me) { - //初始化插件 - for (var pi in UE.plugins) { - UE.plugins[pi].call(me); - } - } - function checkCurLang(I18N) { - for (var lang in I18N) { - return lang; - } - } - - function langReadied(me) { - me.langIsReady = true; - - me.fireEvent("langReady"); - } - - /** - * 编辑器准备就绪后会触发该事件 - * @module UE - * @class Editor - * @event ready - * @remind render方法执行完成之后,会触发该事件 - * @remind - * @example - * ```javascript - * editor.addListener( 'ready', function( editor ) { - * editor.execCommand( 'focus' ); //编辑器家在完成后,让编辑器拿到焦点 - * } ); - * ``` - */ - /** - * 执行destroy方法,会触发该事件 - * @module UE - * @class Editor - * @event destroy - * @see UE.Editor:destroy() - */ - /** - * 执行reset方法,会触发该事件 - * @module UE - * @class Editor - * @event reset - * @see UE.Editor:reset() - */ - /** - * 执行focus方法,会触发该事件 - * @module UE - * @class Editor - * @event focus - * @see UE.Editor:focus(Boolean) - */ - /** - * 语言加载完成会触发该事件 - * @module UE - * @class Editor - * @event langReady - */ - /** - * 运行命令之后会触发该命令 - * @module UE - * @class Editor - * @event beforeExecCommand - */ - /** - * 运行命令之后会触发该命令 - * @module UE - * @class Editor - * @event afterExecCommand - */ - /** - * 运行命令之前会触发该命令 - * @module UE - * @class Editor - * @event firstBeforeExecCommand - */ - /** - * 在getContent方法执行之前会触发该事件 - * @module UE - * @class Editor - * @event beforeGetContent - * @see UE.Editor:getContent() - */ - /** - * 在getContent方法执行之后会触发该事件 - * @module UE - * @class Editor - * @event afterGetContent - * @see UE.Editor:getContent() - */ - /** - * 在getAllHtml方法执行时会触发该事件 - * @module UE - * @class Editor - * @event getAllHtml - * @see UE.Editor:getAllHtml() - */ - /** - * 在setContent方法执行之前会触发该事件 - * @module UE - * @class Editor - * @event beforeSetContent - * @see UE.Editor:setContent(String) - */ - /** - * 在setContent方法执行之后会触发该事件 - * @module UE - * @class Editor - * @event afterSetContent - * @see UE.Editor:setContent(String) - */ - /** - * 每当编辑器内部选区发生改变时,将触发该事件 - * @event selectionchange - * @warning 该事件的触发非常频繁,不建议在该事件的处理过程中做重量级的处理 - * @example - * ```javascript - * editor.addListener( 'selectionchange', function( editor ) { - * console.log('选区发生改变'); - * } - */ - /** - * 在所有selectionchange的监听函数执行之前,会触发该事件 - * @module UE - * @class Editor - * @event beforeSelectionChange - * @see UE.Editor:selectionchange - */ - /** - * 在所有selectionchange的监听函数执行完之后,会触发该事件 - * @module UE - * @class Editor - * @event afterSelectionChange - * @see UE.Editor:selectionchange - */ - /** - * 编辑器内容发生改变时会触发该事件 - * @module UE - * @class Editor - * @event contentChange - */ - - /** - * 以默认参数构建一个编辑器实例 - * @constructor - * @remind 通过 改构造方法实例化的编辑器,不带ui层.需要render到一个容器,编辑器实例才能正常渲染到页面 - * @example - * ```javascript - * var editor = new UE.Editor(); - * editor.execCommand('blod'); - * ``` - * @see UE.Config - */ - - /** - * 以给定的参数集合创建一个编辑器实例,对于未指定的参数,将应用默认参数。 - * @constructor - * @remind 通过 改构造方法实例化的编辑器,不带ui层.需要render到一个容器,编辑器实例才能正常渲染到页面 - * @param { Object } setting 创建编辑器的参数 - * @example - * ```javascript - * var editor = new UE.Editor(); - * editor.execCommand('blod'); - * ``` - * @see UE.Config - */ - var Editor = (UE.Editor = function(options) { - var me = this; - me.uid = uid++; - EventBase.call(me); - me.commands = {}; - me.options = utils.extend(utils.clone(options || {}), UEDITOR_CONFIG, true); - me.shortcutkeys = {}; - me.inputRules = []; - me.outputRules = []; - //设置默认的常用属性 - me.setOpt(Editor.defaultOptions(me)); - - /* 尝试异步加载后台配置 */ - //me.loadServerConfig(); - - if (!utils.isEmptyObject(UE.I18N)) { - //修改默认的语言类型 - me.options.lang = checkCurLang(UE.I18N); - UE.plugin.load(me); - langReadied(me); - } else { - utils.loadFile( - document, - { - src: - me.options.langPath + - me.options.lang + - "/" + - me.options.lang + - ".js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - UE.plugin.load(me); - langReadied(me); - } - ); - } - - UE.instants["ueditorInstant" + me.uid] = me; - }); - Editor.prototype = { - registerCommand: function(name, obj) { - this.commands[name] = obj; - }, - /** - * 编辑器对外提供的监听ready事件的接口, 通过调用该方法,达到的效果与监听ready事件是一致的 - * @method ready - * @param { Function } fn 编辑器ready之后所执行的回调, 如果在注册事件之前编辑器已经ready,将会 - * 立即触发该回调。 - * @remind 需要等待编辑器加载完成后才能执行的代码,可以使用该方法传入 - * @example - * ```javascript - * editor.ready( function( editor ) { - * editor.setContent('初始化完毕'); - * } ); - * ``` - * @see UE.Editor.event:ready - */ - ready: function(fn) { - var me = this; - if (fn) { - me.isReady ? fn.apply(me) : me.addListener("ready", fn); - } - }, - /** - * 该方法用于设置placeholder - * @method setPlaceholder - * @param { String } placeholder 编辑器的placeholder文案 - * @example - * ```javascript - * editor.setPlaceholder('请输入内容'); - * ``` - */ - setPlaceholder: function(){ - - function contentChange(){ - var localHtml = this.getPlainTxt(); - if(!localHtml.trim()){ - UE.dom.domUtils.addClass( this.body, 'empty' ); - }else{ - UE.dom.domUtils.removeClasses( this.body, 'empty' ); - } - } - - return function(placeholder){ - var _editor = this; - - _editor.ready(function () { - contentChange.call(_editor); - _editor.body.setAttribute('placeholder', placeholder); - }); - _editor.removeListener('keyup contentchange', contentChange); - _editor.addListener('keyup contentchange', contentChange); - } - }(), - - /** - * 该方法是提供给插件里面使用,设置配置项默认值 - * @method setOpt - * @warning 三处设置配置项的优先级: 实例化时传入参数 > setOpt()设置 > config文件里设置 - * @warning 该方法仅供编辑器插件内部和编辑器初始化时调用,其他地方不能调用。 - * @param { String } key 编辑器的可接受的选项名称 - * @param { * } val 该选项可接受的值 - * @example - * ```javascript - * editor.setOpt( 'initContent', '欢迎使用编辑器' ); - * ``` - */ - - /** - * 该方法是提供给插件里面使用,以{key:value}集合的方式设置插件内用到的配置项默认值 - * @method setOpt - * @warning 三处设置配置项的优先级: 实例化时传入参数 > setOpt()设置 > config文件里设置 - * @warning 该方法仅供编辑器插件内部和编辑器初始化时调用,其他地方不能调用。 - * @param { Object } options 将要设置的选项的键值对对象 - * @example - * ```javascript - * editor.setOpt( { - * 'initContent': '欢迎使用编辑器' - * } ); - * ``` - */ - setOpt: function(key, val) { - var obj = {}; - if (utils.isString(key)) { - obj[key] = val; - } else { - obj = key; - } - utils.extend(this.options, obj, true); - }, - getOpt: function(key) { - return this.options[key]; - }, - /** - * 销毁编辑器实例,使用textarea代替 - * @method destroy - * @example - * ```javascript - * editor.destroy(); - * ``` - */ - destroy: function() { - var me = this; - me.fireEvent("destroy"); - var container = me.container.parentNode; - var textarea = me.textarea; - if (!textarea) { - textarea = document.createElement("textarea"); - container.parentNode.insertBefore(textarea, container); - } else { - textarea.style.display = ""; - } - - textarea.style.width = me.iframe.offsetWidth + "px"; - textarea.style.height = me.iframe.offsetHeight + "px"; - textarea.value = me.getContent(); - textarea.id = me.key; - container.innerHTML = ""; - domUtils.remove(container); - var key = me.key; - //trace:2004 - for (var p in me) { - if (me.hasOwnProperty(p)) { - delete this[p]; - } - } - UE.delEditor(key); - }, - - /** - * 渲染编辑器的DOM到指定容器 - * @method render - * @param { String } containerId 指定一个容器ID - * @remind 执行该方法,会触发ready事件 - * @warning 必须且只能调用一次 - */ - - /** - * 渲染编辑器的DOM到指定容器 - * @method render - * @param { Element } containerDom 直接指定容器对象 - * @remind 执行该方法,会触发ready事件 - * @warning 必须且只能调用一次 - */ - render: function(container) { - var me = this, - options = me.options, - getStyleValue = function(attr) { - return parseInt(domUtils.getComputedStyle(container, attr)); - }; - if (utils.isString(container)) { - container = document.getElementById(container); - } - if (container) { - if (options.initialFrameWidth) { - options.minFrameWidth = options.initialFrameWidth; - } else { - options.minFrameWidth = options.initialFrameWidth = - container.offsetWidth; - } - if (options.initialFrameHeight) { - options.minFrameHeight = options.initialFrameHeight; - } else { - options.initialFrameHeight = options.minFrameHeight = - container.offsetHeight; - } - - container.style.width = /%$/.test(options.initialFrameWidth) - ? "100%" - : options.initialFrameWidth - - getStyleValue("padding-left") - - getStyleValue("padding-right") + - "px"; - container.style.height = /%$/.test(options.initialFrameHeight) - ? "100%" - : options.initialFrameHeight - - getStyleValue("padding-top") - - getStyleValue("padding-bottom") + - "px"; - - container.style.zIndex = options.zIndex; - - var html = - (ie && browser.version < 9 ? "" : "") + - "" + - "" + - "" + - (options.iframeCssUrl - ? "" - : "") + - (options.initialStyle - ? "" - : "") + - "" + - "" + - "" + - (options.iframeJsUrl - ? "" - : "") + - ""; - - container.appendChild( - domUtils.createElement(document, "iframe", { - id: "ueditor_" + me.uid, - width: "100%", - height: "100%", - frameborder: "0", - //先注释掉了,加的原因忘记了,但开启会直接导致全屏模式下内容多时不会出现滚动条 - // scrolling :'no', - src: - "javascript:void(function(){document.open();" + - (options.customDomain && document.domain != location.hostname - ? 'document.domain="' + document.domain + '";' - : "") + - 'document.write("' + - html + - '");document.close();}())' - }) - ); - container.style.overflow = "hidden"; - //解决如果是给定的百分比,会导致高度算不对的问题 - setTimeout(function() { - if (/%$/.test(options.initialFrameWidth)) { - options.minFrameWidth = options.initialFrameWidth = - container.offsetWidth; - //如果这里给定宽度,会导致ie在拖动窗口大小时,编辑区域不随着变化 - // container.style.width = options.initialFrameWidth + 'px'; - } - if (/%$/.test(options.initialFrameHeight)) { - options.minFrameHeight = options.initialFrameHeight = - container.offsetHeight; - container.style.height = options.initialFrameHeight + "px"; - } - }); - } - }, - - /** - * 编辑器初始化 - * @method _setup - * @private - * @param { Element } doc 编辑器Iframe中的文档对象 - */ - _setup: function(doc) { - var me = this, - options = me.options; - if (ie) { - doc.body.disabled = true; - doc.body.contentEditable = true; - doc.body.disabled = false; - } else { - doc.body.contentEditable = true; - } - doc.body.spellcheck = false; - me.document = doc; - me.window = doc.defaultView || doc.parentWindow; - me.iframe = me.window.frameElement; - me.body = doc.body; - me.selection = new dom.Selection(doc); - //gecko初始化就能得到range,无法判断isFocus了 - var geckoSel; - if (browser.gecko && (geckoSel = this.selection.getNative())) { - geckoSel.removeAllRanges(); - } - this._initEvents(); - //为form提交提供一个隐藏的textarea - for ( - var form = this.iframe.parentNode; - !domUtils.isBody(form); - form = form.parentNode - ) { - if (form.tagName == "FORM") { - me.form = form; - if (me.options.autoSyncData) { - domUtils.on(me.window, "blur", function() { - setValue(form, me); - }); - } else { - domUtils.on(form, "submit", function() { - setValue(this, me); - }); - } - break; - } - } - if (options.initialContent) { - if (options.autoClearinitialContent) { - var oldExecCommand = me.execCommand; - me.execCommand = function() { - me.fireEvent("firstBeforeExecCommand"); - return oldExecCommand.apply(me, arguments); - }; - this._setDefaultContent(options.initialContent); - } else this.setContent(options.initialContent, false, true); - } - - //编辑器不能为空内容 - - if (domUtils.isEmptyNode(me.body)) { - me.body.innerHTML = "

                      " + (browser.ie ? "" : "
                      ") + "

                      "; - } - //如果要求focus, 就把光标定位到内容开始 - if (options.focus) { - setTimeout(function() { - me.focus(me.options.focusInEnd); - //如果自动清除开着,就不需要做selectionchange; - !me.options.autoClearinitialContent && me._selectionChange(); - }, 0); - } - if (!me.container) { - me.container = this.iframe.parentNode; - } - if (options.fullscreen && me.ui) { - me.ui.setFullScreen(true); - } - - try { - me.document.execCommand("2D-position", false, false); - } catch (e) {} - try { - me.document.execCommand("enableInlineTableEditing", false, false); - } catch (e) {} - try { - me.document.execCommand("enableObjectResizing", false, false); - } catch (e) {} - - //挂接快捷键 - me._bindshortcutKeys(); - me.isReady = 1; - me.fireEvent("ready"); - options.onready && options.onready.call(me); - if (!browser.ie9below) { - domUtils.on(me.window, ["blur", "focus"], function(e) { - //chrome下会出现alt+tab切换时,导致选区位置不对 - if (e.type == "blur") { - me._bakRange = me.selection.getRange(); - try { - me._bakNativeRange = me.selection.getNative().getRangeAt(0); - me.selection.getNative().removeAllRanges(); - } catch (e) { - me._bakNativeRange = null; - } - } else { - try { - me._bakRange && me._bakRange.select(); - } catch (e) {} - } - }); - } - //trace:1518 ff3.6body不够寛,会导致点击空白处无法获得焦点 - if (browser.gecko && browser.version <= 10902) { - //修复ff3.6初始化进来,不能点击获得焦点 - me.body.contentEditable = false; - setTimeout(function() { - me.body.contentEditable = true; - }, 100); - setInterval(function() { - me.body.style.height = me.iframe.offsetHeight - 20 + "px"; - }, 100); - } - - !options.isShow && me.setHide(); - options.readonly && me.setDisabled(); - }, - - /** - * 同步数据到编辑器所在的form - * 从编辑器的容器节点向上查找form元素,若找到,就同步编辑内容到找到的form里,为提交数据做准备,主要用于是手动提交的情况 - * 后台取得数据的键值,使用你容器上的name属性,如果没有就使用参数里的textarea项 - * @method sync - * @example - * ```javascript - * editor.sync(); - * form.sumbit(); //form变量已经指向了form元素 - * ``` - */ - - /** - * 根据传入的formId,在页面上查找要同步数据的表单,若找到,就同步编辑内容到找到的form里,为提交数据做准备 - * 后台取得数据的键值,该键值默认使用给定的编辑器容器的name属性,如果没有name属性则使用参数项里给定的“textarea”项 - * @method sync - * @param { String } formID 指定一个要同步数据的form的id,编辑器的数据会同步到你指定form下 - */ - sync: function(formId) { - var me = this, - form = formId - ? document.getElementById(formId) - : domUtils.findParent( - me.iframe.parentNode, - function(node) { - return node.tagName == "FORM"; - }, - true - ); - form && setValue(form, me); - }, - - /** - * 设置编辑器高度 - * @method setHeight - * @remind 当配置项autoHeightEnabled为真时,该方法无效 - * @param { Number } number 设置的高度值,纯数值,不带单位 - * @example - * ```javascript - * editor.setHeight(number); - * ``` - */ - setHeight: function(height, notSetHeight) { - if (height !== parseInt(this.iframe.parentNode.style.height)) { - this.iframe.parentNode.style.height = height + "px"; - } - !notSetHeight && - (this.options.minFrameHeight = this.options.initialFrameHeight = height); - this.body.style.height = height + "px"; - !notSetHeight && this.trigger("setHeight"); - }, - - /** - * 为编辑器的编辑命令提供快捷键 - * 这个接口是为插件扩展提供的接口,主要是为新添加的插件,如果需要添加快捷键,所提供的接口 - * @method addshortcutkey - * @param { Object } keyset 命令名和快捷键键值对对象,多个按钮的快捷键用“+”分隔 - * @example - * ```javascript - * editor.addshortcutkey({ - * "Bold" : "ctrl+66",//^B - * "Italic" : "ctrl+73", //^I - * }); - * ``` - */ - /** - * 这个接口是为插件扩展提供的接口,主要是为新添加的插件,如果需要添加快捷键,所提供的接口 - * @method addshortcutkey - * @param { String } cmd 触发快捷键时,响应的命令 - * @param { String } keys 快捷键的字符串,多个按钮用“+”分隔 - * @example - * ```javascript - * editor.addshortcutkey("Underline", "ctrl+85"); //^U - * ``` - */ - addshortcutkey: function(cmd, keys) { - var obj = {}; - if (keys) { - obj[cmd] = keys; - } else { - obj = cmd; - } - utils.extend(this.shortcutkeys, obj); - }, - - /** - * 对编辑器设置keydown事件监听,绑定快捷键和命令,当快捷键组合触发成功,会响应对应的命令 - * @method _bindshortcutKeys - * @private - */ - _bindshortcutKeys: function() { - var me = this, - shortcutkeys = this.shortcutkeys; - me.addListener("keydown", function(type, e) { - var keyCode = e.keyCode || e.which; - for (var i in shortcutkeys) { - var tmp = shortcutkeys[i].split(","); - for (var t = 0, ti; (ti = tmp[t++]); ) { - ti = ti.split(":"); - var key = ti[0], - param = ti[1]; - if ( - /^(ctrl)(\+shift)?\+(\d+)$/.test(key.toLowerCase()) || - /^(\d+)$/.test(key) - ) { - if ( - ((RegExp.$1 == "ctrl" ? e.ctrlKey || e.metaKey : 0) && - (RegExp.$2 != "" ? e[RegExp.$2.slice(1) + "Key"] : 1) && - keyCode == RegExp.$3) || - keyCode == RegExp.$1 - ) { - if (me.queryCommandState(i, param) != -1) - me.execCommand(i, param); - domUtils.preventDefault(e); - } - } - } - } - }); - }, - - /** - * 获取编辑器的内容 - * @method getContent - * @warning 该方法获取到的是经过编辑器内置的过滤规则进行过滤后得到的内容 - * @return { String } 编辑器的内容字符串, 如果编辑器的内容为空,或者是空的标签内容(如:”<p><br/></p>“), 则返回空字符串 - * @example - * ```javascript - * //编辑器html内容:

                      123456

                      - * var content = editor.getContent(); //返回值:

                      123456

                      - * ``` - */ - - /** - * 获取编辑器的内容。 可以通过参数定义编辑器内置的判空规则 - * @method getContent - * @param { Function } fn 自定的判空规则, 要求该方法返回一个boolean类型的值, - * 代表当前编辑器的内容是否空, - * 如果返回true, 则该方法将直接返回空字符串;如果返回false,则编辑器将返回 - * 经过内置过滤规则处理后的内容。 - * @remind 该方法在处理包含有初始化内容的时候能起到很好的作用。 - * @warning 该方法获取到的是经过编辑器内置的过滤规则进行过滤后得到的内容 - * @return { String } 编辑器的内容字符串 - * @example - * ```javascript - * // editor 是一个编辑器的实例 - * var content = editor.getContent( function ( editor ) { - * return editor.body.innerHTML === '欢迎使用UEditor'; //返回空字符串 - * } ); - * ``` - */ - getContent: function(cmd, fn, notSetCursor, ignoreBlank, formatter) { - var me = this; - if (cmd && utils.isFunction(cmd)) { - fn = cmd; - cmd = ""; - } - if (fn ? !fn() : !this.hasContents()) { - return ""; - } - me.fireEvent("beforegetcontent"); - var root = UE.htmlparser(me.body.innerHTML, ignoreBlank); - me.filterOutputRule(root); - me.fireEvent("aftergetcontent", cmd, root); - return root.toHtml(formatter); - }, - - /** - * 取得完整的html代码,可以直接显示成完整的html文档 - * @method getAllHtml - * @return { String } 编辑器的内容html文档字符串 - * @eaxmple - * ```javascript - * editor.getAllHtml(); //返回格式大致是: ...... - * ``` - */ - getAllHtml: function() { - var me = this, - headHtml = [], - html = ""; - me.fireEvent("getAllHtml", headHtml); - if (browser.ie && browser.version > 8) { - var headHtmlForIE9 = ""; - utils.each(me.document.styleSheets, function(si) { - headHtmlForIE9 += si.href - ? '' - : ""; - }); - utils.each(me.document.getElementsByTagName("script"), function(si) { - headHtmlForIE9 += si.outerHTML; - }); - } - return ( - "" + - (me.options.charset - ? '' - : "") + - (headHtmlForIE9 || - me.document.getElementsByTagName("head")[0].innerHTML) + - headHtml.join("\n") + - "" + - "" + - me.getContent(null, null, true) + - "" - ); - }, - - /** - * 得到编辑器的纯文本内容,但会保留段落格式 - * @method getPlainTxt - * @return { String } 编辑器带段落格式的纯文本内容字符串 - * @example - * ```javascript - * //编辑器html内容:

                      1

                      2

                      - * console.log(editor.getPlainTxt()); //输出:"1\n2\n - * ``` - */ - getPlainTxt: function() { - var reg = new RegExp(domUtils.fillChar, "g"), - html = this.body.innerHTML.replace(/[\n\r]/g, ""); //ie要先去了\n在处理 - html = html - .replace(/<(p|div)[^>]*>(| )<\/\1>/gi, "\n") - .replace(//gi, "\n") - .replace(/<[^>/]+>/g, "") - .replace(/(\n)?<\/([^>]+)>/g, function(a, b, c) { - return dtd.$block[c] ? "\n" : b ? b : ""; - }); - //取出来的空格会有c2a0会变成乱码,处理这种情况\u00a0 - return html - .replace(reg, "") - .replace(/\u00a0/g, " ") - .replace(/ /g, " "); - }, - - /** - * 获取编辑器中的纯文本内容,没有段落格式 - * @method getContentTxt - * @return { String } 编辑器不带段落格式的纯文本内容字符串 - * @example - * ```javascript - * //编辑器html内容:

                      1

                      2

                      - * console.log(editor.getPlainTxt()); //输出:"12 - * ``` - */ - getContentTxt: function() { - var reg = new RegExp(domUtils.fillChar, "g"); - //取出来的空格会有c2a0会变成乱码,处理这种情况\u00a0 - return this.body[browser.ie ? "innerText" : "textContent"] - .replace(reg, "") - .replace(/\u00a0/g, " "); - }, - - /** - * 设置编辑器的内容,可修改编辑器当前的html内容 - * @method setContent - * @warning 通过该方法插入的内容,是经过编辑器内置的过滤规则进行过滤后得到的内容 - * @warning 该方法会触发selectionchange事件 - * @param { String } html 要插入的html内容 - * @example - * ```javascript - * editor.getContent('

                      test

                      '); - * ``` - */ - - /** - * 设置编辑器的内容,可修改编辑器当前的html内容 - * @method setContent - * @warning 通过该方法插入的内容,是经过编辑器内置的过滤规则进行过滤后得到的内容 - * @warning 该方法会触发selectionchange事件 - * @param { String } html 要插入的html内容 - * @param { Boolean } isAppendTo 若传入true,不清空原来的内容,在最后插入内容,否则,清空内容再插入 - * @example - * ```javascript - * //假设设置前的编辑器内容是

                      old text

                      - * editor.setContent('

                      new text

                      ', true); //插入的结果是

                      old text

                      new text

                      - * ``` - */ - setContent: function(html, isAppendTo, notFireSelectionchange) { - var me = this; - - me.fireEvent("beforesetcontent", html); - var root = UE.htmlparser(html); - me.filterInputRule(root); - html = root.toHtml(); - - me.body.innerHTML = (isAppendTo ? me.body.innerHTML : "") + html; - - function isCdataDiv(node) { - return node.tagName == "DIV" && node.getAttribute("cdata_tag"); - } - //给文本或者inline节点套p标签 - if (me.options.enterTag == "p") { - var child = this.body.firstChild, - tmpNode; - if ( - !child || - (child.nodeType == 1 && - (dtd.$cdata[child.tagName] || - isCdataDiv(child) || - domUtils.isCustomeNode(child)) && - child === this.body.lastChild) - ) { - this.body.innerHTML = - "

                      " + - (browser.ie ? " " : "
                      ") + - "

                      " + - this.body.innerHTML; - } else { - var p = me.document.createElement("p"); - while (child) { - while ( - child && - (child.nodeType == 3 || - (child.nodeType == 1 && - dtd.p[child.tagName] && - !dtd.$cdata[child.tagName])) - ) { - tmpNode = child.nextSibling; - p.appendChild(child); - child = tmpNode; - } - if (p.firstChild) { - if (!child) { - me.body.appendChild(p); - break; - } else { - child.parentNode.insertBefore(p, child); - p = me.document.createElement("p"); - } - } - child = child.nextSibling; - } - } - } - me.fireEvent("aftersetcontent"); - me.fireEvent("contentchange"); - - !notFireSelectionchange && me._selectionChange(); - //清除保存的选区 - me._bakRange = me._bakIERange = me._bakNativeRange = null; - //trace:1742 setContent后gecko能得到焦点问题 - var geckoSel; - if (browser.gecko && (geckoSel = this.selection.getNative())) { - geckoSel.removeAllRanges(); - } - if (me.options.autoSyncData) { - me.form && setValue(me.form, me); - } - }, - - /** - * 让编辑器获得焦点,默认focus到编辑器头部 - * @method focus - * @example - * ```javascript - * editor.focus() - * ``` - */ - - /** - * 让编辑器获得焦点,toEnd确定focus位置 - * @method focus - * @param { Boolean } toEnd 默认focus到编辑器头部,toEnd为true时focus到内容尾部 - * @example - * ```javascript - * editor.focus(true) - * ``` - */ - focus: function(toEnd) { - try { - var me = this, - rng = me.selection.getRange(); - if (toEnd) { - var node = me.body.lastChild; - if (node && node.nodeType == 1 && !dtd.$empty[node.tagName]) { - if (domUtils.isEmptyBlock(node)) { - rng.setStartAtFirst(node); - } else { - rng.setStartAtLast(node); - } - rng.collapse(true); - } - rng.setCursor(true); - } else { - if ( - !rng.collapsed && - domUtils.isBody(rng.startContainer) && - rng.startOffset == 0 - ) { - var node = me.body.firstChild; - if (node && node.nodeType == 1 && !dtd.$empty[node.tagName]) { - rng.setStartAtFirst(node).collapse(true); - } - } - - rng.select(true); - } - this.fireEvent("focus selectionchange"); - } catch (e) {} - }, - isFocus: function() { - return this.selection.isFocus(); - }, - blur: function() { - var sel = this.selection.getNative(); - if (sel.empty && browser.ie) { - var nativeRng = document.body.createTextRange(); - nativeRng.moveToElementText(document.body); - nativeRng.collapse(true); - nativeRng.select(); - sel.empty(); - } else { - sel.removeAllRanges(); - } - - //this.fireEvent('blur selectionchange'); - }, - /** - * 初始化UE事件及部分事件代理 - * @method _initEvents - * @private - */ - _initEvents: function() { - var me = this, - doc = me.document, - win = me.window; - me._proxyDomEvent = utils.bind(me._proxyDomEvent, me); - domUtils.on( - doc, - [ - "click", - "contextmenu", - "mousedown", - "keydown", - "keyup", - "keypress", - "mouseup", - "mouseover", - "mouseout", - "selectstart" - ], - me._proxyDomEvent - ); - domUtils.on(win, ["focus", "blur"], me._proxyDomEvent); - domUtils.on(me.body, "drop", function(e) { - //阻止ff下默认的弹出新页面打开图片 - if (browser.gecko && e.stopPropagation) { - e.stopPropagation(); - } - me.fireEvent("contentchange"); - }); - domUtils.on(doc, ["mouseup", "keydown"], function(evt) { - //特殊键不触发selectionchange - if ( - evt.type == "keydown" && - (evt.ctrlKey || evt.metaKey || evt.shiftKey || evt.altKey) - ) { - return; - } - if (evt.button == 2) return; - me._selectionChange(250, evt); - }); - }, - /** - * 触发事件代理 - * @method _proxyDomEvent - * @private - * @return { * } fireEvent的返回值 - * @see UE.EventBase:fireEvent(String) - */ - _proxyDomEvent: function(evt) { - if ( - this.fireEvent("before" + evt.type.replace(/^on/, "").toLowerCase()) === - false - ) { - return false; - } - if (this.fireEvent(evt.type.replace(/^on/, ""), evt) === false) { - return false; - } - return this.fireEvent( - "after" + evt.type.replace(/^on/, "").toLowerCase() - ); - }, - /** - * 变化选区 - * @method _selectionChange - * @private - */ - _selectionChange: function(delay, evt) { - var me = this; - //有光标才做selectionchange 为了解决未focus时点击source不能触发更改工具栏状态的问题(source命令notNeedUndo=1) - // if ( !me.selection.isFocus() ){ - // return; - // } - - var hackForMouseUp = false; - var mouseX, mouseY; - if (browser.ie && browser.version < 9 && evt && evt.type == "mouseup") { - var range = this.selection.getRange(); - if (!range.collapsed) { - hackForMouseUp = true; - mouseX = evt.clientX; - mouseY = evt.clientY; - } - } - clearTimeout(_selectionChangeTimer); - _selectionChangeTimer = setTimeout(function() { - if (!me.selection || !me.selection.getNative()) { - return; - } - //修复一个IE下的bug: 鼠标点击一段已选择的文本中间时,可能在mouseup后的一段时间内取到的range是在selection的type为None下的错误值. - //IE下如果用户是拖拽一段已选择文本,则不会触发mouseup事件,所以这里的特殊处理不会对其有影响 - var ieRange; - if (hackForMouseUp && me.selection.getNative().type == "None") { - ieRange = me.document.body.createTextRange(); - try { - ieRange.moveToPoint(mouseX, mouseY); - } catch (ex) { - ieRange = null; - } - } - var bakGetIERange; - if (ieRange) { - bakGetIERange = me.selection.getIERange; - me.selection.getIERange = function() { - return ieRange; - }; - } - me.selection.cache(); - if (bakGetIERange) { - me.selection.getIERange = bakGetIERange; - } - if (me.selection._cachedRange && me.selection._cachedStartElement) { - me.fireEvent("beforeselectionchange"); - // 第二个参数causeByUi为true代表由用户交互造成的selectionchange. - me.fireEvent("selectionchange", !!evt); - me.fireEvent("afterselectionchange"); - me.selection.clear(); - } - }, delay || 50); - }, - - /** - * 执行编辑命令 - * @method _callCmdFn - * @private - * @param { String } fnName 函数名称 - * @param { * } args 传给命令函数的参数 - * @return { * } 返回命令函数运行的返回值 - */ - _callCmdFn: function(fnName, args) { - var cmdName = args[0].toLowerCase(), - cmd, - cmdFn; - cmd = this.commands[cmdName] || UE.commands[cmdName]; - cmdFn = cmd && cmd[fnName]; - //没有querycommandstate或者没有command的都默认返回0 - if ((!cmd || !cmdFn) && fnName == "queryCommandState") { - return 0; - } else if (cmdFn) { - return cmdFn.apply(this, args); - } - }, - - /** - * 执行编辑命令cmdName,完成富文本编辑效果 - * @method execCommand - * @param { String } cmdName 需要执行的命令 - * @remind 具体命令的使用请参考命令列表 - * @return { * } 返回命令函数运行的返回值 - * @example - * ```javascript - * editor.execCommand(cmdName); - * ``` - */ - execCommand: function(cmdName) { - cmdName = cmdName.toLowerCase(); - var me = this; - var result; - var cmd = me.commands[cmdName] || UE.commands[cmdName]; - if (!cmd || !cmd.execCommand) { - return null; - } - if (!cmd.notNeedUndo && !me.__hasEnterExecCommand) { - me.__hasEnterExecCommand = true; - if (me.queryCommandState.apply(me, arguments) != -1) { - me.fireEvent("saveScene"); - me.fireEvent.apply( - me, - ["beforeexeccommand", cmdName].concat(arguments) - ); - result = this._callCmdFn("execCommand", arguments); - //保存场景时,做了内容对比,再看是否进行contentchange触发,这里多触发了一次,去掉 - // (!cmd.ignoreContentChange && !me._ignoreContentChange) && me.fireEvent('contentchange'); - me.fireEvent.apply( - me, - ["afterexeccommand", cmdName].concat(arguments) - ); - me.fireEvent("saveScene"); - } - me.__hasEnterExecCommand = false; - } else { - result = this._callCmdFn("execCommand", arguments); - !me.__hasEnterExecCommand && - !cmd.ignoreContentChange && - !me._ignoreContentChange && - me.fireEvent("contentchange"); - } - !me.__hasEnterExecCommand && - !cmd.ignoreContentChange && - !me._ignoreContentChange && - me._selectionChange(); - return result; - }, - - /** - * 根据传入的command命令,查选编辑器当前的选区,返回命令的状态 - * @method queryCommandState - * @param { String } cmdName 需要查询的命令名称 - * @remind 具体命令的使用请参考命令列表 - * @return { Number } number 返回放前命令的状态,返回值三种情况:(-1|0|1) - * @example - * ```javascript - * editor.queryCommandState(cmdName) => (-1|0|1) - * ``` - * @see COMMAND.LIST - */ - queryCommandState: function(cmdName) { - return this._callCmdFn("queryCommandState", arguments); - }, - - /** - * 根据传入的command命令,查选编辑器当前的选区,根据命令返回相关的值 - * @method queryCommandValue - * @param { String } cmdName 需要查询的命令名称 - * @remind 具体命令的使用请参考命令列表 - * @remind 只有部分插件有此方法 - * @return { * } 返回每个命令特定的当前状态值 - * @grammar editor.queryCommandValue(cmdName) => {*} - * @see COMMAND.LIST - */ - queryCommandValue: function(cmdName) { - return this._callCmdFn("queryCommandValue", arguments); - }, - - /** - * 检查编辑区域中是否有内容 - * @method hasContents - * @remind 默认有文本内容,或者有以下节点都不认为是空 - * table,ul,ol,dl,iframe,area,base,col,hr,img,embed,input,link,meta,param - * @return { Boolean } 检查有内容返回true,否则返回false - * @example - * ```javascript - * editor.hasContents() - * ``` - */ - - /** - * 检查编辑区域中是否有内容,若包含参数tags中的节点类型,直接返回true - * @method hasContents - * @param { Array } tags 传入数组判断时用到的节点类型 - * @return { Boolean } 若文档中包含tags数组里对应的tag,返回true,否则返回false - * @example - * ```javascript - * editor.hasContents(['span']); - * ``` - */ - hasContents: function(tags) { - if (tags) { - for (var i = 0, ci; (ci = tags[i++]); ) { - if (this.document.getElementsByTagName(ci).length > 0) { - return true; - } - } - } - if (!domUtils.isEmptyBlock(this.body)) { - return true; - } - //随时添加,定义的特殊标签如果存在,不能认为是空 - tags = ["div"]; - for (i = 0; (ci = tags[i++]); ) { - var nodes = domUtils.getElementsByTagName(this.document, ci); - for (var n = 0, cn; (cn = nodes[n++]); ) { - if (domUtils.isCustomeNode(cn)) { - return true; - } - } - } - return false; - }, - - /** - * 重置编辑器,可用来做多个tab使用同一个编辑器实例 - * @method reset - * @remind 此方法会清空编辑器内容,清空回退列表,会触发reset事件 - * @example - * ```javascript - * editor.reset() - * ``` - */ - reset: function() { - this.fireEvent("reset"); - }, - - /** - * 设置当前编辑区域可以编辑 - * @method setEnabled - * @example - * ```javascript - * editor.setEnabled() - * ``` - */ - setEnabled: function() { - var me = this, - range; - if (me.body.contentEditable == "false") { - me.body.contentEditable = true; - range = me.selection.getRange(); - //有可能内容丢失了 - try { - range.moveToBookmark(me.lastBk); - delete me.lastBk; - } catch (e) { - range.setStartAtFirst(me.body).collapse(true); - } - range.select(true); - if (me.bkqueryCommandState) { - me.queryCommandState = me.bkqueryCommandState; - delete me.bkqueryCommandState; - } - if (me.bkqueryCommandValue) { - me.queryCommandValue = me.bkqueryCommandValue; - delete me.bkqueryCommandValue; - } - me.fireEvent("selectionchange"); - } - }, - enable: function() { - return this.setEnabled(); - }, - - /** 设置当前编辑区域不可编辑 - * @method setDisabled - */ - - /** 设置当前编辑区域不可编辑,except中的命令除外 - * @method setDisabled - * @param { String } except 例外命令的字符串 - * @remind 即使设置了disable,此处配置的例外命令仍然可以执行 - * @example - * ```javascript - * editor.setDisabled('bold'); //禁用工具栏中除加粗之外的所有功能 - * ``` - */ - - /** 设置当前编辑区域不可编辑,except中的命令除外 - * @method setDisabled - * @param { Array } except 例外命令的字符串数组,数组中的命令仍然可以执行 - * @remind 即使设置了disable,此处配置的例外命令仍然可以执行 - * @example - * ```javascript - * editor.setDisabled(['bold','insertimage']); //禁用工具栏中除加粗和插入图片之外的所有功能 - * ``` - */ - setDisabled: function(except) { - var me = this; - except = except ? (utils.isArray(except) ? except : [except]) : []; - if (me.body.contentEditable == "true") { - if (!me.lastBk) { - me.lastBk = me.selection.getRange().createBookmark(true); - } - me.body.contentEditable = false; - me.bkqueryCommandState = me.queryCommandState; - me.bkqueryCommandValue = me.queryCommandValue; - me.queryCommandState = function(type) { - if (utils.indexOf(except, type) != -1) { - return me.bkqueryCommandState.apply(me, arguments); - } - return -1; - }; - me.queryCommandValue = function(type) { - if (utils.indexOf(except, type) != -1) { - return me.bkqueryCommandValue.apply(me, arguments); - } - return null; - }; - me.fireEvent("selectionchange"); - } - }, - disable: function(except) { - return this.setDisabled(except); - }, - - /** - * 设置默认内容 - * @method _setDefaultContent - * @private - * @param { String } cont 要存入的内容 - */ - _setDefaultContent: (function() { - function clear() { - var me = this; - if (me.document.getElementById("initContent")) { - me.body.innerHTML = "

                      " + (ie ? "" : "
                      ") + "

                      "; - me.removeListener("firstBeforeExecCommand focus", clear); - setTimeout(function() { - me.focus(); - me._selectionChange(); - }, 0); - } - } - - return function(cont) { - var me = this; - me.body.innerHTML = '

                      ' + cont + "

                      "; - - me.addListener("firstBeforeExecCommand focus", clear); - }; - })(), - - /** - * 显示编辑器 - * @method setShow - * @example - * ```javascript - * editor.setShow() - * ``` - */ - setShow: function() { - var me = this, - range = me.selection.getRange(); - if (me.container.style.display == "none") { - //有可能内容丢失了 - try { - range.moveToBookmark(me.lastBk); - delete me.lastBk; - } catch (e) { - range.setStartAtFirst(me.body).collapse(true); - } - //ie下focus实效,所以做了个延迟 - setTimeout(function() { - range.select(true); - }, 100); - me.container.style.display = ""; - } - }, - show: function() { - return this.setShow(); - }, - /** - * 隐藏编辑器 - * @method setHide - * @example - * ```javascript - * editor.setHide() - * ``` - */ - setHide: function() { - var me = this; - if (!me.lastBk) { - me.lastBk = me.selection.getRange().createBookmark(true); - } - me.container.style.display = "none"; - }, - hide: function() { - return this.setHide(); - }, - - /** - * 根据指定的路径,获取对应的语言资源 - * @method getLang - * @param { String } path 路径根据的是lang目录下的语言文件的路径结构 - * @return { Object | String } 根据路径返回语言资源的Json格式对象或者语言字符串 - * @example - * ```javascript - * editor.getLang('contextMenu.delete'); //如果当前是中文,那返回是的是'删除' - * ``` - */ - getLang: function(path) { - var lang = UE.I18N[this.options.lang]; - if (!lang) { - throw Error("not import language file"); - } - path = (path || "").split("."); - for (var i = 0, ci; (ci = path[i++]); ) { - lang = lang[ci]; - if (!lang) break; - } - return lang; - }, - - /** - * 计算编辑器html内容字符串的长度 - * @method getContentLength - * @return { Number } 返回计算的长度 - * @example - * ```javascript - * //编辑器html内容

                      132

                      - * editor.getContentLength() //返回27 - * ``` - */ - /** - * 计算编辑器当前纯文本内容的长度 - * @method getContentLength - * @param { Boolean } ingoneHtml 传入true时,只按照纯文本来计算 - * @return { Number } 返回计算的长度,内容中有hr/img/iframe标签,长度加1 - * @example - * ```javascript - * //编辑器html内容

                      132

                      - * editor.getContentLength() //返回3 - * ``` - */ - getContentLength: function(ingoneHtml, tagNames) { - var count = this.getContent(false, false, true).length; - if (ingoneHtml) { - tagNames = (tagNames || []).concat(["hr", "img", "iframe"]); - count = this.getContentTxt().replace(/[\t\r\n]+/g, "").length; - for (var i = 0, ci; (ci = tagNames[i++]); ) { - count += this.document.getElementsByTagName(ci).length; - } - } - return count; - }, - - /** - * 注册输入过滤规则 - * @method addInputRule - * @param { Function } rule 要添加的过滤规则 - * @example - * ```javascript - * editor.addInputRule(function(root){ - * $.each(root.getNodesByTagName('div'),function(i,node){ - * node.tagName="p"; - * }); - * }); - * ``` - */ - addInputRule: function(rule) { - this.inputRules.push(rule); - }, - - /** - * 执行注册的过滤规则 - * @method filterInputRule - * @param { UE.uNode } root 要过滤的uNode节点 - * @remind 执行editor.setContent方法和执行'inserthtml'命令后,会运行该过滤函数 - * @example - * ```javascript - * editor.filterInputRule(editor.body); - * ``` - * @see UE.Editor:addInputRule - */ - filterInputRule: function(root) { - for (var i = 0, ci; (ci = this.inputRules[i++]); ) { - ci.call(this, root); - } - }, - - /** - * 注册输出过滤规则 - * @method addOutputRule - * @param { Function } rule 要添加的过滤规则 - * @example - * ```javascript - * editor.addOutputRule(function(root){ - * $.each(root.getNodesByTagName('p'),function(i,node){ - * node.tagName="div"; - * }); - * }); - * ``` - */ - addOutputRule: function(rule) { - this.outputRules.push(rule); - }, - - /** - * 根据输出过滤规则,过滤编辑器内容 - * @method filterOutputRule - * @remind 执行editor.getContent方法的时候,会先运行该过滤函数 - * @param { UE.uNode } root 要过滤的uNode节点 - * @example - * ```javascript - * editor.filterOutputRule(editor.body); - * ``` - * @see UE.Editor:addOutputRule - */ - filterOutputRule: function(root) { - for (var i = 0, ci; (ci = this.outputRules[i++]); ) { - ci.call(this, root); - } - }, - - /** - * 根据action名称获取请求的路径 - * @method getActionUrl - * @remind 假如没有设置serverUrl,会根据imageUrl设置默认的controller路径 - * @param { String } action action名称 - * @example - * ```javascript - * editor.getActionUrl('config'); //返回 "/ueditor/php/controller.php?action=config" - * editor.getActionUrl('image'); //返回 "/ueditor/php/controller.php?action=uplaodimage" - * editor.getActionUrl('scrawl'); //返回 "/ueditor/php/controller.php?action=uplaodscrawl" - * editor.getActionUrl('imageManager'); //返回 "/ueditor/php/controller.php?action=listimage" - * ``` - */ - getActionUrl: function(action) { - var actionName = this.getOpt(action) || action, - imageUrl = this.getOpt("imageUrl"), - serverUrl = this.getOpt("serverUrl"); - /* if (!serverUrl && imageUrl) { - serverUrl = imageUrl.replace(/^(.*[\/]).+([\.].+)$/, "$1controller$2"); - } - - if (serverUrl) { - serverUrl = - serverUrl + - (serverUrl.indexOf("?") == -1 ? "?" : "&") + - "action=" + - (actionName || ""); - return utils.formatUrl(serverUrl); - } else { - return ""; - } */ - - if (serverUrl) { - serverUrl = serverUrl + "?"; - return utils.formatUrl(serverUrl); - } else { - return ""; - } - } - }; - utils.inherits(Editor, EventBase); -})(); - - -// core/Editor.defaultoptions.js -//维护编辑器一下默认的不在插件中的配置项 -UE.Editor.defaultOptions = function(editor) { - var _url = editor.options.UEDITOR_HOME_URL; - return { - isShow: true, - initialContent: "", - initialStyle: "", - autoClearinitialContent: false, - iframeCssUrl: _url + "themes/iframe.css", - textarea: "editorValue", - focus: false, - focusInEnd: true, - autoClearEmptyNode: true, - fullscreen: false, - readonly: false, - zIndex: 999, - imagePopup: true, - enterTag: "p", - customDomain: false, - lang: "zh-cn", - langPath: _url + "i18n/", - theme: "default", - themePath: _url + "themes/", - allHtmlEnabled: false, - scaleEnabled: false, - tableNativeEditInFF: false, - autoSyncData: true, - fileNameFormat: "{time}{rand:6}" - }; -}; - - -// core/loadconfig.js -;(function() { - UE.Editor.prototype.loadServerConfig = function() { - var me = this; - setTimeout(function() { - try { - me.options.imageUrl && - me.setOpt( - "serverUrl", - me.options.imageUrl.replace( - /^(.*[\/]).+([\.].+)$/, - "$1controller$2" - ) - ); - - var configUrl = me.getActionUrl("config"), - isJsonp = utils.isCrossDomainUrl(configUrl); - - /* 发出ajax请求 */ - me._serverConfigLoaded = false; - - configUrl && - UE.ajax.request(configUrl, { - method: "GET", - dataType: isJsonp ? "jsonp" : "", - onsuccess: function(r) { - try { - var config = isJsonp ? r : eval("(" + r.responseText + ")"); - utils.extend(me.options, config); - me.fireEvent("serverConfigLoaded"); - me._serverConfigLoaded = true; - } catch (e) { - showErrorMsg(me.getLang("loadconfigFormatError")); - } - }, - onerror: function() { - showErrorMsg(me.getLang("loadconfigHttpError")); - } - }); - } catch (e) { - showErrorMsg(me.getLang("loadconfigError")); - } - }); - - function showErrorMsg(msg) { - console && console.error(msg); - //me.fireEvent('showMessage', { - // 'title': msg, - // 'type': 'error' - //}); - } - }; - - UE.Editor.prototype.isServerConfigLoaded = function() { - var me = this; - return me._serverConfigLoaded || false; - }; - - UE.Editor.prototype.afterConfigReady = function(handler) { - if (!handler || !utils.isFunction(handler)) return; - var me = this; - var readyHandler = function() { - handler.apply(me, arguments); - me.removeListener("serverConfigLoaded", readyHandler); - }; - - if (me.isServerConfigLoaded()) { - handler.call(me, "serverConfigLoaded"); - } else { - me.addListener("serverConfigLoaded", readyHandler); - } - }; -})(); - - -// core/ajax.js -/** - * @file - * @module UE.ajax - * @since 1.2.6.1 - */ - -/** - * 提供对ajax请求的支持 - * @module UE.ajax - */ -UE.ajax = (function() { - //创建一个ajaxRequest对象 - var fnStr = "XMLHttpRequest()"; - try { - new ActiveXObject("Msxml2.XMLHTTP"); - fnStr = "ActiveXObject('Msxml2.XMLHTTP')"; - } catch (e) { - try { - new ActiveXObject("Microsoft.XMLHTTP"); - fnStr = "ActiveXObject('Microsoft.XMLHTTP')"; - } catch (e) {} - } - var creatAjaxRequest = new Function("return new " + fnStr); - - /** - * 将json参数转化成适合ajax提交的参数列表 - * @param json - */ - function json2str(json) { - var strArr = []; - for (var i in json) { - //忽略默认的几个参数 - if ( - i == "method" || - i == "timeout" || - i == "async" || - i == "dataType" || - i == "callback" - ) - continue; - //忽略控制 - if (json[i] == undefined || json[i] == null) continue; - //传递过来的对象和函数不在提交之列 - if ( - !( - (typeof json[i]).toLowerCase() == "function" || - (typeof json[i]).toLowerCase() == "object" - ) - ) { - strArr.push(encodeURIComponent(i) + "=" + encodeURIComponent(json[i])); - } else if (utils.isArray(json[i])) { - //支持传数组内容 - for (var j = 0; j < json[i].length; j++) { - strArr.push( - encodeURIComponent(i) + "[]=" + encodeURIComponent(json[i][j]) - ); - } - } - } - return strArr.join("&"); - } - - function doAjax(url, ajaxOptions) { - var xhr = creatAjaxRequest(), - //是否超时 - timeIsOut = false, - //默认参数 - defaultAjaxOptions = { - method: "POST", - timeout: 5000, - async: true, - data: {}, //需要传递对象的话只能覆盖 - onsuccess: function() {}, - onerror: function() {} - }; - - if (typeof url === "object") { - ajaxOptions = url; - url = ajaxOptions.url; - } - if (!xhr || !url) return; - var ajaxOpts = ajaxOptions - ? utils.extend(defaultAjaxOptions, ajaxOptions) - : defaultAjaxOptions; - - var submitStr = json2str(ajaxOpts); // { name:"Jim",city:"Beijing" } --> "name=Jim&city=Beijing" - //如果用户直接通过data参数传递json对象过来,则也要将此json对象转化为字符串 - if (!utils.isEmptyObject(ajaxOpts.data)) { - submitStr += (submitStr ? "&" : "") + json2str(ajaxOpts.data); - } - //超时检测 - var timerID = setTimeout(function() { - if (xhr.readyState != 4) { - timeIsOut = true; - xhr.abort(); - clearTimeout(timerID); - } - }, ajaxOpts.timeout); - - var method = ajaxOpts.method.toUpperCase(); - var str = - url + - (url.indexOf("?") == -1 ? "?" : "&") + - (method == "POST" ? "" : submitStr + "&noCache=" + +new Date()); - xhr.open(method, str, ajaxOpts.async); - xhr.onreadystatechange = function() { - if (xhr.readyState == 4) { - if (!timeIsOut && xhr.status == 200) { - ajaxOpts.onsuccess(xhr); - } else { - ajaxOpts.onerror(xhr); - } - } - }; - if (method == "POST") { - xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - xhr.send(submitStr); - } else { - xhr.send(null); - } - } - - function doJsonp(url, opts) { - var successhandler = opts.onsuccess || function() {}, - scr = document.createElement("SCRIPT"), - options = opts || {}, - charset = options["charset"], - callbackField = options["jsonp"] || "callback", - callbackFnName, - timeOut = options["timeOut"] || 0, - timer, - reg = new RegExp("(\\?|&)" + callbackField + "=([^&]*)"), - matches; - - if (utils.isFunction(successhandler)) { - callbackFnName = - "bd__editor__" + Math.floor(Math.random() * 2147483648).toString(36); - window[callbackFnName] = getCallBack(0); - } else if (utils.isString(successhandler)) { - callbackFnName = successhandler; - } else { - if ((matches = reg.exec(url))) { - callbackFnName = matches[2]; - } - } - - url = url.replace(reg, "\x241" + callbackField + "=" + callbackFnName); - - if (url.search(reg) < 0) { - url += - (url.indexOf("?") < 0 ? "?" : "&") + - callbackField + - "=" + - callbackFnName; - } - - var queryStr = json2str(opts); // { name:"Jim",city:"Beijing" } --> "name=Jim&city=Beijing" - //如果用户直接通过data参数传递json对象过来,则也要将此json对象转化为字符串 - if (!utils.isEmptyObject(opts.data)) { - queryStr += (queryStr ? "&" : "") + json2str(opts.data); - } - if (queryStr) { - url = url.replace(/\?/, "?" + queryStr + "&"); - } - - scr.onerror = getCallBack(1); - if (timeOut) { - timer = setTimeout(getCallBack(1), timeOut); - } - createScriptTag(scr, url, charset); - - function createScriptTag(scr, url, charset) { - scr.setAttribute("type", "text/javascript"); - scr.setAttribute("defer", "defer"); - charset && scr.setAttribute("charset", charset); - scr.setAttribute("src", url); - document.getElementsByTagName("head")[0].appendChild(scr); - } - - function getCallBack(onTimeOut) { - return function() { - try { - if (onTimeOut) { - options.onerror && options.onerror(); - } else { - try { - clearTimeout(timer); - successhandler.apply(window, arguments); - } catch (e) {} - } - } catch (exception) { - options.onerror && options.onerror.call(window, exception); - } finally { - options.oncomplete && options.oncomplete.apply(window, arguments); - scr.parentNode && scr.parentNode.removeChild(scr); - window[callbackFnName] = null; - try { - delete window[callbackFnName]; - } catch (e) {} - } - }; - } - } - - return { - /** - * 根据给定的参数项,向指定的url发起一个ajax请求。 ajax请求完成后,会根据请求结果调用相应回调: 如果请求 - * 成功, 则调用onsuccess回调, 失败则调用 onerror 回调 - * @method request - * @param { URLString } url ajax请求的url地址 - * @param { Object } ajaxOptions ajax请求选项的键值对,支持的选项如下: - * @example - * ```javascript - * //向sayhello.php发起一个异步的Ajax GET请求, 请求超时时间为10s, 请求完成后执行相应的回调。 - * UE.ajax.requeset( 'sayhello.php', { - * - * //请求方法。可选值: 'GET', 'POST',默认值是'POST' - * method: 'GET', - * - * //超时时间。 默认为5000, 单位是ms - * timeout: 10000, - * - * //是否是异步请求。 true为异步请求, false为同步请求 - * async: true, - * - * //请求携带的数据。如果请求为GET请求, data会经过stringify后附加到请求url之后。 - * data: { - * name: 'neditor' - * }, - * - * //请求成功后的回调, 该回调接受当前的XMLHttpRequest对象作为参数。 - * onsuccess: function ( xhr ) { - * console.log( xhr.responseText ); - * }, - * - * //请求失败或者超时后的回调。 - * onerror: function ( xhr ) { - * alert( 'Ajax请求失败' ); - * } - * - * } ); - * ``` - */ - - /** - * 根据给定的参数项发起一个ajax请求, 参数项里必须包含一个url地址。 ajax请求完成后,会根据请求结果调用相应回调: 如果请求 - * 成功, 则调用onsuccess回调, 失败则调用 onerror 回调。 - * @method request - * @warning 如果在参数项里未提供一个key为“url”的地址值,则该请求将直接退出。 - * @param { Object } ajaxOptions ajax请求选项的键值对,支持的选项如下: - * @example - * ```javascript - * - * //向sayhello.php发起一个异步的Ajax POST请求, 请求超时时间为5s, 请求完成后不执行任何回调。 - * UE.ajax.requeset( 'sayhello.php', { - * - * //请求的地址, 该项是必须的。 - * url: 'sayhello.php' - * - * } ); - * ``` - */ - request: function(url, opts) { - if (opts && opts.dataType == "jsonp") { - doJsonp(url, opts); - } else { - doAjax(url, opts); - } - }, - getJSONP: function(url, data, fn) { - var opts = { - data: data, - oncomplete: fn - }; - doJsonp(url, opts); - } - }; -})(); - - -// core/filterword.js -/** - * UE过滤word的静态方法 - * @file - */ - -/** - * UEditor公用空间,UEditor所有的功能都挂载在该空间下 - * @module UE - */ - -/** - * 根据传入html字符串过滤word - * @module UE - * @since 1.2.6.1 - * @method filterWord - * @param { String } html html字符串 - * @return { String } 已过滤后的结果字符串 - * @example - * ```javascript - * UE.filterWord(html); - * ``` - */ -var filterWord = (UE.filterWord = (function() { - //是否是word过来的内容 - function isWordDocument(str) { - return /(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<(v|o):|lang=)/gi.test( - str - ); - } - //去掉小数 - function transUnit(v) { - v = v.replace(/[\d.]+\w+/g, function(m) { - return utils.transUnitToPx(m); - }); - return v; - } - - function filterPasteWord(str) { - return ( - str - .replace(/[\t\r\n]+/g, " ") - .replace(//gi, "") - //转换图片 - .replace(/]*>[\s\S]*?.<\/v:shape>/gi, function(str) { - //opera能自己解析出image所这里直接返回空 - if (browser.opera) { - return ""; - } - try { - //有可能是bitmap占为图,无用,直接过滤掉,主要体现在粘贴excel表格中 - if (/Bitmap/i.test(str)) { - return ""; - } - var width = str.match(/width:([ \d.]*p[tx])/i)[1], - height = str.match(/height:([ \d.]*p[tx])/i)[1], - src = str.match(/src=\s*"([^"]*)"/i)[1]; - return ( - '' - ); - } catch (e) { - return ""; - } - }) - //针对wps添加的多余标签处理 - .replace(/<\/?div[^>]*>/g, "") - //去掉多余的属性 - .replace(/v:\w+=(["']?)[^'"]+\1/g, "") - .replace( - /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi, - "" - ) - .replace( - /

                      ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, - "

                      $1

                      " - ) - //去掉多余的属性 - .replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/gi, function( - str, - name, - marks, - val - ) { - //保留list的标示 - return name == "class" && val == "MsoListParagraph" ? str : ""; - }) - //清除多余的font/span不能匹配 有可能是空格 - .replace(/<(font|span)[^>]*>(\s*)<\/\1>/gi, function(a, b, c) { - return c.replace(/[\t\r\n ]+/g, " "); - }) - //处理style的问题 - .replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi, function( - str, - tag, - tmp, - style - ) { - var n = [], - s = style - .replace(/^\s+|\s+$/, "") - .replace(/'/g, "'") - .replace(/"/gi, "'") - .replace(/[\d.]+(cm|pt)/g, function(str) { - return utils.transUnitToPx(str); - }) - .split(/;\s*/g); - - for (var i = 0, v; (v = s[i]); i++) { - var name, - value, - parts = v.split(":"); - - if (parts.length == 2) { - name = parts[0].toLowerCase(); - value = parts[1].toLowerCase(); - if ( - (/^(background)\w*/.test(name) && - value.replace(/(initial|\s)/g, "").length == 0) || - (/^(margin)\w*/.test(name) && /^0\w+$/.test(value)) - ) { - continue; - } - - switch (name) { - case "mso-padding-alt": - case "mso-padding-top-alt": - case "mso-padding-right-alt": - case "mso-padding-bottom-alt": - case "mso-padding-left-alt": - case "mso-margin-alt": - case "mso-margin-top-alt": - case "mso-margin-right-alt": - case "mso-margin-bottom-alt": - case "mso-margin-left-alt": - //ie下会出现挤到一起的情况 - //case "mso-table-layout-alt": - case "mso-height": - case "mso-width": - case "mso-vertical-align-alt": - //trace:1819 ff下会解析出padding在table上 - if (!/]/.test(html)) { - return UE.htmlparser(html).children[0]; - } else { - return new uNode({ - type: "element", - children: [], - tagName: html - }); - } - }; - uNode.createText = function(data, noTrans) { - return new UE.uNode({ - type: "text", - data: noTrans ? data : utils.unhtml(data || "") - }); - }; - function nodeToHtml(node, arr, formatter, current) { - switch (node.type) { - case "root": - for (var i = 0, ci; (ci = node.children[i++]); ) { - //插入新行 - if ( - formatter && - ci.type == "element" && - !dtd.$inlineWithA[ci.tagName] && - i > 1 - ) { - insertLine(arr, current, true); - insertIndent(arr, current); - } - nodeToHtml(ci, arr, formatter, current); - } - break; - case "text": - isText(node, arr); - break; - case "element": - isElement(node, arr, formatter, current); - break; - case "comment": - isComment(node, arr, formatter); - } - return arr; - } - - function isText(node, arr) { - if (node.parentNode.tagName == "pre") { - //源码模式下输入html标签,不能做转换处理,直接输出 - arr.push(node.data); - } else { - arr.push( - notTransTagName[node.parentNode.tagName] - ? utils.html(node.data) - : node.data.replace(/[ ]{2}/g, "  ") - ); - } - } - - function isElement(node, arr, formatter, current) { - var attrhtml = ""; - if (node.attrs) { - attrhtml = []; - var attrs = node.attrs; - for (var a in attrs) { - //这里就针对 - //

                      '

                      - //这里边的\"做转换,要不用innerHTML直接被截断了,属性src - //有可能做的不够 - attrhtml.push( - a + - (attrs[a] !== undefined - ? '="' + - (notTransAttrs[a] - ? utils.html(attrs[a]).replace(/["]/g, function(a) { - return """; - }) - : utils.unhtml(attrs[a])) + - '"' - : "") - ); - } - attrhtml = attrhtml.join(" "); - } - arr.push( - "<" + - node.tagName + - (attrhtml ? " " + attrhtml : "") + - (dtd.$empty[node.tagName] ? "/" : "") + - ">" - ); - //插入新行 - if (formatter && !dtd.$inlineWithA[node.tagName] && node.tagName != "pre") { - if (node.children && node.children.length) { - current = insertLine(arr, current, true); - insertIndent(arr, current); - } - } - if (node.children && node.children.length) { - for (var i = 0, ci; (ci = node.children[i++]); ) { - if ( - formatter && - ci.type == "element" && - !dtd.$inlineWithA[ci.tagName] && - i > 1 - ) { - insertLine(arr, current); - insertIndent(arr, current); - } - nodeToHtml(ci, arr, formatter, current); - } - } - if (!dtd.$empty[node.tagName]) { - if ( - formatter && - !dtd.$inlineWithA[node.tagName] && - node.tagName != "pre" - ) { - if (node.children && node.children.length) { - current = insertLine(arr, current); - insertIndent(arr, current); - } - } - arr.push(""); - } - } - - function isComment(node, arr) { - arr.push(""); - } - - function getNodeById(root, id) { - var node; - if (root.type == "element" && root.getAttr("id") == id) { - return root; - } - if (root.children && root.children.length) { - for (var i = 0, ci; (ci = root.children[i++]); ) { - if ((node = getNodeById(ci, id))) { - return node; - } - } - } - } - - function getNodesByTagName(node, tagName, arr) { - if (node.type == "element" && node.tagName == tagName) { - arr.push(node); - } - if (node.children && node.children.length) { - for (var i = 0, ci; (ci = node.children[i++]); ) { - getNodesByTagName(ci, tagName, arr); - } - } - } - function nodeTraversal(root, fn) { - if (root.children && root.children.length) { - for (var i = 0, ci; (ci = root.children[i]); ) { - nodeTraversal(ci, fn); - //ci被替换的情况,这里就不再走 fn了 - if (ci.parentNode) { - if (ci.children && ci.children.length) { - fn(ci); - } - if (ci.parentNode) i++; - } - } - } else { - fn(root); - } - } - uNode.prototype = { - /** - * 当前节点对象,转换成html文本 - * @method toHtml - * @return { String } 返回转换后的html字符串 - * @example - * ```javascript - * node.toHtml(); - * ``` - */ - - /** - * 当前节点对象,转换成html文本 - * @method toHtml - * @param { Boolean } formatter 是否格式化返回值 - * @return { String } 返回转换后的html字符串 - * @example - * ```javascript - * node.toHtml( true ); - * ``` - */ - toHtml: function(formatter) { - var arr = []; - nodeToHtml(this, arr, formatter, 0); - return arr.join(""); - }, - - /** - * 获取节点的html内容 - * @method innerHTML - * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 - * @return { String } 返回节点的html内容 - * @example - * ```javascript - * var htmlstr = node.innerHTML(); - * ``` - */ - - /** - * 设置节点的html内容 - * @method innerHTML - * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 - * @param { String } htmlstr 传入要设置的html内容 - * @return { UE.uNode } 返回节点本身 - * @example - * ```javascript - * node.innerHTML('text'); - * ``` - */ - innerHTML: function(htmlstr) { - if (this.type != "element" || dtd.$empty[this.tagName]) { - return this; - } - if (utils.isString(htmlstr)) { - if (this.children) { - for (var i = 0, ci; (ci = this.children[i++]); ) { - ci.parentNode = null; - } - } - this.children = []; - var tmpRoot = UE.htmlparser(htmlstr); - for (var i = 0, ci; (ci = tmpRoot.children[i++]); ) { - this.children.push(ci); - ci.parentNode = this; - } - return this; - } else { - var tmpRoot = new UE.uNode({ - type: "root", - children: this.children - }); - return tmpRoot.toHtml(); - } - }, - - /** - * 获取节点的纯文本内容 - * @method innerText - * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 - * @return { String } 返回节点的存文本内容 - * @example - * ```javascript - * var textStr = node.innerText(); - * ``` - */ - - /** - * 设置节点的纯文本内容 - * @method innerText - * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 - * @param { String } textStr 传入要设置的文本内容 - * @return { UE.uNode } 返回节点本身 - * @example - * ```javascript - * node.innerText('text'); - * ``` - */ - innerText: function(textStr, noTrans) { - if (this.type != "element" || dtd.$empty[this.tagName]) { - return this; - } - if (textStr) { - if (this.children) { - for (var i = 0, ci; (ci = this.children[i++]); ) { - ci.parentNode = null; - } - } - this.children = []; - this.appendChild(uNode.createText(textStr, noTrans)); - return this; - } else { - return this.toHtml().replace(/<[^>]+>/g, ""); - } - }, - - /** - * 获取当前对象的data属性 - * @method getData - * @return { Object } 若节点的type值是elemenet,返回空字符串,否则返回节点的data属性 - * @example - * ```javascript - * node.getData(); - * ``` - */ - getData: function() { - if (this.type == "element") return ""; - return this.data; - }, - - /** - * 获取当前节点下的第一个子节点 - * @method firstChild - * @return { UE.uNode } 返回第一个子节点 - * @example - * ```javascript - * node.firstChild(); //返回第一个子节点 - * ``` - */ - firstChild: function() { - // if (this.type != 'element' || dtd.$empty[this.tagName]) { - // return this; - // } - return this.children ? this.children[0] : null; - }, - - /** - * 获取当前节点下的最后一个子节点 - * @method lastChild - * @return { UE.uNode } 返回最后一个子节点 - * @example - * ```javascript - * node.lastChild(); //返回最后一个子节点 - * ``` - */ - lastChild: function() { - // if (this.type != 'element' || dtd.$empty[this.tagName] ) { - // return this; - // } - return this.children ? this.children[this.children.length - 1] : null; - }, - - /** - * 获取和当前节点有相同父亲节点的前一个节点 - * @method previousSibling - * @return { UE.uNode } 返回前一个节点 - * @example - * ```javascript - * node.children[2].previousSibling(); //返回子节点node.children[1] - * ``` - */ - previousSibling: function() { - var parent = this.parentNode; - for (var i = 0, ci; (ci = parent.children[i]); i++) { - if (ci === this) { - return i == 0 ? null : parent.children[i - 1]; - } - } - }, - - /** - * 获取和当前节点有相同父亲节点的后一个节点 - * @method nextSibling - * @return { UE.uNode } 返回后一个节点,找不到返回null - * @example - * ```javascript - * node.children[2].nextSibling(); //如果有,返回子节点node.children[3] - * ``` - */ - nextSibling: function() { - var parent = this.parentNode; - for (var i = 0, ci; (ci = parent.children[i++]); ) { - if (ci === this) { - return parent.children[i]; - } - } - }, - - /** - * 用新的节点替换当前节点 - * @method replaceChild - * @param { UE.uNode } target 要替换成该节点参数 - * @param { UE.uNode } source 要被替换掉的节点 - * @return { UE.uNode } 返回替换之后的节点对象 - * @example - * ```javascript - * node.replaceChild(newNode, childNode); //用newNode替换childNode,childNode是node的子节点 - * ``` - */ - replaceChild: function(target, source) { - if (this.children) { - if (target.parentNode) { - target.parentNode.removeChild(target); - } - for (var i = 0, ci; (ci = this.children[i]); i++) { - if (ci === source) { - this.children.splice(i, 1, target); - source.parentNode = null; - target.parentNode = this; - return target; - } - } - } - }, - - /** - * 在节点的子节点列表最后位置插入一个节点 - * @method appendChild - * @param { UE.uNode } node 要插入的节点 - * @return { UE.uNode } 返回刚插入的子节点 - * @example - * ```javascript - * node.appendChild( newNode ); //在node内插入子节点newNode - * ``` - */ - appendChild: function(node) { - if ( - this.type == "root" || - (this.type == "element" && !dtd.$empty[this.tagName]) - ) { - if (!this.children) { - this.children = []; - } - if (node.parentNode) { - node.parentNode.removeChild(node); - } - for (var i = 0, ci; (ci = this.children[i]); i++) { - if (ci === node) { - this.children.splice(i, 1); - break; - } - } - this.children.push(node); - node.parentNode = this; - return node; - } - }, - - /** - * 在传入节点的前面插入一个节点 - * @method insertBefore - * @param { UE.uNode } target 要插入的节点 - * @param { UE.uNode } source 在该参数节点前面插入 - * @return { UE.uNode } 返回刚插入的子节点 - * @example - * ```javascript - * node.parentNode.insertBefore(newNode, node); //在node节点后面插入newNode - * ``` - */ - insertBefore: function(target, source) { - if (this.children) { - if (target.parentNode) { - target.parentNode.removeChild(target); - } - for (var i = 0, ci; (ci = this.children[i]); i++) { - if (ci === source) { - this.children.splice(i, 0, target); - target.parentNode = this; - return target; - } - } - } - }, - - /** - * 在传入节点的后面插入一个节点 - * @method insertAfter - * @param { UE.uNode } target 要插入的节点 - * @param { UE.uNode } source 在该参数节点后面插入 - * @return { UE.uNode } 返回刚插入的子节点 - * @example - * ```javascript - * node.parentNode.insertAfter(newNode, node); //在node节点后面插入newNode - * ``` - */ - insertAfter: function(target, source) { - if (this.children) { - if (target.parentNode) { - target.parentNode.removeChild(target); - } - for (var i = 0, ci; (ci = this.children[i]); i++) { - if (ci === source) { - this.children.splice(i + 1, 0, target); - target.parentNode = this; - return target; - } - } - } - }, - - /** - * 从当前节点的子节点列表中,移除节点 - * @method removeChild - * @param { UE.uNode } node 要移除的节点引用 - * @param { Boolean } keepChildren 是否保留移除节点的子节点,若传入true,自动把移除节点的子节点插入到移除的位置 - * @return { * } 返回刚移除的子节点 - * @example - * ```javascript - * node.removeChild(childNode,true); //在node的子节点列表中移除child节点,并且吧child的子节点插入到移除的位置 - * ``` - */ - removeChild: function(node, keepChildren) { - if (this.children) { - for (var i = 0, ci; (ci = this.children[i]); i++) { - if (ci === node) { - this.children.splice(i, 1); - ci.parentNode = null; - if (keepChildren && ci.children && ci.children.length) { - for (var j = 0, cj; (cj = ci.children[j]); j++) { - this.children.splice(i + j, 0, cj); - cj.parentNode = this; - } - } - return ci; - } - } - } - }, - - /** - * 获取当前节点所代表的元素属性,即获取attrs对象下的属性值 - * @method getAttr - * @param { String } attrName 要获取的属性名称 - * @return { * } 返回attrs对象下的属性值 - * @example - * ```javascript - * node.getAttr('title'); - * ``` - */ - getAttr: function(attrName) { - return this.attrs && this.attrs[attrName.toLowerCase()]; - }, - - /** - * 设置当前节点所代表的元素属性,即设置attrs对象下的属性值 - * @method setAttr - * @param { String } attrName 要设置的属性名称 - * @param { * } attrVal 要设置的属性值,类型视设置的属性而定 - * @return { * } 返回attrs对象下的属性值 - * @example - * ```javascript - * node.setAttr('title','标题'); - * ``` - */ - setAttr: function(attrName, attrVal) { - if (!attrName) { - delete this.attrs; - return; - } - if (!this.attrs) { - this.attrs = {}; - } - if (utils.isObject(attrName)) { - for (var a in attrName) { - if (!attrName[a]) { - delete this.attrs[a]; - } else { - this.attrs[a.toLowerCase()] = attrName[a]; - } - } - } else { - if (!attrVal) { - delete this.attrs[attrName]; - } else { - this.attrs[attrName.toLowerCase()] = attrVal; - } - } - }, - - /** - * 获取当前节点在父节点下的位置索引 - * @method getIndex - * @return { Number } 返回索引数值,如果没有父节点,返回-1 - * @example - * ```javascript - * node.getIndex(); - * ``` - */ - getIndex: function() { - var parent = this.parentNode; - for (var i = 0, ci; (ci = parent.children[i]); i++) { - if (ci === this) { - return i; - } - } - return -1; - }, - - /** - * 在当前节点下,根据id查找节点 - * @method getNodeById - * @param { String } id 要查找的id - * @return { UE.uNode } 返回找到的节点 - * @example - * ```javascript - * node.getNodeById('textId'); - * ``` - */ - getNodeById: function(id) { - var node; - if (this.children && this.children.length) { - for (var i = 0, ci; (ci = this.children[i++]); ) { - if ((node = getNodeById(ci, id))) { - return node; - } - } - } - }, - - /** - * 在当前节点下,根据元素名称查找节点列表 - * @method getNodesByTagName - * @param { String } tagNames 要查找的元素名称 - * @return { Array } 返回找到的节点列表 - * @example - * ```javascript - * node.getNodesByTagName('span'); - * ``` - */ - getNodesByTagName: function(tagNames) { - tagNames = utils.trim(tagNames).replace(/[ ]{2,}/g, " ").split(" "); - var arr = [], - me = this; - utils.each(tagNames, function(tagName) { - if (me.children && me.children.length) { - for (var i = 0, ci; (ci = me.children[i++]); ) { - getNodesByTagName(ci, tagName, arr); - } - } - }); - return arr; - }, - - /** - * 根据样式名称,获取节点的样式值 - * @method getStyle - * @param { String } name 要获取的样式名称 - * @return { String } 返回样式值 - * @example - * ```javascript - * node.getStyle('font-size'); - * ``` - */ - getStyle: function(name) { - var cssStyle = this.getAttr("style"); - if (!cssStyle) { - return ""; - } - var reg = new RegExp("(^|;)\\s*" + name + ":([^;]+)", "i"); - var match = cssStyle.match(reg); - if (match && match[0]) { - return match[2]; - } - return ""; - }, - - /** - * 给节点设置样式 - * @method setStyle - * @param { String } name 要设置的的样式名称 - * @param { String } val 要设置的的样值 - * @example - * ```javascript - * node.setStyle('font-size', '12px'); - * ``` - */ - setStyle: function(name, val) { - function exec(name, val) { - var reg = new RegExp("(^|;)\\s*" + name + ":([^;]+;?)", "gi"); - cssStyle = cssStyle.replace(reg, "$1"); - if (val) { - cssStyle = name + ":" + utils.unhtml(val) + ";" + cssStyle; - } - } - - var cssStyle = this.getAttr("style"); - if (!cssStyle) { - cssStyle = ""; - } - if (utils.isObject(name)) { - for (var a in name) { - exec(a, name[a]); - } - } else { - exec(name, val); - } - this.setAttr("style", utils.trim(cssStyle)); - }, - - /** - * 传入一个函数,递归遍历当前节点下的所有节点 - * @method traversal - * @param { Function } fn 遍历到节点的时,传入节点作为参数,运行此函数 - * @example - * ```javascript - * traversal(node, function(){ - * console.log(node.type); - * }); - * ``` - */ - traversal: function(fn) { - if (this.children && this.children.length) { - nodeTraversal(this, fn); - } - return this; - } - }; -})(); - - -// core/htmlparser.js -/** - * html字符串转换成uNode节点 - * @file - * @module UE - * @since 1.2.6.1 - */ - -/** - * UEditor公用空间,UEditor所有的功能都挂载在该空间下 - * @unfile - * @module UE - */ - -/** - * html字符串转换成uNode节点的静态方法 - * @method htmlparser - * @param { String } htmlstr 要转换的html代码 - * @param { Boolean } ignoreBlank 若设置为true,转换的时候忽略\n\r\t等空白字符 - * @return { uNode } 给定的html片段转换形成的uNode对象 - * @example - * ```javascript - * var root = UE.htmlparser('

                      htmlparser

                      ', true); - * ``` - */ - -var htmlparser = (UE.htmlparser = function(htmlstr, ignoreBlank) { - //todo 原来的方式 [^"'<>\/] 有\/就不能配对上 " - ); - } - html.push(""); - } - //禁止指定table-width - return "
                      这样的标签了 - //先去掉了,加上的原因忘了,这里先记录 - //var re_tag = /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g, - //以上的正则表达式无法匹配:

                      - //修改为如下正则表达式: - var re_tag = /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g, - re_attr = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g; - - //ie下取得的html可能会有\n存在,要去掉,在处理replace(/[\t\r\n]*/g,'');代码高量的\n不能去除 - var allowEmptyTags = { - b: 1, - code: 1, - i: 1, - u: 1, - strike: 1, - s: 1, - tt: 1, - strong: 1, - q: 1, - samp: 1, - em: 1, - span: 1, - sub: 1, - img: 1, - sup: 1, - font: 1, - big: 1, - small: 1, - iframe: 1, - a: 1, - br: 1, - pre: 1 - }; - htmlstr = htmlstr.replace(new RegExp(domUtils.fillChar, "g"), ""); - if (!ignoreBlank) { - htmlstr = htmlstr.replace( - new RegExp( - "[\\r\\t\\n" + - (ignoreBlank ? "" : " ") + - "]*]*)>[\\r\\t\\n" + - (ignoreBlank ? "" : " ") + - "]*", - "g" - ), - function(a, b) { - //br暂时单独处理 - if (b && allowEmptyTags[b.toLowerCase()]) { - return a.replace(/(^[\n\r]+)|([\n\r]+$)/g, ""); - } - return a - .replace(new RegExp("^[\\r\\n" + (ignoreBlank ? "" : " ") + "]+"), "") - .replace( - new RegExp("[\\r\\n" + (ignoreBlank ? "" : " ") + "]+$"), - "" - ); - } - ); - } - - var notTransAttrs = { - href: 1, - src: 1 - }; - - var uNode = UE.uNode, - needParentNode = { - td: "tr", - tr: ["tbody", "thead", "tfoot"], - tbody: "table", - th: "tr", - thead: "table", - tfoot: "table", - caption: "table", - li: ["ul", "ol"], - dt: "dl", - dd: "dl", - option: "select" - }, - needChild = { - ol: "li", - ul: "li" - }; - - function text(parent, data) { - if (needChild[parent.tagName]) { - var tmpNode = uNode.createElement(needChild[parent.tagName]); - parent.appendChild(tmpNode); - tmpNode.appendChild(uNode.createText(data)); - parent = tmpNode; - } else { - parent.appendChild(uNode.createText(data)); - } - } - - function element(parent, tagName, htmlattr) { - var needParentTag; - if ((needParentTag = needParentNode[tagName])) { - var tmpParent = parent, - hasParent; - while (tmpParent.type != "root") { - if ( - utils.isArray(needParentTag) - ? utils.indexOf(needParentTag, tmpParent.tagName) != -1 - : needParentTag == tmpParent.tagName - ) { - parent = tmpParent; - hasParent = true; - break; - } - tmpParent = tmpParent.parentNode; - } - if (!hasParent) { - parent = element( - parent, - utils.isArray(needParentTag) ? needParentTag[0] : needParentTag - ); - } - } - //按dtd处理嵌套 - // if(parent.type != 'root' && !dtd[parent.tagName][tagName]) - // parent = parent.parentNode; - var elm = new uNode({ - parentNode: parent, - type: "element", - tagName: tagName.toLowerCase(), - //是自闭合的处理一下 - children: dtd.$empty[tagName] ? null : [] - }); - //如果属性存在,处理属性 - if (htmlattr) { - var attrs = {}, - match; - while ((match = re_attr.exec(htmlattr))) { - attrs[match[1].toLowerCase()] = notTransAttrs[match[1].toLowerCase()] - ? match[2] || match[3] || match[4] - : utils.unhtml(match[2] || match[3] || match[4]); - } - elm.attrs = attrs; - } - //trace:3970 - // //如果parent下不能放elm - // if(dtd.$inline[parent.tagName] && dtd.$block[elm.tagName] && !dtd[parent.tagName][elm.tagName]){ - // parent = parent.parentNode; - // elm.parentNode = parent; - // } - parent.children.push(elm); - //如果是自闭合节点返回父亲节点 - return dtd.$empty[tagName] ? parent : elm; - } - - function comment(parent, data) { - parent.children.push( - new uNode({ - type: "comment", - data: data, - parentNode: parent - }) - ); - } - - var match, - currentIndex = 0, - nextIndex = 0; - //设置根节点 - var root = new uNode({ - type: "root", - children: [] - }); - var currentParent = root; - - while ((match = re_tag.exec(htmlstr))) { - currentIndex = match.index; - try { - if (currentIndex > nextIndex) { - //text node - text(currentParent, htmlstr.slice(nextIndex, currentIndex)); - } - if (match[3]) { - if (dtd.$cdata[currentParent.tagName]) { - text(currentParent, match[0]); - } else { - //start tag - currentParent = element( - currentParent, - match[3].toLowerCase(), - match[4] - ); - } - } else if (match[1]) { - if (currentParent.type != "root") { - if (dtd.$cdata[currentParent.tagName] && !dtd.$cdata[match[1]]) { - text(currentParent, match[0]); - } else { - var tmpParent = currentParent; - while ( - currentParent.type == "element" && - currentParent.tagName != match[1].toLowerCase() - ) { - currentParent = currentParent.parentNode; - if (currentParent.type == "root") { - currentParent = tmpParent; - throw "break"; - } - } - //end tag - currentParent = currentParent.parentNode; - } - } - } else if (match[2]) { - //comment - comment(currentParent, match[2]); - } - } catch (e) {} - - nextIndex = re_tag.lastIndex; - } - //如果结束是文本,就有可能丢掉,所以这里手动判断一下 - //例如
                    • sdfsdfsdf
                    • sdfsdfsdfsdf - if (nextIndex < htmlstr.length) { - text(currentParent, htmlstr.slice(nextIndex)); - } - return root; -}); - - -// core/filternode.js -/** - * UE过滤节点的静态方法 - * @file - */ - -/** - * UEditor公用空间,UEditor所有的功能都挂载在该空间下 - * @module UE - */ - -/** - * 根据传入节点和过滤规则过滤相应节点 - * @module UE - * @since 1.2.6.1 - * @method filterNode - * @param { Object } root 指定root节点 - * @param { Object } rules 过滤规则json对象 - * @example - * ```javascript - * UE.filterNode(root,editor.options.filterRules); - * ``` - */ -var filterNode = (UE.filterNode = (function() { - function filterNode(node, rules) { - switch (node.type) { - case "text": - break; - case "element": - var val; - if ((val = rules[node.tagName])) { - if (val === "-") { - node.parentNode.removeChild(node); - } else if (utils.isFunction(val)) { - var parentNode = node.parentNode, - index = node.getIndex(); - val(node); - if (node.parentNode) { - if (node.children) { - for (var i = 0, ci; (ci = node.children[i]); ) { - filterNode(ci, rules); - if (ci.parentNode) { - i++; - } - } - } - } else { - for (var i = index, ci; (ci = parentNode.children[i]); ) { - filterNode(ci, rules); - if (ci.parentNode) { - i++; - } - } - } - } else { - var attrs = val["$"]; - if (attrs && node.attrs) { - var tmpAttrs = {}, - tmpVal; - for (var a in attrs) { - tmpVal = node.getAttr(a); - //todo 只先对style单独处理 - if (a == "style" && utils.isArray(attrs[a])) { - var tmpCssStyle = []; - utils.each(attrs[a], function(v) { - var tmp; - if ((tmp = node.getStyle(v))) { - tmpCssStyle.push(v + ":" + tmp); - } - }); - tmpVal = tmpCssStyle.join(";"); - } - if (tmpVal) { - tmpAttrs[a] = tmpVal; - } - } - node.attrs = tmpAttrs; - } - if (node.children) { - for (var i = 0, ci; (ci = node.children[i]); ) { - filterNode(ci, rules); - if (ci.parentNode) { - i++; - } - } - } - } - } else { - //如果不在名单里扣出子节点并删除该节点,cdata除外 - if (dtd.$cdata[node.tagName]) { - node.parentNode.removeChild(node); - } else { - var parentNode = node.parentNode, - index = node.getIndex(); - node.parentNode.removeChild(node, true); - for (var i = index, ci; (ci = parentNode.children[i]); ) { - filterNode(ci, rules); - if (ci.parentNode) { - i++; - } - } - } - } - break; - case "comment": - node.parentNode.removeChild(node); - } - } - return function(root, rules) { - if (utils.isEmptyObject(rules)) { - return root; - } - var val; - if ((val = rules["-"])) { - utils.each(val.split(" "), function(k) { - rules[k] = "-"; - }); - } - for (var i = 0, ci; (ci = root.children[i]); ) { - filterNode(ci, rules); - if (ci.parentNode) { - i++; - } - } - return root; - }; -})()); - - -// core/plugin.js -/** - * Created with JetBrains PhpStorm. - * User: campaign - * Date: 10/8/13 - * Time: 6:15 PM - * To change this template use File | Settings | File Templates. - */ -UE.plugin = (function() { - var _plugins = {}; - return { - register: function(pluginName, fn, oldOptionName, afterDisabled) { - if (oldOptionName && utils.isFunction(oldOptionName)) { - afterDisabled = oldOptionName; - oldOptionName = null; - } - _plugins[pluginName] = { - optionName: oldOptionName || pluginName, - execFn: fn, - //当插件被禁用时执行 - afterDisabled: afterDisabled - }; - }, - load: function(editor) { - utils.each(_plugins, function(plugin) { - var _export = plugin.execFn.call(editor); - if (editor.options[plugin.optionName] !== false) { - if (_export) { - //后边需要再做扩展 - utils.each(_export, function(v, k) { - switch (k.toLowerCase()) { - case "shortcutkey": - editor.addshortcutkey(v); - break; - case "bindevents": - utils.each(v, function(fn, eventName) { - editor.addListener(eventName, fn); - }); - break; - case "bindmultievents": - utils.each(utils.isArray(v) ? v : [v], function(event) { - var types = utils.trim(event.type).split(/\s+/); - utils.each(types, function(eventName) { - editor.addListener(eventName, event.handler); - }); - }); - break; - case "commands": - utils.each(v, function(execFn, execName) { - editor.commands[execName] = execFn; - }); - break; - case "outputrule": - editor.addOutputRule(v); - break; - case "inputrule": - editor.addInputRule(v); - break; - case "defaultoptions": - editor.setOpt(v); - } - }); - } - } else if (plugin.afterDisabled) { - plugin.afterDisabled.call(editor); - } - }); - //向下兼容 - utils.each(UE.plugins, function(plugin) { - plugin.call(editor); - }); - }, - run: function(pluginName, editor) { - var plugin = _plugins[pluginName]; - if (plugin) { - plugin.exeFn.call(editor); - } - } - }; -})(); - - -// core/keymap.js -var keymap = (UE.keymap = { - Backspace: 8, - Tab: 9, - Enter: 13, - - Shift: 16, - Control: 17, - Alt: 18, - CapsLock: 20, - - Esc: 27, - - Spacebar: 32, - - PageUp: 33, - PageDown: 34, - End: 35, - Home: 36, - - Left: 37, - Up: 38, - Right: 39, - Down: 40, - - Insert: 45, - - Del: 46, - - NumLock: 144, - - Cmd: 91, - - "=": 187, - "-": 189, - - b: 66, - i: 73, - //回退 - z: 90, - y: 89, - //粘贴 - v: 86, - x: 88, - - s: 83, - - n: 78 -}); - - -// core/localstorage.js -//存储媒介封装 -var LocalStorage = (UE.LocalStorage = (function() { - var storage = window.localStorage || getUserData() || null, - LOCAL_FILE = "localStorage"; - - return { - saveLocalData: function(key, data) { - if (storage && data) { - storage.setItem(key, data); - return true; - } - - return false; - }, - - getLocalData: function(key) { - if (storage) { - return storage.getItem(key); - } - - return null; - }, - - removeItem: function(key) { - storage && storage.removeItem(key); - } - }; - - function getUserData() { - var container = document.createElement("div"); - container.style.display = "none"; - - if (!container.addBehavior) { - return null; - } - - container.addBehavior("#default#userdata"); - - return { - getItem: function(key) { - var result = null; - - try { - document.body.appendChild(container); - container.load(LOCAL_FILE); - result = container.getAttribute(key); - document.body.removeChild(container); - } catch (e) {} - - return result; - }, - - setItem: function(key, value) { - document.body.appendChild(container); - container.setAttribute(key, value); - container.save(LOCAL_FILE); - document.body.removeChild(container); - }, - - //// 暂时没有用到 - //clear: function () { - // - // var expiresTime = new Date(); - // expiresTime.setFullYear(expiresTime.getFullYear() - 1); - // document.body.appendChild(container); - // container.expires = expiresTime.toUTCString(); - // container.save(LOCAL_FILE); - // document.body.removeChild(container); - // - //}, - - removeItem: function(key) { - document.body.appendChild(container); - container.removeAttribute(key); - container.save(LOCAL_FILE); - document.body.removeChild(container); - } - }; - } -})()); - -;(function() { - var ROOTKEY = "ueditor_preference"; - - UE.Editor.prototype.setPreferences = function(key, value) { - var obj = {}; - if (utils.isString(key)) { - obj[key] = value; - } else { - obj = key; - } - var data = LocalStorage.getLocalData(ROOTKEY); - if (data && (data = utils.str2json(data))) { - utils.extend(data, obj); - } else { - data = obj; - } - data && LocalStorage.saveLocalData(ROOTKEY, utils.json2str(data)); - }; - - UE.Editor.prototype.getPreferences = function(key) { - var data = LocalStorage.getLocalData(ROOTKEY); - if (data && (data = utils.str2json(data))) { - return key ? data[key] : data; - } - return null; - }; - - UE.Editor.prototype.removePreferences = function(key) { - var data = LocalStorage.getLocalData(ROOTKEY); - if (data && (data = utils.str2json(data))) { - data[key] = undefined; - delete data[key]; - } - data && LocalStorage.saveLocalData(ROOTKEY, utils.json2str(data)); - }; -})(); - - -// plugins/defaultfilter.js -///import core -///plugin 编辑器默认的过滤转换机制 - -UE.plugins["defaultfilter"] = function() { - var me = this; - me.setOpt({ - allowDivTransToP: true, - disabledTableInTable: true, - rgb2Hex: true - }); - //默认的过滤处理 - //进入编辑器的内容处理 - me.addInputRule(function(root) { - var allowDivTransToP = this.options.allowDivTransToP; - var val; - function tdParent(node) { - while (node && node.type == "element") { - if (node.tagName == "td") { - return true; - } - node = node.parentNode; - } - return false; - } - //进行默认的处理 - root.traversal(function(node) { - if (node.type == "element") { - if ( - !dtd.$cdata[node.tagName] && - me.options.autoClearEmptyNode && - dtd.$inline[node.tagName] && - !dtd.$empty[node.tagName] && - (!node.attrs || utils.isEmptyObject(node.attrs)) - ) { - if (!node.firstChild()) node.parentNode.removeChild(node); - else if ( - node.tagName == "span" && - (!node.attrs || utils.isEmptyObject(node.attrs)) - ) { - node.parentNode.removeChild(node, true); - } - return; - } - switch (node.tagName) { - case "style": - case "script": - node.setAttr({ - cdata_tag: node.tagName, - cdata_data: node.innerHTML() || "", - _ue_custom_node_: "true" - }); - node.tagName = "div"; - node.innerHTML(""); - break; - case "a": - if ((val = node.getAttr("href"))) { - node.setAttr("_href", val); - } - break; - case "img": - //todo base64暂时去掉,后边做远程图片上传后,干掉这个 - if ((val = node.getAttr("src"))) { - if (/^data:/.test(val)) { - node.parentNode.removeChild(node); - break; - } - } - node.setAttr("_src", node.getAttr("src")); - break; - case "span": - if (browser.webkit && (val = node.getStyle("white-space"))) { - if (/nowrap|normal/.test(val)) { - node.setStyle("white-space", ""); - if ( - me.options.autoClearEmptyNode && - utils.isEmptyObject(node.attrs) - ) { - node.parentNode.removeChild(node, true); - } - } - } - val = node.getAttr("id"); - if (val && /^_baidu_bookmark_/i.test(val)) { - node.parentNode.removeChild(node); - } - break; - case "p": - if ((val = node.getAttr("align"))) { - node.setAttr("align"); - node.setStyle("text-align", val); - } - //trace:3431 - // var cssStyle = node.getAttr('style'); - // if (cssStyle) { - // cssStyle = cssStyle.replace(/(margin|padding)[^;]+/g, ''); - // node.setAttr('style', cssStyle) - // - // } - //p标签不允许嵌套 - utils.each(node.children, function(n) { - if (n.type == "element" && n.tagName == "p") { - var next = n.nextSibling(); - node.parentNode.insertAfter(n, node); - var last = n; - while (next) { - var tmp = next.nextSibling(); - node.parentNode.insertAfter(next, last); - last = next; - next = tmp; - } - return false; - } - }); - if (!node.firstChild()) { - node.innerHTML(browser.ie ? " " : "
                      "); - } - break; - case "div": - if (node.getAttr("cdata_tag")) { - break; - } - //针对代码这里不处理插入代码的div - val = node.getAttr("class"); - if (val && /^line number\d+/.test(val)) { - break; - } - if (!allowDivTransToP) { - break; - } - var tmpNode, - p = UE.uNode.createElement("p"); - while ((tmpNode = node.firstChild())) { - if ( - tmpNode.type == "text" || - !UE.dom.dtd.$block[tmpNode.tagName] - ) { - p.appendChild(tmpNode); - } else { - if (p.firstChild()) { - node.parentNode.insertBefore(p, node); - p = UE.uNode.createElement("p"); - } else { - node.parentNode.insertBefore(tmpNode, node); - } - } - } - if (p.firstChild()) { - node.parentNode.insertBefore(p, node); - } - node.parentNode.removeChild(node); - break; - case "dl": - node.tagName = "ul"; - break; - case "dt": - case "dd": - node.tagName = "li"; - break; - case "li": - var className = node.getAttr("class"); - if (!className || !/list\-/.test(className)) { - node.setAttr(); - } - var tmpNodes = node.getNodesByTagName("ol ul"); - UE.utils.each(tmpNodes, function(n) { - node.parentNode.insertAfter(n, node); - }); - break; - case "td": - case "th": - case "caption": - if (!node.children || !node.children.length) { - node.appendChild( - browser.ie11below - ? UE.uNode.createText(" ") - : UE.uNode.createElement("br") - ); - } - break; - case "table": - if (me.options.disabledTableInTable && tdParent(node)) { - node.parentNode.insertBefore( - UE.uNode.createText(node.innerText()), - node - ); - node.parentNode.removeChild(node); - } - } - } - // if(node.type == 'comment'){ - // node.parentNode.removeChild(node); - // } - }); - }); - - //从编辑器出去的内容处理 - me.addOutputRule(function(root) { - var val; - root.traversal(function(node) { - if (node.type == "element") { - if ( - me.options.autoClearEmptyNode && - dtd.$inline[node.tagName] && - !dtd.$empty[node.tagName] && - (!node.attrs || utils.isEmptyObject(node.attrs)) - ) { - if (!node.firstChild()) node.parentNode.removeChild(node); - else if ( - node.tagName == "span" && - (!node.attrs || utils.isEmptyObject(node.attrs)) - ) { - node.parentNode.removeChild(node, true); - } - return; - } - switch (node.tagName) { - case "div": - if ((val = node.getAttr("cdata_tag"))) { - node.tagName = val; - node.appendChild(UE.uNode.createText(node.getAttr("cdata_data"))); - node.setAttr({ - cdata_tag: "", - cdata_data: "", - _ue_custom_node_: "" - }); - } - break; - case "a": - if ((val = node.getAttr("_href"))) { - node.setAttr({ - href: utils.html(val), - _href: "" - }); - } - break; - break; - case "span": - val = node.getAttr("id"); - if (val && /^_baidu_bookmark_/i.test(val)) { - node.parentNode.removeChild(node); - } - //将color的rgb格式转换为#16进制格式 - if (me.getOpt("rgb2Hex")) { - var cssStyle = node.getAttr("style"); - if (cssStyle) { - node.setAttr( - "style", - cssStyle.replace(/rgba?\(([\d,\s]+)\)/g, function(a, value) { - var array = value.split(","); - if (array.length > 3) return ""; - value = "#"; - for (var i = 0, color; (color = array[i++]); ) { - color = parseInt( - color.replace(/[^\d]/gi, ""), - 10 - ).toString(16); - value += color.length == 1 ? "0" + color : color; - } - return value.toUpperCase(); - }) - ); - } - } - break; - case "img": - if ((val = node.getAttr("_src"))) { - node.setAttr({ - src: node.getAttr("_src"), - _src: "" - }); - } - } - } - }); - }); -}; - - -// plugins/inserthtml.js -/** - * 插入html字符串插件 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入html代码 - * @command inserthtml - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } html 插入的html字符串 - * @remaind 插入的标签内容是在当前的选区位置上插入,如果当前是闭合状态,那直接插入内容, 如果当前是选中状态,将先清除当前选中内容后,再做插入 - * @warning 注意:该命令会对当前选区的位置,对插入的内容进行过滤转换处理。 过滤的规则遵循html语意化的原则。 - * @example - * ```javascript - * //xxx[BB]xxx 当前选区为非闭合选区,选中BB这两个文本 - * //执行命令,插入CC - * //插入后的效果 xxxCCxxx - * //

                      xx|xxx

                      当前选区为闭合状态 - * //插入

                      CC

                      - * //结果

                      xx

                      CC

                      xxx

                      - * //

                      xxxx

                      |

                      xxx

                      当前选区在两个p标签之间 - * //插入 xxxx - * //结果

                      xxxx

                      xxxx

                      xxx

                      - * ``` - */ - -UE.commands["inserthtml"] = { - execCommand: function(command, html, notNeedFilter) { - var me = this, - range, - div; - if (!html) { - return; - } - if (me.fireEvent("beforeinserthtml", html) === true) { - return; - } - range = me.selection.getRange(); - div = range.document.createElement("div"); - div.style.display = "inline"; - - if (!notNeedFilter) { - var root = UE.htmlparser(html); - //如果给了过滤规则就先进行过滤 - if (me.options.filterRules) { - UE.filterNode(root, me.options.filterRules); - } - //执行默认的处理 - me.filterInputRule(root); - html = root.toHtml(); - } - div.innerHTML = utils.trim(html); - - if (!range.collapsed) { - var tmpNode = range.startContainer; - if (domUtils.isFillChar(tmpNode)) { - range.setStartBefore(tmpNode); - } - tmpNode = range.endContainer; - if (domUtils.isFillChar(tmpNode)) { - range.setEndAfter(tmpNode); - } - range.txtToElmBoundary(); - //结束边界可能放到了br的前边,要把br包含进来 - // x[xxx]
                      - if (range.endContainer && range.endContainer.nodeType == 1) { - tmpNode = range.endContainer.childNodes[range.endOffset]; - if (tmpNode && domUtils.isBr(tmpNode)) { - range.setEndAfter(tmpNode); - } - } - if (range.startOffset == 0) { - tmpNode = range.startContainer; - if (domUtils.isBoundaryNode(tmpNode, "firstChild")) { - tmpNode = range.endContainer; - if ( - range.endOffset == - (tmpNode.nodeType == 3 - ? tmpNode.nodeValue.length - : tmpNode.childNodes.length) && - domUtils.isBoundaryNode(tmpNode, "lastChild") - ) { - me.body.innerHTML = "

                      " + (browser.ie ? "" : "
                      ") + "

                      "; - range.setStart(me.body.firstChild, 0).collapse(true); - } - } - } - !range.collapsed && range.deleteContents(); - if (range.startContainer.nodeType == 1) { - var child = range.startContainer.childNodes[range.startOffset], - pre; - if ( - child && - domUtils.isBlockElm(child) && - (pre = child.previousSibling) && - domUtils.isBlockElm(pre) - ) { - range.setEnd(pre, pre.childNodes.length).collapse(); - while (child.firstChild) { - pre.appendChild(child.firstChild); - } - domUtils.remove(child); - } - } - } - - var child, - parent, - pre, - tmp, - hadBreak = 0, - nextNode; - //如果当前位置选中了fillchar要干掉,要不会产生空行 - if (range.inFillChar()) { - child = range.startContainer; - if (domUtils.isFillChar(child)) { - range.setStartBefore(child).collapse(true); - domUtils.remove(child); - } else if (domUtils.isFillChar(child, true)) { - child.nodeValue = child.nodeValue.replace(fillCharReg, ""); - range.startOffset--; - range.collapsed && range.collapse(true); - } - } - //列表单独处理 - var li = domUtils.findParentByTagName(range.startContainer, "li", true); - if (li) { - var next, last; - while ((child = div.firstChild)) { - //针对hr单独处理一下先 - while ( - child && - (child.nodeType == 3 || - !domUtils.isBlockElm(child) || - child.tagName == "HR") - ) { - next = child.nextSibling; - range.insertNode(child).collapse(); - last = child; - child = next; - } - if (child) { - if (/^(ol|ul)$/i.test(child.tagName)) { - while (child.firstChild) { - last = child.firstChild; - domUtils.insertAfter(li, child.firstChild); - li = li.nextSibling; - } - domUtils.remove(child); - } else { - var tmpLi; - next = child.nextSibling; - tmpLi = me.document.createElement("li"); - domUtils.insertAfter(li, tmpLi); - tmpLi.appendChild(child); - last = child; - child = next; - li = tmpLi; - } - } - } - li = domUtils.findParentByTagName(range.startContainer, "li", true); - if (domUtils.isEmptyBlock(li)) { - domUtils.remove(li); - } - if (last) { - range.setStartAfter(last).collapse(true).select(true); - } - } else { - while ((child = div.firstChild)) { - if (hadBreak) { - var p = me.document.createElement("p"); - while (child && (child.nodeType == 3 || !dtd.$block[child.tagName])) { - nextNode = child.nextSibling; - p.appendChild(child); - child = nextNode; - } - if (p.firstChild) { - child = p; - } - } - range.insertNode(child); - nextNode = child.nextSibling; - if ( - !hadBreak && - child.nodeType == domUtils.NODE_ELEMENT && - domUtils.isBlockElm(child) - ) { - parent = domUtils.findParent(child, function(node) { - return domUtils.isBlockElm(node); - }); - if ( - parent && - parent.tagName.toLowerCase() != "body" && - !( - dtd[parent.tagName][child.nodeName] && child.parentNode === parent - ) - ) { - if (!dtd[parent.tagName][child.nodeName]) { - pre = parent; - } else { - tmp = child.parentNode; - while (tmp !== parent) { - pre = tmp; - tmp = tmp.parentNode; - } - } - - domUtils.breakParent(child, pre || tmp); - //去掉break后前一个多余的节点

                      |<[p> ==>

                      |

                      - var pre = child.previousSibling; - domUtils.trimWhiteTextNode(pre); - if (!pre.childNodes.length) { - domUtils.remove(pre); - } - //trace:2012,在非ie的情况,切开后剩下的节点有可能不能点入光标添加br占位 - - if ( - !browser.ie && - (next = child.nextSibling) && - domUtils.isBlockElm(next) && - next.lastChild && - !domUtils.isBr(next.lastChild) - ) { - next.appendChild(me.document.createElement("br")); - } - hadBreak = 1; - } - } - var next = child.nextSibling; - if (!div.firstChild && next && domUtils.isBlockElm(next)) { - range.setStart(next, 0).collapse(true); - break; - } - range.setEndAfter(child).collapse(); - } - - child = range.startContainer; - - if (nextNode && domUtils.isBr(nextNode)) { - domUtils.remove(nextNode); - } - //用chrome可能有空白展位符 - if (domUtils.isBlockElm(child) && domUtils.isEmptyNode(child)) { - if ((nextNode = child.nextSibling)) { - domUtils.remove(child); - if (nextNode.nodeType == 1 && dtd.$block[nextNode.tagName]) { - range.setStart(nextNode, 0).collapse(true).shrinkBoundary(); - } - } else { - try { - child.innerHTML = browser.ie ? domUtils.fillChar : "
                      "; - } catch (e) { - range.setStartBefore(child); - domUtils.remove(child); - } - } - } - //加上true因为在删除表情等时会删两次,第一次是删的fillData - try { - range.select(true); - } catch (e) {} - } - - setTimeout(function() { - range = me.selection.getRange(); - range.scrollToView( - me.autoHeightEnabled, - me.autoHeightEnabled ? domUtils.getXY(me.iframe).y : 0 - ); - me.fireEvent("afterinserthtml", html); - }, 200); - } -}; - - -// plugins/autotypeset.js -/** - * 自动排版 - * @file - * @since 1.2.6.1 - */ - -/** - * 对当前编辑器的内容执行自动排版, 排版的行为根据config配置文件里的“autotypeset”选项进行控制。 - * @command autotypeset - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'autotypeset' ); - * ``` - */ - -UE.plugins["autotypeset"] = function() { - this.setOpt({ - autotypeset: { - mergeEmptyline: true, //合并空行 - removeClass: true, //去掉冗余的class - removeEmptyline: false, //去掉空行 - textAlign: "left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版 - imageBlockLine: "center", //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版 - pasteFilter: false, //根据规则过滤没事粘贴进来的内容 - clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号 - clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体 - removeEmptyNode: false, // 去掉空节点 - //可以去掉的标签 - removeTagNames: utils.extend({ div: 1 }, dtd.$removeEmpty), - indent: false, // 行首缩进 - indentValue: "2em", //行首缩进的大小 - bdc2sb: false, - tobdc: false - } - }); - - var me = this, - opt = me.options.autotypeset, - remainClass = { - selectTdClass: 1, - pagebreak: 1, - anchorclass: 1 - }, - remainTag = { - li: 1 - }, - tags = { - div: 1, - p: 1, - //trace:2183 这些也认为是行 - blockquote: 1, - center: 1, - h1: 1, - h2: 1, - h3: 1, - h4: 1, - h5: 1, - h6: 1, - span: 1 - }, - highlightCont; - //升级了版本,但配置项目里没有autotypeset - if (!opt) { - return; - } - - readLocalOpts(); - - function isLine(node, notEmpty) { - if (!node || node.nodeType == 3) return 0; - if (domUtils.isBr(node)) return 1; - if (node && node.parentNode && tags[node.tagName.toLowerCase()]) { - if ( - (highlightCont && highlightCont.contains(node)) || - node.getAttribute("pagebreak") - ) { - return 0; - } - - return notEmpty - ? !domUtils.isEmptyBlock(node) - : domUtils.isEmptyBlock( - node, - new RegExp("[\\s" + domUtils.fillChar + "]", "g") - ); - } - } - - function removeNotAttributeSpan(node) { - if (!node.style.cssText) { - domUtils.removeAttributes(node, ["style"]); - if ( - node.tagName.toLowerCase() == "span" && - domUtils.hasNoAttributes(node) - ) { - domUtils.remove(node, true); - } - } - } - function autotype(type, html) { - var me = this, - cont; - if (html) { - if (!opt.pasteFilter) { - return; - } - cont = me.document.createElement("div"); - cont.innerHTML = html.html; - } else { - cont = me.document.body; - } - var nodes = domUtils.getElementsByTagName(cont, "*"); - - // 行首缩进,段落方向,段间距,段内间距 - for (var i = 0, ci; (ci = nodes[i++]); ) { - if (me.fireEvent("excludeNodeinautotype", ci) === true) { - continue; - } - //font-size - if (opt.clearFontSize && ci.style.fontSize) { - domUtils.removeStyle(ci, "font-size"); - - removeNotAttributeSpan(ci); - } - //font-family - if (opt.clearFontFamily && ci.style.fontFamily) { - domUtils.removeStyle(ci, "font-family"); - removeNotAttributeSpan(ci); - } - - if (isLine(ci)) { - //合并空行 - if (opt.mergeEmptyline) { - var next = ci.nextSibling, - tmpNode, - isBr = domUtils.isBr(ci); - while (isLine(next)) { - tmpNode = next; - next = tmpNode.nextSibling; - if (isBr && (!next || (next && !domUtils.isBr(next)))) { - break; - } - domUtils.remove(tmpNode); - } - } - //去掉空行,保留占位的空行 - if ( - opt.removeEmptyline && - domUtils.inDoc(ci, cont) && - !remainTag[ci.parentNode.tagName.toLowerCase()] - ) { - if (domUtils.isBr(ci)) { - next = ci.nextSibling; - if (next && !domUtils.isBr(next)) { - continue; - } - } - domUtils.remove(ci); - continue; - } - } - if (isLine(ci, true) && ci.tagName != "SPAN") { - if (opt.indent) { - ci.style.textIndent = opt.indentValue; - } - if (opt.textAlign) { - ci.style.textAlign = opt.textAlign; - } - // if(opt.lineHeight) - // ci.style.lineHeight = opt.lineHeight + 'cm'; - } - - //去掉class,保留的class不去掉 - if ( - opt.removeClass && - ci.className && - !remainClass[ci.className.toLowerCase()] - ) { - if (highlightCont && highlightCont.contains(ci)) { - continue; - } - domUtils.removeAttributes(ci, ["class"]); - } - - //表情不处理 - if ( - opt.imageBlockLine && - ci.tagName.toLowerCase() == "img" && - !ci.getAttribute("emotion") - ) { - if (html) { - var img = ci; - switch (opt.imageBlockLine) { - case "left": - case "right": - case "none": - var pN = img.parentNode, - tmpNode, - pre, - next; - while (dtd.$inline[pN.tagName] || pN.tagName == "A") { - pN = pN.parentNode; - } - tmpNode = pN; - if ( - tmpNode.tagName == "P" && - domUtils.getStyle(tmpNode, "text-align") == "center" - ) { - if ( - !domUtils.isBody(tmpNode) && - domUtils.getChildCount(tmpNode, function(node) { - return !domUtils.isBr(node) && !domUtils.isWhitespace(node); - }) == 1 - ) { - pre = tmpNode.previousSibling; - next = tmpNode.nextSibling; - if ( - pre && - next && - pre.nodeType == 1 && - next.nodeType == 1 && - pre.tagName == next.tagName && - domUtils.isBlockElm(pre) - ) { - pre.appendChild(tmpNode.firstChild); - while (next.firstChild) { - pre.appendChild(next.firstChild); - } - domUtils.remove(tmpNode); - domUtils.remove(next); - } else { - domUtils.setStyle(tmpNode, "text-align", ""); - } - } - } - domUtils.setStyle(img, "float", opt.imageBlockLine); - break; - case "center": - if (me.queryCommandValue("imagefloat") != "center") { - pN = img.parentNode; - domUtils.setStyle(img, "float", "none"); - tmpNode = img; - while ( - pN && - domUtils.getChildCount(pN, function(node) { - return !domUtils.isBr(node) && !domUtils.isWhitespace(node); - }) == 1 && - (dtd.$inline[pN.tagName] || pN.tagName == "A") - ) { - tmpNode = pN; - pN = pN.parentNode; - } - var pNode = me.document.createElement("p"); - domUtils.setAttributes(pNode, { - style: "text-align:center" - }); - tmpNode.parentNode.insertBefore(pNode, tmpNode); - pNode.appendChild(tmpNode); - domUtils.setStyle(tmpNode, "float", ""); - } - } - } else { - var range = me.selection.getRange(); - range.selectNode(ci).select(); - me.execCommand("imagefloat", opt.imageBlockLine); - } - } - - //去掉冗余的标签 - if (opt.removeEmptyNode) { - if ( - opt.removeTagNames[ci.tagName.toLowerCase()] && - domUtils.hasNoAttributes(ci) && - domUtils.isEmptyBlock(ci) - ) { - domUtils.remove(ci); - } - } - } - if (opt.tobdc) { - var root = UE.htmlparser(cont.innerHTML); - root.traversal(function(node) { - if (node.type == "text") { - node.data = ToDBC(node.data); - } - }); - cont.innerHTML = root.toHtml(); - } - if (opt.bdc2sb) { - var root = UE.htmlparser(cont.innerHTML); - root.traversal(function(node) { - if (node.type == "text") { - node.data = DBC2SB(node.data); - } - }); - cont.innerHTML = root.toHtml(); - } - if (html) { - html.html = cont.innerHTML; - } - } - if (opt.pasteFilter) { - me.addListener("beforepaste", autotype); - } - - function DBC2SB(str) { - var result = ""; - for (var i = 0; i < str.length; i++) { - var code = str.charCodeAt(i); //获取当前字符的unicode编码 - if (code >= 65281 && code <= 65373) { - //在这个unicode编码范围中的是所有的英文字母已经各种字符 - result += String.fromCharCode(str.charCodeAt(i) - 65248); //把全角字符的unicode编码转换为对应半角字符的unicode码 - } else if (code == 12288) { - //空格 - result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32); - } else { - result += str.charAt(i); - } - } - return result; - } - function ToDBC(txtstring) { - txtstring = utils.html(txtstring); - var tmp = ""; - var mark = ""; /*用于判断,如果是html尖括里的标记,则不进行全角的转换*/ - for (var i = 0; i < txtstring.length; i++) { - if (txtstring.charCodeAt(i) == 32) { - tmp = tmp + String.fromCharCode(12288); - } else if (txtstring.charCodeAt(i) < 127) { - tmp = tmp + String.fromCharCode(txtstring.charCodeAt(i) + 65248); - } else { - tmp += txtstring.charAt(i); - } - } - return tmp; - } - - function readLocalOpts() { - var cookieOpt = me.getPreferences("autotypeset"); - utils.extend(me.options.autotypeset, cookieOpt); - } - - me.commands["autotypeset"] = { - execCommand: function() { - me.removeListener("beforepaste", autotype); - if (opt.pasteFilter) { - me.addListener("beforepaste", autotype); - } - autotype.call(me); - } - }; -}; - - -// plugins/autosubmit.js -/** - * 快捷键提交 - * @file - * @since 1.2.6.1 - */ - -/** - * 提交表单 - * @command autosubmit - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'autosubmit' ); - * ``` - */ - -UE.plugin.register("autosubmit", function() { - return { - shortcutkey: { - autosubmit: "ctrl+13" //手动提交 - }, - commands: { - autosubmit: { - execCommand: function() { - var me = this, - form = domUtils.findParentByTagName(me.iframe, "form", false); - if (form) { - if (me.fireEvent("beforesubmit") === false) { - return; - } - me.sync(); - form.submit(); - } - } - } - } - }; -}); - - -// plugins/background.js -/** - * 背景插件,为UEditor提供设置背景功能 - * @file - * @since 1.2.6.1 - */ -UE.plugin.register("background", function() { - var me = this, - cssRuleId = "editor_background", - isSetColored, - reg = new RegExp("body[\\s]*\\{(.+)\\}", "i"); - - function stringToObj(str) { - var obj = {}, - styles = str.split(";"); - utils.each(styles, function(v) { - var index = v.indexOf(":"), - key = utils.trim(v.substr(0, index)).toLowerCase(); - key && (obj[key] = utils.trim(v.substr(index + 1) || "")); - }); - return obj; - } - - function setBackground(obj) { - if (obj) { - var styles = []; - for (var name in obj) { - if (obj.hasOwnProperty(name)) { - styles.push(name + ":" + obj[name] + "; "); - } - } - utils.cssRule( - cssRuleId, - styles.length ? "body{" + styles.join("") + "}" : "", - me.document - ); - } else { - utils.cssRule(cssRuleId, "", me.document); - } - } - //重写editor.hasContent方法 - - var orgFn = me.hasContents; - me.hasContents = function() { - if (me.queryCommandValue("background")) { - return true; - } - return orgFn.apply(me, arguments); - }; - return { - bindEvents: { - getAllHtml: function(type, headHtml) { - var body = this.body, - su = domUtils.getComputedStyle(body, "background-image"), - url = ""; - if (su.indexOf(me.options.imagePath) > 0) { - url = su - .substring(su.indexOf(me.options.imagePath), su.length - 1) - .replace(/"|\(|\)/gi, ""); - } else { - url = su != "none" ? su.replace(/url\("?|"?\)/gi, "") : ""; - } - var html = ' "; - headHtml.push(html); - }, - aftersetcontent: function() { - if (isSetColored == false) setBackground(); - } - }, - inputRule: function(root) { - isSetColored = false; - utils.each(root.getNodesByTagName("p"), function(p) { - var styles = p.getAttr("data-background"); - if (styles) { - isSetColored = true; - setBackground(stringToObj(styles)); - p.parentNode.removeChild(p); - } - }); - }, - outputRule: function(root) { - var me = this, - styles = (utils.cssRule(cssRuleId, me.document) || "") - .replace(/[\n\r]+/g, "") - .match(reg); - if (styles) { - root.appendChild( - UE.uNode.createElement( - '


                      ' - ) - ); - } - }, - commands: { - background: { - execCommand: function(cmd, obj) { - setBackground(obj); - }, - queryCommandValue: function() { - var me = this, - styles = (utils.cssRule(cssRuleId, me.document) || "") - .replace(/[\n\r]+/g, "") - .match(reg); - return styles ? stringToObj(styles[1]) : null; - }, - notNeedUndo: true - } - } - }; -}); - - -// plugins/image.js -/** - * 图片插入、排版插件 - * @file - * @since 1.2.6.1 - */ - -/** - * 图片对齐方式 - * @command imagefloat - * @method execCommand - * @remind 值center为独占一行居中 - * @param { String } cmd 命令字符串 - * @param { String } align 对齐方式,可传left、right、none、center - * @remaind center表示图片独占一行 - * @example - * ```javascript - * editor.execCommand( 'imagefloat', 'center' ); - * ``` - */ - -/** - * 如果选区所在位置是图片区域 - * @command imagefloat - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回图片对齐方式 - * @example - * ```javascript - * editor.queryCommandValue( 'imagefloat' ); - * ``` - */ - -UE.commands["imagefloat"] = { - execCommand: function(cmd, align) { - var me = this, - range = me.selection.getRange(); - if (!range.collapsed) { - var img = range.getClosedNode(); - if (img && img.tagName == "IMG") { - switch (align) { - case "left": - case "right": - case "none": - var pN = img.parentNode, - tmpNode, - pre, - next; - while (dtd.$inline[pN.tagName] || pN.tagName == "A") { - pN = pN.parentNode; - } - tmpNode = pN; - if ( - tmpNode.tagName == "P" && - domUtils.getStyle(tmpNode, "text-align") == "center" - ) { - if ( - !domUtils.isBody(tmpNode) && - domUtils.getChildCount(tmpNode, function(node) { - return !domUtils.isBr(node) && !domUtils.isWhitespace(node); - }) == 1 - ) { - pre = tmpNode.previousSibling; - next = tmpNode.nextSibling; - if ( - pre && - next && - pre.nodeType == 1 && - next.nodeType == 1 && - pre.tagName == next.tagName && - domUtils.isBlockElm(pre) - ) { - pre.appendChild(tmpNode.firstChild); - while (next.firstChild) { - pre.appendChild(next.firstChild); - } - domUtils.remove(tmpNode); - domUtils.remove(next); - } else { - domUtils.setStyle(tmpNode, "text-align", ""); - } - } - - range.selectNode(img).select(); - } - domUtils.setStyle(img, "float", align == "none" ? "" : align); - if (align == "none") { - domUtils.removeAttributes(img, "align"); - } - - break; - case "center": - if (me.queryCommandValue("imagefloat") != "center") { - var pN = img.parentNode; - domUtils.setStyle(img, "float", ""); - domUtils.removeAttributes(img, "align"); - tmpNode = img; - while ( - pN && - domUtils.getChildCount(pN, function(node) { - return !domUtils.isBr(node) && !domUtils.isWhitespace(node); - }) == 1 && - (dtd.$inline[pN.tagName] || pN.tagName == "A") - ) { - tmpNode = pN; - pN = pN.parentNode; - } - range.setStartBefore(tmpNode).setCursor(false); - pN = me.document.createElement("div"); - pN.appendChild(tmpNode); - domUtils.setStyle(tmpNode, "float", ""); - - me.execCommand( - "insertHtml", - '

                      ' + - pN.innerHTML + - "

                      " - ); - - tmpNode = me.document.getElementsByClassName("_img_parent_tmp")[0]; - tmpNode.removeAttribute("class"); - tmpNode = tmpNode.firstChild; - range.selectNode(tmpNode).select(); - //去掉后边多余的元素 - next = tmpNode.parentNode.nextSibling; - if (next && domUtils.isEmptyNode(next)) { - domUtils.remove(next); - } - } - - break; - } - } - } - }, - queryCommandValue: function() { - var range = this.selection.getRange(), - startNode, - floatStyle; - if (range.collapsed) { - return "none"; - } - startNode = range.getClosedNode(); - if (startNode && startNode.nodeType == 1 && startNode.tagName == "IMG") { - floatStyle = - domUtils.getComputedStyle(startNode, "float") || - startNode.getAttribute("align"); - - if (floatStyle == "none") { - floatStyle = domUtils.getComputedStyle( - startNode.parentNode, - "text-align" - ) == "center" - ? "center" - : floatStyle; - } - return { - left: 1, - right: 1, - center: 1 - }[floatStyle] - ? floatStyle - : "none"; - } - return "none"; - }, - queryCommandState: function() { - var range = this.selection.getRange(), - startNode; - - if (range.collapsed) return -1; - - startNode = range.getClosedNode(); - if (startNode && startNode.nodeType == 1 && startNode.tagName == "IMG") { - return 0; - } - return -1; - } -}; - -/** - * 插入图片 - * @command insertimage - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Object } opt 属性键值对,这些属性都将被复制到当前插入图片 - * @remind 该命令第二个参数可接受一个图片配置项对象的数组,可以插入多张图片, - * 此时数组的每一个元素都是一个Object类型的图片属性集合。 - * @example - * ```javascript - * editor.execCommand( 'insertimage', { - * src:'a/b/c.jpg', - * width:'100', - * height:'100' - * } ); - * ``` - * @example - * ```javascript - * editor.execCommand( 'insertimage', [{ - * src:'a/b/c.jpg', - * width:'100', - * height:'100' - * },{ - * src:'a/b/d.jpg', - * width:'100', - * height:'100' - * }] ); - * ``` - */ - -UE.commands["insertimage"] = { - execCommand: function(cmd, opt) { - opt = utils.isArray(opt) ? opt : [opt]; - if (!opt.length) { - return; - } - var me = this, - range = me.selection.getRange(), - img = range.getClosedNode(); - - if (me.fireEvent("beforeinsertimage", opt) === true) { - return; - } - - if ( - img && - /img/i.test(img.tagName) && - (img.className != "edui-faked-video" || - img.className.indexOf("edui-upload-video") != -1) && - !img.getAttribute("word_img") - ) { - var first = opt.shift(); - var floatStyle = first["floatStyle"]; - delete first["floatStyle"]; - //// img.style.border = (first.border||0) +"px solid #000"; - //// img.style.margin = (first.margin||0) +"px"; - // img.style.cssText += ';margin:' + (first.margin||0) +"px;" + 'border:' + (first.border||0) +"px solid #000"; - domUtils.setAttributes(img, first); - me.execCommand("imagefloat", floatStyle); - if (opt.length > 0) { - range.setStartAfter(img).setCursor(false, true); - me.execCommand("insertimage", opt); - } - } else { - var html = [], - str = "", - ci; - ci = opt[0]; - if (opt.length == 1) { - str = - '' + ci.alt + '"; - if (ci["floatStyle"] == "center") { - str = '

                      ' + str + "

                      "; - } - html.push(str); - } else { - for (var i = 0; (ci = opt[i++]); ) { - str = - "

                      "; - html.push(str); - } - } - - me.execCommand("insertHtml", html.join("")); - } - - me.fireEvent("afterinsertimage", opt); - } -}; - - -// plugins/justify.js -/** - * 段落格式 - * @file - * @since 1.2.6.1 - */ - -/** - * 段落对齐方式 - * @command justify - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } align 对齐方式:left => 居左,right => 居右,center => 居中,justify => 两端对齐 - * @example - * ```javascript - * editor.execCommand( 'justify', 'center' ); - * ``` - */ -/** - * 如果选区所在位置是段落区域,返回当前段落对齐方式 - * @command justify - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回段落对齐方式 - * @example - * ```javascript - * editor.queryCommandValue( 'justify' ); - * ``` - */ - -UE.plugins["justify"] = function() { - var me = this, - block = domUtils.isBlockElm, - defaultValue = { - left: 1, - right: 1, - center: 1, - justify: 1 - }, - doJustify = function(range, style) { - var bookmark = range.createBookmark(), - filterFn = function(node) { - return node.nodeType == 1 - ? node.tagName.toLowerCase() != "br" && - !domUtils.isBookmarkNode(node) - : !domUtils.isWhitespace(node); - }; - - range.enlarge(true); - var bookmark2 = range.createBookmark(), - current = domUtils.getNextDomNode(bookmark2.start, false, filterFn), - tmpRange = range.cloneRange(), - tmpNode; - while ( - current && - !( - domUtils.getPosition(current, bookmark2.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - if (current.nodeType == 3 || !block(current)) { - tmpRange.setStartBefore(current); - while (current && current !== bookmark2.end && !block(current)) { - tmpNode = current; - current = domUtils.getNextDomNode(current, false, null, function( - node - ) { - return !block(node); - }); - } - tmpRange.setEndAfter(tmpNode); - var common = tmpRange.getCommonAncestor(); - if (!domUtils.isBody(common) && block(common)) { - domUtils.setStyles( - common, - utils.isString(style) ? { "text-align": style } : style - ); - current = common; - } else { - var p = range.document.createElement("p"); - domUtils.setStyles( - p, - utils.isString(style) ? { "text-align": style } : style - ); - var frag = tmpRange.extractContents(); - p.appendChild(frag); - tmpRange.insertNode(p); - current = p; - } - current = domUtils.getNextDomNode(current, false, filterFn); - } else { - current = domUtils.getNextDomNode(current, true, filterFn); - } - } - return range.moveToBookmark(bookmark2).moveToBookmark(bookmark); - }; - - UE.commands["justify"] = { - execCommand: function(cmdName, align) { - var range = this.selection.getRange(), - txt; - - //闭合时单独处理 - if (range.collapsed) { - txt = this.document.createTextNode("p"); - range.insertNode(txt); - } - doJustify(range, align); - if (txt) { - range.setStartBefore(txt).collapse(true); - domUtils.remove(txt); - } - - range.select(); - - return true; - }, - queryCommandValue: function() { - var startNode = this.selection.getStart(), - value = domUtils.getComputedStyle(startNode, "text-align"); - return defaultValue[value] ? value : "left"; - }, - queryCommandState: function() { - var start = this.selection.getStart(), - cell = - start && - domUtils.findParentByTagName(start, ["td", "th", "caption"], true); - - return cell ? -1 : 0; - } - }; -}; - - -// plugins/font.js -/** - * 字体颜色,背景色,字号,字体,下划线,删除线 - * @file - * @since 1.2.6.1 - */ - -/** - * 字体颜色 - * @command forecolor - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } value 色值(必须十六进制) - * @example - * ```javascript - * editor.execCommand( 'forecolor', '#000' ); - * ``` - */ -/** - * 返回选区字体颜色 - * @command forecolor - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回字体颜色 - * @example - * ```javascript - * editor.queryCommandValue( 'forecolor' ); - * ``` - */ - -/** - * 字体背景颜色 - * @command backcolor - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } value 色值(必须十六进制) - * @example - * ```javascript - * editor.execCommand( 'backcolor', '#000' ); - * ``` - */ -/** - * 返回选区字体颜色 - * @command backcolor - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回字体背景颜色 - * @example - * ```javascript - * editor.queryCommandValue( 'backcolor' ); - * ``` - */ - -/** - * 字体大小 - * @command fontsize - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } value 字体大小 - * @example - * ```javascript - * editor.execCommand( 'fontsize', '14px' ); - * ``` - */ -/** - * 返回选区字体大小 - * @command fontsize - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回字体大小 - * @example - * ```javascript - * editor.queryCommandValue( 'fontsize' ); - * ``` - */ - -/** - * 字体样式 - * @command fontfamily - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } value 字体样式 - * @example - * ```javascript - * editor.execCommand( 'fontfamily', '微软雅黑' ); - * ``` - */ -/** - * 返回选区字体样式 - * @command fontfamily - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回字体样式 - * @example - * ```javascript - * editor.queryCommandValue( 'fontfamily' ); - * ``` - */ - -/** - * 字体下划线,与删除线互斥 - * @command underline - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'underline' ); - * ``` - */ - -/** - * 字体删除线,与下划线互斥 - * @command strikethrough - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'strikethrough' ); - * ``` - */ - -/** - * 字体边框 - * @command fontborder - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'fontborder' ); - * ``` - */ - -UE.plugins["font"] = function() { - var me = this, - fonts = { - forecolor: "color", - backcolor: "background-color", - fontsize: "font-size", - fontfamily: "font-family", - underline: "text-decoration", - strikethrough: "text-decoration", - fontborder: "border" - }, - needCmd = { underline: 1, strikethrough: 1, fontborder: 1 }, - needSetChild = { - forecolor: "color", - backcolor: "background-color", - fontsize: "font-size", - fontfamily: "font-family" - }; - me.setOpt({ - fontfamily: [ - { name: "songti", val: "宋体,SimSun" }, - { name: "yahei", val: "微软雅黑,Microsoft YaHei" }, - { name: "kaiti", val: "楷体,楷体_GB2312, SimKai" }, - { name: "heiti", val: "黑体, SimHei" }, - { name: "lishu", val: "隶书, SimLi" }, - { name: "andaleMono", val: "andale mono" }, - { name: "arial", val: "arial, helvetica,sans-serif" }, - { name: "arialBlack", val: "arial black,avant garde" }, - { name: "comicSansMs", val: "comic sans ms" }, - { name: "impact", val: "impact,chicago" }, - { name: "timesNewRoman", val: "times new roman" } - ], - fontsize: [10, 11, 12, 14, 16, 18, 20, 24, 36] - }); - - function mergeWithParent(node) { - var parent; - while ((parent = node.parentNode)) { - if ( - parent.tagName == "SPAN" && - domUtils.getChildCount(parent, function(child) { - return !domUtils.isBookmarkNode(child) && !domUtils.isBr(child); - }) == 1 - ) { - parent.style.cssText += node.style.cssText; - domUtils.remove(node, true); - node = parent; - } else { - break; - } - } - } - function mergeChild(rng, cmdName, value) { - if (needSetChild[cmdName]) { - rng.adjustmentBoundary(); - if (!rng.collapsed && rng.startContainer.nodeType == 1) { - rng.traversal(function(node){ - var start; - if(domUtils.isTagNode(node,'span')){ - start = node; - }else{ - start = domUtils.getElementsByTagName(node,'span')[0]; - } - if (start && domUtils.isTagNode(start, "span")) { - var bk = rng.createBookmark(); - utils.each(domUtils.getElementsByTagName(start, "span"), function( - span - ) { - if (!span.parentNode || domUtils.isBookmarkNode(span)) return; - if ( - cmdName == "backcolor" && - domUtils - .getComputedStyle(span, "background-color") - .toLowerCase() === value - ) { - return; - } - domUtils.removeStyle(span, needSetChild[cmdName]); - if (span.style.cssText.replace(/^\s+$/, "").length == 0) { - domUtils.remove(span, true); - } - }); - rng.moveToBookmark(bk); - } - }); - } - } - } - function mergesibling(rng, cmdName, value) { - var collapsed = rng.collapsed, - bk = rng.createBookmark(), - common; - if (collapsed) { - common = bk.start.parentNode; - while (dtd.$inline[common.tagName]) { - common = common.parentNode; - } - } else { - common = domUtils.getCommonAncestor(bk.start, bk.end); - } - utils.each(domUtils.getElementsByTagName(common, "span"), function(span) { - if (!span.parentNode || domUtils.isBookmarkNode(span)) return; - if (/\s*border\s*:\s*none;?\s*/i.test(span.style.cssText)) { - if (/^\s*border\s*:\s*none;?\s*$/.test(span.style.cssText)) { - domUtils.remove(span, true); - } else { - domUtils.removeStyle(span, "border"); - } - return; - } - if ( - /border/i.test(span.style.cssText) && - span.parentNode.tagName == "SPAN" && - /border/i.test(span.parentNode.style.cssText) - ) { - span.style.cssText = span.style.cssText.replace( - /border[^:]*:[^;]+;?/gi, - "" - ); - } - if (!(cmdName == "fontborder" && value == "none")) { - var next = span.nextSibling; - while (next && next.nodeType == 1 && next.tagName == "SPAN") { - if (domUtils.isBookmarkNode(next) && cmdName == "fontborder") { - span.appendChild(next); - next = span.nextSibling; - continue; - } - if (next.style.cssText == span.style.cssText) { - domUtils.moveChild(next, span); - domUtils.remove(next); - } - if (span.nextSibling === next) break; - next = span.nextSibling; - } - } - - mergeWithParent(span); - if (browser.ie && browser.version > 8) { - //拷贝父亲们的特别的属性,这里只做背景颜色的处理 - var parent = domUtils.findParent(span, function(n) { - return ( - n.tagName == "SPAN" && /background-color/.test(n.style.cssText) - ); - }); - if (parent && !/background-color/.test(span.style.cssText)) { - span.style.backgroundColor = parent.style.backgroundColor; - } - } - }); - rng.moveToBookmark(bk); - mergeChild(rng, cmdName, value); - } - - me.addInputRule(function(root) { - utils.each(root.getNodesByTagName("u s del font strike"), function(node) { - if (node.tagName == "font") { - var cssStyle = []; - for (var p in node.attrs) { - switch (p) { - case "size": - cssStyle.push( - "font-size:" + - ({ - "1": "10", - "2": "12", - "3": "16", - "4": "18", - "5": "24", - "6": "32", - "7": "48" - }[node.attrs[p]] || node.attrs[p]) + - "px" - ); - break; - case "color": - cssStyle.push("color:" + node.attrs[p]); - break; - case "face": - cssStyle.push("font-family:" + node.attrs[p]); - break; - case "style": - cssStyle.push(node.attrs[p]); - } - } - node.attrs = { - style: cssStyle.join(";") - }; - } else { - var val = node.tagName == "u" ? "underline" : "line-through"; - node.attrs = { - style: (node.getAttr("style") || "") + "text-decoration:" + val + ";" - }; - } - node.tagName = "span"; - }); - // utils.each(root.getNodesByTagName('span'), function (node) { - // var val; - // if(val = node.getAttr('class')){ - // if(/fontstrikethrough/.test(val)){ - // node.setStyle('text-decoration','line-through'); - // if(node.attrs['class']){ - // node.attrs['class'] = node.attrs['class'].replace(/fontstrikethrough/,''); - // }else{ - // node.setAttr('class') - // } - // } - // if(/fontborder/.test(val)){ - // node.setStyle('border','1px solid #000'); - // if(node.attrs['class']){ - // node.attrs['class'] = node.attrs['class'].replace(/fontborder/,''); - // }else{ - // node.setAttr('class') - // } - // } - // } - // }); - }); - // me.addOutputRule(function(root){ - // utils.each(root.getNodesByTagName('span'), function (node) { - // var val; - // if(val = node.getStyle('text-decoration')){ - // if(/line-through/.test(val)){ - // if(node.attrs['class']){ - // node.attrs['class'] += ' fontstrikethrough'; - // }else{ - // node.setAttr('class','fontstrikethrough') - // } - // } - // - // node.setStyle('text-decoration') - // } - // if(val = node.getStyle('border')){ - // if(/1px/.test(val) && /solid/.test(val)){ - // if(node.attrs['class']){ - // node.attrs['class'] += ' fontborder'; - // - // }else{ - // node.setAttr('class','fontborder') - // } - // } - // node.setStyle('border') - // - // } - // }); - // }); - for (var p in fonts) { - (function(cmd, style) { - UE.commands[cmd] = { - execCommand: function(cmdName, value) { - value = - value || - (this.queryCommandState(cmdName) - ? "none" - : cmdName == "underline" - ? "underline" - : cmdName == "fontborder" ? "1px solid #000" : "line-through"); - var me = this, - range = this.selection.getRange(), - text; - - if (value == "default") { - if (range.collapsed) { - text = me.document.createTextNode("font"); - range.insertNode(text).select(); - } - me.execCommand("removeFormat", "span,a", style); - if (text) { - range.setStartBefore(text).collapse(true); - domUtils.remove(text); - } - mergesibling(range, cmdName, value); - range.select(); - } else { - if (!range.collapsed) { - if (needCmd[cmd] && me.queryCommandValue(cmd)) { - me.execCommand("removeFormat", "span,a", style); - } - range = me.selection.getRange(); - - range.applyInlineStyle("span", { style: style + ":" + value }); - mergesibling(range, cmdName, value); - range.select(); - } else { - var span = domUtils.findParentByTagName( - range.startContainer, - "span", - true - ); - text = me.document.createTextNode("font"); - if ( - span && - !span.children.length && - !span[browser.ie ? "innerText" : "textContent"].replace( - fillCharReg, - "" - ).length - ) { - //for ie hack when enter - range.insertNode(text); - if (needCmd[cmd]) { - range.selectNode(text).select(); - me.execCommand("removeFormat", "span,a", style, null); - - span = domUtils.findParentByTagName(text, "span", true); - range.setStartBefore(text); - } - span && (span.style.cssText += ";" + style + ":" + value); - range.collapse(true).select(); - } else { - range.insertNode(text); - range.selectNode(text).select(); - span = range.document.createElement("span"); - - if (needCmd[cmd]) { - //a标签内的不处理跳过 - if (domUtils.findParentByTagName(text, "a", true)) { - range.setStartBefore(text).setCursor(); - domUtils.remove(text); - return; - } - me.execCommand("removeFormat", "span,a", style); - } - - span.style.cssText = style + ":" + value; - - text.parentNode.insertBefore(span, text); - //修复,span套span 但样式不继承的问题 - if (!browser.ie || (browser.ie && browser.version == 9)) { - var spanParent = span.parentNode; - while (!domUtils.isBlockElm(spanParent)) { - if (spanParent.tagName == "SPAN") { - //opera合并style不会加入";" - span.style.cssText = - spanParent.style.cssText + ";" + span.style.cssText; - } - spanParent = spanParent.parentNode; - } - } - - if (opera) { - setTimeout(function() { - range.setStart(span, 0).collapse(true); - mergesibling(range, cmdName, value); - range.select(); - }); - } else { - range.setStart(span, 0).collapse(true); - mergesibling(range, cmdName, value); - range.select(); - } - - //trace:981 - //domUtils.mergeToParent(span) - } - domUtils.remove(text); - } - } - return true; - }, - queryCommandValue: function(cmdName) { - var startNode = this.selection.getStart(); - - //trace:946 - if (cmdName == "underline" || cmdName == "strikethrough") { - var tmpNode = startNode, - value; - while ( - tmpNode && - !domUtils.isBlockElm(tmpNode) && - !domUtils.isBody(tmpNode) - ) { - if (tmpNode.nodeType == 1) { - value = domUtils.getComputedStyle(tmpNode, style); - if (value != "none") { - return value; - } - } - - tmpNode = tmpNode.parentNode; - } - return "none"; - } - if (cmdName == "fontborder") { - var tmp = startNode, - val; - while (tmp && dtd.$inline[tmp.tagName]) { - if ((val = domUtils.getComputedStyle(tmp, "border"))) { - if (/1px/.test(val) && /solid/.test(val)) { - return val; - } - } - tmp = tmp.parentNode; - } - return ""; - } - - if (cmdName == "FontSize") { - var styleVal = domUtils.getComputedStyle(startNode, style), - tmp = /^([\d\.]+)(\w+)$/.exec(styleVal); - - if (tmp) { - return Math.floor(tmp[1]) + tmp[2]; - } - - return styleVal; - } - - return domUtils.getComputedStyle(startNode, style); - }, - queryCommandState: function(cmdName) { - if (!needCmd[cmdName]) return 0; - var val = this.queryCommandValue(cmdName); - if (cmdName == "fontborder") { - return /1px/.test(val) && /solid/.test(val); - } else { - return cmdName == "underline" - ? /underline/.test(val) - : /line\-through/.test(val); - } - } - }; - })(p, fonts[p]); - } -}; - - -// plugins/link.js -/** - * 超链接 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入超链接 - * @command link - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Object } options 设置自定义属性,例如:url、title、target - * @example - * ```javascript - * editor.execCommand( 'link', '{ - * url:'neditor.baidu.com', - * title:'neditor', - * target:'_blank' - * }' ); - * ``` - */ -/** - * 返回当前选中的第一个超链接节点 - * @command link - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { Element } 超链接节点 - * @example - * ```javascript - * editor.queryCommandValue( 'link' ); - * ``` - */ - -/** - * 取消超链接 - * @command unlink - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'unlink'); - * ``` - */ - -UE.plugins["link"] = function() { - function optimize(range) { - var start = range.startContainer, - end = range.endContainer; - - if ((start = domUtils.findParentByTagName(start, "a", true))) { - range.setStartBefore(start); - } - if ((end = domUtils.findParentByTagName(end, "a", true))) { - range.setEndAfter(end); - } - } - - UE.commands["unlink"] = { - execCommand: function() { - var range = this.selection.getRange(), - bookmark; - if ( - range.collapsed && - !domUtils.findParentByTagName(range.startContainer, "a", true) - ) { - return; - } - bookmark = range.createBookmark(); - optimize(range); - range.removeInlineStyle("a").moveToBookmark(bookmark).select(); - }, - queryCommandState: function() { - return !this.highlight && this.queryCommandValue("link") ? 0 : -1; - } - }; - function doLink(range, opt, me) { - var rngClone = range.cloneRange(), - link = me.queryCommandValue("link"); - optimize((range = range.adjustmentBoundary())); - var start = range.startContainer; - if (start.nodeType == 1 && link) { - start = start.childNodes[range.startOffset]; - if ( - start && - start.nodeType == 1 && - start.tagName == "A" && - /^(?:https?|ftp|file)\s*:\s*\/\//.test( - start[browser.ie ? "innerText" : "textContent"] - ) - ) { - start[browser.ie ? "innerText" : "textContent"] = utils.html( - opt.textValue || opt.href - ); - } - } - if (!rngClone.collapsed || link) { - range.removeInlineStyle("a"); - rngClone = range.cloneRange(); - } - - if (rngClone.collapsed) { - var a = range.document.createElement("a"), - text = ""; - if (opt.textValue) { - text = utils.html(opt.textValue); - delete opt.textValue; - } else { - text = utils.html(opt.href); - } - domUtils.setAttributes(a, opt); - start = domUtils.findParentByTagName(rngClone.startContainer, "a", true); - if (start && domUtils.isInNodeEndBoundary(rngClone, start)) { - range.setStartAfter(start).collapse(true); - } - a[browser.ie ? "innerText" : "textContent"] = text; - range.insertNode(a).selectNode(a); - } else { - range.applyInlineStyle("a", opt); - } - } - UE.commands["link"] = { - execCommand: function(cmdName, opt) { - var range; - opt._href && (opt._href = utils.unhtml(opt._href, /[<">]/g)); - opt.href && (opt.href = utils.unhtml(opt.href, /[<">]/g)); - opt.textValue && (opt.textValue = utils.unhtml(opt.textValue, /[<">]/g)); - doLink((range = this.selection.getRange()), opt, this); - //闭合都不加占位符,如果加了会在a后边多个占位符节点,导致a是图片背景组成的列表,出现空白问题 - range.collapse().select(true); - }, - queryCommandValue: function() { - var range = this.selection.getRange(), - node; - if (range.collapsed) { - // node = this.selection.getStart(); - //在ie下getstart()取值偏上了 - node = range.startContainer; - node = node.nodeType == 1 ? node : node.parentNode; - - if ( - node && - (node = domUtils.findParentByTagName(node, "a", true)) && - !domUtils.isInNodeEndBoundary(range, node) - ) { - return node; - } - } else { - //trace:1111 如果是

                      xx

                      startContainer是p就会找不到a - range.shrinkBoundary(); - var start = range.startContainer.nodeType == 3 || - !range.startContainer.childNodes[range.startOffset] - ? range.startContainer - : range.startContainer.childNodes[range.startOffset], - end = range.endContainer.nodeType == 3 || range.endOffset == 0 - ? range.endContainer - : range.endContainer.childNodes[range.endOffset - 1], - common = range.getCommonAncestor(); - node = domUtils.findParentByTagName(common, "a", true); - if (!node && common.nodeType == 1) { - var as = common.getElementsByTagName("a"), - ps, - pe; - - for (var i = 0, ci; (ci = as[i++]); ) { - (ps = domUtils.getPosition(ci, start)), (pe = domUtils.getPosition( - ci, - end - )); - if ( - (ps & domUtils.POSITION_FOLLOWING || - ps & domUtils.POSITION_CONTAINS) && - (pe & domUtils.POSITION_PRECEDING || - pe & domUtils.POSITION_CONTAINS) - ) { - node = ci; - break; - } - } - } - return node; - } - }, - queryCommandState: function() { - //判断如果是视频的话连接不可用 - //fix 853 - var img = this.selection.getRange().getClosedNode(), - flag = - img && - (img.className == "edui-faked-video" || - img.className.indexOf("edui-upload-video") != -1); - return flag ? -1 : 0; - } - }; -}; - - -// plugins/iframe.js -///import core -///import plugins\inserthtml.js -///commands 插入框架 -///commandsName InsertFrame -///commandsTitle 插入Iframe -///commandsDialog dialogs\insertframe - -UE.plugins["insertframe"] = function() { - var me = this; - function deleteIframe() { - me._iframe && delete me._iframe; - } - - me.addListener("selectionchange", function() { - deleteIframe(); - }); -}; - - -// plugins/scrawl.js -///import core -///commands 涂鸦 -///commandsName Scrawl -///commandsTitle 涂鸦 -///commandsDialog dialogs\scrawl -UE.commands["scrawl"] = { - queryCommandState: function() { - return browser.ie && browser.version <= 8 ? -1 : 0; - } -}; - - -// plugins/removeformat.js -/** - * 清除格式 - * @file - * @since 1.2.6.1 - */ - -/** - * 清除文字样式 - * @command removeformat - * @method execCommand - * @param { String } cmd 命令字符串 - * @param {String} tags 以逗号隔开的标签。如:strong - * @param {String} style 样式如:color - * @param {String} attrs 属性如:width - * @example - * ```javascript - * editor.execCommand( 'removeformat', 'strong','color','width' ); - * ``` - */ - -UE.plugins["removeformat"] = function() { - var me = this; - me.setOpt({ - removeFormatTags: - "b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var", - removeFormatAttributes: "class,style,lang,width,height,align,hspace,valign" - }); - me.commands["removeformat"] = { - execCommand: function(cmdName, tags, style, attrs, notIncludeA) { - var tagReg = new RegExp( - "^(?:" + - (tags || this.options.removeFormatTags).replace(/,/g, "|") + - ")$", - "i" - ), - removeFormatAttributes = style - ? [] - : (attrs || this.options.removeFormatAttributes).split(","), - range = new dom.Range(this.document), - bookmark, - node, - parent, - filter = function(node) { - return node.nodeType == 1; - }; - - function isRedundantSpan(node) { - if (node.nodeType == 3 || node.tagName.toLowerCase() != "span") { - return 0; - } - if (browser.ie) { - //ie 下判断实效,所以只能简单用style来判断 - //return node.style.cssText == '' ? 1 : 0; - var attrs = node.attributes; - if (attrs.length) { - for (var i = 0, l = attrs.length; i < l; i++) { - if (attrs[i].specified) { - return 0; - } - } - return 1; - } - } - return !node.attributes.length; - } - function doRemove(range) { - var bookmark1 = range.createBookmark(); - if (range.collapsed) { - range.enlarge(true); - } - - //不能把a标签切了 - if (!notIncludeA) { - var aNode = domUtils.findParentByTagName( - range.startContainer, - "a", - true - ); - if (aNode) { - range.setStartBefore(aNode); - } - - aNode = domUtils.findParentByTagName(range.endContainer, "a", true); - if (aNode) { - range.setEndAfter(aNode); - } - } - - bookmark = range.createBookmark(); - - node = bookmark.start; - - //切开始 - while ((parent = node.parentNode) && !domUtils.isBlockElm(parent)) { - domUtils.breakParent(node, parent); - - domUtils.clearEmptySibling(node); - } - if (bookmark.end) { - //切结束 - node = bookmark.end; - while ((parent = node.parentNode) && !domUtils.isBlockElm(parent)) { - domUtils.breakParent(node, parent); - domUtils.clearEmptySibling(node); - } - - //开始去除样式 - var current = domUtils.getNextDomNode(bookmark.start, false, filter), - next; - while (current) { - if (current == bookmark.end) { - break; - } - - next = domUtils.getNextDomNode(current, true, filter); - - if ( - !dtd.$empty[current.tagName.toLowerCase()] && - !domUtils.isBookmarkNode(current) - ) { - if (tagReg.test(current.tagName)) { - if (style) { - domUtils.removeStyle(current, style); - if (isRedundantSpan(current) && style != "text-decoration") { - domUtils.remove(current, true); - } - } else { - domUtils.remove(current, true); - } - } else { - //trace:939 不能把list上的样式去掉 - if ( - !dtd.$tableContent[current.tagName] && - !dtd.$list[current.tagName] - ) { - domUtils.removeAttributes(current, removeFormatAttributes); - if (isRedundantSpan(current)) { - domUtils.remove(current, true); - } - } - } - } - current = next; - } - } - //trace:1035 - //trace:1096 不能把td上的样式去掉,比如边框 - var pN = bookmark.start.parentNode; - if ( - domUtils.isBlockElm(pN) && - !dtd.$tableContent[pN.tagName] && - !dtd.$list[pN.tagName] - ) { - domUtils.removeAttributes(pN, removeFormatAttributes); - } - pN = bookmark.end.parentNode; - if ( - bookmark.end && - domUtils.isBlockElm(pN) && - !dtd.$tableContent[pN.tagName] && - !dtd.$list[pN.tagName] - ) { - domUtils.removeAttributes(pN, removeFormatAttributes); - } - range.moveToBookmark(bookmark).moveToBookmark(bookmark1); - //清除冗余的代码 - var node = range.startContainer, - tmp, - collapsed = range.collapsed; - while ( - node.nodeType == 1 && - domUtils.isEmptyNode(node) && - dtd.$removeEmpty[node.tagName] - ) { - tmp = node.parentNode; - range.setStartBefore(node); - //trace:937 - //更新结束边界 - if (range.startContainer === range.endContainer) { - range.endOffset--; - } - domUtils.remove(node); - node = tmp; - } - - if (!collapsed) { - node = range.endContainer; - while ( - node.nodeType == 1 && - domUtils.isEmptyNode(node) && - dtd.$removeEmpty[node.tagName] - ) { - tmp = node.parentNode; - range.setEndBefore(node); - domUtils.remove(node); - - node = tmp; - } - } - } - - range = this.selection.getRange(); - doRemove(range); - range.select(); - } - }; -}; - - -// plugins/blockquote.js -/** - * 添加引用 - * @file - * @since 1.2.6.1 - */ - -/** - * 添加引用 - * @command blockquote - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'blockquote' ); - * ``` - */ - -/** - * 添加引用 - * @command blockquote - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Object } attrs 节点属性 - * @example - * ```javascript - * editor.execCommand( 'blockquote',{ - * style: "color: red;" - * } ); - * ``` - */ - -UE.plugins["blockquote"] = function() { - var me = this; - function getObj(editor) { - return domUtils.filterNodeList( - editor.selection.getStartElementPath(), - "blockquote" - ); - } - me.commands["blockquote"] = { - execCommand: function(cmdName, attrs) { - var range = this.selection.getRange(), - obj = getObj(this), - blockquote = dtd.blockquote, - bookmark = range.createBookmark(); - - if (obj) { - var start = range.startContainer, - startBlock = domUtils.isBlockElm(start) - ? start - : domUtils.findParent(start, function(node) { - return domUtils.isBlockElm(node); - }), - end = range.endContainer, - endBlock = domUtils.isBlockElm(end) - ? end - : domUtils.findParent(end, function(node) { - return domUtils.isBlockElm(node); - }); - - //处理一下li - startBlock = - domUtils.findParentByTagName(startBlock, "li", true) || startBlock; - endBlock = - domUtils.findParentByTagName(endBlock, "li", true) || endBlock; - - if ( - startBlock.tagName == "LI" || - startBlock.tagName == "TD" || - startBlock === obj || - domUtils.isBody(startBlock) - ) { - domUtils.remove(obj, true); - } else { - domUtils.breakParent(startBlock, obj); - } - - if (startBlock !== endBlock) { - obj = domUtils.findParentByTagName(endBlock, "blockquote"); - if (obj) { - if ( - endBlock.tagName == "LI" || - endBlock.tagName == "TD" || - domUtils.isBody(endBlock) - ) { - obj.parentNode && domUtils.remove(obj, true); - } else { - domUtils.breakParent(endBlock, obj); - } - } - } - - var blockquotes = domUtils.getElementsByTagName( - this.document, - "blockquote" - ); - for (var i = 0, bi; (bi = blockquotes[i++]); ) { - if (!bi.childNodes.length) { - domUtils.remove(bi); - } else if ( - domUtils.getPosition(bi, startBlock) & - domUtils.POSITION_FOLLOWING && - domUtils.getPosition(bi, endBlock) & domUtils.POSITION_PRECEDING - ) { - domUtils.remove(bi, true); - } - } - } else { - var tmpRange = range.cloneRange(), - node = tmpRange.startContainer.nodeType == 1 - ? tmpRange.startContainer - : tmpRange.startContainer.parentNode, - preNode = node, - doEnd = 1; - - //调整开始 - while (1) { - if (domUtils.isBody(node)) { - if (preNode !== node) { - if (range.collapsed) { - tmpRange.selectNode(preNode); - doEnd = 0; - } else { - tmpRange.setStartBefore(preNode); - } - } else { - tmpRange.setStart(node, 0); - } - - break; - } - if (!blockquote[node.tagName]) { - if (range.collapsed) { - tmpRange.selectNode(preNode); - } else { - tmpRange.setStartBefore(preNode); - } - break; - } - - preNode = node; - node = node.parentNode; - } - - //调整结束 - if (doEnd) { - preNode = node = node = tmpRange.endContainer.nodeType == 1 - ? tmpRange.endContainer - : tmpRange.endContainer.parentNode; - while (1) { - if (domUtils.isBody(node)) { - if (preNode !== node) { - tmpRange.setEndAfter(preNode); - } else { - tmpRange.setEnd(node, node.childNodes.length); - } - - break; - } - if (!blockquote[node.tagName]) { - tmpRange.setEndAfter(preNode); - break; - } - - preNode = node; - node = node.parentNode; - } - } - - node = range.document.createElement("blockquote"); - domUtils.setAttributes(node, attrs); - node.appendChild(tmpRange.extractContents()); - tmpRange.insertNode(node); - //去除重复的 - var childs = domUtils.getElementsByTagName(node, "blockquote"); - for (var i = 0, ci; (ci = childs[i++]); ) { - if (ci.parentNode) { - domUtils.remove(ci, true); - } - } - } - range.moveToBookmark(bookmark).select(); - }, - queryCommandState: function() { - return getObj(this) ? 1 : 0; - } - }; -}; - - -// plugins/convertcase.js -/** - * 大小写转换 - * @file - * @since 1.2.6.1 - */ - -/** - * 把选区内文本变大写,与“tolowercase”命令互斥 - * @command touppercase - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'touppercase' ); - * ``` - */ - -/** - * 把选区内文本变小写,与“touppercase”命令互斥 - * @command tolowercase - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'tolowercase' ); - * ``` - */ -UE.commands["touppercase"] = UE.commands["tolowercase"] = { - execCommand: function(cmd) { - var me = this; - var rng = me.selection.getRange(); - if (rng.collapsed) { - return rng; - } - var bk = rng.createBookmark(), - bkEnd = bk.end, - filterFn = function(node) { - return !domUtils.isBr(node) && !domUtils.isWhitespace(node); - }, - curNode = domUtils.getNextDomNode(bk.start, false, filterFn); - while ( - curNode && - domUtils.getPosition(curNode, bkEnd) & domUtils.POSITION_PRECEDING - ) { - if (curNode.nodeType == 3) { - curNode.nodeValue = curNode.nodeValue[ - cmd == "touppercase" ? "toUpperCase" : "toLowerCase" - ](); - } - curNode = domUtils.getNextDomNode(curNode, true, filterFn); - if (curNode === bkEnd) { - break; - } - } - rng.moveToBookmark(bk).select(); - } -}; - - -// plugins/indent.js -/** - * 首行缩进 - * @file - * @since 1.2.6.1 - */ - -/** - * 缩进 - * @command indent - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'indent' ); - * ``` - */ -UE.commands["indent"] = { - execCommand: function() { - var me = this, - value = me.queryCommandState("indent") - ? "0em" - : me.options.indentValue || "2em"; - me.execCommand("Paragraph", "p", { style: "text-indent:" + value }); - }, - queryCommandState: function() { - var pN = domUtils.filterNodeList( - this.selection.getStartElementPath(), - "p h1 h2 h3 h4 h5 h6" - ); - return pN && pN.style.textIndent && parseInt(pN.style.textIndent) ? 1 : 0; - } -}; - - -// plugins/print.js -/** - * 打印 - * @file - * @since 1.2.6.1 - */ - -/** - * 打印 - * @command print - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'print' ); - * ``` - */ -UE.commands["print"] = { - execCommand: function() { - this.window.print(); - }, - notNeedUndo: 1 -}; - - -// plugins/preview.js -/** - * 预览 - * @file - * @since 1.2.6.1 - */ - -/** - * 预览 - * @command preview - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'preview' ); - * ``` - */ -UE.commands["preview"] = { - execCommand: function() { - var w = window.open("", "_blank", ""), - d = w.document; - d.open(); - d.write( - '
                      " + - this.getContent(null, null, true) + - "
                      " - ); - d.close(); - }, - notNeedUndo: 1 -}; - - -// plugins/selectall.js -/** - * 全选 - * @file - * @since 1.2.6.1 - */ - -/** - * 选中所有内容 - * @command selectall - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'selectall' ); - * ``` - */ -UE.plugins["selectall"] = function() { - var me = this; - me.commands["selectall"] = { - execCommand: function() { - //去掉了原生的selectAll,因为会出现报错和当内容为空时,不能出现闭合状态的光标 - var me = this, - body = me.body, - range = me.selection.getRange(); - range.selectNodeContents(body); - if (domUtils.isEmptyBlock(body)) { - //opera不能自动合并到元素的里边,要手动处理一下 - if (browser.opera && body.firstChild && body.firstChild.nodeType == 1) { - range.setStartAtFirst(body.firstChild); - } - range.collapse(true); - } - range.select(true); - }, - notNeedUndo: 1 - }; - - //快捷键 - me.addshortcutkey({ - selectAll: "ctrl+65" - }); -}; - - -// plugins/paragraph.js -/** - * 段落样式 - * @file - * @since 1.2.6.1 - */ - -/** - * 段落格式 - * @command paragraph - * @method execCommand - * @param { String } cmd 命令字符串 - * @param {String} style 标签值为:'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' - * @param {Object} attrs 标签的属性 - * @example - * ```javascript - * editor.execCommand( 'Paragraph','h1','{ - * class:'test' - * }' ); - * ``` - */ - -/** - * 返回选区内节点标签名 - * @command paragraph - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 节点标签名 - * @example - * ```javascript - * editor.queryCommandValue( 'Paragraph' ); - * ``` - */ - -UE.plugins["paragraph"] = function() { - var me = this, - block = domUtils.isBlockElm, - notExchange = ["TD", "LI", "PRE"], - doParagraph = function(range, style, attrs, sourceCmdName) { - var bookmark = range.createBookmark(), - filterFn = function(node) { - return node.nodeType == 1 - ? node.tagName.toLowerCase() != "br" && - !domUtils.isBookmarkNode(node) - : !domUtils.isWhitespace(node); - }, - para; - - range.enlarge(true); - var bookmark2 = range.createBookmark(), - current = domUtils.getNextDomNode(bookmark2.start, false, filterFn), - tmpRange = range.cloneRange(), - tmpNode; - while ( - current && - !( - domUtils.getPosition(current, bookmark2.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - if (current.nodeType == 3 || !block(current)) { - tmpRange.setStartBefore(current); - while (current && current !== bookmark2.end && !block(current)) { - tmpNode = current; - current = domUtils.getNextDomNode(current, false, null, function( - node - ) { - return !block(node); - }); - } - tmpRange.setEndAfter(tmpNode); - - para = range.document.createElement(style); - if (attrs) { - domUtils.setAttributes(para, attrs); - if ( - sourceCmdName && - sourceCmdName == "customstyle" && - attrs.style - ) { - para.style.cssText = attrs.style; - } - } - para.appendChild(tmpRange.extractContents()); - //需要内容占位 - if (domUtils.isEmptyNode(para)) { - domUtils.fillChar(range.document, para); - } - - tmpRange.insertNode(para); - - var parent = para.parentNode; - //如果para上一级是一个block元素且不是body,td就删除它 - if ( - block(parent) && - !domUtils.isBody(para.parentNode) && - utils.indexOf(notExchange, parent.tagName) == -1 - ) { - //存储dir,style - if (!(sourceCmdName && sourceCmdName == "customstyle")) { - parent.getAttribute("dir") && - para.setAttribute("dir", parent.getAttribute("dir")); - //trace:1070 - parent.style.cssText && - (para.style.cssText = - parent.style.cssText + ";" + para.style.cssText); - //trace:1030 - parent.style.textAlign && - !para.style.textAlign && - (para.style.textAlign = parent.style.textAlign); - parent.style.textIndent && - !para.style.textIndent && - (para.style.textIndent = parent.style.textIndent); - parent.style.padding && - !para.style.padding && - (para.style.padding = parent.style.padding); - } - - //trace:1706 选择的就是h1-6要删除 - if ( - attrs && - /h\d/i.test(parent.tagName) && - !/h\d/i.test(para.tagName) - ) { - domUtils.setAttributes(parent, attrs); - if ( - sourceCmdName && - sourceCmdName == "customstyle" && - attrs.style - ) { - parent.style.cssText = attrs.style; - } - domUtils.remove(para.parentNode, true); - para = parent; - } else { - domUtils.remove(para.parentNode, true); - } - } - if (utils.indexOf(notExchange, parent.tagName) != -1) { - current = parent; - } else { - current = para; - } - - current = domUtils.getNextDomNode(current, false, filterFn); - } else { - current = domUtils.getNextDomNode(current, true, filterFn); - } - } - return range.moveToBookmark(bookmark2).moveToBookmark(bookmark); - }; - me.setOpt("paragraph", { - p: "", - h1: "", - h2: "", - h3: "", - h4: "", - h5: "", - h6: "" - }); - me.commands["paragraph"] = { - execCommand: function(cmdName, style, attrs, sourceCmdName) { - var range = this.selection.getRange(); - //闭合时单独处理 - if (range.collapsed) { - var txt = this.document.createTextNode("p"); - range.insertNode(txt); - //去掉冗余的fillchar - if (browser.ie) { - var node = txt.previousSibling; - if (node && domUtils.isWhitespace(node)) { - domUtils.remove(node); - } - node = txt.nextSibling; - if (node && domUtils.isWhitespace(node)) { - domUtils.remove(node); - } - } - } - range = doParagraph(range, style, attrs, sourceCmdName); - if (txt) { - range.setStartBefore(txt).collapse(true); - pN = txt.parentNode; - - domUtils.remove(txt); - - if (domUtils.isBlockElm(pN) && domUtils.isEmptyNode(pN)) { - domUtils.fillNode(this.document, pN); - } - } - - if ( - browser.gecko && - range.collapsed && - range.startContainer.nodeType == 1 - ) { - var child = range.startContainer.childNodes[range.startOffset]; - if ( - child && - child.nodeType == 1 && - child.tagName.toLowerCase() == style - ) { - range.setStart(child, 0).collapse(true); - } - } - //trace:1097 原来有true,原因忘了,但去了就不能清除多余的占位符了 - range.select(); - - return true; - }, - queryCommandValue: function() { - var node = domUtils.filterNodeList( - this.selection.getStartElementPath(), - "p h1 h2 h3 h4 h5 h6" - ); - return node ? node.tagName.toLowerCase() : ""; - } - }; -}; - - -// plugins/directionality.js -/** - * 设置文字输入的方向的插件 - * @file - * @since 1.2.6.1 - */ -;(function() { - var block = domUtils.isBlockElm, - getObj = function(editor) { - // var startNode = editor.selection.getStart(), - // parents; - // if ( startNode ) { - // //查找所有的是block的父亲节点 - // parents = domUtils.findParents( startNode, true, block, true ); - // for ( var i = 0,ci; ci = parents[i++]; ) { - // if ( ci.getAttribute( 'dir' ) ) { - // return ci; - // } - // } - // } - return domUtils.filterNodeList( - editor.selection.getStartElementPath(), - function(n) { - return n && n.nodeType == 1 && n.getAttribute("dir"); - } - ); - }, - doDirectionality = function(range, editor, forward) { - var bookmark, - filterFn = function(node) { - return node.nodeType == 1 - ? !domUtils.isBookmarkNode(node) - : !domUtils.isWhitespace(node); - }, - obj = getObj(editor); - - if (obj && range.collapsed) { - obj.setAttribute("dir", forward); - return range; - } - bookmark = range.createBookmark(); - range.enlarge(true); - var bookmark2 = range.createBookmark(), - current = domUtils.getNextDomNode(bookmark2.start, false, filterFn), - tmpRange = range.cloneRange(), - tmpNode; - while ( - current && - !( - domUtils.getPosition(current, bookmark2.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - if (current.nodeType == 3 || !block(current)) { - tmpRange.setStartBefore(current); - while (current && current !== bookmark2.end && !block(current)) { - tmpNode = current; - current = domUtils.getNextDomNode(current, false, null, function( - node - ) { - return !block(node); - }); - } - tmpRange.setEndAfter(tmpNode); - var common = tmpRange.getCommonAncestor(); - if (!domUtils.isBody(common) && block(common)) { - //遍历到了block节点 - common.setAttribute("dir", forward); - current = common; - } else { - //没有遍历到,添加一个block节点 - var p = range.document.createElement("p"); - p.setAttribute("dir", forward); - var frag = tmpRange.extractContents(); - p.appendChild(frag); - tmpRange.insertNode(p); - current = p; - } - - current = domUtils.getNextDomNode(current, false, filterFn); - } else { - current = domUtils.getNextDomNode(current, true, filterFn); - } - } - return range.moveToBookmark(bookmark2).moveToBookmark(bookmark); - }; - - /** - * 文字输入方向 - * @command directionality - * @method execCommand - * @param { String } cmdName 命令字符串 - * @param { String } forward 传入'ltr'表示从左向右输入,传入'rtl'表示从右向左输入 - * @example - * ```javascript - * editor.execCommand( 'directionality', 'ltr'); - * ``` - */ - - /** - * 查询当前选区的文字输入方向 - * @command directionality - * @method queryCommandValue - * @param { String } cmdName 命令字符串 - * @return { String } 返回'ltr'表示从左向右输入,返回'rtl'表示从右向左输入 - * @example - * ```javascript - * editor.queryCommandValue( 'directionality'); - * ``` - */ - UE.commands["directionality"] = { - execCommand: function(cmdName, forward) { - var range = this.selection.getRange(); - //闭合时单独处理 - if (range.collapsed) { - var txt = this.document.createTextNode("d"); - range.insertNode(txt); - } - doDirectionality(range, this, forward); - if (txt) { - range.setStartBefore(txt).collapse(true); - domUtils.remove(txt); - } - - range.select(); - return true; - }, - queryCommandValue: function() { - var node = getObj(this); - return node ? node.getAttribute("dir") : "ltr"; - } - }; -})(); - - -// plugins/horizontal.js -/** - * 插入分割线插件 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入分割线 - * @command horizontal - * @method execCommand - * @param { String } cmdName 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'horizontal' ); - * ``` - */ -UE.plugins["horizontal"] = function() { - var me = this; - me.commands["horizontal"] = { - execCommand: function(cmdName) { - var me = this; - if (me.queryCommandState(cmdName) !== -1) { - me.execCommand("insertHtml", "
                      "); - var range = me.selection.getRange(), - start = range.startContainer; - if (start.nodeType == 1 && !start.childNodes[range.startOffset]) { - var tmp; - if ((tmp = start.childNodes[range.startOffset - 1])) { - if (tmp.nodeType == 1 && tmp.tagName == "HR") { - if (me.options.enterTag == "p") { - tmp = me.document.createElement("p"); - range.insertNode(tmp); - range.setStart(tmp, 0).setCursor(); - } else { - tmp = me.document.createElement("br"); - range.insertNode(tmp); - range.setStartBefore(tmp).setCursor(); - } - } - } - } - return true; - } - }, - //边界在table里不能加分隔线 - queryCommandState: function() { - return domUtils.filterNodeList( - this.selection.getStartElementPath(), - "table" - ) - ? -1 - : 0; - } - }; - // me.addListener('delkeyup',function(){ - // var rng = this.selection.getRange(); - // if(browser.ie && browser.version > 8){ - // rng.txtToElmBoundary(true); - // if(domUtils.isStartInblock(rng)){ - // var tmpNode = rng.startContainer; - // var pre = tmpNode.previousSibling; - // if(pre && domUtils.isTagNode(pre,'hr')){ - // domUtils.remove(pre); - // rng.select(); - // return; - // } - // } - // } - // if(domUtils.isBody(rng.startContainer)){ - // var hr = rng.startContainer.childNodes[rng.startOffset -1]; - // if(hr && hr.nodeName == 'HR'){ - // var next = hr.nextSibling; - // if(next){ - // rng.setStart(next,0) - // }else if(hr.previousSibling){ - // rng.setStartAtLast(hr.previousSibling) - // }else{ - // var p = this.document.createElement('p'); - // hr.parentNode.insertBefore(p,hr); - // domUtils.fillNode(this.document,p); - // rng.setStart(p,0); - // } - // domUtils.remove(hr); - // rng.setCursor(false,true); - // } - // } - // }) - me.addListener("delkeydown", function(name, evt) { - var rng = this.selection.getRange(); - rng.txtToElmBoundary(true); - if (domUtils.isStartInblock(rng)) { - var tmpNode = rng.startContainer; - var pre = tmpNode.previousSibling; - if (pre && domUtils.isTagNode(pre, "hr")) { - domUtils.remove(pre); - rng.select(); - domUtils.preventDefault(evt); - return true; - } - } - }); -}; - - -// plugins/time.js -/** - * 插入时间和日期 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入时间,默认格式:12:59:59 - * @command time - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'time'); - * ``` - */ - -/** - * 插入日期,默认格式:2013-08-30 - * @command date - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'date'); - * ``` - */ -UE.commands["time"] = UE.commands["date"] = { - execCommand: function(cmd, format) { - var date = new Date(); - - function formatTime(date, format) { - var hh = ("0" + date.getHours()).slice(-2), - ii = ("0" + date.getMinutes()).slice(-2), - ss = ("0" + date.getSeconds()).slice(-2); - format = format || "hh:ii:ss"; - return format.replace(/hh/gi, hh).replace(/ii/gi, ii).replace(/ss/gi, ss); - } - function formatDate(date, format) { - var yyyy = ("000" + date.getFullYear()).slice(-4), - yy = yyyy.slice(-2), - mm = ("0" + (date.getMonth() + 1)).slice(-2), - dd = ("0" + date.getDate()).slice(-2); - format = format || "yyyy-mm-dd"; - return format - .replace(/yyyy/gi, yyyy) - .replace(/yy/gi, yy) - .replace(/mm/gi, mm) - .replace(/dd/gi, dd); - } - - this.execCommand( - "insertHtml", - cmd == "time" ? formatTime(date, format) : formatDate(date, format) - ); - } -}; - - -// plugins/rowspacing.js -/** - * 段前段后间距插件 - * @file - * @since 1.2.6.1 - */ - -/** - * 设置段间距 - * @command rowspacing - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } value 段间距的值,以px为单位 - * @param { String } dir 间距位置,top或bottom,分别表示段前和段后 - * @example - * ```javascript - * editor.execCommand( 'rowspacing', '10', 'top' ); - * ``` - */ - -UE.plugins["rowspacing"] = function() { - var me = this; - me.setOpt({ - rowspacingtop: ["5", "10", "15", "20", "25"], - rowspacingbottom: ["5", "10", "15", "20", "25"] - }); - me.commands["rowspacing"] = { - execCommand: function(cmdName, value, dir) { - this.execCommand("paragraph", "p", { - style: "margin-" + dir + ":" + value + "px" - }); - return true; - }, - queryCommandValue: function(cmdName, dir) { - var pN = domUtils.filterNodeList( - this.selection.getStartElementPath(), - function(node) { - return domUtils.isBlockElm(node); - } - ), - value; - //trace:1026 - if (pN) { - value = domUtils - .getComputedStyle(pN, "margin-" + dir) - .replace(/[^\d]/g, ""); - return !value ? 0 : value; - } - return 0; - } - }; -}; - - -// plugins/lineheight.js -/** - * 设置行内间距 - * @file - * @since 1.2.6.1 - */ -UE.plugins["lineheight"] = function() { - var me = this; - me.setOpt({ lineheight: ["1", "1.5", "1.75", "2", "3", "4", "5"] }); - - /** - * 行距 - * @command lineheight - * @method execCommand - * @param { String } cmdName 命令字符串 - * @param { String } value 传入的行高值, 该值是当前字体的倍数, 例如: 1.5, 1.75 - * @example - * ```javascript - * editor.execCommand( 'lineheight', 1.5); - * ``` - */ - /** - * 查询当前选区内容的行高大小 - * @command lineheight - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回当前行高大小 - * @example - * ```javascript - * editor.queryCommandValue( 'lineheight' ); - * ``` - */ - - me.commands["lineheight"] = { - execCommand: function(cmdName, value) { - this.execCommand("paragraph", "p", { - style: "line-height:" + (value == "1" ? "normal" : value + "em") - }); - return true; - }, - queryCommandValue: function() { - var pN = domUtils.filterNodeList( - this.selection.getStartElementPath(), - function(node) { - return domUtils.isBlockElm(node); - } - ); - if (pN) { - var value = domUtils.getComputedStyle(pN, "line-height"); - return value == "normal" ? 1 : value.replace(/[^\d.]*/gi, ""); - } - } - }; -}; - - -// plugins/insertcode.js -/** - * 插入代码插件 - * @file - * @since 1.2.6.1 - */ - -UE.plugins["insertcode"] = function() { - var me = this; - me.ready(function() { - utils.cssRule( - "pre", - "pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}", - me.document - ); - }); - me.setOpt("insertcode", { - as3: "ActionScript3", - bash: "Bash/Shell", - cpp: "C/C++", - css: "Css", - cf: "CodeFunction", - "c#": "C#", - delphi: "Delphi", - diff: "Diff", - erlang: "Erlang", - groovy: "Groovy", - html: "Html", - java: "Java", - jfx: "JavaFx", - js: "Javascript", - pl: "Perl", - php: "Php", - plain: "Plain Text", - ps: "PowerShell", - python: "Python", - ruby: "Ruby", - scala: "Scala", - sql: "Sql", - vb: "Vb", - xml: "Xml" - }); - - /** - * 插入代码 - * @command insertcode - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } lang 插入代码的语言 - * @example - * ```javascript - * editor.execCommand( 'insertcode', 'javascript' ); - * ``` - */ - - /** - * 如果选区所在位置是插入插入代码区域,返回代码的语言 - * @command insertcode - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回代码的语言 - * @example - * ```javascript - * editor.queryCommandValue( 'insertcode' ); - * ``` - */ - - me.commands["insertcode"] = { - execCommand: function(cmd, lang) { - var me = this, - rng = me.selection.getRange(), - pre = domUtils.findParentByTagName(rng.startContainer, "pre", true); - if (pre) { - pre.className = "brush:" + lang + ";toolbar:false;"; - } else { - var code = ""; - if (rng.collapsed) { - code = browser.ie && browser.ie11below - ? browser.version <= 8 ? " " : "" - : "
                      "; - } else { - var frag = rng.extractContents(); - var div = me.document.createElement("div"); - div.appendChild(frag); - - utils.each( - UE.filterNode( - UE.htmlparser(div.innerHTML.replace(/[\r\t]/g, "")), - me.options.filterTxtRules - ).children, - function(node) { - if (browser.ie && browser.ie11below && browser.version > 8) { - if (node.type == "element") { - if (node.tagName == "br") { - code += "\n"; - } else if (!dtd.$empty[node.tagName]) { - utils.each(node.children, function(cn) { - if (cn.type == "element") { - if (cn.tagName == "br") { - code += "\n"; - } else if (!dtd.$empty[node.tagName]) { - code += cn.innerText(); - } - } else { - code += cn.data; - } - }); - if (!/\n$/.test(code)) { - code += "\n"; - } - } - } else { - code += node.data + "\n"; - } - if (!node.nextSibling() && /\n$/.test(code)) { - code = code.replace(/\n$/, ""); - } - } else { - if (browser.ie && browser.ie11below) { - if (node.type == "element") { - if (node.tagName == "br") { - code += "
                      "; - } else if (!dtd.$empty[node.tagName]) { - utils.each(node.children, function(cn) { - if (cn.type == "element") { - if (cn.tagName == "br") { - code += "
                      "; - } else if (!dtd.$empty[node.tagName]) { - code += cn.innerText(); - } - } else { - code += cn.data; - } - }); - if (!/br>$/.test(code)) { - code += "
                      "; - } - } - } else { - code += node.data + "
                      "; - } - if (!node.nextSibling() && /
                      $/.test(code)) { - code = code.replace(/
                      $/, ""); - } - } else { - code += node.type == "element" - ? dtd.$empty[node.tagName] ? "" : node.innerText() - : node.data; - if (!/br\/?\s*>$/.test(code)) { - if (!node.nextSibling()) return; - code += "
                      "; - } - } - } - } - ); - } - me.execCommand( - "inserthtml", - '
                      ' +
                      -            code +
                      -            "
                      ", - true - ); - - pre = me.document.getElementById("coder"); - domUtils.removeAttributes(pre, "id"); - var tmpNode = pre.previousSibling; - - if ( - tmpNode && - ((tmpNode.nodeType == 3 && - tmpNode.nodeValue.length == 1 && - browser.ie && - browser.version == 6) || - domUtils.isEmptyBlock(tmpNode)) - ) { - domUtils.remove(tmpNode); - } - var rng = me.selection.getRange(); - if (domUtils.isEmptyBlock(pre)) { - rng.setStart(pre, 0).setCursor(false, true); - } else { - rng.selectNodeContents(pre).select(); - } - } - }, - queryCommandValue: function() { - var path = this.selection.getStartElementPath(); - var lang = ""; - utils.each(path, function(node) { - if (node.nodeName == "PRE") { - var match = node.className.match(/brush:([^;]+)/); - lang = match && match[1] ? match[1] : ""; - return false; - } - }); - return lang; - } - }; - - me.addInputRule(function(root) { - utils.each(root.getNodesByTagName("pre"), function(pre) { - var brs = pre.getNodesByTagName("br"); - if (brs.length) { - browser.ie && - browser.ie11below && - browser.version > 8 && - utils.each(brs, function(br) { - var txt = UE.uNode.createText("\n"); - br.parentNode.insertBefore(txt, br); - br.parentNode.removeChild(br); - }); - return; - } - if (browser.ie && browser.ie11below && browser.version > 8) return; - var code = pre.innerText().split(/\n/); - pre.innerHTML(""); - utils.each(code, function(c) { - if (c.length) { - pre.appendChild(UE.uNode.createText(c)); - } - pre.appendChild(UE.uNode.createElement("br")); - }); - }); - }); - me.addOutputRule(function(root) { - utils.each(root.getNodesByTagName("pre"), function(pre) { - var code = ""; - utils.each(pre.children, function(n) { - if (n.type == "text") { - //在ie下文本内容有可能末尾带有\n要去掉 - //trace:3396 - code += n.data.replace(/[ ]/g, " ").replace(/\n$/, ""); - } else { - if (n.tagName == "br") { - code += "\n"; - } else { - code += !dtd.$empty[n.tagName] ? "" : n.innerText(); - } - } - }); - - pre.innerText(code.replace(/( |\n)+$/, "")); - }); - }); - //不需要判断highlight的command列表 - me.notNeedCodeQuery = { - help: 1, - undo: 1, - redo: 1, - source: 1, - print: 1, - searchreplace: 1, - fullscreen: 1, - preview: 1, - insertparagraph: 1, - elementpath: 1, - insertcode: 1, - inserthtml: 1, - selectall: 1 - }; - //将queyCommamndState重置 - var orgQuery = me.queryCommandState; - me.queryCommandState = function(cmd) { - var me = this; - - if ( - !me.notNeedCodeQuery[cmd.toLowerCase()] && - me.selection && - me.queryCommandValue("insertcode") - ) { - return -1; - } - return UE.Editor.prototype.queryCommandState.apply(this, arguments); - }; - me.addListener("beforeenterkeydown", function() { - var rng = me.selection.getRange(); - var pre = domUtils.findParentByTagName(rng.startContainer, "pre", true); - if (pre) { - me.fireEvent("saveScene"); - if (!rng.collapsed) { - rng.deleteContents(); - } - if (!browser.ie || browser.ie9above) { - var tmpNode = me.document.createElement("br"), - pre; - rng.insertNode(tmpNode).setStartAfter(tmpNode).collapse(true); - var next = tmpNode.nextSibling; - if (!next && (!browser.ie || browser.version > 10)) { - rng.insertNode(tmpNode.cloneNode(false)); - } else { - rng.setStartAfter(tmpNode); - } - pre = tmpNode.previousSibling; - var tmp; - while (pre) { - tmp = pre; - pre = pre.previousSibling; - if (!pre || pre.nodeName == "BR") { - pre = tmp; - break; - } - } - if (pre) { - var str = ""; - while ( - pre && - pre.nodeName != "BR" && - new RegExp("^[\\s" + domUtils.fillChar + "]*$").test(pre.nodeValue) - ) { - str += pre.nodeValue; - pre = pre.nextSibling; - } - if (pre.nodeName != "BR") { - var match = pre.nodeValue.match( - new RegExp("^([\\s" + domUtils.fillChar + "]+)") - ); - if (match && match[1]) { - str += match[1]; - } - } - if (str) { - str = me.document.createTextNode(str); - rng.insertNode(str).setStartAfter(str); - } - } - rng.collapse(true).select(true); - } else { - if (browser.version > 8) { - var txt = me.document.createTextNode("\n"); - var start = rng.startContainer; - if (rng.startOffset == 0) { - var preNode = start.previousSibling; - if (preNode) { - rng.insertNode(txt); - var fillchar = me.document.createTextNode(" "); - rng - .setStartAfter(txt) - .insertNode(fillchar) - .setStart(fillchar, 0) - .collapse(true) - .select(true); - } - } else { - rng.insertNode(txt).setStartAfter(txt); - var fillchar = me.document.createTextNode(" "); - start = rng.startContainer.childNodes[rng.startOffset]; - if (start && !/^\n/.test(start.nodeValue)) { - rng.setStartBefore(txt); - } - rng - .insertNode(fillchar) - .setStart(fillchar, 0) - .collapse(true) - .select(true); - } - } else { - var tmpNode = me.document.createElement("br"); - rng.insertNode(tmpNode); - rng.insertNode(me.document.createTextNode(domUtils.fillChar)); - rng.setStartAfter(tmpNode); - pre = tmpNode.previousSibling; - var tmp; - while (pre) { - tmp = pre; - pre = pre.previousSibling; - if (!pre || pre.nodeName == "BR") { - pre = tmp; - break; - } - } - if (pre) { - var str = ""; - while ( - pre && - pre.nodeName != "BR" && - new RegExp("^[ " + domUtils.fillChar + "]*$").test(pre.nodeValue) - ) { - str += pre.nodeValue; - pre = pre.nextSibling; - } - if (pre.nodeName != "BR") { - var match = pre.nodeValue.match( - new RegExp("^([ " + domUtils.fillChar + "]+)") - ); - if (match && match[1]) { - str += match[1]; - } - } - - str = me.document.createTextNode(str); - rng.insertNode(str).setStartAfter(str); - } - rng.collapse(true).select(); - } - } - me.fireEvent("saveScene"); - return true; - } - }); - - me.addListener("tabkeydown", function(cmd, evt) { - var rng = me.selection.getRange(); - var pre = domUtils.findParentByTagName(rng.startContainer, "pre", true); - if (pre) { - me.fireEvent("saveScene"); - if (evt.shiftKey) { - } else { - if (!rng.collapsed) { - var bk = rng.createBookmark(); - var start = bk.start.previousSibling; - - while (start) { - if (pre.firstChild === start && !domUtils.isBr(start)) { - pre.insertBefore(me.document.createTextNode(" "), start); - - break; - } - if (domUtils.isBr(start)) { - pre.insertBefore( - me.document.createTextNode(" "), - start.nextSibling - ); - - break; - } - start = start.previousSibling; - } - var end = bk.end; - start = bk.start.nextSibling; - if (pre.firstChild === bk.start) { - pre.insertBefore( - me.document.createTextNode(" "), - start.nextSibling - ); - } - while (start && start !== end) { - if (domUtils.isBr(start) && start.nextSibling) { - if (start.nextSibling === end) { - break; - } - pre.insertBefore( - me.document.createTextNode(" "), - start.nextSibling - ); - } - - start = start.nextSibling; - } - rng.moveToBookmark(bk).select(); - } else { - var tmpNode = me.document.createTextNode(" "); - rng - .insertNode(tmpNode) - .setStartAfter(tmpNode) - .collapse(true) - .select(true); - } - } - - me.fireEvent("saveScene"); - return true; - } - }); - - me.addListener("beforeinserthtml", function(evtName, html) { - var me = this, - rng = me.selection.getRange(), - pre = domUtils.findParentByTagName(rng.startContainer, "pre", true); - if (pre) { - if (!rng.collapsed) { - rng.deleteContents(); - } - var htmlstr = ""; - if (browser.ie && browser.version > 8) { - utils.each( - UE.filterNode(UE.htmlparser(html), me.options.filterTxtRules) - .children, - function(node) { - if (node.type == "element") { - if (node.tagName == "br") { - htmlstr += "\n"; - } else if (!dtd.$empty[node.tagName]) { - utils.each(node.children, function(cn) { - if (cn.type == "element") { - if (cn.tagName == "br") { - htmlstr += "\n"; - } else if (!dtd.$empty[node.tagName]) { - htmlstr += cn.innerText(); - } - } else { - htmlstr += cn.data; - } - }); - if (!/\n$/.test(htmlstr)) { - htmlstr += "\n"; - } - } - } else { - htmlstr += node.data + "\n"; - } - if (!node.nextSibling() && /\n$/.test(htmlstr)) { - htmlstr = htmlstr.replace(/\n$/, ""); - } - } - ); - var tmpNode = me.document.createTextNode( - utils.html(htmlstr.replace(/ /g, " ")) - ); - rng.insertNode(tmpNode).selectNode(tmpNode).select(); - } else { - var frag = me.document.createDocumentFragment(); - - utils.each( - UE.filterNode(UE.htmlparser(html), me.options.filterTxtRules) - .children, - function(node) { - if (node.type == "element") { - if (node.tagName == "br") { - frag.appendChild(me.document.createElement("br")); - } else if (!dtd.$empty[node.tagName]) { - utils.each(node.children, function(cn) { - if (cn.type == "element") { - if (cn.tagName == "br") { - frag.appendChild(me.document.createElement("br")); - } else if (!dtd.$empty[node.tagName]) { - frag.appendChild( - me.document.createTextNode( - utils.html(cn.innerText().replace(/ /g, " ")) - ) - ); - } - } else { - frag.appendChild( - me.document.createTextNode( - utils.html(cn.data.replace(/ /g, " ")) - ) - ); - } - }); - if (frag.lastChild.nodeName != "BR") { - frag.appendChild(me.document.createElement("br")); - } - } - } else { - frag.appendChild( - me.document.createTextNode( - utils.html(node.data.replace(/ /g, " ")) - ) - ); - } - if (!node.nextSibling() && frag.lastChild.nodeName == "BR") { - frag.removeChild(frag.lastChild); - } - } - ); - rng.insertNode(frag).select(); - } - - return true; - } - }); - //方向键的处理 - me.addListener("keydown", function(cmd, evt) { - var me = this, - keyCode = evt.keyCode || evt.which; - if (keyCode == 40) { - var rng = me.selection.getRange(), - pre, - start = rng.startContainer; - if ( - rng.collapsed && - (pre = domUtils.findParentByTagName(rng.startContainer, "pre", true)) && - !pre.nextSibling - ) { - var last = pre.lastChild; - while (last && last.nodeName == "BR") { - last = last.previousSibling; - } - if ( - last === start || - (rng.startContainer === pre && - rng.startOffset == pre.childNodes.length) - ) { - me.execCommand("insertparagraph"); - domUtils.preventDefault(evt); - } - } - } - }); - //trace:3395 - me.addListener("delkeydown", function(type, evt) { - var rng = this.selection.getRange(); - rng.txtToElmBoundary(true); - var start = rng.startContainer; - if ( - domUtils.isTagNode(start, "pre") && - rng.collapsed && - domUtils.isStartInblock(rng) - ) { - var p = me.document.createElement("p"); - domUtils.fillNode(me.document, p); - start.parentNode.insertBefore(p, start); - domUtils.remove(start); - rng.setStart(p, 0).setCursor(false, true); - domUtils.preventDefault(evt); - return true; - } - }); -}; - - -// plugins/cleardoc.js -/** - * 清空文档插件 - * @file - * @since 1.2.6.1 - */ - -/** - * 清空文档 - * @command cleardoc - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * //editor 是编辑器实例 - * editor.execCommand('cleardoc'); - * ``` - */ - -UE.commands["cleardoc"] = { - execCommand: function(cmdName) { - var me = this, - enterTag = me.options.enterTag, - range = me.selection.getRange(); - if (enterTag == "br") { - me.body.innerHTML = "
                      "; - range.setStart(me.body, 0).setCursor(); - } else { - me.body.innerHTML = "

                      " + (ie ? "" : "
                      ") + "

                      "; - range.setStart(me.body.firstChild, 0).setCursor(false, true); - } - setTimeout(function() { - me.fireEvent("clearDoc"); - }, 0); - } -}; - - -// plugins/anchor.js -/** - * 锚点插件,为UEditor提供插入锚点支持 - * @file - * @since 1.2.6.1 - */ -UE.plugin.register("anchor", function () { - var me = this; - return { - bindEvents: { - ready: function () { - utils.cssRule( - "anchor", - ".anchorclass{background: url('" + - this.options.themePath + - this.options.theme + - "/images/anchor.gif') no-repeat scroll left center transparent;cursor: auto;display: inline-block;height: 16px;width: 16px;}", - this.document - ); - } - }, - outputRule: function (root) { - utils.each(root.getNodesByTagName("img"), function (a) { - var val; - if ((val = a.getAttr("anchorname"))) { - a.tagName = "a"; - a.setAttr({ - anchorname: "", - name: val, - class: "" - }); - } - }); - }, - inputRule: function (root) { - utils.each(root.getNodesByTagName("a"), function (a) { - var val; - if ((val = a.getAttr("name")) && !a.getAttr("href")) { - //过滤掉word冗余标签 - //_Toc\d+有可能勿命中 - if (/^\_Toc\d+$/.test(val)) { - a.parentNode.removeChild(a); - return; - } - a.tagName = "img"; - a.setAttr({ - anchorname: a.getAttr("name"), - class: "anchorclass" - }); - a.setAttr("name"); - } - }); - }, - commands: { - /** - * 插入锚点 - * @command anchor - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } name 锚点名称字符串 - * @example - * ```javascript - * //editor 是编辑器实例 - * editor.execCommand('anchor', 'anchor1'); - * ``` - */ - anchor: { - execCommand: function (cmd, name) { - var range = this.selection.getRange(), - img = range.getClosedNode(); - - if (img && img.getAttribute("anchorname")) { - if (name) { - img.setAttribute("anchorname", name); - } else { - range.setStartBefore(img).setCursor(); - domUtils.remove(img); - } - } else { - if (name) { - //只在选区的开始插入 - var anchor = utils.renderTplstr('', { - name: name - }); - me.execCommand("inserthtml", anchor, true); - } - } - } - } - } - }; -}); - - -// plugins/wordcount.js -///import core -///commands 字数统计 -///commandsName WordCount,wordCount -///commandsTitle 字数统计 -/* - * Created by JetBrains WebStorm. - * User: taoqili - * Date: 11-9-7 - * Time: 下午8:18 - * To change this template use File | Settings | File Templates. - */ - -UE.plugins["wordcount"] = function() { - var me = this; - me.setOpt("wordCount", true); - me.addListener("contentchange", function() { - me.fireEvent("wordcount"); - }); - var timer; - me.addListener("ready", function() { - var me = this; - domUtils.on(me.body, "keyup", function(evt) { - var code = evt.keyCode || evt.which, - //忽略的按键,ctr,alt,shift,方向键 - ignores = { - "16": 1, - "18": 1, - "20": 1, - "37": 1, - "38": 1, - "39": 1, - "40": 1 - }; - if (code in ignores) return; - clearTimeout(timer); - timer = setTimeout(function() { - me.fireEvent("wordcount"); - }, 200); - }); - }); -}; - - -// plugins/pagebreak.js -/** - * 分页功能插件 - * @file - * @since 1.2.6.1 - */ -UE.plugins["pagebreak"] = function() { - var me = this, - notBreakTags = ["td"]; - me.setOpt("pageBreakTag", "_ueditor_page_break_tag_"); - - function fillNode(node) { - if (domUtils.isEmptyBlock(node)) { - var firstChild = node.firstChild, - tmpNode; - - while ( - firstChild && - firstChild.nodeType == 1 && - domUtils.isEmptyBlock(firstChild) - ) { - tmpNode = firstChild; - firstChild = firstChild.firstChild; - } - !tmpNode && (tmpNode = node); - domUtils.fillNode(me.document, tmpNode); - } - } - //分页符样式添加 - - me.ready(function() { - utils.cssRule( - "pagebreak", - ".pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}", - me.document - ); - }); - function isHr(node) { - return ( - node && - node.nodeType == 1 && - node.tagName == "HR" && - node.className == "pagebreak" - ); - } - me.addInputRule(function(root) { - root.traversal(function(node) { - if (node.type == "text" && node.data == me.options.pageBreakTag) { - var hr = UE.uNode.createElement( - '
                      ' - ); - node.parentNode.insertBefore(hr, node); - node.parentNode.removeChild(node); - } - }); - }); - me.addOutputRule(function(node) { - utils.each(node.getNodesByTagName("hr"), function(n) { - if (n.getAttr("class") == "pagebreak") { - var txt = UE.uNode.createText(me.options.pageBreakTag); - n.parentNode.insertBefore(txt, n); - n.parentNode.removeChild(n); - } - }); - }); - - /** - * 插入分页符 - * @command pagebreak - * @method execCommand - * @param { String } cmd 命令字符串 - * @remind 在表格中插入分页符会把表格切分成两部分 - * @remind 获取编辑器内的数据时, 编辑器会把分页符转换成“_ueditor_page_break_tag_”字符串, - * 以便于提交数据到服务器端后处理分页。 - * @example - * ```javascript - * editor.execCommand( 'pagebreak'); //插入一个hr标签,带有样式类名pagebreak - * ``` - */ - - me.commands["pagebreak"] = { - execCommand: function() { - var range = me.selection.getRange(), - hr = me.document.createElement("hr"); - domUtils.setAttributes(hr, { - class: "pagebreak", - noshade: "noshade", - size: "5" - }); - domUtils.unSelectable(hr); - //table单独处理 - var node = domUtils.findParentByTagName( - range.startContainer, - notBreakTags, - true - ), - parents = [], - pN; - if (node) { - switch (node.tagName) { - case "TD": - pN = node.parentNode; - if (!pN.previousSibling) { - var table = domUtils.findParentByTagName(pN, "table"); - // var tableWrapDiv = table.parentNode; - // if(tableWrapDiv && tableWrapDiv.nodeType == 1 - // && tableWrapDiv.tagName == 'DIV' - // && tableWrapDiv.getAttribute('dropdrag') - // ){ - // domUtils.remove(tableWrapDiv,true); - // } - table.parentNode.insertBefore(hr, table); - parents = domUtils.findParents(hr, true); - } else { - pN.parentNode.insertBefore(hr, pN); - parents = domUtils.findParents(hr); - } - pN = parents[1]; - if (hr !== pN) { - domUtils.breakParent(hr, pN); - } - //table要重写绑定一下拖拽 - me.fireEvent("afteradjusttable", me.document); - } - } else { - if (!range.collapsed) { - range.deleteContents(); - var start = range.startContainer; - while ( - !domUtils.isBody(start) && - domUtils.isBlockElm(start) && - domUtils.isEmptyNode(start) - ) { - range.setStartBefore(start).collapse(true); - domUtils.remove(start); - start = range.startContainer; - } - } - range.insertNode(hr); - - var pN = hr.parentNode, - nextNode; - while (!domUtils.isBody(pN)) { - domUtils.breakParent(hr, pN); - nextNode = hr.nextSibling; - if (nextNode && domUtils.isEmptyBlock(nextNode)) { - domUtils.remove(nextNode); - } - pN = hr.parentNode; - } - nextNode = hr.nextSibling; - var pre = hr.previousSibling; - if (isHr(pre)) { - domUtils.remove(pre); - } else { - pre && fillNode(pre); - } - - if (!nextNode) { - var p = me.document.createElement("p"); - - hr.parentNode.appendChild(p); - domUtils.fillNode(me.document, p); - range.setStart(p, 0).collapse(true); - } else { - if (isHr(nextNode)) { - domUtils.remove(nextNode); - } else { - fillNode(nextNode); - } - range.setEndAfter(hr).collapse(false); - } - - range.select(true); - } - } - }; -}; - - -// plugins/wordimage.js -///import core -///commands 本地图片引导上传 -///commandsName WordImage -///commandsTitle 本地图片引导上传 -///commandsDialog dialogs\wordimage - -UE.plugin.register("wordimage", function() { - var me = this, - images = []; - return { - commands: { - wordimage: { - execCommand: function() { - var images = domUtils.getElementsByTagName(me.body, "img"); - var urlList = []; - for (var i = 0, ci; (ci = images[i++]); ) { - var url = ci.getAttribute("word_img"); - url && urlList.push(url); - } - return urlList; - }, - queryCommandState: function() { - images = domUtils.getElementsByTagName(me.body, "img"); - for (var i = 0, ci; (ci = images[i++]); ) { - if (ci.getAttribute("word_img")) { - return 1; - } - } - return -1; - }, - notNeedUndo: true - } - }, - inputRule: function(root) { - utils.each(root.getNodesByTagName("img"), function(img) { - var attrs = img.attrs, - flag = parseInt(attrs.width) < 128 || parseInt(attrs.height) < 43, - opt = me.options, - src = opt.UEDITOR_HOME_URL + "themes/notadd/images/spacer.gif"; - if (attrs["src"] && /^(?:(file:\/+))/.test(attrs["src"])) { - img.setAttr({ - width: attrs.width, - height: attrs.height, - alt: attrs.alt, - word_img: attrs.src, - src: src, - style: - "background:url(" + - (flag - ? opt.themePath + opt.theme + "/images/word.gif" - : opt.langPath + opt.lang + "/images/localimage.png") + - ") no-repeat center center;border:1px solid #ddd" - }); - } - }); - } - }; -}); - - -// plugins/dragdrop.js -UE.plugins["dragdrop"] = function() { - var me = this; - me.ready(function() { - domUtils.on(this.body, "dragend", function() { - var rng = me.selection.getRange(); - var node = rng.getClosedNode() || me.selection.getStart(); - - if (node && node.tagName == "IMG") { - var pre = node.previousSibling, - next; - while ((next = node.nextSibling)) { - if ( - next.nodeType == 1 && - next.tagName == "SPAN" && - !next.firstChild - ) { - domUtils.remove(next); - } else { - break; - } - } - - if ( - ((pre && pre.nodeType == 1 && !domUtils.isEmptyBlock(pre)) || !pre) && - (!next || (next && !domUtils.isEmptyBlock(next))) - ) { - if (pre && pre.tagName == "P" && !domUtils.isEmptyBlock(pre)) { - pre.appendChild(node); - domUtils.moveChild(next, pre); - domUtils.remove(next); - } else if ( - next && - next.tagName == "P" && - !domUtils.isEmptyBlock(next) - ) { - next.insertBefore(node, next.firstChild); - } - - if (pre && pre.tagName == "P" && domUtils.isEmptyBlock(pre)) { - domUtils.remove(pre); - } - if (next && next.tagName == "P" && domUtils.isEmptyBlock(next)) { - domUtils.remove(next); - } - rng.selectNode(node).select(); - me.fireEvent("saveScene"); - } - } - }); - }); - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - if (keyCode == 13) { - var rng = me.selection.getRange(), - node; - if ( - (node = domUtils.findParentByTagName(rng.startContainer, "p", true)) - ) { - if (domUtils.getComputedStyle(node, "text-align") == "center") { - domUtils.removeStyle(node, "text-align"); - } - } - } - }); -}; - - -// plugins/undo.js -/** - * undo redo - * @file - * @since 1.2.6.1 - */ - -/** - * 撤销上一次执行的命令 - * @command undo - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'undo' ); - * ``` - */ - -/** - * 重做上一次执行的命令 - * @command redo - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'redo' ); - * ``` - */ - -UE.plugins["undo"] = function() { - var saveSceneTimer; - var me = this, - maxUndoCount = me.options.maxUndoCount || 20, - maxInputCount = me.options.maxInputCount || 20, - fillchar = new RegExp(domUtils.fillChar + "|", "gi"); // ie会产生多余的 - var noNeedFillCharTags = { - ol: 1, - ul: 1, - table: 1, - tbody: 1, - tr: 1, - body: 1 - }; - var orgState = me.options.autoClearEmptyNode; - function compareAddr(indexA, indexB) { - if (indexA.length != indexB.length) return 0; - for (var i = 0, l = indexA.length; i < l; i++) { - if (indexA[i] != indexB[i]) return 0; - } - return 1; - } - - function compareRangeAddress(rngAddrA, rngAddrB) { - if (rngAddrA.collapsed != rngAddrB.collapsed) { - return 0; - } - if ( - !compareAddr(rngAddrA.startAddress, rngAddrB.startAddress) || - !compareAddr(rngAddrA.endAddress, rngAddrB.endAddress) - ) { - return 0; - } - return 1; - } - - function UndoManager() { - this.list = []; - this.index = 0; - this.hasUndo = false; - this.hasRedo = false; - this.undo = function() { - if (this.hasUndo) { - if (!this.list[this.index - 1] && this.list.length == 1) { - this.reset(); - return; - } - while ( - this.list[this.index].content == this.list[this.index - 1].content - ) { - this.index--; - if (this.index == 0) { - return this.restore(0); - } - } - this.restore(--this.index); - } - }; - this.redo = function() { - if (this.hasRedo) { - while ( - this.list[this.index].content == this.list[this.index + 1].content - ) { - this.index++; - if (this.index == this.list.length - 1) { - return this.restore(this.index); - } - } - this.restore(++this.index); - } - }; - - this.restore = function() { - var me = this.editor; - var scene = this.list[this.index]; - var root = UE.htmlparser(scene.content.replace(fillchar, "")); - me.options.autoClearEmptyNode = false; - me.filterInputRule(root); - me.options.autoClearEmptyNode = orgState; - //trace:873 - //去掉展位符 - me.document.body.innerHTML = root.toHtml(); - me.fireEvent("afterscencerestore"); - //处理undo后空格不展位的问题 - if (browser.ie) { - utils.each( - domUtils.getElementsByTagName(me.document, "td th caption p"), - function(node) { - if (domUtils.isEmptyNode(node)) { - domUtils.fillNode(me.document, node); - } - } - ); - } - - try { - var rng = new dom.Range(me.document).moveToAddress(scene.address); - rng.select( - noNeedFillCharTags[rng.startContainer.nodeName.toLowerCase()] - ); - } catch (e) {} - - this.update(); - this.clearKey(); - //不能把自己reset了 - me.fireEvent("reset", true); - }; - - this.getScene = function() { - var me = this.editor; - var rng = me.selection.getRange(), - rngAddress = rng.createAddress(false, true); - me.fireEvent("beforegetscene"); - var root = UE.htmlparser(me.body.innerHTML); - me.options.autoClearEmptyNode = false; - me.filterOutputRule(root); - me.options.autoClearEmptyNode = orgState; - var cont = root.toHtml(); - //trace:3461 - //这个会引起回退时导致空格丢失的情况 - // browser.ie && (cont = cont.replace(/> <').replace(/\s*\s*/g, '>')); - me.fireEvent("aftergetscene"); - - return { - address: rngAddress, - content: cont - }; - }; - this.save = function(notCompareRange, notSetCursor) { - clearTimeout(saveSceneTimer); - var currentScene = this.getScene(notSetCursor), - lastScene = this.list[this.index]; - - if (lastScene && lastScene.content != currentScene.content) { - me.trigger("contentchange"); - } - //内容相同位置相同不存 - if ( - lastScene && - lastScene.content == currentScene.content && - (notCompareRange - ? 1 - : compareRangeAddress(lastScene.address, currentScene.address)) - ) { - return; - } - this.list = this.list.slice(0, this.index + 1); - this.list.push(currentScene); - //如果大于最大数量了,就把最前的剔除 - if (this.list.length > maxUndoCount) { - this.list.shift(); - } - this.index = this.list.length - 1; - this.clearKey(); - //跟新undo/redo状态 - this.update(); - }; - this.update = function() { - this.hasRedo = !!this.list[this.index + 1]; - this.hasUndo = !!this.list[this.index - 1]; - }; - this.reset = function() { - this.list = []; - this.index = 0; - this.hasUndo = false; - this.hasRedo = false; - this.clearKey(); - }; - this.clearKey = function() { - keycont = 0; - lastKeyCode = null; - }; - } - - me.undoManger = new UndoManager(); - me.undoManger.editor = me; - function saveScene() { - this.undoManger.save(); - } - - me.addListener("saveScene", function() { - var args = Array.prototype.splice.call(arguments, 1); - this.undoManger.save.apply(this.undoManger, args); - }); - - // me.addListener('beforeexeccommand', saveScene); - // me.addListener('afterexeccommand', saveScene); - - me.addListener("reset", function(type, exclude) { - if (!exclude) { - this.undoManger.reset(); - } - }); - me.commands["redo"] = me.commands["undo"] = { - execCommand: function(cmdName) { - this.undoManger[cmdName](); - }, - queryCommandState: function(cmdName) { - return this.undoManger[ - "has" + (cmdName.toLowerCase() == "undo" ? "Undo" : "Redo") - ] - ? 0 - : -1; - }, - notNeedUndo: 1 - }; - - var keys = { - // /*Backspace*/ 8:1, /*Delete*/ 46:1, - /*Shift*/ 16: 1, - /*Ctrl*/ 17: 1, - /*Alt*/ 18: 1, - 37: 1, - 38: 1, - 39: 1, - 40: 1 - }, - keycont = 0, - lastKeyCode; - //输入法状态下不计算字符数 - var inputType = false; - me.addListener("ready", function() { - domUtils.on(this.body, "compositionstart", function() { - inputType = true; - }); - domUtils.on(this.body, "compositionend", function() { - inputType = false; - }); - }); - //快捷键 - me.addshortcutkey({ - Undo: "ctrl+90", //undo - Redo: "ctrl+89" //redo - }); - var isCollapsed = true; - me.addListener("keydown", function(type, evt) { - var me = this; - var keyCode = evt.keyCode || evt.which; - if ( - !keys[keyCode] && - !evt.ctrlKey && - !evt.metaKey && - !evt.shiftKey && - !evt.altKey - ) { - if (inputType) return; - - if (!me.selection.getRange().collapsed) { - me.undoManger.save(false, true); - isCollapsed = false; - return; - } - if (me.undoManger.list.length == 0) { - me.undoManger.save(true); - } - clearTimeout(saveSceneTimer); - function save(cont) { - cont.undoManger.save(false, true); - cont.fireEvent("selectionchange"); - } - saveSceneTimer = setTimeout(function() { - if (inputType) { - var interalTimer = setInterval(function() { - if (!inputType) { - save(me); - clearInterval(interalTimer); - } - }, 300); - return; - } - save(me); - }, 200); - - lastKeyCode = keyCode; - keycont++; - if (keycont >= maxInputCount) { - save(me); - } - } - }); - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - if ( - !keys[keyCode] && - !evt.ctrlKey && - !evt.metaKey && - !evt.shiftKey && - !evt.altKey - ) { - if (inputType) return; - if (!isCollapsed) { - this.undoManger.save(false, true); - isCollapsed = true; - } - } - }); - //扩展实例,添加关闭和开启命令undo - me.stopCmdUndo = function() { - me.__hasEnterExecCommand = true; - }; - me.startCmdUndo = function() { - me.__hasEnterExecCommand = false; - }; -}; - - -// plugins/copy.js -UE.plugin.register("copy", function() { - var me = this; - - function initZeroClipboard() { - ZeroClipboard.config({ - debug: false, - swfPath: - me.options.UEDITOR_HOME_URL + - "third-party/zeroclipboard/ZeroClipboard.swf" - }); - - var client = (me.zeroclipboard = new ZeroClipboard()); - - // 复制内容 - client.on("copy", function(e) { - var client = e.client, - rng = me.selection.getRange(), - div = document.createElement("div"); - - div.appendChild(rng.cloneContents()); - client.setText(div.innerText || div.textContent); - client.setHtml(div.innerHTML); - rng.select(); - }); - // hover事件传递到target - client.on("mouseover mouseout", function(e) { - var target = e.target; - if (target) { - if (e.type == "mouseover") { - domUtils.addClass(target, "edui-state-hover"); - } else if (e.type == "mouseout") { - domUtils.removeClasses(target, "edui-state-hover"); - } - } - }); - // flash加载不成功 - client.on("wrongflash noflash", function() { - ZeroClipboard.destroy(); - }); - - // 触发事件 - me.fireEvent("zeroclipboardready", client); - } - - return { - bindEvents: { - ready: function() { - if (!browser.ie) { - if (window.ZeroClipboard) { - initZeroClipboard(); - } else { - utils.loadFile( - document, - { - src: - me.options.UEDITOR_HOME_URL + - "third-party/zeroclipboard/ZeroClipboard.js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - initZeroClipboard(); - } - ); - } - } - } - }, - commands: { - copy: { - execCommand: function(cmd) { - if (!me.document.execCommand("copy")) { - alert(me.getLang("copymsg")); - } - } - } - } - }; -}); - - -// plugins/paste.js -///import core -///import plugins/inserthtml.js -///import plugins/undo.js -///import plugins/serialize.js -///commands 粘贴 -///commandsName PastePlain -///commandsTitle 纯文本粘贴模式 -/** - * @description 粘贴 - * @author zhanyi - */ -UE.plugins["paste"] = function() { - function getClipboardData(callback) { - var doc = this.document; - if (doc.getElementById("baidu_pastebin")) { - return; - } - var range = this.selection.getRange(), - bk = range.createBookmark(), - //创建剪贴的容器div - pastebin = doc.createElement("div"); - pastebin.id = "baidu_pastebin"; - // Safari 要求div必须有内容,才能粘贴内容进来 - browser.webkit && - pastebin.appendChild( - doc.createTextNode(domUtils.fillChar + domUtils.fillChar) - ); - doc.body.appendChild(pastebin); - //trace:717 隐藏的span不能得到top - //bk.start.innerHTML = ' '; - bk.start.style.display = ""; - pastebin.style.cssText = - "position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:" + - //要在现在光标平行的位置加入,否则会出现跳动的问题 - domUtils.getXY(bk.start).y + - "px"; - - range.selectNodeContents(pastebin).select(true); - - setTimeout(function() { - if (browser.webkit) { - for ( - var i = 0, pastebins = doc.querySelectorAll("#baidu_pastebin"), pi; - (pi = pastebins[i++]); - - ) { - if (domUtils.isEmptyNode(pi)) { - domUtils.remove(pi); - } else { - pastebin = pi; - break; - } - } - } - try { - pastebin.parentNode.removeChild(pastebin); - } catch (e) {} - range.moveToBookmark(bk).select(true); - callback(pastebin); - }, 0); - } - - var me = this; - - me.setOpt({ - retainOnlyLabelPasted: false - }); - - var txtContent, htmlContent, address; - - function getPureHtml(html) { - return html.replace(/<(\/?)([\w\-]+)([^>]*)>/gi, function( - a, - b, - tagName, - attrs - ) { - tagName = tagName.toLowerCase(); - if ({ img: 1 }[tagName]) { - return a; - } - attrs = attrs.replace( - /([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi, - function(str, atr, val) { - if ( - { - src: 1, - href: 1, - name: 1 - }[atr.toLowerCase()] - ) { - return atr + "=" + val + " "; - } - return ""; - } - ); - if ( - { - span: 1, - div: 1 - }[tagName] - ) { - return ""; - } else { - return "<" + b + tagName + " " + utils.trim(attrs) + ">"; - } - }); - } - function filter(div) { - var html; - if (div.firstChild) { - //去掉cut中添加的边界值 - var nodes = domUtils.getElementsByTagName(div, "span"); - for (var i = 0, ni; (ni = nodes[i++]); ) { - if (ni.id == "_baidu_cut_start" || ni.id == "_baidu_cut_end") { - domUtils.remove(ni); - } - } - - if (browser.webkit) { - var brs = div.querySelectorAll("div br"); - for (var i = 0, bi; (bi = brs[i++]); ) { - var pN = bi.parentNode; - if (pN.tagName == "DIV" && pN.childNodes.length == 1) { - pN.innerHTML = "


                      "; - domUtils.remove(pN); - } - } - var divs = div.querySelectorAll("#baidu_pastebin"); - for (var i = 0, di; (di = divs[i++]); ) { - var tmpP = me.document.createElement("p"); - di.parentNode.insertBefore(tmpP, di); - while (di.firstChild) { - tmpP.appendChild(di.firstChild); - } - domUtils.remove(di); - } - - var metas = div.querySelectorAll("meta"); - for (var i = 0, ci; (ci = metas[i++]); ) { - domUtils.remove(ci); - } - - var brs = div.querySelectorAll("br"); - for (i = 0; (ci = brs[i++]); ) { - if (/^apple-/i.test(ci.className)) { - domUtils.remove(ci); - } - } - } - if (browser.gecko) { - var dirtyNodes = div.querySelectorAll("[_moz_dirty]"); - for (i = 0; (ci = dirtyNodes[i++]); ) { - ci.removeAttribute("_moz_dirty"); - } - } - if (!browser.ie) { - var spans = div.querySelectorAll("span.Apple-style-span"); - for (var i = 0, ci; (ci = spans[i++]); ) { - domUtils.remove(ci, true); - } - } - - //ie下使用innerHTML会产生多余的\r\n字符,也会产生 这里过滤掉 - html = div.innerHTML; //.replace(/>(?:(\s| )*?)<'); - - //过滤word粘贴过来的冗余属性 - html = UE.filterWord(html); - //取消了忽略空白的第二个参数,粘贴过来的有些是有空白的,会被套上相关的标签 - var root = UE.htmlparser(html); - //如果给了过滤规则就先进行过滤 - if (me.options.filterRules) { - UE.filterNode(root, me.options.filterRules); - } - //执行默认的处理 - me.filterInputRule(root); - //针对chrome的处理 - if (browser.webkit) { - var br = root.lastChild(); - if (br && br.type == "element" && br.tagName == "br") { - root.removeChild(br); - } - utils.each(me.body.querySelectorAll("div"), function(node) { - if (domUtils.isEmptyBlock(node)) { - domUtils.remove(node, true); - } - }); - } - html = { html: root.toHtml() }; - me.fireEvent("beforepaste", html, root); - //抢了默认的粘贴,那后边的内容就不执行了,比如表格粘贴 - if (!html.html) { - return; - } - root = UE.htmlparser(html.html, true); - //如果开启了纯文本模式 - if (me.queryCommandState("pasteplain") === 1) { - me.execCommand( - "insertHtml", - UE.filterNode(root, me.options.filterTxtRules).toHtml(), - true - ); - } else { - //文本模式 - UE.filterNode(root, me.options.filterTxtRules); - txtContent = root.toHtml(); - //完全模式 - htmlContent = html.html; - - address = me.selection.getRange().createAddress(true); - me.execCommand( - "insertHtml", - me.getOpt("retainOnlyLabelPasted") === true - ? getPureHtml(htmlContent) - : htmlContent, - true - ); - } - me.fireEvent("afterpaste", html); - } - } - - me.addListener("pasteTransfer", function(cmd, plainType) { - if (address && txtContent && htmlContent && txtContent != htmlContent) { - var range = me.selection.getRange(); - range.moveToAddress(address, true); - - if (!range.collapsed) { - while (!domUtils.isBody(range.startContainer)) { - var start = range.startContainer; - if (start.nodeType == 1) { - start = start.childNodes[range.startOffset]; - if (!start) { - range.setStartBefore(range.startContainer); - continue; - } - var pre = start.previousSibling; - - if ( - pre && - pre.nodeType == 3 && - new RegExp("^[\n\r\t " + domUtils.fillChar + "]*$").test( - pre.nodeValue - ) - ) { - range.setStartBefore(pre); - } - } - if (range.startOffset == 0) { - range.setStartBefore(range.startContainer); - } else { - break; - } - } - while (!domUtils.isBody(range.endContainer)) { - var end = range.endContainer; - if (end.nodeType == 1) { - end = end.childNodes[range.endOffset]; - if (!end) { - range.setEndAfter(range.endContainer); - continue; - } - var next = end.nextSibling; - if ( - next && - next.nodeType == 3 && - new RegExp("^[\n\r\t" + domUtils.fillChar + "]*$").test( - next.nodeValue - ) - ) { - range.setEndAfter(next); - } - } - if ( - range.endOffset == - range.endContainer[ - range.endContainer.nodeType == 3 ? "nodeValue" : "childNodes" - ].length - ) { - range.setEndAfter(range.endContainer); - } else { - break; - } - } - } - - range.deleteContents(); - range.select(true); - me.__hasEnterExecCommand = true; - var html = htmlContent; - if (plainType === 2) { - html = getPureHtml(html); - } else if (plainType) { - html = txtContent; - } - me.execCommand("inserthtml", html, true); - me.__hasEnterExecCommand = false; - var rng = me.selection.getRange(); - while ( - !domUtils.isBody(rng.startContainer) && - !rng.startOffset && - rng.startContainer[ - rng.startContainer.nodeType == 3 ? "nodeValue" : "childNodes" - ].length - ) { - rng.setStartBefore(rng.startContainer); - } - var tmpAddress = rng.createAddress(true); - address.endAddress = tmpAddress.startAddress; - } - }); - - me.addListener("ready", function() { - domUtils.on(me.body, "cut", function() { - var range = me.selection.getRange(); - if (!range.collapsed && me.undoManger) { - me.undoManger.save(); - } - }); - - //ie下beforepaste在点击右键时也会触发,所以用监控键盘才处理 - domUtils.on( - me.body, - browser.ie || browser.opera ? "keydown" : "paste", - function(e) { - if ( - (browser.ie || browser.opera) && - ((!e.ctrlKey && !e.metaKey) || e.keyCode != "86") - ) { - return; - } - getClipboardData.call(me, function(div) { - filter(div); - }); - } - ); - }); - - me.commands["paste"] = { - execCommand: function(cmd) { - if (browser.ie) { - getClipboardData.call(me, function(div) { - filter(div); - }); - me.document.execCommand("paste"); - } else { - alert(me.getLang("pastemsg")); - } - } - }; -}; - - -// plugins/puretxtpaste.js -/** - * 纯文本粘贴插件 - * @file - * @since 1.2.6.1 - */ - -UE.plugins["pasteplain"] = function() { - var me = this; - me.setOpt({ - pasteplain: false, - filterTxtRules: (function() { - function transP(node) { - node.tagName = "p"; - node.setStyle(); - } - function removeNode(node) { - node.parentNode.removeChild(node, true); - } - return { - //直接删除及其字节点内容 - "-": "script style object iframe embed input select", - p: { $: {} }, - br: { $: {} }, - div: function(node) { - var tmpNode, - p = UE.uNode.createElement("p"); - while ((tmpNode = node.firstChild())) { - if (tmpNode.type == "text" || !UE.dom.dtd.$block[tmpNode.tagName]) { - p.appendChild(tmpNode); - } else { - if (p.firstChild()) { - node.parentNode.insertBefore(p, node); - p = UE.uNode.createElement("p"); - } else { - node.parentNode.insertBefore(tmpNode, node); - } - } - } - if (p.firstChild()) { - node.parentNode.insertBefore(p, node); - } - node.parentNode.removeChild(node); - }, - ol: removeNode, - ul: removeNode, - dl: removeNode, - dt: removeNode, - dd: removeNode, - li: removeNode, - caption: transP, - th: transP, - tr: transP, - h1: transP, - h2: transP, - h3: transP, - h4: transP, - h5: transP, - h6: transP, - td: function(node) { - //没有内容的td直接删掉 - var txt = !!node.innerText(); - if (txt) { - node.parentNode.insertAfter( - UE.uNode.createText("    "), - node - ); - } - node.parentNode.removeChild(node, node.innerText()); - } - }; - })() - }); - //暂时这里支持一下老版本的属性 - var pasteplain = me.options.pasteplain; - - /** - * 启用或取消纯文本粘贴模式 - * @command pasteplain - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.queryCommandState( 'pasteplain' ); - * ``` - */ - - /** - * 查询当前是否处于纯文本粘贴模式 - * @command pasteplain - * @method queryCommandState - * @param { String } cmd 命令字符串 - * @return { int } 如果处于纯文本模式,返回1,否则,返回0 - * @example - * ```javascript - * editor.queryCommandState( 'pasteplain' ); - * ``` - */ - me.commands["pasteplain"] = { - queryCommandState: function() { - return pasteplain ? 1 : 0; - }, - execCommand: function() { - pasteplain = !pasteplain | 0; - }, - notNeedUndo: 1 - }; -}; - - -// plugins/list.js -/** - * 有序列表,无序列表插件 - * @file - * @since 1.2.6.1 - */ - -UE.plugins["list"] = function() { - var me = this, - notExchange = { - TD: 1, - PRE: 1, - BLOCKQUOTE: 1 - }; - var customStyle = { - cn: "cn-1-", - cn1: "cn-2-", - cn2: "cn-3-", - num: "num-1-", - num1: "num-2-", - num2: "num-3-", - dash: "dash", - dot: "dot" - }; - - me.setOpt({ - autoTransWordToList: false, - insertorderedlist: { - num: "", - num1: "", - num2: "", - cn: "", - cn1: "", - cn2: "", - decimal: "", - "lower-alpha": "", - "lower-roman": "", - "upper-alpha": "", - "upper-roman": "" - }, - insertunorderedlist: { - circle: "", - disc: "", - square: "", - dash: "", - dot: "" - }, - listDefaultPaddingLeft: "30", - listiconpath: "http://bs.baidu.com/listicon/", - maxListLevel: -1, //-1不限制 - disablePInList: false - }); - function listToArray(list) { - var arr = []; - for (var p in list) { - arr.push(p); - } - return arr; - } - var listStyle = { - OL: listToArray(me.options.insertorderedlist), - UL: listToArray(me.options.insertunorderedlist) - }; - var liiconpath = me.options.listiconpath; - - //根据用户配置,调整customStyle - for (var s in customStyle) { - if ( - !me.options.insertorderedlist.hasOwnProperty(s) && - !me.options.insertunorderedlist.hasOwnProperty(s) - ) { - delete customStyle[s]; - } - } - - me.ready(function() { - var customCss = []; - for (var p in customStyle) { - if (p == "dash" || p == "dot") { - customCss.push( - "li.list-" + - customStyle[p] + - "{background-image:url(" + - liiconpath + - customStyle[p] + - ".gif)}" - ); - customCss.push( - "ul.custom_" + - p + - "{list-style:none;}ul.custom_" + - p + - " li{background-position:0 3px;background-repeat:no-repeat}" - ); - } else { - for (var i = 0; i < 99; i++) { - customCss.push( - "li.list-" + - customStyle[p] + - i + - "{background-image:url(" + - liiconpath + - "list-" + - customStyle[p] + - i + - ".gif)}" - ); - } - customCss.push( - "ol.custom_" + - p + - "{list-style:none;}ol.custom_" + - p + - " li{background-position:0 3px;background-repeat:no-repeat}" - ); - } - switch (p) { - case "cn": - customCss.push("li.list-" + p + "-paddingleft-1{padding-left:25px}"); - customCss.push("li.list-" + p + "-paddingleft-2{padding-left:40px}"); - customCss.push("li.list-" + p + "-paddingleft-3{padding-left:55px}"); - break; - case "cn1": - customCss.push("li.list-" + p + "-paddingleft-1{padding-left:30px}"); - customCss.push("li.list-" + p + "-paddingleft-2{padding-left:40px}"); - customCss.push("li.list-" + p + "-paddingleft-3{padding-left:55px}"); - break; - case "cn2": - customCss.push("li.list-" + p + "-paddingleft-1{padding-left:40px}"); - customCss.push("li.list-" + p + "-paddingleft-2{padding-left:55px}"); - customCss.push("li.list-" + p + "-paddingleft-3{padding-left:68px}"); - break; - case "num": - case "num1": - customCss.push("li.list-" + p + "-paddingleft-1{padding-left:25px}"); - break; - case "num2": - customCss.push("li.list-" + p + "-paddingleft-1{padding-left:35px}"); - customCss.push("li.list-" + p + "-paddingleft-2{padding-left:40px}"); - break; - case "dash": - customCss.push("li.list-" + p + "-paddingleft{padding-left:35px}"); - break; - case "dot": - customCss.push("li.list-" + p + "-paddingleft{padding-left:20px}"); - } - } - customCss.push(".list-paddingleft-1{padding-left:0}"); - customCss.push( - ".list-paddingleft-2{padding-left:" + - me.options.listDefaultPaddingLeft + - "px}" - ); - customCss.push( - ".list-paddingleft-3{padding-left:" + - me.options.listDefaultPaddingLeft * 2 + - "px}" - ); - //如果不给宽度会在自定应样式里出现滚动条 - utils.cssRule( - "list", - "ol,ul{margin:0;pading:0;" + - (browser.ie ? "" : "width:95%") + - "}li{clear:both;}" + - customCss.join("\n"), - me.document - ); - }); - //单独处理剪切的问题 - me.ready(function() { - domUtils.on(me.body, "cut", function() { - setTimeout(function() { - var rng = me.selection.getRange(), - li; - //trace:3416 - if (!rng.collapsed) { - if ( - (li = domUtils.findParentByTagName(rng.startContainer, "li", true)) - ) { - if (!li.nextSibling && domUtils.isEmptyBlock(li)) { - var pn = li.parentNode, - node; - if ((node = pn.previousSibling)) { - domUtils.remove(pn); - rng.setStartAtLast(node).collapse(true); - rng.select(true); - } else if ((node = pn.nextSibling)) { - domUtils.remove(pn); - rng.setStartAtFirst(node).collapse(true); - rng.select(true); - } else { - var tmpNode = me.document.createElement("p"); - domUtils.fillNode(me.document, tmpNode); - pn.parentNode.insertBefore(tmpNode, pn); - domUtils.remove(pn); - rng.setStart(tmpNode, 0).collapse(true); - rng.select(true); - } - } - } - } - }); - }); - }); - - function getStyle(node) { - var cls = node.className; - if (domUtils.hasClass(node, /custom_/)) { - return cls.match(/custom_(\w+)/)[1]; - } - return domUtils.getStyle(node, "list-style-type"); - } - - me.addListener("beforepaste", function(type, html) { - var me = this, - rng = me.selection.getRange(), - li; - var root = UE.htmlparser(html.html, true); - if ((li = domUtils.findParentByTagName(rng.startContainer, "li", true))) { - var list = li.parentNode, - tagName = list.tagName == "OL" ? "ul" : "ol"; - utils.each(root.getNodesByTagName(tagName), function(n) { - n.tagName = list.tagName; - n.setAttr(); - if (n.parentNode === root) { - type = getStyle(list) || (list.tagName == "OL" ? "decimal" : "disc"); - } else { - var className = n.parentNode.getAttr("class"); - if (className && /custom_/.test(className)) { - type = className.match(/custom_(\w+)/)[1]; - } else { - type = n.parentNode.getStyle("list-style-type"); - } - if (!type) { - type = list.tagName == "OL" ? "decimal" : "disc"; - } - } - var index = utils.indexOf(listStyle[list.tagName], type); - if (n.parentNode !== root) - index = index + 1 == listStyle[list.tagName].length ? 0 : index + 1; - var currentStyle = listStyle[list.tagName][index]; - if (customStyle[currentStyle]) { - n.setAttr("class", "custom_" + currentStyle); - } else { - n.setStyle("list-style-type", currentStyle); - } - }); - } - - html.html = root.toHtml(); - }); - //导出时,去掉p标签 - me.getOpt("disablePInList") === true && - me.addOutputRule(function(root) { - utils.each(root.getNodesByTagName("li"), function(li) { - var newChildrens = [], - index = 0; - utils.each(li.children, function(n) { - if (n.tagName == "p") { - var tmpNode; - while ((tmpNode = n.children.pop())) { - newChildrens.splice(index, 0, tmpNode); - tmpNode.parentNode = li; - lastNode = tmpNode; - } - tmpNode = newChildrens[newChildrens.length - 1]; - if ( - !tmpNode || - tmpNode.type != "element" || - tmpNode.tagName != "br" - ) { - var br = UE.uNode.createElement("br"); - br.parentNode = li; - newChildrens.push(br); - } - - index = newChildrens.length; - } - }); - if (newChildrens.length) { - li.children = newChildrens; - } - }); - }); - //进入编辑器的li要套p标签 - me.addInputRule(function(root) { - utils.each(root.getNodesByTagName("li"), function(li) { - var tmpP = UE.uNode.createElement("p"); - for (var i = 0, ci; (ci = li.children[i]); ) { - if (ci.type == "text" || dtd.p[ci.tagName]) { - tmpP.appendChild(ci); - } else { - if (tmpP.firstChild()) { - li.insertBefore(tmpP, ci); - tmpP = UE.uNode.createElement("p"); - i = i + 2; - } else { - i++; - } - } - } - if ((tmpP.firstChild() && !tmpP.parentNode) || !li.firstChild()) { - li.appendChild(tmpP); - } - //trace:3357 - //p不能为空 - if (!tmpP.firstChild()) { - tmpP.innerHTML(browser.ie ? " " : "
                      "); - } - //去掉末尾的空白 - var p = li.firstChild(); - var lastChild = p.lastChild(); - if ( - lastChild && - lastChild.type == "text" && - /^\s*$/.test(lastChild.data) - ) { - p.removeChild(lastChild); - } - }); - if (me.options.autoTransWordToList) { - var orderlisttype = { - num1: /^\d+\)/, - decimal: /^\d+\./, - "lower-alpha": /^[a-z]+\)/, - "upper-alpha": /^[A-Z]+\./, - cn: /^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/, - cn2: /^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/ - }, - unorderlisttype = { - square: "n" - }; - function checkListType(content, container) { - var span = container.firstChild(); - if ( - span && - span.type == "element" && - span.tagName == "span" && - /Wingdings|Symbol/.test(span.getStyle("font-family")) - ) { - for (var p in unorderlisttype) { - if (unorderlisttype[p] == span.data) { - return p; - } - } - return "disc"; - } - for (var p in orderlisttype) { - if (orderlisttype[p].test(content)) { - return p; - } - } - } - utils.each(root.getNodesByTagName("p"), function(node) { - if (node.getAttr("class") != "MsoListParagraph") { - return; - } - - //word粘贴过来的会带有margin要去掉,但这样也可能会误命中一些央视 - node.setStyle("margin", ""); - node.setStyle("margin-left", ""); - node.setAttr("class", ""); - - function appendLi(list, p, type) { - if (list.tagName == "ol") { - if (browser.ie) { - var first = p.firstChild(); - if ( - first.type == "element" && - first.tagName == "span" && - orderlisttype[type].test(first.innerText()) - ) { - p.removeChild(first); - } - } else { - p.innerHTML(p.innerHTML().replace(orderlisttype[type], "")); - } - } else { - p.removeChild(p.firstChild()); - } - - var li = UE.uNode.createElement("li"); - li.appendChild(p); - list.appendChild(li); - } - var tmp = node, - type, - cacheNode = node; - - if ( - node.parentNode.tagName != "li" && - (type = checkListType(node.innerText(), node)) - ) { - var list = UE.uNode.createElement( - me.options.insertorderedlist.hasOwnProperty(type) ? "ol" : "ul" - ); - if (customStyle[type]) { - list.setAttr("class", "custom_" + type); - } else { - list.setStyle("list-style-type", type); - } - while ( - node && - node.parentNode.tagName != "li" && - checkListType(node.innerText(), node) - ) { - tmp = node.nextSibling(); - if (!tmp) { - node.parentNode.insertBefore(list, node); - } - appendLi(list, node, type); - node = tmp; - } - if (!list.parentNode && node && node.parentNode) { - node.parentNode.insertBefore(list, node); - } - } - var span = cacheNode.firstChild(); - if ( - span && - span.type == "element" && - span.tagName == "span" && - /^\s*( )+\s*$/.test(span.innerText()) - ) { - span.parentNode.removeChild(span); - } - }); - } - }); - - //调整索引标签 - me.addListener("contentchange", function() { - adjustListStyle(me.document); - }); - - function adjustListStyle(doc, ignore) { - utils.each(domUtils.getElementsByTagName(doc, "ol ul"), function(node) { - if (!domUtils.inDoc(node, doc)) return; - - var parent = node.parentNode; - if (parent.tagName == node.tagName) { - var nodeStyleType = - getStyle(node) || (node.tagName == "OL" ? "decimal" : "disc"), - parentStyleType = - getStyle(parent) || (parent.tagName == "OL" ? "decimal" : "disc"); - if (nodeStyleType == parentStyleType) { - var styleIndex = utils.indexOf( - listStyle[node.tagName], - nodeStyleType - ); - styleIndex = styleIndex + 1 == listStyle[node.tagName].length - ? 0 - : styleIndex + 1; - setListStyle(node, listStyle[node.tagName][styleIndex]); - } - } - var index = 0, - type = 2; - if (domUtils.hasClass(node, /custom_/)) { - if ( - !( - /[ou]l/i.test(parent.tagName) && - domUtils.hasClass(parent, /custom_/) - ) - ) { - type = 1; - } - } else { - if ( - /[ou]l/i.test(parent.tagName) && - domUtils.hasClass(parent, /custom_/) - ) { - type = 3; - } - } - - var style = domUtils.getStyle(node, "list-style-type"); - style && (node.style.cssText = "list-style-type:" + style); - node.className = - utils.trim(node.className.replace(/list-paddingleft-\w+/, "")) + - " list-paddingleft-" + - type; - utils.each(domUtils.getElementsByTagName(node, "li"), function(li) { - li.style.cssText && (li.style.cssText = ""); - if (!li.firstChild) { - domUtils.remove(li); - return; - } - if (li.parentNode !== node) { - return; - } - index++; - if (domUtils.hasClass(node, /custom_/)) { - var paddingLeft = 1, - currentStyle = getStyle(node); - if (node.tagName == "OL") { - if (currentStyle) { - switch (currentStyle) { - case "cn": - case "cn1": - case "cn2": - if ( - index > 10 && - (index % 10 == 0 || (index > 10 && index < 20)) - ) { - paddingLeft = 2; - } else if (index > 20) { - paddingLeft = 3; - } - break; - case "num2": - if (index > 9) { - paddingLeft = 2; - } - } - } - li.className = - "list-" + - customStyle[currentStyle] + - index + - " " + - "list-" + - currentStyle + - "-paddingleft-" + - paddingLeft; - } else { - li.className = - "list-" + - customStyle[currentStyle] + - " " + - "list-" + - currentStyle + - "-paddingleft"; - } - } else { - li.className = li.className.replace(/list-[\w\-]+/gi, ""); - } - var className = li.getAttribute("class"); - if (className !== null && !className.replace(/\s/g, "")) { - domUtils.removeAttributes(li, "class"); - } - }); - !ignore && - adjustList( - node, - node.tagName.toLowerCase(), - getStyle(node) || domUtils.getStyle(node, "list-style-type"), - true - ); - }); - } - function adjustList(list, tag, style, ignoreEmpty) { - var nextList = list.nextSibling; - if ( - nextList && - nextList.nodeType == 1 && - nextList.tagName.toLowerCase() == tag && - (getStyle(nextList) || - domUtils.getStyle(nextList, "list-style-type") || - (tag == "ol" ? "decimal" : "disc")) == style - ) { - domUtils.moveChild(nextList, list); - if (nextList.childNodes.length == 0) { - domUtils.remove(nextList); - } - } - if (nextList && domUtils.isFillChar(nextList)) { - domUtils.remove(nextList); - } - var preList = list.previousSibling; - if ( - preList && - preList.nodeType == 1 && - preList.tagName.toLowerCase() == tag && - (getStyle(preList) || - domUtils.getStyle(preList, "list-style-type") || - (tag == "ol" ? "decimal" : "disc")) == style - ) { - domUtils.moveChild(list, preList); - } - if (preList && domUtils.isFillChar(preList)) { - domUtils.remove(preList); - } - !ignoreEmpty && domUtils.isEmptyBlock(list) && domUtils.remove(list); - if (getStyle(list)) { - adjustListStyle(list.ownerDocument, true); - } - } - - function setListStyle(list, style) { - if (customStyle[style]) { - list.className = "custom_" + style; - } - try { - domUtils.setStyle(list, "list-style-type", style); - } catch (e) {} - } - function clearEmptySibling(node) { - var tmpNode = node.previousSibling; - if (tmpNode && domUtils.isEmptyBlock(tmpNode)) { - domUtils.remove(tmpNode); - } - tmpNode = node.nextSibling; - if (tmpNode && domUtils.isEmptyBlock(tmpNode)) { - domUtils.remove(tmpNode); - } - } - - me.addListener("keydown", function(type, evt) { - function preventAndSave() { - evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); - me.fireEvent("contentchange"); - me.undoManger && me.undoManger.save(); - } - function findList(node, filterFn) { - while (node && !domUtils.isBody(node)) { - if (filterFn(node)) { - return null; - } - if (node.nodeType == 1 && /[ou]l/i.test(node.tagName)) { - return node; - } - node = node.parentNode; - } - return null; - } - var keyCode = evt.keyCode || evt.which; - if (keyCode == 13 && !evt.shiftKey) { - //回车 - var rng = me.selection.getRange(), - parent = domUtils.findParent( - rng.startContainer, - function(node) { - return domUtils.isBlockElm(node); - }, - true - ), - li = domUtils.findParentByTagName(rng.startContainer, "li", true); - if (parent && parent.tagName != "PRE" && !li) { - var html = parent.innerHTML.replace( - new RegExp(domUtils.fillChar, "g"), - "" - ); - if (/^\s*1\s*\.[^\d]/.test(html)) { - parent.innerHTML = html.replace(/^\s*1\s*\./, ""); - rng.setStartAtLast(parent).collapse(true).select(); - me.__hasEnterExecCommand = true; - me.execCommand("insertorderedlist"); - me.__hasEnterExecCommand = false; - } - } - var range = me.selection.getRange(), - start = findList(range.startContainer, function(node) { - return node.tagName == "TABLE"; - }), - end = range.collapsed - ? start - : findList(range.endContainer, function(node) { - return node.tagName == "TABLE"; - }); - - if (start && end && start === end) { - if (!range.collapsed) { - start = domUtils.findParentByTagName( - range.startContainer, - "li", - true - ); - end = domUtils.findParentByTagName(range.endContainer, "li", true); - if (start && end && start === end) { - range.deleteContents(); - li = domUtils.findParentByTagName(range.startContainer, "li", true); - if (li && domUtils.isEmptyBlock(li)) { - pre = li.previousSibling; - next = li.nextSibling; - p = me.document.createElement("p"); - - domUtils.fillNode(me.document, p); - parentList = li.parentNode; - if (pre && next) { - range.setStart(next, 0).collapse(true).select(true); - domUtils.remove(li); - } else { - if ((!pre && !next) || !pre) { - parentList.parentNode.insertBefore(p, parentList); - } else { - li.parentNode.parentNode.insertBefore( - p, - parentList.nextSibling - ); - } - domUtils.remove(li); - if (!parentList.firstChild) { - domUtils.remove(parentList); - } - range.setStart(p, 0).setCursor(); - } - preventAndSave(); - return; - } - } else { - var tmpRange = range.cloneRange(), - bk = tmpRange.collapse(false).createBookmark(); - - range.deleteContents(); - tmpRange.moveToBookmark(bk); - var li = domUtils.findParentByTagName( - tmpRange.startContainer, - "li", - true - ); - - clearEmptySibling(li); - tmpRange.select(); - preventAndSave(); - return; - } - } - - li = domUtils.findParentByTagName(range.startContainer, "li", true); - - if (li) { - if (domUtils.isEmptyBlock(li)) { - bk = range.createBookmark(); - var parentList = li.parentNode; - if (li !== parentList.lastChild) { - domUtils.breakParent(li, parentList); - clearEmptySibling(li); - } else { - parentList.parentNode.insertBefore(li, parentList.nextSibling); - if (domUtils.isEmptyNode(parentList)) { - domUtils.remove(parentList); - } - } - //嵌套不处理 - if (!dtd.$list[li.parentNode.tagName]) { - if (!domUtils.isBlockElm(li.firstChild)) { - p = me.document.createElement("p"); - li.parentNode.insertBefore(p, li); - while (li.firstChild) { - p.appendChild(li.firstChild); - } - domUtils.remove(li); - } else { - domUtils.remove(li, true); - } - } - range.moveToBookmark(bk).select(); - } else { - var first = li.firstChild; - if (!first || !domUtils.isBlockElm(first)) { - var p = me.document.createElement("p"); - - !li.firstChild && domUtils.fillNode(me.document, p); - while (li.firstChild) { - p.appendChild(li.firstChild); - } - li.appendChild(p); - first = p; - } - - var span = me.document.createElement("span"); - - range.insertNode(span); - domUtils.breakParent(span, li); - - var nextLi = span.nextSibling; - first = nextLi.firstChild; - - if (!first) { - p = me.document.createElement("p"); - - domUtils.fillNode(me.document, p); - nextLi.appendChild(p); - first = p; - } - if (domUtils.isEmptyNode(first)) { - first.innerHTML = ""; - domUtils.fillNode(me.document, first); - } - - range.setStart(first, 0).collapse(true).shrinkBoundary().select(); - domUtils.remove(span); - var pre = nextLi.previousSibling; - if (pre && domUtils.isEmptyBlock(pre)) { - pre.innerHTML = "

                      "; - domUtils.fillNode(me.document, pre.firstChild); - } - } - // } - preventAndSave(); - } - } - } - if (keyCode == 8) { - //修中ie中li下的问题 - range = me.selection.getRange(); - if (range.collapsed && domUtils.isStartInblock(range)) { - tmpRange = range.cloneRange().trimBoundary(); - li = domUtils.findParentByTagName(range.startContainer, "li", true); - //要在li的最左边,才能处理 - if (li && domUtils.isStartInblock(tmpRange)) { - start = domUtils.findParentByTagName(range.startContainer, "p", true); - if (start && start !== li.firstChild) { - var parentList = domUtils.findParentByTagName(start, ["ol", "ul"]); - domUtils.breakParent(start, parentList); - clearEmptySibling(start); - me.fireEvent("contentchange"); - range.setStart(start, 0).setCursor(false, true); - me.fireEvent("saveScene"); - domUtils.preventDefault(evt); - return; - } - - if (li && (pre = li.previousSibling)) { - if (keyCode == 46 && li.childNodes.length) { - return; - } - //有可能上边的兄弟节点是个2级菜单,要追加到2级菜单的最后的li - if (dtd.$list[pre.tagName]) { - pre = pre.lastChild; - } - me.undoManger && me.undoManger.save(); - first = li.firstChild; - if (domUtils.isBlockElm(first)) { - if (domUtils.isEmptyNode(first)) { - // range.setEnd(pre, pre.childNodes.length).shrinkBoundary().collapse().select(true); - pre.appendChild(first); - range.setStart(first, 0).setCursor(false, true); - //first不是唯一的节点 - while (li.firstChild) { - pre.appendChild(li.firstChild); - } - } else { - span = me.document.createElement("span"); - range.insertNode(span); - //判断pre是否是空的节点,如果是


                      类型的空节点,干掉p标签防止它占位 - if (domUtils.isEmptyBlock(pre)) { - pre.innerHTML = ""; - } - domUtils.moveChild(li, pre); - range.setStartBefore(span).collapse(true).select(true); - - domUtils.remove(span); - } - } else { - if (domUtils.isEmptyNode(li)) { - var p = me.document.createElement("p"); - pre.appendChild(p); - range.setStart(p, 0).setCursor(); - // range.setEnd(pre, pre.childNodes.length).shrinkBoundary().collapse().select(true); - } else { - range - .setEnd(pre, pre.childNodes.length) - .collapse() - .select(true); - while (li.firstChild) { - pre.appendChild(li.firstChild); - } - } - } - domUtils.remove(li); - me.fireEvent("contentchange"); - me.fireEvent("saveScene"); - domUtils.preventDefault(evt); - return; - } - //trace:980 - - if (li && !li.previousSibling) { - var parentList = li.parentNode; - var bk = range.createBookmark(); - if (domUtils.isTagNode(parentList.parentNode, "ol ul")) { - parentList.parentNode.insertBefore(li, parentList); - if (domUtils.isEmptyNode(parentList)) { - domUtils.remove(parentList); - } - } else { - while (li.firstChild) { - parentList.parentNode.insertBefore(li.firstChild, parentList); - } - - domUtils.remove(li); - if (domUtils.isEmptyNode(parentList)) { - domUtils.remove(parentList); - } - } - range.moveToBookmark(bk).setCursor(false, true); - me.fireEvent("contentchange"); - me.fireEvent("saveScene"); - domUtils.preventDefault(evt); - return; - } - } - } - } - }); - - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - if (keyCode == 8) { - var rng = me.selection.getRange(), - list; - if ( - (list = domUtils.findParentByTagName( - rng.startContainer, - ["ol", "ul"], - true - )) - ) { - adjustList( - list, - list.tagName.toLowerCase(), - getStyle(list) || domUtils.getComputedStyle(list, "list-style-type"), - true - ); - } - } - }); - //处理tab键 - me.addListener("tabkeydown", function() { - var range = me.selection.getRange(); - - //控制级数 - function checkLevel(li) { - if (me.options.maxListLevel != -1) { - var level = li.parentNode, - levelNum = 0; - while (/[ou]l/i.test(level.tagName)) { - levelNum++; - level = level.parentNode; - } - if (levelNum >= me.options.maxListLevel) { - return true; - } - } - } - //只以开始为准 - //todo 后续改进 - var li = domUtils.findParentByTagName(range.startContainer, "li", true); - if (li) { - var bk; - if (range.collapsed) { - if (checkLevel(li)) return true; - var parentLi = li.parentNode, - list = me.document.createElement(parentLi.tagName), - index = utils.indexOf( - listStyle[list.tagName], - getStyle(parentLi) || - domUtils.getComputedStyle(parentLi, "list-style-type") - ); - index = index + 1 == listStyle[list.tagName].length ? 0 : index + 1; - var currentStyle = listStyle[list.tagName][index]; - setListStyle(list, currentStyle); - if (domUtils.isStartInblock(range)) { - me.fireEvent("saveScene"); - bk = range.createBookmark(); - parentLi.insertBefore(list, li); - list.appendChild(li); - adjustList(list, list.tagName.toLowerCase(), currentStyle); - me.fireEvent("contentchange"); - range.moveToBookmark(bk).select(true); - return true; - } - } else { - me.fireEvent("saveScene"); - bk = range.createBookmark(); - for ( - var i = 0, closeList, parents = domUtils.findParents(li), ci; - (ci = parents[i++]); - - ) { - if (domUtils.isTagNode(ci, "ol ul")) { - closeList = ci; - break; - } - } - var current = li; - if (bk.end) { - while ( - current && - !( - domUtils.getPosition(current, bk.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - if (checkLevel(current)) { - current = domUtils.getNextDomNode(current, false, null, function( - node - ) { - return node !== closeList; - }); - continue; - } - var parentLi = current.parentNode, - list = me.document.createElement(parentLi.tagName), - index = utils.indexOf( - listStyle[list.tagName], - getStyle(parentLi) || - domUtils.getComputedStyle(parentLi, "list-style-type") - ); - var currentIndex = index + 1 == listStyle[list.tagName].length - ? 0 - : index + 1; - var currentStyle = listStyle[list.tagName][currentIndex]; - setListStyle(list, currentStyle); - parentLi.insertBefore(list, current); - while ( - current && - !( - domUtils.getPosition(current, bk.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - li = current.nextSibling; - list.appendChild(current); - if (!li || domUtils.isTagNode(li, "ol ul")) { - if (li) { - while ((li = li.firstChild)) { - if (li.tagName == "LI") { - break; - } - } - } else { - li = domUtils.getNextDomNode(current, false, null, function( - node - ) { - return node !== closeList; - }); - } - break; - } - current = li; - } - adjustList(list, list.tagName.toLowerCase(), currentStyle); - current = li; - } - } - me.fireEvent("contentchange"); - range.moveToBookmark(bk).select(); - return true; - } - } - }); - function getLi(start) { - while (start && !domUtils.isBody(start)) { - if (start.nodeName == "TABLE") { - return null; - } - if (start.nodeName == "LI") { - return start; - } - start = start.parentNode; - } - } - - /** - * 有序列表,与“insertunorderedlist”命令互斥 - * @command insertorderedlist - * @method execCommand - * @param { String } command 命令字符串 - * @param { String } style 插入的有序列表类型,值为:decimal,lower-alpha,lower-roman,upper-alpha,upper-roman,cn,cn1,cn2,num,num1,num2 - * @example - * ```javascript - * editor.execCommand( 'insertorderedlist','decimal'); - * ``` - */ - /** - * 查询当前选区内容是否有序列表 - * @command insertorderedlist - * @method queryCommandState - * @param { String } cmd 命令字符串 - * @return { int } 如果当前选区是有序列表返回1,否则返回0 - * @example - * ```javascript - * editor.queryCommandState( 'insertorderedlist' ); - * ``` - */ - /** - * 查询当前选区内容是否有序列表 - * @command insertorderedlist - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回当前有序列表的类型,值为null或decimal,lower-alpha,lower-roman,upper-alpha,upper-roman,cn,cn1,cn2,num,num1,num2 - * @example - * ```javascript - * editor.queryCommandValue( 'insertorderedlist' ); - * ``` - */ - - /** - * 无序列表,与“insertorderedlist”命令互斥 - * @command insertunorderedlist - * @method execCommand - * @param { String } command 命令字符串 - * @param { String } style 插入的无序列表类型,值为:circle,disc,square,dash,dot - * @example - * ```javascript - * editor.execCommand( 'insertunorderedlist','circle'); - * ``` - */ - /** - * 查询当前是否有word文档粘贴进来的图片 - * @command insertunorderedlist - * @method insertunorderedlist - * @param { String } command 命令字符串 - * @return { int } 如果当前选区是无序列表返回1,否则返回0 - * @example - * ```javascript - * editor.queryCommandState( 'insertunorderedlist' ); - * ``` - */ - /** - * 查询当前选区内容是否有序列表 - * @command insertunorderedlist - * @method queryCommandValue - * @param { String } command 命令字符串 - * @return { String } 返回当前无序列表的类型,值为null或circle,disc,square,dash,dot - * @example - * ```javascript - * editor.queryCommandValue( 'insertunorderedlist' ); - * ``` - */ - - me.commands["insertorderedlist"] = me.commands["insertunorderedlist"] = { - execCommand: function(command, style) { - if (!style) { - style = command.toLowerCase() == "insertorderedlist" - ? "decimal" - : "disc"; - } - var me = this, - range = this.selection.getRange(), - filterFn = function(node) { - return node.nodeType == 1 - ? node.tagName.toLowerCase() != "br" - : !domUtils.isWhitespace(node); - }, - tag = command.toLowerCase() == "insertorderedlist" ? "ol" : "ul", - frag = me.document.createDocumentFragment(); - //去掉是因为会出现选到末尾,导致adjustmentBoundary缩到ol/ul的位置 - //range.shrinkBoundary();//.adjustmentBoundary(); - range.adjustmentBoundary().shrinkBoundary(); - var bko = range.createBookmark(true), - start = getLi(me.document.getElementById(bko.start)), - modifyStart = 0, - end = getLi(me.document.getElementById(bko.end)), - modifyEnd = 0, - startParent, - endParent, - list, - tmp; - - if (start || end) { - start && (startParent = start.parentNode); - if (!bko.end) { - end = start; - } - end && (endParent = end.parentNode); - - if (startParent === endParent) { - while (start !== end) { - tmp = start; - start = start.nextSibling; - if (!domUtils.isBlockElm(tmp.firstChild)) { - var p = me.document.createElement("p"); - while (tmp.firstChild) { - p.appendChild(tmp.firstChild); - } - tmp.appendChild(p); - } - frag.appendChild(tmp); - } - tmp = me.document.createElement("span"); - startParent.insertBefore(tmp, end); - if (!domUtils.isBlockElm(end.firstChild)) { - p = me.document.createElement("p"); - while (end.firstChild) { - p.appendChild(end.firstChild); - } - end.appendChild(p); - } - frag.appendChild(end); - domUtils.breakParent(tmp, startParent); - if (domUtils.isEmptyNode(tmp.previousSibling)) { - domUtils.remove(tmp.previousSibling); - } - if (domUtils.isEmptyNode(tmp.nextSibling)) { - domUtils.remove(tmp.nextSibling); - } - var nodeStyle = - getStyle(startParent) || - domUtils.getComputedStyle(startParent, "list-style-type") || - (command.toLowerCase() == "insertorderedlist" ? "decimal" : "disc"); - if (startParent.tagName.toLowerCase() == tag && nodeStyle == style) { - for ( - var i = 0, ci, tmpFrag = me.document.createDocumentFragment(); - (ci = frag.firstChild); - - ) { - if (domUtils.isTagNode(ci, "ol ul")) { - // 删除时,子列表不处理 - // utils.each(domUtils.getElementsByTagName(ci,'li'),function(li){ - // while(li.firstChild){ - // tmpFrag.appendChild(li.firstChild); - // } - // - // }); - tmpFrag.appendChild(ci); - } else { - while (ci.firstChild) { - tmpFrag.appendChild(ci.firstChild); - domUtils.remove(ci); - } - } - } - tmp.parentNode.insertBefore(tmpFrag, tmp); - } else { - list = me.document.createElement(tag); - setListStyle(list, style); - list.appendChild(frag); - tmp.parentNode.insertBefore(list, tmp); - } - - domUtils.remove(tmp); - list && adjustList(list, tag, style); - range.moveToBookmark(bko).select(); - return; - } - //开始 - if (start) { - while (start) { - tmp = start.nextSibling; - if (domUtils.isTagNode(start, "ol ul")) { - frag.appendChild(start); - } else { - var tmpfrag = me.document.createDocumentFragment(), - hasBlock = 0; - while (start.firstChild) { - if (domUtils.isBlockElm(start.firstChild)) { - hasBlock = 1; - } - tmpfrag.appendChild(start.firstChild); - } - if (!hasBlock) { - var tmpP = me.document.createElement("p"); - tmpP.appendChild(tmpfrag); - frag.appendChild(tmpP); - } else { - frag.appendChild(tmpfrag); - } - domUtils.remove(start); - } - - start = tmp; - } - startParent.parentNode.insertBefore(frag, startParent.nextSibling); - if (domUtils.isEmptyNode(startParent)) { - range.setStartBefore(startParent); - domUtils.remove(startParent); - } else { - range.setStartAfter(startParent); - } - modifyStart = 1; - } - - if (end && domUtils.inDoc(endParent, me.document)) { - //结束 - start = endParent.firstChild; - while (start && start !== end) { - tmp = start.nextSibling; - if (domUtils.isTagNode(start, "ol ul")) { - frag.appendChild(start); - } else { - tmpfrag = me.document.createDocumentFragment(); - hasBlock = 0; - while (start.firstChild) { - if (domUtils.isBlockElm(start.firstChild)) { - hasBlock = 1; - } - tmpfrag.appendChild(start.firstChild); - } - if (!hasBlock) { - tmpP = me.document.createElement("p"); - tmpP.appendChild(tmpfrag); - frag.appendChild(tmpP); - } else { - frag.appendChild(tmpfrag); - } - domUtils.remove(start); - } - start = tmp; - } - var tmpDiv = domUtils.createElement(me.document, "div", { - tmpDiv: 1 - }); - domUtils.moveChild(end, tmpDiv); - - frag.appendChild(tmpDiv); - domUtils.remove(end); - endParent.parentNode.insertBefore(frag, endParent); - range.setEndBefore(endParent); - if (domUtils.isEmptyNode(endParent)) { - domUtils.remove(endParent); - } - - modifyEnd = 1; - } - } - - if (!modifyStart) { - range.setStartBefore(me.document.getElementById(bko.start)); - } - if (bko.end && !modifyEnd) { - range.setEndAfter(me.document.getElementById(bko.end)); - } - range.enlarge(true, function(node) { - return notExchange[node.tagName]; - }); - - frag = me.document.createDocumentFragment(); - - var bk = range.createBookmark(), - current = domUtils.getNextDomNode(bk.start, false, filterFn), - tmpRange = range.cloneRange(), - tmpNode, - block = domUtils.isBlockElm; - - while ( - current && - current !== bk.end && - domUtils.getPosition(current, bk.end) & domUtils.POSITION_PRECEDING - ) { - if (current.nodeType == 3 || dtd.li[current.tagName]) { - if (current.nodeType == 1 && dtd.$list[current.tagName]) { - while (current.firstChild) { - frag.appendChild(current.firstChild); - } - tmpNode = domUtils.getNextDomNode(current, false, filterFn); - domUtils.remove(current); - current = tmpNode; - continue; - } - tmpNode = current; - tmpRange.setStartBefore(current); - - while ( - current && - current !== bk.end && - (!block(current) || domUtils.isBookmarkNode(current)) - ) { - tmpNode = current; - current = domUtils.getNextDomNode(current, false, null, function( - node - ) { - return !notExchange[node.tagName]; - }); - } - - if (current && block(current)) { - tmp = domUtils.getNextDomNode(tmpNode, false, filterFn); - if (tmp && domUtils.isBookmarkNode(tmp)) { - current = domUtils.getNextDomNode(tmp, false, filterFn); - tmpNode = tmp; - } - } - tmpRange.setEndAfter(tmpNode); - - current = domUtils.getNextDomNode(tmpNode, false, filterFn); - - var li = range.document.createElement("li"); - - li.appendChild(tmpRange.extractContents()); - if (domUtils.isEmptyNode(li)) { - var tmpNode = range.document.createElement("p"); - while (li.firstChild) { - tmpNode.appendChild(li.firstChild); - } - li.appendChild(tmpNode); - } - frag.appendChild(li); - } else { - current = domUtils.getNextDomNode(current, true, filterFn); - } - } - range.moveToBookmark(bk).collapse(true); - list = me.document.createElement(tag); - setListStyle(list, style); - list.appendChild(frag); - range.insertNode(list); - //当前list上下看能否合并 - adjustList(list, tag, style); - //去掉冗余的tmpDiv - for ( - var i = 0, ci, tmpDivs = domUtils.getElementsByTagName(list, "div"); - (ci = tmpDivs[i++]); - - ) { - if (ci.getAttribute("tmpDiv")) { - domUtils.remove(ci, true); - } - } - range.moveToBookmark(bko).select(); - }, - queryCommandState: function(command) { - var tag = command.toLowerCase() == "insertorderedlist" ? "ol" : "ul"; - var path = this.selection.getStartElementPath(); - for (var i = 0, ci; (ci = path[i++]); ) { - if (ci.nodeName == "TABLE") { - return 0; - } - if (tag == ci.nodeName.toLowerCase()) { - return 1; - } - } - return 0; - }, - queryCommandValue: function(command) { - var tag = command.toLowerCase() == "insertorderedlist" ? "ol" : "ul"; - var path = this.selection.getStartElementPath(), - node; - for (var i = 0, ci; (ci = path[i++]); ) { - if (ci.nodeName == "TABLE") { - node = null; - break; - } - if (tag == ci.nodeName.toLowerCase()) { - node = ci; - break; - } - } - return node - ? getStyle(node) || domUtils.getComputedStyle(node, "list-style-type") - : null; - } - }; -}; - - -// plugins/source.js -/** - * 源码编辑插件 - * @file - * @since 1.2.6.1 - */ - -;(function() { - var sourceEditors = { - textarea: function(editor, holder) { - var textarea = holder.ownerDocument.createElement("textarea"); - textarea.style.cssText = - "position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;"; - // todo: IE下只有onresize属性可用... 很纠结 - if (browser.ie && browser.version < 8) { - textarea.style.width = holder.offsetWidth + "px"; - textarea.style.height = holder.offsetHeight + "px"; - holder.onresize = function() { - textarea.style.width = holder.offsetWidth + "px"; - textarea.style.height = holder.offsetHeight + "px"; - }; - } - holder.appendChild(textarea); - return { - setContent: function(content) { - textarea.value = content; - }, - getContent: function() { - return textarea.value; - }, - select: function() { - var range; - if (browser.ie) { - range = textarea.createTextRange(); - range.collapse(true); - range.select(); - } else { - //todo: chrome下无法设置焦点 - textarea.setSelectionRange(0, 0); - textarea.focus(); - } - }, - dispose: function() { - holder.removeChild(textarea); - // todo - holder.onresize = null; - textarea = null; - holder = null; - }, - focus: function (){ - textarea.focus(); - }, - blur: function (){ - textarea.blur(); - } - }; - }, - codemirror: function(editor, holder) { - var codeEditor = window.CodeMirror(holder, { - mode: "text/html", - tabMode: "indent", - lineNumbers: true, - lineWrapping: true - }); - var dom = codeEditor.getWrapperElement(); - dom.style.cssText = - 'position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;'; - codeEditor.getScrollerElement().style.cssText = - "position:absolute;left:0;top:0;width:100%;height:100%;"; - codeEditor.refresh(); - return { - getCodeMirror: function() { - return codeEditor; - }, - setContent: function(content) { - codeEditor.setValue(content); - }, - getContent: function() { - return codeEditor.getValue(); - }, - select: function() { - codeEditor.focus(); - }, - dispose: function() { - holder.removeChild(dom); - dom = null; - codeEditor = null; - }, - focus: function (){ - codeEditor.focus(); - }, - blur: function (){ - // codeEditor.blur(); - // since codemirror not support blur() - codeEditor.setOption('readOnly', true); - codeEditor.setOption('readOnly', false); - } - }; - } - }; - - UE.plugins["source"] = function() { - var me = this; - var opt = this.options; - var sourceMode = false; - var sourceEditor; - var orgSetContent; - var orgFocus; - var orgBlur; - opt.sourceEditor = browser.ie - ? "textarea" - : opt.sourceEditor || "codemirror"; - - me.setOpt({ - sourceEditorFirst: false - }); - function createSourceEditor(holder) { - return sourceEditors[ - opt.sourceEditor == "codemirror" && window.CodeMirror - ? "codemirror" - : "textarea" - ](me, holder); - } - - var bakCssText; - //解决在源码模式下getContent不能得到最新的内容问题 - var oldGetContent, bakAddress; - - /** - * 切换源码模式和编辑模式 - * @command source - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'source'); - * ``` - */ - - /** - * 查询当前编辑区域的状态是源码模式还是可视化模式 - * @command source - * @method queryCommandState - * @param { String } cmd 命令字符串 - * @return { int } 如果当前是源码编辑模式,返回1,否则返回0 - * @example - * ```javascript - * editor.queryCommandState( 'source' ); - * ``` - */ - - me.commands["source"] = { - execCommand: function() { - sourceMode = !sourceMode; - if (sourceMode) { - bakAddress = me.selection.getRange().createAddress(false, true); - me.undoManger && me.undoManger.save(true); - if (browser.gecko) { - me.body.contentEditable = false; - } - - bakCssText = me.iframe.style.cssText; - me.iframe.style.cssText += - "position:absolute;left:-32768px;top:-32768px;"; - - me.fireEvent("beforegetcontent"); - var root = UE.htmlparser(me.body.innerHTML); - me.filterOutputRule(root); - root.traversal(function(node) { - if (node.type == "element") { - switch (node.tagName) { - case "td": - case "th": - case "caption": - if (node.children && node.children.length == 1) { - if (node.firstChild().tagName == "br") { - node.removeChild(node.firstChild()); - } - } - break; - case "pre": - node.innerText(node.innerText().replace(/ /g, " ")); - } - } - }); - - me.fireEvent("aftergetcontent"); - - var content = root.toHtml(true); - - sourceEditor = createSourceEditor(me.iframe.parentNode); - - sourceEditor.setContent(content); - - orgSetContent = me.setContent; - - me.setContent = function(html) { - //这里暂时不触发事件,防止报错 - var root = UE.htmlparser(html); - me.filterInputRule(root); - html = root.toHtml(); - sourceEditor.setContent(html); - }; - - setTimeout(function() { - sourceEditor.select(); - me.addListener("fullscreenchanged", function() { - try { - sourceEditor.getCodeMirror().refresh(); - } catch (e) {} - }); - }); - - //重置getContent,源码模式下取值也能是最新的数据 - oldGetContent = me.getContent; - me.getContent = function() { - return ( - sourceEditor.getContent() || - "

                      " + (browser.ie ? "" : "
                      ") + "

                      " - ); - }; - - orgFocus = me.focus; - orgBlur = me.blur; - - me.focus = function(){ - sourceEditor.focus(); - }; - - me.blur = function(){ - orgBlur.call(me); - sourceEditor.blur(); - }; - } else { - me.iframe.style.cssText = bakCssText; - var cont = - sourceEditor.getContent() || - "

                      " + (browser.ie ? "" : "
                      ") + "

                      "; - //处理掉block节点前后的空格,有可能会误命中,暂时不考虑 - cont = cont.replace( - new RegExp("[\\r\\t\\n ]*]*)>", "g"), - function(a, b) { - if (b && !dtd.$inlineWithA[b.toLowerCase()]) { - return a.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g, ""); - } - return a.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g, ""); - } - ); - - me.setContent = orgSetContent; - - me.setContent(cont); - sourceEditor.dispose(); - sourceEditor = null; - //还原getContent方法 - me.getContent = oldGetContent; - me.focus = orgFocus; - me.blur = orgBlur; - var first = me.body.firstChild; - //trace:1106 都删除空了,下边会报错,所以补充一个p占位 - if (!first) { - me.body.innerHTML = "

                      " + (browser.ie ? "" : "
                      ") + "

                      "; - first = me.body.firstChild; - } - - //要在ifm为显示时ff才能取到selection,否则报错 - //这里不能比较位置了 - me.undoManger && me.undoManger.save(true); - - if (browser.gecko) { - var input = document.createElement("input"); - input.style.cssText = "position:absolute;left:0;top:-32768px"; - - document.body.appendChild(input); - - me.body.contentEditable = false; - setTimeout(function() { - domUtils.setViewportOffset(input, { left: -32768, top: 0 }); - input.focus(); - setTimeout(function() { - me.body.contentEditable = true; - me.selection.getRange().moveToAddress(bakAddress).select(true); - domUtils.remove(input); - }); - }); - } else { - //ie下有可能报错,比如在代码顶头的情况 - try { - me.selection.getRange().moveToAddress(bakAddress).select(true); - } catch (e) {} - } - } - this.fireEvent("sourcemodechanged", sourceMode); - }, - queryCommandState: function() { - return sourceMode | 0; - }, - notNeedUndo: 1 - }; - var oldQueryCommandState = me.queryCommandState; - - me.queryCommandState = function(cmdName) { - cmdName = cmdName.toLowerCase(); - if (sourceMode) { - //源码模式下可以开启的命令 - return cmdName in - { - source: 1, - fullscreen: 1 - } - ? 1 - : -1; - } - return oldQueryCommandState.apply(this, arguments); - }; - - if (opt.sourceEditor == "codemirror") { - me.addListener("ready", function() { - utils.loadFile( - document, - { - src: - opt.codeMirrorJsUrl || - opt.UEDITOR_HOME_URL + "third-party/codemirror/codemirror.js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - if (opt.sourceEditorFirst) { - setTimeout(function() { - me.execCommand("source"); - }, 0); - } - } - ); - utils.loadFile(document, { - tag: "link", - rel: "stylesheet", - type: "text/css", - href: - opt.codeMirrorCssUrl || - opt.UEDITOR_HOME_URL + "third-party/codemirror/codemirror.css" - }); - }); - } - }; -})(); - - -// plugins/enterkey.js -///import core -///import plugins/undo.js -///commands 设置回车标签p或br -///commandsName EnterKey -///commandsTitle 设置回车标签p或br -/** - * @description 处理回车 - * @author zhanyi - */ -UE.plugins["enterkey"] = function() { - var hTag, - me = this, - tag = me.options.enterTag; - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - if (keyCode == 13) { - var range = me.selection.getRange(), - start = range.startContainer, - doSave; - - //修正在h1-h6里边回车后不能嵌套p的问题 - if (!browser.ie) { - if (/h\d/i.test(hTag)) { - if (browser.gecko) { - var h = domUtils.findParentByTagName( - start, - [ - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "blockquote", - "caption", - "table" - ], - true - ); - if (!h) { - me.document.execCommand("formatBlock", false, "

                      "); - doSave = 1; - } - } else { - //chrome remove div - if (start.nodeType == 1) { - var tmp = me.document.createTextNode(""), - div; - range.insertNode(tmp); - div = domUtils.findParentByTagName(tmp, "div", true); - if (div) { - var p = me.document.createElement("p"); - while (div.firstChild) { - p.appendChild(div.firstChild); - } - div.parentNode.insertBefore(p, div); - domUtils.remove(div); - range.setStartBefore(tmp).setCursor(); - doSave = 1; - } - domUtils.remove(tmp); - } - } - - if (me.undoManger && doSave) { - me.undoManger.save(); - } - } - //没有站位符,会出现多行的问题 - browser.opera && range.select(); - } else { - me.fireEvent("saveScene", true, true); - } - } - }); - - me.addListener("keydown", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - if (keyCode == 13) { - //回车 - if (me.fireEvent("beforeenterkeydown")) { - domUtils.preventDefault(evt); - return; - } - me.fireEvent("saveScene", true, true); - hTag = ""; - - var range = me.selection.getRange(); - - if (!range.collapsed) { - //跨td不能删 - var start = range.startContainer, - end = range.endContainer, - startTd = domUtils.findParentByTagName(start, "td", true), - endTd = domUtils.findParentByTagName(end, "td", true); - if ( - (startTd && endTd && startTd !== endTd) || - (!startTd && endTd) || - (startTd && !endTd) - ) { - evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); - return; - } - } - if (tag == "p") { - if (!browser.ie) { - start = domUtils.findParentByTagName( - range.startContainer, - [ - "ol", - "ul", - "p", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "blockquote", - "caption" - ], - true - ); - - //opera下执行formatblock会在table的场景下有问题,回车在opera原生支持很好,所以暂时在opera去掉调用这个原生的command - //trace:2431 - if (!start && !browser.opera) { - me.document.execCommand("formatBlock", false, "

                      "); - - if (browser.gecko) { - range = me.selection.getRange(); - start = domUtils.findParentByTagName( - range.startContainer, - "p", - true - ); - start && domUtils.removeDirtyAttr(start); - } - } else { - hTag = start.tagName; - start.tagName.toLowerCase() == "p" && - browser.gecko && - domUtils.removeDirtyAttr(start); - } - } - } else { - evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); - - if (!range.collapsed) { - range.deleteContents(); - start = range.startContainer; - if ( - start.nodeType == 1 && - (start = start.childNodes[range.startOffset]) - ) { - while (start.nodeType == 1) { - if (dtd.$empty[start.tagName]) { - range.setStartBefore(start).setCursor(); - if (me.undoManger) { - me.undoManger.save(); - } - return false; - } - if (!start.firstChild) { - var br = range.document.createElement("br"); - start.appendChild(br); - range.setStart(start, 0).setCursor(); - if (me.undoManger) { - me.undoManger.save(); - } - return false; - } - start = start.firstChild; - } - if (start === range.startContainer.childNodes[range.startOffset]) { - br = range.document.createElement("br"); - range.insertNode(br).setCursor(); - } else { - range.setStart(start, 0).setCursor(); - } - } else { - br = range.document.createElement("br"); - range.insertNode(br).setStartAfter(br).setCursor(); - } - } else { - br = range.document.createElement("br"); - range.insertNode(br); - var parent = br.parentNode; - if (parent.lastChild === br) { - br.parentNode.insertBefore(br.cloneNode(true), br); - range.setStartBefore(br); - } else { - range.setStartAfter(br); - } - range.setCursor(); - } - } - } - }); -}; - - -// plugins/keystrokes.js -/* 处理特殊键的兼容性问题 */ -UE.plugins["keystrokes"] = function() { - var me = this; - var collapsed = true; - me.addListener("keydown", function(type, evt) { - var keyCode = evt.keyCode || evt.which, - rng = me.selection.getRange(); - - //处理全选的情况 - if ( - !rng.collapsed && - !(evt.ctrlKey || evt.shiftKey || evt.altKey || evt.metaKey) && - ((keyCode >= 65 && keyCode <= 90) || - (keyCode >= 48 && keyCode <= 57) || - (keyCode >= 96 && keyCode <= 111) || - { - 13: 1, - 8: 1, - 46: 1 - }[keyCode]) - ) { - var tmpNode = rng.startContainer; - if (domUtils.isFillChar(tmpNode)) { - rng.setStartBefore(tmpNode); - } - tmpNode = rng.endContainer; - if (domUtils.isFillChar(tmpNode)) { - rng.setEndAfter(tmpNode); - } - rng.txtToElmBoundary(); - //结束边界可能放到了br的前边,要把br包含进来 - // x[xxx]
                      - if (rng.endContainer && rng.endContainer.nodeType == 1) { - tmpNode = rng.endContainer.childNodes[rng.endOffset]; - if (tmpNode && domUtils.isBr(tmpNode)) { - rng.setEndAfter(tmpNode); - } - } - if (rng.startOffset == 0) { - tmpNode = rng.startContainer; - if (domUtils.isBoundaryNode(tmpNode, "firstChild")) { - tmpNode = rng.endContainer; - if ( - rng.endOffset == - (tmpNode.nodeType == 3 - ? tmpNode.nodeValue.length - : tmpNode.childNodes.length) && - domUtils.isBoundaryNode(tmpNode, "lastChild") - ) { - me.fireEvent("saveScene"); - me.body.innerHTML = "

                      " + (browser.ie ? "" : "
                      ") + "

                      "; - rng.setStart(me.body.firstChild, 0).setCursor(false, true); - me._selectionChange(); - return; - } - } - } - } - - //处理backspace - if (keyCode == keymap.Backspace) { - rng = me.selection.getRange(); - collapsed = rng.collapsed; - if (me.fireEvent("delkeydown", evt)) { - return; - } - var start, end; - //避免按两次删除才能生效的问题 - if (rng.collapsed && rng.inFillChar()) { - start = rng.startContainer; - - if (domUtils.isFillChar(start)) { - rng.setStartBefore(start).shrinkBoundary(true).collapse(true); - domUtils.remove(start); - } else { - start.nodeValue = start.nodeValue.replace( - new RegExp("^" + domUtils.fillChar), - "" - ); - rng.startOffset--; - rng.collapse(true).select(true); - } - } - - //解决选中control元素不能删除的问题 - if ((start = rng.getClosedNode())) { - me.fireEvent("saveScene"); - rng.setStartBefore(start); - domUtils.remove(start); - rng.setCursor(); - me.fireEvent("saveScene"); - domUtils.preventDefault(evt); - return; - } - //阻止在table上的删除 - if (!browser.ie) { - start = domUtils.findParentByTagName(rng.startContainer, "table", true); - end = domUtils.findParentByTagName(rng.endContainer, "table", true); - if ((start && !end) || (!start && end) || start !== end) { - evt.preventDefault(); - return; - } - } - } - //处理tab键的逻辑 - if (keyCode == keymap.Tab) { - //不处理以下标签 - var excludeTagNameForTabKey = { - ol: 1, - ul: 1, - table: 1 - }; - //处理组件里的tab按下事件 - if (me.fireEvent("tabkeydown", evt)) { - domUtils.preventDefault(evt); - return; - } - var range = me.selection.getRange(); - me.fireEvent("saveScene"); - for ( - var i = 0, - txt = "", - tabSize = me.options.tabSize || 4, - tabNode = me.options.tabNode || " "; - i < tabSize; - i++ - ) { - txt += tabNode; - } - var span = me.document.createElement("span"); - span.innerHTML = txt + domUtils.fillChar; - if (range.collapsed) { - range.insertNode(span.cloneNode(true).firstChild).setCursor(true); - } else { - var filterFn = function(node) { - return ( - domUtils.isBlockElm(node) && - !excludeTagNameForTabKey[node.tagName.toLowerCase()] - ); - }; - //普通的情况 - start = domUtils.findParent(range.startContainer, filterFn, true); - end = domUtils.findParent(range.endContainer, filterFn, true); - if (start && end && start === end) { - range.deleteContents(); - range.insertNode(span.cloneNode(true).firstChild).setCursor(true); - } else { - var bookmark = range.createBookmark(); - range.enlarge(true); - var bookmark2 = range.createBookmark(), - current = domUtils.getNextDomNode(bookmark2.start, false, filterFn); - while ( - current && - !( - domUtils.getPosition(current, bookmark2.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - current.insertBefore( - span.cloneNode(true).firstChild, - current.firstChild - ); - current = domUtils.getNextDomNode(current, false, filterFn); - } - range.moveToBookmark(bookmark2).moveToBookmark(bookmark).select(); - } - } - domUtils.preventDefault(evt); - } - //trace:1634 - //ff的del键在容器空的时候,也会删除 - if (browser.gecko && keyCode == 46) { - range = me.selection.getRange(); - if (range.collapsed) { - start = range.startContainer; - if (domUtils.isEmptyBlock(start)) { - var parent = start.parentNode; - while ( - domUtils.getChildCount(parent) == 1 && - !domUtils.isBody(parent) - ) { - start = parent; - parent = parent.parentNode; - } - if (start === parent.lastChild) evt.preventDefault(); - return; - } - } - } - - /* 修复在编辑区域快捷键 (Mac:meta+alt+I; Win:ctrl+shift+I) 打不开 chrome 控制台的问题 */ - browser.chrome && - me.on("keydown", function(type, e) { - var keyCode = e.keyCode || e.which; - if ( - ((e.metaKey && e.altKey) || (e.ctrlKey && e.shiftKey)) && - keyCode == 73 - ) { - return true; - } - }); - }); - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which, - rng, - me = this; - if (keyCode == keymap.Backspace) { - if (me.fireEvent("delkeyup")) { - return; - } - rng = me.selection.getRange(); - if (rng.collapsed) { - var tmpNode, - autoClearTagName = ["h1", "h2", "h3", "h4", "h5", "h6"]; - if ( - (tmpNode = domUtils.findParentByTagName( - rng.startContainer, - autoClearTagName, - true - )) - ) { - if (domUtils.isEmptyBlock(tmpNode)) { - var pre = tmpNode.previousSibling; - if (pre && pre.nodeName != "TABLE") { - domUtils.remove(tmpNode); - rng.setStartAtLast(pre).setCursor(false, true); - return; - } else { - var next = tmpNode.nextSibling; - if (next && next.nodeName != "TABLE") { - domUtils.remove(tmpNode); - rng.setStartAtFirst(next).setCursor(false, true); - return; - } - } - } - } - //处理当删除到body时,要重新给p标签展位 - if (domUtils.isBody(rng.startContainer)) { - var tmpNode = domUtils.createElement(me.document, "p", { - innerHTML: browser.ie ? domUtils.fillChar : "
                      " - }); - rng.insertNode(tmpNode).setStart(tmpNode, 0).setCursor(false, true); - } - } - - //chrome下如果删除了inline标签,浏览器会有记忆,在输入文字还是会套上刚才删除的标签,所以这里再选一次就不会了 - if ( - !collapsed && - (rng.startContainer.nodeType == 3 || - (rng.startContainer.nodeType == 1 && - domUtils.isEmptyBlock(rng.startContainer))) - ) { - if (browser.ie) { - var span = rng.document.createElement("span"); - rng.insertNode(span).setStartBefore(span).collapse(true); - rng.select(); - domUtils.remove(span); - } else { - rng.select(); - } - } - } - }); -}; - - -// plugins/fiximgclick.js -///import core -///commands 修复chrome下图片不能点击的问题,出现八个角可改变大小 -///commandsName FixImgClick -///commandsTitle 修复chrome下图片不能点击的问题,出现八个角可改变大小 -//修复chrome下图片不能点击的问题,出现八个角可改变大小 - -UE.plugins["fiximgclick"] = (function() { - var elementUpdated = false; - function Scale() { - this.editor = null; - this.resizer = null; - this.cover = null; - this.doc = document; - this.prePos = { x: 0, y: 0 }; - this.startPos = { x: 0, y: 0 }; - } - - (function() { - var rect = [ - //[left, top, width, height] - [0, 0, -1, -1], - [0, 0, 0, -1], - [0, 0, 1, -1], - [0, 0, -1, 0], - [0, 0, 1, 0], - [0, 0, -1, 1], - [0, 0, 0, 1], - [0, 0, 1, 1] - ]; - - Scale.prototype = { - init: function(editor) { - var me = this; - me.editor = editor; - me.startPos = this.prePos = { x: 0, y: 0 }; - me.dragId = -1; - - var hands = [], - cover = (me.cover = document.createElement("div")), - resizer = (me.resizer = document.createElement("div")); - - cover.id = me.editor.ui.id + "_imagescale_cover"; - cover.style.cssText = - "position:absolute;display:none;z-index:" + - me.editor.options.zIndex + - ";filter:alpha(opacity=0); opacity:0;background:#CCC;"; - domUtils.on(cover, "mousedown click", function() { - me.hide(); - }); - - for (i = 0; i < 8; i++) { - hands.push( - '' - ); - } - resizer.id = me.editor.ui.id + "_imagescale"; - resizer.className = "edui-editor-imagescale"; - resizer.innerHTML = hands.join(""); - resizer.style.cssText += - ";display:none;border:1px solid #3b77ff;z-index:" + - me.editor.options.zIndex + - ";"; - - me.editor.ui.getDom().appendChild(cover); - me.editor.ui.getDom().appendChild(resizer); - - me.initStyle(); - me.initEvents(); - }, - initStyle: function() { - utils.cssRule( - "imagescale", - ".edui-editor-imagescale{display:none;position:absolute;border:1px solid #38B2CE;cursor:hand;-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}" + - ".edui-editor-imagescale span{position:absolute;width:6px;height:6px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}" - ); - }, - initEvents: function() { - var me = this; - - me.startPos.x = me.startPos.y = 0; - me.isDraging = false; - }, - _eventHandler: function(e) { - var me = this; - switch (e.type) { - case "mousedown": - var hand = e.target || e.srcElement, - hand; - if ( - hand.className.indexOf("edui-editor-imagescale-hand") != -1 && - me.dragId == -1 - ) { - me.dragId = hand.className.slice(-1); - me.startPos.x = me.prePos.x = e.clientX; - me.startPos.y = me.prePos.y = e.clientY; - domUtils.on(me.doc, "mousemove", me.proxy(me._eventHandler, me)); - } - break; - case "mousemove": - if (me.dragId != -1) { - me.updateContainerStyle(me.dragId, { - x: e.clientX - me.prePos.x, - y: e.clientY - me.prePos.y - }); - me.prePos.x = e.clientX; - me.prePos.y = e.clientY; - elementUpdated = true; - me.updateTargetElement(); - } - break; - case "mouseup": - if (me.dragId != -1) { - me.updateContainerStyle(me.dragId, { - x: e.clientX - me.prePos.x, - y: e.clientY - me.prePos.y - }); - me.updateTargetElement(); - if (me.target.parentNode) me.attachTo(me.target); - me.dragId = -1; - } - domUtils.un(me.doc, "mousemove", me.proxy(me._eventHandler, me)); - //修复只是点击挪动点,但没有改变大小,不应该触发contentchange - if (elementUpdated) { - elementUpdated = false; - me.editor.fireEvent("contentchange"); - } - - break; - default: - break; - } - }, - updateTargetElement: function() { - var me = this; - domUtils.setStyles(me.target, { - width: me.resizer.style.width, - height: me.resizer.style.height - }); - me.target.width = parseInt(me.resizer.style.width); - me.target.height = parseInt(me.resizer.style.height); - me.attachTo(me.target); - }, - updateContainerStyle: function(dir, offset) { - var me = this, - dom = me.resizer, - tmp; - - if (rect[dir][0] != 0) { - tmp = parseInt(dom.style.left) + offset.x; - dom.style.left = me._validScaledProp("left", tmp) + "px"; - } - if (rect[dir][1] != 0) { - tmp = parseInt(dom.style.top) + offset.y; - dom.style.top = me._validScaledProp("top", tmp) + "px"; - } - if (rect[dir][2] != 0) { - tmp = dom.clientWidth + rect[dir][2] * offset.x; - dom.style.width = me._validScaledProp("width", tmp) + "px"; - } - if (rect[dir][3] != 0) { - tmp = dom.clientHeight + rect[dir][3] * offset.y; - dom.style.height = me._validScaledProp("height", tmp) + "px"; - } - }, - _validScaledProp: function(prop, value) { - var ele = this.resizer, - wrap = document; - - value = isNaN(value) ? 0 : value; - switch (prop) { - case "left": - return value < 0 - ? 0 - : value + ele.clientWidth > wrap.clientWidth - ? wrap.clientWidth - ele.clientWidth - : value; - case "top": - return value < 0 - ? 0 - : value + ele.clientHeight > wrap.clientHeight - ? wrap.clientHeight - ele.clientHeight - : value; - case "width": - return value <= 0 - ? 1 - : value + ele.offsetLeft > wrap.clientWidth - ? wrap.clientWidth - ele.offsetLeft - : value; - case "height": - return value <= 0 - ? 1 - : value + ele.offsetTop > wrap.clientHeight - ? wrap.clientHeight - ele.offsetTop - : value; - } - }, - hideCover: function() { - this.cover.style.display = "none"; - }, - showCover: function() { - var me = this, - editorPos = domUtils.getXY(me.editor.ui.getDom()), - iframePos = domUtils.getXY(me.editor.iframe); - - domUtils.setStyles(me.cover, { - width: me.editor.iframe.offsetWidth + "px", - height: me.editor.iframe.offsetHeight + "px", - top: iframePos.y - editorPos.y + "px", - left: iframePos.x - editorPos.x + "px", - position: "absolute", - display: "" - }); - }, - show: function(targetObj) { - var me = this; - me.resizer.style.display = "block"; - if (targetObj) me.attachTo(targetObj); - - domUtils.on(this.resizer, "mousedown", me.proxy(me._eventHandler, me)); - domUtils.on(me.doc, "mouseup", me.proxy(me._eventHandler, me)); - - me.showCover(); - me.editor.fireEvent("afterscaleshow", me); - me.editor.fireEvent("saveScene"); - }, - hide: function() { - var me = this; - me.hideCover(); - me.resizer.style.display = "none"; - - domUtils.un(me.resizer, "mousedown", me.proxy(me._eventHandler, me)); - domUtils.un(me.doc, "mouseup", me.proxy(me._eventHandler, me)); - me.editor.fireEvent("afterscalehide", me); - }, - proxy: function(fn, context) { - return function(e) { - return fn.apply(context || this, arguments); - }; - }, - attachTo: function(targetObj) { - var me = this, - target = (me.target = targetObj), - resizer = this.resizer, - imgPos = domUtils.getXY(target), - iframePos = domUtils.getXY(me.editor.iframe), - editorPos = domUtils.getXY(resizer.parentNode); - - var doc = me.editor.document; - domUtils.setStyles(resizer, { - width: target.width + "px", - height: target.height + "px", - left: - iframePos.x + - imgPos.x - - (doc.documentElement.scrollLeft || doc.body.scrollLeft || 0) - - editorPos.x - - parseInt(resizer.style.borderLeftWidth) + - "px", - top: - iframePos.y + - imgPos.y - - (doc.documentElement.scrollTop || doc.body.scrollTop || 0) - - editorPos.y - - parseInt(resizer.style.borderTopWidth) + - "px" - }); - } - }; - })(); - - return function() { - var me = this, - imageScale; - - me.setOpt("imageScaleEnabled", true); - - if (!browser.ie && me.options.imageScaleEnabled) { - me.addListener("click", function(type, e) { - var range = me.selection.getRange(), - img = range.getClosedNode(); - - if (img && img.tagName == "IMG" && me.body.contentEditable != "false") { - if ( - img.className.indexOf("edui-faked-music") != -1 || - img.getAttribute("anchorname") || - domUtils.hasClass(img, "loadingclass") || - domUtils.hasClass(img, "loaderrorclass") - ) { - return; - } - - if (!imageScale) { - imageScale = new Scale(); - imageScale.init(me); - me.ui.getDom().appendChild(imageScale.resizer); - - var _keyDownHandler = function(e) { - imageScale.hide(); - if (imageScale.target) - me.selection.getRange().selectNode(imageScale.target).select(); - }, - _mouseDownHandler = function(e) { - var ele = e.target || e.srcElement; - if ( - ele && - (ele.className === undefined || - ele.className.indexOf("edui-editor-imagescale") == -1) - ) { - _keyDownHandler(e); - } - }, - timer; - - me.addListener("afterscaleshow", function(e) { - me.addListener("beforekeydown", _keyDownHandler); - me.addListener("beforemousedown", _mouseDownHandler); - domUtils.on(document, "keydown", _keyDownHandler); - domUtils.on(document, "mousedown", _mouseDownHandler); - me.selection.getNative().removeAllRanges(); - }); - me.addListener("afterscalehide", function(e) { - me.removeListener("beforekeydown", _keyDownHandler); - me.removeListener("beforemousedown", _mouseDownHandler); - domUtils.un(document, "keydown", _keyDownHandler); - domUtils.un(document, "mousedown", _mouseDownHandler); - var target = imageScale.target; - if (target.parentNode) { - me.selection.getRange().selectNode(target).select(); - } - }); - //TODO 有iframe的情况,mousedown不能往下传。。 - domUtils.on(imageScale.resizer, "mousedown", function(e) { - me.selection.getNative().removeAllRanges(); - var ele = e.target || e.srcElement; - if ( - ele && - ele.className.indexOf("edui-editor-imagescale-hand") == -1 - ) { - timer = setTimeout(function() { - imageScale.hide(); - if (imageScale.target) - me.selection.getRange().selectNode(ele).select(); - }, 200); - } - }); - domUtils.on(imageScale.resizer, "mouseup", function(e) { - var ele = e.target || e.srcElement; - if ( - ele && - ele.className.indexOf("edui-editor-imagescale-hand") == -1 - ) { - clearTimeout(timer); - } - }); - } - imageScale.show(img); - } else { - if (imageScale && imageScale.resizer.style.display != "none") - imageScale.hide(); - } - }); - } - - if (browser.webkit) { - me.addListener("click", function(type, e) { - if (e.target.tagName == "IMG" && me.body.contentEditable != "false") { - var range = new dom.Range(me.document); - range.selectNode(e.target).select(); - } - }); - } - }; -})(); - - -// plugins/autolink.js -///import core -///commands 为非ie浏览器自动添加a标签 -///commandsName AutoLink -///commandsTitle 自动增加链接 -/** - * @description 为非ie浏览器自动添加a标签 - * @author zhanyi - */ - -UE.plugin.register( - "autolink", - function() { - var cont = 0; - - return !browser.ie - ? { - bindEvents: { - reset: function() { - cont = 0; - }, - keydown: function(type, evt) { - var me = this; - var keyCode = evt.keyCode || evt.which; - - if (keyCode == 32 || keyCode == 13) { - var sel = me.selection.getNative(), - range = sel.getRangeAt(0).cloneRange(), - offset, - charCode; - - var start = range.startContainer; - while (start.nodeType == 1 && range.startOffset > 0) { - start = - range.startContainer.childNodes[range.startOffset - 1]; - if (!start) { - break; - } - range.setStart( - start, - start.nodeType == 1 - ? start.childNodes.length - : start.nodeValue.length - ); - range.collapse(true); - start = range.startContainer; - } - - do { - if (range.startOffset == 0) { - start = range.startContainer.previousSibling; - - while (start && start.nodeType == 1) { - start = start.lastChild; - } - if (!start || domUtils.isFillChar(start)) { - break; - } - offset = start.nodeValue.length; - } else { - start = range.startContainer; - offset = range.startOffset; - } - range.setStart(start, offset - 1); - charCode = range.toString().charCodeAt(0); - } while (charCode != 160 && charCode != 32); - - if ( - range - .toString() - .replace(new RegExp(domUtils.fillChar, "g"), "") - .match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i) - ) { - while (range.toString().length) { - if ( - /^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test( - range.toString() - ) - ) { - break; - } - try { - range.setStart( - range.startContainer, - range.startOffset + 1 - ); - } catch (e) { - //trace:2121 - var start = range.startContainer; - while (!(next = start.nextSibling)) { - if (domUtils.isBody(start)) { - return; - } - start = start.parentNode; - } - range.setStart(next, 0); - } - } - //range的开始边界已经在a标签里的不再处理 - if ( - domUtils.findParentByTagName( - range.startContainer, - "a", - true - ) - ) { - return; - } - var a = me.document.createElement("a"), - text = me.document.createTextNode(" "), - href; - - me.undoManger && me.undoManger.save(); - a.appendChild(range.extractContents()); - a.href = a.innerHTML = a.innerHTML.replace(/<[^>]+>/g, ""); - href = a - .getAttribute("href") - .replace(new RegExp(domUtils.fillChar, "g"), ""); - href = /^(?:https?:\/\/)/gi.test(href) - ? href - : "http://" + href; - a.setAttribute("_src", utils.html(href)); - a.href = utils.html(href); - - range.insertNode(a); - a.parentNode.insertBefore(text, a.nextSibling); - range.setStart(text, 0); - range.collapse(true); - sel.removeAllRanges(); - sel.addRange(range); - me.undoManger && me.undoManger.save(); - } - } - } - } - } - : {}; - }, - function() { - var keyCodes = { - 37: 1, - 38: 1, - 39: 1, - 40: 1, - 13: 1, - 32: 1 - }; - function checkIsCludeLink(node) { - if (node.nodeType == 3) { - return null; - } - if (node.nodeName == "A") { - return node; - } - var lastChild = node.lastChild; - - while (lastChild) { - if (lastChild.nodeName == "A") { - return lastChild; - } - if (lastChild.nodeType == 3) { - if (domUtils.isWhitespace(lastChild)) { - lastChild = lastChild.previousSibling; - continue; - } - return null; - } - lastChild = lastChild.lastChild; - } - } - browser.ie && - this.addListener("keyup", function(cmd, evt) { - var me = this, - keyCode = evt.keyCode; - if (keyCodes[keyCode]) { - var rng = me.selection.getRange(); - var start = rng.startContainer; - - if (keyCode == 13) { - while ( - start && - !domUtils.isBody(start) && - !domUtils.isBlockElm(start) - ) { - start = start.parentNode; - } - if (start && !domUtils.isBody(start) && start.nodeName == "P") { - var pre = start.previousSibling; - if (pre && pre.nodeType == 1) { - var pre = checkIsCludeLink(pre); - if (pre && !pre.getAttribute("_href")) { - domUtils.remove(pre, true); - } - } - } - } else if (keyCode == 32) { - if (start.nodeType == 3 && /^\s$/.test(start.nodeValue)) { - start = start.previousSibling; - if ( - start && - start.nodeName == "A" && - !start.getAttribute("_href") - ) { - domUtils.remove(start, true); - } - } - } else { - start = domUtils.findParentByTagName(start, "a", true); - if (start && !start.getAttribute("_href")) { - var bk = rng.createBookmark(); - - domUtils.remove(start, true); - rng.moveToBookmark(bk).select(true); - } - } - } - }); - } -); - - -// plugins/autoheight.js -///import core -///commands 当输入内容超过编辑器高度时,编辑器自动增高 -///commandsName AutoHeight,autoHeightEnabled -///commandsTitle 自动增高 -/** - * @description 自动伸展 - * @author zhanyi - */ -UE.plugins["autoheight"] = function() { - var me = this; - //提供开关,就算加载也可以关闭 - me.autoHeightEnabled = me.options.autoHeightEnabled !== false; - if (!me.autoHeightEnabled) { - return; - } - - var bakOverflow, - lastHeight = 0, - options = me.options, - currentHeight, - timer; - - function adjustHeight() { - var me = this; - clearTimeout(timer); - if (isFullscreen) return; - if ( - !me.queryCommandState || - (me.queryCommandState && me.queryCommandState("source") != 1) - ) { - timer = setTimeout(function() { - var node = me.body.lastChild; - while (node && node.nodeType != 1) { - node = node.previousSibling; - } - if (node && node.nodeType == 1) { - node.style.clear = "both"; - currentHeight = Math.max( - domUtils.getXY(node).y + node.offsetHeight + 25, - Math.max(options.minFrameHeight, options.initialFrameHeight) - ); - if (currentHeight != lastHeight) { - if (currentHeight !== parseInt(me.iframe.parentNode.style.height)) { - me.iframe.parentNode.style.height = currentHeight + "px"; - } - me.body.style.height = currentHeight + "px"; - lastHeight = currentHeight; - } - domUtils.removeStyle(node, "clear"); - } - }, 50); - } - } - var isFullscreen; - me.addListener("fullscreenchanged", function(cmd, f) { - isFullscreen = f; - }); - me.addListener("destroy", function() { - domUtils.un(me.window, "scroll", fixedScrollTop); - me.removeListener( - "contentchange afterinserthtml keyup mouseup", - adjustHeight - ); - }); - me.enableAutoHeight = function() { - var me = this; - if (!me.autoHeightEnabled) { - return; - } - var doc = me.document; - me.autoHeightEnabled = true; - bakOverflow = doc.body.style.overflowY; - doc.body.style.overflowY = "hidden"; - me.addListener("contentchange afterinserthtml keyup mouseup", adjustHeight); - //ff不给事件算得不对 - - setTimeout(function() { - adjustHeight.call(me); - }, browser.gecko ? 100 : 0); - me.fireEvent("autoheightchanged", me.autoHeightEnabled); - }; - me.disableAutoHeight = function() { - me.body.style.overflowY = bakOverflow || ""; - - me.removeListener("contentchange", adjustHeight); - me.removeListener("keyup", adjustHeight); - me.removeListener("mouseup", adjustHeight); - me.autoHeightEnabled = false; - me.fireEvent("autoheightchanged", me.autoHeightEnabled); - }; - - me.on("setHeight", function() { - me.disableAutoHeight(); - }); - me.addListener("ready", function() { - me.enableAutoHeight(); - //trace:1764 - var timer; - domUtils.on( - browser.ie ? me.body : me.document, - browser.webkit ? "dragover" : "drop", - function() { - clearTimeout(timer); - timer = setTimeout(function() { - //trace:3681 - adjustHeight.call(me); - }, 100); - } - ); - //修复内容过多时,回到顶部,顶部内容被工具栏遮挡问题 - domUtils.on(me.window, "scroll", fixedScrollTop); - }); - - var lastScrollY; - - function fixedScrollTop() { - if (!me.window) return; - if (lastScrollY === null) { - lastScrollY = me.window.scrollY; - } else if (me.window.scrollY == 0 && lastScrollY != 0) { - me.window.scrollTo(0, 0); - lastScrollY = null; - } - } -}; - - -// plugins/autofloat.js -///import core -///commands 悬浮工具栏 -///commandsName AutoFloat,autoFloatEnabled -///commandsTitle 悬浮工具栏 -/** - * modified by chengchao01 - * 注意: 引入此功能后,在IE6下会将body的背景图片覆盖掉! - */ -UE.plugins["autofloat"] = function() { - var me = this, - lang = me.getLang(); - me.setOpt({ - topOffset: 0 - }); - var optsAutoFloatEnabled = me.options.autoFloatEnabled !== false, - topOffset = me.options.topOffset; - - //如果不固定toolbar的位置,则直接退出 - if (!optsAutoFloatEnabled) { - return; - } - var uiUtils = UE.ui.uiUtils, - LteIE6 = browser.ie && browser.version <= 6, - quirks = browser.quirks; - - function checkHasUI() { - if (!UE.ui) { - alert(lang.autofloatMsg); - return 0; - } - return 1; - } - function fixIE6FixedPos() { - var docStyle = document.body.style; - docStyle.backgroundImage = 'url("about:blank")'; - docStyle.backgroundAttachment = "fixed"; - } - var bakCssText, - placeHolder = document.createElement("div"), - toolbarBox, - orgTop, - getPosition, - flag = true; //ie7模式下需要偏移 - function setFloating() { - var toobarBoxPos = domUtils.getXY(toolbarBox), - origalFloat = domUtils.getComputedStyle(toolbarBox, "position"), - origalLeft = domUtils.getComputedStyle(toolbarBox, "left"); - toolbarBox.style.width = toolbarBox.offsetWidth + "px"; - toolbarBox.style.zIndex = me.options.zIndex * 1 + 1; - toolbarBox.parentNode.insertBefore(placeHolder, toolbarBox); - if (LteIE6 || (quirks && browser.ie)) { - if (toolbarBox.style.position != "absolute") { - toolbarBox.style.position = "absolute"; - } - toolbarBox.style.top = - (document.body.scrollTop || document.documentElement.scrollTop) - - orgTop + - topOffset + - "px"; - } else { - if (browser.ie7Compat && flag) { - flag = false; - toolbarBox.style.left = - domUtils.getXY(toolbarBox).x - - document.documentElement.getBoundingClientRect().left + - 2 + - "px"; - } - if (toolbarBox.style.position != "fixed") { - toolbarBox.style.position = "fixed"; - toolbarBox.style.top = topOffset + "px"; - (origalFloat == "absolute" || origalFloat == "relative") && - parseFloat(origalLeft) && - (toolbarBox.style.left = toobarBoxPos.x + "px"); - } - } - } - function unsetFloating() { - flag = true; - if (placeHolder.parentNode) { - placeHolder.parentNode.removeChild(placeHolder); - } - - toolbarBox.style.cssText = bakCssText; - } - - function updateFloating() { - var rect3 = getPosition(me.container); - var offset = me.options.toolbarTopOffset || 0; - if (rect3.top < 0 && rect3.bottom - toolbarBox.offsetHeight > offset) { - setFloating(); - } else { - unsetFloating(); - } - } - var defer_updateFloating = utils.defer( - function() { - updateFloating(); - }, - browser.ie ? 200 : 100, - true - ); - - me.addListener("destroy", function() { - domUtils.un(window, ["scroll", "resize"], updateFloating); - me.removeListener("keydown", defer_updateFloating); - //适用于在DIV scrollbox中滚动,但页面不滚动的浮动toolbar - var scrollBox = document.getElementById("scrollBox"); - if (scrollBox) { - domUtils.un(scrollBox, ['scroll','resize'], updateFloating); - } - }); - - me.addListener("ready", function() { - if (checkHasUI(me)) { - //加载了ui组件,但在new时,没有加载ui,导致编辑器实例上没有ui类,所以这里做判断 - if (!me.ui) { - return; - } - getPosition = uiUtils.getClientRect; - toolbarBox = me.ui.getDom("toolbarbox"); - orgTop = getPosition(toolbarBox).top; - bakCssText = toolbarBox.style.cssText; - placeHolder.style.height = toolbarBox.offsetHeight + "px"; - if (LteIE6) { - fixIE6FixedPos(); - } - domUtils.on(window, ["scroll", "resize"], updateFloating); - me.addListener("keydown", defer_updateFloating); - //适用于在DIV scrollbox中滚动,但页面不滚动的浮动toolbar - var scrollBox = document.getElementById("scrollBox"); - if (scrollBox) { - domUtils.on(scrollBox, ['scroll','resize'], updateFloating); - } - me.addListener("beforefullscreenchange", function(t, enabled) { - if (enabled) { - unsetFloating(); - } - }); - me.addListener("fullscreenchanged", function(t, enabled) { - if (!enabled) { - updateFloating(); - } - }); - me.addListener("sourcemodechanged", function(t, enabled) { - setTimeout(function() { - updateFloating(); - }, 0); - }); - me.addListener("clearDoc", function() { - setTimeout(function() { - updateFloating(); - }, 0); - }); - } - }); -}; - - -// plugins/video.js -/** - * video插件, 为UEditor提供视频插入支持 - * @file - * @since 1.2.6.1 - */ - -UE.plugins["video"] = function() { - var me = this; - - /** - * 创建插入视频字符窜 - * @param url 视频地址 - * @param width 视频宽度 - * @param height 视频高度 - * @param align 视频对齐 - * @param toEmbed 是否以flash代替显示 - * @param addParagraph 是否需要添加P 标签 - */ - function creatInsertStr(url, width, height, id, align, classname, type) { - var str; - switch (type) { - case "image": - str = - "'; - break; - case "embed": - str = - ''; - break; - case "video": - var ext = url.substr(url.lastIndexOf(".") + 1); - if (ext == "ogv") ext = "ogg"; - str = - "' + - ''; - break; - } - return str; - } - - function switchImgAndVideo(root, img2video) { - utils.each( - root.getNodesByTagName(img2video ? "img" : "embed video"), - function(node) { - var className = node.getAttr("class"); - if (className && className.indexOf("edui-faked-video") != -1) { - var html = creatInsertStr( - img2video ? node.getAttr("_url") : node.getAttr("src"), - node.getAttr("width"), - node.getAttr("height"), - null, - node.getStyle("float") || "", - className, - img2video ? "embed" : "image" - ); - node.parentNode.replaceChild(UE.uNode.createElement(html), node); - } - if (className && className.indexOf("edui-upload-video") != -1) { - var html = creatInsertStr( - img2video ? node.getAttr("_url") : node.getAttr("src"), - node.getAttr("width"), - node.getAttr("height"), - null, - node.getStyle("float") || "", - className, - img2video ? "video" : "image" - ); - node.parentNode.replaceChild(UE.uNode.createElement(html), node); - } - } - ); - } - - me.addOutputRule(function(root) { - switchImgAndVideo(root, true); - }); - me.addInputRule(function(root) { - switchImgAndVideo(root); - }); - - /** - * 插入视频 - * @command insertvideo - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Object } videoAttr 键值对对象, 描述一个视频的所有属性 - * @example - * ```javascript - * - * var videoAttr = { - * //视频地址 - * url: 'http://www.youku.com/xxx', - * //视频宽高值, 单位px - * width: 200, - * height: 100 - * }; - * - * //editor 是编辑器实例 - * //向编辑器插入单个视频 - * editor.execCommand( 'insertvideo', videoAttr ); - * ``` - */ - - /** - * 插入视频 - * @command insertvideo - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Array } videoArr 需要插入的视频的数组, 其中的每一个元素都是一个键值对对象, 描述了一个视频的所有属性 - * @example - * ```javascript - * - * var videoAttr1 = { - * //视频地址 - * url: 'http://www.youku.com/xxx', - * //视频宽高值, 单位px - * width: 200, - * height: 100 - * }, - * videoAttr2 = { - * //视频地址 - * url: 'http://www.youku.com/xxx', - * //视频宽高值, 单位px - * width: 200, - * height: 100 - * } - * - * //editor 是编辑器实例 - * //该方法将会向编辑器内插入两个视频 - * editor.execCommand( 'insertvideo', [ videoAttr1, videoAttr2 ] ); - * ``` - */ - - /** - * 查询当前光标所在处是否是一个视频 - * @command insertvideo - * @method queryCommandState - * @param { String } cmd 需要查询的命令字符串 - * @return { int } 如果当前光标所在处的元素是一个视频对象, 则返回1,否则返回0 - * @example - * ```javascript - * - * //editor 是编辑器实例 - * editor.queryCommandState( 'insertvideo' ); - * ``` - */ - me.commands["insertvideo"] = { - execCommand: function(cmd, videoObjs, type) { - videoObjs = utils.isArray(videoObjs) ? videoObjs : [videoObjs]; - - if (me.fireEvent("beforeinsertvideo", videoObjs) === true) { - return; - } - - var html = [], - id = "tmpVedio", - cl; - for (var i = 0, vi, len = videoObjs.length; i < len; i++) { - vi = videoObjs[i]; - cl = type == "upload" - ? "edui-upload-video video-js vjs-default-skin" - : "edui-faked-video"; - html.push( - creatInsertStr( - vi.url, - vi.width || 420, - vi.height || 280, - id + i, - null, - cl, - "image" - ) - ); - } - me.execCommand("inserthtml", html.join(""), true); - var rng = this.selection.getRange(); - for (var i = 0, len = videoObjs.length; i < len; i++) { - var img = this.document.getElementById("tmpVedio" + i); - domUtils.removeAttributes(img, "id"); - rng.selectNode(img).select(); - me.execCommand("imagefloat", videoObjs[i].align); - } - - me.fireEvent("afterinsertvideo", videoObjs); - }, - queryCommandState: function() { - var img = me.selection.getRange().getClosedNode(), - flag = - img && - (img.className == "edui-faked-video" || - img.className.indexOf("edui-upload-video") != -1); - return flag ? 1 : 0; - } - }; -}; - - -// plugins/table.core.js -/** - * Created with JetBrains WebStorm. - * User: taoqili - * Date: 13-1-18 - * Time: 上午11:09 - * To change this template use File | Settings | File Templates. - */ -/** - * UE表格操作类 - * @param table - * @constructor - */ -;(function() { - var UETable = (UE.UETable = function(table) { - this.table = table; - this.indexTable = []; - this.selectedTds = []; - this.cellsRange = {}; - this.update(table); - }); - - //===以下为静态工具方法=== - UETable.removeSelectedClass = function(cells) { - utils.each(cells, function(cell) { - domUtils.removeClasses(cell, "selectTdClass"); - }); - }; - UETable.addSelectedClass = function(cells) { - utils.each(cells, function(cell) { - domUtils.addClass(cell, "selectTdClass"); - }); - }; - UETable.isEmptyBlock = function(node) { - var reg = new RegExp(domUtils.fillChar, "g"); - if ( - node[browser.ie ? "innerText" : "textContent"] - .replace(/^\s*$/, "") - .replace(reg, "").length > 0 - ) { - return 0; - } - for (var i in dtd.$isNotEmpty) - if (dtd.$isNotEmpty.hasOwnProperty(i)) { - if (node.getElementsByTagName(i).length) { - return 0; - } - } - return 1; - }; - UETable.getWidth = function(cell) { - if (!cell) return 0; - return parseInt(domUtils.getComputedStyle(cell, "width"), 10); - }; - - /** - * 获取单元格或者单元格组的“对齐”状态。 如果当前的检测对象是一个单元格组, 只有在满足所有单元格的 水平和竖直 对齐属性都相同的 - * 条件时才会返回其状态值,否则将返回null; 如果当前只检测了一个单元格, 则直接返回当前单元格的对齐状态; - * @param table cell or table cells , 支持单个单元格dom对象 或者 单元格dom对象数组 - * @return { align: 'left' || 'right' || 'center', valign: 'top' || 'middle' || 'bottom' } 或者 null - */ - UETable.getTableCellAlignState = function(cells) { - !utils.isArray(cells) && (cells = [cells]); - - var result = {}, - status = ["align", "valign"], - tempStatus = null, - isSame = true; //状态是否相同 - - utils.each(cells, function(cellNode) { - utils.each(status, function(currentState) { - tempStatus = cellNode.getAttribute(currentState); - - if (!result[currentState] && tempStatus) { - result[currentState] = tempStatus; - } else if ( - !result[currentState] || - tempStatus !== result[currentState] - ) { - isSame = false; - return false; - } - }); - - return isSame; - }); - - return isSame ? result : null; - }; - - /** - * 根据当前选区获取相关的table信息 - * @return {Object} - */ - UETable.getTableItemsByRange = function(editor) { - var start = editor.selection.getStart(); - - //ff下会选中bookmark - if ( - start && - start.id && - start.id.indexOf("_baidu_bookmark_start_") === 0 && - start.nextSibling - ) { - start = start.nextSibling; - } - - //在table或者td边缘有可能存在选中tr的情况 - var cell = start && domUtils.findParentByTagName(start, ["td", "th"], true), - tr = cell && cell.parentNode, - table = tr && domUtils.findParentByTagName(tr, ["table"]), - caption = table && table.getElementsByTagName("caption")[0]; - - return { - cell: cell, - tr: tr, - table: table, - caption: caption - }; - }; - UETable.getUETableBySelected = function(editor) { - var table = UETable.getTableItemsByRange(editor).table; - if (table && table.ueTable && table.ueTable.selectedTds.length) { - return table.ueTable; - } - return null; - }; - - UETable.getDefaultValue = function(editor, table) { - var borderMap = { - thin: "0px", - medium: "1px", - thick: "2px" - }, - tableBorder, - tdPadding, - tdBorder, - tmpValue; - if (!table) { - table = editor.document.createElement("table"); - table.insertRow(0).insertCell(0).innerHTML = "xxx"; - editor.body.appendChild(table); - var td = table.getElementsByTagName("td")[0]; - tmpValue = domUtils.getComputedStyle(table, "border-left-width"); - tableBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); - tmpValue = domUtils.getComputedStyle(td, "padding-left"); - tdPadding = parseInt(borderMap[tmpValue] || tmpValue, 10); - tmpValue = domUtils.getComputedStyle(td, "border-left-width"); - tdBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); - domUtils.remove(table); - return { - tableBorder: tableBorder, - tdPadding: tdPadding, - tdBorder: tdBorder - }; - } else { - td = table.getElementsByTagName("td")[0]; - tmpValue = domUtils.getComputedStyle(table, "border-left-width"); - tableBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); - tmpValue = domUtils.getComputedStyle(td, "padding-left"); - tdPadding = parseInt(borderMap[tmpValue] || tmpValue, 10); - tmpValue = domUtils.getComputedStyle(td, "border-left-width"); - tdBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); - return { - tableBorder: tableBorder, - tdPadding: tdPadding, - tdBorder: tdBorder - }; - } - }; - /** - * 根据当前点击的td或者table获取索引对象 - * @param tdOrTable - */ - UETable.getUETable = function(tdOrTable) { - var tag = tdOrTable.tagName.toLowerCase(); - tdOrTable = tag == "td" || tag == "th" || tag == "caption" - ? domUtils.findParentByTagName(tdOrTable, "table", true) - : tdOrTable; - if (!tdOrTable.ueTable) { - tdOrTable.ueTable = new UETable(tdOrTable); - } - return tdOrTable.ueTable; - }; - - UETable.cloneCell = function(cell, ignoreMerge, keepPro) { - if (!cell || utils.isString(cell)) { - return this.table.ownerDocument.createElement(cell || "td"); - } - var flag = domUtils.hasClass(cell, "selectTdClass"); - flag && domUtils.removeClasses(cell, "selectTdClass"); - var tmpCell = cell.cloneNode(true); - if (ignoreMerge) { - tmpCell.rowSpan = tmpCell.colSpan = 1; - } - //去掉宽高 - !keepPro && domUtils.removeAttributes(tmpCell, "width height"); - !keepPro && domUtils.removeAttributes(tmpCell, "style"); - - tmpCell.style.borderLeftStyle = ""; - tmpCell.style.borderTopStyle = ""; - tmpCell.style.borderLeftColor = cell.style.borderRightColor; - tmpCell.style.borderLeftWidth = cell.style.borderRightWidth; - tmpCell.style.borderTopColor = cell.style.borderBottomColor; - tmpCell.style.borderTopWidth = cell.style.borderBottomWidth; - flag && domUtils.addClass(cell, "selectTdClass"); - return tmpCell; - }; - - UETable.prototype = { - getMaxRows: function() { - var rows = this.table.rows, - maxLen = 1; - for (var i = 0, row; (row = rows[i]); i++) { - var currentMax = 1; - for (var j = 0, cj; (cj = row.cells[j++]); ) { - currentMax = Math.max(cj.rowSpan || 1, currentMax); - } - maxLen = Math.max(currentMax + i, maxLen); - } - return maxLen; - }, - /** - * 获取当前表格的最大列数 - */ - getMaxCols: function() { - var rows = this.table.rows, - maxLen = 0, - cellRows = {}; - for (var i = 0, row; (row = rows[i]); i++) { - var cellsNum = 0; - for (var j = 0, cj; (cj = row.cells[j++]); ) { - cellsNum += cj.colSpan || 1; - if (cj.rowSpan && cj.rowSpan > 1) { - for (var k = 1; k < cj.rowSpan; k++) { - if (!cellRows["row_" + (i + k)]) { - cellRows["row_" + (i + k)] = cj.colSpan || 1; - } else { - cellRows["row_" + (i + k)]++; - } - } - } - } - cellsNum += cellRows["row_" + i] || 0; - maxLen = Math.max(cellsNum, maxLen); - } - return maxLen; - }, - getCellColIndex: function(cell) {}, - /** - * 获取当前cell旁边的单元格, - * @param cell - * @param right - */ - getHSideCell: function(cell, right) { - try { - var cellInfo = this.getCellInfo(cell), - previewRowIndex, - previewColIndex; - var len = this.selectedTds.length, - range = this.cellsRange; - //首行或者首列没有前置单元格 - if ( - (!right && (!len ? !cellInfo.colIndex : !range.beginColIndex)) || - (right && - (!len - ? cellInfo.colIndex == this.colsNum - 1 - : range.endColIndex == this.colsNum - 1)) - ) - return null; - - previewRowIndex = !len ? cellInfo.rowIndex : range.beginRowIndex; - previewColIndex = !right - ? !len - ? cellInfo.colIndex < 1 ? 0 : cellInfo.colIndex - 1 - : range.beginColIndex - 1 - : !len ? cellInfo.colIndex + 1 : range.endColIndex + 1; - return this.getCell( - this.indexTable[previewRowIndex][previewColIndex].rowIndex, - this.indexTable[previewRowIndex][previewColIndex].cellIndex - ); - } catch (e) { - showError(e); - } - }, - getTabNextCell: function(cell, preRowIndex) { - var cellInfo = this.getCellInfo(cell), - rowIndex = preRowIndex || cellInfo.rowIndex, - colIndex = cellInfo.colIndex + 1 + (cellInfo.colSpan - 1), - nextCell; - try { - nextCell = this.getCell( - this.indexTable[rowIndex][colIndex].rowIndex, - this.indexTable[rowIndex][colIndex].cellIndex - ); - } catch (e) { - try { - rowIndex = rowIndex * 1 + 1; - colIndex = 0; - nextCell = this.getCell( - this.indexTable[rowIndex][colIndex].rowIndex, - this.indexTable[rowIndex][colIndex].cellIndex - ); - } catch (e) {} - } - return nextCell; - }, - /** - * 获取视觉上的后置单元格 - * @param cell - * @param bottom - */ - getVSideCell: function(cell, bottom, ignoreRange) { - try { - var cellInfo = this.getCellInfo(cell), - nextRowIndex, - nextColIndex; - var len = this.selectedTds.length && !ignoreRange, - range = this.cellsRange; - //末行或者末列没有后置单元格 - if ( - (!bottom && cellInfo.rowIndex == 0) || - (bottom && - (!len - ? cellInfo.rowIndex + cellInfo.rowSpan > this.rowsNum - 1 - : range.endRowIndex == this.rowsNum - 1)) - ) - return null; - - nextRowIndex = !bottom - ? !len ? cellInfo.rowIndex - 1 : range.beginRowIndex - 1 - : !len ? cellInfo.rowIndex + cellInfo.rowSpan : range.endRowIndex + 1; - nextColIndex = !len ? cellInfo.colIndex : range.beginColIndex; - return this.getCell( - this.indexTable[nextRowIndex][nextColIndex].rowIndex, - this.indexTable[nextRowIndex][nextColIndex].cellIndex - ); - } catch (e) { - showError(e); - } - }, - /** - * 获取相同结束位置的单元格,xOrY指代了是获取x轴相同还是y轴相同 - */ - getSameEndPosCells: function(cell, xOrY) { - try { - var flag = xOrY.toLowerCase() === "x", - end = - domUtils.getXY(cell)[flag ? "x" : "y"] + - cell["offset" + (flag ? "Width" : "Height")], - rows = this.table.rows, - cells = null, - returns = []; - for (var i = 0; i < this.rowsNum; i++) { - cells = rows[i].cells; - for (var j = 0, tmpCell; (tmpCell = cells[j++]); ) { - var tmpEnd = - domUtils.getXY(tmpCell)[flag ? "x" : "y"] + - tmpCell["offset" + (flag ? "Width" : "Height")]; - //对应行的td已经被上面行rowSpan了 - if (tmpEnd > end && flag) break; - if (cell == tmpCell || end == tmpEnd) { - //只获取单一的单元格 - //todo 仅获取单一单元格在特定情况下会造成returns为空,从而影响后续的拖拽实现,修正这个。需考虑性能 - if (tmpCell[flag ? "colSpan" : "rowSpan"] == 1) { - returns.push(tmpCell); - } - if (flag) break; - } - } - } - return returns; - } catch (e) { - showError(e); - } - }, - setCellContent: function(cell, content) { - cell.innerHTML = content || (browser.ie ? domUtils.fillChar : "
                      "); - }, - cloneCell: UETable.cloneCell, - /** - * 获取跟当前单元格的右边竖线为左边的所有未合并单元格 - */ - getSameStartPosXCells: function(cell) { - try { - var start = domUtils.getXY(cell).x + cell.offsetWidth, - rows = this.table.rows, - cells, - returns = []; - for (var i = 0; i < this.rowsNum; i++) { - cells = rows[i].cells; - for (var j = 0, tmpCell; (tmpCell = cells[j++]); ) { - var tmpStart = domUtils.getXY(tmpCell).x; - if (tmpStart > start) break; - if (tmpStart == start && tmpCell.colSpan == 1) { - returns.push(tmpCell); - break; - } - } - } - return returns; - } catch (e) { - showError(e); - } - }, - /** - * 更新table对应的索引表 - */ - update: function(table) { - this.table = table || this.table; - this.selectedTds = []; - this.cellsRange = {}; - this.indexTable = []; - var rows = this.table.rows, - rowsNum = this.getMaxRows(), - dNum = rowsNum - rows.length, - colsNum = this.getMaxCols(); - while (dNum--) { - this.table.insertRow(rows.length); - } - this.rowsNum = rowsNum; - this.colsNum = colsNum; - for (var i = 0, len = rows.length; i < len; i++) { - this.indexTable[i] = new Array(colsNum); - } - //填充索引表 - for (var rowIndex = 0, row; (row = rows[rowIndex]); rowIndex++) { - for ( - var cellIndex = 0, cell, cells = row.cells; - (cell = cells[cellIndex]); - cellIndex++ - ) { - //修正整行被rowSpan时导致的行数计算错误 - if (cell.rowSpan > rowsNum) { - cell.rowSpan = rowsNum; - } - var colIndex = cellIndex, - rowSpan = cell.rowSpan || 1, - colSpan = cell.colSpan || 1; - //当已经被上一行rowSpan或者被前一列colSpan了,则跳到下一个单元格进行 - while (this.indexTable[rowIndex][colIndex]) colIndex++; - for (var j = 0; j < rowSpan; j++) { - for (var k = 0; k < colSpan; k++) { - this.indexTable[rowIndex + j][colIndex + k] = { - rowIndex: rowIndex, - cellIndex: cellIndex, - colIndex: colIndex, - rowSpan: rowSpan, - colSpan: colSpan - }; - } - } - } - } - //修复残缺td - for (j = 0; j < rowsNum; j++) { - for (k = 0; k < colsNum; k++) { - if (this.indexTable[j][k] === undefined) { - row = rows[j]; - cell = row.cells[row.cells.length - 1]; - cell = cell - ? cell.cloneNode(true) - : this.table.ownerDocument.createElement("td"); - this.setCellContent(cell); - if (cell.colSpan !== 1) cell.colSpan = 1; - if (cell.rowSpan !== 1) cell.rowSpan = 1; - row.appendChild(cell); - this.indexTable[j][k] = { - rowIndex: j, - cellIndex: cell.cellIndex, - colIndex: k, - rowSpan: 1, - colSpan: 1 - }; - } - } - } - //当框选后删除行或者列后撤销,需要重建选区。 - var tds = domUtils.getElementsByTagName(this.table, "td"), - selectTds = []; - utils.each(tds, function(td) { - if (domUtils.hasClass(td, "selectTdClass")) { - selectTds.push(td); - } - }); - if (selectTds.length) { - var start = selectTds[0], - end = selectTds[selectTds.length - 1], - startInfo = this.getCellInfo(start), - endInfo = this.getCellInfo(end); - this.selectedTds = selectTds; - this.cellsRange = { - beginRowIndex: startInfo.rowIndex, - beginColIndex: startInfo.colIndex, - endRowIndex: endInfo.rowIndex + endInfo.rowSpan - 1, - endColIndex: endInfo.colIndex + endInfo.colSpan - 1 - }; - } - //给第一行设置firstRow的样式名称,在排序图标的样式上使用到 - if (!domUtils.hasClass(this.table.rows[0], "firstRow")) { - domUtils.addClass(this.table.rows[0], "firstRow"); - for (var i = 1; i < this.table.rows.length; i++) { - domUtils.removeClasses(this.table.rows[i], "firstRow"); - } - } - }, - /** - * 获取单元格的索引信息 - */ - getCellInfo: function(cell) { - if (!cell) return; - var cellIndex = cell.cellIndex, - rowIndex = cell.parentNode.rowIndex, - rowInfo = this.indexTable[rowIndex], - numCols = this.colsNum; - for (var colIndex = cellIndex; colIndex < numCols; colIndex++) { - var cellInfo = rowInfo[colIndex]; - if ( - cellInfo.rowIndex === rowIndex && - cellInfo.cellIndex === cellIndex - ) { - return cellInfo; - } - } - }, - /** - * 根据行列号获取单元格 - */ - getCell: function(rowIndex, cellIndex) { - return ( - (rowIndex < this.rowsNum && - this.table.rows[rowIndex].cells[cellIndex]) || - null - ); - }, - /** - * 删除单元格 - */ - deleteCell: function(cell, rowIndex) { - rowIndex = typeof rowIndex == "number" - ? rowIndex - : cell.parentNode.rowIndex; - var row = this.table.rows[rowIndex]; - row.deleteCell(cell.cellIndex); - }, - /** - * 根据始末两个单元格获取被框选的所有单元格范围 - */ - getCellsRange: function(cellA, cellB) { - function checkRange( - beginRowIndex, - beginColIndex, - endRowIndex, - endColIndex - ) { - var tmpBeginRowIndex = beginRowIndex, - tmpBeginColIndex = beginColIndex, - tmpEndRowIndex = endRowIndex, - tmpEndColIndex = endColIndex, - cellInfo, - colIndex, - rowIndex; - // 通过indexTable检查是否存在超出TableRange上边界的情况 - if (beginRowIndex > 0) { - for (colIndex = beginColIndex; colIndex < endColIndex; colIndex++) { - cellInfo = me.indexTable[beginRowIndex][colIndex]; - rowIndex = cellInfo.rowIndex; - if (rowIndex < beginRowIndex) { - tmpBeginRowIndex = Math.min(rowIndex, tmpBeginRowIndex); - } - } - } - // 通过indexTable检查是否存在超出TableRange右边界的情况 - if (endColIndex < me.colsNum) { - for (rowIndex = beginRowIndex; rowIndex < endRowIndex; rowIndex++) { - cellInfo = me.indexTable[rowIndex][endColIndex]; - colIndex = cellInfo.colIndex + cellInfo.colSpan - 1; - if (colIndex > endColIndex) { - tmpEndColIndex = Math.max(colIndex, tmpEndColIndex); - } - } - } - // 检查是否有超出TableRange下边界的情况 - if (endRowIndex < me.rowsNum) { - for (colIndex = beginColIndex; colIndex < endColIndex; colIndex++) { - cellInfo = me.indexTable[endRowIndex][colIndex]; - rowIndex = cellInfo.rowIndex + cellInfo.rowSpan - 1; - if (rowIndex > endRowIndex) { - tmpEndRowIndex = Math.max(rowIndex, tmpEndRowIndex); - } - } - } - // 检查是否有超出TableRange左边界的情况 - if (beginColIndex > 0) { - for (rowIndex = beginRowIndex; rowIndex < endRowIndex; rowIndex++) { - cellInfo = me.indexTable[rowIndex][beginColIndex]; - colIndex = cellInfo.colIndex; - if (colIndex < beginColIndex) { - tmpBeginColIndex = Math.min(cellInfo.colIndex, tmpBeginColIndex); - } - } - } - //递归调用直至所有完成所有框选单元格的扩展 - if ( - tmpBeginRowIndex != beginRowIndex || - tmpBeginColIndex != beginColIndex || - tmpEndRowIndex != endRowIndex || - tmpEndColIndex != endColIndex - ) { - return checkRange( - tmpBeginRowIndex, - tmpBeginColIndex, - tmpEndRowIndex, - tmpEndColIndex - ); - } else { - // 不需要扩展TableRange的情况 - return { - beginRowIndex: beginRowIndex, - beginColIndex: beginColIndex, - endRowIndex: endRowIndex, - endColIndex: endColIndex - }; - } - } - - try { - var me = this, - cellAInfo = me.getCellInfo(cellA); - if (cellA === cellB) { - return { - beginRowIndex: cellAInfo.rowIndex, - beginColIndex: cellAInfo.colIndex, - endRowIndex: cellAInfo.rowIndex + cellAInfo.rowSpan - 1, - endColIndex: cellAInfo.colIndex + cellAInfo.colSpan - 1 - }; - } - var cellBInfo = me.getCellInfo(cellB); - // 计算TableRange的四个边 - var beginRowIndex = Math.min(cellAInfo.rowIndex, cellBInfo.rowIndex), - beginColIndex = Math.min(cellAInfo.colIndex, cellBInfo.colIndex), - endRowIndex = Math.max( - cellAInfo.rowIndex + cellAInfo.rowSpan - 1, - cellBInfo.rowIndex + cellBInfo.rowSpan - 1 - ), - endColIndex = Math.max( - cellAInfo.colIndex + cellAInfo.colSpan - 1, - cellBInfo.colIndex + cellBInfo.colSpan - 1 - ); - - return checkRange( - beginRowIndex, - beginColIndex, - endRowIndex, - endColIndex - ); - } catch (e) { - //throw e; - } - }, - /** - * 依据cellsRange获取对应的单元格集合 - */ - getCells: function(range) { - //每次获取cells之前必须先清除上次的选择,否则会对后续获取操作造成影响 - this.clearSelected(); - var beginRowIndex = range.beginRowIndex, - beginColIndex = range.beginColIndex, - endRowIndex = range.endRowIndex, - endColIndex = range.endColIndex, - cellInfo, - rowIndex, - colIndex, - tdHash = {}, - returnTds = []; - for (var i = beginRowIndex; i <= endRowIndex; i++) { - for (var j = beginColIndex; j <= endColIndex; j++) { - cellInfo = this.indexTable[i][j]; - rowIndex = cellInfo.rowIndex; - colIndex = cellInfo.colIndex; - // 如果Cells里已经包含了此Cell则跳过 - var key = rowIndex + "|" + colIndex; - if (tdHash[key]) continue; - tdHash[key] = 1; - if ( - rowIndex < i || - colIndex < j || - rowIndex + cellInfo.rowSpan - 1 > endRowIndex || - colIndex + cellInfo.colSpan - 1 > endColIndex - ) { - return null; - } - returnTds.push(this.getCell(rowIndex, cellInfo.cellIndex)); - } - } - return returnTds; - }, - /** - * 清理已经选中的单元格 - */ - clearSelected: function() { - UETable.removeSelectedClass(this.selectedTds); - this.selectedTds = []; - this.cellsRange = {}; - }, - /** - * 根据range设置已经选中的单元格 - */ - setSelected: function(range) { - var cells = this.getCells(range); - UETable.addSelectedClass(cells); - this.selectedTds = cells; - this.cellsRange = range; - }, - isFullRow: function() { - var range = this.cellsRange; - return range.endColIndex - range.beginColIndex + 1 == this.colsNum; - }, - isFullCol: function() { - var range = this.cellsRange, - table = this.table, - ths = table.getElementsByTagName("th"), - rows = range.endRowIndex - range.beginRowIndex + 1; - return !ths.length - ? rows == this.rowsNum - : rows == this.rowsNum || rows == this.rowsNum - 1; - }, - /** - * 获取视觉上的前置单元格,默认是左边,top传入时 - * @param cell - * @param top - */ - getNextCell: function(cell, bottom, ignoreRange) { - try { - var cellInfo = this.getCellInfo(cell), - nextRowIndex, - nextColIndex; - var len = this.selectedTds.length && !ignoreRange, - range = this.cellsRange; - //末行或者末列没有后置单元格 - if ( - (!bottom && cellInfo.rowIndex == 0) || - (bottom && - (!len - ? cellInfo.rowIndex + cellInfo.rowSpan > this.rowsNum - 1 - : range.endRowIndex == this.rowsNum - 1)) - ) - return null; - - nextRowIndex = !bottom - ? !len ? cellInfo.rowIndex - 1 : range.beginRowIndex - 1 - : !len ? cellInfo.rowIndex + cellInfo.rowSpan : range.endRowIndex + 1; - nextColIndex = !len ? cellInfo.colIndex : range.beginColIndex; - return this.getCell( - this.indexTable[nextRowIndex][nextColIndex].rowIndex, - this.indexTable[nextRowIndex][nextColIndex].cellIndex - ); - } catch (e) { - showError(e); - } - }, - getPreviewCell: function(cell, top) { - try { - var cellInfo = this.getCellInfo(cell), - previewRowIndex, - previewColIndex; - var len = this.selectedTds.length, - range = this.cellsRange; - //首行或者首列没有前置单元格 - if ( - (!top && (!len ? !cellInfo.colIndex : !range.beginColIndex)) || - (top && - (!len - ? cellInfo.rowIndex > this.colsNum - 1 - : range.endColIndex == this.colsNum - 1)) - ) - return null; - - previewRowIndex = !top - ? !len ? cellInfo.rowIndex : range.beginRowIndex - : !len - ? cellInfo.rowIndex < 1 ? 0 : cellInfo.rowIndex - 1 - : range.beginRowIndex; - previewColIndex = !top - ? !len - ? cellInfo.colIndex < 1 ? 0 : cellInfo.colIndex - 1 - : range.beginColIndex - 1 - : !len ? cellInfo.colIndex : range.endColIndex + 1; - return this.getCell( - this.indexTable[previewRowIndex][previewColIndex].rowIndex, - this.indexTable[previewRowIndex][previewColIndex].cellIndex - ); - } catch (e) { - showError(e); - } - }, - /** - * 移动单元格中的内容 - */ - moveContent: function(cellTo, cellFrom) { - if (UETable.isEmptyBlock(cellFrom)) return; - if (UETable.isEmptyBlock(cellTo)) { - cellTo.innerHTML = cellFrom.innerHTML; - return; - } - var child = cellTo.lastChild; - if (child.nodeType == 3 || !dtd.$block[child.tagName]) { - cellTo.appendChild(cellTo.ownerDocument.createElement("br")); - } - while ((child = cellFrom.firstChild)) { - cellTo.appendChild(child); - } - }, - /** - * 向右合并单元格 - */ - mergeRight: function(cell) { - var cellInfo = this.getCellInfo(cell), - rightColIndex = cellInfo.colIndex + cellInfo.colSpan, - rightCellInfo = this.indexTable[cellInfo.rowIndex][rightColIndex], - rightCell = this.getCell( - rightCellInfo.rowIndex, - rightCellInfo.cellIndex - ); - //合并 - cell.colSpan = cellInfo.colSpan + rightCellInfo.colSpan; - //被合并的单元格不应存在宽度属性 - cell.removeAttribute("width"); - //移动内容 - this.moveContent(cell, rightCell); - //删掉被合并的Cell - this.deleteCell(rightCell, rightCellInfo.rowIndex); - this.update(); - }, - /** - * 向下合并单元格 - */ - mergeDown: function(cell) { - var cellInfo = this.getCellInfo(cell), - downRowIndex = cellInfo.rowIndex + cellInfo.rowSpan, - downCellInfo = this.indexTable[downRowIndex][cellInfo.colIndex], - downCell = this.getCell(downCellInfo.rowIndex, downCellInfo.cellIndex); - cell.rowSpan = cellInfo.rowSpan + downCellInfo.rowSpan; - cell.removeAttribute("height"); - this.moveContent(cell, downCell); - this.deleteCell(downCell, downCellInfo.rowIndex); - this.update(); - }, - /** - * 合并整个range中的内容 - */ - mergeRange: function() { - //由于合并操作可以在任意时刻进行,所以无法通过鼠标位置等信息实时生成range,只能通过缓存实例中的cellsRange对象来访问 - var range = this.cellsRange, - leftTopCell = this.getCell( - range.beginRowIndex, - this.indexTable[range.beginRowIndex][range.beginColIndex].cellIndex - ); - - // 这段关于行表头或者列表头的特殊处理会导致表头合并范围错误 - // 为什么有这段代码的原因未明,暂且注释掉,希望原作者看到后出面说明下 - // if ( - // leftTopCell.tagName == "TH" && - // range.endRowIndex !== range.beginRowIndex - // ) { - // var index = this.indexTable, - // info = this.getCellInfo(leftTopCell); - // leftTopCell = this.getCell(1, index[1][info.colIndex].cellIndex); - // range = this.getCellsRange( - // leftTopCell, - // this.getCell( - // index[this.rowsNum - 1][info.colIndex].rowIndex, - // index[this.rowsNum - 1][info.colIndex].cellIndex - // ) - // ); - // } - - // 删除剩余的Cells - var cells = this.getCells(range); - for (var i = 0, ci; (ci = cells[i++]); ) { - if (ci !== leftTopCell) { - this.moveContent(leftTopCell, ci); - this.deleteCell(ci); - } - } - // 修改左上角Cell的rowSpan和colSpan,并调整宽度属性设置 - leftTopCell.rowSpan = range.endRowIndex - range.beginRowIndex + 1; - leftTopCell.rowSpan > 1 && leftTopCell.removeAttribute("height"); - leftTopCell.colSpan = range.endColIndex - range.beginColIndex + 1; - leftTopCell.colSpan > 1 && leftTopCell.removeAttribute("width"); - if (leftTopCell.rowSpan == this.rowsNum && leftTopCell.colSpan != 1) { - leftTopCell.colSpan = 1; - } - - if (leftTopCell.colSpan == this.colsNum && leftTopCell.rowSpan != 1) { - var rowIndex = leftTopCell.parentNode.rowIndex; - //解决IE下的表格操作问题 - if (this.table.deleteRow) { - for ( - var i = rowIndex + 1, - curIndex = rowIndex + 1, - len = leftTopCell.rowSpan; - i < len; - i++ - ) { - this.table.deleteRow(curIndex); - } - } else { - for (var i = 0, len = leftTopCell.rowSpan - 1; i < len; i++) { - var row = this.table.rows[rowIndex + 1]; - row.parentNode.removeChild(row); - } - } - leftTopCell.rowSpan = 1; - } - this.update(); - }, - /** - * 插入一行单元格 - */ - insertRow: function(rowIndex, sourceCell) { - var numCols = this.colsNum, - table = this.table, - row = table.insertRow(rowIndex), - cell, - thead = null, - isInsertTitle = - typeof sourceCell == "string" && sourceCell.toUpperCase() == "TH"; - - function replaceTdToTh(colIndex, cell, tableRow) { - if (colIndex == 0) { - var tr = tableRow.nextSibling || tableRow.previousSibling, - th = tr.cells[colIndex]; - if (th.tagName == "TH") { - th = cell.ownerDocument.createElement("th"); - th.appendChild(cell.firstChild); - tableRow.insertBefore(th, cell); - domUtils.remove(cell); - } - } else { - if (cell.tagName == "TH") { - var td = cell.ownerDocument.createElement("td"); - td.appendChild(cell.firstChild); - tableRow.insertBefore(td, cell); - domUtils.remove(cell); - } - } - } - - //首行直接插入,无需考虑部分单元格被rowspan的情况 - if (rowIndex == 0 || rowIndex == this.rowsNum) { - for (var colIndex = 0; colIndex < numCols; colIndex++) { - cell = this.cloneCell(sourceCell, true); - this.setCellContent(cell); - cell.getAttribute("vAlign") && - cell.setAttribute("vAlign", cell.getAttribute("vAlign")); - row.appendChild(cell); - if (!isInsertTitle) replaceTdToTh(colIndex, cell, row); - } - - if (isInsertTitle) { - thead = table.createTHead(); - thead.insertBefore(row, thead.firstChild); - } - } else { - var infoRow = this.indexTable[rowIndex], - cellIndex = 0; - for (colIndex = 0; colIndex < numCols; colIndex++) { - var cellInfo = infoRow[colIndex]; - //如果存在某个单元格的rowspan穿过待插入行的位置,则修改该单元格的rowspan即可,无需插入单元格 - if (cellInfo.rowIndex < rowIndex) { - cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); - cell.rowSpan = cellInfo.rowSpan + 1; - } else { - cell = this.cloneCell(sourceCell, true); - this.setCellContent(cell); - row.appendChild(cell); - } - if (!isInsertTitle) replaceTdToTh(colIndex, cell, row); - } - } - //框选时插入不触发contentchange,需要手动更新索引。 - this.update(); - return row; - }, - /** - * 删除一行单元格 - * @param rowIndex - */ - deleteRow: function(rowIndex) { - var row = this.table.rows[rowIndex], - infoRow = this.indexTable[rowIndex], - colsNum = this.colsNum, - count = 0; //处理计数 - for (var colIndex = 0; colIndex < colsNum; ) { - var cellInfo = infoRow[colIndex], - cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); - if (cell.rowSpan > 1) { - if (cellInfo.rowIndex == rowIndex) { - var clone = cell.cloneNode(true); - clone.rowSpan = cell.rowSpan - 1; - clone.innerHTML = ""; - cell.rowSpan = 1; - var nextRowIndex = rowIndex + 1, - nextRow = this.table.rows[nextRowIndex], - insertCellIndex, - preMerged = - this.getPreviewMergedCellsNum(nextRowIndex, colIndex) - count; - if (preMerged < colIndex) { - insertCellIndex = colIndex - preMerged - 1; - //nextRow.insertCell(insertCellIndex); - domUtils.insertAfter(nextRow.cells[insertCellIndex], clone); - } else { - if (nextRow.cells.length) - nextRow.insertBefore(clone, nextRow.cells[0]); - } - count += 1; - //cell.parentNode.removeChild(cell); - } - } - colIndex += cell.colSpan || 1; - } - var deleteTds = [], - cacheMap = {}; - for (colIndex = 0; colIndex < colsNum; colIndex++) { - var tmpRowIndex = infoRow[colIndex].rowIndex, - tmpCellIndex = infoRow[colIndex].cellIndex, - key = tmpRowIndex + "_" + tmpCellIndex; - if (cacheMap[key]) continue; - cacheMap[key] = 1; - cell = this.getCell(tmpRowIndex, tmpCellIndex); - deleteTds.push(cell); - } - var mergeTds = []; - utils.each(deleteTds, function(td) { - if (td.rowSpan == 1) { - td.parentNode.removeChild(td); - } else { - mergeTds.push(td); - } - }); - utils.each(mergeTds, function(td) { - td.rowSpan--; - }); - row.parentNode.removeChild(row); - //浏览器方法本身存在bug,采用自定义方法删除 - //this.table.deleteRow(rowIndex); - this.update(); - }, - insertCol: function(colIndex, sourceCell, defaultValue) { - var rowsNum = this.rowsNum, - rowIndex = 0, - tableRow, - cell, - backWidth = parseInt( - (this.table.offsetWidth - - (this.colsNum + 1) * 20 - - (this.colsNum + 1)) / - (this.colsNum + 1), - 10 - ), - isInsertTitleCol = - typeof sourceCell == "string" && sourceCell.toUpperCase() == "TH"; - - function replaceTdToTh(rowIndex, cell, tableRow) { - if (rowIndex == 0) { - var th = cell.nextSibling || cell.previousSibling; - if (th.tagName == "TH") { - th = cell.ownerDocument.createElement("th"); - th.appendChild(cell.firstChild); - tableRow.insertBefore(th, cell); - domUtils.remove(cell); - } - } else { - if (cell.tagName == "TH") { - var td = cell.ownerDocument.createElement("td"); - td.appendChild(cell.firstChild); - tableRow.insertBefore(td, cell); - domUtils.remove(cell); - } - } - } - - var preCell; - if (colIndex == 0 || colIndex == this.colsNum) { - for (; rowIndex < rowsNum; rowIndex++) { - tableRow = this.table.rows[rowIndex]; - preCell = - tableRow.cells[colIndex == 0 ? colIndex : tableRow.cells.length]; - cell = this.cloneCell(sourceCell, true); //tableRow.insertCell(colIndex == 0 ? colIndex : tableRow.cells.length); - this.setCellContent(cell); - cell.setAttribute("vAlign", cell.getAttribute("vAlign")); - preCell && cell.setAttribute("width", preCell.getAttribute("width")); - if (!colIndex) { - tableRow.insertBefore(cell, tableRow.cells[0]); - } else { - domUtils.insertAfter( - tableRow.cells[tableRow.cells.length - 1], - cell - ); - } - if (!isInsertTitleCol) replaceTdToTh(rowIndex, cell, tableRow); - } - } else { - for (; rowIndex < rowsNum; rowIndex++) { - var cellInfo = this.indexTable[rowIndex][colIndex]; - if (cellInfo.colIndex < colIndex) { - cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); - cell.colSpan = cellInfo.colSpan + 1; - } else { - tableRow = this.table.rows[rowIndex]; - preCell = tableRow.cells[cellInfo.cellIndex]; - - cell = this.cloneCell(sourceCell, true); //tableRow.insertCell(cellInfo.cellIndex); - this.setCellContent(cell); - cell.setAttribute("vAlign", cell.getAttribute("vAlign")); - preCell && - cell.setAttribute("width", preCell.getAttribute("width")); - //防止IE下报错 - preCell - ? tableRow.insertBefore(cell, preCell) - : tableRow.appendChild(cell); - } - if (!isInsertTitleCol) replaceTdToTh(rowIndex, cell, tableRow); - } - } - //框选时插入不触发contentchange,需要手动更新索引 - this.update(); - this.updateWidth( - backWidth, - defaultValue || { tdPadding: 10, tdBorder: 1 } - ); - }, - updateWidth: function(width, defaultValue) { - var table = this.table, - tmpWidth = - UETable.getWidth(table) - - defaultValue.tdPadding * 2 - - defaultValue.tdBorder + - width; - if (tmpWidth < table.ownerDocument.body.offsetWidth) { - table.setAttribute("width", tmpWidth); - return; - } - var tds = domUtils.getElementsByTagName(this.table, "td th"); - utils.each(tds, function(td) { - td.setAttribute("width", width); - }); - }, - deleteCol: function(colIndex) { - var indexTable = this.indexTable, - tableRows = this.table.rows, - backTableWidth = this.table.getAttribute("width"), - backTdWidth = 0, - rowsNum = this.rowsNum, - cacheMap = {}; - for (var rowIndex = 0; rowIndex < rowsNum; ) { - var infoRow = indexTable[rowIndex], - cellInfo = infoRow[colIndex], - key = cellInfo.rowIndex + "_" + cellInfo.colIndex; - // 跳过已经处理过的Cell - if (cacheMap[key]) continue; - cacheMap[key] = 1; - var cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); - if (!backTdWidth) - backTdWidth = - cell && parseInt(cell.offsetWidth / cell.colSpan, 10).toFixed(0); - // 如果Cell的colSpan大于1, 就修改colSpan, 否则就删掉这个Cell - if (cell.colSpan > 1) { - cell.colSpan--; - } else { - tableRows[rowIndex].deleteCell(cellInfo.cellIndex); - } - rowIndex += cellInfo.rowSpan || 1; - } - this.table.setAttribute("width", backTableWidth - backTdWidth); - this.update(); - }, - splitToCells: function(cell) { - var me = this, - cells = this.splitToRows(cell); - utils.each(cells, function(cell) { - me.splitToCols(cell); - }); - }, - splitToRows: function(cell) { - var cellInfo = this.getCellInfo(cell), - rowIndex = cellInfo.rowIndex, - colIndex = cellInfo.colIndex, - results = []; - // 修改Cell的rowSpan - cell.rowSpan = 1; - results.push(cell); - // 补齐单元格 - for ( - var i = rowIndex, endRow = rowIndex + cellInfo.rowSpan; - i < endRow; - i++ - ) { - if (i == rowIndex) continue; - var tableRow = this.table.rows[i], - tmpCell = tableRow.insertCell( - colIndex - this.getPreviewMergedCellsNum(i, colIndex) - ); - tmpCell.colSpan = cellInfo.colSpan; - this.setCellContent(tmpCell); - tmpCell.setAttribute("vAlign", cell.getAttribute("vAlign")); - tmpCell.setAttribute("align", cell.getAttribute("align")); - if (cell.style.cssText) { - tmpCell.style.cssText = cell.style.cssText; - } - results.push(tmpCell); - } - this.update(); - return results; - }, - getPreviewMergedCellsNum: function(rowIndex, colIndex) { - var indexRow = this.indexTable[rowIndex], - num = 0; - for (var i = 0; i < colIndex; ) { - var colSpan = indexRow[i].colSpan, - tmpRowIndex = indexRow[i].rowIndex; - num += colSpan - (tmpRowIndex == rowIndex ? 1 : 0); - i += colSpan; - } - return num; - }, - splitToCols: function(cell) { - var backWidth = (cell.offsetWidth / cell.colSpan - 22).toFixed(0), - cellInfo = this.getCellInfo(cell), - rowIndex = cellInfo.rowIndex, - colIndex = cellInfo.colIndex, - results = []; - // 修改Cell的rowSpan - cell.colSpan = 1; - cell.setAttribute("width", backWidth); - results.push(cell); - // 补齐单元格 - for ( - var j = colIndex, endCol = colIndex + cellInfo.colSpan; - j < endCol; - j++ - ) { - if (j == colIndex) continue; - var tableRow = this.table.rows[rowIndex], - tmpCell = tableRow.insertCell( - this.indexTable[rowIndex][j].cellIndex + 1 - ); - tmpCell.rowSpan = cellInfo.rowSpan; - this.setCellContent(tmpCell); - tmpCell.setAttribute("vAlign", cell.getAttribute("vAlign")); - tmpCell.setAttribute("align", cell.getAttribute("align")); - tmpCell.setAttribute("width", backWidth); - if (cell.style.cssText) { - tmpCell.style.cssText = cell.style.cssText; - } - //处理th的情况 - if (cell.tagName == "TH") { - var th = cell.ownerDocument.createElement("th"); - th.appendChild(tmpCell.firstChild); - th.setAttribute("vAlign", cell.getAttribute("vAlign")); - th.rowSpan = tmpCell.rowSpan; - tableRow.insertBefore(th, tmpCell); - domUtils.remove(tmpCell); - } - results.push(tmpCell); - } - this.update(); - return results; - }, - isLastCell: function(cell, rowsNum, colsNum) { - rowsNum = rowsNum || this.rowsNum; - colsNum = colsNum || this.colsNum; - var cellInfo = this.getCellInfo(cell); - return ( - cellInfo.rowIndex + cellInfo.rowSpan == rowsNum && - cellInfo.colIndex + cellInfo.colSpan == colsNum - ); - }, - getLastCell: function(cells) { - cells = cells || this.table.getElementsByTagName("td"); - var firstInfo = this.getCellInfo(cells[0]); - var me = this, - last = cells[0], - tr = last.parentNode, - cellsNum = 0, - cols = 0, - rows; - utils.each(cells, function(cell) { - if (cell.parentNode == tr) cols += cell.colSpan || 1; - cellsNum += cell.rowSpan * cell.colSpan || 1; - }); - rows = cellsNum / cols; - utils.each(cells, function(cell) { - if (me.isLastCell(cell, rows, cols)) { - last = cell; - return false; - } - }); - return last; - }, - selectRow: function(rowIndex) { - var indexRow = this.indexTable[rowIndex], - start = this.getCell(indexRow[0].rowIndex, indexRow[0].cellIndex), - end = this.getCell( - indexRow[this.colsNum - 1].rowIndex, - indexRow[this.colsNum - 1].cellIndex - ), - range = this.getCellsRange(start, end); - this.setSelected(range); - }, - selectTable: function() { - var tds = this.table.getElementsByTagName("td"), - range = this.getCellsRange(tds[0], tds[tds.length - 1]); - this.setSelected(range); - }, - setBackground: function(cells, value) { - if (typeof value === "string") { - utils.each(cells, function(cell) { - cell.style.backgroundColor = value; - }); - } else if (typeof value === "object") { - value = utils.extend( - { - repeat: true, - colorList: ["#ddd", "#fff"] - }, - value - ); - var rowIndex = this.getCellInfo(cells[0]).rowIndex, - count = 0, - colors = value.colorList, - getColor = function(list, index, repeat) { - return list[index] - ? list[index] - : repeat ? list[index % list.length] : ""; - }; - for (var i = 0, cell; (cell = cells[i++]); ) { - var cellInfo = this.getCellInfo(cell); - cell.style.backgroundColor = getColor( - colors, - rowIndex + count == cellInfo.rowIndex ? count : ++count, - value.repeat - ); - } - } - }, - removeBackground: function(cells) { - utils.each(cells, function(cell) { - cell.style.backgroundColor = ""; - }); - } - }; - function showError(e) {} -})(); - - -// plugins/table.cmds.js -/** - * Created with JetBrains PhpStorm. - * User: taoqili - * Date: 13-2-20 - * Time: 下午6:25 - * To change this template use File | Settings | File Templates. - */ -;(function() { - var UT = UE.UETable, - getTableItemsByRange = function(editor) { - return UT.getTableItemsByRange(editor); - }, - getUETableBySelected = function(editor) { - return UT.getUETableBySelected(editor); - }, - getDefaultValue = function(editor, table) { - return UT.getDefaultValue(editor, table); - }, - getUETable = function(tdOrTable) { - return UT.getUETable(tdOrTable); - }; - - UE.commands["inserttable"] = { - queryCommandState: function() { - return getTableItemsByRange(this).table ? -1 : 0; - }, - execCommand: function(cmd, opt) { - function createTable(opt, tdWidth) { - var html = [], - rowsNum = opt.numRows, - colsNum = opt.numCols; - for (var r = 0; r < rowsNum; r++) { - html.push(""); - for (var c = 0; c < colsNum; c++) { - html.push( - '
                    • ' + - (browser.ie && browser.version < 11 - ? domUtils.fillChar - : "
                      ") + - "
                      " + html.join("") + "
                      "; - } - - if (!opt) { - opt = utils.extend( - {}, - { - numCols: this.options.defaultCols, - numRows: this.options.defaultRows, - tdvalign: this.options.tdvalign - } - ); - } - var me = this; - var range = this.selection.getRange(), - start = range.startContainer, - firstParentBlock = - domUtils.findParent( - start, - function(node) { - return domUtils.isBlockElm(node); - }, - true - ) || me.body; - - var defaultValue = getDefaultValue(me), - tableWidth = firstParentBlock.offsetWidth, - tdWidth = Math.floor( - tableWidth / opt.numCols - - defaultValue.tdPadding * 2 - - defaultValue.tdBorder - ); - - //todo其他属性 - !opt.tdvalign && (opt.tdvalign = me.options.tdvalign); - me.execCommand("inserthtml", createTable(opt, tdWidth)); - } - }; - - UE.commands["insertparagraphbeforetable"] = { - queryCommandState: function() { - return getTableItemsByRange(this).cell ? 0 : -1; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var p = this.document.createElement("p"); - p.innerHTML = browser.ie ? " " : "
                      "; - table.parentNode.insertBefore(p, table); - this.selection.getRange().setStart(p, 0).setCursor(); - } - } - }; - - UE.commands["deletetable"] = { - queryCommandState: function() { - var rng = this.selection.getRange(); - return domUtils.findParentByTagName(rng.startContainer, "table", true) - ? 0 - : -1; - }, - execCommand: function(cmd, table) { - var rng = this.selection.getRange(); - table = - table || - domUtils.findParentByTagName(rng.startContainer, "table", true); - if (table) { - var next = table.nextSibling; - if (!next) { - next = domUtils.createElement(this.document, "p", { - innerHTML: browser.ie ? domUtils.fillChar : "
                      " - }); - table.parentNode.insertBefore(next, table); - } - domUtils.remove(table); - rng = this.selection.getRange(); - if (next.nodeType == 3) { - rng.setStartBefore(next); - } else { - rng.setStart(next, 0); - } - rng.setCursor(false, true); - this.fireEvent("tablehasdeleted"); - } - } - }; - UE.commands["cellalign"] = { - queryCommandState: function() { - return getSelectedArr(this).length ? 0 : -1; - }, - execCommand: function(cmd, align) { - var selectedTds = getSelectedArr(this); - if (selectedTds.length) { - for (var i = 0, ci; (ci = selectedTds[i++]); ) { - ci.setAttribute("align", align); - } - } - } - }; - UE.commands["cellvalign"] = { - queryCommandState: function() { - return getSelectedArr(this).length ? 0 : -1; - }, - execCommand: function(cmd, valign) { - var selectedTds = getSelectedArr(this); - if (selectedTds.length) { - for (var i = 0, ci; (ci = selectedTds[i++]); ) { - ci.setAttribute("vAlign", valign); - } - } - } - }; - UE.commands["insertcaption"] = { - queryCommandState: function() { - var table = getTableItemsByRange(this).table; - if (table) { - return table.getElementsByTagName("caption").length == 0 ? 1 : -1; - } - return -1; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var caption = this.document.createElement("caption"); - caption.innerHTML = browser.ie ? domUtils.fillChar : "
                      "; - table.insertBefore(caption, table.firstChild); - var range = this.selection.getRange(); - range.setStart(caption, 0).setCursor(); - } - } - }; - UE.commands["deletecaption"] = { - queryCommandState: function() { - var rng = this.selection.getRange(), - table = domUtils.findParentByTagName(rng.startContainer, "table"); - if (table) { - return table.getElementsByTagName("caption").length == 0 ? -1 : 1; - } - return -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - table = domUtils.findParentByTagName(rng.startContainer, "table"); - if (table) { - domUtils.remove(table.getElementsByTagName("caption")[0]); - var range = this.selection.getRange(); - range.setStart(table.rows[0].cells[0], 0).setCursor(); - } - } - }; - UE.commands["inserttitle"] = { - queryCommandState: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var firstRow = table.rows[0]; - return firstRow.cells[ - firstRow.cells.length - 1 - ].tagName.toLowerCase() != "th" - ? 0 - : -1; - } - return -1; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - if (table) { - getUETable(table).insertRow(0, "th"); - } - var th = table.getElementsByTagName("th")[0]; - this.selection.getRange().setStart(th, 0).setCursor(false, true); - } - }; - UE.commands["deletetitle"] = { - queryCommandState: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var firstRow = table.rows[0]; - return firstRow.cells[ - firstRow.cells.length - 1 - ].tagName.toLowerCase() == "th" - ? 0 - : -1; - } - return -1; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - if (table) { - domUtils.remove(table.rows[0]); - } - var td = table.getElementsByTagName("td")[0]; - this.selection.getRange().setStart(td, 0).setCursor(false, true); - } - }; - UE.commands["inserttitlecol"] = { - queryCommandState: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var lastRow = table.rows[table.rows.length - 1]; - return lastRow.getElementsByTagName("th").length ? -1 : 0; - } - return -1; - }, - execCommand: function(cmd) { - var table = getTableItemsByRange(this).table; - if (table) { - getUETable(table).insertCol(0, "th"); - } - resetTdWidth(table, this); - var th = table.getElementsByTagName("th")[0]; - this.selection.getRange().setStart(th, 0).setCursor(false, true); - } - }; - UE.commands["deletetitlecol"] = { - queryCommandState: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var lastRow = table.rows[table.rows.length - 1]; - return lastRow.getElementsByTagName("th").length ? 0 : -1; - } - return -1; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - if (table) { - for (var i = 0; i < table.rows.length; i++) { - domUtils.remove(table.rows[i].children[0]); - } - } - resetTdWidth(table, this); - var td = table.getElementsByTagName("td")[0]; - this.selection.getRange().setStart(td, 0).setCursor(false, true); - } - }; - - UE.commands["mergeright"] = { - queryCommandState: function(cmd) { - var tableItems = getTableItemsByRange(this), - table = tableItems.table, - cell = tableItems.cell; - - if (!table || !cell) return -1; - var ut = getUETable(table); - if (ut.selectedTds.length) return -1; - - var cellInfo = ut.getCellInfo(cell), - rightColIndex = cellInfo.colIndex + cellInfo.colSpan; - if (rightColIndex >= ut.colsNum) return -1; // 如果处于最右边则不能向右合并 - - var rightCellInfo = ut.indexTable[cellInfo.rowIndex][rightColIndex], - rightCell = - table.rows[rightCellInfo.rowIndex].cells[rightCellInfo.cellIndex]; - if (!rightCell || cell.tagName != rightCell.tagName) return -1; // TH和TD不能相互合并 - - // 当且仅当两个Cell的开始列号和结束列号一致时能进行合并 - return rightCellInfo.rowIndex == cellInfo.rowIndex && - rightCellInfo.rowSpan == cellInfo.rowSpan - ? 0 - : -1; - }, - execCommand: function(cmd) { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell); - ut.mergeRight(cell); - rng.moveToBookmark(bk).select(); - } - }; - UE.commands["mergedown"] = { - queryCommandState: function(cmd) { - var tableItems = getTableItemsByRange(this), - table = tableItems.table, - cell = tableItems.cell; - - if (!table || !cell) return -1; - var ut = getUETable(table); - if (ut.selectedTds.length) return -1; - - var cellInfo = ut.getCellInfo(cell), - downRowIndex = cellInfo.rowIndex + cellInfo.rowSpan; - if (downRowIndex >= ut.rowsNum) return -1; // 如果处于最下边则不能向下合并 - - var downCellInfo = ut.indexTable[downRowIndex][cellInfo.colIndex], - downCell = - table.rows[downCellInfo.rowIndex].cells[downCellInfo.cellIndex]; - if (!downCell || cell.tagName != downCell.tagName) return -1; // TH和TD不能相互合并 - - // 当且仅当两个Cell的开始列号和结束列号一致时能进行合并 - return downCellInfo.colIndex == cellInfo.colIndex && - downCellInfo.colSpan == cellInfo.colSpan - ? 0 - : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell); - ut.mergeDown(cell); - rng.moveToBookmark(bk).select(); - } - }; - UE.commands["mergecells"] = { - queryCommandState: function() { - return getUETableBySelected(this) ? 0 : -1; - }, - execCommand: function() { - var ut = getUETableBySelected(this); - if (ut && ut.selectedTds.length) { - var cell = ut.selectedTds[0]; - ut.mergeRange(); - var rng = this.selection.getRange(); - if (domUtils.isEmptyBlock(cell)) { - rng.setStart(cell, 0).collapse(true); - } else { - rng.selectNodeContents(cell); - } - rng.select(); - } - } - }; - UE.commands["insertrow"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - return cell && - (cell.tagName == "TD" || - (cell.tagName == "TH" && - tableItems.tr !== tableItems.table.rows[0])) && - getUETable(tableItems.table).rowsNum < this.options.maxRowNum - ? 0 - : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell, - table = tableItems.table, - ut = getUETable(table), - cellInfo = ut.getCellInfo(cell); - //ut.insertRow(!ut.selectedTds.length ? cellInfo.rowIndex:ut.cellsRange.beginRowIndex,''); - if (!ut.selectedTds.length) { - ut.insertRow(cellInfo.rowIndex, cell); - } else { - var range = ut.cellsRange; - for ( - var i = 0, len = range.endRowIndex - range.beginRowIndex + 1; - i < len; - i++ - ) { - ut.insertRow(range.beginRowIndex, cell); - } - } - rng.moveToBookmark(bk).select(); - if (table.getAttribute("interlaced") === "enabled") - this.fireEvent("interlacetable", table); - } - }; - //后插入行 - UE.commands["insertrownext"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - return cell && - cell.tagName == "TD" && - getUETable(tableItems.table).rowsNum < this.options.maxRowNum - ? 0 - : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell, - table = tableItems.table, - ut = getUETable(table), - cellInfo = ut.getCellInfo(cell); - //ut.insertRow(!ut.selectedTds.length? cellInfo.rowIndex + cellInfo.rowSpan : ut.cellsRange.endRowIndex + 1,''); - if (!ut.selectedTds.length) { - ut.insertRow(cellInfo.rowIndex + cellInfo.rowSpan, cell); - } else { - var range = ut.cellsRange; - for ( - var i = 0, len = range.endRowIndex - range.beginRowIndex + 1; - i < len; - i++ - ) { - ut.insertRow(range.endRowIndex + 1, cell); - } - } - rng.moveToBookmark(bk).select(); - if (table.getAttribute("interlaced") === "enabled") - this.fireEvent("interlacetable", table); - } - }; - UE.commands["deleterow"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this); - return tableItems.cell ? 0 : -1; - }, - execCommand: function() { - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell), - cellsRange = ut.cellsRange, - cellInfo = ut.getCellInfo(cell), - preCell = ut.getVSideCell(cell), - nextCell = ut.getVSideCell(cell, true), - rng = this.selection.getRange(); - if (utils.isEmptyObject(cellsRange)) { - ut.deleteRow(cellInfo.rowIndex); - } else { - for ( - var i = cellsRange.beginRowIndex; - i < cellsRange.endRowIndex + 1; - i++ - ) { - ut.deleteRow(cellsRange.beginRowIndex); - } - } - var table = ut.table; - if (!table.getElementsByTagName("td").length) { - var nextSibling = table.nextSibling; - domUtils.remove(table); - if (nextSibling) { - rng.setStart(nextSibling, 0).setCursor(false, true); - } - } else { - if ( - cellInfo.rowSpan == 1 || - cellInfo.rowSpan == - cellsRange.endRowIndex - cellsRange.beginRowIndex + 1 - ) { - if (nextCell || preCell) - rng.selectNodeContents(nextCell || preCell).setCursor(false, true); - } else { - var newCell = ut.getCell( - cellInfo.rowIndex, - ut.indexTable[cellInfo.rowIndex][cellInfo.colIndex].cellIndex - ); - if (newCell) rng.selectNodeContents(newCell).setCursor(false, true); - } - } - if (table.getAttribute("interlaced") === "enabled") - this.fireEvent("interlacetable", table); - } - }; - UE.commands["insertcol"] = { - queryCommandState: function(cmd) { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - return cell && - (cell.tagName == "TD" || - (cell.tagName == "TH" && cell !== tableItems.tr.cells[0])) && - getUETable(tableItems.table).colsNum < this.options.maxColNum - ? 0 - : -1; - }, - execCommand: function(cmd) { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - if (this.queryCommandState(cmd) == -1) return; - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell), - cellInfo = ut.getCellInfo(cell); - - //ut.insertCol(!ut.selectedTds.length ? cellInfo.colIndex:ut.cellsRange.beginColIndex); - if (!ut.selectedTds.length) { - ut.insertCol(cellInfo.colIndex, cell); - } else { - var range = ut.cellsRange; - for ( - var i = 0, len = range.endColIndex - range.beginColIndex + 1; - i < len; - i++ - ) { - ut.insertCol(range.beginColIndex, cell); - } - } - rng.moveToBookmark(bk).select(true); - } - }; - UE.commands["insertcolnext"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - return cell && - getUETable(tableItems.table).colsNum < this.options.maxColNum - ? 0 - : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell), - cellInfo = ut.getCellInfo(cell); - //ut.insertCol(!ut.selectedTds.length ? cellInfo.colIndex + cellInfo.colSpan:ut.cellsRange.endColIndex +1); - if (!ut.selectedTds.length) { - ut.insertCol(cellInfo.colIndex + cellInfo.colSpan, cell); - } else { - var range = ut.cellsRange; - for ( - var i = 0, len = range.endColIndex - range.beginColIndex + 1; - i < len; - i++ - ) { - ut.insertCol(range.endColIndex + 1, cell); - } - } - rng.moveToBookmark(bk).select(); - } - }; - - UE.commands["deletecol"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this); - return tableItems.cell ? 0 : -1; - }, - execCommand: function() { - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell), - range = ut.cellsRange, - cellInfo = ut.getCellInfo(cell), - preCell = ut.getHSideCell(cell), - nextCell = ut.getHSideCell(cell, true); - if (utils.isEmptyObject(range)) { - ut.deleteCol(cellInfo.colIndex); - } else { - for (var i = range.beginColIndex; i < range.endColIndex + 1; i++) { - ut.deleteCol(range.beginColIndex); - } - } - var table = ut.table, - rng = this.selection.getRange(); - - if (!table.getElementsByTagName("td").length) { - var nextSibling = table.nextSibling; - domUtils.remove(table); - if (nextSibling) { - rng.setStart(nextSibling, 0).setCursor(false, true); - } - } else { - if (domUtils.inDoc(cell, this.document)) { - rng.setStart(cell, 0).setCursor(false, true); - } else { - if (nextCell && domUtils.inDoc(nextCell, this.document)) { - rng.selectNodeContents(nextCell).setCursor(false, true); - } else { - if (preCell && domUtils.inDoc(preCell, this.document)) { - rng.selectNodeContents(preCell).setCursor(true, true); - } - } - } - } - } - }; - UE.commands["splittocells"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - if (!cell) return -1; - var ut = getUETable(tableItems.table); - if (ut.selectedTds.length > 0) return -1; - return cell && (cell.colSpan > 1 || cell.rowSpan > 1) ? 0 : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell); - ut.splitToCells(cell); - rng.moveToBookmark(bk).select(); - } - }; - UE.commands["splittorows"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - if (!cell) return -1; - var ut = getUETable(tableItems.table); - if (ut.selectedTds.length > 0) return -1; - return cell && cell.rowSpan > 1 ? 0 : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell); - ut.splitToRows(cell); - rng.moveToBookmark(bk).select(); - } - }; - UE.commands["splittocols"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - if (!cell) return -1; - var ut = getUETable(tableItems.table); - if (ut.selectedTds.length > 0) return -1; - return cell && cell.colSpan > 1 ? 0 : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell); - ut.splitToCols(cell); - rng.moveToBookmark(bk).select(); - } - }; - - UE.commands["adaptbytext"] = UE.commands["adaptbywindow"] = { - queryCommandState: function() { - return getTableItemsByRange(this).table ? 0 : -1; - }, - execCommand: function(cmd) { - var tableItems = getTableItemsByRange(this), - table = tableItems.table; - if (table) { - if (cmd == "adaptbywindow") { - resetTdWidth(table, this); - } else { - var cells = domUtils.getElementsByTagName(table, "td th"); - utils.each(cells, function(cell) { - cell.removeAttribute("width"); - }); - table.removeAttribute("width"); - } - } - } - }; - - //平均分配各列 - UE.commands["averagedistributecol"] = { - queryCommandState: function() { - var ut = getUETableBySelected(this); - if (!ut) return -1; - return ut.isFullRow() || ut.isFullCol() ? 0 : -1; - }, - execCommand: function(cmd) { - var me = this, - ut = getUETableBySelected(me); - - function getAverageWidth() { - var tb = ut.table, - averageWidth, - sumWidth = 0, - colsNum = 0, - tbAttr = getDefaultValue(me, tb); - - if (ut.isFullRow()) { - sumWidth = tb.offsetWidth; - colsNum = ut.colsNum; - } else { - var begin = ut.cellsRange.beginColIndex, - end = ut.cellsRange.endColIndex, - node; - for (var i = begin; i <= end; ) { - node = ut.selectedTds[i]; - sumWidth += node.offsetWidth; - i += node.colSpan; - colsNum += 1; - } - } - averageWidth = - Math.ceil(sumWidth / colsNum) - - tbAttr.tdBorder * 2 - - tbAttr.tdPadding * 2; - return averageWidth; - } - - function setAverageWidth(averageWidth) { - utils.each(domUtils.getElementsByTagName(ut.table, "th"), function( - node - ) { - node.setAttribute("width", ""); - }); - var cells = ut.isFullRow() - ? domUtils.getElementsByTagName(ut.table, "td") - : ut.selectedTds; - - utils.each(cells, function(node) { - if (node.colSpan == 1) { - node.setAttribute("width", averageWidth); - } - }); - } - - if (ut && ut.selectedTds.length) { - setAverageWidth(getAverageWidth()); - } - } - }; - //平均分配各行 - UE.commands["averagedistributerow"] = { - queryCommandState: function() { - var ut = getUETableBySelected(this); - if (!ut) return -1; - if (ut.selectedTds && /th/gi.test(ut.selectedTds[0].tagName)) return -1; - return ut.isFullRow() || ut.isFullCol() ? 0 : -1; - }, - execCommand: function(cmd) { - var me = this, - ut = getUETableBySelected(me); - - function getAverageHeight() { - var averageHeight, - rowNum, - sumHeight = 0, - tb = ut.table, - tbAttr = getDefaultValue(me, tb), - tdpadding = parseInt( - domUtils.getComputedStyle( - tb.getElementsByTagName("td")[0], - "padding-top" - ) - ); - - if (ut.isFullCol()) { - var captionArr = domUtils.getElementsByTagName(tb, "caption"), - thArr = domUtils.getElementsByTagName(tb, "th"), - captionHeight, - thHeight; - - if (captionArr.length > 0) { - captionHeight = captionArr[0].offsetHeight; - } - if (thArr.length > 0) { - thHeight = thArr[0].offsetHeight; - } - - sumHeight = tb.offsetHeight - (captionHeight || 0) - (thHeight || 0); - rowNum = thArr.length == 0 ? ut.rowsNum : ut.rowsNum - 1; - } else { - var begin = ut.cellsRange.beginRowIndex, - end = ut.cellsRange.endRowIndex, - count = 0, - trs = domUtils.getElementsByTagName(tb, "tr"); - for (var i = begin; i <= end; i++) { - sumHeight += trs[i].offsetHeight; - count += 1; - } - rowNum = count; - } - //ie8下是混杂模式 - if (browser.ie && browser.version < 9) { - averageHeight = Math.ceil(sumHeight / rowNum); - } else { - averageHeight = - Math.ceil(sumHeight / rowNum) - tbAttr.tdBorder * 2 - tdpadding * 2; - } - return averageHeight; - } - - function setAverageHeight(averageHeight) { - var cells = ut.isFullCol() - ? domUtils.getElementsByTagName(ut.table, "td") - : ut.selectedTds; - utils.each(cells, function(node) { - if (node.rowSpan == 1) { - node.setAttribute("height", averageHeight); - } - }); - } - - if (ut && ut.selectedTds.length) { - setAverageHeight(getAverageHeight()); - } - } - }; - - //单元格对齐方式 - UE.commands["cellalignment"] = { - queryCommandState: function() { - return getTableItemsByRange(this).table ? 0 : -1; - }, - execCommand: function(cmd, data) { - var me = this, - ut = getUETableBySelected(me); - - if (!ut) { - var start = me.selection.getStart(), - cell = - start && - domUtils.findParentByTagName(start, ["td", "th", "caption"], true); - if (!/caption/gi.test(cell.tagName)) { - domUtils.setAttributes(cell, data); - } else { - cell.style.textAlign = data.align; - cell.style.verticalAlign = data.vAlign; - } - me.selection.getRange().setCursor(true); - } else { - utils.each(ut.selectedTds, function(cell) { - domUtils.setAttributes(cell, data); - }); - } - }, - /** - * 查询当前点击的单元格的对齐状态, 如果当前已经选择了多个单元格, 则会返回所有单元格经过统一协调过后的状态 - * @see UE.UETable.getTableCellAlignState - */ - queryCommandValue: function(cmd) { - var activeMenuCell = getTableItemsByRange(this).cell; - - if (!activeMenuCell) { - activeMenuCell = getSelectedArr(this)[0]; - } - - if (!activeMenuCell) { - return null; - } else { - //获取同时选中的其他单元格 - var cells = UE.UETable.getUETable(activeMenuCell).selectedTds; - - !cells.length && (cells = activeMenuCell); - - return UE.UETable.getTableCellAlignState(cells); - } - } - }; - //表格对齐方式 - UE.commands["tablealignment"] = { - queryCommandState: function() { - if (browser.ie && browser.version < 8) { - return -1; - } - return getTableItemsByRange(this).table ? 0 : -1; - }, - execCommand: function(cmd, value) { - var me = this, - start = me.selection.getStart(), - table = start && domUtils.findParentByTagName(start, ["table"], true); - - if (table) { - table.setAttribute("align", value); - } - } - }; - - //表格属性 - UE.commands["edittable"] = { - queryCommandState: function() { - return getTableItemsByRange(this).table ? 0 : -1; - }, - execCommand: function(cmd, color) { - var rng = this.selection.getRange(), - table = domUtils.findParentByTagName(rng.startContainer, "table"); - if (table) { - var arr = domUtils - .getElementsByTagName(table, "td") - .concat( - domUtils.getElementsByTagName(table, "th"), - domUtils.getElementsByTagName(table, "caption") - ); - utils.each(arr, function(node) { - node.style.borderColor = color; - }); - } - } - }; - //单元格属性 - UE.commands["edittd"] = { - queryCommandState: function() { - return getTableItemsByRange(this).table ? 0 : -1; - }, - execCommand: function(cmd, bkColor) { - var me = this, - ut = getUETableBySelected(me); - - if (!ut) { - var start = me.selection.getStart(), - cell = - start && - domUtils.findParentByTagName(start, ["td", "th", "caption"], true); - if (cell) { - cell.style.backgroundColor = bkColor; - } - } else { - utils.each(ut.selectedTds, function(cell) { - cell.style.backgroundColor = bkColor; - }); - } - } - }; - - UE.commands["settablebackground"] = { - queryCommandState: function() { - return getSelectedArr(this).length > 1 ? 0 : -1; - }, - execCommand: function(cmd, value) { - var cells, ut; - cells = getSelectedArr(this); - ut = getUETable(cells[0]); - ut.setBackground(cells, value); - } - }; - - UE.commands["cleartablebackground"] = { - queryCommandState: function() { - var cells = getSelectedArr(this); - if (!cells.length) return -1; - for (var i = 0, cell; (cell = cells[i++]); ) { - if (cell.style.backgroundColor !== "") return 0; - } - return -1; - }, - execCommand: function() { - var cells = getSelectedArr(this), - ut = getUETable(cells[0]); - ut.removeBackground(cells); - } - }; - - UE.commands["interlacetable"] = UE.commands["uninterlacetable"] = { - queryCommandState: function(cmd) { - var table = getTableItemsByRange(this).table; - if (!table) return -1; - var interlaced = table.getAttribute("interlaced"); - if (cmd == "interlacetable") { - //TODO 待定 - //是否需要待定,如果设置,则命令只能单次执行成功,但反射具备toggle效果;否则可以覆盖前次命令,但反射将不存在toggle效果 - return interlaced === "enabled" ? -1 : 0; - } else { - return !interlaced || interlaced === "disabled" ? -1 : 0; - } - }, - execCommand: function(cmd, classList) { - var table = getTableItemsByRange(this).table; - if (cmd == "interlacetable") { - table.setAttribute("interlaced", "enabled"); - this.fireEvent("interlacetable", table, classList); - } else { - table.setAttribute("interlaced", "disabled"); - this.fireEvent("uninterlacetable", table); - } - } - }; - UE.commands["setbordervisible"] = { - queryCommandState: function(cmd) { - var table = getTableItemsByRange(this).table; - if (!table) return -1; - return 0; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - utils.each(domUtils.getElementsByTagName(table, "td"), function(td) { - td.style.borderWidth = "1px"; - td.style.borderStyle = "solid"; - }); - } - }; - function resetTdWidth(table, editor) { - var tds = domUtils.getElementsByTagName(table, "td th"); - utils.each(tds, function(td) { - td.removeAttribute("width"); - }); - table.setAttribute( - "width", - getTableWidth(editor, true, getDefaultValue(editor, table)) - ); - var tdsWidths = []; - setTimeout(function() { - utils.each(tds, function(td) { - td.colSpan == 1 && tdsWidths.push(td.offsetWidth); - }); - utils.each(tds, function(td, i) { - td.colSpan == 1 && td.setAttribute("width", tdsWidths[i] + ""); - }); - }, 0); - } - - function getTableWidth(editor, needIEHack, defaultValue) { - var body = editor.body; - return ( - body.offsetWidth - - (needIEHack - ? parseInt(domUtils.getComputedStyle(body, "margin-left"), 10) * 2 - : 0) - - defaultValue.tableBorder * 2 - - (editor.options.offsetWidth || 0) - ); - } - - function getSelectedArr(editor) { - var cell = getTableItemsByRange(editor).cell; - if (cell) { - var ut = getUETable(cell); - return ut.selectedTds.length ? ut.selectedTds : [cell]; - } else { - return []; - } - } -})(); - - -// plugins/table.action.js -/** - * Created with JetBrains PhpStorm. - * User: taoqili - * Date: 12-10-12 - * Time: 上午10:05 - * To change this template use File | Settings | File Templates. - */ -UE.plugins["table"] = function() { - var me = this, - tabTimer = null, - //拖动计时器 - tableDragTimer = null, - //双击计时器 - tableResizeTimer = null, - //单元格最小宽度 - cellMinWidth = 5, - isInResizeBuffer = false, - //单元格边框大小 - cellBorderWidth = 5, - //鼠标偏移距离 - offsetOfTableCell = 10, - //记录在有限时间内的点击状态, 共有3个取值, 0, 1, 2。 0代表未初始化, 1代表单击了1次,2代表2次 - singleClickState = 0, - userActionStatus = null, - //双击允许的时间范围 - dblclickTime = 360, - UT = UE.UETable, - getUETable = function(tdOrTable) { - return UT.getUETable(tdOrTable); - }, - getUETableBySelected = function(editor) { - return UT.getUETableBySelected(editor); - }, - getDefaultValue = function(editor, table) { - return UT.getDefaultValue(editor, table); - }, - removeSelectedClass = function(cells) { - return UT.removeSelectedClass(cells); - }; - - function showError(e) { - // throw e; - } - me.ready(function() { - var me = this; - var orgGetText = me.selection.getText; - me.selection.getText = function() { - var table = getUETableBySelected(me); - if (table) { - var str = ""; - utils.each(table.selectedTds, function(td) { - str += td[browser.ie ? "innerText" : "textContent"]; - }); - return str; - } else { - return orgGetText.call(me.selection); - } - }; - }); - - //处理拖动及框选相关方法 - var startTd = null, //鼠标按下时的锚点td - currentTd = null, //当前鼠标经过时的td - onDrag = "", //指示当前拖动状态,其值可为"","h","v" ,分别表示未拖动状态,横向拖动状态,纵向拖动状态,用于鼠标移动过程中的判断 - onBorder = false, //检测鼠标按下时是否处在单元格边缘位置 - dragButton = null, - dragOver = false, - dragLine = null, //模拟的拖动线 - dragTd = null; //发生拖动的目标td - - var mousedown = false, - //todo 判断混乱模式 - needIEHack = true; - - me.setOpt({ - maxColNum: 20, - maxRowNum: 100, - defaultCols: 5, - defaultRows: 5, - tdvalign: "top", - cursorpath: me.options.UEDITOR_HOME_URL + "themes/" + me.options.theme + "/images/cursor_", - tableDragable: false, - classList: [ - "ue-table-interlace-color-single", - "ue-table-interlace-color-double" - ] - }); - me.getUETable = getUETable; - var commands = { - deletetable: 1, - inserttable: 1, - cellvalign: 1, - insertcaption: 1, - deletecaption: 1, - inserttitle: 1, - deletetitle: 1, - mergeright: 1, - mergedown: 1, - mergecells: 1, - insertrow: 1, - insertrownext: 1, - deleterow: 1, - insertcol: 1, - insertcolnext: 1, - deletecol: 1, - splittocells: 1, - splittorows: 1, - splittocols: 1, - adaptbytext: 1, - adaptbywindow: 1, - adaptbycustomer: 1, - insertparagraph: 1, - insertparagraphbeforetable: 1, - averagedistributecol: 1, - averagedistributerow: 1 - }; - me.ready(function() { - utils.cssRule( - "table", - //选中的td上的样式 - ".selectTdClass{background-color:#edf5fa !important}" + - "table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}" + - //插入的表格的默认样式 - "table{margin-bottom:10px;border-collapse:collapse;display:table;}" + - "td,th{padding: 5px 10px;border: 1px solid #DDD;}" + - "caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}" + - "th{border-top:1px solid #BBB;background-color:#F7F7F7;}" + - "table tr.firstRow th{border-top-width:2px;}" + - ".ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }" + - "td p{margin:0;padding:0;}", - me.document - ); - - var tableCopyList, isFullCol, isFullRow; - //注册del/backspace事件 - me.addListener("keydown", function(cmd, evt) { - var me = this; - var keyCode = evt.keyCode || evt.which; - - if (keyCode == 8) { - var ut = getUETableBySelected(me); - if (ut && ut.selectedTds.length) { - if (ut.isFullCol()) { - me.execCommand("deletecol"); - } else if (ut.isFullRow()) { - me.execCommand("deleterow"); - } else { - me.fireEvent("delcells"); - } - domUtils.preventDefault(evt); - } - - var caption = domUtils.findParentByTagName( - me.selection.getStart(), - "caption", - true - ), - range = me.selection.getRange(); - if (range.collapsed && caption && isEmptyBlock(caption)) { - me.fireEvent("saveScene"); - var table = caption.parentNode; - domUtils.remove(caption); - if (table) { - range.setStart(table.rows[0].cells[0], 0).setCursor(false, true); - } - me.fireEvent("saveScene"); - } - } - - if (keyCode == 46) { - ut = getUETableBySelected(me); - if (ut) { - me.fireEvent("saveScene"); - for (var i = 0, ci; (ci = ut.selectedTds[i++]); ) { - domUtils.fillNode(me.document, ci); - } - me.fireEvent("saveScene"); - domUtils.preventDefault(evt); - } - } - if (keyCode == 13) { - var rng = me.selection.getRange(), - caption = domUtils.findParentByTagName( - rng.startContainer, - "caption", - true - ); - if (caption) { - var table = domUtils.findParentByTagName(caption, "table"); - if (!rng.collapsed) { - rng.deleteContents(); - me.fireEvent("saveScene"); - } else { - if (caption) { - rng.setStart(table.rows[0].cells[0], 0).setCursor(false, true); - } - } - domUtils.preventDefault(evt); - return; - } - if (rng.collapsed) { - var table = domUtils.findParentByTagName(rng.startContainer, "table"); - if (table) { - var cell = table.rows[0].cells[0], - start = domUtils.findParentByTagName( - me.selection.getStart(), - ["td", "th"], - true - ), - preNode = table.previousSibling; - if ( - cell === start && - (!preNode || - (preNode.nodeType == 1 && preNode.tagName == "TABLE")) && - domUtils.isStartInblock(rng) - ) { - var first = domUtils.findParent( - me.selection.getStart(), - function(n) { - return domUtils.isBlockElm(n); - }, - true - ); - if ( - first && - (/t(h|d)/i.test(first.tagName) || first === start.firstChild) - ) { - me.execCommand("insertparagraphbeforetable"); - domUtils.preventDefault(evt); - } - } - } - } - } - - if ((evt.ctrlKey || evt.metaKey) && evt.keyCode == "67") { - tableCopyList = null; - var ut = getUETableBySelected(me); - if (ut) { - var tds = ut.selectedTds; - isFullCol = ut.isFullCol(); - isFullRow = ut.isFullRow(); - tableCopyList = [[ut.cloneCell(tds[0], null, true)]]; - for (var i = 1, ci; (ci = tds[i]); i++) { - if (ci.parentNode !== tds[i - 1].parentNode) { - tableCopyList.push([ut.cloneCell(ci, null, true)]); - } else { - tableCopyList[tableCopyList.length - 1].push( - ut.cloneCell(ci, null, true) - ); - } - } - } - } - }); - me.addListener("tablehasdeleted", function() { - toggleDraggableState(this, false, "", null); - if (dragButton) domUtils.remove(dragButton); - }); - - me.addListener("beforepaste", function(cmd, html) { - var me = this; - var rng = me.selection.getRange(); - if (domUtils.findParentByTagName(rng.startContainer, "caption", true)) { - var div = me.document.createElement("div"); - div.innerHTML = html.html; - //trace:3729 - html.html = div[browser.ie9below ? "innerText" : "textContent"]; - return; - } - var table = getUETableBySelected(me); - if (tableCopyList) { - me.fireEvent("saveScene"); - var rng = me.selection.getRange(); - var td = domUtils.findParentByTagName( - rng.startContainer, - ["td", "th"], - true - ), - tmpNode, - preNode; - if (td) { - var ut = getUETable(td); - if (isFullRow) { - var rowIndex = ut.getCellInfo(td).rowIndex; - if (td.tagName == "TH") { - rowIndex++; - } - for (var i = 0, ci; (ci = tableCopyList[i++]); ) { - var tr = ut.insertRow(rowIndex++, "td"); - for (var j = 0, cj; (cj = ci[j]); j++) { - var cell = tr.cells[j]; - if (!cell) { - cell = tr.insertCell(j); - } - cell.innerHTML = cj.innerHTML; - cj.getAttribute("width") && - cell.setAttribute("width", cj.getAttribute("width")); - cj.getAttribute("vAlign") && - cell.setAttribute("vAlign", cj.getAttribute("vAlign")); - cj.getAttribute("align") && - cell.setAttribute("align", cj.getAttribute("align")); - cj.style.cssText && (cell.style.cssText = cj.style.cssText); - } - for (var j = 0, cj; (cj = tr.cells[j]); j++) { - if (!ci[j]) break; - cj.innerHTML = ci[j].innerHTML; - ci[j].getAttribute("width") && - cj.setAttribute("width", ci[j].getAttribute("width")); - ci[j].getAttribute("vAlign") && - cj.setAttribute("vAlign", ci[j].getAttribute("vAlign")); - ci[j].getAttribute("align") && - cj.setAttribute("align", ci[j].getAttribute("align")); - ci[j].style.cssText && (cj.style.cssText = ci[j].style.cssText); - } - } - } else { - if (isFullCol) { - cellInfo = ut.getCellInfo(td); - var maxColNum = 0; - for (var j = 0, ci = tableCopyList[0], cj; (cj = ci[j++]); ) { - maxColNum += cj.colSpan || 1; - } - me.__hasEnterExecCommand = true; - for (i = 0; i < maxColNum; i++) { - me.execCommand("insertcol"); - } - me.__hasEnterExecCommand = false; - td = ut.table.rows[0].cells[cellInfo.cellIndex]; - if (td.tagName == "TH") { - td = ut.table.rows[1].cells[cellInfo.cellIndex]; - } - } - for (var i = 0, ci; (ci = tableCopyList[i++]); ) { - tmpNode = td; - for (var j = 0, cj; (cj = ci[j++]); ) { - if (td) { - td.innerHTML = cj.innerHTML; - //todo 定制处理 - cj.getAttribute("width") && - td.setAttribute("width", cj.getAttribute("width")); - cj.getAttribute("vAlign") && - td.setAttribute("vAlign", cj.getAttribute("vAlign")); - cj.getAttribute("align") && - td.setAttribute("align", cj.getAttribute("align")); - cj.style.cssText && (td.style.cssText = cj.style.cssText); - preNode = td; - td = td.nextSibling; - } else { - var cloneTd = cj.cloneNode(true); - domUtils.removeAttributes(cloneTd, [ - "class", - "rowSpan", - "colSpan" - ]); - - preNode.parentNode.appendChild(cloneTd); - } - } - td = ut.getNextCell(tmpNode, true, true); - if (!tableCopyList[i]) break; - if (!td) { - var cellInfo = ut.getCellInfo(tmpNode); - ut.table.insertRow(ut.table.rows.length); - ut.update(); - td = ut.getVSideCell(tmpNode, true); - } - } - } - ut.update(); - } else { - table = me.document.createElement("table"); - for (var i = 0, ci; (ci = tableCopyList[i++]); ) { - var tr = table.insertRow(table.rows.length); - for (var j = 0, cj; (cj = ci[j++]); ) { - cloneTd = UT.cloneCell(cj, null, true); - domUtils.removeAttributes(cloneTd, ["class"]); - tr.appendChild(cloneTd); - } - if (j == 2 && cloneTd.rowSpan > 1) { - cloneTd.rowSpan = 1; - } - } - - var defaultValue = getDefaultValue(me), - width = - me.body.offsetWidth - - (needIEHack - ? parseInt( - domUtils.getComputedStyle(me.body, "margin-left"), - 10 - ) * 2 - : 0) - - defaultValue.tableBorder * 2 - - (me.options.offsetWidth || 0); - me.execCommand( - "insertHTML", - "" + - table.innerHTML - .replace(/>\s*<") - .replace(/\bth\b/gi, "td") + - "
                      " - ); - } - me.fireEvent("contentchange"); - me.fireEvent("saveScene"); - html.html = ""; - return true; - } else { - var div = me.document.createElement("div"), - tables; - div.innerHTML = html.html; - tables = div.getElementsByTagName("table"); - if (domUtils.findParentByTagName(me.selection.getStart(), "table")) { - utils.each(tables, function(t) { - domUtils.remove(t); - }); - if ( - domUtils.findParentByTagName( - me.selection.getStart(), - "caption", - true - ) - ) { - div.innerHTML = div[browser.ie ? "innerText" : "textContent"]; - } - } else { - utils.each(tables, function(table) { - removeStyleSize(table, true); - domUtils.removeAttributes(table, ["style", "border"]); - utils.each(domUtils.getElementsByTagName(table, "td"), function( - td - ) { - if (isEmptyBlock(td)) { - domUtils.fillNode(me.document, td); - } - removeStyleSize(td, true); - // domUtils.removeAttributes(td, ['style']) - }); - }); - } - html.html = div.innerHTML; - } - }); - - me.addListener("afterpaste", function() { - utils.each(domUtils.getElementsByTagName(me.body, "table"), function( - table - ) { - if (table.offsetWidth > me.body.offsetWidth) { - var defaultValue = getDefaultValue(me, table); - table.style.width = - me.body.offsetWidth - - (needIEHack - ? parseInt( - domUtils.getComputedStyle(me.body, "margin-left"), - 10 - ) * 2 - : 0) - - defaultValue.tableBorder * 2 - - (me.options.offsetWidth || 0) + - "px"; - } - }); - }); - me.addListener("blur", function() { - tableCopyList = null; - }); - var timer; - me.addListener("keydown", function() { - clearTimeout(timer); - timer = setTimeout(function() { - var rng = me.selection.getRange(), - cell = domUtils.findParentByTagName( - rng.startContainer, - ["th", "td"], - true - ); - if (cell) { - var table = cell.parentNode.parentNode.parentNode; - if (table.offsetWidth > table.getAttribute("width")) { - cell.style.wordBreak = "break-all"; - } - } - }, 100); - }); - me.addListener("selectionchange", function() { - toggleDraggableState(me, false, "", null); - }); - - //内容变化时触发索引更新 - //todo 可否考虑标记检测,如果不涉及表格的变化就不进行索引重建和更新 - me.addListener("contentchange", function() { - var me = this; - //尽可能排除一些不需要更新的状况 - hideDragLine(me); - if (getUETableBySelected(me)) return; - var rng = me.selection.getRange(); - var start = rng.startContainer; - start = domUtils.findParentByTagName(start, ["td", "th"], true); - utils.each(domUtils.getElementsByTagName(me.document, "table"), function( - table - ) { - if (me.fireEvent("excludetable", table) === true) return; - table.ueTable = new UT(table); - //trace:3742 - // utils.each(domUtils.getElementsByTagName(me.document, 'td'), function (td) { - // - // if (domUtils.isEmptyBlock(td) && td !== start) { - // domUtils.fillNode(me.document, td); - // if (browser.ie && browser.version == 6) { - // td.innerHTML = ' ' - // } - // } - // }); - // utils.each(domUtils.getElementsByTagName(me.document, 'th'), function (th) { - // if (domUtils.isEmptyBlock(th) && th !== start) { - // domUtils.fillNode(me.document, th); - // if (browser.ie && browser.version == 6) { - // th.innerHTML = ' ' - // } - // } - // }); - table.onmouseover = function() { - me.fireEvent("tablemouseover", table); - }; - table.onmousemove = function() { - me.fireEvent("tablemousemove", table); - me.options.tableDragable && toggleDragButton(true, this, me); - utils.defer(function() { - me.fireEvent("contentchange", 50); - }, true); - }; - table.onmouseout = function() { - me.fireEvent("tablemouseout", table); - toggleDraggableState(me, false, "", null); - hideDragLine(me); - }; - table.onclick = function(evt) { - evt = me.window.event || evt; - var target = getParentTdOrTh(evt.target || evt.srcElement); - if (!target) return; - var ut = getUETable(target), - table = ut.table, - cellInfo = ut.getCellInfo(target), - cellsRange, - rng = me.selection.getRange(); - // if ("topLeft" == inPosition(table, mouseCoords(evt))) { - // cellsRange = ut.getCellsRange(ut.table.rows[0].cells[0], ut.getLastCell()); - // ut.setSelected(cellsRange); - // return; - // } - // if ("bottomRight" == inPosition(table, mouseCoords(evt))) { - // - // return; - // } - if (inTableSide(table, target, evt, true)) { - var endTdCol = ut.getCell( - ut.indexTable[ut.rowsNum - 1][cellInfo.colIndex].rowIndex, - ut.indexTable[ut.rowsNum - 1][cellInfo.colIndex].cellIndex - ); - if (evt.shiftKey && ut.selectedTds.length) { - if (ut.selectedTds[0] !== endTdCol) { - cellsRange = ut.getCellsRange(ut.selectedTds[0], endTdCol); - ut.setSelected(cellsRange); - } else { - rng && rng.selectNodeContents(endTdCol).select(); - } - } else { - if (target !== endTdCol) { - cellsRange = ut.getCellsRange(target, endTdCol); - ut.setSelected(cellsRange); - } else { - rng && rng.selectNodeContents(endTdCol).select(); - } - } - return; - } - if (inTableSide(table, target, evt)) { - var endTdRow = ut.getCell( - ut.indexTable[cellInfo.rowIndex][ut.colsNum - 1].rowIndex, - ut.indexTable[cellInfo.rowIndex][ut.colsNum - 1].cellIndex - ); - if (evt.shiftKey && ut.selectedTds.length) { - if (ut.selectedTds[0] !== endTdRow) { - cellsRange = ut.getCellsRange(ut.selectedTds[0], endTdRow); - ut.setSelected(cellsRange); - } else { - rng && rng.selectNodeContents(endTdRow).select(); - } - } else { - if (target !== endTdRow) { - cellsRange = ut.getCellsRange(target, endTdRow); - ut.setSelected(cellsRange); - } else { - rng && rng.selectNodeContents(endTdRow).select(); - } - } - } - }; - }); - - switchBorderColor(me, true); - }); - - domUtils.on(me.document, "mousemove", mouseMoveEvent); - - domUtils.on(me.document, "mouseout", function(evt) { - var target = evt.target || evt.srcElement; - if (target.tagName == "TABLE") { - toggleDraggableState(me, false, "", null); - } - }); - /** - * 表格隔行变色 - */ - me.addListener("interlacetable", function(type, table, classList) { - if (!table) return; - var me = this, - rows = table.rows, - len = rows.length, - getClass = function(list, index, repeat) { - return list[index] - ? list[index] - : repeat ? list[index % list.length] : ""; - }; - for (var i = 0; i < len; i++) { - rows[i].className = getClass( - classList || me.options.classList, - i, - true - ); - } - }); - me.addListener("uninterlacetable", function(type, table) { - if (!table) return; - var me = this, - rows = table.rows, - classList = me.options.classList, - len = rows.length; - for (var i = 0; i < len; i++) { - domUtils.removeClasses(rows[i], classList); - } - }); - - me.addListener("mousedown", mouseDownEvent); - me.addListener("mouseup", mouseUpEvent); - //拖动的时候触发mouseup - domUtils.on(me.body, "dragstart", function(evt) { - mouseUpEvent.call(me, "dragstart", evt); - }); - me.addOutputRule(function(root) { - utils.each(root.getNodesByTagName("div"), function(n) { - if (n.getAttr("id") == "ue_tableDragLine") { - n.parentNode.removeChild(n); - } - }); - }); - - var currentRowIndex = 0; - me.addListener("mousedown", function() { - currentRowIndex = 0; - }); - me.addListener("tabkeydown", function() { - var range = this.selection.getRange(), - common = range.getCommonAncestor(true, true), - table = domUtils.findParentByTagName(common, "table"); - if (table) { - if (domUtils.findParentByTagName(common, "caption", true)) { - var cell = domUtils.getElementsByTagName(table, "th td"); - if (cell && cell.length) { - range.setStart(cell[0], 0).setCursor(false, true); - } - } else { - var cell = domUtils.findParentByTagName(common, ["td", "th"], true), - ua = getUETable(cell); - currentRowIndex = cell.rowSpan > 1 - ? currentRowIndex - : ua.getCellInfo(cell).rowIndex; - var nextCell = ua.getTabNextCell(cell, currentRowIndex); - if (nextCell) { - if (isEmptyBlock(nextCell)) { - range.setStart(nextCell, 0).setCursor(false, true); - } else { - range.selectNodeContents(nextCell).select(); - } - } else { - me.fireEvent("saveScene"); - me.__hasEnterExecCommand = true; - this.execCommand("insertrownext"); - me.__hasEnterExecCommand = false; - range = this.selection.getRange(); - range - .setStart(table.rows[table.rows.length - 1].cells[0], 0) - .setCursor(); - me.fireEvent("saveScene"); - } - } - return true; - } - }); - browser.ie && - me.addListener("selectionchange", function() { - toggleDraggableState(this, false, "", null); - }); - me.addListener("keydown", function(type, evt) { - var me = this; - //处理在表格的最后一个输入tab产生新的表格 - var keyCode = evt.keyCode || evt.which; - if (keyCode == 8 || keyCode == 46) { - return; - } - var notCtrlKey = - !evt.ctrlKey && !evt.metaKey && !evt.shiftKey && !evt.altKey; - notCtrlKey && - removeSelectedClass(domUtils.getElementsByTagName(me.body, "td")); - var ut = getUETableBySelected(me); - if (!ut) return; - notCtrlKey && ut.clearSelected(); - }); - - me.addListener("beforegetcontent", function() { - switchBorderColor(this, false); - browser.ie && - utils.each(this.document.getElementsByTagName("caption"), function(ci) { - if (domUtils.isEmptyNode(ci)) { - ci.innerHTML = " "; - } - }); - }); - me.addListener("aftergetcontent", function() { - switchBorderColor(this, true); - }); - me.addListener("getAllHtml", function() { - removeSelectedClass(me.document.getElementsByTagName("td")); - }); - //修正全屏状态下插入的表格宽度在非全屏状态下撑开编辑器的情况 - me.addListener("fullscreenchanged", function(type, fullscreen) { - if (!fullscreen) { - var ratio = this.body.offsetWidth / document.body.offsetWidth, - tables = domUtils.getElementsByTagName(this.body, "table"); - utils.each(tables, function(table) { - if (table.offsetWidth < me.body.offsetWidth) return false; - var tds = domUtils.getElementsByTagName(table, "td"), - backWidths = []; - utils.each(tds, function(td) { - backWidths.push(td.offsetWidth); - }); - for (var i = 0, td; (td = tds[i]); i++) { - td.setAttribute("width", Math.floor(backWidths[i] * ratio)); - } - table.setAttribute( - "width", - Math.floor(getTableWidth(me, needIEHack, getDefaultValue(me))) - ); - }); - } - }); - - //重写execCommand命令,用于处理框选时的处理 - var oldExecCommand = me.execCommand; - me.execCommand = function(cmd, datatat) { - var me = this, - args = arguments; - - cmd = cmd.toLowerCase(); - var ut = getUETableBySelected(me), - tds, - range = new dom.Range(me.document), - cmdFun = me.commands[cmd] || UE.commands[cmd], - result; - if (!cmdFun) return; - if ( - ut && - !commands[cmd] && - !cmdFun.notNeedUndo && - !me.__hasEnterExecCommand - ) { - me.__hasEnterExecCommand = true; - me.fireEvent("beforeexeccommand", cmd); - tds = ut.selectedTds; - var lastState = -2, - lastValue = -2, - value, - state; - for (var i = 0, td; (td = tds[i]); i++) { - if (isEmptyBlock(td)) { - range.setStart(td, 0).setCursor(false, true); - } else { - range.selectNode(td).select(true); - } - state = me.queryCommandState(cmd); - value = me.queryCommandValue(cmd); - if (state != -1) { - if (lastState !== state || lastValue !== value) { - me._ignoreContentChange = true; - result = oldExecCommand.apply(me, arguments); - me._ignoreContentChange = false; - } - lastState = me.queryCommandState(cmd); - lastValue = me.queryCommandValue(cmd); - if (domUtils.isEmptyBlock(td)) { - domUtils.fillNode(me.document, td); - } - } - } - range.setStart(tds[0], 0).shrinkBoundary(true).setCursor(false, true); - me.fireEvent("contentchange"); - me.fireEvent("afterexeccommand", cmd); - me.__hasEnterExecCommand = false; - me._selectionChange(); - } else { - result = oldExecCommand.apply(me, arguments); - } - return result; - }; - }); - /** - * 删除obj的宽高style,改成属性宽高 - * @param obj - * @param replaceToProperty - */ - function removeStyleSize(obj, replaceToProperty) { - removeStyle(obj, "width", true); - removeStyle(obj, "height", true); - } - - function removeStyle(obj, styleName, replaceToProperty) { - if (obj.style[styleName]) { - replaceToProperty && - obj.setAttribute(styleName, parseInt(obj.style[styleName], 10)); - obj.style[styleName] = ""; - } - } - - function getParentTdOrTh(ele) { - if (ele.tagName == "TD" || ele.tagName == "TH") return ele; - var td; - if ( - (td = - domUtils.findParentByTagName(ele, "td", true) || - domUtils.findParentByTagName(ele, "th", true)) - ) - return td; - return null; - } - - function isEmptyBlock(node) { - var reg = new RegExp(domUtils.fillChar, "g"); - if ( - node[browser.ie ? "innerText" : "textContent"] - .replace(/^\s*$/, "") - .replace(reg, "").length > 0 - ) { - return 0; - } - for (var n in dtd.$isNotEmpty) { - if (node.getElementsByTagName(n).length) { - return 0; - } - } - return 1; - } - - function mouseCoords(evt) { - if (evt.pageX || evt.pageY) { - return { x: evt.pageX, y: evt.pageY }; - } - return { - x: - evt.clientX + me.document.body.scrollLeft - me.document.body.clientLeft, - y: evt.clientY + me.document.body.scrollTop - me.document.body.clientTop - }; - } - - function mouseMoveEvent(evt) { - if (isEditorDisabled()) { - return; - } - - try { - //普通状态下鼠标移动 - var target = getParentTdOrTh(evt.target || evt.srcElement), - pos; - - //区分用户的行为是拖动还是双击 - if (isInResizeBuffer) { - me.body.style.webkitUserSelect = "none"; - - if ( - Math.abs(userActionStatus.x - evt.clientX) > offsetOfTableCell || - Math.abs(userActionStatus.y - evt.clientY) > offsetOfTableCell - ) { - clearTableDragTimer(); - isInResizeBuffer = false; - singleClickState = 0; - //drag action - tableBorderDrag(evt); - } - } - - //修改单元格大小时的鼠标移动 - if (onDrag && dragTd) { - singleClickState = 0; - me.body.style.webkitUserSelect = "none"; - me.selection.getNative()[ - browser.ie9below ? "empty" : "removeAllRanges" - ](); - pos = mouseCoords(evt); - toggleDraggableState(me, true, onDrag, pos, target); - if (onDrag == "h") { - dragLine.style.left = getPermissionX(dragTd, evt) + "px"; - } else if (onDrag == "v") { - dragLine.style.top = getPermissionY(dragTd, evt) + "px"; - } - return; - } - //当鼠标处于table上时,修改移动过程中的光标状态 - if (target) { - //针对使用table作为容器的组件不触发拖拽效果 - if (me.fireEvent("excludetable", target) === true) return; - pos = mouseCoords(evt); - var state = getRelation(target, pos), - table = domUtils.findParentByTagName(target, "table", true); - - if (inTableSide(table, target, evt, true)) { - if (me.fireEvent("excludetable", table) === true) return; - me.body.style.cursor = - "url(" + me.options.cursorpath + "h.png),pointer"; - } else if (inTableSide(table, target, evt)) { - if (me.fireEvent("excludetable", table) === true) return; - me.body.style.cursor = - "url(" + me.options.cursorpath + "v.png),pointer"; - } else { - me.body.style.cursor = "text"; - var curCell = target; - if (/\d/.test(state)) { - state = state.replace(/\d/, ""); - target = getUETable(target).getPreviewCell(target, state == "v"); - } - //位于第一行的顶部或者第一列的左边时不可拖动 - toggleDraggableState( - me, - target ? !!state : false, - target ? state : "", - pos, - target - ); - } - } else { - toggleDragButton(false, table, me); - } - } catch (e) { - showError(e); - } - } - - var dragButtonTimer; - - function toggleDragButton(show, table, editor) { - if (!show) { - if (dragOver) return; - dragButtonTimer = setTimeout(function() { - !dragOver && - dragButton && - dragButton.parentNode && - dragButton.parentNode.removeChild(dragButton); - }, 2000); - } else { - createDragButton(table, editor); - } - } - - function createDragButton(table, editor) { - var pos = domUtils.getXY(table), - doc = table.ownerDocument; - if (dragButton && dragButton.parentNode) return dragButton; - dragButton = doc.createElement("div"); - dragButton.contentEditable = false; - dragButton.innerHTML = ""; - dragButton.style.cssText = - "width:15px;height:15px;background-image:url(" + - editor.options.UEDITOR_HOME_URL + - "dialogs/table/dragicon.png);position: absolute;cursor:move;top:" + - (pos.y - 15) + - "px;left:" + - pos.x + - "px;"; - domUtils.unSelectable(dragButton); - dragButton.onmouseover = function(evt) { - dragOver = true; - }; - dragButton.onmouseout = function(evt) { - dragOver = false; - }; - domUtils.on(dragButton, "click", function(type, evt) { - doClick(evt, this); - }); - domUtils.on(dragButton, "dblclick", function(type, evt) { - doDblClick(evt); - }); - domUtils.on(dragButton, "dragstart", function(type, evt) { - domUtils.preventDefault(evt); - }); - var timer; - - function doClick(evt, button) { - // 部分浏览器下需要清理 - clearTimeout(timer); - timer = setTimeout(function() { - editor.fireEvent("tableClicked", table, button); - }, 300); - } - - function doDblClick(evt) { - clearTimeout(timer); - var ut = getUETable(table), - start = table.rows[0].cells[0], - end = ut.getLastCell(), - range = ut.getCellsRange(start, end); - editor.selection.getRange().setStart(start, 0).setCursor(false, true); - ut.setSelected(range); - } - - doc.body.appendChild(dragButton); - } - - // function inPosition(table, pos) { - // var tablePos = domUtils.getXY(table), - // width = table.offsetWidth, - // height = table.offsetHeight; - // if (pos.x - tablePos.x < 5 && pos.y - tablePos.y < 5) { - // return "topLeft"; - // } else if (tablePos.x + width - pos.x < 5 && tablePos.y + height - pos.y < 5) { - // return "bottomRight"; - // } - // } - - function inTableSide(table, cell, evt, top) { - var pos = mouseCoords(evt), - state = getRelation(cell, pos); - - if (top) { - var caption = table.getElementsByTagName("caption")[0], - capHeight = caption ? caption.offsetHeight : 0; - return state == "v1" && pos.y - domUtils.getXY(table).y - capHeight < 8; - } else { - return state == "h1" && pos.x - domUtils.getXY(table).x < 8; - } - } - - /** - * 获取拖动时允许的X轴坐标 - * @param dragTd - * @param evt - */ - function getPermissionX(dragTd, evt) { - var ut = getUETable(dragTd); - if (ut) { - var preTd = ut.getSameEndPosCells(dragTd, "x")[0], - nextTd = ut.getSameStartPosXCells(dragTd)[0], - mouseX = mouseCoords(evt).x, - left = - (preTd ? domUtils.getXY(preTd).x : domUtils.getXY(ut.table).x) + 20, - right = nextTd - ? domUtils.getXY(nextTd).x + nextTd.offsetWidth - 20 - : me.body.offsetWidth + 5 || - parseInt(domUtils.getComputedStyle(me.body, "width"), 10); - - left += cellMinWidth; - right -= cellMinWidth; - - return mouseX < left ? left : mouseX > right ? right : mouseX; - } - } - - /** - * 获取拖动时允许的Y轴坐标 - */ - function getPermissionY(dragTd, evt) { - try { - var top = domUtils.getXY(dragTd).y, - mousePosY = mouseCoords(evt).y; - return mousePosY < top ? top : mousePosY; - } catch (e) { - showError(e); - } - } - - /** - * 移动状态切换 - */ - function toggleDraggableState(editor, draggable, dir, mousePos, cell) { - try { - editor.body.style.cursor = dir == "h" - ? "col-resize" - : dir == "v" ? "row-resize" : "text"; - if (browser.ie) { - if (dir && !mousedown && !getUETableBySelected(editor)) { - getDragLine(editor, editor.document); - showDragLineAt(dir, cell); - } else { - hideDragLine(editor); - } - } - onBorder = draggable; - } catch (e) { - showError(e); - } - } - - /** - * 获取与UETable相关的resize line - * @param uetable UETable对象 - */ - function getResizeLineByUETable() { - var lineId = "_UETableResizeLine", - line = this.document.getElementById(lineId); - - if (!line) { - line = this.document.createElement("div"); - line.id = lineId; - line.contnetEditable = false; - line.setAttribute("unselectable", "on"); - - var styles = { - width: 2 * cellBorderWidth + 1 + "px", - position: "absolute", - "z-index": 100000, - cursor: "col-resize", - background: "red", - display: "none" - }; - - //切换状态 - line.onmouseout = function() { - this.style.display = "none"; - }; - - utils.extend(line.style, styles); - - this.document.body.appendChild(line); - } - - return line; - } - - /** - * 更新resize-line - */ - function updateResizeLine(cell, uetable) { - var line = getResizeLineByUETable.call(this), - table = uetable.table, - styles = { - top: domUtils.getXY(table).y + "px", - left: - domUtils.getXY(cell).x + cell.offsetWidth - cellBorderWidth + "px", - display: "block", - height: table.offsetHeight + "px" - }; - - utils.extend(line.style, styles); - } - - /** - * 显示resize-line - */ - function showResizeLine(cell) { - var uetable = getUETable(cell); - - updateResizeLine.call(this, cell, uetable); - } - - /** - * 获取鼠标与当前单元格的相对位置 - * @param ele - * @param mousePos - */ - function getRelation(ele, mousePos) { - var elePos = domUtils.getXY(ele); - - if (!elePos) { - return ""; - } - - if (elePos.x + ele.offsetWidth - mousePos.x < cellBorderWidth) { - return "h"; - } - if (mousePos.x - elePos.x < cellBorderWidth) { - return "h1"; - } - if (elePos.y + ele.offsetHeight - mousePos.y < cellBorderWidth) { - return "v"; - } - if (mousePos.y - elePos.y < cellBorderWidth) { - return "v1"; - } - return ""; - } - - function mouseDownEvent(type, evt) { - if (isEditorDisabled()) { - return; - } - - userActionStatus = { - x: evt.clientX, - y: evt.clientY - }; - - //右键菜单单独处理 - if (evt.button == 2) { - var ut = getUETableBySelected(me), - flag = false; - - if (ut) { - var td = getTargetTd(me, evt); - utils.each(ut.selectedTds, function(ti) { - if (ti === td) { - flag = true; - } - }); - if (!flag) { - removeSelectedClass(domUtils.getElementsByTagName(me.body, "th td")); - ut.clearSelected(); - } else { - td = ut.selectedTds[0]; - setTimeout(function() { - me.selection.getRange().setStart(td, 0).setCursor(false, true); - }, 0); - } - } - } else { - tableClickHander(evt); - } - } - - //清除表格的计时器 - function clearTableTimer() { - tabTimer && clearTimeout(tabTimer); - tabTimer = null; - } - - //双击收缩 - function tableDbclickHandler(evt) { - singleClickState = 0; - evt = evt || me.window.event; - var target = getParentTdOrTh(evt.target || evt.srcElement); - if (target) { - var h; - if ((h = getRelation(target, mouseCoords(evt)))) { - hideDragLine(me); - - if (h == "h1") { - h = "h"; - if ( - inTableSide( - domUtils.findParentByTagName(target, "table"), - target, - evt - ) - ) { - me.execCommand("adaptbywindow"); - } else { - target = getUETable(target).getPreviewCell(target); - if (target) { - var rng = me.selection.getRange(); - rng.selectNodeContents(target).setCursor(true, true); - } - } - } - if (h == "h") { - var ut = getUETable(target), - table = ut.table, - cells = getCellsByMoveBorder(target, table, true); - - cells = extractArray(cells, "left"); - - ut.width = ut.offsetWidth; - - var oldWidth = [], - newWidth = []; - - utils.each(cells, function(cell) { - oldWidth.push(cell.offsetWidth); - }); - - utils.each(cells, function(cell) { - cell.removeAttribute("width"); - }); - - window.setTimeout(function() { - //是否允许改变 - var changeable = true; - - utils.each(cells, function(cell, index) { - var width = cell.offsetWidth; - - if (width > oldWidth[index]) { - changeable = false; - return false; - } - - newWidth.push(width); - }); - - var change = changeable ? newWidth : oldWidth; - - utils.each(cells, function(cell, index) { - cell.width = change[index] - getTabcellSpace(); - }); - }, 0); - - // minWidth -= cellMinWidth; - // - // table.removeAttribute("width"); - // utils.each(cells, function (cell) { - // cell.style.width = ""; - // cell.width -= minWidth; - // }); - } - } - } - } - - function tableClickHander(evt) { - removeSelectedClass(domUtils.getElementsByTagName(me.body, "td th")); - //trace:3113 - //选中单元格,点击table外部,不会清掉table上挂的ueTable,会引起getUETableBySelected方法返回值 - utils.each(me.document.getElementsByTagName("table"), function(t) { - t.ueTable = null; - }); - startTd = getTargetTd(me, evt); - if (!startTd) return; - var table = domUtils.findParentByTagName(startTd, "table", true); - ut = getUETable(table); - ut && ut.clearSelected(); - - //判断当前鼠标状态 - if (!onBorder) { - me.document.body.style.webkitUserSelect = ""; - mousedown = true; - me.addListener("mouseover", mouseOverEvent); - } else { - //边框上的动作处理 - borderActionHandler(evt); - } - } - - //处理表格边框上的动作, 这里做延时处理,避免两种动作互相影响 - function borderActionHandler(evt) { - if (browser.ie) { - evt = reconstruct(evt); - } - - clearTableDragTimer(); - - //是否正在等待resize的缓冲中 - isInResizeBuffer = true; - - tableDragTimer = setTimeout(function() { - tableBorderDrag(evt); - }, dblclickTime); - } - - function extractArray(originArr, key) { - var result = [], - tmp = null; - - for (var i = 0, len = originArr.length; i < len; i++) { - tmp = originArr[i][key]; - - if (tmp) { - result.push(tmp); - } - } - - return result; - } - - function clearTableDragTimer() { - tableDragTimer && clearTimeout(tableDragTimer); - tableDragTimer = null; - } - - function reconstruct(obj) { - var attrs = [ - "pageX", - "pageY", - "clientX", - "clientY", - "srcElement", - "target" - ], - newObj = {}; - - if (obj) { - for (var i = 0, key, val; (key = attrs[i]); i++) { - val = obj[key]; - val && (newObj[key] = val); - } - } - - return newObj; - } - - //边框拖动 - function tableBorderDrag(evt) { - isInResizeBuffer = false; - - startTd = evt.target || evt.srcElement; - if (!startTd) return; - var state = getRelation(startTd, mouseCoords(evt)); - if (/\d/.test(state)) { - state = state.replace(/\d/, ""); - startTd = getUETable(startTd).getPreviewCell(startTd, state == "v"); - } - hideDragLine(me); - getDragLine(me, me.document); - me.fireEvent("saveScene"); - showDragLineAt(state, startTd); - mousedown = true; - //拖动开始 - onDrag = state; - dragTd = startTd; - } - - function mouseUpEvent(type, evt) { - if (isEditorDisabled()) { - return; - } - - clearTableDragTimer(); - - isInResizeBuffer = false; - - if (onBorder) { - singleClickState = ++singleClickState % 3; - - userActionStatus = { - x: evt.clientX, - y: evt.clientY - }; - - tableResizeTimer = setTimeout(function() { - singleClickState > 0 && singleClickState--; - }, dblclickTime); - - if (singleClickState === 2) { - singleClickState = 0; - tableDbclickHandler(evt); - return; - } - } - - if (evt.button == 2) return; - var me = this; - //清除表格上原生跨选问题 - var range = me.selection.getRange(), - start = domUtils.findParentByTagName(range.startContainer, "table", true), - end = domUtils.findParentByTagName(range.endContainer, "table", true); - - if (start || end) { - if (start === end) { - start = domUtils.findParentByTagName( - range.startContainer, - ["td", "th", "caption"], - true - ); - end = domUtils.findParentByTagName( - range.endContainer, - ["td", "th", "caption"], - true - ); - if (start !== end) { - me.selection.clearRange(); - } - } else { - me.selection.clearRange(); - } - } - mousedown = false; - me.document.body.style.webkitUserSelect = ""; - //拖拽状态下的mouseUP - if (onDrag && dragTd) { - me.selection.getNative()[ - browser.ie9below ? "empty" : "removeAllRanges" - ](); - - singleClickState = 0; - dragLine = me.document.getElementById("ue_tableDragLine"); - - // trace 3973 - if (dragLine) { - var dragTdPos = domUtils.getXY(dragTd), - dragLinePos = domUtils.getXY(dragLine); - - switch (onDrag) { - case "h": - changeColWidth(dragTd, dragLinePos.x - dragTdPos.x); - break; - case "v": - changeRowHeight( - dragTd, - dragLinePos.y - dragTdPos.y - dragTd.offsetHeight - ); - break; - default: - } - onDrag = ""; - dragTd = null; - - hideDragLine(me); - me.fireEvent("saveScene"); - return; - } - } - //正常状态下的mouseup - if (!startTd) { - var target = domUtils.findParentByTagName( - evt.target || evt.srcElement, - "td", - true - ); - if (!target) - target = domUtils.findParentByTagName( - evt.target || evt.srcElement, - "th", - true - ); - if (target && (target.tagName == "TD" || target.tagName == "TH")) { - if (me.fireEvent("excludetable", target) === true) return; - range = new dom.Range(me.document); - range.setStart(target, 0).setCursor(false, true); - } - } else { - var ut = getUETable(startTd), - cell = ut ? ut.selectedTds[0] : null; - if (cell) { - range = new dom.Range(me.document); - if (domUtils.isEmptyBlock(cell)) { - range.setStart(cell, 0).setCursor(false, true); - } else { - range - .selectNodeContents(cell) - .shrinkBoundary() - .setCursor(false, true); - } - } else { - range = me.selection.getRange().shrinkBoundary(); - if (!range.collapsed) { - var start = domUtils.findParentByTagName( - range.startContainer, - ["td", "th"], - true - ), - end = domUtils.findParentByTagName( - range.endContainer, - ["td", "th"], - true - ); - //在table里边的不能清除 - if ( - (start && !end) || - (!start && end) || - (start && end && start !== end) - ) { - range.setCursor(false, true); - } - } - } - startTd = null; - me.removeListener("mouseover", mouseOverEvent); - } - me._selectionChange(250, evt); - } - - function mouseOverEvent(type, evt) { - if (isEditorDisabled()) { - return; - } - - var me = this, - tar = evt.target || evt.srcElement; - currentTd = - domUtils.findParentByTagName(tar, "td", true) || - domUtils.findParentByTagName(tar, "th", true); - //需要判断两个TD是否位于同一个表格内 - if ( - startTd && - currentTd && - ((startTd.tagName == "TD" && currentTd.tagName == "TD") || - (startTd.tagName == "TH" && currentTd.tagName == "TH")) && - domUtils.findParentByTagName(startTd, "table") == - domUtils.findParentByTagName(currentTd, "table") - ) { - var ut = getUETable(currentTd); - if (startTd != currentTd) { - me.document.body.style.webkitUserSelect = "none"; - me.selection.getNative()[ - browser.ie9below ? "empty" : "removeAllRanges" - ](); - var range = ut.getCellsRange(startTd, currentTd); - ut.setSelected(range); - } else { - me.document.body.style.webkitUserSelect = ""; - ut.clearSelected(); - } - } - evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); - } - - function setCellHeight(cell, height, backHeight) { - var lineHight = parseInt( - domUtils.getComputedStyle(cell, "line-height"), - 10 - ), - tmpHeight = backHeight + height; - height = tmpHeight < lineHight ? lineHight : tmpHeight; - if (cell.style.height) cell.style.height = ""; - cell.rowSpan == 1 - ? cell.setAttribute("height", height) - : cell.removeAttribute && cell.removeAttribute("height"); - } - - function getWidth(cell) { - if (!cell) return 0; - return parseInt(domUtils.getComputedStyle(cell, "width"), 10); - } - - function changeColWidth(cell, changeValue) { - var ut = getUETable(cell); - if (ut) { - //根据当前移动的边框获取相关的单元格 - var table = ut.table, - cells = getCellsByMoveBorder(cell, table); - - table.style.width = ""; - table.removeAttribute("width"); - - //修正改变量 - changeValue = correctChangeValue(changeValue, cell, cells); - - if (cell.nextSibling) { - var i = 0; - - utils.each(cells, function(cellGroup) { - cellGroup.left.width = +cellGroup.left.width + changeValue; - cellGroup.right && - (cellGroup.right.width = +cellGroup.right.width - changeValue); - }); - } else { - utils.each(cells, function(cellGroup) { - cellGroup.left.width -= -changeValue; - }); - } - } - } - - function isEditorDisabled() { - return me.body.contentEditable === "false"; - } - - function changeRowHeight(td, changeValue) { - if (Math.abs(changeValue) < 10) return; - var ut = getUETable(td); - if (ut) { - var cells = ut.getSameEndPosCells(td, "y"), - //备份需要连带变化的td的原始高度,否则后期无法获取正确的值 - backHeight = cells[0] ? cells[0].offsetHeight : 0; - for (var i = 0, cell; (cell = cells[i++]); ) { - setCellHeight(cell, changeValue, backHeight); - } - } - } - - /** - * 获取调整单元格大小的相关单元格 - * @isContainMergeCell 返回的结果中是否包含发生合并后的单元格 - */ - function getCellsByMoveBorder(cell, table, isContainMergeCell) { - if (!table) { - table = domUtils.findParentByTagName(cell, "table"); - } - - if (!table) { - return null; - } - - //获取到该单元格所在行的序列号 - var index = domUtils.getNodeIndex(cell), - temp = cell, - rows = table.rows, - colIndex = 0; - - while (temp) { - //获取到当前单元格在未发生单元格合并时的序列 - if (temp.nodeType === 1) { - colIndex += temp.colSpan || 1; - } - temp = temp.previousSibling; - } - - temp = null; - - //记录想关的单元格 - var borderCells = []; - - utils.each(rows, function(tabRow) { - var cells = tabRow.cells, - currIndex = 0; - - utils.each(cells, function(tabCell) { - currIndex += tabCell.colSpan || 1; - - if (currIndex === colIndex) { - borderCells.push({ - left: tabCell, - right: tabCell.nextSibling || null - }); - - return false; - } else if (currIndex > colIndex) { - if (isContainMergeCell) { - borderCells.push({ - left: tabCell - }); - } - - return false; - } - }); - }); - - return borderCells; - } - - /** - * 通过给定的单元格集合获取最小的单元格width - */ - function getMinWidthByTableCells(cells) { - var minWidth = Number.MAX_VALUE; - - for (var i = 0, curCell; (curCell = cells[i]); i++) { - minWidth = Math.min( - minWidth, - curCell.width || getTableCellWidth(curCell) - ); - } - - return minWidth; - } - - function correctChangeValue(changeValue, relatedCell, cells) { - //为单元格的paading预留空间 - changeValue -= getTabcellSpace(); - - if (changeValue < 0) { - return 0; - } - - changeValue -= getTableCellWidth(relatedCell); - - //确定方向 - var direction = changeValue < 0 ? "left" : "right"; - - changeValue = Math.abs(changeValue); - - //只关心非最后一个单元格就可以 - utils.each(cells, function(cellGroup) { - var curCell = cellGroup[direction]; - - //为单元格保留最小空间 - if (curCell) { - changeValue = Math.min( - changeValue, - getTableCellWidth(curCell) - cellMinWidth - ); - } - }); - - //修正越界 - changeValue = changeValue < 0 ? 0 : changeValue; - - return direction === "left" ? -changeValue : changeValue; - } - - function getTableCellWidth(cell) { - var width = 0, - //偏移纠正量 - offset = 0, - width = cell.offsetWidth - getTabcellSpace(); - - //最后一个节点纠正一下 - if (!cell.nextSibling) { - width -= getTableCellOffset(cell); - } - - width = width < 0 ? 0 : width; - - try { - cell.width = width; - } catch (e) {} - - return width; - } - - /** - * 获取单元格所在表格的最末单元格的偏移量 - */ - function getTableCellOffset(cell) { - tab = domUtils.findParentByTagName(cell, "table", false); - - if (tab.offsetVal === undefined) { - var prev = cell.previousSibling; - - if (prev) { - //最后一个单元格和前一个单元格的width diff结果 如果恰好为一个border width, 则条件成立 - tab.offsetVal = cell.offsetWidth - prev.offsetWidth === UT.borderWidth - ? UT.borderWidth - : 0; - } else { - tab.offsetVal = 0; - } - } - - return tab.offsetVal; - } - - function getTabcellSpace() { - if (UT.tabcellSpace === undefined) { - var cell = null, - tab = me.document.createElement("table"), - tbody = me.document.createElement("tbody"), - trow = me.document.createElement("tr"), - tabcell = me.document.createElement("td"), - mirror = null; - - tabcell.style.cssText = "border: 0;"; - tabcell.width = 1; - - trow.appendChild(tabcell); - trow.appendChild((mirror = tabcell.cloneNode(false))); - - tbody.appendChild(trow); - - tab.appendChild(tbody); - - tab.style.cssText = "visibility: hidden;"; - - me.body.appendChild(tab); - - UT.paddingSpace = tabcell.offsetWidth - 1; - - var tmpTabWidth = tab.offsetWidth; - - tabcell.style.cssText = ""; - mirror.style.cssText = ""; - - UT.borderWidth = (tab.offsetWidth - tmpTabWidth) / 3; - - UT.tabcellSpace = UT.paddingSpace + UT.borderWidth; - - me.body.removeChild(tab); - } - - getTabcellSpace = function() { - return UT.tabcellSpace; - }; - - return UT.tabcellSpace; - } - - function getDragLine(editor, doc) { - if (mousedown) return; - dragLine = editor.document.createElement("div"); - domUtils.setAttributes(dragLine, { - id: "ue_tableDragLine", - unselectable: "on", - contenteditable: false, - onresizestart: "return false", - ondragstart: "return false", - onselectstart: "return false", - style: - "background-color:blue;position:absolute;padding:0;margin:0;background-image:none;border:0px none;opacity:0;filter:alpha(opacity=0)" - }); - editor.body.appendChild(dragLine); - } - - function hideDragLine(editor) { - if (mousedown) return; - var line; - while ((line = editor.document.getElementById("ue_tableDragLine"))) { - domUtils.remove(line); - } - } - - /** - * 依据state(v|h)在cell位置显示横线 - * @param state - * @param cell - */ - function showDragLineAt(state, cell) { - if (!cell) return; - var table = domUtils.findParentByTagName(cell, "table"), - caption = table.getElementsByTagName("caption"), - width = table.offsetWidth, - height = - table.offsetHeight - (caption.length > 0 ? caption[0].offsetHeight : 0), - tablePos = domUtils.getXY(table), - cellPos = domUtils.getXY(cell), - css; - switch (state) { - case "h": - css = - "height:" + - height + - "px;top:" + - (tablePos.y + (caption.length > 0 ? caption[0].offsetHeight : 0)) + - "px;left:" + - (cellPos.x + cell.offsetWidth); - dragLine.style.cssText = - css + - "px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)"; - break; - case "v": - css = - "width:" + - width + - "px;left:" + - tablePos.x + - "px;top:" + - (cellPos.y + cell.offsetHeight); - //必须加上border:0和color:blue,否则低版ie不支持背景色显示 - dragLine.style.cssText = - css + - "px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)"; - break; - default: - } - } - - /** - * 当表格边框颜色为白色时设置为虚线,true为添加虚线 - * @param editor - * @param flag - */ - function switchBorderColor(editor, flag) { - var tableArr = domUtils.getElementsByTagName(editor.body, "table"), - color; - for (var i = 0, node; (node = tableArr[i++]); ) { - var td = domUtils.getElementsByTagName(node, "td"); - if (td[0]) { - if (flag) { - color = td[0].style.borderColor.replace(/\s/g, ""); - if (/(#ffffff)|(rgb\(255,255,255\))/gi.test(color)) - domUtils.addClass(node, "noBorderTable"); - } else { - domUtils.removeClasses(node, "noBorderTable"); - } - } - } - } - - function getTableWidth(editor, needIEHack, defaultValue) { - var body = editor.body; - return ( - body.offsetWidth - - (needIEHack - ? parseInt(domUtils.getComputedStyle(body, "margin-left"), 10) * 2 - : 0) - - defaultValue.tableBorder * 2 - - (editor.options.offsetWidth || 0) - ); - } - - /** - * 获取当前拖动的单元格 - */ - function getTargetTd(editor, evt) { - var target = domUtils.findParentByTagName( - evt.target || evt.srcElement, - ["td", "th"], - true - ), - dir = null; - - if (!target) { - return null; - } - - dir = getRelation(target, mouseCoords(evt)); - - //如果有前一个节点, 需要做一个修正, 否则可能会得到一个错误的td - - if (!target) { - return null; - } - - if (dir === "h1" && target.previousSibling) { - var position = domUtils.getXY(target), - cellWidth = target.offsetWidth; - - if (Math.abs(position.x + cellWidth - evt.clientX) > cellWidth / 3) { - target = target.previousSibling; - } - } else if (dir === "v1" && target.parentNode.previousSibling) { - var position = domUtils.getXY(target), - cellHeight = target.offsetHeight; - - if (Math.abs(position.y + cellHeight - evt.clientY) > cellHeight / 3) { - target = target.parentNode.previousSibling.firstChild; - } - } - - //排除了非td内部以及用于代码高亮部分的td - return target && !(editor.fireEvent("excludetable", target) === true) - ? target - : null; - } -}; - - -// plugins/table.sort.js -/** - * Created with JetBrains PhpStorm. - * User: Jinqn - * Date: 13-10-12 - * Time: 上午10:20 - * To change this template use File | Settings | File Templates. - */ - -UE.UETable.prototype.sortTable = function(sortByCellIndex, compareFn) { - var table = this.table, - rows = table.rows, - trArray = [], - flag = rows[0].cells[0].tagName === "TH", - lastRowIndex = 0; - if (this.selectedTds.length) { - var range = this.cellsRange, - len = range.endRowIndex + 1; - for (var i = range.beginRowIndex; i < len; i++) { - trArray[i] = rows[i]; - } - trArray.splice(0, range.beginRowIndex); - lastRowIndex = range.endRowIndex + 1 === this.rowsNum - ? 0 - : range.endRowIndex + 1; - } else { - for (var i = 0, len = rows.length; i < len; i++) { - trArray[i] = rows[i]; - } - } - - var Fn = { - reversecurrent: function(td1, td2) { - return 1; - }, - orderbyasc: function(td1, td2) { - var value1 = td1.innerText || td1.textContent, - value2 = td2.innerText || td2.textContent; - return value1.localeCompare(value2); - }, - reversebyasc: function(td1, td2) { - var value1 = td1.innerHTML, - value2 = td2.innerHTML; - return value2.localeCompare(value1); - }, - orderbynum: function(td1, td2) { - var value1 = td1[browser.ie ? "innerText" : "textContent"].match(/\d+/), - value2 = td2[browser.ie ? "innerText" : "textContent"].match(/\d+/); - if (value1) value1 = +value1[0]; - if (value2) value2 = +value2[0]; - return (value1 || 0) - (value2 || 0); - }, - reversebynum: function(td1, td2) { - var value1 = td1[browser.ie ? "innerText" : "textContent"].match(/\d+/), - value2 = td2[browser.ie ? "innerText" : "textContent"].match(/\d+/); - if (value1) value1 = +value1[0]; - if (value2) value2 = +value2[0]; - return (value2 || 0) - (value1 || 0); - } - }; - - //对表格设置排序的标记data-sort-type - table.setAttribute( - "data-sort-type", - compareFn && typeof compareFn === "string" && Fn[compareFn] ? compareFn : "" - ); - - //th不参与排序 - flag && trArray.splice(0, 1); - trArray = utils.sort(trArray, function(tr1, tr2) { - var result; - if (compareFn && typeof compareFn === "function") { - result = compareFn.call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } else if (compareFn && typeof compareFn === "number") { - result = 1; - } else if (compareFn && typeof compareFn === "string" && Fn[compareFn]) { - result = Fn[compareFn].call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } else { - result = Fn["orderbyasc"].call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } - return result; - }); - var fragment = table.ownerDocument.createDocumentFragment(); - for (var j = 0, len = trArray.length; j < len; j++) { - fragment.appendChild(trArray[j]); - } - var tbody = table.getElementsByTagName("tbody")[0]; - if (!lastRowIndex) { - tbody.appendChild(fragment); - } else { - tbody.insertBefore( - fragment, - rows[lastRowIndex - range.endRowIndex + range.beginRowIndex - 1] - ); - } -}; - -UE.plugins["tablesort"] = function() { - var me = this, - UT = UE.UETable, - getUETable = function(tdOrTable) { - return UT.getUETable(tdOrTable); - }, - getTableItemsByRange = function(editor) { - return UT.getTableItemsByRange(editor); - }; - - me.ready(function() { - //添加表格可排序的样式 - utils.cssRule( - "tablesort", - "table.sortEnabled tr.firstRow th,table.sortEnabled tr.firstRow td{padding-right:20px;background-repeat: no-repeat;background-position: center right;" + - " background-image:url(" + - me.options.themePath + - me.options.theme + - "/images/sortable.png);}", - me.document - ); - - //做单元格合并操作时,清除可排序标识 - me.addListener("afterexeccommand", function(type, cmd) { - if (cmd == "mergeright" || cmd == "mergedown" || cmd == "mergecells") { - this.execCommand("disablesort"); - } - }); - }); - - //表格排序 - UE.commands["sorttable"] = { - queryCommandState: function() { - var me = this, - tableItems = getTableItemsByRange(me); - if (!tableItems.cell) return -1; - var table = tableItems.table, - cells = table.getElementsByTagName("td"); - for (var i = 0, cell; (cell = cells[i++]); ) { - if (cell.rowSpan != 1 || cell.colSpan != 1) return -1; - } - return 0; - }, - execCommand: function(cmd, fn) { - var me = this, - range = me.selection.getRange(), - bk = range.createBookmark(true), - tableItems = getTableItemsByRange(me), - cell = tableItems.cell, - ut = getUETable(tableItems.table), - cellInfo = ut.getCellInfo(cell); - ut.sortTable(cellInfo.cellIndex, fn); - range.moveToBookmark(bk); - try { - range.select(); - } catch (e) {} - } - }; - - //设置表格可排序,清除表格可排序 - UE.commands["enablesort"] = UE.commands["disablesort"] = { - queryCommandState: function(cmd) { - var table = getTableItemsByRange(this).table; - if (table && cmd == "enablesort") { - var cells = domUtils.getElementsByTagName(table, "th td"); - for (var i = 0; i < cells.length; i++) { - if ( - cells[i].getAttribute("colspan") > 1 || - cells[i].getAttribute("rowspan") > 1 - ) - return -1; - } - } - - return !table - ? -1 - : (cmd == "enablesort") ^ - (table.getAttribute("data-sort") != "sortEnabled") - ? -1 - : 0; - }, - execCommand: function(cmd) { - var table = getTableItemsByRange(this).table; - table.setAttribute( - "data-sort", - cmd == "enablesort" ? "sortEnabled" : "sortDisabled" - ); - cmd == "enablesort" - ? domUtils.addClass(table, "sortEnabled") - : domUtils.removeClasses(table, "sortEnabled"); - } - }; -}; - - -// plugins/contextmenu.js -///import core -///commands 右键菜单 -///commandsName ContextMenu -///commandsTitle 右键菜单 -/** - * 右键菜单 - * @function - * @name baidu.editor.plugins.contextmenu - * @author zhanyi - */ - -UE.plugins["contextmenu"] = function() { - var me = this; - - me.setOpt("enableContextMenu", me.getOpt("enableContextMenu") || true); - - if (me.getOpt("enableContextMenu") === false) { - return; - } - var lang = me.getLang("contextMenu"), - menu, - items = me.options.contextMenu || [ - { label: lang["selectall"], cmdName: "selectall" }, - { - label: lang.cleardoc, - cmdName: "cleardoc", - exec: function() { - if (confirm(lang.confirmclear)) { - this.execCommand("cleardoc"); - } - } - }, - "-", - { - label: lang.unlink, - cmdName: "unlink" - }, - "-", - { - group: lang.paragraph, - icon: "justifyjustify", - subMenu: [ - { - label: lang.justifyleft, - cmdName: "justify", - value: "left" - }, - { - label: lang.justifyright, - cmdName: "justify", - value: "right" - }, - { - label: lang.justifycenter, - cmdName: "justify", - value: "center" - }, - { - label: lang.justifyjustify, - cmdName: "justify", - value: "justify" - } - ] - }, - "-", - { - group: lang.table, - icon: "table", - subMenu: [ - { - label: lang.inserttable, - cmdName: "inserttable" - }, - { - label: lang.deletetable, - cmdName: "deletetable" - }, - "-", - { - label: lang.deleterow, - cmdName: "deleterow" - }, - { - label: lang.deletecol, - cmdName: "deletecol" - }, - { - label: lang.insertcol, - cmdName: "insertcol" - }, - { - label: lang.insertcolnext, - cmdName: "insertcolnext" - }, - { - label: lang.insertrow, - cmdName: "insertrow" - }, - { - label: lang.insertrownext, - cmdName: "insertrownext" - }, - "-", - { - label: lang.insertcaption, - cmdName: "insertcaption" - }, - { - label: lang.deletecaption, - cmdName: "deletecaption" - }, - { - label: lang.inserttitle, - cmdName: "inserttitle" - }, - { - label: lang.deletetitle, - cmdName: "deletetitle" - }, - { - label: lang.inserttitlecol, - cmdName: "inserttitlecol" - }, - { - label: lang.deletetitlecol, - cmdName: "deletetitlecol" - }, - "-", - { - label: lang.mergecells, - cmdName: "mergecells" - }, - { - label: lang.mergeright, - cmdName: "mergeright" - }, - { - label: lang.mergedown, - cmdName: "mergedown" - }, - "-", - { - label: lang.splittorows, - cmdName: "splittorows" - }, - { - label: lang.splittocols, - cmdName: "splittocols" - }, - { - label: lang.splittocells, - cmdName: "splittocells" - }, - "-", - { - label: lang.averageDiseRow, - cmdName: "averagedistributerow" - }, - { - label: lang.averageDisCol, - cmdName: "averagedistributecol" - }, - "-", - { - label: lang.edittd, - cmdName: "edittd", - exec: function() { - if (UE.ui["edittd"]) { - new UE.ui["edittd"](this); - } - this.getDialog("edittd").open(); - } - }, - { - label: lang.edittable, - cmdName: "edittable", - exec: function() { - if (UE.ui["edittable"]) { - new UE.ui["edittable"](this); - } - this.getDialog("edittable").open(); - } - }, - { - label: lang.setbordervisible, - cmdName: "setbordervisible" - } - ] - }, - { - group: lang.tablesort, - icon: "tablesort", - subMenu: [ - { - label: lang.enablesort, - cmdName: "enablesort" - }, - { - label: lang.disablesort, - cmdName: "disablesort" - }, - "-", - { - label: lang.reversecurrent, - cmdName: "sorttable", - value: "reversecurrent" - }, - { - label: lang.orderbyasc, - cmdName: "sorttable", - value: "orderbyasc" - }, - { - label: lang.reversebyasc, - cmdName: "sorttable", - value: "reversebyasc" - }, - { - label: lang.orderbynum, - cmdName: "sorttable", - value: "orderbynum" - }, - { - label: lang.reversebynum, - cmdName: "sorttable", - value: "reversebynum" - } - ] - }, - { - group: lang.borderbk, - icon: "borderBack", - subMenu: [ - { - label: lang.setcolor, - cmdName: "interlacetable", - exec: function() { - this.execCommand("interlacetable"); - } - }, - { - label: lang.unsetcolor, - cmdName: "uninterlacetable", - exec: function() { - this.execCommand("uninterlacetable"); - } - }, - { - label: lang.setbackground, - cmdName: "settablebackground", - exec: function() { - this.execCommand("settablebackground", { - repeat: true, - colorList: ["#bbb", "#ccc"] - }); - } - }, - { - label: lang.unsetbackground, - cmdName: "cleartablebackground", - exec: function() { - this.execCommand("cleartablebackground"); - } - }, - { - label: lang.redandblue, - cmdName: "settablebackground", - exec: function() { - this.execCommand("settablebackground", { - repeat: true, - colorList: ["red", "blue"] - }); - } - }, - { - label: lang.threecolorgradient, - cmdName: "settablebackground", - exec: function() { - this.execCommand("settablebackground", { - repeat: true, - colorList: ["#aaa", "#bbb", "#ccc"] - }); - } - } - ] - }, - { - group: lang.aligntd, - icon: "aligntd", - subMenu: [ - { - cmdName: "cellalignment", - value: { align: "left", vAlign: "top" } - }, - { - cmdName: "cellalignment", - value: { align: "center", vAlign: "top" } - }, - { - cmdName: "cellalignment", - value: { align: "right", vAlign: "top" } - }, - { - cmdName: "cellalignment", - value: { align: "left", vAlign: "middle" } - }, - { - cmdName: "cellalignment", - value: { align: "center", vAlign: "middle" } - }, - { - cmdName: "cellalignment", - value: { align: "right", vAlign: "middle" } - }, - { - cmdName: "cellalignment", - value: { align: "left", vAlign: "bottom" } - }, - { - cmdName: "cellalignment", - value: { align: "center", vAlign: "bottom" } - }, - { - cmdName: "cellalignment", - value: { align: "right", vAlign: "bottom" } - } - ] - }, - { - group: lang.aligntable, - icon: "aligntable", - subMenu: [ - { - cmdName: "tablealignment", - className: "left", - label: lang.tableleft, - value: "left" - }, - { - cmdName: "tablealignment", - className: "center", - label: lang.tablecenter, - value: "center" - }, - { - cmdName: "tablealignment", - className: "right", - label: lang.tableright, - value: "right" - } - ] - }, - "-", - { - label: lang.insertparagraphbefore, - cmdName: "insertparagraph", - value: true - }, - { - label: lang.insertparagraphafter, - cmdName: "insertparagraph" - }, - { - label: lang["copy"], - cmdName: "copy" - }, - { - label: lang["paste"], - cmdName: "paste" - } - ]; - if (!items.length) { - return; - } - var uiUtils = UE.ui.uiUtils; - - me.addListener("contextmenu", function(type, evt) { - var offset = uiUtils.getViewportOffsetByEvent(evt); - me.fireEvent("beforeselectionchange"); - if (menu) { - menu.destroy(); - } - for (var i = 0, ti, contextItems = []; (ti = items[i]); i++) { - var last; - (function(item) { - if (item == "-") { - if ((last = contextItems[contextItems.length - 1]) && last !== "-") { - contextItems.push("-"); - } - } else if (item.hasOwnProperty("group")) { - for (var j = 0, cj, subMenu = []; (cj = item.subMenu[j]); j++) { - (function(subItem) { - if (subItem == "-") { - if ((last = subMenu[subMenu.length - 1]) && last !== "-") { - subMenu.push("-"); - } else { - subMenu.splice(subMenu.length - 1); - } - } else { - if ( - (me.commands[subItem.cmdName] || - UE.commands[subItem.cmdName] || - subItem.query) && - (subItem.query - ? subItem.query() - : me.queryCommandState(subItem.cmdName)) > -1 - ) { - subMenu.push({ - label: - subItem.label || - me.getLang( - "contextMenu." + - subItem.cmdName + - (subItem.value || "") - ) || - "", - className: - "edui-for-" + - subItem.cmdName + - (subItem.className - ? " edui-for-" + - subItem.cmdName + - "-" + - subItem.className - : ""), - onclick: subItem.exec - ? function() { - subItem.exec.call(me); - } - : function() { - me.execCommand(subItem.cmdName, subItem.value); - } - }); - } - } - })(cj); - } - if (subMenu.length) { - function getLabel() { - switch (item.icon) { - case "table": - return me.getLang("contextMenu.table"); - case "justifyjustify": - return me.getLang("contextMenu.paragraph"); - case "aligntd": - return me.getLang("contextMenu.aligntd"); - case "aligntable": - return me.getLang("contextMenu.aligntable"); - case "tablesort": - return lang.tablesort; - case "borderBack": - return lang.borderbk; - default: - return ""; - } - } - contextItems.push({ - //todo 修正成自动获取方式 - label: getLabel(), - className: "edui-for-" + item.icon, - subMenu: { - items: subMenu, - editor: me - } - }); - } - } else { - //有可能commmand没有加载右键不能出来,或者没有command也想能展示出来添加query方法 - if ( - (me.commands[item.cmdName] || - UE.commands[item.cmdName] || - item.query) && - (item.query - ? item.query.call(me) - : me.queryCommandState(item.cmdName)) > -1 - ) { - contextItems.push({ - label: item.label || me.getLang("contextMenu." + item.cmdName), - className: - "edui-for-" + - (item.icon ? item.icon : item.cmdName + (item.value || "")), - onclick: item.exec - ? function() { - item.exec.call(me); - } - : function() { - me.execCommand(item.cmdName, item.value); - } - }); - } - } - })(ti); - } - if (contextItems[contextItems.length - 1] == "-") { - contextItems.pop(); - } - - menu = new UE.ui.Menu({ - items: contextItems, - className: "edui-contextmenu", - editor: me - }); - menu.render(); - menu.showAt(offset); - - me.fireEvent("aftershowcontextmenu", menu); - - domUtils.preventDefault(evt); - if (browser.ie) { - var ieRange; - try { - ieRange = me.selection.getNative().createRange(); - } catch (e) { - return; - } - if (ieRange.item) { - var range = new dom.Range(me.document); - range.selectNode(ieRange.item(0)).select(true, true); - } - } - }); - - // 添加复制的flash按钮 - me.addListener("aftershowcontextmenu", function(type, menu) { - if (me.zeroclipboard) { - var items = menu.items; - for (var key in items) { - if (items[key].className == "edui-for-copy") { - me.zeroclipboard.clip(items[key].getDom()); - } - } - } - }); -}; - - -// plugins/shortcutmenu.js -///import core -///commands 弹出菜单 -// commandsName popupmenu -///commandsTitle 弹出菜单 -/** - * 弹出菜单 - * @function - * @name baidu.editor.plugins.popupmenu - * @author xuheng - */ - -UE.plugins["shortcutmenu"] = function() { - var me = this, - menu, - items = me.options.shortcutMenu || []; - - if (!items.length) { - return; - } - - me.addListener("contextmenu mouseup", function(type, e) { - var me = this, - customEvt = { - type: type, - target: e.target || e.srcElement, - screenX: e.screenX, - screenY: e.screenY, - clientX: e.clientX, - clientY: e.clientY - }; - - setTimeout(function() { - var rng = me.selection.getRange(); - if (rng.collapsed === false || type == "contextmenu") { - if (!menu) { - menu = new baidu.editor.ui.ShortCutMenu({ - editor: me, - items: items, - theme: me.options.theme, - className: "edui-shortcutmenu" - }); - - menu.render(); - me.fireEvent("afterrendershortcutmenu", menu); - } - - menu.show(customEvt, !!UE.plugins["contextmenu"]); - } - }); - - if (type == "contextmenu") { - domUtils.preventDefault(e); - if (browser.ie9below) { - var ieRange; - try { - ieRange = me.selection.getNative().createRange(); - } catch (e) { - return; - } - if (ieRange.item) { - var range = new dom.Range(me.document); - range.selectNode(ieRange.item(0)).select(true, true); - } - } - } - }); - - me.addListener("keydown", function(type) { - if (type == "keydown") { - menu && !menu.isHidden && menu.hide(); - } - }); -}; - - -// plugins/basestyle.js -/** - * B、I、sub、super命令支持 - * @file - * @since 1.2.6.1 - */ - -UE.plugins["basestyle"] = function() { - /** - * 字体加粗 - * @command bold - * @param { String } cmd 命令字符串 - * @remind 对已加粗的文本内容执行该命令, 将取消加粗 - * @method execCommand - * @example - * ```javascript - * //editor是编辑器实例 - * //对当前选中的文本内容执行加粗操作 - * //第一次执行, 文本内容加粗 - * editor.execCommand( 'bold' ); - * - * //第二次执行, 文本内容取消加粗 - * editor.execCommand( 'bold' ); - * ``` - */ - - /** - * 字体倾斜 - * @command italic - * @method execCommand - * @param { String } cmd 命令字符串 - * @remind 对已倾斜的文本内容执行该命令, 将取消倾斜 - * @example - * ```javascript - * //editor是编辑器实例 - * //对当前选中的文本内容执行斜体操作 - * //第一次操作, 文本内容将变成斜体 - * editor.execCommand( 'italic' ); - * - * //再次对同一文本内容执行, 则文本内容将恢复正常 - * editor.execCommand( 'italic' ); - * ``` - */ - - /** - * 下标文本,与“superscript”命令互斥 - * @command subscript - * @method execCommand - * @remind 把选中的文本内容切换成下标文本, 如果当前选中的文本已经是下标, 则该操作会把文本内容还原成正常文本 - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * //editor是编辑器实例 - * //对当前选中的文本内容执行下标操作 - * //第一次操作, 文本内容将变成下标文本 - * editor.execCommand( 'subscript' ); - * - * //再次对同一文本内容执行, 则文本内容将恢复正常 - * editor.execCommand( 'subscript' ); - * ``` - */ - - /** - * 上标文本,与“subscript”命令互斥 - * @command superscript - * @method execCommand - * @remind 把选中的文本内容切换成上标文本, 如果当前选中的文本已经是上标, 则该操作会把文本内容还原成正常文本 - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * //editor是编辑器实例 - * //对当前选中的文本内容执行上标操作 - * //第一次操作, 文本内容将变成上标文本 - * editor.execCommand( 'superscript' ); - * - * //再次对同一文本内容执行, 则文本内容将恢复正常 - * editor.execCommand( 'superscript' ); - * ``` - */ - var basestyles = { - bold: ["strong", "b"], - italic: ["em", "i"], - subscript: ["sub"], - superscript: ["sup"] - }, - getObj = function(editor, tagNames) { - return domUtils.filterNodeList( - editor.selection.getStartElementPath(), - tagNames - ); - }, - me = this; - //添加快捷键 - me.addshortcutkey({ - Bold: "ctrl+66", //^B - Italic: "ctrl+73", //^I - Underline: "ctrl+85" //^U - }); - me.addInputRule(function(root) { - utils.each(root.getNodesByTagName("b i"), function(node) { - switch (node.tagName) { - case "b": - node.tagName = "strong"; - break; - case "i": - node.tagName = "em"; - } - }); - }); - for (var style in basestyles) { - (function(cmd, tagNames) { - me.commands[cmd] = { - execCommand: function(cmdName) { - var range = me.selection.getRange(), - obj = getObj(this, tagNames); - if (range.collapsed) { - if (obj) { - var tmpText = me.document.createTextNode(""); - range.insertNode(tmpText).removeInlineStyle(tagNames); - range.setStartBefore(tmpText); - domUtils.remove(tmpText); - } else { - var tmpNode = range.document.createElement(tagNames[0]); - if (cmdName == "superscript" || cmdName == "subscript") { - tmpText = me.document.createTextNode(""); - range - .insertNode(tmpText) - .removeInlineStyle(["sub", "sup"]) - .setStartBefore(tmpText) - .collapse(true); - } - range.insertNode(tmpNode).setStart(tmpNode, 0); - } - range.collapse(true); - } else { - if (cmdName == "superscript" || cmdName == "subscript") { - if (!obj || obj.tagName.toLowerCase() != cmdName) { - range.removeInlineStyle(["sub", "sup"]); - } - } - obj - ? range.removeInlineStyle(tagNames) - : range.applyInlineStyle(tagNames[0]); - } - range.select(); - }, - queryCommandState: function() { - return getObj(this, tagNames) ? 1 : 0; - } - }; - })(style, basestyles[style]); - } -}; - - -// plugins/elementpath.js -/** - * 选取路径命令 - * @file - */ -UE.plugins["elementpath"] = function() { - var currentLevel, - tagNames, - me = this; - me.setOpt("elementPathEnabled", true); - if (!me.options.elementPathEnabled) { - return; - } - me.commands["elementpath"] = { - execCommand: function(cmdName, level) { - var start = tagNames[level], - range = me.selection.getRange(); - currentLevel = level * 1; - range.selectNode(start).select(); - }, - queryCommandValue: function() { - //产生一个副本,不能修改原来的startElementPath; - var parents = [].concat(this.selection.getStartElementPath()).reverse(), - names = []; - tagNames = parents; - for (var i = 0, ci; (ci = parents[i]); i++) { - if (ci.nodeType == 3) { - continue; - } - var name = ci.tagName.toLowerCase(); - if (name == "img" && ci.getAttribute("anchorname")) { - name = "anchor"; - } - names[i] = name; - if (currentLevel == i) { - currentLevel = -1; - break; - } - } - return names; - } - }; -}; - - -// plugins/formatmatch.js -/** - * 格式刷,只格式inline的 - * @file - * @since 1.2.6.1 - */ - -/** - * 格式刷 - * @command formatmatch - * @method execCommand - * @remind 该操作不能复制段落格式 - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * //editor是编辑器实例 - * //获取格式刷 - * editor.execCommand( 'formatmatch' ); - * ``` - */ -UE.plugins["formatmatch"] = function() { - var me = this, - list = [], - img, - flag = 0; - - me.addListener("reset", function() { - list = []; - flag = 0; - }); - - function addList(type, evt) { - if (browser.webkit) { - var target = evt.target.tagName == "IMG" ? evt.target : null; - } - - function addFormat(range) { - if (text) { - range.selectNode(text); - } - return range.applyInlineStyle(list[list.length - 1].tagName, null, list); - } - - me.undoManger && me.undoManger.save(); - - var range = me.selection.getRange(), - imgT = target || range.getClosedNode(); - if (img && imgT && imgT.tagName == "IMG") { - //trace:964 - - imgT.style.cssText += - ";float:" + - (img.style.cssFloat || img.style.styleFloat || "none") + - ";display:" + - (img.style.display || "inline"); - - img = null; - } else { - if (!img) { - var collapsed = range.collapsed; - if (collapsed) { - var text = me.document.createTextNode("match"); - range.insertNode(text).select(); - } - me.__hasEnterExecCommand = true; - //不能把block上的属性干掉 - //trace:1553 - var removeFormatAttributes = me.options.removeFormatAttributes; - me.options.removeFormatAttributes = ""; - me.execCommand("removeformat"); - me.options.removeFormatAttributes = removeFormatAttributes; - me.__hasEnterExecCommand = false; - //trace:969 - range = me.selection.getRange(); - if (list.length) { - addFormat(range); - } - if (text) { - range.setStartBefore(text).collapse(true); - } - range.select(); - text && domUtils.remove(text); - } - } - - me.undoManger && me.undoManger.save(); - me.removeListener("mouseup", addList); - flag = 0; - } - - me.commands["formatmatch"] = { - execCommand: function(cmdName) { - if (flag) { - flag = 0; - list = []; - me.removeListener("mouseup", addList); - return; - } - - var range = me.selection.getRange(); - img = range.getClosedNode(); - if (!img || img.tagName != "IMG") { - range.collapse(true).shrinkBoundary(); - var start = range.startContainer; - list = domUtils.findParents(start, true, function(node) { - return !domUtils.isBlockElm(node) && node.nodeType == 1; - }); - //a不能加入格式刷, 并且克隆节点 - for (var i = 0, ci; (ci = list[i]); i++) { - if (ci.tagName == "A") { - list.splice(i, 1); - break; - } - } - } - - me.addListener("mouseup", addList); - flag = 1; - }, - queryCommandState: function() { - return flag; - }, - notNeedUndo: 1 - }; -}; - - -// plugins/searchreplace.js -///import core -///commands 查找替换 -///commandsName SearchReplace -///commandsTitle 查询替换 -///commandsDialog dialogs\searchreplace -/** - * @description 查找替换 - * @author zhanyi - */ - -UE.plugin.register("searchreplace", function() { - var me = this; - - var _blockElm = { table: 1, tbody: 1, tr: 1, ol: 1, ul: 1 }; - - var lastRng = null; - - function getText(node) { - var text = node.nodeType == 3 - ? node.nodeValue - : node[browser.ie ? "innerText" : "textContent"]; - return text.replace(domUtils.fillChar, ""); - } - - function findTextInString(textContent, opt, currentIndex) { - var str = opt.searchStr; - - var reg = new RegExp(str, "g" + (opt.casesensitive ? "" : "i")), - match; - - if (opt.dir == -1) { - textContent = textContent.substr(0, currentIndex); - textContent = textContent.split("").reverse().join(""); - str = str.split("").reverse().join(""); - match = reg.exec(textContent); - if (match) { - return currentIndex - match.index - str.length; - } - } else { - textContent = textContent.substr(currentIndex); - match = reg.exec(textContent); - if (match) { - return match.index + currentIndex; - } - } - - return -1; - } - function findTextBlockElm(node, currentIndex, opt) { - var textContent, - index, - methodName = opt.all || opt.dir == 1 ? "getNextDomNode" : "getPreDomNode"; - if (domUtils.isBody(node)) { - node = node.firstChild; - } - var first = 1; - while (node) { - textContent = getText(node); - index = findTextInString(textContent, opt, currentIndex); - first = 0; - if (index != -1) { - return { - node: node, - index: index - }; - } - node = domUtils[methodName](node); - while (node && _blockElm[node.nodeName.toLowerCase()]) { - node = domUtils[methodName](node, true); - } - if (node) { - currentIndex = opt.dir == -1 ? getText(node).length : 0; - } - } - } - function findNTextInBlockElm(node, index, str) { - var currentIndex = 0, - currentNode = node.firstChild, - currentNodeLength = 0, - result; - while (currentNode) { - if (currentNode.nodeType == 3) { - currentNodeLength = getText(currentNode).replace( - /(^[\t\r\n]+)|([\t\r\n]+$)/, - "" - ).length; - currentIndex += currentNodeLength; - if (currentIndex >= index) { - return { - node: currentNode, - index: currentNodeLength - (currentIndex - index) - }; - } - } else if (!dtd.$empty[currentNode.tagName]) { - currentNodeLength = getText(currentNode).replace( - /(^[\t\r\n]+)|([\t\r\n]+$)/, - "" - ).length; - currentIndex += currentNodeLength; - if (currentIndex >= index) { - result = findNTextInBlockElm( - currentNode, - currentNodeLength - (currentIndex - index), - str - ); - if (result) { - return result; - } - } - } - currentNode = domUtils.getNextDomNode(currentNode); - } - } - - function searchReplace(me, opt) { - var rng = lastRng || me.selection.getRange(), - startBlockNode, - searchStr = opt.searchStr, - span = me.document.createElement("span"); - span.innerHTML = "$$ueditor_searchreplace_key$$"; - - rng.shrinkBoundary(true); - - //判断是不是第一次选中 - if (!rng.collapsed) { - rng.select(); - var rngText = me.selection.getText(); - if ( - new RegExp( - "^" + opt.searchStr + "$", - opt.casesensitive ? "" : "i" - ).test(rngText) - ) { - if (opt.replaceStr != undefined) { - replaceText(rng, opt.replaceStr); - rng.select(); - return true; - } else { - rng.collapse(opt.dir == -1); - } - } - } - - rng.insertNode(span); - rng.enlargeToBlockElm(true); - startBlockNode = rng.startContainer; - var currentIndex = getText(startBlockNode).indexOf( - "$$ueditor_searchreplace_key$$" - ); - rng.setStartBefore(span); - domUtils.remove(span); - var result = findTextBlockElm(startBlockNode, currentIndex, opt); - if (result) { - var rngStart = findNTextInBlockElm(result.node, result.index, searchStr); - var rngEnd = findNTextInBlockElm( - result.node, - result.index + searchStr.length, - searchStr - ); - rng - .setStart(rngStart.node, rngStart.index) - .setEnd(rngEnd.node, rngEnd.index); - - if (opt.replaceStr !== undefined) { - replaceText(rng, opt.replaceStr); - } - rng.select(); - return true; - } else { - rng.setCursor(); - } - } - function replaceText(rng, str) { - str = me.document.createTextNode(str); - rng.deleteContents().insertNode(str); - } - return { - commands: { - searchreplace: { - execCommand: function(cmdName, opt) { - utils.extend( - opt, - { - all: false, - casesensitive: false, - dir: 1 - }, - true - ); - var num = 0; - if (opt.all) { - lastRng = null; - var rng = me.selection.getRange(), - first = me.body.firstChild; - if (first && first.nodeType == 1) { - rng.setStart(first, 0); - rng.shrinkBoundary(true); - } else if (first.nodeType == 3) { - rng.setStartBefore(first); - } - rng.collapse(true).select(true); - if (opt.replaceStr !== undefined) { - me.fireEvent("saveScene"); - } - while (searchReplace(this, opt)) { - num++; - lastRng = me.selection.getRange(); - lastRng.collapse(opt.dir == -1); - } - if (num) { - me.fireEvent("saveScene"); - } - } else { - if (opt.replaceStr !== undefined) { - me.fireEvent("saveScene"); - } - if (searchReplace(this, opt)) { - num++; - lastRng = me.selection.getRange(); - lastRng.collapse(opt.dir == -1); - } - if (num) { - me.fireEvent("saveScene"); - } - } - - return num; - }, - notNeedUndo: 1 - } - }, - bindEvents: { - clearlastSearchResult: function() { - lastRng = null; - } - } - }; -}); - - -// plugins/customstyle.js -/** - * 自定义样式 - * @file - * @since 1.2.6.1 - */ - -/** - * 根据config配置文件里“customstyle”选项的值对匹配的标签执行样式替换。 - * @command customstyle - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'customstyle' ); - * ``` - */ -UE.plugins["customstyle"] = function() { - var me = this; - me.setOpt({ - customstyle: [ - { - tag: "h1", - name: "tc", - style: - "font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;" - }, - { - tag: "h1", - name: "tl", - style: - "font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:left;margin:0 0 10px 0;" - }, - { - tag: "span", - name: "im", - style: - "font-size:16px;font-style:italic;font-weight:bold;line-height:18px;" - }, - { - tag: "span", - name: "hi", - style: - "font-size:16px;font-style:italic;font-weight:bold;color:rgb(51, 153, 204);line-height:18px;" - } - ] - }); - me.commands["customstyle"] = { - execCommand: function(cmdName, obj) { - var me = this, - tagName = obj.tag, - node = domUtils.findParent( - me.selection.getStart(), - function(node) { - return node.getAttribute("label"); - }, - true - ), - range, - bk, - tmpObj = {}; - for (var p in obj) { - if (obj[p] !== undefined) tmpObj[p] = obj[p]; - } - delete tmpObj.tag; - if (node && node.getAttribute("label") == obj.label) { - range = this.selection.getRange(); - bk = range.createBookmark(); - if (range.collapsed) { - //trace:1732 删掉自定义标签,要有p来回填站位 - if (dtd.$block[node.tagName]) { - var fillNode = me.document.createElement("p"); - domUtils.moveChild(node, fillNode); - node.parentNode.insertBefore(fillNode, node); - domUtils.remove(node); - } else { - domUtils.remove(node, true); - } - } else { - var common = domUtils.getCommonAncestor(bk.start, bk.end), - nodes = domUtils.getElementsByTagName(common, tagName); - if (new RegExp(tagName, "i").test(common.tagName)) { - nodes.push(common); - } - for (var i = 0, ni; (ni = nodes[i++]); ) { - if (ni.getAttribute("label") == obj.label) { - var ps = domUtils.getPosition(ni, bk.start), - pe = domUtils.getPosition(ni, bk.end); - if ( - (ps & domUtils.POSITION_FOLLOWING || - ps & domUtils.POSITION_CONTAINS) && - (pe & domUtils.POSITION_PRECEDING || - pe & domUtils.POSITION_CONTAINS) - ) - if (dtd.$block[tagName]) { - var fillNode = me.document.createElement("p"); - domUtils.moveChild(ni, fillNode); - ni.parentNode.insertBefore(fillNode, ni); - } - domUtils.remove(ni, true); - } - } - node = domUtils.findParent( - common, - function(node) { - return node.getAttribute("label") == obj.label; - }, - true - ); - if (node) { - domUtils.remove(node, true); - } - } - range.moveToBookmark(bk).select(); - } else { - if (dtd.$block[tagName]) { - this.execCommand("paragraph", tagName, tmpObj, "customstyle"); - range = me.selection.getRange(); - if (!range.collapsed) { - range.collapse(); - node = domUtils.findParent( - me.selection.getStart(), - function(node) { - return node.getAttribute("label") == obj.label; - }, - true - ); - var pNode = me.document.createElement("p"); - domUtils.insertAfter(node, pNode); - domUtils.fillNode(me.document, pNode); - range.setStart(pNode, 0).setCursor(); - } - } else { - range = me.selection.getRange(); - if (range.collapsed) { - node = me.document.createElement(tagName); - domUtils.setAttributes(node, tmpObj); - range.insertNode(node).setStart(node, 0).setCursor(); - - return; - } - - bk = range.createBookmark(); - range.applyInlineStyle(tagName, tmpObj).moveToBookmark(bk).select(); - } - } - }, - queryCommandValue: function() { - var parent = domUtils.filterNodeList( - this.selection.getStartElementPath(), - function(node) { - return node.getAttribute("label"); - } - ); - return parent ? parent.getAttribute("label") : ""; - } - }; - //当去掉customstyle是,如果是块元素,用p代替 - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - - if (keyCode == 32 || keyCode == 13) { - var range = me.selection.getRange(); - if (range.collapsed) { - var node = domUtils.findParent( - me.selection.getStart(), - function(node) { - return node.getAttribute("label"); - }, - true - ); - if (node && dtd.$block[node.tagName] && domUtils.isEmptyNode(node)) { - var p = me.document.createElement("p"); - domUtils.insertAfter(node, p); - domUtils.fillNode(me.document, p); - domUtils.remove(node); - range.setStart(p, 0).setCursor(); - } - } - } - }); -}; - - -// plugins/catchremoteimage.js -///import core -///commands 远程图片抓取 -///commandsName catchRemoteImage,catchremoteimageenable -///commandsTitle 远程图片抓取 -/** - * 远程图片抓取,当开启本插件时所有不符合本地域名的图片都将被抓取成为本地服务器上的图片 - */ -UE.plugins["catchremoteimage"] = function() { - var me = this, - ajax = UE.ajax; - - /* 设置默认值 */ - if (me.options.catchRemoteImageEnable === false) return; - me.setOpt({ - catchRemoteImageEnable: false - }); - - me.addListener("afterpaste", function() { - me.fireEvent("catchRemoteImage"); - }); - - me.addListener("catchRemoteImage", function() { - var catcherLocalDomain = me.getOpt("catcherLocalDomain"), - catcherActionUrl = me.getActionUrl(me.getOpt("catcherActionName")), - catcherUrlPrefix = me.getOpt("catcherUrlPrefix"), - catcherFieldName = me.getOpt("catcherFieldName"); - - var remoteImages = [], - loadingIMG = me.options.themePath + me.options.theme + '/images/spacer.gif', - imgs = me.document.querySelectorAll('[style*="url"],img'), - test = function(src, urls) { - if (src.indexOf(location.host) != -1 || /(^\.)|(^\/)/.test(src)) { - return true; - } - if (urls) { - for (var j = 0, url; (url = urls[j++]); ) { - if (src.indexOf(url) !== -1) { - return true; - } - } - } - return false; - }; - - for (var i = 0, ci; (ci = imgs[i++]); ) { - if (ci.getAttribute("word_img")) { - continue; - } - if(ci.nodeName == "IMG"){ - var src = ci.getAttribute("_src") || ci.src || ""; - if (/^(https?|ftp):/i.test(src) && !test(src, catcherLocalDomain)) { - remoteImages.push(src); - // 添加上传时的uploading动画 - domUtils.setAttributes(ci, { - class: "loadingclass", - _src: src, - src: loadingIMG - }) - } - } else { - // 获取背景图片url - var backgroundImageurl = ci.style.cssText.replace(/.*\s?url\([\'\"]?/, '').replace(/[\'\"]?\).*/, ''); - if (/^(https?|ftp):/i.test(backgroundImageurl) && !test(backgroundImageurl, catcherLocalDomain)) { - remoteImages.push(backgroundImageurl); - ci.style.cssText = ci.style.cssText.replace(backgroundImageurl, loadingIMG); - domUtils.setAttributes(ci, { - "data-background": backgroundImageurl - }) - } - } - } - - if (remoteImages.length) { - catchremoteimage(remoteImages, { - //成功抓取 - success: function(r) { - try { - var info = r.state !== undefined - ? r - : eval("(" + r.responseText + ")"); - } catch (e) { - return; - } - - /* 获取源路径和新路径 */ - var i, - j, - ci, - cj, - oldSrc, - newSrc, - list = info.list; - - /* 抓取失败统计 */ - var catchFailList = []; - /* 抓取成功统计 */ - var catchSuccessList = []; - /* 抓取失败时显示的图片 */ - var failIMG = me.options.themePath + me.options.theme + '/images/img-cracked.png'; - - for (i = 0; ci = imgs[i++];) { - oldSrc = ci.getAttribute("_src") || ci.src || ""; - oldBgIMG = ci.getAttribute("data-background") || ""; - for (j = 0; cj = list[j++];) { - if (oldSrc == cj.source && cj.state == "SUCCESS") { - newSrc = catcherUrlPrefix + cj.url; - // 上传成功是删除uploading动画 - domUtils.removeClasses( ci, "loadingclass" ); - domUtils.setAttributes(ci, { - "src": newSrc, - "_src": newSrc, - "data-catchResult":"img_catchSuccess" // 添加catch成功标记 - }); - catchSuccessList.push(ci); - break; - } else if (oldSrc == cj.source && cj.state == "FAIL") { - // 替换成统一的失败图片 - domUtils.removeClasses( ci, "loadingclass" ); - domUtils.setAttributes(ci, { - "src": failIMG, - "_src": failIMG, - "data-catchResult":"img_catchFail" // 添加catch失败标记 - }); - catchFailList.push(ci); - break; - } else if (oldBgIMG == cj.source && cj.state == "SUCCESS") { - newBgIMG = catcherUrlPrefix + cj.url; - ci.style.cssText = ci.style.cssText.replace(loadingIMG, newBgIMG); - domUtils.removeAttributes(ci,"data-background"); - domUtils.setAttributes(ci, { - "data-catchResult":"img_catchSuccess" // 添加catch成功标记 - }); - catchSuccessList.push(ci); - break; - } else if (oldBgIMG == cj.source && cj.state == "FAIL"){ - ci.style.cssText = ci.style.cssText.replace(loadingIMG, failIMG); - domUtils.removeAttributes(ci,"data-background"); - domUtils.setAttributes(ci, { - "data-catchResult":"img_catchFail" // 添加catch失败标记 - }); - catchFailList.push(ci); - break; - } - } - - } - // 监听事件添加成功抓取和抓取失败的dom列表参数 - me.fireEvent('catchremotesuccess',catchSuccessList,catchFailList); - }, - //回调失败,本次请求超时 - error: function() { - me.fireEvent("catchremoteerror"); - } - }); - } - - function catchremoteimage(imgs, callbacks) { - var params = - utils.serializeParam(me.queryCommandValue("serverparam")) || "", - url = utils.formatUrl( - catcherActionUrl + - (catcherActionUrl.indexOf("?") == -1 ? "?" : "&") + - params - ), - isJsonp = utils.isCrossDomainUrl(url), - opt = { - method: "POST", - dataType: isJsonp ? "jsonp" : "", - timeout: 60000, //单位:毫秒,回调请求超时设置。目标用户如果网速不是很快的话此处建议设置一个较大的数值 - onsuccess: callbacks["success"], - onerror: callbacks["error"] - }; - opt[catcherFieldName] = imgs; - ajax.request(url, opt); - } - }); -}; - - -// plugins/snapscreen.js -/** - * 截屏插件,为UEditor提供插入支持 - * @file - * @since 1.4.2 - */ -UE.plugin.register("snapscreen", function() { - var me = this; - var snapplugin; - - function getLocation(url) { - var search, - a = document.createElement("a"), - params = utils.serializeParam(me.queryCommandValue("serverparam")) || ""; - - a.href = url; - if (browser.ie) { - a.href = a.href; - } - - search = a.search; - if (params) { - search = search + (search.indexOf("?") == -1 ? "?" : "&") + params; - search = search.replace(/[&]+/gi, "&"); - } - return { - port: a.port, - hostname: a.hostname, - path: a.pathname + search || +a.hash - }; - } - - return { - commands: { - /** - * 字体背景颜色 - * @command snapscreen - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand('snapscreen'); - * ``` - */ - snapscreen: { - execCommand: function(cmd) { - var url, local, res; - var lang = me.getLang("snapScreen_plugin"); - - if (!snapplugin) { - var container = me.container; - var doc = me.container.ownerDocument || me.container.document; - snapplugin = doc.createElement("object"); - try { - snapplugin.type = "application/x-pluginbaidusnap"; - } catch (e) { - return; - } - snapplugin.style.cssText = - "position:absolute;left:-9999px;width:0;height:0;"; - snapplugin.setAttribute("width", "0"); - snapplugin.setAttribute("height", "0"); - container.appendChild(snapplugin); - } - - function onSuccess(rs) { - try { - rs = eval("(" + rs + ")"); - if (rs.state == "SUCCESS") { - var opt = me.options; - me.execCommand("insertimage", { - src: opt.snapscreenUrlPrefix + rs.url, - _src: opt.snapscreenUrlPrefix + rs.url, - alt: rs.title || "", - floatStyle: opt.snapscreenImgAlign - }); - } else { - alert(rs.state); - } - } catch (e) { - alert(lang.callBackErrorMsg); - } - } - url = me.getActionUrl(me.getOpt("snapscreenActionName")); - local = getLocation(url); - setTimeout(function() { - try { - res = snapplugin.saveSnapshot( - local.hostname, - local.path, - local.port - ); - } catch (e) { - me.ui._dialogs["snapscreenDialog"].open(); - return; - } - - onSuccess(res); - }, 50); - }, - queryCommandState: function() { - return navigator.userAgent.indexOf("Windows", 0) != -1 ? 0 : -1; - } - } - } - }; -}); - - -// plugins/insertparagraph.js -/** - * 插入段落 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入段落 - * @command insertparagraph - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * //editor是编辑器实例 - * editor.execCommand( 'insertparagraph' ); - * ``` - */ - -UE.commands["insertparagraph"] = { - execCommand: function(cmdName, front) { - var me = this, - range = me.selection.getRange(), - start = range.startContainer, - tmpNode; - while (start) { - if (domUtils.isBody(start)) { - break; - } - tmpNode = start; - start = start.parentNode; - } - if (tmpNode) { - var p = me.document.createElement("p"); - if (front) { - tmpNode.parentNode.insertBefore(p, tmpNode); - } else { - tmpNode.parentNode.insertBefore(p, tmpNode.nextSibling); - } - domUtils.fillNode(me.document, p); - range.setStart(p, 0).setCursor(false, true); - } - } -}; - - -// plugins/webapp.js -/** - * 百度应用 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入百度应用 - * @command webapp - * @method execCommand - * @remind 需要百度APPKey - * @remind 百度应用主页: http://app.baidu.com/ - * @param { Object } appOptions 应用所需的参数项, 支持的key有: title=>应用标题, width=>应用容器宽度, - * height=>应用容器高度,logo=>应用logo,url=>应用地址 - * @example - * ```javascript - * //editor是编辑器实例 - * //在编辑器里插入一个“植物大战僵尸”的APP - * editor.execCommand( 'webapp' , { - * title: '植物大战僵尸', - * width: 560, - * height: 465, - * logo: '应用展示的图片', - * url: '百度应用的地址' - * } ); - * ``` - */ - -//UE.plugins['webapp'] = function () { -// var me = this; -// function createInsertStr( obj, toIframe, addParagraph ) { -// return !toIframe ? -// (addParagraph ? '

                      ' : '') + '' + -// (addParagraph ? '

                      ' : '') -// : -// ''; -// } -// -// function switchImgAndIframe( img2frame ) { -// var tmpdiv, -// nodes = domUtils.getElementsByTagName( me.document, !img2frame ? "iframe" : "img" ); -// for ( var i = 0, node; node = nodes[i++]; ) { -// if ( node.className != "edui-faked-webapp" ){ -// continue; -// } -// tmpdiv = me.document.createElement( "div" ); -// tmpdiv.innerHTML = createInsertStr( img2frame ? {url:node.getAttribute( "_url" ), width:node.width, height:node.height,title:node.title,logo:node.style.backgroundImage.replace("url(","").replace(")","")} : {url:node.getAttribute( "src", 2 ),title:node.title, width:node.width, height:node.height,logo:node.getAttribute("logo_url")}, img2frame ? true : false,false ); -// node.parentNode.replaceChild( tmpdiv.firstChild, node ); -// } -// } -// -// me.addListener( "beforegetcontent", function () { -// switchImgAndIframe( true ); -// } ); -// me.addListener( 'aftersetcontent', function () { -// switchImgAndIframe( false ); -// } ); -// me.addListener( 'aftergetcontent', function ( cmdName ) { -// if ( cmdName == 'aftergetcontent' && me.queryCommandState( 'source' ) ){ -// return; -// } -// switchImgAndIframe( false ); -// } ); -// -// me.commands['webapp'] = { -// execCommand:function ( cmd, obj ) { -// me.execCommand( "inserthtml", createInsertStr( obj, false,true ) ); -// } -// }; -//}; - -UE.plugin.register("webapp", function() { - var me = this; - function createInsertStr(obj, toEmbed) { - return !toEmbed - ? '" - : ''; - } - return { - outputRule: function(root) { - utils.each(root.getNodesByTagName("img"), function(node) { - var html; - if (node.getAttr("class") == "edui-faked-webapp") { - html = createInsertStr( - { - title: node.getAttr("title"), - width: node.getAttr("width"), - height: node.getAttr("height"), - align: node.getAttr("align"), - cssfloat: node.getStyle("float"), - url: node.getAttr("_url"), - logo: node.getAttr("_logo_url") - }, - true - ); - var embed = UE.uNode.createElement(html); - node.parentNode.replaceChild(embed, node); - } - }); - }, - inputRule: function(root) { - utils.each(root.getNodesByTagName("iframe"), function(node) { - if (node.getAttr("class") == "edui-faked-webapp") { - var img = UE.uNode.createElement( - createInsertStr({ - title: node.getAttr("title"), - width: node.getAttr("width"), - height: node.getAttr("height"), - align: node.getAttr("align"), - cssfloat: node.getStyle("float"), - url: node.getAttr("src"), - logo: node.getAttr("logo_url") - }) - ); - node.parentNode.replaceChild(img, node); - } - }); - }, - commands: { - /** - * 插入百度应用 - * @command webapp - * @method execCommand - * @remind 需要百度APPKey - * @remind 百度应用主页: http://app.baidu.com/ - * @param { Object } appOptions 应用所需的参数项, 支持的key有: title=>应用标题, width=>应用容器宽度, - * height=>应用容器高度,logo=>应用logo,url=>应用地址 - * @example - * ```javascript - * //editor是编辑器实例 - * //在编辑器里插入一个“植物大战僵尸”的APP - * editor.execCommand( 'webapp' , { - * title: '植物大战僵尸', - * width: 560, - * height: 465, - * logo: '应用展示的图片', - * url: '百度应用的地址' - * } ); - * ``` - */ - webapp: { - execCommand: function(cmd, obj) { - var me = this, - str = createInsertStr( - utils.extend(obj, { - align: "none" - }), - false - ); - me.execCommand("inserthtml", str); - }, - queryCommandState: function() { - var me = this, - img = me.selection.getRange().getClosedNode(), - flag = img && img.className == "edui-faked-webapp"; - return flag ? 1 : 0; - } - } - } - }; -}); - - -// plugins/template.js -///import core -///import plugins\inserthtml.js -///import plugins\cleardoc.js -///commands 模板 -///commandsName template -///commandsTitle 模板 -///commandsDialog dialogs\template -UE.plugins["template"] = function() { - UE.commands["template"] = { - execCommand: function(cmd, obj) { - obj.html && this.execCommand("inserthtml", obj.html); - } - }; - this.addListener("click", function(type, evt) { - var el = evt.target || evt.srcElement, - range = this.selection.getRange(); - var tnode = domUtils.findParent( - el, - function(node) { - if (node.className && domUtils.hasClass(node, "ue_t")) { - return node; - } - }, - true - ); - tnode && range.selectNode(tnode).shrinkBoundary().select(); - }); - this.addListener("keydown", function(type, evt) { - var range = this.selection.getRange(); - if (!range.collapsed) { - if (!evt.ctrlKey && !evt.metaKey && !evt.shiftKey && !evt.altKey) { - var tnode = domUtils.findParent( - range.startContainer, - function(node) { - if (node.className && domUtils.hasClass(node, "ue_t")) { - return node; - } - }, - true - ); - if (tnode) { - domUtils.removeClasses(tnode, ["ue_t"]); - } - } - } - }); -}; - - -// plugins/music.js -/** - * 插入音乐命令 - * @file - */ -UE.plugin.register("music", function() { - var me = this; - function creatInsertStr(url, width, height, align, cssfloat, toEmbed) { - return !toEmbed - ? "' - : ''; - } - return { - outputRule: function(root) { - utils.each(root.getNodesByTagName("img"), function(node) { - var html; - if (node.getAttr("class") == "edui-faked-music") { - var cssfloat = node.getStyle("float"); - var align = node.getAttr("align"); - html = creatInsertStr( - node.getAttr("_url"), - node.getAttr("width"), - node.getAttr("height"), - align, - cssfloat, - true - ); - var embed = UE.uNode.createElement(html); - node.parentNode.replaceChild(embed, node); - } - }); - }, - inputRule: function(root) { - utils.each(root.getNodesByTagName("embed"), function(node) { - if (node.getAttr("class") == "edui-faked-music") { - var cssfloat = node.getStyle("float"); - var align = node.getAttr("align"); - html = creatInsertStr( - node.getAttr("src"), - node.getAttr("width"), - node.getAttr("height"), - align, - cssfloat, - false - ); - var img = UE.uNode.createElement(html); - node.parentNode.replaceChild(img, node); - } - }); - }, - commands: { - /** - * 插入音乐 - * @command music - * @method execCommand - * @param { Object } musicOptions 插入音乐的参数项, 支持的key有: url=>音乐地址; - * width=>音乐容器宽度;height=>音乐容器高度;align=>音乐文件的对齐方式, 可选值有: left, center, right, none - * @example - * ```javascript - * //editor是编辑器实例 - * //在编辑器里插入一个“植物大战僵尸”的APP - * editor.execCommand( 'music' , { - * width: 400, - * height: 95, - * align: "center", - * url: "音乐地址" - * } ); - * ``` - */ - music: { - execCommand: function(cmd, musicObj) { - var me = this, - str = creatInsertStr( - musicObj.url, - musicObj.width || 400, - musicObj.height || 95, - "none", - false - ); - me.execCommand("inserthtml", str); - }, - queryCommandState: function() { - var me = this, - img = me.selection.getRange().getClosedNode(), - flag = img && img.className == "edui-faked-music"; - return flag ? 1 : 0; - } - } - } - }; -}); - - -// plugins/autoupload.js -/** - * @description - * 1.拖放文件到编辑区域,自动上传并插入到选区 - * 2.插入粘贴板的图片,自动上传并插入到选区 - * @author Jinqn - * @date 2013-10-14 - */ -UE.plugin.register("autoupload", function() { - function sendAndInsertFile(file, editor) { - var me = editor; - //模拟数据 - var fieldName, - urlPrefix, - maxSize, - allowFiles, - actionUrl, - loadingHtml, - errorHandler, - successHandler, - filetype = /image\/\w+/i.test(file.type) ? "image" : "file", - loadingId = "loading_" + (+new Date()).toString(36); - - fieldName = me.getOpt(filetype + "FieldName"); - urlPrefix = me.getOpt(filetype + "UrlPrefix"); - maxSize = me.getOpt(filetype + "MaxSize"); - allowFiles = me.getOpt(filetype + "AllowFiles"); - actionUrl = me.getActionUrl(me.getOpt(filetype + "ActionName")); - errorHandler = function(title) { - var loader = me.document.getElementById(loadingId); - loader && domUtils.remove(loader); - me.fireEvent("showmessage", { - id: loadingId, - content: title, - type: "error", - timeout: 4000 - }); - }; - - if (filetype == "image") { - loadingHtml = - ''; - successHandler = function(data) { - var link = urlPrefix + data.url, - loader = me.document.getElementById(loadingId); - if (loader) { - domUtils.removeClasses(loader, "loadingclass"); - loader.setAttribute("src", link); - loader.setAttribute("_src", link); - loader.setAttribute("alt", data.original || ""); - loader.removeAttribute("id"); - me.trigger("contentchange", loader); - } - }; - } else { - loadingHtml = - "

                      " + - '' + - "

                      "; - successHandler = function(data) { - var link = urlPrefix + data.url, - loader = me.document.getElementById(loadingId); - - var rng = me.selection.getRange(), - bk = rng.createBookmark(); - rng.selectNode(loader).select(); - me.execCommand("insertfile", { url: link }); - rng.moveToBookmark(bk).select(); - }; - } - - /* 插入loading的占位符 */ - me.execCommand("inserthtml", loadingHtml); - /* 判断后端配置是否没有加载成功 */ - if (!me.getOpt(filetype + "ActionName")) { - errorHandler(me.getLang("autoupload.errorLoadConfig")); - return; - } - /* 判断文件大小是否超出限制 */ - if (file.size > maxSize) { - errorHandler(me.getLang("autoupload.exceedSizeError")); - return; - } - /* 判断文件格式是否超出允许 */ - var fileext = file.name ? file.name.substr(file.name.lastIndexOf(".")) : ""; - if ( - (fileext && filetype != "image") || - (allowFiles && - (allowFiles.join("") + ".").indexOf(fileext.toLowerCase() + ".") == -1) - ) { - errorHandler(me.getLang("autoupload.exceedTypeError")); - return; - } - - /* 创建Ajax并提交 */ - var xhr = new XMLHttpRequest(), - fd = new FormData(), - params = utils.serializeParam(me.queryCommandValue("serverparam")) || "", - url = utils.formatUrl( - actionUrl + (actionUrl.indexOf("?") == -1 ? "?" : "&") + params - ); - - fd.append( - fieldName, - file, - file.name || "blob." + file.type.substr("image/".length) - ); - fd.append("type", "ajax"); - xhr.open("post", url, true); - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - xhr.addEventListener("load", function(e) { - try { - var json = new Function("return " + utils.trim(e.target.response))(); - if (json.state == "SUCCESS" && json.url) { - successHandler(json); - } else { - errorHandler(json.state); - } - } catch (er) { - errorHandler(me.getLang("autoupload.loadError")); - } - }); - xhr.send(fd); - } - - function getPasteImage(e) { - return e.clipboardData && - e.clipboardData.items && - e.clipboardData.items.length == 1 && - /^image\//.test(e.clipboardData.items[0].type) - ? e.clipboardData.items - : null; - } - function getDropImage(e) { - return e.dataTransfer && e.dataTransfer.files ? e.dataTransfer.files : null; - } - - return { - outputRule: function(root) { - utils.each(root.getNodesByTagName("img"), function(n) { - if (/\b(loaderrorclass)|(bloaderrorclass)\b/.test(n.getAttr("class"))) { - n.parentNode.removeChild(n); - } - }); - utils.each(root.getNodesByTagName("p"), function(n) { - if (/\bloadpara\b/.test(n.getAttr("class"))) { - n.parentNode.removeChild(n); - } - }); - }, - bindEvents: { - defaultOptions: { - //默认间隔时间 - enableDragUpload: true, - enablePasteUpload: true - }, - //插入粘贴板的图片,拖放插入图片 - ready: function(e) { - var me = this; - if (window.FormData && window.FileReader) { - var handler = function(e) { - var hasImg = false, - items; - //获取粘贴板文件列表或者拖放文件列表 - items = e.type == "paste" ? getPasteImage(e) : getDropImage(e); - if (items) { - var len = items.length, - file; - while (len--) { - file = items[len]; - if (file.getAsFile) file = file.getAsFile(); - if (file && file.size > 0) { - sendAndInsertFile(file, me); - hasImg = true; - } - } - hasImg && e.preventDefault(); - } - }; - - if (me.getOpt("enablePasteUpload") !== false) { - domUtils.on(me.body, "paste ", handler); - } - if (me.getOpt("enableDragUpload") !== false) { - domUtils.on(me.body, "drop", handler); - //取消拖放图片时出现的文字光标位置提示 - domUtils.on(me.body, "dragover", function(e) { - if (e.dataTransfer.types[0] == "Files") { - e.preventDefault(); - } - }); - } else { - if (browser.gecko) { - domUtils.on(me.body, "drop", function(e) { - if (getDropImage(e)) { - e.preventDefault(); - } - }); - } - } - - //设置loading的样式 - utils.cssRule( - "loading", - ".loadingclass{display:inline-block;cursor:default;background: url('" + - this.options.themePath + - this.options.theme + - "/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-left:1px;height: 22px;width: 22px;}\n" + - ".loaderrorclass{display:inline-block;cursor:default;background: url('" + - this.options.themePath + - this.options.theme + - "/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;" + - "}", - this.document - ); - } - } - } - }; -}); - - -// plugins/autosave.js -UE.plugin.register("autosave", function() { - var me = this, - //无限循环保护 - lastSaveTime = new Date(), - //最小保存间隔时间 - MIN_TIME = 20, - //auto save key - saveKey = null; - - function save(editor) { - var saveData; - - if (new Date() - lastSaveTime < MIN_TIME) { - return; - } - - if (!editor.hasContents()) { - //这里不能调用命令来删除, 会造成事件死循环 - saveKey && me.removePreferences(saveKey); - return; - } - - lastSaveTime = new Date(); - - editor._saveFlag = null; - - saveData = me.body.innerHTML; - - if ( - editor.fireEvent("beforeautosave", { - content: saveData - }) === false - ) { - return; - } - - me.setPreferences(saveKey, saveData); - - editor.fireEvent("afterautosave", { - content: saveData - }); - } - - return { - defaultOptions: { - //默认间隔时间 - saveInterval: 500, - enableAutoSave: true - }, - bindEvents: { - ready: function() { - var _suffix = "-drafts-data", - key = null; - - if (me.key) { - key = me.key + _suffix; - } else { - key = (me.container.parentNode.id || "ue-common") + _suffix; - } - - //页面地址+编辑器ID 保持唯一 - saveKey = - (location.protocol + location.host + location.pathname).replace( - /[.:\/]/g, - "_" - ) + key; - }, - - contentchange: function() { - if (!me.getOpt("enableAutoSave")) { - return; - } - - if (!saveKey) { - return; - } - - if (me._saveFlag) { - window.clearTimeout(me._saveFlag); - } - - if (me.options.saveInterval > 0) { - me._saveFlag = window.setTimeout(function() { - save(me); - }, me.options.saveInterval); - } else { - save(me); - } - } - }, - commands: { - clearlocaldata: { - execCommand: function(cmd, name) { - if (saveKey && me.getPreferences(saveKey)) { - me.removePreferences(saveKey); - } - }, - notNeedUndo: true, - ignoreContentChange: true - }, - - getlocaldata: { - execCommand: function(cmd, name) { - return saveKey ? me.getPreferences(saveKey) || "" : ""; - }, - notNeedUndo: true, - ignoreContentChange: true - }, - - drafts: { - execCommand: function(cmd, name) { - if (saveKey) { - window.setTimeout(function(){ - me.body.innerHTML = - me.getPreferences(saveKey) || "

                      " + domUtils.fillHtml + "

                      "; - // me.focus(true); - }, 0); - } - }, - queryCommandState: function() { - return saveKey ? (me.getPreferences(saveKey) === null ? -1 : 0) : -1; - }, - notNeedUndo: true, - ignoreContentChange: true - } - } - }; -}); - - -// plugins/charts.js -UE.plugin.register("charts", function() { - var me = this; - - return { - bindEvents: { - chartserror: function() {} - }, - commands: { - charts: { - execCommand: function(cmd, data) { - var tableNode = domUtils.findParentByTagName( - this.selection.getRange().startContainer, - "table", - true - ), - flagText = [], - config = {}; - - if (!tableNode) { - return false; - } - - if (!validData(tableNode)) { - me.fireEvent("chartserror"); - return false; - } - - config.title = data.title || ""; - config.subTitle = data.subTitle || ""; - config.xTitle = data.xTitle || ""; - config.yTitle = data.yTitle || ""; - config.suffix = data.suffix || ""; - config.tip = data.tip || ""; - //数据对齐方式 - config.dataFormat = data.tableDataFormat || ""; - //图表类型 - config.chartType = data.chartType || 0; - - for (var key in config) { - if (!config.hasOwnProperty(key)) { - continue; - } - - flagText.push(key + ":" + config[key]); - } - - tableNode.setAttribute("data-chart", flagText.join(";")); - domUtils.addClass(tableNode, "edui-charts-table"); - }, - queryCommandState: function(cmd, name) { - var tableNode = domUtils.findParentByTagName( - this.selection.getRange().startContainer, - "table", - true - ); - return tableNode && validData(tableNode) ? 0 : -1; - } - } - }, - inputRule: function(root) { - utils.each(root.getNodesByTagName("table"), function(tableNode) { - if (tableNode.getAttr("data-chart") !== undefined) { - tableNode.setAttr("style"); - } - }); - }, - outputRule: function(root) { - utils.each(root.getNodesByTagName("table"), function(tableNode) { - if (tableNode.getAttr("data-chart") !== undefined) { - tableNode.setAttr("style", "display: none;"); - } - }); - } - }; - - function validData(table) { - var firstRows = null, - cellCount = 0; - - //行数不够 - if (table.rows.length < 2) { - return false; - } - - //列数不够 - if (table.rows[0].cells.length < 2) { - return false; - } - - //第一行所有cell必须是th - firstRows = table.rows[0].cells; - cellCount = firstRows.length; - - for (var i = 0, cell; (cell = firstRows[i]); i++) { - if (cell.tagName.toLowerCase() !== "th") { - return false; - } - } - - for (var i = 1, row; (row = table.rows[i]); i++) { - //每行单元格数不匹配, 返回false - if (row.cells.length != cellCount) { - return false; - } - - //第一列不是th也返回false - if (row.cells[0].tagName.toLowerCase() !== "th") { - return false; - } - - for (var j = 1, cell; (cell = row.cells[j]); j++) { - var value = utils.trim(cell.innerText || cell.textContent || ""); - - value = value - .replace(new RegExp(UE.dom.domUtils.fillChar, "g"), "") - .replace(/^\s+|\s+$/g, ""); - - //必须是数字 - if (!/^\d*\.?\d+$/.test(value)) { - return false; - } - } - } - - return true; - } -}); - - -// plugins/section.js -/** - * 目录大纲支持插件 - * @file - * @since 1.3.0 - */ -UE.plugin.register("section", function() { - /* 目录节点对象 */ - function Section(option) { - this.tag = ""; - (this.level = -1), (this.dom = null); - this.nextSection = null; - this.previousSection = null; - this.parentSection = null; - this.startAddress = []; - this.endAddress = []; - this.children = []; - } - function getSection(option) { - var section = new Section(); - return utils.extend(section, option); - } - function getNodeFromAddress(startAddress, root) { - var current = root; - for (var i = 0; i < startAddress.length; i++) { - if (!current.childNodes) return null; - current = current.childNodes[startAddress[i]]; - } - return current; - } - - var me = this; - - return { - bindMultiEvents: { - type: "aftersetcontent afterscencerestore", - handler: function() { - me.fireEvent("updateSections"); - } - }, - bindEvents: { - /* 初始化、拖拽、粘贴、执行setcontent之后 */ - ready: function() { - me.fireEvent("updateSections"); - domUtils.on(me.body, "drop paste", function() { - me.fireEvent("updateSections"); - }); - }, - /* 执行paragraph命令之后 */ - afterexeccommand: function(type, cmd) { - if (cmd == "paragraph") { - me.fireEvent("updateSections"); - } - }, - /* 部分键盘操作,触发updateSections事件 */ - keyup: function(type, e) { - var me = this, - range = me.selection.getRange(); - if (range.collapsed != true) { - me.fireEvent("updateSections"); - } else { - var keyCode = e.keyCode || e.which; - if (keyCode == 13 || keyCode == 8 || keyCode == 46) { - me.fireEvent("updateSections"); - } - } - } - }, - commands: { - getsections: { - execCommand: function(cmd, levels) { - var levelFn = levels || ["h1", "h2", "h3", "h4", "h5", "h6"]; - - for (var i = 0; i < levelFn.length; i++) { - if (typeof levelFn[i] == "string") { - levelFn[i] = (function(fn) { - return function(node) { - return node.tagName == fn.toUpperCase(); - }; - })(levelFn[i]); - } else if (typeof levelFn[i] != "function") { - levelFn[i] = function(node) { - return null; - }; - } - } - function getSectionLevel(node) { - for (var i = 0; i < levelFn.length; i++) { - if (levelFn[i](node)) return i; - } - return -1; - } - - var me = this, - Directory = getSection({ level: -1, title: "root" }), - previous = Directory; - - function traversal(node, Directory) { - var level, - tmpSection = null, - parent, - child, - children = node.childNodes; - for (var i = 0, len = children.length; i < len; i++) { - child = children[i]; - level = getSectionLevel(child); - if (level >= 0) { - var address = me.selection - .getRange() - .selectNode(child) - .createAddress(true).startAddress, - current = getSection({ - tag: child.tagName, - title: child.innerText || child.textContent || "", - level: level, - dom: child, - startAddress: utils.clone(address, []), - endAddress: utils.clone(address, []), - children: [] - }); - previous.nextSection = current; - current.previousSection = previous; - parent = previous; - while (level <= parent.level) { - parent = parent.parentSection; - } - current.parentSection = parent; - parent.children.push(current); - tmpSection = previous = current; - } else { - child.nodeType === 1 && traversal(child, Directory); - tmpSection && - tmpSection.endAddress[tmpSection.endAddress.length - 1]++; - } - } - } - traversal(me.body, Directory); - return Directory; - }, - notNeedUndo: true - }, - movesection: { - execCommand: function(cmd, sourceSection, targetSection, isAfter) { - var me = this, - targetAddress, - target; - - if (!sourceSection || !targetSection || targetSection.level == -1) - return; - - targetAddress = isAfter - ? targetSection.endAddress - : targetSection.startAddress; - target = getNodeFromAddress(targetAddress, me.body); - - /* 判断目标地址是否被源章节包含 */ - if ( - !targetAddress || - !target || - isContainsAddress( - sourceSection.startAddress, - sourceSection.endAddress, - targetAddress - ) - ) - return; - - var startNode = getNodeFromAddress( - sourceSection.startAddress, - me.body - ), - endNode = getNodeFromAddress(sourceSection.endAddress, me.body), - current, - nextNode; - - if (isAfter) { - current = endNode; - while ( - current && - !( - domUtils.getPosition(startNode, current) & - domUtils.POSITION_FOLLOWING - ) - ) { - nextNode = current.previousSibling; - domUtils.insertAfter(target, current); - if (current == startNode) break; - current = nextNode; - } - } else { - current = startNode; - while ( - current && - !( - domUtils.getPosition(current, endNode) & - domUtils.POSITION_FOLLOWING - ) - ) { - nextNode = current.nextSibling; - target.parentNode.insertBefore(current, target); - if (current == endNode) break; - current = nextNode; - } - } - - me.fireEvent("updateSections"); - - /* 获取地址的包含关系 */ - function isContainsAddress(startAddress, endAddress, addressTarget) { - var isAfterStartAddress = false, - isBeforeEndAddress = false; - for (var i = 0; i < startAddress.length; i++) { - if (i >= addressTarget.length) break; - if (addressTarget[i] > startAddress[i]) { - isAfterStartAddress = true; - break; - } else if (addressTarget[i] < startAddress[i]) { - break; - } - } - for (var i = 0; i < endAddress.length; i++) { - if (i >= addressTarget.length) break; - if (addressTarget[i] < startAddress[i]) { - isBeforeEndAddress = true; - break; - } else if (addressTarget[i] > startAddress[i]) { - break; - } - } - return isAfterStartAddress && isBeforeEndAddress; - } - } - }, - deletesection: { - execCommand: function(cmd, section, keepChildren) { - var me = this; - - if (!section) return; - - function getNodeFromAddress(startAddress) { - var current = me.body; - for (var i = 0; i < startAddress.length; i++) { - if (!current.childNodes) return null; - current = current.childNodes[startAddress[i]]; - } - return current; - } - - var startNode = getNodeFromAddress(section.startAddress), - endNode = getNodeFromAddress(section.endAddress), - current = startNode, - nextNode; - - if (!keepChildren) { - while ( - current && - domUtils.inDoc(endNode, me.document) && - !( - domUtils.getPosition(current, endNode) & - domUtils.POSITION_FOLLOWING - ) - ) { - nextNode = current.nextSibling; - domUtils.remove(current); - current = nextNode; - } - } else { - domUtils.remove(current); - } - - me.fireEvent("updateSections"); - } - }, - selectsection: { - execCommand: function(cmd, section) { - if (!section && !section.dom) return false; - var me = this, - range = me.selection.getRange(), - address = { - startAddress: utils.clone(section.startAddress, []), - endAddress: utils.clone(section.endAddress, []) - }; - address.endAddress[address.endAddress.length - 1]++; - range.moveToAddress(address).select().scrollToView(); - return true; - }, - notNeedUndo: true - }, - scrolltosection: { - execCommand: function(cmd, section) { - if (!section && !section.dom) return false; - var me = this, - range = me.selection.getRange(), - address = { - startAddress: section.startAddress, - endAddress: section.endAddress - }; - address.endAddress[address.endAddress.length - 1]++; - range.moveToAddress(address).scrollToView(); - return true; - }, - notNeedUndo: true - } - } - }; -}); - - -// plugins/simpleupload.js -/** - * @description - * 简单上传:点击按钮,直接选择文件上传 - * @author Jinqn - * @date 2014-03-31 - */ -UE.plugin.register("simpleupload", function() { - var me = this, - isLoaded = false, - containerBtn; - - function initUploadBtn() { - var w = containerBtn.offsetWidth || 20, - h = containerBtn.offsetHeight || 20, - btnIframe = document.createElement("iframe"), - btnStyle = - "display:block;width:" + - w + - "px;height:" + - h + - "px;overflow:hidden;border:0;margin:0;padding:0;position:absolute;top:0;left:0;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;cursor:pointer;"; - - domUtils.on(btnIframe, "load", function() { - var timestrap = (+new Date()).toString(36), - wrapper, - btnIframeDoc, - btnIframeBody; - - btnIframeDoc = - btnIframe.contentDocument || btnIframe.contentWindow.document; - btnIframeBody = btnIframeDoc.body; - wrapper = btnIframeDoc.createElement("div"); - - wrapper.innerHTML = - '
                      ' + - '' + - "
                      " + - ''; - - wrapper.className = "edui-" + me.options.theme; - wrapper.id = me.ui.id + "_iframeupload"; - btnIframeBody.style.cssText = btnStyle; - btnIframeBody.style.width = w + "px"; - btnIframeBody.style.height = h + "px"; - btnIframeBody.appendChild(wrapper); - - if (btnIframeBody.parentNode) { - btnIframeBody.parentNode.style.width = w + "px"; - btnIframeBody.parentNode.style.height = w + "px"; - } - - var form = btnIframeDoc.getElementById("edui_form_" + timestrap); - var input = btnIframeDoc.getElementById("edui_input_" + timestrap); - var iframe = btnIframeDoc.getElementById("edui_iframe_" + timestrap); - - domUtils.on(input, "change", function() { - if (!input.value) return; - var loadingId = "loading_" + (+new Date()).toString(36); - var params = - utils.serializeParam(me.queryCommandValue("serverparam")) || ""; - - var imageActionUrl = me.getActionUrl(me.getOpt("imageActionName")); - var allowFiles = me.getOpt("imageAllowFiles"); - - me.focus(); - me.execCommand( - "inserthtml", - '' - ); - - function callback() { - try { - var link, - json, - loader, - body = (iframe.contentDocument || iframe.contentWindow.document) - .body, - result = body.innerText || body.textContent || ""; - json = new Function("return " + result)(); - link = me.options.imageUrlPrefix + json.url; - if (json.state == "SUCCESS" && json.url) { - loader = me.document.getElementById(loadingId); - domUtils.removeClasses(loader, "loadingclass"); - domUtils.on(loader,'load',function(){ - me.fireEvent('contentchange'); - }); - loader.setAttribute("src", link); - loader.setAttribute("_src", link); - loader.setAttribute("alt", json.original || ""); - loader.removeAttribute("id"); - } else { - showErrorLoader && showErrorLoader(json.state); - } - } catch (er) { - showErrorLoader && - showErrorLoader(me.getLang("simpleupload.loadError")); - } - form.reset(); - domUtils.un(iframe, "load", callback); - } - function showErrorLoader(title) { - if (loadingId) { - var loader = me.document.getElementById(loadingId); - loader && domUtils.remove(loader); - me.fireEvent("showmessage", { - id: loadingId, - content: title, - type: "error", - timeout: 4000 - }); - } - } - - /* 判断后端配置是否没有加载成功 */ - if (!me.getOpt("imageActionName")) { - errorHandler(me.getLang("autoupload.errorLoadConfig")); - return; - } - // 判断文件格式是否错误 - var filename = input.value, - fileext = filename ? filename.substr(filename.lastIndexOf(".")) : ""; - if ( - !fileext || - (allowFiles && - (allowFiles.join("") + ".").indexOf(fileext.toLowerCase() + ".") == - -1) - ) { - showErrorLoader(me.getLang("simpleupload.exceedTypeError")); - return; - } - - domUtils.on(iframe, "load", callback); - form.action = utils.formatUrl( - imageActionUrl + - (imageActionUrl.indexOf("?") == -1 ? "?" : "&") + - params - ); - form.submit(); - }); - - var stateTimer; - me.addListener("selectionchange", function() { - clearTimeout(stateTimer); - stateTimer = setTimeout(function() { - var state = me.queryCommandState("simpleupload"); - if (state == -1) { - input.disabled = "disabled"; - } else { - input.disabled = false; - } - }, 400); - }); - isLoaded = true; - }); - - btnIframe.style.cssText = btnStyle; - containerBtn.appendChild(btnIframe); - } - - return { - bindEvents: { - ready: function() { - //设置loading的样式 - utils.cssRule( - "loading", - ".loadingclass{display:inline-block;cursor:default;background: url('" + - this.options.themePath + - this.options.theme + - "/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}\n" + - ".loaderrorclass{display:inline-block;cursor:default;background: url('" + - this.options.themePath + - this.options.theme + - "/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;" + - "}", - this.document - ); - }, - /* 初始化简单上传按钮 */ - simpleuploadbtnready: function(type, container) { - containerBtn = container; - me.afterConfigReady(initUploadBtn); - } - }, - outputRule: function(root) { - utils.each(root.getNodesByTagName("img"), function(n) { - if (/\b(loaderrorclass)|(bloaderrorclass)\b/.test(n.getAttr("class"))) { - n.parentNode.removeChild(n); - } - }); - }, - commands: { - simpleupload: { - queryCommandState: function() { - return isLoaded ? 0 : -1; - } - } - } - }; -}); - - -// plugins/serverparam.js -/** - * 服务器提交的额外参数列表设置插件 - * @file - * @since 1.2.6.1 - */ -UE.plugin.register("serverparam", function() { - var me = this, - serverParam = {}; - - return { - commands: { - /** - * 修改服务器提交的额外参数列表,清除所有项 - * @command serverparam - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand('serverparam'); - * editor.queryCommandValue('serverparam'); //返回空 - * ``` - */ - /** - * 修改服务器提交的额外参数列表,删除指定项 - * @command serverparam - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } key 要清除的属性 - * @example - * ```javascript - * editor.execCommand('serverparam', 'name'); //删除属性name - * ``` - */ - /** - * 修改服务器提交的额外参数列表,使用键值添加项 - * @command serverparam - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } key 要添加的属性 - * @param { String } value 要添加属性的值 - * @example - * ```javascript - * editor.execCommand('serverparam', 'name', 'hello'); - * editor.queryCommandValue('serverparam'); //返回对象 {'name': 'hello'} - * ``` - */ - /** - * 修改服务器提交的额外参数列表,传入键值对对象添加多项 - * @command serverparam - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Object } key 传入的键值对对象 - * @example - * ```javascript - * editor.execCommand('serverparam', {'name': 'hello'}); - * editor.queryCommandValue('serverparam'); //返回对象 {'name': 'hello'} - * ``` - */ - /** - * 修改服务器提交的额外参数列表,使用自定义函数添加多项 - * @command serverparam - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Function } key 自定义获取参数的函数 - * @example - * ```javascript - * editor.execCommand('serverparam', function(editor){ - * return {'key': 'value'}; - * }); - * editor.queryCommandValue('serverparam'); //返回对象 {'key': 'value'} - * ``` - */ - - /** - * 获取服务器提交的额外参数列表 - * @command serverparam - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.queryCommandValue( 'serverparam' ); //返回对象 {'key': 'value'} - * ``` - */ - serverparam: { - execCommand: function(cmd, key, value) { - if (key === undefined || key === null) { - //不传参数,清空列表 - serverParam = {}; - } else if (utils.isString(key)) { - //传入键值 - if (value === undefined || value === null) { - delete serverParam[key]; - } else { - serverParam[key] = value; - } - } else if (utils.isObject(key)) { - //传入对象,覆盖列表项 - utils.extend(serverParam, key, false); - } else if (utils.isFunction(key)) { - //传入函数,添加列表项 - utils.extend(serverParam, key(), false); - } - }, - queryCommandValue: function() { - return serverParam || {}; - } - } - } - }; -}); - - -// plugins/insertfile.js -/** - * 插入附件 - */ -UE.plugin.register("insertfile", function() { - var me = this; - - function getFileIcon(url) { - var ext = url.substr(url.lastIndexOf(".") + 1).toLowerCase(), - maps = { - rar: "icon_rar.gif", - zip: "icon_rar.gif", - tar: "icon_rar.gif", - gz: "icon_rar.gif", - bz2: "icon_rar.gif", - doc: "icon_doc.gif", - docx: "icon_doc.gif", - pdf: "icon_pdf.gif", - mp3: "icon_mp3.gif", - xls: "icon_xls.gif", - chm: "icon_chm.gif", - ppt: "icon_ppt.gif", - pptx: "icon_ppt.gif", - avi: "icon_mv.gif", - rmvb: "icon_mv.gif", - wmv: "icon_mv.gif", - flv: "icon_mv.gif", - swf: "icon_mv.gif", - rm: "icon_mv.gif", - exe: "icon_exe.gif", - psd: "icon_psd.gif", - txt: "icon_txt.gif", - jpg: "icon_jpg.gif", - png: "icon_jpg.gif", - jpeg: "icon_jpg.gif", - gif: "icon_jpg.gif", - ico: "icon_jpg.gif", - bmp: "icon_jpg.gif" - }; - return maps[ext] ? maps[ext] : maps["txt"]; - } - - return { - commands: { - insertfile: { - execCommand: function(command, filelist) { - filelist = utils.isArray(filelist) ? filelist : [filelist]; - - if (me.fireEvent("beforeinsertfile", filelist) === true) { - return; - } - - var i, - item, - icon, - title, - html = "", - URL = me.getOpt("UEDITOR_HOME_URL"), - iconDir = - URL + - (URL.substr(URL.length - 1) == "/" ? "" : "/") + - "dialogs/attachment/fileTypeImages/"; - for (i = 0; i < filelist.length; i++) { - item = filelist[i]; - icon = iconDir + getFileIcon(item.url); - title = - item.title || item.url.substr(item.url.lastIndexOf("/") + 1); - html += - '

                      ' + - '' + - '' + - title + - "" + - "

                      "; - } - me.execCommand("insertHtml", html); - - me.fireEvent("afterinsertfile", filelist); - } - } - } - }; -}); - - -// plugins/xssFilter.js -/** - * @file xssFilter.js - * @desc xss过滤器 - * @author robbenmu - */ - -UE.plugins.xssFilter = function() { - - var config = UEDITOR_CONFIG; - var whitList = config.whitList; - - function filter(node) { - - var tagName = node.tagName; - var attrs = node.attrs; - - if (!whitList.hasOwnProperty(tagName)) { - node.parentNode.removeChild(node); - return false; - } - - UE.utils.each(attrs, function (val, key) { - - if (whitList[tagName].indexOf(key) === -1) { - node.setAttr(key); - } - }); - } - - // 添加inserthtml\paste等操作用的过滤规则 - if (whitList && config.xssFilterRules) { - this.options.filterRules = function () { - - var result = {}; - - UE.utils.each(whitList, function(val, key) { - result[key] = function (node) { - return filter(node); - }; - }); - - return result; - }(); - } - - var tagList = []; - - UE.utils.each(whitList, function (val, key) { - tagList.push(key); - }); - - // 添加input过滤规则 - // - if (whitList && config.inputXssFilter) { - this.addInputRule(function (root) { - - root.traversal(function(node) { - if (node.type !== 'element') { - return false; - } - filter(node); - }); - }); - } - // 添加output过滤规则 - // - if (whitList && config.outputXssFilter) { - this.addOutputRule(function (root) { - - root.traversal(function(node) { - if (node.type !== 'element') { - return false; - } - filter(node); - }); - }); - } - -}; - - -// ui/ui.js -var baidu = baidu || {}; -baidu.editor = baidu.editor || {}; -UE.ui = baidu.editor.ui = {}; - - -// ui/uiutils.js -;(function() { - var browser = baidu.editor.browser, - domUtils = baidu.editor.dom.domUtils; - - var magic = "$EDITORUI"; - var root = (window[magic] = {}); - var uidMagic = "ID" + magic; - var uidCount = 0; - - var uiUtils = (baidu.editor.ui.uiUtils = { - uid: function(obj) { - return obj ? obj[uidMagic] || (obj[uidMagic] = ++uidCount) : ++uidCount; - }, - hook: function(fn, callback) { - var dg; - if (fn && fn._callbacks) { - dg = fn; - } else { - dg = function() { - var q; - if (fn) { - q = fn.apply(this, arguments); - } - var callbacks = dg._callbacks; - var k = callbacks.length; - while (k--) { - var r = callbacks[k].apply(this, arguments); - if (q === undefined) { - q = r; - } - } - return q; - }; - dg._callbacks = []; - } - dg._callbacks.push(callback); - return dg; - }, - createElementByHtml: function(html) { - var el = document.createElement("div"); - el.innerHTML = html; - el = el.firstChild; - el.parentNode.removeChild(el); - return el; - }, - getViewportElement: function() { - return browser.ie && browser.quirks - ? document.body - : document.documentElement; - }, - getClientRect: function(element) { - var bcr; - //trace IE6下在控制编辑器显隐时可能会报错,catch一下 - try { - bcr = element.getBoundingClientRect(); - } catch (e) { - bcr = { left: 0, top: 0, height: 0, width: 0 }; - } - var rect = { - left: Math.round(bcr.left), - top: Math.round(bcr.top), - height: Math.round(bcr.bottom - bcr.top), - width: Math.round(bcr.right - bcr.left) - }; - var doc; - while ( - (doc = element.ownerDocument) !== document && - (element = domUtils.getWindow(doc).frameElement) - ) { - bcr = element.getBoundingClientRect(); - rect.left += bcr.left; - rect.top += bcr.top; - } - rect.bottom = rect.top + rect.height; - rect.right = rect.left + rect.width; - return rect; - }, - getViewportRect: function() { - var viewportEl = uiUtils.getViewportElement(); - var width = (window.innerWidth || viewportEl.clientWidth) | 0; - var height = (window.innerHeight || viewportEl.clientHeight) | 0; - return { - left: 0, - top: 0, - height: height, - width: width, - bottom: height, - right: width - }; - }, - setViewportOffset: function(element, offset) { - var rect; - var fixedLayer = uiUtils.getFixedLayer(); - if (element.parentNode === fixedLayer) { - element.style.left = offset.left + "px"; - element.style.top = offset.top + "px"; - } else { - domUtils.setViewportOffset(element, offset); - } - }, - getEventOffset: function(evt) { - var el = evt.target || evt.srcElement; - var rect = uiUtils.getClientRect(el); - var offset = uiUtils.getViewportOffsetByEvent(evt); - return { - left: offset.left - rect.left, - top: offset.top - rect.top - }; - }, - getViewportOffsetByEvent: function(evt) { - var el = evt.target || evt.srcElement; - var frameEl = domUtils.getWindow(el).frameElement; - var offset = { - left: evt.clientX, - top: evt.clientY - }; - if (frameEl && el.ownerDocument !== document) { - var rect = uiUtils.getClientRect(frameEl); - offset.left += rect.left; - offset.top += rect.top; - } - return offset; - }, - setGlobal: function(id, obj) { - root[id] = obj; - return magic + '["' + id + '"]'; - }, - unsetGlobal: function(id) { - delete root[id]; - }, - copyAttributes: function(tgt, src) { - var attributes = src.attributes; - var k = attributes.length; - while (k--) { - var attrNode = attributes[k]; - if ( - attrNode.nodeName != "style" && - attrNode.nodeName != "class" && - (!browser.ie || attrNode.specified) - ) { - tgt.setAttribute(attrNode.nodeName, attrNode.nodeValue); - } - } - if (src.className) { - domUtils.addClass(tgt, src.className); - } - if (src.style.cssText) { - tgt.style.cssText += ";" + src.style.cssText; - } - }, - removeStyle: function(el, styleName) { - if (el.style.removeProperty) { - el.style.removeProperty(styleName); - } else if (el.style.removeAttribute) { - el.style.removeAttribute(styleName); - } else throw ""; - }, - contains: function(elA, elB) { - return ( - elA && - elB && - (elA === elB - ? false - : elA.contains - ? elA.contains(elB) - : elA.compareDocumentPosition(elB) & 16) - ); - }, - startDrag: function(evt, callbacks, doc) { - var doc = doc || document; - var startX = evt.clientX; - var startY = evt.clientY; - function handleMouseMove(evt) { - var x = evt.clientX - startX; - var y = evt.clientY - startY; - callbacks.ondragmove(x, y, evt); - if (evt.stopPropagation) { - evt.stopPropagation(); - } else { - evt.cancelBubble = true; - } - } - if (doc.addEventListener) { - function handleMouseUp(evt) { - doc.removeEventListener("mousemove", handleMouseMove, true); - doc.removeEventListener("mouseup", handleMouseUp, true); - window.removeEventListener("mouseup", handleMouseUp, true); - callbacks.ondragstop(); - } - doc.addEventListener("mousemove", handleMouseMove, true); - doc.addEventListener("mouseup", handleMouseUp, true); - window.addEventListener("mouseup", handleMouseUp, true); - - evt.preventDefault(); - } else { - var elm = evt.srcElement; - elm.setCapture(); - function releaseCaptrue() { - elm.releaseCapture(); - elm.detachEvent("onmousemove", handleMouseMove); - elm.detachEvent("onmouseup", releaseCaptrue); - elm.detachEvent("onlosecaptrue", releaseCaptrue); - callbacks.ondragstop(); - } - elm.attachEvent("onmousemove", handleMouseMove); - elm.attachEvent("onmouseup", releaseCaptrue); - elm.attachEvent("onlosecaptrue", releaseCaptrue); - evt.returnValue = false; - } - callbacks.ondragstart(); - }, - getFixedLayer: function() { - var layer = document.getElementById("edui_fixedlayer"); - if (layer == null) { - layer = document.createElement("div"); - layer.id = "edui_fixedlayer"; - document.body.appendChild(layer); - if (browser.ie && browser.version <= 8) { - layer.style.position = "absolute"; - bindFixedLayer(); - setTimeout(updateFixedOffset); - } else { - layer.style.position = "fixed"; - } - layer.style.left = "0"; - layer.style.top = "0"; - layer.style.width = "0"; - layer.style.height = "0"; - } - return layer; - }, - makeUnselectable: function(element) { - if (browser.opera || (browser.ie && browser.version < 9)) { - element.unselectable = "on"; - if (element.hasChildNodes()) { - for (var i = 0; i < element.childNodes.length; i++) { - if (element.childNodes[i].nodeType == 1) { - uiUtils.makeUnselectable(element.childNodes[i]); - } - } - } - } else { - if (element.style.MozUserSelect !== undefined) { - element.style.MozUserSelect = "none"; - } else if (element.style.WebkitUserSelect !== undefined) { - element.style.WebkitUserSelect = "none"; - } else if (element.style.KhtmlUserSelect !== undefined) { - element.style.KhtmlUserSelect = "none"; - } - } - } - }); - function updateFixedOffset() { - var layer = document.getElementById("edui_fixedlayer"); - uiUtils.setViewportOffset(layer, { - left: 0, - top: 0 - }); - // layer.style.display = 'none'; - // layer.style.display = 'block'; - - //#trace: 1354 - // setTimeout(updateFixedOffset); - } - function bindFixedLayer(adjOffset) { - domUtils.on(window, "scroll", updateFixedOffset); - domUtils.on( - window, - "resize", - baidu.editor.utils.defer(updateFixedOffset, 0, true) - ); - } -})(); - - -// ui/uibase.js -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - EventBase = baidu.editor.EventBase, - UIBase = (baidu.editor.ui.UIBase = function() {}); - - UIBase.prototype = { - className: "", - uiName: "", - initOptions: function(options) { - var me = this; - for (var k in options) { - me[k] = options[k]; - } - this.id = this.id || "edui" + uiUtils.uid(); - }, - initUIBase: function() { - this._globalKey = utils.unhtml(uiUtils.setGlobal(this.id, this)); - }, - render: function(holder) { - var html = this.renderHtml(); - var el = uiUtils.createElementByHtml(html); - - //by xuheng 给每个node添加class - var list = domUtils.getElementsByTagName(el, "*"); - var theme = "edui-" + (this.theme || this.editor.options.theme); - var layer = document.getElementById("edui_fixedlayer"); - for (var i = 0, node; (node = list[i++]); ) { - domUtils.addClass(node, theme); - } - domUtils.addClass(el, theme); - if (layer) { - layer.className = ""; - domUtils.addClass(layer, theme); - } - - var seatEl = this.getDom(); - if (seatEl != null) { - seatEl.parentNode.replaceChild(el, seatEl); - uiUtils.copyAttributes(el, seatEl); - } else { - if (typeof holder == "string") { - holder = document.getElementById(holder); - } - holder = holder || uiUtils.getFixedLayer(); - domUtils.addClass(holder, theme); - holder.appendChild(el); - } - this.postRender(); - }, - getDom: function(name) { - if (!name) { - return document.getElementById(this.id); - } else { - return document.getElementById(this.id + "_" + name); - } - }, - postRender: function() { - this.fireEvent("postrender"); - }, - getHtmlTpl: function() { - return ""; - }, - formatHtml: function(tpl) { - var prefix = "edui-" + this.uiName; - return tpl - .replace(/##/g, this.id) - .replace(/%%-/g, this.uiName ? prefix + "-" : "") - .replace(/%%/g, (this.uiName ? prefix : "") + " " + this.className) - .replace(/\$\$/g, this._globalKey); - }, - renderHtml: function() { - return this.formatHtml(this.getHtmlTpl()); - }, - dispose: function() { - var box = this.getDom(); - if (box) baidu.editor.dom.domUtils.remove(box); - uiUtils.unsetGlobal(this.id); - } - }; - utils.inherits(UIBase, EventBase); -})(); - - -// ui/separator.js -;(function() { - var utils = baidu.editor.utils, - UIBase = baidu.editor.ui.UIBase, - Separator = (baidu.editor.ui.Separator = function(options) { - this.initOptions(options); - this.initSeparator(); - }); - Separator.prototype = { - uiName: "separator", - initSeparator: function() { - this.initUIBase(); - }, - getHtmlTpl: function() { - return '
                      '; - } - }; - utils.inherits(Separator, UIBase); -})(); - - -// ui/mask.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - domUtils = baidu.editor.dom.domUtils, - UIBase = baidu.editor.ui.UIBase, - uiUtils = baidu.editor.ui.uiUtils; - - var Mask = (baidu.editor.ui.Mask = function(options) { - this.initOptions(options); - this.initUIBase(); - }); - Mask.prototype = { - getHtmlTpl: function() { - return '
                      '; - }, - postRender: function() { - var me = this; - domUtils.on(window, "resize", function() { - setTimeout(function() { - if (!me.isHidden()) { - me._fill(); - } - }); - }); - }, - show: function(zIndex) { - this._fill(); - this.getDom().style.display = ""; - this.getDom().style.zIndex = zIndex; - }, - hide: function() { - this.getDom().style.display = "none"; - this.getDom().style.zIndex = ""; - }, - isHidden: function() { - return this.getDom().style.display == "none"; - }, - _onMouseDown: function() { - return false; - }, - _onClick: function(e, target) { - this.fireEvent("click", e, target); - }, - _fill: function() { - var el = this.getDom(); - var vpRect = uiUtils.getViewportRect(); - el.style.width = vpRect.width + "px"; - el.style.height = vpRect.height + "px"; - } - }; - utils.inherits(Mask, UIBase); -})(); - - -// ui/popup.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - domUtils = baidu.editor.dom.domUtils, - UIBase = baidu.editor.ui.UIBase, - Popup = (baidu.editor.ui.Popup = function(options) { - this.initOptions(options); - this.initPopup(); - }); - - var allPopups = []; - function closeAllPopup(evt, el) { - for (var i = 0; i < allPopups.length; i++) { - var pop = allPopups[i]; - if (!pop.isHidden()) { - if (pop.queryAutoHide(el) !== false) { - if ( - evt && - /scroll/gi.test(evt.type) && - pop.className == "edui-wordpastepop" - ) - return; - pop.hide(); - } - } - } - - if (allPopups.length) pop.editor.fireEvent("afterhidepop"); - } - - Popup.postHide = closeAllPopup; - - var ANCHOR_CLASSES = [ - "edui-anchor-topleft", - "edui-anchor-topright", - "edui-anchor-bottomleft", - "edui-anchor-bottomright" - ]; - Popup.prototype = { - SHADOW_RADIUS: 5, - content: null, - _hidden: false, - autoRender: true, - canSideLeft: true, - canSideUp: true, - initPopup: function() { - this.initUIBase(); - allPopups.push(this); - }, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ' + - ' ' + - '
                      ' + - '
                      ' + - this.getContentHtmlTpl() + - "
                      " + - "
                      " + - "
                      " - ); - }, - getContentHtmlTpl: function() { - if (this.content) { - if (typeof this.content == "string") { - return this.content; - } - return this.content.renderHtml(); - } else { - return ""; - } - }, - _UIBase_postRender: UIBase.prototype.postRender, - postRender: function() { - if (this.content instanceof UIBase) { - this.content.postRender(); - } - - //捕获鼠标滚轮 - if (this.captureWheel && !this.captured) { - this.captured = true; - - var winHeight = - (document.documentElement.clientHeight || - document.body.clientHeight) - 80, - _height = this.getDom().offsetHeight, - _top = uiUtils.getClientRect(this.combox.getDom()).top, - content = this.getDom("content"), - ifr = this.getDom("body").getElementsByTagName("iframe"), - me = this; - - ifr.length && (ifr = ifr[0]); - - while (_top + _height > winHeight) { - _height -= 30; - } - content.style.height = _height + "px"; - //同步更改iframe高度 - ifr && (ifr.style.height = _height + "px"); - - //阻止在combox上的鼠标滚轮事件, 防止用户的正常操作被误解 - if (window.XMLHttpRequest) { - domUtils.on( - content, - "onmousewheel" in document.body ? "mousewheel" : "DOMMouseScroll", - function(e) { - if (e.preventDefault) { - e.preventDefault(); - } else { - e.returnValue = false; - } - - if (e.wheelDelta) { - content.scrollTop -= e.wheelDelta / 120 * 60; - } else { - content.scrollTop -= e.detail / -3 * 60; - } - } - ); - } else { - //ie6 - domUtils.on(this.getDom(), "mousewheel", function(e) { - e.returnValue = false; - - me.getDom("content").scrollTop -= e.wheelDelta / 120 * 60; - }); - } - } - this.fireEvent("postRenderAfter"); - this.hide(true); - this._UIBase_postRender(); - }, - _doAutoRender: function() { - if (!this.getDom() && this.autoRender) { - this.render(); - } - }, - mesureSize: function() { - var box = this.getDom("content"); - return uiUtils.getClientRect(box); - }, - fitSize: function() { - if (this.captureWheel && this.sized) { - return this.__size; - } - this.sized = true; - var popBodyEl = this.getDom("body"); - popBodyEl.style.width = ""; - popBodyEl.style.height = ""; - var size = this.mesureSize(); - if (this.captureWheel) { - popBodyEl.style.width = -(-20 - size.width) + "px"; - var height = parseInt(this.getDom("content").style.height, 10); - !window.isNaN(height) && (size.height = height); - } else { - popBodyEl.style.width = size.width + "px"; - } - popBodyEl.style.height = size.height + "px"; - this.__size = size; - this.captureWheel && (this.getDom("content").style.overflow = "auto"); - return size; - }, - showAnchor: function(element, hoz) { - this.showAnchorRect(uiUtils.getClientRect(element), hoz); - }, - showAnchorRect: function(rect, hoz, adj) { - this._doAutoRender(); - var vpRect = uiUtils.getViewportRect(); - this.getDom().style.visibility = "hidden"; - this._show(); - var popSize = this.fitSize(); - - var sideLeft, sideUp, left, top; - if (hoz) { - sideLeft = - this.canSideLeft && - (rect.right + popSize.width > vpRect.right && - rect.left > popSize.width); - sideUp = - this.canSideUp && - (rect.top + popSize.height > vpRect.bottom && - rect.bottom > popSize.height); - left = sideLeft ? rect.left - popSize.width : rect.right; - top = sideUp ? rect.bottom - popSize.height : rect.top; - } else { - sideLeft = - this.canSideLeft && - (rect.right + popSize.width > vpRect.right && - rect.left > popSize.width); - sideUp = - this.canSideUp && - (rect.top + popSize.height > vpRect.bottom && - rect.bottom > popSize.height); - left = sideLeft ? rect.right - popSize.width : rect.left; - top = sideUp ? rect.top - popSize.height : rect.bottom; - } - - var popEl = this.getDom(); - uiUtils.setViewportOffset(popEl, { - left: left, - top: top - }); - domUtils.removeClasses(popEl, ANCHOR_CLASSES); - popEl.className += - " " + ANCHOR_CLASSES[(sideUp ? 1 : 0) * 2 + (sideLeft ? 1 : 0)]; - if (this.editor) { - popEl.style.zIndex = this.editor.container.style.zIndex * 1 + 10; - baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex = - popEl.style.zIndex - 1; - } - this.getDom().style.visibility = "visible"; - }, - showAt: function(offset) { - var left = offset.left; - var top = offset.top; - var rect = { - left: left, - top: top, - right: left, - bottom: top, - height: 0, - width: 0 - }; - this.showAnchorRect(rect, false, true); - }, - _show: function() { - if (this._hidden) { - var box = this.getDom(); - box.style.display = ""; - this._hidden = false; - // if (box.setActive) { - // box.setActive(); - // } - this.fireEvent("show"); - } - }, - isHidden: function() { - return this._hidden; - }, - show: function() { - this._doAutoRender(); - this._show(); - }, - hide: function(notNofity) { - if (!this._hidden && this.getDom()) { - this.getDom().style.display = "none"; - this._hidden = true; - if (!notNofity) { - this.fireEvent("hide"); - } - } - }, - queryAutoHide: function(el) { - return !el || !uiUtils.contains(this.getDom(), el); - } - }; - utils.inherits(Popup, UIBase); - - domUtils.on(document, "mousedown", function(evt) { - var el = evt.target || evt.srcElement; - closeAllPopup(evt, el); - }); - domUtils.on(window, "scroll", function(evt, el) { - closeAllPopup(evt, el); - }); -})(); - - -// ui/colorpicker.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - UIBase = baidu.editor.ui.UIBase, - ColorPicker = (baidu.editor.ui.ColorPicker = function(options) { - this.initOptions(options); - this.noColorText = this.noColorText || this.editor.getLang("clearColor"); - this.initUIBase(); - }); - - ColorPicker.prototype = { - getHtmlTpl: function() { - return genColorPicker(this.noColorText, this.editor); - }, - _onTableClick: function(evt) { - var tgt = evt.target || evt.srcElement; - var color = tgt.getAttribute("data-color"); - if (color) { - this.fireEvent("pickcolor", color); - } - }, - _onTableOver: function(evt) { - var tgt = evt.target || evt.srcElement; - var color = tgt.getAttribute("data-color"); - if (color) { - this.getDom("preview").style.backgroundColor = color; - } - }, - _onTableOut: function() { - this.getDom("preview").style.backgroundColor = ""; - }, - _onPickNoColor: function() { - this.fireEvent("picknocolor"); - } - }; - utils.inherits(ColorPicker, UIBase); - - var COLORS = ("ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646," + - "f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada," + - "d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5," + - "bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f," + - "a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09," + - "7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806," + - "c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,").split( - "," - ); - - function genColorPicker(noColorText, editor) { - var html = - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - noColorText + - "
                      " + - "
                      " + - '' + - '" + - ''; - for (var i = 0; i < COLORS.length; i++) { - if (i && i % 10 === 0) { - html += - "" + - (i == 60 - ? '" - : "") + - ""; - } - html += i < 70 - ? '" - : ""; - } - html += "
                      ' + - editor.getLang("themeColor") + - "
                      ' + - editor.getLang("standardColor") + - "
                      = 60 - ? "border-width:1px;" - : i >= 10 && i < 20 - ? "border-width:1px 1px 0 1px;" - : "border-width:0 1px 0 1px;") + - '"' + - ">
                      "; - return html; - } -})(); - - -// ui/tablepicker.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - UIBase = baidu.editor.ui.UIBase; - - var TablePicker = (baidu.editor.ui.TablePicker = function(options) { - this.initOptions(options); - this.initTablePicker(); - }); - TablePicker.prototype = { - defaultNumRows: 10, - defaultNumCols: 10, - maxNumRows: 20, - maxNumCols: 20, - numRows: 10, - numCols: 10, - lengthOfCellSide: 22, - initTablePicker: function() { - this.initUIBase(); - }, - getHtmlTpl: function() { - var me = this; - return ( - '
                      ' + - '
                      ' + - '
                      ' + - '' + - "
                      " + - '
                      " + - '
                      ' + - "
                      " + - "
                      " + - "
                      " - ); - }, - _UIBase_render: UIBase.prototype.render, - render: function(holder) { - this._UIBase_render(holder); - this.getDom("label").innerHTML = - "0" + - this.editor.getLang("t_row") + - " x 0" + - this.editor.getLang("t_col"); - }, - _track: function(numCols, numRows) { - var style = this.getDom("overlay").style; - var sideLen = this.lengthOfCellSide; - style.width = numCols * sideLen + "px"; - style.height = numRows * sideLen + "px"; - var label = this.getDom("label"); - label.innerHTML = - numCols + - this.editor.getLang("t_col") + - " x " + - numRows + - this.editor.getLang("t_row"); - this.numCols = numCols; - this.numRows = numRows; - }, - _onMouseOver: function(evt, el) { - var rel = evt.relatedTarget || evt.fromElement; - if (!uiUtils.contains(el, rel) && el !== rel) { - this.getDom("label").innerHTML = - "0" + - this.editor.getLang("t_col") + - " x 0" + - this.editor.getLang("t_row"); - this.getDom("overlay").style.visibility = ""; - } - }, - _onMouseOut: function(evt, el) { - var rel = evt.relatedTarget || evt.toElement; - if (!uiUtils.contains(el, rel) && el !== rel) { - this.getDom("label").innerHTML = - "0" + - this.editor.getLang("t_col") + - " x 0" + - this.editor.getLang("t_row"); - this.getDom("overlay").style.visibility = "hidden"; - } - }, - _onMouseMove: function(evt, el) { - var style = this.getDom("overlay").style; - var offset = uiUtils.getEventOffset(evt); - var sideLen = this.lengthOfCellSide; - var numCols = Math.ceil(offset.left / sideLen); - var numRows = Math.ceil(offset.top / sideLen); - this._track(numCols, numRows); - }, - _onClick: function() { - this.fireEvent("picktable", this.numCols, this.numRows); - } - }; - utils.inherits(TablePicker, UIBase); -})(); - - -// ui/stateful.js -;(function() { - var browser = baidu.editor.browser, - domUtils = baidu.editor.dom.domUtils, - uiUtils = baidu.editor.ui.uiUtils; - - var TPL_STATEFUL = - 'onmousedown="$$.Stateful_onMouseDown(event, this);"' + - ' onmouseup="$$.Stateful_onMouseUp(event, this);"' + - (browser.ie - ? ' onmouseenter="$$.Stateful_onMouseEnter(event, this);"' + - ' onmouseleave="$$.Stateful_onMouseLeave(event, this);"' - : ' onmouseover="$$.Stateful_onMouseOver(event, this);"' + - ' onmouseout="$$.Stateful_onMouseOut(event, this);"'); - - baidu.editor.ui.Stateful = { - alwalysHoverable: false, - target: null, //目标元素和this指向dom不一样 - Stateful_init: function() { - this._Stateful_dGetHtmlTpl = this.getHtmlTpl; - this.getHtmlTpl = this.Stateful_getHtmlTpl; - }, - Stateful_getHtmlTpl: function() { - var tpl = this._Stateful_dGetHtmlTpl(); - // 使用function避免$转义 - return tpl.replace(/stateful/g, function() { - return TPL_STATEFUL; - }); - }, - Stateful_onMouseEnter: function(evt, el) { - this.target = el; - if (!this.isDisabled() || this.alwalysHoverable) { - this.addState("hover"); - this.fireEvent("over"); - } - }, - Stateful_onMouseLeave: function(evt, el) { - if (!this.isDisabled() || this.alwalysHoverable) { - this.removeState("hover"); - this.removeState("active"); - this.fireEvent("out"); - } - }, - Stateful_onMouseOver: function(evt, el) { - var rel = evt.relatedTarget; - if (!uiUtils.contains(el, rel) && el !== rel) { - this.Stateful_onMouseEnter(evt, el); - } - }, - Stateful_onMouseOut: function(evt, el) { - var rel = evt.relatedTarget; - if (!uiUtils.contains(el, rel) && el !== rel) { - this.Stateful_onMouseLeave(evt, el); - } - }, - Stateful_onMouseDown: function(evt, el) { - if (!this.isDisabled()) { - this.addState("active"); - } - }, - Stateful_onMouseUp: function(evt, el) { - if (!this.isDisabled()) { - this.removeState("active"); - } - }, - Stateful_postRender: function() { - if (this.disabled && !this.hasState("disabled")) { - this.addState("disabled"); - } - }, - hasState: function(state) { - return domUtils.hasClass(this.getStateDom(), "edui-state-" + state); - }, - addState: function(state) { - if (!this.hasState(state)) { - this.getStateDom().className += " edui-state-" + state; - } - }, - removeState: function(state) { - if (this.hasState(state)) { - domUtils.removeClasses(this.getStateDom(), ["edui-state-" + state]); - } - }, - getStateDom: function() { - return this.getDom("state"); - }, - isChecked: function() { - return this.hasState("checked"); - }, - setChecked: function(checked) { - if (!this.isDisabled() && checked) { - this.addState("checked"); - } else { - this.removeState("checked"); - } - }, - isDisabled: function() { - return this.hasState("disabled"); - }, - setDisabled: function(disabled) { - if (disabled) { - this.removeState("hover"); - this.removeState("checked"); - this.removeState("active"); - this.addState("disabled"); - } else { - this.removeState("disabled"); - } - } - }; -})(); - - -// ui/button.js -///import core -///import uicore -///import ui/stateful.js -;(function() { - var utils = baidu.editor.utils, - UIBase = baidu.editor.ui.UIBase, - Stateful = baidu.editor.ui.Stateful, - Button = (baidu.editor.ui.Button = function(options) { - if (options.name) { - var btnName = options.name; - var cssRules = options.cssRules; - if (!options.className) { - options.className = "edui-for-" + btnName; - } - options.cssRules = - ".edui-" + - (options.theme || "default") + - " .edui-toolbar .edui-button.edui-for-" + - btnName + - " .edui-icon {" + - cssRules + - "}"; - } - this.initOptions(options); - this.initButton(); - }); - Button.prototype = { - uiName: "button", - label: "", - title: "", - showIcon: true, - showText: true, - cssRules: "", - initButton: function() { - this.initUIBase(); - this.Stateful_init(); - if (this.cssRules) { - utils.cssRule("edui-customize-" + this.name + "-style", this.cssRules); - } - }, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ' + - '
                      ' + - (this.showIcon ? '
                      ' : "") + - (this.showText - ? '
                      ' + this.label + "
                      " - : "") + - "
                      " + - "
                      " + - "
                      " - ); - }, - postRender: function() { - this.Stateful_postRender(); - this.setDisabled(this.disabled); - }, - _onMouseDown: function(e) { - var target = e.target || e.srcElement, - tagName = target && target.tagName && target.tagName.toLowerCase(); - if (tagName == "input" || tagName == "object" || tagName == "object") { - return false; - } - }, - _onClick: function() { - if (!this.isDisabled()) { - this.fireEvent("click"); - } - }, - setTitle: function(text) { - var label = this.getDom("label"); - label.innerHTML = text; - } - }; - utils.inherits(Button, UIBase); - utils.extend(Button.prototype, Stateful); -})(); - - -// ui/splitbutton.js -///import core -///import uicore -///import ui/stateful.js -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - domUtils = baidu.editor.dom.domUtils, - UIBase = baidu.editor.ui.UIBase, - Stateful = baidu.editor.ui.Stateful, - SplitButton = (baidu.editor.ui.SplitButton = function(options) { - this.initOptions(options); - this.initSplitButton(); - }); - SplitButton.prototype = { - popup: null, - uiName: "splitbutton", - title: "", - initSplitButton: function() { - this.initUIBase(); - this.Stateful_init(); - var me = this; - if (this.popup != null) { - var popup = this.popup; - this.popup = null; - this.setPopup(popup); - } - }, - _UIBase_postRender: UIBase.prototype.postRender, - postRender: function() { - this.Stateful_postRender(); - this._UIBase_postRender(); - }, - setPopup: function(popup) { - if (this.popup === popup) return; - if (this.popup != null) { - this.popup.dispose(); - } - popup.addListener("show", utils.bind(this._onPopupShow, this)); - popup.addListener("hide", utils.bind(this._onPopupHide, this)); - popup.addListener( - "postrender", - utils.bind(function() { - popup - .getDom("body") - .appendChild( - uiUtils.createElementByHtml( - '
                      ' - ) - ); - popup.getDom().className += " " + this.className; - }, this) - ); - this.popup = popup; - }, - _onPopupShow: function() { - this.addState("opened"); - }, - _onPopupHide: function() { - this.removeState("opened"); - }, - getHtmlTpl: function() { - return ( - '
                      ' + - "
                      ' + - '
                      ' + - '
                      ' + - "
                      " + - '
                      ' + - '
                      ' + - "
                      " - ); - }, - showPopup: function() { - // 当popup往上弹出的时候,做特殊处理 - var rect = uiUtils.getClientRect(this.getDom()); - rect.top -= this.popup.SHADOW_RADIUS; - rect.height += this.popup.SHADOW_RADIUS; - this.popup.showAnchorRect(rect); - }, - _onArrowClick: function(event, el) { - if (!this.isDisabled()) { - this.showPopup(); - } - }, - _onButtonClick: function() { - if (!this.isDisabled()) { - this.fireEvent("buttonclick"); - } - } - }; - utils.inherits(SplitButton, UIBase); - utils.extend(SplitButton.prototype, Stateful, true); -})(); - - -// ui/colorbutton.js -///import core -///import uicore -///import ui/colorpicker.js -///import ui/popup.js -///import ui/splitbutton.js -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - ColorPicker = baidu.editor.ui.ColorPicker, - Popup = baidu.editor.ui.Popup, - SplitButton = baidu.editor.ui.SplitButton, - ColorButton = (baidu.editor.ui.ColorButton = function(options) { - this.initOptions(options); - this.initColorButton(); - }); - ColorButton.prototype = { - initColorButton: function() { - var me = this; - this.popup = new Popup({ - content: new ColorPicker({ - noColorText: me.editor.getLang("clearColor"), - editor: me.editor, - onpickcolor: function(t, color) { - me._onPickColor(color); - }, - onpicknocolor: function(t, color) { - me._onPickNoColor(color); - } - }), - editor: me.editor - }); - this.initSplitButton(); - }, - _SplitButton_postRender: SplitButton.prototype.postRender, - postRender: function() { - this._SplitButton_postRender(); - this.getDom("button_body").appendChild( - uiUtils.createElementByHtml( - '
                      ' - ) - ); - this.getDom().className += " edui-colorbutton"; - }, - setColor: function(color) { - this.getDom("colorlump").style.backgroundColor = color; - this.color = color; - }, - _onPickColor: function(color) { - if (this.fireEvent("pickcolor", color) !== false) { - this.setColor(color); - this.popup.hide(); - } - }, - _onPickNoColor: function(color) { - if (this.fireEvent("picknocolor") !== false) { - this.popup.hide(); - } - } - }; - utils.inherits(ColorButton, SplitButton); -})(); - - -// ui/tablebutton.js -///import core -///import uicore -///import ui/popup.js -///import ui/tablepicker.js -///import ui/splitbutton.js -;(function() { - var utils = baidu.editor.utils, - Popup = baidu.editor.ui.Popup, - TablePicker = baidu.editor.ui.TablePicker, - SplitButton = baidu.editor.ui.SplitButton, - TableButton = (baidu.editor.ui.TableButton = function(options) { - this.initOptions(options); - this.initTableButton(); - }); - TableButton.prototype = { - initTableButton: function() { - var me = this; - this.popup = new Popup({ - content: new TablePicker({ - editor: me.editor, - onpicktable: function(t, numCols, numRows) { - me._onPickTable(numCols, numRows); - } - }), - editor: me.editor - }); - this.initSplitButton(); - }, - _onPickTable: function(numCols, numRows) { - if (this.fireEvent("picktable", numCols, numRows) !== false) { - this.popup.hide(); - } - } - }; - utils.inherits(TableButton, SplitButton); -})(); - - -// ui/autotypesetpicker.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - UIBase = baidu.editor.ui.UIBase; - - var AutoTypeSetPicker = (baidu.editor.ui.AutoTypeSetPicker = function( - options - ) { - this.initOptions(options); - this.initAutoTypeSetPicker(); - }); - AutoTypeSetPicker.prototype = { - initAutoTypeSetPicker: function() { - this.initUIBase(); - }, - getHtmlTpl: function() { - var me = this.editor, - opt = me.options.autotypeset, - lang = me.getLang("autoTypeSet"); - - var textAlignInputName = "textAlignValue" + me.uid, - imageBlockInputName = "imageBlockLineValue" + me.uid, - symbolConverInputName = "symbolConverValue" + me.uid; - - return ( - '
                      ' + - '
                      ' + - "" + - '" + - '" + - "" + - '" + - '" + - "" + - "" + - '" + - '" + - "" + - '" + - '" + - '" + - "" + - '" + - '" + - '" + - "" + - "
                      " + - lang.mergeLine + - '" + - lang.delLine + - "
                      " + - lang.removeFormat + - '" + - lang.indent + - "
                      " + - lang.alignment + - "' + - '" + - me.getLang("justifyleft") + - '" + - me.getLang("justifycenter") + - '" + - me.getLang("justifyright") + - "
                      " + - lang.imageFloat + - "' + - '" + - me.getLang("default") + - '" + - me.getLang("justifyleft") + - '" + - me.getLang("justifycenter") + - '" + - me.getLang("justifyright") + - "
                      " + - lang.removeFontsize + - '" + - lang.removeFontFamily + - "
                      " + - lang.removeHtml + - "
                      " + - lang.pasteFilter + - "
                      " + - lang.symbol + - "' + - '" + - lang.bdc2sb + - '" + - lang.tobdc + - "" + - "
                      " + - "
                      " + - "
                      " - ); - }, - _UIBase_render: UIBase.prototype.render - }; - utils.inherits(AutoTypeSetPicker, UIBase); -})(); - - -// ui/autotypesetbutton.js -///import core -///import uicore -///import ui/popup.js -///import ui/autotypesetpicker.js -///import ui/splitbutton.js -;(function() { - var utils = baidu.editor.utils, - Popup = baidu.editor.ui.Popup, - AutoTypeSetPicker = baidu.editor.ui.AutoTypeSetPicker, - SplitButton = baidu.editor.ui.SplitButton, - AutoTypeSetButton = (baidu.editor.ui.AutoTypeSetButton = function(options) { - this.initOptions(options); - this.initAutoTypeSetButton(); - }); - function getPara(me) { - var opt = {}, - cont = me.getDom(), - editorId = me.editor.uid, - inputType = null, - attrName = null, - ipts = domUtils.getElementsByTagName(cont, "input"); - for (var i = ipts.length - 1, ipt; (ipt = ipts[i--]); ) { - inputType = ipt.getAttribute("type"); - if (inputType == "checkbox") { - attrName = ipt.getAttribute("name"); - opt[attrName] && delete opt[attrName]; - if (ipt.checked) { - var attrValue = document.getElementById( - attrName + "Value" + editorId - ); - if (attrValue) { - if (/input/gi.test(attrValue.tagName)) { - opt[attrName] = attrValue.value; - } else { - var iptChilds = attrValue.getElementsByTagName("input"); - for ( - var j = iptChilds.length - 1, iptchild; - (iptchild = iptChilds[j--]); - - ) { - if (iptchild.checked) { - opt[attrName] = iptchild.value; - break; - } - } - } - } else { - opt[attrName] = true; - } - } else { - opt[attrName] = false; - } - } else { - opt[ipt.getAttribute("value")] = ipt.checked; - } - } - - var selects = domUtils.getElementsByTagName(cont, "select"); - for (var i = 0, si; (si = selects[i++]); ) { - var attr = si.getAttribute("name"); - opt[attr] = opt[attr] ? si.value : ""; - } - - utils.extend(me.editor.options.autotypeset, opt); - - me.editor.setPreferences("autotypeset", opt); - } - - AutoTypeSetButton.prototype = { - initAutoTypeSetButton: function() { - var me = this; - this.popup = new Popup({ - //传入配置参数 - content: new AutoTypeSetPicker({ editor: me.editor }), - editor: me.editor, - hide: function() { - if (!this._hidden && this.getDom()) { - getPara(this); - this.getDom().style.display = "none"; - this._hidden = true; - this.fireEvent("hide"); - } - } - }); - var flag = 0; - this.popup.addListener("postRenderAfter", function() { - var popupUI = this; - if (flag) return; - var cont = this.getDom(), - btn = cont.getElementsByTagName("button")[0]; - - btn.onclick = function() { - getPara(popupUI); - me.editor.execCommand("autotypeset"); - popupUI.hide(); - }; - - domUtils.on(cont, "click", function(e) { - var target = e.target || e.srcElement, - editorId = me.editor.uid; - if (target && target.tagName == "INPUT") { - // 点击图片浮动的checkbox,去除对应的radio - if ( - target.name == "imageBlockLine" || - target.name == "textAlign" || - target.name == "symbolConver" - ) { - var checked = target.checked, - radioTd = document.getElementById( - target.name + "Value" + editorId - ), - radios = radioTd.getElementsByTagName("input"), - defalutSelect = { - imageBlockLine: "none", - textAlign: "left", - symbolConver: "tobdc" - }; - - for (var i = 0; i < radios.length; i++) { - if (checked) { - if (radios[i].value == defalutSelect[target.name]) { - radios[i].checked = "checked"; - } - } else { - radios[i].checked = false; - } - } - } - // 点击radio,选中对应的checkbox - if ( - target.name == "imageBlockLineValue" + editorId || - target.name == "textAlignValue" + editorId || - target.name == "bdc" - ) { - var checkboxs = target.parentNode.previousSibling.getElementsByTagName( - "input" - ); - checkboxs && (checkboxs[0].checked = true); - } - - getPara(popupUI); - } - }); - - flag = 1; - }); - this.initSplitButton(); - } - }; - utils.inherits(AutoTypeSetButton, SplitButton); -})(); - - -// ui/cellalignpicker.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - Popup = baidu.editor.ui.Popup, - Stateful = baidu.editor.ui.Stateful, - UIBase = baidu.editor.ui.UIBase; - - /** - * 该参数将新增一个参数: selected, 参数类型为一个Object, 形如{ 'align': 'center', 'valign': 'top' }, 表示单元格的初始 - * 对齐状态为: 竖直居上,水平居中; 其中 align的取值为:'center', 'left', 'right'; valign的取值为: 'top', 'middle', 'bottom' - * @update 2013/4/2 hancong03@baidu.com - */ - var CellAlignPicker = (baidu.editor.ui.CellAlignPicker = function(options) { - this.initOptions(options); - this.initSelected(); - this.initCellAlignPicker(); - }); - CellAlignPicker.prototype = { - //初始化选中状态, 该方法将根据传递进来的参数获取到应该选中的对齐方式图标的索引 - initSelected: function() { - var status = { - valign: { - top: 0, - middle: 1, - bottom: 2 - }, - align: { - left: 0, - center: 1, - right: 2 - }, - count: 3 - }, - result = -1; - - if (this.selected) { - this.selectedIndex = - status.valign[this.selected.valign] * status.count + - status.align[this.selected.align]; - } - }, - initCellAlignPicker: function() { - this.initUIBase(); - this.Stateful_init(); - }, - getHtmlTpl: function() { - var alignType = ["left", "center", "right"], - COUNT = 9, - tempClassName = null, - tempIndex = -1, - tmpl = []; - - for (var i = 0; i < COUNT; i++) { - tempClassName = this.selectedIndex === i - ? ' class="edui-cellalign-selected" ' - : ""; - tempIndex = i % 3; - - tempIndex === 0 && tmpl.push(""); - - tmpl.push( - '
                      ' - ); - - tempIndex === 2 && tmpl.push(""); - } - - return ( - '
                      ' + - '
                      ' + - '' + - tmpl.join("") + - "
                      " + - "
                      " + - "
                      " - ); - }, - getStateDom: function() { - return this.target; - }, - _onClick: function(evt) { - var target = evt.target || evt.srcElement; - if (/icon/.test(target.className)) { - this.items[target.parentNode.getAttribute("index")].onclick(); - Popup.postHide(evt); - } - }, - _UIBase_render: UIBase.prototype.render - }; - utils.inherits(CellAlignPicker, UIBase); - utils.extend(CellAlignPicker.prototype, Stateful, true); -})(); - - -// ui/pastepicker.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - Stateful = baidu.editor.ui.Stateful, - uiUtils = baidu.editor.ui.uiUtils, - UIBase = baidu.editor.ui.UIBase; - - var PastePicker = (baidu.editor.ui.PastePicker = function(options) { - this.initOptions(options); - this.initPastePicker(); - }); - PastePicker.prototype = { - initPastePicker: function() { - this.initUIBase(); - this.Stateful_init(); - }, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ' + - '
                      ' + - this.editor.getLang("pasteOpt") + - "
                      " + - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - "
                      " + - "
                      " + - "
                      " - ); - }, - getStateDom: function() { - return this.target; - }, - format: function(param) { - this.editor.ui._isTransfer = true; - this.editor.fireEvent("pasteTransfer", param); - }, - _onClick: function(cur) { - var node = domUtils.getNextDomNode(cur), - screenHt = uiUtils.getViewportRect().height, - subPop = uiUtils.getClientRect(node); - - if (subPop.top + subPop.height > screenHt) - node.style.top = -subPop.height - cur.offsetHeight + "px"; - else node.style.top = ""; - - if (/hidden/gi.test(domUtils.getComputedStyle(node, "visibility"))) { - node.style.visibility = "visible"; - domUtils.addClass(cur, "edui-state-opened"); - } else { - node.style.visibility = "hidden"; - domUtils.removeClasses(cur, "edui-state-opened"); - } - }, - _UIBase_render: UIBase.prototype.render - }; - utils.inherits(PastePicker, UIBase); - utils.extend(PastePicker.prototype, Stateful, true); -})(); - - -// ui/toolbar.js -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - UIBase = baidu.editor.ui.UIBase, - Toolbar = (baidu.editor.ui.Toolbar = function(options) { - this.initOptions(options); - this.initToolbar(); - }); - Toolbar.prototype = { - items: null, - initToolbar: function() { - this.items = this.items || []; - this.initUIBase(); - }, - add: function(item, index) { - if (index === undefined) { - this.items.push(item); - } else { - this.items.splice(index, 0, item); - } - }, - getHtmlTpl: function() { - var buff = []; - for (var i = 0; i < this.items.length; i++) { - buff[i] = this.items[i].renderHtml(); - } - return ( - '
                      ' + - buff.join("") + - "
                      " - ); - }, - postRender: function() { - var box = this.getDom(); - for (var i = 0; i < this.items.length; i++) { - this.items[i].postRender(); - } - uiUtils.makeUnselectable(box); - }, - _onMouseDown: function(e) { - var target = e.target || e.srcElement, - tagName = target && target.tagName && target.tagName.toLowerCase(); - if (tagName == "input" || tagName == "object" || tagName == "object") { - return false; - } - } - }; - utils.inherits(Toolbar, UIBase); -})(); - - -// ui/menu.js -///import core -///import uicore -///import ui\popup.js -///import ui\stateful.js -;(function() { - var utils = baidu.editor.utils, - domUtils = baidu.editor.dom.domUtils, - uiUtils = baidu.editor.ui.uiUtils, - UIBase = baidu.editor.ui.UIBase, - Popup = baidu.editor.ui.Popup, - Stateful = baidu.editor.ui.Stateful, - CellAlignPicker = baidu.editor.ui.CellAlignPicker, - Menu = (baidu.editor.ui.Menu = function(options) { - this.initOptions(options); - this.initMenu(); - }); - - var menuSeparator = { - renderHtml: function() { - return '
                      '; - }, - postRender: function() {}, - queryAutoHide: function() { - return true; - } - }; - Menu.prototype = { - items: null, - uiName: "menu", - initMenu: function() { - this.items = this.items || []; - this.initPopup(); - this.initItems(); - }, - initItems: function() { - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - if (item == "-") { - this.items[i] = this.getSeparator(); - } else if (!(item instanceof MenuItem)) { - item.editor = this.editor; - item.theme = this.editor.options.theme; - this.items[i] = this.createItem(item); - } - } - }, - getSeparator: function() { - return menuSeparator; - }, - createItem: function(item) { - //新增一个参数menu, 该参数存储了menuItem所对应的menu引用 - item.menu = this; - return new MenuItem(item); - }, - _Popup_getContentHtmlTpl: Popup.prototype.getContentHtmlTpl, - getContentHtmlTpl: function() { - if (this.items.length == 0) { - return this._Popup_getContentHtmlTpl(); - } - var buff = []; - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - buff[i] = item.renderHtml(); - } - return '
                      ' + buff.join("") + "
                      "; - }, - _Popup_postRender: Popup.prototype.postRender, - postRender: function() { - var me = this; - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - item.ownerMenu = this; - item.postRender(); - } - domUtils.on(this.getDom(), "mouseover", function(evt) { - evt = evt || event; - var rel = evt.relatedTarget || evt.fromElement; - var el = me.getDom(); - if (!uiUtils.contains(el, rel) && el !== rel) { - me.fireEvent("over"); - } - }); - this._Popup_postRender(); - }, - queryAutoHide: function(el) { - if (el) { - if (uiUtils.contains(this.getDom(), el)) { - return false; - } - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - if (item.queryAutoHide(el) === false) { - return false; - } - } - } - }, - clearItems: function() { - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - clearTimeout(item._showingTimer); - clearTimeout(item._closingTimer); - if (item.subMenu) { - item.subMenu.destroy(); - } - } - this.items = []; - }, - destroy: function() { - if (this.getDom()) { - domUtils.remove(this.getDom()); - } - this.clearItems(); - }, - dispose: function() { - this.destroy(); - } - }; - utils.inherits(Menu, Popup); - - /** - * @update 2013/04/03 hancong03 新增一个参数menu, 该参数存储了menuItem所对应的menu引用 - * @type {Function} - */ - var MenuItem = (baidu.editor.ui.MenuItem = function(options) { - this.initOptions(options); - this.initUIBase(); - this.Stateful_init(); - if (this.subMenu && !(this.subMenu instanceof Menu)) { - if (options.className && options.className.indexOf("aligntd") != -1) { - var me = this; - - //获取单元格对齐初始状态 - this.subMenu.selected = this.editor.queryCommandValue("cellalignment"); - - this.subMenu = new Popup({ - content: new CellAlignPicker(this.subMenu), - parentMenu: me, - editor: me.editor, - destroy: function() { - if (this.getDom()) { - domUtils.remove(this.getDom()); - } - } - }); - this.subMenu.addListener("postRenderAfter", function() { - domUtils.on(this.getDom(), "mouseover", function() { - me.addState("opened"); - }); - }); - } else { - this.subMenu = new Menu(this.subMenu); - } - } - }); - MenuItem.prototype = { - label: "", - subMenu: null, - ownerMenu: null, - uiName: "menuitem", - alwalysHoverable: true, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ' + - this.renderLabelHtml() + - "
                      " + - "
                      " - ); - }, - postRender: function() { - var me = this; - this.addListener("over", function() { - me.ownerMenu.fireEvent("submenuover", me); - if (me.subMenu) { - me.delayShowSubMenu(); - } - }); - if (this.subMenu) { - this.getDom().className += " edui-hassubmenu"; - this.subMenu.render(); - this.addListener("out", function() { - me.delayHideSubMenu(); - }); - this.subMenu.addListener("over", function() { - clearTimeout(me._closingTimer); - me._closingTimer = null; - me.addState("opened"); - }); - this.ownerMenu.addListener("hide", function() { - me.hideSubMenu(); - }); - this.ownerMenu.addListener("submenuover", function(t, subMenu) { - if (subMenu !== me) { - me.delayHideSubMenu(); - } - }); - this.subMenu._bakQueryAutoHide = this.subMenu.queryAutoHide; - this.subMenu.queryAutoHide = function(el) { - if (el && uiUtils.contains(me.getDom(), el)) { - return false; - } - return this._bakQueryAutoHide(el); - }; - } - this.getDom().style.tabIndex = "-1"; - uiUtils.makeUnselectable(this.getDom()); - this.Stateful_postRender(); - }, - delayShowSubMenu: function() { - var me = this; - if (!me.isDisabled()) { - me.addState("opened"); - clearTimeout(me._showingTimer); - clearTimeout(me._closingTimer); - me._closingTimer = null; - me._showingTimer = setTimeout(function() { - me.showSubMenu(); - }, 250); - } - }, - delayHideSubMenu: function() { - var me = this; - if (!me.isDisabled()) { - me.removeState("opened"); - clearTimeout(me._showingTimer); - if (!me._closingTimer) { - me._closingTimer = setTimeout(function() { - if (!me.hasState("opened")) { - me.hideSubMenu(); - } - me._closingTimer = null; - }, 400); - } - } - }, - renderLabelHtml: function() { - return ( - '
                      ' + - '
                      ' + - '
                      ' + - (this.label || "") + - "
                      " - ); - }, - getStateDom: function() { - return this.getDom(); - }, - queryAutoHide: function(el) { - if (this.subMenu && this.hasState("opened")) { - return this.subMenu.queryAutoHide(el); - } - }, - _onClick: function(event, this_) { - if (this.hasState("disabled")) return; - if (this.fireEvent("click", event, this_) !== false) { - if (this.subMenu) { - this.showSubMenu(); - } else { - Popup.postHide(event); - } - } - }, - showSubMenu: function() { - var rect = uiUtils.getClientRect(this.getDom()); - rect.right -= 5; - rect.left += 2; - rect.width -= 7; - rect.top -= 4; - rect.bottom += 4; - rect.height += 8; - this.subMenu.showAnchorRect(rect, true, true); - }, - hideSubMenu: function() { - this.subMenu.hide(); - } - }; - utils.inherits(MenuItem, UIBase); - utils.extend(MenuItem.prototype, Stateful, true); -})(); - - -// ui/combox.js -///import core -///import uicore -///import ui/menu.js -///import ui/splitbutton.js -;(function() { - // todo: menu和item提成通用list - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - Menu = baidu.editor.ui.Menu, - SplitButton = baidu.editor.ui.SplitButton, - Combox = (baidu.editor.ui.Combox = function(options) { - this.initOptions(options); - this.initCombox(); - }); - Combox.prototype = { - uiName: "combox", - onbuttonclick: function() { - this.showPopup(); - }, - initCombox: function() { - var me = this; - this.items = this.items || []; - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - item.uiName = "listitem"; - item.index = i; - item.onclick = function() { - me.selectByIndex(this.index); - }; - } - this.popup = new Menu({ - items: this.items, - uiName: "list", - editor: this.editor, - captureWheel: true, - combox: this - }); - - this.initSplitButton(); - }, - _SplitButton_postRender: SplitButton.prototype.postRender, - postRender: function() { - this._SplitButton_postRender(); - this.setLabel(this.label || ""); - this.setValue(this.initValue || ""); - }, - showPopup: function() { - var rect = uiUtils.getClientRect(this.getDom()); - rect.top += 1; - rect.bottom -= 1; - rect.height -= 2; - this.popup.showAnchorRect(rect); - }, - getValue: function() { - return this.value; - }, - setValue: function(value) { - var index = this.indexByValue(value); - if (index != -1) { - this.selectedIndex = index; - this.setLabel(this.items[index].label); - this.value = this.items[index].value; - } else { - this.selectedIndex = -1; - this.setLabel(this.getLabelForUnknowValue(value)); - this.value = value; - } - }, - setLabel: function(label) { - this.getDom("button_body").innerHTML = label; - this.label = label; - }, - getLabelForUnknowValue: function(value) { - return value; - }, - indexByValue: function(value) { - for (var i = 0; i < this.items.length; i++) { - if (value == this.items[i].value) { - return i; - } - } - return -1; - }, - getItem: function(index) { - return this.items[index]; - }, - selectByIndex: function(index) { - if ( - index < this.items.length && - this.fireEvent("select", index) !== false - ) { - this.selectedIndex = index; - this.value = this.items[index].value; - this.setLabel(this.items[index].label); - } - } - }; - utils.inherits(Combox, SplitButton); -})(); - - -// ui/dialog.js -///import core -///import uicore -///import ui/mask.js -///import ui/button.js -;(function() { - var utils = baidu.editor.utils, - domUtils = baidu.editor.dom.domUtils, - uiUtils = baidu.editor.ui.uiUtils, - Mask = baidu.editor.ui.Mask, - UIBase = baidu.editor.ui.UIBase, - Button = baidu.editor.ui.Button, - Dialog = (baidu.editor.ui.Dialog = function(options) { - if (options.name) { - var name = options.name; - var cssRules = options.cssRules; - if (!options.className) { - options.className = "edui-for-" + name; - } - if (cssRules) { - options.cssRules = - ".edui-for-" + name + " .edui-dialog-content {" + cssRules + "}"; - } - } - this.initOptions( - utils.extend( - { - autoReset: true, - draggable: true, - onok: function() {}, - oncancel: function() {}, - onclose: function(t, ok) { - return ok ? this.onok() : this.oncancel(); - }, - //是否控制dialog中的scroll事件, 默认为不阻止 - holdScroll: false - }, - options - ) - ); - this.initDialog(); - }); - var modalMask; - var dragMask; - var activeDialog; - Dialog.prototype = { - draggable: false, - uiName: "dialog", - initDialog: function() { - var me = this, - theme = this.editor.options.theme; - if (this.cssRules) { - this.cssRules = ".edui-" + theme + " " + this.cssRules; - utils.cssRule("edui-customize-" + this.name + "-style", this.cssRules); - } - this.initUIBase(); - this.modalMask = - modalMask || - (modalMask = new Mask({ - className: "edui-dialog-modalmask", - theme: theme, - onclick: function() { - activeDialog && activeDialog.close(false); - } - })); - this.dragMask = - dragMask || - (dragMask = new Mask({ - className: "edui-dialog-dragmask", - theme: theme - })); - this.closeButton = new Button({ - className: "edui-dialog-closebutton", - title: me.closeDialog, - theme: theme, - onclick: function() { - me.close(false); - } - }); - - this.fullscreen && this.initResizeEvent(); - - if (this.buttons) { - for (var i = 0; i < this.buttons.length; i++) { - if (!(this.buttons[i] instanceof Button)) { - this.buttons[i] = new Button( - utils.extend( - this.buttons[i], - { - editor: this.editor - }, - true - ) - ); - } - } - } - }, - initResizeEvent: function() { - var me = this; - - domUtils.on(window, "resize", function() { - if (me._hidden || me._hidden === undefined) { - return; - } - - if (me.__resizeTimer) { - window.clearTimeout(me.__resizeTimer); - } - - me.__resizeTimer = window.setTimeout(function() { - me.__resizeTimer = null; - - var dialogWrapNode = me.getDom(), - contentNode = me.getDom("content"), - wrapRect = UE.ui.uiUtils.getClientRect(dialogWrapNode), - contentRect = UE.ui.uiUtils.getClientRect(contentNode), - vpRect = uiUtils.getViewportRect(); - - contentNode.style.width = - vpRect.width - wrapRect.width + contentRect.width + "px"; - contentNode.style.height = - vpRect.height - wrapRect.height + contentRect.height + "px"; - - dialogWrapNode.style.width = vpRect.width + "px"; - dialogWrapNode.style.height = vpRect.height + "px"; - - me.fireEvent("resize"); - }, 100); - }); - }, - fitSize: function() { - var popBodyEl = this.getDom("body"); - // if (!(baidu.editor.browser.ie && baidu.editor.browser.version == 7)) { - // uiUtils.removeStyle(popBodyEl, 'width'); - // uiUtils.removeStyle(popBodyEl, 'height'); - // } - var size = this.mesureSize(); - popBodyEl.style.width = size.width + "px"; - popBodyEl.style.height = size.height + "px"; - return size; - }, - safeSetOffset: function(offset) { - var me = this; - var el = me.getDom(); - var vpRect = uiUtils.getViewportRect(); - var rect = uiUtils.getClientRect(el); - var left = offset.left; - if (left + rect.width > vpRect.right) { - left = vpRect.right - rect.width; - } - var top = offset.top; - if (top + rect.height > vpRect.bottom) { - top = vpRect.bottom - rect.height; - } - el.style.left = Math.max(left, 0) + "px"; - el.style.top = Math.max(top, 0) + "px"; - }, - showAtCenter: function() { - var vpRect = uiUtils.getViewportRect(); - - if (!this.fullscreen) { - this.getDom().style.display = ""; - var popSize = this.fitSize(); - var titleHeight = this.getDom("titlebar").offsetHeight | 0; - var left = vpRect.width / 2 - popSize.width / 2; - var top = - vpRect.height / 2 - (popSize.height - titleHeight) / 2 - titleHeight; - var popEl = this.getDom(); - this.safeSetOffset({ - left: Math.max(left | 0, 0), - top: Math.max(top | 0, 0) - }); - if (!domUtils.hasClass(popEl, "edui-state-centered")) { - popEl.className += " edui-state-centered"; - } - } else { - var dialogWrapNode = this.getDom(), - contentNode = this.getDom("content"); - - dialogWrapNode.style.display = "block"; - - var wrapRect = UE.ui.uiUtils.getClientRect(dialogWrapNode), - contentRect = UE.ui.uiUtils.getClientRect(contentNode); - dialogWrapNode.style.left = "-100000px"; - - contentNode.style.width = - vpRect.width - wrapRect.width + contentRect.width + "px"; - contentNode.style.height = - vpRect.height - wrapRect.height + contentRect.height + "px"; - - dialogWrapNode.style.width = vpRect.width + "px"; - dialogWrapNode.style.height = vpRect.height + "px"; - dialogWrapNode.style.left = 0; - - //保存环境的overflow值 - this._originalContext = { - html: { - overflowX: document.documentElement.style.overflowX, - overflowY: document.documentElement.style.overflowY - }, - body: { - overflowX: document.body.style.overflowX, - overflowY: document.body.style.overflowY - } - }; - - document.documentElement.style.overflowX = "hidden"; - document.documentElement.style.overflowY = "hidden"; - document.body.style.overflowX = "hidden"; - document.body.style.overflowY = "hidden"; - } - - this._show(); - }, - getContentHtml: function() { - var contentHtml = ""; - if (typeof this.content == "string") { - contentHtml = this.content; - } else if (this.iframeUrl) { - contentHtml = - ''; - } - return contentHtml; - }, - getHtmlTpl: function() { - var footHtml = ""; - - if (this.buttons) { - var buff = []; - for (var i = 0; i < this.buttons.length; i++) { - buff[i] = this.buttons[i].renderHtml(); - } - footHtml = - '
                      ' + - '
                      ' + - buff.join("") + - "
                      " + - "
                      "; - } - - return ( - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - '' + - (this.title || "") + - "" + - "
                      " + - this.closeButton.renderHtml() + - "
                      " + - '
                      ' + - (this.autoReset ? "" : this.getContentHtml()) + - "
                      " + - footHtml + - "
                      " - ); - }, - postRender: function() { - // todo: 保持居中/记住上次关闭位置选项 - if (!this.modalMask.getDom()) { - this.modalMask.render(); - this.modalMask.hide(); - } - if (!this.dragMask.getDom()) { - this.dragMask.render(); - this.dragMask.hide(); - } - var me = this; - this.addListener("show", function() { - me.modalMask.show(this.getDom().style.zIndex - 2); - }); - this.addListener("hide", function() { - me.modalMask.hide(); - }); - if (this.buttons) { - for (var i = 0; i < this.buttons.length; i++) { - this.buttons[i].postRender(); - } - } - domUtils.on(window, "resize", function() { - setTimeout(function() { - if (!me.isHidden()) { - me.safeSetOffset(uiUtils.getClientRect(me.getDom())); - } - }); - }); - - //hold住scroll事件,防止dialog的滚动影响页面 - // if( this.holdScroll ) { - // - // if( !me.iframeUrl ) { - // domUtils.on( document.getElementById( me.id + "_iframe"), !browser.gecko ? "mousewheel" : "DOMMouseScroll", function(e){ - // domUtils.preventDefault(e); - // } ); - // } else { - // me.addListener('dialogafterreset', function(){ - // window.setTimeout(function(){ - // var iframeWindow = document.getElementById( me.id + "_iframe").contentWindow; - // - // if( browser.ie ) { - // - // var timer = window.setInterval(function(){ - // - // if( iframeWindow.document && iframeWindow.document.body ) { - // window.clearInterval( timer ); - // timer = null; - // domUtils.on( iframeWindow.document.body, !browser.gecko ? "mousewheel" : "DOMMouseScroll", function(e){ - // domUtils.preventDefault(e); - // } ); - // } - // - // }, 100); - // - // } else { - // domUtils.on( iframeWindow, !browser.gecko ? "mousewheel" : "DOMMouseScroll", function(e){ - // domUtils.preventDefault(e); - // } ); - // } - // - // }, 1); - // }); - // } - // - // } - this._hide(); - }, - mesureSize: function() { - var body = this.getDom("body"); - var width = uiUtils.getClientRect(this.getDom("content")).width; - var dialogBodyStyle = body.style; - dialogBodyStyle.width = width; - return uiUtils.getClientRect(body); - }, - _onTitlebarMouseDown: function(evt, el) { - if (this.draggable) { - var rect; - var vpRect = uiUtils.getViewportRect(); - var me = this; - uiUtils.startDrag(evt, { - ondragstart: function() { - rect = uiUtils.getClientRect(me.getDom()); - me.getDom("contmask").style.visibility = "visible"; - me.dragMask.show(me.getDom().style.zIndex - 1); - }, - ondragmove: function(x, y) { - var left = rect.left + x; - var top = rect.top + y; - me.safeSetOffset({ - left: left, - top: top - }); - }, - ondragstop: function() { - me.getDom("contmask").style.visibility = "hidden"; - domUtils.removeClasses(me.getDom(), ["edui-state-centered"]); - me.dragMask.hide(); - } - }); - } - }, - reset: function() { - this.getDom("content").innerHTML = this.getContentHtml(); - this.fireEvent("dialogafterreset"); - }, - _show: function() { - if (this._hidden) { - this.getDom().style.display = ""; - - //要高过编辑器的zindxe - this.editor.container.style.zIndex && - (this.getDom().style.zIndex = - this.editor.container.style.zIndex * 1 + 10); - this._hidden = false; - this.fireEvent("show"); - baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex = - this.getDom().style.zIndex - 4; - } - }, - isHidden: function() { - return this._hidden; - }, - _hide: function() { - if (!this._hidden) { - var wrapNode = this.getDom(); - wrapNode.style.display = "none"; - wrapNode.style.zIndex = ""; - wrapNode.style.width = ""; - wrapNode.style.height = ""; - this._hidden = true; - this.fireEvent("hide"); - } - }, - open: function() { - if (this.autoReset) { - //有可能还没有渲染 - try { - this.reset(); - } catch (e) { - this.render(); - this.open(); - } - } - this.showAtCenter(); - if (this.iframeUrl) { - try { - this.getDom("iframe").focus(); - } catch (ex) {} - } - activeDialog = this; - }, - _onCloseButtonClick: function(evt, el) { - this.close(false); - }, - close: function(ok) { - if (this.fireEvent("close", ok) !== false) { - //还原环境 - if (this.fullscreen) { - document.documentElement.style.overflowX = this._originalContext.html.overflowX; - document.documentElement.style.overflowY = this._originalContext.html.overflowY; - document.body.style.overflowX = this._originalContext.body.overflowX; - document.body.style.overflowY = this._originalContext.body.overflowY; - delete this._originalContext; - } - this._hide(); - - //销毁content - var content = this.getDom("content"); - var iframe = this.getDom("iframe"); - if (content && iframe) { - var doc = iframe.contentDocument || iframe.contentWindow.document; - doc && (doc.body.innerHTML = ""); - domUtils.remove(content); - } - } - } - }; - utils.inherits(Dialog, UIBase); -})(); - - -// ui/menubutton.js -///import core -///import uicore -///import ui/menu.js -///import ui/splitbutton.js -;(function() { - var utils = baidu.editor.utils, - Menu = baidu.editor.ui.Menu, - SplitButton = baidu.editor.ui.SplitButton, - MenuButton = (baidu.editor.ui.MenuButton = function(options) { - this.initOptions(options); - this.initMenuButton(); - }); - MenuButton.prototype = { - initMenuButton: function() { - var me = this; - this.uiName = "menubutton"; - this.popup = new Menu({ - items: me.items, - className: me.className, - editor: me.editor - }); - this.popup.addListener("show", function() { - var list = this; - for (var i = 0; i < list.items.length; i++) { - list.items[i].removeState("checked"); - if (list.items[i].value == me._value) { - list.items[i].addState("checked"); - this.value = me._value; - } - } - }); - this.initSplitButton(); - }, - setValue: function(value) { - this._value = value; - } - }; - utils.inherits(MenuButton, SplitButton); -})(); - - -// ui/multiMenu.js -///import core -///import uicore -///commands 表情 -;(function() { - var utils = baidu.editor.utils, - Popup = baidu.editor.ui.Popup, - SplitButton = baidu.editor.ui.SplitButton, - MultiMenuPop = (baidu.editor.ui.MultiMenuPop = function(options) { - this.initOptions(options); - this.initMultiMenu(); - }); - - MultiMenuPop.prototype = { - initMultiMenu: function() { - var me = this; - this.popup = new Popup({ - content: "", - editor: me.editor, - iframe_rendered: false, - onshow: function() { - if (!this.iframe_rendered) { - this.iframe_rendered = true; - this.getDom("content").innerHTML = - ''; - me.editor.container.style.zIndex && - (this.getDom().style.zIndex = - me.editor.container.style.zIndex * 1 + 1); - } - } - // canSideUp:false, - // canSideLeft:false - }); - this.onbuttonclick = function() { - this.showPopup(); - }; - this.initSplitButton(); - } - }; - - utils.inherits(MultiMenuPop, SplitButton); -})(); - - -// ui/shortcutmenu.js -;(function() { - var UI = baidu.editor.ui, - UIBase = UI.UIBase, - uiUtils = UI.uiUtils, - utils = baidu.editor.utils, - domUtils = baidu.editor.dom.domUtils; - - var allMenus = [], //存储所有快捷菜单 - timeID, - isSubMenuShow = false; //是否有子pop显示 - - var ShortCutMenu = (UI.ShortCutMenu = function(options) { - this.initOptions(options); - this.initShortCutMenu(); - }); - - ShortCutMenu.postHide = hideAllMenu; - - ShortCutMenu.prototype = { - isHidden: true, - SPACE: 5, - initShortCutMenu: function() { - this.items = this.items || []; - this.initUIBase(); - this.initItems(); - this.initEvent(); - allMenus.push(this); - }, - initEvent: function() { - var me = this, - doc = me.editor.document; - - domUtils.on(doc, "mousemove", function(e) { - if (me.isHidden === false) { - //有pop显示就不隐藏快捷菜单 - if (me.getSubMenuMark() || me.eventType == "contextmenu") return; - - var flag = true, - el = me.getDom(), - wt = el.offsetWidth, - ht = el.offsetHeight, - distanceX = wt / 2 + me.SPACE, //距离中心X标准 - distanceY = ht / 2, //距离中心Y标准 - x = Math.abs(e.screenX - me.left), //离中心距离横坐标 - y = Math.abs(e.screenY - me.top); //离中心距离纵坐标 - - clearTimeout(timeID); - timeID = setTimeout(function() { - if (y > 0 && y < distanceY) { - me.setOpacity(el, "1"); - } else if (y > distanceY && y < distanceY + 70) { - me.setOpacity(el, "0.5"); - flag = false; - } else if (y > distanceY + 70 && y < distanceY + 140) { - me.hide(); - } - - if (flag && x > 0 && x < distanceX) { - me.setOpacity(el, "1"); - } else if (x > distanceX && x < distanceX + 70) { - me.setOpacity(el, "0.5"); - } else if (x > distanceX + 70 && x < distanceX + 140) { - me.hide(); - } - }); - } - }); - - //ie\ff下 mouseout不准 - if (browser.chrome) { - domUtils.on(doc, "mouseout", function(e) { - var relatedTgt = e.relatedTarget || e.toElement; - - if (relatedTgt == null || relatedTgt.tagName == "HTML") { - me.hide(); - } - }); - } - - me.editor.addListener("afterhidepop", function() { - if (!me.isHidden) { - isSubMenuShow = true; - } - }); - }, - initItems: function() { - if (utils.isArray(this.items)) { - for (var i = 0, len = this.items.length; i < len; i++) { - var item = this.items[i].toLowerCase(); - - if (UI[item]) { - this.items[i] = new UI[item](this.editor); - this.items[i].className += " edui-shortcutsubmenu "; - } - } - } - }, - setOpacity: function(el, value) { - if (browser.ie && browser.version < 9) { - el.style.filter = "alpha(opacity = " + parseFloat(value) * 100 + ");"; - } else { - el.style.opacity = value; - } - }, - getSubMenuMark: function() { - isSubMenuShow = false; - var layerEle = uiUtils.getFixedLayer(); - var list = domUtils.getElementsByTagName(layerEle, "div", function(node) { - return domUtils.hasClass(node, "edui-shortcutsubmenu edui-popup"); - }); - - for (var i = 0, node; (node = list[i++]); ) { - if (node.style.display != "none") { - isSubMenuShow = true; - } - } - return isSubMenuShow; - }, - show: function(e, hasContextmenu) { - var me = this, - offset = {}, - el = this.getDom(), - fixedlayer = uiUtils.getFixedLayer(); - - function setPos(offset) { - if (offset.left < 0) { - offset.left = 0; - } - if (offset.top < 0) { - offset.top = 0; - } - el.style.cssText = - "position:absolute;left:" + - offset.left + - "px;top:" + - offset.top + - "px;"; - } - - function setPosByCxtMenu(menu) { - if (!menu.tagName) { - menu = menu.getDom(); - } - offset.left = parseInt(menu.style.left); - offset.top = parseInt(menu.style.top); - offset.top -= el.offsetHeight + 15; - setPos(offset); - } - - me.eventType = e.type; - el.style.cssText = "display:block;left:-9999px"; - - if (e.type == "contextmenu" && hasContextmenu) { - var menu = domUtils.getElementsByTagName( - fixedlayer, - "div", - "edui-contextmenu" - )[0]; - if (menu) { - setPosByCxtMenu(menu); - } else { - me.editor.addListener("aftershowcontextmenu", function(type, menu) { - setPosByCxtMenu(menu); - }); - } - } else { - offset = uiUtils.getViewportOffsetByEvent(e); - offset.top -= el.offsetHeight + me.SPACE; - offset.left += me.SPACE + 20; - setPos(offset); - me.setOpacity(el, 0.2); - } - - me.isHidden = false; - me.left = e.screenX + el.offsetWidth / 2 - me.SPACE; - me.top = e.screenY - el.offsetHeight / 2 - me.SPACE; - - if (me.editor) { - el.style.zIndex = me.editor.container.style.zIndex * 1 + 10; - fixedlayer.style.zIndex = el.style.zIndex - 1; - } - }, - hide: function() { - if (this.getDom()) { - this.getDom().style.display = "none"; - } - this.isHidden = true; - }, - postRender: function() { - if (utils.isArray(this.items)) { - for (var i = 0, item; (item = this.items[i++]); ) { - item.postRender(); - } - } - }, - getHtmlTpl: function() { - var buff; - if (utils.isArray(this.items)) { - buff = []; - for (var i = 0; i < this.items.length; i++) { - buff[i] = this.items[i].renderHtml(); - } - buff = buff.join(""); - } else { - buff = this.items; - } - - return ( - '
                      ' + - buff + - "
                      " - ); - } - }; - - utils.inherits(ShortCutMenu, UIBase); - - function hideAllMenu(e) { - var tgt = e.target || e.srcElement, - cur = domUtils.findParent( - tgt, - function(node) { - return ( - domUtils.hasClass(node, "edui-shortcutmenu") || - domUtils.hasClass(node, "edui-popup") - ); - }, - true - ); - - if (!cur) { - for (var i = 0, menu; (menu = allMenus[i++]); ) { - menu.hide(); - } - } - } - - domUtils.on(document, "mousedown", function(e) { - hideAllMenu(e); - }); - - domUtils.on(window, "scroll", function(e) { - hideAllMenu(e); - }); -})(); - - -// ui/breakline.js -;(function() { - var utils = baidu.editor.utils, - UIBase = baidu.editor.ui.UIBase, - Breakline = (baidu.editor.ui.Breakline = function(options) { - this.initOptions(options); - this.initSeparator(); - }); - Breakline.prototype = { - uiName: "Breakline", - initSeparator: function() { - this.initUIBase(); - }, - getHtmlTpl: function() { - return "
                      "; - } - }; - utils.inherits(Breakline, UIBase); -})(); - - -// ui/message.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - domUtils = baidu.editor.dom.domUtils, - UIBase = baidu.editor.ui.UIBase, - Message = (baidu.editor.ui.Message = function(options) { - this.initOptions(options); - this.initMessage(); - }); - - Message.prototype = { - initMessage: function() { - this.initUIBase(); - }, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ×
                      ' + - '
                      ' + - ' ' + - '
                      ' + - '
                      ' + - "
                      " + - "
                      " + - "
                      " - ); - }, - reset: function(opt) { - var me = this; - if (!opt.keepshow) { - clearTimeout(this.timer); - me.timer = setTimeout(function() { - me.hide(); - }, opt.timeout || 4000); - } - - opt.content !== undefined && me.setContent(opt.content); - opt.type !== undefined && me.setType(opt.type); - - me.show(); - }, - postRender: function() { - var me = this, - closer = this.getDom("closer"); - closer && - domUtils.on(closer, "click", function() { - me.hide(); - }); - }, - setContent: function(content) { - this.getDom("content").innerHTML = content; - }, - setType: function(type) { - type = type || "info"; - var body = this.getDom("body"); - body.className = body.className.replace( - /edui-message-type-[\w-]+/, - "edui-message-type-" + type - ); - }, - getContent: function() { - return this.getDom("content").innerHTML; - }, - getType: function() { - var arr = this.getDom("body").match(/edui-message-type-([\w-]+)/); - return arr ? arr[1] : ""; - }, - show: function() { - this.getDom().style.display = "block"; - }, - hide: function() { - var dom = this.getDom(); - if (dom) { - dom.style.display = "none"; - dom.parentNode && dom.parentNode.removeChild(dom); - } - } - }; - - utils.inherits(Message, UIBase); -})(); - - -// ui/iconfont.js -;(function(window){var svgSprite='';var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) - -// adapter/editorui.js -//ui跟编辑器的适配層 -//那个按钮弹出是dialog,是下拉筐等都是在这个js中配置 -//自己写的ui也要在这里配置,放到baidu.editor.ui下边,当编辑器实例化的时候会根据neditor.config中的toolbars找到相应的进行实例化 -;(function() { - var utils = baidu.editor.utils; - var editorui = baidu.editor.ui; - var _Dialog = editorui.Dialog; - editorui.buttons = {}; - - editorui.Dialog = function(options) { - var dialog = new _Dialog(options); - dialog.addListener("hide", function() { - if (dialog.editor) { - var editor = dialog.editor; - try { - if (browser.gecko) { - var y = editor.window.scrollY, - x = editor.window.scrollX; - editor.body.focus(); - editor.window.scrollTo(x, y); - } else { - editor.focus(); - } - } catch (ex) {} - } - }); - return dialog; - }; - - var iframeUrlMap = { - anchor: "~/dialogs/anchor/anchor.html", - insertimage: "~/dialogs/image/image.html", - link: "~/dialogs/link/link.html", - spechars: "~/dialogs/spechars/spechars.html", - searchreplace: "~/dialogs/searchreplace/searchreplace.html", - map: "~/dialogs/map/map.html", - gmap: "~/dialogs/gmap/gmap.html", - insertvideo: "~/dialogs/video/video.html", - help: "~/dialogs/help/help.html", - preview: "~/dialogs/preview/preview.html", - emotion: "~/dialogs/emotion/emotion.html", - wordimage: "~/dialogs/wordimage/wordimage.html", - attachment: "~/dialogs/attachment/attachment.html", - insertframe: "~/dialogs/insertframe/insertframe.html", - edittip: "~/dialogs/table/edittip.html", - edittable: "~/dialogs/table/edittable.html", - edittd: "~/dialogs/table/edittd.html", - webapp: "~/dialogs/webapp/webapp.html", - snapscreen: "~/dialogs/snapscreen/snapscreen.html", - scrawl: "~/dialogs/scrawl/scrawl.html", - music: "~/dialogs/music/music.html", - template: "~/dialogs/template/template.html", - background: "~/dialogs/background/background.html", - charts: "~/dialogs/charts/charts.html" - }; - //为工具栏添加按钮,以下都是统一的按钮触发命令,所以写在一起 - var btnCmds = [ - "undo", - "redo", - "formatmatch", - "bold", - "italic", - "underline", - "fontborder", - "touppercase", - "tolowercase", - "strikethrough", - "subscript", - "superscript", - "source", - "indent", - "outdent", - "blockquote", - "pasteplain", - "pagebreak", - "selectall", - "print", - "horizontal", - "removeformat", - "time", - "date", - "unlink", - "insertparagraphbeforetable", - "insertrow", - "insertcol", - "mergeright", - "mergedown", - "deleterow", - "deletecol", - "splittorows", - "splittocols", - "splittocells", - "mergecells", - "deletetable", - "drafts" - ]; - - for (var i = 0, ci; (ci = btnCmds[i++]); ) { - ci = ci.toLowerCase(); - editorui[ci] = (function(cmd) { - return function(editor) { - var ui = new editorui.Button({ - className: "edui-for-" + cmd, - title: - editor.options.labelMap[cmd] || - editor.getLang("labelMap." + cmd) || - "", - onclick: function() { - editor.execCommand(cmd); - }, - theme: editor.options.theme, - showText: false - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function( - type, - causeByUi, - uiReady - ) { - var state = editor.queryCommandState(cmd); - if (state == -1) { - ui.setDisabled(true); - ui.setChecked(false); - } else { - if (!uiReady) { - ui.setDisabled(false); - ui.setChecked(state); - } - } - }); - return ui; - }; - })(ci); - } - - //清除文档 - editorui.cleardoc = function(editor) { - var ui = new editorui.Button({ - className: "edui-for-cleardoc", - title: - editor.options.labelMap.cleardoc || - editor.getLang("labelMap.cleardoc") || - "", - theme: editor.options.theme, - onclick: function() { - if (confirm(editor.getLang("confirmClear"))) { - editor.execCommand("cleardoc"); - } - } - }); - editorui.buttons["cleardoc"] = ui; - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState("cleardoc") == -1); - }); - return ui; - }; - - //排版,图片排版,文字方向 - var typeset = { - justify: ["left", "right", "center", "justify"], - imagefloat: ["none", "left", "center", "right"], - directionality: ["ltr", "rtl"] - }; - - for (var p in typeset) { - (function(cmd, val) { - for (var i = 0, ci; (ci = val[i++]); ) { - (function(cmd2) { - editorui[cmd.replace("float", "") + cmd2] = function(editor) { - var ui = new editorui.Button({ - className: "edui-for-" + cmd.replace("float", "") + cmd2, - title: - editor.options.labelMap[cmd.replace("float", "") + cmd2] || - editor.getLang( - "labelMap." + cmd.replace("float", "") + cmd2 - ) || - "", - theme: editor.options.theme, - onclick: function() { - editor.execCommand(cmd, cmd2); - } - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function( - type, - causeByUi, - uiReady - ) { - ui.setDisabled(editor.queryCommandState(cmd) == -1); - ui.setChecked(editor.queryCommandValue(cmd) == cmd2 && !uiReady); - }); - return ui; - }; - })(ci); - } - })(p, typeset[p]); - } - - //字体颜色和背景颜色 - for (var i = 0, ci; (ci = ["backcolor", "forecolor"][i++]); ) { - editorui[ci] = (function(cmd) { - return function(editor) { - var ui = new editorui.ColorButton({ - className: "edui-for-" + cmd, - color: "default", - title: - editor.options.labelMap[cmd] || - editor.getLang("labelMap." + cmd) || - "", - editor: editor, - onpickcolor: function(t, color) { - editor.execCommand(cmd, color); - }, - onpicknocolor: function() { - editor.execCommand(cmd, "default"); - this.setColor("transparent"); - this.color = "default"; - }, - onbuttonclick: function() { - editor.execCommand(cmd, this.color); - } - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState(cmd) == -1); - }); - return ui; - }; - })(ci); - } - - var dialogBtns = { - noOk: ["searchreplace", "help", "spechars", "webapp", "preview"], - ok: [ - "attachment", - "anchor", - "link", - "insertimage", - "map", - "gmap", - "insertframe", - "wordimage", - "insertvideo", - "insertframe", - "edittip", - "edittable", - "edittd", - "scrawl", - "template", - "music", - "background", - "charts" - ] - }; - - for (var p in dialogBtns) { - (function(type, vals) { - for (var i = 0, ci; (ci = vals[i++]); ) { - //todo opera下存在问题 - if (browser.opera && ci === "searchreplace") { - continue; - } - (function(cmd) { - editorui[cmd] = function(editor, iframeUrl, title) { - iframeUrl = - iframeUrl || - (editor.options.iframeUrlMap || {})[cmd] || - iframeUrlMap[cmd]; - title = - editor.options.labelMap[cmd] || - editor.getLang("labelMap." + cmd) || - ""; - - var dialog; - //没有iframeUrl不创建dialog - if (iframeUrl) { - dialog = new editorui.Dialog( - utils.extend( - { - iframeUrl: editor.ui.mapUrl(iframeUrl), - editor: editor, - className: "edui-for-" + cmd, - title: title, - holdScroll: cmd === "insertimage", - fullscreen: /charts|preview/.test(cmd), - closeDialog: editor.getLang("closeDialog") - }, - type == "ok" - ? { - buttons: [ - { - className: "edui-okbutton", - label: editor.getLang("ok"), - editor: editor, - onclick: function() { - dialog.close(true); - } - }, - { - className: "edui-cancelbutton", - label: editor.getLang("cancel"), - editor: editor, - onclick: function() { - dialog.close(false); - } - } - ] - } - : {} - ) - ); - - editor.ui._dialogs[cmd + "Dialog"] = dialog; - } - - var ui = new editorui.Button({ - className: "edui-for-" + cmd, - title: title, - onclick: function() { - if (dialog) { - switch (cmd) { - case "wordimage": - var images = editor.execCommand("wordimage"); - if (images && images.length) { - dialog.render(); - dialog.open(); - } - break; - case "scrawl": - if (editor.queryCommandState("scrawl") != -1) { - dialog.render(); - dialog.open(); - } - - break; - default: - dialog.render(); - dialog.open(); - } - } - }, - theme: editor.options.theme, - disabled: - (cmd == "scrawl" && editor.queryCommandState("scrawl") == -1) || - cmd == "charts" - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function() { - //只存在于右键菜单而无工具栏按钮的ui不需要检测状态 - var unNeedCheckState = { edittable: 1 }; - if (cmd in unNeedCheckState) return; - - var state = editor.queryCommandState(cmd); - if (ui.getDom()) { - ui.setDisabled(state == -1); - ui.setChecked(state); - } - }); - - return ui; - }; - })(ci.toLowerCase()); - } - })(p, dialogBtns[p]); - } - - editorui.snapscreen = function(editor, iframeUrl, title) { - title = - editor.options.labelMap["snapscreen"] || - editor.getLang("labelMap.snapscreen") || - ""; - var ui = new editorui.Button({ - className: "edui-for-snapscreen", - title: title, - onclick: function() { - editor.execCommand("snapscreen"); - }, - theme: editor.options.theme - }); - editorui.buttons["snapscreen"] = ui; - iframeUrl = - iframeUrl || - (editor.options.iframeUrlMap || {})["snapscreen"] || - iframeUrlMap["snapscreen"]; - if (iframeUrl) { - var dialog = new editorui.Dialog({ - iframeUrl: editor.ui.mapUrl(iframeUrl), - editor: editor, - className: "edui-for-snapscreen", - title: title, - buttons: [ - { - className: "edui-okbutton", - label: editor.getLang("ok"), - editor: editor, - onclick: function() { - dialog.close(true); - } - }, - { - className: "edui-cancelbutton", - label: editor.getLang("cancel"), - editor: editor, - onclick: function() { - dialog.close(false); - } - } - ] - }); - dialog.render(); - editor.ui._dialogs["snapscreenDialog"] = dialog; - } - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState("snapscreen") == -1); - }); - return ui; - }; - - editorui.insertcode = function(editor, list, title) { - list = editor.options["insertcode"] || []; - title = - editor.options.labelMap["insertcode"] || - editor.getLang("labelMap.insertcode") || - ""; - // if (!list.length) return; - var items = []; - utils.each(list, function(key, val) { - items.push({ - label: key, - value: val, - theme: editor.options.theme, - renderLabelHtml: function() { - return ( - '
                      ' + (this.label || "") + "
                      " - ); - } - }); - }); - - var ui = new editorui.Combox({ - editor: editor, - items: items, - onselect: function(t, index) { - editor.execCommand("insertcode", this.items[index].value); - }, - onbuttonclick: function() { - this.showPopup(); - }, - title: title, - initValue: title, - className: "edui-for-insertcode", - indexByValue: function(value) { - if (value) { - for (var i = 0, ci; (ci = this.items[i]); i++) { - if (ci.value.indexOf(value) != -1) return i; - } - } - - return -1; - } - }); - editorui.buttons["insertcode"] = ui; - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - if (!uiReady) { - var state = editor.queryCommandState("insertcode"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("insertcode"); - if (!value) { - ui.setValue(title); - return; - } - //trace:1871 ie下从源码模式切换回来时,字体会带单引号,而且会有逗号 - value && (value = value.replace(/['"]/g, "").split(",")[0]); - ui.setValue(value); - } - } - }); - return ui; - }; - editorui.fontfamily = function(editor, list, title) { - list = editor.options["fontfamily"] || []; - title = - editor.options.labelMap["fontfamily"] || - editor.getLang("labelMap.fontfamily") || - ""; - if (!list.length) return; - for (var i = 0, ci, items = []; (ci = list[i]); i++) { - var langLabel = editor.getLang("fontfamily")[ci.name] || ""; - (function(key, val) { - items.push({ - label: key, - value: val, - theme: editor.options.theme, - renderLabelHtml: function() { - return ( - '
                      ' + - (this.label || "") + - "
                      " - ); - } - }); - })(ci.label || langLabel, ci.val); - } - var ui = new editorui.Combox({ - editor: editor, - items: items, - onselect: function(t, index) { - editor.execCommand("FontFamily", this.items[index].value); - }, - onbuttonclick: function() { - this.showPopup(); - }, - title: title, - initValue: title, - className: "edui-for-fontfamily", - indexByValue: function(value) { - if (value) { - for (var i = 0, ci; (ci = this.items[i]); i++) { - if (ci.value.indexOf(value) != -1) return i; - } - } - - return -1; - } - }); - editorui.buttons["fontfamily"] = ui; - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - if (!uiReady) { - var state = editor.queryCommandState("FontFamily"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("FontFamily"); - //trace:1871 ie下从源码模式切换回来时,字体会带单引号,而且会有逗号 - value && (value = value.replace(/['"]/g, "").split(",")[0]); - ui.setValue(value); - } - } - }); - return ui; - }; - - editorui.fontsize = function(editor, list, title) { - title = - editor.options.labelMap["fontsize"] || - editor.getLang("labelMap.fontsize") || - ""; - list = list || editor.options["fontsize"] || []; - if (!list.length) return; - var items = []; - for (var i = 0; i < list.length; i++) { - var size = list[i] + "px"; - items.push({ - label: size, - value: size, - theme: editor.options.theme, - renderLabelHtml: function() { - return ( - '
                      ' + - (this.label || "") + - "
                      " - ); - } - }); - } - var ui = new editorui.Combox({ - editor: editor, - items: items, - title: title, - initValue: title, - onselect: function(t, index) { - editor.execCommand("FontSize", this.items[index].value); - }, - onbuttonclick: function() { - this.showPopup(); - }, - className: "edui-for-fontsize" - }); - editorui.buttons["fontsize"] = ui; - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - if (!uiReady) { - var state = editor.queryCommandState("FontSize"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - ui.setValue(editor.queryCommandValue("FontSize")); - } - } - }); - return ui; - }; - - editorui.paragraph = function(editor, list, title) { - title = - editor.options.labelMap["paragraph"] || - editor.getLang("labelMap.paragraph") || - ""; - list = editor.options["paragraph"] || []; - if (utils.isEmptyObject(list)) return; - var items = []; - for (var i in list) { - items.push({ - value: i, - label: list[i] || editor.getLang("paragraph")[i], - theme: editor.options.theme, - renderLabelHtml: function() { - return ( - '
                      ' + - (this.label || "") + - "
                      " - ); - } - }); - } - var ui = new editorui.Combox({ - editor: editor, - items: items, - title: title, - initValue: title, - className: "edui-for-paragraph", - onselect: function(t, index) { - editor.execCommand("Paragraph", this.items[index].value); - }, - onbuttonclick: function() { - this.showPopup(); - } - }); - editorui.buttons["paragraph"] = ui; - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - if (!uiReady) { - var state = editor.queryCommandState("Paragraph"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("Paragraph"); - var index = ui.indexByValue(value); - if (index != -1) { - ui.setValue(value); - } else { - ui.setValue(ui.initValue); - } - } - } - }); - return ui; - }; - - //自定义标题 - editorui.customstyle = function(editor) { - var list = editor.options["customstyle"] || [], - title = - editor.options.labelMap["customstyle"] || - editor.getLang("labelMap.customstyle") || - ""; - if (!list.length) return; - var langCs = editor.getLang("customstyle"); - for (var i = 0, items = [], t; (t = list[i++]); ) { - (function(t) { - var ck = {}; - ck.label = t.label ? t.label : langCs[t.name]; - ck.style = t.style; - ck.className = t.className; - ck.tag = t.tag; - items.push({ - label: ck.label, - value: ck, - theme: editor.options.theme, - renderLabelHtml: function() { - return ( - '
                      ' + - "<" + - ck.tag + - " " + - (ck.className ? ' class="' + ck.className + '"' : "") + - (ck.style ? ' style="' + ck.style + '"' : "") + - ">" + - ck.label + - "" + - "
                      " - ); - } - }); - })(t); - } - - var ui = new editorui.Combox({ - editor: editor, - items: items, - title: title, - initValue: title, - className: "edui-for-customstyle", - onselect: function(t, index) { - editor.execCommand("customstyle", this.items[index].value); - }, - onbuttonclick: function() { - this.showPopup(); - }, - indexByValue: function(value) { - for (var i = 0, ti; (ti = this.items[i++]); ) { - if (ti.label == value) { - return i - 1; - } - } - return -1; - } - }); - editorui.buttons["customstyle"] = ui; - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - if (!uiReady) { - var state = editor.queryCommandState("customstyle"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("customstyle"); - var index = ui.indexByValue(value); - if (index != -1) { - ui.setValue(value); - } else { - ui.setValue(ui.initValue); - } - } - } - }); - return ui; - }; - editorui.inserttable = function(editor, iframeUrl, title) { - title = - editor.options.labelMap["inserttable"] || - editor.getLang("labelMap.inserttable") || - ""; - var ui = new editorui.TableButton({ - editor: editor, - title: title, - className: "edui-for-inserttable", - onpicktable: function(t, numCols, numRows) { - editor.execCommand("InsertTable", { - numRows: numRows, - numCols: numCols, - border: 1 - }); - }, - onbuttonclick: function() { - this.showPopup(); - } - }); - editorui.buttons["inserttable"] = ui; - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState("inserttable") == -1); - }); - return ui; - }; - - editorui.lineheight = function(editor) { - var val = editor.options.lineheight || []; - if (!val.length) return; - for (var i = 0, ci, items = []; (ci = val[i++]); ) { - items.push({ - //todo:写死了 - label: ci, - value: ci, - theme: editor.options.theme, - onclick: function() { - editor.execCommand("lineheight", this.value); - } - }); - } - var ui = new editorui.MenuButton({ - editor: editor, - className: "edui-for-lineheight", - title: - editor.options.labelMap["lineheight"] || - editor.getLang("labelMap.lineheight") || - "", - items: items, - onbuttonclick: function() { - var value = editor.queryCommandValue("LineHeight") || this.value; - editor.execCommand("LineHeight", value); - } - }); - editorui.buttons["lineheight"] = ui; - editor.addListener("selectionchange", function() { - var state = editor.queryCommandState("LineHeight"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("LineHeight"); - value && ui.setValue((value + "").replace(/cm/, "")); - ui.setChecked(state); - } - }); - return ui; - }; - - var rowspacings = ["top", "bottom"]; - for (var r = 0, ri; (ri = rowspacings[r++]); ) { - (function(cmd) { - editorui["rowspacing" + cmd] = function(editor) { - var val = editor.options["rowspacing" + cmd] || []; - if (!val.length) return null; - for (var i = 0, ci, items = []; (ci = val[i++]); ) { - items.push({ - label: ci, - value: ci, - theme: editor.options.theme, - onclick: function() { - editor.execCommand("rowspacing", this.value, cmd); - } - }); - } - var ui = new editorui.MenuButton({ - editor: editor, - className: "edui-for-rowspacing" + cmd, - title: - editor.options.labelMap["rowspacing" + cmd] || - editor.getLang("labelMap.rowspacing" + cmd) || - "", - items: items, - onbuttonclick: function() { - var value = - editor.queryCommandValue("rowspacing", cmd) || this.value; - editor.execCommand("rowspacing", value, cmd); - } - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function() { - var state = editor.queryCommandState("rowspacing", cmd); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("rowspacing", cmd); - value && ui.setValue((value + "").replace(/%/, "")); - ui.setChecked(state); - } - }); - return ui; - }; - })(ri); - } - //有序,无序列表 - var lists = ["insertorderedlist", "insertunorderedlist"]; - for (var l = 0, cl; (cl = lists[l++]); ) { - (function(cmd) { - editorui[cmd] = function(editor) { - var vals = editor.options[cmd], - _onMenuClick = function() { - editor.execCommand(cmd, this.value); - }, - items = []; - for (var i in vals) { - items.push({ - label: vals[i] || editor.getLang()[cmd][i] || "", - value: i, - theme: editor.options.theme, - onclick: _onMenuClick - }); - } - var ui = new editorui.MenuButton({ - editor: editor, - className: "edui-for-" + cmd, - title: editor.getLang("labelMap." + cmd) || "", - items: items, - onbuttonclick: function() { - var value = editor.queryCommandValue(cmd) || this.value; - editor.execCommand(cmd, value); - } - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function() { - var state = editor.queryCommandState(cmd); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue(cmd); - ui.setValue(value); - ui.setChecked(state); - } - }); - return ui; - }; - })(cl); - } - - editorui.fullscreen = function(editor, title) { - title = - editor.options.labelMap["fullscreen"] || - editor.getLang("labelMap.fullscreen") || - ""; - var ui = new editorui.Button({ - className: "edui-for-fullscreen", - title: title, - theme: editor.options.theme, - onclick: function() { - if (editor.ui) { - editor.ui.setFullScreen(!editor.ui.isFullScreen()); - } - this.setChecked(editor.ui.isFullScreen()); - } - }); - editorui.buttons["fullscreen"] = ui; - editor.addListener("selectionchange", function() { - var state = editor.queryCommandState("fullscreen"); - ui.setDisabled(state == -1); - ui.setChecked(editor.ui.isFullScreen()); - }); - return ui; - }; - - // 表情 - editorui["emotion"] = function(editor, iframeUrl) { - var cmd = "emotion"; - var ui = new editorui.MultiMenuPop({ - title: - editor.options.labelMap[cmd] || - editor.getLang("labelMap." + cmd + "") || - "", - editor: editor, - className: "edui-for-" + cmd, - iframeUrl: editor.ui.mapUrl( - iframeUrl || - (editor.options.iframeUrlMap || {})[cmd] || - iframeUrlMap[cmd] - ) - }); - editorui.buttons[cmd] = ui; - - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState(cmd) == -1); - }); - return ui; - }; - - editorui.autotypeset = function(editor) { - var ui = new editorui.AutoTypeSetButton({ - editor: editor, - title: - editor.options.labelMap["autotypeset"] || - editor.getLang("labelMap.autotypeset") || - "", - className: "edui-for-autotypeset", - onbuttonclick: function() { - editor.execCommand("autotypeset"); - } - }); - editorui.buttons["autotypeset"] = ui; - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState("autotypeset") == -1); - }); - return ui; - }; - - /* 简单上传插件 */ - editorui["simpleupload"] = function(editor) { - var name = "simpleupload", - ui = new editorui.Button({ - className: "edui-for-" + name, - title: - editor.options.labelMap[name] || - editor.getLang("labelMap." + name) || - "", - onclick: function() {}, - theme: editor.options.theme, - showText: false - }); - editorui.buttons[name] = ui; - editor.addListener("ready", function() { - var b = ui.getDom("body"), - iconSpan = b.children[0]; - editor.fireEvent("simpleuploadbtnready", iconSpan); - }); - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - var state = editor.queryCommandState(name); - if (state == -1) { - ui.setDisabled(true); - ui.setChecked(false); - } else { - if (!uiReady) { - ui.setDisabled(false); - ui.setChecked(state); - } - } - }); - return ui; - }; -})(); - - -// adapter/editor.js -///import core -///commands 全屏 -///commandsName FullScreen -///commandsTitle 全屏 -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - UIBase = baidu.editor.ui.UIBase, - domUtils = baidu.editor.dom.domUtils; - var nodeStack = []; - - function EditorUI(options) { - this.initOptions(options); - this.initEditorUI(); - } - - EditorUI.prototype = { - uiName: "editor", - initEditorUI: function() { - this.editor.ui = this; - this._dialogs = {}; - this.initUIBase(); - this._initToolbars(); - var editor = this.editor, - me = this; - - editor.addListener("ready", function() { - //提供getDialog方法 - editor.getDialog = function(name) { - return editor.ui._dialogs[name + "Dialog"]; - }; - domUtils.on(editor.window, "scroll", function(evt) { - baidu.editor.ui.Popup.postHide(evt); - }); - //提供编辑器实时宽高(全屏时宽高不变化) - editor.ui._actualFrameWidth = editor.options.initialFrameWidth; - - UE.browser.ie && - UE.browser.version === 6 && - editor.container.ownerDocument.execCommand( - "BackgroundImageCache", - false, - true - ); - - //display bottom-bar label based on config - if (editor.options.elementPathEnabled) { - editor.ui.getDom("elementpath").innerHTML = - '
                      ' + - editor.getLang("elementPathTip") + - ":
                      "; - } - if (editor.options.wordCount) { - function countFn() { - setCount(editor, me); - domUtils.un(editor.document, "click", arguments.callee); - } - domUtils.on(editor.document, "click", countFn); - editor.ui.getDom("wordcount").innerHTML = editor.getLang( - "wordCountTip" - ); - } - editor.ui._scale(); - if (editor.options.scaleEnabled) { - if (editor.autoHeightEnabled) { - editor.disableAutoHeight(); - } - me.enableScale(); - } else { - me.disableScale(); - } - if ( - !editor.options.elementPathEnabled && - !editor.options.wordCount && - !editor.options.scaleEnabled - ) { - editor.ui.getDom("elementpath").style.display = "none"; - editor.ui.getDom("wordcount").style.display = "none"; - editor.ui.getDom("scale").style.display = "none"; - } - - if (!editor.selection.isFocus()) return; - editor.fireEvent("selectionchange", false, true); - }); - - editor.addListener("mousedown", function(t, evt) { - var el = evt.target || evt.srcElement; - baidu.editor.ui.Popup.postHide(evt, el); - baidu.editor.ui.ShortCutMenu.postHide(evt); - }); - editor.addListener("delcells", function() { - if (UE.ui["edittip"]) { - new UE.ui["edittip"](editor); - } - editor.getDialog("edittip").open(); - }); - - var pastePop, - isPaste = false, - timer; - editor.addListener("afterpaste", function() { - if (editor.queryCommandState("pasteplain")) return; - if (baidu.editor.ui.PastePicker) { - pastePop = new baidu.editor.ui.Popup({ - content: new baidu.editor.ui.PastePicker({ editor: editor }), - editor: editor, - className: "edui-wordpastepop" - }); - pastePop.render(); - } - isPaste = true; - }); - - editor.addListener("afterinserthtml", function() { - clearTimeout(timer); - timer = setTimeout(function() { - if (pastePop && (isPaste || editor.ui._isTransfer)) { - if (pastePop.isHidden()) { - var span = domUtils.createElement(editor.document, "span", { - style: "line-height:0px;", - innerHTML: "\ufeff" - }), - range = editor.selection.getRange(); - range.insertNode(span); - var tmp = getDomNode(span, "firstChild", "previousSibling"); - tmp && - pastePop.showAnchor(tmp.nodeType == 3 ? tmp.parentNode : tmp); - domUtils.remove(span); - } else { - pastePop.show(); - } - delete editor.ui._isTransfer; - isPaste = false; - } - }, 200); - }); - editor.addListener("contextmenu", function(t, evt) { - baidu.editor.ui.Popup.postHide(evt); - }); - editor.addListener("keydown", function(t, evt) { - if (pastePop) pastePop.dispose(evt); - var keyCode = evt.keyCode || evt.which; - if (evt.altKey && keyCode == 90) { - UE.ui.buttons["fullscreen"].onclick(); - } - }); - editor.addListener("wordcount", function(type) { - setCount(this, me); - }); - function setCount(editor, ui) { - editor.setOpt({ - wordCount: true, - maximumWords: 10000, - wordCountMsg: - editor.options.wordCountMsg || editor.getLang("wordCountMsg"), - wordOverFlowMsg: - editor.options.wordOverFlowMsg || editor.getLang("wordOverFlowMsg") - }); - var opt = editor.options, - max = opt.maximumWords, - msg = opt.wordCountMsg, - errMsg = opt.wordOverFlowMsg, - countDom = ui.getDom("wordcount"); - if (!opt.wordCount) { - return; - } - var count = editor.getContentLength(true); - if (count > max) { - countDom.innerHTML = errMsg; - editor.fireEvent("wordcountoverflow"); - } else { - countDom.innerHTML = msg - .replace("{#leave}", max - count) - .replace("{#count}", count); - } - } - - editor.addListener("selectionchange", function() { - if (editor.options.elementPathEnabled) { - me[ - (editor.queryCommandState("elementpath") == -1 ? "dis" : "en") + - "ableElementPath" - ](); - } - if (editor.options.scaleEnabled) { - me[ - (editor.queryCommandState("scale") == -1 ? "dis" : "en") + - "ableScale" - ](); - } - }); - var popup = new baidu.editor.ui.Popup({ - editor: editor, - content: "", - className: "edui-bubble", - _onEditButtonClick: function() { - this.hide(); - editor.ui._dialogs.linkDialog.open(); - }, - _onImgEditButtonClick: function(name) { - this.hide(); - editor.ui._dialogs[name] && editor.ui._dialogs[name].open(); - }, - _onImgSetFloat: function(value) { - this.hide(); - editor.execCommand("imagefloat", value); - }, - _setIframeAlign: function(value) { - var frame = popup.anchorEl; - var newFrame = frame.cloneNode(true); - switch (value) { - case -2: - newFrame.setAttribute("align", ""); - break; - case -1: - newFrame.setAttribute("align", "left"); - break; - case 1: - newFrame.setAttribute("align", "right"); - break; - } - frame.parentNode.insertBefore(newFrame, frame); - domUtils.remove(frame); - popup.anchorEl = newFrame; - popup.showAnchor(popup.anchorEl); - }, - _updateIframe: function() { - var frame = (editor._iframe = popup.anchorEl); - if (domUtils.hasClass(frame, "ueditor_baidumap")) { - editor.selection.getRange().selectNode(frame).select(); - editor.ui._dialogs.mapDialog.open(); - popup.hide(); - } else { - editor.ui._dialogs.insertframeDialog.open(); - popup.hide(); - } - }, - _onRemoveButtonClick: function(cmdName) { - editor.execCommand(cmdName); - this.hide(); - }, - queryAutoHide: function(el) { - if (el && el.ownerDocument == editor.document) { - if ( - el.tagName.toLowerCase() == "img" || - domUtils.findParentByTagName(el, "a", true) - ) { - return el !== popup.anchorEl; - } - } - return baidu.editor.ui.Popup.prototype.queryAutoHide.call(this, el); - } - }); - popup.render(); - if (editor.options.imagePopup) { - editor.addListener("mouseover", function(t, evt) { - evt = evt || window.event; - var el = evt.target || evt.srcElement; - if ( - editor.ui._dialogs.insertframeDialog && - /iframe/gi.test(el.tagName) - ) { - var html = popup.formatHtml( - "" + - editor.getLang("property") + - ': ' + - editor.getLang("default") + - '  ' + - editor.getLang("justifyleft") + - '  ' + - editor.getLang("justifyright") + - "  " + - ' ' + - editor.getLang("modify") + - "" - ); - if (html) { - popup.getDom("content").innerHTML = html; - popup.anchorEl = el; - popup.showAnchor(popup.anchorEl); - } else { - popup.hide(); - } - } - }); - editor.addListener("selectionchange", function(t, causeByUi) { - if (!causeByUi) return; - var html = "", - str = "", - img = editor.selection.getRange().getClosedNode(), - dialogs = editor.ui._dialogs; - if (img && img.tagName == "IMG") { - var dialogName = "insertimageDialog"; - if ( - img.className.indexOf("edui-faked-video") != -1 || - img.className.indexOf("edui-upload-video") != -1 - ) { - dialogName = "insertvideoDialog"; - } - if (img.className.indexOf("edui-faked-webapp") != -1) { - dialogName = "webappDialog"; - } - if (img.src.indexOf("https://api.map.baidu.com") != -1) { - dialogName = "mapDialog"; - } - if (img.className.indexOf("edui-faked-music") != -1) { - dialogName = "musicDialog"; - } - if ( - img.src.indexOf("http://maps.google.com/maps/api/staticmap") != -1 - ) { - dialogName = "gmapDialog"; - } - if (img.getAttribute("anchorname")) { - dialogName = "anchorDialog"; - html = popup.formatHtml( - "" + - editor.getLang("property") + - ': ' + - editor.getLang("modify") + - "  " + - "" + - editor.getLang("delete") + - "" - ); - } - if (img.getAttribute("word_img")) { - //todo 放到dialog去做查询 - editor.word_img = [img.getAttribute("word_img")]; - dialogName = "wordimageDialog"; - } - if ( - domUtils.hasClass(img, "loadingclass") || - domUtils.hasClass(img, "loaderrorclass") - ) { - dialogName = ""; - } - if (!dialogs[dialogName]) { - return; - } - str = - "" + - editor.getLang("property") + - ": " + - '' + - editor.getLang("default") + - "  " + - '' + - editor.getLang("justifyleft") + - "  " + - '' + - editor.getLang("justifyright") + - "  " + - '' + - editor.getLang("justifycenter") + - "  " + - "' + - editor.getLang("modify") + - ""; - - !html && (html = popup.formatHtml(str)); - } - if (editor.ui._dialogs.linkDialog) { - var link = editor.queryCommandValue("link"); - var url; - if ( - link && - (url = link.getAttribute("_href") || link.getAttribute("href", 2)) - ) { - var txt = url; - if (url.length > 30) { - txt = url.substring(0, 20) + "..."; - } - if (html) { - html += '
                      '; - } - html += popup.formatHtml( - "" + - editor.getLang("anthorMsg") + - ': ' + - txt + - "" + - ' ' + - editor.getLang("modify") + - "" + - ' ' + - editor.getLang("clear") + - "" - ); - popup.showAnchor(link); - } - } - - if (html) { - popup.getDom("content").innerHTML = html; - popup.anchorEl = img || link; - popup.showAnchor(popup.anchorEl); - } else { - popup.hide(); - } - }); - } - }, - _initToolbars: function() { - var editor = this.editor; - var toolbars = this.toolbars || []; - var toolbarUis = []; - var extraUIs = []; - for (var i = 0; i < toolbars.length; i++) { - var toolbar = toolbars[i]; - var toolbarUi = new baidu.editor.ui.Toolbar({ - theme: editor.options.theme - }); - for (var j = 0; j < toolbar.length; j++) { - var toolbarItem = toolbar[j]; - var toolbarItemUi = null; - if (typeof toolbarItem == "string") { - toolbarItem = toolbarItem.toLowerCase(); - if (toolbarItem == "|") { - toolbarItem = "Separator"; - } - if (toolbarItem == "||") { - toolbarItem = "Breakline"; - } - var ui = baidu.editor.ui[toolbarItem]; - if (ui) { - if (utils.isFunction(ui)) { - toolbarItemUi = new baidu.editor.ui[toolbarItem](editor); - } else { - if (ui.id && ui.id != editor.key) { - continue; - } - var itemUI = ui.execFn.call(editor, editor, toolbarItem); - if (itemUI) { - if (ui.index === undefined) { - toolbarUi.add(itemUI); - continue; - } else { - extraUIs.push({ - index: ui.index, - itemUI: itemUI - }); - } - } - } - } - //fullscreen这里单独处理一下,放到首行去 - if (toolbarItem == "fullscreen") { - if (toolbarUis && toolbarUis[0]) { - toolbarUis[0].items.splice(0, 0, toolbarItemUi); - } else { - toolbarItemUi && toolbarUi.items.splice(0, 0, toolbarItemUi); - } - continue; - } - } else { - toolbarItemUi = toolbarItem; - } - if (toolbarItemUi && toolbarItemUi.id) { - toolbarUi.add(toolbarItemUi); - } - } - toolbarUis[i] = toolbarUi; - } - - //接受外部定制的UI - - utils.each(extraUIs, function(obj) { - toolbarUi.add(obj.itemUI, obj.index); - }); - this.toolbars = toolbarUis; - }, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ' + - (this.toolbars.length - ? '
                      ' + - this.renderToolbarBoxHtml() + - "
                      " - : "") + - '" + - '
                      ' + - "
                      " + - '
                      ' + - "
                      " + - //modify wdcount by matao - '
                      ' + - '' + - '' + - '' + - "
                      " + - '
                      ' + - "
                      " - ); - }, - showWordImageDialog: function() { - this._dialogs["wordimageDialog"].open(); - }, - renderToolbarBoxHtml: function() { - var buff = []; - for (var i = 0; i < this.toolbars.length; i++) { - buff.push(this.toolbars[i].renderHtml()); - } - return buff.join(""); - }, - setFullScreen: function(fullscreen) { - var editor = this.editor, - container = editor.container.parentNode.parentNode; - if (this._fullscreen != fullscreen) { - this._fullscreen = fullscreen; - this.editor.fireEvent("beforefullscreenchange", fullscreen); - if (baidu.editor.browser.gecko) { - var bk = editor.selection.getRange().createBookmark(); - } - if (fullscreen) { - while (container.tagName != "BODY") { - var position = baidu.editor.dom.domUtils.getComputedStyle( - container, - "position" - ); - nodeStack.push(position); - container.style.position = "static"; - container = container.parentNode; - } - this._bakHtmlOverflow = document.documentElement.style.overflow; - this._bakBodyOverflow = document.body.style.overflow; - this._bakAutoHeight = this.editor.autoHeightEnabled; - this._bakScrollTop = Math.max( - document.documentElement.scrollTop, - document.body.scrollTop - ); - - this._bakEditorContaninerWidth = editor.iframe.parentNode.offsetWidth; - if (this._bakAutoHeight) { - //当全屏时不能执行自动长高 - editor.autoHeightEnabled = false; - this.editor.disableAutoHeight(); - } - - document.documentElement.style.overflow = "hidden"; - //修复,滚动条不收起的问题 - - window.scrollTo(0, window.scrollY); - this._bakCssText = this.getDom().style.cssText; - this._bakCssText1 = this.getDom("iframeholder").style.cssText; - editor.iframe.parentNode.style.width = ""; - this._updateFullScreen(); - } else { - while (container.tagName != "BODY") { - container.style.position = nodeStack.shift(); - container = container.parentNode; - } - this.getDom().style.cssText = this._bakCssText; - this.getDom("iframeholder").style.cssText = this._bakCssText1; - if (this._bakAutoHeight) { - editor.autoHeightEnabled = true; - this.editor.enableAutoHeight(); - } - - document.documentElement.style.overflow = this._bakHtmlOverflow; - document.body.style.overflow = this._bakBodyOverflow; - editor.iframe.parentNode.style.width = - this._bakEditorContaninerWidth + "px"; - window.scrollTo(0, this._bakScrollTop); - } - if (browser.gecko && editor.body.contentEditable === "true") { - var input = document.createElement("input"); - document.body.appendChild(input); - editor.body.contentEditable = false; - setTimeout(function() { - input.focus(); - setTimeout(function() { - editor.body.contentEditable = true; - editor.fireEvent("fullscreenchanged", fullscreen); - editor.selection.getRange().moveToBookmark(bk).select(true); - baidu.editor.dom.domUtils.remove(input); - fullscreen && window.scroll(0, 0); - }, 0); - }, 0); - } - - if (editor.body.contentEditable === "true") { - this.editor.fireEvent("fullscreenchanged", fullscreen); - this.triggerLayout(); - } - } - }, - _updateFullScreen: function() { - if (this._fullscreen) { - var vpRect = uiUtils.getViewportRect(); - this.getDom().style.cssText = - "border:0;position:absolute;left:0;top:" + - (this.editor.options.topOffset || 0) + - "px;width:" + - vpRect.width + - "px;height:" + - vpRect.height + - "px;z-index:" + - (this.getDom().style.zIndex * 1 + 100); - uiUtils.setViewportOffset(this.getDom(), { - left: 0, - top: this.editor.options.topOffset || 0 - }); - this.editor.setHeight( - vpRect.height - - this.getDom("toolbarbox").offsetHeight - - this.getDom("bottombar").offsetHeight - - (this.editor.options.topOffset || 0), - true - ); - //不手动调一下,会导致全屏失效 - if (browser.gecko) { - try { - window.onresize(); - } catch (e) {} - } - } - }, - _updateElementPath: function() { - var bottom = this.getDom("elementpath"), - list; - if ( - this.elementPathEnabled && - (list = this.editor.queryCommandValue("elementpath")) - ) { - var buff = []; - for (var i = 0, ci; (ci = list[i]); i++) { - buff[i] = this.formatHtml( - '' + - ci + - "" - ); - } - bottom.innerHTML = - '
                      ' + - this.editor.getLang("elementPathTip") + - ": " + - buff.join(" > ") + - "
                      "; - } else { - bottom.style.display = "none"; - } - }, - disableElementPath: function() { - var bottom = this.getDom("elementpath"); - bottom.innerHTML = ""; - bottom.style.display = "none"; - this.elementPathEnabled = false; - }, - enableElementPath: function() { - var bottom = this.getDom("elementpath"); - bottom.style.display = ""; - this.elementPathEnabled = true; - this._updateElementPath(); - }, - _scale: function() { - var doc = document, - editor = this.editor, - editorHolder = editor.container, - editorDocument = editor.document, - toolbarBox = this.getDom("toolbarbox"), - bottombar = this.getDom("bottombar"), - scale = this.getDom("scale"), - scalelayer = this.getDom("scalelayer"); - - var isMouseMove = false, - position = null, - minEditorHeight = 0, - minEditorWidth = editor.options.minFrameWidth, - pageX = 0, - pageY = 0, - scaleWidth = 0, - scaleHeight = 0; - - function down() { - position = domUtils.getXY(editorHolder); - - if (!minEditorHeight) { - minEditorHeight = - editor.options.minFrameHeight + - toolbarBox.offsetHeight + - bottombar.offsetHeight; - } - - scalelayer.style.cssText = - "position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:" + - editorHolder.offsetWidth + - "px;height:" + - editorHolder.offsetHeight + - "px;z-index:" + - (editor.options.zIndex + 1); - - domUtils.on(doc, "mousemove", move); - domUtils.on(editorDocument, "mouseup", up); - domUtils.on(doc, "mouseup", up); - } - - var me = this; - //by xuheng 全屏时关掉缩放 - this.editor.addListener("fullscreenchanged", function(e, fullScreen) { - if (fullScreen) { - me.disableScale(); - } else { - if (me.editor.options.scaleEnabled) { - me.enableScale(); - var tmpNode = me.editor.document.createElement("span"); - me.editor.body.appendChild(tmpNode); - me.editor.body.style.height = - Math.max( - domUtils.getXY(tmpNode).y, - me.editor.iframe.offsetHeight - 20 - ) + "px"; - domUtils.remove(tmpNode); - } - } - }); - function move(event) { - clearSelection(); - var e = event || window.event; - pageX = e.pageX || doc.documentElement.scrollLeft + e.clientX; - pageY = e.pageY || doc.documentElement.scrollTop + e.clientY; - scaleWidth = pageX - position.x; - scaleHeight = pageY - position.y; - - if (scaleWidth >= minEditorWidth) { - isMouseMove = true; - scalelayer.style.width = scaleWidth + "px"; - } - if (scaleHeight >= minEditorHeight) { - isMouseMove = true; - scalelayer.style.height = scaleHeight + "px"; - } - } - - function up() { - if (isMouseMove) { - isMouseMove = false; - editor.ui._actualFrameWidth = scalelayer.offsetWidth - 2; - editorHolder.style.width = editor.ui._actualFrameWidth + "px"; - - editor.setHeight( - scalelayer.offsetHeight - - bottombar.offsetHeight - - toolbarBox.offsetHeight - - 2, - true - ); - } - if (scalelayer) { - scalelayer.style.display = "none"; - } - clearSelection(); - domUtils.un(doc, "mousemove", move); - domUtils.un(editorDocument, "mouseup", up); - domUtils.un(doc, "mouseup", up); - } - - function clearSelection() { - if (browser.ie) doc.selection.clear(); - else window.getSelection().removeAllRanges(); - } - - this.enableScale = function() { - //trace:2868 - if (editor.queryCommandState("source") == 1) return; - scale.style.display = ""; - this.scaleEnabled = true; - domUtils.on(scale, "mousedown", down); - }; - this.disableScale = function() { - scale.style.display = "none"; - this.scaleEnabled = false; - domUtils.un(scale, "mousedown", down); - }; - }, - isFullScreen: function() { - return this._fullscreen; - }, - postRender: function() { - UIBase.prototype.postRender.call(this); - for (var i = 0; i < this.toolbars.length; i++) { - this.toolbars[i].postRender(); - } - var me = this; - var timerId, - domUtils = baidu.editor.dom.domUtils, - updateFullScreenTime = function() { - clearTimeout(timerId); - timerId = setTimeout(function() { - me._updateFullScreen(); - }); - }; - domUtils.on(window, "resize", updateFullScreenTime); - - me.addListener("destroy", function() { - domUtils.un(window, "resize", updateFullScreenTime); - clearTimeout(timerId); - }); - }, - showToolbarMsg: function(msg, flag) { - this.getDom("toolbarmsg_label").innerHTML = msg; - this.getDom("toolbarmsg").style.display = ""; - // - if (!flag) { - var w = this.getDom("upload_dialog"); - w.style.display = "none"; - } - }, - hideToolbarMsg: function() { - this.getDom("toolbarmsg").style.display = "none"; - }, - mapUrl: function(url) { - return url - ? url.replace("~/", this.editor.options.UEDITOR_HOME_URL || "") - : ""; - }, - triggerLayout: function() { - var dom = this.getDom(); - if (dom.style.zoom == "1") { - dom.style.zoom = "100%"; - } else { - dom.style.zoom = "1"; - } - } - }; - utils.inherits(EditorUI, baidu.editor.ui.UIBase); - - var instances = {}; - - UE.ui.Editor = function(options) { - var editor = new UE.Editor(options); - editor.options.editor = editor; - utils.loadFile(document, { - href: - editor.options.themePath + editor.options.theme + "/css/neditor.css", - tag: "link", - type: "text/css", - rel: "stylesheet" - }); - - var oldRender = editor.render; - editor.render = function(holder) { - if (holder.constructor === String) { - editor.key = holder; - instances[holder] = editor; - } - utils.domReady(function() { - editor.langIsReady - ? renderUI() - : editor.addListener("langReady", renderUI); - function renderUI() { - editor.setOpt({ - labelMap: editor.options.labelMap || editor.getLang("labelMap") - }); - new EditorUI(editor.options); - if (holder) { - if (holder.constructor === String) { - holder = document.getElementById(holder); - } - holder && - holder.getAttribute("name") && - (editor.options.textarea = holder.getAttribute("name")); - if (holder && /script|textarea/gi.test(holder.tagName)) { - var newDiv = document.createElement("div"); - holder.parentNode.insertBefore(newDiv, holder); - var cont = holder.value || holder.innerHTML; - editor.options.initialContent = /^[\t\r\n ]*$/.test(cont) - ? editor.options.initialContent - : cont - .replace(/>[\n\r\t]+([ ]{4})+/g, ">") - .replace(/[\n\r\t]+([ ]{4})+[\n\r\t]+<"); - holder.className && (newDiv.className = holder.className); - holder.style.cssText && - (newDiv.style.cssText = holder.style.cssText); - if (/textarea/i.test(holder.tagName)) { - editor.textarea = holder; - editor.textarea.style.display = "none"; - } else { - holder.parentNode.removeChild(holder); - } - if (holder.id) { - newDiv.id = holder.id; - domUtils.removeAttributes(holder, "id"); - } - holder = newDiv; - holder.innerHTML = ""; - } - } - domUtils.addClass(holder, "edui-" + editor.options.theme); - editor.ui.render(holder); - var opt = editor.options; - //给实例添加一个编辑器的容器引用 - editor.container = editor.ui.getDom(); - var parents = domUtils.findParents(holder, true); - var displays = []; - for (var i = 0, ci; (ci = parents[i]); i++) { - displays[i] = ci.style.display; - ci.style.display = "block"; - } - if (opt.initialFrameWidth) { - opt.minFrameWidth = opt.initialFrameWidth; - } else { - opt.minFrameWidth = opt.initialFrameWidth = holder.offsetWidth; - var styleWidth = holder.style.width; - if (/%$/.test(styleWidth)) { - opt.initialFrameWidth = styleWidth; - } - } - if (opt.initialFrameHeight) { - opt.minFrameHeight = opt.initialFrameHeight; - } else { - opt.initialFrameHeight = opt.minFrameHeight = holder.offsetHeight; - } - for (var i = 0, ci; (ci = parents[i]); i++) { - ci.style.display = displays[i]; - } - //编辑器最外容器设置了高度,会导致,编辑器不占位 - //todo 先去掉,没有找到原因 - if (holder.style.height) { - holder.style.height = ""; - } - editor.container.style.width = - opt.initialFrameWidth + - (/%$/.test(opt.initialFrameWidth) ? "" : "px"); - editor.container.style.zIndex = opt.zIndex; - oldRender.call(editor, editor.ui.getDom("iframeholder")); - editor.fireEvent("afteruiready"); - } - }); - }; - return editor; - }; - - /** - * @file - * @name UE - * @short UE - * @desc UEditor的顶部命名空间 - */ - /** - * @name getEditor - * @since 1.2.4+ - * @grammar UE.getEditor(id,[opt]) => Editor实例 - * @desc 提供一个全局的方法得到编辑器实例 - * - * * ''id'' 放置编辑器的容器id, 如果容器下的编辑器已经存在,就直接返回 - * * ''opt'' 编辑器的可选参数 - * @example - * UE.getEditor('containerId',{onready:function(){//创建一个编辑器实例 - * this.setContent('hello') - * }}); - * UE.getEditor('containerId'); //返回刚创建的实例 - * - */ - UE.getEditor = function(id, opt) { - var editor = instances[id]; - if (!editor) { - editor = instances[id] = new UE.ui.Editor(opt); - editor.render(id); - } - return editor; - }; - - UE.delEditor = function(id) { - var editor; - if ((editor = instances[id])) { - editor.key && editor.destroy(); - delete instances[id]; - } - }; - - UE.registerUI = function(uiName, fn, index, editorId) { - utils.each(uiName.split(/\s+/), function(name) { - baidu.editor.ui[name] = { - id: editorId, - execFn: fn, - index: index - }; - }); - }; -})(); - - -// adapter/message.js -UE.registerUI("message", function(editor) { - var editorui = baidu.editor.ui; - var Message = editorui.Message; - var holder; - var _messageItems = []; - var me = editor; - - me.setOpt("enableMessageShow", true); - if (me.getOpt("enableMessageShow") === false) { - return; - } - - me.addListener("ready", function() { - holder = document.getElementById(me.ui.id + "_message_holder"); - updateHolderPos(); - setTimeout(function() { - updateHolderPos(); - }, 500); - }); - - me.addListener("showmessage", function(type, opt) { - opt = utils.isString(opt) - ? { - content: opt - } - : opt; - var message = new Message({ - timeout: opt.timeout, - type: opt.type, - content: opt.content, - keepshow: opt.keepshow, - editor: me - }), - mid = opt.id || "msg_" + (+new Date()).toString(36); - message.render(holder); - _messageItems[mid] = message; - message.reset(opt); - updateHolderPos(); - return mid; - }); - - me.addListener("updatemessage", function(type, id, opt) { - opt = utils.isString(opt) - ? { - content: opt - } - : opt; - var message = _messageItems[id]; - message.render(holder); - message && message.reset(opt); - }); - - me.addListener("hidemessage", function(type, id) { - var message = _messageItems[id]; - message && message.hide(); - }); - - function updateHolderPos() { - if (!holder || !me.ui) return; - var toolbarbox = me.ui.getDom("toolbarbox"); - if (toolbarbox) { - holder.style.top = toolbarbox.offsetHeight + 3 + "px"; - } - holder.style.zIndex = - Math.max(me.options.zIndex, me.iframe.style.zIndex) + 1; - } -}); - - -// adapter/autosave.js -UE.registerUI("autosave", function(editor) { - var timer = null, - uid = null; - editor.on("afterautosave", function() { - clearTimeout(timer); - - timer = setTimeout(function() { - if (uid) { - editor.trigger("hidemessage", uid); - } - uid = editor.trigger("showmessage", { - content: editor.getLang("autosave.success"), - timeout: 2000 - }); - }, 2000); - }); -}); - - - -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.all.min.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.all.min.js deleted file mode 100644 index c207f65c18a71a9966c964ac41ad15174ac1653b..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.all.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * neditor - * version: 2.1.6 - * build: Thu Nov 29 2018 09:38:10 GMT+0000 (UTC) - */!function(){function getListener(a,b,c){var d;return b=b.toLowerCase(),(d=a.__allListeners||c&&(a.__allListeners={}))&&(d[b]||c&&(d[b]=[]))}function getDomNode(a,b,c,d,e,f){var g,h=d&&a[b];for(!h&&(h=a[c]);!h&&(g=(g||a).parentNode);){if("BODY"==g.tagName||f&&!f(g))return null;h=g[c]}return h&&e&&!e(h)?getDomNode(h,b,c,!1,e):h}UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var baidu=window.baidu||{};window.baidu=baidu,window.UE=baidu.editor={plugins:{},commands:{},instants:{},I18N:{},_customizeUI:{},version:"1.5.0"};var dom=UE.dom={},browser=UE.browser=function(){var a=navigator.userAgent.toLowerCase(),b=window.opera,c={ie:/(msie\s|trident.*rv:)([\w.]+)/i.test(a),opera:!!b&&b.version,webkit:a.indexOf(" applewebkit/")>-1,mac:a.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode};c.gecko="Gecko"==navigator.product&&!c.webkit&&!c.opera&&!c.ie;var d=0;if(c.ie){var e=a.match(/(?:msie\s([\w.]+))/),f=a.match(/(?:trident.*rv:([\w.]+))/);d=e&&f&&e[1]&&f[1]?Math.max(1*e[1],1*f[1]):e&&e[1]?1*e[1]:f&&f[1]?1*f[1]:0,c.ie11Compat=11==document.documentMode,c.ie9Compat=9==document.documentMode,c.ie8=!!document.documentMode,c.ie8Compat=8==document.documentMode,c.ie7Compat=7==d&&!document.documentMode||7==document.documentMode,c.ie6Compat=d<7||c.quirks,c.ie9above=d>8,c.ie9below=d<9,c.ie11above=d>10,c.ie11below=d<11}if(c.gecko){var g=a.match(/rv:([\d\.]+)/);g&&(g=g[1].split("."),d=1e4*g[0]+100*(g[1]||0)+1*(g[2]||0))}return/chrome\/(\d+\.\d)/i.test(a)&&(c.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(a)&&!/chrome/i.test(a)&&(c.safari=+(RegExp.$1||RegExp.$2)),c.opera&&(d=parseFloat(b.version())),c.webkit&&(d=parseFloat(a.match(/ applewebkit\/(\d+)/)[1])),c.version=d,c.isCompatible=!c.mobile&&(c.ie&&d>=6||c.gecko&&d>=10801||c.opera&&d>=9.5||c.air&&d>=1||c.webkit&&d>=522||!1),c}(),ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera,utils=UE.utils={each:function(a,b,c){if(null!=a)if(a.length===+a.length){for(var d=0,e=a.length;d=c&&a===b)return d=e,!1}),d},removeItem:function(a,b){for(var c=0,d=a.length;c'](?:(amp|lt|ldquo|rdquo|quot|gt|#39|nbsp|#\d+);)?/g,function(a,b){return b?a:{"<":"<","&":"&",'"':""","“":"“","”":"”",">":">","'":"'"}[a]}):""},html:function(a){return a?a.replace(/&((g|l|quo|ldquo|rdquo)t|amp|#39|nbsp);/g,function(a){return{"<":"<","&":"&",""":'"',"“":"“","”":"”",">":">","'":"'"," ":" "}[a]}):""},cssStyleToDomStyle:function(){var a=document.createElement("div").style,b={"float":void 0!=a.cssFloat?"cssFloat":void 0!=a.styleFloat?"styleFloat":"float"};return function(a){return b[a]||(b[a]=a.toLowerCase().replace(/-./g,function(a){return a.charAt(1).toUpperCase()}))}}(),loadFile:function(){function a(a,c){try{for(var d,e=0;d=b[e++];)if(d.doc===a&&d.url==(c.src||c.href))return d}catch(f){return null}}var b=[];return function(c,d,e){var f=a(c,d);if(f)return void(f.ready?e&&e():f.funs.push(e));if(b.push({doc:c,url:d.src||d.href,funs:[e]}),!c.body){var g=[];for(var h in d)"tag"!=h&&g.push(h+'="'+d[h]+'"');return void c.write("<"+d.tag+" "+g.join(" ")+" >")}if(!d.id||!c.getElementById(d.id)){var i=c.createElement(d.tag);delete d.tag;for(var h in d)i.setAttribute(h,d[h]);i.onload=i.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(f=a(c,d),f.funs.length>0){f.ready=1;for(var b;b=f.funs.pop();)b()}i.onload=i.onreadystatechange=null}},i.onerror=function(){throw Error("The load "+(d.href||d.src)+" fails,check the url settings of file neditor.config.js ")},c.getElementsByTagName("head")[0].appendChild(i)}}}(),isEmptyObject:function(a){if(null==a)return!0;if(this.isArray(a)||this.isString(a))return 0===a.length;for(var b in a)if(a.hasOwnProperty(b))return!1;return!0},fixColor:function(a,b){if(/color/i.test(a)&&/rgba?/.test(b)){var c=b.split(",");if(c.length>3)return"";b="#";for(var d,e=0;d=c[e++];)d=parseInt(d.replace(/[^\d]/gi,""),10).toString(16),b+=1==d.length?"0"+d:d;b=b.toUpperCase()}return b},optCss:function(a){function b(a,b){if(!a)return"";var c=a.top,d=a.bottom,e=a.left,f=a.right,g="";if(c&&e&&d&&f)g+=";"+b+":"+(c==d&&d==e&&e==f?c:c==d&&e==f?c+" "+e:e==f?c+" "+e+" "+d:c+" "+f+" "+d+" "+e)+";";else for(var h in a)g+=";"+b+"-"+h+":"+a[h]+";";return g}var c,d;return a=a.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,function(a,b,e,f){if(1==f.split(" ").length)switch(b){case"padding":return!c&&(c={}),c[e]=f,"";case"margin":return!d&&(d={}),d[e]=f,"";case"border":return"initial"==f?"":a}return a}),a+=b(c,"padding")+b(d,"margin"),a.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,function(a,b){return b?b+";;":";"})},clone:function(a,b){var c;b=b||{};for(var d in a)a.hasOwnProperty(d)&&(c=a[d],"object"==typeof c?(b[d]=utils.isArray(c)?[]:{},utils.clone(a[d],b[d])):b[d]=c);return b},transUnitToPx:function(a){if(!/(pt|cm)/.test(a))return a;var b;switch(a.replace(/([\d.]+)(\w+)/,function(c,d,e){a=d,b=e}),b){case"cm":a=25*parseFloat(a);break;case"pt":a=Math.round(96*parseFloat(a)/72)}return a+(a?"px":"")},domReady:function(){function a(a){a.isReady=!0;for(var c;c=b.pop();c());}var b=[];return function(c,d){d=d||window;var e=d.document;c&&b.push(c),"complete"===e.readyState?a(e):(e.isReady&&a(e),browser.ie&&11!=browser.version?(!function(){if(!e.isReady){try{e.documentElement.doScroll("left")}catch(b){return void setTimeout(arguments.callee,0)}a(e)}}(),d.attachEvent("onload",function(){a(e)})):(e.addEventListener("DOMContentLoaded",function(){e.removeEventListener("DOMContentLoaded",arguments.callee,!1),a(e)},!1),d.addEventListener("load",function(){a(e)},!1)))}}(),cssRule:browser.ie&&11!=browser.version?function(a,b,c){var d,e;if(void 0===b||b&&b.nodeType&&9==b.nodeType){if(c=b&&b.nodeType&&9==b.nodeType?b:c||document,d=c.indexList||(c.indexList={}),e=d[a],void 0!==e)return c.styleSheets[e].cssText}else{if(c=c||document,d=c.indexList||(c.indexList={}),e=d[a],""===b)return void 0!==e&&(c.styleSheets[e].cssText="",delete d[a],!0);void 0!==e?sheetStyle=c.styleSheets[e]:(sheetStyle=c.createStyleSheet("",e=c.styleSheets.length),d[a]=e),sheetStyle.cssText=b}}:function(a,b,c){var d;return void 0===b||b&&b.nodeType&&9==b.nodeType?(c=b&&b.nodeType&&9==b.nodeType?b:c||document,d=c.getElementById(a),d?d.innerHTML:void 0):(c=c||document,d=c.getElementById(a),""===b?!!d&&(d.parentNode.removeChild(d),!0):void(d?d.innerHTML=b:(d=c.createElement("style"),d.id=a,d.innerHTML=b,c.getElementsByTagName("head")[0].appendChild(d))))},sort:function(a,b){b=b||function(a,b){return a.localeCompare(b)};for(var c=0,d=a.length;c0){var g=a[c];a[c]=a[e],a[e]=g}return a},serializeParam:function(a){var b=[];for(var c in a)if("method"!=c&&"timeout"!=c&&"async"!=c)if("function"!=(typeof a[c]).toLowerCase()&&"object"!=(typeof a[c]).toLowerCase())b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));else if(utils.isArray(a[c]))for(var d=0;d1||b!==a.parentNode){a.style.cssText=b.style.cssText+";"+a.style.cssText,b=b.parentNode;continue}b.style.cssText+=";"+a.style.cssText,"A"==b.tagName&&(b.style.textDecoration="underline")}if("A"!=b.tagName){b===a.parentNode&&domUtils.remove(a,!0);break}}b=b.parentNode}},mergeSibling:function(a,b,c){function d(a,b,c){var d;if((d=c[a])&&!domUtils.isBookmarkNode(d)&&1==d.nodeType&&domUtils.isSameElement(c,d)){for(;d.firstChild;)"firstChild"==b?c.insertBefore(d.lastChild,c.firstChild):c.appendChild(d.firstChild);domUtils.remove(d)}}!b&&d("previousSibling","firstChild",a),!c&&d("nextSibling","lastChild",a)},unSelectable:ie&&browser.ie9below||browser.opera?function(a){a.onselectstart=function(){return!1},a.onclick=a.onkeyup=a.onkeydown=function(){return!1},a.unselectable="on",a.setAttribute("unselectable","on");for(var b,c=0;b=a.all[c++];)switch(b.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:b.unselectable="on",a.setAttribute("unselectable","on")}}:function(a){a.style.MozUserSelect=a.style.webkitUserSelect=a.style.msUserSelect=a.style.KhtmlUserSelect="none"},removeAttributes:function(a,b){b=utils.isArray(b)?b:utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0;c=b[d++];){switch(c=attrFix[c]||c){case"className":a[c]="";break;case"style":a.style.cssText="";var e=a.getAttributeNode("style");!browser.ie&&e&&a.removeAttributeNode(e)}a.removeAttribute(c)}},createElement:function(a,b,c){return domUtils.setAttributes(a.createElement(b),c)},setAttributes:function(a,b){for(var c in b)if(b.hasOwnProperty(c)){var d=b[c];switch(c){case"class":a.className=d;break;case"style":a.style.cssText=a.style.cssText+";"+d;break;case"innerHTML":a[c]=d;break;case"value":a.value=d;break;default:a.setAttribute(attrFix[c]||c,d)}}return a},getComputedStyle:function(a,b){var c="width height top left";if(c.indexOf(b)>-1)return a["offset"+b.replace(/^\w/,function(a){return a.toUpperCase()})]+"px";if(3==a.nodeType&&(a=a.parentNode),browser.ie&&browser.version<9&&"font-size"==b&&!a.style.fontSize&&!dtd.$empty[a.tagName]&&!dtd.$nonChild[a.tagName]){var d=a.ownerDocument.createElement("span");d.style.cssText="padding:0;border:0;font-family:simsun;",d.innerHTML=".",a.appendChild(d);var e=d.offsetHeight;return a.removeChild(d),d=null,e+"px"}try{var f=domUtils.getStyle(a,b)||(window.getComputedStyle?domUtils.getWindow(a).getComputedStyle(a,"").getPropertyValue(b):(a.currentStyle||a.style)[utils.cssStyleToDomStyle(b)])}catch(g){return""}return utils.transUnitToPx(utils.fixColor(b,f))},removeClasses:function(a,b){b=utils.isArray(b)?b:utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)e=e.replace(new RegExp("\\b"+c+"\\b"),"");e=utils.trim(e).replace(/[ ]{2,}/g," "),e?a.className=e:domUtils.removeAttributes(a,["class"])},addClass:function(a,b){if(a){b=utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)new RegExp("\\b"+c+"\\b").test(e)||(e+=" "+c);a.className=utils.trim(e)}},hasClass:function(a,b){if(utils.isRegExp(b))return b.test(a.className);b=utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)if(!new RegExp("\\b"+c+"\\b","i").test(e))return!1;return d-1==b.length},preventDefault:function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},removeStyle:function(a,b){browser.ie?("color"==b&&(b="(^|;)"+b),a.style.cssText=a.style.cssText.replace(new RegExp(b+"[^:]*:[^;]+;?","ig"),"")):a.style.removeProperty?a.style.removeProperty(b):a.style.removeAttribute(utils.cssStyleToDomStyle(b)),a.style.cssText||domUtils.removeAttributes(a,["style"])},getStyle:function(a,b){var c=a.style[utils.cssStyleToDomStyle(b)];return utils.fixColor(b,c)},setStyle:function(a,b,c){a.style[utils.cssStyleToDomStyle(b)]=c,utils.trim(a.style.cssText)||this.removeAttributes(a,"style")},setStyles:function(a,b){for(var c in b)b.hasOwnProperty(c)&&domUtils.setStyle(a,c,b[c])},removeDirtyAttr:function(a){for(var b,c=0,d=a.getElementsByTagName("*");b=d[c++];)b.removeAttribute("_moz_dirty");a.removeAttribute("_moz_dirty")},getChildCount:function(a,b){var c=0,d=a.firstChild;for(b=b||function(){return 1};d;)b(d)&&c++,d=d.nextSibling;return c},isEmptyNode:function(a){return!a.firstChild||0==domUtils.getChildCount(a,function(a){return!domUtils.isBr(a)&&!domUtils.isBookmarkNode(a)&&!domUtils.isWhitespace(a)})},clearSelectedArr:function(a){for(var b;b=a.pop();)domUtils.removeAttributes(b,["class"])},scrollToView:function(a,b,c){var d=function(){var a=b.document,c="CSS1Compat"==a.compatMode;return{width:(c?a.documentElement.clientWidth:a.body.clientWidth)||0,height:(c?a.documentElement.clientHeight:a.body.clientHeight)||0}},e=function(a){if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};var b=a.document;return{x:b.documentElement.scrollLeft||b.body.scrollLeft||0,y:b.documentElement.scrollTop||b.body.scrollTop||0}},f=d().height,g=f*-1+c;g+=a.offsetHeight||0;var h=domUtils.getXY(a);g+=h.y;var i=e(b).y;(g>i||g0)return 0;for(var c in dtd.$isNotEmpty)if(a.getElementsByTagName(c).length)return 0;return 1},setViewportOffset:function(a,b){var c=0|parseInt(a.style.left),d=0|parseInt(a.style.top),e=a.getBoundingClientRect(),f=b.left-e.left,g=b.top-e.top;f&&(a.style.left=c+f+"px"),g&&(a.style.top=d+g+"px")},fillNode:function(a,b){var c=browser.ie?a.createTextNode(domUtils.fillChar):a.createElement("br");b.innerHTML="",b.appendChild(c)},moveChild:function(a,b,c){for(;a.firstChild;)c&&b.firstChild?b.insertBefore(a.lastChild,b.firstChild):b.appendChild(a.firstChild)},hasNoAttributes:function(a){return browser.ie?/^<\w+\s*?>/.test(a.outerHTML):0==a.attributes.length},isCustomeNode:function(a){return 1==a.nodeType&&a.getAttribute("_ue_custom_node_")},isTagNode:function(a,b){return 1==a.nodeType&&new RegExp("\\b"+a.tagName+"\\b","i").test(b)},filterNodeList:function(a,b,c){var d=[];if(!utils.isFunction(b)){var e=b;b=function(a){return utils.indexOf(utils.isArray(e)?e:e.split(" "),a.tagName.toLowerCase())!=-1}}return utils.each(a,function(a){b(a)&&d.push(a)}),0==d.length?null:1!=d.length&&c?d:d[0]},isInNodeEndBoundary:function(a,b){var c=a.startContainer;if(3==c.nodeType&&a.startOffset!=c.nodeValue.length)return 0;if(1==c.nodeType&&a.startOffset!=c.childNodes.length)return 0;for(;c!==b;){if(c.nextSibling)return 0;c=c.parentNode}return 1},isBoundaryNode:function(a,b){for(var c;!domUtils.isBody(a);)if(c=a,a=a.parentNode,c!==a[b])return!1;return!0},fillHtml:browser.ie11below?" ":"
                      "},fillCharReg=new RegExp(domUtils.fillChar,"g");!function(){function a(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer===a.endContainer&&a.startOffset==a.endOffset}function b(a){return!a.collapsed&&1==a.startContainer.nodeType&&a.startContainer===a.endContainer&&a.endOffset-a.startOffset==1}function c(b,c,d,e){return 1==c.nodeType&&(dtd.$empty[c.tagName]||dtd.$nonChild[c.tagName])&&(d=domUtils.getNodeIndex(c)+(b?0:1),c=c.parentNode),b?(e.startContainer=c,e.startOffset=d,e.endContainer||e.collapse(!0)):(e.endContainer=c,e.endOffset=d,e.startContainer||e.collapse(!1)),a(e),e}function d(a,b){var c,d,e=a.startContainer,f=a.endContainer,g=a.startOffset,h=a.endOffset,i=a.document,j=i.createDocumentFragment();if(1==e.nodeType&&(e=e.childNodes[g]||(c=e.appendChild(i.createTextNode("")))),1==f.nodeType&&(f=f.childNodes[h]||(d=f.appendChild(i.createTextNode("")))),e===f&&3==e.nodeType)return j.appendChild(i.createTextNode(e.substringData(g,h-g))),b&&(e.deleteData(g,h-g),a.collapse(!0)),j;for(var k,l,m=j,n=domUtils.findParents(e,!0),o=domUtils.findParents(f,!0),p=0;n[p]==o[p];)p++;for(var q,r=p;q=n[r];r++){for(k=q.nextSibling,q==e?c||(3==a.startContainer.nodeType?(m.appendChild(i.createTextNode(e.nodeValue.slice(g))),b&&e.deleteData(g,e.nodeValue.length-g)):m.appendChild(b?e:e.cloneNode(!0))):(l=q.cloneNode(!1),m.appendChild(l));k&&k!==f&&k!==o[r];)q=k.nextSibling,m.appendChild(b?k:k.cloneNode(!0)),k=q;m=l}m=j,n[p]||(m.appendChild(n[p-1].cloneNode(!1)),m=m.firstChild);for(var s,r=p;s=o[r];r++){if(k=s.previousSibling,s==f?d||3!=a.endContainer.nodeType||(m.appendChild(i.createTextNode(f.substringData(0,h))),b&&f.deleteData(0,h)):(l=s.cloneNode(!1),m.appendChild(l)),r!=p||!n[p])for(;k&&k!==e;)s=k.previousSibling,m.insertBefore(b?k:k.cloneNode(!0),m.firstChild),k=s;m=l}return b&&a.setStartBefore(o[p]?n[p]?o[p]:n[p-1]:o[p-1]).collapse(!0),c&&domUtils.remove(c),d&&domUtils.remove(d),j}function e(a,b){try{if(g&&domUtils.inDoc(g,a))if(g.nodeValue.replace(fillCharReg,"").length)g.nodeValue=g.nodeValue.replace(fillCharReg,"");else{var c=g.parentNode;for(domUtils.remove(g);c&&domUtils.isEmptyInlineElement(c)&&(browser.safari?!(domUtils.getPosition(c,b)&domUtils.POSITION_CONTAINS):!c.contains(b));)g=c.parentNode, -domUtils.remove(c),c=g}}catch(d){}}function f(a,b){var c;for(a=a[b];a&&domUtils.isFillChar(a);)c=a[b],domUtils.remove(a),a=c}var g,h=0,i=domUtils.fillChar,j=dom.Range=function(a){var b=this;b.startContainer=b.startOffset=b.endContainer=b.endOffset=null,b.document=a,b.collapsed=!0};j.prototype={cloneContents:function(){return this.collapsed?null:d(this,0)},deleteContents:function(){var a;return this.collapsed||d(this,1),browser.webkit&&(a=this.startContainer,3!=a.nodeType||a.nodeValue.length||(this.setStartBefore(a).collapse(!0),domUtils.remove(a))),this},extractContents:function(){return this.collapsed?null:d(this,2)},setStart:function(a,b){return c(!0,a,b,this)},setEnd:function(a,b){return c(!1,a,b,this)},setStartAfter:function(a){return this.setStart(a.parentNode,domUtils.getNodeIndex(a)+1)},setStartBefore:function(a){return this.setStart(a.parentNode,domUtils.getNodeIndex(a))},setEndAfter:function(a){return this.setEnd(a.parentNode,domUtils.getNodeIndex(a)+1)},setEndBefore:function(a){return this.setEnd(a.parentNode,domUtils.getNodeIndex(a))},setStartAtFirst:function(a){return this.setStart(a,0)},setStartAtLast:function(a){return this.setStart(a,3==a.nodeType?a.nodeValue.length:a.childNodes.length)},setEndAtFirst:function(a){return this.setEnd(a,0)},setEndAtLast:function(a){return this.setEnd(a,3==a.nodeType?a.nodeValue.length:a.childNodes.length)},selectNode:function(a){return this.setStartBefore(a).setEndAfter(a)},selectNodeContents:function(a){return this.setStart(a,0).setEndAtLast(a)},cloneRange:function(){var a=this;return new j(a.document).setStart(a.startContainer,a.startOffset).setEnd(a.endContainer,a.endOffset)},collapse:function(a){var b=this;return a?(b.endContainer=b.startContainer,b.endOffset=b.startOffset):(b.startContainer=b.endContainer,b.startOffset=b.endOffset),b.collapsed=!0,b},shrinkBoundary:function(a){function b(a){return 1==a.nodeType&&!domUtils.isBookmarkNode(a)&&!dtd.$empty[a.tagName]&&!dtd.$nonChild[a.tagName]}for(var c,d=this,e=d.collapsed;1==d.startContainer.nodeType&&(c=d.startContainer.childNodes[d.startOffset])&&b(c);)d.setStart(c,0);if(e)return d.collapse(!0);if(!a)for(;1==d.endContainer.nodeType&&d.endOffset>0&&(c=d.endContainer.childNodes[d.endOffset-1])&&b(c);)d.setEnd(c,c.childNodes.length);return d},getCommonAncestor:function(a,c){var d=this,e=d.startContainer,f=d.endContainer;return e===f?a&&b(this)&&(e=e.childNodes[d.startOffset],1==e.nodeType)?e:c&&3==e.nodeType?e.parentNode:e:domUtils.getCommonAncestor(e,f)},trimBoundary:function(a){this.txtToElmBoundary();var b=this.startContainer,c=this.startOffset,d=this.collapsed,e=this.endContainer;if(3==b.nodeType){if(0==c)this.setStartBefore(b);else if(c>=b.nodeValue.length)this.setStartAfter(b);else{var f=domUtils.split(b,c);b===e?this.setEnd(f,this.endOffset-c):b.parentNode===e&&(this.endOffset+=1),this.setStartBefore(f)}if(d)return this.collapse(!0)}return a||(c=this.endOffset,e=this.endContainer,3==e.nodeType&&(0==c?this.setEndBefore(e):(c=c.nodeValue.length&&a["set"+b.replace(/(\w)/,function(a){return a.toUpperCase()})+"After"](c):a["set"+b.replace(/(\w)/,function(a){return a.toUpperCase()})+"Before"](c))}return!a&&this.collapsed||(b(this,"start"),b(this,"end")),this},insertNode:function(a){var b=a,c=1;11==a.nodeType&&(b=a.firstChild,c=a.childNodes.length),this.trimBoundary(!0);var d=this.startContainer,e=this.startOffset,f=d.childNodes[e];return f?d.insertBefore(a,f):d.appendChild(a),b.parentNode===this.endContainer&&(this.endOffset=this.endOffset+c),this.setStartBefore(b)},setCursor:function(a,b){return this.collapse(!a).select(b)},createBookmark:function(a,b){var c,d=this.document.createElement("span");return d.style.cssText="display:none;line-height:0px;",d.appendChild(this.document.createTextNode("‍")),d.id="_baidu_bookmark_start_"+(b?"":h++),this.collapsed||(c=d.cloneNode(!0),c.id="_baidu_bookmark_end_"+(b?"":h++)),this.insertNode(d),c&&this.collapse().insertNode(c).setEndBefore(c),this.setStartAfter(d),{start:a?d.id:d,end:c?a?c.id:c:null,id:a}},moveToBookmark:function(a){var b=a.id?this.document.getElementById(a.start):a.start,c=a.end&&a.id?this.document.getElementById(a.end):a.end;return this.setStartBefore(b),domUtils.remove(b),c?(this.setEndBefore(c),domUtils.remove(c)):this.collapse(!0),this},enlarge:function(a,b){var c,d,e=domUtils.isBody,f=this.document.createTextNode("");if(a){for(d=this.startContainer,1==d.nodeType?d.childNodes[this.startOffset]?c=d=d.childNodes[this.startOffset]:(d.appendChild(f),c=d=f):c=d;;){if(domUtils.isBlockElm(d)){for(d=c;(c=d.previousSibling)&&!domUtils.isBlockElm(c);)d=c;this.setStartBefore(d);break}c=d,d=d.parentNode}for(d=this.endContainer,1==d.nodeType?((c=d.childNodes[this.endOffset])?d.insertBefore(f,c):d.appendChild(f),c=d=f):c=d;;){if(domUtils.isBlockElm(d)){for(d=c;(c=d.nextSibling)&&!domUtils.isBlockElm(c);)d=c;this.setEndAfter(d);break}c=d,d=d.parentNode}f.parentNode===this.endContainer&&this.endOffset--,domUtils.remove(f)}if(!this.collapsed){for(;!(0!=this.startOffset||b&&b(this.startContainer)||e(this.startContainer));)this.setStartBefore(this.startContainer);for(;!(this.endOffset!=(1==this.endContainer.nodeType?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)||b&&b(this.endContainer)||e(this.endContainer));)this.setEndAfter(this.endContainer)}return this},enlargeToBlockElm:function(a){for(;!domUtils.isBlockElm(this.startContainer);)this.setStartBefore(this.startContainer);if(!a)for(;!domUtils.isBlockElm(this.endContainer);)this.setEndAfter(this.endContainer);return this},adjustmentBoundary:function(){if(!this.collapsed){for(;!domUtils.isBody(this.startContainer)&&this.startOffset==this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length&&this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length;)this.setStartAfter(this.startContainer);for(;!domUtils.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length;)this.setEndBefore(this.endContainer)}return this},applyInlineStyle:function(a,b,c){if(this.collapsed)return this;this.trimBoundary().enlarge(!1,function(a){return 1==a.nodeType&&domUtils.isBlockElm(a)}).adjustmentBoundary();for(var d,e,f=this.createBookmark(),g=f.end,h=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!domUtils.isWhitespace(a)},i=domUtils.getNextDomNode(f.start,!1,h),j=this.cloneRange();i&&domUtils.getPosition(i,g)&domUtils.POSITION_PRECEDING;)if(3==i.nodeType||dtd[a][i.tagName]){for(j.setStartBefore(i),d=i;d&&(3==d.nodeType||dtd[a][d.tagName])&&d!==g;)e=d,d=domUtils.getNextDomNode(d,1==d.nodeType,null,function(b){return dtd[a][b.tagName]});var k,l=j.setEndAfter(e).extractContents();if(c&&c.length>0){var m,n;n=m=c[0].cloneNode(!1);for(var o,p=1;o=c[p++];)m.appendChild(o.cloneNode(!1)),m=m.firstChild;k=m}else k=j.document.createElement(a);b&&domUtils.setAttributes(k,b),k.appendChild(l),"SPAN"==k.tagName&&b&&b.style&&utils.each(k.getElementsByTagName("span"),function(a){a.style.cssText=a.style.cssText+";"+b.style}),j.insertNode(c?n:k);var q;if("span"==a&&b.style&&/text\-decoration/.test(b.style)&&(q=domUtils.findParentByTagName(k,"a",!0))?(domUtils.setAttributes(q,b),domUtils.remove(k,!0),k=q):(domUtils.mergeSibling(k),domUtils.clearEmptySibling(k)),domUtils.mergeChild(k,b),i=domUtils.getNextDomNode(k,!1,h),domUtils.mergeToParent(k),d===g)break}else i=domUtils.getNextDomNode(i,!0,h);return this.moveToBookmark(f)},removeInlineStyle:function(a){if(this.collapsed)return this;a=utils.isArray(a)?a:[a],this.shrinkBoundary().adjustmentBoundary();for(var b=this.startContainer,c=this.endContainer;;){if(1==b.nodeType){if(utils.indexOf(a,b.tagName.toLowerCase())>-1)break;if("body"==b.tagName.toLowerCase()){b=null;break}}b=b.parentNode}for(;;){if(1==c.nodeType){if(utils.indexOf(a,c.tagName.toLowerCase())>-1)break;if("body"==c.tagName.toLowerCase()){c=null;break}}c=c.parentNode}var d,e,f=this.createBookmark();b&&(e=this.cloneRange().setEndBefore(f.start).setStartBefore(b),d=e.extractContents(),e.insertNode(d),domUtils.clearEmptySibling(b,!0),b.parentNode.insertBefore(f.start,b)),c&&(e=this.cloneRange().setStartAfter(f.end).setEndAfter(c),d=e.extractContents(),e.insertNode(d),domUtils.clearEmptySibling(c,!1,!0),c.parentNode.insertBefore(f.end,c.nextSibling));for(var g,h=domUtils.getNextDomNode(f.start,!1,function(a){return 1==a.nodeType});h&&h!==f.end;)g=domUtils.getNextDomNode(h,!0,function(a){return 1==a.nodeType}),utils.indexOf(a,h.tagName.toLowerCase())>-1&&domUtils.remove(h,!0),h=g;return this.moveToBookmark(f)},getClosedNode:function(){var a;if(!this.collapsed){var c=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(b(c)){var d=c.startContainer.childNodes[c.startOffset];d&&1==d.nodeType&&(dtd.$empty[d.tagName]||dtd.$nonChild[d.tagName])&&(a=d)}}return a},select:browser.ie?function(a,b){var c;this.collapsed||this.shrinkBoundary();var d=this.getClosedNode();if(d&&!b){try{c=this.document.body.createControlRange(),c.addElement(d),c.select()}catch(h){}return this}var j,k=this.createBookmark(),l=k.start;if(c=this.document.body.createTextRange(),c.moveToElementText(l),c.moveStart("character",1),this.collapsed){if(!a&&3!=this.startContainer.nodeType){var m=this.document.createTextNode(i),n=this.document.createElement("span");n.appendChild(this.document.createTextNode(i)),l.parentNode.insertBefore(n,l),l.parentNode.insertBefore(m,l),e(this.document,m),g=m,f(n,"previousSibling"),f(l,"nextSibling"),c.moveStart("character",-1),c.collapse(!0)}}else{var o=this.document.body.createTextRange();j=k.end,o.moveToElementText(j),c.setEndPoint("EndToEnd",o)}this.moveToBookmark(k),n&&domUtils.remove(n);try{c.select()}catch(h){}return this}:function(a){function b(a){function b(b,c,d){3==b.nodeType&&b.nodeValue.length0)j=k-1;else{if(!(l<0))return{container:d,offset:c(e)};i=k+1}}if(k==-1){if(h.moveToElementText(d),h.setEndPoint("StartToStart",a),f=h.text.replace(/(\r\n|\r)/g,"\n").length,g=d.childNodes,!f)return e=g[g.length-1],{container:e,offset:e.nodeValue.length};for(var m=g.length;f>0;)f-=g[--m].nodeValue.length;return{container:g[m],offset:-f}}if(h.collapse(l>0),h.setEndPoint(l>0?"StartToStart":"EndToStart",a),f=h.text.replace(/(\r\n|\r)/g,"\n").length,!f)return dtd.$empty[e.tagName]||dtd.$nonChild[e.tagName]?{container:d,offset:c(e)+(l>0?0:1)}:{container:e,offset:l>0?0:e.childNodes.length};for(;f>0;)try{var n=e;e=e[l>0?"previousSibling":"nextSibling"],f-=e.nodeValue.length}catch(o){return{container:d,offset:c(n)}}return{container:e,offset:l>0?-f:e.nodeValue.length+f}}function b(b,c){if(b.item)c.selectNode(b.item(0));else{var d=a(b,!0);c.setStart(d.container,d.offset),0!=b.compareEndPoints("StartToEnd",b)&&(d=a(b,!1),c.setEnd(d.container,d.offset))}return c}function c(a){var b;try{b=a.getNative().createRange()}catch(c){return null}var d=b.item?b.item(0):b.parentElement();return(d.ownerDocument||d)===a.document?b:null}var d=dom.Selection=function(a){var b,d=this;d.document=a,browser.ie9below&&(b=domUtils.getWindow(a).frameElement,domUtils.on(b,"beforedeactivate",function(){d._bakIERange=d.getIERange()}),domUtils.on(b,"activate",function(){try{!c(d)&&d._bakIERange&&d._bakIERange.select()}catch(a){}d._bakIERange=null})),b=a=null};d.prototype={rangeInBody:function(a,b){var c=browser.ie9below||b?a.item?a.item():a.parentElement():a.startContainer;return c===this.document.body||domUtils.inDoc(c,this.document)},getNative:function(){var a=this.document;try{return a?browser.ie9below?a.selection:domUtils.getWindow(a).getSelection():null}catch(b){return null}},getIERange:function(){var a=c(this);return!a&&this._bakIERange?this._bakIERange:a},cache:function(){this.clear(),this._cachedRange=this.getRange(),this._cachedStartElement=this.getStart(),this._cachedStartElementPath=this.getStartElementPath()},getStartElementPath:function(){if(this._cachedStartElementPath)return this._cachedStartElementPath;var a=this.getStart();return a?domUtils.findParents(a,!0,null,!0):[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{if(browser.ie9below){var a=c(this);return!(!a||!this.rangeInBody(a))}return!!this.getNative().rangeCount}catch(b){return!1}},getRange:function(){function a(a){for(var b=c.document.body.firstChild,d=a.collapsed;b&&b.firstChild;)a.setStart(b,0),b=b.firstChild;a.startContainer||a.setStart(c.document.body,0),d&&a.collapse(!0)}var c=this;if(null!=c._cachedRange)return this._cachedRange;var d=new baidu.editor.dom.Range(c.document);if(browser.ie9below){var e=c.getIERange();if(e)try{b(e,d)}catch(f){a(d)}else a(d)}else{var g=c.getNative();if(g&&g.rangeCount){var h=g.getRangeAt(0),i=g.getRangeAt(g.rangeCount-1);d.setStart(h.startContainer,h.startOffset).setEnd(i.endContainer,i.endOffset),d.collapsed&&domUtils.isBody(d.startContainer)&&!d.startOffset&&a(d)}else{if(this._bakRange&&domUtils.inDoc(this._bakRange.startContainer,this.document))return this._bakRange;a(d)}}return this._bakRange=d},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement;var a,b,c,d,e=browser.ie9below?this.getIERange():this.getRange();if(browser.ie9below){if(!e)return this.document.body.firstChild;if(e.item)return e.item(0);for(a=e.duplicate(),a.text.length>0&&a.moveStart("character",1),a.collapse(1),b=a.parentElement(),d=c=e.parentElement();c=c.parentNode;)if(c==b){b=d;break}}else if(e.shrinkBoundary(),b=e.startContainer,1==b.nodeType&&b.hasChildNodes()&&(b=b.childNodes[Math.min(b.childNodes.length-1,e.startOffset)]),3==b.nodeType)return b.parentNode;return b},getText:function(){var a,b;return this.isFocus()&&(a=this.getNative())?(b=browser.ie9below?a.createRange():a.getRangeAt(0),browser.ie9below?b.text:b.toString()):""},clearRange:function(){this.getNative()[browser.ie9below?"empty":"removeAllRanges"]()}}}(),function(){function a(a,b){var c;if(b.options.textarea)if(utils.isString(b.options.textarea)){for(var d,e=0,f=domUtils.getElementsByTagName(a,"textarea");d=f[e++];)if(d.id=="ueditor_textarea_"+b.options.textarea){c=d;break}}else c=b.textarea;c||(a.appendChild(c=domUtils.createElement(document,"textarea",{name:b.options.textarea,id:"ueditor_textarea_"+b.options.textarea,style:"display:none"})),b.textarea=c),!c.getAttribute("name")&&c.setAttribute("name",b.options.textarea),c.value=b.hasContents()?b.options.allHtmlEnabled?b.getAllHtml():b.getContent(null,null,!0):""}function b(a){for(var b in a)return b}function c(a){a.langIsReady=!0,a.fireEvent("langReady")}var d,e=0,f=UE.Editor=function(a){var d=this;d.uid=e++,EventBase.call(d),d.commands={},d.options=utils.extend(utils.clone(a||{}),UEDITOR_CONFIG,!0),d.shortcutkeys={},d.inputRules=[],d.outputRules=[],d.setOpt(f.defaultOptions(d)),utils.isEmptyObject(UE.I18N)?utils.loadFile(document,{src:d.options.langPath+d.options.lang+"/"+d.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){UE.plugin.load(d),c(d)}):(d.options.lang=b(UE.I18N),UE.plugin.load(d),c(d)),UE.instants["ueditorInstant"+d.uid]=d};f.prototype={registerCommand:function(a,b){this.commands[a]=b},ready:function(a){var b=this;a&&(b.isReady?a.apply(b):b.addListener("ready",a))},setPlaceholder:function(){function a(){var a=this.getPlainTxt();a.trim()?UE.dom.domUtils.removeClasses(this.body,"empty"):UE.dom.domUtils.addClass(this.body,"empty")}return function(b){var c=this;c.ready(function(){a.call(c),c.body.setAttribute("placeholder",b)}),c.removeListener("keyup contentchange",a),c.addListener("keyup contentchange",a)}}(),setOpt:function(a,b){var c={};utils.isString(a)?c[a]=b:c=a,utils.extend(this.options,c,!0)},getOpt:function(a){return this.options[a]},destroy:function(){var a=this;a.fireEvent("destroy");var b=a.container.parentNode,c=a.textarea;c?c.style.display="":(c=document.createElement("textarea"),b.parentNode.insertBefore(c,b)),c.style.width=a.iframe.offsetWidth+"px",c.style.height=a.iframe.offsetHeight+"px",c.value=a.getContent(),c.id=a.key,b.innerHTML="",domUtils.remove(b);var d=a.key;for(var e in a)a.hasOwnProperty(e)&&delete this[e];UE.delEditor(d)},render:function(a){var b=this,c=b.options,d=function(b){return parseInt(domUtils.getComputedStyle(a,b))};if(utils.isString(a)&&(a=document.getElementById(a)),a){c.initialFrameWidth?c.minFrameWidth=c.initialFrameWidth:c.minFrameWidth=c.initialFrameWidth=a.offsetWidth,c.initialFrameHeight?c.minFrameHeight=c.initialFrameHeight:c.initialFrameHeight=c.minFrameHeight=a.offsetHeight,a.style.width=/%$/.test(c.initialFrameWidth)?"100%":c.initialFrameWidth-d("padding-left")-d("padding-right")+"px",a.style.height=/%$/.test(c.initialFrameHeight)?"100%":c.initialFrameHeight-d("padding-top")-d("padding-bottom")+"px",a.style.zIndex=c.zIndex;var e=(ie&&browser.version<9?"":"")+""+(c.iframeCssUrl?"":"")+(c.initialStyle?"":"")+""+(c.iframeJsUrl?"":"")+"";a.appendChild(domUtils.createElement(document,"iframe",{id:"ueditor_"+b.uid,width:"100%",height:"100%",frameborder:"0",src:"javascript:void(function(){document.open();"+(c.customDomain&&document.domain!=location.hostname?'document.domain="'+document.domain+'";':"")+'document.write("'+e+'");document.close();}())'})),a.style.overflow="hidden",setTimeout(function(){/%$/.test(c.initialFrameWidth)&&(c.minFrameWidth=c.initialFrameWidth=a.offsetWidth),/%$/.test(c.initialFrameHeight)&&(c.minFrameHeight=c.initialFrameHeight=a.offsetHeight,a.style.height=c.initialFrameHeight+"px")})}},_setup:function(b){var c=this,d=c.options;ie?(b.body.disabled=!0,b.body.contentEditable=!0,b.body.disabled=!1):b.body.contentEditable=!0,b.body.spellcheck=!1,c.document=b,c.window=b.defaultView||b.parentWindow,c.iframe=c.window.frameElement,c.body=b.body,c.selection=new dom.Selection(b);var e;browser.gecko&&(e=this.selection.getNative())&&e.removeAllRanges(),this._initEvents();for(var f=this.iframe.parentNode;!domUtils.isBody(f);f=f.parentNode)if("FORM"==f.tagName){c.form=f,c.options.autoSyncData?domUtils.on(c.window,"blur",function(){a(f,c)}):domUtils.on(f,"submit",function(){a(this,c)});break}if(d.initialContent)if(d.autoClearinitialContent){var g=c.execCommand;c.execCommand=function(){return c.fireEvent("firstBeforeExecCommand"),g.apply(c,arguments)},this._setDefaultContent(d.initialContent)}else this.setContent(d.initialContent,!1,!0);domUtils.isEmptyNode(c.body)&&(c.body.innerHTML="

                      "+(browser.ie?"":"
                      ")+"

                      "),d.focus&&setTimeout(function(){c.focus(c.options.focusInEnd),!c.options.autoClearinitialContent&&c._selectionChange()},0),c.container||(c.container=this.iframe.parentNode),d.fullscreen&&c.ui&&c.ui.setFullScreen(!0);try{c.document.execCommand("2D-position",!1,!1)}catch(h){}try{c.document.execCommand("enableInlineTableEditing",!1,!1)}catch(h){}try{c.document.execCommand("enableObjectResizing",!1,!1)}catch(h){}c._bindshortcutKeys(),c.isReady=1,c.fireEvent("ready"),d.onready&&d.onready.call(c),browser.ie9below||domUtils.on(c.window,["blur","focus"],function(a){if("blur"==a.type){c._bakRange=c.selection.getRange();try{c._bakNativeRange=c.selection.getNative().getRangeAt(0),c.selection.getNative().removeAllRanges()}catch(a){c._bakNativeRange=null}}else try{c._bakRange&&c._bakRange.select()}catch(a){}}),browser.gecko&&browser.version<=10902&&(c.body.contentEditable=!1,setTimeout(function(){c.body.contentEditable=!0},100),setInterval(function(){c.body.style.height=c.iframe.offsetHeight-20+"px"},100)),!d.isShow&&c.setHide(),d.readonly&&c.setDisabled()},sync:function(b){var c=this,d=b?document.getElementById(b):domUtils.findParent(c.iframe.parentNode,function(a){return"FORM"==a.tagName},!0);d&&a(d,c)},setHeight:function(a,b){a!==parseInt(this.iframe.parentNode.style.height)&&(this.iframe.parentNode.style.height=a+"px"),!b&&(this.options.minFrameHeight=this.options.initialFrameHeight=a),this.body.style.height=a+"px",!b&&this.trigger("setHeight")},addshortcutkey:function(a,b){var c={};b?c[a]=b:c=a,utils.extend(this.shortcutkeys,c)},_bindshortcutKeys:function(){var a=this,b=this.shortcutkeys;a.addListener("keydown",function(c,d){var e=d.keyCode||d.which;for(var f in b)for(var g,h=b[f].split(","),i=0;g=h[i++];){g=g.split(":");var j=g[0],k=g[1];(/^(ctrl)(\+shift)?\+(\d+)$/.test(j.toLowerCase())||/^(\d+)$/.test(j))&&(("ctrl"==RegExp.$1?d.ctrlKey||d.metaKey:0)&&(""!=RegExp.$2?d[RegExp.$2.slice(1)+"Key"]:1)&&e==RegExp.$3||e==RegExp.$1)&&(a.queryCommandState(f,k)!=-1&&a.execCommand(f,k),domUtils.preventDefault(d))}})},getContent:function(a,b,c,d,e){var f=this;if(a&&utils.isFunction(a)&&(b=a,a=""),b?!b():!this.hasContents())return"";f.fireEvent("beforegetcontent");var g=UE.htmlparser(f.body.innerHTML,d);return f.filterOutputRule(g),f.fireEvent("aftergetcontent",a,g),g.toHtml(e)},getAllHtml:function(){var a=this,b=[];if(a.fireEvent("getAllHtml",b),browser.ie&&browser.version>8){var c="";utils.each(a.document.styleSheets,function(a){c+=a.href?'':""}),utils.each(a.document.getElementsByTagName("script"),function(a){c+=a.outerHTML})}return""+(a.options.charset?'':"")+(c||a.document.getElementsByTagName("head")[0].innerHTML)+b.join("\n")+""+a.getContent(null,null,!0)+""},getPlainTxt:function(){var a=new RegExp(domUtils.fillChar,"g"),b=this.body.innerHTML.replace(/[\n\r]/g,"");return b=b.replace(/<(p|div)[^>]*>(| )<\/\1>/gi,"\n").replace(//gi,"\n").replace(/<[^>\/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,function(a,b,c){return dtd.$block[c]?"\n":b?b:""}),b.replace(a,"").replace(/\u00a0/g," ").replace(/ /g," ")},getContentTxt:function(){var a=new RegExp(domUtils.fillChar,"g");return this.body[browser.ie?"innerText":"textContent"].replace(a,"").replace(/\u00a0/g," ")},setContent:function(b,c,d){function e(a){return"DIV"==a.tagName&&a.getAttribute("cdata_tag")}var f=this;f.fireEvent("beforesetcontent",b);var g=UE.htmlparser(b);if(f.filterInputRule(g),b=g.toHtml(),f.body.innerHTML=(c?f.body.innerHTML:"")+b,"p"==f.options.enterTag){var h,i=this.body.firstChild;if(!i||1==i.nodeType&&(dtd.$cdata[i.tagName]||e(i)||domUtils.isCustomeNode(i))&&i===this.body.lastChild)this.body.innerHTML="

                      "+(browser.ie?" ":"
                      ")+"

                      "+this.body.innerHTML;else for(var j=f.document.createElement("p");i;){for(;i&&(3==i.nodeType||1==i.nodeType&&dtd.p[i.tagName]&&!dtd.$cdata[i.tagName]);)h=i.nextSibling,j.appendChild(i),i=h;if(j.firstChild){if(!i){f.body.appendChild(j);break}i.parentNode.insertBefore(j,i),j=f.document.createElement("p")}i=i.nextSibling}}f.fireEvent("aftersetcontent"),f.fireEvent("contentchange"),!d&&f._selectionChange(),f._bakRange=f._bakIERange=f._bakNativeRange=null;var k;browser.gecko&&(k=this.selection.getNative())&&k.removeAllRanges(),f.options.autoSyncData&&f.form&&a(f.form,f)},focus:function(a){try{var b=this,c=b.selection.getRange();if(a){var d=b.body.lastChild;d&&1==d.nodeType&&!dtd.$empty[d.tagName]&&(domUtils.isEmptyBlock(d)?c.setStartAtFirst(d):c.setStartAtLast(d),c.collapse(!0)),c.setCursor(!0)}else{if(!c.collapsed&&domUtils.isBody(c.startContainer)&&0==c.startOffset){var d=b.body.firstChild;d&&1==d.nodeType&&!dtd.$empty[d.tagName]&&c.setStartAtFirst(d).collapse(!0)}c.select(!0)}this.fireEvent("focus selectionchange")}catch(e){}},isFocus:function(){return this.selection.isFocus()},blur:function(){var a=this.selection.getNative();if(a.empty&&browser.ie){var b=document.body.createTextRange();b.moveToElementText(document.body),b.collapse(!0),b.select(),a.empty()}else a.removeAllRanges()},_initEvents:function(){var a=this,b=a.document,c=a.window;a._proxyDomEvent=utils.bind(a._proxyDomEvent,a),domUtils.on(b,["click","contextmenu","mousedown","keydown","keyup","keypress","mouseup","mouseover","mouseout","selectstart"],a._proxyDomEvent),domUtils.on(c,["focus","blur"],a._proxyDomEvent),domUtils.on(a.body,"drop",function(b){browser.gecko&&b.stopPropagation&&b.stopPropagation(),a.fireEvent("contentchange")}),domUtils.on(b,["mouseup","keydown"],function(b){"keydown"==b.type&&(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)||2!=b.button&&a._selectionChange(250,b)})},_proxyDomEvent:function(a){return this.fireEvent("before"+a.type.replace(/^on/,"").toLowerCase())!==!1&&(this.fireEvent(a.type.replace(/^on/,""),a)!==!1&&this.fireEvent("after"+a.type.replace(/^on/,"").toLowerCase()))},_selectionChange:function(a,b){var c,e,f=this,g=!1;if(browser.ie&&browser.version<9&&b&&"mouseup"==b.type){var h=this.selection.getRange();h.collapsed||(g=!0,c=b.clientX,e=b.clientY)}clearTimeout(d),d=setTimeout(function(){if(f.selection&&f.selection.getNative()){var a;if(g&&"None"==f.selection.getNative().type){a=f.document.body.createTextRange();try{a.moveToPoint(c,e)}catch(d){a=null}}var h;a&&(h=f.selection.getIERange,f.selection.getIERange=function(){return a}),f.selection.cache(),h&&(f.selection.getIERange=h),f.selection._cachedRange&&f.selection._cachedStartElement&&(f.fireEvent("beforeselectionchange"),f.fireEvent("selectionchange",!!b),f.fireEvent("afterselectionchange"),f.selection.clear())}},a||50)},_callCmdFn:function(a,b){var c,d,e=b[0].toLowerCase();return c=this.commands[e]||UE.commands[e],d=c&&c[a],c&&d||"queryCommandState"!=a?d?d.apply(this,b):void 0:0},execCommand:function(a){a=a.toLowerCase();var b,c=this,d=c.commands[a]||UE.commands[a];return d&&d.execCommand?(d.notNeedUndo||c.__hasEnterExecCommand?(b=this._callCmdFn("execCommand",arguments),!c.__hasEnterExecCommand&&!d.ignoreContentChange&&!c._ignoreContentChange&&c.fireEvent("contentchange")):(c.__hasEnterExecCommand=!0,c.queryCommandState.apply(c,arguments)!=-1&&(c.fireEvent("saveScene"),c.fireEvent.apply(c,["beforeexeccommand",a].concat(arguments)),b=this._callCmdFn("execCommand",arguments),c.fireEvent.apply(c,["afterexeccommand",a].concat(arguments)),c.fireEvent("saveScene")),c.__hasEnterExecCommand=!1),!c.__hasEnterExecCommand&&!d.ignoreContentChange&&!c._ignoreContentChange&&c._selectionChange(),b):null},queryCommandState:function(a){return this._callCmdFn("queryCommandState",arguments)},queryCommandValue:function(a){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(a){if(a)for(var b,c=0;b=a[c++];)if(this.document.getElementsByTagName(b).length>0)return!0;if(!domUtils.isEmptyBlock(this.body))return!0;for(a=["div"],c=0;b=a[c++];)for(var d,e=domUtils.getElementsByTagName(this.document,b),f=0;d=e[f++];)if(domUtils.isCustomeNode(d))return!0;return!1},reset:function(){this.fireEvent("reset")},setEnabled:function(){var a,b=this;if("false"==b.body.contentEditable){b.body.contentEditable=!0,a=b.selection.getRange();try{a.moveToBookmark(b.lastBk),delete b.lastBk}catch(c){a.setStartAtFirst(b.body).collapse(!0)}a.select(!0),b.bkqueryCommandState&&(b.queryCommandState=b.bkqueryCommandState,delete b.bkqueryCommandState),b.bkqueryCommandValue&&(b.queryCommandValue=b.bkqueryCommandValue,delete b.bkqueryCommandValue),b.fireEvent("selectionchange")}},enable:function(){return this.setEnabled()},setDisabled:function(a){var b=this;a=a?utils.isArray(a)?a:[a]:[],"true"==b.body.contentEditable&&(b.lastBk||(b.lastBk=b.selection.getRange().createBookmark(!0)),b.body.contentEditable=!1,b.bkqueryCommandState=b.queryCommandState,b.bkqueryCommandValue=b.queryCommandValue,b.queryCommandState=function(c){return utils.indexOf(a,c)!=-1?b.bkqueryCommandState.apply(b,arguments):-1},b.queryCommandValue=function(c){return utils.indexOf(a,c)!=-1?b.bkqueryCommandValue.apply(b,arguments):null},b.fireEvent("selectionchange"))},disable:function(a){return this.setDisabled(a)},_setDefaultContent:function(){ -function a(){var b=this;b.document.getElementById("initContent")&&(b.body.innerHTML="

                      "+(ie?"":"
                      ")+"

                      ",b.removeListener("firstBeforeExecCommand focus",a),setTimeout(function(){b.focus(),b._selectionChange()},0))}return function(b){var c=this;c.body.innerHTML='

                      '+b+"

                      ",c.addListener("firstBeforeExecCommand focus",a)}}(),setShow:function(){var a=this,b=a.selection.getRange();if("none"==a.container.style.display){try{b.moveToBookmark(a.lastBk),delete a.lastBk}catch(c){b.setStartAtFirst(a.body).collapse(!0)}setTimeout(function(){b.select(!0)},100),a.container.style.display=""}},show:function(){return this.setShow()},setHide:function(){var a=this;a.lastBk||(a.lastBk=a.selection.getRange().createBookmark(!0)),a.container.style.display="none"},hide:function(){return this.setHide()},getLang:function(a){var b=UE.I18N[this.options.lang];if(!b)throw Error("not import language file");a=(a||"").split(".");for(var c,d=0;(c=a[d++])&&(b=b[c],b););return b},getContentLength:function(a,b){var c=this.getContent(!1,!1,!0).length;if(a){b=(b||[]).concat(["hr","img","iframe"]),c=this.getContentTxt().replace(/[\t\r\n]+/g,"").length;for(var d,e=0;d=b[e++];)c+=this.document.getElementsByTagName(d).length}return c},addInputRule:function(a){this.inputRules.push(a)},filterInputRule:function(a){for(var b,c=0;b=this.inputRules[c++];)b.call(this,a)},addOutputRule:function(a){this.outputRules.push(a)},filterOutputRule:function(a){for(var b,c=0;b=this.outputRules[c++];)b.call(this,a)},getActionUrl:function(a){var b=(this.getOpt(a)||a,this.getOpt("imageUrl"),this.getOpt("serverUrl"));return b?(b+="?",utils.formatUrl(b)):""}},utils.inherits(f,EventBase)}(),UE.Editor.defaultOptions=function(a){var b=a.options.UEDITOR_HOME_URL;return{isShow:!0,initialContent:"",initialStyle:"",autoClearinitialContent:!1,iframeCssUrl:b+"themes/iframe.css",textarea:"editorValue",focus:!1,focusInEnd:!0,autoClearEmptyNode:!0,fullscreen:!1,readonly:!1,zIndex:999,imagePopup:!0,enterTag:"p",customDomain:!1,lang:"zh-cn",langPath:b+"i18n/",theme:"default",themePath:b+"themes/",allHtmlEnabled:!1,scaleEnabled:!1,tableNativeEditInFF:!1,autoSyncData:!0,fileNameFormat:"{time}{rand:6}"}},function(){UE.Editor.prototype.loadServerConfig=function(){function showErrorMsg(a){console&&console.error(a)}var me=this;setTimeout(function(){try{me.options.imageUrl&&me.setOpt("serverUrl",me.options.imageUrl.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2"));var configUrl=me.getActionUrl("config"),isJsonp=utils.isCrossDomainUrl(configUrl);me._serverConfigLoaded=!1,configUrl&&UE.ajax.request(configUrl,{method:"GET",dataType:isJsonp?"jsonp":"",onsuccess:function(r){try{var config=isJsonp?r:eval("("+r.responseText+")");utils.extend(me.options,config),me.fireEvent("serverConfigLoaded"),me._serverConfigLoaded=!0}catch(e){showErrorMsg(me.getLang("loadconfigFormatError"))}},onerror:function(){showErrorMsg(me.getLang("loadconfigHttpError"))}})}catch(e){showErrorMsg(me.getLang("loadconfigError"))}})},UE.Editor.prototype.isServerConfigLoaded=function(){var a=this;return a._serverConfigLoaded||!1},UE.Editor.prototype.afterConfigReady=function(a){if(a&&utils.isFunction(a)){var b=this,c=function(){a.apply(b,arguments),b.removeListener("serverConfigLoaded",c)};b.isServerConfigLoaded()?a.call(b,"serverConfigLoaded"):b.addListener("serverConfigLoaded",c)}}}(),UE.ajax=function(){function a(a){var b=[];for(var c in a)if("method"!=c&&"timeout"!=c&&"async"!=c&&"dataType"!=c&&"callback"!=c&&void 0!=a[c]&&null!=a[c])if("function"!=(typeof a[c]).toLowerCase()&&"object"!=(typeof a[c]).toLowerCase())b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));else if(utils.isArray(a[c]))for(var d=0;d/gi,"").replace(/]*>[\s\S]*?.<\/v:shape>/gi,function(a){if(browser.opera)return"";try{if(/Bitmap/i.test(a))return"";var c=a.match(/width:([ \d.]*p[tx])/i)[1],d=a.match(/height:([ \d.]*p[tx])/i)[1],e=a.match(/src=\s*"([^"]*)"/i)[1];return''}catch(f){return""}}).replace(/<\/?div[^>]*>/g,"").replace(/v:\w+=(["']?)[^'"]+\1/g,"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/

                      ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

                      $1

                      ").replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/gi,function(a,b,c,d){return"class"==b&&"MsoListParagraph"==d?a:""}).replace(/<(font|span)[^>]*>(\s*)<\/\1>/gi,function(a,b,c){return c.replace(/[\t\r\n ]+/g," ")}).replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,function(a,c,d,e){for(var f,g=[],h=e.replace(/^\s+|\s+$/,"").replace(/'/g,"'").replace(/"/gi,"'").replace(/[\d.]+(cm|pt)/g,function(a){return utils.transUnitToPx(a)}).split(/;\s*/g),i=0;f=h[i];i++){var j,k,l=f.split(":");if(2==l.length){if(j=l[0].toLowerCase(),k=l[1].toLowerCase(),/^(background)\w*/.test(j)&&0==k.replace(/(initial|\s)/g,"").length||/^(margin)\w*/.test(j)&&/^0\w+$/.test(k))continue;switch(j){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":/1&&(a(h,j,!0),b(h,j)),c(k,h,i,j);break;case"text":d(g,h);break;case"element":e(g,h,i,j);break;case"comment":f(g,h,i)}return h}function d(a,b){"pre"==a.parentNode.tagName?b.push(a.data):b.push(l[a.parentNode.tagName]?utils.html(a.data):a.data.replace(/[ ]{2}/g,"  "))}function e(d,e,f,g){var h="";if(d.attrs){h=[];var i=d.attrs;for(var j in i)h.push(j+(void 0!==i[j]?'="'+(k[j]?utils.html(i[j]).replace(/["]/g,function(a){return"""}):utils.unhtml(i[j]))+'"':""));h=h.join(" ")}if(e.push("<"+d.tagName+(h?" "+h:"")+(dtd.$empty[d.tagName]?"/":"")+">"),f&&!dtd.$inlineWithA[d.tagName]&&"pre"!=d.tagName&&d.children&&d.children.length&&(g=a(e,g,!0),b(e,g)),d.children&&d.children.length)for(var l,m=0;l=d.children[m++];)f&&"element"==l.type&&!dtd.$inlineWithA[l.tagName]&&m>1&&(a(e,g),b(e,g)),c(l,e,f,g);dtd.$empty[d.tagName]||(f&&!dtd.$inlineWithA[d.tagName]&&"pre"!=d.tagName&&d.children&&d.children.length&&(g=a(e,g),b(e,g)),e.push(""))}function f(a,b){b.push("")}function g(a,b){var c;if("element"==a.type&&a.getAttr("id")==b)return a;if(a.children&&a.children.length)for(var d,e=0;d=a.children[e++];)if(c=g(d,b))return c}function h(a,b,c){if("element"==a.type&&a.tagName==b&&c.push(a),a.children&&a.children.length)for(var d,e=0;d=a.children[e++];)h(d,b,c)}function i(a,b){if(a.children&&a.children.length)for(var c,d=0;c=a.children[d];)i(c,b),c.parentNode&&(c.children&&c.children.length&&b(c),c.parentNode&&d++);else b(a)}var j=UE.uNode=function(a){this.type=a.type,this.data=a.data,this.tagName=a.tagName,this.parentNode=a.parentNode,this.attrs=a.attrs||{},this.children=a.children},k={href:1,src:1,_src:1,_href:1,cdata_data:1},l={style:1,script:1},m=" ",n="\n";j.createElement=function(a){return/[<>]/.test(a)?UE.htmlparser(a).children[0]:new j({type:"element",children:[],tagName:a})},j.createText=function(a,b){return new UE.uNode({type:"text",data:b?a:utils.unhtml(a||"")})},j.prototype={toHtml:function(a){var b=[];return c(this,b,a,0),b.join("")},innerHTML:function(a){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(utils.isString(a)){if(this.children)for(var b,c=0;b=this.children[c++];)b.parentNode=null;this.children=[];for(var b,d=UE.htmlparser(a),c=0;b=d.children[c++];)this.children.push(b),b.parentNode=this;return this}var d=new UE.uNode({type:"root",children:this.children});return d.toHtml()},innerText:function(a,b){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(a){if(this.children)for(var c,d=0;c=this.children[d++];)c.parentNode=null;return this.children=[],this.appendChild(j.createText(a,b)),this}return this.toHtml().replace(/<[^>]+>/g,"")},getData:function(){return"element"==this.type?"":this.data},firstChild:function(){return this.children?this.children[0]:null},lastChild:function(){return this.children?this.children[this.children.length-1]:null},previousSibling:function(){for(var a,b=this.parentNode,c=0;a=b.children[c];c++)if(a===this)return 0==c?null:b.children[c-1]},nextSibling:function(){for(var a,b=this.parentNode,c=0;a=b.children[c++];)if(a===this)return b.children[c]},replaceChild:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c,d=0;c=this.children[d];d++)if(c===b)return this.children.splice(d,1,a),b.parentNode=null,a.parentNode=this,a}},appendChild:function(a){if("root"==this.type||"element"==this.type&&!dtd.$empty[this.tagName]){this.children||(this.children=[]),a.parentNode&&a.parentNode.removeChild(a);for(var b,c=0;b=this.children[c];c++)if(b===a){this.children.splice(c,1);break}return this.children.push(a),a.parentNode=this,a}},insertBefore:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c,d=0;c=this.children[d];d++)if(c===b)return this.children.splice(d,0,a),a.parentNode=this,a}},insertAfter:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c,d=0;c=this.children[d];d++)if(c===b)return this.children.splice(d+1,0,a),a.parentNode=this,a}},removeChild:function(a,b){if(this.children)for(var c,d=0;c=this.children[d];d++)if(c===a){if(this.children.splice(d,1),c.parentNode=null,b&&c.children&&c.children.length)for(var e,f=0;e=c.children[f];f++)this.children.splice(d+f,0,e),e.parentNode=this;return c}},getAttr:function(a){return this.attrs&&this.attrs[a.toLowerCase()]},setAttr:function(a,b){if(!a)return void delete this.attrs;if(this.attrs||(this.attrs={}),utils.isObject(a))for(var c in a)a[c]?this.attrs[c.toLowerCase()]=a[c]:delete this.attrs[c];else b?this.attrs[a.toLowerCase()]=b:delete this.attrs[a]},getIndex:function(){for(var a,b=this.parentNode,c=0;a=b.children[c];c++)if(a===this)return c;return-1},getNodeById:function(a){var b;if(this.children&&this.children.length)for(var c,d=0;c=this.children[d++];)if(b=g(c,a))return b},getNodesByTagName:function(a){a=utils.trim(a).replace(/[ ]{2,}/g," ").split(" ");var b=[],c=this;return utils.each(a,function(a){if(c.children&&c.children.length)for(var d,e=0;d=c.children[e++];)h(d,a,b)}),b},getStyle:function(a){var b=this.getAttr("style");if(!b)return"";var c=new RegExp("(^|;)\\s*"+a+":([^;]+)","i"),d=b.match(c);return d&&d[0]?d[2]:""},setStyle:function(a,b){function c(a,b){var c=new RegExp("(^|;)\\s*"+a+":([^;]+;?)","gi");d=d.replace(c,"$1"),b&&(d=a+":"+utils.unhtml(b)+";"+d)}var d=this.getAttr("style");if(d||(d=""),utils.isObject(a))for(var e in a)c(e,a[e]);else c(a,b);this.setAttr("style",utils.trim(d))},traversal:function(a){return this.children&&this.children.length&&i(this,a),this}}}();var htmlparser=UE.htmlparser=function(a,b){function c(a,b){if(m[a.tagName]){var c=k.createElement(m[a.tagName]);a.appendChild(c),c.appendChild(k.createText(b)),a=c}else a.appendChild(k.createText(b))}function d(a,b,c){var e;if(e=l[b]){for(var f,h=a;"root"!=h.type;){if(utils.isArray(e)?utils.indexOf(e,h.tagName)!=-1:e==h.tagName){a=h,f=!0;break}h=h.parentNode}f||(a=d(a,utils.isArray(e)?e[0]:e))}var i=new k({parentNode:a,type:"element",tagName:b.toLowerCase(),children:dtd.$empty[b]?null:[]});if(c){for(var m,n={};m=g.exec(c);)n[m[1].toLowerCase()]=j[m[1].toLowerCase()]?m[2]||m[3]||m[4]:utils.unhtml(m[2]||m[3]||m[4]);i.attrs=n}return a.children.push(i),dtd.$empty[b]?a:i}function e(a,b){a.children.push(new k({type:"comment",data:b,parentNode:a}))}var f=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g,g=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,h={b:1,code:1,i:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,span:1,sub:1,img:1,sup:1,font:1,big:1,small:1,iframe:1,a:1,br:1,pre:1};a=a.replace(new RegExp(domUtils.fillChar,"g"),""),b||(a=a.replace(new RegExp("[\\r\\t\\n"+(b?"":" ")+"]*]*)>[\\r\\t\\n"+(b?"":" ")+"]*","g"),function(a,c){return c&&h[c.toLowerCase()]?a.replace(/(^[\n\r]+)|([\n\r]+$)/g,""):a.replace(new RegExp("^[\\r\\n"+(b?"":" ")+"]+"),"").replace(new RegExp("[\\r\\n"+(b?"":" ")+"]+$"),"")}));for(var i,j={href:1,src:1},k=UE.uNode,l={td:"tr",tr:["tbody","thead","tfoot"],tbody:"table",th:"tr",thead:"table",tfoot:"table",caption:"table",li:["ul","ol"],dt:"dl",dd:"dl",option:"select"},m={ol:"li",ul:"li"},n=0,o=0,p=new k({type:"root",children:[]}),q=p;i=f.exec(a);){n=i.index;try{if(n>o&&c(q,a.slice(o,n)),i[3])dtd.$cdata[q.tagName]?c(q,i[0]):q=d(q,i[3].toLowerCase(),i[4]);else if(i[1]){if("root"!=q.type)if(dtd.$cdata[q.tagName]&&!dtd.$cdata[i[1]])c(q,i[0]);else{for(var r=q;"element"==q.type&&q.tagName!=i[1].toLowerCase();)if(q=q.parentNode,"root"==q.type)throw q=r,"break";q=q.parentNode}}else i[2]&&e(q,i[2])}catch(s){}o=f.lastIndex}return o");break;case"div":if(b.getAttr("cdata_tag"))break;if(d=b.getAttr("class"),d&&/^line number\d+/.test(d))break;if(!e)break;for(var f,g=UE.uNode.createElement("p");f=b.firstChild();)"text"!=f.type&&UE.dom.dtd.$block[f.tagName]?g.firstChild()?(b.parentNode.insertBefore(g,b),g=UE.uNode.createElement("p")):b.parentNode.insertBefore(f,b):g.appendChild(f);g.firstChild()&&b.parentNode.insertBefore(g,b),b.parentNode.removeChild(b);break;case"dl":b.tagName="ul";break;case"dt":case"dd":b.tagName="li";break;case"li":var h=b.getAttr("class");h&&/list\-/.test(h)||b.setAttr();var i=b.getNodesByTagName("ol ul");UE.utils.each(i,function(a){b.parentNode.insertAfter(a,b)});break;case"td":case"th":case"caption":b.children&&b.children.length||b.appendChild(browser.ie11below?UE.uNode.createText(" "):UE.uNode.createElement("br"));break;case"table":a.options.disabledTableInTable&&c(b)&&(b.parentNode.insertBefore(UE.uNode.createText(b.innerText()),b),b.parentNode.removeChild(b))}}})}),a.addOutputRule(function(b){var c;b.traversal(function(b){if("element"==b.type){if(a.options.autoClearEmptyNode&&dtd.$inline[b.tagName]&&!dtd.$empty[b.tagName]&&(!b.attrs||utils.isEmptyObject(b.attrs)))return void(b.firstChild()?"span"!=b.tagName||b.attrs&&!utils.isEmptyObject(b.attrs)||b.parentNode.removeChild(b,!0):b.parentNode.removeChild(b));switch(b.tagName){case"div":(c=b.getAttr("cdata_tag"))&&(b.tagName=c,b.appendChild(UE.uNode.createText(b.getAttr("cdata_data"))),b.setAttr({cdata_tag:"",cdata_data:"",_ue_custom_node_:""}));break;case"a":(c=b.getAttr("_href"))&&b.setAttr({href:utils.html(c),_href:""});break;case"span":if(c=b.getAttr("id"),c&&/^_baidu_bookmark_/i.test(c)&&b.parentNode.removeChild(b),a.getOpt("rgb2Hex")){var d=b.getAttr("style");d&&b.setAttr("style",d.replace(/rgba?\(([\d,\s]+)\)/g,function(a,b){var c=b.split(",");if(c.length>3)return"";b="#";for(var d,e=0;d=c[e++];)d=parseInt(d.replace(/[^\d]/gi,""),10).toString(16),b+=1==d.length?"0"+d:d;return b.toUpperCase()}))}break;case"img":(c=b.getAttr("_src"))&&b.setAttr({src:b.getAttr("_src"),_src:""})}}})})},UE.commands.inserthtml={execCommand:function(a,b,c){var d,e,f=this;if(b&&f.fireEvent("beforeinserthtml",b)!==!0){if(d=f.selection.getRange(),e=d.document.createElement("div"),e.style.display="inline",!c){var g=UE.htmlparser(b);f.options.filterRules&&UE.filterNode(g,f.options.filterRules),f.filterInputRule(g),b=g.toHtml()}if(e.innerHTML=utils.trim(b),!d.collapsed){var h=d.startContainer;if(domUtils.isFillChar(h)&&d.setStartBefore(h),h=d.endContainer,domUtils.isFillChar(h)&&d.setEndAfter(h),d.txtToElmBoundary(),d.endContainer&&1==d.endContainer.nodeType&&(h=d.endContainer.childNodes[d.endOffset],h&&domUtils.isBr(h)&&d.setEndAfter(h)),0==d.startOffset&&(h=d.startContainer,domUtils.isBoundaryNode(h,"firstChild")&&(h=d.endContainer,d.endOffset==(3==h.nodeType?h.nodeValue.length:h.childNodes.length)&&domUtils.isBoundaryNode(h,"lastChild")&&(f.body.innerHTML="

                      "+(browser.ie?"":"
                      ")+"

                      ",d.setStart(f.body.firstChild,0).collapse(!0)))),!d.collapsed&&d.deleteContents(),1==d.startContainer.nodeType){var i,j=d.startContainer.childNodes[d.startOffset];if(j&&domUtils.isBlockElm(j)&&(i=j.previousSibling)&&domUtils.isBlockElm(i)){for(d.setEnd(i,i.childNodes.length).collapse();j.firstChild;)i.appendChild(j.firstChild);domUtils.remove(j)}}}var j,k,i,l,m,n=0;d.inFillChar()&&(j=d.startContainer,domUtils.isFillChar(j)?(d.setStartBefore(j).collapse(!0),domUtils.remove(j)):domUtils.isFillChar(j,!0)&&(j.nodeValue=j.nodeValue.replace(fillCharReg,""),d.startOffset--,d.collapsed&&d.collapse(!0)));var o=domUtils.findParentByTagName(d.startContainer,"li",!0);if(o){for(var p,q;j=e.firstChild;){for(;j&&(3==j.nodeType||!domUtils.isBlockElm(j)||"HR"==j.tagName);)p=j.nextSibling,d.insertNode(j).collapse(),q=j,j=p;if(j)if(/^(ol|ul)$/i.test(j.tagName)){for(;j.firstChild;)q=j.firstChild,domUtils.insertAfter(o,j.firstChild),o=o.nextSibling;domUtils.remove(j)}else{var r;p=j.nextSibling,r=f.document.createElement("li"),domUtils.insertAfter(o,r),r.appendChild(j),q=j,j=p,o=r}}o=domUtils.findParentByTagName(d.startContainer,"li",!0),domUtils.isEmptyBlock(o)&&domUtils.remove(o),q&&d.setStartAfter(q).collapse(!0).select(!0)}else{for(;j=e.firstChild;){if(n){for(var s=f.document.createElement("p");j&&(3==j.nodeType||!dtd.$block[j.tagName]);)m=j.nextSibling,s.appendChild(j),j=m;s.firstChild&&(j=s)}if(d.insertNode(j),m=j.nextSibling,!n&&j.nodeType==domUtils.NODE_ELEMENT&&domUtils.isBlockElm(j)&&(k=domUtils.findParent(j,function(a){return domUtils.isBlockElm(a)}),k&&"body"!=k.tagName.toLowerCase()&&(!dtd[k.tagName][j.nodeName]||j.parentNode!==k))){if(dtd[k.tagName][j.nodeName])for(l=j.parentNode;l!==k;)i=l,l=l.parentNode;else i=k;domUtils.breakParent(j,i||l);var i=j.previousSibling;domUtils.trimWhiteTextNode(i),i.childNodes.length||domUtils.remove(i),!browser.ie&&(p=j.nextSibling)&&domUtils.isBlockElm(p)&&p.lastChild&&!domUtils.isBr(p.lastChild)&&p.appendChild(f.document.createElement("br")),n=1}var p=j.nextSibling;if(!e.firstChild&&p&&domUtils.isBlockElm(p)){d.setStart(p,0).collapse(!0);break}d.setEndAfter(j).collapse()}if(j=d.startContainer,m&&domUtils.isBr(m)&&domUtils.remove(m),domUtils.isBlockElm(j)&&domUtils.isEmptyNode(j))if(m=j.nextSibling)domUtils.remove(j),1==m.nodeType&&dtd.$block[m.tagName]&&d.setStart(m,0).collapse(!0).shrinkBoundary();else try{j.innerHTML=browser.ie?domUtils.fillChar:"
                      "}catch(t){d.setStartBefore(j),domUtils.remove(j)}try{d.select(!0)}catch(t){}}setTimeout(function(){d=f.selection.getRange(),d.scrollToView(f.autoHeightEnabled,f.autoHeightEnabled?domUtils.getXY(f.iframe).y:0),f.fireEvent("afterinserthtml",b)},200)}}},UE.plugins.autotypeset=function(){function a(a,b){return a&&3!=a.nodeType?domUtils.isBr(a)?1:a&&a.parentNode&&l[a.tagName.toLowerCase()]?g&&g.contains(a)||a.getAttribute("pagebreak")?0:b?!domUtils.isEmptyBlock(a):domUtils.isEmptyBlock(a,new RegExp("[\\s"+domUtils.fillChar+"]","g")):void 0:0}function b(a){a.style.cssText||(domUtils.removeAttributes(a,["style"]),"span"==a.tagName.toLowerCase()&&domUtils.hasNoAttributes(a)&&domUtils.remove(a,!0))}function c(c,f){var h,l=this;if(f){if(!i.pasteFilter)return;h=l.document.createElement("div"),h.innerHTML=f.html}else h=l.document.body;for(var m,n=domUtils.getElementsByTagName(h,"*"),o=0;m=n[o++];)if(l.fireEvent("excludeNodeinautotype",m)!==!0){if(i.clearFontSize&&m.style.fontSize&&(domUtils.removeStyle(m,"font-size"),b(m)),i.clearFontFamily&&m.style.fontFamily&&(domUtils.removeStyle(m,"font-family"),b(m)),a(m)){if(i.mergeEmptyline)for(var p,q=m.nextSibling,r=domUtils.isBr(m);a(q)&&(p=q,q=p.nextSibling,!r||q&&(!q||domUtils.isBr(q)));)domUtils.remove(p);if(i.removeEmptyline&&domUtils.inDoc(m,h)&&!k[m.parentNode.tagName.toLowerCase()]){if(domUtils.isBr(m)&&(q=m.nextSibling,q&&!domUtils.isBr(q)))continue;domUtils.remove(m);continue}}if(a(m,!0)&&"SPAN"!=m.tagName&&(i.indent&&(m.style.textIndent=i.indentValue),i.textAlign&&(m.style.textAlign=i.textAlign)),i.removeClass&&m.className&&!j[m.className.toLowerCase()]){if(g&&g.contains(m))continue;domUtils.removeAttributes(m,["class"])}if(i.imageBlockLine&&"img"==m.tagName.toLowerCase()&&!m.getAttribute("emotion"))if(f){var s=m;switch(i.imageBlockLine){case"left":case"right":case"none":for(var p,t,q,u=s.parentNode;dtd.$inline[u.tagName]||"A"==u.tagName;)u=u.parentNode;if(p=u,"P"==p.tagName&&"center"==domUtils.getStyle(p,"text-align")&&!domUtils.isBody(p)&&1==domUtils.getChildCount(p,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)}))if(t=p.previousSibling,q=p.nextSibling,t&&q&&1==t.nodeType&&1==q.nodeType&&t.tagName==q.tagName&&domUtils.isBlockElm(t)){for(t.appendChild(p.firstChild);q.firstChild;)t.appendChild(q.firstChild);domUtils.remove(p),domUtils.remove(q)}else domUtils.setStyle(p,"text-align","");domUtils.setStyle(s,"float",i.imageBlockLine);break;case"center":if("center"!=l.queryCommandValue("imagefloat")){for(u=s.parentNode,domUtils.setStyle(s,"float","none"),p=s;u&&1==domUtils.getChildCount(u,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)})&&(dtd.$inline[u.tagName]||"A"==u.tagName);)p=u,u=u.parentNode;var v=l.document.createElement("p");domUtils.setAttributes(v,{style:"text-align:center"}),p.parentNode.insertBefore(v,p),v.appendChild(p),domUtils.setStyle(p,"float","")}}}else{var w=l.selection.getRange();w.selectNode(m).select(),l.execCommand("imagefloat",i.imageBlockLine)}i.removeEmptyNode&&i.removeTagNames[m.tagName.toLowerCase()]&&domUtils.hasNoAttributes(m)&&domUtils.isEmptyBlock(m)&&domUtils.remove(m)}if(i.tobdc){var x=UE.htmlparser(h.innerHTML);x.traversal(function(a){"text"==a.type&&(a.data=e(a.data))}),h.innerHTML=x.toHtml()}if(i.bdc2sb){var x=UE.htmlparser(h.innerHTML);x.traversal(function(a){"text"==a.type&&(a.data=d(a.data))}),h.innerHTML=x.toHtml()}f&&(f.html=h.innerHTML)}function d(a){for(var b="",c=0;c=65281&&d<=65373?String.fromCharCode(a.charCodeAt(c)-65248):12288==d?String.fromCharCode(a.charCodeAt(c)-12288+32):a.charAt(c)}return b}function e(a){a=utils.html(a);for(var b="",c=0;c0?e.substring(e.indexOf(d.options.imagePath),e.length-1).replace(/"|\(|\)/gi,""):"none"!=e?e.replace(/url\("?|"?\)/gi,""):"";var g=' ",b.push(g)},aftersetcontent:function(){0==c&&b()}},inputRule:function(d){c=!1,utils.each(d.getNodesByTagName("p"),function(d){var e=d.getAttr("data-background");e&&(c=!0,b(a(e)),d.parentNode.removeChild(d))})},outputRule:function(a){var b=this,c=(utils.cssRule(e,b.document)||"").replace(/[\n\r]+/g,"").match(f);c&&a.appendChild(UE.uNode.createElement('


                      '))},commands:{background:{execCommand:function(a,c){b(c)},queryCommandValue:function(){var b=this,c=(utils.cssRule(e,b.document)||"").replace(/[\n\r]+/g,"").match(f);return c?a(c[1]):null},notNeedUndo:!0}}}}),UE.commands.imagefloat={execCommand:function(a,b){var c=this,d=c.selection.getRange();if(!d.collapsed){var e=d.getClosedNode();if(e&&"IMG"==e.tagName)switch(b){case"left":case"right":case"none":for(var f,g,h,i=e.parentNode;dtd.$inline[i.tagName]||"A"==i.tagName;)i=i.parentNode;if(f=i,"P"==f.tagName&&"center"==domUtils.getStyle(f,"text-align")){if(!domUtils.isBody(f)&&1==domUtils.getChildCount(f,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)}))if(g=f.previousSibling,h=f.nextSibling,g&&h&&1==g.nodeType&&1==h.nodeType&&g.tagName==h.tagName&&domUtils.isBlockElm(g)){for(g.appendChild(f.firstChild);h.firstChild;)g.appendChild(h.firstChild);domUtils.remove(f),domUtils.remove(h)}else domUtils.setStyle(f,"text-align","");d.selectNode(e).select()}domUtils.setStyle(e,"float","none"==b?"":b),"none"==b&&domUtils.removeAttributes(e,"align");break;case"center":if("center"!=c.queryCommandValue("imagefloat")){var i=e.parentNode;for(domUtils.setStyle(e,"float",""),domUtils.removeAttributes(e,"align"),f=e;i&&1==domUtils.getChildCount(i,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)})&&(dtd.$inline[i.tagName]||"A"==i.tagName);)f=i,i=i.parentNode;d.setStartBefore(f).setCursor(!1),i=c.document.createElement("div"),i.appendChild(f),domUtils.setStyle(f,"float",""),c.execCommand("insertHtml",'

                      '+i.innerHTML+"

                      "),f=c.document.getElementsByClassName("_img_parent_tmp")[0],f.removeAttribute("class"),f=f.firstChild,d.selectNode(f).select(),h=f.parentNode.nextSibling,h&&domUtils.isEmptyNode(h)&&domUtils.remove(h)}}}},queryCommandValue:function(){var a,b,c=this.selection.getRange();return c.collapsed?"none":(a=c.getClosedNode(),a&&1==a.nodeType&&"IMG"==a.tagName?(b=domUtils.getComputedStyle(a,"float")||a.getAttribute("align"),"none"==b&&(b="center"==domUtils.getComputedStyle(a.parentNode,"text-align")?"center":b),{left:1,right:1,center:1}[b]?b:"none"):"none")},queryCommandState:function(){var a,b=this.selection.getRange();return b.collapsed?-1:(a=b.getClosedNode(),a&&1==a.nodeType&&"IMG"==a.tagName?0:-1)}},UE.commands.insertimage={execCommand:function(a,b){if(b=utils.isArray(b)?b:[b],b.length){var c=this,d=c.selection.getRange(),e=d.getClosedNode();if(c.fireEvent("beforeinsertimage",b)!==!0){if(!e||!/img/i.test(e.tagName)||"edui-faked-video"==e.className&&e.className.indexOf("edui-upload-video")==-1||e.getAttribute("word_img")){var f,g=[],h="";if(f=b[0],1==b.length)h=''+f.alt+'","center"==f.floatStyle&&(h='

                      '+h+"

                      "),g.push(h);else for(var i=0;f=b[i++];)h="

                      ",g.push(h);c.execCommand("insertHtml",g.join(""))}else{var j=b.shift(),k=j.floatStyle;delete j.floatStyle,domUtils.setAttributes(e,j),c.execCommand("imagefloat",k),b.length>0&&(d.setStartAfter(e).setCursor(!1,!0),c.execCommand("insertimage",b))}c.fireEvent("afterinsertimage",b)}}}},UE.plugins.justify=function(){var a=domUtils.isBlockElm,b={left:1,right:1,center:1,justify:1},c=function(b,c){var d=b.createBookmark(),e=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!domUtils.isBookmarkNode(a):!domUtils.isWhitespace(a)};b.enlarge(!0);for(var f,g=b.createBookmark(),h=domUtils.getNextDomNode(g.start,!1,e),i=b.cloneRange();h&&!(domUtils.getPosition(h,g.end)&domUtils.POSITION_FOLLOWING);)if(3!=h.nodeType&&a(h))h=domUtils.getNextDomNode(h,!0,e);else{for(i.setStartBefore(h);h&&h!==g.end&&!a(h);)f=h,h=domUtils.getNextDomNode(h,!1,null,function(b){return!a(b)});i.setEndAfter(f);var j=i.getCommonAncestor();if(!domUtils.isBody(j)&&a(j))domUtils.setStyles(j,utils.isString(c)?{"text-align":c}:c),h=j;else{var k=b.document.createElement("p");domUtils.setStyles(k,utils.isString(c)?{"text-align":c}:c);var l=i.extractContents();k.appendChild(l),i.insertNode(k),h=k}h=domUtils.getNextDomNode(h,!1,e)}return b.moveToBookmark(g).moveToBookmark(d)};UE.commands.justify={execCommand:function(a,b){var d,e=this.selection.getRange();return e.collapsed&&(d=this.document.createTextNode("p"),e.insertNode(d)),c(e,b),d&&(e.setStartBefore(d).collapse(!0),domUtils.remove(d)),e.select(),!0},queryCommandValue:function(){var a=this.selection.getStart(),c=domUtils.getComputedStyle(a,"text-align");return b[c]?c:"left"},queryCommandState:function(){var a=this.selection.getStart(),b=a&&domUtils.findParentByTagName(a,["td","th","caption"],!0);return b?-1:0}}},UE.plugins.font=function(){function a(a){for(var b;(b=a.parentNode)&&"SPAN"==b.tagName&&1==domUtils.getChildCount(b,function(a){return!domUtils.isBookmarkNode(a)&&!domUtils.isBr(a)});)b.style.cssText+=a.style.cssText,domUtils.remove(a,!0),a=b}function b(a,b,c){g[b]&&(a.adjustmentBoundary(),a.collapsed||1!=a.startContainer.nodeType||a.traversal(function(d){var e;if(e=domUtils.isTagNode(d,"span")?d:domUtils.getElementsByTagName(d,"span")[0],e&&domUtils.isTagNode(e,"span")){var f=a.createBookmark();utils.each(domUtils.getElementsByTagName(e,"span"),function(a){a.parentNode&&!domUtils.isBookmarkNode(a)&&("backcolor"==b&&domUtils.getComputedStyle(a,"background-color").toLowerCase()===c||(domUtils.removeStyle(a,g[b]),0==a.style.cssText.replace(/^\s+$/,"").length&&domUtils.remove(a,!0)))}),a.moveToBookmark(f)}}))}function c(c,d,e){var f,g=c.collapsed,h=c.createBookmark();if(g)for(f=h.start.parentNode;dtd.$inline[f.tagName];)f=f.parentNode;else f=domUtils.getCommonAncestor(h.start,h.end);utils.each(domUtils.getElementsByTagName(f,"span"),function(b){if(b.parentNode&&!domUtils.isBookmarkNode(b)){if(/\s*border\s*:\s*none;?\s*/i.test(b.style.cssText))return void(/^\s*border\s*:\s*none;?\s*$/.test(b.style.cssText)?domUtils.remove(b,!0):domUtils.removeStyle(b,"border"));if(/border/i.test(b.style.cssText)&&"SPAN"==b.parentNode.tagName&&/border/i.test(b.parentNode.style.cssText)&&(b.style.cssText=b.style.cssText.replace(/border[^:]*:[^;]+;?/gi,"")),"fontborder"!=d||"none"!=e)for(var c=b.nextSibling;c&&1==c.nodeType&&"SPAN"==c.tagName;)if(domUtils.isBookmarkNode(c)&&"fontborder"==d)b.appendChild(c),c=b.nextSibling;else{if(c.style.cssText==b.style.cssText&&(domUtils.moveChild(c,b),domUtils.remove(c)),b.nextSibling===c)break;c=b.nextSibling}if(a(b),browser.ie&&browser.version>8){var f=domUtils.findParent(b,function(a){return"SPAN"==a.tagName&&/background-color/.test(a.style.cssText)});f&&!/background-color/.test(b.style.cssText)&&(b.style.backgroundColor=f.style.backgroundColor)}}}),c.moveToBookmark(h),b(c,d,e)}var d=this,e={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family",underline:"text-decoration",strikethrough:"text-decoration",fontborder:"border"},f={underline:1,strikethrough:1,fontborder:1},g={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family"};d.setOpt({fontfamily:[{name:"songti",val:"宋体,SimSun"},{name:"yahei",val:"微软雅黑,Microsoft YaHei"},{name:"kaiti",val:"楷体,楷体_GB2312, SimKai"},{name:"heiti",val:"黑体, SimHei"},{name:"lishu",val:"隶书, SimLi"},{name:"andaleMono",val:"andale mono"},{name:"arial",val:"arial, helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"comicSansMs",val:"comic sans ms"},{name:"impact",val:"impact,chicago"},{name:"timesNewRoman",val:"times new roman"}],fontsize:[10,11,12,14,16,18,20,24,36]}),d.addInputRule(function(a){utils.each(a.getNodesByTagName("u s del font strike"),function(a){if("font"==a.tagName){var b=[];for(var c in a.attrs)switch(c){case"size":b.push("font-size:"+({1:"10",2:"12",3:"16",4:"18",5:"24",6:"32",7:"48"}[a.attrs[c]]||a.attrs[c])+"px");break;case"color":b.push("color:"+a.attrs[c]);break;case"face":b.push("font-family:"+a.attrs[c]);break;case"style":b.push(a.attrs[c])}a.attrs={style:b.join(";")}}else{var d="u"==a.tagName?"underline":"line-through";a.attrs={style:(a.getAttr("style")||"")+"text-decoration:"+d+";"}}a.tagName="span"})});for(var h in e)!function(a,b){UE.commands[a]={execCommand:function(d,e){e=e||(this.queryCommandState(d)?"none":"underline"==d?"underline":"fontborder"==d?"1px solid #000":"line-through");var g,h=this,i=this.selection.getRange();if("default"==e)i.collapsed&&(g=h.document.createTextNode("font"),i.insertNode(g).select()),h.execCommand("removeFormat","span,a",b),g&&(i.setStartBefore(g).collapse(!0),domUtils.remove(g)),c(i,d,e),i.select();else if(i.collapsed){var j=domUtils.findParentByTagName(i.startContainer,"span",!0);if(g=h.document.createTextNode("font"),!j||j.children.length||j[browser.ie?"innerText":"textContent"].replace(fillCharReg,"").length){if(i.insertNode(g),i.selectNode(g).select(),j=i.document.createElement("span"),f[a]){if(domUtils.findParentByTagName(g,"a",!0))return i.setStartBefore(g).setCursor(),void domUtils.remove(g);h.execCommand("removeFormat","span,a",b)}if(j.style.cssText=b+":"+e,g.parentNode.insertBefore(j,g),!browser.ie||browser.ie&&9==browser.version)for(var k=j.parentNode;!domUtils.isBlockElm(k);)"SPAN"==k.tagName&&(j.style.cssText=k.style.cssText+";"+j.style.cssText),k=k.parentNode;opera?setTimeout(function(){i.setStart(j,0).collapse(!0),c(i,d,e),i.select()}):(i.setStart(j,0).collapse(!0),c(i,d,e),i.select())}else i.insertNode(g),f[a]&&(i.selectNode(g).select(),h.execCommand("removeFormat","span,a",b,null),j=domUtils.findParentByTagName(g,"span",!0),i.setStartBefore(g)),j&&(j.style.cssText+=";"+b+":"+e),i.collapse(!0).select();domUtils.remove(g)}else f[a]&&h.queryCommandValue(a)&&h.execCommand("removeFormat","span,a",b),i=h.selection.getRange(),i.applyInlineStyle("span",{style:b+":"+e}),c(i,d,e),i.select();return!0},queryCommandValue:function(a){var c=this.selection.getStart();if("underline"==a||"strikethrough"==a){for(var d,e=c;e&&!domUtils.isBlockElm(e)&&!domUtils.isBody(e);){if(1==e.nodeType&&(d=domUtils.getComputedStyle(e,b),"none"!=d))return d;e=e.parentNode}return"none"}if("fontborder"==a){for(var f,g=c;g&&dtd.$inline[g.tagName];){if((f=domUtils.getComputedStyle(g,"border"))&&/1px/.test(f)&&/solid/.test(f))return f;g=g.parentNode}return""}if("FontSize"==a){var h=domUtils.getComputedStyle(c,b),g=/^([\d\.]+)(\w+)$/.exec(h);return g?Math.floor(g[1])+g[2]:h}return domUtils.getComputedStyle(c,b)},queryCommandState:function(a){if(!f[a])return 0;var b=this.queryCommandValue(a);return"fontborder"==a?/1px/.test(b)&&/solid/.test(b):"underline"==a?/underline/.test(b):/line\-through/.test(b)}}}(h,e[h])},UE.plugins.link=function(){function a(a){var b=a.startContainer,c=a.endContainer;(b=domUtils.findParentByTagName(b,"a",!0))&&a.setStartBefore(b),(c=domUtils.findParentByTagName(c,"a",!0))&&a.setEndAfter(c)}function b(b,c,d){var e=b.cloneRange(),f=d.queryCommandValue("link");a(b=b.adjustmentBoundary());var g=b.startContainer;if(1==g.nodeType&&f&&(g=g.childNodes[b.startOffset],g&&1==g.nodeType&&"A"==g.tagName&&/^(?:https?|ftp|file)\s*:\s*\/\//.test(g[browser.ie?"innerText":"textContent"])&&(g[browser.ie?"innerText":"textContent"]=utils.html(c.textValue||c.href))),e.collapsed&&!f||(b.removeInlineStyle("a"),e=b.cloneRange()),e.collapsed){var h=b.document.createElement("a"),i="";c.textValue?(i=utils.html(c.textValue),delete c.textValue):i=utils.html(c.href),domUtils.setAttributes(h,c),g=domUtils.findParentByTagName(e.startContainer,"a",!0),g&&domUtils.isInNodeEndBoundary(e,g)&&b.setStartAfter(g).collapse(!0),h[browser.ie?"innerText":"textContent"]=i,b.insertNode(h).selectNode(h)}else b.applyInlineStyle("a",c)}UE.commands.unlink={execCommand:function(){var b,c=this.selection.getRange();c.collapsed&&!domUtils.findParentByTagName(c.startContainer,"a",!0)||(b=c.createBookmark(),a(c),c.removeInlineStyle("a").moveToBookmark(b).select())},queryCommandState:function(){return!this.highlight&&this.queryCommandValue("link")?0:-1}},UE.commands.link={execCommand:function(a,c){var d;c._href&&(c._href=utils.unhtml(c._href,/[<">]/g)),c.href&&(c.href=utils.unhtml(c.href,/[<">]/g)),c.textValue&&(c.textValue=utils.unhtml(c.textValue,/[<">]/g)),b(d=this.selection.getRange(),c,this),d.collapse().select(!0)},queryCommandValue:function(){var a,b=this.selection.getRange();if(!b.collapsed){b.shrinkBoundary();var c=3!=b.startContainer.nodeType&&b.startContainer.childNodes[b.startOffset]?b.startContainer.childNodes[b.startOffset]:b.startContainer,d=3==b.endContainer.nodeType||0==b.endOffset?b.endContainer:b.endContainer.childNodes[b.endOffset-1],e=b.getCommonAncestor();if(a=domUtils.findParentByTagName(e,"a",!0),!a&&1==e.nodeType)for(var f,g,h,i=e.getElementsByTagName("a"),j=0;h=i[j++];)if(f=domUtils.getPosition(h,c),g=domUtils.getPosition(h,d),(f&domUtils.POSITION_FOLLOWING||f&domUtils.POSITION_CONTAINS)&&(g&domUtils.POSITION_PRECEDING||g&domUtils.POSITION_CONTAINS)){a=h;break}return a}if(a=b.startContainer,a=1==a.nodeType?a:a.parentNode,a&&(a=domUtils.findParentByTagName(a,"a",!0))&&!domUtils.isInNodeEndBoundary(b,a))return a},queryCommandState:function(){var a=this.selection.getRange().getClosedNode(),b=a&&("edui-faked-video"==a.className||a.className.indexOf("edui-upload-video")!=-1);return b?-1:0}}},UE.plugins.insertframe=function(){function a(){b._iframe&&delete b._iframe}var b=this;b.addListener("selectionchange",function(){a()})},UE.commands.scrawl={queryCommandState:function(){return browser.ie&&browser.version<=8?-1:0}},UE.plugins.removeformat=function(){var a=this;a.setOpt({removeFormatTags:"b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var",removeFormatAttributes:"class,style,lang,width,height,align,hspace,valign"}),a.commands.removeformat={execCommand:function(a,b,c,d,e){function f(a){if(3==a.nodeType||"span"!=a.tagName.toLowerCase())return 0;if(browser.ie){var b=a.attributes;if(b.length){for(var c=0,d=b.length;c
                      "+this.getContent(null,null,!0)+"
                      "),b.close()},notNeedUndo:1},UE.plugins.selectall=function(){var a=this;a.commands.selectall={execCommand:function(){var a=this,b=a.body,c=a.selection.getRange();c.selectNodeContents(b),domUtils.isEmptyBlock(b)&&(browser.opera&&b.firstChild&&1==b.firstChild.nodeType&&c.setStartAtFirst(b.firstChild),c.collapse(!0)),c.select(!0)},notNeedUndo:1},a.addshortcutkey({selectAll:"ctrl+65"})},UE.plugins.paragraph=function(){var a=this,b=domUtils.isBlockElm,c=["TD","LI","PRE"],d=function(a,d,e,f){var g,h=a.createBookmark(),i=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!domUtils.isBookmarkNode(a):!domUtils.isWhitespace(a)};a.enlarge(!0);for(var j,k=a.createBookmark(),l=domUtils.getNextDomNode(k.start,!1,i),m=a.cloneRange();l&&!(domUtils.getPosition(l,k.end)&domUtils.POSITION_FOLLOWING);)if(3!=l.nodeType&&b(l))l=domUtils.getNextDomNode(l,!0,i);else{for(m.setStartBefore(l);l&&l!==k.end&&!b(l);)j=l,l=domUtils.getNextDomNode(l,!1,null,function(a){return!b(a)});m.setEndAfter(j),g=a.document.createElement(d),e&&(domUtils.setAttributes(g,e),f&&"customstyle"==f&&e.style&&(g.style.cssText=e.style)),g.appendChild(m.extractContents()),domUtils.isEmptyNode(g)&&domUtils.fillChar(a.document,g),m.insertNode(g);var n=g.parentNode;b(n)&&!domUtils.isBody(g.parentNode)&&utils.indexOf(c,n.tagName)==-1&&(f&&"customstyle"==f||(n.getAttribute("dir")&&g.setAttribute("dir",n.getAttribute("dir")),n.style.cssText&&(g.style.cssText=n.style.cssText+";"+g.style.cssText),n.style.textAlign&&!g.style.textAlign&&(g.style.textAlign=n.style.textAlign),n.style.textIndent&&!g.style.textIndent&&(g.style.textIndent=n.style.textIndent),n.style.padding&&!g.style.padding&&(g.style.padding=n.style.padding)),e&&/h\d/i.test(n.tagName)&&!/h\d/i.test(g.tagName)?(domUtils.setAttributes(n,e),f&&"customstyle"==f&&e.style&&(n.style.cssText=e.style),domUtils.remove(g.parentNode,!0),g=n):domUtils.remove(g.parentNode,!0)),l=utils.indexOf(c,n.tagName)!=-1?n:g,l=domUtils.getNextDomNode(l,!1,i)}return a.moveToBookmark(k).moveToBookmark(h)};a.setOpt("paragraph",{p:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:""}),a.commands.paragraph={execCommand:function(a,b,c,e){var f=this.selection.getRange();if(f.collapsed){var g=this.document.createTextNode("p");if(f.insertNode(g),browser.ie){var h=g.previousSibling;h&&domUtils.isWhitespace(h)&&domUtils.remove(h),h=g.nextSibling,h&&domUtils.isWhitespace(h)&&domUtils.remove(h)}}if(f=d(f,b,c,e),g&&(f.setStartBefore(g).collapse(!0),pN=g.parentNode,domUtils.remove(g),domUtils.isBlockElm(pN)&&domUtils.isEmptyNode(pN)&&domUtils.fillNode(this.document,pN)),browser.gecko&&f.collapsed&&1==f.startContainer.nodeType){var i=f.startContainer.childNodes[f.startOffset];i&&1==i.nodeType&&i.tagName.toLowerCase()==b&&f.setStart(i,0).collapse(!0)}return f.select(),!0},queryCommandValue:function(){var a=domUtils.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return a?a.tagName.toLowerCase():""}}},function(){var a=domUtils.isBlockElm,b=function(a){return domUtils.filterNodeList(a.selection.getStartElementPath(),function(a){return a&&1==a.nodeType&&a.getAttribute("dir")})},c=function(c,d,e){var f,g=function(a){return 1==a.nodeType?!domUtils.isBookmarkNode(a):!domUtils.isWhitespace(a)},h=b(d);if(h&&c.collapsed)return h.setAttribute("dir",e),c;f=c.createBookmark(),c.enlarge(!0);for(var i,j=c.createBookmark(),k=domUtils.getNextDomNode(j.start,!1,g),l=c.cloneRange();k&&!(domUtils.getPosition(k,j.end)&domUtils.POSITION_FOLLOWING);)if(3!=k.nodeType&&a(k))k=domUtils.getNextDomNode(k,!0,g);else{for(l.setStartBefore(k);k&&k!==j.end&&!a(k);)i=k,k=domUtils.getNextDomNode(k,!1,null,function(b){return!a(b)});l.setEndAfter(i);var m=l.getCommonAncestor();if(!domUtils.isBody(m)&&a(m))m.setAttribute("dir",e),k=m;else{var n=c.document.createElement("p");n.setAttribute("dir",e);var o=l.extractContents();n.appendChild(o),l.insertNode(n),k=n}k=domUtils.getNextDomNode(k,!1,g)}return c.moveToBookmark(j).moveToBookmark(f)};UE.commands.directionality={execCommand:function(a,b){var d=this.selection.getRange();if(d.collapsed){var e=this.document.createTextNode("d");d.insertNode(e)}return c(d,this,b),e&&(d.setStartBefore(e).collapse(!0),domUtils.remove(e)),d.select(),!0},queryCommandValue:function(){var a=b(this);return a?a.getAttribute("dir"):"ltr"}}}(),UE.plugins.horizontal=function(){var a=this;a.commands.horizontal={execCommand:function(a){var b=this;if(b.queryCommandState(a)!==-1){b.execCommand("insertHtml","
                      ");var c=b.selection.getRange(),d=c.startContainer;if(1==d.nodeType&&!d.childNodes[c.startOffset]){var e;(e=d.childNodes[c.startOffset-1])&&1==e.nodeType&&"HR"==e.tagName&&("p"==b.options.enterTag?(e=b.document.createElement("p"),c.insertNode(e),c.setStart(e,0).setCursor()):(e=b.document.createElement("br"),c.insertNode(e),c.setStartBefore(e).setCursor()))}return!0}},queryCommandState:function(){return domUtils.filterNodeList(this.selection.getStartElementPath(),"table")?-1:0}},a.addListener("delkeydown",function(a,b){var c=this.selection.getRange();if(c.txtToElmBoundary(!0),domUtils.isStartInblock(c)){var d=c.startContainer,e=d.previousSibling;if(e&&domUtils.isTagNode(e,"hr"))return domUtils.remove(e),c.select(),domUtils.preventDefault(b),!0}})},UE.commands.time=UE.commands.date={execCommand:function(a,b){function c(a,b){var c=("0"+a.getHours()).slice(-2),d=("0"+a.getMinutes()).slice(-2),e=("0"+a.getSeconds()).slice(-2);return b=b||"hh:ii:ss",b.replace(/hh/gi,c).replace(/ii/gi,d).replace(/ss/gi,e)}function d(a,b){var c=("000"+a.getFullYear()).slice(-4),d=c.slice(-2),e=("0"+(a.getMonth()+1)).slice(-2),f=("0"+a.getDate()).slice(-2);return b=b||"yyyy-mm-dd",b.replace(/yyyy/gi,c).replace(/yy/gi,d).replace(/mm/gi,e).replace(/dd/gi,f)}var e=new Date;this.execCommand("insertHtml","time"==a?c(e,b):d(e,b))}},UE.plugins.rowspacing=function(){var a=this;a.setOpt({rowspacingtop:["5","10","15","20","25"],rowspacingbottom:["5","10","15","20","25"]}),a.commands.rowspacing={execCommand:function(a,b,c){return this.execCommand("paragraph","p",{style:"margin-"+c+":"+b+"px"}),!0},queryCommandValue:function(a,b){var c,d=domUtils.filterNodeList(this.selection.getStartElementPath(),function(a){return domUtils.isBlockElm(a)});return d?(c=domUtils.getComputedStyle(d,"margin-"+b).replace(/[^\d]/g,""),c?c:0):0}}},UE.plugins.lineheight=function(){var a=this;a.setOpt({lineheight:["1","1.5","1.75","2","3","4","5"]}),a.commands.lineheight={execCommand:function(a,b){return this.execCommand("paragraph","p",{style:"line-height:"+("1"==b?"normal":b+"em")}),!0},queryCommandValue:function(){var a=domUtils.filterNodeList(this.selection.getStartElementPath(),function(a){return domUtils.isBlockElm(a)});if(a){var b=domUtils.getComputedStyle(a,"line-height");return"normal"==b?1:b.replace(/[^\d.]*/gi,"")}}}},UE.plugins.insertcode=function(){var a=this;a.ready(function(){utils.cssRule("pre","pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}",a.document)}),a.setOpt("insertcode",{as3:"ActionScript3",bash:"Bash/Shell",cpp:"C/C++",css:"Css",cf:"CodeFunction","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"Html",java:"Java",jfx:"JavaFx",js:"Javascript",pl:"Perl",php:"Php",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"Sql",vb:"Vb",xml:"Xml"}),a.commands.insertcode={execCommand:function(a,b){var c=this,d=c.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"pre",!0);if(e)e.className="brush:"+b+";toolbar:false;";else{var f="";if(d.collapsed)f=browser.ie&&browser.ie11below?browser.version<=8?" ":"":"
                      ";else{var g=d.extractContents(),h=c.document.createElement("div");h.appendChild(g),utils.each(UE.filterNode(UE.htmlparser(h.innerHTML.replace(/[\r\t]/g,"")),c.options.filterTxtRules).children,function(a){if(browser.ie&&browser.ie11below&&browser.version>8)"element"==a.type?"br"==a.tagName?f+="\n":dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?f+="\n":dtd.$empty[a.tagName]||(f+=b.innerText()):f+=b.data}),/\n$/.test(f)||(f+="\n")):f+=a.data+"\n",!a.nextSibling()&&/\n$/.test(f)&&(f=f.replace(/\n$/,""));else if(browser.ie&&browser.ie11below)"element"==a.type?"br"==a.tagName?f+="
                      ":dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?f+="
                      ":dtd.$empty[a.tagName]||(f+=b.innerText()):f+=b.data}),/br>$/.test(f)||(f+="
                      ")):f+=a.data+"
                      ",!a.nextSibling()&&/
                      $/.test(f)&&(f=f.replace(/
                      $/,""));else if(f+="element"==a.type?dtd.$empty[a.tagName]?"":a.innerText():a.data,!/br\/?\s*>$/.test(f)){if(!a.nextSibling())return;f+="
                      "}})}c.execCommand("inserthtml",'
                      '+f+"
                      ",!0),e=c.document.getElementById("coder"),domUtils.removeAttributes(e,"id");var i=e.previousSibling;i&&(3==i.nodeType&&1==i.nodeValue.length&&browser.ie&&6==browser.version||domUtils.isEmptyBlock(i))&&domUtils.remove(i);var d=c.selection.getRange();domUtils.isEmptyBlock(e)?d.setStart(e,0).setCursor(!1,!0):d.selectNodeContents(e).select()}},queryCommandValue:function(){var a=this.selection.getStartElementPath(),b="";return utils.each(a,function(a){if("PRE"==a.nodeName){var c=a.className.match(/brush:([^;]+)/);return b=c&&c[1]?c[1]:"",!1}}),b}},a.addInputRule(function(a){utils.each(a.getNodesByTagName("pre"),function(a){var b=a.getNodesByTagName("br");if(b.length)return void(browser.ie&&browser.ie11below&&browser.version>8&&utils.each(b,function(a){var b=UE.uNode.createText("\n");a.parentNode.insertBefore(b,a),a.parentNode.removeChild(a)}));if(!(browser.ie&&browser.ie11below&&browser.version>8)){var c=a.innerText().split(/\n/);a.innerHTML(""),utils.each(c,function(b){b.length&&a.appendChild(UE.uNode.createText(b)),a.appendChild(UE.uNode.createElement("br"))})}})}),a.addOutputRule(function(a){utils.each(a.getNodesByTagName("pre"),function(a){var b="";utils.each(a.children,function(a){b+="text"==a.type?a.data.replace(/[ ]/g," ").replace(/\n$/,""):"br"==a.tagName?"\n":dtd.$empty[a.tagName]?a.innerText():""}),a.innerText(b.replace(/( |\n)+$/,""))})}),a.notNeedCodeQuery={help:1,undo:1,redo:1,source:1, -print:1,searchreplace:1,fullscreen:1,preview:1,insertparagraph:1,elementpath:1,insertcode:1,inserthtml:1,selectall:1};a.queryCommandState;a.queryCommandState=function(a){var b=this;return!b.notNeedCodeQuery[a.toLowerCase()]&&b.selection&&b.queryCommandValue("insertcode")?-1:UE.Editor.prototype.queryCommandState.apply(this,arguments)},a.addListener("beforeenterkeydown",function(){var b=a.selection.getRange(),c=domUtils.findParentByTagName(b.startContainer,"pre",!0);if(c){if(a.fireEvent("saveScene"),b.collapsed||b.deleteContents(),!browser.ie||browser.ie9above){var c,d=a.document.createElement("br");b.insertNode(d).setStartAfter(d).collapse(!0);var e=d.nextSibling;e||browser.ie&&!(browser.version>10)?b.setStartAfter(d):b.insertNode(d.cloneNode(!1)),c=d.previousSibling;for(var f;c;)if(f=c,c=c.previousSibling,!c||"BR"==c.nodeName){c=f;break}if(c){for(var g="";c&&"BR"!=c.nodeName&&new RegExp("^[\\s"+domUtils.fillChar+"]*$").test(c.nodeValue);)g+=c.nodeValue,c=c.nextSibling;if("BR"!=c.nodeName){var h=c.nodeValue.match(new RegExp("^([\\s"+domUtils.fillChar+"]+)"));h&&h[1]&&(g+=h[1])}g&&(g=a.document.createTextNode(g),b.insertNode(g).setStartAfter(g))}b.collapse(!0).select(!0)}else if(browser.version>8){var i=a.document.createTextNode("\n"),j=b.startContainer;if(0==b.startOffset){var k=j.previousSibling;if(k){b.insertNode(i);var l=a.document.createTextNode(" ");b.setStartAfter(i).insertNode(l).setStart(l,0).collapse(!0).select(!0)}}else{b.insertNode(i).setStartAfter(i);var l=a.document.createTextNode(" ");j=b.startContainer.childNodes[b.startOffset],j&&!/^\n/.test(j.nodeValue)&&b.setStartBefore(i),b.insertNode(l).setStart(l,0).collapse(!0).select(!0)}}else{var d=a.document.createElement("br");b.insertNode(d),b.insertNode(a.document.createTextNode(domUtils.fillChar)),b.setStartAfter(d),c=d.previousSibling;for(var f;c;)if(f=c,c=c.previousSibling,!c||"BR"==c.nodeName){c=f;break}if(c){for(var g="";c&&"BR"!=c.nodeName&&new RegExp("^[ "+domUtils.fillChar+"]*$").test(c.nodeValue);)g+=c.nodeValue,c=c.nextSibling;if("BR"!=c.nodeName){var h=c.nodeValue.match(new RegExp("^([ "+domUtils.fillChar+"]+)"));h&&h[1]&&(g+=h[1])}g=a.document.createTextNode(g),b.insertNode(g).setStartAfter(g)}b.collapse(!0).select()}return a.fireEvent("saveScene"),!0}}),a.addListener("tabkeydown",function(b,c){var d=a.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"pre",!0);if(e){if(a.fireEvent("saveScene"),c.shiftKey);else if(d.collapsed){var f=a.document.createTextNode(" ");d.insertNode(f).setStartAfter(f).collapse(!0).select(!0)}else{for(var g=d.createBookmark(),h=g.start.previousSibling;h;){if(e.firstChild===h&&!domUtils.isBr(h)){e.insertBefore(a.document.createTextNode(" "),h);break}if(domUtils.isBr(h)){e.insertBefore(a.document.createTextNode(" "),h.nextSibling);break}h=h.previousSibling}var i=g.end;for(h=g.start.nextSibling,e.firstChild===g.start&&e.insertBefore(a.document.createTextNode(" "),h.nextSibling);h&&h!==i;){if(domUtils.isBr(h)&&h.nextSibling){if(h.nextSibling===i)break;e.insertBefore(a.document.createTextNode(" "),h.nextSibling)}h=h.nextSibling}d.moveToBookmark(g).select()}return a.fireEvent("saveScene"),!0}}),a.addListener("beforeinserthtml",function(a,b){var c=this,d=c.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"pre",!0);if(e){d.collapsed||d.deleteContents();var f="";if(browser.ie&&browser.version>8){utils.each(UE.filterNode(UE.htmlparser(b),c.options.filterTxtRules).children,function(a){"element"==a.type?"br"==a.tagName?f+="\n":dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?f+="\n":dtd.$empty[a.tagName]||(f+=b.innerText()):f+=b.data}),/\n$/.test(f)||(f+="\n")):f+=a.data+"\n",!a.nextSibling()&&/\n$/.test(f)&&(f=f.replace(/\n$/,""))});var g=c.document.createTextNode(utils.html(f.replace(/ /g," ")));d.insertNode(g).selectNode(g).select()}else{var h=c.document.createDocumentFragment();utils.each(UE.filterNode(UE.htmlparser(b),c.options.filterTxtRules).children,function(a){"element"==a.type?"br"==a.tagName?h.appendChild(c.document.createElement("br")):dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?h.appendChild(c.document.createElement("br")):dtd.$empty[a.tagName]||h.appendChild(c.document.createTextNode(utils.html(b.innerText().replace(/ /g," ")))):h.appendChild(c.document.createTextNode(utils.html(b.data.replace(/ /g," "))))}),"BR"!=h.lastChild.nodeName&&h.appendChild(c.document.createElement("br"))):h.appendChild(c.document.createTextNode(utils.html(a.data.replace(/ /g," ")))),a.nextSibling()||"BR"!=h.lastChild.nodeName||h.removeChild(h.lastChild)}),d.insertNode(h).select()}return!0}}),a.addListener("keydown",function(a,b){var c=this,d=b.keyCode||b.which;if(40==d){var e,f=c.selection.getRange(),g=f.startContainer;if(f.collapsed&&(e=domUtils.findParentByTagName(f.startContainer,"pre",!0))&&!e.nextSibling){for(var h=e.lastChild;h&&"BR"==h.nodeName;)h=h.previousSibling;(h===g||f.startContainer===e&&f.startOffset==e.childNodes.length)&&(c.execCommand("insertparagraph"),domUtils.preventDefault(b))}}}),a.addListener("delkeydown",function(b,c){var d=this.selection.getRange();d.txtToElmBoundary(!0);var e=d.startContainer;if(domUtils.isTagNode(e,"pre")&&d.collapsed&&domUtils.isStartInblock(d)){var f=a.document.createElement("p");return domUtils.fillNode(a.document,f),e.parentNode.insertBefore(f,e),domUtils.remove(e),d.setStart(f,0).setCursor(!1,!0),domUtils.preventDefault(c),!0}})},UE.commands.cleardoc={execCommand:function(a){var b=this,c=b.options.enterTag,d=b.selection.getRange();"br"==c?(b.body.innerHTML="
                      ",d.setStart(b.body,0).setCursor()):(b.body.innerHTML="

                      "+(ie?"":"
                      ")+"

                      ",d.setStart(b.body.firstChild,0).setCursor(!1,!0)),setTimeout(function(){b.fireEvent("clearDoc")},0)}},UE.plugin.register("anchor",function(){var a=this;return{bindEvents:{ready:function(){utils.cssRule("anchor",".anchorclass{background: url('"+this.options.themePath+this.options.theme+"/images/anchor.gif') no-repeat scroll left center transparent;cursor: auto;display: inline-block;height: 16px;width: 16px;}",this.document)}},outputRule:function(a){utils.each(a.getNodesByTagName("img"),function(a){var b;(b=a.getAttr("anchorname"))&&(a.tagName="a",a.setAttr({anchorname:"",name:b,"class":""}))})},inputRule:function(a){utils.each(a.getNodesByTagName("a"),function(a){var b;if((b=a.getAttr("name"))&&!a.getAttr("href")){if(/^\_Toc\d+$/.test(b))return void a.parentNode.removeChild(a);a.tagName="img",a.setAttr({anchorname:a.getAttr("name"),"class":"anchorclass"}),a.setAttr("name")}})},commands:{anchor:{execCommand:function(b,c){var d=this.selection.getRange(),e=d.getClosedNode();if(e&&e.getAttribute("anchorname"))c?e.setAttribute("anchorname",c):(d.setStartBefore(e).setCursor(),domUtils.remove(e));else if(c){var f=utils.renderTplstr('',{name:c});a.execCommand("inserthtml",f,!0)}}}}}}),UE.plugins.wordcount=function(){var a=this;a.setOpt("wordCount",!0),a.addListener("contentchange",function(){a.fireEvent("wordcount")});var b;a.addListener("ready",function(){var a=this;domUtils.on(a.body,"keyup",function(c){var d=c.keyCode||c.which,e={16:1,18:1,20:1,37:1,38:1,39:1,40:1};d in e||(clearTimeout(b),b=setTimeout(function(){a.fireEvent("wordcount")},200))})})},UE.plugins.pagebreak=function(){function a(a){if(domUtils.isEmptyBlock(a)){for(var b,d=a.firstChild;d&&1==d.nodeType&&domUtils.isEmptyBlock(d);)b=d,d=d.firstChild;!b&&(b=a),domUtils.fillNode(c.document,b)}}function b(a){return a&&1==a.nodeType&&"HR"==a.tagName&&"pagebreak"==a.className}var c=this,d=["td"];c.setOpt("pageBreakTag","_ueditor_page_break_tag_"),c.ready(function(){utils.cssRule("pagebreak",".pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}",c.document)}),c.addInputRule(function(a){a.traversal(function(a){if("text"==a.type&&a.data==c.options.pageBreakTag){var b=UE.uNode.createElement('
                      ');a.parentNode.insertBefore(b,a),a.parentNode.removeChild(a)}})}),c.addOutputRule(function(a){utils.each(a.getNodesByTagName("hr"),function(a){if("pagebreak"==a.getAttr("class")){var b=UE.uNode.createText(c.options.pageBreakTag);a.parentNode.insertBefore(b,a),a.parentNode.removeChild(a)}})}),c.commands.pagebreak={execCommand:function(){var e=c.selection.getRange(),f=c.document.createElement("hr");domUtils.setAttributes(f,{"class":"pagebreak",noshade:"noshade",size:"5"}),domUtils.unSelectable(f);var g,h=domUtils.findParentByTagName(e.startContainer,d,!0),i=[];if(h)switch(h.tagName){case"TD":if(g=h.parentNode,g.previousSibling)g.parentNode.insertBefore(f,g),i=domUtils.findParents(f);else{var j=domUtils.findParentByTagName(g,"table");j.parentNode.insertBefore(f,j),i=domUtils.findParents(f,!0)}g=i[1],f!==g&&domUtils.breakParent(f,g),c.fireEvent("afteradjusttable",c.document)}else{if(!e.collapsed){e.deleteContents();for(var k=e.startContainer;!domUtils.isBody(k)&&domUtils.isBlockElm(k)&&domUtils.isEmptyNode(k);)e.setStartBefore(k).collapse(!0),domUtils.remove(k),k=e.startContainer}e.insertNode(f);for(var l,g=f.parentNode;!domUtils.isBody(g);)domUtils.breakParent(f,g),l=f.nextSibling,l&&domUtils.isEmptyBlock(l)&&domUtils.remove(l),g=f.parentNode;l=f.nextSibling;var m=f.previousSibling;if(b(m)?domUtils.remove(m):m&&a(m),l)b(l)?domUtils.remove(l):a(l),e.setEndAfter(f).collapse(!1);else{var n=c.document.createElement("p");f.parentNode.appendChild(n),domUtils.fillNode(c.document,n),e.setStart(n,0).collapse(!0)}e.select(!0)}}}},UE.plugin.register("wordimage",function(){var a=this,b=[];return{commands:{wordimage:{execCommand:function(){for(var b,c=domUtils.getElementsByTagName(a.body,"img"),d=[],e=0;b=c[e++];){var f=b.getAttribute("word_img");f&&d.push(f)}return d},queryCommandState:function(){b=domUtils.getElementsByTagName(a.body,"img");for(var c,d=0;c=b[d++];)if(c.getAttribute("word_img"))return 1;return-1},notNeedUndo:!0}},inputRule:function(b){utils.each(b.getNodesByTagName("img"),function(b){var c=b.attrs,d=parseInt(c.width)<128||parseInt(c.height)<43,e=a.options,f=e.UEDITOR_HOME_URL+"themes/notadd/images/spacer.gif";c.src&&/^(?:(file:\/+))/.test(c.src)&&b.setAttr({width:c.width,height:c.height,alt:c.alt,word_img:c.src,src:f,style:"background:url("+(d?e.themePath+e.theme+"/images/word.gif":e.langPath+e.lang+"/images/localimage.png")+") no-repeat center center;border:1px solid #ddd"})})}}}),UE.plugins.dragdrop=function(){var a=this;a.ready(function(){domUtils.on(this.body,"dragend",function(){var b=a.selection.getRange(),c=b.getClosedNode()||a.selection.getStart();if(c&&"IMG"==c.tagName){for(var d,e=c.previousSibling;(d=c.nextSibling)&&1==d.nodeType&&"SPAN"==d.tagName&&!d.firstChild;)domUtils.remove(d);(!e||1!=e.nodeType||domUtils.isEmptyBlock(e))&&e||d&&(!d||domUtils.isEmptyBlock(d))||(e&&"P"==e.tagName&&!domUtils.isEmptyBlock(e)?(e.appendChild(c),domUtils.moveChild(d,e),domUtils.remove(d)):d&&"P"==d.tagName&&!domUtils.isEmptyBlock(d)&&d.insertBefore(c,d.firstChild),e&&"P"==e.tagName&&domUtils.isEmptyBlock(e)&&domUtils.remove(e),d&&"P"==d.tagName&&domUtils.isEmptyBlock(d)&&domUtils.remove(d),b.selectNode(c).select(),a.fireEvent("saveScene"))}})}),a.addListener("keyup",function(b,c){var d=c.keyCode||c.which;if(13==d){var e,f=a.selection.getRange();(e=domUtils.findParentByTagName(f.startContainer,"p",!0))&&"center"==domUtils.getComputedStyle(e,"text-align")&&domUtils.removeStyle(e,"text-align")}})},UE.plugins.undo=function(){function a(a,b){if(a.length!=b.length)return 0;for(var c=0,d=a.length;cf&&this.list.shift(),this.index=this.list.length-1,this.clearKey(),this.update())},this.update=function(){this.hasRedo=!!this.list[this.index+1],this.hasUndo=!!this.list[this.index-1]},this.reset=function(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.clearKey()},this.clearKey=function(){m=0,k=null}}var d,e=this,f=e.options.maxUndoCount||20,g=e.options.maxInputCount||20,h=new RegExp(domUtils.fillChar+"|","gi"),i={ol:1,ul:1,table:1,tbody:1,tr:1,body:1},j=e.options.autoClearEmptyNode;e.undoManger=new c,e.undoManger.editor=e,e.addListener("saveScene",function(){var a=Array.prototype.splice.call(arguments,1);this.undoManger.save.apply(this.undoManger,a)}),e.addListener("reset",function(a,b){b||this.undoManger.reset()}),e.commands.redo=e.commands.undo={execCommand:function(a){this.undoManger[a]()},queryCommandState:function(a){return this.undoManger["has"+("undo"==a.toLowerCase()?"Undo":"Redo")]?0:-1},notNeedUndo:1};var k,l={16:1,17:1,18:1,37:1,38:1,39:1,40:1},m=0,n=!1;e.addListener("ready",function(){domUtils.on(this.body,"compositionstart",function(){n=!0}),domUtils.on(this.body,"compositionend",function(){n=!1})}),e.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89"});var o=!0;e.addListener("keydown",function(a,b){function c(a){a.undoManger.save(!1,!0),a.fireEvent("selectionchange")}var e=this,f=b.keyCode||b.which;if(!(l[f]||b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)){if(n)return;if(!e.selection.getRange().collapsed)return e.undoManger.save(!1,!0),void(o=!1);0==e.undoManger.list.length&&e.undoManger.save(!0),clearTimeout(d),d=setTimeout(function(){if(n)var a=setInterval(function(){n||(c(e),clearInterval(a))},300);else c(e)},200),k=f,m++,m>=g&&c(e)}}),e.addListener("keyup",function(a,b){var c=b.keyCode||b.which;if(!(l[c]||b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)){if(n)return;o||(this.undoManger.save(!1,!0),o=!0)}}),e.stopCmdUndo=function(){e.__hasEnterExecCommand=!0},e.startCmdUndo=function(){e.__hasEnterExecCommand=!1}},UE.plugin.register("copy",function(){function a(){ZeroClipboard.config({debug:!1,swfPath:b.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.swf"});var a=b.zeroclipboard=new ZeroClipboard;a.on("copy",function(a){var c=a.client,d=b.selection.getRange(),e=document.createElement("div");e.appendChild(d.cloneContents()),c.setText(e.innerText||e.textContent),c.setHtml(e.innerHTML),d.select()}),a.on("mouseover mouseout",function(a){var b=a.target;b&&("mouseover"==a.type?domUtils.addClass(b,"edui-state-hover"):"mouseout"==a.type&&domUtils.removeClasses(b,"edui-state-hover"))}),a.on("wrongflash noflash",function(){ZeroClipboard.destroy()}),b.fireEvent("zeroclipboardready",a)}var b=this;return{bindEvents:{ready:function(){browser.ie||(window.ZeroClipboard?a():utils.loadFile(document,{src:b.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.js",tag:"script",type:"text/javascript",defer:"defer"},function(){a()}))}},commands:{copy:{execCommand:function(a){b.document.execCommand("copy")||alert(b.getLang("copymsg"))}}}}}),UE.plugins.paste=function(){function a(a){var b=this.document;if(!b.getElementById("baidu_pastebin")){var c=this.selection.getRange(),d=c.createBookmark(),e=b.createElement("div");e.id="baidu_pastebin",browser.webkit&&e.appendChild(b.createTextNode(domUtils.fillChar+domUtils.fillChar)),b.body.appendChild(e),d.start.style.display="",e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+domUtils.getXY(d.start).y+"px",c.selectNodeContents(e).select(!0),setTimeout(function(){if(browser.webkit)for(var f,g=0,h=b.querySelectorAll("#baidu_pastebin");f=h[g++];){if(!domUtils.isEmptyNode(f)){e=f;break}domUtils.remove(f)}try{e.parentNode.removeChild(e)}catch(i){}c.moveToBookmark(d).select(!0),a(e)},0)}}function b(a){return a.replace(/<(\/?)([\w\-]+)([^>]*)>/gi,function(a,b,c,d){return c=c.toLowerCase(),{img:1}[c]?a:(d=d.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,function(a,b,c){return{src:1,href:1,name:1}[b.toLowerCase()]?b+"="+c+" ":""}),{span:1,div:1}[c]?"":"<"+b+c+" "+utils.trim(d)+">")})}function c(a){var c;if(a.firstChild){for(var h,i=domUtils.getElementsByTagName(a,"span"),j=0;h=i[j++];)"_baidu_cut_start"!=h.id&&"_baidu_cut_end"!=h.id||domUtils.remove(h);if(browser.webkit){for(var k,l=a.querySelectorAll("div br"),j=0;k=l[j++];){var m=k.parentNode;"DIV"==m.tagName&&1==m.childNodes.length&&(m.innerHTML="


                      ",domUtils.remove(m))}for(var n,o=a.querySelectorAll("#baidu_pastebin"),j=0;n=o[j++];){var p=d.document.createElement("p");for(n.parentNode.insertBefore(p,n);n.firstChild;)p.appendChild(n.firstChild);domUtils.remove(n)}for(var q,r=a.querySelectorAll("meta"),j=0;q=r[j++];)domUtils.remove(q);var l=a.querySelectorAll("br");for(j=0;q=l[j++];)/^apple-/i.test(q.className)&&domUtils.remove(q)}if(browser.gecko){var s=a.querySelectorAll("[_moz_dirty]");for(j=0;q=s[j++];)q.removeAttribute("_moz_dirty")}if(!browser.ie)for(var q,t=a.querySelectorAll("span.Apple-style-span"),j=0;q=t[j++];)domUtils.remove(q,!0);c=a.innerHTML,c=UE.filterWord(c);var u=UE.htmlparser(c);if(d.options.filterRules&&UE.filterNode(u,d.options.filterRules),d.filterInputRule(u),browser.webkit){var v=u.lastChild();v&&"element"==v.type&&"br"==v.tagName&&u.removeChild(v),utils.each(d.body.querySelectorAll("div"),function(a){domUtils.isEmptyBlock(a)&&domUtils.remove(a,!0)})}if(c={html:u.toHtml()},d.fireEvent("beforepaste",c,u),!c.html)return;u=UE.htmlparser(c.html,!0),1===d.queryCommandState("pasteplain")?d.execCommand("insertHtml",UE.filterNode(u,d.options.filterTxtRules).toHtml(),!0):(UE.filterNode(u,d.options.filterTxtRules),e=u.toHtml(),f=c.html,g=d.selection.getRange().createAddress(!0),d.execCommand("insertHtml",d.getOpt("retainOnlyLabelPasted")===!0?b(f):f,!0)),d.fireEvent("afterpaste",c)}}var d=this;d.setOpt({retainOnlyLabelPasted:!1});var e,f,g;d.addListener("pasteTransfer",function(a,c){if(g&&e&&f&&e!=f){var h=d.selection.getRange();if(h.moveToAddress(g,!0),!h.collapsed){for(;!domUtils.isBody(h.startContainer);){var i=h.startContainer;if(1==i.nodeType){if(i=i.childNodes[h.startOffset],!i){h.setStartBefore(h.startContainer);continue}var j=i.previousSibling;j&&3==j.nodeType&&new RegExp("^[\n\r\t "+domUtils.fillChar+"]*$").test(j.nodeValue)&&h.setStartBefore(j)}if(0!=h.startOffset)break;h.setStartBefore(h.startContainer)}for(;!domUtils.isBody(h.endContainer);){var k=h.endContainer;if(1==k.nodeType){if(k=k.childNodes[h.endOffset],!k){h.setEndAfter(h.endContainer);continue}var l=k.nextSibling;l&&3==l.nodeType&&new RegExp("^[\n\r\t"+domUtils.fillChar+"]*$").test(l.nodeValue)&&h.setEndAfter(l)}if(h.endOffset!=h.endContainer[3==h.endContainer.nodeType?"nodeValue":"childNodes"].length)break;h.setEndAfter(h.endContainer)}}h.deleteContents(),h.select(!0),d.__hasEnterExecCommand=!0;var m=f;2===c?m=b(m):c&&(m=e),d.execCommand("inserthtml",m,!0),d.__hasEnterExecCommand=!1;for(var n=d.selection.getRange();!domUtils.isBody(n.startContainer)&&!n.startOffset&&n.startContainer[3==n.startContainer.nodeType?"nodeValue":"childNodes"].length;)n.setStartBefore(n.startContainer);var o=n.createAddress(!0);g.endAddress=o.startAddress}}),d.addListener("ready",function(){domUtils.on(d.body,"cut",function(){var a=d.selection.getRange();!a.collapsed&&d.undoManger&&d.undoManger.save()}),domUtils.on(d.body,browser.ie||browser.opera?"keydown":"paste",function(b){(!browser.ie&&!browser.opera||(b.ctrlKey||b.metaKey)&&"86"==b.keyCode)&&a.call(d,function(a){c(a)})})}),d.commands.paste={execCommand:function(b){browser.ie?(a.call(d,function(a){c(a)}),d.document.execCommand("paste")):alert(d.getLang("pastemsg"))}}},UE.plugins.pasteplain=function(){var a=this;a.setOpt({pasteplain:!1,filterTxtRules:function(){function a(a){a.tagName="p",a.setStyle()}function b(a){a.parentNode.removeChild(a,!0)}return{"-":"script style object iframe embed input select",p:{$:{}},br:{$:{}},div:function(a){for(var b,c=UE.uNode.createElement("p");b=a.firstChild();)"text"!=b.type&&UE.dom.dtd.$block[b.tagName]?c.firstChild()?(a.parentNode.insertBefore(c,a),c=UE.uNode.createElement("p")):a.parentNode.insertBefore(b,a):c.appendChild(b);c.firstChild()&&a.parentNode.insertBefore(c,a),a.parentNode.removeChild(a)},ol:b,ul:b,dl:b,dt:b,dd:b,li:b,caption:a,th:a,tr:a,h1:a,h2:a,h3:a,h4:a,h5:a,h6:a,td:function(a){var b=!!a.innerText();b&&a.parentNode.insertAfter(UE.uNode.createText("    "),a),a.parentNode.removeChild(a,a.innerText())}}}()});var b=a.options.pasteplain;a.commands.pasteplain={queryCommandState:function(){return b?1:0},execCommand:function(){b=0|!b},notNeedUndo:1}},UE.plugins.list=function(){function a(a){var b=[];for(var c in a)b.push(c);return b}function b(a){var b=a.className;return domUtils.hasClass(a,/custom_/)?b.match(/custom_(\w+)/)[1]:domUtils.getStyle(a,"list-style-type")}function c(a,c){utils.each(domUtils.getElementsByTagName(a,"ol ul"),function(f){if(domUtils.inDoc(f,a)){var g=f.parentNode;if(g.tagName==f.tagName){var h=b(f)||("OL"==f.tagName?"decimal":"disc"),i=b(g)||("OL"==g.tagName?"decimal":"disc");if(h==i){var l=utils.indexOf(k[f.tagName],h);l=l+1==k[f.tagName].length?0:l+1,e(f,k[f.tagName][l])}}var m=0,n=2;domUtils.hasClass(f,/custom_/)?/[ou]l/i.test(g.tagName)&&domUtils.hasClass(g,/custom_/)||(n=1):/[ou]l/i.test(g.tagName)&&domUtils.hasClass(g,/custom_/)&&(n=3);var o=domUtils.getStyle(f,"list-style-type");o&&(f.style.cssText="list-style-type:"+o),f.className=utils.trim(f.className.replace(/list-paddingleft-\w+/,""))+" list-paddingleft-"+n,utils.each(domUtils.getElementsByTagName(f,"li"),function(a){if(a.style.cssText&&(a.style.cssText=""),!a.firstChild)return void domUtils.remove(a);if(a.parentNode===f){if(m++,domUtils.hasClass(f,/custom_/)){var c=1,d=b(f);if("OL"==f.tagName){if(d)switch(d){case"cn":case"cn1":case"cn2":m>10&&(m%10==0||m>10&&m<20)?c=2:m>20&&(c=3);break;case"num2":m>9&&(c=2)}a.className="list-"+j[d]+m+" list-"+d+"-paddingleft-"+c}else a.className="list-"+j[d]+" list-"+d+"-paddingleft"}else a.className=a.className.replace(/list-[\w\-]+/gi,"");var e=a.getAttribute("class");null===e||e.replace(/\s/g,"")||domUtils.removeAttributes(a,"class")}}),!c&&d(f,f.tagName.toLowerCase(),b(f)||domUtils.getStyle(f,"list-style-type"),!0)}})}function d(a,d,e,f){var g=a.nextSibling;g&&1==g.nodeType&&g.tagName.toLowerCase()==d&&(b(g)||domUtils.getStyle(g,"list-style-type")||("ol"==d?"decimal":"disc"))==e&&(domUtils.moveChild(g,a),0==g.childNodes.length&&domUtils.remove(g)),g&&domUtils.isFillChar(g)&&domUtils.remove(g);var h=a.previousSibling;h&&1==h.nodeType&&h.tagName.toLowerCase()==d&&(b(h)||domUtils.getStyle(h,"list-style-type")||("ol"==d?"decimal":"disc"))==e&&domUtils.moveChild(a,h),h&&domUtils.isFillChar(h)&&domUtils.remove(h),!f&&domUtils.isEmptyBlock(a)&&domUtils.remove(a),b(a)&&c(a.ownerDocument,!0)}function e(a,b){j[b]&&(a.className="custom_"+b);try{domUtils.setStyle(a,"list-style-type",b)}catch(c){}}function f(a){var b=a.previousSibling;b&&domUtils.isEmptyBlock(b)&&domUtils.remove(b),b=a.nextSibling,b&&domUtils.isEmptyBlock(b)&&domUtils.remove(b)}function g(a){for(;a&&!domUtils.isBody(a);){if("TABLE"==a.nodeName)return null;if("LI"==a.nodeName)return a;a=a.parentNode}}var h=this,i={TD:1,PRE:1,BLOCKQUOTE:1},j={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};h.setOpt({autoTransWordToList:!1,insertorderedlist:{num:"",num1:"",num2:"",cn:"",cn1:"",cn2:"",decimal:"","lower-alpha":"","lower-roman":"","upper-alpha":"","upper-roman":""},insertunorderedlist:{circle:"",disc:"",square:"",dash:"",dot:""},listDefaultPaddingLeft:"30",listiconpath:"http://bs.baidu.com/listicon/",maxListLevel:-1,disablePInList:!1});var k={OL:a(h.options.insertorderedlist),UL:a(h.options.insertunorderedlist)},l=h.options.listiconpath;for(var m in j)h.options.insertorderedlist.hasOwnProperty(m)||h.options.insertunorderedlist.hasOwnProperty(m)||delete j[m];h.ready(function(){var a=[];for(var b in j){if("dash"==b||"dot"==b)a.push("li.list-"+j[b]+"{background-image:url("+l+j[b]+".gif)}"),a.push("ul.custom_"+b+"{list-style:none;}ul.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}");else{for(var c=0;c<99;c++)a.push("li.list-"+j[b]+c+"{background-image:url("+l+"list-"+j[b]+c+".gif)}");a.push("ol.custom_"+b+"{list-style:none;}ol.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(b){case"cn":a.push("li.list-"+b+"-paddingleft-1{padding-left:25px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}"),a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case"cn1":a.push("li.list-"+b+"-paddingleft-1{padding-left:30px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}"),a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case"cn2":a.push("li.list-"+b+"-paddingleft-1{padding-left:40px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:55px}"),a.push("li.list-"+b+"-paddingleft-3{padding-left:68px}");break;case"num":case"num1":a.push("li.list-"+b+"-paddingleft-1{padding-left:25px}");break;case"num2":a.push("li.list-"+b+"-paddingleft-1{padding-left:35px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}");break;case"dash":a.push("li.list-"+b+"-paddingleft{padding-left:35px}");break;case"dot":a.push("li.list-"+b+"-paddingleft{padding-left:20px}")}}a.push(".list-paddingleft-1{padding-left:0}"),a.push(".list-paddingleft-2{padding-left:"+h.options.listDefaultPaddingLeft+"px}"),a.push(".list-paddingleft-3{padding-left:"+2*h.options.listDefaultPaddingLeft+"px}"),utils.cssRule("list","ol,ul{margin:0;pading:0;"+(browser.ie?"":"width:95%")+"}li{clear:both;}"+a.join("\n"),h.document)}),h.ready(function(){domUtils.on(h.body,"cut",function(){setTimeout(function(){var a,b=h.selection.getRange();if(!b.collapsed&&(a=domUtils.findParentByTagName(b.startContainer,"li",!0))&&!a.nextSibling&&domUtils.isEmptyBlock(a)){var c,d=a.parentNode;if(c=d.previousSibling)domUtils.remove(d),b.setStartAtLast(c).collapse(!0),b.select(!0);else if(c=d.nextSibling)domUtils.remove(d),b.setStartAtFirst(c).collapse(!0),b.select(!0);else{var e=h.document.createElement("p");domUtils.fillNode(h.document,e),d.parentNode.insertBefore(e,d),domUtils.remove(d),b.setStart(e,0).collapse(!0),b.select(!0)}}})})}),h.addListener("beforepaste",function(a,c){var d,e=this,f=e.selection.getRange(),g=UE.htmlparser(c.html,!0);if(d=domUtils.findParentByTagName(f.startContainer,"li",!0)){var h=d.parentNode,i="OL"==h.tagName?"ul":"ol";utils.each(g.getNodesByTagName(i),function(c){if(c.tagName=h.tagName,c.setAttr(),c.parentNode===g)a=b(h)||("OL"==h.tagName?"decimal":"disc");else{var d=c.parentNode.getAttr("class");a=d&&/custom_/.test(d)?d.match(/custom_(\w+)/)[1]:c.parentNode.getStyle("list-style-type"),a||(a="OL"==h.tagName?"decimal":"disc")}var e=utils.indexOf(k[h.tagName],a);c.parentNode!==g&&(e=e+1==k[h.tagName].length?0:e+1);var f=k[h.tagName][e];j[f]?c.setAttr("class","custom_"+f):c.setStyle("list-style-type",f)})}c.html=g.toHtml()}),h.getOpt("disablePInList")===!0&&h.addOutputRule(function(a){utils.each(a.getNodesByTagName("li"),function(a){var b=[],c=0;utils.each(a.children,function(d){if("p"==d.tagName){for(var e;e=d.children.pop();)b.splice(c,0,e),e.parentNode=a,lastNode=e;if(e=b[b.length-1],!e||"element"!=e.type||"br"!=e.tagName){var f=UE.uNode.createElement("br");f.parentNode=a,b.push(f)}c=b.length}}),b.length&&(a.children=b)})}),h.addInputRule(function(a){function b(a,b){var e=b.firstChild();if(e&&"element"==e.type&&"span"==e.tagName&&/Wingdings|Symbol/.test(e.getStyle("font-family"))){for(var f in d)if(d[f]==e.data)return f;return"disc"}for(var f in c)if(c[f].test(a))return f}if(utils.each(a.getNodesByTagName("li"),function(a){for(var b,c=UE.uNode.createElement("p"),d=0;b=a.children[d];)"text"==b.type||dtd.p[b.tagName]?c.appendChild(b):c.firstChild()?(a.insertBefore(c,b),c=UE.uNode.createElement("p"),d+=2):d++;(c.firstChild()&&!c.parentNode||!a.firstChild())&&a.appendChild(c),c.firstChild()||c.innerHTML(browser.ie?" ":"
                      ");var e=a.firstChild(),f=e.lastChild();f&&"text"==f.type&&/^\s*$/.test(f.data)&&e.removeChild(f)}),h.options.autoTransWordToList){var c={num1:/^\d+\)/,decimal:/^\d+\./,"lower-alpha":/^[a-z]+\)/,"upper-alpha":/^[A-Z]+\./,cn:/^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/,cn2:/^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/},d={square:"n"};utils.each(a.getNodesByTagName("p"),function(a){function d(a,b,d){if("ol"==a.tagName)if(browser.ie){var e=b.firstChild();"element"==e.type&&"span"==e.tagName&&c[d].test(e.innerText())&&b.removeChild(e)}else b.innerHTML(b.innerHTML().replace(c[d],""));else b.removeChild(b.firstChild());var f=UE.uNode.createElement("li");f.appendChild(b),a.appendChild(f)}if("MsoListParagraph"==a.getAttr("class")){a.setStyle("margin",""),a.setStyle("margin-left",""),a.setAttr("class","");var e,f=a,g=a;if("li"!=a.parentNode.tagName&&(e=b(a.innerText(),a))){var i=UE.uNode.createElement(h.options.insertorderedlist.hasOwnProperty(e)?"ol":"ul");for(j[e]?i.setAttr("class","custom_"+e):i.setStyle("list-style-type",e);a&&"li"!=a.parentNode.tagName&&b(a.innerText(),a);)f=a.nextSibling(),f||a.parentNode.insertBefore(i,a),d(i,a,e),a=f;!i.parentNode&&a&&a.parentNode&&a.parentNode.insertBefore(i,a)}var k=g.firstChild();k&&"element"==k.type&&"span"==k.tagName&&/^\s*( )+\s*$/.test(k.innerText())&&k.parentNode.removeChild(k)}})}}),h.addListener("contentchange",function(){c(h.document)}),h.addListener("keydown",function(a,b){function c(){b.preventDefault?b.preventDefault():b.returnValue=!1,h.fireEvent("contentchange"),h.undoManger&&h.undoManger.save()}function d(a,b){for(;a&&!domUtils.isBody(a);){if(b(a))return null;if(1==a.nodeType&&/[ou]l/i.test(a.tagName))return a;a=a.parentNode}return null}var e=b.keyCode||b.which;if(13==e&&!b.shiftKey){var g=h.selection.getRange(),i=domUtils.findParent(g.startContainer,function(a){return domUtils.isBlockElm(a)},!0),j=domUtils.findParentByTagName(g.startContainer,"li",!0);if(i&&"PRE"!=i.tagName&&!j){var k=i.innerHTML.replace(new RegExp(domUtils.fillChar,"g"),"");/^\s*1\s*\.[^\d]/.test(k)&&(i.innerHTML=k.replace(/^\s*1\s*\./,""),g.setStartAtLast(i).collapse(!0).select(),h.__hasEnterExecCommand=!0,h.execCommand("insertorderedlist"),h.__hasEnterExecCommand=!1)}var l=h.selection.getRange(),m=d(l.startContainer,function(a){return"TABLE"==a.tagName}),n=l.collapsed?m:d(l.endContainer,function(a){return"TABLE"==a.tagName});if(m&&n&&m===n){if(!l.collapsed){if(m=domUtils.findParentByTagName(l.startContainer,"li",!0), -n=domUtils.findParentByTagName(l.endContainer,"li",!0),!m||!n||m!==n){var o=l.cloneRange(),p=o.collapse(!1).createBookmark();l.deleteContents(),o.moveToBookmark(p);var j=domUtils.findParentByTagName(o.startContainer,"li",!0);return f(j),o.select(),void c()}if(l.deleteContents(),j=domUtils.findParentByTagName(l.startContainer,"li",!0),j&&domUtils.isEmptyBlock(j))return v=j.previousSibling,next=j.nextSibling,s=h.document.createElement("p"),domUtils.fillNode(h.document,s),q=j.parentNode,v&&next?(l.setStart(next,0).collapse(!0).select(!0),domUtils.remove(j)):((v||next)&&v?j.parentNode.parentNode.insertBefore(s,q.nextSibling):q.parentNode.insertBefore(s,q),domUtils.remove(j),q.firstChild||domUtils.remove(q),l.setStart(s,0).setCursor()),void c()}if(j=domUtils.findParentByTagName(l.startContainer,"li",!0)){if(domUtils.isEmptyBlock(j)){p=l.createBookmark();var q=j.parentNode;if(j!==q.lastChild?(domUtils.breakParent(j,q),f(j)):(q.parentNode.insertBefore(j,q.nextSibling),domUtils.isEmptyNode(q)&&domUtils.remove(q)),!dtd.$list[j.parentNode.tagName])if(domUtils.isBlockElm(j.firstChild))domUtils.remove(j,!0);else{for(s=h.document.createElement("p"),j.parentNode.insertBefore(s,j);j.firstChild;)s.appendChild(j.firstChild);domUtils.remove(j)}l.moveToBookmark(p).select()}else{var r=j.firstChild;if(!r||!domUtils.isBlockElm(r)){var s=h.document.createElement("p");for(!j.firstChild&&domUtils.fillNode(h.document,s);j.firstChild;)s.appendChild(j.firstChild);j.appendChild(s),r=s}var t=h.document.createElement("span");l.insertNode(t),domUtils.breakParent(t,j);var u=t.nextSibling;r=u.firstChild,r||(s=h.document.createElement("p"),domUtils.fillNode(h.document,s),u.appendChild(s),r=s),domUtils.isEmptyNode(r)&&(r.innerHTML="",domUtils.fillNode(h.document,r)),l.setStart(r,0).collapse(!0).shrinkBoundary().select(),domUtils.remove(t);var v=u.previousSibling;v&&domUtils.isEmptyBlock(v)&&(v.innerHTML="

                      ",domUtils.fillNode(h.document,v.firstChild))}c()}}}if(8==e&&(l=h.selection.getRange(),l.collapsed&&domUtils.isStartInblock(l)&&(o=l.cloneRange().trimBoundary(),j=domUtils.findParentByTagName(l.startContainer,"li",!0),j&&domUtils.isStartInblock(o)))){if(m=domUtils.findParentByTagName(l.startContainer,"p",!0),m&&m!==j.firstChild){var q=domUtils.findParentByTagName(m,["ol","ul"]);return domUtils.breakParent(m,q),f(m),h.fireEvent("contentchange"),l.setStart(m,0).setCursor(!1,!0),h.fireEvent("saveScene"),void domUtils.preventDefault(b)}if(j&&(v=j.previousSibling)){if(46==e&&j.childNodes.length)return;if(dtd.$list[v.tagName]&&(v=v.lastChild),h.undoManger&&h.undoManger.save(),r=j.firstChild,domUtils.isBlockElm(r))if(domUtils.isEmptyNode(r))for(v.appendChild(r),l.setStart(r,0).setCursor(!1,!0);j.firstChild;)v.appendChild(j.firstChild);else t=h.document.createElement("span"),l.insertNode(t),domUtils.isEmptyBlock(v)&&(v.innerHTML=""),domUtils.moveChild(j,v),l.setStartBefore(t).collapse(!0).select(!0),domUtils.remove(t);else if(domUtils.isEmptyNode(j)){var s=h.document.createElement("p");v.appendChild(s),l.setStart(s,0).setCursor()}else for(l.setEnd(v,v.childNodes.length).collapse().select(!0);j.firstChild;)v.appendChild(j.firstChild);return domUtils.remove(j),h.fireEvent("contentchange"),h.fireEvent("saveScene"),void domUtils.preventDefault(b)}if(j&&!j.previousSibling){var q=j.parentNode,p=l.createBookmark();if(domUtils.isTagNode(q.parentNode,"ol ul"))q.parentNode.insertBefore(j,q),domUtils.isEmptyNode(q)&&domUtils.remove(q);else{for(;j.firstChild;)q.parentNode.insertBefore(j.firstChild,q);domUtils.remove(j),domUtils.isEmptyNode(q)&&domUtils.remove(q)}return l.moveToBookmark(p).setCursor(!1,!0),h.fireEvent("contentchange"),h.fireEvent("saveScene"),void domUtils.preventDefault(b)}}}),h.addListener("keyup",function(a,c){var e=c.keyCode||c.which;if(8==e){var f,g=h.selection.getRange();(f=domUtils.findParentByTagName(g.startContainer,["ol","ul"],!0))&&d(f,f.tagName.toLowerCase(),b(f)||domUtils.getComputedStyle(f,"list-style-type"),!0)}}),h.addListener("tabkeydown",function(){function a(a){if(h.options.maxListLevel!=-1){for(var b=a.parentNode,c=0;/[ou]l/i.test(b.tagName);)c++,b=b.parentNode;if(c>=h.options.maxListLevel)return!0}}var c=h.selection.getRange(),f=domUtils.findParentByTagName(c.startContainer,"li",!0);if(f){var g;if(!c.collapsed){h.fireEvent("saveScene"),g=c.createBookmark();for(var i,j,l=0,m=domUtils.findParents(f);j=m[l++];)if(domUtils.isTagNode(j,"ol ul")){i=j;break}var n=f;if(g.end)for(;n&&!(domUtils.getPosition(n,g.end)&domUtils.POSITION_FOLLOWING);)if(a(n))n=domUtils.getNextDomNode(n,!1,null,function(a){return a!==i});else{var o=n.parentNode,p=h.document.createElement(o.tagName),q=utils.indexOf(k[p.tagName],b(o)||domUtils.getComputedStyle(o,"list-style-type")),r=q+1==k[p.tagName].length?0:q+1,s=k[p.tagName][r];for(e(p,s),o.insertBefore(p,n);n&&!(domUtils.getPosition(n,g.end)&domUtils.POSITION_FOLLOWING);){if(f=n.nextSibling,p.appendChild(n),!f||domUtils.isTagNode(f,"ol ul")){if(f)for(;(f=f.firstChild)&&"LI"!=f.tagName;);else f=domUtils.getNextDomNode(n,!1,null,function(a){return a!==i});break}n=f}d(p,p.tagName.toLowerCase(),s),n=f}return h.fireEvent("contentchange"),c.moveToBookmark(g).select(),!0}if(a(f))return!0;var o=f.parentNode,p=h.document.createElement(o.tagName),q=utils.indexOf(k[p.tagName],b(o)||domUtils.getComputedStyle(o,"list-style-type"));q=q+1==k[p.tagName].length?0:q+1;var s=k[p.tagName][q];if(e(p,s),domUtils.isStartInblock(c))return h.fireEvent("saveScene"),g=c.createBookmark(),o.insertBefore(p,f),p.appendChild(f),d(p,p.tagName.toLowerCase(),s),h.fireEvent("contentchange"),c.moveToBookmark(g).select(!0),!0}}),h.commands.insertorderedlist=h.commands.insertunorderedlist={execCommand:function(a,c){c||(c="insertorderedlist"==a.toLowerCase()?"decimal":"disc");var f=this,h=this.selection.getRange(),j=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!domUtils.isWhitespace(a)},k="insertorderedlist"==a.toLowerCase()?"ol":"ul",l=f.document.createDocumentFragment();h.adjustmentBoundary().shrinkBoundary();var m,n,o,p,q=h.createBookmark(!0),r=g(f.document.getElementById(q.start)),s=0,t=g(f.document.getElementById(q.end)),u=0;if(r||t){if(r&&(m=r.parentNode),q.end||(t=r),t&&(n=t.parentNode),m===n){for(;r!==t;){if(p=r,r=r.nextSibling,!domUtils.isBlockElm(p.firstChild)){for(var v=f.document.createElement("p");p.firstChild;)v.appendChild(p.firstChild);p.appendChild(v)}l.appendChild(p)}if(p=f.document.createElement("span"),m.insertBefore(p,t),!domUtils.isBlockElm(t.firstChild)){for(v=f.document.createElement("p");t.firstChild;)v.appendChild(t.firstChild);t.appendChild(v)}l.appendChild(t),domUtils.breakParent(p,m),domUtils.isEmptyNode(p.previousSibling)&&domUtils.remove(p.previousSibling),domUtils.isEmptyNode(p.nextSibling)&&domUtils.remove(p.nextSibling);var w=b(m)||domUtils.getComputedStyle(m,"list-style-type")||("insertorderedlist"==a.toLowerCase()?"decimal":"disc");if(m.tagName.toLowerCase()==k&&w==c){for(var x,y=0,z=f.document.createDocumentFragment();x=l.firstChild;)if(domUtils.isTagNode(x,"ol ul"))z.appendChild(x);else for(;x.firstChild;)z.appendChild(x.firstChild),domUtils.remove(x);p.parentNode.insertBefore(z,p)}else o=f.document.createElement(k),e(o,c),o.appendChild(l),p.parentNode.insertBefore(o,p);return domUtils.remove(p),o&&d(o,k,c),void h.moveToBookmark(q).select()}if(r){for(;r;){if(p=r.nextSibling,domUtils.isTagNode(r,"ol ul"))l.appendChild(r);else{for(var A=f.document.createDocumentFragment(),B=0;r.firstChild;)domUtils.isBlockElm(r.firstChild)&&(B=1),A.appendChild(r.firstChild);if(B)l.appendChild(A);else{var C=f.document.createElement("p");C.appendChild(A),l.appendChild(C)}domUtils.remove(r)}r=p}m.parentNode.insertBefore(l,m.nextSibling),domUtils.isEmptyNode(m)?(h.setStartBefore(m),domUtils.remove(m)):h.setStartAfter(m),s=1}if(t&&domUtils.inDoc(n,f.document)){for(r=n.firstChild;r&&r!==t;){if(p=r.nextSibling,domUtils.isTagNode(r,"ol ul"))l.appendChild(r);else{for(A=f.document.createDocumentFragment(),B=0;r.firstChild;)domUtils.isBlockElm(r.firstChild)&&(B=1),A.appendChild(r.firstChild);B?l.appendChild(A):(C=f.document.createElement("p"),C.appendChild(A),l.appendChild(C)),domUtils.remove(r)}r=p}var D=domUtils.createElement(f.document,"div",{tmpDiv:1});domUtils.moveChild(t,D),l.appendChild(D),domUtils.remove(t),n.parentNode.insertBefore(l,n),h.setEndBefore(n),domUtils.isEmptyNode(n)&&domUtils.remove(n),u=1}}s||h.setStartBefore(f.document.getElementById(q.start)),q.end&&!u&&h.setEndAfter(f.document.getElementById(q.end)),h.enlarge(!0,function(a){return i[a.tagName]}),l=f.document.createDocumentFragment();for(var E,F=h.createBookmark(),G=domUtils.getNextDomNode(F.start,!1,j),H=h.cloneRange(),I=domUtils.isBlockElm;G&&G!==F.end&&domUtils.getPosition(G,F.end)&domUtils.POSITION_PRECEDING;)if(3==G.nodeType||dtd.li[G.tagName]){if(1==G.nodeType&&dtd.$list[G.tagName]){for(;G.firstChild;)l.appendChild(G.firstChild);E=domUtils.getNextDomNode(G,!1,j),domUtils.remove(G),G=E;continue}for(E=G,H.setStartBefore(G);G&&G!==F.end&&(!I(G)||domUtils.isBookmarkNode(G));)E=G,G=domUtils.getNextDomNode(G,!1,null,function(a){return!i[a.tagName]});G&&I(G)&&(p=domUtils.getNextDomNode(E,!1,j),p&&domUtils.isBookmarkNode(p)&&(G=domUtils.getNextDomNode(p,!1,j),E=p)),H.setEndAfter(E),G=domUtils.getNextDomNode(E,!1,j);var J=h.document.createElement("li");if(J.appendChild(H.extractContents()),domUtils.isEmptyNode(J)){for(var E=h.document.createElement("p");J.firstChild;)E.appendChild(J.firstChild);J.appendChild(E)}l.appendChild(J)}else G=domUtils.getNextDomNode(G,!0,j);h.moveToBookmark(F).collapse(!0),o=f.document.createElement(k),e(o,c),o.appendChild(l),h.insertNode(o),d(o,k,c);for(var x,y=0,K=domUtils.getElementsByTagName(o,"div");x=K[y++];)x.getAttribute("tmpDiv")&&domUtils.remove(x,!0);h.moveToBookmark(q).select()},queryCommandState:function(a){for(var b,c="insertorderedlist"==a.toLowerCase()?"ol":"ul",d=this.selection.getStartElementPath(),e=0;b=d[e++];){if("TABLE"==b.nodeName)return 0;if(c==b.nodeName.toLowerCase())return 1}return 0},queryCommandValue:function(a){for(var c,d,e="insertorderedlist"==a.toLowerCase()?"ol":"ul",f=this.selection.getStartElementPath(),g=0;d=f[g++];){if("TABLE"==d.nodeName){c=null;break}if(e==d.nodeName.toLowerCase()){c=d;break}}return c?b(c)||domUtils.getComputedStyle(c,"list-style-type"):null}}},function(){var a={textarea:function(a,b){var c=b.ownerDocument.createElement("textarea");return c.style.cssText="position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;",browser.ie&&browser.version<8&&(c.style.width=b.offsetWidth+"px",c.style.height=b.offsetHeight+"px",b.onresize=function(){c.style.width=b.offsetWidth+"px",c.style.height=b.offsetHeight+"px"}),b.appendChild(c),{setContent:function(a){c.value=a},getContent:function(){return c.value},select:function(){var a;browser.ie?(a=c.createTextRange(),a.collapse(!0),a.select()):(c.setSelectionRange(0,0),c.focus())},dispose:function(){b.removeChild(c),b.onresize=null,c=null,b=null},focus:function(){c.focus()},blur:function(){c.blur()}}},codemirror:function(a,b){var c=window.CodeMirror(b,{mode:"text/html",tabMode:"indent",lineNumbers:!0,lineWrapping:!0}),d=c.getWrapperElement();return d.style.cssText='position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;',c.getScrollerElement().style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;",c.refresh(),{getCodeMirror:function(){return c},setContent:function(a){c.setValue(a)},getContent:function(){return c.getValue()},select:function(){c.focus()},dispose:function(){b.removeChild(d),d=null,c=null},focus:function(){c.focus()},blur:function(){c.setOption("readOnly",!0),c.setOption("readOnly",!1)}}}};UE.plugins.source=function(){function b(b){return a["codemirror"==h.sourceEditor&&window.CodeMirror?"codemirror":"textarea"](g,b)}var c,d,e,f,g=this,h=this.options,i=!1;h.sourceEditor=browser.ie?"textarea":h.sourceEditor||"codemirror",g.setOpt({sourceEditorFirst:!1});var j,k,l;g.commands.source={execCommand:function(){if(i=!i){l=g.selection.getRange().createAddress(!1,!0),g.undoManger&&g.undoManger.save(!0),browser.gecko&&(g.body.contentEditable=!1),j=g.iframe.style.cssText,g.iframe.style.cssText+="position:absolute;left:-32768px;top:-32768px;",g.fireEvent("beforegetcontent");var a=UE.htmlparser(g.body.innerHTML);g.filterOutputRule(a),a.traversal(function(a){if("element"==a.type)switch(a.tagName){case"td":case"th":case"caption":a.children&&1==a.children.length&&"br"==a.firstChild().tagName&&a.removeChild(a.firstChild());break;case"pre":a.innerText(a.innerText().replace(/ /g," "))}}),g.fireEvent("aftergetcontent");var h=a.toHtml(!0);c=b(g.iframe.parentNode),c.setContent(h),d=g.setContent,g.setContent=function(a){var b=UE.htmlparser(a);g.filterInputRule(b),a=b.toHtml(),c.setContent(a)},setTimeout(function(){c.select(),g.addListener("fullscreenchanged",function(){try{c.getCodeMirror().refresh()}catch(a){}})}),k=g.getContent,g.getContent=function(){return c.getContent()||"

                      "+(browser.ie?"":"
                      ")+"

                      "},e=g.focus,f=g.blur,g.focus=function(){c.focus()},g.blur=function(){f.call(g),c.blur()}}else{g.iframe.style.cssText=j;var m=c.getContent()||"

                      "+(browser.ie?"":"
                      ")+"

                      ";m=m.replace(new RegExp("[\\r\\t\\n ]*]*)>","g"),function(a,b){return b&&!dtd.$inlineWithA[b.toLowerCase()]?a.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g,""):a.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g,"")}),g.setContent=d,g.setContent(m),c.dispose(),c=null,g.getContent=k,g.focus=e,g.blur=f;var n=g.body.firstChild;if(n||(g.body.innerHTML="

                      "+(browser.ie?"":"
                      ")+"

                      ",n=g.body.firstChild),g.undoManger&&g.undoManger.save(!0),browser.gecko){var o=document.createElement("input");o.style.cssText="position:absolute;left:0;top:-32768px",document.body.appendChild(o),g.body.contentEditable=!1,setTimeout(function(){domUtils.setViewportOffset(o,{left:-32768,top:0}),o.focus(),setTimeout(function(){g.body.contentEditable=!0,g.selection.getRange().moveToAddress(l).select(!0),domUtils.remove(o)})})}else try{g.selection.getRange().moveToAddress(l).select(!0)}catch(p){}}this.fireEvent("sourcemodechanged",i)},queryCommandState:function(){return 0|i},notNeedUndo:1};var m=g.queryCommandState;g.queryCommandState=function(a){return a=a.toLowerCase(),i?a in{source:1,fullscreen:1}?1:-1:m.apply(this,arguments)},"codemirror"==h.sourceEditor&&g.addListener("ready",function(){utils.loadFile(document,{src:h.codeMirrorJsUrl||h.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.js",tag:"script",type:"text/javascript",defer:"defer"},function(){h.sourceEditorFirst&&setTimeout(function(){g.execCommand("source")},0)}),utils.loadFile(document,{tag:"link",rel:"stylesheet",type:"text/css",href:h.codeMirrorCssUrl||h.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.css"})})}}(),UE.plugins.enterkey=function(){var a,b=this,c=b.options.enterTag;b.addListener("keyup",function(c,d){var e=d.keyCode||d.which;if(13==e){var f,g=b.selection.getRange(),h=g.startContainer;if(browser.ie)b.fireEvent("saveScene",!0,!0);else{if(/h\d/i.test(a)){if(browser.gecko){var i=domUtils.findParentByTagName(h,["h1","h2","h3","h4","h5","h6","blockquote","caption","table"],!0);i||(b.document.execCommand("formatBlock",!1,"

                      "),f=1)}else if(1==h.nodeType){var j,k=b.document.createTextNode("");if(g.insertNode(k),j=domUtils.findParentByTagName(k,"div",!0)){for(var l=b.document.createElement("p");j.firstChild;)l.appendChild(j.firstChild);j.parentNode.insertBefore(l,j),domUtils.remove(j),g.setStartBefore(k).setCursor(),f=1}domUtils.remove(k)}b.undoManger&&f&&b.undoManger.save()}browser.opera&&g.select()}}}),b.addListener("keydown",function(d,e){var f=e.keyCode||e.which;if(13==f){if(b.fireEvent("beforeenterkeydown"))return void domUtils.preventDefault(e);b.fireEvent("saveScene",!0,!0),a="";var g=b.selection.getRange();if(!g.collapsed){var h=g.startContainer,i=g.endContainer,j=domUtils.findParentByTagName(h,"td",!0),k=domUtils.findParentByTagName(i,"td",!0);if(j&&k&&j!==k||!j&&k||j&&!k)return void(e.preventDefault?e.preventDefault():e.returnValue=!1)}if("p"==c)browser.ie||(h=domUtils.findParentByTagName(g.startContainer,["ol","ul","p","h1","h2","h3","h4","h5","h6","blockquote","caption"],!0),h||browser.opera?(a=h.tagName,"p"==h.tagName.toLowerCase()&&browser.gecko&&domUtils.removeDirtyAttr(h)):(b.document.execCommand("formatBlock",!1,"

                      "),browser.gecko&&(g=b.selection.getRange(),h=domUtils.findParentByTagName(g.startContainer,"p",!0),h&&domUtils.removeDirtyAttr(h))));else if(e.preventDefault?e.preventDefault():e.returnValue=!1,g.collapsed){m=g.document.createElement("br"),g.insertNode(m);var l=m.parentNode;l.lastChild===m?(m.parentNode.insertBefore(m.cloneNode(!0),m),g.setStartBefore(m)):g.setStartAfter(m),g.setCursor()}else if(g.deleteContents(),h=g.startContainer,1==h.nodeType&&(h=h.childNodes[g.startOffset])){for(;1==h.nodeType;){if(dtd.$empty[h.tagName])return g.setStartBefore(h).setCursor(),b.undoManger&&b.undoManger.save(),!1;if(!h.firstChild){var m=g.document.createElement("br");return h.appendChild(m),g.setStart(h,0).setCursor(),b.undoManger&&b.undoManger.save(),!1}h=h.firstChild}h===g.startContainer.childNodes[g.startOffset]?(m=g.document.createElement("br"),g.insertNode(m).setCursor()):g.setStart(h,0).setCursor()}else m=g.document.createElement("br"),g.insertNode(m).setStartAfter(m).setCursor()}})},UE.plugins.keystrokes=function(){var a=this,b=!0;a.addListener("keydown",function(c,d){var e=d.keyCode||d.which,f=a.selection.getRange();if(!f.collapsed&&!(d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)&&(e>=65&&e<=90||e>=48&&e<=57||e>=96&&e<=111||{13:1,8:1,46:1}[e])){var g=f.startContainer;if(domUtils.isFillChar(g)&&f.setStartBefore(g),g=f.endContainer,domUtils.isFillChar(g)&&f.setEndAfter(g),f.txtToElmBoundary(),f.endContainer&&1==f.endContainer.nodeType&&(g=f.endContainer.childNodes[f.endOffset],g&&domUtils.isBr(g)&&f.setEndAfter(g)),0==f.startOffset&&(g=f.startContainer,domUtils.isBoundaryNode(g,"firstChild")&&(g=f.endContainer,f.endOffset==(3==g.nodeType?g.nodeValue.length:g.childNodes.length)&&domUtils.isBoundaryNode(g,"lastChild"))))return a.fireEvent("saveScene"),a.body.innerHTML="

                      "+(browser.ie?"":"
                      ")+"

                      ",f.setStart(a.body.firstChild,0).setCursor(!1,!0),void a._selectionChange()}if(e==keymap.Backspace){if(f=a.selection.getRange(),b=f.collapsed,a.fireEvent("delkeydown",d))return;var h,i;if(f.collapsed&&f.inFillChar()&&(h=f.startContainer,domUtils.isFillChar(h)?(f.setStartBefore(h).shrinkBoundary(!0).collapse(!0),domUtils.remove(h)):(h.nodeValue=h.nodeValue.replace(new RegExp("^"+domUtils.fillChar),""),f.startOffset--,f.collapse(!0).select(!0))),h=f.getClosedNode())return a.fireEvent("saveScene"),f.setStartBefore(h),domUtils.remove(h),f.setCursor(),a.fireEvent("saveScene"),void domUtils.preventDefault(d);if(!browser.ie&&(h=domUtils.findParentByTagName(f.startContainer,"table",!0),i=domUtils.findParentByTagName(f.endContainer,"table",!0),h&&!i||!h&&i||h!==i))return void d.preventDefault()}if(e==keymap.Tab){var j={ol:1,ul:1,table:1};if(a.fireEvent("tabkeydown",d))return void domUtils.preventDefault(d);var k=a.selection.getRange();a.fireEvent("saveScene");for(var l=0,m="",n=a.options.tabSize||4,o=a.options.tabNode||" ";l"});d.insertNode(g).setStart(g,0).setCursor(!1,!0)}}if(!b&&(3==d.startContainer.nodeType||1==d.startContainer.nodeType&&domUtils.isEmptyBlock(d.startContainer)))if(browser.ie){var k=d.document.createElement("span");d.insertNode(k).setStartBefore(k).collapse(!0),d.select(),domUtils.remove(k)}else d.select()}})},UE.plugins.fiximgclick=function(){function a(){this.editor=null,this.resizer=null,this.cover=null,this.doc=document,this.prePos={x:0,y:0},this.startPos={x:0,y:0}}var b=!1;return function(){var c=[[0,0,-1,-1],[0,0,0,-1],[0,0,1,-1],[0,0,-1,0],[0,0,1,0],[0,0,-1,1],[0,0,0,1],[0,0,1,1]];a.prototype={init:function(a){var b=this;b.editor=a,b.startPos=this.prePos={x:0,y:0},b.dragId=-1;var c=[],d=b.cover=document.createElement("div"),e=b.resizer=document.createElement("div");for(d.id=b.editor.ui.id+"_imagescale_cover",d.style.cssText="position:absolute;display:none;z-index:"+b.editor.options.zIndex+";filter:alpha(opacity=0); opacity:0;background:#CCC;",domUtils.on(d,"mousedown click",function(){b.hide()}),i=0;i<8;i++)c.push('');e.id=b.editor.ui.id+"_imagescale",e.className="edui-editor-imagescale",e.innerHTML=c.join(""),e.style.cssText+=";display:none;border:1px solid #3b77ff;z-index:"+b.editor.options.zIndex+";",b.editor.ui.getDom().appendChild(d),b.editor.ui.getDom().appendChild(e),b.initStyle(),b.initEvents()},initStyle:function(){utils.cssRule("imagescale",".edui-editor-imagescale{display:none;position:absolute;border:1px solid #38B2CE;cursor:hand;-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}.edui-editor-imagescale span{position:absolute;width:6px;height:6px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}.edui-editor-imagescale .edui-editor-imagescale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}")},initEvents:function(){var a=this;a.startPos.x=a.startPos.y=0,a.isDraging=!1},_eventHandler:function(a){var c=this;switch(a.type){case"mousedown":var d,d=a.target||a.srcElement;d.className.indexOf("edui-editor-imagescale-hand")!=-1&&c.dragId==-1&&(c.dragId=d.className.slice(-1),c.startPos.x=c.prePos.x=a.clientX,c.startPos.y=c.prePos.y=a.clientY,domUtils.on(c.doc,"mousemove",c.proxy(c._eventHandler,c)));break;case"mousemove":c.dragId!=-1&&(c.updateContainerStyle(c.dragId,{x:a.clientX-c.prePos.x,y:a.clientY-c.prePos.y}),c.prePos.x=a.clientX,c.prePos.y=a.clientY,b=!0,c.updateTargetElement());break;case"mouseup":c.dragId!=-1&&(c.updateContainerStyle(c.dragId,{x:a.clientX-c.prePos.x,y:a.clientY-c.prePos.y}),c.updateTargetElement(),c.target.parentNode&&c.attachTo(c.target),c.dragId=-1),domUtils.un(c.doc,"mousemove",c.proxy(c._eventHandler,c)),b&&(b=!1,c.editor.fireEvent("contentchange"))}},updateTargetElement:function(){var a=this;domUtils.setStyles(a.target,{width:a.resizer.style.width,height:a.resizer.style.height}),a.target.width=parseInt(a.resizer.style.width),a.target.height=parseInt(a.resizer.style.height),a.attachTo(a.target)},updateContainerStyle:function(a,b){var d,e=this,f=e.resizer;0!=c[a][0]&&(d=parseInt(f.style.left)+b.x,f.style.left=e._validScaledProp("left",d)+"px"),0!=c[a][1]&&(d=parseInt(f.style.top)+b.y,f.style.top=e._validScaledProp("top",d)+"px"),0!=c[a][2]&&(d=f.clientWidth+c[a][2]*b.x,f.style.width=e._validScaledProp("width",d)+"px"),0!=c[a][3]&&(d=f.clientHeight+c[a][3]*b.y,f.style.height=e._validScaledProp("height",d)+"px")},_validScaledProp:function(a,b){var c=this.resizer,d=document;switch(b=isNaN(b)?0:b,a){case"left":return b<0?0:b+c.clientWidth>d.clientWidth?d.clientWidth-c.clientWidth:b;case"top":return b<0?0:b+c.clientHeight>d.clientHeight?d.clientHeight-c.clientHeight:b;case"width":return b<=0?1:b+c.offsetLeft>d.clientWidth?d.clientWidth-c.offsetLeft:b;case"height":return b<=0?1:b+c.offsetTop>d.clientHeight?d.clientHeight-c.offsetTop:b}},hideCover:function(){this.cover.style.display="none"},showCover:function(){var a=this,b=domUtils.getXY(a.editor.ui.getDom()),c=domUtils.getXY(a.editor.iframe);domUtils.setStyles(a.cover,{width:a.editor.iframe.offsetWidth+"px",height:a.editor.iframe.offsetHeight+"px",top:c.y-b.y+"px",left:c.x-b.x+"px",position:"absolute",display:""})},show:function(a){var b=this;b.resizer.style.display="block",a&&b.attachTo(a),domUtils.on(this.resizer,"mousedown",b.proxy(b._eventHandler,b)),domUtils.on(b.doc,"mouseup",b.proxy(b._eventHandler,b)),b.showCover(),b.editor.fireEvent("afterscaleshow",b),b.editor.fireEvent("saveScene")},hide:function(){var a=this;a.hideCover(),a.resizer.style.display="none",domUtils.un(a.resizer,"mousedown",a.proxy(a._eventHandler,a)),domUtils.un(a.doc,"mouseup",a.proxy(a._eventHandler,a)),a.editor.fireEvent("afterscalehide",a)},proxy:function(a,b){return function(c){return a.apply(b||this,arguments)}},attachTo:function(a){var b=this,c=b.target=a,d=this.resizer,e=domUtils.getXY(c),f=domUtils.getXY(b.editor.iframe),g=domUtils.getXY(d.parentNode),h=b.editor.document;domUtils.setStyles(d,{width:c.width+"px",height:c.height+"px",left:f.x+e.x-(h.documentElement.scrollLeft||h.body.scrollLeft||0)-g.x-parseInt(d.style.borderLeftWidth)+"px",top:f.y+e.y-(h.documentElement.scrollTop||h.body.scrollTop||0)-g.y-parseInt(d.style.borderTopWidth)+"px"})}}}(),function(){var b,c=this;c.setOpt("imageScaleEnabled",!0),!browser.ie&&c.options.imageScaleEnabled&&c.addListener("click",function(d,e){var f=c.selection.getRange(),g=f.getClosedNode();if(g&&"IMG"==g.tagName&&"false"!=c.body.contentEditable){if(g.className.indexOf("edui-faked-music")!=-1||g.getAttribute("anchorname")||domUtils.hasClass(g,"loadingclass")||domUtils.hasClass(g,"loaderrorclass"))return;if(!b){b=new a,b.init(c),c.ui.getDom().appendChild(b.resizer);var h,i=function(a){b.hide(),b.target&&c.selection.getRange().selectNode(b.target).select()},j=function(a){var b=a.target||a.srcElement;!b||void 0!==b.className&&b.className.indexOf("edui-editor-imagescale")!=-1||i(a)};c.addListener("afterscaleshow",function(a){c.addListener("beforekeydown",i),c.addListener("beforemousedown",j),domUtils.on(document,"keydown",i),domUtils.on(document,"mousedown",j),c.selection.getNative().removeAllRanges()}),c.addListener("afterscalehide",function(a){c.removeListener("beforekeydown",i),c.removeListener("beforemousedown",j),domUtils.un(document,"keydown",i),domUtils.un(document,"mousedown",j);var d=b.target;d.parentNode&&c.selection.getRange().selectNode(d).select()}),domUtils.on(b.resizer,"mousedown",function(a){c.selection.getNative().removeAllRanges();var d=a.target||a.srcElement;d&&d.className.indexOf("edui-editor-imagescale-hand")==-1&&(h=setTimeout(function(){b.hide(),b.target&&c.selection.getRange().selectNode(d).select()},200))}),domUtils.on(b.resizer,"mouseup",function(a){var b=a.target||a.srcElement;b&&b.className.indexOf("edui-editor-imagescale-hand")==-1&&clearTimeout(h)})}b.show(g)}else b&&"none"!=b.resizer.style.display&&b.hide()}),browser.webkit&&c.addListener("click",function(a,b){if("IMG"==b.target.tagName&&"false"!=c.body.contentEditable){var d=new dom.Range(c.document);d.selectNode(b.target).select()}})}}(),UE.plugin.register("autolink",function(){var a=0;return browser.ie?{}:{bindEvents:{reset:function(){a=0},keydown:function(a,b){var c=this,d=b.keyCode||b.which;if(32==d||13==d){for(var e,f,g=c.selection.getNative(),h=g.getRangeAt(0).cloneRange(),i=h.startContainer;1==i.nodeType&&h.startOffset>0&&(i=h.startContainer.childNodes[h.startOffset-1]);)h.setStart(i,1==i.nodeType?i.childNodes.length:i.nodeValue.length),h.collapse(!0),i=h.startContainer;do{if(0==h.startOffset){for(i=h.startContainer.previousSibling;i&&1==i.nodeType;)i=i.lastChild;if(!i||domUtils.isFillChar(i))break;e=i.nodeValue.length}else i=h.startContainer,e=h.startOffset;h.setStart(i,e-1),f=h.toString().charCodeAt(0)}while(160!=f&&32!=f);if(h.toString().replace(new RegExp(domUtils.fillChar,"g"),"").match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)){for(;h.toString().length&&!/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(h.toString());)try{h.setStart(h.startContainer,h.startOffset+1)}catch(j){for(var i=h.startContainer;!(next=i.nextSibling);){if(domUtils.isBody(i))return;i=i.parentNode}h.setStart(next,0)}if(domUtils.findParentByTagName(h.startContainer,"a",!0))return;var k,l=c.document.createElement("a"),m=c.document.createTextNode(" ");c.undoManger&&c.undoManger.save(),l.appendChild(h.extractContents()),l.href=l.innerHTML=l.innerHTML.replace(/<[^>]+>/g,""),k=l.getAttribute("href").replace(new RegExp(domUtils.fillChar,"g"),""),k=/^(?:https?:\/\/)/gi.test(k)?k:"http://"+k,l.setAttribute("_src",utils.html(k)),l.href=utils.html(k),h.insertNode(l),l.parentNode.insertBefore(m,l.nextSibling),h.setStart(m,0),h.collapse(!0),g.removeAllRanges(),g.addRange(h),c.undoManger&&c.undoManger.save()}}}}}},function(){function a(a){if(3==a.nodeType)return null;if("A"==a.nodeName)return a;for(var b=a.lastChild;b;){if("A"==b.nodeName)return b;if(3==b.nodeType){if(domUtils.isWhitespace(b)){b=b.previousSibling;continue}return null}b=b.lastChild}}var b={37:1,38:1,39:1,40:1,13:1,32:1};browser.ie&&this.addListener("keyup",function(c,d){var e=this,f=d.keyCode;if(b[f]){var g=e.selection.getRange(),h=g.startContainer;if(13==f){for(;h&&!domUtils.isBody(h)&&!domUtils.isBlockElm(h);)h=h.parentNode;if(h&&!domUtils.isBody(h)&&"P"==h.nodeName){var i=h.previousSibling;if(i&&1==i.nodeType){var i=a(i);i&&!i.getAttribute("_href")&&domUtils.remove(i,!0)}}}else if(32==f)3==h.nodeType&&/^\s$/.test(h.nodeValue)&&(h=h.previousSibling,h&&"A"==h.nodeName&&!h.getAttribute("_href")&&domUtils.remove(h,!0));else if(h=domUtils.findParentByTagName(h,"a",!0),h&&!h.getAttribute("_href")){var j=g.createBookmark();domUtils.remove(h,!0),g.moveToBookmark(j).select(!0)}}})}),UE.plugins.autoheight=function(){function a(){var a=this;clearTimeout(f),g||(!a.queryCommandState||a.queryCommandState&&1!=a.queryCommandState("source"))&&(f=setTimeout(function(){for(var b=a.body.lastChild;b&&1!=b.nodeType;)b=b.previousSibling;b&&1==b.nodeType&&(b.style.clear="both",e=Math.max(domUtils.getXY(b).y+b.offsetHeight+25,Math.max(i.minFrameHeight,i.initialFrameHeight)),e!=h&&(e!==parseInt(a.iframe.parentNode.style.height)&&(a.iframe.parentNode.style.height=e+"px"), -a.body.style.height=e+"px",h=e),domUtils.removeStyle(b,"clear"))},50))}function b(){c.window&&(null===j?j=c.window.scrollY:0==c.window.scrollY&&0!=j&&(c.window.scrollTo(0,0),j=null))}var c=this;if(c.autoHeightEnabled=c.options.autoHeightEnabled!==!1,c.autoHeightEnabled){var d,e,f,g,h=0,i=c.options;c.addListener("fullscreenchanged",function(a,b){g=b}),c.addListener("destroy",function(){domUtils.un(c.window,"scroll",b),c.removeListener("contentchange afterinserthtml keyup mouseup",a)}),c.enableAutoHeight=function(){var b=this;if(b.autoHeightEnabled){var c=b.document;b.autoHeightEnabled=!0,d=c.body.style.overflowY,c.body.style.overflowY="hidden",b.addListener("contentchange afterinserthtml keyup mouseup",a),setTimeout(function(){a.call(b)},browser.gecko?100:0),b.fireEvent("autoheightchanged",b.autoHeightEnabled)}},c.disableAutoHeight=function(){c.body.style.overflowY=d||"",c.removeListener("contentchange",a),c.removeListener("keyup",a),c.removeListener("mouseup",a),c.autoHeightEnabled=!1,c.fireEvent("autoheightchanged",c.autoHeightEnabled)},c.on("setHeight",function(){c.disableAutoHeight()}),c.addListener("ready",function(){c.enableAutoHeight();var d;domUtils.on(browser.ie?c.body:c.document,browser.webkit?"dragover":"drop",function(){clearTimeout(d),d=setTimeout(function(){a.call(c)},100)}),domUtils.on(c.window,"scroll",b)});var j}},UE.plugins.autofloat=function(){function a(){return UE.ui?1:(alert(g.autofloatMsg),0)}function b(){var a=document.body.style;a.backgroundImage='url("about:blank")',a.backgroundAttachment="fixed"}function c(){var a=domUtils.getXY(k),b=domUtils.getComputedStyle(k,"position"),c=domUtils.getComputedStyle(k,"left");k.style.width=k.offsetWidth+"px",k.style.zIndex=1*f.options.zIndex+1,k.parentNode.insertBefore(q,k),o||p&&browser.ie?("absolute"!=k.style.position&&(k.style.position="absolute"),k.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-l+i+"px"):(browser.ie7Compat&&r&&(r=!1,k.style.left=domUtils.getXY(k).x-document.documentElement.getBoundingClientRect().left+2+"px"),"fixed"!=k.style.position&&(k.style.position="fixed",k.style.top=i+"px",("absolute"==b||"relative"==b)&&parseFloat(c)&&(k.style.left=a.x+"px")))}function d(){r=!0,q.parentNode&&q.parentNode.removeChild(q),k.style.cssText=j}function e(){var a=m(f.container),b=f.options.toolbarTopOffset||0;a.top<0&&a.bottom-k.offsetHeight>b?c():d()}var f=this,g=f.getLang();f.setOpt({topOffset:0});var h=f.options.autoFloatEnabled!==!1,i=f.options.topOffset;if(h){var j,k,l,m,n=UE.ui.uiUtils,o=browser.ie&&browser.version<=6,p=browser.quirks,q=document.createElement("div"),r=!0,s=utils.defer(function(){e()},browser.ie?200:100,!0);f.addListener("destroy",function(){domUtils.un(window,["scroll","resize"],e),f.removeListener("keydown",s);var a=document.getElementById("scrollBox");a&&domUtils.un(a,["scroll","resize"],e)}),f.addListener("ready",function(){if(a(f)){if(!f.ui)return;m=n.getClientRect,k=f.ui.getDom("toolbarbox"),l=m(k).top,j=k.style.cssText,q.style.height=k.offsetHeight+"px",o&&b(),domUtils.on(window,["scroll","resize"],e),f.addListener("keydown",s);var c=document.getElementById("scrollBox");c&&domUtils.on(c,["scroll","resize"],e),f.addListener("beforefullscreenchange",function(a,b){b&&d()}),f.addListener("fullscreenchanged",function(a,b){b||e()}),f.addListener("sourcemodechanged",function(a,b){setTimeout(function(){e()},0)}),f.addListener("clearDoc",function(){setTimeout(function(){e()},0)})}})}},UE.plugins.video=function(){function a(a,b,d,e,f,g,h){var i;switch(h){case"image":i="';break;case"embed":i='';break;case"video":var j=a.substr(a.lastIndexOf(".")+1);"ogv"==j&&(j="ogg"),i="'}return i}function b(b,c){utils.each(b.getNodesByTagName(c?"img":"embed video"),function(b){var d=b.getAttr("class");if(d&&d.indexOf("edui-faked-video")!=-1){var e=a(c?b.getAttr("_url"):b.getAttr("src"),b.getAttr("width"),b.getAttr("height"),null,b.getStyle("float")||"",d,c?"embed":"image");b.parentNode.replaceChild(UE.uNode.createElement(e),b)}if(d&&d.indexOf("edui-upload-video")!=-1){var e=a(c?b.getAttr("_url"):b.getAttr("src"),b.getAttr("width"),b.getAttr("height"),null,b.getStyle("float")||"",d,c?"video":"image");b.parentNode.replaceChild(UE.uNode.createElement(e),b)}})}var c=this;c.addOutputRule(function(a){b(a,!0)}),c.addInputRule(function(a){b(a)}),c.commands.insertvideo={execCommand:function(b,d,e){if(d=utils.isArray(d)?d:[d],c.fireEvent("beforeinsertvideo",d)!==!0){for(var f,g,h=[],i="tmpVedio",j=0,k=d.length;j0)return 0;for(var c in dtd.$isNotEmpty)if(dtd.$isNotEmpty.hasOwnProperty(c)&&a.getElementsByTagName(c).length)return 0;return 1},b.getWidth=function(a){return a?parseInt(domUtils.getComputedStyle(a,"width"),10):0},b.getTableCellAlignState=function(a){!utils.isArray(a)&&(a=[a]);var b={},c=["align","valign"],d=null,e=!0;return utils.each(a,function(a){return utils.each(c,function(c){if(d=a.getAttribute(c),!b[c]&&d)b[c]=d;else if(!b[c]||d!==b[c])return e=!1,!1}),e}),e?b:null},b.getTableItemsByRange=function(a){var b=a.selection.getStart();b&&b.id&&0===b.id.indexOf("_baidu_bookmark_start_")&&b.nextSibling&&(b=b.nextSibling);var c=b&&domUtils.findParentByTagName(b,["td","th"],!0),d=c&&c.parentNode,e=d&&domUtils.findParentByTagName(d,["table"]),f=e&&e.getElementsByTagName("caption")[0];return{cell:c,tr:d,table:e,caption:f}},b.getUETableBySelected=function(a){var c=b.getTableItemsByRange(a).table;return c&&c.ueTable&&c.ueTable.selectedTds.length?c.ueTable:null},b.getDefaultValue=function(a,b){var c,d,e,f,g={thin:"0px",medium:"1px",thick:"2px"};if(b)return h=b.getElementsByTagName("td")[0],f=domUtils.getComputedStyle(b,"border-left-width"),c=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"padding-left"),d=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"border-left-width"),e=parseInt(g[f]||f,10),{tableBorder:c,tdPadding:d,tdBorder:e};b=a.document.createElement("table"),b.insertRow(0).insertCell(0).innerHTML="xxx",a.body.appendChild(b);var h=b.getElementsByTagName("td")[0];return f=domUtils.getComputedStyle(b,"border-left-width"),c=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"padding-left"),d=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"border-left-width"),e=parseInt(g[f]||f,10),domUtils.remove(b),{tableBorder:c,tdPadding:d,tdBorder:e}},b.getUETable=function(a){var c=a.tagName.toLowerCase();return a="td"==c||"th"==c||"caption"==c?domUtils.findParentByTagName(a,"table",!0):a,a.ueTable||(a.ueTable=new b(a)),a.ueTable},b.cloneCell=function(a,b,c){if(!a||utils.isString(a))return this.table.ownerDocument.createElement(a||"td");var d=domUtils.hasClass(a,"selectTdClass");d&&domUtils.removeClasses(a,"selectTdClass");var e=a.cloneNode(!0);return b&&(e.rowSpan=e.colSpan=1),!c&&domUtils.removeAttributes(e,"width height"),!c&&domUtils.removeAttributes(e,"style"),e.style.borderLeftStyle="",e.style.borderTopStyle="",e.style.borderLeftColor=a.style.borderRightColor,e.style.borderLeftWidth=a.style.borderRightWidth,e.style.borderTopColor=a.style.borderBottomColor,e.style.borderTopWidth=a.style.borderBottomWidth,d&&domUtils.addClass(a,"selectTdClass"),e},b.prototype={getMaxRows:function(){for(var a,b=this.table.rows,c=1,d=0;a=b[d];d++){for(var e,f=1,g=0;e=a.cells[g++];)f=Math.max(e.rowSpan||1,f);c=Math.max(f+d,c)}return c},getMaxCols:function(){for(var a,b=this.table.rows,c=0,d={},e=0;a=b[e];e++){for(var f,g=0,h=0;f=a.cells[h++];)if(g+=f.colSpan||1,f.rowSpan&&f.rowSpan>1)for(var i=1;ithis.rowsNum-1)?null:(e=c?h?i.endRowIndex+1:g.rowIndex+g.rowSpan:h?i.beginRowIndex-1:g.rowIndex-1,f=h?i.beginColIndex:g.colIndex,this.getCell(this.indexTable[e][f].rowIndex,this.indexTable[e][f].cellIndex))}catch(j){a(j)}},getSameEndPosCells:function(b,c){try{for(var d="x"===c.toLowerCase(),e=domUtils.getXY(b)[d?"x":"y"]+b["offset"+(d?"Width":"Height")],f=this.table.rows,g=null,h=[],i=0;ie&&d)break;if((b==j||e==l)&&(1==j[d?"colSpan":"rowSpan"]&&h.push(j),d))break}}return h}catch(m){a(m)}},setCellContent:function(a,b){a.innerHTML=b||(browser.ie?domUtils.fillChar:"
                      ")},cloneCell:b.cloneCell,getSameStartPosXCells:function(b){try{for(var c,d=domUtils.getXY(b).x+b.offsetWidth,e=this.table.rows,f=[],g=0;gd)break;if(j==d&&1==h.colSpan){f.push(h);break}}}return f}catch(k){a(k)}},update:function(a){this.table=a||this.table,this.selectedTds=[],this.cellsRange={},this.indexTable=[];for(var b=this.table.rows,c=this.getMaxRows(),d=c-b.length,e=this.getMaxCols();d--;)this.table.insertRow(b.length);this.rowsNum=c,this.colsNum=e;for(var f=0,g=b.length;fc&&(j.rowSpan=c);for(var m=k,n=j.rowSpan||1,o=j.colSpan||1;this.indexTable[i][m];)m++;for(var p=0;p0)for(h=b;hf&&(m=Math.max(h,m));if(ee&&(l=Math.max(i,l));if(b>0)for(i=a;ig||d+b.colSpan-1>h)return null;j.push(this.getCell(c,b.cellIndex))}}return j},clearSelected:function(){b.removeSelectedClass(this.selectedTds),this.selectedTds=[],this.cellsRange={}},setSelected:function(a){var c=this.getCells(a);b.addSelectedClass(c),this.selectedTds=c,this.cellsRange=a},isFullRow:function(){var a=this.cellsRange;return a.endColIndex-a.beginColIndex+1==this.colsNum},isFullCol:function(){var a=this.cellsRange,b=this.table,c=b.getElementsByTagName("th"),d=a.endRowIndex-a.beginRowIndex+1;return c.length?d==this.rowsNum||d==this.rowsNum-1:d==this.rowsNum},getNextCell:function(b,c,d){try{var e,f,g=this.getCellInfo(b),h=this.selectedTds.length&&!d,i=this.cellsRange;return!c&&0==g.rowIndex||c&&(h?i.endRowIndex==this.rowsNum-1:g.rowIndex+g.rowSpan>this.rowsNum-1)?null:(e=c?h?i.endRowIndex+1:g.rowIndex+g.rowSpan:h?i.beginRowIndex-1:g.rowIndex-1,f=h?i.beginColIndex:g.colIndex,this.getCell(this.indexTable[e][f].rowIndex,this.indexTable[e][f].cellIndex))}catch(j){a(j)}},getPreviewCell:function(b,c){try{var d,e,f=this.getCellInfo(b),g=this.selectedTds.length,h=this.cellsRange;return!c&&(g?!h.beginColIndex:!f.colIndex)||c&&(g?h.endColIndex==this.colsNum-1:f.rowIndex>this.colsNum-1)?null:(d=c?g?h.beginRowIndex:f.rowIndex<1?0:f.rowIndex-1:g?h.beginRowIndex:f.rowIndex,e=c?g?h.endColIndex+1:f.colIndex:g?h.beginColIndex-1:f.colIndex<1?0:f.colIndex-1,this.getCell(this.indexTable[d][e].rowIndex,this.indexTable[d][e].cellIndex))}catch(i){a(i)}},moveContent:function(a,c){if(!b.isEmptyBlock(c)){if(b.isEmptyBlock(a))return void(a.innerHTML=c.innerHTML);var d=a.lastChild;for(3!=d.nodeType&&dtd.$block[d.tagName]||a.appendChild(a.ownerDocument.createElement("br"));d=c.firstChild;)a.appendChild(d)}},mergeRight:function(a){var b=this.getCellInfo(a),c=b.colIndex+b.colSpan,d=this.indexTable[b.rowIndex][c],e=this.getCell(d.rowIndex,d.cellIndex);a.colSpan=b.colSpan+d.colSpan,a.removeAttribute("width"),this.moveContent(a,e),this.deleteCell(e,d.rowIndex),this.update()},mergeDown:function(a){var b=this.getCellInfo(a),c=b.rowIndex+b.rowSpan,d=this.indexTable[c][b.colIndex],e=this.getCell(d.rowIndex,d.cellIndex);a.rowSpan=b.rowSpan+d.rowSpan,a.removeAttribute("height"),this.moveContent(a,e),this.deleteCell(e,d.rowIndex),this.update()},mergeRange:function(){for(var a,b=this.cellsRange,c=this.getCell(b.beginRowIndex,this.indexTable[b.beginRowIndex][b.beginColIndex].cellIndex),d=this.getCells(b),e=0;a=d[e++];)a!==c&&(this.moveContent(c,a),this.deleteCell(a));if(c.rowSpan=b.endRowIndex-b.beginRowIndex+1,c.rowSpan>1&&c.removeAttribute("height"),c.colSpan=b.endColIndex-b.beginColIndex+1,c.colSpan>1&&c.removeAttribute("width"),c.rowSpan==this.rowsNum&&1!=c.colSpan&&(c.colSpan=1),c.colSpan==this.colsNum&&1!=c.rowSpan){var f=c.parentNode.rowIndex;if(this.table.deleteRow)for(var e=f+1,g=f+1,h=c.rowSpan;e1&&g.rowIndex==a){var i=h.cloneNode(!0);i.rowSpan=h.rowSpan-1,i.innerHTML="",h.rowSpan=1;var j,k=a+1,l=this.table.rows[k],m=this.getPreviewMergedCellsNum(k,f)-e;m1?l.colSpan--:c[h].deleteCell(j.cellIndex),h+=j.rowSpan||1}}this.table.setAttribute("width",d-e),this.update()},splitToCells:function(a){var b=this,c=this.splitToRows(a);utils.each(c,function(a){b.splitToCols(a)})},splitToRows:function(a){var b=this.getCellInfo(a),c=b.rowIndex,d=b.colIndex,e=[];a.rowSpan=1,e.push(a);for(var f=c,g=c+b.rowSpan;f");for(var g=0;g'+(browser.ie&&browser.version<11?domUtils.fillChar:"
                      ")+"");c.push("")}return"
                      "+c.join("")+"
                      "}b||(b=utils.extend({},{numCols:this.options.defaultCols,numRows:this.options.defaultRows,tdvalign:this.options.tdvalign}));var d=this,e=this.selection.getRange(),f=e.startContainer,h=domUtils.findParent(f,function(a){return domUtils.isBlockElm(a)},!0)||d.body,i=g(d),j=h.offsetWidth,k=Math.floor(j/b.numCols-2*i.tdPadding-i.tdBorder);!b.tdvalign&&(b.tdvalign=d.options.tdvalign),d.execCommand("inserthtml",c(b,k))}},UE.commands.insertparagraphbeforetable={queryCommandState:function(){return e(this).cell?0:-1},execCommand:function(){var a=e(this).table;if(a){var b=this.document.createElement("p");b.innerHTML=browser.ie?" ":"
                      ",a.parentNode.insertBefore(b,a),this.selection.getRange().setStart(b,0).setCursor()}}},UE.commands.deletetable={queryCommandState:function(){var a=this.selection.getRange();return domUtils.findParentByTagName(a.startContainer,"table",!0)?0:-1},execCommand:function(a,b){var c=this.selection.getRange();if(b=b||domUtils.findParentByTagName(c.startContainer,"table",!0)){var d=b.nextSibling;d||(d=domUtils.createElement(this.document,"p",{innerHTML:browser.ie?domUtils.fillChar:"
                      "}),b.parentNode.insertBefore(d,b)),domUtils.remove(b),c=this.selection.getRange(),3==d.nodeType?c.setStartBefore(d):c.setStart(d,0),c.setCursor(!1,!0),this.fireEvent("tablehasdeleted")}}},UE.commands.cellalign={queryCommandState:function(){return c(this).length?0:-1},execCommand:function(a,b){var d=c(this);if(d.length)for(var e,f=0;e=d[f++];)e.setAttribute("align",b)}},UE.commands.cellvalign={queryCommandState:function(){return c(this).length?0:-1},execCommand:function(a,b){var d=c(this);if(d.length)for(var e,f=0;e=d[f++];)e.setAttribute("vAlign",b)}},UE.commands.insertcaption={queryCommandState:function(){var a=e(this).table;return a&&0==a.getElementsByTagName("caption").length?1:-1},execCommand:function(){var a=e(this).table;if(a){var b=this.document.createElement("caption");b.innerHTML=browser.ie?domUtils.fillChar:"
                      ",a.insertBefore(b,a.firstChild);var c=this.selection.getRange();c.setStart(b,0).setCursor()}}},UE.commands.deletecaption={queryCommandState:function(){var a=this.selection.getRange(),b=domUtils.findParentByTagName(a.startContainer,"table");return b?0==b.getElementsByTagName("caption").length?-1:1:-1},execCommand:function(){var a=this.selection.getRange(),b=domUtils.findParentByTagName(a.startContainer,"table");if(b){domUtils.remove(b.getElementsByTagName("caption")[0]);var c=this.selection.getRange();c.setStart(b.rows[0].cells[0],0).setCursor()}}},UE.commands.inserttitle={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[0];return"th"!=b.cells[b.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var a=e(this).table;a&&h(a).insertRow(0,"th");var b=a.getElementsByTagName("th")[0];this.selection.getRange().setStart(b,0).setCursor(!1,!0)}},UE.commands.deletetitle={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[0];return"th"==b.cells[b.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var a=e(this).table;a&&domUtils.remove(a.rows[0]);var b=a.getElementsByTagName("td")[0];this.selection.getRange().setStart(b,0).setCursor(!1,!0)}},UE.commands.inserttitlecol={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[a.rows.length-1];return b.getElementsByTagName("th").length?-1:0}return-1},execCommand:function(b){var c=e(this).table;c&&h(c).insertCol(0,"th"),a(c,this);var d=c.getElementsByTagName("th")[0];this.selection.getRange().setStart(d,0).setCursor(!1,!0)}},UE.commands.deletetitlecol={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[a.rows.length-1];return b.getElementsByTagName("th").length?0:-1}return-1},execCommand:function(){var b=e(this).table;if(b)for(var c=0;c=f.colsNum)return-1;var j=f.indexTable[g.rowIndex][i],k=c.rows[j.rowIndex].cells[j.cellIndex];return k&&d.tagName==k.tagName&&j.rowIndex==g.rowIndex&&j.rowSpan==g.rowSpan?0:-1},execCommand:function(a){var b=this.selection.getRange(),c=b.createBookmark(!0),d=e(this).cell,f=h(d);f.mergeRight(d),b.moveToBookmark(c).select()}},UE.commands.mergedown={queryCommandState:function(a){var b=e(this),c=b.table,d=b.cell;if(!c||!d)return-1;var f=h(c);if(f.selectedTds.length)return-1;var g=f.getCellInfo(d),i=g.rowIndex+g.rowSpan;if(i>=f.rowsNum)return-1;var j=f.indexTable[i][g.colIndex],k=c.rows[j.rowIndex].cells[j.cellIndex];return k&&d.tagName==k.tagName&&j.colIndex==g.colIndex&&j.colSpan==g.colSpan?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.mergeDown(c),a.moveToBookmark(b).select()}},UE.commands.mergecells={queryCommandState:function(){return f(this)?0:-1},execCommand:function(){var a=f(this);if(a&&a.selectedTds.length){var b=a.selectedTds[0];a.mergeRange();var c=this.selection.getRange();domUtils.isEmptyBlock(b)?c.setStart(b,0).collapse(!0):c.selectNodeContents(b),c.select()}}},UE.commands.insertrow={queryCommandState:function(){var a=e(this),b=a.cell;return b&&("TD"==b.tagName||"TH"==b.tagName&&a.tr!==a.table.rows[0])&&h(a.table).rowsNum0?-1:b&&(b.colSpan>1||b.rowSpan>1)?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.splitToCells(c),a.moveToBookmark(b).select()}},UE.commands.splittorows={queryCommandState:function(){var a=e(this),b=a.cell;if(!b)return-1;var c=h(a.table);return c.selectedTds.length>0?-1:b&&b.rowSpan>1?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.splitToRows(c),a.moveToBookmark(b).select()}},UE.commands.splittocols={queryCommandState:function(){var a=e(this),b=a.cell;if(!b)return-1;var c=h(a.table);return c.selectedTds.length>0?-1:b&&b.colSpan>1?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.splitToCols(c),a.moveToBookmark(b).select()}},UE.commands.adaptbytext=UE.commands.adaptbywindow={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(b){var c=e(this),d=c.table;if(d)if("adaptbywindow"==b)a(d,this);else{var f=domUtils.getElementsByTagName(d,"td th");utils.each(f,function(a){a.removeAttribute("width")}),d.removeAttribute("width")}}},UE.commands.averagedistributecol={queryCommandState:function(){var a=f(this);return a&&(a.isFullRow()||a.isFullCol())?0:-1},execCommand:function(a){function b(){var a,b=e.table,c=0,f=0,h=g(d,b);if(e.isFullRow())c=b.offsetWidth,f=e.colsNum;else for(var i,j=e.cellsRange.beginColIndex,k=e.cellsRange.endColIndex,l=j;l<=k;)i=e.selectedTds[l],c+=i.offsetWidth,l+=i.colSpan,f+=1;return a=Math.ceil(c/f)-2*h.tdBorder-2*h.tdPadding}function c(a){utils.each(domUtils.getElementsByTagName(e.table,"th"),function(a){a.setAttribute("width","")});var b=e.isFullRow()?domUtils.getElementsByTagName(e.table,"td"):e.selectedTds;utils.each(b,function(b){1==b.colSpan&&b.setAttribute("width",a)})}var d=this,e=f(d);e&&e.selectedTds.length&&c(b())}},UE.commands.averagedistributerow={queryCommandState:function(){var a=f(this);return a?a.selectedTds&&/th/gi.test(a.selectedTds[0].tagName)?-1:a.isFullRow()||a.isFullCol()?0:-1:-1},execCommand:function(a){function b(){var a,b,c=0,f=e.table,h=g(d,f),i=parseInt(domUtils.getComputedStyle(f.getElementsByTagName("td")[0],"padding-top"));if(e.isFullCol()){var j,k,l=domUtils.getElementsByTagName(f,"caption"),m=domUtils.getElementsByTagName(f,"th");l.length>0&&(j=l[0].offsetHeight),m.length>0&&(k=m[0].offsetHeight),c=f.offsetHeight-(j||0)-(k||0),b=0==m.length?e.rowsNum:e.rowsNum-1}else{for(var n=e.cellsRange.beginRowIndex,o=e.cellsRange.endRowIndex,p=0,q=domUtils.getElementsByTagName(f,"tr"),r=n;r<=o;r++)c+=q[r].offsetHeight,p+=1;b=p}return a=browser.ie&&browser.version<9?Math.ceil(c/b):Math.ceil(c/b)-2*h.tdBorder-2*i}function c(a){var b=e.isFullCol()?domUtils.getElementsByTagName(e.table,"td"):e.selectedTds;utils.each(b,function(b){1==b.rowSpan&&b.setAttribute("height",a)})}var d=this,e=f(d);e&&e.selectedTds.length&&c(b())}},UE.commands.cellalignment={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(a,b){var c=this,d=f(c);if(d)utils.each(d.selectedTds,function(a){domUtils.setAttributes(a,b)});else{var e=c.selection.getStart(),g=e&&domUtils.findParentByTagName(e,["td","th","caption"],!0);/caption/gi.test(g.tagName)?(g.style.textAlign=b.align,g.style.verticalAlign=b.vAlign):domUtils.setAttributes(g,b),c.selection.getRange().setCursor(!0)}},queryCommandValue:function(a){var b=e(this).cell;if(b||(b=c(this)[0]),b){var d=UE.UETable.getUETable(b).selectedTds;return!d.length&&(d=b),UE.UETable.getTableCellAlignState(d)}return null}},UE.commands.tablealignment={queryCommandState:function(){return browser.ie&&browser.version<8?-1:e(this).table?0:-1},execCommand:function(a,b){var c=this,d=c.selection.getStart(),e=d&&domUtils.findParentByTagName(d,["table"],!0);e&&e.setAttribute("align",b)}},UE.commands.edittable={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(a,b){var c=this.selection.getRange(),d=domUtils.findParentByTagName(c.startContainer,"table");if(d){var e=domUtils.getElementsByTagName(d,"td").concat(domUtils.getElementsByTagName(d,"th"),domUtils.getElementsByTagName(d,"caption"));utils.each(e,function(a){a.style.borderColor=b})}}},UE.commands.edittd={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(a,b){var c=this,d=f(c);if(d)utils.each(d.selectedTds,function(a){a.style.backgroundColor=b});else{var e=c.selection.getStart(),g=e&&domUtils.findParentByTagName(e,["td","th","caption"],!0);g&&(g.style.backgroundColor=b)}}},UE.commands.settablebackground={queryCommandState:function(){return c(this).length>1?0:-1},execCommand:function(a,b){var d,e;d=c(this),e=h(d[0]),e.setBackground(d,b)}},UE.commands.cleartablebackground={queryCommandState:function(){var a=c(this);if(!a.length)return-1;for(var b,d=0;b=a[d++];)if(""!==b.style.backgroundColor)return 0;return-1},execCommand:function(){var a=c(this),b=h(a[0]);b.removeBackground(a)}},UE.commands.interlacetable=UE.commands.uninterlacetable={queryCommandState:function(a){var b=e(this).table;if(!b)return-1;var c=b.getAttribute("interlaced");return"interlacetable"==a?"enabled"===c?-1:0:c&&"disabled"!==c?0:-1},execCommand:function(a,b){var c=e(this).table;"interlacetable"==a?(c.setAttribute("interlaced","enabled"),this.fireEvent("interlacetable",c,b)):(c.setAttribute("interlaced","disabled"),this.fireEvent("uninterlacetable",c))}},UE.commands.setbordervisible={queryCommandState:function(a){var b=e(this).table;return b?0:-1},execCommand:function(){var a=e(this).table;utils.each(domUtils.getElementsByTagName(a,"td"),function(a){a.style.borderWidth="1px",a.style.borderStyle="solid"})}}}(),UE.plugins.table=function(){function a(a){}function b(a,b){c(a,"width",!0),c(a,"height",!0)}function c(a,b,c){a.style[b]&&(c&&a.setAttribute(b,parseInt(a.style[b],10)),a.style[b]="")}function d(a){if("TD"==a.tagName||"TH"==a.tagName)return a;var b;return(b=domUtils.findParentByTagName(a,"td",!0)||domUtils.findParentByTagName(a,"th",!0))?b:null}function e(a){var b=new RegExp(domUtils.fillChar,"g");if(a[browser.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(b,"").length>0)return 0;for(var c in dtd.$isNotEmpty)if(a.getElementsByTagName(c).length)return 0;return 1}function f(a){return a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+N.document.body.scrollLeft-N.document.body.clientLeft,y:a.clientY+N.document.body.scrollTop-N.document.body.clientTop}}function g(b){if(!A())try{var c,e=d(b.target||b.srcElement);if(R&&(N.body.style.webkitUserSelect="none",(Math.abs(V.x-b.clientX)>T||Math.abs(V.y-b.clientY)>T)&&(t(),R=!1,U=0,v(b))),ca&&ha)return U=0,N.body.style.webkitUserSelect="none",N.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),c=f(b),m(N,!0,ca,c,e),void("h"==ca?ga.style.left=k(ha,b)+"px":"v"==ca&&(ga.style.top=l(ha,b)+"px"));if(e){if(N.fireEvent("excludetable",e)===!0)return;c=f(b);var g=n(e,c),i=domUtils.findParentByTagName(e,"table",!0);if(j(i,e,b,!0)){if(N.fireEvent("excludetable",i)===!0)return;N.body.style.cursor="url("+N.options.cursorpath+"h.png),pointer"}else if(j(i,e,b)){if(N.fireEvent("excludetable",i)===!0)return;N.body.style.cursor="url("+N.options.cursorpath+"v.png),pointer"}else{N.body.style.cursor="text";/\d/.test(g)&&(g=g.replace(/\d/,""),e=Y(e).getPreviewCell(e,"v"==g)),m(N,!!e&&!!g,e?g:"",c,e)}}else h(!1,i,N)}catch(o){a(o)}}function h(a,b,c){if(a)i(b,c);else{if(fa)return;la=setTimeout(function(){!fa&&ea&&ea.parentNode&&ea.parentNode.removeChild(ea)},2e3)}}function i(a,b){function c(c,d){clearTimeout(g),g=setTimeout(function(){b.fireEvent("tableClicked",a,d)},300)}function d(c){clearTimeout(g);var d=Y(a),e=a.rows[0].cells[0],f=d.getLastCell(),h=d.getCellsRange(e,f);b.selection.getRange().setStart(e,0).setCursor(!1,!0),d.setSelected(h)}var e=domUtils.getXY(a),f=a.ownerDocument;if(ea&&ea.parentNode)return ea;ea=f.createElement("div"),ea.contentEditable=!1,ea.innerHTML="",ea.style.cssText="width:15px;height:15px;background-image:url("+b.options.UEDITOR_HOME_URL+"dialogs/table/dragicon.png);position: absolute;cursor:move;top:"+(e.y-15)+"px;left:"+e.x+"px;",domUtils.unSelectable(ea),ea.onmouseover=function(a){fa=!0},ea.onmouseout=function(a){fa=!1},domUtils.on(ea,"click",function(a,b){c(b,this)}),domUtils.on(ea,"dblclick",function(a,b){d(b)}),domUtils.on(ea,"dragstart",function(a,b){domUtils.preventDefault(b)});var g;f.body.appendChild(ea)}function j(a,b,c,d){var e=f(c),g=n(b,e);if(d){var h=a.getElementsByTagName("caption")[0],i=h?h.offsetHeight:0;return"v1"==g&&e.y-domUtils.getXY(a).y-i<8}return"h1"==g&&e.x-domUtils.getXY(a).x<8}function k(a,b){var c=Y(a);if(c){var d=c.getSameEndPosCells(a,"x")[0],e=c.getSameStartPosXCells(a)[0],g=f(b).x,h=(d?domUtils.getXY(d).x:domUtils.getXY(c.table).x)+20,i=e?domUtils.getXY(e).x+e.offsetWidth-20:N.body.offsetWidth+5||parseInt(domUtils.getComputedStyle(N.body,"width"),10);return h+=Q,i-=Q,gi?i:g}}function l(b,c){try{var d=domUtils.getXY(b).y,e=f(c).y;return ek[c]?(a=!1,!1):void l.push(d)});var b=a?l:k;utils.each(i,function(a,c){a.width=b[c]-G()})},0)}}}}function q(a){if(_(domUtils.getElementsByTagName(N.body,"td th")),utils.each(N.document.getElementsByTagName("table"),function(a){a.ueTable=null}),aa=M(N,a)){var b=domUtils.findParentByTagName(aa,"table",!0);ut=Y(b),ut&&ut.clearSelected(),da?r(a):(N.document.body.style.webkitUserSelect="",ia=!0,N.addListener("mouseover",x))}}function r(a){browser.ie&&(a=u(a)),t(),R=!0,O=setTimeout(function(){v(a)},W)}function s(a,b){for(var c=[],d=null,e=0,f=a.length;e0&&U--},W),2===U))return U=0,void p(b);if(2!=b.button){var c=this,d=c.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"table",!0),f=domUtils.findParentByTagName(d.endContainer,"table",!0);if((e||f)&&(e===f?(e=domUtils.findParentByTagName(d.startContainer,["td","th","caption"],!0),f=domUtils.findParentByTagName(d.endContainer,["td","th","caption"],!0),e!==f&&c.selection.clearRange()):c.selection.clearRange()),ia=!1,c.document.body.style.webkitUserSelect="",ca&&ha&&(c.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),U=0,ga=c.document.getElementById("ue_tableDragLine"))){var g=domUtils.getXY(ha),h=domUtils.getXY(ga);switch(ca){case"h":z(ha,h.x-g.x);break;case"v":B(ha,h.y-g.y-ha.offsetHeight)}return ca="",ha=null,I(c),void c.fireEvent("saveScene")}if(aa){var i=Y(aa),j=i?i.selectedTds[0]:null;if(j)d=new dom.Range(c.document),domUtils.isEmptyBlock(j)?d.setStart(j,0).setCursor(!1,!0):d.selectNodeContents(j).shrinkBoundary().setCursor(!1,!0);else if(d=c.selection.getRange().shrinkBoundary(),!d.collapsed){var e=domUtils.findParentByTagName(d.startContainer,["td","th"],!0),f=domUtils.findParentByTagName(d.endContainer,["td","th"],!0);(e&&!f||!e&&f||e&&f&&e!==f)&&d.setCursor(!1,!0)}aa=null,c.removeListener("mouseover",x)}else{var k=domUtils.findParentByTagName(b.target||b.srcElement,"td",!0);if(k||(k=domUtils.findParentByTagName(b.target||b.srcElement,"th",!0)),k&&("TD"==k.tagName||"TH"==k.tagName)){if(c.fireEvent("excludetable",k)===!0)return;d=new dom.Range(c.document),d.setStart(k,0).setCursor(!1,!0)}}c._selectionChange(250,b)}}}function x(a,b){if(!A()){var c=this,d=b.target||b.srcElement;if(ba=domUtils.findParentByTagName(d,"td",!0)||domUtils.findParentByTagName(d,"th",!0),aa&&ba&&("TD"==aa.tagName&&"TD"==ba.tagName||"TH"==aa.tagName&&"TH"==ba.tagName)&&domUtils.findParentByTagName(aa,"table")==domUtils.findParentByTagName(ba,"table")){var e=Y(ba);if(aa!=ba){c.document.body.style.webkitUserSelect="none",c.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"]();var f=e.getCellsRange(aa,ba);e.setSelected(f)}else c.document.body.style.webkitUserSelect="",e.clearSelected()}b.preventDefault?b.preventDefault():b.returnValue=!1}}function y(a,b,c){var d=parseInt(domUtils.getComputedStyle(a,"line-height"),10),e=c+b;b=ef?(c&&g.push({left:a}),!1):void 0})}),g}function D(a,b,c){if(a-=G(),a<0)return 0;a-=E(b);var d=a<0?"left":"right";return a=Math.abs(a),utils.each(c,function(b){var c=b[d];c&&(a=Math.min(a,E(c)-Q))}),a=a<0?0:a,"left"===d?-a:a}function E(a){var b=0,b=a.offsetWidth-G();a.nextSibling||(b-=F(a)),b=b<0?0:b;try{a.width=b}catch(c){}return b}function F(a){if(tab=domUtils.findParentByTagName(a,"table",!1),void 0===tab.offsetVal){var b=a.previousSibling;b?tab.offsetVal=a.offsetWidth-b.offsetWidth===X.borderWidth?X.borderWidth:0:tab.offsetVal=0}return tab.offsetVal}function G(){if(void 0===X.tabcellSpace){var a=N.document.createElement("table"),b=N.document.createElement("tbody"),c=N.document.createElement("tr"),d=N.document.createElement("td"),e=null;d.style.cssText="border: 0;",d.width=1,c.appendChild(d),c.appendChild(e=d.cloneNode(!1)),b.appendChild(c),a.appendChild(b),a.style.cssText="visibility: hidden;",N.body.appendChild(a),X.paddingSpace=d.offsetWidth-1;var f=a.offsetWidth;d.style.cssText="",e.style.cssText="",X.borderWidth=(a.offsetWidth-f)/3,X.tabcellSpace=X.paddingSpace+X.borderWidth,N.body.removeChild(a)}return G=function(){return X.tabcellSpace},X.tabcellSpace}function H(a,b){ia||(ga=a.document.createElement("div"),domUtils.setAttributes(ga,{id:"ue_tableDragLine",unselectable:"on",contenteditable:!1,onresizestart:"return false",ondragstart:"return false",onselectstart:"return false",style:"background-color:blue;position:absolute;padding:0;margin:0;background-image:none;border:0px none;opacity:0;filter:alpha(opacity=0)"}),a.body.appendChild(ga))}function I(a){if(!ia)for(var b;b=a.document.getElementById("ue_tableDragLine");)domUtils.remove(b)}function J(a,b){if(b){var c,d=domUtils.findParentByTagName(b,"table"),e=d.getElementsByTagName("caption"),f=d.offsetWidth,g=d.offsetHeight-(e.length>0?e[0].offsetHeight:0),h=domUtils.getXY(d),i=domUtils.getXY(b);switch(a){case"h":c="height:"+g+"px;top:"+(h.y+(e.length>0?e[0].offsetHeight:0))+"px;left:"+(i.x+b.offsetWidth),ga.style.cssText=c+"px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)";break;case"v":c="width:"+f+"px;left:"+h.x+"px;top:"+(i.y+b.offsetHeight),ga.style.cssText=c+"px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)"}}}function K(a,b){for(var c,d,e=domUtils.getElementsByTagName(a.body,"table"),f=0;d=e[f++];){var g=domUtils.getElementsByTagName(d,"td");g[0]&&(b?(c=g[0].style.borderColor.replace(/\s/g,""),/(#ffffff)|(rgb\(255,255,255\))/gi.test(c)&&domUtils.addClass(d,"noBorderTable")):domUtils.removeClasses(d,"noBorderTable"))}}function L(a,b,c){var d=a.body;return d.offsetWidth-(b?2*parseInt(domUtils.getComputedStyle(d,"margin-left"),10):0)-2*c.tableBorder-(a.options.offsetWidth||0)}function M(a,b){var c=domUtils.findParentByTagName(b.target||b.srcElement,["td","th"],!0),d=null;if(!c)return null;if(d=n(c,f(b)),!c)return null;if("h1"===d&&c.previousSibling){var e=domUtils.getXY(c),g=c.offsetWidth;Math.abs(e.x+g-b.clientX)>g/3&&(c=c.previousSibling)}else if("v1"===d&&c.parentNode.previousSibling){var e=domUtils.getXY(c),h=c.offsetHeight;Math.abs(e.y+h-b.clientY)>h/3&&(c=c.parentNode.previousSibling.firstChild)}return c&&a.fireEvent("excludetable",c)!==!0?c:null}var N=this,O=null,P=null,Q=5,R=!1,S=5,T=10,U=0,V=null,W=360,X=UE.UETable,Y=function(a){return X.getUETable(a)},Z=function(a){return X.getUETableBySelected(a)},$=function(a,b){return X.getDefaultValue(a,b)},_=function(a){return X.removeSelectedClass(a)};N.ready(function(){var a=this,b=a.selection.getText;a.selection.getText=function(){var c=Z(a);if(c){var d="";return utils.each(c.selectedTds,function(a){d+=a[browser.ie?"innerText":"textContent"]}),d}return b.call(a.selection)}});var aa=null,ba=null,ca="",da=!1,ea=null,fa=!1,ga=null,ha=null,ia=!1,ja=!0;N.setOpt({maxColNum:20,maxRowNum:100,defaultCols:5,defaultRows:5,tdvalign:"top",cursorpath:N.options.UEDITOR_HOME_URL+"themes/"+N.options.theme+"/images/cursor_",tableDragable:!1,classList:["ue-table-interlace-color-single","ue-table-interlace-color-double"]}),N.getUETable=Y;var ka={deletetable:1,inserttable:1,cellvalign:1,insertcaption:1,deletecaption:1,inserttitle:1,deletetitle:1,mergeright:1,mergedown:1,mergecells:1,insertrow:1,insertrownext:1,deleterow:1,insertcol:1,insertcolnext:1,deletecol:1,splittocells:1,splittorows:1,splittocols:1,adaptbytext:1,adaptbywindow:1,adaptbycustomer:1,insertparagraph:1,insertparagraphbeforetable:1,averagedistributecol:1,averagedistributerow:1};N.ready(function(){utils.cssRule("table",".selectTdClass{background-color:#edf5fa !important}table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}table{margin-bottom:10px;border-collapse:collapse;display:table;}td,th{padding: 5px 10px;border: 1px solid #DDD;}caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}th{border-top:1px solid #BBB;background-color:#F7F7F7;}table tr.firstRow th{border-top-width:2px;}.ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }td p{margin:0;padding:0;}",N.document);var a,c,f;N.addListener("keydown",function(b,d){var g=this,h=d.keyCode||d.which;if(8==h){var i=Z(g);i&&i.selectedTds.length&&(i.isFullCol()?g.execCommand("deletecol"):i.isFullRow()?g.execCommand("deleterow"):g.fireEvent("delcells"),domUtils.preventDefault(d));var j=domUtils.findParentByTagName(g.selection.getStart(),"caption",!0),k=g.selection.getRange();if(k.collapsed&&j&&e(j)){g.fireEvent("saveScene");var l=j.parentNode;domUtils.remove(j),l&&k.setStart(l.rows[0].cells[0],0).setCursor(!1,!0),g.fireEvent("saveScene")}}if(46==h&&(i=Z(g))){g.fireEvent("saveScene");for(var m,n=0;m=i.selectedTds[n++];)domUtils.fillNode(g.document,m);g.fireEvent("saveScene"),domUtils.preventDefault(d)}if(13==h){var o=g.selection.getRange(),j=domUtils.findParentByTagName(o.startContainer,"caption",!0);if(j){var l=domUtils.findParentByTagName(j,"table");return o.collapsed?j&&o.setStart(l.rows[0].cells[0],0).setCursor(!1,!0):(o.deleteContents(),g.fireEvent("saveScene")),void domUtils.preventDefault(d)}if(o.collapsed){var l=domUtils.findParentByTagName(o.startContainer,"table");if(l){var p=l.rows[0].cells[0],q=domUtils.findParentByTagName(g.selection.getStart(),["td","th"],!0),r=l.previousSibling;if(p===q&&(!r||1==r.nodeType&&"TABLE"==r.tagName)&&domUtils.isStartInblock(o)){var s=domUtils.findParent(g.selection.getStart(),function(a){return domUtils.isBlockElm(a)},!0);s&&(/t(h|d)/i.test(s.tagName)||s===q.firstChild)&&(g.execCommand("insertparagraphbeforetable"),domUtils.preventDefault(d))}}}}if((d.ctrlKey||d.metaKey)&&"67"==d.keyCode){a=null;var i=Z(g);if(i){var t=i.selectedTds;c=i.isFullCol(),f=i.isFullRow(),a=[[i.cloneCell(t[0],null,!0)]];for(var m,n=1;m=t[n];n++)m.parentNode!==t[n-1].parentNode?a.push([i.cloneCell(m,null,!0)]):a[a.length-1].push(i.cloneCell(m,null,!0))}}}),N.addListener("tablehasdeleted",function(){m(this,!1,"",null),ea&&domUtils.remove(ea)}),N.addListener("beforepaste",function(d,g){var h=this,i=h.selection.getRange();if(domUtils.findParentByTagName(i.startContainer,"caption",!0)){var j=h.document.createElement("div");return j.innerHTML=g.html,void(g.html=j[browser.ie9below?"innerText":"textContent"])}var k=Z(h);if(a){h.fireEvent("saveScene");var l,m,i=h.selection.getRange(),n=domUtils.findParentByTagName(i.startContainer,["td","th"],!0);if(n){var o=Y(n);if(f){var p=o.getCellInfo(n).rowIndex;"TH"==n.tagName&&p++;for(var q,r=0;q=a[r++];){for(var s,t=o.insertRow(p++,"td"),u=0;s=q[u];u++){var v=t.cells[u];v||(v=t.insertCell(u)),v.innerHTML=s.innerHTML,s.getAttribute("width")&&v.setAttribute("width",s.getAttribute("width")),s.getAttribute("vAlign")&&v.setAttribute("vAlign",s.getAttribute("vAlign")),s.getAttribute("align")&&v.setAttribute("align",s.getAttribute("align")),s.style.cssText&&(v.style.cssText=s.style.cssText)}for(var s,u=0;(s=t.cells[u])&&q[u];u++)s.innerHTML=q[u].innerHTML,q[u].getAttribute("width")&&s.setAttribute("width",q[u].getAttribute("width")),q[u].getAttribute("vAlign")&&s.setAttribute("vAlign",q[u].getAttribute("vAlign")),q[u].getAttribute("align")&&s.setAttribute("align",q[u].getAttribute("align")),q[u].style.cssText&&(s.style.cssText=q[u].style.cssText)}}else{if(c){y=o.getCellInfo(n);for(var s,w=0,u=0,q=a[0];s=q[u++];)w+=s.colSpan||1;for(h.__hasEnterExecCommand=!0,r=0;r1&&(x.rowSpan=1)}var z=$(h),A=h.body.offsetWidth-(ja?2*parseInt(domUtils.getComputedStyle(h.body,"margin-left"),10):0)-2*z.tableBorder-(h.options.offsetWidth||0);h.execCommand("insertHTML",""+k.innerHTML.replace(/>\s*<").replace(/\bth\b/gi,"td")+"
                      ")}return h.fireEvent("contentchange"),h.fireEvent("saveScene"),g.html="",!0}var B,j=h.document.createElement("div");j.innerHTML=g.html,B=j.getElementsByTagName("table"),domUtils.findParentByTagName(h.selection.getStart(),"table")?(utils.each(B,function(a){domUtils.remove(a)}),domUtils.findParentByTagName(h.selection.getStart(),"caption",!0)&&(j.innerHTML=j[browser.ie?"innerText":"textContent"])):utils.each(B,function(a){b(a,!0),domUtils.removeAttributes(a,["style","border"]),utils.each(domUtils.getElementsByTagName(a,"td"),function(a){e(a)&&domUtils.fillNode(h.document,a),b(a,!0)})}),g.html=j.innerHTML}),N.addListener("afterpaste",function(){utils.each(domUtils.getElementsByTagName(N.body,"table"),function(a){if(a.offsetWidth>N.body.offsetWidth){var b=$(N,a);a.style.width=N.body.offsetWidth-(ja?2*parseInt(domUtils.getComputedStyle(N.body,"margin-left"),10):0)-2*b.tableBorder-(N.options.offsetWidth||0)+"px"}})}),N.addListener("blur",function(){a=null});var i;N.addListener("keydown",function(){clearTimeout(i),i=setTimeout(function(){var a=N.selection.getRange(),b=domUtils.findParentByTagName(a.startContainer,["th","td"],!0);if(b){var c=b.parentNode.parentNode.parentNode;c.offsetWidth>c.getAttribute("width")&&(b.style.wordBreak="break-all")}},100)}),N.addListener("selectionchange",function(){m(N,!1,"",null)}),N.addListener("contentchange",function(){var a=this;if(I(a),!Z(a)){var b=a.selection.getRange(),c=b.startContainer;c=domUtils.findParentByTagName(c,["td","th"],!0),utils.each(domUtils.getElementsByTagName(a.document,"table"),function(b){a.fireEvent("excludetable",b)!==!0&&(b.ueTable=new X(b),b.onmouseover=function(){a.fireEvent("tablemouseover",b)},b.onmousemove=function(){a.fireEvent("tablemousemove",b),a.options.tableDragable&&h(!0,this,a),utils.defer(function(){a.fireEvent("contentchange",50)},!0)},b.onmouseout=function(){a.fireEvent("tablemouseout",b),m(a,!1,"",null),I(a)},b.onclick=function(b){b=a.window.event||b;var c=d(b.target||b.srcElement);if(c){var e,f=Y(c),g=f.table,h=f.getCellInfo(c),i=a.selection.getRange();if(j(g,c,b,!0)){var k=f.getCell(f.indexTable[f.rowsNum-1][h.colIndex].rowIndex,f.indexTable[f.rowsNum-1][h.colIndex].cellIndex);return void(b.shiftKey&&f.selectedTds.length?f.selectedTds[0]!==k?(e=f.getCellsRange(f.selectedTds[0],k),f.setSelected(e)):i&&i.selectNodeContents(k).select():c!==k?(e=f.getCellsRange(c,k),f.setSelected(e)):i&&i.selectNodeContents(k).select())}if(j(g,c,b)){var l=f.getCell(f.indexTable[h.rowIndex][f.colsNum-1].rowIndex,f.indexTable[h.rowIndex][f.colsNum-1].cellIndex);b.shiftKey&&f.selectedTds.length?f.selectedTds[0]!==l?(e=f.getCellsRange(f.selectedTds[0],l),f.setSelected(e)):i&&i.selectNodeContents(l).select():c!==l?(e=f.getCellsRange(c,l),f.setSelected(e)):i&&i.selectNodeContents(l).select()}}})}),K(a,!0)}}),domUtils.on(N.document,"mousemove",g),domUtils.on(N.document,"mouseout",function(a){var b=a.target||a.srcElement;"TABLE"==b.tagName&&m(N,!1,"",null)}),N.addListener("interlacetable",function(a,b,c){if(b)for(var d=this,e=b.rows,f=e.length,g=function(a,b,c){return a[b]?a[b]:c?a[b%a.length]:""},h=0;h1?k:f.getCellInfo(d).rowIndex;var g=f.getTabNextCell(d,k);g?e(g)?a.setStart(g,0).setCursor(!1,!0):a.selectNodeContents(g).select():(N.fireEvent("saveScene"),N.__hasEnterExecCommand=!0,this.execCommand("insertrownext"),N.__hasEnterExecCommand=!1,a=this.selection.getRange(),a.setStart(c.rows[c.rows.length-1].cells[0],0).setCursor(),N.fireEvent("saveScene"))}return!0}}),browser.ie&&N.addListener("selectionchange",function(){m(this,!1,"",null)}),N.addListener("keydown",function(a,b){var c=this,d=b.keyCode||b.which;if(8!=d&&46!=d){var e=!(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey);e&&_(domUtils.getElementsByTagName(c.body,"td"));var f=Z(c);f&&e&&f.clearSelected()}}),N.addListener("beforegetcontent",function(){K(this,!1),browser.ie&&utils.each(this.document.getElementsByTagName("caption"),function(a){domUtils.isEmptyNode(a)&&(a.innerHTML=" ")})}),N.addListener("aftergetcontent",function(){K(this,!0)}),N.addListener("getAllHtml",function(){_(N.document.getElementsByTagName("td"))}),N.addListener("fullscreenchanged",function(a,b){if(!b){var c=this.body.offsetWidth/document.body.offsetWidth,d=domUtils.getElementsByTagName(this.body,"table");utils.each(d,function(a){if(a.offsetWidth1||c[e].getAttribute("rowspan")>1)return-1;return b?"enablesort"==a^"sortEnabled"!=b.getAttribute("data-sort")?-1:0:-1},execCommand:function(a){var b=d(this).table;b.setAttribute("data-sort","enablesort"==a?"sortEnabled":"sortDisabled"),"enablesort"==a?domUtils.addClass(b,"sortEnabled"):domUtils.removeClasses(b,"sortEnabled")}}},UE.plugins.contextmenu=function(){var a=this;if(a.setOpt("enableContextMenu",a.getOpt("enableContextMenu")||!0),a.getOpt("enableContextMenu")!==!1){var b,c=a.getLang("contextMenu"),d=a.options.contextMenu||[{label:c.selectall,cmdName:"selectall"},{label:c.cleardoc,cmdName:"cleardoc",exec:function(){confirm(c.confirmclear)&&this.execCommand("cleardoc")}},"-",{label:c.unlink,cmdName:"unlink"},"-",{group:c.paragraph,icon:"justifyjustify",subMenu:[{label:c.justifyleft,cmdName:"justify",value:"left"},{label:c.justifyright,cmdName:"justify",value:"right"},{label:c.justifycenter,cmdName:"justify",value:"center"},{label:c.justifyjustify,cmdName:"justify",value:"justify"}]},"-",{group:c.table,icon:"table",subMenu:[{label:c.inserttable,cmdName:"inserttable"},{label:c.deletetable,cmdName:"deletetable"},"-",{label:c.deleterow,cmdName:"deleterow"},{label:c.deletecol,cmdName:"deletecol"},{label:c.insertcol,cmdName:"insertcol"},{label:c.insertcolnext,cmdName:"insertcolnext"},{label:c.insertrow,cmdName:"insertrow"},{label:c.insertrownext,cmdName:"insertrownext"},"-",{label:c.insertcaption,cmdName:"insertcaption"},{label:c.deletecaption,cmdName:"deletecaption"},{label:c.inserttitle,cmdName:"inserttitle"},{label:c.deletetitle,cmdName:"deletetitle"},{label:c.inserttitlecol,cmdName:"inserttitlecol"},{label:c.deletetitlecol,cmdName:"deletetitlecol"},"-",{label:c.mergecells,cmdName:"mergecells"},{label:c.mergeright,cmdName:"mergeright"},{label:c.mergedown,cmdName:"mergedown"},"-",{label:c.splittorows,cmdName:"splittorows"},{label:c.splittocols,cmdName:"splittocols"},{label:c.splittocells,cmdName:"splittocells"},"-",{label:c.averageDiseRow,cmdName:"averagedistributerow"},{label:c.averageDisCol,cmdName:"averagedistributecol"},"-",{label:c.edittd,cmdName:"edittd",exec:function(){UE.ui.edittd&&new UE.ui.edittd(this),this.getDialog("edittd").open()}},{label:c.edittable,cmdName:"edittable",exec:function(){UE.ui.edittable&&new UE.ui.edittable(this),this.getDialog("edittable").open()}},{label:c.setbordervisible,cmdName:"setbordervisible"}]},{group:c.tablesort,icon:"tablesort",subMenu:[{label:c.enablesort,cmdName:"enablesort"},{label:c.disablesort,cmdName:"disablesort"},"-",{label:c.reversecurrent,cmdName:"sorttable",value:"reversecurrent"},{label:c.orderbyasc,cmdName:"sorttable",value:"orderbyasc"},{label:c.reversebyasc,cmdName:"sorttable",value:"reversebyasc"},{label:c.orderbynum,cmdName:"sorttable",value:"orderbynum"},{label:c.reversebynum,cmdName:"sorttable",value:"reversebynum"}]},{group:c.borderbk,icon:"borderBack",subMenu:[{label:c.setcolor,cmdName:"interlacetable",exec:function(){this.execCommand("interlacetable")}},{label:c.unsetcolor,cmdName:"uninterlacetable",exec:function(){this.execCommand("uninterlacetable")}},{label:c.setbackground,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#bbb","#ccc"]})}},{label:c.unsetbackground,cmdName:"cleartablebackground",exec:function(){this.execCommand("cleartablebackground")}},{label:c.redandblue,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["red","blue"]})}},{label:c.threecolorgradient,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#aaa","#bbb","#ccc"]})}}]},{group:c.aligntd,icon:"aligntd",subMenu:[{cmdName:"cellalignment",value:{align:"left",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"bottom"}}]},{group:c.aligntable,icon:"aligntable",subMenu:[{cmdName:"tablealignment",className:"left",label:c.tableleft,value:"left"},{cmdName:"tablealignment",className:"center",label:c.tablecenter,value:"center"},{cmdName:"tablealignment",className:"right",label:c.tableright,value:"right"}]},"-",{label:c.insertparagraphbefore,cmdName:"insertparagraph",value:!0},{label:c.insertparagraphafter,cmdName:"insertparagraph"},{label:c.copy,cmdName:"copy"},{label:c.paste,cmdName:"paste"}];if(d.length){var e=UE.ui.uiUtils;a.addListener("contextmenu",function(f,g){var h=e.getViewportOffsetByEvent(g);a.fireEvent("beforeselectionchange"),b&&b.destroy();for(var i,j=0,k=[];i=d[j];j++){var l;!function(b){function d(){switch(b.icon){case"table":return a.getLang("contextMenu.table");case"justifyjustify":return a.getLang("contextMenu.paragraph");case"aligntd":return a.getLang("contextMenu.aligntd");case"aligntable":return a.getLang("contextMenu.aligntable");case"tablesort":return c.tablesort;case"borderBack":return c.borderbk;default:return""}}if("-"==b)(l=k[k.length-1])&&"-"!==l&&k.push("-");else if(b.hasOwnProperty("group")){for(var e,f=0,g=[];e=b.subMenu[f];f++)!function(b){"-"==b?(l=g[g.length-1])&&"-"!==l?g.push("-"):g.splice(g.length-1):(a.commands[b.cmdName]||UE.commands[b.cmdName]||b.query)&&(b.query?b.query():a.queryCommandState(b.cmdName))>-1&&g.push({label:b.label||a.getLang("contextMenu."+b.cmdName+(b.value||""))||"",className:"edui-for-"+b.cmdName+(b.className?" edui-for-"+b.cmdName+"-"+b.className:""),onclick:b.exec?function(){b.exec.call(a)}:function(){a.execCommand(b.cmdName,b.value)}})}(e);g.length&&k.push({label:d(),className:"edui-for-"+b.icon,subMenu:{items:g,editor:a}})}else(a.commands[b.cmdName]||UE.commands[b.cmdName]||b.query)&&(b.query?b.query.call(a):a.queryCommandState(b.cmdName))>-1&&k.push({label:b.label||a.getLang("contextMenu."+b.cmdName),className:"edui-for-"+(b.icon?b.icon:b.cmdName+(b.value||"")),onclick:b.exec?function(){b.exec.call(a)}:function(){a.execCommand(b.cmdName,b.value)}})}(i)}if("-"==k[k.length-1]&&k.pop(),b=new UE.ui.Menu({items:k,className:"edui-contextmenu",editor:a}),b.render(),b.showAt(h),a.fireEvent("aftershowcontextmenu",b),domUtils.preventDefault(g),browser.ie){var m;try{m=a.selection.getNative().createRange()}catch(n){return}if(m.item){var o=new dom.Range(a.document);o.selectNode(m.item(0)).select(!0,!0)}}}),a.addListener("aftershowcontextmenu",function(b,c){if(a.zeroclipboard){var d=c.items;for(var e in d)"edui-for-copy"==d[e].className&&a.zeroclipboard.clip(d[e].getDom())}})}}},UE.plugins.shortcutmenu=function(){var a,b=this,c=b.options.shortcutMenu||[];c.length&&(b.addListener("contextmenu mouseup",function(b,d){var e=this,f={type:b,target:d.target||d.srcElement,screenX:d.screenX,screenY:d.screenY,clientX:d.clientX,clientY:d.clientY};if(setTimeout(function(){var d=e.selection.getRange();d.collapsed!==!1&&"contextmenu"!=b||(a||(a=new baidu.editor.ui.ShortCutMenu({editor:e,items:c,theme:e.options.theme,className:"edui-shortcutmenu"}),a.render(),e.fireEvent("afterrendershortcutmenu",a)),a.show(f,!!UE.plugins.contextmenu))}),"contextmenu"==b&&(domUtils.preventDefault(d),browser.ie9below)){var g;try{g=e.selection.getNative().createRange()}catch(d){return}if(g.item){var h=new dom.Range(e.document);h.selectNode(g.item(0)).select(!0,!0)}}}),b.addListener("keydown",function(b){"keydown"==b&&a&&!a.isHidden&&a.hide()}))},UE.plugins.basestyle=function(){var a={bold:["strong","b"],italic:["em","i"],subscript:["sub"],superscript:["sup"]},b=function(a,b){return domUtils.filterNodeList(a.selection.getStartElementPath(),b)},c=this;c.addshortcutkey({Bold:"ctrl+66",Italic:"ctrl+73",Underline:"ctrl+85"}),c.addInputRule(function(a){utils.each(a.getNodesByTagName("b i"),function(a){switch(a.tagName){case"b":a.tagName="strong";break;case"i":a.tagName="em"}})});for(var d in a)!function(a,d){c.commands[a]={execCommand:function(a){var e=c.selection.getRange(),f=b(this,d);if(e.collapsed){if(f){var g=c.document.createTextNode("");e.insertNode(g).removeInlineStyle(d),e.setStartBefore(g),domUtils.remove(g)}else{var h=e.document.createElement(d[0]);"superscript"!=a&&"subscript"!=a||(g=c.document.createTextNode(""),e.insertNode(g).removeInlineStyle(["sub","sup"]).setStartBefore(g).collapse(!0)),e.insertNode(h).setStart(h,0)}e.collapse(!0)}else"superscript"!=a&&"subscript"!=a||f&&f.tagName.toLowerCase()==a||e.removeInlineStyle(["sub","sup"]),f?e.removeInlineStyle(d):e.applyInlineStyle(d[0]);e.select()},queryCommandState:function(){return b(this,d)?1:0}}}(d,a[d])},UE.plugins.elementpath=function(){var a,b,c=this;c.setOpt("elementPathEnabled",!0),c.options.elementPathEnabled&&(c.commands.elementpath={execCommand:function(d,e){var f=b[e],g=c.selection.getRange();a=1*e,g.selectNode(f).select()},queryCommandValue:function(){var c=[].concat(this.selection.getStartElementPath()).reverse(),d=[];b=c;for(var e,f=0;e=c[f];f++)if(3!=e.nodeType){var g=e.tagName.toLowerCase();if("img"==g&&e.getAttribute("anchorname")&&(g="anchor"),d[f]=g,a==f){a=-1;break}}return d}})},UE.plugins.formatmatch=function(){function a(f,g){function h(a){return m&&a.selectNode(m),a.applyInlineStyle(d[d.length-1].tagName,null,d)}if(browser.webkit)var i="IMG"==g.target.tagName?g.target:null;c.undoManger&&c.undoManger.save();var j=c.selection.getRange(),k=i||j.getClosedNode();if(b&&k&&"IMG"==k.tagName)k.style.cssText+=";float:"+(b.style.cssFloat||b.style.styleFloat||"none")+";display:"+(b.style.display||"inline"),b=null;else if(!b){var l=j.collapsed;if(l){var m=c.document.createTextNode("match");j.insertNode(m).select()}c.__hasEnterExecCommand=!0;var n=c.options.removeFormatAttributes;c.options.removeFormatAttributes="",c.execCommand("removeformat"),c.options.removeFormatAttributes=n,c.__hasEnterExecCommand=!1,j=c.selection.getRange(),d.length&&h(j),m&&j.setStartBefore(m).collapse(!0),j.select(),m&&domUtils.remove(m)}c.undoManger&&c.undoManger.save(),c.removeListener("mouseup",a),e=0}var b,c=this,d=[],e=0;c.addListener("reset",function(){d=[],e=0}),c.commands.formatmatch={execCommand:function(f){if(e)return e=0,d=[],void c.removeListener("mouseup",a);var g=c.selection.getRange();if(b=g.getClosedNode(),!b||"IMG"!=b.tagName){g.collapse(!0).shrinkBoundary();var h=g.startContainer;d=domUtils.findParents(h,!0,function(a){return!domUtils.isBlockElm(a)&&1==a.nodeType});for(var i,j=0;i=d[j];j++)if("A"==i.tagName){d.splice(j,1);break}}c.addListener("mouseup",a),e=1},queryCommandState:function(){return e},notNeedUndo:1}},UE.plugin.register("searchreplace",function(){function a(a){var b=3==a.nodeType?a.nodeValue:a[browser.ie?"innerText":"textContent"];return b.replace(domUtils.fillChar,"")}function b(a,b,c){var d,e=b.searchStr,f=new RegExp(e,"g"+(b.casesensitive?"":"i"));if(b.dir==-1){if(a=a.substr(0,c),a=a.split("").reverse().join(""),e=e.split("").reverse().join(""),d=f.exec(a))return c-d.index-e.length}else if(a=a.substr(c),d=f.exec(a))return d.index+c;return-1}function c(c,d,e){var f,g,i=e.all||1==e.dir?"getNextDomNode":"getPreDomNode";domUtils.isBody(c)&&(c=c.firstChild);for(var j=1;c;){if(f=a(c),g=b(f,e,d),j=0,g!=-1)return{node:c,index:g};for(c=domUtils[i](c);c&&h[c.nodeName.toLowerCase()];)c=domUtils[i](c,!0);c&&(d=e.dir==-1?a(c).length:0)}}function d(b,c,e){for(var f,g=0,h=b.firstChild,i=0;h;){if(3==h.nodeType){if(i=a(h).replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,g+=i,g>=c)return{node:h,index:i-(g-c)}}else if(!dtd.$empty[h.tagName]&&(i=a(h).replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,g+=i,g>=c&&(f=d(h,i-(g-c),e))))return f;h=domUtils.getNextDomNode(h)}}function e(b,e){var g,h=i||b.selection.getRange(),j=e.searchStr,k=b.document.createElement("span");if(k.innerHTML="$$ueditor_searchreplace_key$$",h.shrinkBoundary(!0),!h.collapsed){h.select();var l=b.selection.getText();if(new RegExp("^"+e.searchStr+"$",e.casesensitive?"":"i").test(l)){if(void 0!=e.replaceStr)return f(h,e.replaceStr),h.select(),!0;h.collapse(e.dir==-1)}}h.insertNode(k),h.enlargeToBlockElm(!0),g=h.startContainer;var m=a(g).indexOf("$$ueditor_searchreplace_key$$");h.setStartBefore(k),domUtils.remove(k);var n=c(g,m,e);if(n){var o=d(n.node,n.index,j),p=d(n.node,n.index+j.length,j);return h.setStart(o.node,o.index).setEnd(p.node,p.index),void 0!==e.replaceStr&&f(h,e.replaceStr),h.select(),!0}h.setCursor()}function f(a,b){b=g.document.createTextNode(b),a.deleteContents().insertNode(b)}var g=this,h={table:1,tbody:1,tr:1,ol:1,ul:1},i=null;return{commands:{searchreplace:{execCommand:function(a,b){utils.extend(b,{all:!1,casesensitive:!1,dir:1},!0);var c=0;if(b.all){i=null;var d=g.selection.getRange(),f=g.body.firstChild;for(f&&1==f.nodeType?(d.setStart(f,0),d.shrinkBoundary(!0)):3==f.nodeType&&d.setStartBefore(f),d.collapse(!0).select(!0),void 0!==b.replaceStr&&g.fireEvent("saveScene");e(this,b);)c++,i=g.selection.getRange(),i.collapse(b.dir==-1);c&&g.fireEvent("saveScene")}else void 0!==b.replaceStr&&g.fireEvent("saveScene"),e(this,b)&&(c++,i=g.selection.getRange(),i.collapse(b.dir==-1)),c&&g.fireEvent("saveScene");return c},notNeedUndo:1}},bindEvents:{clearlastSearchResult:function(){i=null}}}}),UE.plugins.customstyle=function(){var a=this;a.setOpt({customstyle:[{tag:"h1",name:"tc",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;"},{tag:"h1",name:"tl",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:left;margin:0 0 10px 0;"},{tag:"span",name:"im",style:"font-size:16px;font-style:italic;font-weight:bold;line-height:18px;"},{tag:"span",name:"hi",style:"font-size:16px;font-style:italic;font-weight:bold;color:rgb(51, 153, 204);line-height:18px;"}]}),a.commands.customstyle={execCommand:function(a,b){var c,d,e=this,f=b.tag,g=domUtils.findParent(e.selection.getStart(),function(a){return a.getAttribute("label")},!0),h={};for(var i in b)void 0!==b[i]&&(h[i]=b[i]);if(delete h.tag,g&&g.getAttribute("label")==b.label){if(c=this.selection.getRange(),d=c.createBookmark(),c.collapsed)if(dtd.$block[g.tagName]){var j=e.document.createElement("p");domUtils.moveChild(g,j),g.parentNode.insertBefore(j,g),domUtils.remove(g)}else domUtils.remove(g,!0);else{var k=domUtils.getCommonAncestor(d.start,d.end),l=domUtils.getElementsByTagName(k,f);new RegExp(f,"i").test(k.tagName)&&l.push(k);for(var m,n=0;m=l[n++];)if(m.getAttribute("label")==b.label){var o=domUtils.getPosition(m,d.start),p=domUtils.getPosition(m,d.end);if((o&domUtils.POSITION_FOLLOWING||o&domUtils.POSITION_CONTAINS)&&(p&domUtils.POSITION_PRECEDING||p&domUtils.POSITION_CONTAINS)&&dtd.$block[f]){var j=e.document.createElement("p");domUtils.moveChild(m,j),m.parentNode.insertBefore(j,m)}domUtils.remove(m,!0)}g=domUtils.findParent(k,function(a){return a.getAttribute("label")==b.label},!0),g&&domUtils.remove(g,!0)}c.moveToBookmark(d).select()}else if(dtd.$block[f]){if(this.execCommand("paragraph",f,h,"customstyle"),c=e.selection.getRange(),!c.collapsed){c.collapse(),g=domUtils.findParent(e.selection.getStart(),function(a){return a.getAttribute("label")==b.label},!0);var q=e.document.createElement("p");domUtils.insertAfter(g,q),domUtils.fillNode(e.document,q),c.setStart(q,0).setCursor()}}else{if(c=e.selection.getRange(),c.collapsed)return g=e.document.createElement(f),domUtils.setAttributes(g,h),void c.insertNode(g).setStart(g,0).setCursor();d=c.createBookmark(),c.applyInlineStyle(f,h).moveToBookmark(d).select()}},queryCommandValue:function(){var a=domUtils.filterNodeList(this.selection.getStartElementPath(),function(a){return a.getAttribute("label")});return a?a.getAttribute("label"):""}},a.addListener("keyup",function(b,c){var d=c.keyCode||c.which;if(32==d||13==d){var e=a.selection.getRange();if(e.collapsed){var f=domUtils.findParent(a.selection.getStart(),function(a){return a.getAttribute("label")},!0);if(f&&dtd.$block[f.tagName]&&domUtils.isEmptyNode(f)){var g=a.document.createElement("p");domUtils.insertAfter(f,g),domUtils.fillNode(a.document,g),domUtils.remove(f),e.setStart(g,0).setCursor()}}}})},UE.plugins.catchremoteimage=function(){var me=this,ajax=UE.ajax;me.options.catchRemoteImageEnable!==!1&&(me.setOpt({catchRemoteImageEnable:!1}),me.addListener("afterpaste",function(){me.fireEvent("catchRemoteImage")}),me.addListener("catchRemoteImage",function(){function catchremoteimage(a,b){var c=utils.serializeParam(me.queryCommandValue("serverparam"))||"",d=utils.formatUrl(catcherActionUrl+(catcherActionUrl.indexOf("?")==-1?"?":"&")+c),e=utils.isCrossDomainUrl(d),f={method:"POST",dataType:e?"jsonp":"",timeout:6e4,onsuccess:b.success,onerror:b.error};f[catcherFieldName]=a,ajax.request(d,f)}for(var catcherLocalDomain=me.getOpt("catcherLocalDomain"),catcherActionUrl=me.getActionUrl(me.getOpt("catcherActionName")),catcherUrlPrefix=me.getOpt("catcherUrlPrefix"),catcherFieldName=me.getOpt("catcherFieldName"),remoteImages=[],loadingIMG=me.options.themePath+me.options.theme+"/images/spacer.gif",imgs=me.document.querySelectorAll('[style*="url"],img'),test=function(a,b){if(a.indexOf(location.host)!=-1||/(^\.)|(^\/)/.test(a))return!0;if(b)for(var c,d=0;c=b[d++];)if(a.indexOf(c)!==-1)return!0;return!1},i=0,ci;ci=imgs[i++];)if(!ci.getAttribute("word_img"))if("IMG"==ci.nodeName){var src=ci.getAttribute("_src")||ci.src||"";/^(https?|ftp):/i.test(src)&&!test(src,catcherLocalDomain)&&(remoteImages.push(src),domUtils.setAttributes(ci,{"class":"loadingclass",_src:src,src:loadingIMG}))}else{var backgroundImageurl=ci.style.cssText.replace(/.*\s?url\([\'\"]?/,"").replace(/[\'\"]?\).*/,"");/^(https?|ftp):/i.test(backgroundImageurl)&&!test(backgroundImageurl,catcherLocalDomain)&&(remoteImages.push(backgroundImageurl),ci.style.cssText=ci.style.cssText.replace(backgroundImageurl,loadingIMG),domUtils.setAttributes(ci,{"data-background":backgroundImageurl}))}remoteImages.length&&catchremoteimage(remoteImages,{success:function(r){try{var info=void 0!==r.state?r:eval("("+r.responseText+")")}catch(e){return}var i,j,ci,cj,oldSrc,newSrc,list=info.list,catchFailList=[],catchSuccessList=[],failIMG=me.options.themePath+me.options.theme+"/images/img-cracked.png";for(i=0;ci=imgs[i++];)for(oldSrc=ci.getAttribute("_src")||ci.src||"",oldBgIMG=ci.getAttribute("data-background")||"",j=0;cj=list[j++];){if(oldSrc==cj.source&&"SUCCESS"==cj.state){newSrc=catcherUrlPrefix+cj.url,domUtils.removeClasses(ci,"loadingclass"),domUtils.setAttributes(ci,{src:newSrc,_src:newSrc,"data-catchResult":"img_catchSuccess"}),catchSuccessList.push(ci);break}if(oldSrc==cj.source&&"FAIL"==cj.state){domUtils.removeClasses(ci,"loadingclass"),domUtils.setAttributes(ci,{src:failIMG,_src:failIMG,"data-catchResult":"img_catchFail"}),catchFailList.push(ci);break}if(oldBgIMG==cj.source&&"SUCCESS"==cj.state){newBgIMG=catcherUrlPrefix+cj.url,ci.style.cssText=ci.style.cssText.replace(loadingIMG,newBgIMG),domUtils.removeAttributes(ci,"data-background"),domUtils.setAttributes(ci,{"data-catchResult":"img_catchSuccess"}),catchSuccessList.push(ci);break}if(oldBgIMG==cj.source&&"FAIL"==cj.state){ci.style.cssText=ci.style.cssText.replace(loadingIMG,failIMG),domUtils.removeAttributes(ci,"data-background"),domUtils.setAttributes(ci,{"data-catchResult":"img_catchFail"}),catchFailList.push(ci);break}}me.fireEvent("catchremotesuccess",catchSuccessList,catchFailList)},error:function(){me.fireEvent("catchremoteerror")}})}))},UE.plugin.register("snapscreen",function(){function getLocation(a){var b,c=document.createElement("a"),d=utils.serializeParam(me.queryCommandValue("serverparam"))||"";return c.href=a,browser.ie&&(c.href=c.href),b=c.search,d&&(b=b+(b.indexOf("?")==-1?"?":"&")+d,b=b.replace(/[&]+/gi,"&")),{port:c.port,hostname:c.hostname,path:c.pathname+b||+c.hash}}var me=this,snapplugin;return{commands:{snapscreen:{execCommand:function(cmd){function onSuccess(rs){try{if(rs=eval("("+rs+")"),"SUCCESS"==rs.state){var opt=me.options;me.execCommand("insertimage",{src:opt.snapscreenUrlPrefix+rs.url,_src:opt.snapscreenUrlPrefix+rs.url,alt:rs.title||"",floatStyle:opt.snapscreenImgAlign})}else alert(rs.state)}catch(e){alert(lang.callBackErrorMsg)}}var url,local,res,lang=me.getLang("snapScreen_plugin");if(!snapplugin){var container=me.container,doc=me.container.ownerDocument||me.container.document;snapplugin=doc.createElement("object");try{snapplugin.type="application/x-pluginbaidusnap"}catch(e){return}snapplugin.style.cssText="position:absolute;left:-9999px;width:0;height:0;",snapplugin.setAttribute("width","0"),snapplugin.setAttribute("height","0"),container.appendChild(snapplugin)}url=me.getActionUrl(me.getOpt("snapscreenActionName")),local=getLocation(url),setTimeout(function(){try{res=snapplugin.saveSnapshot(local.hostname,local.path,local.port)}catch(a){return void me.ui._dialogs.snapscreenDialog.open()}onSuccess(res)},50)},queryCommandState:function(){return navigator.userAgent.indexOf("Windows",0)!=-1?0:-1}}}}}),UE.commands.insertparagraph={execCommand:function(a,b){for(var c,d=this,e=d.selection.getRange(),f=e.startContainer;f&&!domUtils.isBody(f);)c=f,f=f.parentNode;if(c){var g=d.document.createElement("p");b?c.parentNode.insertBefore(g,c):c.parentNode.insertBefore(g,c.nextSibling),domUtils.fillNode(d.document,g),e.setStart(g,0).setCursor(!1,!0)}}},UE.plugin.register("webapp",function(){function a(a,c){return c?'':'"}var b=this;return{outputRule:function(b){utils.each(b.getNodesByTagName("img"),function(b){var c;if("edui-faked-webapp"==b.getAttr("class")){c=a({title:b.getAttr("title"),width:b.getAttr("width"),height:b.getAttr("height"),align:b.getAttr("align"),cssfloat:b.getStyle("float"),url:b.getAttr("_url"),logo:b.getAttr("_logo_url")},!0);var d=UE.uNode.createElement(c);b.parentNode.replaceChild(d,b)}})},inputRule:function(b){utils.each(b.getNodesByTagName("iframe"),function(b){if("edui-faked-webapp"==b.getAttr("class")){var c=UE.uNode.createElement(a({title:b.getAttr("title"),width:b.getAttr("width"),height:b.getAttr("height"),align:b.getAttr("align"),cssfloat:b.getStyle("float"),url:b.getAttr("src"),logo:b.getAttr("logo_url")}));b.parentNode.replaceChild(c,b)}})},commands:{webapp:{execCommand:function(b,c){var d=this,e=a(utils.extend(c,{align:"none"}),!1);d.execCommand("inserthtml",e)},queryCommandState:function(){var a=this,b=a.selection.getRange().getClosedNode(),c=b&&"edui-faked-webapp"==b.className;return c?1:0}}}}}),UE.plugins.template=function(){UE.commands.template={execCommand:function(a,b){b.html&&this.execCommand("inserthtml",b.html)}},this.addListener("click",function(a,b){var c=b.target||b.srcElement,d=this.selection.getRange(),e=domUtils.findParent(c,function(a){if(a.className&&domUtils.hasClass(a,"ue_t"))return a},!0);e&&d.selectNode(e).shrinkBoundary().select()}),this.addListener("keydown",function(a,b){var c=this.selection.getRange();if(!c.collapsed&&!(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)){var d=domUtils.findParent(c.startContainer,function(a){if(a.className&&domUtils.hasClass(a,"ue_t"))return a},!0);d&&domUtils.removeClasses(d,["ue_t"])}})},UE.plugin.register("music",function(){function a(a,c,d,e,f,g){return g?'':"'}var b=this;return{outputRule:function(b){utils.each(b.getNodesByTagName("img"),function(b){var c;if("edui-faked-music"==b.getAttr("class")){var d=b.getStyle("float"),e=b.getAttr("align");c=a(b.getAttr("_url"),b.getAttr("width"),b.getAttr("height"),e,d,!0);var f=UE.uNode.createElement(c);b.parentNode.replaceChild(f,b)}})},inputRule:function(b){utils.each(b.getNodesByTagName("embed"),function(b){if("edui-faked-music"==b.getAttr("class")){var c=b.getStyle("float"),d=b.getAttr("align");html=a(b.getAttr("src"),b.getAttr("width"),b.getAttr("height"),d,c,!1);var e=UE.uNode.createElement(html);b.parentNode.replaceChild(e,b)}})},commands:{music:{execCommand:function(b,c){var d=this,e=a(c.url,c.width||400,c.height||95,"none",!1);d.execCommand("inserthtml",e)},queryCommandState:function(){var a=this,b=a.selection.getRange().getClosedNode(),c=b&&"edui-faked-music"==b.className;return c?1:0}}}}}),UE.plugin.register("autoupload",function(){function a(a,b){var c,d,e,f,g,h,i,j,k=b,l=/image\/\w+/i.test(a.type)?"image":"file",m="loading_"+(+new Date).toString(36);if(c=k.getOpt(l+"FieldName"),d=k.getOpt(l+"UrlPrefix"),e=k.getOpt(l+"MaxSize"),f=k.getOpt(l+"AllowFiles"),g=k.getActionUrl(k.getOpt(l+"ActionName")),i=function(a){var b=k.document.getElementById(m);b&&domUtils.remove(b),k.fireEvent("showmessage",{id:m,content:a,type:"error",timeout:4e3})},"image"==l?(h='',j=function(a){var b=d+a.url,c=k.document.getElementById(m);c&&(domUtils.removeClasses(c,"loadingclass"),c.setAttribute("src",b),c.setAttribute("_src",b),c.setAttribute("alt",a.original||""),c.removeAttribute("id"),k.trigger("contentchange",c))}):(h='

                      ',j=function(a){var b=d+a.url,c=k.document.getElementById(m),e=k.selection.getRange(),f=e.createBookmark();e.selectNode(c).select(),k.execCommand("insertfile",{url:b}),e.moveToBookmark(f).select()}),k.execCommand("inserthtml",h),!k.getOpt(l+"ActionName"))return void i(k.getLang("autoupload.errorLoadConfig"));if(a.size>e)return void i(k.getLang("autoupload.exceedSizeError"));var n=a.name?a.name.substr(a.name.lastIndexOf(".")):"";if(n&&"image"!=l||f&&(f.join("")+".").indexOf(n.toLowerCase()+".")==-1)return void i(k.getLang("autoupload.exceedTypeError"));var o=new XMLHttpRequest,p=new FormData,q=utils.serializeParam(k.queryCommandValue("serverparam"))||"",r=utils.formatUrl(g+(g.indexOf("?")==-1?"?":"&")+q);p.append(c,a,a.name||"blob."+a.type.substr("image/".length)),p.append("type","ajax"),o.open("post",r,!0),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.addEventListener("load",function(a){try{var b=new Function("return "+utils.trim(a.target.response))();"SUCCESS"==b.state&&b.url?j(b):i(b.state)}catch(c){i(k.getLang("autoupload.loadError"))}}),o.send(p)}function b(a){return a.clipboardData&&a.clipboardData.items&&1==a.clipboardData.items.length&&/^image\//.test(a.clipboardData.items[0].type)?a.clipboardData.items:null}function c(a){return a.dataTransfer&&a.dataTransfer.files?a.dataTransfer.files:null}return{outputRule:function(a){utils.each(a.getNodesByTagName("img"),function(a){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(a.getAttr("class"))&&a.parentNode.removeChild(a)}),utils.each(a.getNodesByTagName("p"),function(a){/\bloadpara\b/.test(a.getAttr("class"))&&a.parentNode.removeChild(a)})},bindEvents:{defaultOptions:{enableDragUpload:!0,enablePasteUpload:!0},ready:function(d){var e=this;if(window.FormData&&window.FileReader){var f=function(d){var f,g=!1;if(f="paste"==d.type?b(d):c(d)){for(var h,i=f.length;i--;)h=f[i],h.getAsFile&&(h=h.getAsFile()),h&&h.size>0&&(a(h,e),g=!0);g&&d.preventDefault()}};e.getOpt("enablePasteUpload")!==!1&&domUtils.on(e.body,"paste ",f),e.getOpt("enableDragUpload")!==!1?(domUtils.on(e.body,"drop",f),domUtils.on(e.body,"dragover",function(a){"Files"==a.dataTransfer.types[0]&&a.preventDefault(); -})):browser.gecko&&domUtils.on(e.body,"drop",function(a){c(a)&&a.preventDefault()}),utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-left:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document)}}}}}),UE.plugin.register("autosave",function(){function a(a){var f;if(!(new Date-c0?b._saveFlag=window.setTimeout(function(){a(b)},b.options.saveInterval):a(b))}},commands:{clearlocaldata:{execCommand:function(a,c){e&&b.getPreferences(e)&&b.removePreferences(e)},notNeedUndo:!0,ignoreContentChange:!0},getlocaldata:{execCommand:function(a,c){return e?b.getPreferences(e)||"":""},notNeedUndo:!0,ignoreContentChange:!0},drafts:{execCommand:function(a,c){e&&window.setTimeout(function(){b.body.innerHTML=b.getPreferences(e)||"

                      "+domUtils.fillHtml+"

                      "},0)},queryCommandState:function(){return e?null===b.getPreferences(e)?-1:0:-1},notNeedUndo:!0,ignoreContentChange:!0}}}}),UE.plugin.register("charts",function(){function a(a){var b=null,c=0;if(a.rows.length<2)return!1;if(a.rows[0].cells.length<2)return!1;b=a.rows[0].cells,c=b.length;for(var d,e=0;d=b[e];e++)if("th"!==d.tagName.toLowerCase())return!1;for(var f,e=1;f=a.rows[e];e++){if(f.cells.length!=c)return!1;if("th"!==f.cells[0].tagName.toLowerCase())return!1;for(var d,g=1;d=f.cells[g];g++){var h=utils.trim(d.innerText||d.textContent||"");if(h=h.replace(new RegExp(UE.dom.domUtils.fillChar,"g"),"").replace(/^\s+|\s+$/g,""),!/^\d*\.?\d+$/.test(h))return!1}}return!0}var b=this;return{bindEvents:{chartserror:function(){}},commands:{charts:{execCommand:function(c,d){var e=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0),f=[],g={};if(!e)return!1;if(!a(e))return b.fireEvent("chartserror"),!1;g.title=d.title||"",g.subTitle=d.subTitle||"",g.xTitle=d.xTitle||"",g.yTitle=d.yTitle||"",g.suffix=d.suffix||"",g.tip=d.tip||"",g.dataFormat=d.tableDataFormat||"",g.chartType=d.chartType||0;for(var h in g)g.hasOwnProperty(h)&&f.push(h+":"+g[h]);e.setAttribute("data-chart",f.join(";")),domUtils.addClass(e,"edui-charts-table")},queryCommandState:function(b,c){var d=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0);return d&&a(d)?0:-1}}},inputRule:function(a){utils.each(a.getNodesByTagName("table"),function(a){void 0!==a.getAttr("data-chart")&&a.setAttr("style")})},outputRule:function(a){utils.each(a.getNodesByTagName("table"),function(a){void 0!==a.getAttr("data-chart")&&a.setAttr("style","display: none;")})}}}),UE.plugin.register("section",function(){function a(a){this.tag="",this.level=-1,this.dom=null,this.nextSection=null,this.previousSection=null,this.parentSection=null,this.startAddress=[],this.endAddress=[],this.children=[]}function b(b){var c=new a;return utils.extend(c,b)}function c(a,b){for(var c=b,d=0;d=0){var o=h.selection.getRange().selectNode(i).createAddress(!0).startAddress,p=b({tag:i.tagName,title:i.innerText||i.textContent||"",level:f,dom:i,startAddress:utils.clone(o,[]),endAddress:utils.clone(o,[]),children:[]});for(j.nextSection=p,p.previousSection=j,g=j;f<=g.level;)g=g.parentSection;p.parentSection=g,g.children.push(p),k=j=p}else 1===i.nodeType&&e(i,c),k&&k.endAddress[k.endAddress.length-1]++}for(var f=c||["h1","h2","h3","h4","h5","h6"],g=0;g=c.length);f++){if(c[f]>a[f]){d=!0;break}if(c[f]=c.length);f++){if(c[f]a[f])break}return d&&e}var g,h,i=this;if(b&&d&&d.level!=-1&&(g=e?d.endAddress:d.startAddress,h=c(g,i.body),g&&h&&!f(b.startAddress,b.endAddress,g))){var j,k,l=c(b.startAddress,i.body),m=c(b.endAddress,i.body);if(e)for(j=m;j&&!(domUtils.getPosition(l,j)&domUtils.POSITION_FOLLOWING)&&(k=j.previousSibling,domUtils.insertAfter(h,j),j!=l);)j=k;else for(j=l;j&&!(domUtils.getPosition(j,m)&domUtils.POSITION_FOLLOWING)&&(k=j.nextSibling,h.parentNode.insertBefore(j,h),j!=m);)j=k;i.fireEvent("updateSections")}}},deletesection:{execCommand:function(a,b,c){function d(a){for(var b=e.body,c=0;c',b.className="edui-"+c.options.theme,b.id=c.ui.id+"_iframeupload",i.style.cssText=g,i.style.width=a+"px",i.style.height=e+"px",i.appendChild(b),i.parentNode&&(i.parentNode.style.width=a+"px",i.parentNode.style.height=a+"px");var k=h.getElementById("edui_form_"+j),l=h.getElementById("edui_input_"+j),m=h.getElementById("edui_iframe_"+j);domUtils.on(l,"change",function(){function a(){try{var e,f,g,h=(m.contentDocument||m.contentWindow.document).body,i=h.innerText||h.textContent||"";f=new Function("return "+i)(),e=c.options.imageUrlPrefix+f.url,"SUCCESS"==f.state&&f.url?(g=c.document.getElementById(d),domUtils.removeClasses(g,"loadingclass"),domUtils.on(g,"load",function(){c.fireEvent("contentchange")}),g.setAttribute("src",e),g.setAttribute("_src",e),g.setAttribute("alt",f.original||""),g.removeAttribute("id")):b&&b(f.state)}catch(j){b&&b(c.getLang("simpleupload.loadError"))}k.reset(),domUtils.un(m,"load",a)}function b(a){if(d){var b=c.document.getElementById(d);b&&domUtils.remove(b),c.fireEvent("showmessage",{id:d,content:a,type:"error",timeout:4e3})}}if(l.value){var d="loading_"+(+new Date).toString(36),e=utils.serializeParam(c.queryCommandValue("serverparam"))||"",f=c.getActionUrl(c.getOpt("imageActionName")),g=c.getOpt("imageAllowFiles");if(c.focus(),c.execCommand("inserthtml",''),!c.getOpt("imageActionName"))return void errorHandler(c.getLang("autoupload.errorLoadConfig"));var h=l.value,i=h?h.substr(h.lastIndexOf(".")):"";if(!i||g&&(g.join("")+".").indexOf(i.toLowerCase()+".")==-1)return void b(c.getLang("simpleupload.exceedTypeError"));domUtils.on(m,"load",a),k.action=utils.formatUrl(f+(f.indexOf("?")==-1?"?":"&")+e),k.submit()}});var n;c.addListener("selectionchange",function(){clearTimeout(n),n=setTimeout(function(){var a=c.queryCommandState("simpleupload");a==-1?l.disabled="disabled":l.disabled=!1},400)}),d=!0}),f.style.cssText=g,b.appendChild(f)}var b,c=this,d=!1;return{bindEvents:{ready:function(){utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document)},simpleuploadbtnready:function(d,e){b=e,c.afterConfigReady(a)}},outputRule:function(a){utils.each(a.getNodesByTagName("img"),function(a){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(a.getAttr("class"))&&a.parentNode.removeChild(a)})},commands:{simpleupload:{queryCommandState:function(){return d?0:-1}}}}}),UE.plugin.register("serverparam",function(){var a={};return{commands:{serverparam:{execCommand:function(b,c,d){void 0===c||null===c?a={}:utils.isString(c)?void 0===d||null===d?delete a[c]:a[c]=d:utils.isObject(c)?utils.extend(a,c,!1):utils.isFunction(c)&&utils.extend(a,c(),!1)},queryCommandValue:function(){return a||{}}}}}}),UE.plugin.register("insertfile",function(){function a(a){var b=a.substr(a.lastIndexOf(".")+1).toLowerCase(),c={rar:"icon_rar.gif",zip:"icon_rar.gif",tar:"icon_rar.gif",gz:"icon_rar.gif",bz2:"icon_rar.gif",doc:"icon_doc.gif",docx:"icon_doc.gif",pdf:"icon_pdf.gif",mp3:"icon_mp3.gif",xls:"icon_xls.gif",chm:"icon_chm.gif",ppt:"icon_ppt.gif",pptx:"icon_ppt.gif",avi:"icon_mv.gif",rmvb:"icon_mv.gif",wmv:"icon_mv.gif",flv:"icon_mv.gif",swf:"icon_mv.gif",rm:"icon_mv.gif",exe:"icon_exe.gif",psd:"icon_psd.gif",txt:"icon_txt.gif",jpg:"icon_jpg.gif",png:"icon_jpg.gif",jpeg:"icon_jpg.gif",gif:"icon_jpg.gif",ico:"icon_jpg.gif",bmp:"icon_jpg.gif"};return c[b]?c[b]:c.txt}var b=this;return{commands:{insertfile:{execCommand:function(c,d){if(d=utils.isArray(d)?d:[d],b.fireEvent("beforeinsertfile",d)!==!0){var e,f,g,h,i="",j=b.getOpt("UEDITOR_HOME_URL"),k=j+("/"==j.substr(j.length-1)?"":"/")+"dialogs/attachment/fileTypeImages/";for(e=0;e'+h+"

                      ";b.execCommand("insertHtml",i),b.fireEvent("afterinsertfile",d)}}}}}}),UE.plugins.xssFilter=function(){function a(a){var b=a.tagName,d=a.attrs;return c.hasOwnProperty(b)?void UE.utils.each(d,function(d,e){c[b].indexOf(e)===-1&&a.setAttr(e)}):(a.parentNode.removeChild(a),!1)}var b=UEDITOR_CONFIG,c=b.whitList;c&&b.xssFilterRules&&(this.options.filterRules=function(){var b={};return UE.utils.each(c,function(c,d){b[d]=function(b){return a(b)}}),b}());var d=[];UE.utils.each(c,function(a,b){d.push(b)}),c&&b.inputXssFilter&&this.addInputRule(function(b){b.traversal(function(b){return"element"===b.type&&void a(b)})}),c&&b.outputXssFilter&&this.addOutputRule(function(b){b.traversal(function(b){return"element"===b.type&&void a(b)})})};var baidu=baidu||{};baidu.editor=baidu.editor||{},UE.ui=baidu.editor.ui={},function(){function a(){var a=document.getElementById("edui_fixedlayer");i.setViewportOffset(a,{left:0,top:0})}function b(b){d.on(window,"scroll",a),d.on(window,"resize",baidu.editor.utils.defer(a,0,!0))}var c=baidu.editor.browser,d=baidu.editor.dom.domUtils,e="$EDITORUI",f=window[e]={},g="ID"+e,h=0,i=baidu.editor.ui.uiUtils={uid:function(a){return a?a[g]||(a[g]=++h):++h},hook:function(a,b){var c;return a&&a._callbacks?c=a:(c=function(){var b;a&&(b=a.apply(this,arguments));for(var d=c._callbacks,e=d.length;e--;){var f=d[e].apply(this,arguments);void 0===b&&(b=f)}return b},c._callbacks=[]),c._callbacks.push(b),c},createElementByHtml:function(a){var b=document.createElement("div");return b.innerHTML=a,b=b.firstChild,b.parentNode.removeChild(b),b},getViewportElement:function(){return c.ie&&c.quirks?document.body:document.documentElement},getClientRect:function(a){var b;try{b=a.getBoundingClientRect()}catch(c){b={left:0,top:0,height:0,width:0}}for(var e,f={left:Math.round(b.left),top:Math.round(b.top),height:Math.round(b.bottom-b.top),width:Math.round(b.right-b.left)};(e=a.ownerDocument)!==document&&(a=d.getWindow(e).frameElement);)b=a.getBoundingClientRect(),f.left+=b.left,f.top+=b.top;return f.bottom=f.top+f.height,f.right=f.left+f.width,f},getViewportRect:function(){var a=i.getViewportElement(),b=0|(window.innerWidth||a.clientWidth),c=0|(window.innerHeight||a.clientHeight);return{left:0,top:0,height:c,width:b,bottom:c,right:b}},setViewportOffset:function(a,b){var c=i.getFixedLayer();a.parentNode===c?(a.style.left=b.left+"px",a.style.top=b.top+"px"):d.setViewportOffset(a,b)},getEventOffset:function(a){var b=a.target||a.srcElement,c=i.getClientRect(b),d=i.getViewportOffsetByEvent(a);return{left:d.left-c.left,top:d.top-c.top}},getViewportOffsetByEvent:function(a){var b=a.target||a.srcElement,c=d.getWindow(b).frameElement,e={left:a.clientX,top:a.clientY};if(c&&b.ownerDocument!==document){var f=i.getClientRect(c);e.left+=f.left,e.top+=f.top}return e},setGlobal:function(a,b){return f[a]=b,e+'["'+a+'"]'},unsetGlobal:function(a){delete f[a]},copyAttributes:function(a,b){for(var e=b.attributes,f=e.length;f--;){var g=e[f];"style"==g.nodeName||"class"==g.nodeName||c.ie&&!g.specified||a.setAttribute(g.nodeName,g.nodeValue)}b.className&&d.addClass(a,b.className),b.style.cssText&&(a.style.cssText+=";"+b.style.cssText)},removeStyle:function(a,b){if(a.style.removeProperty)a.style.removeProperty(b);else{if(!a.style.removeAttribute)throw"";a.style.removeAttribute(b)}},contains:function(a,b){return a&&b&&a!==b&&(a.contains?a.contains(b):16&a.compareDocumentPosition(b))},startDrag:function(a,b,c){function d(a){var c=a.clientX-g,d=a.clientY-h;b.ondragmove(c,d,a),a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function e(a){c.removeEventListener("mousemove",d,!0),c.removeEventListener("mouseup",e,!0),window.removeEventListener("mouseup",e,!0),b.ondragstop()}function f(){i.releaseCapture(),i.detachEvent("onmousemove",d),i.detachEvent("onmouseup",f),i.detachEvent("onlosecaptrue",f),b.ondragstop()}var c=c||document,g=a.clientX,h=a.clientY;if(c.addEventListener)c.addEventListener("mousemove",d,!0),c.addEventListener("mouseup",e,!0),window.addEventListener("mouseup",e,!0),a.preventDefault();else{var i=a.srcElement;i.setCapture(),i.attachEvent("onmousemove",d),i.attachEvent("onmouseup",f),i.attachEvent("onlosecaptrue",f),a.returnValue=!1}b.ondragstart()},getFixedLayer:function(){var d=document.getElementById("edui_fixedlayer");return null==d&&(d=document.createElement("div"),d.id="edui_fixedlayer",document.body.appendChild(d),c.ie&&c.version<=8?(d.style.position="absolute",b(),setTimeout(a)):d.style.position="fixed",d.style.left="0",d.style.top="0",d.style.width="0",d.style.height="0"),d},makeUnselectable:function(a){if(c.opera||c.ie&&c.version<9){if(a.unselectable="on",a.hasChildNodes())for(var b=0;b
                      '}},a.inherits(c,b)}(),function(){var a=baidu.editor.utils,b=baidu.editor.dom.domUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.uiUtils,e=baidu.editor.ui.Mask=function(a){this.initOptions(a),this.initUIBase()};e.prototype={getHtmlTpl:function(){return'
                      '},postRender:function(){var a=this;b.on(window,"resize",function(){setTimeout(function(){a.isHidden()||a._fill()})})},show:function(a){this._fill(),this.getDom().style.display="",this.getDom().style.zIndex=a},hide:function(){this.getDom().style.display="none",this.getDom().style.zIndex=""},isHidden:function(){return"none"==this.getDom().style.display},_onMouseDown:function(){return!1},_onClick:function(a,b){this.fireEvent("click",a,b)},_fill:function(){var a=this.getDom(),b=d.getViewportRect();a.style.width=b.width+"px",a.style.height=b.height+"px"}},a.inherits(e,c)}(),function(){function a(a,b){for(var c=0;c
                      '+this.getContentHtmlTpl()+"
                      "},getContentHtmlTpl:function(){return this.content?"string"==typeof this.content?this.content:this.content.renderHtml():""},_UIBase_postRender:e.prototype.postRender,postRender:function(){if(this.content instanceof e&&this.content.postRender(),this.captureWheel&&!this.captured){this.captured=!0;var a=(document.documentElement.clientHeight||document.body.clientHeight)-80,b=this.getDom().offsetHeight,f=c.getClientRect(this.combox.getDom()).top,g=this.getDom("content"),h=this.getDom("body").getElementsByTagName("iframe"),i=this;for(h.length&&(h=h[0]);f+b>a;)b-=30;g.style.height=b+"px",h&&(h.style.height=b+"px"),window.XMLHttpRequest?d.on(g,"onmousewheel"in document.body?"mousewheel":"DOMMouseScroll",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1,a.wheelDelta?g.scrollTop-=a.wheelDelta/120*60:g.scrollTop-=a.detail/-3*60}):d.on(this.getDom(),"mousewheel",function(a){a.returnValue=!1,i.getDom("content").scrollTop-=a.wheelDelta/120*60})}this.fireEvent("postRenderAfter"),this.hide(!0),this._UIBase_postRender()},_doAutoRender:function(){!this.getDom()&&this.autoRender&&this.render()},mesureSize:function(){var a=this.getDom("content");return c.getClientRect(a)},fitSize:function(){if(this.captureWheel&&this.sized)return this.__size;this.sized=!0;var a=this.getDom("body");a.style.width="",a.style.height="";var b=this.mesureSize();if(this.captureWheel){a.style.width=-(-20-b.width)+"px";var c=parseInt(this.getDom("content").style.height,10);!window.isNaN(c)&&(b.height=c)}else a.style.width=b.width+"px";return a.style.height=b.height+"px",this.__size=b,this.captureWheel&&(this.getDom("content").style.overflow="auto"),b},showAnchor:function(a,b){this.showAnchorRect(c.getClientRect(a),b)},showAnchorRect:function(a,b,e){this._doAutoRender();var f=c.getViewportRect();this.getDom().style.visibility="hidden",this._show();var g,i,j,k,l=this.fitSize();b?(g=this.canSideLeft&&a.right+l.width>f.right&&a.left>l.width,i=this.canSideUp&&a.top+l.height>f.bottom&&a.bottom>l.height,j=g?a.left-l.width:a.right,k=i?a.bottom-l.height:a.top):(g=this.canSideLeft&&a.right+l.width>f.right&&a.left>l.width,i=this.canSideUp&&a.top+l.height>f.bottom&&a.bottom>l.height,j=g?a.right-l.width:a.left,k=i?a.top-l.height:a.bottom);var m=this.getDom();c.setViewportOffset(m,{left:j,top:k}),d.removeClasses(m,h),m.className+=" "+h[2*(i?1:0)+(g?1:0)],this.editor&&(m.style.zIndex=1*this.editor.container.style.zIndex+10,baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=m.style.zIndex-1),this.getDom().style.visibility="visible"},showAt:function(a){var b=a.left,c=a.top,d={left:b,top:c,right:b,bottom:c,height:0,width:0};this.showAnchorRect(d,!1,!0)},_show:function(){if(this._hidden){var a=this.getDom();a.style.display="",this._hidden=!1,this.fireEvent("show")}},isHidden:function(){return this._hidden},show:function(){this._doAutoRender(),this._show()},hide:function(a){!this._hidden&&this.getDom()&&(this.getDom().style.display="none",this._hidden=!0,a||this.fireEvent("hide"))},queryAutoHide:function(a){return!a||!c.contains(this.getDom(),a)}},b.inherits(f,e),d.on(document,"mousedown",function(b){var c=b.target||b.srcElement;a(b,c)}),d.on(window,"scroll",function(b,c){a(b,c)})}(),function(){function a(a,b){for(var c='
                      '+a+'
                      ',d=0;d"+(60==d?'":"")+""),c+=d<70?'':"";return c+="
                      '+b.getLang("themeColor")+'
                      '+b.getLang("standardColor")+"
                      =60?"border-width:1px;":d>=10&&d<20?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'">
                      "}var b=baidu.editor.utils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.ColorPicker=function(a){this.initOptions(a),this.noColorText=this.noColorText||this.editor.getLang("clearColor"),this.initUIBase()};d.prototype={getHtmlTpl:function(){return a(this.noColorText,this.editor)},_onTableClick:function(a){var b=a.target||a.srcElement,c=b.getAttribute("data-color");c&&this.fireEvent("pickcolor",c)},_onTableOver:function(a){var b=a.target||a.srcElement,c=b.getAttribute("data-color");c&&(this.getDom("preview").style.backgroundColor=c)},_onTableOut:function(){this.getDom("preview").style.backgroundColor=""},_onPickNoColor:function(){this.fireEvent("picknocolor")}},b.inherits(d,c);var e="ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646,f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806,c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,".split(",")}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.TablePicker=function(a){this.initOptions(a),this.initTablePicker()};d.prototype={defaultNumRows:10,defaultNumCols:10,maxNumRows:20,maxNumCols:20,numRows:10,numCols:10,lengthOfCellSide:22,initTablePicker:function(){this.initUIBase()},getHtmlTpl:function(){return'
                      '},_UIBase_render:c.prototype.render,render:function(a){this._UIBase_render(a),this.getDom("label").innerHTML="0"+this.editor.getLang("t_row")+" x 0"+this.editor.getLang("t_col")},_track:function(a,b){var c=this.getDom("overlay").style,d=this.lengthOfCellSide;c.width=a*d+"px",c.height=b*d+"px";var e=this.getDom("label");e.innerHTML=a+this.editor.getLang("t_col")+" x "+b+this.editor.getLang("t_row"),this.numCols=a,this.numRows=b},_onMouseOver:function(a,c){var d=a.relatedTarget||a.fromElement;b.contains(c,d)||c===d||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="")},_onMouseOut:function(a,c){var d=a.relatedTarget||a.toElement;b.contains(c,d)||c===d||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="hidden")},_onMouseMove:function(a,c){var d=(this.getDom("overlay").style,b.getEventOffset(a)),e=this.lengthOfCellSide,f=Math.ceil(d.left/e),g=Math.ceil(d.top/e);this._track(f,g)},_onClick:function(){this.fireEvent("picktable",this.numCols,this.numRows)}},a.inherits(d,c)}(),function(){var a=baidu.editor.browser,b=baidu.editor.dom.domUtils,c=baidu.editor.ui.uiUtils,d='onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"'+(a.ie?' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"':' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"');baidu.editor.ui.Stateful={alwalysHoverable:!1,target:null,Stateful_init:function(){this._Stateful_dGetHtmlTpl=this.getHtmlTpl,this.getHtmlTpl=this.Stateful_getHtmlTpl},Stateful_getHtmlTpl:function(){var a=this._Stateful_dGetHtmlTpl();return a.replace(/stateful/g,function(){return d})},Stateful_onMouseEnter:function(a,b){this.target=b,this.isDisabled()&&!this.alwalysHoverable||(this.addState("hover"),this.fireEvent("over"))},Stateful_onMouseLeave:function(a,b){this.isDisabled()&&!this.alwalysHoverable||(this.removeState("hover"),this.removeState("active"),this.fireEvent("out"))},Stateful_onMouseOver:function(a,b){var d=a.relatedTarget;c.contains(b,d)||b===d||this.Stateful_onMouseEnter(a,b)},Stateful_onMouseOut:function(a,b){var d=a.relatedTarget;c.contains(b,d)||b===d||this.Stateful_onMouseLeave(a,b)},Stateful_onMouseDown:function(a,b){this.isDisabled()||this.addState("active")},Stateful_onMouseUp:function(a,b){this.isDisabled()||this.removeState("active")},Stateful_postRender:function(){this.disabled&&!this.hasState("disabled")&&this.addState("disabled")},hasState:function(a){return b.hasClass(this.getStateDom(),"edui-state-"+a)},addState:function(a){this.hasState(a)||(this.getStateDom().className+=" edui-state-"+a)},removeState:function(a){this.hasState(a)&&b.removeClasses(this.getStateDom(),["edui-state-"+a])},getStateDom:function(){return this.getDom("state")},isChecked:function(){return this.hasState("checked")},setChecked:function(a){!this.isDisabled()&&a?this.addState("checked"):this.removeState("checked")},isDisabled:function(){return this.hasState("disabled")},setDisabled:function(a){a?(this.removeState("hover"),this.removeState("checked"),this.removeState("active"),this.addState("disabled")):this.removeState("disabled")}}}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase,c=baidu.editor.ui.Stateful,d=baidu.editor.ui.Button=function(a){if(a.name){var b=a.name,c=a.cssRules;a.className||(a.className="edui-for-"+b),a.cssRules=".edui-"+(a.theme||"default")+" .edui-toolbar .edui-button.edui-for-"+b+" .edui-icon {"+c+"}"}this.initOptions(a),this.initButton()};d.prototype={uiName:"button",label:"",title:"",showIcon:!0,showText:!0,cssRules:"",initButton:function(){this.initUIBase(),this.Stateful_init(),this.cssRules&&a.cssRule("edui-customize-"+this.name+"-style",this.cssRules)},getHtmlTpl:function(){return'
                      '+(this.showIcon?'
                      ':"")+(this.showText?'
                      '+this.label+"
                      ":"")+"
                      "; -},postRender:function(){this.Stateful_postRender(),this.setDisabled(this.disabled)},_onMouseDown:function(a){var b=a.target||a.srcElement,c=b&&b.tagName&&b.tagName.toLowerCase();if("input"==c||"object"==c||"object"==c)return!1},_onClick:function(){this.isDisabled()||this.fireEvent("click")},setTitle:function(a){var b=this.getDom("label");b.innerHTML=a}},a.inherits(d,b),a.extend(d.prototype,c)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=(baidu.editor.dom.domUtils,baidu.editor.ui.UIBase),d=baidu.editor.ui.Stateful,e=baidu.editor.ui.SplitButton=function(a){this.initOptions(a),this.initSplitButton()};e.prototype={popup:null,uiName:"splitbutton",title:"",initSplitButton:function(){this.initUIBase(),this.Stateful_init();if(null!=this.popup){var a=this.popup;this.popup=null,this.setPopup(a)}},_UIBase_postRender:c.prototype.postRender,postRender:function(){this.Stateful_postRender(),this._UIBase_postRender()},setPopup:function(c){this.popup!==c&&(null!=this.popup&&this.popup.dispose(),c.addListener("show",a.bind(this._onPopupShow,this)),c.addListener("hide",a.bind(this._onPopupHide,this)),c.addListener("postrender",a.bind(function(){c.getDom("body").appendChild(b.createElementByHtml('
                      ')),c.getDom().className+=" "+this.className},this)),this.popup=c)},_onPopupShow:function(){this.addState("opened")},_onPopupHide:function(){this.removeState("opened")},getHtmlTpl:function(){return'
                      '},showPopup:function(){var a=b.getClientRect(this.getDom());a.top-=this.popup.SHADOW_RADIUS,a.height+=this.popup.SHADOW_RADIUS,this.popup.showAnchorRect(a)},_onArrowClick:function(a,b){this.isDisabled()||this.showPopup()},_onButtonClick:function(){this.isDisabled()||this.fireEvent("buttonclick")}},a.inherits(e,c),a.extend(e.prototype,d,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.ColorPicker,d=baidu.editor.ui.Popup,e=baidu.editor.ui.SplitButton,f=baidu.editor.ui.ColorButton=function(a){this.initOptions(a),this.initColorButton()};f.prototype={initColorButton:function(){var a=this;this.popup=new d({content:new c({noColorText:a.editor.getLang("clearColor"),editor:a.editor,onpickcolor:function(b,c){a._onPickColor(c)},onpicknocolor:function(b,c){a._onPickNoColor(c)}}),editor:a.editor}),this.initSplitButton()},_SplitButton_postRender:e.prototype.postRender,postRender:function(){this._SplitButton_postRender(),this.getDom("button_body").appendChild(b.createElementByHtml('
                      ')),this.getDom().className+=" edui-colorbutton"},setColor:function(a){this.getDom("colorlump").style.backgroundColor=a,this.color=a},_onPickColor:function(a){this.fireEvent("pickcolor",a)!==!1&&(this.setColor(a),this.popup.hide())},_onPickNoColor:function(a){this.fireEvent("picknocolor")!==!1&&this.popup.hide()}},a.inherits(f,e)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.Popup,c=baidu.editor.ui.TablePicker,d=baidu.editor.ui.SplitButton,e=baidu.editor.ui.TableButton=function(a){this.initOptions(a),this.initTableButton()};e.prototype={initTableButton:function(){var a=this;this.popup=new b({content:new c({editor:a.editor,onpicktable:function(b,c,d){a._onPickTable(c,d)}}),editor:a.editor}),this.initSplitButton()},_onPickTable:function(a,b){this.fireEvent("picktable",a,b)!==!1&&this.popup.hide()}},a.inherits(e,d)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase,c=baidu.editor.ui.AutoTypeSetPicker=function(a){this.initOptions(a),this.initAutoTypeSetPicker()};c.prototype={initAutoTypeSetPicker:function(){this.initUIBase()},getHtmlTpl:function(){var a=this.editor,b=a.options.autotypeset,c=a.getLang("autoTypeSet"),d="textAlignValue"+a.uid,e="imageBlockLineValue"+a.uid,f="symbolConverValue"+a.uid;return'
                      "+c.mergeLine+'"+c.delLine+'
                      "+c.removeFormat+'"+c.indent+'
                      "+c.alignment+'"+a.getLang("justifyleft")+'"+a.getLang("justifycenter")+'"+a.getLang("justifyright")+'
                      "+c.imageFloat+'"+a.getLang("default")+'"+a.getLang("justifyleft")+'"+a.getLang("justifycenter")+'"+a.getLang("justifyright")+'
                      "+c.removeFontsize+'"+c.removeFontFamily+'
                      "+c.removeHtml+'
                      "+c.pasteFilter+'
                      "+c.symbol+'"+c.bdc2sb+'"+c.tobdc+'
                      "},_UIBase_render:b.prototype.render},a.inherits(c,b)}(),function(){function a(a){for(var c,d={},e=a.getDom(),f=a.editor.uid,g=null,h=null,i=domUtils.getElementsByTagName(e,"input"),j=i.length-1;c=i[j--];)if(g=c.getAttribute("type"),"checkbox"==g)if(h=c.getAttribute("name"),d[h]&&delete d[h],c.checked){var k=document.getElementById(h+"Value"+f);if(k){if(/input/gi.test(k.tagName))d[h]=k.value;else for(var l,m=k.getElementsByTagName("input"),n=m.length-1;l=m[n--];)if(l.checked){d[h]=l.value;break}}else d[h]=!0}else d[h]=!1;else d[c.getAttribute("value")]=c.checked;for(var o,p=domUtils.getElementsByTagName(e,"select"),j=0;o=p[j++];){var q=o.getAttribute("name");d[q]=d[q]?o.value:""}b.extend(a.editor.options.autotypeset,d),a.editor.setPreferences("autotypeset",d)}var b=baidu.editor.utils,c=baidu.editor.ui.Popup,d=baidu.editor.ui.AutoTypeSetPicker,e=baidu.editor.ui.SplitButton,f=baidu.editor.ui.AutoTypeSetButton=function(a){this.initOptions(a),this.initAutoTypeSetButton()};f.prototype={initAutoTypeSetButton:function(){var b=this;this.popup=new c({content:new d({editor:b.editor}),editor:b.editor,hide:function(){!this._hidden&&this.getDom()&&(a(this),this.getDom().style.display="none",this._hidden=!0,this.fireEvent("hide"))}});var e=0;this.popup.addListener("postRenderAfter",function(){var c=this;if(!e){var d=this.getDom(),f=d.getElementsByTagName("button")[0];f.onclick=function(){a(c),b.editor.execCommand("autotypeset"),c.hide()},domUtils.on(d,"click",function(d){var e=d.target||d.srcElement,f=b.editor.uid;if(e&&"INPUT"==e.tagName){if("imageBlockLine"==e.name||"textAlign"==e.name||"symbolConver"==e.name)for(var g=e.checked,h=document.getElementById(e.name+"Value"+f),i=h.getElementsByTagName("input"),j={imageBlockLine:"none",textAlign:"left",symbolConver:"tobdc"},k=0;k"),e.push('
                      '),2===d&&e.push("");return'
                      '+e.join("")+"
                      "},getStateDom:function(){return this.target},_onClick:function(a){var c=a.target||a.srcElement;/icon/.test(c.className)&&(this.items[c.parentNode.getAttribute("index")].onclick(),b.postHide(a))},_UIBase_render:d.prototype.render},a.inherits(e,d),a.extend(e.prototype,c,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.Stateful,c=baidu.editor.ui.uiUtils,d=baidu.editor.ui.UIBase,e=baidu.editor.ui.PastePicker=function(a){this.initOptions(a),this.initPastePicker()};e.prototype={initPastePicker:function(){this.initUIBase(),this.Stateful_init()},getHtmlTpl:function(){return'
                      '+this.editor.getLang("pasteOpt")+'
                      '},getStateDom:function(){return this.target},format:function(a){this.editor.ui._isTransfer=!0,this.editor.fireEvent("pasteTransfer",a)},_onClick:function(a){var b=domUtils.getNextDomNode(a),d=c.getViewportRect().height,e=c.getClientRect(b);e.top+e.height>d?b.style.top=-e.height-a.offsetHeight+"px":b.style.top="",/hidden/gi.test(domUtils.getComputedStyle(b,"visibility"))?(b.style.visibility="visible",domUtils.addClass(a,"edui-state-opened")):(b.style.visibility="hidden",domUtils.removeClasses(a,"edui-state-opened"))},_UIBase_render:d.prototype.render},a.inherits(e,d),a.extend(e.prototype,b,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.Toolbar=function(a){this.initOptions(a),this.initToolbar()};d.prototype={items:null,initToolbar:function(){this.items=this.items||[],this.initUIBase()},add:function(a,b){void 0===b?this.items.push(a):this.items.splice(b,0,a)},getHtmlTpl:function(){for(var a=[],b=0;b'+a.join("")+"
                      "},postRender:function(){for(var a=this.getDom(),c=0;c
                      '},postRender:function(){},queryAutoHide:function(){return!0}};h.prototype={items:null,uiName:"menu",initMenu:function(){this.items=this.items||[],this.initPopup(),this.initItems()},initItems:function(){for(var a=0;a'+a.join("")+"
                      "},_Popup_postRender:e.prototype.postRender,postRender:function(){for(var a=this,d=0;d
                      '+this.renderLabelHtml()+"
                      "},postRender:function(){var a=this;this.addListener("over",function(){a.ownerMenu.fireEvent("submenuover",a),a.subMenu&&a.delayShowSubMenu()}),this.subMenu&&(this.getDom().className+=" edui-hassubmenu",this.subMenu.render(),this.addListener("out",function(){a.delayHideSubMenu()}),this.subMenu.addListener("over",function(){clearTimeout(a._closingTimer),a._closingTimer=null,a.addState("opened")}),this.ownerMenu.addListener("hide",function(){a.hideSubMenu()}),this.ownerMenu.addListener("submenuover",function(b,c){c!==a&&a.delayHideSubMenu()}),this.subMenu._bakQueryAutoHide=this.subMenu.queryAutoHide,this.subMenu.queryAutoHide=function(b){return(!b||!c.contains(a.getDom(),b))&&this._bakQueryAutoHide(b)}),this.getDom().style.tabIndex="-1",c.makeUnselectable(this.getDom()),this.Stateful_postRender()},delayShowSubMenu:function(){var a=this;a.isDisabled()||(a.addState("opened"),clearTimeout(a._showingTimer),clearTimeout(a._closingTimer),a._closingTimer=null,a._showingTimer=setTimeout(function(){a.showSubMenu()},250))},delayHideSubMenu:function(){var a=this;a.isDisabled()||(a.removeState("opened"),clearTimeout(a._showingTimer),a._closingTimer||(a._closingTimer=setTimeout(function(){a.hasState("opened")||a.hideSubMenu(),a._closingTimer=null},400)))},renderLabelHtml:function(){return'
                      '+(this.label||"")+"
                      "},getStateDom:function(){return this.getDom()},queryAutoHide:function(a){if(this.subMenu&&this.hasState("opened"))return this.subMenu.queryAutoHide(a)},_onClick:function(a,b){this.hasState("disabled")||this.fireEvent("click",a,b)!==!1&&(this.subMenu?this.showSubMenu():e.postHide(a))},showSubMenu:function(){var a=c.getClientRect(this.getDom());a.right-=5,a.left+=2,a.width-=7,a.top-=4,a.bottom+=4,a.height+=8,this.subMenu.showAnchorRect(a,!0,!0)},hideSubMenu:function(){this.subMenu.hide()}},a.inherits(j,d),a.extend(j.prototype,f,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.Menu,d=baidu.editor.ui.SplitButton,e=baidu.editor.ui.Combox=function(a){this.initOptions(a),this.initCombox()};e.prototype={uiName:"combox",onbuttonclick:function(){this.showPopup()},initCombox:function(){var a=this;this.items=this.items||[];for(var b=0;bd.right&&(g=d.right-e.width);var h=a.top;h+e.height>d.bottom&&(h=d.bottom-e.height),c.style.left=Math.max(g,0)+"px",c.style.top=Math.max(h,0)+"px"},showAtCenter:function(){var a=f.getViewportRect();if(this.fullscreen){var b=this.getDom(),c=this.getDom("content");b.style.display="block";var d=UE.ui.uiUtils.getClientRect(b),g=UE.ui.uiUtils.getClientRect(c);b.style.left="-100000px",c.style.width=a.width-d.width+g.width+"px",c.style.height=a.height-d.height+g.height+"px",b.style.width=a.width+"px",b.style.height=a.height+"px",b.style.left=0,this._originalContext={html:{overflowX:document.documentElement.style.overflowX,overflowY:document.documentElement.style.overflowY},body:{overflowX:document.body.style.overflowX,overflowY:document.body.style.overflowY}},document.documentElement.style.overflowX="hidden",document.documentElement.style.overflowY="hidden",document.body.style.overflowX="hidden",document.body.style.overflowY="hidden"}else{this.getDom().style.display="";var h=this.fitSize(),i=0|this.getDom("titlebar").offsetHeight,j=a.width/2-h.width/2,k=a.height/2-(h.height-i)/2-i,l=this.getDom();this.safeSetOffset({left:Math.max(0|j,0),top:Math.max(0|k,0)}),e.hasClass(l,"edui-state-centered")||(l.className+=" edui-state-centered")}this._show()},getContentHtml:function(){var a="";return"string"==typeof this.content?a=this.content:this.iframeUrl&&(a=''),a},getHtmlTpl:function(){var a="";if(this.buttons){for(var b=[],c=0;c
                      '+b.join("")+"
                      "}return'
                      '+(this.title||"")+"
                      "+this.closeButton.renderHtml()+'
                      '+(this.autoReset?"":this.getContentHtml())+"
                      "+a+"
                      "},postRender:function(){this.modalMask.getDom()||(this.modalMask.render(),this.modalMask.hide()),this.dragMask.getDom()||(this.dragMask.render(),this.dragMask.hide());var a=this;if(this.addListener("show",function(){a.modalMask.show(this.getDom().style.zIndex-2)}),this.addListener("hide",function(){a.modalMask.hide()}),this.buttons)for(var b=0;b',a.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*a.editor.container.style.zIndex+1))}}),this.onbuttonclick=function(){this.showPopup()},this.initSplitButton()}},a.inherits(d,c)}(),function(){function a(a){var b=a.target||a.srcElement,c=g.findParent(b,function(a){return g.hasClass(a,"edui-shortcutmenu")||g.hasClass(a,"edui-popup")},!0);if(!c)for(var d,e=0;d=h[e++];)d.hide()}var b,c=baidu.editor.ui,d=c.UIBase,e=c.uiUtils,f=baidu.editor.utils,g=baidu.editor.dom.domUtils,h=[],i=!1,j=c.ShortCutMenu=function(a){this.initOptions(a),this.initShortCutMenu()};j.postHide=a,j.prototype={isHidden:!0,SPACE:5,initShortCutMenu:function(){this.items=this.items||[],this.initUIBase(),this.initItems(),this.initEvent(),h.push(this)},initEvent:function(){var a=this,c=a.editor.document;g.on(c,"mousemove",function(c){if(a.isHidden===!1){if(a.getSubMenuMark()||"contextmenu"==a.eventType)return;var d=!0,e=a.getDom(),f=e.offsetWidth,g=e.offsetHeight,h=f/2+a.SPACE,i=g/2,j=Math.abs(c.screenX-a.left),k=Math.abs(c.screenY-a.top);clearTimeout(b),b=setTimeout(function(){k>0&&ki&&ki+70&&k0&&jh&&jh+70&&j'+a+""}},f.inherits(j,d),g.on(document,"mousedown",function(b){a(b)}),g.on(window,"scroll",function(b){a(b)})}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase,c=baidu.editor.ui.Breakline=function(a){this.initOptions(a),this.initSeparator()};c.prototype={uiName:"Breakline",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return"
                      "}},a.inherits(c,b)}(),function(){var a=baidu.editor.utils,b=baidu.editor.dom.domUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.Message=function(a){this.initOptions(a),this.initMessage()};d.prototype={initMessage:function(){this.initUIBase()},getHtmlTpl:function(){return'
                      ×
                      '},reset:function(a){var b=this;a.keepshow||(clearTimeout(this.timer),b.timer=setTimeout(function(){b.hide()},a.timeout||4e3)),void 0!==a.content&&b.setContent(a.content),void 0!==a.type&&b.setType(a.type),b.show()},postRender:function(){var a=this,c=this.getDom("closer");c&&b.on(c,"click",function(){a.hide()})},setContent:function(a){this.getDom("content").innerHTML=a},setType:function(a){a=a||"info";var b=this.getDom("body");b.className=b.className.replace(/edui-message-type-[\w-]+/,"edui-message-type-"+a); -},getContent:function(){return this.getDom("content").innerHTML},getType:function(){var a=this.getDom("body").match(/edui-message-type-([\w-]+)/);return a?a[1]:""},show:function(){this.getDom().style.display="block"},hide:function(){var a=this.getDom();a&&(a.style.display="none",a.parentNode&&a.parentNode.removeChild(a))}},a.inherits(d,c)}(),function(a){function b(){var a,b;a=document.createElement("div"),a.innerHTML=c,c=null,b=a.getElementsByTagName("svg")[0],b&&(b.setAttribute("aria-hidden","true"),b.style.position="absolute",b.style.width=0,b.style.height=0,b.style.overflow="hidden",h(b,document.body))}var c='',d=function(){ -var a=document.getElementsByTagName("script");return a[a.length-1]}(),e=d.getAttribute("data-injectcss"),f=function(b){function c(a,b){var c=a.document,d=!1,e=function(){d||(d=!0,b())},f=function(){try{c.documentElement.doScroll("left")}catch(a){return void setTimeout(f,50)}e()};f(),c.onreadystatechange=function(){"complete"==c.readyState&&(c.onreadystatechange=null,e())}}if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(b,0);else{var d=function(){document.removeEventListener("DOMContentLoaded",d,!1),b()};document.addEventListener("DOMContentLoaded",d,!1)}else document.attachEvent&&c(a,b)},g=function(a,b){b.parentNode.insertBefore(a,b)},h=function(a,b){b.firstChild?g(a,b.firstChild):b.appendChild(a)};if(e&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(i){console&&console.log(i)}}f(b)}(window),function(){var a=baidu.editor.utils,b=baidu.editor.ui,c=b.Dialog;b.buttons={},b.Dialog=function(a){var b=new c(a);return b.addListener("hide",function(){if(b.editor){var a=b.editor;try{if(browser.gecko){var c=a.window.scrollY,d=a.window.scrollX;a.body.focus(),a.window.scrollTo(d,c)}else a.focus()}catch(e){}}}),b};for(var d,e={anchor:"~/dialogs/anchor/anchor.html",insertimage:"~/dialogs/image/image.html",link:"~/dialogs/link/link.html",spechars:"~/dialogs/spechars/spechars.html",searchreplace:"~/dialogs/searchreplace/searchreplace.html",map:"~/dialogs/map/map.html",gmap:"~/dialogs/gmap/gmap.html",insertvideo:"~/dialogs/video/video.html",help:"~/dialogs/help/help.html",preview:"~/dialogs/preview/preview.html",emotion:"~/dialogs/emotion/emotion.html",wordimage:"~/dialogs/wordimage/wordimage.html",attachment:"~/dialogs/attachment/attachment.html",insertframe:"~/dialogs/insertframe/insertframe.html",edittip:"~/dialogs/table/edittip.html",edittable:"~/dialogs/table/edittable.html",edittd:"~/dialogs/table/edittd.html",webapp:"~/dialogs/webapp/webapp.html",snapscreen:"~/dialogs/snapscreen/snapscreen.html",scrawl:"~/dialogs/scrawl/scrawl.html",music:"~/dialogs/music/music.html",template:"~/dialogs/template/template.html",background:"~/dialogs/background/background.html",charts:"~/dialogs/charts/charts.html"},f=["undo","redo","formatmatch","bold","italic","underline","fontborder","touppercase","tolowercase","strikethrough","subscript","superscript","source","indent","outdent","blockquote","pasteplain","pagebreak","selectall","print","horizontal","removeformat","time","date","unlink","insertparagraphbeforetable","insertrow","insertcol","mergeright","mergedown","deleterow","deletecol","splittorows","splittocols","splittocells","mergecells","deletetable","drafts"],g=0;d=f[g++];)d=d.toLowerCase(),b[d]=function(a){return function(c){var d=new b.Button({className:"edui-for-"+a,title:c.options.labelMap[a]||c.getLang("labelMap."+a)||"",onclick:function(){c.execCommand(a)},theme:c.options.theme,showText:!1});return b.buttons[a]=d,c.addListener("selectionchange",function(b,e,f){var g=c.queryCommandState(a);g==-1?(d.setDisabled(!0),d.setChecked(!1)):f||(d.setDisabled(!1),d.setChecked(g))}),d}}(d);b.cleardoc=function(a){var c=new b.Button({className:"edui-for-cleardoc",title:a.options.labelMap.cleardoc||a.getLang("labelMap.cleardoc")||"",theme:a.options.theme,onclick:function(){confirm(a.getLang("confirmClear"))&&a.execCommand("cleardoc")}});return b.buttons.cleardoc=c,a.addListener("selectionchange",function(){c.setDisabled(a.queryCommandState("cleardoc")==-1)}),c};var h={justify:["left","right","center","justify"],imagefloat:["none","left","center","right"],directionality:["ltr","rtl"]};for(var i in h)!function(a,c){for(var d,e=0;d=c[e++];)!function(c){b[a.replace("float","")+c]=function(d){var e=new b.Button({className:"edui-for-"+a.replace("float","")+c,title:d.options.labelMap[a.replace("float","")+c]||d.getLang("labelMap."+a.replace("float","")+c)||"",theme:d.options.theme,onclick:function(){d.execCommand(a,c)}});return b.buttons[a]=e,d.addListener("selectionchange",function(b,f,g){e.setDisabled(d.queryCommandState(a)==-1),e.setChecked(d.queryCommandValue(a)==c&&!g)}),e}}(d)}(i,h[i]);for(var d,g=0;d=["backcolor","forecolor"][g++];)b[d]=function(a){return function(c){var d=new b.ColorButton({className:"edui-for-"+a,color:"default",title:c.options.labelMap[a]||c.getLang("labelMap."+a)||"",editor:c,onpickcolor:function(b,d){c.execCommand(a,d)},onpicknocolor:function(){c.execCommand(a,"default"),this.setColor("transparent"),this.color="default"},onbuttonclick:function(){c.execCommand(a,this.color)}});return b.buttons[a]=d,c.addListener("selectionchange",function(){d.setDisabled(c.queryCommandState(a)==-1)}),d}}(d);var j={noOk:["searchreplace","help","spechars","webapp","preview"],ok:["attachment","anchor","link","insertimage","map","gmap","insertframe","wordimage","insertvideo","insertframe","edittip","edittable","edittd","scrawl","template","music","background","charts"]};for(var i in j)!function(c,d){for(var f,g=0;f=d[g++];)browser.opera&&"searchreplace"===f||!function(d){b[d]=function(f,g,h){g=g||(f.options.iframeUrlMap||{})[d]||e[d],h=f.options.labelMap[d]||f.getLang("labelMap."+d)||"";var i;g&&(i=new b.Dialog(a.extend({iframeUrl:f.ui.mapUrl(g),editor:f,className:"edui-for-"+d,title:h,holdScroll:"insertimage"===d,fullscreen:/charts|preview/.test(d),closeDialog:f.getLang("closeDialog")},"ok"==c?{buttons:[{className:"edui-okbutton",label:f.getLang("ok"),editor:f,onclick:function(){i.close(!0)}},{className:"edui-cancelbutton",label:f.getLang("cancel"),editor:f,onclick:function(){i.close(!1)}}]}:{})),f.ui._dialogs[d+"Dialog"]=i);var j=new b.Button({className:"edui-for-"+d,title:h,onclick:function(){if(i)switch(d){case"wordimage":var a=f.execCommand("wordimage");a&&a.length&&(i.render(),i.open());break;case"scrawl":f.queryCommandState("scrawl")!=-1&&(i.render(),i.open());break;default:i.render(),i.open()}},theme:f.options.theme,disabled:"scrawl"==d&&f.queryCommandState("scrawl")==-1||"charts"==d});return b.buttons[d]=j,f.addListener("selectionchange",function(){var a={edittable:1};if(!(d in a)){var b=f.queryCommandState(d);j.getDom()&&(j.setDisabled(b==-1),j.setChecked(b))}}),j}}(f.toLowerCase())}(i,j[i]);b.snapscreen=function(a,c,d){d=a.options.labelMap.snapscreen||a.getLang("labelMap.snapscreen")||"";var f=new b.Button({className:"edui-for-snapscreen",title:d,onclick:function(){a.execCommand("snapscreen")},theme:a.options.theme});if(b.buttons.snapscreen=f,c=c||(a.options.iframeUrlMap||{}).snapscreen||e.snapscreen){var g=new b.Dialog({iframeUrl:a.ui.mapUrl(c),editor:a,className:"edui-for-snapscreen",title:d,buttons:[{className:"edui-okbutton",label:a.getLang("ok"),editor:a,onclick:function(){g.close(!0)}},{className:"edui-cancelbutton",label:a.getLang("cancel"),editor:a,onclick:function(){g.close(!1)}}]});g.render(),a.ui._dialogs.snapscreenDialog=g}return a.addListener("selectionchange",function(){f.setDisabled(a.queryCommandState("snapscreen")==-1)}),f},b.insertcode=function(c,d,e){d=c.options.insertcode||[],e=c.options.labelMap.insertcode||c.getLang("labelMap.insertcode")||"";var f=[];a.each(d,function(a,b){f.push({label:a,value:b,theme:c.options.theme,renderLabelHtml:function(){return'
                      '+(this.label||"")+"
                      "}})});var g=new b.Combox({editor:c,items:f,onselect:function(a,b){c.execCommand("insertcode",this.items[b].value)},onbuttonclick:function(){this.showPopup()},title:e,initValue:e,className:"edui-for-insertcode",indexByValue:function(a){if(a)for(var b,c=0;b=this.items[c];c++)if(b.value.indexOf(a)!=-1)return c;return-1}});return b.buttons.insertcode=g,c.addListener("selectionchange",function(a,b,d){if(!d){var f=c.queryCommandState("insertcode");if(f==-1)g.setDisabled(!0);else{g.setDisabled(!1);var h=c.queryCommandValue("insertcode");if(!h)return void g.setValue(e);h&&(h=h.replace(/['"]/g,"").split(",")[0]),g.setValue(h)}}}),g},b.fontfamily=function(c,d,e){if(d=c.options.fontfamily||[],e=c.options.labelMap.fontfamily||c.getLang("labelMap.fontfamily")||"",d.length){for(var f,g=0,h=[];f=d[g];g++){var i=c.getLang("fontfamily")[f.name]||"";!function(b,d){h.push({label:b,value:d,theme:c.options.theme,renderLabelHtml:function(){return'
                      '+(this.label||"")+"
                      "}})}(f.label||i,f.val)}var j=new b.Combox({editor:c,items:h,onselect:function(a,b){c.execCommand("FontFamily",this.items[b].value)},onbuttonclick:function(){this.showPopup()},title:e,initValue:e,className:"edui-for-fontfamily",indexByValue:function(a){if(a)for(var b,c=0;b=this.items[c];c++)if(b.value.indexOf(a)!=-1)return c;return-1}});return b.buttons.fontfamily=j,c.addListener("selectionchange",function(a,b,d){if(!d){var e=c.queryCommandState("FontFamily");if(e==-1)j.setDisabled(!0);else{j.setDisabled(!1);var f=c.queryCommandValue("FontFamily");f&&(f=f.replace(/['"]/g,"").split(",")[0]),j.setValue(f)}}}),j}},b.fontsize=function(a,c,d){if(d=a.options.labelMap.fontsize||a.getLang("labelMap.fontsize")||"",c=c||a.options.fontsize||[],c.length){for(var e=[],f=0;f'+(this.label||"")+""}})}var h=new b.Combox({editor:a,items:e,title:d,initValue:d,onselect:function(b,c){a.execCommand("FontSize",this.items[c].value)},onbuttonclick:function(){this.showPopup()},className:"edui-for-fontsize"});return b.buttons.fontsize=h,a.addListener("selectionchange",function(b,c,d){if(!d){var e=a.queryCommandState("FontSize");e==-1?h.setDisabled(!0):(h.setDisabled(!1),h.setValue(a.queryCommandValue("FontSize")))}}),h}},b.paragraph=function(c,d,e){if(e=c.options.labelMap.paragraph||c.getLang("labelMap.paragraph")||"",d=c.options.paragraph||[],!a.isEmptyObject(d)){var f=[];for(var g in d)f.push({value:g,label:d[g]||c.getLang("paragraph")[g],theme:c.options.theme,renderLabelHtml:function(){return'
                      '+(this.label||"")+"
                      "}});var h=new b.Combox({editor:c,items:f,title:e,initValue:e,className:"edui-for-paragraph",onselect:function(a,b){c.execCommand("Paragraph",this.items[b].value)},onbuttonclick:function(){this.showPopup()}});return b.buttons.paragraph=h,c.addListener("selectionchange",function(a,b,d){if(!d){var e=c.queryCommandState("Paragraph");if(e==-1)h.setDisabled(!0);else{h.setDisabled(!1);var f=c.queryCommandValue("Paragraph"),g=h.indexByValue(f);g!=-1?h.setValue(f):h.setValue(h.initValue)}}}),h}},b.customstyle=function(a){var c=a.options.customstyle||[],d=a.options.labelMap.customstyle||a.getLang("labelMap.customstyle")||"";if(c.length){for(var e,f=a.getLang("customstyle"),g=0,h=[];e=c[g++];)!function(b){var c={};c.label=b.label?b.label:f[b.name],c.style=b.style,c.className=b.className,c.tag=b.tag,h.push({label:c.label,value:c,theme:a.options.theme,renderLabelHtml:function(){return'
                      <'+c.tag+" "+(c.className?' class="'+c.className+'"':"")+(c.style?' style="'+c.style+'"':"")+">"+c.label+"
                      "}})}(e);var i=new b.Combox({editor:a,items:h,title:d,initValue:d,className:"edui-for-customstyle",onselect:function(b,c){a.execCommand("customstyle",this.items[c].value)},onbuttonclick:function(){this.showPopup()},indexByValue:function(a){for(var b,c=0;b=this.items[c++];)if(b.label==a)return c-1;return-1}});return b.buttons.customstyle=i,a.addListener("selectionchange",function(b,c,d){if(!d){var e=a.queryCommandState("customstyle");if(e==-1)i.setDisabled(!0);else{i.setDisabled(!1);var f=a.queryCommandValue("customstyle"),g=i.indexByValue(f);g!=-1?i.setValue(f):i.setValue(i.initValue)}}}),i}},b.inserttable=function(a,c,d){d=a.options.labelMap.inserttable||a.getLang("labelMap.inserttable")||"";var e=new b.TableButton({editor:a,title:d,className:"edui-for-inserttable",onpicktable:function(b,c,d){a.execCommand("InsertTable",{numRows:d,numCols:c,border:1})},onbuttonclick:function(){this.showPopup()}});return b.buttons.inserttable=e,a.addListener("selectionchange",function(){e.setDisabled(a.queryCommandState("inserttable")==-1)}),e},b.lineheight=function(a){var c=a.options.lineheight||[];if(c.length){for(var d,e=0,f=[];d=c[e++];)f.push({label:d,value:d,theme:a.options.theme,onclick:function(){a.execCommand("lineheight",this.value)}});var g=new b.MenuButton({editor:a,className:"edui-for-lineheight",title:a.options.labelMap.lineheight||a.getLang("labelMap.lineheight")||"",items:f,onbuttonclick:function(){var b=a.queryCommandValue("LineHeight")||this.value;a.execCommand("LineHeight",b)}});return b.buttons.lineheight=g,a.addListener("selectionchange",function(){var b=a.queryCommandState("LineHeight");if(b==-1)g.setDisabled(!0);else{g.setDisabled(!1);var c=a.queryCommandValue("LineHeight");c&&g.setValue((c+"").replace(/cm/,"")),g.setChecked(b)}}),g}};for(var k,l=["top","bottom"],m=0;k=l[m++];)!function(a){b["rowspacing"+a]=function(c){var d=c.options["rowspacing"+a]||[];if(!d.length)return null;for(var e,f=0,g=[];e=d[f++];)g.push({label:e,value:e,theme:c.options.theme,onclick:function(){c.execCommand("rowspacing",this.value,a)}});var h=new b.MenuButton({editor:c,className:"edui-for-rowspacing"+a,title:c.options.labelMap["rowspacing"+a]||c.getLang("labelMap.rowspacing"+a)||"",items:g,onbuttonclick:function(){var b=c.queryCommandValue("rowspacing",a)||this.value;c.execCommand("rowspacing",b,a)}});return b.buttons[a]=h,c.addListener("selectionchange",function(){var b=c.queryCommandState("rowspacing",a);if(b==-1)h.setDisabled(!0);else{h.setDisabled(!1);var d=c.queryCommandValue("rowspacing",a);d&&h.setValue((d+"").replace(/%/,"")),h.setChecked(b)}}),h}}(k);for(var n,o=["insertorderedlist","insertunorderedlist"],p=0;n=o[p++];)!function(a){b[a]=function(c){var d=c.options[a],e=function(){c.execCommand(a,this.value)},f=[];for(var g in d)f.push({label:d[g]||c.getLang()[a][g]||"",value:g,theme:c.options.theme,onclick:e});var h=new b.MenuButton({editor:c,className:"edui-for-"+a,title:c.getLang("labelMap."+a)||"",items:f,onbuttonclick:function(){var b=c.queryCommandValue(a)||this.value;c.execCommand(a,b)}});return b.buttons[a]=h,c.addListener("selectionchange",function(){var b=c.queryCommandState(a);if(b==-1)h.setDisabled(!0);else{h.setDisabled(!1);var d=c.queryCommandValue(a);h.setValue(d),h.setChecked(b)}}),h}}(n);b.fullscreen=function(a,c){c=a.options.labelMap.fullscreen||a.getLang("labelMap.fullscreen")||"";var d=new b.Button({className:"edui-for-fullscreen",title:c,theme:a.options.theme,onclick:function(){a.ui&&a.ui.setFullScreen(!a.ui.isFullScreen()),this.setChecked(a.ui.isFullScreen())}});return b.buttons.fullscreen=d,a.addListener("selectionchange",function(){var b=a.queryCommandState("fullscreen");d.setDisabled(b==-1),d.setChecked(a.ui.isFullScreen())}),d},b.emotion=function(a,c){var d="emotion",f=new b.MultiMenuPop({title:a.options.labelMap[d]||a.getLang("labelMap."+d)||"",editor:a,className:"edui-for-"+d,iframeUrl:a.ui.mapUrl(c||(a.options.iframeUrlMap||{})[d]||e[d])});return b.buttons[d]=f,a.addListener("selectionchange",function(){f.setDisabled(a.queryCommandState(d)==-1)}),f},b.autotypeset=function(a){var c=new b.AutoTypeSetButton({editor:a,title:a.options.labelMap.autotypeset||a.getLang("labelMap.autotypeset")||"",className:"edui-for-autotypeset",onbuttonclick:function(){a.execCommand("autotypeset")}});return b.buttons.autotypeset=c,a.addListener("selectionchange",function(){c.setDisabled(a.queryCommandState("autotypeset")==-1)}),c},b.simpleupload=function(a){var c="simpleupload",d=new b.Button({className:"edui-for-"+c,title:a.options.labelMap[c]||a.getLang("labelMap."+c)||"",onclick:function(){},theme:a.options.theme,showText:!1});return b.buttons[c]=d,a.addListener("ready",function(){var b=d.getDom("body"),c=b.children[0];a.fireEvent("simpleuploadbtnready",c)}),a.addListener("selectionchange",function(b,e,f){var g=a.queryCommandState(c);g==-1?(d.setDisabled(!0),d.setChecked(!1)):f||(d.setDisabled(!1),d.setChecked(g))}),d}}(),function(){function a(a){this.initOptions(a),this.initEditorUI()}var b=baidu.editor.utils,c=baidu.editor.ui.uiUtils,d=baidu.editor.ui.UIBase,e=baidu.editor.dom.domUtils,f=[];a.prototype={uiName:"editor",initEditorUI:function(){function a(a,b){a.setOpt({wordCount:!0,maximumWords:1e4,wordCountMsg:a.options.wordCountMsg||a.getLang("wordCountMsg"),wordOverFlowMsg:a.options.wordOverFlowMsg||a.getLang("wordOverFlowMsg")});var c=a.options,d=c.maximumWords,e=c.wordCountMsg,f=c.wordOverFlowMsg,g=b.getDom("wordcount");if(c.wordCount){var h=a.getContentLength(!0);h>d?(g.innerHTML=f,a.fireEvent("wordcountoverflow")):g.innerHTML=e.replace("{#leave}",d-h).replace("{#count}",h)}}this.editor.ui=this,this._dialogs={},this.initUIBase(),this._initToolbars();var b=this.editor,c=this;b.addListener("ready",function(){function d(){a(b,c),e.un(b.document,"click",arguments.callee)}b.getDialog=function(a){return b.ui._dialogs[a+"Dialog"]},e.on(b.window,"scroll",function(a){baidu.editor.ui.Popup.postHide(a)}),b.ui._actualFrameWidth=b.options.initialFrameWidth,UE.browser.ie&&6===UE.browser.version&&b.container.ownerDocument.execCommand("BackgroundImageCache",!1,!0),b.options.elementPathEnabled&&(b.ui.getDom("elementpath").innerHTML='
                      '+b.getLang("elementPathTip")+":
                      "),b.options.wordCount&&(e.on(b.document,"click",d),b.ui.getDom("wordcount").innerHTML=b.getLang("wordCountTip")),b.ui._scale(),b.options.scaleEnabled?(b.autoHeightEnabled&&b.disableAutoHeight(),c.enableScale()):c.disableScale(),b.options.elementPathEnabled||b.options.wordCount||b.options.scaleEnabled||(b.ui.getDom("elementpath").style.display="none",b.ui.getDom("wordcount").style.display="none",b.ui.getDom("scale").style.display="none"),b.selection.isFocus()&&b.fireEvent("selectionchange",!1,!0)}),b.addListener("mousedown",function(a,b){var c=b.target||b.srcElement;baidu.editor.ui.Popup.postHide(b,c),baidu.editor.ui.ShortCutMenu.postHide(b)}),b.addListener("delcells",function(){UE.ui.edittip&&new UE.ui.edittip(b),b.getDialog("edittip").open()});var d,f,g=!1;b.addListener("afterpaste",function(){b.queryCommandState("pasteplain")||(baidu.editor.ui.PastePicker&&(d=new baidu.editor.ui.Popup({content:new baidu.editor.ui.PastePicker({editor:b}),editor:b,className:"edui-wordpastepop"}),d.render()),g=!0)}),b.addListener("afterinserthtml",function(){clearTimeout(f),f=setTimeout(function(){if(d&&(g||b.ui._isTransfer)){if(d.isHidden()){var a=e.createElement(b.document,"span",{style:"line-height:0px;",innerHTML:"\ufeff"}),c=b.selection.getRange();c.insertNode(a);var f=getDomNode(a,"firstChild","previousSibling");f&&d.showAnchor(3==f.nodeType?f.parentNode:f),e.remove(a)}else d.show();delete b.ui._isTransfer,g=!1}},200)}),b.addListener("contextmenu",function(a,b){baidu.editor.ui.Popup.postHide(b)}),b.addListener("keydown",function(a,b){d&&d.dispose(b);var c=b.keyCode||b.which;b.altKey&&90==c&&UE.ui.buttons.fullscreen.onclick()}),b.addListener("wordcount",function(b){a(this,c)}),b.addListener("selectionchange",function(){b.options.elementPathEnabled&&c[(b.queryCommandState("elementpath")==-1?"dis":"en")+"ableElementPath"](),b.options.scaleEnabled&&c[(b.queryCommandState("scale")==-1?"dis":"en")+"ableScale"]()});var h=new baidu.editor.ui.Popup({editor:b,content:"",className:"edui-bubble",_onEditButtonClick:function(){this.hide(),b.ui._dialogs.linkDialog.open()},_onImgEditButtonClick:function(a){this.hide(),b.ui._dialogs[a]&&b.ui._dialogs[a].open()},_onImgSetFloat:function(a){this.hide(),b.execCommand("imagefloat",a)},_setIframeAlign:function(a){var b=h.anchorEl,c=b.cloneNode(!0);switch(a){case-2:c.setAttribute("align","");break;case-1:c.setAttribute("align","left");break;case 1:c.setAttribute("align","right")}b.parentNode.insertBefore(c,b),e.remove(b),h.anchorEl=c,h.showAnchor(h.anchorEl)},_updateIframe:function(){var a=b._iframe=h.anchorEl;e.hasClass(a,"ueditor_baidumap")?(b.selection.getRange().selectNode(a).select(),b.ui._dialogs.mapDialog.open(),h.hide()):(b.ui._dialogs.insertframeDialog.open(),h.hide())},_onRemoveButtonClick:function(a){b.execCommand(a),this.hide()},queryAutoHide:function(a){return a&&a.ownerDocument==b.document&&("img"==a.tagName.toLowerCase()||e.findParentByTagName(a,"a",!0))?a!==h.anchorEl:baidu.editor.ui.Popup.prototype.queryAutoHide.call(this,a)}});h.render(),b.options.imagePopup&&(b.addListener("mouseover",function(a,c){c=c||window.event;var d=c.target||c.srcElement;if(b.ui._dialogs.insertframeDialog&&/iframe/gi.test(d.tagName)){var e=h.formatHtml(""+b.getLang("property")+': '+b.getLang("default")+'  '+b.getLang("justifyleft")+'  '+b.getLang("justifyright")+'   '+b.getLang("modify")+"");e?(h.getDom("content").innerHTML=e,h.anchorEl=d,h.showAnchor(h.anchorEl)):h.hide()}}),b.addListener("selectionchange",function(a,c){if(c){var d="",f="",g=b.selection.getRange().getClosedNode(),i=b.ui._dialogs;if(g&&"IMG"==g.tagName){var j="insertimageDialog";if(g.className.indexOf("edui-faked-video")==-1&&g.className.indexOf("edui-upload-video")==-1||(j="insertvideoDialog"),g.className.indexOf("edui-faked-webapp")!=-1&&(j="webappDialog"),g.src.indexOf("https://api.map.baidu.com")!=-1&&(j="mapDialog"),g.className.indexOf("edui-faked-music")!=-1&&(j="musicDialog"),g.src.indexOf("http://maps.google.com/maps/api/staticmap")!=-1&&(j="gmapDialog"),g.getAttribute("anchorname")&&(j="anchorDialog",d=h.formatHtml(""+b.getLang("property")+': '+b.getLang("modify")+"  "+b.getLang("delete")+"")),g.getAttribute("word_img")&&(b.word_img=[g.getAttribute("word_img")],j="wordimageDialog"),(e.hasClass(g,"loadingclass")||e.hasClass(g,"loaderrorclass"))&&(j=""),!i[j])return;f=""+b.getLang("property")+': '+b.getLang("default")+'  '+b.getLang("justifyleft")+'  '+b.getLang("justifyright")+'  '+b.getLang("justifycenter")+"  '+b.getLang("modify")+"",!d&&(d=h.formatHtml(f))}if(b.ui._dialogs.linkDialog){var k,l=b.queryCommandValue("link");if(l&&(k=l.getAttribute("_href")||l.getAttribute("href",2))){var m=k;k.length>30&&(m=k.substring(0,20)+"..."),d&&(d+='
                      '),d+=h.formatHtml(""+b.getLang("anthorMsg")+': '+m+' '+b.getLang("modify")+' '+b.getLang("clear")+""),h.showAnchor(l)}}d?(h.getDom("content").innerHTML=d,h.anchorEl=g||l,h.showAnchor(h.anchorEl)):h.hide()}}))},_initToolbars:function(){for(var a=this.editor,c=this.toolbars||[],d=[],e=[],f=0;f
                      '+(this.toolbars.length?'
                      '+this.renderToolbarBoxHtml()+"
                      ":"")+'
                      '},showWordImageDialog:function(){this._dialogs.wordimageDialog.open()},renderToolbarBoxHtml:function(){for(var a=[],b=0;b'+c+"");b.innerHTML='
                      '+this.editor.getLang("elementPathTip")+": "+d.join(" > ")+"
                      "}else b.style.display="none"},disableElementPath:function(){var a=this.getDom("elementpath");a.innerHTML="",a.style.display="none",this.elementPathEnabled=!1},enableElementPath:function(){var a=this.getDom("elementpath");a.style.display="",this.elementPathEnabled=!0,this._updateElementPath()},_scale:function(){function a(){o=e.getXY(h),p||(p=g.options.minFrameHeight+j.offsetHeight+k.offsetHeight),m.style.cssText="position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:"+h.offsetWidth+"px;height:"+h.offsetHeight+"px;z-index:"+(g.options.zIndex+1),e.on(f,"mousemove",b),e.on(i,"mouseup",c),e.on(f,"mouseup",c)}function b(a){d();var b=a||window.event;r=b.pageX||f.documentElement.scrollLeft+b.clientX,s=b.pageY||f.documentElement.scrollTop+b.clientY,t=r-o.x,u=s-o.y,t>=q&&(n=!0,m.style.width=t+"px"),u>=p&&(n=!0,m.style.height=u+"px")}function c(){n&&(n=!1,g.ui._actualFrameWidth=m.offsetWidth-2,h.style.width=g.ui._actualFrameWidth+"px",g.setHeight(m.offsetHeight-k.offsetHeight-j.offsetHeight-2,!0)),m&&(m.style.display="none"),d(),e.un(f,"mousemove",b),e.un(i,"mouseup",c),e.un(f,"mouseup",c)}function d(){browser.ie?f.selection.clear():window.getSelection().removeAllRanges()}var f=document,g=this.editor,h=g.container,i=g.document,j=this.getDom("toolbarbox"),k=this.getDom("bottombar"),l=this.getDom("scale"),m=this.getDom("scalelayer"),n=!1,o=null,p=0,q=g.options.minFrameWidth,r=0,s=0,t=0,u=0,v=this;this.editor.addListener("fullscreenchanged",function(a,b){if(b)v.disableScale();else if(v.editor.options.scaleEnabled){v.enableScale();var c=v.editor.document.createElement("span");v.editor.body.appendChild(c),v.editor.body.style.height=Math.max(e.getXY(c).y,v.editor.iframe.offsetHeight-20)+"px",e.remove(c)}}),this.enableScale=function(){1!=g.queryCommandState("source")&&(l.style.display="",this.scaleEnabled=!0,e.on(l,"mousedown",a))},this.disableScale=function(){l.style.display="none",this.scaleEnabled=!1,e.un(l,"mousedown",a)}},isFullScreen:function(){return this._fullscreen},postRender:function(){d.prototype.postRender.call(this);for(var a=0;a[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+[\n\r\t]+<"),c.className&&(b.className=c.className),c.style.cssText&&(b.style.cssText=c.style.cssText),/textarea/i.test(c.tagName)?(d.textarea=c,d.textarea.style.display="none"):c.parentNode.removeChild(c),c.id&&(b.id=c.id,e.removeAttributes(c,"id")),c=b,c.innerHTML=""}e.addClass(c,"edui-"+d.options.theme),d.ui.render(c);var h=d.options;d.container=d.ui.getDom();for(var i,j=e.findParents(c,!0),k=[],l=0;i=j[l];l++)k[l]=i.style.display,i.style.display="block";if(h.initialFrameWidth)h.minFrameWidth=h.initialFrameWidth;else{h.minFrameWidth=h.initialFrameWidth=c.offsetWidth;var m=c.style.width;/%$/.test(m)&&(h.initialFrameWidth=m)}h.initialFrameHeight?h.minFrameHeight=h.initialFrameHeight:h.initialFrameHeight=h.minFrameHeight=c.offsetHeight;for(var i,l=0;i=j[l];l++)i.style.display=k[l];c.style.height&&(c.style.height=""),d.container.style.width=h.initialFrameWidth+(/%$/.test(h.initialFrameWidth)?"":"px"),d.container.style.zIndex=h.zIndex,f.call(d,d.ui.getDom("iframeholder")),d.fireEvent("afteruiready")}d.langIsReady?b():d.addListener("langReady",b)})},d},UE.getEditor=function(a,b){var c=g[a];return c||(c=g[a]=new UE.ui.Editor(b),c.render(a)),c},UE.delEditor=function(a){var b;(b=g[a])&&(b.key&&b.destroy(),delete g[a])},UE.registerUI=function(a,c,d,e){b.each(a.split(/\s+/),function(a){baidu.editor.ui[a]={id:e,execFn:c,index:d}})}}(),UE.registerUI("message",function(a){function b(){if(c&&g.ui){var a=g.ui.getDom("toolbarbox");a&&(c.style.top=a.offsetHeight+3+"px"),c.style.zIndex=Math.max(g.options.zIndex,g.iframe.style.zIndex)+1}}var c,d=baidu.editor.ui,e=d.Message,f=[],g=a;g.setOpt("enableMessageShow",!0),g.getOpt("enableMessageShow")!==!1&&(g.addListener("ready",function(){c=document.getElementById(g.ui.id+"_message_holder"),b(),setTimeout(function(){b()},500)}),g.addListener("showmessage",function(a,d){d=utils.isString(d)?{content:d}:d;var h=new e({timeout:d.timeout,type:d.type,content:d.content,keepshow:d.keepshow,editor:g}),i=d.id||"msg_"+(+new Date).toString(36);return h.render(c),f[i]=h,h.reset(d),b(),i}),g.addListener("updatemessage",function(a,b,d){d=utils.isString(d)?{content:d}:d;var e=f[b];e.render(c),e&&e.reset(d)}),g.addListener("hidemessage",function(a,b){var c=f[b];c&&c.hide()}))}),UE.registerUI("autosave",function(a){var b=null,c=null;a.on("afterautosave",function(){clearTimeout(b),b=setTimeout(function(){c&&a.trigger("hidemessage",c),c=a.trigger("showmessage",{content:a.getLang("autosave.success"),timeout:2e3})},2e3)})})}(); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.config.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.config.js deleted file mode 100644 index 77d0aaed679505c89e00a0377a2184cdc5ff46da..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.config.js +++ /dev/null @@ -1,604 +0,0 @@ -/** - * neditor完整配置项 - * 可以在这里配置整个编辑器的特性 - */ -/**************************提示******************************** - * 所有被注释的配置项均为UEditor默认值。 - * 修改默认配置请首先确保已经完全明确该参数的真实用途。 - * 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。 - * 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。 - **************************提示********************************/ - -(function () { - /** - * 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。 - * 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。 - * "相对于网站根目录的相对路径"也就是以斜杠开头的形如"/myProject/neditor/"这样的路径。 - * 如果站点中有多个不在同一层级的页面需要实例化编辑器,且引用了同一UEditor的时候,此处的URL可能不适用于每个页面的编辑器。 - * 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。 - * window.UEDITOR_HOME_URL = "/xxxx/xxxx/"; - */ - var URL = window.UEDITOR_HOME_URL || getUEBasePath(); - - /** - * 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。 - */ - window.UEDITOR_CONFIG = { - videoAllowFiles: [ - ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", - ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"], - //为编辑器实例添加一个路径,这个不能被注释 - UEDITOR_HOME_URL: URL, - - // 服务器统一请求接口路径 - //serverUrl: window.NEDITOR_UPLOAD || URL + "php/controller.php", - serverUrl: "/fileUploads/ueditor/upload/file", - imageActionName: "uploadimage", - scrawlActionName: "uploadscrawl", - videoActionName: "uploadvideo", - fileActionName: "uploadfile", - imageFieldName: "file", // 提交的图片表单名称 - imageMaxSize: 2048000, // 上传大小限制,单位B - imageUrlPrefix: "", - scrawlUrlPrefix: "", - videoUrlPrefix: "", - fileUrlPrefix: "", - catcherLocalDomain: "", - //工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义 - toolbars: [ - [ - "fullscreen", - "source", - "|", - "undo", - "redo", - "|", - "bold", - "italic", - "underline", - "fontborder", - "strikethrough", - "superscript", - "subscript", - "removeformat", - "formatmatch", - "autotypeset", - "blockquote", - "pasteplain", - "|", - "forecolor", - "backcolor", - "insertorderedlist", - "insertunorderedlist", - "selectall", - "cleardoc", - "|", - "rowspacingtop", - "rowspacingbottom", - "lineheight", - "|", - "customstyle", - "paragraph", - "fontfamily", - "fontsize", - "|", - "directionalityltr", - "directionalityrtl", - "indent", - "|", - "justifyleft", - "justifycenter", - "justifyright", - "justifyjustify", - "|", - "touppercase", - "tolowercase", - "|", - "link", - "unlink", - "anchor", - "|", - "imagenone", - "imageleft", - "imageright", - "imagecenter", - "|", - // "simpleupload", - "insertimage", - "emotion", - "scrawl", - "insertvideo", - "music", - "attachment", - "map", - "gmap", - "insertframe", - // "webapp", - "pagebreak", - "template", - "background", - "|", - "insertcode", - "horizontal", - "date", - "time", - "spechars", - "snapscreen", - "wordimage", - "|", - "inserttable", - "deletetable", - "insertparagraphbeforetable", - "insertrow", - "deleterow", - "insertcol", - "deletecol", - "mergecells", - "mergeright", - "mergedown", - "splittocells", - "splittorows", - "splittocols", - "charts", - "|", - "print", - "preview", - "searchreplace", - "drafts", - "help" - ] - ] - //当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准 - //,labelMap:{ - // 'anchor':'', 'undo':'' - //} - - //语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件: - //lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase() - //,lang:"zh-cn" - //,langPath:URL +"i18n/" - - //主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件: - //现有如下皮肤:default - , - theme: 'notadd' - //,themePath:URL +"themes/" - - , - zIndex: 1100 //编辑器层级的基数,默认是900 - - //针对getAllHtml方法,会在对应的head标签中增加该编码设置。 - //,charset:"utf-8" - - //若实例化编辑器的页面手动修改的domain,此处需要设置为true - //,customDomain:false - - //常用配置项目 - //,isShow : true //默认显示编辑器 - - //,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值 - - //,initialContent:'欢迎使用neditor!' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子 - - //,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了 - - //,focus:false //初始化时,是否让编辑器获得焦点true或false - - //如果自定义,最好给p标签如下的行高,要不输入中文时,会有跳动感 - //,initialStyle:'p{line-height:1em}'//编辑器层级的基数,可以用来改变字体等 - - //,iframeJsUrl: '' //给编辑区域的iframe引入一个js文件 - //,iframeCssUrl: URL + '/themes/iframe.css' //给编辑区域的iframe引入一个css文件 - - //indentValue - //首行缩进距离,默认是2em - //,indentValue:'2em' - - //,initialFrameWidth:1000 //初始化编辑器宽度,默认1000 - //,initialFrameHeight:320 //初始化编辑器高度,默认320 - - //,readonly : false //编辑器初始化结束后,编辑区域是否是只读的,默认是false - - //,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况) - - //启用自动保存 - //,enableAutoSave: true - //自动保存间隔时间, 单位ms - //,saveInterval: 500 - - //启用拖放上传 - //,enableDragUpload: true - //启用粘贴上传 - //,enablePasteUpload: true - - //启用图片拉伸缩放 - //,imageScaleEnabled: true - - //,fullscreen : false //是否开启初始化时即全屏,默认关闭 - - //,imagePopup:true //图片操作的浮层开关,默认打开 - - //,autoSyncData:true //自动同步编辑器要提交的数据 - //,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹 - - //粘贴只保留标签,去除标签所有属性 - //,retainOnlyLabelPasted: false - - //,pasteplain:false //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴 - //纯文本粘贴模式下的过滤规则 - //'filterTxtRules' : function(){ - // function transP(node){ - // node.tagName = 'p'; - // node.setStyle(); - // } - // return { - // //直接删除及其字节点内容 - // '-' : 'script style object iframe embed input select', - // 'p': {$:{}}, - // 'br':{$:{}}, - // 'div':{'$':{}}, - // 'li':{'$':{}}, - // 'caption':transP, - // 'th':transP, - // 'tr':transP, - // 'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP, - // 'td':function(node){ - // //没有内容的td直接删掉 - // var txt = !!node.innerText(); - // if(txt){ - // node.parentNode.insertAfter(UE.uNode.createText('    '),node); - // } - // node.parentNode.removeChild(node,node.innerText()) - // } - // } - //}() - - //,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串 - - //insertorderedlist - //有序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准 - //,'insertorderedlist':{ - // //自定的样式 - // 'num':'1,2,3...', - // 'num1':'1),2),3)...', - // 'num2':'(1),(2),(3)...', - // 'cn':'一,二,三....', - // 'cn1':'一),二),三)....', - // 'cn2':'(一),(二),(三)....', - // //系统自带 - // 'decimal' : '' , //'1,2,3...' - // 'lower-alpha' : '' , // 'a,b,c...' - // 'lower-roman' : '' , //'i,ii,iii...' - // 'upper-alpha' : '' , lang //'A,B,C' - // 'upper-roman' : '' //'I,II,III...' - //} - - //insertunorderedlist - //无序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准 - //,insertunorderedlist : { //自定的样式 - // 'dash' :'— 破折号', //-破折号 - // 'dot':' 。 小圆圈', //系统自带 - // 'circle' : '', // '○ 小圆圈' - // 'disc' : '', // '● 小圆点' - // 'square' : '' //'■ 小方块' - //} - //,listDefaultPaddingLeft : '30'//默认的左边缩进的基数倍 - //,listiconpath : 'http://bs.baidu.com/listicon/'//自定义标号的路径 - //,maxListLevel : 3 //限制可以tab的级数, 设置-1为不限制 - - //,autoTransWordToList:false //禁止word中粘贴进来的列表自动变成列表标签 - - //fontfamily - //字体设置 label留空支持多语言自动切换,若配置,则以配置值为准 - //,'fontfamily':[ - // { label:'',name:'songti',val:'宋体,SimSun'}, - // { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'}, - // { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'}, - // { label:'',name:'heiti',val:'黑体, SimHei'}, - // { label:'',name:'lishu',val:'隶书, SimLi'}, - // { label:'',name:'andaleMono',val:'andale mono'}, - // { label:'',name:'arial',val:'arial, helvetica,sans-serif'}, - // { label:'',name:'arialBlack',val:'arial black,avant garde'}, - // { label:'',name:'comicSansMs',val:'comic sans ms'}, - // { label:'',name:'impact',val:'impact,chicago'}, - // { label:'',name:'timesNewRoman',val:'times new roman'} - //] - - //fontsize - //字号 - //,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36] - - //paragraph - //段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准 - //,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''} - - //rowspacingtop - //段间距 值和显示的名字相同 - //,'rowspacingtop':['5', '10', '15', '20', '25'] - - //rowspacingBottom - //段间距 值和显示的名字相同 - //,'rowspacingbottom':['5', '10', '15', '20', '25'] - - //lineheight - //行内间距 值和显示的名字相同 - //,'lineheight':['1', '1.5','1.75','2', '3', '4', '5'] - - //customstyle - //自定义样式,不支持国际化,此处配置值即可最后显示值 - //block的元素是依据设置段落的逻辑设置的,inline的元素依据BIU的逻辑设置 - //尽量使用一些常用的标签 - //参数说明 - //tag 使用的标签名字 - //label 显示的名字也是用来标识不同类型的标识符,注意这个值每个要不同, - //style 添加的样式 - //每一个对象就是一个自定义的样式 - //,'customstyle':[ - // {tag:'h1', name:'tc', label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'}, - // {tag:'h1', name:'tl',label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;margin:0 0 10px 0;'}, - // {tag:'span',name:'im', label:'', style:'font-style:italic;font-weight:bold'}, - // {tag:'span',name:'hi', label:'', style:'font-style:italic;font-weight:bold;color:rgb(51, 153, 204)'} - //] - - //打开右键菜单功能 - //,enableContextMenu: true - //右键菜单的内容,可以参考plugins/contextmenu.js里边的默认菜单的例子,label留空支持国际化,否则以此配置为准 - //,contextMenu:[ - // { - // label:'', //显示的名称 - // cmdName:'selectall',//执行的command命令,当点击这个右键菜单时 - // //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName - // exec:function () { - // //this是当前编辑器的实例 - // //this.ui._dialogs['inserttableDialog'].open(); - // } - // } - //] - - //快捷菜单 - //,shortcutMenu:["fontfamily", "fontsize", "bold", "italic", "underline", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist"] - - //elementPathEnabled - //是否启用元素路径,默认是显示 - //,elementPathEnabled : true - - //wordCount - //,wordCount:true //是否开启字数统计 - //,maximumWords:10000 //允许的最大字符数 - //字数统计提示,{#count}代表当前字数,{#leave}代表还可以输入多少字符数,留空支持多语言自动切换,否则按此配置显示 - //,wordCountMsg:'' //当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符 - //超出字数限制提示 留空支持多语言自动切换,否则按此配置显示 - //,wordOverFlowMsg:'' //你输入的字符个数已经超出最大允许值,服务器可能会拒绝保存! - - //tab - //点击tab键时移动的距离,tabSize倍数,tabNode什么字符做为单位 - //,tabSize:4 - //,tabNode:' ' - - //removeFormat - //清除格式时可以删除的标签和属性 - //removeForamtTags标签 - //,removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var' - //removeFormatAttributes属性 - //,removeFormatAttributes:'class,style,lang,width,height,align,hspace,valign' - - //undo - //可以最多回退的次数,默认20 - //,maxUndoCount:20 - //当输入的字符数超过该值时,保存一次现场 - //,maxInputCount:1 - - //autoHeightEnabled - // 是否自动长高,默认true - , - autoHeightEnabled: false - - //scaleEnabled - //是否可以拉伸长高,默认true(当开启时,自动长高失效) - //,scaleEnabled:false - //,minFrameWidth:800 //编辑器拖动时最小宽度,默认800 - //,minFrameHeight:220 //编辑器拖动时最小高度,默认220 - - //autoFloatEnabled - //是否保持toolbar的位置不动,默认true - //,autoFloatEnabled:true - //浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面 - //,topOffset:30 - //编辑器底部距离工具栏高度(如果参数大于等于编辑器高度,则设置无效) - //,toolbarTopOffset:400 - - //设置远程图片是否抓取到本地保存 - //,catchRemoteImageEnable: true //设置是否抓取远程图片 - - //pageBreakTag - //分页标识符,默认是_neditor_page_break_tag_ - //,pageBreakTag:'_neditor_page_break_tag_' - - //autotypeset - //自动排版参数 - //,autotypeset: { - // mergeEmptyline: true, //合并空行 - // removeClass: true, //去掉冗余的class - // removeEmptyline: false, //去掉空行 - // textAlign:"left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版 - // imageBlockLine: 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版 - // pasteFilter: false, //根据规则过滤没事粘贴进来的内容 - // clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号 - // clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体 - // removeEmptyNode: false, // 去掉空节点 - // //可以去掉的标签 - // removeTagNames: {标签名字:1}, - // indent: false, // 行首缩进 - // indentValue : '2em', //行首缩进的大小 - // bdc2sb: false, - // tobdc: false - //} - - //tableDragable - //表格是否可以拖拽 - //,tableDragable: true - - //sourceEditor - //源码的查看方式,codemirror 是代码高亮,textarea是文本框,默认是codemirror - //注意默认codemirror只能在ie8+和非ie中使用 - //,sourceEditor:"codemirror" - //如果sourceEditor是codemirror,还用配置一下两个参数 - //codeMirrorJsUrl js加载的路径,默认是 URL + "third-party/codemirror/codemirror.js" - //,codeMirrorJsUrl:URL + "third-party/codemirror/codemirror.js" - //codeMirrorCssUrl css加载的路径,默认是 URL + "third-party/codemirror/codemirror.css" - //,codeMirrorCssUrl:URL + "third-party/codemirror/codemirror.css" - //编辑器初始化完成后是否进入源码模式,默认为否。 - //,sourceEditorFirst:false - - //iframeUrlMap - //dialog内容的路径 ~会被替换成URL,垓属性一旦打开,将覆盖所有的dialog的默认路径 - //,iframeUrlMap:{ - // 'anchor':'~/dialogs/anchor/anchor.html', - //} - - //allowLinkProtocol 允许的链接地址,有这些前缀的链接地址不会自动添加http - //, allowLinkProtocols: ['http:', 'https:', '#', '/', 'ftp:', 'mailto:', 'tel:', 'git:', 'svn:'] - - //webAppKey 百度应用的APIkey,每个站长必须首先去百度官网注册一个key后方能正常使用app功能,注册介绍,http://app.baidu.com/static/cms/getapikey.html - //, webAppKey: "" - - //默认过滤规则相关配置项目 - //,disabledTableInTable:true //禁止表格嵌套 - //,allowDivTransToP:true //允许进入编辑器的div标签自动变成p标签 - //,rgb2Hex:true //默认产出的数据中的color自动从rgb格式变成16进制格式 - - // xss 过滤是否开启,inserthtml等操作 - , - xssFilterRules: true - //input xss过滤 - , - inputXssFilter: true - //output xss过滤 - , - outputXssFilter: true - // xss过滤白名单 名单来源: https://raw.githubusercontent.com/leizongmin/js-xss/master/lib/default.js - , - whitList: { - a: ['target', 'href', 'title', 'class', 'style'], - abbr: ['title', 'class', 'style'], - address: ['class', 'style'], - area: ['shape', 'coords', 'href', 'alt'], - article: [], - aside: [], - audio: ['autoplay', 'controls', 'loop', 'preload', 'src', 'class', 'style'], - b: ['class', 'style'], - bdi: ['dir'], - bdo: ['dir'], - big: [], - blockquote: ['cite', 'class', 'style'], - br: [], - caption: ['class', 'style'], - center: [], - cite: [], - code: ['class', 'style'], - col: ['align', 'valign', 'span', 'width', 'class', 'style'], - colgroup: ['align', 'valign', 'span', 'width', 'class', 'style'], - dd: ['class', 'style'], - del: ['datetime'], - details: ['open'], - div: ['class', 'style'], - dl: ['class', 'style'], - dt: ['class', 'style'], - em: ['class', 'style'], - font: ['color', 'size', 'face'], - footer: [], - h1: ['class', 'style'], - h2: ['class', 'style'], - h3: ['class', 'style'], - h4: ['class', 'style'], - h5: ['class', 'style'], - h6: ['class', 'style'], - header: [], - hr: [], - i: ['class', 'style'], - img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', '_url', 'loadingclass', 'class', 'data-latex'], - ins: ['datetime'], - li: ['class', 'style'], - mark: [], - nav: [], - ol: ['class', 'style'], - p: ['class', 'style'], - pre: ['class', 'style'], - s: [], - section: [], - small: [], - span: ['class', 'style'], - sub: ['class', 'style'], - sup: ['class', 'style'], - strong: ['class', 'style'], - table: ['width', 'border', 'align', 'valign', 'class', 'style'], - tbody: ['align', 'valign', 'class', 'style'], - td: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'], - tfoot: ['align', 'valign', 'class', 'style'], - th: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'], - thead: ['align', 'valign', 'class', 'style'], - tr: ['rowspan', 'align', 'valign', 'class', 'style'], - tt: [], - u: [], - ul: ['class', 'style'], - video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'class', 'style'], - source: ['src', 'type'], - embed: ['type', 'class', 'pluginspage', 'src', 'width', 'height', 'align', 'style', 'wmode', 'play', 'autoplay', 'loop', 'menu', 'allowscriptaccess', 'allowfullscreen', 'controls', 'preload'], - iframe: ['src', 'class', 'height', 'width', 'max-width', 'max-height', 'align', 'frameborder', 'allowfullscreen'] - } - }; - - function getUEBasePath(docUrl, confUrl) { - return getBasePath( - docUrl || self.document.URL || self.location.href, - confUrl || getConfigFilePath() - ); - } - - function getConfigFilePath() { - var configPath = document.getElementsByTagName("script"); - - return configPath[configPath.length - 1].src; - } - - function getBasePath(docUrl, confUrl) { - var basePath = confUrl; - - if (/^(\/|\\\\)/.test(confUrl)) { - basePath = - /^.+?\w(\/|\\\\)/.exec(docUrl)[0] + confUrl.replace(/^(\/|\\\\)/, ""); - } else if (!/^[a-z]+:/i.test(confUrl)) { - docUrl = docUrl.split("#")[0].split("?")[0].replace(/[^\\\/]+$/, ""); - - basePath = docUrl + "" + confUrl; - } - - return optimizationPath(basePath); - } - - function optimizationPath(path) { - var protocol = /^[a-z]+:\/\//.exec(path)[0], - tmp = null, - res = []; - - path = path.replace(protocol, "").split("?")[0].split("#")[0]; - - path = path.replace(/\\/g, "/").split(/\//); - - path[path.length - 1] = ""; - - while (path.length) { - if ((tmp = path.shift()) === "..") { - res.pop(); - } else if (tmp !== ".") { - res.push(tmp); - } - } - - return protocol + res.join("/"); - } - - window.UE = { - getUEBasePath: getUEBasePath - }; -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.parse.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.parse.js deleted file mode 100644 index 028d72ef4b6486a31e8155b1d818ffdf14727eb0..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.parse.js +++ /dev/null @@ -1,1230 +0,0 @@ -/*! - * neditor parse - * version: 2.1.6 - * build: Thu Nov 29 2018 09:38:10 GMT+0000 (UTC) - */ - -(function(){ - -(function() { - UE = window.UE || {}; - var isIE = !!window.ActiveXObject; - //定义utils工具 - var utils = { - removeLastbs: function(url) { - return url.replace(/\/$/, ""); - }, - extend: function(t, s) { - var a = arguments, - notCover = this.isBoolean(a[a.length - 1]) ? a[a.length - 1] : false, - len = this.isBoolean(a[a.length - 1]) ? a.length - 1 : a.length; - for (var i = 1; i < len; i++) { - var x = a[i]; - for (var k in x) { - if (!notCover || !t.hasOwnProperty(k)) { - t[k] = x[k]; - } - } - } - return t; - }, - isIE: isIE, - cssRule: isIE - ? function(key, style, doc) { - var indexList, index; - doc = doc || document; - if (doc.indexList) { - indexList = doc.indexList; - } else { - indexList = doc.indexList = {}; - } - var sheetStyle; - if (!indexList[key]) { - if (style === undefined) { - return ""; - } - sheetStyle = doc.createStyleSheet( - "", - (index = doc.styleSheets.length) - ); - indexList[key] = index; - } else { - sheetStyle = doc.styleSheets[indexList[key]]; - } - if (style === undefined) { - return sheetStyle.cssText; - } - sheetStyle.cssText = sheetStyle.cssText + "\n" + (style || ""); - } - : function(key, style, doc) { - doc = doc || document; - var head = doc.getElementsByTagName("head")[0], - node; - if (!(node = doc.getElementById(key))) { - if (style === undefined) { - return ""; - } - node = doc.createElement("style"); - node.id = key; - head.appendChild(node); - } - if (style === undefined) { - return node.innerHTML; - } - if (style !== "") { - node.innerHTML = node.innerHTML + "\n" + style; - } else { - head.removeChild(node); - } - }, - domReady: function(onready) { - var doc = window.document; - if (doc.readyState === "complete") { - onready(); - } else { - if (isIE) { - (function() { - if (doc.isReady) return; - try { - doc.documentElement.doScroll("left"); - } catch (error) { - setTimeout(arguments.callee, 0); - return; - } - onready(); - })(); - window.attachEvent("onload", function() { - onready(); - }); - } else { - doc.addEventListener( - "DOMContentLoaded", - function() { - doc.removeEventListener( - "DOMContentLoaded", - arguments.callee, - false - ); - onready(); - }, - false - ); - window.addEventListener( - "load", - function() { - onready(); - }, - false - ); - } - } - }, - each: function(obj, iterator, context) { - if (obj == null) return; - if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === false) return false; - } - } else { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - if (iterator.call(context, obj[key], key, obj) === false) - return false; - } - } - } - }, - inArray: function(arr, item) { - var index = -1; - this.each(arr, function(v, i) { - if (v === item) { - index = i; - return false; - } - }); - return index; - }, - pushItem: function(arr, item) { - if (this.inArray(arr, item) == -1) { - arr.push(item); - } - }, - trim: function(str) { - return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, ""); - }, - indexOf: function(array, item, start) { - var index = -1; - start = this.isNumber(start) ? start : 0; - this.each(array, function(v, i) { - if (i >= start && v === item) { - index = i; - return false; - } - }); - return index; - }, - hasClass: function(element, className) { - className = className - .replace(/(^[ ]+)|([ ]+$)/g, "") - .replace(/[ ]{2,}/g, " ") - .split(" "); - for (var i = 0, ci, cls = element.className; (ci = className[i++]); ) { - if (!new RegExp("\\b" + ci + "\\b", "i").test(cls)) { - return false; - } - } - return i - 1 == className.length; - }, - addClass: function(elm, classNames) { - if (!elm) return; - classNames = this.trim(classNames).replace(/[ ]{2,}/g, " ").split(" "); - for (var i = 0, ci, cls = elm.className; (ci = classNames[i++]); ) { - if (!new RegExp("\\b" + ci + "\\b").test(cls)) { - cls += " " + ci; - } - } - elm.className = utils.trim(cls); - }, - removeClass: function(elm, classNames) { - classNames = this.isArray(classNames) - ? classNames - : this.trim(classNames).replace(/[ ]{2,}/g, " ").split(" "); - for (var i = 0, ci, cls = elm.className; (ci = classNames[i++]); ) { - cls = cls.replace(new RegExp("\\b" + ci + "\\b"), ""); - } - cls = this.trim(cls).replace(/[ ]{2,}/g, " "); - elm.className = cls; - !cls && elm.removeAttribute("className"); - }, - on: function(element, type, handler) { - var types = this.isArray(type) ? type : type.split(/\s+/), - k = types.length; - if (k) - while (k--) { - type = types[k]; - if (element.addEventListener) { - element.addEventListener(type, handler, false); - } else { - if (!handler._d) { - handler._d = { - els: [] - }; - } - var key = type + handler.toString(), - index = utils.indexOf(handler._d.els, element); - if (!handler._d[key] || index == -1) { - if (index == -1) { - handler._d.els.push(element); - } - if (!handler._d[key]) { - handler._d[key] = function(evt) { - return handler.call(evt.srcElement, evt || window.event); - }; - } - - element.attachEvent("on" + type, handler._d[key]); - } - } - } - element = null; - }, - off: function(element, type, handler) { - var types = this.isArray(type) ? type : type.split(/\s+/), - k = types.length; - if (k) - while (k--) { - type = types[k]; - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else { - var key = type + handler.toString(); - try { - element.detachEvent( - "on" + type, - handler._d ? handler._d[key] : handler - ); - } catch (e) {} - if (handler._d && handler._d[key]) { - var index = utils.indexOf(handler._d.els, element); - if (index != -1) { - handler._d.els.splice(index, 1); - } - handler._d.els.length == 0 && delete handler._d[key]; - } - } - } - }, - loadFile: (function() { - var tmpList = []; - function getItem(doc, obj) { - try { - for (var i = 0, ci; (ci = tmpList[i++]); ) { - if (ci.doc === doc && ci.url == (obj.src || obj.href)) { - return ci; - } - } - } catch (e) { - return null; - } - } - return function(doc, obj, fn) { - var item = getItem(doc, obj); - if (item) { - if (item.ready) { - fn && fn(); - } else { - item.funs.push(fn); - } - return; - } - tmpList.push({ - doc: doc, - url: obj.src || obj.href, - funs: [fn] - }); - if (!doc.body) { - var html = []; - for (var p in obj) { - if (p == "tag") continue; - html.push(p + '="' + obj[p] + '"'); - } - doc.write( - "<" + obj.tag + " " + html.join(" ") + " >" - ); - return; - } - if (obj.id && doc.getElementById(obj.id)) { - return; - } - var element = doc.createElement(obj.tag); - delete obj.tag; - for (var p in obj) { - element.setAttribute(p, obj[p]); - } - element.onload = element.onreadystatechange = function() { - if (!this.readyState || /loaded|complete/.test(this.readyState)) { - item = getItem(doc, obj); - if (item.funs.length > 0) { - item.ready = 1; - for (var fi; (fi = item.funs.pop()); ) { - fi(); - } - } - element.onload = element.onreadystatechange = null; - } - }; - element.onerror = function() { - throw Error( - "The load " + (obj.href || obj.src) + " fails,check the url" - ); - }; - doc.getElementsByTagName("head")[0].appendChild(element); - }; - })() - }; - utils.each( - ["String", "Function", "Array", "Number", "RegExp", "Object", "Boolean"], - function(v) { - utils["is" + v] = function(obj) { - return Object.prototype.toString.apply(obj) == "[object " + v + "]"; - }; - } - ); - var parselist = {}; - UE.parse = { - register: function(parseName, fn) { - parselist[parseName] = fn; - }, - load: function(opt) { - utils.each(parselist, function(v) { - v.call(opt, utils); - }); - } - }; - uParse = function(selector, opt) { - utils.domReady(function() { - var contents; - if (document.querySelectorAll) { - contents = document.querySelectorAll(selector); - } else { - if (/^#/.test(selector)) { - contents = [document.getElementById(selector.replace(/^#/, ""))]; - } else if (/^\./.test(selector)) { - var contents = []; - utils.each(document.getElementsByTagName("*"), function(node) { - if ( - node.className && - new RegExp("\\b" + selector.replace(/^\./, "") + "\\b", "i").test( - node.className - ) - ) { - contents.push(node); - } - }); - } else { - contents = document.getElementsByTagName(selector); - } - } - utils.each(contents, function(v) { - UE.parse.load(utils.extend({ root: v, selector: selector }, opt)); - }); - }); - }; -})(); - -UE.parse.register("insertcode", function(utils) { - var pres = this.root.getElementsByTagName("pre"); - if (pres.length) { - if (typeof XRegExp == "undefined") { - var jsurl, cssurl; - if (this.rootPath !== undefined) { - jsurl = - utils.removeLastbs(this.rootPath) + - "/third-party/SyntaxHighlighter/shCore.js"; - cssurl = - utils.removeLastbs(this.rootPath) + - "/third-party/SyntaxHighlighter/shCoreDefault.css"; - } else { - jsurl = this.highlightJsUrl; - cssurl = this.highlightCssUrl; - } - utils.loadFile(document, { - id: "syntaxhighlighter_css", - tag: "link", - rel: "stylesheet", - type: "text/css", - href: cssurl - }); - utils.loadFile( - document, - { - id: "syntaxhighlighter_js", - src: jsurl, - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - utils.each(pres, function(pi) { - if (pi && /brush/i.test(pi.className)) { - SyntaxHighlighter.highlight(pi); - } - }); - } - ); - } else { - utils.each(pres, function(pi) { - if (pi && /brush/i.test(pi.className)) { - SyntaxHighlighter.highlight(pi); - } - }); - } - } -}); - -UE.parse.register("table", function(utils) { - var me = this, - root = this.root, - tables = root.getElementsByTagName("table"); - if (tables.length) { - var selector = this.selector; - //追加默认的表格样式 - utils.cssRule( - "table", - selector + - " table.noBorderTable td," + - selector + - " table.noBorderTable th," + - selector + - " table.noBorderTable caption{border:1px dashed #ddd !important}" + - selector + - " table.sortEnabled tr.firstRow th," + - selector + - " table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;" + - "background-position: center right; background-image:url(" + - this.rootPath + - "themes/default/images/sortable.png);}" + - selector + - " table.sortEnabled tr.firstRow th:hover," + - selector + - " table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}" + - selector + - " table{margin-bottom:10px;border-collapse:collapse;display:table;}" + - selector + - " td," + - selector + - " th{padding: 5px 10px;border: 1px solid #DDD;}" + - selector + - " caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}" + - selector + - " th{border-top:1px solid #BBB;background:#F7F7F7;}" + - selector + - " table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}" + - selector + - " tr.ue-table-interlace-color-single td{ background: #fcfcfc; }" + - selector + - " tr.ue-table-interlace-color-double td{ background: #f7faff; }" + - selector + - " td p{margin:0;padding:0;width:auto;height:auto;}", - document - ); - //填充空的单元格 - - utils.each("td th caption".split(" "), function(tag) { - var cells = root.getElementsByTagName(tag); - cells.length && - utils.each(cells, function(node) { - if (!node.firstChild) { - node.innerHTML = " "; - } - }); - }); - - //表格可排序 - var tables = root.getElementsByTagName("table"); - utils.each(tables, function(table) { - if (/\bsortEnabled\b/.test(table.className)) { - utils.on(table, "click", function(e) { - var target = e.target || e.srcElement, - cell = findParentByTagName(target, ["td", "th"]); - var table = findParentByTagName(target, "table"), - colIndex = utils.indexOf(table.rows[0].cells, cell), - sortType = table.getAttribute("data-sort-type"); - if (colIndex != -1) { - sortTable(table, colIndex, me.tableSortCompareFn || sortType); - updateTable(table); - } - }); - } - }); - - //按照标签名查找父节点 - function findParentByTagName(target, tagNames) { - var i, - current = target; - tagNames = utils.isArray(tagNames) ? tagNames : [tagNames]; - while (current) { - for (i = 0; i < tagNames.length; i++) { - if (current.tagName == tagNames[i].toUpperCase()) return current; - } - current = current.parentNode; - } - return null; - } - //表格排序 - function sortTable(table, sortByCellIndex, compareFn) { - var rows = table.rows, - trArray = [], - flag = rows[0].cells[0].tagName === "TH", - lastRowIndex = 0; - - for (var i = 0, len = rows.length; i < len; i++) { - trArray[i] = rows[i]; - } - - var Fn = { - reversecurrent: function(td1, td2) { - return 1; - }, - orderbyasc: function(td1, td2) { - var value1 = td1.innerText || td1.textContent, - value2 = td2.innerText || td2.textContent; - return value1.localeCompare(value2); - }, - reversebyasc: function(td1, td2) { - var value1 = td1.innerHTML, - value2 = td2.innerHTML; - return value2.localeCompare(value1); - }, - orderbynum: function(td1, td2) { - var value1 = td1[utils.isIE ? "innerText" : "textContent"].match( - /\d+/ - ), - value2 = td2[utils.isIE ? "innerText" : "textContent"].match(/\d+/); - if (value1) value1 = +value1[0]; - if (value2) value2 = +value2[0]; - return (value1 || 0) - (value2 || 0); - }, - reversebynum: function(td1, td2) { - var value1 = td1[utils.isIE ? "innerText" : "textContent"].match( - /\d+/ - ), - value2 = td2[utils.isIE ? "innerText" : "textContent"].match(/\d+/); - if (value1) value1 = +value1[0]; - if (value2) value2 = +value2[0]; - return (value2 || 0) - (value1 || 0); - } - }; - - //对表格设置排序的标记data-sort-type - table.setAttribute( - "data-sort-type", - compareFn && typeof compareFn === "string" && Fn[compareFn] - ? compareFn - : "" - ); - - //th不参与排序 - flag && trArray.splice(0, 1); - trArray = sort(trArray, function(tr1, tr2) { - var result; - if (compareFn && typeof compareFn === "function") { - result = compareFn.call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } else if (compareFn && typeof compareFn === "number") { - result = 1; - } else if ( - compareFn && - typeof compareFn === "string" && - Fn[compareFn] - ) { - result = Fn[compareFn].call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } else { - result = Fn["orderbyasc"].call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } - return result; - }); - var fragment = table.ownerDocument.createDocumentFragment(); - for (var j = 0, len = trArray.length; j < len; j++) { - fragment.appendChild(trArray[j]); - } - var tbody = table.getElementsByTagName("tbody")[0]; - if (!lastRowIndex) { - tbody.appendChild(fragment); - } else { - tbody.insertBefore( - fragment, - rows[lastRowIndex - range.endRowIndex + range.beginRowIndex - 1] - ); - } - } - //冒泡排序 - function sort(array, compareFn) { - compareFn = - compareFn || - function(item1, item2) { - return item1.localeCompare(item2); - }; - for (var i = 0, len = array.length; i < len; i++) { - for (var j = i, length = array.length; j < length; j++) { - if (compareFn(array[i], array[j]) > 0) { - var t = array[i]; - array[i] = array[j]; - array[j] = t; - } - } - } - return array; - } - //更新表格 - function updateTable(table) { - //给第一行设置firstRow的样式名称,在排序图标的样式上使用到 - if (!utils.hasClass(table.rows[0], "firstRow")) { - for (var i = 1; i < table.rows.length; i++) { - utils.removeClass(table.rows[i], "firstRow"); - } - utils.addClass(table.rows[0], "firstRow"); - } - } - } -}); - -UE.parse.register("charts", function(utils) { - utils.cssRule( - "chartsContainerHeight", - ".edui-chart-container { height:" + - (this.chartContainerHeight || 300) + - "px}" - ); - var resourceRoot = this.rootPath, - containers = this.root, - sources = null; - - //不存在指定的根路径, 则直接退出 - if (!resourceRoot) { - return; - } - - if ((sources = parseSources())) { - loadResources(); - } - - function parseSources() { - if (!containers) { - return null; - } - - return extractChartData(containers); - } - - /** - * 提取数据 - */ - function extractChartData(rootNode) { - var data = [], - tables = rootNode.getElementsByTagName("table"); - - for (var i = 0, tableNode; (tableNode = tables[i]); i++) { - if (tableNode.getAttribute("data-chart") !== null) { - data.push(formatData(tableNode)); - } - } - - return data.length ? data : null; - } - - function formatData(tableNode) { - var meta = tableNode.getAttribute("data-chart"), - metaConfig = {}, - data = []; - - //提取table数据 - for (var i = 0, row; (row = tableNode.rows[i]); i++) { - var rowData = []; - - for (var j = 0, cell; (cell = row.cells[j]); j++) { - var value = cell.innerText || cell.textContent || ""; - rowData.push(cell.tagName == "TH" ? value : value | 0); - } - - data.push(rowData); - } - - //解析元信息 - meta = meta.split(";"); - for (var i = 0, metaData; (metaData = meta[i]); i++) { - metaData = metaData.split(":"); - metaConfig[metaData[0]] = metaData[1]; - } - - return { - table: tableNode, - meta: metaConfig, - data: data - }; - } - - //加载资源 - function loadResources() { - loadJQuery(); - } - - function loadJQuery() { - //不存在jquery, 则加载jquery - if (!window.jQuery) { - utils.loadFile( - document, - { - src: resourceRoot + "/third-party/jquery-1.10.2.min.js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - loadHighcharts(); - } - ); - } else { - loadHighcharts(); - } - } - - function loadHighcharts() { - //不存在Highcharts, 则加载Highcharts - if (!window.Highcharts) { - utils.loadFile( - document, - { - src: resourceRoot + "/third-party/highcharts/highcharts.js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - loadTypeConfig(); - } - ); - } else { - loadTypeConfig(); - } - } - - //加载图表差异化配置文件 - function loadTypeConfig() { - utils.loadFile( - document, - { - src: resourceRoot + "/dialogs/charts/chart.config.js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - render(); - } - ); - } - - //渲染图表 - function render() { - var config = null, - chartConfig = null, - container = null; - - for (var i = 0, len = sources.length; i < len; i++) { - config = sources[i]; - - chartConfig = analysisConfig(config); - - container = createContainer(config.table); - - renderChart(container, typeConfig[config.meta.chartType], chartConfig); - } - } - - /** - * 渲染图表 - * @param container 图表容器节点对象 - * @param typeConfig 图表类型配置 - * @param config 图表通用配置 - * */ - function renderChart(container, typeConfig, config) { - $(container).highcharts( - $.extend({}, typeConfig, { - credits: { - enabled: false - }, - exporting: { - enabled: false - }, - title: { - text: config.title, - x: -20 //center - }, - subtitle: { - text: config.subTitle, - x: -20 - }, - xAxis: { - title: { - text: config.xTitle - }, - categories: config.categories - }, - yAxis: { - title: { - text: config.yTitle - }, - plotLines: [ - { - value: 0, - width: 1, - color: "#808080" - } - ] - }, - tooltip: { - enabled: true, - valueSuffix: config.suffix - }, - legend: { - layout: "vertical", - align: "right", - verticalAlign: "middle", - borderWidth: 1 - }, - series: config.series - }) - ); - } - - /** - * 创建图表的容器 - * 新创建的容器会替换掉对应的table对象 - * */ - function createContainer(tableNode) { - var container = document.createElement("div"); - container.className = "edui-chart-container"; - - tableNode.parentNode.replaceChild(container, tableNode); - - return container; - } - - //根据config解析出正确的类别和图表数据信息 - function analysisConfig(config) { - var series = [], - //数据类别 - categories = [], - result = [], - data = config.data, - meta = config.meta; - - //数据对齐方式为相反的方式, 需要反转数据 - if (meta.dataFormat != "1") { - for (var i = 0, len = data.length; i < len; i++) { - for (var j = 0, jlen = data[i].length; j < jlen; j++) { - if (!result[j]) { - result[j] = []; - } - - result[j][i] = data[i][j]; - } - } - - data = result; - } - - result = {}; - - //普通图表 - if (meta.chartType != typeConfig.length - 1) { - categories = data[0].slice(1); - - for (var i = 1, curData; (curData = data[i]); i++) { - series.push({ - name: curData[0], - data: curData.slice(1) - }); - } - - result.series = series; - result.categories = categories; - result.title = meta.title; - result.subTitle = meta.subTitle; - result.xTitle = meta.xTitle; - result.yTitle = meta.yTitle; - result.suffix = meta.suffix; - } else { - var curData = []; - - for (var i = 1, len = data[0].length; i < len; i++) { - curData.push([data[0][i], data[1][i] | 0]); - } - - //饼图 - series[0] = { - type: "pie", - name: meta.tip, - data: curData - }; - - result.series = series; - result.title = meta.title; - result.suffix = meta.suffix; - } - - return result; - } -}); - -UE.parse.register("background", function(utils) { - var me = this, - root = me.root, - p = root.getElementsByTagName("p"), - styles; - - for (var i = 0, ci; (ci = p[i++]); ) { - styles = ci.getAttribute("data-background"); - if (styles) { - ci.parentNode.removeChild(ci); - } - } - - //追加默认的表格样式 - styles && - utils.cssRule( - "ueditor_background", - me.selector + "{" + styles + "}", - document - ); -}); - -UE.parse.register("list", function(utils) { - var customCss = [], - customStyle = { - cn: "cn-1-", - cn1: "cn-2-", - cn2: "cn-3-", - num: "num-1-", - num1: "num-2-", - num2: "num-3-", - dash: "dash", - dot: "dot" - }; - - utils.extend(this, { - liiconpath : utils.removeLastbs(this.rootPath) + '/themes/ueditor-list/', - listDefaultPaddingLeft: "20" - }); - - var root = this.root, - ols = root.getElementsByTagName("ol"), - uls = root.getElementsByTagName("ul"), - selector = this.selector; - - if (ols.length) { - applyStyle.call(this, ols); - } - - if (uls.length) { - applyStyle.call(this, uls); - } - - if (ols.length || uls.length) { - customCss.push(selector + " .list-paddingleft-1{padding-left:0}"); - customCss.push( - selector + - " .list-paddingleft-2{padding-left:" + - this.listDefaultPaddingLeft + - "px}" - ); - customCss.push( - selector + - " .list-paddingleft-3{padding-left:" + - this.listDefaultPaddingLeft * 2 + - "px}" - ); - - utils.cssRule( - "list", - selector + - " ol," + - selector + - " ul{margin:0;padding:0;}\n" + - selector + - " li{clear:both;}\n" + - customCss.join("\n"), - document - ); - } - function applyStyle(nodes) { - var T = this; - utils.each(nodes, function(list) { - if (list.className && /custom_/i.test(list.className)) { - var listStyle = list.className.match(/custom_(\w+)/)[1]; - if (listStyle == "dash" || listStyle == "dot") { - utils.pushItem( - customCss, - selector + - " li.list-" + - customStyle[listStyle] + - "{background-image:url(" + - T.liiconpath + - customStyle[listStyle] + - ".gif)}" - ); - utils.pushItem( - customCss, - selector + - " ul.custom_" + - listStyle + - "{list-style:none;} " + - selector + - " ul.custom_" + - listStyle + - " li{background-position:0 3px;background-repeat:no-repeat}" - ); - } else { - var index = 1; - utils.each(list.childNodes, function(li) { - if (li.tagName == "LI") { - utils.pushItem( - customCss, - selector + - " li.list-" + - customStyle[listStyle] + - index + - "{background-image:url(" + - T.liiconpath + - "list-" + - customStyle[listStyle] + - index + - ".gif)}" - ); - index++; - } - }); - utils.pushItem( - customCss, - selector + - " ol.custom_" + - listStyle + - "{list-style:none;}" + - selector + - " ol.custom_" + - listStyle + - " li{background-position:0 3px;background-repeat:no-repeat}" - ); - } - switch (listStyle) { - case "cn": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-1{padding-left:25px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-2{padding-left:40px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-3{padding-left:55px}" - ); - break; - case "cn1": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-1{padding-left:30px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-2{padding-left:40px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-3{padding-left:55px}" - ); - break; - case "cn2": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-1{padding-left:40px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-2{padding-left:55px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-3{padding-left:68px}" - ); - break; - case "num": - case "num1": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-1{padding-left:25px}" - ); - break; - case "num2": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-1{padding-left:35px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-2{padding-left:40px}" - ); - break; - case "dash": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft{padding-left:35px}" - ); - break; - case "dot": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft{padding-left:20px}" - ); - } - } - }); - } -}); - -UE.parse.register("vedio", function(utils) { - var video = this.root.getElementsByTagName("video"), - audio = this.root.getElementsByTagName("audio"); - - document.createElement("video"); - document.createElement("audio"); - if (video.length || audio.length) { - var sourcePath = utils.removeLastbs(this.rootPath), - jsurl = sourcePath + "/third-party/video-js/video.js", - cssurl = sourcePath + "/third-party/video-js/video-js.min.css", - swfUrl = sourcePath + "/third-party/video-js/video-js.swf"; - - if (window.videojs) { - videojs.autoSetup(); - } else { - utils.loadFile(document, { - id: "video_css", - tag: "link", - rel: "stylesheet", - type: "text/css", - href: cssurl - }); - utils.loadFile( - document, - { - id: "video_js", - src: jsurl, - tag: "script", - type: "text/javascript" - }, - function() { - videojs.options.flash.swf = swfUrl; - videojs.autoSetup(); - } - ); - } - } -}); - - -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.parse.min.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.parse.min.js deleted file mode 100644 index 6edefd47a55eaee3bcb3c2b2542a064d303d3ea7..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/neditor.parse.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * neditor parse - * version: 2.1.6 - * build: Thu Nov 29 2018 09:38:15 GMT+0000 (UTC) - */!function(){!function(){UE=window.UE||{};var a=!!window.ActiveXObject,b={removeLastbs:function(a){return a.replace(/\/$/,"")},extend:function(a,b){for(var c=arguments,d=!!this.isBoolean(c[c.length-1])&&c[c.length-1],e=this.isBoolean(c[c.length-1])?c.length-1:c.length,f=1;f=c&&a===b)return d=e,!1}),d},hasClass:function(a,b){b=b.replace(/(^[ ]+)|([ ]+$)/g,"").replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)if(!new RegExp("\\b"+c+"\\b","i").test(e))return!1;return d-1==b.length},addClass:function(a,c){if(a){c=this.trim(c).replace(/[ ]{2,}/g," ").split(" ");for(var d,e=0,f=a.className;d=c[e++];)new RegExp("\\b"+d+"\\b").test(f)||(f+=" "+d);a.className=b.trim(f)}},removeClass:function(a,b){b=this.isArray(b)?b:this.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)e=e.replace(new RegExp("\\b"+c+"\\b"),"");e=this.trim(e).replace(/[ ]{2,}/g," "),a.className=e,!e&&a.removeAttribute("className")},on:function(a,c,d){var e=this.isArray(c)?c:c.split(/\s+/),f=e.length;if(f)for(;f--;)if(c=e[f],a.addEventListener)a.addEventListener(c,d,!1);else{d._d||(d._d={els:[]});var g=c+d.toString(),h=b.indexOf(d._d.els,a);d._d[g]&&h!=-1||(h==-1&&d._d.els.push(a),d._d[g]||(d._d[g]=function(a){return d.call(a.srcElement,a||window.event)}),a.attachEvent("on"+c,d._d[g]))}a=null},off:function(a,c,d){var e=this.isArray(c)?c:c.split(/\s+/),f=e.length;if(f)for(;f--;)if(c=e[f],a.removeEventListener)a.removeEventListener(c,d,!1);else{var g=c+d.toString();try{a.detachEvent("on"+c,d._d?d._d[g]:d)}catch(h){}if(d._d&&d._d[g]){var i=b.indexOf(d._d.els,a);i!=-1&&d._d.els.splice(i,1),0==d._d.els.length&&delete d._d[g]}}},loadFile:function(){function a(a,c){try{for(var d,e=0;d=b[e++];)if(d.doc===a&&d.url==(c.src||c.href))return d}catch(f){return null}}var b=[];return function(c,d,e){var f=a(c,d);if(f)return void(f.ready?e&&e():f.funs.push(e));if(b.push({doc:c,url:d.src||d.href,funs:[e]}),!c.body){var g=[];for(var h in d)"tag"!=h&&g.push(h+'="'+d[h]+'"');return void c.write("<"+d.tag+" "+g.join(" ")+" >")}if(!d.id||!c.getElementById(d.id)){var i=c.createElement(d.tag);delete d.tag;for(var h in d)i.setAttribute(h,d[h]);i.onload=i.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(f=a(c,d),f.funs.length>0){f.ready=1;for(var b;b=f.funs.pop();)b()}i.onload=i.onreadystatechange=null}},i.onerror=function(){throw Error("The load "+(d.href||d.src)+" fails,check the url")},c.getElementsByTagName("head")[0].appendChild(i)}}}()};b.each(["String","Function","Array","Number","RegExp","Object","Boolean"],function(a){b["is"+a]=function(b){return Object.prototype.toString.apply(b)=="[object "+a+"]"}});var c={};UE.parse={register:function(a,b){c[a]=b},load:function(a){b.each(c,function(c){c.call(a,b)})}},uParse=function(a,c){b.domReady(function(){var d;if(document.querySelectorAll)d=document.querySelectorAll(a);else if(/^#/.test(a))d=[document.getElementById(a.replace(/^#/,""))];else if(/^\./.test(a)){var d=[];b.each(document.getElementsByTagName("*"),function(b){b.className&&new RegExp("\\b"+a.replace(/^\./,"")+"\\b","i").test(b.className)&&d.push(b)})}else d=document.getElementsByTagName(a);b.each(d,function(d){UE.parse.load(b.extend({root:d,selector:a},c))})})}}(),UE.parse.register("insertcode",function(a){var b=this.root.getElementsByTagName("pre");if(b.length)if("undefined"==typeof XRegExp){var c,d;void 0!==this.rootPath?(c=a.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCore.js",d=a.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCoreDefault.css"):(c=this.highlightJsUrl,d=this.highlightCssUrl),a.loadFile(document,{id:"syntaxhighlighter_css",tag:"link",rel:"stylesheet",type:"text/css",href:d}),a.loadFile(document,{id:"syntaxhighlighter_js",src:c,tag:"script",type:"text/javascript",defer:"defer"},function(){a.each(b,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})})}else a.each(b,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})}),UE.parse.register("table",function(a){function b(b,c){var d,e=b;for(c=a.isArray(c)?c:[c];e;){for(d=0;d0){var g=a[c];a[c]=a[e],a[e]=g}return a}function e(b){if(!a.hasClass(b.rows[0],"firstRow")){for(var c=1;c.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/fonts/iconfont.svg b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/fonts/iconfont.svg deleted file mode 100644 index 7bbbafef1899338fd6b6a6b63d8a7573e28d028e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/fonts/iconfont.svg +++ /dev/null @@ -1,410 +0,0 @@ - - - - - -Created by iconfont - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/fonts/iconfont.ttf b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/fonts/iconfont.ttf deleted file mode 100644 index f8a15465d6cd67623be8186f5bdb96988308ac0c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/fonts/iconfont.ttf and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/fonts/iconfont.woff b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/fonts/iconfont.woff deleted file mode 100644 index 951c50e6bc5c3d8605710b0f86be22490bfb2554..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/fonts/iconfont.woff and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/anchor.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/anchor.gif deleted file mode 100644 index fa4d420ada43da7064ebca58f79c80ba46488b64..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/anchor.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/arrow.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/arrow.png deleted file mode 100644 index d9008866ba56c4a4715a3f883ccb3be941031206..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/arrow.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/arrow_down.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/arrow_down.png deleted file mode 100644 index e9257e83b00375259f2f724c7cbac03d0df5ceb2..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/arrow_down.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/arrow_up.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/arrow_up.png deleted file mode 100644 index 74277af1e6a8ef91f8fe664efde11377a5292dbc..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/arrow_up.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/button-bg.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/button-bg.gif deleted file mode 100644 index ec7fa2eabf0705226fe0c488d65198508bf547e9..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/button-bg.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cancelbutton.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cancelbutton.gif deleted file mode 100644 index df4bc2c06d485df4403d689c98ee745a4cde8e97..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cancelbutton.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/charts.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/charts.png deleted file mode 100644 index 713965cc4c6971759c80a52290ddef9ab32776b6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/charts.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_h.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_h.gif deleted file mode 100644 index d7c3e7e9eb5755d57ec03c34097c258244abe61a..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_h.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_h.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_h.png deleted file mode 100644 index 2088fc24077a214aab0e758d571678a11dd41ce9..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_h.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_v.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_v.gif deleted file mode 100644 index bb508db552b6ac3f670f9ce1fcb1e55669db0dd6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_v.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_v.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_v.png deleted file mode 100644 index 6f39ca3d84d5e3c2cea3639b4d97c43df32aa4d7..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/cursor_v.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/dialog-title-bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/dialog-title-bg.png deleted file mode 100644 index f744f267f797ebf9993b746ecaff21b85d556e83..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/dialog-title-bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/filescan.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/filescan.png deleted file mode 100644 index 1d271588692c1726e3521032f71d8354b66fab0e..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/filescan.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/highlighted.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/highlighted.gif deleted file mode 100644 index 9272b4915ad2b8d4052a19b4c80a41b7c71cf1f1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/highlighted.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/icons-all.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/icons-all.gif deleted file mode 100644 index 21915e59dede0aa22cda8c7097a14f0f1f68906c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/icons-all.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/icons.gif deleted file mode 100644 index 7abd30a1c6516cda6376f335902e3cadbae64c89..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/icons.png deleted file mode 100644 index c015e3aac9a84ebad11b932e84722124772d9641..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/loaderror.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/loaderror.png deleted file mode 100644 index 35ff3336457d48dbecbc11698ef8245441a94f82..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/loaderror.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/loading.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/loading.gif deleted file mode 100644 index b713e27dfba708a01c380e7c731a13b52a34edfc..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/loading.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/lock.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/lock.gif deleted file mode 100644 index b4e6d7822a5af54c19e555f449a461baf464dc5e..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/lock.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/neweditor-tab-bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/neweditor-tab-bg.png deleted file mode 100644 index 8f398b0958cdc5136a23b9745becc23a833aa325..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/neweditor-tab-bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/pagebreak.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/pagebreak.gif deleted file mode 100644 index 8d1cffd64af72709b1180b3b0a51bbfe30bcb8c6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/pagebreak.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/scale.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/scale.png deleted file mode 100644 index f45adb585717879be556fc978daf9f951de45e57..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/scale.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/sortable.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/sortable.png deleted file mode 100644 index 1bca649698e187a80e1b1951fde99ddea3d7b038..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/sortable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/spacer.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/spacer.gif deleted file mode 100644 index 5bfd67a2d6f72ac3a55cbfcea5866e841d22f5d9..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/spacer.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/sparator_v.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/sparator_v.png deleted file mode 100644 index 8cf5662da8c36a446e1e08eb71b992c730ab8d15..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/sparator_v.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/table-cell-align.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/table-cell-align.png deleted file mode 100644 index ddf42853ea5c00663e74d9195d1f1264ab684252..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/table-cell-align.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/tangram-colorpicker.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/tangram-colorpicker.png deleted file mode 100644 index 738e500cfcf2c746f977189b05a7fe43544e80f0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/tangram-colorpicker.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/toolbar_bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/toolbar_bg.png deleted file mode 100644 index 7ab685f4236ad543601b0d7dc43e429e041bee98..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/toolbar_bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/unhighlighted.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/unhighlighted.gif deleted file mode 100644 index 7ad0b67ae634d41e76848ec0b6696e8ac7e06983..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/unhighlighted.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/upload.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/upload.png deleted file mode 100644 index 08d4d9268204a20ca343bf75784302cc706d2417..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/upload.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/videologo.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/videologo.gif deleted file mode 100644 index d0c36c483f77acef63ee5ab20b6bc5b18f00302f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/videologo.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/word.gif b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/word.gif deleted file mode 100644 index 9ef5d09b7b30c4f3225f77788462e429cc494b9b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/word.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/wordpaste.png b/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/wordpaste.png deleted file mode 100644 index 936775810b9ca1531a0973e73f9c3772eb6d69af..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.10/themes/notadd/images/wordpaste.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.10/third-party/SyntaxHighlighter/shCore.js b/api/src/main/resources/static/plug-in/neditor/2.1.10/third-party/SyntaxHighlighter/shCore.js deleted file mode 100644 index 32491842526a32527bb92877f312b7dd2e94e5ee..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.10/third-party/SyntaxHighlighter/shCore.js +++ /dev/null @@ -1,3655 +0,0 @@ -// XRegExp 1.5.1 -// (c) 2007-2012 Steven Levithan -// MIT License -// -// Provides an augmented, extensible, cross-browser implementation of regular expressions, -// including support for additional syntax, flags, and methods - -var XRegExp; - -if (XRegExp) { - // Avoid running twice, since that would break references to native globals - throw Error("can't load XRegExp twice in the same frame"); -} - -// Run within an anonymous function to protect variables and avoid new globals -(function (undefined) { - - //--------------------------------- - // Constructor - //--------------------------------- - - // Accepts a pattern and flags; returns a new, extended `RegExp` object. Differs from a native - // regular expression in that additional syntax and flags are supported and cross-browser - // syntax inconsistencies are ameliorated. `XRegExp(/regex/)` clones an existing regex and - // converts to type XRegExp - XRegExp = function (pattern, flags) { - var output = [], - currScope = XRegExp.OUTSIDE_CLASS, - pos = 0, - context, tokenResult, match, chr, regex; - - if (XRegExp.isRegExp(pattern)) { - if (flags !== undefined) - throw TypeError("can't supply flags when constructing one RegExp from another"); - return clone(pattern); - } - // Tokens become part of the regex construction process, so protect against infinite - // recursion when an XRegExp is constructed within a token handler or trigger - if (isInsideConstructor) - throw Error("can't call the XRegExp constructor within token definition functions"); - - flags = flags || ""; - context = { // `this` object for custom tokens - hasNamedCapture: false, - captureNames: [], - hasFlag: function (flag) {return flags.indexOf(flag) > -1;}, - setFlag: function (flag) {flags += flag;} - }; - - while (pos < pattern.length) { - // Check for custom tokens at the current position - tokenResult = runTokens(pattern, pos, currScope, context); - - if (tokenResult) { - output.push(tokenResult.output); - pos += (tokenResult.match[0].length || 1); - } else { - // Check for native multicharacter metasequences (excluding character classes) at - // the current position - if (match = nativ.exec.call(nativeTokens[currScope], pattern.slice(pos))) { - output.push(match[0]); - pos += match[0].length; - } else { - chr = pattern.charAt(pos); - if (chr === "[") - currScope = XRegExp.INSIDE_CLASS; - else if (chr === "]") - currScope = XRegExp.OUTSIDE_CLASS; - // Advance position one character - output.push(chr); - pos++; - } - } - } - - regex = RegExp(output.join(""), nativ.replace.call(flags, flagClip, "")); - regex._xregexp = { - source: pattern, - captureNames: context.hasNamedCapture ? context.captureNames : null - }; - return regex; - }; - - - //--------------------------------- - // Public properties - //--------------------------------- - - XRegExp.version = "1.5.1"; - - // Token scope bitflags - XRegExp.INSIDE_CLASS = 1; - XRegExp.OUTSIDE_CLASS = 2; - - - //--------------------------------- - // Private variables - //--------------------------------- - - var replacementToken = /\$(?:(\d\d?|[$&`'])|{([$\w]+)})/g, - flagClip = /[^gimy]+|([\s\S])(?=[\s\S]*\1)/g, // Nonnative and duplicate flags - quantifier = /^(?:[?*+]|{\d+(?:,\d*)?})\??/, - isInsideConstructor = false, - tokens = [], - // Copy native globals for reference ("native" is an ES3 reserved keyword) - nativ = { - exec: RegExp.prototype.exec, - test: RegExp.prototype.test, - match: String.prototype.match, - replace: String.prototype.replace, - split: String.prototype.split - }, - compliantExecNpcg = nativ.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups - compliantLastIndexIncrement = function () { - var x = /^/g; - nativ.test.call(x, ""); - return !x.lastIndex; - }(), - hasNativeY = RegExp.prototype.sticky !== undefined, - nativeTokens = {}; - - // `nativeTokens` match native multicharacter metasequences only (including deprecated octals, - // excluding character classes) - nativeTokens[XRegExp.INSIDE_CLASS] = /^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/; - nativeTokens[XRegExp.OUTSIDE_CLASS] = /^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/; - - - //--------------------------------- - // Public methods - //--------------------------------- - - // Lets you extend or change XRegExp syntax and create custom flags. This is used internally by - // the XRegExp library and can be used to create XRegExp plugins. This function is intended for - // users with advanced knowledge of JavaScript's regular expression syntax and behavior. It can - // be disabled by `XRegExp.freezeTokens` - XRegExp.addToken = function (regex, handler, scope, trigger) { - tokens.push({ - pattern: clone(regex, "g" + (hasNativeY ? "y" : "")), - handler: handler, - scope: scope || XRegExp.OUTSIDE_CLASS, - trigger: trigger || null - }); - }; - - // Accepts a pattern and flags; returns an extended `RegExp` object. If the pattern and flag - // combination has previously been cached, the cached copy is returned; otherwise the newly - // created regex is cached - XRegExp.cache = function (pattern, flags) { - var key = pattern + "/" + (flags || ""); - return XRegExp.cache[key] || (XRegExp.cache[key] = XRegExp(pattern, flags)); - }; - - // Accepts a `RegExp` instance; returns a copy with the `/g` flag set. The copy has a fresh - // `lastIndex` (set to zero). If you want to copy a regex without forcing the `global` - // property, use `XRegExp(regex)`. Do not use `RegExp(regex)` because it will not preserve - // special properties required for named capture - XRegExp.copyAsGlobal = function (regex) { - return clone(regex, "g"); - }; - - // Accepts a string; returns the string with regex metacharacters escaped. The returned string - // can safely be used at any point within a regex to match the provided literal string. Escaped - // characters are [ ] { } ( ) * + ? - . , \ ^ $ | # and whitespace - XRegExp.escape = function (str) { - return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - }; - - // Accepts a string to search, regex to search with, position to start the search within the - // string (default: 0), and an optional Boolean indicating whether matches must start at-or- - // after the position or at the specified position only. This function ignores the `lastIndex` - // of the provided regex in its own handling, but updates the property for compatibility - XRegExp.execAt = function (str, regex, pos, anchored) { - var r2 = clone(regex, "g" + ((anchored && hasNativeY) ? "y" : "")), - match; - r2.lastIndex = pos = pos || 0; - match = r2.exec(str); // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (anchored && match && match.index !== pos) - match = null; - if (regex.global) - regex.lastIndex = match ? r2.lastIndex : 0; - return match; - }; - - // Breaks the unrestorable link to XRegExp's private list of tokens, thereby preventing - // syntax and flag changes. Should be run after XRegExp and any plugins are loaded - XRegExp.freezeTokens = function () { - XRegExp.addToken = function () { - throw Error("can't run addToken after freezeTokens"); - }; - }; - - // Accepts any value; returns a Boolean indicating whether the argument is a `RegExp` object. - // Note that this is also `true` for regex literals and regexes created by the `XRegExp` - // constructor. This works correctly for variables created in another frame, when `instanceof` - // and `constructor` checks would fail to work as intended - XRegExp.isRegExp = function (o) { - return Object.prototype.toString.call(o) === "[object RegExp]"; - }; - - // Executes `callback` once per match within `str`. Provides a simpler and cleaner way to - // iterate over regex matches compared to the traditional approaches of subverting - // `String.prototype.replace` or repeatedly calling `exec` within a `while` loop - XRegExp.iterate = function (str, regex, callback, context) { - var r2 = clone(regex, "g"), - i = -1, match; - while (match = r2.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (regex.global) - regex.lastIndex = r2.lastIndex; // Doing this to follow expectations if `lastIndex` is checked within `callback` - callback.call(context, match, ++i, str, regex); - if (r2.lastIndex === match.index) - r2.lastIndex++; - } - if (regex.global) - regex.lastIndex = 0; - }; - - // Accepts a string and an array of regexes; returns the result of using each successive regex - // to search within the matches of the previous regex. The array of regexes can also contain - // objects with `regex` and `backref` properties, in which case the named or numbered back- - // references specified are passed forward to the next regex or returned. E.g.: - // var xregexpImgFileNames = XRegExp.matchChain(html, [ - // {regex: /]+)>/i, backref: 1}, // tag attributes - // {regex: XRegExp('(?ix) \\s src=" (? [^"]+ )'), backref: "src"}, // src attribute values - // {regex: XRegExp("^http://xregexp\\.com(/[^#?]+)", "i"), backref: 1}, // xregexp.com paths - // /[^\/]+$/ // filenames (strip directory paths) - // ]); - XRegExp.matchChain = function (str, chain) { - return function recurseChain (values, level) { - var item = chain[level].regex ? chain[level] : {regex: chain[level]}, - regex = clone(item.regex, "g"), - matches = [], i; - for (i = 0; i < values.length; i++) { - XRegExp.iterate(values[i], regex, function (match) { - matches.push(item.backref ? (match[item.backref] || "") : match[0]); - }); - } - return ((level === chain.length - 1) || !matches.length) ? - matches : recurseChain(matches, level + 1); - }([str], 0); - }; - - - //--------------------------------- - // New RegExp prototype methods - //--------------------------------- - - // Accepts a context object and arguments array; returns the result of calling `exec` with the - // first value in the arguments array. the context is ignored but is accepted for congruity - // with `Function.prototype.apply` - RegExp.prototype.apply = function (context, args) { - return this.exec(args[0]); - }; - - // Accepts a context object and string; returns the result of calling `exec` with the provided - // string. the context is ignored but is accepted for congruity with `Function.prototype.call` - RegExp.prototype.call = function (context, str) { - return this.exec(str); - }; - - - //--------------------------------- - // Overriden native methods - //--------------------------------- - - // Adds named capture support (with backreferences returned as `result.name`), and fixes two - // cross-browser issues per ES3: - // - Captured values for nonparticipating capturing groups should be returned as `undefined`, - // rather than the empty string. - // - `lastIndex` should not be incremented after zero-length matches. - RegExp.prototype.exec = function (str) { - var match, name, r2, origLastIndex; - if (!this.global) - origLastIndex = this.lastIndex; - match = nativ.exec.apply(this, arguments); - if (match) { - // Fix browsers whose `exec` methods don't consistently return `undefined` for - // nonparticipating capturing groups - if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { - r2 = RegExp(this.source, nativ.replace.call(getNativeFlags(this), "g", "")); - // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed - // matching due to characters outside the match - nativ.replace.call((str + "").slice(match.index), r2, function () { - for (var i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) - match[i] = undefined; - } - }); - } - // Attach named capture properties - if (this._xregexp && this._xregexp.captureNames) { - for (var i = 1; i < match.length; i++) { - name = this._xregexp.captureNames[i - 1]; - if (name) - match[name] = match[i]; - } - } - // Fix browsers that increment `lastIndex` after zero-length matches - if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - } - if (!this.global) - this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - return match; - }; - - // Fix browser bugs in native method - RegExp.prototype.test = function (str) { - // Use the native `exec` to skip some processing overhead, even though the altered - // `exec` would take care of the `lastIndex` fixes - var match, origLastIndex; - if (!this.global) - origLastIndex = this.lastIndex; - match = nativ.exec.call(this, str); - // Fix browsers that increment `lastIndex` after zero-length matches - if (match && !compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - if (!this.global) - this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - return !!match; - }; - - // Adds named capture support and fixes browser bugs in native method - String.prototype.match = function (regex) { - if (!XRegExp.isRegExp(regex)) - regex = RegExp(regex); // Native `RegExp` - if (regex.global) { - var result = nativ.match.apply(this, arguments); - regex.lastIndex = 0; // Fix IE bug - return result; - } - return regex.exec(this); // Run the altered `exec` - }; - - // Adds support for `${n}` tokens for named and numbered backreferences in replacement text, - // and provides named backreferences to replacement functions as `arguments[0].name`. Also - // fixes cross-browser differences in replacement text syntax when performing a replacement - // using a nonregex search value, and the value of replacement regexes' `lastIndex` property - // during replacement iterations. Note that this doesn't support SpiderMonkey's proprietary - // third (`flags`) parameter - String.prototype.replace = function (search, replacement) { - var isRegex = XRegExp.isRegExp(search), - captureNames, result, str, origLastIndex; - - // There are too many combinations of search/replacement types/values and browser bugs that - // preclude passing to native `replace`, so don't try - //if (...) - // return nativ.replace.apply(this, arguments); - - if (isRegex) { - if (search._xregexp) - captureNames = search._xregexp.captureNames; // Array or `null` - if (!search.global) - origLastIndex = search.lastIndex; - } else { - search = search + ""; // Type conversion - } - - if (Object.prototype.toString.call(replacement) === "[object Function]") { - result = nativ.replace.call(this + "", search, function () { - if (captureNames) { - // Change the `arguments[0]` string primitive to a String object which can store properties - arguments[0] = new String(arguments[0]); - // Store named backreferences on `arguments[0]` - for (var i = 0; i < captureNames.length; i++) { - if (captureNames[i]) - arguments[0][captureNames[i]] = arguments[i + 1]; - } - } - // Update `lastIndex` before calling `replacement` (fix browsers) - if (isRegex && search.global) - search.lastIndex = arguments[arguments.length - 2] + arguments[0].length; - return replacement.apply(null, arguments); - }); - } else { - str = this + ""; // Type conversion, so `args[args.length - 1]` will be a string (given nonstring `this`) - result = nativ.replace.call(str, search, function () { - var args = arguments; // Keep this function's `arguments` available through closure - return nativ.replace.call(replacement + "", replacementToken, function ($0, $1, $2) { - // Numbered backreference (without delimiters) or special variable - if ($1) { - switch ($1) { - case "$": return "$"; - case "&": return args[0]; - case "`": return args[args.length - 1].slice(0, args[args.length - 2]); - case "'": return args[args.length - 1].slice(args[args.length - 2] + args[0].length); - // Numbered backreference - default: - // What does "$10" mean? - // - Backreference 10, if 10 or more capturing groups exist - // - Backreference 1 followed by "0", if 1-9 capturing groups exist - // - Otherwise, it's the string "$10" - // Also note: - // - Backreferences cannot be more than two digits (enforced by `replacementToken`) - // - "$01" is equivalent to "$1" if a capturing group exists, otherwise it's the string "$01" - // - There is no "$0" token ("$&" is the entire match) - var literalNumbers = ""; - $1 = +$1; // Type conversion; drop leading zero - if (!$1) // `$1` was "0" or "00" - return $0; - while ($1 > args.length - 3) { - literalNumbers = String.prototype.slice.call($1, -1) + literalNumbers; - $1 = Math.floor($1 / 10); // Drop the last digit - } - return ($1 ? args[$1] || "" : "$") + literalNumbers; - } - // Named backreference or delimited numbered backreference - } else { - // What does "${n}" mean? - // - Backreference to numbered capture n. Two differences from "$n": - // - n can be more than two digits - // - Backreference 0 is allowed, and is the entire match - // - Backreference to named capture n, if it exists and is not a number overridden by numbered capture - // - Otherwise, it's the string "${n}" - var n = +$2; // Type conversion; drop leading zeros - if (n <= args.length - 3) - return args[n]; - n = captureNames ? indexOf(captureNames, $2) : -1; - return n > -1 ? args[n + 1] : $0; - } - }); - }); - } - - if (isRegex) { - if (search.global) - search.lastIndex = 0; // Fix IE, Safari bug (last tested IE 9.0.5, Safari 5.1.2 on Windows) - else - search.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - } - - return result; - }; - - // A consistent cross-browser, ES3 compliant `split` - String.prototype.split = function (s /* separator */, limit) { - // If separator `s` is not a regex, use the native `split` - if (!XRegExp.isRegExp(s)) - return nativ.split.apply(this, arguments); - - var str = this + "", // Type conversion - output = [], - lastLastIndex = 0, - match, lastLength; - - // Behavior for `limit`: if it's... - // - `undefined`: No limit - // - `NaN` or zero: Return an empty array - // - A positive number: Use `Math.floor(limit)` - // - A negative number: No limit - // - Other: Type-convert, then use the above rules - if (limit === undefined || +limit < 0) { - limit = Infinity; - } else { - limit = Math.floor(+limit); - if (!limit) - return []; - } - - // This is required if not `s.global`, and it avoids needing to set `s.lastIndex` to zero - // and restore it to its original value when we're done using the regex - s = XRegExp.copyAsGlobal(s); - - while (match = s.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (s.lastIndex > lastLastIndex) { - output.push(str.slice(lastLastIndex, match.index)); - - if (match.length > 1 && match.index < str.length) - Array.prototype.push.apply(output, match.slice(1)); - - lastLength = match[0].length; - lastLastIndex = s.lastIndex; - - if (output.length >= limit) - break; - } - - if (s.lastIndex === match.index) - s.lastIndex++; - } - - if (lastLastIndex === str.length) { - if (!nativ.test.call(s, "") || lastLength) - output.push(""); - } else { - output.push(str.slice(lastLastIndex)); - } - - return output.length > limit ? output.slice(0, limit) : output; - }; - - - //--------------------------------- - // Private helper functions - //--------------------------------- - - // Supporting function for `XRegExp`, `XRegExp.copyAsGlobal`, etc. Returns a copy of a `RegExp` - // instance with a fresh `lastIndex` (set to zero), preserving properties required for named - // capture. Also allows adding new flags in the process of copying the regex - function clone (regex, additionalFlags) { - if (!XRegExp.isRegExp(regex)) - throw TypeError("type RegExp expected"); - var x = regex._xregexp; - regex = XRegExp(regex.source, getNativeFlags(regex) + (additionalFlags || "")); - if (x) { - regex._xregexp = { - source: x.source, - captureNames: x.captureNames ? x.captureNames.slice(0) : null - }; - } - return regex; - } - - function getNativeFlags (regex) { - return (regex.global ? "g" : "") + - (regex.ignoreCase ? "i" : "") + - (regex.multiline ? "m" : "") + - (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 - (regex.sticky ? "y" : ""); - } - - function runTokens (pattern, index, scope, context) { - var i = tokens.length, - result, match, t; - // Protect against constructing XRegExps within token handler and trigger functions - isInsideConstructor = true; - // Must reset `isInsideConstructor`, even if a `trigger` or `handler` throws - try { - while (i--) { // Run in reverse order - t = tokens[i]; - if ((scope & t.scope) && (!t.trigger || t.trigger.call(context))) { - t.pattern.lastIndex = index; - match = t.pattern.exec(pattern); // Running the altered `exec` here allows use of named backreferences, etc. - if (match && match.index === index) { - result = { - output: t.handler.call(context, match, scope), - match: match - }; - break; - } - } - } - } catch (err) { - throw err; - } finally { - isInsideConstructor = false; - } - return result; - } - - function indexOf (array, item, from) { - if (Array.prototype.indexOf) // Use the native array method if available - return array.indexOf(item, from); - for (var i = from || 0; i < array.length; i++) { - if (array[i] === item) - return i; - } - return -1; - } - - - //--------------------------------- - // Built-in tokens - //--------------------------------- - - // Augment XRegExp's regular expression syntax and flags. Note that when adding tokens, the - // third (`scope`) argument defaults to `XRegExp.OUTSIDE_CLASS` - - // Comment pattern: (?# ) - XRegExp.addToken( - /\(\?#[^)]*\)/, - function (match) { - // Keep tokens separated unless the following token is a quantifier - return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; - } - ); - - // Capturing group (match the opening parenthesis only). - // Required for support of named capturing groups - XRegExp.addToken( - /\((?!\?)/, - function () { - this.captureNames.push(null); - return "("; - } - ); - - // Named capturing group (match the opening delimiter only): (? - XRegExp.addToken( - /\(\?<([$\w]+)>/, - function (match) { - this.captureNames.push(match[1]); - this.hasNamedCapture = true; - return "("; - } - ); - - // Named backreference: \k - XRegExp.addToken( - /\\k<([\w$]+)>/, - function (match) { - var index = indexOf(this.captureNames, match[1]); - // Keep backreferences separate from subsequent literal numbers. Preserve back- - // references to named groups that are undefined at this point as literal strings - return index > -1 ? - "\\" + (index + 1) + (isNaN(match.input.charAt(match.index + match[0].length)) ? "" : "(?:)") : - match[0]; - } - ); - - // Empty character class: [] or [^] - XRegExp.addToken( - /\[\^?]/, - function (match) { - // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. - // (?!) should work like \b\B, but is unreliable in Firefox - return match[0] === "[]" ? "\\b\\B" : "[\\s\\S]"; - } - ); - - // Mode modifier at the start of the pattern only, with any combination of flags imsx: (?imsx) - // Does not support x(?i), (?-i), (?i-m), (?i: ), (?i)(?m), etc. - XRegExp.addToken( - /^\(\?([imsx]+)\)/, - function (match) { - this.setFlag(match[1]); - return ""; - } - ); - - // Whitespace and comments, in free-spacing (aka extended) mode only - XRegExp.addToken( - /(?:\s+|#.*)+/, - function (match) { - // Keep tokens separated unless the following token is a quantifier - return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; - }, - XRegExp.OUTSIDE_CLASS, - function () {return this.hasFlag("x");} - ); - - // Dot, in dotall (aka singleline) mode only - XRegExp.addToken( - /\./, - function () {return "[\\s\\S]";}, - XRegExp.OUTSIDE_CLASS, - function () {return this.hasFlag("s");} - ); - - - //--------------------------------- - // Backward compatibility - //--------------------------------- - - // Uncomment the following block for compatibility with XRegExp 1.0-1.2: - /* - XRegExp.matchWithinChain = XRegExp.matchChain; - RegExp.prototype.addFlags = function (s) {return clone(this, s);}; - RegExp.prototype.execAll = function (s) {var r = []; XRegExp.iterate(s, this, function (m) {r.push(m);}); return r;}; - RegExp.prototype.forEachExec = function (s, f, c) {return XRegExp.iterate(s, this, f, c);}; - RegExp.prototype.validate = function (s) {var r = RegExp("^(?:" + this.source + ")$(?!\\s)", getNativeFlags(this)); if (this.global) this.lastIndex = 0; return s.search(r) === 0;}; - */ - -})(); - -// -// Begin anonymous function. This is used to contain local scope variables without polutting global scope. -// -if (typeof(SyntaxHighlighter) == 'undefined') var SyntaxHighlighter = function() { - -// CommonJS - if (typeof(require) != 'undefined' && typeof(XRegExp) == 'undefined') - { - XRegExp = require('XRegExp').XRegExp; - } - -// Shortcut object which will be assigned to the SyntaxHighlighter variable. -// This is a shorthand for local reference in order to avoid long namespace -// references to SyntaxHighlighter.whatever... - var sh = { - defaults : { - /** Additional CSS class names to be added to highlighter elements. */ - 'class-name' : '', - - /** First line number. */ - 'first-line' : 1, - - /** - * Pads line numbers. Possible values are: - * - * false - don't pad line numbers. - * true - automaticaly pad numbers with minimum required number of leading zeroes. - * [int] - length up to which pad line numbers. - */ - 'pad-line-numbers' : false, - - /** Lines to highlight. */ - 'highlight' : false, - - /** Title to be displayed above the code block. */ - 'title' : null, - - /** Enables or disables smart tabs. */ - 'smart-tabs' : true, - - /** Gets or sets tab size. */ - 'tab-size' : 4, - - /** Enables or disables gutter. */ - 'gutter' : true, - - /** Enables or disables toolbar. */ - 'toolbar' : true, - - /** Enables quick code copy and paste from double click. */ - 'quick-code' : true, - - /** Forces code view to be collapsed. */ - 'collapse' : false, - - /** Enables or disables automatic links. */ - 'auto-links' : false, - - /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */ - 'light' : false, - - 'unindent' : true, - - 'html-script' : false - }, - - config : { - space : ' ', - - /** Enables use of - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/attachment.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/attachment.css deleted file mode 100644 index 15f49edde77447afcf9662bbe221ed18fe15dabc..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/attachment.css +++ /dev/null @@ -1,682 +0,0 @@ -@charset "utf-8"; -/* dialog样式 */ -.wrapper { - zoom: 1; - width: 630px; - *width: 626px; - height: 380px; - margin: 0 auto; - padding: 10px; - position: relative; - font-family: sans-serif; -} - -/*tab样式框大小*/ -.tabhead { - float:left; -} -.tabbody { - width: 100%; - height: 346px; - position: relative; - clear: both; -} - -.tabbody .panel { - position: absolute; - width: 0; - height: 0; - background: #fff; - overflow: hidden; - display: none; -} - -.tabbody .panel.focus { - width: 100%; - height: 346px; - display: block; -} - -/* 上传附件 */ -.tabbody #upload.panel { - width: 0; - height: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); - background: #fff; - display: block; -} - -.tabbody #upload.panel.focus { - width: 100%; - height: 346px; - display: block; - clip: auto; -} - -#upload .queueList { - margin: 0; - width: 100%; - height: 100%; - position: absolute; - overflow: hidden; -} - -#upload p { - margin: 0; -} - -.element-invisible { - width: 0 !important; - height: 0 !important; - border: 0; - padding: 0; - margin: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); -} - -#upload .placeholder { - margin: 10px; - /*border: 2px dashed #e6e6e6;*/ - height: 172px; - padding-top: 150px; - text-align: center; - /*background: url(./images/image.png) center 70px no-repeat;*/ - background-color: #f3f3f3; - color: #cccccc; - font-size: 18px; - position: relative; - top:0; - *top: 10px; -} - -#upload .placeholder .webuploader-pick { - font-size: 16px; - background: #f3f3f3; - border-radius: 3px; - line-height: 44px; - padding: 0 30px; - color: #646464; - display: inline-block; - margin: 0 auto 20px auto; - cursor: pointer; - /* box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); */ - border: 1px solid #ccc; -} - -#upload .placeholder .webuploader-pick-hover { - border: 1px solid #00a2d4; - color: #00a2d4; -} - - -#filePickerContainer { - text-align: center; -} - -#upload .placeholder .flashTip { - color: #666666; - font-size: 12px; - position: absolute; - width: 100%; - text-align: center; - bottom: 20px; -} - -#upload .placeholder .flashTip a { - color: #0785d1; - text-decoration: none; -} - -#upload .placeholder .flashTip a:hover { - text-decoration: underline; -} - -#upload .placeholder.webuploader-dnd-over { - border-color: #999999; -} - -#upload .filelist { - list-style: none; - margin: 0; - padding: 0; - overflow-x: hidden; - overflow-y: auto; - position: relative; - height: 300px; -} - -#upload .filelist:after { - content: ''; - display: block; - width: 0; - height: 0; - overflow: hidden; - clear: both; -} - -#upload .filelist li { - width: 113px; - height: 113px; - background: url(./images/bg.png); - text-align: center; - margin: 9px 0 0 9px; - *margin: 6px 0 0 6px; - position: relative; - display: block; - float: left; - overflow: hidden; - font-size: 12px; -} - -#upload .filelist li p.log { - position: relative; - top: -45px; -} - -#upload .filelist li p.title { - position: absolute; - top: 0; - left: 0; - width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - top: 5px; - text-indent: 5px; - text-align: left; -} - -#upload .filelist li p.progress { - position: absolute; - width: 100%; - bottom: 0; - left: 0; - height: 8px; - overflow: hidden; - z-index: 50; - margin: 0; - border-radius: 0; - background: none; - -webkit-box-shadow: 0 0 0; -} - -#upload .filelist li p.progress span { - display: none; - overflow: hidden; - width: 0; - height: 100%; - background: #1483d8 url(./images/progress.png) repeat-x; - - -webit-transition: width 200ms linear; - -moz-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; - transition: width 200ms linear; - - -webkit-animation: progressmove 2s linear infinite; - -moz-animation: progressmove 2s linear infinite; - -o-animation: progressmove 2s linear infinite; - -ms-animation: progressmove 2s linear infinite; - animation: progressmove 2s linear infinite; - - -webkit-transform: translateZ(0); -} - -@-webkit-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@-moz-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -#upload .filelist li p.imgWrap { - position: relative; - z-index: 2; - line-height: 113px; - vertical-align: middle; - overflow: hidden; - width: 113px; - height: 113px; - - -webkit-transform-origin: 50% 50%; - -moz-transform-origin: 50% 50%; - -o-transform-origin: 50% 50%; - -ms-transform-origin: 50% 50%; - transform-origin: 50% 50%; - - -webit-transition: 200ms ease-out; - -moz-transition: 200ms ease-out; - -o-transition: 200ms ease-out; - -ms-transition: 200ms ease-out; - transition: 200ms ease-out; -} -#upload .filelist li p.imgWrap.notimage { - margin-top: 0; - width: 111px; - height: 111px; - border: 1px #eeeeee solid; -} -#upload .filelist li p.imgWrap.notimage i.file-preview { - margin-top: 15px; -} - -#upload .filelist li img { - width: 100%; -} - -#upload .filelist li p.error { - background: #f43838; - color: #fff; - position: absolute; - bottom: 0; - left: 0; - height: 28px; - line-height: 28px; - width: 100%; - z-index: 100; - display:none; -} - -#upload .filelist li .success { - display: block; - position: absolute; - left: 0; - bottom: 0; - height: 40px; - width: 100%; - z-index: 200; - background: url(./images/success.png) no-repeat right bottom; - background-image: url(./images/success.gif) \9; -} - -#upload .filelist li.filePickerBlock { - width: 113px; - height: 113px; - background: url(../fonts/images/addfile.svg) no-repeat center; - border: 1px solid #eeeeee; - border-radius: 0; -} -#upload .filelist li.filePickerBlock div.webuploader-pick { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - opacity: 0; - background: none; - font-size: 0; -} - -#upload .filelist div.file-panel { - position: absolute; - height: 0; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0; - background: rgba(0, 0, 0, 0.5); - width: 100%; - top: 0; - left: 0; - overflow: hidden; - z-index: 300; -} - -#upload .filelist div.file-panel span { - width: 24px; - height: 24px; - display: inline; - float: right; - text-indent: -9999px; - overflow: hidden; - background: url(./images/icons.png) no-repeat; - background: url(./images/icons.gif) no-repeat \9; - margin: 5px 1px 1px; - cursor: pointer; - -webkit-tap-highlight-color: rgba(0,0,0,0); - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -#upload .filelist div.file-panel span.rotateLeft { - display:none; - background-position: 0 -24px; -} - -#upload .filelist div.file-panel span.rotateLeft:hover { - background-position: 0 0; -} - -#upload .filelist div.file-panel span.rotateRight { - display:none; - background-position: -24px -24px; -} - -#upload .filelist div.file-panel span.rotateRight:hover { - background-position: -24px 0; -} - -#upload .filelist div.file-panel span.cancel { - background-position: -48px -24px; -} - -#upload .filelist div.file-panel span.cancel:hover { - background-position: -48px 0; -} - -#upload .statusBar { - height: 45px; - border-bottom: 1px solid #dadada; - margin: 0 10px; - padding: 0; - line-height: 45px; - vertical-align: middle; - position: relative; -} - -#upload .statusBar .progress { - border: 1px solid #1483d8; - width: 198px; - background: #fff; - height: 18px; - position: absolute; - top: 12px; - display: none; - text-align: center; - line-height: 18px; - color: #6dbfff; - margin: 0 10px 0 0; -} -#upload .statusBar .progress span.percentage { - width: 0; - height: 100%; - left: 0; - top: 0; - background: #1483d8; - position: absolute; -} -#upload .statusBar .progress span.text { - position: relative; - z-index: 10; -} - -#upload .statusBar .info { - display: inline-block; - font-size: 14px; - color: #666666; -} - -#upload .statusBar .btns { - position: absolute; - top: 7px; - right: 0; - line-height: 30px; -} - -#filePickerBtn { - display: inline-block; - float: left; -} -#upload .statusBar .btns .webuploader-pick, -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-uploading, -#upload .statusBar .btns .uploadBtn.state-paused { - background: #ffffff; - border: 1px solid #cfcfcf; - color: #565656; - padding: 0 18px; - display: inline-block; - border-radius: 3px; - margin-left: 10px; - cursor: pointer; - font-size: 14px; - float: left; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -#upload .statusBar .btns .webuploader-pick-hover, -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-uploading:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover { - background: #f0f0f0; -} - -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-paused{ - background: #00b7ee; - color: #fff; - border-color: transparent; -} -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover{ - background: #00a2d4; -} - -#upload .statusBar .btns .uploadBtn.disabled { - pointer-events: none; - filter:alpha(opacity=60); - -moz-opacity:0.6; - -khtml-opacity: 0.6; - opacity: 0.6; -} - - - -/* 图片管理样式 */ -#online { - width: 100%; - height: 336px; - padding: 10px 0 0 0; -} -#online #fileList{ - width: 100%; - height: 100%; - overflow-x: hidden; - overflow-y: auto; - position: relative; -} -#online ul { - display: block; - list-style: none; - margin: 0; - padding: 0; -} -#online li { - float: left; - display: block; - list-style: none; - padding: 0; - width: 113px; - height: 113px; - margin: 0 0 9px 9px; - *margin: 0 0 6px 6px; - background-color: #eee; - overflow: hidden; - cursor: pointer; - position: relative; -} -#online li.clearFloat { - float: none; - clear: both; - display: block; - width:0; - height:0; - margin: 0; - padding: 0; -} -#online li img { - cursor: pointer; -} -#online li div.file-wrapper { - cursor: pointer; - position: absolute; - display: block; - width: 111px; - height: 111px; - border: 1px solid #eee; - background: url("./images/bg.png") repeat; -} -#online li div span.file-title{ - display: block; - padding: 0 3px; - margin: 3px 0 0 0; - font-size: 12px; - height: 15px; - color: #555555; - text-align: center; - width: 107px; - white-space: nowrap; - word-break: break-all; - overflow: hidden; - text-overflow: ellipsis; -} -#online li .icon { - cursor: pointer; - width: 113px; - height: 113px; - position: absolute; - top: 0; - left: 0; - z-index: 2; - border: 0; - background-repeat: no-repeat; -} -#online li .icon:hover { - width: 107px; - height: 107px; - border: 3px solid #1094fa; -} -#online li.selected .icon { - background-image: url(images/success.png); - background-image: url(images/success.gif) \9; - background-position: 75px 75px; -} -#online li.selected .icon:hover { - width: 107px; - height: 107px; - border: 3px solid #1094fa; - background-position: 72px 72px; -} - - -/* 在线文件的文件预览图标 */ -i.file-preview { - display: block; - margin: 10px auto; - width: 70px; - height: 70px; - background-image: url("./images/file-icons.png"); - background-image: url("./images/file-icons.gif") \9; - background-position: -140px center; - background-repeat: no-repeat; -} -i.file-preview.file-type-dir{ - background-position: 0 center; -} -i.file-preview.file-type-file{ - background-position: -140px center; -} -i.file-preview.file-type-filelist{ - background-position: -210px center; -} -i.file-preview.file-type-zip, -i.file-preview.file-type-rar, -i.file-preview.file-type-7z, -i.file-preview.file-type-tar, -i.file-preview.file-type-gz, -i.file-preview.file-type-bz2{ - background-position: -280px center; -} -i.file-preview.file-type-xls, -i.file-preview.file-type-xlsx{ - background-position: -350px center; -} -i.file-preview.file-type-doc, -i.file-preview.file-type-docx{ - background-position: -420px center; -} -i.file-preview.file-type-ppt, -i.file-preview.file-type-pptx{ - background-position: -490px center; -} -i.file-preview.file-type-vsd{ - background-position: -560px center; -} -i.file-preview.file-type-pdf{ - background-position: -630px center; -} -i.file-preview.file-type-txt, -i.file-preview.file-type-md, -i.file-preview.file-type-json, -i.file-preview.file-type-htm, -i.file-preview.file-type-xml, -i.file-preview.file-type-html, -i.file-preview.file-type-js, -i.file-preview.file-type-css, -i.file-preview.file-type-php, -i.file-preview.file-type-jsp, -i.file-preview.file-type-asp{ - background-position: -700px center; -} -i.file-preview.file-type-apk{ - background-position: -770px center; -} -i.file-preview.file-type-exe{ - background-position: -840px center; -} -i.file-preview.file-type-ipa{ - background-position: -910px center; -} -i.file-preview.file-type-mp4, -i.file-preview.file-type-swf, -i.file-preview.file-type-mkv, -i.file-preview.file-type-avi, -i.file-preview.file-type-flv, -i.file-preview.file-type-mov, -i.file-preview.file-type-mpg, -i.file-preview.file-type-mpeg, -i.file-preview.file-type-ogv, -i.file-preview.file-type-webm, -i.file-preview.file-type-rm, -i.file-preview.file-type-rmvb{ - background-position: -980px center; -} -i.file-preview.file-type-ogg, -i.file-preview.file-type-wav, -i.file-preview.file-type-wmv, -i.file-preview.file-type-mid, -i.file-preview.file-type-mp3{ - background-position: -1050px center; -} -i.file-preview.file-type-jpg, -i.file-preview.file-type-jpeg, -i.file-preview.file-type-gif, -i.file-preview.file-type-bmp, -i.file-preview.file-type-png, -i.file-preview.file-type-psd{ - background-position: -140px center; -} diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/attachment.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/attachment.html deleted file mode 100644 index f698f192c320a7316298b720d08607459ed61fca..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/attachment.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - neditor图片对话框 - - - - - - - - - - - - - - -
                      -
                      - - -
                      -
                      - -
                      -
                      -
                      -
                      - 0% - -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                        -
                      • -
                      -
                      -
                      - - -
                      -
                      -
                      - -
                      -
                      - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/attachment.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/attachment.js deleted file mode 100644 index d9598b049d7a31250d0a455ea82cd0df161418cd..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/attachment.js +++ /dev/null @@ -1,775 +0,0 @@ -/** - * User: Jinqn - * Date: 14-04-08 - * Time: 下午16:34 - * 上传图片对话框逻辑代码,包括tab: 远程图片/上传图片/在线图片/搜索图片 - */ - -(function () { - - var uploadFile, - onlineFile; - - window.onload = function () { - initTabs(); - initButtons(); - }; - - /* 初始化tab标签 */ - function initTabs() { - var tabs = $G('tabhead').children; - for (var i = 0; i < tabs.length; i++) { - domUtils.on(tabs[i], "click", function (e) { - var target = e.target || e.srcElement; - setTabFocus(target.getAttribute('data-content-id')); - }); - } - - setTabFocus('upload'); - } - - /* 初始化tabbody */ - function setTabFocus(id) { - if(!id) return; - var i, bodyId, tabs = $G('tabhead').children; - for (i = 0; i < tabs.length; i++) { - bodyId = tabs[i].getAttribute('data-content-id') - if (bodyId == id) { - domUtils.addClass(tabs[i], 'focus'); - domUtils.addClass($G(bodyId), 'focus'); - } else { - domUtils.removeClasses(tabs[i], 'focus'); - domUtils.removeClasses($G(bodyId), 'focus'); - } - } - switch (id) { - case 'upload': - uploadFile = uploadFile || new UploadFile('queueList'); - break; - case 'online': - onlineFile = onlineFile || new OnlineFile('fileList'); - break; - } - } - - /* 初始化onok事件 */ - function initButtons() { - - dialog.onok = function () { - var list = [], id, tabs = $G('tabhead').children; - for (var i = 0; i < tabs.length; i++) { - if (domUtils.hasClass(tabs[i], 'focus')) { - id = tabs[i].getAttribute('data-content-id'); - break; - } - } - - switch (id) { - case 'upload': - list = uploadFile.getInsertList(); - var count = uploadFile.getQueueCount(); - if (count) { - $('.info', '#queueList').html('' + '还有2个未上传文件'.replace(/[\d]/, count) + ''); - return false; - } - break; - case 'online': - list = onlineFile.getInsertList(); - break; - } - - editor.execCommand('insertfile', list); - }; - } - - - /* 上传附件 */ - function UploadFile(target) { - this.$wrap = target.constructor == String ? $('#' + target) : $(target); - this.init(); - } - UploadFile.prototype = { - init: function () { - this.fileList = []; - this.initContainer(); - this.initUploader(); - }, - initContainer: function () { - this.$queue = this.$wrap.find('.filelist'); - }, - /* 初始化容器 */ - initUploader: function () { - var _this = this, - $ = jQuery, // just in case. Make sure it's not an other libaray. - $wrap = _this.$wrap, - // 图片容器 - $queue = $wrap.find('.filelist'), - // 状态栏,包括进度和控制按钮 - $statusBar = $wrap.find('.statusBar'), - // 文件总体选择信息。 - $info = $statusBar.find('.info'), - // 上传按钮 - $upload = $wrap.find('.uploadBtn'), - // 上传按钮 - $filePickerBtn = $wrap.find('.filePickerBtn'), - // 上传按钮 - $filePickerBlock = $wrap.find('.filePickerBlock'), - // 没选择文件之前的内容。 - $placeHolder = $wrap.find('.placeholder'), - // 总体进度条 - $progress = $statusBar.find('.progress').hide(), - // 添加的文件数量 - fileCount = 0, - // 添加的文件总大小 - fileSize = 0, - // 优化retina, 在retina下这个值是2 - ratio = window.devicePixelRatio || 1, - // 缩略图大小 - thumbnailWidth = 113 * ratio, - thumbnailHeight = 113 * ratio, - // 可能有pedding, ready, uploading, confirm, done. - state = '', - // 所有文件的进度信息,key为file id - percentages = {}, - supportTransition = (function () { - var s = document.createElement('p').style, - r = 'transition' in s || - 'WebkitTransition' in s || - 'MozTransition' in s || - 'msTransition' in s || - 'OTransition' in s; - s = null; - return r; - })(), - // WebUploader实例 - uploader, - actionUrl = editor.getActionUrl(editor.getOpt('fileActionName')), - fileMaxSize = editor.getOpt('fileMaxSize'), - acceptExtensions = (editor.getOpt('fileAllowFiles') || - [".txt",".doc",".docs",".xls",".xlsx",".ppt",".pdf",".odt",".ott",".fodt",".uot",".xml",".dot",".htm",".html",".rtf",".docm",".zip",".rar",".tar",".7z",".tar.gz",".tar.bz",".tar.xz"]).join('').replace(/\./g, ',').replace(/^[,]/, '');; - if (!WebUploader.Uploader.support()) { - $('#filePickerReady').after($('
                      ').html(lang.errorNotSupport)).hide(); - return; - } else if (!editor.getOpt('fileActionName')) { - $('#filePickerReady').after($('
                      ').html(lang.errorLoadConfig)).hide(); - return; - } - - uploader = _this.uploader = WebUploader.create({ - pick: { - id: '#filePickerReady', - label: lang.uploadSelectFile - }, - swf: '../../third-party/webuploader/Uploader.swf', - server: actionUrl, - fileVal: editor.getOpt('fileFieldName'), - duplicate: true, - fileSingleSizeLimit: fileMaxSize, - compress: false - }); - uploader.addButton({ - id: '#filePickerBlock' - }); - uploader.addButton({ - id: '#filePickerBtn', - label: lang.uploadAddFile - }); - - setState('pedding'); - - // 当有文件添加进来时执行,负责view的创建 - function addFile(file) { - var $li = $('
                    • ' + - '

                      ' + file.name + '

                      ' + - '

                      ' + - '

                      ' + - '
                    • '), - - $btns = $('
                      ' + - '' + lang.uploadDelete + '' + - '' + lang.uploadTurnRight + '' + - '' + lang.uploadTurnLeft + '
                      ').appendTo($li), - $prgress = $li.find('p.progress span'), - $wrap = $li.find('p.imgWrap'), - $info = $('

                      ').hide().appendTo($li), - - showError = function (code) { - switch (code) { - case 'exceed_size': - text = lang.errorExceedSize; - break; - case 'interrupt': - text = lang.errorInterrupt; - break; - case 'http': - text = lang.errorHttp; - break; - case 'not_allow_type': - text = lang.errorFileType; - break; - default: - text = lang.errorUploadRetry; - break; - } - $info.text(text).show(); - }; - - if (file.getStatus() === 'invalid') { - showError(file.statusText); - } else { - $wrap.text(lang.uploadPreview); - if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|'+file.ext.toLowerCase()+'|') == -1) { - $wrap.empty().addClass('notimage').append('' + - '' + file.name + ''); - } else { - if (browser.ie && browser.version <= 7) { - $wrap.text(lang.uploadNoPreview); - } else { - uploader.makeThumb(file, function (error, src) { - if (error || !src) { - $wrap.text(lang.uploadNoPreview); - } else { - var $img = $(''); - $wrap.empty().append($img); - $img.on('error', function () { - $wrap.text(lang.uploadNoPreview); - }); - } - }, thumbnailWidth, thumbnailHeight); - } - } - percentages[ file.id ] = [ file.size, 0 ]; - file.rotation = 0; - - /* 检查文件格式 */ - if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) { - showError('not_allow_type'); - uploader.removeFile(file); - } - } - - file.on('statuschange', function (cur, prev) { - if (prev === 'progress') { - $prgress.hide().width(0); - } else if (prev === 'queued') { - $li.off('mouseenter mouseleave'); - $btns.remove(); - } - // 成功 - if (cur === 'error' || cur === 'invalid') { - showError(file.statusText); - percentages[ file.id ][ 1 ] = 1; - } else if (cur === 'interrupt') { - showError('interrupt'); - } else if (cur === 'queued') { - percentages[ file.id ][ 1 ] = 0; - } else if (cur === 'progress') { - $info.hide(); - $prgress.css('display', 'block'); - } else if (cur === 'complete') { - } - - $li.removeClass('state-' + prev).addClass('state-' + cur); - }); - - $li.on('mouseenter', function () { - $btns.stop().animate({height: 30}); - }); - $li.on('mouseleave', function () { - $btns.stop().animate({height: 0}); - }); - - $btns.on('click', 'span', function () { - var index = $(this).index(), - deg; - - switch (index) { - case 0: - uploader.removeFile(file); - return; - case 1: - file.rotation += 90; - break; - case 2: - file.rotation -= 90; - break; - } - - if (supportTransition) { - deg = 'rotate(' + file.rotation + 'deg)'; - $wrap.css({ - '-webkit-transform': deg, - '-mos-transform': deg, - '-o-transform': deg, - 'transform': deg - }); - } else { - $wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')'); - } - - }); - - $li.insertBefore($filePickerBlock); - } - - // 负责view的销毁 - function removeFile(file) { - var $li = $('#' + file.id); - delete percentages[ file.id ]; - updateTotalProgress(); - $li.off().find('.file-panel').off().end().remove(); - } - - function updateTotalProgress() { - var loaded = 0, - total = 0, - spans = $progress.children(), - percent; - - $.each(percentages, function (k, v) { - total += v[ 0 ]; - loaded += v[ 0 ] * v[ 1 ]; - }); - - percent = total ? loaded / total : 0; - - spans.eq(0).text(Math.round(percent * 100) + '%'); - spans.eq(1).css('width', Math.round(percent * 100) + '%'); - updateStatus(); - } - - function setState(val, files) { - - if (val != state) { - - var stats = uploader.getStats(); - - $upload.removeClass('state-' + state); - $upload.addClass('state-' + val); - - switch (val) { - - /* 未选择文件 */ - case 'pedding': - $queue.addClass('element-invisible'); - $statusBar.addClass('element-invisible'); - $placeHolder.removeClass('element-invisible'); - $progress.hide(); $info.hide(); - uploader.refresh(); - break; - - /* 可以开始上传 */ - case 'ready': - $placeHolder.addClass('element-invisible'); - $queue.removeClass('element-invisible'); - $statusBar.removeClass('element-invisible'); - $progress.hide(); $info.show(); - $upload.text(lang.uploadStart); - uploader.refresh(); - break; - - /* 上传中 */ - case 'uploading': - $progress.show(); $info.hide(); - $upload.text(lang.uploadPause); - break; - - /* 暂停上传 */ - case 'paused': - $progress.show(); $info.hide(); - $upload.text(lang.uploadContinue); - break; - - case 'confirm': - $progress.show(); $info.hide(); - $upload.text(lang.uploadStart); - - stats = uploader.getStats(); - if (stats.successNum && !stats.uploadFailNum) { - setState('finish'); - return; - } - break; - - case 'finish': - $progress.hide(); $info.show(); - if (stats.uploadFailNum) { - $upload.text(lang.uploadRetry); - } else { - $upload.text(lang.uploadStart); - } - break; - } - - state = val; - updateStatus(); - - } - - if (!_this.getQueueCount()) { - $upload.addClass('disabled') - } else { - $upload.removeClass('disabled') - } - - } - - function updateStatus() { - var text = '', stats; - - if (state === 'ready') { - text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)); - } else if (state === 'confirm') { - stats = uploader.getStats(); - if (stats.uploadFailNum) { - text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum); - } - } else { - stats = uploader.getStats(); - text = lang.updateStatusFinish.replace('_', fileCount). - replace('_KB', WebUploader.formatSize(fileSize)). - replace('_', stats.successNum); - - if (stats.uploadFailNum) { - text += lang.updateStatusError.replace('_', stats.uploadFailNum); - } - } - - $info.html(text); - } - - uploader.on('fileQueued', function (file) { - /* 选择文件后设置上传相关的url和自定义参数 */ - editor.getOpt("fileUploadService")(_this, editor).setUploadData(file); - - if (file.ext && acceptExtensions.indexOf(file.ext.toLowerCase()) != -1 && file.size <= fileMaxSize) { - fileCount++; - fileSize += file.size; - } - - if (fileCount === 1) { - $placeHolder.addClass('element-invisible'); - $statusBar.show(); - } - - addFile(file); - }); - - uploader.on('fileDequeued', function (file) { - if (file.ext && acceptExtensions.indexOf(file.ext.toLowerCase()) != -1 && file.size <= fileMaxSize) { - fileCount--; - fileSize -= file.size; - } - - removeFile(file); - updateTotalProgress(); - }); - - uploader.on('filesQueued', function (file) { - if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) { - setState('ready'); - } - updateTotalProgress(); - }); - - uploader.on('all', function (type, files) { - switch (type) { - case 'uploadFinished': - setState('confirm', files); - break; - case 'startUpload': - /* 设置Uploader配置项 */ - editor.getOpt("fileUploadService")(_this, editor).setUploaderOptions(uploader); - setState('uploading', files); - break; - case 'stopUpload': - setState('paused', files); - break; - } - }); - - uploader.on('uploadBeforeSend', function (object, data, headers) { - //这里可以通过data对象添加POST参数 - editor.getOpt("fileUploadService")(_this, editor).setFormData(object, data, headers); - }); - - uploader.on('uploadProgress', function (file, percentage) { - var $li = $('#' + file.id), - $percent = $li.find('.progress span'); - - $percent.css('width', percentage * 100 + '%'); - percentages[ file.id ][ 1 ] = percentage; - updateTotalProgress(); - }); - - uploader.on('uploadSuccess', function (file, res) { - var $file = $('#' + file.id); - try { - if (editor.getOpt("fileUploadService")(_this, editor).getResponseSuccess(res)) { - _this.fileList.push(res); - $file.append(''); - } else { - $file.find('.error').text(res.message).show(); - } - } catch (e) { - $file.find('.error').text(lang.errorServerUpload).show(); - } - }); - - uploader.on('uploadError', function (file, code) { - }); - uploader.on('error', function (code, file) { - if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { - addFile(file); - } - }); - uploader.on('uploadComplete', function (file, ret) { - }); - - $upload.on('click', function () { - if ($(this).hasClass('disabled')) { - return false; - } - - if (state === 'ready') { - uploader.upload(); - } else if (state === 'paused') { - uploader.upload(); - } else if (state === 'uploading') { - uploader.stop(); - } - }); - - $upload.addClass('state-' + state); - updateTotalProgress(); - }, - getQueueCount: function () { - var file, i, status, readyFile = 0, files = this.uploader.getFiles(); - for (i = 0; file = files[i++]; ) { - status = file.getStatus(); - if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; - } - return readyFile; - }, - getInsertList: function () { - var i, link, data, list = [], - prefix = editor.getOpt('fileUrlPrefix'), - fileSrcField = editor.getOpt("fileUploadService")(this, editor).fileSrcField || 'url', - fileSrc = '', - fileSrcFieldKeys = fileSrcField.split('.'); - - for (i = 0; i < this.fileList.length; i++) { - data = this.fileList[i]; - if(fileSrcFieldKeys.length > 1) { - function setFileSrc(obj, keys, index) { - obj = obj[keys[index]]; - if (index < keys.length - 1) { - setFileSrc(obj, keys, index += 1) - } else { - fileSrc = obj; - } - } - - setFileSrc(data, fileSrcFieldKeys, 0); - } else { - fileSrc = data[fileSrcField]; - } - link = fileSrc; - list.push({ - title: data.original || link.substr(link.lastIndexOf('/') + 1), - url: prefix + link - }); - } - return list; - } - }; - - - /* 在线附件 */ - function OnlineFile(target) { - this.container = utils.isString(target) ? document.getElementById(target) : target; - this.init(); - } - OnlineFile.prototype = { - init: function () { - this.initContainer(); - this.initEvents(); - this.initData(); - }, - /* 初始化容器 */ - initContainer: function () { - this.container.innerHTML = ''; - this.list = document.createElement('ul'); - this.clearFloat = document.createElement('li'); - - domUtils.addClass(this.list, 'list'); - domUtils.addClass(this.clearFloat, 'clearFloat'); - - this.list.appendChild(this.clearFloat); - this.container.appendChild(this.list); - }, - /* 初始化滚动事件,滚动到地步自动拉取数据 */ - initEvents: function () { - var _this = this; - - /* 滚动拉取图片 */ - domUtils.on($G('fileList'), 'scroll', function(e){ - var panel = this; - if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { - _this.getFileData(); - } - }); - /* 选中图片 */ - domUtils.on(this.list, 'click', function (e) { - var target = e.target || e.srcElement, - li = target.parentNode; - - if (li.tagName.toLowerCase() == 'li') { - if (domUtils.hasClass(li, 'selected')) { - domUtils.removeClasses(li, 'selected'); - } else { - domUtils.addClass(li, 'selected'); - } - } - }); - }, - /* 初始化第一次的数据 */ - initData: function () { - - /* 拉取数据需要使用的值 */ - this.state = 0; - this.listSize = editor.getOpt('fileManagerListSize'); - this.listIndex = 0; - this.listEnd = false; - - /* 第一次拉取数据 */ - this.getFileData(); - }, - /* 向后台拉取图片列表数据 */ - getFileData: function () { - var _this = this; - - if(!_this.listEnd && !this.isLoadingData) { - this.isLoadingData = true; - ajax.request(editor.getActionUrl(editor.getOpt('fileManagerActionName')), { - timeout: 100000, - data: utils.extend({ - start: this.listIndex, - size: this.listSize - }, editor.queryCommandValue('serverparam')), - method: 'get', - onsuccess: function (r) { - try { - var json = eval('(' + r.responseText + ')'); - if (json.state == 'SUCCESS') { - _this.pushData(json.list); - _this.listIndex = parseInt(json.start) + parseInt(json.list.length); - if(_this.listIndex >= json.total) { - _this.listEnd = true; - } - _this.isLoadingData = false; - } - } catch (e) { - if(r.responseText.indexOf('ue_separate_ue') != -1) { - var list = r.responseText.split(r.responseText); - _this.pushData(list); - _this.listIndex = parseInt(list.length); - _this.listEnd = true; - _this.isLoadingData = false; - } - } - }, - onerror: function () { - _this.isLoadingData = false; - } - }); - } - }, - /* 添加图片到列表界面上 */ - pushData: function (list) { - var i, item, img, filetype, preview, icon, _this = this, - urlPrefix = editor.getOpt('fileManagerUrlPrefix'); - for (i = 0; i < list.length; i++) { - if(list[i] && list[i].url) { - item = document.createElement('li'); - icon = document.createElement('span'); - filetype = list[i].url.substr(list[i].url.lastIndexOf('.') + 1); - - if ( "png|jpg|jpeg|gif|bmp".indexOf(filetype) != -1 ) { - preview = document.createElement('img'); - domUtils.on(preview, 'load', (function(image){ - return function(){ - _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); - }; - })(preview)); - preview.width = 113; - preview.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) ); - } else { - var ic = document.createElement('i'), - textSpan = document.createElement('span'); - textSpan.innerHTML = list[i].url.substr(list[i].url.lastIndexOf('/') + 1); - preview = document.createElement('div'); - preview.appendChild(ic); - preview.appendChild(textSpan); - domUtils.addClass(preview, 'file-wrapper'); - domUtils.addClass(textSpan, 'file-title'); - domUtils.addClass(ic, 'file-type-' + filetype); - domUtils.addClass(ic, 'file-preview'); - } - domUtils.addClass(icon, 'icon'); - item.setAttribute('data-url', urlPrefix + list[i].url); - if (list[i].original) { - item.setAttribute('data-title', list[i].original); - } - - item.appendChild(preview); - item.appendChild(icon); - this.list.insertBefore(item, this.clearFloat); - } - } - }, - /* 改变图片大小 */ - scale: function (img, w, h, type) { - var ow = img.width, - oh = img.height; - - if (type == 'justify') { - if (ow >= oh) { - img.width = w; - img.height = h * oh / ow; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w * ow / oh; - img.height = h; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } else { - if (ow >= oh) { - img.width = w * ow / oh; - img.height = h; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w; - img.height = h * oh / ow; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } - }, - getInsertList: function () { - var i, lis = this.list.children, list = []; - for (i = 0; i < lis.length; i++) { - if (domUtils.hasClass(lis[i], 'selected')) { - var url = lis[i].getAttribute('data-url'); - var title = lis[i].getAttribute('data-title') || url.substr(url.lastIndexOf('/') + 1); - list.push({ - title: title, - url: url - }); - } - } - return list; - } - }; - - -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_chm.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_chm.gif deleted file mode 100644 index 9ca4fb6a23c7ed528374426575c3e7f67730cfb7..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_chm.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_default.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_default.png deleted file mode 100644 index 50ac1cb1654c147225f6c99f98fa820d8b1d47d3..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_default.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_doc.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_doc.gif deleted file mode 100644 index 206fede4ee7495c3d4fa8dbbb76425e23566e9cc..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_doc.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_exe.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_exe.gif deleted file mode 100644 index 2e3b7a28e08d4be8c98dc54ec9c355a3f3d89ccb..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_exe.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_jpg.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_jpg.gif deleted file mode 100644 index 5d5dec02627672b415a936eb5ab6526c895646c6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_jpg.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_mp3.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_mp3.gif deleted file mode 100644 index b351a1f2a294cd0f8e145e20c2c455a38cad2001..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_mp3.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_mv.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_mv.gif deleted file mode 100644 index 26019b099d96b382a549fa383bd81315cd6d295c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_mv.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_pdf.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_pdf.gif deleted file mode 100644 index bbb65c837dea9a6c28d6209ca1b1140a37988423..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_pdf.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_ppt.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_ppt.gif deleted file mode 100644 index ccb26fbebdff5521eab7418d22e99fbae6c1d08c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_ppt.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_psd.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_psd.gif deleted file mode 100644 index 2e8743a2705b98b9c546c28c97fe724dd4668b16..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_psd.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_rar.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_rar.gif deleted file mode 100644 index 5359e46d2094b9dbb88566d4c5098e91665238ad..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_rar.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_txt.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_txt.gif deleted file mode 100644 index e7b8dd21d8ca8121e2c1629bb607cf2ab151c7a3..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_txt.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_xls.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_xls.gif deleted file mode 100644 index e86c1c6631b34ecd605b655baf3d7b1ae643d014..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/fileTypeImages/icon_xls.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/alignicon.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/alignicon.gif deleted file mode 100644 index 005a5ac65a3ddc9cdac037abdb5fe92267155a0d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/alignicon.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/alignicon.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/alignicon.png deleted file mode 100644 index 4b6c444b78f31f4e9b381ce440ef5c0231bcec1f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/alignicon.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/bg.png deleted file mode 100644 index 580be0a01dff4c70c72f78a3f40186660ee8eee0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/file-icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/file-icons.gif deleted file mode 100644 index d8c02c27e242f0584fc6b214f35b4f6d8caec332..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/file-icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/file-icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/file-icons.png deleted file mode 100644 index 3ff82c8c488f53a7aff67fbe39742e3321183eca..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/file-icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/icons.gif deleted file mode 100644 index 78459dea7b12ccbeec81d19ecdab22b1658e93b4..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/icons.png deleted file mode 100644 index 12e4700163ac87fa38ae3d92a2c39d0fb4690fed..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/image.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/image.png deleted file mode 100644 index 19699f6a9c6b09cb18ec0f488242d9753d2e341b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/image.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/progress.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/progress.png deleted file mode 100644 index 717c4865c90a959c6a0e9ad1af9c777d900a2e9c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/progress.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/success.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/success.gif deleted file mode 100644 index 8d4f3112b9d1df2147ed3b67d9736163dedd11e1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/success.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/success.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/success.png deleted file mode 100644 index 94f968dc8fd3c7ca8f6cb599d006ef3f23b62c7d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/attachment/images/success.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/background.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/background.css deleted file mode 100644 index f0fa943ed2a48ca5e66a74b3aaa413d41215339a..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/background.css +++ /dev/null @@ -1,97 +0,0 @@ -.wrapper{ width: 424px;margin: 20px; zoom:1;position: relative} -.tabbody{height:225px;} -.tabbody .panel { position: absolute;width:100%; height:100%;background: #fff; display: none;} -.tabbody .focus { display: block;} - -body{font-size: 12px;color: #888;overflow: hidden;} -input,label{vertical-align:middle} -.clear{clear: both;} -.pl{padding-left: 18px;padding-left: 23px\9;} - -#imageList {width: 420px;height: 215px;margin-top: 10px;overflow: hidden;overflow-y: auto;} -#imageList div {float: left;width: 100px;height: 95px;margin: 5px 10px;} -#imageList img {cursor: pointer;border: 2px solid white;} - -.bgarea{margin: 10px;padding: 5px;height: 84%;border: 1px solid #A8A297;border-radius: 4px;} -.content div{margin: 10px 0 10px 5px;} -.content .iptradio{margin: 0px 5px 5px 0px;} -.txt{width:280px; margin-left: 10px;height: 26px;line-height: 26px; border-radius: 5px;border: 1px solid #ccc;} - -.wrapcolor{height: 19px;} -div.color{float: left;margin: 0;} -#colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;margin: 0 0 0 10px;float: left;} -div.alignment,#custom{margin-left: 23px;margin-left: 28px\9;} -#custom input{height: 15px;min-height: 15px;width:20px;} -#repeatType{width:100px; - margin-left: 10px; - border-radius: 4px; - height: 23px;} - - -/* 图片管理样式 */ -#imgManager { - width: 100%; - height: 225px; -} -#imgManager #imageList{ - width: 100%; - overflow-x: hidden; - overflow-y: auto; -} -#imgManager ul { - display: block; - list-style: none; - margin: 0; - padding: 0; -} -#imgManager li { - float: left; - display: block; - list-style: none; - padding: 0; - width: 113px; - height: 113px; - margin: 9px 0 0 19px; - background-color: #eee; - overflow: hidden; - cursor: pointer; - position: relative; -} -#imgManager li.clearFloat { - float: none; - clear: both; - display: block; - width:0; - height:0; - margin: 0; - padding: 0; -} -#imgManager li img { - cursor: pointer; -} -#imgManager li .icon { - cursor: pointer; - width: 113px; - height: 113px; - position: absolute; - top: 0; - left: 0; - z-index: 2; - border: 0; - background-repeat: no-repeat; -} -#imgManager li .icon:hover { - width: 107px; - height: 107px; - border: 3px solid #1094fa; -} -#imgManager li.selected .icon { - background-image: url(images/success.png); - background-position: 75px 75px; -} -#imgManager li.selected .icon:hover { - width: 107px; - height: 107px; - border: 3px solid #1094fa; - background-position: 72px 72px; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/background.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/background.html deleted file mode 100644 index a611b970dd9bc5f2a2972835e62828fabaa5ad4b..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/background.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - -
                      -
                      - - -
                      -
                      -
                      -
                      - -
                      -
                      - - -
                      -
                      -
                      - : -
                      -
                      -
                      -
                      -
                      - -
                      -
                      - : -
                      -
                      - :x:px  y:px -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      -
                      - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/background.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/background.js deleted file mode 100644 index 9a4a1315d4aa04f1b2f5f4ac247869a8f62ab513..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/background.js +++ /dev/null @@ -1,376 +0,0 @@ -(function () { - - var onlineImage, - backupStyle = editor.queryCommandValue('background'); - - window.onload = function () { - initTabs(); - initColorSelector(); - }; - - /* 初始化tab标签 */ - function initTabs(){ - var tabs = $G('tabHeads').children; - for (var i = 0; i < tabs.length; i++) { - domUtils.on(tabs[i], "click", function (e) { - var target = e.target || e.srcElement; - for (var j = 0; j < tabs.length; j++) { - if(tabs[j] == target){ - tabs[j].className = "focus"; - var contentId = tabs[j].getAttribute('data-content-id'); - $G(contentId).style.display = "block"; - if(contentId == 'imgManager') { - initImagePanel(); - } - }else { - tabs[j].className = ""; - $G(tabs[j].getAttribute('data-content-id')).style.display = "none"; - } - } - }); - } - } - - /* 初始化颜色设置 */ - function initColorSelector () { - var obj = editor.queryCommandValue('background'); - if (obj) { - var color = obj['background-color'], - repeat = obj['background-repeat'] || 'repeat', - image = obj['background-image'] || '', - position = obj['background-position'] || 'center center', - pos = position.split(' '), - x = parseInt(pos[0]) || 0, - y = parseInt(pos[1]) || 0; - - if(repeat == 'no-repeat' && (x || y)) repeat = 'self'; - - image = image.match(/url[\s]*\(([^\)]*)\)/); - image = image ? image[1]:''; - updateFormState('colored', color, image, repeat, x, y); - } else { - updateFormState(); - } - - var updateHandler = function () { - updateFormState(); - updateBackground(); - } - domUtils.on($G('nocolorRadio'), 'click', updateBackground); - domUtils.on($G('coloredRadio'), 'click', updateHandler); - domUtils.on($G('url'), 'keyup', function(){ - if($G('url').value && $G('alignment').style.display == "none") { - utils.each($G('repeatType').children, function(item){ - item.selected = ('repeat' == item.getAttribute('value') ? 'selected':false); - }); - } - updateHandler(); - }); - domUtils.on($G('repeatType'), 'change', updateHandler); - domUtils.on($G('x'), 'keyup', updateBackground); - domUtils.on($G('y'), 'keyup', updateBackground); - - initColorPicker(); - } - - /* 初始化颜色选择器 */ - function initColorPicker() { - var me = editor, - cp = $G("colorPicker"); - - /* 生成颜色选择器ui对象 */ - var popup = new UE.ui.Popup({ - content: new UE.ui.ColorPicker({ - noColorText: me.getLang("clearColor"), - editor: me, - onpickcolor: function (t, color) { - updateFormState('colored', color); - updateBackground(); - UE.ui.Popup.postHide(); - }, - onpicknocolor: function (t, color) { - updateFormState('colored', 'transparent'); - updateBackground(); - UE.ui.Popup.postHide(); - } - }), - editor: me, - onhide: function () { - } - }); - - /* 设置颜色选择器 */ - domUtils.on(cp, "click", function () { - popup.showAnchor(this); - }); - domUtils.on(document, 'mousedown', function (evt) { - var el = evt.target || evt.srcElement; - UE.ui.Popup.postHide(el); - }); - domUtils.on(window, 'scroll', function () { - UE.ui.Popup.postHide(); - }); - } - - /* 初始化在线图片列表 */ - function initImagePanel() { - onlineImage = onlineImage || new OnlineImage('imageList'); - } - - /* 更新背景色设置面板 */ - function updateFormState (radio, color, url, align, x, y) { - var nocolorRadio = $G('nocolorRadio'), - coloredRadio = $G('coloredRadio'); - - if(radio) { - nocolorRadio.checked = (radio == 'colored' ? false:'checked'); - coloredRadio.checked = (radio == 'colored' ? 'checked':false); - } - if(color) { - domUtils.setStyle($G("colorPicker"), "background-color", color); - } - - if(url && /^\//.test(url)) { - var a = document.createElement('a'); - a.href = url; - browser.ie && (a.href = a.href); - url = browser.ie ? a.href:(a.protocol + '//' + a.host + a.pathname + a.search + a.hash); - } - - if(url || url === '') { - $G('url').value = url; - } - if(align) { - utils.each($G('repeatType').children, function(item){ - item.selected = (align == item.getAttribute('value') ? 'selected':false); - }); - } - if(x || y) { - $G('x').value = parseInt(x) || 0; - $G('y').value = parseInt(y) || 0; - } - - $G('alignment').style.display = coloredRadio.checked && $G('url').value ? '':'none'; - $G('custom').style.display = coloredRadio.checked && $G('url').value && $G('repeatType').value == 'self' ? '':'none'; - } - - /* 更新背景颜色 */ - function updateBackground () { - if ($G('coloredRadio').checked) { - var color = domUtils.getStyle($G("colorPicker"), "background-color"), - bgimg = $G("url").value, - align = $G("repeatType").value, - backgroundObj = { - "background-repeat": "no-repeat", - "background-position": "center center" - }; - - if (color) backgroundObj["background-color"] = color; - if (bgimg) backgroundObj["background-image"] = 'url(' + bgimg + ')'; - if (align == 'self') { - backgroundObj["background-position"] = $G("x").value + "px " + $G("y").value + "px"; - } else if (align == 'repeat-x' || align == 'repeat-y' || align == 'repeat') { - backgroundObj["background-repeat"] = align; - } - - editor.execCommand('background', backgroundObj); - } else { - editor.execCommand('background', null); - } - } - - - /* 在线图片 */ - function OnlineImage(target) { - this.container = utils.isString(target) ? document.getElementById(target) : target; - this.init(); - } - OnlineImage.prototype = { - init: function () { - this.reset(); - this.initEvents(); - }, - /* 初始化容器 */ - initContainer: function () { - this.container.innerHTML = ''; - this.list = document.createElement('ul'); - this.clearFloat = document.createElement('li'); - - domUtils.addClass(this.list, 'list'); - domUtils.addClass(this.clearFloat, 'clearFloat'); - - this.list.id = 'imageListUl'; - this.list.appendChild(this.clearFloat); - this.container.appendChild(this.list); - }, - /* 初始化滚动事件,滚动到地步自动拉取数据 */ - initEvents: function () { - var _this = this; - - /* 滚动拉取图片 */ - domUtils.on($G('imageList'), 'scroll', function(e){ - var panel = this; - if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { - _this.getImageData(); - } - }); - /* 选中图片 */ - domUtils.on(this.container, 'click', function (e) { - var target = e.target || e.srcElement, - li = target.parentNode, - nodes = $G('imageListUl').childNodes; - - if (li.tagName.toLowerCase() == 'li') { - updateFormState('nocolor', null, ''); - for (var i = 0, node; node = nodes[i++];) { - if (node == li && !domUtils.hasClass(node, 'selected')) { - domUtils.addClass(node, 'selected'); - updateFormState('colored', null, li.firstChild.getAttribute("_src"), 'repeat'); - } else { - domUtils.removeClasses(node, 'selected'); - } - } - updateBackground(); - } - }); - }, - /* 初始化第一次的数据 */ - initData: function () { - - /* 拉取数据需要使用的值 */ - this.state = 0; - this.listSize = editor.getOpt('imageManagerListSize'); - this.listIndex = 0; - this.listEnd = false; - - /* 第一次拉取数据 */ - this.getImageData(); - }, - /* 重置界面 */ - reset: function() { - this.initContainer(); - this.initData(); - }, - /* 向后台拉取图片列表数据 */ - getImageData: function () { - var _this = this; - - if(!_this.listEnd && !this.isLoadingData) { - this.isLoadingData = true; - var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')), - isJsonp = utils.isCrossDomainUrl(url); - ajax.request(url, { - 'timeout': 100000, - 'dataType': isJsonp ? 'jsonp':'', - 'data': utils.extend({ - start: this.listIndex, - size: this.listSize - }, editor.queryCommandValue('serverparam')), - 'method': 'get', - 'onsuccess': function (r) { - try { - var json = isJsonp ? r:eval('(' + r.responseText + ')'); - if (json.state == 'SUCCESS') { - _this.pushData(json.list); - _this.listIndex = parseInt(json.start) + parseInt(json.list.length); - if(_this.listIndex >= json.total) { - _this.listEnd = true; - } - _this.isLoadingData = false; - } - } catch (e) { - if(r.responseText.indexOf('ue_separate_ue') != -1) { - var list = r.responseText.split(r.responseText); - _this.pushData(list); - _this.listIndex = parseInt(list.length); - _this.listEnd = true; - _this.isLoadingData = false; - } - } - }, - 'onerror': function () { - _this.isLoadingData = false; - } - }); - } - }, - /* 添加图片到列表界面上 */ - pushData: function (list) { - var i, item, img, icon, _this = this, - urlPrefix = editor.getOpt('imageManagerUrlPrefix'); - for (i = 0; i < list.length; i++) { - if(list[i] && list[i].url) { - item = document.createElement('li'); - img = document.createElement('img'); - icon = document.createElement('span'); - - domUtils.on(img, 'load', (function(image){ - return function(){ - _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); - } - })(img)); - img.width = 113; - img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) ); - img.setAttribute('_src', urlPrefix + list[i].url); - domUtils.addClass(icon, 'icon'); - - item.appendChild(img); - item.appendChild(icon); - this.list.insertBefore(item, this.clearFloat); - } - } - }, - /* 改变图片大小 */ - scale: function (img, w, h, type) { - var ow = img.width, - oh = img.height; - - if (type == 'justify') { - if (ow >= oh) { - img.width = w; - img.height = h * oh / ow; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w * ow / oh; - img.height = h; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } else { - if (ow >= oh) { - img.width = w * ow / oh; - img.height = h; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w; - img.height = h * oh / ow; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } - }, - getInsertList: function () { - var i, lis = this.list.children, list = [], align = getAlign(); - for (i = 0; i < lis.length; i++) { - if (domUtils.hasClass(lis[i], 'selected')) { - var img = lis[i].firstChild, - src = img.getAttribute('_src'); - list.push({ - src: src, - _src: src, - floatStyle: align - }); - } - - } - return list; - } - }; - - dialog.onok = function () { - updateBackground(); - editor.fireEvent('saveScene'); - }; - dialog.oncancel = function () { - editor.execCommand('background', backupStyle); - }; - -})(); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/images/bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/images/bg.png deleted file mode 100644 index 580be0a01dff4c70c72f78a3f40186660ee8eee0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/images/bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/images/success.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/images/success.png deleted file mode 100644 index 94f968dc8fd3c7ca8f6cb599d006ef3f23b62c7d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/background/images/success.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/chart.config.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/chart.config.js deleted file mode 100644 index 678b00deb8a77bc445974641ccd6e6db380586df..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/chart.config.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 图表配置文件 - * */ - - -//不同类型的配置 -var typeConfig = [ - { - chart: { - type: 'line' - }, - plotOptions: { - line: { - dataLabels: { - enabled: false - }, - enableMouseTracking: true - } - } - }, { - chart: { - type: 'line' - }, - plotOptions: { - line: { - dataLabels: { - enabled: true - }, - enableMouseTracking: false - } - } - }, { - chart: { - type: 'area' - } - }, { - chart: { - type: 'bar' - } - }, { - chart: { - type: 'column' - } - }, { - chart: { - plotBackgroundColor: null, - plotBorderWidth: null, - plotShadow: false - }, - plotOptions: { - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: true, - color: '#000000', - connectorColor: '#000000', - formatter: function() { - return ''+ this.point.name +': '+ ( Math.round( this.point.percentage*100 ) / 100 ) +' %'; - } - } - } - } - } -]; diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/charts.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/charts.css deleted file mode 100644 index ac3c76458206126b54ca2c225f5481e2e9cbd524..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/charts.css +++ /dev/null @@ -1,165 +0,0 @@ -html, body { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - overflow-x: hidden; -} - -.main { - width: 100%; - overflow: hidden; -} - -.table-view { - height: 100%; - float: left; - margin: 20px; - width: 40%; -} - -.table-view .table-container { - width: 100%; - margin-bottom: 50px; - overflow: scroll; -} - -.table-view th { - padding: 5px 10px; - background-color: #F7F7F7; -} - -.table-view td { - width: 50px; - text-align: center; - padding:0; -} - -.table-container input { - width: 40px; - padding: 5px; - border: none; - outline: none; -} - -.table-view caption { - font-size: 18px; - text-align: left; -} - -.charts-view { - /*margin-left: 49%!important;*/ - width: 50%; - margin-left: 49%; - height: 400px; -} - -.charts-container { - border-left: 1px solid #c3c3c3; -} - -.charts-format fieldset { - padding-left: 20px; - margin-bottom: 50px; -} - -.charts-format legend { - padding-left: 10px; - padding-right: 10px; -} - -.format-item-container { - padding: 20px; -} - -.format-item-container label { - display: block; - margin: 10px 0; -} - -.charts-format .data-item { - border: 1px solid black; - outline: none; - padding: 2px 3px; -} - -/* 图表类型 */ - -.charts-type { - margin-top: 50px; - height: 300px; -} - -.scroll-view { - border: 1px solid #c3c3c3; - border-left: none; - border-right: none; - overflow: hidden; -} - -.scroll-container { - margin: 20px; - width: 100%; - overflow: hidden; -} - -.scroll-bed { - width: 10000px; - _margin-top: 20px; - -webkit-transition: margin-left .5s ease; - -moz-transition: margin-left .5s ease; - transition: margin-left .5s ease; -} - -.view-box { - display: inline-block; - *display: inline; - *zoom: 1; - margin-right: 20px; - border: 2px solid white; - line-height: 0; - overflow: hidden; - cursor: pointer; -} - -.view-box img { - border: 1px solid #cecece; -} - -.view-box.selected { - border-color: #7274A7; -} - -.button-container { - margin-bottom: 20px; - text-align: center; -} - -.button-container a { - display: inline-block; - width: 100px; - height: 25px; - line-height: 25px; - border: 1px solid #c2ccd1; - margin-right: 30px; - text-decoration: none; - color: black; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} - -.button-container a:HOVER { - background: #fcfcfc; -} - -.button-container a:ACTIVE { - border-top-color: #c2ccd1; - box-shadow:inset 0 5px 4px -4px rgba(49, 49, 64, 0.1); -} - -.edui-charts-not-data { - height: 100px; - line-height: 100px; - text-align: center; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/charts.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/charts.html deleted file mode 100644 index 70e23149f143b618a63f70265766f971f6339621..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/charts.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - chart - - - - - -
                      -
                      -

                      -
                      -

                      -
                      -
                      -
                      - -
                      - - -
                      -
                      -
                      -
                      - -
                      - - - - -
                      -
                      -
                      - -
                      - -

                      -
                      -
                      -
                      - -
                      - -

                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -

                      -
                      -
                      -
                      -
                      -
                      - - -
                      -
                      -
                      -
                      -
                      - - - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/charts.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/charts.js deleted file mode 100644 index 37344fd129db521348dfefd4b97e278e26144fab..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/charts.js +++ /dev/null @@ -1,519 +0,0 @@ -/* - * 图片转换对话框脚本 - **/ - -var tableData = [], - //编辑器页面table - editorTable = null, - chartsConfig = window.typeConfig, - resizeTimer = null, - //初始默认图表类型 - currentChartType = 0; - -window.onload = function () { - - editorTable = domUtils.findParentByTagName( editor.selection.getRange().startContainer, 'table', true); - - //未找到表格, 显示错误页面 - if ( !editorTable ) { - document.body.innerHTML = "
                      未找到数据
                      "; - return; - } - - //初始化图表类型选择 - initChartsTypeView(); - renderTable( editorTable ); - initEvent(); - initUserConfig( editorTable.getAttribute( "data-chart" ) ); - $( "#scrollBed .view-box:eq("+ currentChartType +")" ).trigger( "click" ); - updateViewType( currentChartType ); - - dialog.addListener( "resize", function () { - - if ( resizeTimer != null ) { - window.clearTimeout( resizeTimer ); - } - - resizeTimer = window.setTimeout( function () { - - resizeTimer = null; - - renderCharts(); - - }, 500 ); - - } ); - -}; - -function initChartsTypeView () { - - var contents = []; - - for ( var i = 0, len = chartsConfig.length; i
                      ' ); - - } - - $( "#scrollBed" ).html( contents.join( "" ) ); - -} - -//渲染table, 以便用户修改数据 -function renderTable ( table ) { - - var tableHtml = []; - - //构造数据 - for ( var i = 0, row; row = table.rows[ i ]; i++ ) { - - tableData[ i ] = []; - tableHtml[ i ] = []; - - for ( var j = 0, cell; cell = row.cells[ j ]; j++ ) { - - var value = getCellValue( cell ); - - if ( i > 0 && j > 0 ) { - value = +value; - } - - if ( i === 0 || j === 0 ) { - tableHtml[ i ].push( ''+ value +'' ); - } else { - tableHtml[ i ].push( '' ); - } - - tableData[ i ][ j ] = value; - - } - - tableHtml[ i ] = tableHtml[ i ].join( "" ); - - } - - //draw 表格 - $( "#tableContainer" ).html( ''+ tableHtml.join( "" ) +'
                      ' ); - -} - -/* - * 根据表格已有的图表属性初始化当前图表属性 - */ -function initUserConfig ( config ) { - - var parsedConfig = {}; - - if ( !config ) { - return; - } - - config = config.split( ";" ); - - $.each( config, function ( index, item ) { - - item = item.split( ":" ); - parsedConfig[ item[ 0 ] ] = item[ 1 ]; - - } ); - - setUserConfig( parsedConfig ); - -} - -function initEvent () { - - var cacheValue = null, - //图表类型数 - typeViewCount = chartsConfig.length- 1, - $chartsTypeViewBox = $( '#scrollBed .view-box' ); - - $( ".charts-format" ).delegate( ".format-ctrl", "change", function () { - - renderCharts(); - - } ) - - $( ".table-view" ).delegate( ".data-item", "focus", function () { - - cacheValue = this.value; - - } ).delegate( ".data-item", "blur", function () { - - if ( this.value !== cacheValue ) { - renderCharts(); - } - - cacheValue = null; - - } ); - - $( "#buttonContainer" ).delegate( "a", "click", function (e) { - - e.preventDefault(); - - if ( this.getAttribute( "data-title" ) === 'prev' ) { - - if ( currentChartType > 0 ) { - currentChartType--; - updateViewType( currentChartType ); - } - - } else { - - if ( currentChartType < typeViewCount ) { - currentChartType++; - updateViewType( currentChartType ); - } - - } - - } ); - - //图表类型变化 - $( '#scrollBed' ).delegate( ".view-box", "click", function (e) { - - var index = $( this ).attr( "data-chart-type" ); - $chartsTypeViewBox.removeClass( "selected" ); - $( $chartsTypeViewBox[ index ] ).addClass( "selected" ); - - currentChartType = index | 0; - - //饼图, 禁用部分配置 - if ( currentChartType === chartsConfig.length - 1 ) { - - disableNotPieConfig(); - - //启用完整配置 - } else { - - enableNotPieConfig(); - - } - - renderCharts(); - - } ); - -} - -function renderCharts () { - - var data = collectData(); - - $('#chartsContainer').highcharts( $.extend( {}, chartsConfig[ currentChartType ], { - - credits: { - enabled: false - }, - exporting: { - enabled: false - }, - title: { - text: data.title, - x: -20 //center - }, - subtitle: { - text: data.subTitle, - x: -20 - }, - xAxis: { - title: { - text: data.xTitle - }, - categories: data.categories - }, - yAxis: { - title: { - text: data.yTitle - }, - plotLines: [{ - value: 0, - width: 1, - color: '#808080' - }] - }, - tooltip: { - enabled: true, - valueSuffix: data.suffix - }, - legend: { - layout: 'vertical', - align: 'right', - verticalAlign: 'middle', - borderWidth: 1 - }, - series: data.series - - } )); - -} - -function updateViewType ( index ) { - - $( "#scrollBed" ).css( 'marginLeft', -index*324+'px' ); - -} - -function collectData () { - - var form = document.forms[ 'data-form' ], - data = null; - - if ( currentChartType !== chartsConfig.length - 1 ) { - - data = getSeriesAndCategories(); - $.extend( data, getUserConfig() ); - - //饼图数据格式 - } else { - data = getSeriesForPieChart(); - data.title = form[ 'title' ].value; - data.suffix = form[ 'unit' ].value; - } - - return data; - -} - -/** - * 获取用户配置信息 - */ -function getUserConfig () { - - var form = document.forms[ 'data-form' ], - info = { - title: form[ 'title' ].value, - subTitle: form[ 'sub-title' ].value, - xTitle: form[ 'x-title' ].value, - yTitle: form[ 'y-title' ].value, - suffix: form[ 'unit' ].value, - //数据对齐方式 - tableDataFormat: getTableDataFormat (), - //饼图提示文字 - tip: $( "#tipInput" ).val() - }; - - return info; - -} - -function setUserConfig ( config ) { - - var form = document.forms[ 'data-form' ]; - - config.title && ( form[ 'title' ].value = config.title ); - config.subTitle && ( form[ 'sub-title' ].value = config.subTitle ); - config.xTitle && ( form[ 'x-title' ].value = config.xTitle ); - config.yTitle && ( form[ 'y-title' ].value = config.yTitle ); - config.suffix && ( form[ 'unit' ].value = config.suffix ); - config.dataFormat == "-1" && ( form[ 'charts-format' ][ 1 ].checked = true ); - config.tip && ( form[ 'tip' ].value = config.tip ); - currentChartType = config.chartType || 0; - -} - -function getSeriesAndCategories () { - - var form = document.forms[ 'data-form' ], - series = [], - categories = [], - tmp = [], - tableData = getTableData(); - - //反转数据 - if ( getTableDataFormat() === "-1" ) { - - for ( var i = 0, len = tableData.length; i < len; i++ ) { - - for ( var j = 0, jlen = tableData[ i ].length; j < jlen; j++ ) { - - if ( !tmp[ j ] ) { - tmp[ j ] = []; - } - - tmp[ j ][ i ] = tableData[ i ][ j ]; - - } - - } - - tableData = tmp; - - } - - categories = tableData[0].slice( 1 ); - - for ( var i = 1, data; data = tableData[ i ]; i++ ) { - - series.push( { - name: data[ 0 ], - data: data.slice( 1 ) - } ); - - } - - return { - series: series, - categories: categories - }; - -} - -/* - * 获取数据源数据对齐方式 - */ -function getTableDataFormat () { - - var form = document.forms[ 'data-form' ], - items = form['charts-format']; - - return items[ 0 ].checked ? items[ 0 ].value : items[ 1 ].value; - -} - -/* - * 禁用非饼图类型的配置项 - */ -function disableNotPieConfig() { - - updateConfigItem( 'disable' ); - -} - -/* - * 启用非饼图类型的配置项 - */ -function enableNotPieConfig() { - - updateConfigItem( 'enable' ); - -} - -function updateConfigItem ( value ) { - - var table = $( "#showTable" )[ 0 ], - isDisable = value === 'disable' ? true : false; - - //table中的input处理 - for ( var i = 2 , row; row = table.rows[ i ]; i++ ) { - - for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) { - - $( "input", cell ).attr( "disabled", isDisable ); - - } - - } - - //其他项处理 - $( "input.not-pie-item" ).attr( "disabled", isDisable ); - $( "#tipInput" ).attr( "disabled", !isDisable ) - -} - -/* - * 获取饼图数据 - * 饼图的数据只取第一行的 - **/ -function getSeriesForPieChart () { - - var series = { - type: 'pie', - name: $("#tipInput").val(), - data: [] - }, - tableData = getTableData(); - - - for ( var j = 1, jlen = tableData[ 0 ].length; j < jlen; j++ ) { - - var title = tableData[ 0 ][ j ], - val = tableData[ 1 ][ j ]; - - series.data.push( [ title, val ] ); - - } - - return { - series: [ series ] - }; - -} - -function getTableData () { - - var table = document.getElementById( "showTable" ), - xCount = table.rows[0].cells.length - 1, - values = getTableInputValue(); - - for ( var i = 0, value; value = values[ i ]; i++ ) { - - tableData[ Math.floor( i / xCount ) + 1 ][ i % xCount + 1 ] = values[ i ]; - - } - - return tableData; - -} - -function getTableInputValue () { - - var table = document.getElementById( "showTable" ), - inputs = table.getElementsByTagName( "input" ), - values = []; - - for ( var i = 0, input; input = inputs[ i ]; i++ ) { - values.push( input.value | 0 ); - } - - return values; - -} - -function getCellValue ( cell ) { - - var value = utils.trim( ( cell.innerText || cell.textContent || '' ) ); - - return value.replace( new RegExp( UE.dom.domUtils.fillChar, 'g' ), '' ).replace( /^\s+|\s+$/g, '' ); - -} - - -//dialog确认事件 -dialog.onok = function () { - - //收集信息 - var form = document.forms[ 'data-form' ], - info = getUserConfig(); - - //添加图表类型 - info.chartType = currentChartType; - - //同步表格数据到编辑器 - syncTableData(); - - //执行图表命令 - editor.execCommand( 'charts', info ); - -}; - -/* - * 同步图表编辑视图的表格数据到编辑器里的原始表格 - */ -function syncTableData () { - - var tableData = getTableData(); - - for ( var i = 1, row; row = editorTable.rows[ i ]; i++ ) { - - for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) { - - cell.innerHTML = tableData[ i ] [ j ]; - - } - - } - -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts0.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts0.png deleted file mode 100644 index 9485e5ed8f83888e782eafae6f7505c79671a985..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts0.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts1.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts1.png deleted file mode 100644 index b5a00392866946feb7cf81da39f6c6ec6e0b50b7..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts1.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts2.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts2.png deleted file mode 100644 index 7c91a39ffac43e0867bec1df89b73e10e0b28c43..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts2.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts3.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts3.png deleted file mode 100644 index a6bc29bfc163974ece14f8f21a897fa908736b8f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts3.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts4.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts4.png deleted file mode 100644 index 742006adc9cee3c07b1a390da6991a84d1da99d6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts4.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts5.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts5.png deleted file mode 100644 index c49a29609d8e8f9bdf101e91021d40c1cb3d4175..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/charts/images/charts5.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/emotion.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/emotion.css deleted file mode 100644 index f801105ad0afd83266a71732cc5ffea1379977c7..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/emotion.css +++ /dev/null @@ -1,43 +0,0 @@ -.jd img{ - background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} -.pp img{ - background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:25px;height:25px;display:block; -} -.ldw img{ - background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} -.tsj img{ - background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} -.cat img{ - background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} -.bb img{ - background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} -.youa img{ - background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} - -.smileytable td {height: 37px;} -#tabPanel{margin-left:5px;overflow: hidden;} -#tabContent {float:left;background:#FFFFFF;} -#tabContent div{display: none;width:480px;overflow:hidden;} -#tabIconReview.show{left:17px;display:block;} -.menuFocus{background:#ACCD3C;} -.menuDefault{background:#FFFFFF;} -#tabIconReview{position:absolute;left:406px;left:398px \9;top:41px;z-index:65533;width:90px;height:76px;} -img.review{width:90px;height:76px;border:2px solid #9cb945;background:#FFFFFF;background-position:center;background-repeat:no-repeat;} - -.wrapper .tabbody{position:relative;float:left;clear:both;padding:10px;width: 95%;} -.tabbody table{width: 100%;} -.tabbody td{border:1px solid #BAC498;} -.tabbody td span{display: block;zoom:1;padding:0 4px;} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/emotion.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/emotion.html deleted file mode 100644 index 3a9584f9bd3380b13d05b4bf7f48f04bdc187c95..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/emotion.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - -
                      -
                      - - - - - - - -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      - -
                      - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/emotion.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/emotion.js deleted file mode 100644 index 2978faa64f0fefdabd3da8830ef7e0321617131f..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/emotion.js +++ /dev/null @@ -1,186 +0,0 @@ -window.onload = function () { - editor.setOpt({ - emotionLocalization:false - }); - - emotion.SmileyPath = editor.options.emotionLocalization === true ? 'images/' : "//imgbaidu.b0.upaiyun.com/hi/"; - emotion.SmileyBox = createTabList( emotion.tabNum ); - emotion.tabExist = createArr( emotion.tabNum ); - - initImgName(); - initEvtHandler( "tabHeads" ); -}; - -function initImgName() { - for ( var pro in emotion.SmilmgName ) { - var tempName = emotion.SmilmgName[pro], - tempBox = emotion.SmileyBox[pro], - tempStr = ""; - - if ( tempBox.length ) return; - for ( var i = 1; i <= tempName[1]; i++ ) { - tempStr = tempName[0]; - if ( i < 10 ) tempStr = tempStr + '0'; - tempStr = tempStr + i + '.gif'; - tempBox.push( tempStr ); - } - } -} - -function initEvtHandler( conId ) { - var tabHeads = $G( conId ); - for ( var i = 0, j = 0; i < tabHeads.childNodes.length; i++ ) { - var tabObj = tabHeads.childNodes[i]; - if ( tabObj.nodeType == 1 ) { - domUtils.on( tabObj, "click", (function ( index ) { - return function () { - switchTab( index ); - }; - })( j ) ); - j++; - } - } - switchTab( 0 ); - $G( "tabIconReview" ).style.display = 'none'; -} - -function InsertSmiley( url, evt ) { - var obj = { - src:editor.options.emotionLocalization ? editor.options.UEDITOR_HOME_URL + "dialogs/emotion/" + url : url - }; - obj._src = obj.src; - editor.execCommand( 'insertimage', obj ); - if ( !evt.ctrlKey ) { - dialog.popup.hide(); - } -} - -function switchTab( index ) { - - autoHeight( index ); - if ( emotion.tabExist[index] == 0 ) { - emotion.tabExist[index] = 1; - createTab( 'tab' + index ); - } - //获取呈现元素句柄数组 - var tabHeads = $G( "tabHeads" ).getElementsByTagName( "span" ), - tabBodys = $G( "tabBodys" ).getElementsByTagName( "div" ), - i = 0, L = tabHeads.length; - //隐藏所有呈现元素 - for ( ; i < L; i++ ) { - tabHeads[i].className = ""; - tabBodys[i].style.display = "none"; - } - //显示对应呈现元素 - tabHeads[index].className = "focus"; - tabBodys[index].style.display = "block"; -} - -function autoHeight( index ) { - var iframe = dialog.getDom( "iframe" ), - parent = iframe.parentNode.parentNode; - switch ( index ) { - case 0: - iframe.style.height = "380px"; - parent.style.height = "392px"; - break; - case 1: - iframe.style.height = "220px"; - parent.style.height = "232px"; - break; - case 2: - iframe.style.height = "260px"; - parent.style.height = "272px"; - break; - case 3: - iframe.style.height = "300px"; - parent.style.height = "312px"; - break; - case 4: - iframe.style.height = "140px"; - parent.style.height = "152px"; - break; - case 5: - iframe.style.height = "260px"; - parent.style.height = "272px"; - break; - case 6: - iframe.style.height = "230px"; - parent.style.height = "242px"; - break; - default: - - } -} - - -function createTab( tabName ) { - var faceVersion = "?v=1.1", //版本号 - tab = $G( tabName ), //获取将要生成的Div句柄 - imagePath = emotion.SmileyPath + emotion.imageFolders[tabName], //获取显示表情和预览表情的路径 - positionLine = 11 / 2, //中间数 - iWidth = iHeight = 35, //图片长宽 - iColWidth = 3, //表格剩余空间的显示比例 - tableCss = emotion.imageCss[tabName], - cssOffset = emotion.imageCssOffset[tabName], - textHTML = [''], - i = 0, imgNum = emotion.SmileyBox[tabName].length, imgColNum = 11, faceImage, - sUrl, realUrl, posflag, offset, infor; - - for ( ; i < imgNum; ) { - textHTML.push( '' ); - for ( var j = 0; j < imgColNum; j++, i++ ) { - faceImage = emotion.SmileyBox[tabName][i]; - if ( faceImage ) { - sUrl = imagePath + faceImage + faceVersion; - realUrl = imagePath + faceImage; - posflag = j < positionLine ? 0 : 1; - offset = cssOffset * i * (-1) - 1; - infor = emotion.SmileyInfor[tabName][i]; - - textHTML.push( '' ); - } - textHTML.push( '' ); - } - textHTML.push( '
                      ' ); - textHTML.push( '' ); - textHTML.push( '' ); - textHTML.push( '' ); - } else { - textHTML.push( '' ); - } - textHTML.push( '
                      ' ); - textHTML = textHTML.join( "" ); - tab.innerHTML = textHTML; -} - -function over( td, srcPath, posFlag ) { - td.style.backgroundColor = "#ACCD3C"; - $G( 'faceReview' ).style.backgroundImage = "url(" + srcPath + ")"; - if ( posFlag == 1 ) $G( "tabIconReview" ).className = "show"; - $G( "tabIconReview" ).style.display = 'block'; -} - -function out( td ) { - td.style.backgroundColor = "transparent"; - var tabIconRevew = $G( "tabIconReview" ); - tabIconRevew.className = ""; - tabIconRevew.style.display = 'none'; -} - -function createTabList( tabNum ) { - var obj = {}; - for ( var i = 0; i < tabNum; i++ ) { - obj["tab" + i] = []; - } - return obj; -} - -function createArr( tabNum ) { - var arr = []; - for ( var i = 0; i < tabNum; i++ ) { - arr[i] = 0; - } - return arr; -} - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/0.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/0.gif deleted file mode 100644 index 6964168b947afc2cf76780a85f43d4f77c257b77..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/0.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/bface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/bface.gif deleted file mode 100644 index 14fe618ab58a9d46fee90074386b5581d47b92c9..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/bface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/cface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/cface.gif deleted file mode 100644 index bff947f5216a49d8cd7fdd8d4e825808b3d14f6e..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/cface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/fface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/fface.gif deleted file mode 100644 index 0d8a6afeb1cb2cc40c5d76f90630d8a9c1323ffe..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/fface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/jxface2.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/jxface2.gif deleted file mode 100644 index a959c90f7eb17adc455982b040244fd583eed888..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/jxface2.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/neweditor-tab-bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/neweditor-tab-bg.png deleted file mode 100644 index 8f398b0958cdc5136a23b9745becc23a833aa325..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/neweditor-tab-bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/tface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/tface.gif deleted file mode 100644 index 1354f54b961211fb0253ccbd27a81da5dab5a639..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/tface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/wface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/wface.gif deleted file mode 100644 index 5667160d8b6228d301fccb56a8c1441b4c4e4b58..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/wface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/yface.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/yface.gif deleted file mode 100644 index 51608be0e74434388bcfe1f55da5c3c019f0a708..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/emotion/images/yface.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/buttoniconex.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/buttoniconex.css deleted file mode 100644 index cc6812e70f26ecd7ff687b46c763d8551aa92b3c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/buttoniconex.css +++ /dev/null @@ -1,272 +0,0 @@ - -@font-face {font-family: "edui-notadd"; - src: url('../fonts/iconfont.eot?t=1544182120898'); /* IE9*/ - src: url('../fonts/iconfont.eot?t=1544182120898#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAADI8AAsAAAAAY5QAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY87kkUY21hcAAAAYAAAAMEAAAIOvSWzAVnbHlmAAAEhAAAJ1sAAE3sXG2CpWhlYWQAACvgAAAAMQAAADYVNjhWaGhlYQAALBQAAAAgAAAAJAmVBYhobXR4AAAsNAAAAB0AAAHo8JL/+2xvY2EAACxUAAAA9gAAAPbwGt16bWF4cAAALUwAAAAfAAAAIAGmALRuYW1lAAAtbAAAAVQAAAKR8lzSlXBvc3QAAC7AAAADeQAABiPUsQ9jeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkEWKcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMTznZ27438AQw9zI8AMozAiSAwDobwx+eJzt1WdWFGEQheF3SCYEc84Rs6KYFQPmrJgwYMSEWTCuzpX4q9yDf/TeuSzDmfNwmqrD4evqqmqgHWiVzdIGLUM0dEVjUNFGM97K1Ga8rdGj3yfr2wJ1r77/7v77V1fUcK6an4byP/mjq2Oc4zxdzGA2G7nARY5yictMZxZzmMtKVrGGTWzlCkeYxDzms5BFLGYJS1nGclawmvX0cJVrbKCXXRziMP06UTu79X+m6GTT6GaQ69xgATdZq/NuYRvb2cFObnGbIU7Sxx72coe77OMe9xnmPQ/Yz0MO8EgnXsdM3ftjOjjIcZ7QyVMGGOEEp/TXpzmjs57lGc95wUteMcpr3vCWd3zgI5/0HWOcz3zhq2vT6OD/p9M/2n9N/PbDfRLqC6oR6hCqJdQrVGuoa6i2UP9Q7aFOojpCPUVNCnUXNTnUZ9SUUMdRU0O9R00LdSHVGepHaoI6k+oK9SjVHepWakaoF6iZoQ6mZoV6mZod6mpqTqi/qbmhTqfmhXqemh/4PhYEzi8MnF8UOLY4cGxJ4NjSwLFlgWPLA8dWBI6tDBxbFZo1aoKmjloTmj9qbWgSqXWhmaTWh6aT6gnNKbUhNLHUxtDsUptCU0xtDs0ztSW8iWpreDPVttC0U9sDP+cdgZ9zb3hL1c7Az3lX4GfYF9oU1O7QzqD2hLYHtTfwc9gX2ijU/sA1OBDelnUw8NkPBT7v4cDn7Q983iOBz3g0tKGoY6FdRR0PbS1qILSBqBOB7+Nk4LOfCnz206E9R50JbTzqbOB7OhfagtT50D6kLoQ2I3UxtCOpS6FtSV0OXI8roQ1KXQ1cm2uhrUoNht8idT1w79wIPEM3w2+euhXaw9TtwLM+FLjedwLX6W5oX+ttFN46NRza4dSDwLV8GNrr1KPAdX0cuJZPolnzp4HrOhK4rs+iuQeeB67xi8D5l4HzrwLnRwPnXwfOvwmcfxs4/y5w/n3g/IfA+Y+BY58Cx8YCx8ajef05cP5L4PzXwPlvgfPfQ+82fncHLf8AikFk6nic5Xx3mBzVle8993aYntC5uiZ1z3TXdPdIk6c6zCgWiiMJJcAEScBgQDJBmBlyVGEyDwyGxWuJYBFtzNo8P3ZBmDXU2vswXiN7/dZ+xjbY4hknnB6LP5vQXbPn3Ooe9QxKYPt7fzxNV91bt27duuGE3zn3lBgwNmUJSxisgTHI+sDrA9UHRRDWJnuXvWsTbJUn2IqX/Bd4krn9NxhjHmzjajElTOZlfpZhg2wBOxpb04Um9KKeLRaKsQ6Afsgugmwhk+0HrxbSY4WivAR9WIl5vJ6spvohq+WdyzRVK2b9kABVKWYVeOrYVzf+eOPImz88wcOFZxO/JDLY3j8K0BxrW5z8whOZFYnWduAR+/drtkMwkBlY/k/R/pZNa2+CYMheNJQeUOKFdlE8dcH558NCvrT81c8ueTOK/960z42o3L9mID4cjkR4+augNquLu9p0CByjZPxx/n8Dfr73DHVOwPR19lw6Gs9fdO4y39x163QcoJw7Vpk7BYerJPNaRM+Dif/kSRhGmRmGYAbOkxfrPye+JpYwwQIsyppZnCXZHHw2lAx5NUXL4+jzuqKrSSwAymGBksQTJBU9hH98BG4ZmRg5//yRic7S34nrSl9+/eu3vAbtr79uz7cvfmzkMbHEvhhueY0qTLxme+Bde9Fr9I+fM2J/CY5hbuyD6WK4Vi5Wx5pYiLXg++X78NA1PM3BXPV94uelNhcrLQDXT+4HBsvsErjKJduwDEuYZYsbNs7CVOWwLcPGYeO4qu9wM598h4JvobFmWR/T2ShbyI5iy9kqtpZtZB9hm9lpbBs7h13CmJrXFD3vxv5ASJN/70t1qpJWKIlQZc39IZ6hEbsVXalOumFYwLiBI2I4NLCqJ9swLQPwrompbR1RLROwAJhpGvSzDMPFykZ1juAAObv6ZCX9QA8Avs5wXoUkxsTU1JSFc38Ui7E2nG8GKkRwLZH5kn7whpCdBoeS+WRkcMhTABw8TgHSGVLYKSbU3WtAIlb6fCwBEI/xo+22Tx6XEE04QhrpWRZ8aYqp8C26nYiV58TiYPCbtHjZpvsW47juU+J/CkD+38RYMpX1QiYbzReKUCimhoZjKj6hD6vYB+eXzSlRr8eLfXN+hUwPKDEq03yQXwTzuaxcuatlUl4t1Q8LAV73Nwr7DoWDAhc2RqAx4vYmcoN9G5PRBUp93C0aG8P+mDecT/KFc+v1bAH8jRH7czDqScW8oyeuH9jY2RPeMBreMMTrwj5/oDnkBVgbaAXRHoKxRmiobwpYTY29nQ3Hz6+bWJN1e2KBJuD+xkS/39vsBe8DbndzqAlM+xd3K23toWJ67oqPdzXEAKCpOfQZWgcuF8PCuSiyExhDcZYr5jWPF9eg4KFfKktFJAOLngL+5kOeLvWYCjhLHi9onh5IRRR6pAfmgjaopeTj9EQGK+J0KgDvNQEUVi3JLGnlcX9dyB9qCADE1vs2jNYvHQ4k2+PexhgPN8FkTETtT7ka/DzSDz5vc6CxLlwHQydl8ivqg5nNeuOigVE16YF5gbDqce+GWFNvoq6nKwq8KdTscd81EVnaBooHXFawMQTQaO8Jtbta/fZTHn7XrmBTfWN769yLVnYnuuvAB23K30MrYy6kRUcOxNl8dhLxN84DkaGSgPng9URjw4sB87qKYwrlshEk0x6g+9lMyhPtAM2pqyaHCwvBHVOTWC9PpFAs5DKpABQpj9MSiqoiRG0OF4pZNTZcyA0goRVkXfk+uKQ+aP9bMAZcDT76bCDe538WlECHXwGfD6KBZECBPf7euH/PQ6Fm4Aq2HIyAr55Seib0yLOBRG/gWYBosCMQdR5KBHH+vxLowacexqcgRm8Iwx8bMBtqDsae9/clAv/8uQCSRcQPo/56WAld/ii+97Fn/PHewB5QQ23BKLYU66+nx1uwwWcD+NAzn8NcNGC/6K+3n7FfDUSU4Of3UKf3qOE27BBE/TEiLylnAee3hSVYD+nvfsDZQOoRSkyl+Ugj7y2CXAbcEVTqXigWhjsgpg4HQPz4z6FevTdop+OuBdDWlIqG4MR0DF4ORaPl79kPLYQt0LnDsF816pp9f67jIDz89HeDkUjQ1tSM/Zjo62wKGO44vBzs0XvK3zSw/qn2a9ethA7D633X1yg8xAKkb3bIPsZYivWyHNtA+iblUQaHQtGYnhwcwnXCfD9obj+kMrmCTiofkkU1oip+0NK4wNHYfJTluJghJIAk3g/NkGhJ8Ur5xYCiBPgoLg7N3LPQt6yvL5XqA/DZvdd95MtnQaip/NlxfzjsH7faugC62riJqYGZMnMKUMRaSsCuo5bg7YDycKq3b1k/9KfAfmTv9dDz5ENNQTPcHsZ6WLnSCspjw8mVqUSOeWoKiR/4UWwxW8nWs2PZKUj52FfsMuoeHAL2uVghdbxcCJRXtKyGIED3ImRS9SwKZSLgXJamAx9Bek4AioQ0XlITqlbU3VEsyGOFOIifhfWO4jLX737nWTHS1hdsjy3QxNozfWdEm2H9UvM8Y74xf65RmHtv96hx6k2rToBovu6Mdd1LYuX/YQzmYLBg2O81RBtPaIr5DNN9GXxiYXHFPcHIvlgrwPqVuZXrkUAjXS3tsO0U/9wWMTpkWVbeuvk6y1p8lNBax7cBpOKwtvPo5G3psS5tZeZ7gUW9c+70JcJuqRccOdDNluL0ZGnYOBfeLPFvPoc8W6QhDtJQi6qXxhP1eFVIaSk/xzzR8jCJyoVIykjjmvjK/aOf3Ni0/taR+1c80D8Mev8DK+6ff+dGseG2kd0rHuzP5QcetplwjV11Sn5kcPDqO68eGBwZGRq4cszcPZgHyA/uHrsX69evvWXkvrHdAzmA3OADY/cXb13XsPH2efeK5uL4lWN1q64eHMLHBq9eVT92Vf9goYJ1nbE0IIaLMBW1bAdSdD6pEGRCCJVPY1YgwCWMAZjmUd1yyzYRPgjTKJukw1FdOuocmGWVkZMF4YUS4nD8V7IkxpAHaXXi82fFBOr0FpzBItJSv0AoTfDZmQ58kUTTkCzQVHmjpCiySZAp3ZXFYrs7PrRMSw1H1CCkk92nDRFaG92a6x0uPwEebUWiucWlNCdWaPa7sC+dTC3P2G9BJLsmmYp/JbNq/lx3fSYeX5rpPVFrV0umuy2uncW3QVCNDMZTo83NEZf9bnZlczQCa7FQWVKRTzRXHUxjBJinGVaRTK2jXM+hzs+TXEeGRjyiE58kazhdWCWzwp6GZF+wJBNXuM4+k5B2DRMLSoUsoRrEr/ija478WTrKrLTGK1zryFE8mYJV8CqLhNpw8Wgd6TC374a3aI3Kcr1w1Qjf9dn/IbGfKXU92gEG2gECkS7T8RkIOeyO4NNh35DFzbLJGT/n2PUf56br6euvf9qF9GCbeImFiCXMW54UWA5mBT9IHGcgTvcxhkZZ0gdJ5BP+ePkjj8Mn4Rt20N43aOF7ywbiUdsc/dnr07jjGrEU0X0IKSWk8WLWFVKS1Qzcuavhl0vs3/HnZfp7Dl3QYi193r74z/tz2A7q7ucljkyxfmwHbTNvZJFUuJjDMSGMyBbTkWJF66oRcOSaHDf/j6Nz14wlRlcAP/eYY87lsHwUVu3Qt9rf79uw7vlzA+c+v+74XuSEVYXCKpDn18d6c264Wxk3Np4rxLkbjXHFPt9b7F3UY/9y9YJlKxcfC+0wUa2NZxymq4YXVaQv5AzwMG+MqQVWzDAhDU6nT0JDOFksIB7QhlJeKh5WY9RXAlRoBnD2I/unbjckf/QjSLrd9k9/9FzZ7S4/55wN19zkQpfWsjZybtPHxgL+nU0w2L3glM4IGngmVa55uLR8+rHnyjC/Pbso3N/TnDxRWXES8DpzYHWk++xFXXKNpbJwITkRBYaQatDSwiuTVcbmrD9HqlRYmrFiG+htIKZ5yOEZMYtfzN27l9pTRpVpRJV5ZnEImis2kQ2+etatMtSoR8kg7um+kN3ahjIoT1gjlAbJv1qSeDkyK19E0TTrwg8xgdzKSp3CCoRCgZJB55r8AGctGdDiNotrWnz6ghLYN26baOyEEiH8lSwn5UyL09152tR0jiHl19KFxgYQfa5ELXyqRB6EMJLDMZSNNXn1A5ZHDlIu9tUM6jtlOTROJV/+K5ULwxm5dfiEz6zq+B8ONC8zZsV9kLw4SPnBnp0xE/ZEzRBg4n0Lf7haM+4ceAps85CDP6Kxew+2qh+0fN9BRviX5D/UsP9fjrtmyQ46voPV+UuX29GDLsavQbsDkUc67+guzUHcRd3RVMkexyuJKmBwyNFrg0M6XeMF//PIGs7XjHxm5GiU8ndtv3/7XW5M7Ic/7XJyrsr90aO56b7zPPNKvnp0ZA3AmtHtdwhxx/bp84wbjm43hYVrokirTcvX2jKOWM+GcGYzWTSMCsUkWvqkZmNqSJgW6iHb054VItvO/0hpVwt4y2EfgBd+24D6ofmZes7NF5s7EE+1l8x2jVJ+Y0sHlMe8aA+J8/BcbyEirC/fVbXRHBppk0gtg3YaIlqJzCpzRnhNkfaakiyGADWml1BOXi9qCC2Swgj796GuIJWxT4K0TgRHZdM0pY7h5tZWi9QNN3b7wxXghY+UTX/YwmJgiHrLm7YikDGm8dhe/hSLsi60GJ3Vy2U9pLhVZ+V0JY2AA21ZNHf9MACZghuXcjEg0oUEBMCT4Xvrb61P9nQMtCxLz1sI7o923166Av4Q6It4/a6wHcJMnd/NwQ6F3f66SF8A/hB2+b2RvrXxVUd3tIK7Q2+Po13QXSh2rjodfi9rob0cdjKL4PfBXmohbIedTI2do7FVNIN6xV1RcXmoujR78hVNrRCkSlZL8F7V2VF1cuT1Si3e5snkXa58xn7OST3g2XKV233VFli25UoPpu/Y35QlV57sBbdTB5Zkcm6q63WqILCAwXQ0PQiYRDKDYPLLNkc3X8YxiWy5jKO14WTMyv2aalR8gHWBA62L+2+1LmAmxmhhXJ01C/PvR7IwFV+Jg9G9rJ75ieuEXkyqOrSh2aQk+drdv9s+CtHR2+wV27ba2wmtE7R+9FFoglH7G/YFhmxjh3gb17cJObfZsekVB9+jGQberFf1ccTp4nbvFi/M7+tbALhQdl3z5addbr8C98F95Y0QgcivG/bkfL14c0Gvr/A0X9C644wd9vft4+EL0Gb/XPJjyQWCpHcA0dYQW0QWgNNdUSwUo7EOcOcLnV61EPN6iHCk/RxT9Uy2iMuRKhT1QjGi94M371Xz5CqEbvvliTUwNnah/fIjW8K8wXc8V7n9p8iyursb5ujuK+qvaErkIxBegfOxwnvSqGsJ79fU1bEfr/jmi77FF+bI/EFrg9nGe93D6YHwH3574aVbwiN1wxFofFIAEmqzPz7X22vUGY3QDKevy3GEopcl2tlfazyAglvNq948efw+3Hjsx+WAvln3Fw1I1GDzMOoXlvahPT0LlpPxL019/j4sXjIlDEbTfxb0Lv2LmCmPSWd3sjls8OCWDZBrJJdJedzVjHDkyyFNGnsJdBW68Ac7KplrUDWhNXDHoQ0aPr+NKne1OYmdlgqO1eIM2u/Jol4bqFhkeW2/ElHI1iKl0gNy8yUp15JMH7n9RIxIjr4QWWQmuebIpWaYUkeE/aeikrBO9YcBZRJtPqHRS1aMST4TbppVvWJaxhRDLYSlFuqYzmplBibe4Pvtq/06mHYsP5AeHgDkr1qL90gV8zVfDDWcYffxTcuWbeLO+UhV9dZ/UNvsP8L49IN8k+OPel76VwWuAenvPkR4jGaS/nBMSQXnXsEphWRID6EhlnbKtRDOPu3/5JPFQY1A3HBMGYp6NLQNTfIM2Sa/776yeV8gaiGxmlY0UNYcbT660v7BD5YtEKwTUNm3R8gpg7MNe598EiIBe2nfFIM++GogAhdcYF9wqT32jTcvtY4lT4zfH2YsJX3CrNLnWj+aVkM589lithSx6hrpQT2BbUb77XS5T/hxdgG7hF3BdrB72ecYixS1AFcWI30VNTzceKZ8Hg/AvCZvF0OVS5idYkVUW8VqqlEenxbFfIDrxUhtMebpWsMj79UX87w3HdNj5Kcl5U4OEUeIqQWSYh63gqKrmCHZtWeyezIxOZm4Y8/OjpXw4mT3hH3LJP6D3ons5Gq8eSdd8Xcn5kyUBzBz0+ScyfIDmIlhBrCk/DusBL/BzBUT3RM78YJ/mx55HnN/PzlpfwfTXVTlisnJdV1Hr/70c9hwF1af9D7paxg8rgOC/vMVFUDYx7Rv9196fv3SY+pegNPqP7lFeC7gq+YJP3YPG9hzR/eeju6V2LR9y0T35M7J7AT00pvuxJvlX2MH+buT1Lc51MtJO0KZWKUH2MtJfjJ2sHyFHM+fuie7cTzd2M1J8GGKtWjUV1Dd33R1H/3p7ufwugtf8tItkEmGO+tjo8mmZ6y74pu83pM7INLZd7ZPX+iDzAwZM5NuWAuQ7EB6rhw6Cd9KvnYvlQ7DkcnkW6VLYZZQFpQMeUPeK5scSZlkhH/GXnljzT52F0sjnw0xg/zZJLmSIq8rdKTpQm7d41FN3aiFi0iCWkhdyHUlUkSthtIwj3gBb2T1rEt2zUK8bKM+Asum7VySbKgmVqgDBnLXqeM7zPFOq3Pc3DG+Y3ztWn405MoWGJY1hWrspeqFc4n/li1z/etNKdhq7+6k3eGydfLlV2yJ7trt33LF5Sdf/sLqDzA+ig5wIxqlQ8hQAdoyp6iEShrRVA1HQbaBRrA1nSUoREaCWsTxIbNAzn6Jo6y2LHJ4v1S9cC4ta+/y5b5nTc3eBeOdl6y67jpuyN7efLvT22dWC/OgE9S88viuV7r6nAlSXgnICVq7dq0Tn3GtHJ/EG35I9fOc3BAbTvAo7ZOh1CtCFu9EE3zY2Srr5ykJXRUsIs6GrHip/HbH+i0bFqZSCfiekl+YnxOLKXafsniuAg/k7PGoqnbnF+Wj8L2OVGrhhi0bOmylvbN/41kL9C1p3pXjjTZLpFLz129Zl4C90VisO78wF7UHo3MWReFe3T4zim1mVTUK30ms37x+Ab7HVtObhheevb63M85V3fEVVmRmN2mqTMrrJqmeqXhjSVnFhovpUEbbX5DLiJ/WCZ+rrDQG412FMek7HeOuehf/Yns6P8b5WCE/JsJiB8CNPNhUvjsEWOQ4WWEK4Eq7GIaxIj7Dl+dFB8luMa03k0gfR1GUD0o5NGIqRnV1WytK9gDNX0iDw3gseYc5p1h35tlw/sme7LKWkfR4MXL1YwLEozfWj57Z/RqcNsNzWXFmmrVeymWfQoPgqp9cDhBvNbq6xed3NDZ85lHIaNAAv5WIaz8CK10zszGGlF8dUwNKlCTO8AAroPZZwday49hJbBxHOT2r/aDGot5sIZf15vK5IoU04GUmX9QyWYpVQKyNONWxiYpe3RNVs0hkqh5TcchqKpPV/aAWitKfTrzkJYGBIsOq8RmcEAqPe70PeS/w4O83G8O989YoT/lbfOO+lq60b03ryp5Hxr11p4XCzQe6d0n5DdpnYoACgbMaP8TnM6d0Q/fmnhOB984RmV6PPF+7aE77iLYhlUikAgOLO5K9nquzW3pE9uTu//2+O+LYEuNPtZYfJn50/Kxy3lxoU4Wl7MiyEbakIjOEMzJN0WPZXEZFWDdczKSl/FDwokD+VUqJbqJe6Y7XqLYib/Pja8ZRPn5w+Hjo/Xln58UA5dfF2eXlhdHti9es/tpHT67zLdsE+I9vXtYE93/2hhtGf0BSnT9VvkWY9qv2e9fDSi3utd+66YYvypClz94MZ8PwpSOU8E1LGxp8jcs3cZj38cF74OzpfXUnbqGPLSTsHQAtKzSBlJ7BNKLTVoiuxlTMacXD0fe3fd6gq2vdOWvDYe4Prrrg764z6oN1nlBd/cqbbzvn8cO56uGUvt4TvwzH2F868aQTNsEx5TtA7900uKWvF8Xo+f9+WPKuGU8AMVaudh/uwD3uAcIvmQHQIkJfDDqaZ7rYvxF3sI7efu+aRNzd1fmR3d//xb3HGp6sNv7Az+VW3KE6eM/io5Ysusf+lP3xB29euuJBMKdlzDXIh6sZCXKpRVSvDBFC8exBjDWNvJ0NZD/EwTGPEOG6B4ewluKnnWNFbh3nKQgii/heeN1iTOktmMXe2OjtG1sSi+a6Niw5T1/04Msu18sPPfSyq0Xd0JF0g/+ll8DvXjxq74y2gj8Y9IuWdCv3h0J+3vKn8yDCd8Z68mahV9EXedvS2XigKx8C1w8fevCHLtcPH4ThU+bm9EuXiJfs/0RDKvCtzQ8sbm2NPF3fmemsN8KqGjZk9plIM7D33LVr5JZamIE3iwAGJEqnGC00khBKEPfwXXv3ks/MLBuo2LllmCWLm/Dne35tX3Gv/ToaOMg1FBBGPgxWwU21MRhjbB07hmISPlAcRmSaaPLvi8QA4olQmtA2LoYeRXrJat4ji8romN7fZdaMDaqu8pnrL/5MH2/rubD7j24uXK7T+i7sOXyIhrCqFGfUkJkTp1H+AZxdNqH+KcuKtIeiimpZ1bmfI+U/zRBLV0U9aVfpiCBRlkGgh7SFK4DX3HB2NuX5E+KfblqxgKOo2txqL+bGyqT9MWGuTHab1Rp0vukfXdAGW8psnlhRYoWNK1E6GYWN/EZWiSu4Btd/B+OYJw9VmPaS00mVzLXQ/mMOz8JV9rXPw1HSFqs5bAFXPmdOTU1jWQS4Nb4Ejm22sgwbplbbat3/xZp8+iB5CmCwdpdN6ZY35QaVdNELQ27P2NJ3D1QEb9Y48gm2mQfy31cd9QfsHyQbQL5Vkz3w1uTdB8mT0Wrtlj0LyF5+WTibCrJLt8ueBWQv7dptCOQbZh+yg5W1qXO5BSBCbmNz0DpdyO7BXma0IQkV0SikAJ1FtJtcsaPdg8gjVYuaQvaopylECdM5ZDIvBW8M8Ew2lslqc+npDIGGwrCa0mWYFvkjYoUsQSoEfM5udVTNKSjWYgiuimqBMjKWcj7IUMIYhRIWveJdj689aF+1+uz4tf66jUG4salxCjoHOzuHOsufg5ZUajjZ2XxspeRblRS+0vrKfUvmt7YLwRsToqMFPH5PtD8noPRYQ2sT8JOPnbM8m1g1t5039H40V9eYCJzz9Ep9OUCLMqfg6YjX+ZrquCswkmlZmXWPH7dwW8aTi7oD2Nw5HnfMvvr0X5lwnE8U/HB9Q2p7c0dysDPZ/B1c6lSqpaWTf1vt6KSSBZX0hc983QPNDS31jXWFuaKJg4ur2Rd/FAHojKaM7fG59XXgDoYBGjeNDT5yRlMTwr9hlFB12KFUQ6M27GtoAq312Dz/6MrE8nnK9J67eJj/mGm0ggO4iCgDoyqquCTpDJJvXgRtMXWY5rOQEdcPnXVLuDWecUfXbSq/2aoBz7RzzxfD4UiiOdzx0962VngUqwRRBTQ1H3Oy1iriaf4PkWJEgUD8J33avMo77+M/pHdGCouhQB7ZqBdRBVJwnCgoSaCSgkJxxTOFawbPuiXSEk+DW1l3Em9s0/CV5Xe/tP+V7fDw9Cs3btHa3O1p/sX9r5zPKCJ96gmxV6ydEX+dZj2siNS7TPrlKtHPWsWiK1Ysuto0TTInVJRR6U71tBNLnZdhw5zp23Zu08Wu8g1v/oG/+QfoeftP/O0/QeKNX/E3fmWfDXttXd+l78KfPbhtlw7379qagyt3bdP1beWdeHfr5/Vb7Z3VE977X/be07D6zp0v6TvP0vWtM/2hf2nMOlizY9Z5JWb9/9f94bqD+FQ6ZnpVZqezPSsHilInN/cM90rZqk0cHwvJ1l8gnbbOeD+LVPyXs/+Q1EpbOdLO+9LW3FZ9my4PRLgUM3WAdh0fo2w9dJhDvumwR2tuiun44/I8xXIiVyk59NjcBzjkG0Gn0dh7D5yfOUrii0+IU8XV2HYzas4Rydd+UgfIsRpmtH6BUkzV82oE9VExX1TkLV2kstAvd+/I9CJPiJCqpQ0oRAou4S7hi/Oe/mBwxzmpTle9KzwqRge/eaUWhGERAL3wL2Gf/Ru12fXC3Xe/4GpW7d/4wpc/JLLvvJMVD/GcW21saYSzPeGrfJ316eRAM18JdrkhBTfDFfUeuLnsD8BPuk/qv/sFIV64u/+kbjsVEP8sHrp87RJ7IzyxZO3lD9XG0DOJDeQuC3mzQ7qSzOshYRHjlkywLAuZexEigKPAMMombQbUxIZV515GWNGXNd4KLVG0lUm7QCbl6BDkVKKPKQw5t6+J7wqlZu0qVBmSUYG0YuRlz4udpW2w096GkBzPNpfXNuWFom+zWQ6XDLbq1Zgu+a0V7UHKFtMU64uGZRto0yYzbOrd17fdMq23jn0U9pUsaQQLZuzaJUMII/Y+3kS8VaKZIf79hMT2WbSVNrDj2IlsCxtnZ2Db2QJBWNQyCsXSe7MZynvIj4HQIQH6EO3eZrKod4ZQEXo9BOvJozGMGio3ANIAwCdQNVUtecfdl6/4AlXyef6fO5pA3Lg11xsU4oZjrnV564U7TCW9mU/607HeeRD0a8HmluAjfq0XgbDnMlHvMoW4TG3buJ1DxPNw8I6S9FSULWvaJWhYA5/q6t16o8AKQjSIGzZe70Kjob5HxzL/Hf4gzOtV0v7JIEDwEU8I0XWzepUQpqvBdbmXb9/Yn216KDgg/nuJNn5I8htO21LO/1J8R7TN9iEfcG0rh37wNa4eoi231WaosHKwTX9J36sfyl8dku9w3qXMkjtEh9zB8zLQ1IkJlD5PeRCNEo2beFWB+cQmdTU4umo/xBBPJ1AUCtKUeoiMSHnMyEtRjVyAvORMkV1ZBo7Ynf4kY1hTZE3gjxw/Tu6Q70z7uEQVISQW56jNC6khyoybduWlUFkfuS0KbKZPHnl8WmF43jenGbRl5X5XdQZFSAsJJzIBhRoi6vmQAEXGJoiUlspk0Z4bLuRzFDpPoYmVWhJNK/SxDcWf+wFJ0ipPH2hOU9hCczbQox6V4fMXU9yCKVxdi9SheE8k2tXSEg5DNppsGIwt6vIVF5LN6cokxQph4JTRjyYRtZ/ZsWZDZxsIJTSvLQGFuSPzkkfbZnvLUDsPB1rzjYEEQMg/1BpHq3qoy93e5elqFXOGD0pPHc4OBMiI8/z0n5sW1wFEeVpgG7kKLGdfzznKlmFIPzqnPY/KHqkpvyXDdTYkLjo8bZFcoH3cylGbF+zQFMTNg5HB4WhL7rGQQ8Q5ZuTZoUnIPBi9O7Tl7Os3sKjcd8/TzkEtAkw69t3MsMdDFwqkHhnOauG5dDqe5mmaOP1IC7lF5+rPNg9+JTHPfvrYP2Mp5BGJ5tySPyiEIilqgBxUjpAD6uSq0ErY1oyds8oHC9NlDrbDS/n1oW3WzrWsiemsPhHNzupTLaKMZCW9hg4BNJ1tIMOc1ZcDbeWViJ5s+kByhgSZKUMc2ooRF0mpH0qTIqAjKzuCOIPsC2kjmVIqU1O0fyg3Cy0UDgYsLhsGfbkhnSRA33gYOHnONHLL+TQWDPoeTsYkMrnPoNGXvxFNykSdRLHqMKvm9mbp++i8qqtFWU4BEfnHJ0dH8TcxOjr6OHzjI8eJ4ujAKjE4UnwMr03aCzMR/Tg7nO+VwP76rbfBbbfCQlt+lzsD58/cbZfaKC2/k01Wvpd1DCsN390CznroFcntsDKuNsMloF1LW27Kofa25OfOqJhsZ9blQQtim84CVSakugmL/+oPanto8stV2lbF3kTkl7y4EJVj9p+D3pAGTYRy9M+o/MldAHM2oTj9cM5Yw6wedH0Ee8yHsoQOZAWRwVmlTCKb95tAjn+Afxv+kUgjXUxyMox/sdehU7m/Uu1LUkZDzkIMkJzhj0VtRh9OechXSx/YFOVHlcBmuwv5eNlwp4ddruE0/zcnLc8HoK87Q438Xyupud+bWGYwkBbHdw0CpqUvYCqsYGNpT2Mw2CjGGoMHnDv53Q9tdFHMKPkQ3NXIlMPsQVhSSTkSWnqyZUQeO9weBCfGMyoUIIzDbo7UftswjfNprUlAkg5NU8QSpkhhRCco7aYPYVRhuCm1K3a4JgaU/AgzorYiXvriLVukT9zeF5y1xLz3fvP+e+X5fSFY5W3VW/hjB6CLdG3MTwVRzvkg8UwzyUOGSBxppDGTU42EcsQRx3U1enY2z1e+oSMZlNUUtYrrBK1CJR/RQkUUNCV8rYvJgIcqa5umuf/CouA+g9Cb813dFNgOMVskvUiIy4qzeD4gvWRzZPSDxFWiZtUiEtfQF30O34c0mKVCOTYf3TwxsXlyUp5XSKBj0bSWccioGQ6kTWkjALHZE9Wn8GyPWxUZgTJMeqwqYqPS51m2cdFH2E+CeuxjSEZwUauE+ei/JgBj2jKuypuP8bXUClIE3/YSmChyZvraaviB5iEtR7ifwmg7EA+Sa1aVPaVIlUyBvRYOFx5pm+6ZbX51us1rZ7Z61H77/LBtqgdp82szm1xc6WjgEPqoS+4E077ZR/d7p0KVlGREftbh1qrxmOlkNXYerY5QLkME5UU7BPMSKypOt2dWGheSap0Dbrcn+Pi+6X+2YVTDN5+3GcXbc3kef3DdRW3VbyRhvGTgwA26FvTNpOjsNDrLFp72dZrVPyeO8/qw394tHxz3h0tXfveU2yiE3ymgVjrD/v0NITY+lN6uxu+NsKPYRpytrezi98/Y7NnKSynraIgPOYuRI5nF8el/fN/+/BHN574jmM4ptv/yw8xsJRblfXPbLKNtlrAV7PiDU1/6b0Jxfw1a2/3h5uJD8+OBqOuvTUn7uRF2H8EM/c2YkR0Ow0gKQRwjfUtS5iGQI3QukRXlanAMFjEyhUlHTOMYQuKaRJs6YV2707A7YZ8BOHLYV7mqfmPhPBOUyI8B/R8d2YyfvgeRTkXqk9eTGoAMfSNSLCTAK+6sb6l/daIp4wvcWN9a/1Z96QwXO+8/fW2+m/y+dNPEq01pnx9Un+/VCb8v03RjPVZptS9AyH3WW/X1N+Jz/olXqabjX3Vi5ELyi1n6SlUjPJxUHChMC+noB2dxp7Gns4s8TQDiu/3QGi39Gk9iebStrbRaLC89SwdeUFEr4K3WaFmNtrZG+a+jrUIr4Rn6q/cHsPqFbVF8QFalVkpfqVZujVbsYvfTB6TtGWsXqvohkYar9C315dPxd691X/VeDN60A/CUvVr8t9JFb7zhOuG9x6DLfoW/Xa6rmB1x8cK2efZz8TvxD5MT8a+yVjXvn/HOStvv/hhOtR/Y38pd+FzTIfpdlf0z2qr1o9biB3IUpeX/wpSU/2PCjPHw3fC0vap6lMdpVPy58hJ59JT/k/eWn+arsOY7ONbnYMn+Pp44376udqR81d69cfudvRddFH9i2pd1wP7P6LVaY6nMmvESvTfwwBNP2L3UrdqjZqrmzcc+nOhM9iHXujoPEJq55rV/rjfe+5lrHr3j3XdmrjuuT3VuZHqZHC28OWM6Kt34Lzlmn4gAeJxjYGRgYADiAJaHxvH8Nl8ZuFkYQOCGQVUGjP7//z8H63bmRiCXg4EJJAoAI2oLPAAAAHicY2BkYGBu+N/AEMO67f///9dZtzMARVBAFQC9ZwgmeJxjYWBgYMGJ//8nzCZG7yimZ7iwbsPEAGenD3IAAAAAAAAAACIAngC2APgBKgHoAiYCrAMuA94EMASqBTIFmAXSBi4GggaiBswG6AcMB14HvgfMCBIIagj2CXQJ8ApsCroLAgtKC6YMFgx0DJYMyg0yDZoNyg4kDnwO4A86EFYQjhD+EW4R1BIYEoITHhOKE/IUShTEFPIVghXEFfAWQBaSF3gXshfsGFIYhBkAGUAZbBmuGd4aThpsGowathrgG3gbrhvkHB4cWBzWHRIdTB2GHeYeMB56HrYe9B8+H4gfwh/OICYggCCoINohOiGCIdwh+iIIIjIiXCKGIxojyCROJOIlDCUmJWYlvCX8JhgmeCayJvYAAHicY2BkYGCoYljBoMQAAkxAzAWEDAz/wXwGACieAlsAeJx1kMtKw0AUhv/0JibgQrHrcaOgNL1shIKrQuu6QvdpMmlTkkyYTAvd+AYufB6fwhfQp3Dv33SEUmzCHL7zzZkzhwFwiS842H/XXHt24DHbcw1nEJbr9HeWG+SB5Sb5yXKL/GzZxQNeLHu4wis7OI1zZvd4t+ygjQ/LNVzg03Kd/ttyg/xjuYm241lukW8su5g5j5Y93Dpv7kjLwMhIzLciCVUeq9y4MlonnVyZIIqmcrFOA31gDnAmdZmoXPT93oGdyFzqv57lZjEwJhaxVpkYs7lMUyUKrVYyNP7SmGLY7cbW+6HKOOIIGhIBDGPEZ51jy5gghEKOuIqGdbvdNX2HuaIJmEeY0i/oU+b6RM3/dkavUdLvbhDow0fvRO2EPq/qj+csseH9A1rDWQWX5rmMNLaTS86WkgWKam9FE9L7WFanCgzR5R8f1fvVC2S/Y2l2a3icbVQHe9s2ENVLtEhKTlwnHeneM20zuvfee++C4ElEBBIIAFq2++d7AOnUn7/y00c8HI433jtodGbUP/no/58jnMFZjDHBFDPMkSFHgQWW2ME5nMcubsMeLuAibscduBN34RLuxj24F/fhfjyAB/EQHsYjeBSP4XE8gSfxFJ7GM7iMZ/EcnscVXMU1XMcLeBEv4WW8glfxGl7HG3gTb+FtvIN38R7exwf4EB/hY3yCT/EZPscX+BJf4Wt8g2/xHb7HD/gRP+Fn/IJf8Rt+xx/4E3/hbwiUkKhAWGGNGgo3sIFGgxYGFjfh4BHQYR9bHOAQR/hnNJHaeFp6Ek7WjqwWkqYqCK3kUrWeXJDCBmXac/3OCifWTth6p98HFTRJo4t+qxqxpoV1tK9M530gO2/pIESQeyk0lUa4alK6ztd5KeRm7UzXVksfnNpQqHm3rufekqyF87nUXFf6ZFwaXeWrTmsvHVFbrIxrROCfrDOOQE6rlhaOGrNP/VleaiM3NzsTaCpaWRs3rknbnIE6Mi33uPCqsZo6q42opoqjtGF5o/NBrQ4lY3LFsNO0CjsDHpbFsDq1rsOYs2/mqdzKyGnlxCr4zHclV6tsmHZtdCh8Z8n1poyLjMQZl0UeEiqC6Sx7SOGJsTbbAffk7quKzIw7jHrkVkRWtVDtLPFN24l1qg2ZJ1aEu9N5Q25NkpizrGJjiPkG5Mw2FyEIWTfc6KTpvJLjdSPskGvlREOZrVY9l+OtYdnogIONWWTKfStsr0QWj5LuU6pUCFUelagp0nKe03grpGrXpQnBNMv/DMHYKUcQWz12VJkxi2iKE0O1d2rgguso57lcs3Klpkl676V3ssY+LkedLp6y9UpeOGVNsp3lhncrxUJESvkwHLrAsxy76T/LEm5NS/mKZ6bkXtmYGo3x+uOYNU8oRc2Gi2P08haKt2C336UQVGnlw6VTPZZxdGmInI6Yr+UtFIMMtHTtiTC90H3uBCv2zSzXUzoSm6k3nZNUeMsNcnqW4BhzZX5xjOOgTITj81nPc1WILphwaMlTmMYrGeKd5D8MYi83lsYejisRqOiHKhV+ik8dXJ5i9uUll8RXQslYJDjwnYY8OhQJnbQmFRJKn80D8e3l7DNRVSulad5PPlVzq+RGcOvxZih2mw/rlWNw9RhcOwbXR6N/Ae4UDYMAAAA=') format('woff'), - url('../fonts/iconfont.ttf?t=1544182120898') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ - url('../fonts/iconfont.svg?t=1544182120898#edui-notadd') format('svg'); /* iOS 4.1- */ -} - -.edui-notadd .edui-icon{ - font-family:"edui-notadd" !important; - font-size:16px; - font-style:normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.edui-iconfont { - width: 1em; - height: 1em; - vertical-align: -0.15em; - fill: currentColor; - overflow: hidden; -} - -.edui-for-close .edui-icon:before { content: "\e654"; } - -.edui-for-searchreplace .edui-icon:before { content: "\e70f"; } - -.edui-for-italic .edui-icon:before { content: "\e62d"; } - -.edui-for-insertcaption .edui-icon:before { content: "\e657"; } - -.edui-for-insertparagraph .edui-icon:before { content: "\e62e"; } - -.edui-for-inserttitlecol .edui-icon:before { content: "\e659"; } - -.edui-for-insertimage .edui-icon:before { content: "\e617"; } - -.edui-for-previousstep .edui-icon:before { content: "\e630"; } - -.edui-for-nextstep .edui-icon:before { content: "\e631"; } - -.edui-for-scaleboard .edui-icon:before { content: "\e632"; } - -.edui-for-brush .edui-icon:before { content: "\e633"; } - -.edui-for-background .edui-icon:before { content: "\e65d"; } - -.edui-for-strikethrough .edui-icon:before { content: "\e60c"; } - -.edui-for-spechars .edui-icon:before { content: "\e603"; } - -.edui-for-clearboard .edui-icon:before { content: "\e634"; } - -.edui-for-bold .edui-icon:before { content: "\e604"; } - -.edui-for-fullscreen .edui-icon:before { content: "\e656"; } - -.edui-for-formatmatch .edui-icon:before { content: "\e60d"; } - -.edui-for-underline .edui-icon:before { content: "\e605"; } - -.edui-for-removeformat .edui-icon:before { content: "\e60e"; } - -.edui-for-blockquote .edui-icon:before { content: "\e60f"; } - -.edui-for-anchor .edui-icon:before { content: "\e618"; } - -.edui-for-help .edui-icon:before { content: "\e619"; } - -.edui-for-horizontal .edui-icon:before { content: "\e638"; } - -.edui-for-simpleupload .edui-icon:before { content: "\e61a"; } - -.edui-for-indent .edui-icon:before { content: "\e61b"; } - -.edui-for-justifycenter .edui-icon:before { content: "\e61c"; } - -.edui-for-justifyleft .edui-icon:before { content: "\e61d"; } - -.edui-for-justifyjustify .edui-icon:before { content: "\e61e"; } - -.edui-for-justifyright .edui-icon:before { content: "\e61f"; } - -.edui-for-link .edui-icon:before { content: "\e620"; } - -.edui-for-cleardoc .edui-icon:before { content: "\e621"; } - -.edui-for-drafts .edui-icon:before { content: "\e610"; } - -.edui-for-subscript .edui-icon:before { content: "\e611"; } - -.edui-for-unlink .edui-icon:before { content: "\e622"; } - -.edui-for-superscript .edui-icon:before { content: "\e612"; } - -.edui-for-forecolor .edui-icon:before { content: "\e63a"; } - -.edui-for-backcolor .edui-icon:before { content: "\e655"; } - -.edui-for-touppercase .edui-icon:before { content: "\e623"; } - -.edui-for-tolowercase .edui-icon:before { content: "\e624"; } - -.edui-for-insertvideo .edui-icon:before { content: "\e627"; } - -.edui-for-emotion .edui-icon:before { content: "\e606"; } - -.edui-for-pasteplain .edui-icon:before { content: "\e613"; } - -.edui-for-preview .edui-icon:before { content: "\e63b"; } - -.edui-for-print .edui-icon:before { content: "\e63c"; } - -.edui-for-selectall .edui-icon:before { content: "\e614"; } - -.edui-for-mergecells .edui-icon:before { content: "\e63d"; } - -.edui-for-deletecol .edui-icon:before { content: "\e63e"; } - -.edui-for-deleterow .edui-icon:before { content: "\e63f"; } - -.edui-for-attachment .edui-icon:before { content: "\e628"; } - -.edui-for-music .edui-icon:before { content: "\e640"; } - -.edui-for-gmap .edui-icon:before { content: "\e629"; } - -.edui-for-insertframe .edui-icon:before { content: "\e645"; } - -.edui-for-pdfformat .edui-icon:before { content: "\e62f"; } - -.edui-for-word .edui-icon:before { content: "\e646"; } - -.edui-for-excel .edui-icon:before { content: "\e647"; } - -.edui-for-time .edui-icon:before { content: "\e64a"; } - -.edui-for-snapscreen .edui-icon:before { content: "\e650"; } - -.edui-for-wordimage .edui-icon:before { content: "\e652"; } - -.edui-for-edittd .edui-icon:before { content: "\e65a"; } - -.edui-for-lineheight .edui-icon:before { content: "\e62a"; } - -.edui-for-rowspacingbottom .edui-icon:before { content: "\e62b"; } - -.edui-for-rowspacingtop .edui-icon:before { content: "\e62c"; } - -.edui-for-scrawl .edui-icon:before { content: "\e616"; } - -.edui-for-redo .edui-icon:before { content: "\e609"; } - -.edui-for-undo .edui-icon:before { content: "\e600"; } - -.edui-for-inserttitle .edui-icon:before { content: "\e65b"; } - -.edui-for-insertparagraphtrue .edui-icon:before { content: "\e660"; } - -.edui-for-aligntable .edui-icon:before { content: "\e662"; } - -.edui-for-table .edui-icon:before { content: "\e664"; } - -.edui-for-tablealignment-left .edui-icon:before { content: "\e663"; } - -.edui-for-tablealignment-center .edui-icon:before { content: "\e665"; } - -.edui-for-tablealignment-right .edui-icon:before { content: "\e666"; } - -.edui-for-paste .edui-icon:before { content: "\e667"; } - -.edui-for-map .edui-icon:before { content: "\e668"; } - -.edui-for-directionalityrtl .edui-icon:before { content: "\e601"; } - -.edui-for-imagecenter .edui-icon:before { content: "\e602"; } - -.edui-for-imagenone .edui-icon:before { content: "\e607"; } - -.edui-for-fontborder .edui-icon:before { content: "\e608"; } - -.edui-for-edittable .edui-icon:before { content: "\e60a"; } - -.edui-for-imageleft .edui-icon:before { content: "\e60b"; } - -.edui-for-imageright .edui-icon:before { content: "\e615"; } - -.edui-for-insertcol .edui-icon:before { content: "\e625"; } - -.edui-for-insertcolnext .edui-icon:before { content: "\e626"; } - -.edui-for-insertorderedlist .edui-icon:before { content: "\e635"; } - -.edui-for-insertparagraphbeforetable .edui-icon:before { content: "\e636"; } - -.edui-for-insertrow .edui-icon:before { content: "\e637"; } - -.edui-for-insertrownext .edui-icon:before { content: "\e639"; } - -.edui-for-insertunorderedlist .edui-icon:before { content: "\e641"; } - -.edui-for-mergeright .edui-icon:before { content: "\e642"; } - -.edui-for-mergedown .edui-icon:before { content: "\e643"; } - -.edui-for-inserttable .edui-icon:before { content: "\e644"; } - -.edui-for-pagebreak .edui-icon:before { content: "\e648"; } - -.edui-for-source .edui-icon:before { content: "\e649"; } - -.edui-for-splittorows .edui-icon:before { content: "\e64b"; } - -.edui-for-splittocols .edui-icon:before { content: "\e64c"; } - -.edui-for-splittocells .edui-icon:before { content: "\e64d"; } - -.edui-for-arrow .edui-icon:before { content: "\e64f"; } - -.edui-for-aligntd .edui-icon:before { content: "\e651"; } - -.edui-for-autotypeset .edui-icon:before { content: "\e653"; } - -.edui-for-charts .edui-icon:before { content: "\e658"; } - -.edui-for-closeerror .edui-icon:before { content: "\e65c"; } - -.edui-for-copy .edui-icon:before { content: "\e65f"; } - -.edui-for-date .edui-icon:before { content: "\e661"; } - -.edui-for-deletetable .edui-icon:before { content: "\e669"; } - -.edui-for-directionalityltr .edui-icon:before { content: "\e66a"; } - -.edui-for-arrowright .edui-icon:before { content: "\e66b"; } - -.edui-for-tableleft .edui-icon:before { content: "\e66c"; } - -.edui-for-tableright .edui-icon:before { content: "\e66d"; } - -.edui-for-tablecenter .edui-icon:before { content: "\e66e"; } - -.edui-for-videoleft .edui-icon:before { content: "\e66f"; } - -.edui-for-videocenter .edui-icon:before { content: "\e670"; } - -.edui-for-videonone .edui-icon:before { content: "\e671"; } - -.edui-for-videoright .edui-icon:before { content: "\e672"; } - -.edui-for-template .edui-icon:before { content: "\e64e"; } - -.edui-for-addfile .edui-icon:before { content: "\e673"; } - -.edui-for-selected .edui-icon:before { content: "\e674"; } - -.edui-for-pickarea .edui-icon:before { content: "\e675"; } - -.edui-for-overlay .edui-icon:before { content: "\e676"; } - -.edui-for-preitem .edui-icon:before { content: "\e677"; } - -.edui-for-preitem1 .edui-icon:before { content: "\e678"; } - -.edui-for-preitem2 .edui-icon:before { content: "\e679"; } - -.edui-for-preitem3 .edui-icon:before { content: "\e67a"; } - -.edui-for-preitem4 .edui-icon:before { content: "\e67b"; } - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.eot b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.eot deleted file mode 100644 index 45c54826615b6f7919a3b65666c9e8c877c83913..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.eot and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.svg b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.svg deleted file mode 100644 index f2e73d540dc4323fd2523d3cc6d352bdad5c4eee..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.svg +++ /dev/null @@ -1,398 +0,0 @@ - - - - - -Created by iconfont - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.ttf b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.ttf deleted file mode 100644 index 294ff8550c1495f68b57d5a98aefb423b32ed6d8..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.ttf and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.woff b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.woff deleted file mode 100644 index fc45fad96d0da853faedee837d81a82335d9050d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/iconfont.woff and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/images/addfile.svg b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/images/addfile.svg deleted file mode 100644 index 89b7ccdd2176d2ffec796d48244c4ba8d627357e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/images/addfile.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/images/selected.svg b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/images/selected.svg deleted file mode 100644 index f29c5a17501af768cb2c1d74b1eaee588090bdd0..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/fonts/images/selected.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/gmap/gmap.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/gmap/gmap.html deleted file mode 100644 index c8786f3697c65929dde7813bd73f7e66d804799a..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/gmap/gmap.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - -
                      - - - - - - -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/help/help.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/help/help.css deleted file mode 100644 index 4478475fdf60cc930ad0a6472601213f1abb6f54..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/help/help.css +++ /dev/null @@ -1,7 +0,0 @@ -.wrapper{width: 370px;margin: 10px auto;zoom: 1;} -.tabbody{height: 360px;} -.tabbody .panel{width:100%;height: 360px;position: absolute;background: #fff;} -.tabbody .panel h1{font-size:26px;margin: 5px 0 0 5px;} -.tabbody .panel p{font-size:12px;margin: 5px 0 0 5px;} -.tabbody table{width:90%;line-height: 20px;margin: 5px 0 0 5px;;} -.tabbody table thead{font-weight: bold;line-height: 25px;} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/help/help.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/help/help.html deleted file mode 100644 index 9e50060e727da6183ca33e0f93659214339ab2c2..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/help/help.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - 帮助 - - - - - -
                      -
                      - - -
                      -
                      -
                      -

                      UEditor

                      -

                      -

                      -
                      -
                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      ctrl+b
                      ctrl+c
                      ctrl+x
                      ctrl+v
                      ctrl+y
                      ctrl+z
                      ctrl+i
                      ctrl+u
                      ctrl+a
                      shift+enter
                      alt+z
                      -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/help/help.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/help/help.js deleted file mode 100644 index 9a2272e381042bb02c7041544819b370e54c8fdb..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/help/help.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-9-26 - * Time: 下午1:06 - * To change this template use File | Settings | File Templates. - */ -/** - * tab点击处理事件 - * @param tabHeads - * @param tabBodys - * @param obj - */ -function clickHandler( tabHeads,tabBodys,obj ) { - //head样式更改 - for ( var k = 0, len = tabHeads.length; k < len; k++ ) { - tabHeads[k].className = ""; - } - obj.className = "focus"; - //body显隐 - var tabSrc = obj.getAttribute( "tabSrc" ); - for ( var j = 0, length = tabBodys.length; j < length; j++ ) { - var body = tabBodys[j], - id = body.getAttribute( "id" ); - body.onclick = function(){ - this.style.zoom = 1; - }; - if ( id != tabSrc ) { - body.style.zIndex = 1; - } else { - body.style.zIndex = 200; - } - } - -} - -/** - * TAB切换 - * @param tabParentId tab的父节点ID或者对象本身 - */ -function switchTab( tabParentId ) { - var tabElements = $G( tabParentId ).children, - tabHeads = tabElements[0].children, - tabBodys = tabElements[1].children; - - for ( var i = 0, length = tabHeads.length; i < length; i++ ) { - var head = tabHeads[i]; - if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); - head.onclick = function () { - clickHandler(tabHeads,tabBodys,this); - } - } -} -switchTab("helptab"); - -document.getElementById('version').innerHTML = parent.UE.version; \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/image.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/image.css deleted file mode 100644 index 4a36f5cc516763634a046b47524800957740120d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/image.css +++ /dev/null @@ -1,936 +0,0 @@ -@charset "utf-8"; -/* dialog样式 */ -.wrapper { - zoom: 1; - width: 600px; - height: 412px; - margin: 0 auto; - padding: 20px; - position: relative; - font-family: sans-serif; -} - -/*tab样式框大小*/ -.tabhead { - float:left; -} -.tabbody { - width: 100%; - height: 346px; - position: relative; - clear: both; -} - -.tabbody .panel { - position: absolute; - width: 0; - height: 0; - background: #fff; - overflow: hidden; - display: none; -} - -.tabbody .panel.focus { - width: 100%; - height: 380px; - display: block; -} - -/* 图片对齐方式 */ -.alignBar{ - float:right; - margin-top: 5px; - position: relative; -} - -.alignBar .algnLabel{ - float:left; - height: 20px; - line-height: 20px; -} - -.alignBar #alignIcon{ - zoom:1; - _display: inline; - display: inline-block; - position: relative; -} -.alignBar #alignIcon span{ - float: left; - cursor: pointer; - display: block; - width: 19px; - height: 17px; - margin-right: 3px; - margin-left: 3px; - background-image: url(./images/alignicon.jpg); -} -.alignBar #alignIcon .none-align{ - background-position: 0 -18px; -} -.alignBar #alignIcon .left-align{ - background-position: -20px -18px; -} -.alignBar #alignIcon .right-align{ - background-position: -40px -18px; -} -.alignBar #alignIcon .center-align{ - background-position: -60px -18px; -} -.alignBar #alignIcon .none-align.focus{ - background-position: 0 0; -} -.alignBar #alignIcon .left-align.focus{ - background-position: -20px 0; -} -.alignBar #alignIcon .right-align.focus{ - background-position: -40px 0; -} -.alignBar #alignIcon .center-align.focus{ - background-position: -60px 0; -} - - - - -/* 远程图片样式 */ -#remote { - z-index: 200; -} - -#remote .top{ - width: 100%; - margin-top: 20px; -} -#remote .left{ - display: block; - float: left; - width: 240px; - height:10px; -} -#remote .right{ - display: block; - float: right; - width: 345px; - height:10px; -} -#remote .row{ - /*margin-left: 20px;*/ - display: flex; - clear: both; - height: 30px; - line-height: 30px; - margin-bottom: 20px; -} - -#remote .row label{ - text-align: center; - width: 50px; - zoom:1; - _display: inline; - display:inline-block; - vertical-align: middle; - margin-right: 10px; -} -#remote .row label.algnLabel{ - float: left; - -} - -#remote input.text{ - height: 28px; - width: 150px; - font-size: 14px; - line-height: 1.42857143; - color: #555; - background-color: #fff; - background-image: none; - border: 1px solid #ccc; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; - transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -} -#remote input.text:focus { - border-color: #66afe9; - outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); -} -#remote textarea.text{ - width: 160px; - height: 120px; - font-size: 14px; - line-height: 1.42857143; - color: #555; - background-color: #fff; - background-image: none; - border: 1px solid #ccc; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; - transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; - resize: none; -} -#remote textarea.text:focus { - border-color: #66afe9; - outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); -} -#remote #url{ - width: 537px; - height: 28px; -} -#remote #width, -#remote #height{ - width: 60px; - height: 28px; - margin-left: 8px; - margin-right: 8px; -} -#remote .top .row:nth-child(2) span:nth-child(1) , -#remote .top .row:nth-child(2) span:nth-child(2) { - display: block; - margin-right: 18px; -} - -#remote .top .row:nth-child(2) span:last-child { - margin-left: 15px; -} -#remote #border, -#remote #vhSpace, -#remote #title{ - width: 145px; - margin-right: 8px; -} -#remote #lock{ - margin-top: 11px; -} -#remote #lockicon{ - zoom: 1; - _display:inline; - display: inline-block; - height: 20px; - background: url("../../themes/notadd/images/lock.gif") -13px -13px no-repeat; - vertical-align: middle; -} -#remote #preview{ - clear: both; - width: 345px; - height: 261px; - z-index: 9999; - background-color: #f3f3f3; - overflow: hidden; -} - -/* 上传图片 */ -.tabbody #upload.panel { - width: 0; - height: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); - background: #fff; - display: block; -} - -.tabbody #upload.panel.focus { - width: 100%; - height: 373px; - display: block; - clip: auto; - margin-top: 12px; -} - -#upload .queueList { - margin: 0; - width: 100%; - height: 100%; - position: absolute; - overflow: hidden; -} - -#upload p { - margin: 0; -} - -.element-invisible { - width: 0 !important; - height: 0 !important; - border: 0; - padding: 0; - margin: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); -} - -#upload .placeholder { - margin: 10px; - height: 212px; - padding-top: 160px; - text-align: center; - /*background: url(./images/image.png) center 130px no-repeat #f3f3f3;*/ - background-color: #f3f3f3; - color: #cccccc; - font-size: 18px; - position: relative; - top: 0; -} - -#upload .placeholder .webuploader-pick { - font-size: 16px; - background: #f3f3f3; - border-radius: 3px; - line-height: 44px; - padding: 0 30px; - color: #646464; - display: inline-block; - margin: 0 auto 20px auto; - cursor: pointer; - /* box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); */ - border: 1px solid #ccc; -} - -#upload .placeholder .webuploader-pick-hover { - border: 1px solid #00a2d4; - color: #00a2d4; -} - - -#filePickerContainer { - text-align: center; -} - -#upload .placeholder .flashTip { - color: #666666; - font-size: 12px; - position: absolute; - width: 100%; - text-align: center; - bottom: 20px; -} - -#upload .placeholder .flashTip a { - color: #0785d1; - text-decoration: none; -} - -#upload .placeholder .flashTip a:hover { - text-decoration: underline; -} - -#upload .placeholder.webuploader-dnd-over { - border-color: #999999; -} - -#upload .filelist { - list-style: none; - margin: 0; - padding: 0; - overflow-x: hidden; - overflow-y: auto; - position: relative; - height: 300px; -} - -#upload .filelist:after { - content: ''; - display: block; - width: 0; - height: 0; - overflow: hidden; - clear: both; - position: relative; -} - -#upload .filelist li { - width: 135px; - height: 135px; - background: url(./images/bg.png); - text-align: center; - margin: 9px 0 0 9px; - *margin: 6px 0 0 6px; - position: relative; - display: block; - float: left; - overflow: hidden; - font-size: 12px; -} - -#upload .filelist li p.log { - position: relative; - top: -45px; -} - -#upload .filelist li p.title { - position: absolute; - top: 0; - left: 0; - width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - top: 5px; - text-indent: 5px; - text-align: left; -} - -#upload .filelist li p.progress { - position: absolute; - width: 100%; - bottom: 0; - left: 0; - height: 8px; - overflow: hidden; - z-index: 50; - margin: 0; - border-radius: 0; - background: none; - -webkit-box-shadow: 0 0 0; -} - -#upload .filelist li p.progress span { - display: none; - overflow: hidden; - width: 0; - height: 100%; - background: #1483d8 url(./images/progress.png) repeat-x; - - -webit-transition: width 200ms linear; - -moz-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; - transition: width 200ms linear; - - -webkit-animation: progressmove 2s linear infinite; - -moz-animation: progressmove 2s linear infinite; - -o-animation: progressmove 2s linear infinite; - -ms-animation: progressmove 2s linear infinite; - animation: progressmove 2s linear infinite; - - -webkit-transform: translateZ(0); -} - -@-webkit-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@-moz-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -#upload .filelist li p.imgWrap { - position: relative; - z-index: 2; - line-height: 135px; - vertical-align: middle; - overflow: hidden; - width: 135px; - height: 135px; - - -webkit-transform-origin: 50% 50%; - -moz-transform-origin: 50% 50%; - -o-transform-origin: 50% 50%; - -ms-transform-origin: 50% 50%; - transform-origin: 50% 50%; - - -webit-transition: 200ms ease-out; - -moz-transition: 200ms ease-out; - -o-transition: 200ms ease-out; - -ms-transition: 200ms ease-out; - transition: 200ms ease-out; -} - -#upload .filelist li img { - width: 100%; -} - -#upload .filelist li p.error { - background: #f43838; - color: #fff; - position: absolute; - bottom: 0; - left: 0; - height: 28px; - line-height: 28px; - width: 100%; - z-index: 100; - display:none; -} - -#upload .filelist li .success { - display: block; - position: absolute; - left: 0; - bottom: 0; - height: 40px; - width: 100%; - z-index: 200; - background: url(../fonts/images/selected.svg) no-repeat right bottom; -} - -#upload .filelist li.filePickerBlock { - width: 135px; - height: 135px; - background: url(../fonts/images/addfile.svg) no-repeat center; - border: 1px solid #eeeeee; - border-radius: 0; -} -#upload .filelist li.filePickerBlock div.webuploader-pick { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - opacity: 0; - background: none; - font-size: 0; -} - -#upload .filelist div.file-panel { - position: absolute; - height: 0; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0; - background: rgba(0, 0, 0, 0.5); - width: 100%; - top: 0; - left: 0; - overflow: hidden; - z-index: 300; -} - -#upload .filelist div.file-panel span { - width: 24px; - height: 24px; - display: inline; - float: right; - text-indent: -9999px; - overflow: hidden; - background: url(./images/icons.png) no-repeat; - background: url(./images/icons.gif) no-repeat \9; - margin: 5px 1px 1px; - cursor: pointer; - -webkit-tap-highlight-color: rgba(0,0,0,0); - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -#upload .filelist div.file-panel span.rotateLeft { - display:none; - background-position: 0 -24px; -} - -#upload .filelist div.file-panel span.rotateLeft:hover { - background-position: 0 0; -} - -#upload .filelist div.file-panel span.rotateRight { - display:none; - background-position: -24px -24px; -} - -#upload .filelist div.file-panel span.rotateRight:hover { - background-position: -24px 0; -} - -#upload .filelist div.file-panel span.cancel { - background-position: -48px -24px; -} - -#upload .filelist div.file-panel span.cancel:hover { - background-position: -48px 0; -} - -#upload .statusBar { - height: 45px; - border-bottom: 1px solid #dadada; - margin: 0 10px; - padding: 0; - line-height: 45px; - vertical-align: middle; - position: relative; -} - -#upload .statusBar .progress { - border: 1px solid #1483d8; - width: 198px; - background: #fff; - height: 18px; - position: absolute; - top: 12px; - display: none; - text-align: center; - line-height: 18px; - color: #6dbfff; - margin: 0 10px 0 0; -} -#upload .statusBar .progress span.percentage { - width: 0; - height: 100%; - left: 0; - top: 0; - background: #1483d8; - position: absolute; -} -#upload .statusBar .progress span.text { - position: relative; - z-index: 10; -} - -#upload .statusBar .info { - display: inline-block; - font-size: 14px; - color: #666666; -} - -#upload .statusBar .btns { - position: absolute; - top: 7px; - right: 0; - line-height: 30px; -} - -#filePickerBtn { - display: inline-block; - float: left; -} -#upload .statusBar .btns .webuploader-pick, -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-uploading, -#upload .statusBar .btns .uploadBtn.state-paused { - background: #ffffff; - border: 1px solid #cfcfcf; - color: #565656; - padding: 0 18px; - display: inline-block; - border-radius: 3px; - margin-left: 10px; - cursor: pointer; - font-size: 14px; - float: left; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -#upload .statusBar .btns .webuploader-pick-hover, -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-uploading:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover { - background: #f0f0f0; -} - -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-paused{ - background: #00b7ee; - color: #fff; - border-color: transparent; -} -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover{ - background: #00a2d4; -} - -#upload .statusBar .btns .uploadBtn.disabled { - pointer-events: none; - filter:alpha(opacity=60); - -moz-opacity:0.6; - -khtml-opacity: 0.6; - opacity: 0.6; -} - - - -/* 图片管理样式 */ -#online { - width: 100%; - height: 336px; - padding: 10px 0 0 0; -} -#online #imageList{ - width: 100%; - height: 100%; - overflow-x: hidden; - overflow-y: auto; - position: relative; -} -#online ul { - display: block; - list-style: none; - margin: 0; - padding: 0; -} -#online li { - float: left; - display: block; - list-style: none; - padding: 0; - width: 135px; - height: 135px; - margin: 0 0 9px 9px; - *margin: 0 0 6px 6px; - background-color: #eee; - overflow: hidden; - cursor: pointer; - position: relative; -} -#online li.clearFloat { - float: none; - clear: both; - display: block; - width:0; - height:0; - margin: 0; - padding: 0; -} -#online li img { - cursor: pointer; - width: 135px !important; - height: 135px !important; - margin-top: 0px !important; -} -#online li .icon { - cursor: pointer; - width: 135px; - height: 135px; - position: absolute; - top: 0; - left: 0; - z-index: 2; - border: 0; - background-repeat: no-repeat; -} -#online li .icon:hover { - width: 129px; - height: 129px; - border: 3px solid #1094fa; -} -#online li.selected .icon { - background-image: url(images/success.png); - background-image: url(images/success.gif)\9; - background-position: 95px 95px; -} -#online li.selected .icon:hover { - width: 129px; - height: 129px; - border: 3px solid #1094fa; - background-position: 92px 92px; -} - - -/* 图片搜索样式 */ -#search .searchBar { - width: 100%; - height: 30px; - margin: 10px 0 5px 0; - padding: 0; -} - -#search input.text{ - width: 150px; - padding: 3px 6px; - font-size: 14px; - line-height: 1.42857143; - color: #555; - background-color: #fff; - background-image: none; - border: 1px solid #ccc; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; - transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -} -#search input.text:focus { - border-color: #66afe9; - outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); -} -#search input.searchTxt { - margin-left:5px; - padding-left: 5px; - background: #FFF; - width: 300px; - *width: 260px; - height: 21px; - line-height: 21px; - float: left; - dislay: block; -} -#search .pagination{ - margin-top: 5px; -} -#search input.num{ - width: 80px; -} - -#search .searchType { - width: 95px; - height: 28px; - padding:0; - line-height: 28px; - border: 1px solid #d7d7d7; - border-radius: 0; - vertical-align: top; - margin-left: 5px; - float: left; - dislay: block; -} - -#search #searchBtn, -#search #searchReset { - display: inline-block; - margin-bottom: 0; - margin-right: 5px; - padding: 4px 10px; - font-weight: 400; - text-align: center; - vertical-align: middle; - cursor: pointer; - background-image: none; - border: 1px solid transparent; - white-space: nowrap; - font-size: 14px; - border-radius: 4px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - vertical-align: top; - float: right; -} - -#search #searchBtn { - color: white; - border-color: #285e8e; - background-color: #3b97d7; -} -#search #searchReset { - color: #333; - border-color: #ccc; - background-color: #fff; -} -#search #searchBtn:hover { - background-color: #3276b1; -} -#search #searchReset:hover { - background-color: #eee; -} - -#search .msg { - margin-left: 5px; -} - -#search .searchList{ - width: 100%; - height: 300px; - overflow: hidden; - clear: both; -} -#search .searchList ul{ - margin:0; - padding:0; - list-style:none; - clear: both; - width: 100%; - height: 100%; - overflow-x: hidden; - overflow-y: auto; - zoom: 1; - position: relative; -} - -#search .searchList li { - list-style:none; - float: left; - display: block; - width: 115px; - margin: 5px 10px 5px 20px; - *margin: 5px 10px 5px 15px; - padding:0; - font-size: 12px; - box-shadow: 0 1px 3px rgba(0, 0, 0, .3); - -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3); - -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3); - position: relative; - vertical-align: top; - text-align: center; - overflow: hidden; - cursor: pointer; - filter: alpha(Opacity=100); - -moz-opacity: 1; - opacity: 1; - border: 2px solid #eee; -} - -#search .searchList li.selected { - filter: alpha(Opacity=40); - -moz-opacity: 0.4; - opacity: 0.4; - border: 2px solid #00a0e9; -} - -#search .searchList li p { - background-color: #eee; - margin: 0; - padding: 0; - position: relative; - width:100%; - height:115px; - overflow: hidden; -} - -#search .searchList li p img { - cursor: pointer; - border: 0; -} - -#search .searchList li a { - color: #999; - border-top: 1px solid #F2F2F2; - background: #FAFAFA; - text-align: center; - display: block; - padding: 0 5px; - width: 105px; - height:32px; - line-height:32px; - white-space:nowrap; - text-overflow:ellipsis; - text-decoration: none; - overflow: hidden; - word-break: break-all; -} - -#search .searchList a:hover { - text-decoration: underline; - color: #333; -} -#search .searchList .clearFloat{ - clear: both; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/image.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/image.html deleted file mode 100644 index f490247974ee11293d366ceeb862ca6208e3655e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/image.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - neditor图片对话框 - - - - - - - - - - - - - - - -
                      -
                      - - - - -
                      -
                      - - - - - - - - - - -
                      -
                      - - -
                      -
                      -
                      - - -
                      -
                      - -   px -   px - -
                      -
                      -
                      -
                      - - px -
                      -
                      - - px -
                      -
                      - - -
                      -
                      -
                      -
                      - - -
                      -
                      -
                      -
                      - 0% - -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                        -
                      • -
                      -
                      -
                      - - -
                      -
                      -
                      - - - - -
                      -
                      - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/image.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/image.js deleted file mode 100644 index 18f70c9bfe0ca070f449e7726353cbaa9f78743f..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/image.js +++ /dev/null @@ -1,1131 +0,0 @@ -/** - * User: Jinqn - * Date: 14-04-08 - * Time: 下午16:34 - * 上传图片对话框逻辑代码,包括tab: 远程图片/上传图片/在线图片/搜索图片 - */ - -(function () { - - var remoteImage, - uploadImage, - onlineImage, - searchImage; - - window.onload = function () { - initTabs(); - initAlign(); - initButtons(); - }; - - /* 初始化tab标签 */ - function initTabs() { - var tabs = $G('tabhead').children; - for (var i = 0; i < tabs.length; i++) { - domUtils.on(tabs[i], "click", function (e) { - var target = e.target || e.srcElement; - setTabFocus(target.getAttribute('data-content-id')); - }); - } - - var img = editor.selection.getRange().getClosedNode(); - if (img && img.tagName && img.tagName.toLowerCase() == 'img') { - setTabFocus('remote'); - } else { - setTabFocus('upload'); - } - } - - /* 初始化tabbody */ - function setTabFocus(id) { - if(!id) return; - var i, bodyId, tabs = $G('tabhead').children; - for (i = 0; i < tabs.length; i++) { - bodyId = tabs[i].getAttribute('data-content-id'); - if (bodyId == id) { - domUtils.addClass(tabs[i], 'focus'); - domUtils.addClass($G(bodyId), 'focus'); - } else { - domUtils.removeClasses(tabs[i], 'focus'); - domUtils.removeClasses($G(bodyId), 'focus'); - } - } - switch (id) { - case 'remote': - remoteImage = remoteImage || new RemoteImage(); - break; - case 'upload': - setAlign(editor.getOpt('imageInsertAlign')); - uploadImage = uploadImage || new UploadImage('queueList'); - break; - case 'online': - setAlign(editor.getOpt('imageManagerInsertAlign')); - onlineImage = onlineImage || new OnlineImage('imageList'); - onlineImage.reset(); - break; - case 'search': - setAlign(editor.getOpt('imageManagerInsertAlign')); - searchImage = searchImage || new SearchImage(); - break; - } - } - - /* 初始化onok事件 */ - function initButtons() { - - dialog.onok = function () { - var remote = false, list = [], id, tabs = $G('tabhead').children; - for (var i = 0; i < tabs.length; i++) { - if (domUtils.hasClass(tabs[i], 'focus')) { - id = tabs[i].getAttribute('data-content-id'); - break; - } - } - - switch (id) { - case 'remote': - list = remoteImage.getInsertList(); - break; - case 'upload': - list = uploadImage.getInsertList(); - var count = uploadImage.getQueueCount(); - if (count) { - $('.info', '#queueList').html('' + '还有2个未上传文件'.replace(/[\d]/, count) + ''); - return false; - } - break; - case 'online': - list = onlineImage.getInsertList(); - break; - case 'search': - list = searchImage.getInsertList(); - remote = true; - break; - } - - if(list) { - editor.execCommand('insertimage', list); - remote && editor.fireEvent("catchRemoteImage"); - } - }; - } - - - /* 初始化对其方式的点击事件 */ - function initAlign(){ - /* 点击align图标 */ - domUtils.on($G("alignIcon"), 'click', function(e){ - var target = e.target || e.srcElement; - if(target.className && target.className.indexOf('-align') != -1) { - setAlign(target.getAttribute('data-align')); - } - }); - } - - /* 设置对齐方式 */ - function setAlign(align){ - align = align || 'none'; - var aligns = $G("alignIcon").children; - for(i = 0; i < aligns.length; i++){ - if(aligns[i].getAttribute('data-align') == align) { - domUtils.addClass(aligns[i], 'focus'); - $G("align").value = aligns[i].getAttribute('data-align'); - } else { - domUtils.removeClasses(aligns[i], 'focus'); - } - } - } - /* 获取对齐方式 */ - function getAlign(){ - var align = $G("align").value || 'none'; - return align == 'none' ? '':align; - } - - - /* 在线图片 */ - function RemoteImage(target) { - this.container = utils.isString(target) ? document.getElementById(target) : target; - this.init(); - } - RemoteImage.prototype = { - init: function () { - this.initContainer(); - this.initEvents(); - }, - initContainer: function () { - this.dom = { - 'url': $G('url'), - 'width': $G('width'), - 'height': $G('height'), - 'border': $G('border'), - 'vhSpace': $G('vhSpace'), - 'title': $G('title'), - 'align': $G('align') - }; - var img = editor.selection.getRange().getClosedNode(); - if (img) { - this.setImage(img); - } - }, - initEvents: function () { - var _this = this, - locker = $G('lock'); - - /* 改变url */ - domUtils.on($G("url"), 'keyup', updatePreview); - domUtils.on($G("border"), 'keyup', updatePreview); - domUtils.on($G("title"), 'keyup', updatePreview); - - domUtils.on($G("width"), 'keyup', function(){ - if(locker.checked) { - var proportion =locker.getAttribute('data-proportion'); - $G('height').value = Math.round(this.value / proportion); - } else { - _this.updateLocker(); - } - updatePreview(); - }); - domUtils.on($G("height"), 'keyup', function(){ - if(locker.checked) { - var proportion =locker.getAttribute('data-proportion'); - $G('width').value = Math.round(this.value * proportion); - } else { - _this.updateLocker(); - } - updatePreview(); - }); - domUtils.on($G("lock"), 'change', function(){ - var proportion = parseInt($G("width").value) /parseInt($G("height").value); - locker.setAttribute('data-proportion', proportion); - }); - - function updatePreview(){ - _this.setPreview(); - } - }, - updateLocker: function(){ - var width = $G('width').value, - height = $G('height').value, - locker = $G('lock'); - if(width && height && width == parseInt(width) && height == parseInt(height)) { - locker.disabled = false; - locker.title = ''; - } else { - locker.checked = false; - locker.disabled = 'disabled'; - locker.title = lang.remoteLockError; - } - }, - setImage: function(img){ - /* 不是正常的图片 */ - if (!img.tagName || img.tagName.toLowerCase() != 'img' && !img.getAttribute("src") || !img.src) return; - - var wordImgFlag = img.getAttribute("word_img"), - src = wordImgFlag ? wordImgFlag.replace("&", "&") : (img.getAttribute('_src') || img.getAttribute("src", 2).replace("&", "&")), - align = editor.queryCommandValue("imageFloat"); - - /* 防止onchange事件循环调用 */ - if (src !== $G("url").value) $G("url").value = src; - if(src) { - /* 设置表单内容 */ - $G("width").value = img.width || ''; - $G("height").value = img.height || ''; - $G("border").value = img.getAttribute("border") || '0'; - $G("vhSpace").value = img.getAttribute("vspace") || '0'; - $G("title").value = img.title || img.alt || ''; - setAlign(align); - this.setPreview(); - this.updateLocker(); - } - }, - getData: function(){ - var data = {}; - for(var k in this.dom){ - data[k] = this.dom[k].value; - } - return data; - }, - setPreview: function(){ - var url = $G('url').value, - ow = $G('width').value, - oh = $G('height').value, - border = $G('border').value, - title = $G('title').value, - preview = $G('preview'), - width, - height; - - width = ((!ow || !oh) ? preview.offsetWidth:Math.min(ow, preview.offsetWidth)); - width = width+(border*2) > preview.offsetWidth ? width:(preview.offsetWidth - (border*2)); - height = (!ow || !oh) ? '':width*oh/ow; - - if(url) { - preview.innerHTML = ''; - } - }, - getInsertList: function () { - var data = this.getData(); - if(data['url']) { - return [{ - src: data['url'], - _src: data['url'], - width: data['width'] || '', - height: data['height'] || '', - border: data['border'] || '', - floatStyle: data['align'] || '', - vspace: data['vhSpace'] || '', - alt: data['title'] || '', - style: "width:" + data['width'] + "px;height:" + data['height'] + "px;" - }]; - } else { - return []; - } - } - }; - - - - /* 上传图片 */ - function UploadImage(target) { - this.$wrap = target.constructor == String ? $('#' + target) : $(target); - this.init(); - } - UploadImage.prototype = { - init: function () { - this.imageList = []; - this.initContainer(); - this.initUploader(); - }, - initContainer: function () { - this.$queue = this.$wrap.find('.filelist'); - }, - /* 初始化容器 */ - initUploader: function () { - var _this = this, - $ = jQuery, // just in case. Make sure it's not an other libaray. - $wrap = _this.$wrap, - // 图片容器 - $queue = $wrap.find('.filelist'), - // 状态栏,包括进度和控制按钮 - $statusBar = $wrap.find('.statusBar'), - // 文件总体选择信息。 - $info = $statusBar.find('.info'), - // 上传按钮 - $upload = $wrap.find('.uploadBtn'), - // 上传按钮 - $filePickerBtn = $wrap.find('.filePickerBtn'), - // 上传按钮 - $filePickerBlock = $wrap.find('.filePickerBlock'), - // 没选择文件之前的内容。 - $placeHolder = $wrap.find('.placeholder'), - // 总体进度条 - $progress = $statusBar.find('.progress').hide(), - // 添加的文件数量 - fileCount = 0, - // 添加的文件总大小 - fileSize = 0, - // 优化retina, 在retina下这个值是2 - ratio = window.devicePixelRatio || 1, - // 缩略图大小 - thumbnailWidth = 113 * ratio, - thumbnailHeight = 113 * ratio, - // 可能有pedding, ready, uploading, confirm, done. - state = '', - // 所有文件的进度信息,key为file id - percentages = {}, - supportTransition = (function () { - var s = document.createElement('p').style, - r = 'transition' in s || - 'WebkitTransition' in s || - 'MozTransition' in s || - 'msTransition' in s || - 'OTransition' in s; - s = null; - return r; - })(), - // WebUploader实例 - uploader, - actionUrl = editor.getActionUrl(editor.getOpt('imageActionName')), - acceptExtensions = (editor.getOpt('imageAllowFiles') || [".png", ".jpg", ".jpeg", ".gif", ".bmp"]).join('').replace(/\./g, ',').replace(/^[,]/, ''), - imageMaxSize = editor.getOpt('imageMaxSize'), - imageCompressBorder = editor.getOpt('imageCompressBorder'); - if (!WebUploader.Uploader.support()) { - $('#filePickerReady').after($('
                      ').html(lang.errorNotSupport)).hide(); - return; - } else if (!editor.getOpt('imageActionName')) { - $('#filePickerReady').after($('
                      ').html(lang.errorLoadConfig)).hide(); - return; - } - - /* 上传插件 */ - uploader = _this.uploader = WebUploader.create({ - pick: { - id: '#filePickerReady', - label: lang.uploadSelectFile - }, - accept: { - title: 'Images', - extensions: acceptExtensions, - mimeTypes: 'image/jpeg,image/png,image/svg,image/webp,image/gif' - }, - swf: '../../third-party/webuploader/Uploader.swf', - server: actionUrl, - fileVal: editor.getOpt('imageFieldName'), - duplicate: true, - fileSingleSizeLimit: imageMaxSize, // 默认 2 M - compress: false - }); - uploader.addButton({ - id: '#filePickerBlock' - }); - uploader.addButton({ - id: '#filePickerBtn', - label: lang.uploadAddFile - }); - - setState('pedding'); - - // 当有文件添加进来时执行,负责view的创建 - function addFile(file) { - var $li = $('
                    • ' + - '

                      ' + file.name + '

                      ' + - '

                      ' + - '

                      ' + - '
                    • '), - - $btns = $('
                      ' + - '' + lang.uploadDelete + '' + - '' + lang.uploadTurnRight + '' + - '' + lang.uploadTurnLeft + '
                      ').appendTo($li), - $prgress = $li.find('p.progress span'), - $wrap = $li.find('p.imgWrap'), - $info = $('

                      ').hide().appendTo($li), - showError = function (code) { - switch (code) { - case 'exceed_size': - text = lang.errorExceedSize; - break; - case 'interrupt': - text = lang.errorInterrupt; - break; - case 'http': - text = lang.errorHttp; - break; - case 'not_allow_type': - text = lang.errorFileType; - break; - default: - text = lang.errorUploadRetry; - break; - } - $info.text(text).show(); - }; - if (file.getStatus() === 'invalid') { - showError(file.statusText); - } else { - $wrap.text(lang.uploadPreview); - if (browser.ie && browser.version <= 7) { - $wrap.text(lang.uploadNoPreview); - } else { - uploader.makeThumb(file, function (error, src) { - if (error || !src) { - $wrap.text(lang.uploadNoPreview); - } else { - var $img = $(''); - $wrap.empty().append($img); - $img.on('error', function () { - $wrap.text(lang.uploadNoPreview); - }); - } - }, thumbnailWidth, thumbnailHeight); - } - percentages[ file.id ] = [ file.size, 0 ]; - file.rotation = 0; - - /* 检查文件格式 */ - if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) { - showError('not_allow_type'); - uploader.removeFile(file); - } - } - - file.on('statuschange', function (cur, prev) { - if (prev === 'progress') { - $prgress.hide().width(0); - } else if (prev === 'queued') { - $li.off('mouseenter mouseleave'); - $btns.remove(); - } - // 成功 - if (cur === 'error' || cur === 'invalid') { - showError(file.statusText); - percentages[ file.id ][ 1 ] = 1; - } else if (cur === 'interrupt') { - showError('interrupt'); - } else if (cur === 'queued') { - percentages[ file.id ][ 1 ] = 0; - } else if (cur === 'progress') { - $info.hide(); - $prgress.css('display', 'block'); - } else if (cur === 'complete') { - } - - $li.removeClass('state-' + prev).addClass('state-' + cur); - }); - - $li.on('mouseenter', function () { - $btns.stop().animate({height: 30}); - }); - $li.on('mouseleave', function () { - $btns.stop().animate({height: 0}); - }); - - $btns.on('click', 'span', function () { - var index = $(this).index(), - deg; - - switch (index) { - case 0: - uploader.removeFile(file); - return; - case 1: - file.rotation += 90; - break; - case 2: - file.rotation -= 90; - break; - } - - if (supportTransition) { - deg = 'rotate(' + file.rotation + 'deg)'; - $wrap.css({ - '-webkit-transform': deg, - '-mos-transform': deg, - '-o-transform': deg, - 'transform': deg - }); - } else { - $wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')'); - } - - }); - - $li.insertBefore($filePickerBlock); - } - - // 负责view的销毁 - function removeFile(file) { - var $li = $('#' + file.id); - delete percentages[ file.id ]; - updateTotalProgress(); - $li.off().find('.file-panel').off().end().remove(); - } - - function updateTotalProgress() { - var loaded = 0, - total = 0, - spans = $progress.children(), - percent; - - $.each(percentages, function (k, v) { - total += v[ 0 ]; - loaded += v[ 0 ] * v[ 1 ]; - }); - - percent = total ? loaded / total : 0; - - spans.eq(0).text(Math.round(percent * 100) + '%'); - spans.eq(1).css('width', Math.round(percent * 100) + '%'); - updateStatus(); - } - - function setState(val, files) { - - if (val != state) { - - var stats = uploader.getStats(); - - $upload.removeClass('state-' + state); - $upload.addClass('state-' + val); - - switch (val) { - - /* 未选择文件 */ - case 'pedding': - $queue.addClass('element-invisible'); - $statusBar.addClass('element-invisible'); - $placeHolder.removeClass('element-invisible'); - $progress.hide(); $info.hide(); - uploader.refresh(); - break; - - /* 可以开始上传 */ - case 'ready': - $placeHolder.addClass('element-invisible'); - $queue.removeClass('element-invisible'); - $statusBar.removeClass('element-invisible'); - $progress.hide(); $info.show(); - $upload.text(lang.uploadStart); - uploader.refresh(); - break; - - /* 上传中 */ - case 'uploading': - $progress.show(); $info.hide(); - $upload.text(lang.uploadPause); - break; - - /* 暂停上传 */ - case 'paused': - $progress.show(); $info.hide(); - $upload.text(lang.uploadContinue); - break; - - case 'confirm': - $progress.show(); $info.hide(); - $upload.text(lang.uploadStart); - - stats = uploader.getStats(); - if (stats.successNum && !stats.uploadFailNum) { - setState('finish'); - return; - } - break; - - case 'finish': - $progress.hide(); $info.show(); - if (stats.uploadFailNum) { - $upload.text(lang.uploadRetry); - } else { - $upload.text(lang.uploadStart); - } - break; - } - - state = val; - updateStatus(); - - } - - if (!_this.getQueueCount()) { - $upload.addClass('disabled') - } else { - $upload.removeClass('disabled') - } - - } - - function updateStatus() { - var text = '', stats; - - if (state === 'ready') { - text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)); - } else if (state === 'confirm') { - stats = uploader.getStats(); - if (stats.uploadFailNum) { - text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum); - } - } else { - stats = uploader.getStats(); - text = lang.updateStatusFinish.replace('_', fileCount). - replace('_KB', WebUploader.formatSize(fileSize)). - replace('_', stats.successNum); - - if (stats.uploadFailNum) { - text += lang.updateStatusError.replace('_', stats.uploadFailNum); - } - } - - $info.html(text); - } - - uploader.on('fileQueued', function (file) { - /* 选择文件后设置上传相关的url和自定义参数 */ - editor.getOpt("imageUploadService")(_this, editor).setUploadData(file); - - fileCount++; - fileSize += file.size; - - if (fileCount === 1) { - $placeHolder.addClass('element-invisible'); - $statusBar.show(); - } - addFile(file); - }); - - uploader.on('fileDequeued', function (file) { - if (file.ext && acceptExtensions.indexOf(file.ext.toLowerCase()) != -1 && file.size <= imageMaxSize) { - fileCount--; - fileSize -= file.size; - } - - removeFile(file); - updateTotalProgress(); - }); - - uploader.on('filesQueued', function (file) { - if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) { - setState('ready'); - } - updateTotalProgress(); - }); - - uploader.on('all', function (type, files) { - switch (type) { - case 'uploadFinished': - setState('confirm', files); - break; - case 'startUpload': - /* 设置Uploader配置项 */ - editor.getOpt("imageUploadService")(_this, editor).setUploaderOptions(uploader); - setState('uploading', files); - break; - case 'stopUpload': - setState('paused', files); - break; - } - }); - - uploader.on('uploadBeforeSend', function (object, data, headers) { - //这里可以通过data对象添加POST参数 - editor.getOpt("imageUploadService")(_this, editor).setFormData(object, data, headers); - }); - - uploader.on('uploadProgress', function (file, percentage) { - var $li = $('#' + file.id), - $percent = $li.find('.progress span'); - - $percent.css('width', percentage * 100 + '%'); - percentages[ file.id ][ 1 ] = percentage; - updateTotalProgress(); - }); - - uploader.on('uploadSuccess', function (file, res) { - var $file = $('#' + file.id); - try { - if (editor.getOpt("imageUploadService")(_this, editor).getResponseSuccess(res)) { - _this.imageList.push(res); - $file.append(''); - } else { - $file.find('.error').text(res.message).show(); - } - } catch (e) { - $file.find('.error').text(lang.errorServerUpload).show(); - } - }); - - uploader.on('uploadError', function (file, code) { - }); - uploader.on('error', function (code, file) { - if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { - addFile(file); - } - }); - uploader.on('uploadComplete', function (file, ret) { - }); - - /* 上传按钮 */ - $upload.on('click', function () { - if ($(this).hasClass('disabled')) { - return false; - } - - if (state === 'ready') { - window.setTimeout(function() { - uploader.upload(); - }, 500); - } else if (state === 'paused') { - window.setTimeout(function() { - uploader.upload(); - }, 500); - } else if (state === 'uploading') { - uploader.stop(); - } - }); - - $upload.addClass('state-' + state); - updateTotalProgress(); - }, - getQueueCount: function () { - var file, i, status, readyFile = 0, files = this.uploader.getFiles(); - for (i = 0; file = files[i++]; ) { - status = file.getStatus(); - if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; - } - return readyFile; - }, - destroy: function () { - this.$wrap.remove(); - }, - getInsertList: function () { - var i, data, list = [], - align = getAlign(), - prefix = editor.getOpt('imageUrlPrefix'), - imageSrcField = editor.getOpt("imageUploadService")(this, editor).imageSrcField || 'url', - imageSrc = '', - imageSrcFieldKeys = imageSrcField.split('.'); - - for (i = 0; i < this.imageList.length; i++) { - data = this.imageList[i]; - - if(imageSrcFieldKeys.length > 1) { - function setImageSrc(obj, keys, index) { - obj = obj[keys[index]]; - if (index < keys.length - 1) { - setImageSrc(obj, keys, index += 1) - } else { - imageSrc = obj; - } - } - - setImageSrc(data, imageSrcFieldKeys, 0); - } else { - imageSrc = data[imageSrcField]; - } - - list.push({ - src: prefix + imageSrc, - _src: prefix + imageSrc, - alt: data.original, - floatStyle: align - }); - } - return list; - } - }; - - - /* 在线图片 */ - function OnlineImage(target) { - this.container = utils.isString(target) ? document.getElementById(target) : target; - this.init(); - } - OnlineImage.prototype = { - init: function () { - this.reset(); - this.initEvents(); - }, - /* 初始化容器 */ - initContainer: function () { - this.container.innerHTML = ''; - this.list = document.createElement('ul'); - this.clearFloat = document.createElement('li'); - - domUtils.addClass(this.list, 'list'); - domUtils.addClass(this.clearFloat, 'clearFloat'); - - this.list.appendChild(this.clearFloat); - this.container.appendChild(this.list); - }, - /* 初始化滚动事件,滚动到地步自动拉取数据 */ - initEvents: function () { - var _this = this; - - /* 滚动拉取图片 */ - domUtils.on($G('imageList'), 'scroll', function(e){ - var panel = this; - if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { - _this.getImageData(); - } - }); - /* 选中图片 */ - domUtils.on(this.container, 'click', function (e) { - var target = e.target || e.srcElement, - li = target.parentNode; - - if (li.tagName.toLowerCase() == 'li') { - if (domUtils.hasClass(li, 'selected')) { - domUtils.removeClasses(li, 'selected'); - } else { - domUtils.addClass(li, 'selected'); - } - } - }); - }, - /* 初始化第一次的数据 */ - initData: function () { - - /* 拉取数据需要使用的值 */ - this.state = 0; - this.listSize = editor.getOpt('imageManagerListSize'); - this.listIndex = 0; - this.listEnd = false; - - /* 第一次拉取数据 */ - this.getImageData(); - }, - /* 重置界面 */ - reset: function() { - this.initContainer(); - this.initData(); - }, - /* 向后台拉取图片列表数据 */ - getImageData: function () { - var _this = this; - - if(!_this.listEnd && !this.isLoadingData) { - this.isLoadingData = true; - var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')), - isJsonp = utils.isCrossDomainUrl(url); - ajax.request(url, { - 'timeout': 100000, - 'dataType': isJsonp ? 'jsonp':'', - 'data': utils.extend({ - start: this.listIndex, - size: this.listSize - }, editor.queryCommandValue('serverparam')), - 'method': 'get', - 'onsuccess': function (r) { - try { - var json = isJsonp ? r:eval('(' + r.responseText + ')'); - if (json.state == 'SUCCESS') { - _this.pushData(json.list); - _this.listIndex = parseInt(json.start) + parseInt(json.list.length); - if(_this.listIndex >= json.total) { - _this.listEnd = true; - } - _this.isLoadingData = false; - } - } catch (e) { - if(r.responseText.indexOf('ue_separate_ue') != -1) { - var list = r.responseText.split(r.responseText); - _this.pushData(list); - _this.listIndex = parseInt(list.length); - _this.listEnd = true; - _this.isLoadingData = false; - } - } - }, - 'onerror': function () { - _this.isLoadingData = false; - } - }); - } - }, - /* 添加图片到列表界面上 */ - pushData: function (list) { - var i, item, img, icon, _this = this, - urlPrefix = editor.getOpt('imageManagerUrlPrefix'); - for (i = 0; i < list.length; i++) { - if(list[i] && list[i].url) { - item = document.createElement('li'); - img = document.createElement('img'); - icon = document.createElement('span'); - - domUtils.on(img, 'load', (function(image){ - return function(){ - _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); - } - })(img)); - img.width = 113; - img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) ); - img.setAttribute('_src', urlPrefix + list[i].url); - domUtils.addClass(icon, 'icon'); - - item.appendChild(img); - item.appendChild(icon); - this.list.insertBefore(item, this.clearFloat); - } - } - }, - /* 改变图片大小 */ - scale: function (img, w, h, type) { - var ow = img.width, - oh = img.height; - - if (type == 'justify') { - if (ow >= oh) { - img.width = w; - img.height = h * oh / ow; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w * ow / oh; - img.height = h; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } else { - if (ow >= oh) { - img.width = w * ow / oh; - img.height = h; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w; - img.height = h * oh / ow; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - } - }, - getInsertList: function () { - var i, lis = this.list.children, list = [], align = getAlign(); - for (i = 0; i < lis.length; i++) { - if (domUtils.hasClass(lis[i], 'selected')) { - var img = lis[i].firstChild, - src = img.getAttribute('_src'); - list.push({ - src: src, - _src: src, - alt: src.substr(src.lastIndexOf('/') + 1), - floatStyle: align - }); - } - - } - return list; - } - }; - - /*搜索图片 */ - function SearchImage() { - this.init(); - } - SearchImage.prototype = { - init: function () { - this.initEvents(); - }, - initEvents: function(){ - var _this = this; - - /* 点击搜索按钮 */ - domUtils.on($G('searchBtn'), 'click', function(){ - var key = $G('searchTxt').value; - if(key && key != lang.searchRemind) { - _this.getImageData(); - } - }); - /* 点击清除妞 */ - domUtils.on($G('searchReset'), 'click', function(){ - $G('searchTxt').value = lang.searchRemind; - $G('searchListUl').innerHTML = ''; - $G('searchType').selectedIndex = 0; - }); - /* 搜索框聚焦 */ - domUtils.on($G('searchTxt'), 'focus', function(){ - var key = $G('searchTxt').value; - if(key && key == lang.searchRemind) { - $G('searchTxt').value = ''; - } - }); - /* 搜索框回车键搜索 */ - domUtils.on($G('searchTxt'), 'keydown', function(e){ - var keyCode = e.keyCode || e.which; - if (keyCode == 13) { - $G('searchBtn').click(); - } - }); - - /* 选中图片 */ - domUtils.on($G('searchList'), 'click', function(e){ - var target = e.target || e.srcElement, - li = target.parentNode.parentNode; - - if (li.tagName.toLowerCase() == 'li') { - if (domUtils.hasClass(li, 'selected')) { - domUtils.removeClasses(li, 'selected'); - } else { - domUtils.addClass(li, 'selected'); - } - } - }); - }, - /* 改变图片大小 */ - scale: function (img, w, h) { - var ow = img.width, - oh = img.height; - - if (ow >= oh) { - img.width = w * ow / oh; - img.height = h; - img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px'; - } else { - img.width = w; - img.height = h * oh / ow; - img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px'; - } - }, - getImageData: function(){ - var _this = this, - key = $G('searchTxt').value, - type = $G('searchType').value, - keepOriginName = editor.options.keepOriginName ? "1" : "0", - pageNum = $G('pageNum').value, - url = "https://image.baidu.com/search/acjson?tn=resultjson_com&ipn=rj&ct=201326592&is=&fp=result&queryWord=" + key + "&cl=2" + type + "&ie=utf-8&oe=utf-8&adpicid=&z=&ic=0&word=" + key + "&se=&tab=&width=&height=&istype=2&qc=&nc=1&fr=&pn=60&rn=" + pageNum + "&gsm=78&" + new Date() + "="; - - $G('searchListUl').innerHTML = lang.searchLoading; - ajax.request(url, { - 'dataType': 'jsonp', - 'onsuccess':function(json){ - var list = []; - if(json && json.data) { - for(var i = 0; i < json.data.length; i++) { - if(json.data[i].objURL) { - list.push({ - title: json.data[i].fromPageTitleEnc, - src: json.data[i].thumbURL, - url: json.data[i].thumbURL - }); - } - } - } - _this.setList(list); - }, - 'onerror':function(){ - $G('searchListUl').innerHTML = lang.searchRetry; - } - }); - }, - /* 添加图片到列表界面上 */ - setList: function (list) { - var i, item, p, img, link, _this = this, - listUl = $G('searchListUl'); - - listUl.innerHTML = ''; - if(list.length) { - for (i = 0; i < list.length; i++) { - item = document.createElement('li'); - p = document.createElement('p'); - img = document.createElement('img'); - link = document.createElement('a'); - - img.onload = function () { - _this.scale(this, 113, 113); - }; - img.width = 113; - img.setAttribute('src', list[i].src); - - link.href = list[i].url; - link.target = '_blank'; - link.title = list[i].title; - link.innerHTML = list[i].title; - - p.appendChild(img); - item.appendChild(p); - item.appendChild(link); - listUl.appendChild(item); - } - } else { - listUl.innerHTML = lang.searchRetry; - } - }, - getInsertList: function () { - var child, - src, - align = getAlign(), - list = [], - items = $G('searchListUl').children; - for(var i = 0; i < items.length; i++) { - child = items[i].firstChild && items[i].firstChild.firstChild; - if(child.tagName && child.tagName.toLowerCase() == 'img' && domUtils.hasClass(items[i], 'selected')) { - src = child.src; - list.push({ - src: src, - _src: src, - alt: src.substr(src.lastIndexOf('/') + 1), - floatStyle: align - }); - } - } - return list; - } - }; - -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/alignicon.jpg b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/alignicon.jpg deleted file mode 100644 index 754755b1b6e2b37d6090f68b80e91867fdcf1042..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/alignicon.jpg and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/bg.png deleted file mode 100644 index 580be0a01dff4c70c72f78a3f40186660ee8eee0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/icons.gif deleted file mode 100644 index 78459dea7b12ccbeec81d19ecdab22b1658e93b4..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/icons.png deleted file mode 100644 index 12e4700163ac87fa38ae3d92a2c39d0fb4690fed..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/image.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/image.png deleted file mode 100644 index 19699f6a9c6b09cb18ec0f488242d9753d2e341b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/image.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/progress.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/progress.png deleted file mode 100644 index 717c4865c90a959c6a0e9ad1af9c777d900a2e9c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/progress.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/success.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/success.gif deleted file mode 100644 index 8d4f3112b9d1df2147ed3b67d9736163dedd11e1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/success.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/success.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/success.png deleted file mode 100644 index 94f968dc8fd3c7ca8f6cb599d006ef3f23b62c7d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/image/images/success.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/insertframe/insertframe.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/insertframe/insertframe.html deleted file mode 100644 index 5170cbd05948b5a37345fc935e9397252d9a3427..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/insertframe/insertframe.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - -
                      - - - - - - - - - - - - - - - - - - - -
                      - - -
                      px
                      px
                      - -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/internal.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/internal.js deleted file mode 100644 index fb845c3ebc6fcd7a06024b5ef66d5aed3b5b63e7..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/internal.js +++ /dev/null @@ -1,81 +0,0 @@ -(function () { - var parent = window.parent; - //dialog对象 - dialog = parent.$EDITORUI[window.frameElement.id.replace( /_iframe$/, '' )]; - //当前打开dialog的编辑器实例 - editor = dialog.editor; - - UE = parent.UE; - - domUtils = UE.dom.domUtils; - - utils = UE.utils; - - browser = UE.browser; - - ajax = UE.ajax; - - $G = function ( id ) { - return document.getElementById( id ) - }; - //focus元素 - $focus = function ( node ) { - setTimeout( function () { - if ( browser.ie ) { - var r = node.createTextRange(); - r.collapse( false ); - r.select(); - } else { - node.focus() - } - }, 0 ) - }; - utils.loadFile(document,{ - href:"../../themes/" + editor.options.theme + "/dialogbase.css?cache="+Math.random(), - tag:"link", - type:"text/css", - rel:"stylesheet" - }); - lang = editor.getLang(dialog.className.split( "-" )[2]); - if(lang){ - domUtils.on(window,'load',function () { - - var langImgPath = editor.options.langPath + editor.options.lang + "/images/"; - //针对静态资源 - for ( var i in lang["static"] ) { - var dom = $G( i ); - if(!dom) continue; - var tagName = dom.tagName, - content = lang["static"][i]; - if(content.src){ - //clone - content = utils.extend({},content,false); - content.src = langImgPath + content.src; - } - if(content.style){ - content = utils.extend({},content,false); - content.style = content.style.replace(/url\s*\(/g,"url(" + langImgPath) - } - switch ( tagName.toLowerCase() ) { - case "var": - dom.parentNode.replaceChild( document.createTextNode( content ), dom ); - break; - case "select": - var ops = dom.options; - for ( var j = 0, oj; oj = ops[j]; ) { - oj.innerHTML = content.options[j++]; - } - for ( var p in content ) { - p != "options" && dom.setAttribute( p, content[p] ); - } - break; - default : - domUtils.setAttributes( dom, content); - } - } - } ); - } - - -})(); - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/link/link.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/link/link.html deleted file mode 100644 index 8da85504e8169eee4ea149db1db55e38e0a7573e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/link/link.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      - - -
                      - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/map/map.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/map/map.html deleted file mode 100644 index a4c6a9f8f19a621340b47485a718eca64253cece..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/map/map.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - -
                      - - - - - - - - - -
                      ::
                      -
                      - -
                      - - - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/map/show.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/map/show.html deleted file mode 100644 index b1508982a5bdb8c2ebf8e7c0ecf3cc8f3fe82ea5..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/map/show.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - 百度地图API自定义地图 - - - - - - - -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/balls.svg b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/balls.svg deleted file mode 100644 index 07130c6f1039d78327efd6446ef48b2d81ad4704..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/balls.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/music.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/music.css deleted file mode 100644 index 8ec98b990eeebbca8ee7ea597a78048d990c9478..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/music.css +++ /dev/null @@ -1,90 +0,0 @@ -.wrapper{margin: 20px;} - -.searchBar{height:30px;text-align:left;} -.searchBtn{ - font-size: 13px; - height: 28px; - border-radius: 5px; - border: 1px solid #3498db; - width: 80px; - background-color: #3498db; - color: #fff; - margin-left: 6px; -} - -.resultBar{width:589px;height:357px;margin-top: 20px;border: 1px solid #CCC;border-radius: 5px;box-shadow: 2px 2px 5px #D3D6DA;overflow: hidden;} - -.listPanel{overflow: hidden;} -.panelon{display:block;} -.paneloff{display:none} - -.page{width:220px;margin:20px auto;overflow: hidden;display: flex;justify-content: center;flex-direction: row-reverse;} -.pageon{float:right;width:26px;line-height:26px;height:26px;margin-right: 5px;border: none;color: #fff;font-weight: bold;text-align:center; - background-color: #3498db;border-radius: 5px;} -.pageoff{float:right;width:24px;line-height:24px;height:24px;cursor:pointer;background-color: #fff; - color: #ccc;margin-right: 5px;text-decoration: none;text-align:center;} - -.m-box{width:589px;} -.m-m{float: left;line-height: 26px;height: 26px;display: flex;} -.m-h{height:30px;line-height:30px;padding-left: 70px;background-color:#f3f3f3;font-weight: bold;font-size: 12px;color: #666;} -.m-l{float:left;width:40px; margin-top: 8px; margin-left: 17px;margin-right: 10px;} -.m-t{float:left;width:142px;} -.m-s{float:left;width:142px;} -.m-z{float:left;width:142px;} -.m-try-t{float: left;width: 60px;;} - -/*.m-try{float:left;width:20px;height:20px;background:url('http://static.tieba.baidu.com/tb/editor/images/try_music.gif') no-repeat ;}*/ -.m-try { - width: 4px; - display: flex; - height: 0; - border-top: 5px solid transparent; - border-left: 8px solid #9e9e9e; - border-bottom: 5px solid transparent; - margin-top: 8px; -} -/*.m-trying{float:left;width:20px;height:20px;background:url('http://static.tieba.baidu.com/tb/editor/images/stop_music.gif') no-repeat ;}*/ - -.m-trying { - display: flex; - width: 3px; - height: 12px; - background-color: #3498db; - margin-top: 8px; - position: relative; -} -.m-trying:after { - width: 3px; - height: 12px; - background-color: #3498db; - left : 5px; - display: block; - position: absolute; - content: " "; -} -.loading{ - width: 113px; - height: 95px; - font-size: 7px; - margin: 114px auto; - background: url(balls.svg) no-repeat; -} -.empty{ - width: 300px; - height: 40px; - padding: 2px; - margin: 157px auto; - line-height: 40px; - color: #666; - text-align: center; -} - -#J_searchName{ - height: 26px; - width: 295px; - border-radius: 5px; - border: 1px solid #ccc; -} -.listPanel input[type="radio"] { - background-color: #fff; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/music.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/music.html deleted file mode 100644 index e7ef04f3954f294e165455539c9f02c764165d2c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/music.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - 插入音乐 - - - - -
                      - -
                      - -
                      -
                      -
                      -
                      - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/music.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/music.js deleted file mode 100644 index 97cfc36afbe92764c978106a8cad16f1d58871fb..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/music/music.js +++ /dev/null @@ -1,192 +0,0 @@ -function Music() { - this.init(); -} -(function () { - var pages = [], - panels = [], - selectedItem = null; - Music.prototype = { - total:70, - pageSize:10, - dataUrl:"https://tingapi.b0.upaiyun.com/v1/restserver/ting?method=baidu.ting.search.common", - playerUrl:"http://box.baidu.com/widget/flash/bdspacesong.swf", - - init:function () { - var me = this; - domUtils.on($G("J_searchName"), "keyup", function (event) { - var e = window.event || event; - if (e.keyCode == 13) { - me.dosearch(); - } - }); - domUtils.on($G("J_searchBtn"), "click", function () { - me.dosearch(); - }); - }, - callback:function (data) { - var me = this; - me.data = data.song_list; - setTimeout(function () { - $G('J_resultBar').innerHTML = me._renderTemplate(data.song_list); - }, 300); - }, - dosearch:function () { - var me = this; - selectedItem = null; - var key = $G('J_searchName').value; - if (utils.trim(key) == "")return false; - key = encodeURIComponent(key); - me._sent(key); - }, - doselect:function (i) { - var me = this; - if (typeof i == 'object') { - selectedItem = i; - } else if (typeof i == 'number') { - selectedItem = me.data[i]; - } - }, - onpageclick:function (id) { - var me = this; - for (var i = 0; i < pages.length; i++) { - $G(pages[i]).className = 'pageoff'; - $G(panels[i]).className = 'paneloff'; - } - $G('page' + id).className = 'pageon'; - $G('panel' + id).className = 'panelon'; - }, - listenTest:function (elem) { - var me = this, - view = $G('J_preview'), - is_play_action = (elem.className == 'm-try'), - old_trying = me._getTryingElem(); - - if (old_trying) { - old_trying.className = 'm-try'; - view.innerHTML = ''; - } - if (is_play_action) { - elem.className = 'm-trying'; - view.innerHTML = me._buildMusicHtml(me._getUrl(true)); - } - }, - _sent:function (param) { - var me = this; - $G('J_resultBar').innerHTML = '
                      '; - - utils.loadFile(document, { - src:me.dataUrl + '&query=' + param + '&page_size=' + me.total + '&callback=music.callback&.r=' + Math.random(), - tag:"script", - type:"text/javascript", - defer:"defer" - }); - }, - _removeHtml:function (str) { - var reg = /<\s*\/?\s*[^>]*\s*>/gi; - return str.replace(reg, ""); - }, - _getUrl:function (isTryListen) { - var me = this; - var param = 'from=tiebasongwidget&url=&name=' + encodeURIComponent(me._removeHtml(selectedItem.title)) + '&artist=' - + encodeURIComponent(me._removeHtml(selectedItem.author)) + '&extra=' - + encodeURIComponent(me._removeHtml(selectedItem.album_title)) - + '&autoPlay='+isTryListen+'' + '&loop=true'; - return me.playerUrl + "?" + param; - }, - _getTryingElem:function () { - var s = $G('J_listPanel').getElementsByTagName('span'); - - for (var i = 0; i < s.length; i++) { - if (s[i].className == 'm-trying') - return s[i]; - } - return null; - }, - _buildMusicHtml:function (playerUrl) { - var html = ' 12) - return s.substring(0, 5) + '...'; - if (!s) s = " "; - return s; - }, - _rebuildData:function (data) { - var me = this, - newData = [], - d = me.pageSize, - itembox; - for (var i = 0; i < data.length; i++) { - if ((i + d) % d == 0) { - itembox = []; - newData.push(itembox) - } - itembox.push(data[i]); - } - return newData; - }, - _renderTemplate:function (data) { - var me = this; - if (data.length == 0)return '
                      ' + lang.emptyTxt + '
                      '; - data = me._rebuildData(data); - var s = [], p = [], t = []; - s.push('
                      '); - p.push('
                      '); - for (var i = 0, tmpList; tmpList = data[i++];) { - panels.push('panel' + i); - pages.push('page' + i); - if (i == 1) { - s.push('
                      '); - if (data.length != 1) { - t.push('
                      ' + (i ) + '
                      '); - } - } else { - s.push('
                      '); - t.push('
                      ' + (i ) + '
                      '); - } - s.push('
                      '); - s.push('
                      ' + lang.chapter + '' + lang.singer - + '' + lang.special + '' + lang.listenTest + '
                      '); - for (var j = 0, tmpObj; tmpObj = tmpList[j++];) { - s.push(''); - } - s.push('
                      '); - s.push('
                      '); - } - t.reverse(); - p.push(t.join('')); - s.push('
                      '); - p.push('
                      '); - return s.join('') + p.join(''); - }, - exec:function () { - var me = this; - if (selectedItem == null) return; - $G('J_preview').innerHTML = ""; - editor.execCommand('music', { - url:me._getUrl(false), - width:400, - height:95 - }); - } - }; -})(); - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/preview/preview.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/preview/preview.html deleted file mode 100644 index 42849bb77fc84b187c9d18904836866f75a5213d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/preview/preview.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - -
                      - -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/addimg.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/addimg.png deleted file mode 100644 index 03a87135bab65fa2633156789ed0f4a906d6c48b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/addimg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/brush.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/brush.png deleted file mode 100644 index efa6fdb01a8e5cf161dc62bfb20894689a1730bd..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/brush.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/delimg.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/delimg.png deleted file mode 100644 index 5a892e40ad3257f632b34a873b517dd5d590cc9f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/delimg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/delimgH.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/delimgH.png deleted file mode 100644 index 2f0c5c9de33a431d1c8e50cd12da74505921ad7e..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/delimgH.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/empty.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/empty.png deleted file mode 100644 index 0375196257ac3c859373b3ebebbabe6f16105587..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/empty.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/emptyH.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/emptyH.png deleted file mode 100644 index 838ca723119499465f29e881a745f4d8a051e22c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/emptyH.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/eraser.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/eraser.png deleted file mode 100644 index 63e87cecb90ed3ac0e4acbc257c6dddae5311e09..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/eraser.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/redo.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/redo.png deleted file mode 100644 index 12cd9bbefc637c7c0a394d00e9d70333ac0f6ea5..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/redo.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/redoH.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/redoH.png deleted file mode 100644 index d9f33d38a3d11ce10447830ce409a0890ecad264..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/redoH.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/scale.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/scale.png deleted file mode 100644 index 935a3f3e1eee04b8a3aa6f70681376298d11e22a..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/scale.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/scaleH.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/scaleH.png deleted file mode 100644 index 72e64a9d0f3ef081ffda153c755600dc4a758e5b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/scaleH.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/size.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/size.png deleted file mode 100644 index 8366845059c94089aef92aa3aeeee79e242732eb..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/size.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/undo.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/undo.png deleted file mode 100644 index 084c7cc73f4058c8084e5ea3ab4e51fd105b7991..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/undo.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/undoH.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/undoH.png deleted file mode 100644 index fde7eb3c2e8080be0224b603f65c3fa5552418be..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/images/undoH.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/scrawl.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/scrawl.css deleted file mode 100644 index f5d35d866d741fd44be96bf2fc794c80103dc2fa..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/scrawl.css +++ /dev/null @@ -1,372 +0,0 @@ -/*common -*/ -body { - margin: 0; -} - -table { - width: 100%; -} - -table td { - padding: 2px 4px; - vertical-align: middle; -} - -a { - text-decoration: none; -} - -em { - font-style: normal; -} - -.border_style1 { - border: 1px solid #ccc; - border-radius: 5px; - box-shadow: 2px 2px 5px #d3d6da; -} - -/*module -*/ -.main { - margin: 20px 20px 0; - overflow: hidden; -} - -.hot { - float: left; -} - -.drawBoard { - position: relative; - cursor: crosshair; -} - -.brushBorad { - position: absolute; - left: 0; - top: 0; - z-index: 998; -} - -.picBoard { - border: none; - text-align: center; - line-height: 300px; - cursor: default; -} - -.operateBar { - margin-top: 10px; - font-size: 12px; - text-align: center; -} - -.operateBar span { - margin-left: 10px; - margin-right: 18px; -} - -.drawToolbar { - float: right; - width: 175px; - height: 372px; - overflow: hidden; -} - -.colorBar { - margin-top: 10px; - margin-left: 10px; - font-size: 12px; - text-align: center; -} - -#J_removeImg { - display: block; - margin-top: 18px; -} - -#J_addImg { - display: block; - margin-top: 16px; -} - -.colorBar #J_colorList tr { - height: 32px; -} - -.colorBar a { - display: block; - width: 16px; - height: 16px; - border: 1px solid #1006F1; - border-radius: 8px; - box-shadow: 2px 2px 5px #d3d6da; - opacity: 0.6 -} - -.sectionBar { - margin-top: 20px; - font-size: 12px; - text-align: center; - display: flex; - justify-content: center; - align-items: center; -} - -/*.sectionBar a{display:inline-block;width:10px;height:12px;color: #888;text-indent: -999px;opacity: 0.3}*/ -/*.size1{background: url('images/size.png') 1px center no-repeat ;}*/ -/*.size2{background: url('images/size.png') -10px center no-repeat;}*/ -/*.size3{background: url('images/size.png') -22px center no-repeat;}*/ -/*.size4{background: url('images/size.png') -35px center no-repeat;}*/ - -.size1 { - width: 4px; - height: 4px; - border-radius: 2px; - text-indent: -999px; - opacity: 0.3; - display: block; - background-color: #3498db; - margin-right: 17px; - margin-left: 15px; -} - -.size2 { - width: 8px; - height: 8px; - border-radius: 4px; - text-indent: -999px; - opacity: 0.3; - display: block; - margin-right: 17px; - background-color: #3498db; - -} - -.size3 { - width: 12px; - height: 12px; - border-radius: 6px; - text-indent: -999px; - opacity: 0.3; - display: block; - background-color: #3498db; - margin-right: 17px; -} - -.size4 { - width: 16px; - height: 16px; - border-radius: 8px; - text-indent: -999px; - opacity: 0.3; - display: block; - background-color: #3498db; -} - -.addImgH { - position: relative; -} - -.addImgH_form { - position: absolute; - left: 18px; - top: -1px; - width: 75px; - height: 21px; - opacity: 0; - cursor: pointer; -} - -.addImgH_form input { - width: 100%; -} - -/*scrawl遮罩层 -*/ -.maskLayerNull { - display: none; -} - -.maskLayer { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - opacity: 0.7; - background-color: #fff; - text-align: center; - font-weight: bold; - line-height: 410px; - z-index: 1000; -} - -.maskLayer input { - border-radius: 2px; - border: 1px solid #ccc; - padding: 4px 12px; -} - -/*btn state -*/ -.previousStepH .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.previousStepH .text { - color: #888; - cursor: pointer; -} - -.previousStep .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.previousStep .text { - color: #ccc; - cursor: default; -} - -.nextStepH .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.nextStepH .text { - color: #888; - cursor: pointer; -} - -.nextStep .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.nextStep .text { - color: #ccc; - cursor: default; -} - -.clearBoardH .icon { - display: inline-block; - width: 16px; - height: 16px; - /*background-image: url('images/empty.png');*/ - cursor: default; -} - -.clearBoardH .text { - color: #888; - cursor: pointer; -} - -.clearBoard .icon { - display: inline-block; - width: 16px; - height: 16px; - /*background-image: url('images/empty.png');*/ - cursor: default; -} - -.clearBoard .text { - color: #ccc; - cursor: default; -} - -.scaleBoardH .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.scaleBoardH .text { - color: #888; - cursor: pointer; -} - -.scaleBoard .icon { - display: inline-block; - width: 16px; - height: 16px; -} - -.scaleBoard .text { - color: #ccc; - cursor: default; -} - -.removeImgH .icon { - display: inline-block; - width: 16px; - height: 16px; - background-image: url('images/delimgH.png'); - cursor: pointer; -} - -.removeImgH .text { - color: #888; - cursor: pointer; -} - -.removeImg .icon { - display: inline-block; - width: 16px; - height: 16px; - background-image: url('images/delimg.png'); - cursor: default; -} - -.removeImg .text { - color: #fff; - cursor: default; - padding: 7px 12px; - border-radius: 6px; - background-color: #f25f5f; -} - -.addImgH .icon { - vertical-align: top; - display: inline-block; - width: 16px; - height: 16px; - background-image: url('images/addimg.png') -} - -.addImgH .text { - color: #888; - cursor: pointer; - padding: 7px 12px; - border-radius: 6px; - background-color: #f3f3f3; -} - -/*icon -*/ -.brushIcon { - display: inline-block; - width: 16px; - height: 16px; - font-size: 16px; - margin-top: -5px; -} - -.eraserIcon { - display: inline-block; - width: 16px; - height: 16px; - font-size: 18px !important; - margin-top: -16px; -} - -.icon { - font-size: 18px; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/scrawl.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/scrawl.html deleted file mode 100644 index 6e8db0e325d892d8a8e9273d8909ef690bc80a5d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/scrawl.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - -
                      -
                      -
                      - -
                      -
                      -
                      - - - - - - - - - - - - - - - - - - - - -
                      -
                      -
                      -
                      -
                      - - 1 - 3 - 5 - 7 -
                      -
                      - - 1 - 3 - 5 - 7 -
                      -
                      -
                      - - -
                      - -
                      - -
                      -
                      -
                      - - - - -
                      -
                      -
                      -
                      - - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/scrawl.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/scrawl.js deleted file mode 100644 index a8cbce1536b9a6d2e16f5d25008dee64fe769fa1..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/scrawl/scrawl.js +++ /dev/null @@ -1,683 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-5-22 - * Time: 上午11:38 - * To change this template use File | Settings | File Templates. - */ -var scrawl = function (options) { - options && this.initOptions(options); -}; -(function () { - var canvas = $G("J_brushBoard"), - context = canvas.getContext('2d'), - drawStep = [], //undo redo存储 - drawStepIndex = 0; //undo redo指针 - - scrawl.prototype = { - isScrawl:false, //是否涂鸦 - brushWidth:-1, //画笔粗细 - brushColor:"", //画笔颜色 - - initOptions:function (options) { - var me = this; - me.originalState(options);//初始页面状态 - me._buildToolbarColor(options.colorList);//动态生成颜色选择集合 - - me._addBoardListener(options.saveNum);//添加画板处理 - me._addOPerateListener(options.saveNum);//添加undo redo clearBoard处理 - me._addColorBarListener();//添加颜色选择处理 - me._addBrushBarListener();//添加画笔大小处理 - me._addEraserBarListener();//添加橡皮大小处理 - me._addAddImgListener();//添加增添背景图片处理 - me._addRemoveImgListenter();//删除背景图片处理 - me._addScalePicListenter();//添加缩放处理 - me._addClearSelectionListenter();//添加清楚选中状态处理 - - me._originalColorSelect(options.drawBrushColor);//初始化颜色选中 - me._originalBrushSelect(options.drawBrushSize);//初始化画笔选中 - me._clearSelection();//清楚选中状态 - }, - - originalState:function (options) { - var me = this; - - me.brushWidth = options.drawBrushSize;//同步画笔粗细 - me.brushColor = options.drawBrushColor;//同步画笔颜色 - - context.lineWidth = me.brushWidth;//初始画笔大小 - context.strokeStyle = me.brushColor;//初始画笔颜色 - context.fillStyle = "transparent";//初始画布背景颜色 - context.lineCap = "round";//去除锯齿 - context.fill(); - }, - _buildToolbarColor:function (colorList) { - var tmp = null, arr = []; - arr.push(""); - for (var i = 0, color; color = colorList[i++];) { - if ((i - 1) % 5 == 0) { - if (i != 1) { - arr.push(""); - } - arr.push(""); - } - tmp = '#' + color; - arr.push(""); - } - arr.push("
                      "); - $G("J_colorBar").innerHTML = arr.join(""); - }, - - _addBoardListener:function (saveNum) { - var me = this, - margin = 0, - startX = -1, - startY = -1, - isMouseDown = false, - isMouseMove = false, - isMouseUp = false, - buttonPress = 0, button, flag = ''; - - margin = parseInt(domUtils.getComputedStyle($G("J_wrap"), "margin-left")); - drawStep.push(context.getImageData(0, 0, context.canvas.width, context.canvas.height)); - drawStepIndex += 1; - - domUtils.on(canvas, ["mousedown", "mousemove", "mouseup", "mouseout"], function (e) { - button = browser.webkit ? e.which : buttonPress; - switch (e.type) { - case 'mousedown': - buttonPress = 1; - flag = 1; - isMouseDown = true; - isMouseUp = false; - isMouseMove = false; - me.isScrawl = true; - startX = e.clientX - margin;//10为外边距总和 - startY = e.clientY - margin; - context.beginPath(); - break; - case 'mousemove' : - if (!flag && button == 0) { - return; - } - if (!flag && button) { - startX = e.clientX - margin;//10为外边距总和 - startY = e.clientY - margin; - context.beginPath(); - flag = 1; - } - if (isMouseUp || !isMouseDown) { - return; - } - var endX = e.clientX - margin, - endY = e.clientY - margin; - - context.moveTo(startX, startY); - context.lineTo(endX, endY); - context.stroke(); - startX = endX; - startY = endY; - isMouseMove = true; - break; - case 'mouseup': - buttonPress = 0; - if (!isMouseDown)return; - if (!isMouseMove) { - context.arc(startX, startY, context.lineWidth, 0, Math.PI * 2, false); - context.fillStyle = context.strokeStyle; - context.fill(); - } - context.closePath(); - me._saveOPerate(saveNum); - isMouseDown = false; - isMouseMove = false; - isMouseUp = true; - startX = -1; - startY = -1; - break; - case 'mouseout': - flag = ''; - buttonPress = 0; - if (button == 1) return; - context.closePath(); - break; - } - }); - }, - _addOPerateListener:function (saveNum) { - var me = this; - domUtils.on($G("J_previousStep"), "click", function () { - if (drawStepIndex > 1) { - drawStepIndex -= 1; - context.clearRect(0, 0, context.canvas.width, context.canvas.height); - context.putImageData(drawStep[drawStepIndex - 1], 0, 0); - // me.btn2Highlight("J_nextStep"); - // drawStepIndex == 1 && me.btn2disable("J_previousStep"); - } - }); - domUtils.on($G("J_nextStep"), "click", function () { - if (drawStepIndex > 0 && drawStepIndex < drawStep.length) { - context.clearRect(0, 0, context.canvas.width, context.canvas.height); - context.putImageData(drawStep[drawStepIndex], 0, 0); - drawStepIndex += 1; - // me.btn2Highlight("J_previousStep"); - // drawStepIndex == drawStep.length && me.btn2disable("J_nextStep"); - } - }); - domUtils.on($G("J_clearBoard"), "click", function () { - context.clearRect(0, 0, context.canvas.width, context.canvas.height); - drawStep = []; - me._saveOPerate(saveNum); - drawStepIndex = 1; - me.isScrawl = false; - // me.btn2disable("J_previousStep"); - // me.btn2disable("J_nextStep"); - // me.btn2disable("J_clearBoard"); - }); - }, - _addColorBarListener:function () { - var me = this; - domUtils.on($G("J_colorBar"), "click", function (e) { - var target = me.getTarget(e), - color = target.title; - if (!!color) { - me._addColorSelect(target); - - me.brushColor = color; - context.globalCompositeOperation = "source-over"; - context.lineWidth = me.brushWidth; - context.strokeStyle = color; - } - }); - }, - _addBrushBarListener:function () { - var me = this; - domUtils.on($G("J_brushBar"), "click", function (e) { - var target = me.getTarget(e), - size = browser.ie ? target.innerText : target.text; - if (!!size) { - me._addBESelect(target); - - context.globalCompositeOperation = "source-over"; - context.lineWidth = parseInt(size); - context.strokeStyle = me.brushColor; - me.brushWidth = context.lineWidth; - } - }); - }, - _addEraserBarListener:function () { - var me = this; - domUtils.on($G("J_eraserBar"), "click", function (e) { - var target = me.getTarget(e), - size = browser.ie ? target.innerText : target.text; - if (!!size) { - me._addBESelect(target); - - context.lineWidth = parseInt(size); - context.globalCompositeOperation = "destination-out"; - context.strokeStyle = "#FFF"; - } - }); - }, - _addAddImgListener:function () { - var file = $G("J_imgTxt"); - if (!window.FileReader) { - $G("J_addImg").style.display = 'none'; - $G("J_removeImg").style.display = 'none'; - $G("J_sacleBoard").style.display = 'none'; - } - domUtils.on(file, "change", function (e) { - var frm = file.parentNode; - addMaskLayer(lang.backgroundUploading); - - var target = e.target || e.srcElement, - reader = new FileReader(); - reader.onload = function(evt){ - var target = evt.target || evt.srcElement; - ue_callback(target.result, 'SUCCESS'); - }; - reader.readAsDataURL(target.files[0]); - frm.reset(); - }); - }, - _addRemoveImgListenter:function () { - var me = this; - domUtils.on($G("J_removeImg"), "click", function () { - $G("J_picBoard").innerHTML = ""; - // me.btn2disable("J_removeImg"); - // me.btn2disable("J_sacleBoard"); - }); - }, - _addScalePicListenter:function () { - domUtils.on($G("J_sacleBoard"), "click", function () { - var picBoard = $G("J_picBoard"), - scaleCon = $G("J_scaleCon"), - img = picBoard.children[0]; - - if (img) { - if (!scaleCon) { - picBoard.style.cssText = "position:relative;z-index:999;"+picBoard.style.cssText; - img.style.cssText = "position: absolute;top:" + (canvas.height - img.height) / 2 + "px;left:" + (canvas.width - img.width) / 2 + "px;"; - var scale = new ScaleBoy(); - picBoard.appendChild(scale.init()); - scale.startScale(img); - } else { - if (scaleCon.style.visibility == "visible") { - scaleCon.style.visibility = "hidden"; - picBoard.style.position = ""; - picBoard.style.zIndex = ""; - } else { - scaleCon.style.visibility = "visible"; - picBoard.style.cssText += "position:relative;z-index:999"; - } - } - } - }); - }, - _addClearSelectionListenter:function () { - var doc = document; - domUtils.on(doc, 'mousemove', function (e) { - if (browser.ie && browser.version < 11) - doc.selection.clear(); - else - window.getSelection().removeAllRanges(); - }); - }, - _clearSelection:function () { - var list = ["J_operateBar", "J_colorBar", "J_brushBar", "J_eraserBar", "J_picBoard"]; - for (var i = 0, group; group = list[i++];) { - domUtils.unSelectable($G(group)); - } - }, - - _saveOPerate:function (saveNum) { - var me = this; - if (drawStep.length <= saveNum) { - if(drawStepIndex"); - } - scale.innerHTML = arr.join(""); - return scale; - } - - var rect = [ - //[left, top, width, height] - [1, 1, -1, -1], - [0, 1, 0, -1], - [0, 1, 1, -1], - [1, 0, -1, 0], - [0, 0, 1, 0], - [1, 0, -1, 1], - [0, 0, 0, 1], - [0, 0, 1, 1] - ]; - ScaleBoy.prototype = { - init:function () { - _appendStyle(); - var me = this, - scale = me.dom = _getDom(); - - me.scaleMousemove.fp = me; - domUtils.on(scale, 'mousedown', function (e) { - var target = e.target || e.srcElement; - me.start = {x:e.clientX, y:e.clientY}; - if (target.className.indexOf('hand') != -1) { - me.dir = target.className.replace('hand', ''); - } - domUtils.on(document.body, 'mousemove', me.scaleMousemove); - e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true; - }); - domUtils.on(document.body, 'mouseup', function (e) { - if (me.start) { - domUtils.un(document.body, 'mousemove', me.scaleMousemove); - if (me.moved) { - me.updateScaledElement({position:{x:scale.style.left, y:scale.style.top}, size:{w:scale.style.width, h:scale.style.height}}); - } - delete me.start; - delete me.moved; - delete me.dir; - } - }); - return scale; - }, - startScale:function (objElement) { - var me = this, Idom = me.dom; - - Idom.style.cssText = 'visibility:visible;top:' + objElement.style.top + ';left:' + objElement.style.left + ';width:' + objElement.offsetWidth + 'px;height:' + objElement.offsetHeight + 'px;'; - me.scalingElement = objElement; - }, - updateScaledElement:function (objStyle) { - var cur = this.scalingElement, - pos = objStyle.position, - size = objStyle.size; - if (pos) { - typeof pos.x != 'undefined' && (cur.style.left = pos.x); - typeof pos.y != 'undefined' && (cur.style.top = pos.y); - } - if (size) { - size.w && (cur.style.width = size.w); - size.h && (cur.style.height = size.h); - } - }, - updateStyleByDir:function (dir, offset) { - var me = this, - dom = me.dom, tmp; - - rect['def'] = [1, 1, 0, 0]; - if (rect[dir][0] != 0) { - tmp = parseInt(dom.style.left) + offset.x; - dom.style.left = me._validScaledProp('left', tmp) + 'px'; - } - if (rect[dir][1] != 0) { - tmp = parseInt(dom.style.top) + offset.y; - dom.style.top = me._validScaledProp('top', tmp) + 'px'; - } - if (rect[dir][2] != 0) { - tmp = dom.clientWidth + rect[dir][2] * offset.x; - dom.style.width = me._validScaledProp('width', tmp) + 'px'; - } - if (rect[dir][3] != 0) { - tmp = dom.clientHeight + rect[dir][3] * offset.y; - dom.style.height = me._validScaledProp('height', tmp) + 'px'; - } - if (dir === 'def') { - me.updateScaledElement({position:{x:dom.style.left, y:dom.style.top}}); - } - }, - scaleMousemove:function (e) { - var me = arguments.callee.fp, - start = me.start, - dir = me.dir || 'def', - offset = {x:e.clientX - start.x, y:e.clientY - start.y}; - - me.updateStyleByDir(dir, offset); - arguments.callee.fp.start = {x:e.clientX, y:e.clientY}; - arguments.callee.fp.moved = 1; - }, - _validScaledProp:function (prop, value) { - var ele = this.dom, - wrap = $G("J_picBoard"); - - value = isNaN(value) ? 0 : value; - switch (prop) { - case 'left': - return value < 0 ? 0 : (value + ele.clientWidth) > wrap.clientWidth ? wrap.clientWidth - ele.clientWidth : value; - case 'top': - return value < 0 ? 0 : (value + ele.clientHeight) > wrap.clientHeight ? wrap.clientHeight - ele.clientHeight : value; - case 'width': - return value <= 0 ? 1 : (value + ele.offsetLeft) > wrap.clientWidth ? wrap.clientWidth - ele.offsetLeft : value; - case 'height': - return value <= 0 ? 1 : (value + ele.offsetTop) > wrap.clientHeight ? wrap.clientHeight - ele.offsetTop : value; - } - } - }; -})(); - -//后台回调 -function ue_callback(url, state) { - var doc = document, - picBorard = $G("J_picBoard"), - img = doc.createElement("img"); - - //图片缩放 - function scale(img, max, oWidth, oHeight) { - var width = 0, height = 0, percent, ow = img.width || oWidth, oh = img.height || oHeight; - if (ow > max || oh > max) { - if (ow >= oh) { - if (width = ow - max) { - percent = (width / ow).toFixed(2); - img.height = oh - oh * percent; - img.width = max; - } - } else { - if (height = oh - max) { - percent = (height / oh).toFixed(2); - img.width = ow - ow * percent; - img.height = max; - } - } - } - } - - //移除遮罩层 - removeMaskLayer(); - //状态响应 - if (state == "SUCCESS") { - picBorard.innerHTML = ""; - img.onload = function () { - scale(this, 300); - picBorard.appendChild(img); - - var obj = new scrawl(); - // obj.btn2Highlight("J_removeImg"); - //trace 2457 - // obj.btn2Highlight("J_sacleBoard"); - }; - img.src = url; - } else { - alert(state); - } -} -//去掉遮罩层 -function removeMaskLayer() { - var maskLayer = $G("J_maskLayer"); - maskLayer.className = "maskLayerNull"; - maskLayer.innerHTML = ""; - dialog.buttons[0].setDisabled(false); -} -//添加遮罩层 -function addMaskLayer(html) { - var maskLayer = $G("J_maskLayer"); - dialog.buttons[0].setDisabled(true); - maskLayer.className = "maskLayer"; - maskLayer.innerHTML = html; -} -//执行确认按钮方法 -function exec(scrawlObj) { - if (scrawlObj.isScrawl) { - addMaskLayer(lang.scrawlUpLoading); - var base64 = scrawlObj.getCanvasData(); - var file = scrawlObj.dataURLtoFile(base64, 'scrawl-image.png'); - /* 上传涂鸦图片 */ - editor.getOpt("scrawlUploadService")(scrawlObj, editor).uploadScraw(file, base64, function(data) { - if (!scrawlObj.isCancelScrawl) { - if (data.responseSuccess) { - var imgObj = {}, - srcField = data.scrawlSrcField || 'url', - src = '', - srcFieldKeys = srcField.split('.'), - prefix = editor.options.scrawlUrlPrefix; - - if(srcFieldKeys.length > 1) { - function setSrc(obj, keys, index) { - obj = obj[keys[index]]; - if (index < keys.length - 1) { - setSrc(obj, keys, index += 1) - } else { - src = obj; - } - } - setSrc(data, srcFieldKeys, 0); - } else { - src = data[srcField]; - } - - imgObj.src = prefix + src; - imgObj._src = prefix + src; - imgObj.alt = data.original || ''; - editor.execCommand("insertImage", imgObj); - dialog.close(); - } else { - addMaskLayer(data.message + "   "); - } - } - }, function(err) { - addMaskLayer(lang.imageError + "   "); - }); - } else { - addMaskLayer(lang.noScarwl + "   "); - } -} - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/searchreplace/searchreplace.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/searchreplace/searchreplace.html deleted file mode 100644 index 8234fe26a23075fcc094b35692ea2fbdebe399b8..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/searchreplace/searchreplace.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - -
                      - -
                      -
                      - - - - - - - - - - - - - - - - - - - - - - -
                      :
                      - -
                      - - -
                      -   -
                      - -
                      -
                      -
                      - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      :
                      :
                      - -
                      - - - - -
                      -   -
                      - -
                      -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/searchreplace/searchreplace.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/searchreplace/searchreplace.js deleted file mode 100644 index 02fa46c8cad3b543165534562498065a73cdd341..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/searchreplace/searchreplace.js +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-9-26 - * Time: 下午12:29 - * To change this template use File | Settings | File Templates. - */ - -//清空上次查选的痕迹 -editor.firstForSR = 0; -editor.currentRangeForSR = null; -//给tab注册切换事件 -/** - * tab点击处理事件 - * @param tabHeads - * @param tabBodys - * @param obj - */ -function clickHandler( tabHeads,tabBodys,obj ) { - //head样式更改 - for ( var k = 0, len = tabHeads.length; k < len; k++ ) { - tabHeads[k].className = ""; - } - obj.className = "focus"; - //body显隐 - var tabSrc = obj.getAttribute( "tabSrc" ); - for ( var j = 0, length = tabBodys.length; j < length; j++ ) { - var body = tabBodys[j], - id = body.getAttribute( "id" ); - if ( id != tabSrc ) { - body.style.zIndex = 1; - } else { - body.style.zIndex = 200; - } - } - -} - -/** - * TAB切换 - * @param tabParentId tab的父节点ID或者对象本身 - */ -function switchTab( tabParentId ) { - var tabElements = $G( tabParentId ).children, - tabHeads = tabElements[0].children, - tabBodys = tabElements[1].children; - - for ( var i = 0, length = tabHeads.length; i < length; i++ ) { - var head = tabHeads[i]; - if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); - head.onclick = function () { - clickHandler(tabHeads,tabBodys,this); - } - } -} -$G('searchtab').onmousedown = function(){ - $G('search-msg').innerHTML = ''; - $G('replace-msg').innerHTML = '' -} -//是否区分大小写 -function getMatchCase(id) { - return $G(id).checked ? true : false; -} -//查找 -$G("nextFindBtn").onclick = function (txt, dir, mcase) { - var findtxt = $G("findtxt").value, obj; - if (!findtxt) { - return false; - } - obj = { - searchStr:findtxt, - dir:1, - casesensitive:getMatchCase("matchCase") - }; - if (!frCommond(obj)) { - var bk = editor.selection.getRange().createBookmark(); - $G('search-msg').innerHTML = lang.getEnd; - editor.selection.getRange().moveToBookmark(bk).select(); - - - } -}; -$G("nextReplaceBtn").onclick = function (txt, dir, mcase) { - var findtxt = $G("findtxt1").value, obj; - if (!findtxt) { - return false; - } - obj = { - searchStr:findtxt, - dir:1, - casesensitive:getMatchCase("matchCase1") - }; - frCommond(obj); -}; -$G("preFindBtn").onclick = function (txt, dir, mcase) { - var findtxt = $G("findtxt").value, obj; - if (!findtxt) { - return false; - } - obj = { - searchStr:findtxt, - dir:-1, - casesensitive:getMatchCase("matchCase") - }; - if (!frCommond(obj)) { - $G('search-msg').innerHTML = lang.getStart; - } -}; -$G("preReplaceBtn").onclick = function (txt, dir, mcase) { - var findtxt = $G("findtxt1").value, obj; - if (!findtxt) { - return false; - } - obj = { - searchStr:findtxt, - dir:-1, - casesensitive:getMatchCase("matchCase1") - }; - frCommond(obj); -}; -//替换 -$G("repalceBtn").onclick = function () { - editor.trigger('clearLastSearchResult'); - var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj, - replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, ""); - if (!findtxt) { - return false; - } - if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) { - return false; - } - obj = { - searchStr:findtxt, - dir:1, - casesensitive:getMatchCase("matchCase1"), - replaceStr:replacetxt - }; - frCommond(obj); -}; -//全部替换 -$G("repalceAllBtn").onclick = function () { - var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj, - replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, ""); - if (!findtxt) { - return false; - } - if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) { - return false; - } - obj = { - searchStr:findtxt, - casesensitive:getMatchCase("matchCase1"), - replaceStr:replacetxt, - all:true - }; - var num = frCommond(obj); - if (num) { - $G('replace-msg').innerHTML = lang.countMsg.replace("{#count}", num); - } -}; -//执行 -var frCommond = function (obj) { - return editor.execCommand("searchreplace", obj); -}; -switchTab("searchtab"); - - -dialog.onclose = function(){ - editor.trigger('clearLastSearchResult') -}; \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/snapscreen/snapscreen.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/snapscreen/snapscreen.html deleted file mode 100644 index a05d10136ec71bb63aa380384a8bcfe444925c1e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/snapscreen/snapscreen.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - -
                      -

                      -
                      -
                      -
                      -
                      -
                      -
                      - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/spechars/spechars.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/spechars/spechars.html deleted file mode 100644 index 0b5c416f86d37836d11259bdec1dd8f895110cd0..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/spechars/spechars.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/spechars/spechars.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/spechars/spechars.js deleted file mode 100644 index f4c155e1598abfb8a6e475c6202f76e3fb5861ea..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/spechars/spechars.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-9-26 - * Time: 下午1:09 - * To change this template use File | Settings | File Templates. - */ -var charsContent = [ - { name:"tsfh", title:lang.tsfh, content:toArray("、,。,·,ˉ,ˇ,¨,〃,々,—,~,‖,…,‘,’,“,”,〔,〕,〈,〉,《,》,「,」,『,』,〖,〗,【,】,±,×,÷,∶,∧,∨,∑,∏,∪,∩,∈,∷,√,⊥,∥,∠,⌒,⊙,∫,∮,≡,≌,≈,∽,∝,≠,≮,≯,≤,≥,∞,∵,∴,♂,♀,°,′,″,℃,$,¤,¢,£,‰,§,№,☆,★,○,●,◎,◇,◆,□,■,△,▲,※,→,←,↑,↓,〓,〡,〢,〣,〤,〥,〦,〧,〨,〩,㊣,㎎,㎏,㎜,㎝,㎞,㎡,㏄,㏎,㏑,㏒,㏕,︰,¬,¦,℡,ˊ,ˋ,˙,–,―,‥,‵,℅,℉,↖,↗,↘,↙,∕,∟,∣,≒,≦,≧,⊿,═,║,╒,╓,╔,╕,╖,╗,╘,╙,╚,╛,╜,╝,╞,╟,╠,╡,╢,╣,╤,╥,╦,╧,╨,╩,╪,╫,╬,╭,╮,╯,╰,╱,╲,╳,▁,▂,▃,▄,▅,▆,▇,�,█,▉,▊,▋,▌,▍,▎,▏,▓,▔,▕,▼,▽,◢,◣,◤,◥,☉,⊕,〒,〝,〞")}, - { name:"lmsz", title:lang.lmsz, content:toArray("ⅰ,ⅱ,ⅲ,ⅳ,ⅴ,ⅵ,ⅶ,ⅷ,ⅸ,ⅹ,Ⅰ,Ⅱ,Ⅲ,Ⅳ,Ⅴ,Ⅵ,Ⅶ,Ⅷ,Ⅸ,Ⅹ,Ⅺ,Ⅻ")}, - { name:"szfh", title:lang.szfh, content:toArray("⒈,⒉,⒊,⒋,⒌,⒍,⒎,⒏,⒐,⒑,⒒,⒓,⒔,⒕,⒖,⒗,⒘,⒙,⒚,⒛,⑴,⑵,⑶,⑷,⑸,⑹,⑺,⑻,⑼,⑽,⑾,⑿,⒀,⒁,⒂,⒃,⒄,⒅,⒆,⒇,①,②,③,④,⑤,⑥,⑦,⑧,⑨,⑩,㈠,㈡,㈢,㈣,㈤,㈥,㈦,㈧,㈨,㈩")}, - { name:"rwfh", title:lang.rwfh, content:toArray("ぁ,あ,ぃ,い,ぅ,う,ぇ,え,ぉ,お,か,が,き,ぎ,く,ぐ,け,げ,こ,ご,さ,ざ,し,じ,す,ず,せ,ぜ,そ,ぞ,た,だ,ち,ぢ,っ,つ,づ,て,で,と,ど,な,に,ぬ,ね,の,は,ば,ぱ,ひ,び,ぴ,ふ,ぶ,ぷ,へ,べ,ぺ,ほ,ぼ,ぽ,ま,み,む,め,も,ゃ,や,ゅ,ゆ,ょ,よ,ら,り,る,れ,ろ,ゎ,わ,ゐ,ゑ,を,ん,ァ,ア,ィ,イ,ゥ,ウ,ェ,エ,ォ,オ,カ,ガ,キ,ギ,ク,グ,ケ,ゲ,コ,ゴ,サ,ザ,シ,ジ,ス,ズ,セ,ゼ,ソ,ゾ,タ,ダ,チ,ヂ,ッ,ツ,ヅ,テ,デ,ト,ド,ナ,ニ,ヌ,ネ,ノ,ハ,バ,パ,ヒ,ビ,ピ,フ,ブ,プ,ヘ,ベ,ペ,ホ,ボ,ポ,マ,ミ,ム,メ,モ,ャ,ヤ,ュ,ユ,ョ,ヨ,ラ,リ,ル,レ,ロ,ヮ,ワ,ヰ,ヱ,ヲ,ン,ヴ,ヵ,ヶ")}, - { name:"xlzm", title:lang.xlzm, content:toArray("Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,τ,υ,φ,χ,ψ,ω")}, - { name:"ewzm", title:lang.ewzm, content:toArray("А,Б,В,Г,Д,Е,Ё,Ж,З,И,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ъ,Ы,Ь,Э,Ю,Я,а,б,в,г,д,е,ё,ж,з,и,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ъ,ы,ь,э,ю,я")}, - { name:"pyzm", title:lang.pyzm, content:toArray("ā,á,ǎ,à,ē,é,ě,è,ī,í,ǐ,ì,ō,ó,ǒ,ò,ū,ú,ǔ,ù,ǖ,ǘ,ǚ,ǜ,ü")}, - { name:"yyyb", title:lang.yyyb, content:toArray("i:,i,e,æ,ʌ,ə:,ə,u:,u,ɔ:,ɔ,a:,ei,ai,ɔi,əu,au,iə,εə,uə,p,t,k,b,d,g,f,s,ʃ,θ,h,v,z,ʒ,ð,tʃ,tr,ts,dʒ,dr,dz,m,n,ŋ,l,r,w,j,")}, - { name:"zyzf", title:lang.zyzf, content:toArray("ㄅ,ㄆ,ㄇ,ㄈ,ㄉ,ㄊ,ㄋ,ㄌ,ㄍ,ㄎ,ㄏ,ㄐ,ㄑ,ㄒ,ㄓ,ㄔ,ㄕ,ㄖ,ㄗ,ㄘ,ㄙ,ㄚ,ㄛ,ㄜ,ㄝ,ㄞ,ㄟ,ㄠ,ㄡ,ㄢ,ㄣ,ㄤ,ㄥ,ㄦ,ㄧ,ㄨ")} -]; -(function createTab(content) { - for (var i = 0, ci; ci = content[i++];) { - var span = document.createElement("span"); - span.setAttribute("tabSrc", ci.name); - span.innerHTML = ci.title; - if (i == 1)span.className = "focus"; - domUtils.on(span, "click", function () { - var tmps = $G("tabHeads").children; - for (var k = 0, sk; sk = tmps[k++];) { - sk.className = ""; - } - tmps = $G("tabBodys").children; - for (var k = 0, sk; sk = tmps[k++];) { - sk.style.display = "none"; - } - this.className = "focus"; - $G(this.getAttribute("tabSrc")).style.display = ""; - }); - $G("tabHeads").appendChild(span); - domUtils.insertAfter(span, document.createTextNode("\n")); - var div = document.createElement("div"); - div.id = ci.name; - div.style.display = (i == 1) ? "" : "none"; - var cons = ci.content; - for (var j = 0, con; con = cons[j++];) { - var charSpan = document.createElement("span"); - charSpan.innerHTML = con; - domUtils.on(charSpan, "click", function () { - editor.execCommand("insertHTML", this.innerHTML); - dialog.close(); - }); - div.appendChild(charSpan); - } - $G("tabBodys").appendChild(div); - } -})(charsContent); -function toArray(str) { - return str.split(","); -} diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/dragicon.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/dragicon.png deleted file mode 100644 index f26203bf3f0026891fc8374f109724a69eb38b22..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/dragicon.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittable.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittable.css deleted file mode 100644 index c6f9396c9b04297b63775ef2b9abb68db330b43b..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittable.css +++ /dev/null @@ -1,84 +0,0 @@ -body{ - overflow: hidden; - width: 540px; -} -.wrapper { - margin: 10px auto 0; - font-size: 12px; - overflow: hidden; - width: 520px; - height: 315px; -} - -.clear { - clear: both; -} - -.wrapper .left { - float: left; - margin-left: 10px;; -} - -.wrapper .right { - float: right; - border-left: 2px dotted #EDEDED; - padding-left: 15px; -} - -.section { - margin-bottom: 15px; - width: 240px; - overflow: hidden; -} - -.section h3 { - font-weight: bold; - padding: 5px 0; - margin-bottom: 10px; - border-bottom: 1px solid #EDEDED; - font-size: 12px; -} - -.section ul { - list-style: none; - overflow: hidden; - clear: both; - -} - -.section li { - float: left; - width: 120px;; -} - -.section .tone { - width: 80px;; -} - -.section .preview { - width: 220px; -} - -.section .preview table { - text-align: center; - vertical-align: middle; - color: #666; -} - -.section .preview caption { - font-weight: bold; -} - -.section .preview td { - border-width: 1px; - border-style: solid; - height: 22px; -} - -.section .preview th { - border-style: solid; - border-color: #DDD; - border-width: 2px 1px 1px 1px; - height: 22px; - background-color: #F7F7F7; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittable.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittable.html deleted file mode 100644 index 3c412fb8273d3468f174e8960ea350665093fa44..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittable.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - -
                      -
                      -
                      -

                      -
                        -
                      • - -
                      • -
                      • - -
                      • -
                      -
                        -
                      • - -
                      • -
                      • - -
                      • -
                      -
                      -
                      -
                      -

                      -
                        -
                      • - -
                      • -
                      • - -
                      • -
                      -
                      -
                      -
                      -

                      -
                        -
                      • - - -
                      • -
                      -
                      -
                      -
                      -
                      -
                      -

                      -
                      -
                      -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittable.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittable.js deleted file mode 100644 index 11dbee7c50a1968d99dbeb4babf04974c83dacd7..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittable.js +++ /dev/null @@ -1,237 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-12-19 - * Time: 下午4:55 - * To change this template use File | Settings | File Templates. - */ -(function () { - var title = $G("J_title"), - titleCol = $G("J_titleCol"), - caption = $G("J_caption"), - sorttable = $G("J_sorttable"), - autoSizeContent = $G("J_autoSizeContent"), - autoSizePage = $G("J_autoSizePage"), - tone = $G("J_tone"), - me, - preview = $G("J_preview"); - - var editTable = function () { - me = this; - me.init(); - }; - editTable.prototype = { - init:function () { - var colorPiker = new UE.ui.ColorPicker({ - editor:editor - }), - colorPop = new UE.ui.Popup({ - editor:editor, - content:colorPiker - }); - - title.checked = editor.queryCommandState("inserttitle") == -1; - titleCol.checked = editor.queryCommandState("inserttitlecol") == -1; - caption.checked = editor.queryCommandState("insertcaption") == -1; - sorttable.checked = editor.queryCommandState("enablesort") == 1; - - var enablesortState = editor.queryCommandState("enablesort"), - disablesortState = editor.queryCommandState("disablesort"); - - sorttable.checked = !!(enablesortState < 0 && disablesortState >=0); - sorttable.disabled = !!(enablesortState < 0 && disablesortState < 0); - sorttable.title = enablesortState < 0 && disablesortState < 0 ? lang.errorMsg:''; - - me.createTable(title.checked, titleCol.checked, caption.checked); - me.setAutoSize(); - me.setColor(me.getColor()); - - domUtils.on(title, "click", me.titleHanler); - domUtils.on(titleCol, "click", me.titleColHanler); - domUtils.on(caption, "click", me.captionHanler); - domUtils.on(sorttable, "click", me.sorttableHanler); - domUtils.on(autoSizeContent, "click", me.autoSizeContentHanler); - domUtils.on(autoSizePage, "click", me.autoSizePageHanler); - - domUtils.on(tone, "click", function () { - colorPop.showAnchor(tone); - }); - domUtils.on(document, 'mousedown', function () { - colorPop.hide(); - }); - colorPiker.addListener("pickcolor", function () { - me.setColor(arguments[1]); - colorPop.hide(); - }); - colorPiker.addListener("picknocolor", function () { - me.setColor(""); - colorPop.hide(); - }); - }, - - createTable:function (hasTitle, hasTitleCol, hasCaption) { - var arr = [], - sortSpan = '^'; - arr.push(""); - if (hasCaption) { - arr.push("") - } - if (hasTitle) { - arr.push(""); - if(hasTitleCol) { arr.push(""); } - for (var j = 0; j < 5; j++) { - arr.push(""); - } - arr.push(""); - } - for (var i = 0; i < 6; i++) { - arr.push(""); - if(hasTitleCol) { arr.push("") } - for (var k = 0; k < 5; k++) { - arr.push("") - } - arr.push(""); - } - arr.push("
                      " + lang.captionName + "
                      " + lang.titleName + "" + lang.titleName + "
                      " + lang.titleName + "" + lang.cellsName + "
                      "); - preview.innerHTML = arr.join(""); - this.updateSortSpan(); - }, - titleHanler:function () { - var example = $G("J_example"), - frg=document.createDocumentFragment(), - color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"), - colCount = example.rows[0].children.length; - - if (title.checked) { - example.insertRow(0); - for (var i = 0, node; i < colCount; i++) { - node = document.createElement("th"); - node.innerHTML = lang.titleName; - frg.appendChild(node); - } - example.rows[0].appendChild(frg); - - } else { - domUtils.remove(example.rows[0]); - } - me.setColor(color); - me.updateSortSpan(); - }, - titleColHanler:function () { - var example = $G("J_example"), - color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"), - colArr = example.rows, - colCount = colArr.length; - - if (titleCol.checked) { - for (var i = 0, node; i < colCount; i++) { - node = document.createElement("th"); - node.innerHTML = lang.titleName; - colArr[i].insertBefore(node, colArr[i].children[0]); - } - } else { - for (var i = 0; i < colCount; i++) { - domUtils.remove(colArr[i].children[0]); - } - } - me.setColor(color); - me.updateSortSpan(); - }, - captionHanler:function () { - var example = $G("J_example"); - if (caption.checked) { - var row = document.createElement('caption'); - row.innerHTML = lang.captionName; - example.insertBefore(row, example.firstChild); - } else { - domUtils.remove(domUtils.getElementsByTagName(example, 'caption')[0]); - } - }, - sorttableHanler:function(){ - me.updateSortSpan(); - }, - autoSizeContentHanler:function () { - var example = $G("J_example"); - example.removeAttribute("width"); - }, - autoSizePageHanler:function () { - var example = $G("J_example"); - var tds = example.getElementsByTagName(example, "td"); - utils.each(tds, function (td) { - td.removeAttribute("width"); - }); - example.setAttribute('width', '100%'); - }, - updateSortSpan: function(){ - var example = $G("J_example"), - row = example.rows[0]; - - var spans = domUtils.getElementsByTagName(example,"span"); - utils.each(spans,function(span){ - span.parentNode.removeChild(span); - }); - if (sorttable.checked) { - utils.each(row.cells, function(cell, i){ - var span = document.createElement("span"); - span.innerHTML = "^"; - cell.appendChild(span); - }); - } - }, - getColor:function () { - var start = editor.selection.getStart(), color, - cell = domUtils.findParentByTagName(start, ["td", "th", "caption"], true); - color = cell && domUtils.getComputedStyle(cell, "border-color"); - if (!color) color = "#DDDDDD"; - return color; - }, - setColor:function (color) { - var example = $G("J_example"), - arr = domUtils.getElementsByTagName(example, "td").concat( - domUtils.getElementsByTagName(example, "th"), - domUtils.getElementsByTagName(example, "caption") - ); - - tone.value = color; - utils.each(arr, function (node) { - node.style.borderColor = color; - }); - - }, - setAutoSize:function () { - var me = this; - autoSizePage.checked = true; - me.autoSizePageHanler(); - } - }; - - new editTable; - - dialog.onok = function () { - editor.__hasEnterExecCommand = true; - - var checks = { - title:"inserttitle deletetitle", - titleCol:"inserttitlecol deletetitlecol", - caption:"insertcaption deletecaption", - sorttable:"enablesort disablesort" - }; - editor.fireEvent('saveScene'); - for(var i in checks){ - var cmds = checks[i].split(" "), - input = $G("J_" + i); - if(input["checked"]){ - editor.queryCommandState(cmds[0])!=-1 &&editor.execCommand(cmds[0]); - }else{ - editor.queryCommandState(cmds[1])!=-1 &&editor.execCommand(cmds[1]); - } - } - - editor.execCommand("edittable", tone.value); - autoSizeContent.checked ?editor.execCommand('adaptbytext') : ""; - autoSizePage.checked ? editor.execCommand("adaptbywindow") : ""; - editor.fireEvent('saveScene'); - - editor.__hasEnterExecCommand = false; - }; -})(); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittd.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittd.html deleted file mode 100644 index 49a52f71952e3f396120951a9504e287a14ad2b0..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittd.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - -
                      - - -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittip.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittip.html deleted file mode 100644 index 954f7bb66f01b0d58dda32a37cc59241e0671cc3..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/table/edittip.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - 表格删除提示 - - - - -
                      -
                      - -
                      -
                      - -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/config.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/config.js deleted file mode 100644 index 20d0d4cdeac3f21540c4ab5fefb5e8a711190957..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/config.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-8-8 - * Time: 下午2:00 - * To change this template use File | Settings | File Templates. - */ -var templates = [ - { - "pre":"pre0.png", - 'title':lang.blank, - 'preHtml':'

                       欢迎使用UEditor!

                      ', - "html":'

                      欢迎使用UEditor!

                      ' - - }, - { - "pre":"pre1.png", - 'title':lang.blog, - 'preHtml':'

                      深入理解Range

                      UEditor二次开发

                      什么是Range

                      对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。


                      Range能干什么

                      在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。

                      ', - "html":'

                      [键入文档标题]

                      [键入文档副标题]

                      [标题 1]

                      对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。

                      [标题 2]

                      在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。 您还可以使用“开始”选项卡上的其他控件来直接设置文本格式。大多数控件都允许您选择是使用当前主题外观,还是使用某种直接指定的格式。

                      [标题 3]

                      对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。


                      ' - - }, - { - "pre":"pre2.png", - 'title':lang.resume, - 'preHtml':'

                      WEB前端开发简历


                      联系电话:[键入您的电话]

                      电子邮件:[键入您的电子邮件地址]

                      家庭住址:[键入您的地址]

                      目标职位

                      WEB前端研发工程师

                      学历

                      1. [起止时间] [学校名称] [所学专业] [所获学位]

                      工作经验


                      ', - "html":'

                      [此处键入简历标题]


                      【此处插入照片】


                      联系电话:[键入您的电话]


                      电子邮件:[键入您的电子邮件地址]


                      家庭住址:[键入您的地址]


                      目标职位

                      [此处键入您的期望职位]

                      学历

                      1. [键入起止时间] [键入学校名称] [键入所学专业] [键入所获学位]

                      2. [键入起止时间] [键入学校名称] [键入所学专业] [键入所获学位]

                      工作经验

                      1. [键入起止时间] [键入公司名称] [键入职位名称]

                        1. [键入负责项目] [键入项目简介]

                        2. [键入负责项目] [键入项目简介]

                      2. [键入起止时间] [键入公司名称] [键入职位名称]

                        1. [键入负责项目] [键入项目简介]

                      掌握技能

                       [这里可以键入您所掌握的技能]

                      ' - - }, - { - "pre":"pre3.png", - 'title':lang.richText, - 'preHtml':'

                      [此处键入文章标题]

                      图文混排方法

                      图片居左,文字围绕图片排版

                      方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文


                      还有没有什么其他的环绕方式呢?这里是居右环绕


                      欢迎大家多多尝试,为UEditor提供更多高质量模板!

                      ', - "html":'


                      [此处键入文章标题]

                      图文混排方法

                      1. 图片居左,文字围绕图片排版

                      方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文本


                      2. 图片居右,文字围绕图片排版

                      方法:在文字前面插入图片,设置居右对齐,然后即可在左边输入多行文本


                      3. 图片居中环绕排版

                      方法:亲,这个真心没有办法。。。



                      还有没有什么其他的环绕方式呢?这里是居右环绕


                      欢迎大家多多尝试,为UEditor提供更多高质量模板!


                      占位


                      占位


                      占位


                      占位


                      占位



                      ' - }, - { - "pre":"pre4.png", - 'title':lang.sciPapers, - 'preHtml':'

                      [键入文章标题]

                      摘要:这里可以输入很长很长很长很长很长很长很长很长很差的摘要

                      标题 1

                      这里可以输入很多内容,可以图文混排,可以有列表等。

                      标题 2

                      1. 列表 1

                      2. 列表 2

                        1. 多级列表 1

                        2. 多级列表 2

                      3. 列表 3

                      标题 3

                      来个文字图文混排的


                      ', - 'html':'

                      [键入文章标题]

                      摘要:这里可以输入很长很长很长很长很长很长很长很长很差的摘要

                      标题 1

                      这里可以输入很多内容,可以图文混排,可以有列表等。

                      标题 2

                      来个列表瞅瞅:

                      1. 列表 1

                      2. 列表 2

                        1. 多级列表 1

                        2. 多级列表 2

                      3. 列表 3

                      标题 3

                      来个文字图文混排的

                      这里可以多行

                      右边是图片

                      绝对没有问题的,不信你也可以试试看


                      ' - } -]; \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/bg.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/bg.gif deleted file mode 100644 index 8c1d10ad1933e02086e8a1b3c807c7d1e57d51db..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/bg.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre0.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre0.png deleted file mode 100644 index 8f3c16ab121c6c9b6add955fd3de78247ccfd9a6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre0.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre1.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre1.png deleted file mode 100644 index 5a03f9699886deef9aa0f52a7d252dea84baafef..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre1.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre2.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre2.png deleted file mode 100644 index 5a55672c1f9c4d41d5b5cf52d76bb2b7e7c6b186..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre2.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre3.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre3.png deleted file mode 100644 index d852d29f13bcf743e15df824901ab568123a5aae..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre3.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre4.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre4.png deleted file mode 100644 index 0d7bc72ab99fe2c0ed9de1d89fd1c3e82ac3fd43..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/images/pre4.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/template.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/template.css deleted file mode 100644 index f2bae3c26f7cf4b7c351808efc66491e3c710cfc..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/template.css +++ /dev/null @@ -1,18 +0,0 @@ -.wrap{ padding: 20px;font-size: 14px;} -.left{width:425px;float: left;} -.right{width:160px;border: 1px solid #ccc;float: right;padding: 5px;margin-right: 5px;} -.right .pre{height: 332px;overflow-y: auto;} -.right .preitem{border: white 1px solid;margin: 5px 0;padding: 2px 0;} -.right .preitem:hover{background-color: #f3f3f3;cursor: pointer;border: #ccc 1px solid;} -.right .preitem img{display: block;margin: 0 auto;width:100px;} -.clear{clear: both;} -.top{height:26px;line-height: 26px;padding: 5px;} -.bottom{height:320px;width:100%;margin: 0 auto;} -.transparent{ background: url("images/bg.gif") repeat;} -.bottom table tr td{border:1px dashed #ccc;} -#colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;} -.border_style1{padding:2px;border: 1px solid #ccc;border-radius: 5px;box-shadow:2px 2px 5px #d3d6da;} -p{margin: 5px 0} -table{clear:both;margin-bottom:10px;border-collapse:collapse;word-break:break-all;} -li{clear:both} -ol{padding-left:40px; } \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/template.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/template.html deleted file mode 100644 index d9903a480df48735fe455cf2de668a280b30d52e..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/template.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - -
                      -
                      -
                      - -
                      -
                      -
                      -
                      - -
                      -
                      -
                      -
                      - - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/template.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/template.js deleted file mode 100644 index d40e4ddf989c3be349d291bfa33c7a1bc83e043d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/template/template.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: xuheng - * Date: 12-8-8 - * Time: 下午2:09 - * To change this template use File | Settings | File Templates. - */ -(function () { - var me = editor, - preview = $G( "preview" ), - preitem = $G( "preitem" ), - tmps = templates, - currentTmp; - var initPre = function () { - var str = ""; - for ( var i = 0, tmp; tmp = tmps[i++]; ) { - str += '
                      '; - } - preitem.innerHTML = str; - }; - var pre = function ( n ) { - var tmp = tmps[n - 1]; - currentTmp = tmp; - clearItem(); - domUtils.setStyles( preitem.childNodes[n - 1], { - "background-color":"#f3f3f3", - "border":"#ccc 1px solid" - } ); - preview.innerHTML = tmp.preHtml ? tmp.preHtml : ""; - }; - var clearItem = function () { - var items = preitem.children; - for ( var i = 0, item; item = items[i++]; ) { - domUtils.setStyles( item, { - "background-color":"", - "border":"white 1px solid" - } ); - } - }; - dialog.onok = function () { - if ( !$G( "issave" ).checked ){ - me.execCommand( "cleardoc" ); - } - var obj = { - html:currentTmp && currentTmp.html - }; - me.execCommand( "template", obj ); - }; - initPre(); - window.pre = pre; - pre(2) - -})(); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/bg.png deleted file mode 100644 index 580be0a01dff4c70c72f78a3f40186660ee8eee0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/center_focus.jpg b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/center_focus.jpg deleted file mode 100644 index 858fdd72b5c9ef4169556a483627a0ec0ab63b32..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/center_focus.jpg and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/file-icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/file-icons.gif deleted file mode 100644 index d8c02c27e242f0584fc6b214f35b4f6d8caec332..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/file-icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/file-icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/file-icons.png deleted file mode 100644 index 3ff82c8c488f53a7aff67fbe39742e3321183eca..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/file-icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/icons.gif deleted file mode 100644 index 78459dea7b12ccbeec81d19ecdab22b1658e93b4..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/icons.png deleted file mode 100644 index 12e4700163ac87fa38ae3d92a2c39d0fb4690fed..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/image.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/image.png deleted file mode 100644 index 19699f6a9c6b09cb18ec0f488242d9753d2e341b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/image.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/left_focus.jpg b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/left_focus.jpg deleted file mode 100644 index e0b2834cc82184835d01a68de6caf30408b8b5fa..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/left_focus.jpg and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/none_focus.jpg b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/none_focus.jpg deleted file mode 100644 index 0e729fc59272fc2a5a5fcc8d3f09516e1bf8c14b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/none_focus.jpg and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/progress.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/progress.png deleted file mode 100644 index 717c4865c90a959c6a0e9ad1af9c777d900a2e9c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/progress.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/right_focus.jpg b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/right_focus.jpg deleted file mode 100644 index 0ce626c4babe9288c8ab5c84e4bf66fad7ee8ce2..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/right_focus.jpg and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/success.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/success.gif deleted file mode 100644 index 8d4f3112b9d1df2147ed3b67d9736163dedd11e1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/success.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/success.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/success.png deleted file mode 100644 index 94f968dc8fd3c7ca8f6cb599d006ef3f23b62c7d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/images/success.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/video.css b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/video.css deleted file mode 100644 index 550d3a15e595c5be2c27d13808d709446d2a843b..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/video.css +++ /dev/null @@ -1,644 +0,0 @@ -@charset "utf-8"; -.wrapper{ - width: 600px; - padding: 0 20px; - _width: 575px; - margin: 10px auto; - zoom: 1; - position: relative; -} -.tabbody{height: 390px;} -.tabbody .panel { - position: absolute; - width: 0; - height: 0; - background: #fff; - overflow: hidden; - display: none; -} -.tabbody .panel.focus { - width: 100%; - height: 406px; - display: block; -} - -.tabbody .panel table td{vertical-align: middle;} -#videoUrl { - width: 520px; - height: 28px; - line-height: 28px; - margin: 18px 0 18px 15px; - background: #FFF; - border: 1px solid #d7d7d7; - border-radius: 4px; -} -#videoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;} -#searchList{width: 570px;overflow: auto;zoom:1;height: 270px;} -#searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;} -#searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/ -#searchList p{margin-left: 10px;} -#videoType{ - width: 65px; - height: 23px; - line-height: 22px; - border: 1px solid #d7d7d7; -} -#videoSearchBtn,#videoSearchReset{ - /*width: 80px;*/ - height: 25px; - line-height: 25px; - background: #eee; - border: 1px solid #d7d7d7; - cursor: pointer; - padding: 0 5px; -} - - - -#preview{position: relative;width: 432px;padding:0;overflow: hidden; margin-left: 10px; height: 320px;background-color: #f3f3f3;float: left} -#preview .previewMsg {position:absolute;top:0;margin:0;padding:0;height:304px;width:100%;background-color: #ddd;padding-top: 14px} -#preview .previewMsg span{display:block;margin: 125px auto 0 auto;text-align:center;font-size:18px;color:#fff;} -#preview .previewVideo {position:absolute;top:0;margin:0;padding:0;height:320px;width:100%;} -.edui-video-wrapper fieldset{ - border: 1px solid #ddd; - padding-left: 5px; - margin-bottom: 20px; - padding-bottom: 5px; - width: 115px; -} - -#videoInfo {width: 120px;float: left;margin-left: 27px;} -fieldset{ - border: 1px solid #ddd; - padding-left: 5px; - margin-bottom: 20px; - padding-bottom: 5px; - width: 115px; -} -fieldset legend{font-weight: bold;} -fieldset p{line-height: 30px;} -fieldset input.txt{ - width: 65px; - height: 21px; - line-height: 21px; - margin: 8px 5px; - background: #FFF; - border: 1px solid #d7d7d7; -} -label.url{font-weight: bold;margin-left: 5px;color: #666;} -#videoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} -#videoFloat .focus{opacity: 1;filter: alpha(opacity = 100)} -span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue} - - - - -/* upload video */ -.tabbody #upload.panel { - width: 0; - height: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); - background: #fff; - display: block; -} -.tabbody #upload.panel.focus { - width: 100%; - height: 390px; - display: block; - clip: auto; -} -#upload_alignment div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} -#upload_alignment .focus{opacity: 1;filter: alpha(opacity = 100)} -#upload_left { width:427px; float:left; } -#upload_left .controller { height: 30px; clear: both; } -#uploadVideoInfo{margin-top:10px;float:right;padding-right:8px;} - -#upload .queueList { - margin: 0; -} - -#upload p { - margin: 0; -} - -.element-invisible { - width: 0 !important; - height: 0 !important; - border: 0; - padding: 0; - margin: 0; - overflow: hidden; - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); -} - -#upload .placeholder { - margin-top: 20px; - margin-right: 0; - height: 220px; - padding-top: 150px; - text-align: center; - width: 100%; - float: left; - /*background: url(./images/image.png) center 70px no-repeat #f3f3f3;*/ - background-color: #f3f3f3; - color: #cccccc; - font-size: 18px; - position: relative; - top:0; - *margin-left: 0; - *left: 10px; -} - -#upload .placeholder .webuploader-pick { - font-size: 16px; - background: #f3f3f3; - border-radius: 3px; - line-height: 44px; - padding: 0 30px; - color: #646464; - display: inline-block; - margin: 0 auto 20px auto; - cursor: pointer; - /* box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); */ - border: 1px solid #ccc; -} - -#upload .placeholder .webuploader-pick-hover { - border: 1px solid #00a2d4; - color: #00a2d4; -} - - -#filePickerContainer { - text-align: center; -} - -#upload .placeholder .flashTip { - color: #666666; - font-size: 12px; - position: absolute; - width: 100%; - text-align: center; - bottom: 20px; -} - -#upload .placeholder .flashTip a { - color: #0785d1; - text-decoration: none; -} - -#upload .placeholder .flashTip a:hover { - text-decoration: underline; -} - -#upload .placeholder.webuploader-dnd-over { - border-color: #999999; -} - -#upload .filelist { - list-style: none; - margin: 0; - padding: 0; - overflow-x: hidden; - overflow-y: auto; - position: relative; - height: 285px; -} - -#upload .filelist:after { - content: ''; - display: block; - width: 0; - height: 0; - overflow: hidden; - clear: both; -} - -#upload .filelist li { - width: 113px; - height: 113px; - background: url(./images/bg.png); - text-align: center; - margin: 15px 0 0 20px; - *margin: 15px 0 0 15px; - position: relative; - display: block; - float: left; - overflow: hidden; - font-size: 12px; -} - -#upload .filelist li p.log { - position: relative; - top: -45px; -} - -#upload .filelist li p.title { - position: absolute; - top: 0; - left: 0; - width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - top: 5px; - text-indent: 5px; - text-align: left; -} - -#upload .filelist li p.progress { - position: absolute; - width: 100%; - bottom: 0; - left: 0; - height: 8px; - overflow: hidden; - z-index: 50; - margin: 0; - border-radius: 0; - background: none; - -webkit-box-shadow: 0 0 0; -} - -#upload .filelist li p.progress span { - display: none; - overflow: hidden; - width: 0; - height: 100%; - background: #1483d8 url(./images/progress.png) repeat-x; - - -webit-transition: width 200ms linear; - -moz-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; - transition: width 200ms linear; - - -webkit-animation: progressmove 2s linear infinite; - -moz-animation: progressmove 2s linear infinite; - -o-animation: progressmove 2s linear infinite; - -ms-animation: progressmove 2s linear infinite; - animation: progressmove 2s linear infinite; - - -webkit-transform: translateZ(0); -} - -@-webkit-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@-moz-keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -@keyframes progressmove { - 0% { - background-position: 0 0; - } - 100% { - background-position: 17px 0; - } -} - -#upload .filelist li p.imgWrap { - position: relative; - z-index: 2; - line-height: 113px; - vertical-align: middle; - overflow: hidden; - width: 113px; - height: 113px; - - -webkit-transform-origin: 50% 50%; - -moz-transform-origin: 50% 50%; - -o-transform-origin: 50% 50%; - -ms-transform-origin: 50% 50%; - transform-origin: 50% 50%; - - -webit-transition: 200ms ease-out; - -moz-transition: 200ms ease-out; - -o-transition: 200ms ease-out; - -ms-transition: 200ms ease-out; - transition: 200ms ease-out; -} -#upload .filelist li p.imgWrap.notimage { - margin-top: 0; - width: 111px; - height: 111px; - border: 1px #eeeeee solid; -} -#upload .filelist li p.imgWrap.notimage i.file-preview { - margin-top: 15px; -} - -#upload .filelist li img { - width: 100%; -} - -#upload .filelist li p.error { - background: #f43838; - color: #fff; - position: absolute; - bottom: 0; - left: 0; - height: 28px; - line-height: 28px; - width: 100%; - z-index: 100; - display:none; -} - -#upload .filelist li .success { - display: block; - position: absolute; - left: 0; - bottom: 0; - height: 40px; - width: 100%; - z-index: 200; - background: url(./images/success.png) no-repeat right bottom; - background-image: url(./images/success.gif) \9; -} - -#upload .filelist li.filePickerBlock { - width: 113px; - height: 113px; - background: url(../fonts/images/addfile.svg) no-repeat center; - border: 1px solid #eeeeee; - border-radius: 0; -} -#upload .filelist li.filePickerBlock div.webuploader-pick { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - opacity: 0; - background: none; - font-size: 0; -} - -#upload .filelist div.file-panel { - position: absolute; - height: 0; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0; - background: rgba(0, 0, 0, 0.5); - width: 100%; - top: 0; - left: 0; - overflow: hidden; - z-index: 300; -} - -#upload .filelist div.file-panel span { - width: 24px; - height: 24px; - display: inline; - float: right; - text-indent: -9999px; - overflow: hidden; - background: url(./images/icons.png) no-repeat; - background: url(./images/icons.gif) no-repeat \9; - margin: 5px 1px 1px; - cursor: pointer; - -webkit-tap-highlight-color: rgba(0,0,0,0); - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -#upload .filelist div.file-panel span.rotateLeft { - display:none; - background-position: 0 -24px; -} - -#upload .filelist div.file-panel span.rotateLeft:hover { - background-position: 0 0; -} - -#upload .filelist div.file-panel span.rotateRight { - display:none; - background-position: -24px -24px; -} - -#upload .filelist div.file-panel span.rotateRight:hover { - background-position: -24px 0; -} - -#upload .filelist div.file-panel span.cancel { - background-position: -48px -24px; -} - -#upload .filelist div.file-panel span.cancel:hover { - background-position: -48px 0; -} - -#upload .statusBar { - height: 45px; - border-bottom: 1px solid #dadada; - margin: 0 10px; - padding: 0; - line-height: 45px; - vertical-align: middle; - position: relative; -} - -#upload .statusBar .progress { - border: 1px solid #1483d8; - width: 198px; - background: #fff; - height: 18px; - position: absolute; - top: 12px; - display: none; - text-align: center; - line-height: 18px; - color: #6dbfff; - margin: 0 10px 0 0; - border-radius: 2px; -} -#upload .statusBar .progress span.percentage { - width: 0; - height: 100%; - left: 0; - top: 0; - background: #1483d8; - position: absolute; -} -#upload .statusBar .progress span.text { - position: relative; - z-index: 10; -} - -#upload .statusBar .info { - display: inline-block; - font-size: 14px; - color: #666666; -} - -#upload .statusBar .btns { - position: absolute; - top: 7px; - right: 0; - line-height: 30px; -} - -#filePickerBtn { - display: inline-block; - float: left; -} -#upload .statusBar .btns .webuploader-pick, -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-uploading, -#upload .statusBar .btns .uploadBtn.state-paused { - background: #ffffff; - border: 1px solid #cfcfcf; - color: #565656; - padding: 0 18px; - display: inline-block; - border-radius: 3px; - margin-left: 10px; - cursor: pointer; - font-size: 14px; - float: left; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -#upload .statusBar .btns .webuploader-pick-hover, -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-uploading:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover { - background: #f0f0f0; -} - -#upload .statusBar .btns .uploadBtn, -#upload .statusBar .btns .uploadBtn.state-paused{ - background: #00b7ee; - color: #fff; - border-color: transparent; -} -#upload .statusBar .btns .uploadBtn:hover, -#upload .statusBar .btns .uploadBtn.state-paused:hover{ - background: #00a2d4; -} - -#upload .statusBar .btns .uploadBtn.disabled { - pointer-events: none; - filter:alpha(opacity=60); - -moz-opacity:0.6; - -khtml-opacity: 0.6; - opacity: 0.6; -} - - -/* 在线文件的文件预览图标 */ -i.file-preview { - display: block; - margin: 10px auto; - width: 70px; - height: 70px; - background-image: url("./images/file-icons.png"); - background-image: url("./images/file-icons.gif") \9; - background-position: -140px center; - background-repeat: no-repeat; -} -i.file-preview.file-type-dir{ - background-position: 0 center; -} -i.file-preview.file-type-file{ - background-position: -140px center; -} -i.file-preview.file-type-filelist{ - background-position: -210px center; -} -i.file-preview.file-type-zip, -i.file-preview.file-type-rar, -i.file-preview.file-type-7z, -i.file-preview.file-type-tar, -i.file-preview.file-type-gz, -i.file-preview.file-type-bz2{ - background-position: -280px center; -} -i.file-preview.file-type-xls, -i.file-preview.file-type-xlsx{ - background-position: -350px center; -} -i.file-preview.file-type-doc, -i.file-preview.file-type-docx{ - background-position: -420px center; -} -i.file-preview.file-type-ppt, -i.file-preview.file-type-pptx{ - background-position: -490px center; -} -i.file-preview.file-type-vsd{ - background-position: -560px center; -} -i.file-preview.file-type-pdf{ - background-position: -630px center; -} -i.file-preview.file-type-txt, -i.file-preview.file-type-md, -i.file-preview.file-type-json, -i.file-preview.file-type-htm, -i.file-preview.file-type-xml, -i.file-preview.file-type-html, -i.file-preview.file-type-js, -i.file-preview.file-type-css, -i.file-preview.file-type-php, -i.file-preview.file-type-jsp, -i.file-preview.file-type-asp{ - background-position: -700px center; -} -i.file-preview.file-type-apk{ - background-position: -770px center; -} -i.file-preview.file-type-exe{ - background-position: -840px center; -} -i.file-preview.file-type-ipa{ - background-position: -910px center; -} -i.file-preview.file-type-mp4, -i.file-preview.file-type-swf, -i.file-preview.file-type-mkv, -i.file-preview.file-type-avi, -i.file-preview.file-type-flv, -i.file-preview.file-type-mov, -i.file-preview.file-type-mpg, -i.file-preview.file-type-mpeg, -i.file-preview.file-type-ogv, -i.file-preview.file-type-webm, -i.file-preview.file-type-rm, -i.file-preview.file-type-rmvb{ - background-position: -980px center; -} -i.file-preview.file-type-ogg, -i.file-preview.file-type-wav, -i.file-preview.file-type-wmv, -i.file-preview.file-type-mid, -i.file-preview.file-type-mp3{ - background-position: -1050px center; -} -i.file-preview.file-type-jpg, -i.file-preview.file-type-jpeg, -i.file-preview.file-type-gif, -i.file-preview.file-type-bmp, -i.file-preview.file-type-png, -i.file-preview.file-type-psd{ - background-position: -140px center; -} \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/video.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/video.html deleted file mode 100644 index 347b42245115f2b896b044b8ae8c449448def5f0..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/video.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - -
                      -
                      -
                      - - -
                      -
                      -
                      -
                      -
                      -
                      -
                      - - - - -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      - 0% - -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                      -
                        -
                      • -
                      -
                      -
                      -
                      -
                      - - - - -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      -
                      -
                      - - - - - - - - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/video.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/video.js deleted file mode 100644 index 7772e431c7c790138019f6f7eeaf291095bf1113..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/video/video.js +++ /dev/null @@ -1,812 +0,0 @@ -/** - * Created by JetBrains PhpStorm. - * User: taoqili - * Date: 12-2-20 - * Time: 上午11:19 - * To change this template use File | Settings | File Templates. - */ - -(function(){ - - var video = {}, - uploadVideoList = [], - isModifyUploadVideo = false, - uploadFile; - - window.onload = function(){ - $focus($G("videoUrl")); - initTabs(); - initVideo(); - initUpload(); - }; - - /* 初始化tab标签 */ - function initTabs(){ - var tabs = $G('tabHeads').children; - for (var i = 0; i < tabs.length; i++) { - domUtils.on(tabs[i], "click", function (e) { - var j, bodyId, target = e.target || e.srcElement; - for (j = 0; j < tabs.length; j++) { - bodyId = tabs[j].getAttribute('data-content-id'); - if(tabs[j] == target){ - domUtils.addClass(tabs[j], 'focus'); - domUtils.addClass($G(bodyId), 'focus'); - }else { - domUtils.removeClasses(tabs[j], 'focus'); - domUtils.removeClasses($G(bodyId), 'focus'); - } - } - }); - } - } - - function initVideo(){ - createAlignButton( ["videoFloat", "upload_alignment"] ); - addUrlChangeListener($G("videoUrl")); - addOkListener(); - - //编辑视频时初始化相关信息 - (function(){ - var img = editor.selection.getRange().getClosedNode(),url; - if(img && img.className){ - var hasFakedClass = (img.className == "edui-faked-video"), - hasUploadClass = img.className.indexOf("edui-upload-video")!=-1; - if(hasFakedClass || hasUploadClass) { - $G("videoUrl").value = url = img.getAttribute("_url"); - $G("videoWidth").value = img.width; - $G("videoHeight").value = img.height; - var align = domUtils.getComputedStyle(img,"float"), - parentAlign = domUtils.getComputedStyle(img.parentNode,"text-align"); - updateAlignButton(parentAlign==="center"?"center":align); - } - if(hasUploadClass) { - isModifyUploadVideo = true; - } - } - createPreviewVideo(url); - })(); - } - - /** - * 监听确认和取消两个按钮事件,用户执行插入或者清空正在播放的视频实例操作 - */ - function addOkListener(){ - dialog.onok = function(){ - $G("preview").innerHTML = ""; - var currentTab = findFocus("tabHeads","tabSrc"); - switch(currentTab){ - case "video": - return insertSingle(); - break; - case "videoSearch": - return insertSearch("searchList"); - break; - case "upload": - return insertUpload(); - break; - } - }; - dialog.oncancel = function(){ - $G("preview").innerHTML = ""; - }; - } - - /** - * 依据传入的align值更新按钮信息 - * @param align - */ - function updateAlignButton( align ) { - var aligns = $G( "videoFloat" ).children; - for ( var i = 0, ci; ci = aligns[i++]; ) { - if ( ci.getAttribute( "name" ) == align ) { - if ( ci.className !="focus" ) { - ci.className = "focus"; - } - } else { - if ( ci.className =="focus" ) { - ci.className = ""; - } - } - } - } - - /** - * 将单个视频信息插入编辑器中 - */ - function insertSingle(){ - var width = $G("videoWidth"), - height = $G("videoHeight"), - url=$G('videoUrl').value, - align = findFocus("videoFloat","name"); - - var newurl = convert_url(url); - if (newurl.startsWith("")) { - var arr = newurl.split(" "); - for (var i=0; i>arr.length; i++) { - if (arr[i].startsWith("src")) { - newurl = arr[i].replace("src=", ""); - } - if (arr[i].startsWith("width")) { - if (!width) { - width = arr[i].replace("width=", ""); - } - } - if (arr[i].startsWith("height")) { - if (!height) { - height = arr[i].replace("height=", ""); - } - } - } - } - - if(!newurl) return false; - if ( !checkNum( [width, height] ) ) return false; - editor.execCommand('insertvideo', { - url: newurl, - width: width.value, - height: height.value, - align: align - }, isModifyUploadVideo ? 'upload':null); - } - - /** - * 将元素id下的所有代表视频的图片插入编辑器中 - * @param id - */ - function insertSearch(id){ - var imgs = domUtils.getElementsByTagName($G(id),"img"), - videoObjs=[]; - for(var i=0,img; img=imgs[i++];){ - if(img.getAttribute("selected")){ - videoObjs.push({ - url:img.getAttribute("ue_video_url"), - width:420, - height:280, - align:"none" - }); - } - } - editor.execCommand('insertvideo',videoObjs); - } - - /** - * 找到id下具有focus类的节点并返回该节点下的某个属性 - * @param id - * @param returnProperty - */ - function findFocus( id, returnProperty ) { - var tabs = $G( id ).children, - property; - for ( var i = 0, ci; ci = tabs[i++]; ) { - if ( ci.className=="focus" ) { - property = ci.getAttribute( returnProperty ); - break; - } - } - return property; - } - function convert_url(url){ - if ( !url ) return ''; - url = utils.trim(url) - .replace(/v\.youku\.com\/v_show\/id_([\w\-=]+)\.html/i, 'player.youku.com/player.php/sid/$1/v.swf') - .replace(/(www\.)?youtube\.com\/watch\?v=([\w\-]+)/i, "www.youtube.com/v/$2") - .replace(/youtu.be\/(\w+)$/i, "www.youtube.com/v/$1") - .replace(/v\.ku6\.com\/.+\/([\w\.]+)\.html.*$/i, "player.ku6.com/refer/$1/v.swf") - .replace(/www\.56\.com\/u\d+\/v_([\w\-]+)\.html/i, "player.56.com/v_$1.swf") - .replace(/www.56.com\/w\d+\/play_album\-aid\-\d+_vid\-([^.]+)\.html/i, "player.56.com/v_$1.swf") - .replace(/v\.pps\.tv\/play_([\w]+)\.html.*$/i, "player.pps.tv/player/sid/$1/v.swf") - .replace(/www\.letv\.com\/ptv\/vplay\/([\d]+)\.html.*$/i, "i7.imgs.letv.com/player/swfPlayer.swf?id=$1&autoplay=0") - .replace(/www\.tudou\.com\/programs\/view\/([\w\-]+)\/?/i, "www.tudou.com/v/$1") - .replace(/v\.qq\.com\/cover\/[\w]+\/[\w]+\/([\w]+)\.html/i, "static.video.qq.com/TPout.swf?vid=$1") - .replace(/v\.qq\.com\/.+[\?\&]vid=([^&]+).*$/i, "static.video.qq.com/TPout.swf?vid=$1") - .replace(/my\.tv\.sohu\.com\/[\w]+\/[\d]+\/([\d]+)\.shtml.*$/i, "share.vrs.sohu.com/my/v.swf&id=$1"); - return url; - } - - /** - * 检测传入的所有input框中输入的长宽是否是正数 - * @param nodes input框集合, - */ - function checkNum( nodes ) { - for ( var i = 0, ci; ci = nodes[i++]; ) { - var value = ci.value; - if ( !isNumber( value ) && value) { - alert( lang.numError ); - ci.value = ""; - ci.focus(); - return false; - } - } - return true; - } - - /** - * 数字判断 - * @param value - */ - function isNumber( value ) { - return /(0|^[1-9]\d*$)/.test( value ); - } - - /** - * 创建图片浮动选择按钮 - * @param ids - */ - function createAlignButton( ids ) { - for ( var i = 0, ci; ci = ids[i++]; ) { - var floatContainer = $G( ci ), - nameMaps = {"none":lang['default'], "left":lang.floatLeft, "right":lang.floatRight, "center":lang.block}; - for ( var j in nameMaps ) { - var div = document.createElement( "div" ); - div.setAttribute( "name", j ); - if ( j == "none" ) div.className="focus"; - div.style.cssText = "background:url(images/" + j + "_focus.jpg);"; - div.setAttribute( "title", nameMaps[j] ); - floatContainer.appendChild( div ); - } - switchSelect( ci ); - } - } - - /** - * 选择切换 - * @param selectParentId - */ - function switchSelect( selectParentId ) { - var selects = $G( selectParentId ).children; - for ( var i = 0, ci; ci = selects[i++]; ) { - domUtils.on( ci, "click", function () { - for ( var j = 0, cj; cj = selects[j++]; ) { - cj.className = ""; - cj.removeAttribute && cj.removeAttribute( "class" ); - } - this.className = "focus"; - } ) - } - } - - /** - * 监听url改变事件 - * @param url - */ - function addUrlChangeListener(url){ - if (browser.ie) { - url.onpropertychange = function () { - createPreviewVideo( this.value ); - } - } else { - url.addEventListener( "input", function () { - createPreviewVideo( this.value ); - }, false ); - } - } - - /** - * 根据url生成视频预览 - * @param url - */ - function createPreviewVideo(url){ - if ( !url ) return; - - if (url.startsWith("http") && url.indexOf(".mp4") > 0) { - $G("preview").innerHTML = '
                      '+lang.urlError+'
                      '+ - ''; - } - if (url.startsWith("")) { - $G("preview").innerHTML = '
                      '+lang.urlError+'
                      '+url; - } - } - - - /* 插入上传视频 */ - function insertUpload(){ - var videoObjs=[], - uploadDir = editor.getOpt('videoUrlPrefix'), - width = parseInt($G('upload_width').value, 10) || 420, - height = parseInt($G('upload_height').value, 10) || 280, - align = findFocus("upload_alignment","name") || 'none'; - for(var key in uploadVideoList) { - var file = uploadVideoList[key]; - videoObjs.push({ - url: uploadDir + file.url, - width:width, - height:height, - align:align - }); - } - - var count = uploadFile.getQueueCount(); - if (count) { - $('.info', '#queueList').html('' + '还有2个未上传文件'.replace(/[\d]/, count) + ''); - return false; - } else { - editor.execCommand('insertvideo', videoObjs, 'upload'); - } - } - - /*初始化上传标签*/ - function initUpload(){ - uploadFile = new UploadFile('queueList'); - } - - - /* 上传附件 */ - function UploadFile(target) { - this.$wrap = target.constructor == String ? $('#' + target) : $(target); - this.init(); - } - UploadFile.prototype = { - init: function () { - this.fileList = []; - this.initContainer(); - this.initUploader(); - }, - initContainer: function () { - this.$queue = this.$wrap.find('.filelist'); - }, - /* 初始化容器 */ - initUploader: function () { - var _this = this, - $ = jQuery, // just in case. Make sure it's not an other libaray. - $wrap = _this.$wrap, - // 图片容器 - $queue = $wrap.find('.filelist'), - // 状态栏,包括进度和控制按钮 - $statusBar = $wrap.find('.statusBar'), - // 文件总体选择信息。 - $info = $statusBar.find('.info'), - // 上传按钮 - $upload = $wrap.find('.uploadBtn'), - // 上传按钮 - $filePickerBtn = $wrap.find('.filePickerBtn'), - // 上传按钮 - $filePickerBlock = $wrap.find('.filePickerBlock'), - // 没选择文件之前的内容。 - $placeHolder = $wrap.find('.placeholder'), - // 总体进度条 - $progress = $statusBar.find('.progress').hide(), - // 添加的文件数量 - fileCount = 0, - // 添加的文件总大小 - fileSize = 0, - // 优化retina, 在retina下这个值是2 - ratio = window.devicePixelRatio || 1, - // 缩略图大小 - thumbnailWidth = 113 * ratio, - thumbnailHeight = 113 * ratio, - // 可能有pedding, ready, uploading, confirm, done. - state = '', - // 所有文件的进度信息,key为file id - percentages = {}, - supportTransition = (function () { - var s = document.createElement('p').style, - r = 'transition' in s || - 'WebkitTransition' in s || - 'MozTransition' in s || - 'msTransition' in s || - 'OTransition' in s; - s = null; - return r; - })(), - // WebUploader实例 - uploader, - actionUrl = editor.getActionUrl(editor.getOpt('videoActionName')), - fileMaxSize = editor.getOpt('videoMaxSize'), - acceptExtensions = (editor.getOpt('videoAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');; - - if (!WebUploader.Uploader.support()) { - $('#filePickerReady').after($('
                      ').html(lang.errorNotSupport)).hide(); - return; - } else if (!editor.getOpt('videoActionName')) { - $('#filePickerReady').after($('
                      ').html(lang.errorLoadConfig)).hide(); - return; - } - - uploader = _this.uploader = WebUploader.create({ - pick: { - id: '#filePickerReady', - label: lang.uploadSelectFile - }, - swf: '../../third-party/webuploader/Uploader.swf', - server: actionUrl, - fileVal: editor.getOpt('videoFieldName'), - duplicate: true, - fileSingleSizeLimit: fileMaxSize, - compress: false - }); - uploader.addButton({ - id: '#filePickerBlock' - }); - uploader.addButton({ - id: '#filePickerBtn', - label: lang.uploadAddFile - }); - - setState('pedding'); - - // 当有文件添加进来时执行,负责view的创建 - function addFile(file) { - var $li = $('
                    • ' + - '

                      ' + file.name + '

                      ' + - '

                      ' + - '

                      ' + - '
                    • '), - - $btns = $('
                      ' + - '' + lang.uploadDelete + '' + - '' + lang.uploadTurnRight + '' + - '' + lang.uploadTurnLeft + '
                      ').appendTo($li), - $prgress = $li.find('p.progress span'), - $wrap = $li.find('p.imgWrap'), - $info = $('

                      ').hide().appendTo($li), - - showError = function (code) { - switch (code) { - case 'exceed_size': - text = lang.errorExceedSize; - break; - case 'interrupt': - text = lang.errorInterrupt; - break; - case 'http': - text = lang.errorHttp; - break; - case 'not_allow_type': - text = lang.errorFileType; - break; - default: - text = lang.errorUploadRetry; - break; - } - $info.text(text).show(); - }; - - if (file.getStatus() === 'invalid') { - showError(file.statusText); - } else { - $wrap.text(lang.uploadPreview); - if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|'+file.ext.toLowerCase()+'|') == -1) { - $wrap.empty().addClass('notimage').append('' + - '' + file.name + ''); - } else { - if (browser.ie && browser.version <= 7) { - $wrap.text(lang.uploadNoPreview); - } else { - uploader.makeThumb(file, function (error, src) { - if (error || !src || (/^data:/.test(src) && browser.ie && browser.version <= 7)) { - $wrap.text(lang.uploadNoPreview); - } else { - var $img = $(''); - $wrap.empty().append($img); - $img.on('error', function () { - $wrap.text(lang.uploadNoPreview); - }); - } - }, thumbnailWidth, thumbnailHeight); - } - } - percentages[ file.id ] = [ file.size, 0 ]; - file.rotation = 0; - - /* 检查文件格式 */ - if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) { - showError('not_allow_type'); - uploader.removeFile(file); - } - } - - file.on('statuschange', function (cur, prev) { - if (prev === 'progress') { - $prgress.hide().width(0); - } else if (prev === 'queued') { - $li.off('mouseenter mouseleave'); - $btns.remove(); - } - // 成功 - if (cur === 'error' || cur === 'invalid') { - showError(file.statusText); - percentages[ file.id ][ 1 ] = 1; - } else if (cur === 'interrupt') { - showError('interrupt'); - } else if (cur === 'queued') { - percentages[ file.id ][ 1 ] = 0; - } else if (cur === 'progress') { - $info.hide(); - $prgress.css('display', 'block'); - } else if (cur === 'complete') { - } - - $li.removeClass('state-' + prev).addClass('state-' + cur); - }); - - $li.on('mouseenter', function () { - $btns.stop().animate({height: 30}); - }); - $li.on('mouseleave', function () { - $btns.stop().animate({height: 0}); - }); - - $btns.on('click', 'span', function () { - var index = $(this).index(), - deg; - - switch (index) { - case 0: - uploader.removeFile(file); - return; - case 1: - file.rotation += 90; - break; - case 2: - file.rotation -= 90; - break; - } - - if (supportTransition) { - deg = 'rotate(' + file.rotation + 'deg)'; - $wrap.css({ - '-webkit-transform': deg, - '-mos-transform': deg, - '-o-transform': deg, - 'transform': deg - }); - } else { - $wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')'); - } - - }); - - $li.insertBefore($filePickerBlock); - } - - // 负责view的销毁 - function removeFile(file) { - var $li = $('#' + file.id); - delete percentages[ file.id ]; - updateTotalProgress(); - $li.off().find('.file-panel').off().end().remove(); - } - - function updateTotalProgress() { - var loaded = 0, - total = 0, - spans = $progress.children(), - percent; - - $.each(percentages, function (k, v) { - total += v[ 0 ]; - loaded += v[ 0 ] * v[ 1 ]; - }); - - percent = total ? loaded / total : 0; - - spans.eq(0).text(Math.round(percent * 100) + '%'); - spans.eq(1).css('width', Math.round(percent * 100) + '%'); - updateStatus(); - } - - function setState(val, files) { - - if (val != state) { - - var stats = uploader.getStats(); - - $upload.removeClass('state-' + state); - $upload.addClass('state-' + val); - - switch (val) { - - /* 未选择文件 */ - case 'pedding': - $queue.addClass('element-invisible'); - $statusBar.addClass('element-invisible'); - $placeHolder.removeClass('element-invisible'); - $progress.hide(); $info.hide(); - uploader.refresh(); - break; - - /* 可以开始上传 */ - case 'ready': - $placeHolder.addClass('element-invisible'); - $queue.removeClass('element-invisible'); - $statusBar.removeClass('element-invisible'); - $progress.hide(); $info.show(); - $upload.text(lang.uploadStart); - uploader.refresh(); - break; - - /* 上传中 */ - case 'uploading': - $progress.show(); $info.hide(); - $upload.text(lang.uploadPause); - break; - - /* 暂停上传 */ - case 'paused': - $progress.show(); $info.hide(); - $upload.text(lang.uploadContinue); - break; - - case 'confirm': - $progress.show(); $info.hide(); - $upload.text(lang.uploadStart); - - stats = uploader.getStats(); - if (stats.successNum && !stats.uploadFailNum) { - setState('finish'); - return; - } - break; - - case 'finish': - $progress.hide(); $info.show(); - if (stats.uploadFailNum) { - $upload.text(lang.uploadRetry); - } else { - $upload.text(lang.uploadStart); - } - break; - } - - state = val; - updateStatus(); - - } - - if (!_this.getQueueCount()) { - $upload.addClass('disabled') - } else { - $upload.removeClass('disabled') - } - - } - - function updateStatus() { - var text = '', stats; - - if (state === 'ready') { - text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)); - } else if (state === 'confirm') { - stats = uploader.getStats(); - if (stats.uploadFailNum) { - text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum); - } - } else { - stats = uploader.getStats(); - text = lang.updateStatusFinish.replace('_', fileCount). - replace('_KB', WebUploader.formatSize(fileSize)). - replace('_', stats.successNum); - - if (stats.uploadFailNum) { - text += lang.updateStatusError.replace('_', stats.uploadFailNum); - } - } - - $info.html(text); - } - - uploader.on('fileQueued', function (file) { - fileCount++; - fileSize += file.size; - - if (fileCount === 1) { - $placeHolder.addClass('element-invisible'); - $statusBar.show(); - } - - addFile(file); - }); - - uploader.on('fileDequeued', function (file) { - fileCount--; - fileSize -= file.size; - - removeFile(file); - updateTotalProgress(); - }); - - uploader.on('filesQueued', function (file) { - if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) { - setState('ready'); - } - updateTotalProgress(); - }); - - uploader.on('all', function (type, files) { - switch (type) { - case 'uploadFinished': - setState('confirm', files); - break; - case 'startUpload': - /* 添加额外的GET参数 */ - var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '', - url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + 'encode=utf-8&' + params); - uploader.option('server', url); - setState('uploading', files); - break; - case 'stopUpload': - setState('paused', files); - break; - } - }); - - uploader.on('uploadBeforeSend', function (file, data, header) { - //这里可以通过data对象添加POST参数 - header['X_Requested_With'] = 'XMLHttpRequest'; - }); - - uploader.on('uploadProgress', function (file, percentage) { - var $li = $('#' + file.id), - $percent = $li.find('.progress span'); - - $percent.css('width', percentage * 100 + '%'); - percentages[ file.id ][ 1 ] = percentage; - updateTotalProgress(); - }); - - uploader.on('uploadSuccess', function (file, ret) { - var $file = $('#' + file.id); - try { - var responseText = (ret._raw || ret), - json = utils.str2json(responseText); - if (json.state == 'SUCCESS') { - uploadVideoList.push({ - 'url': json.url, - 'type': json.type, - 'original':json.original - }); - $file.append(''); - } else { - $file.find('.error').text(json.state).show(); - } - } catch (e) { - $file.find('.error').text(lang.errorServerUpload).show(); - } - }); - - uploader.on('uploadError', function (file, code) { - }); - uploader.on('error', function (code, file) { - if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { - addFile(file); - } - }); - uploader.on('uploadComplete', function (file, ret) { - }); - - $upload.on('click', function () { - if ($(this).hasClass('disabled')) { - return false; - } - - if (state === 'ready') { - uploader.upload(); - } else if (state === 'paused') { - uploader.upload(); - } else if (state === 'uploading') { - uploader.stop(); - } - }); - - $upload.addClass('state-' + state); - updateTotalProgress(); - }, - getQueueCount: function () { - var file, i, status, readyFile = 0, files = this.uploader.getFiles(); - for (i = 0; file = files[i++]; ) { - status = file.getStatus(); - if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; - } - return readyFile; - }, - refresh: function(){ - this.uploader.refresh(); - } - }; - -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/webapp/webapp.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/webapp/webapp.html deleted file mode 100644 index 161437790f5433da8dc3c085a7fbdc121410e873..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/webapp/webapp.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/fClipboard_ueditor.swf b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/fClipboard_ueditor.swf deleted file mode 100644 index ac5d27f81d2111c8581a042564c5275edd751e1c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/fClipboard_ueditor.swf and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/imageUploader.swf b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/imageUploader.swf deleted file mode 100644 index 2a554cadbd136ff622b612dbcf0460fb9a980f40..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/imageUploader.swf and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/tangram.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/tangram.js deleted file mode 100644 index 2ebd8fd3dc82629ecd4bbece4d5c83da6a86bf0f..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/tangram.js +++ /dev/null @@ -1,1495 +0,0 @@ -// Copyright (c) 2009, Baidu Inc. All rights reserved. -// -// Licensed under the BSD License -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http:// tangram.baidu.com/license.html -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS-IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - /** - * @namespace T Tangram七巧板 - * @name T - * @version 1.6.0 -*/ - -/** - * 声明baidu包 - * @author: allstar, erik, meizz, berg - */ -var T, - baidu = T = baidu || {version: "1.5.0"}; -baidu.guid = "$BAIDU$"; -baidu.$$ = window[baidu.guid] = window[baidu.guid] || {global:{}}; - -/** - * 使用flash资源封装的一些功能 - * @namespace baidu.flash - */ -baidu.flash = baidu.flash || {}; - -/** - * 操作dom的方法 - * @namespace baidu.dom - */ -baidu.dom = baidu.dom || {}; - - -/** - * 从文档中获取指定的DOM元素 - * @name baidu.dom.g - * @function - * @grammar baidu.dom.g(id) - * @param {string|HTMLElement} id 元素的id或DOM元素. - * @shortcut g,T.G - * @meta standard - * @see baidu.dom.q - * - * @return {HTMLElement|null} 获取的元素,查找不到时返回null,如果参数不合法,直接返回参数. - */ -baidu.dom.g = function(id) { - if (!id) return null; - if ('string' == typeof id || id instanceof String) { - return document.getElementById(id); - } else if (id.nodeName && (id.nodeType == 1 || id.nodeType == 9)) { - return id; - } - return null; -}; -baidu.g = baidu.G = baidu.dom.g; - - -/** - * 操作数组的方法 - * @namespace baidu.array - */ - -baidu.array = baidu.array || {}; - - -/** - * 遍历数组中所有元素 - * @name baidu.array.each - * @function - * @grammar baidu.array.each(source, iterator[, thisObject]) - * @param {Array} source 需要遍历的数组 - * @param {Function} iterator 对每个数组元素进行调用的函数,该函数有两个参数,第一个为数组元素,第二个为数组索引值,function (item, index)。 - * @param {Object} [thisObject] 函数调用时的this指针,如果没有此参数,默认是当前遍历的数组 - * @remark - * each方法不支持对Object的遍历,对Object的遍历使用baidu.object.each 。 - * @shortcut each - * @meta standard - * - * @returns {Array} 遍历的数组 - */ - -baidu.each = baidu.array.forEach = baidu.array.each = function (source, iterator, thisObject) { - var returnValue, item, i, len = source.length; - - if ('function' == typeof iterator) { - for (i = 0; i < len; i++) { - item = source[i]; - returnValue = iterator.call(thisObject || source, item, i); - - if (returnValue === false) { - break; - } - } - } - return source; -}; - -/** - * 对语言层面的封装,包括类型判断、模块扩展、继承基类以及对象自定义事件的支持。 - * @namespace baidu.lang - */ -baidu.lang = baidu.lang || {}; - - -/** - * 判断目标参数是否为function或Function实例 - * @name baidu.lang.isFunction - * @function - * @grammar baidu.lang.isFunction(source) - * @param {Any} source 目标参数 - * @version 1.2 - * @see baidu.lang.isString,baidu.lang.isObject,baidu.lang.isNumber,baidu.lang.isArray,baidu.lang.isElement,baidu.lang.isBoolean,baidu.lang.isDate - * @meta standard - * @returns {boolean} 类型判断结果 - */ -baidu.lang.isFunction = function (source) { - return '[object Function]' == Object.prototype.toString.call(source); -}; - -/** - * 判断目标参数是否string类型或String对象 - * @name baidu.lang.isString - * @function - * @grammar baidu.lang.isString(source) - * @param {Any} source 目标参数 - * @shortcut isString - * @meta standard - * @see baidu.lang.isObject,baidu.lang.isNumber,baidu.lang.isArray,baidu.lang.isElement,baidu.lang.isBoolean,baidu.lang.isDate - * - * @returns {boolean} 类型判断结果 - */ -baidu.lang.isString = function (source) { - return '[object String]' == Object.prototype.toString.call(source); -}; -baidu.isString = baidu.lang.isString; - - -/** - * 判断浏览器类型和特性的属性 - * @namespace baidu.browser - */ -baidu.browser = baidu.browser || {}; - - -/** - * 判断是否为opera浏览器 - * @property opera opera版本号 - * @grammar baidu.browser.opera - * @meta standard - * @see baidu.browser.ie,baidu.browser.firefox,baidu.browser.safari,baidu.browser.chrome - * @returns {Number} opera版本号 - */ - -/** - * opera 从10开始不是用opera后面的字符串进行版本的判断 - * 在Browser identification最后添加Version + 数字进行版本标识 - * opera后面的数字保持在9.80不变 - */ -baidu.browser.opera = /opera(\/| )(\d+(\.\d+)?)(.+?(version\/(\d+(\.\d+)?)))?/i.test(navigator.userAgent) ? + ( RegExp["\x246"] || RegExp["\x242"] ) : undefined; - - -/** - * 在目标元素的指定位置插入HTML代码 - * @name baidu.dom.insertHTML - * @function - * @grammar baidu.dom.insertHTML(element, position, html) - * @param {HTMLElement|string} element 目标元素或目标元素的id - * @param {string} position 插入html的位置信息,取值为beforeBegin,afterBegin,beforeEnd,afterEnd - * @param {string} html 要插入的html - * @remark - * - * 对于position参数,大小写不敏感
                      - * 参数的意思:beforeBegin<span>afterBegin this is span! beforeEnd</span> afterEnd
                      - * 此外,如果使用本函数插入带有script标签的HTML字符串,script标签对应的脚本将不会被执行。 - * - * @shortcut insertHTML - * @meta standard - * - * @returns {HTMLElement} 目标元素 - */ -baidu.dom.insertHTML = function (element, position, html) { - element = baidu.dom.g(element); - var range,begin; - if (element.insertAdjacentHTML && !baidu.browser.opera) { - element.insertAdjacentHTML(position, html); - } else { - range = element.ownerDocument.createRange(); - position = position.toUpperCase(); - if (position == 'AFTERBEGIN' || position == 'BEFOREEND') { - range.selectNodeContents(element); - range.collapse(position == 'AFTERBEGIN'); - } else { - begin = position == 'BEFOREBEGIN'; - range[begin ? 'setStartBefore' : 'setEndAfter'](element); - range.collapse(begin); - } - range.insertNode(range.createContextualFragment(html)); - } - return element; -}; - -baidu.insertHTML = baidu.dom.insertHTML; - -/** - * 操作flash对象的方法,包括创建flash对象、获取flash对象以及判断flash插件的版本号 - * @namespace baidu.swf - */ -baidu.swf = baidu.swf || {}; - - -/** - * 浏览器支持的flash插件版本 - * @property version 浏览器支持的flash插件版本 - * @grammar baidu.swf.version - * @return {String} 版本号 - * @meta standard - */ -baidu.swf.version = (function () { - var n = navigator; - if (n.plugins && n.mimeTypes.length) { - var plugin = n.plugins["Shockwave Flash"]; - if (plugin && plugin.description) { - return plugin.description - .replace(/([a-zA-Z]|\s)+/, "") - .replace(/(\s)+r/, ".") + ".0"; - } - } else if (window.ActiveXObject && !window.opera) { - for (var i = 12; i >= 2; i--) { - try { - var c = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.' + i); - if (c) { - var version = c.GetVariable("$version"); - return version.replace(/WIN/g,'').replace(/,/g,'.'); - } - } catch(e) {} - } - } -})(); - -/** - * 操作字符串的方法 - * @namespace baidu.string - */ -baidu.string = baidu.string || {}; - - -/** - * 对目标字符串进行html编码 - * @name baidu.string.encodeHTML - * @function - * @grammar baidu.string.encodeHTML(source) - * @param {string} source 目标字符串 - * @remark - * 编码字符有5个:&<>"' - * @shortcut encodeHTML - * @meta standard - * @see baidu.string.decodeHTML - * - * @returns {string} html编码后的字符串 - */ -baidu.string.encodeHTML = function (source) { - return String(source) - .replace(/&/g,'&') - .replace(//g,'>') - .replace(/"/g, """) - .replace(/'/g, "'"); -}; - -baidu.encodeHTML = baidu.string.encodeHTML; - -/** - * 创建flash对象的html字符串 - * @name baidu.swf.createHTML - * @function - * @grammar baidu.swf.createHTML(options) - * - * @param {Object} options 创建flash的选项参数 - * @param {string} options.id 要创建的flash的标识 - * @param {string} options.url flash文件的url - * @param {String} options.errorMessage 未安装flash player或flash player版本号过低时的提示 - * @param {string} options.ver 最低需要的flash player版本号 - * @param {string} options.width flash的宽度 - * @param {string} options.height flash的高度 - * @param {string} options.align flash的对齐方式,允许值:middle/left/right/top/bottom - * @param {string} options.base 设置用于解析swf文件中的所有相对路径语句的基本目录或URL - * @param {string} options.bgcolor swf文件的背景色 - * @param {string} options.salign 设置缩放的swf文件在由width和height设置定义的区域内的位置。允许值:l/r/t/b/tl/tr/bl/br - * @param {boolean} options.menu 是否显示右键菜单,允许值:true/false - * @param {boolean} options.loop 播放到最后一帧时是否重新播放,允许值: true/false - * @param {boolean} options.play flash是否在浏览器加载时就开始播放。允许值:true/false - * @param {string} options.quality 设置flash播放的画质,允许值:low/medium/high/autolow/autohigh/best - * @param {string} options.scale 设置flash内容如何缩放来适应设置的宽高。允许值:showall/noborder/exactfit - * @param {string} options.wmode 设置flash的显示模式。允许值:window/opaque/transparent - * @param {string} options.allowscriptaccess 设置flash与页面的通信权限。允许值:always/never/sameDomain - * @param {string} options.allownetworking 设置swf文件中允许使用的网络API。允许值:all/internal/none - * @param {boolean} options.allowfullscreen 是否允许flash全屏。允许值:true/false - * @param {boolean} options.seamlesstabbing 允许设置执行无缝跳格,从而使用户能跳出flash应用程序。该参数只能在安装Flash7及更高版本的Windows中使用。允许值:true/false - * @param {boolean} options.devicefont 设置静态文本对象是否以设备字体呈现。允许值:true/false - * @param {boolean} options.swliveconnect 第一次加载flash时浏览器是否应启动Java。允许值:true/false - * @param {Object} options.vars 要传递给flash的参数,支持JSON或string类型。 - * - * @see baidu.swf.create - * @meta standard - * @returns {string} flash对象的html字符串 - */ -baidu.swf.createHTML = function (options) { - options = options || {}; - var version = baidu.swf.version, - needVersion = options['ver'] || '6.0.0', - vUnit1, vUnit2, i, k, len, item, tmpOpt = {}, - encodeHTML = baidu.string.encodeHTML; - for (k in options) { - tmpOpt[k] = options[k]; - } - options = tmpOpt; - if (version) { - version = version.split('.'); - needVersion = needVersion.split('.'); - for (i = 0; i < 3; i++) { - vUnit1 = parseInt(version[i], 10); - vUnit2 = parseInt(needVersion[i], 10); - if (vUnit2 < vUnit1) { - break; - } else if (vUnit2 > vUnit1) { - return ''; - } - } - } else { - return ''; - } - - var vars = options['vars'], - objProperties = ['classid', 'codebase', 'id', 'width', 'height', 'align']; - options['align'] = options['align'] || 'middle'; - options['classid'] = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'; - options['codebase'] = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'; - options['movie'] = options['url'] || ''; - delete options['vars']; - delete options['url']; - if ('string' == typeof vars) { - options['flashvars'] = vars; - } else { - var fvars = []; - for (k in vars) { - item = vars[k]; - fvars.push(k + "=" + encodeURIComponent(item)); - } - options['flashvars'] = fvars.join('&'); - } - var str = [''); - var params = { - 'wmode' : 1, - 'scale' : 1, - 'quality' : 1, - 'play' : 1, - 'loop' : 1, - 'menu' : 1, - 'salign' : 1, - 'bgcolor' : 1, - 'base' : 1, - 'allowscriptaccess' : 1, - 'allownetworking' : 1, - 'allowfullscreen' : 1, - 'seamlesstabbing' : 1, - 'devicefont' : 1, - 'swliveconnect' : 1, - 'flashvars' : 1, - 'movie' : 1 - }; - - for (k in options) { - item = options[k]; - k = k.toLowerCase(); - if (params[k] && (item || item === false || item === 0)) { - str.push(''); - } - } - options['src'] = options['movie']; - options['name'] = options['id']; - delete options['id']; - delete options['movie']; - delete options['classid']; - delete options['codebase']; - options['type'] = 'application/x-shockwave-flash'; - options['pluginspage'] = 'http://www.macromedia.com/go/getflashplayer'; - str.push(''); - - return str.join(''); -}; - - -/** - * 在页面中创建一个flash对象 - * @name baidu.swf.create - * @function - * @grammar baidu.swf.create(options[, container]) - * - * @param {Object} options 创建flash的选项参数 - * @param {string} options.id 要创建的flash的标识 - * @param {string} options.url flash文件的url - * @param {String} options.errorMessage 未安装flash player或flash player版本号过低时的提示 - * @param {string} options.ver 最低需要的flash player版本号 - * @param {string} options.width flash的宽度 - * @param {string} options.height flash的高度 - * @param {string} options.align flash的对齐方式,允许值:middle/left/right/top/bottom - * @param {string} options.base 设置用于解析swf文件中的所有相对路径语句的基本目录或URL - * @param {string} options.bgcolor swf文件的背景色 - * @param {string} options.salign 设置缩放的swf文件在由width和height设置定义的区域内的位置。允许值:l/r/t/b/tl/tr/bl/br - * @param {boolean} options.menu 是否显示右键菜单,允许值:true/false - * @param {boolean} options.loop 播放到最后一帧时是否重新播放,允许值: true/false - * @param {boolean} options.play flash是否在浏览器加载时就开始播放。允许值:true/false - * @param {string} options.quality 设置flash播放的画质,允许值:low/medium/high/autolow/autohigh/best - * @param {string} options.scale 设置flash内容如何缩放来适应设置的宽高。允许值:showall/noborder/exactfit - * @param {string} options.wmode 设置flash的显示模式。允许值:window/opaque/transparent - * @param {string} options.allowscriptaccess 设置flash与页面的通信权限。允许值:always/never/sameDomain - * @param {string} options.allownetworking 设置swf文件中允许使用的网络API。允许值:all/internal/none - * @param {boolean} options.allowfullscreen 是否允许flash全屏。允许值:true/false - * @param {boolean} options.seamlesstabbing 允许设置执行无缝跳格,从而使用户能跳出flash应用程序。该参数只能在安装Flash7及更高版本的Windows中使用。允许值:true/false - * @param {boolean} options.devicefont 设置静态文本对象是否以设备字体呈现。允许值:true/false - * @param {boolean} options.swliveconnect 第一次加载flash时浏览器是否应启动Java。允许值:true/false - * @param {Object} options.vars 要传递给flash的参数,支持JSON或string类型。 - * - * @param {HTMLElement|string} [container] flash对象的父容器元素,不传递该参数时在当前代码位置创建flash对象。 - * @meta standard - * @see baidu.swf.createHTML,baidu.swf.getMovie - */ -baidu.swf.create = function (options, target) { - options = options || {}; - var html = baidu.swf.createHTML(options) - || options['errorMessage'] - || ''; - - if (target && 'string' == typeof target) { - target = document.getElementById(target); - } - baidu.dom.insertHTML( target || document.body ,'beforeEnd',html ); -}; -/** - * 判断是否为ie浏览器 - * @name baidu.browser.ie - * @field - * @grammar baidu.browser.ie - * @returns {Number} IE版本号 - */ -baidu.browser.ie = baidu.ie = /msie (\d+\.\d+)/i.test(navigator.userAgent) ? (document.documentMode || + RegExp['\x241']) : undefined; - -/** - * 移除数组中的项 - * @name baidu.array.remove - * @function - * @grammar baidu.array.remove(source, match) - * @param {Array} source 需要移除项的数组 - * @param {Any} match 要移除的项 - * @meta standard - * @see baidu.array.removeAt - * - * @returns {Array} 移除后的数组 - */ -baidu.array.remove = function (source, match) { - var len = source.length; - - while (len--) { - if (len in source && source[len] === match) { - source.splice(len, 1); - } - } - return source; -}; - -/** - * 判断目标参数是否Array对象 - * @name baidu.lang.isArray - * @function - * @grammar baidu.lang.isArray(source) - * @param {Any} source 目标参数 - * @meta standard - * @see baidu.lang.isString,baidu.lang.isObject,baidu.lang.isNumber,baidu.lang.isElement,baidu.lang.isBoolean,baidu.lang.isDate - * - * @returns {boolean} 类型判断结果 - */ -baidu.lang.isArray = function (source) { - return '[object Array]' == Object.prototype.toString.call(source); -}; - - - -/** - * 将一个变量转换成array - * @name baidu.lang.toArray - * @function - * @grammar baidu.lang.toArray(source) - * @param {mix} source 需要转换成array的变量 - * @version 1.3 - * @meta standard - * @returns {array} 转换后的array - */ -baidu.lang.toArray = function (source) { - if (source === null || source === undefined) - return []; - if (baidu.lang.isArray(source)) - return source; - if (typeof source.length !== 'number' || typeof source === 'string' || baidu.lang.isFunction(source)) { - return [source]; - } - if (source.item) { - var l = source.length, array = new Array(l); - while (l--) - array[l] = source[l]; - return array; - } - - return [].slice.call(source); -}; - -/** - * 获得flash对象的实例 - * @name baidu.swf.getMovie - * @function - * @grammar baidu.swf.getMovie(name) - * @param {string} name flash对象的名称 - * @see baidu.swf.create - * @meta standard - * @returns {HTMLElement} flash对象的实例 - */ -baidu.swf.getMovie = function (name) { - var movie = document[name], ret; - return baidu.browser.ie == 9 ? - movie && movie.length ? - (ret = baidu.array.remove(baidu.lang.toArray(movie),function(item){ - return item.tagName.toLowerCase() != "embed"; - })).length == 1 ? ret[0] : ret - : movie - : movie || window[name]; -}; - - -baidu.flash._Base = (function(){ - - var prefix = 'bd__flash__'; - - /** - * 创建一个随机的字符串 - * @private - * @return {String} - */ - function _createString(){ - return prefix + Math.floor(Math.random() * 2147483648).toString(36); - }; - - /** - * 检查flash状态 - * @private - * @param {Object} target flash对象 - * @return {Boolean} - */ - function _checkReady(target){ - if(typeof target !== 'undefined' && typeof target.flashInit !== 'undefined' && target.flashInit()){ - return true; - }else{ - return false; - } - }; - - /** - * 调用之前进行压栈的函数 - * @private - * @param {Array} callQueue 调用队列 - * @param {Object} target flash对象 - * @return {Null} - */ - function _callFn(callQueue, target){ - var result = null; - - callQueue = callQueue.reverse(); - baidu.each(callQueue, function(item){ - result = target.call(item.fnName, item.params); - item.callBack(result); - }); - }; - - /** - * 为传入的匿名函数创建函数名 - * @private - * @param {String|Function} fun 传入的匿名函数或者函数名 - * @return {String} - */ - function _createFunName(fun){ - var name = ''; - - if(baidu.lang.isFunction(fun)){ - name = _createString(); - window[name] = function(){ - fun.apply(window, arguments); - }; - - return name; - }else if(baidu.lang.isString){ - return fun; - } - }; - - /** - * 绘制flash - * @private - * @param {Object} options 创建参数 - * @return {Object} - */ - function _render(options){ - if(!options.id){ - options.id = _createString(); - } - - var container = options.container || ''; - delete(options.container); - - baidu.swf.create(options, container); - - return baidu.swf.getMovie(options.id); - }; - - return function(options, callBack){ - var me = this, - autoRender = (typeof options.autoRender !== 'undefined' ? options.autoRender : true), - createOptions = options.createOptions || {}, - target = null, - isReady = false, - callQueue = [], - timeHandle = null, - callBack = callBack || []; - - /** - * 将flash文件绘制到页面上 - * @public - * @return {Null} - */ - me.render = function(){ - target = _render(createOptions); - - if(callBack.length > 0){ - baidu.each(callBack, function(funName, index){ - callBack[index] = _createFunName(options[funName] || new Function()); - }); - } - me.call('setJSFuncName', [callBack]); - }; - - /** - * 返回flash状态 - * @return {Boolean} - */ - me.isReady = function(){ - return isReady; - }; - - /** - * 调用flash接口的统一入口 - * @param {String} fnName 调用的函数名 - * @param {Array} params 传入的参数组成的数组,若不许要参数,需传入空数组 - * @param {Function} [callBack] 异步调用后将返回值作为参数的调用回调函数,如无返回值,可以不传入此参数 - * @return {Null} - */ - me.call = function(fnName, params, callBack){ - if(!fnName) return null; - callBack = callBack || new Function(); - - var result = null; - - if(isReady){ - result = target.call(fnName, params); - callBack(result); - }else{ - callQueue.push({ - fnName: fnName, - params: params, - callBack: callBack - }); - - (!timeHandle) && (timeHandle = setInterval(_check, 200)); - } - }; - - /** - * 为传入的匿名函数创建函数名 - * @public - * @param {String|Function} fun 传入的匿名函数或者函数名 - * @return {String} - */ - me.createFunName = function(fun){ - return _createFunName(fun); - }; - - /** - * 检查flash是否ready, 并进行调用 - * @private - * @return {Null} - */ - function _check(){ - if(_checkReady(target)){ - clearInterval(timeHandle); - timeHandle = null; - _call(); - - isReady = true; - } - }; - - /** - * 调用之前进行压栈的函数 - * @private - * @return {Null} - */ - function _call(){ - _callFn(callQueue, target); - callQueue = []; - } - - autoRender && me.render(); - }; -})(); - - - -/** - * 创建flash based imageUploader - * @class - * @grammar baidu.flash.imageUploader(options) - * @param {Object} createOptions 创建flash时需要的参数,请参照baidu.swf.create文档 - * @config {Object} vars 创建imageUploader时所需要的参数 - * @config {Number} vars.gridWidth 每一个预览图片所占的宽度,应该为flash寛的整除 - * @config {Number} vars.gridHeight 每一个预览图片所占的高度,应该为flash高的整除 - * @config {Number} vars.picWidth 单张预览图片的宽度 - * @config {Number} vars.picHeight 单张预览图片的高度 - * @config {String} vars.uploadDataFieldName POST请求中图片数据的key,默认值'picdata' - * @config {String} vars.picDescFieldName POST请求中图片描述的key,默认值'picDesc' - * @config {Number} vars.maxSize 文件的最大体积,单位'MB' - * @config {Number} vars.compressSize 上传前如果图片体积超过该值,会先压缩 - * @config {Number} vars.maxNum:32 最大上传多少个文件 - * @config {Number} vars.compressLength 能接受的最大边长,超过该值会等比压缩 - * @config {String} vars.url 上传的url地址 - * @config {Number} vars.mode mode == 0时,是使用滚动条,mode == 1时,拉伸flash, 默认值为0 - * @see baidu.swf.createHTML - * @param {String} backgroundUrl 背景图片路径 - * @param {String} listBacgroundkUrl 布局控件背景 - * @param {String} buttonUrl 按钮图片不背景 - * @param {String|Function} selectFileCallback 选择文件的回调 - * @param {String|Function} exceedFileCallback文件超出限制的最大体积时的回调 - * @param {String|Function} deleteFileCallback 删除文件的回调 - * @param {String|Function} startUploadCallback 开始上传某个文件时的回调 - * @param {String|Function} uploadCompleteCallback 某个文件上传完成的回调 - * @param {String|Function} uploadErrorCallback 某个文件上传失败的回调 - * @param {String|Function} allCompleteCallback 全部上传完成时的回调 - * @param {String|Function} changeFlashHeight 改变Flash的高度,mode==1的时候才有用 - */ -baidu.flash.imageUploader = baidu.flash.imageUploader || function(options){ - - var me = this, - options = options || {}, - _flash = new baidu.flash._Base(options, [ - 'selectFileCallback', - 'exceedFileCallback', - 'deleteFileCallback', - 'startUploadCallback', - 'uploadCompleteCallback', - 'uploadErrorCallback', - 'allCompleteCallback', - 'changeFlashHeight' - ]); - /** - * 开始或回复上传图片 - * @public - * @return {Null} - */ - me.upload = function(){ - _flash.call('upload'); - }; - - /** - * 暂停上传图片 - * @public - * @return {Null} - */ - me.pause = function(){ - _flash.call('pause'); - }; - me.addCustomizedParams = function(index,obj){ - _flash.call('addCustomizedParams',[index,obj]); - } -}; - -/** - * 操作原生对象的方法 - * @namespace baidu.object - */ -baidu.object = baidu.object || {}; - - -/** - * 将源对象的所有属性拷贝到目标对象中 - * @author erik - * @name baidu.object.extend - * @function - * @grammar baidu.object.extend(target, source) - * @param {Object} target 目标对象 - * @param {Object} source 源对象 - * @see baidu.array.merge - * @remark - * -1.目标对象中,与源对象key相同的成员将会被覆盖。
                      -2.源对象的prototype成员不会拷贝。 - - * @shortcut extend - * @meta standard - * - * @returns {Object} 目标对象 - */ -baidu.extend = -baidu.object.extend = function (target, source) { - for (var p in source) { - if (source.hasOwnProperty(p)) { - target[p] = source[p]; - } - } - - return target; -}; - - - - - -/** - * 创建flash based fileUploader - * @class - * @grammar baidu.flash.fileUploader(options) - * @param {Object} options - * @config {Object} createOptions 创建flash时需要的参数,请参照baidu.swf.create文档 - * @config {String} createOptions.width - * @config {String} createOptions.height - * @config {Number} maxNum 最大可选文件数 - * @config {Function|String} selectFile - * @config {Function|String} exceedMaxSize - * @config {Function|String} deleteFile - * @config {Function|String} uploadStart - * @config {Function|String} uploadComplete - * @config {Function|String} uploadError - * @config {Function|String} uploadProgress - */ -baidu.flash.fileUploader = baidu.flash.fileUploader || function(options){ - var me = this, - options = options || {}; - - options.createOptions = baidu.extend({ - wmod: 'transparent' - },options.createOptions || {}); - - var _flash = new baidu.flash._Base(options, [ - 'selectFile', - 'exceedMaxSize', - 'deleteFile', - 'uploadStart', - 'uploadComplete', - 'uploadError', - 'uploadProgress' - ]); - - _flash.call('setMaxNum', options.maxNum ? [options.maxNum] : [1]); - - /** - * 设置当鼠标移动到flash上时,是否变成手型 - * @public - * @param {Boolean} isCursor - * @return {Null} - */ - me.setHandCursor = function(isCursor){ - _flash.call('setHandCursor', [isCursor || false]); - }; - - /** - * 设置鼠标相应函数名 - * @param {String|Function} fun - */ - me.setMSFunName = function(fun){ - _flash.call('setMSFunName',[_flash.createFunName(fun)]); - }; - - /** - * 执行上传操作 - * @param {String} url 上传的url - * @param {String} fieldName 上传的表单字段名 - * @param {Object} postData 键值对,上传的POST数据 - * @param {Number|Array|null|-1} [index]上传的文件序列 - * Int值上传该文件 - * Array一次串行上传该序列文件 - * -1/null上传所有文件 - * @return {Null} - */ - me.upload = function(url, fieldName, postData, index){ - - if(typeof url !== 'string' || typeof fieldName !== 'string') return null; - if(typeof index === 'undefined') index = -1; - - _flash.call('upload', [url, fieldName, postData, index]); - }; - - /** - * 取消上传操作 - * @public - * @param {Number|-1} index - */ - me.cancel = function(index){ - if(typeof index === 'undefined') index = -1; - _flash.call('cancel', [index]); - }; - - /** - * 删除文件 - * @public - * @param {Number|Array} [index] 要删除的index,不传则全部删除 - * @param {Function} callBack - * */ - me.deleteFile = function(index, callBack){ - - var callBackAll = function(list){ - callBack && callBack(list); - }; - - if(typeof index === 'undefined'){ - _flash.call('deleteFilesAll', [], callBackAll); - return; - }; - - if(typeof index === 'Number') index = [index]; - index.sort(function(a,b){ - return b-a; - }); - baidu.each(index, function(item){ - _flash.call('deleteFileBy', item, callBackAll); - }); - }; - - /** - * 添加文件类型,支持macType - * @public - * @param {Object|Array[Object]} type {description:String, extention:String} - * @return {Null}; - */ - me.addFileType = function(type){ - var type = type || [[]]; - - if(type instanceof Array) type = [type]; - else type = [[type]]; - _flash.call('addFileTypes', type); - }; - - /** - * 设置文件类型,支持macType - * @public - * @param {Object|Array[Object]} type {description:String, extention:String} - * @return {Null}; - */ - me.setFileType = function(type){ - var type = type || [[]]; - - if(type instanceof Array) type = [type]; - else type = [[type]]; - _flash.call('setFileTypes', type); - }; - - /** - * 设置可选文件的数量限制 - * @public - * @param {Number} num - * @return {Null} - */ - me.setMaxNum = function(num){ - _flash.call('setMaxNum', [num]); - }; - - /** - * 设置可选文件大小限制,以兆M为单位 - * @public - * @param {Number} num,0为无限制 - * @return {Null} - */ - me.setMaxSize = function(num){ - _flash.call('setMaxSize', [num]); - }; - - /** - * @public - */ - me.getFileAll = function(callBack){ - _flash.call('getFileAll', [], callBack); - }; - - /** - * @public - * @param {Number} index - * @param {Function} [callBack] - */ - me.getFileByIndex = function(index, callBack){ - _flash.call('getFileByIndex', [], callBack); - }; - - /** - * @public - * @param {Number} index - * @param {function} [callBack] - */ - me.getStatusByIndex = function(index, callBack){ - _flash.call('getStatusByIndex', [], callBack); - }; -}; - -/** - * 使用动态script标签请求服务器资源,包括由服务器端的回调和浏览器端的回调 - * @namespace baidu.sio - */ -baidu.sio = baidu.sio || {}; - -/** - * - * @param {HTMLElement} src script节点 - * @param {String} url script节点的地址 - * @param {String} [charset] 编码 - */ -baidu.sio._createScriptTag = function(scr, url, charset){ - scr.setAttribute('type', 'text/javascript'); - charset && scr.setAttribute('charset', charset); - scr.setAttribute('src', url); - document.getElementsByTagName('head')[0].appendChild(scr); -}; - -/** - * 删除script的属性,再删除script标签,以解决修复内存泄漏的问题 - * - * @param {HTMLElement} src script节点 - */ -baidu.sio._removeScriptTag = function(scr){ - if (scr.clearAttributes) { - scr.clearAttributes(); - } else { - for (var attr in scr) { - if (scr.hasOwnProperty(attr)) { - delete scr[attr]; - } - } - } - if(scr && scr.parentNode){ - scr.parentNode.removeChild(scr); - } - scr = null; -}; - - -/** - * 通过script标签加载数据,加载完成由浏览器端触发回调 - * @name baidu.sio.callByBrowser - * @function - * @grammar baidu.sio.callByBrowser(url, opt_callback, opt_options) - * @param {string} url 加载数据的url - * @param {Function|string} opt_callback 数据加载结束时调用的函数或函数名 - * @param {Object} opt_options 其他可选项 - * @config {String} [charset] script的字符集 - * @config {Integer} [timeOut] 超时时间,超过这个时间将不再响应本请求,并触发onfailure函数 - * @config {Function} [onfailure] timeOut设定后才生效,到达超时时间时触发本函数 - * @remark - * 1、与callByServer不同,callback参数只支持Function类型,不支持string。 - * 2、如果请求了一个不存在的页面,callback函数在IE/opera下也会被调用,因此使用者需要在onsuccess函数中判断数据是否正确加载。 - * @meta standard - * @see baidu.sio.callByServer - */ -baidu.sio.callByBrowser = function (url, opt_callback, opt_options) { - var scr = document.createElement("SCRIPT"), - scriptLoaded = 0, - options = opt_options || {}, - charset = options['charset'], - callback = opt_callback || function(){}, - timeOut = options['timeOut'] || 0, - timer; - scr.onload = scr.onreadystatechange = function () { - if (scriptLoaded) { - return; - } - - var readyState = scr.readyState; - if ('undefined' == typeof readyState - || readyState == "loaded" - || readyState == "complete") { - scriptLoaded = 1; - try { - callback(); - clearTimeout(timer); - } finally { - scr.onload = scr.onreadystatechange = null; - baidu.sio._removeScriptTag(scr); - } - } - }; - - if( timeOut ){ - timer = setTimeout(function(){ - scr.onload = scr.onreadystatechange = null; - baidu.sio._removeScriptTag(scr); - options.onfailure && options.onfailure(); - }, timeOut); - } - - baidu.sio._createScriptTag(scr, url, charset); -}; - -/** - * 通过script标签加载数据,加载完成由服务器端触发回调 - * @name baidu.sio.callByServer - * @function - * @grammar baidu.sio.callByServer(url, callback[, opt_options]) - * @param {string} url 加载数据的url. - * @param {Function|string} callback 服务器端调用的函数或函数名。如果没有指定本参数,将在URL中寻找options['queryField']做为callback的方法名. - * @param {Object} opt_options 加载数据时的选项. - * @config {string} [charset] script的字符集 - * @config {string} [queryField] 服务器端callback请求字段名,默认为callback - * @config {Integer} [timeOut] 超时时间(单位:ms),超过这个时间将不再响应本请求,并触发onfailure函数 - * @config {Function} [onfailure] timeOut设定后才生效,到达超时时间时触发本函数 - * @remark - * 如果url中已经包含key为“options['queryField']”的query项,将会被替换成callback中参数传递或自动生成的函数名。 - * @meta standard - * @see baidu.sio.callByBrowser - */ -baidu.sio.callByServer = /**@function*/function(url, callback, opt_options) { - var scr = document.createElement('SCRIPT'), - prefix = 'bd__cbs__', - callbackName, - callbackImpl, - options = opt_options || {}, - charset = options['charset'], - queryField = options['queryField'] || 'callback', - timeOut = options['timeOut'] || 0, - timer, - reg = new RegExp('(\\?|&)' + queryField + '=([^&]*)'), - matches; - - if (baidu.lang.isFunction(callback)) { - callbackName = prefix + Math.floor(Math.random() * 2147483648).toString(36); - window[callbackName] = getCallBack(0); - } else if(baidu.lang.isString(callback)){ - callbackName = callback; - } else { - if (matches = reg.exec(url)) { - callbackName = matches[2]; - } - } - - if( timeOut ){ - timer = setTimeout(getCallBack(1), timeOut); - } - url = url.replace(reg, '\x241' + queryField + '=' + callbackName); - - if (url.search(reg) < 0) { - url += (url.indexOf('?') < 0 ? '?' : '&') + queryField + '=' + callbackName; - } - baidu.sio._createScriptTag(scr, url, charset); - - /* - * 返回一个函数,用于立即(挂在window上)或者超时(挂在setTimeout中)时执行 - */ - function getCallBack(onTimeOut){ - /*global callbackName, callback, scr, options;*/ - return function(){ - try { - if( onTimeOut ){ - options.onfailure && options.onfailure(); - }else{ - callback.apply(window, arguments); - clearTimeout(timer); - } - window[callbackName] = null; - delete window[callbackName]; - } catch (exception) { - } finally { - baidu.sio._removeScriptTag(scr); - } - } - } -}; - -/** - * 通过请求一个图片的方式令服务器存储一条日志 - * @function - * @grammar baidu.sio.log(url) - * @param {string} url 要发送的地址. - * @author: int08h,leeight - */ -baidu.sio.log = function(url) { - var img = new Image(), - key = 'tangram_sio_log_' + Math.floor(Math.random() * - 2147483648).toString(36); - window[key] = img; - - img.onload = img.onerror = img.onabort = function() { - img.onload = img.onerror = img.onabort = null; - - window[key] = null; - img = null; - }; - img.src = url; -}; - - - -/* - * Tangram - * Copyright 2009 Baidu Inc. All rights reserved. - * - * path: baidu/json.js - * author: erik - * version: 1.1.0 - * date: 2009/12/02 - */ - - -/** - * 操作json对象的方法 - * @namespace baidu.json - */ -baidu.json = baidu.json || {}; -/* - * Tangram - * Copyright 2009 Baidu Inc. All rights reserved. - * - * path: baidu/json/parse.js - * author: erik, berg - * version: 1.2 - * date: 2009/11/23 - */ - - - -/** - * 将字符串解析成json对象。注:不会自动祛除空格 - * @name baidu.json.parse - * @function - * @grammar baidu.json.parse(data) - * @param {string} source 需要解析的字符串 - * @remark - * 该方法的实现与ecma-262第五版中规定的JSON.parse不同,暂时只支持传入一个参数。后续会进行功能丰富。 - * @meta standard - * @see baidu.json.stringify,baidu.json.decode - * - * @returns {JSON} 解析结果json对象 - */ -baidu.json.parse = function (data) { - //2010/12/09:更新至不使用原生parse,不检测用户输入是否正确 - return (new Function("return (" + data + ")"))(); -}; -/* - * Tangram - * Copyright 2009 Baidu Inc. All rights reserved. - * - * path: baidu/json/decode.js - * author: erik, cat - * version: 1.3.4 - * date: 2010/12/23 - */ - - - -/** - * 将字符串解析成json对象,为过时接口,今后会被baidu.json.parse代替 - * @name baidu.json.decode - * @function - * @grammar baidu.json.decode(source) - * @param {string} source 需要解析的字符串 - * @meta out - * @see baidu.json.encode,baidu.json.parse - * - * @returns {JSON} 解析结果json对象 - */ -baidu.json.decode = baidu.json.parse; -/* - * Tangram - * Copyright 2009 Baidu Inc. All rights reserved. - * - * path: baidu/json/stringify.js - * author: erik - * version: 1.1.0 - * date: 2010/01/11 - */ - - - -/** - * 将json对象序列化 - * @name baidu.json.stringify - * @function - * @grammar baidu.json.stringify(value) - * @param {JSON} value 需要序列化的json对象 - * @remark - * 该方法的实现与ecma-262第五版中规定的JSON.stringify不同,暂时只支持传入一个参数。后续会进行功能丰富。 - * @meta standard - * @see baidu.json.parse,baidu.json.encode - * - * @returns {string} 序列化后的字符串 - */ -baidu.json.stringify = (function () { - /** - * 字符串处理时需要转义的字符表 - * @private - */ - var escapeMap = { - "\b": '\\b', - "\t": '\\t', - "\n": '\\n', - "\f": '\\f', - "\r": '\\r', - '"' : '\\"', - "\\": '\\\\' - }; - - /** - * 字符串序列化 - * @private - */ - function encodeString(source) { - if (/["\\\x00-\x1f]/.test(source)) { - source = source.replace( - /["\\\x00-\x1f]/g, - function (match) { - var c = escapeMap[match]; - if (c) { - return c; - } - c = match.charCodeAt(); - return "\\u00" - + Math.floor(c / 16).toString(16) - + (c % 16).toString(16); - }); - } - return '"' + source + '"'; - } - - /** - * 数组序列化 - * @private - */ - function encodeArray(source) { - var result = ["["], - l = source.length, - preComma, i, item; - - for (i = 0; i < l; i++) { - item = source[i]; - - switch (typeof item) { - case "undefined": - case "function": - case "unknown": - break; - default: - if(preComma) { - result.push(','); - } - result.push(baidu.json.stringify(item)); - preComma = 1; - } - } - result.push("]"); - return result.join(""); - } - - /** - * 处理日期序列化时的补零 - * @private - */ - function pad(source) { - return source < 10 ? '0' + source : source; - } - - /** - * 日期序列化 - * @private - */ - function encodeDate(source){ - return '"' + source.getFullYear() + "-" - + pad(source.getMonth() + 1) + "-" - + pad(source.getDate()) + "T" - + pad(source.getHours()) + ":" - + pad(source.getMinutes()) + ":" - + pad(source.getSeconds()) + '"'; - } - - return function (value) { - switch (typeof value) { - case 'undefined': - return 'undefined'; - - case 'number': - return isFinite(value) ? String(value) : "null"; - - case 'string': - return encodeString(value); - - case 'boolean': - return String(value); - - default: - if (value === null) { - return 'null'; - } else if (value instanceof Array) { - return encodeArray(value); - } else if (value instanceof Date) { - return encodeDate(value); - } else { - var result = ['{'], - encode = baidu.json.stringify, - preComma, - item; - - for (var key in value) { - if (Object.prototype.hasOwnProperty.call(value, key)) { - item = value[key]; - switch (typeof item) { - case 'undefined': - case 'unknown': - case 'function': - break; - default: - if (preComma) { - result.push(','); - } - preComma = 1; - result.push(encode(key) + ':' + encode(item)); - } - } - } - result.push('}'); - return result.join(''); - } - } - }; -})(); -/* - * Tangram - * Copyright 2009 Baidu Inc. All rights reserved. - * - * path: baidu/json/encode.js - * author: erik, cat - * version: 1.3.4 - * date: 2010/12/23 - */ - - - -/** - * 将json对象序列化,为过时接口,今后会被baidu.json.stringify代替 - * @name baidu.json.encode - * @function - * @grammar baidu.json.encode(value) - * @param {JSON} value 需要序列化的json对象 - * @meta out - * @see baidu.json.decode,baidu.json.stringify - * - * @returns {string} 序列化后的字符串 - */ -baidu.json.encode = baidu.json.stringify; diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/wordimage.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/wordimage.html deleted file mode 100644 index 670db71eb09d969c2ff17b02ee9793a80dbd828d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/wordimage.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - -
                      -
                      - -
                      -
                      -
                      -
                      -
                      - -
                      - : -
                      -
                      -
                      - - - - - - \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/wordimage.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/wordimage.js deleted file mode 100644 index b3a075de8020ed131c8f4259f41e68393461439c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/dialogs/wordimage/wordimage.js +++ /dev/null @@ -1,157 +0,0 @@ -/** - * Created by JetBrains PhpStorm. - * User: taoqili - * Date: 12-1-30 - * Time: 下午12:50 - * To change this template use File | Settings | File Templates. - */ - - - -var wordImage = {}; -//(function(){ -var g = baidu.g, - flashObj,flashContainer; - -wordImage.init = function(opt, callbacks) { - showLocalPath("localPath"); - //createCopyButton("clipboard","localPath"); - createFlashUploader(opt, callbacks); - addUploadListener(); - addOkListener(); -}; - -function hideFlash(){ - flashObj = null; - flashContainer.innerHTML = ""; -} -function addOkListener() { - dialog.onok = function() { - if (!imageUrls.length) return; - var urlPrefix = editor.getOpt('imageUrlPrefix'), - images = domUtils.getElementsByTagName(editor.document,"img"); - editor.fireEvent('saveScene'); - for (var i = 0,img; img = images[i++];) { - var src = img.getAttribute("word_img"); - if (!src) continue; - for (var j = 0,url; url = imageUrls[j++];) { - if (src.indexOf(url.original.replace(" ","")) != -1) { - img.src = urlPrefix + url.url; - img.setAttribute("_src", urlPrefix + url.url); //同时修改"_src"属性 - img.setAttribute("title",url.title); - domUtils.removeAttributes(img, ["word_img","style","width","height"]); - editor.fireEvent("selectionchange"); - break; - } - } - } - editor.fireEvent('saveScene'); - hideFlash(); - }; - dialog.oncancel = function(){ - hideFlash(); - } -} - -/** - * 绑定开始上传事件 - */ -function addUploadListener() { - g("upload").onclick = function () { - flashObj.upload(); - this.style.display = "none"; - }; -} - -function showLocalPath(id) { - //单张编辑 - var img = editor.selection.getRange().getClosedNode(); - var images = editor.execCommand('wordimage'); - if(images.length==1 || img && img.tagName == 'IMG'){ - g(id).value = images[0]; - return; - } - var path = images[0]; - var leftSlashIndex = path.lastIndexOf("/")||0, //不同版本的doc和浏览器都可能影响到这个符号,故直接判断两种 - rightSlashIndex = path.lastIndexOf("\\")||0, - separater = leftSlashIndex > rightSlashIndex ? "/":"\\" ; - - path = path.substring(0, path.lastIndexOf(separater)+1); - g(id).value = path; -} - -function createFlashUploader(opt, callbacks) { - //由于lang.flashI18n是静态属性,不可以直接进行修改,否则会影响到后续内容 - var i18n = utils.extend({},lang.flashI18n); - //处理图片资源地址的编码,补全等问题 - for(var i in i18n){ - if(!(i in {"lang":1,"uploadingTF":1,"imageTF":1,"textEncoding":1}) && i18n[i]){ - i18n[i] = encodeURIComponent(editor.options.langPath + editor.options.lang + "/images/" + i18n[i]); - } - } - opt = utils.extend(opt,i18n,false); - var option = { - createOptions:{ - id:'flash', - url:opt.flashUrl, - width:opt.width, - height:opt.height, - errorMessage:lang.flashError, - wmode:browser.safari ? 'transparent' : 'window', - ver:'10.0.0', - vars:opt, - container:opt.container - } - }; - - option = extendProperty(callbacks, option); - flashObj = new baidu.flash.imageUploader(option); - flashContainer = $G(opt.container); -} - -function extendProperty(fromObj, toObj) { - for (var i in fromObj) { - if (!toObj[i]) { - toObj[i] = fromObj[i]; - } - } - return toObj; -} - -//})(); - -function getPasteData(id) { - baidu.g("msg").innerHTML = lang.copySuccess + "
                      "; - setTimeout(function() { - baidu.g("msg").innerHTML = ""; - }, 5000); - return baidu.g(id).value; -} - -function createCopyButton(id, dataFrom) { - baidu.swf.create({ - id:"copyFlash", - url:"fClipboard_neditor.swf", - width:"58", - height:"25", - errorMessage:"", - bgColor:"#CBCBCB", - wmode:"transparent", - ver:"10.0.0", - vars:{ - tid:dataFrom - } - }, id - ); - - var clipboard = baidu.swf.getMovie("copyFlash"); - var clipinterval = setInterval(function() { - if (clipboard && clipboard.flashInit) { - clearInterval(clipinterval); - clipboard.setHandCursor(true); - clipboard.setContentFuncName("getPasteData"); - //clipboard.setMEFuncName("mouseEventHandler"); - } - }, 500); -} -createCopyButton("clipboard", "localPath"); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/en.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/en.js deleted file mode 100644 index 0ccead18c631aa8eb482827b63ba957429bc0527..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/en.js +++ /dev/null @@ -1,684 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: taoqili - * Date: 12-6-12 - * Time: 下午6:57 - * To change this template use File | Settings | File Templates. - */ -UE.I18N['en'] = { - 'labelMap':{ - 'anchor':'Anchor', 'undo':'Undo', 'redo':'Redo', 'bold':'Bold', 'indent':'Indent', 'snapscreen':'SnapScreen', - 'italic':'Italic', 'underline':'Underline', 'strikethrough':'Strikethrough', 'subscript':'SubScript','fontborder':'text border', - 'superscript':'SuperScript', 'formatmatch':'Format Match', 'source':'Source', 'blockquote':'BlockQuote', - 'pasteplain':'PastePlain', 'selectall':'SelectAll', 'print':'Print', 'preview':'Preview', - 'horizontal':'Horizontal', 'removeformat':'RemoveFormat', 'time':'Time', 'date':'Date', - 'unlink':'Unlink', 'insertrow':'InsertRow', 'insertcol':'InsertCol', 'mergeright':'MergeRight', 'mergedown':'MergeDown', - 'deleterow':'DeleteRow', 'deletecol':'DeleteCol', 'splittorows':'SplitToRows','insertcode':'insert code', - 'splittocols':'SplitToCols', 'splittocells':'SplitToCells','deletecaption':'DeleteCaption','inserttitle':'InsertTitle', - 'mergecells':'MergeCells', 'deletetable':'DeleteTable', 'cleardoc':'Clear', 'insertparagraphbeforetable':"InsertParagraphBeforeTable", - 'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph','simpleupload':'Single Image','insertimage':'Multi Image','edittable':'Edit Table', 'edittd':'Edit Td','link':'Link', - 'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap', - 'insertvideo':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter', - 'justifyjustify':'Justify', 'forecolor':'FontColor', 'backcolor':'BackColor', 'insertorderedlist':'OL', - 'insertunorderedlist':'UL', 'fullscreen':'FullScreen', 'directionalityltr':'EnterFromLeft', 'directionalityrtl':'EnterFromRight', - 'rowspacingtop':'RowSpacingTop', 'rowspacingbottom':'RowSpacingBottom', 'pagebreak':'PageBreak', 'insertframe':'Iframe', 'imagenone':'Default', - 'imageleft':'ImageLeft', 'imageright':'ImageRight', 'attachment':'Attachment', 'imagecenter':'ImageCenter', 'wordimage':'WordImage', - 'lineheight':'LineHeight','edittip':'EditTip','customstyle':'CustomStyle', 'scrawl':'Scrawl', 'autotypeset':'AutoTypeset', - 'webapp':'WebAPP', 'touppercase':'UpperCase', 'tolowercase':'LowerCase','template':'Template','background':'Background','inserttable':'InsertTable', - 'music':'Music', 'charts': 'charts','drafts': 'Load from Drafts' - }, - 'insertorderedlist':{ - 'num':'1,2,3...', - 'num1':'1),2),3)...', - 'num2':'(1),(2),(3)...', - 'cn':'一,二,三....', - 'cn1':'一),二),三)....', - 'cn2':'(一),(二),(三)....', - 'decimal':'1,2,3...', - 'lower-alpha':'a,b,c...', - 'lower-roman':'i,ii,iii...', - 'upper-alpha':'A,B,C...', - 'upper-roman':'I,II,III...' - }, - 'insertunorderedlist':{ - 'circle':'○ Circle', - 'disc':'● Circle dot', - 'square':'■ Rectangle ', - 'dash' :'- Dash', - 'dot' : '。dot' - }, - 'paragraph':{'p':'Paragraph', 'h1':'Title 1', 'h2':'Title 2', 'h3':'Title 3', 'h4':'Title 4', 'h5':'Title 5', 'h6':'Title 6'}, - 'fontfamily':{ - 'songti':'Sim Sun', - 'kaiti':'Sim Kai', - 'heiti':'Sim Hei', - 'lishu':'Sim Li', - 'yahei': 'Microsoft YaHei', - 'andaleMono':'Andale Mono', - 'arial': 'Arial', - 'arialBlack':'Arial Black', - 'comicSansMs':'Comic Sans MS', - 'impact':'Impact', - 'timesNewRoman':'Times New Roman' - }, - 'customstyle':{ - 'tc':'Title center', - 'tl':'Title left', - 'im':'Important', - 'hi':'Highlight' - }, - 'autoupload': { - 'exceedSizeError': 'File Size Exceed', - 'exceedTypeError': 'File Type Not Allow', - 'jsonEncodeError': 'Server Return Format Error', - 'loading':"loading...", - 'loadError':"load error", - 'errorLoadConfig': 'Server config not loaded, upload can not work.', - }, - 'simpleupload':{ - 'exceedSizeError': 'File Size Exceed', - 'exceedTypeError': 'File Type Not Allow', - 'jsonEncodeError': 'Server Return Format Error', - 'loading':"loading...", - 'loadError':"load error", - 'errorLoadConfig': 'Server config not loaded, upload can not work.', - }, - 'elementPathTip':"Path", - 'wordCountTip':"Word Count", - 'wordCountMsg':'{#count} characters entered,{#leave} left. ', - 'wordOverFlowMsg':'The number of characters has exceeded allowable maximum values, the server may refuse to save!', - 'ok':"OK", - 'cancel':"Cancel", - 'closeDialog':"closeDialog", - 'tableDrag':"You must import the file uiUtils.js before drag! ", - 'autofloatMsg':"The plugin AutoFloat depends on EditorUI!", - 'loadconfigError': 'Get server config error.', - 'loadconfigFormatError': 'Server config format error.', - 'loadconfigHttpError': 'Get server config http error.', - 'snapScreen_plugin':{ - 'browserMsg':"Only IE supported!", - 'callBackErrorMsg':"The callback data is wrong,please check the config!", - 'uploadErrorMsg':"Upload error,please check your server environment! " - }, - 'insertcode':{ - 'as3':'ActionScript 3', - 'bash':'Bash/Shell', - 'cpp':'C/C++', - 'css':'CSS', - 'cf':'ColdFusion', - 'c#':'C#', - 'delphi':'Delphi', - 'diff':'Diff', - 'erlang':'Erlang', - 'groovy':'Groovy', - 'html':'HTML', - 'java':'Java', - 'jfx':'JavaFX', - 'js':'JavaScript', - 'pl':'Perl', - 'php':'PHP', - 'plain':'Plain Text', - 'ps':'PowerShell', - 'python':'Python', - 'ruby':'Ruby', - 'scala':'Scala', - 'sql':'SQL', - 'vb':'Visual Basic', - 'xml':'XML' - }, - 'confirmClear':"Do you confirm to clear the Document?", - 'contextMenu':{ - 'delete':"Delete", - 'selectall':"Select all", - 'deletecode':"Delete Code", - 'cleardoc':"Clear Document", - 'confirmclear':"Do you confirm to clear the Document?", - 'unlink':"Unlink", - 'paragraph':"Paragraph", - 'edittable':"Table property", - 'aligncell':'Align cell', - 'aligntable':'Table alignment', - 'tableleft':'Left float', - 'tablecenter':'Center', - 'tableright':'Right float', - 'aligntd':'Cell alignment', - 'edittd':"Cell property", - 'setbordervisible':'set table edge visible', - 'table':"Table", - 'justifyleft':'Justify Left', - 'justifyright':'Justify Right', - 'justifycenter':'Justify Center', - 'justifyjustify':'Default', - 'deletetable':"Delete table", - 'insertparagraphbefore':"InsertedBeforeLine", - 'insertparagraphafter':'InsertedAfterLine', - 'inserttable':'Insert table', - 'insertcaption':'Insert caption', - 'deletecaption':'Delete Caption', - 'inserttitle':'Insert Title', - 'deletetitle':'Delete Title', - 'inserttitlecol':'Insert Title Col', - 'deletetitlecol':'Delete Title Col', - 'averageDiseRow':'AverageDise Row', - 'averageDisCol':'AverageDis Col', - 'deleterow':"Delete row", - 'deletecol':"Delete col", - 'insertrow':"Insert row", - 'insertcol':"Insert col", - 'insertrownext':'Insert Row Next', - 'insertcolnext':'Insert Col Next', - 'mergeright':"Merge right", - 'mergeleft':"Merge left", - 'mergedown':"Merge down", - 'mergecells':"Merge cells", - 'splittocells':"Split to cells", - 'splittocols':"Split to Cols", - 'splittorows':"Split to Rows", - 'tablesort':'Table sorting', - 'enablesort':'Sorting Enable', - 'disablesort':'Sorting Disable', - 'reversecurrent':'Reverse current', - 'orderbyasc':'Order By ASCII', - 'reversebyasc':'Reverse By ASCII', - 'orderbynum':'Order By Num', - 'reversebynum':'Reverse By Num', - 'borderbk':'Border shading', - 'setcolor':'interlaced color', - 'unsetcolor':'Cancel interlacedcolor', - 'setbackground':'Background interlaced', - 'unsetbackground':'Cancel Bk interlaced', - 'redandblue':'Blue and red', - 'threecolorgradient':'Three-color gradient', - 'copy':"Copy(Ctrl + c)", - 'copymsg':"Browser does not support. Please use 'Ctrl + c' instead!", - 'paste':"Paste(Ctrl + v)", - 'pastemsg':"Browser does not support. Please use 'Ctrl + v' instead!" - }, - 'copymsg': "Browser does not support. Please use 'Ctrl + c' instead!", - 'pastemsg': "Browser does not support. Please use 'Ctrl + v' instead!", - 'anthorMsg':"Link", - 'clearColor':'Clear', - 'standardColor':'Standard color', - 'themeColor':'Theme color', - 'property':'Property', - 'default':'Default', - 'modify':'Modify', - 'justifyleft':'Justify Left', - 'justifyright':'Justify Right', - 'justifycenter':'Justify Center', - 'justify':'Default', - 'clear':'Clear', - 'anchorMsg':'Anchor', - 'delete':'Delete', - 'clickToUpload':"Click to upload", - 'unset':'Language hasn\'t been set!', - 't_row':'row', - 't_col':'col', - 'pasteOpt':'Paste Option', - 'pasteSourceFormat':"Keep Source Formatting", - 'tagFormat':'Keep tag', - 'pasteTextFormat':'Keep Text only', - 'more':'More', - 'autoTypeSet':{ - 'mergeLine':"Merge empty line", - 'delLine':"Del empty line", - 'removeFormat':"Remove format", - 'indent':"Indent", - 'alignment':"Alignment", - 'imageFloat':"Image float", - 'removeFontsize':"Remove font size", - 'removeFontFamily':"Remove fontFamily", - 'removeHtml':"Remove redundant HTML code", - 'pasteFilter':"Paste filter", - 'run':"Done", - 'symbol':'Symbol Conversion', - 'bdc2sb':'Full-width to Half-width', - 'tobdc':'Half-width to Full-width' - }, - - 'background':{ - 'static':{ - 'lang_background_normal':'Normal', - 'lang_background_local':'Online', - 'lang_background_set':'Background Set', - 'lang_background_none':'No Background', - 'lang_background_colored':'Colored Background', - 'lang_background_color':'Color Set', - 'lang_background_netimg':'Net-Image', - 'lang_background_align':'Align Type', - 'lang_background_position':'Position', - 'repeatType':{'options':["Center", "Repeat-x", "Repeat-y", "Tile","Custom"]} - }, - 'noUploadImage':"No pictures has been uploaded!", - 'toggleSelect':'Change the active state by click!\n Image Size: ' - }, - //===============dialog i18N======================= - 'insertimage':{ - 'static':{ - 'lang_tab_remote':"Insert", - 'lang_tab_upload':"Local", - 'lang_tab_online':"Manager", - 'lang_tab_search':"Search", - 'lang_input_url':"Address:", - 'lang_input_size':"Size:", - 'lang_input_width':"Width", - 'lang_input_height':"Height", - 'lang_input_border':"Border:", - 'lang_input_vhspace':"Margins:", - 'lang_input_title':"Title:", - 'lang_input_align':'Image Float Style:', - 'lang_imgLoading':"Loading...", - 'lang_start_upload':"Start Upload", - 'lock':{'title':"Lock rate"}, - 'searchType':{'title':"ImageType", 'options':["All", "Avatar", "Facial", "Cartoon", "StickFigure", "GIF", "StaticImage"]}, - 'searchTxt':{'value':"Enter the search keyword!"}, - 'searchBtn':{'value':"Search"}, - 'searchReset':{'value':"Clear"}, - 'noneAlign':{'title':'None Float'}, - 'leftAlign':{'title':'Left Float'}, - 'rightAlign':{'title':'Right Float'}, - 'centerAlign':{'title':'Center In A Line'} - }, - 'uploadSelectFile':'Select File', - 'uploadAddFile':'Add File', - 'uploadStart':'Start Upload', - 'uploadPause':'Pause Upload', - 'uploadContinue':'Continue Upload', - 'uploadRetry':'Retry Upload', - 'uploadDelete':'Delete', - 'uploadTurnLeft':'Turn Left', - 'uploadTurnRight':'Turn Right', - 'uploadPreview':'Doing Preview', - 'uploadNoPreview':'Can Not Preview', - 'updateStatusReady': 'Selected _ pictures, total _KB.', - 'updateStatusConfirm': '_ uploaded successfully and _ upload failed', - 'updateStatusFinish': 'Total _ pictures (_KB), _ uploaded successfully', - 'updateStatusError': ' and _ upload failed', - 'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', - 'errorLoadConfig': 'Server config not loaded, upload can not work.', - 'errorExceedSize':'File Size Exceed', - 'errorFileType':'File Type Not Allow', - 'errorInterrupt':'File Upload Interrupted', - 'errorUploadRetry':'Upload Error, Please Retry.', - 'errorHttp':'Http Error', - 'errorServerUpload':'Server Result Error.', - 'remoteLockError':"Cannot Lock the Proportion between width and height", - 'numError':"Please enter the correct Num. e.g 123,400", - 'imageUrlError':"The image format may be wrong!", - 'imageLoadError':"Error,please check the network or URL!", - 'searchRemind':"Enter the search keyword!", - 'searchLoading':"Image is loading,please wait...", - 'searchRetry':" Sorry,can't find the image,please try again!" - }, - 'attachment':{ - 'static':{ - 'lang_tab_upload': 'Upload', - 'lang_tab_online': 'Online', - 'lang_start_upload':"Start upload", - 'lang_drop_remind':"You can drop files here, a single maximum of 300 files" - }, - 'uploadSelectFile':'Select File', - 'uploadAddFile':'Add File', - 'uploadStart':'Start Upload', - 'uploadPause':'Pause Upload', - 'uploadContinue':'Continue Upload', - 'uploadRetry':'Retry Upload', - 'uploadDelete':'Delete', - 'uploadTurnLeft':'Turn Left', - 'uploadTurnRight':'Turn Right', - 'uploadPreview':'Doing Preview', - 'updateStatusReady': 'Selected _ files, total _KB.', - 'updateStatusConfirm': '_ uploaded successfully and _ upload failed', - 'updateStatusFinish': 'Total _ files (_KB), _ uploaded successfully', - 'updateStatusError': ' and _ upload failed', - 'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', - 'errorLoadConfig': 'Server config not loaded, upload can not work.', - 'errorExceedSize':'File Size Exceed', - 'errorFileType':'File Type Not Allow', - 'errorInterrupt':'File Upload Interrupted', - 'errorUploadRetry':'Upload Error, Please Retry.', - 'errorHttp':'Http Error', - 'errorServerUpload':'Server Result Error.' - }, - - 'insertvideo':{ - 'static':{ - 'lang_tab_insertV':"Video", - 'lang_tab_searchV':"Search", - 'lang_tab_uploadV':"Upload", - 'lang_video_url':" URL ", - 'lang_video_size':"Video Size", - 'lang_videoW':"Width", - 'lang_videoH':"Height", - 'lang_alignment':"Alignment", - 'videoSearchTxt':{'value':"Enter the search keyword!"}, - 'videoType':{'options':["All", "Hot", "Entertainment", "Funny", "Sports", "Science", "variety"]}, - 'videoSearchBtn':{'value':"Search in Baidu"}, - 'videoSearchReset':{'value':"Clear result"}, - - 'lang_input_fileStatus':' No file uploaded!', - 'startUpload':{'style':"background:url(upload.png) no-repeat;"}, - - 'lang_upload_size':"Video Size", - 'lang_upload_width':"Width", - 'lang_upload_height':"Height", - 'lang_upload_alignment':"Alignment", - 'lang_format_advice':"Recommends mp4 format." - }, - 'numError':"Please enter the correct Num. e.g 123,400", - 'floatLeft':"Float left", - 'floatRight':"Float right", - 'default':"Default", - 'block':"Display in block", - 'urlError':"The video url format may be wrong!", - 'loading':"  The video is loading, please wait…", - 'clickToSelect':"Click to select", - 'goToSource':'Visit source video ', - 'noVideo':"    Sorry,can't find the video,please try again!", - - 'browseFiles':'Open files', - 'uploadSuccess':'Upload Successful!', - 'delSuccessFile':'Remove from the success of the queue', - 'delFailSaveFile':'Remove the save failed file', - 'statusPrompt':' file(s) uploaded! ', - 'flashVersionError':'The current Flash version is too low, please update FlashPlayer,then try again!', - 'flashLoadingError':'The Flash failed loading! Please check the path or network state', - 'fileUploadReady':'Wait for uploading...', - 'delUploadQueue':'Remove from the uploading queue ', - 'limitPrompt1':'Can not choose more than single', - 'limitPrompt2':'file(s)!Please choose again!', - 'delFailFile':'Remove failure file', - 'fileSizeLimit':'File size exceeds the limit!', - 'emptyFile':'Can not upload an empty file!', - 'fileTypeError':'File type error!', - 'unknownError':'Unknown error!', - 'fileUploading':'Uploading,please wait...', - 'cancelUpload':'Cancel upload', - 'netError':'Network error', - 'failUpload':'Upload failed', - 'serverIOError':'Server IO error!', - 'noAuthority':'No Permission!', - 'fileNumLimit':'Upload limit to the number', - 'failCheck':'Authentication fails, the upload is skipped!', - 'fileCanceling':'Cancel, please wait...', - 'stopUploading':'Upload has stopped...', - - 'uploadSelectFile':'Select File', - 'uploadAddFile':'Add File', - 'uploadStart':'Start Upload', - 'uploadPause':'Pause Upload', - 'uploadContinue':'Continue Upload', - 'uploadRetry':'Retry Upload', - 'uploadDelete':'Delete', - 'uploadTurnLeft':'Turn Left', - 'uploadTurnRight':'Turn Right', - 'uploadPreview':'Doing Preview', - 'updateStatusReady': 'Selected _ files, total _KB.', - 'updateStatusConfirm': '_ uploaded successfully and _ upload failed', - 'updateStatusFinish': 'Total _ files (_KB), _ uploaded successfully', - 'updateStatusError': ' and _ upload failed', - 'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', - 'errorLoadConfig': 'Server config not loaded, upload can not work.', - 'errorExceedSize':'File Size Exceed', - 'errorFileType':'File Type Not Allow', - 'errorInterrupt':'File Upload Interrupted', - 'errorUploadRetry':'Upload Error, Please Retry.', - 'errorHttp':'Http Error', - 'errorServerUpload':'Server Result Error.' - }, - 'webapp':{ - 'tip1':"This function provided by Baidu APP,please apply for baidu APPKey webmaster first!", - 'tip2':"And then open the file neditor.config.js to set it! ", - 'applyFor':"APPLY FOR", - 'anthorApi':"Baidu API" - }, - 'template':{ - 'static':{ - 'lang_template_bkcolor':'Background Color', - 'lang_template_clear' : 'Keep Content', - 'lang_template_select':'Select Template' - }, - 'blank':"Blank", - 'blog':"Blog", - 'resume':"Resume", - 'richText':"Rich Text", - 'scrPapers':"Scientific Papers" - }, - scrawl:{ - 'static':{ - 'lang_input_previousStep':"Previous", - 'lang_input_nextsStep':"Next", - 'lang_input_clear':'Clear', - 'lang_input_addPic':'AddImage', - 'lang_input_ScalePic':'ScaleImage', - 'lang_input_removePic':'RemoveImage', - 'J_imgTxt':{title:'Add background image'} - }, - 'noScarwl':"No paint, a white paper...", - 'scrawlUpLoading':"Image is uploading, please wait...", - 'continueBtn':"Try again", - 'imageError':"Image failed to load!", - 'backgroundUploading':'Image is uploading,please wait...' - }, - 'music':{ - 'static':{ - 'lang_input_tips':"Input singer/song/album, search you interested in music!", - 'J_searchBtn':{value:'Search songs'} - }, - 'emptyTxt':'Not search to the relevant music results, please change a keyword try.', - 'chapter':'Songs', - 'singer':'Singer', - 'special':'Album', - 'listenTest':'Audition' - }, - anchor:{ - 'static':{ - 'lang_input_anchorName':'Anchor Name:' - } - }, - 'charts':{ - 'static':{ - 'lang_data_source':'Data source:', - 'lang_chart_format': 'Chart format:', - 'lang_data_align': 'Align', - 'lang_chart_align_same': 'Consistent with the X-axis Y-axis', - 'lang_chart_align_reverse': 'X-axis Y-axis opposite', - 'lang_chart_title': 'Title', - 'lang_chart_main_title': 'main title:', - 'lang_chart_sub_title': 'sub title:', - 'lang_chart_x_title': 'X-axis title:', - 'lang_chart_y_title': 'Y-axis title:', - 'lang_chart_tip': 'Prompt', - 'lang_cahrt_tip_prefix': 'prefix:', - 'lang_cahrt_tip_description': '仅饼图有效, 当鼠标移动到饼图中相应的块上时,提示框内的文字的前缀', - 'lang_chart_data_unit': 'Unit', - 'lang_chart_data_unit_title': 'unit:', - 'lang_chart_data_unit_description': '显示在每个数据点上的数据的单位, 比如: 温度的单位 ℃', - 'lang_chart_type': 'Chart type:', - 'lang_prev_btn': 'Previous', - 'lang_next_btn': 'Next' - } - }, - emotion:{ - 'static':{ - 'lang_input_choice':'Choice', - 'lang_input_Tuzki':'Tuzki', - 'lang_input_lvdouwa':'LvDouWa', - 'lang_input_BOBO':'BOBO', - 'lang_input_babyCat':'BabyCat', - 'lang_input_bubble':'Bubble', - 'lang_input_youa':'YouA' - } - }, - gmap:{ - 'static':{ - 'lang_input_address':'Address:', - 'lang_input_search':'Search', - 'address':{value:"Beijing"} - }, - searchError:'Unable to locate the address!' - }, - help:{ - 'static':{ - 'lang_input_about':'About', - 'lang_input_shortcuts':'Shortcuts', - 'lang_input_introduction':"UEditor is developed by Baidu Co.ltd. It is lightweight, customizable , focusing on user experience and etc. , UEditor is based on open source BSD license , allowing free use and redistribution.", - 'lang_Txt_shortcuts':'Shortcuts', - 'lang_Txt_func':'Function', - 'lang_Txt_bold':'Bold', - 'lang_Txt_copy':'Copy', - 'lang_Txt_cut':'Cut', - 'lang_Txt_Paste':'Paste', - 'lang_Txt_undo':'Undo', - 'lang_Txt_redo':'Redo', - 'lang_Txt_italic':'Italic', - 'lang_Txt_underline':'Underline', - 'lang_Txt_selectAll':'Select All', - 'lang_Txt_visualEnter':'Submit', - 'lang_Txt_fullscreen':'Fullscreen' - } - }, - insertframe:{ - 'static':{ - 'lang_input_address':'Address:', - 'lang_input_width':'Width:', - 'lang_input_height':'height:', - 'lang_input_isScroll':'Enable scrollbars:', - 'lang_input_frameborder':'Show frame border:', - 'lang_input_alignMode':'Alignment:', - 'align':{title:"Alignment", options:["Default", "Left", "Right", "Center"]} - }, - 'enterAddress':'Please enter an address!' - }, - link:{ - 'static':{ - 'lang_input_text':'Text:', - 'lang_input_url':'URL:', - 'lang_input_title':'Title:', - 'lang_input_target':'open in new window:' - }, - 'validLink':'Supports only effective when a link is selected', - 'httpPrompt':'The hyperlink you enter should start with "http|https|ftp://"!' - }, - map:{ - 'static':{ - lang_city:"City", - lang_address:"Address", - city:{value:"Beijing"}, - lang_search:"Search", - lang_dynamicmap:"Dynamic map" - }, - cityMsg:"Please enter the city name!", - errorMsg:"Can't find the place!" - }, - searchreplace:{ - 'static':{ - lang_tab_search:"Search", - lang_tab_replace:"Replace", - lang_search1:"Search", - lang_search2:"Search", - lang_replace:"Replace", - lang_searchReg:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"', - lang_searchReg1:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"', - lang_case_sensitive1:"Case sense", - lang_case_sensitive2:"Case sense", - nextFindBtn:{value:"Next"}, - preFindBtn:{value:"Preview"}, - nextReplaceBtn:{value:"Next"}, - preReplaceBtn:{value:"Preview"}, - repalceBtn:{value:"Replace"}, - repalceAllBtn:{value:"Replace all"} - }, - getEnd:"Has the search to the bottom!", - getStart:"Has the search to the top!", - countMsg:"Altogether replaced {#count} character(s)!" - }, - snapscreen:{ - 'static':{ - lang_showMsg:"You should install the UEditor screenshots program first!", - lang_download:"Download!", - lang_step1:"Step1:Download the program and then run it", - lang_step2:"Step2:After complete install,try to click the button again" - } - }, - spechars:{ - 'static':{}, - tsfh:"Special", - lmsz:"Roman", - szfh:"Numeral", - rwfh:"Japanese", - xlzm:"The Greek", - ewzm:"Russian", - pyzm:"Phonetic", - yyyb:"English", - zyzf:"Others" - }, - 'edittable':{ - 'static':{ - 'lang_tableStyle':'Table style', - 'lang_insertCaption':'Add table header row', - 'lang_insertTitle':'Add table title row', - 'lang_insertTitleCol':'Add table title col', - 'lang_tableSize':'Automatically adjust table size', - 'lang_autoSizeContent':'Adaptive by form text', - 'lang_orderbycontent':"Table of contents sortable", - 'lang_autoSizePage':'Page width adaptive', - 'lang_example':'Example', - 'lang_borderStyle':'Table Border', - 'lang_color':'Color:' - }, - captionName:'Caption', - titleName:'Title', - cellsName:'text', - errorMsg:'There are merged cells, can not sort.' - }, - 'edittip':{ - 'static':{ - lang_delRow:'Delete entire row', - lang_delCol:'Delete entire col' - } - }, - 'edittd':{ - 'static':{ - lang_tdBkColor:'Background Color:' - } - }, - 'formula':{ - 'static':{ - } - }, - wordimage:{ - 'static':{ - lang_resave:"The re-save step", - uploadBtn:{src:"upload.png", alt:"Upload"}, - clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"}, - lang_step:" 1. Click top button to copy the url and then open the dialog to paste it. 2. Open after choose photos uploaded process." - }, - fileType:"Image", - flashError:"Flash initialization failed!", - netError:"Network error! Please try again!", - copySuccess:"URL has been copied!", - - 'flashI18n':{ - lang:encodeURI( '{"UploadingState":"totalNum: ${a},uploadComplete: ${b}", "BeforeUpload":"waitingNum: ${a}", "ExceedSize":"Size exceed${a}", "ErrorInPreview":"Preview failed", "DefaultDescription":"Description", "LoadingImage":"Loading..."}' ), - uploadingTF:encodeURI( '{"font":"Arial", "size":12, "color":"0x000", "bold":"true", "italic":"false", "underline":"false"}' ), - imageTF:encodeURI( '{"font":"Arial", "size":11, "color":"red", "bold":"false", "italic":"false", "underline":"false"}' ), - textEncoding:"utf-8", - addImageSkinURL:"addImage.png", - allDeleteBtnUpSkinURL:"allDeleteBtnUpSkin.png", - allDeleteBtnHoverSkinURL:"allDeleteBtnHoverSkin.png", - rotateLeftBtnEnableSkinURL:"rotateLeftEnable.png", - rotateLeftBtnDisableSkinURL:"rotateLeftDisable.png", - rotateRightBtnEnableSkinURL:"rotateRightEnable.png", - rotateRightBtnDisableSkinURL:"rotateRightDisable.png", - deleteBtnEnableSkinURL:"deleteEnable.png", - deleteBtnDisableSkinURL:"deleteDisable.png", - backgroundURL:'', - listBackgroundURL:'', - buttonURL:'button.png' - } - }, - 'autosave': { - 'success':'Local conservation success' - } -}; diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/addimage.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/addimage.png deleted file mode 100644 index 3a2fd17121b9e0d435b2ca082d696c33b9f27b79..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/addimage.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/alldeletebtnhoverskin.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/alldeletebtnhoverskin.png deleted file mode 100644 index 355eeabbd8fc611ec984889883a2ec46e1cb6bb1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/alldeletebtnhoverskin.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/alldeletebtnupskin.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/alldeletebtnupskin.png deleted file mode 100644 index 61658ce6f10164478ce293c05f1f0485a8fa1fc4..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/alldeletebtnupskin.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/background.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/background.png deleted file mode 100644 index d5bf5fdd8ae94b603832031134b208c9bc72edf4..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/background.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/button.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/button.png deleted file mode 100644 index 098874cb1fa85852d77ba9acbb5850c91c341fb7..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/button.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/copy.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/copy.png deleted file mode 100644 index f982e8bcbc6e0d6dde115a2cd5d094b12ad50f4f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/copy.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/deletedisable.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/deletedisable.png deleted file mode 100644 index c8ee75094f59f0c1262806fd294d361f30f64f58..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/deletedisable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/deleteenable.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/deleteenable.png deleted file mode 100644 index 26acc883567c5d7fde8de3ba052d7754a5b1c539..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/deleteenable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/listbackground.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/listbackground.png deleted file mode 100644 index 4f82ccd88fca215709827937769cb4c9216323b1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/listbackground.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/localimage.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/localimage.png deleted file mode 100644 index 12c8e6aefa8fd16287ac77bbecd7d5b58c3fc837..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/localimage.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/music.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/music.png deleted file mode 100644 index 69c5a9a7e1cecdf78902fc11178313f7f33d1f85..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/music.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotateleftdisable.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotateleftdisable.png deleted file mode 100644 index 741526e0d5e6eb5c30eb0a62c9b1d6d558ed9cdf..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotateleftdisable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotateleftenable.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotateleftenable.png deleted file mode 100644 index e164ddbd62a232f3a89826158c9795f6c082cc89..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotateleftenable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotaterightdisable.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotaterightdisable.png deleted file mode 100644 index 5a78c26062ae546b046ca58d1c2b6647f62d2368..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotaterightdisable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotaterightenable.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotaterightenable.png deleted file mode 100644 index d768531fca400de87d148dca3b9b7ae88bce4b61..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/rotaterightenable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/upload.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/upload.png deleted file mode 100644 index 7bb15b3d6d6799504cf7093a1600bd7ece0d9ef5..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/en/images/upload.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/copy.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/copy.png deleted file mode 100644 index 66b6fe71757822ab6962141c33fea3feb3a0297f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/copy.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/localimage.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/localimage.png deleted file mode 100644 index ebacdefd64d8766fc74a93a9c2d99cef44bfe451..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/localimage.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/music.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/music.png deleted file mode 100644 index a11dae89251faf5b7d5f1e3f37253af085f6219c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/music.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/upload.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/upload.png deleted file mode 100644 index 60561e4b24453c34b0b52725b90ace6e37ce3768..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/images/upload.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/ja-jp.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/ja-jp.js deleted file mode 100644 index f274f2a09c1138d37b18b81dd33185a353ec5cce..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/ja-jp/ja-jp.js +++ /dev/null @@ -1,665 +0,0 @@ -/** - */ -UE.I18N['ja-jp'] = { - 'labelMap':{ - 'anchor':'アンカー', 'undo':'アンドゥー', 'redo':'リドゥー', 'bold':'太字', 'indent':'インデント', 'snapscreen':'スクリーンショット', - 'italic':'斜体', 'underline':'下線', 'strikethrough':'取り消し線', 'subscript':'下付き','fontborder':'囲み線', - 'superscript':'上付き', 'formatmatch':'書式のコピー/貼り付け', 'source':'ソースコード', 'blockquote':'参考資料', - 'pasteplain':'テキストのみ保持', 'selectall':'すべて選択','print':'印刷', 'preview':'プレビュー', - 'horizontal':'セパレーター', 'removeformat':'フォーマットをクリア', 'time':'タイム', 'date':'デート', - 'unlink':'リンクを解除する', 'insertrow':'前に行を挿入', 'insertcol':'前に列を挿入', 'mergeright':'右にセルをマージ', 'mergedown':'下にセールをマージ', - 'deleterow':'行を削除', 'deletecol':'列を削除', 'splittorows':'行に分割', - 'splittocols':'列に分割', 'splittocells':'セルを分割','deletecaption':'テーブルのヘッダを削除する','inserttitle':'タイトルを挿入する', - 'mergecells':'複数のセルをマージする', 'deletetable':'テーブルを削除する', 'cleardoc':'ドキュメントをクリアする','insertparagraphbeforetable':"テーブルの前に行を挿入する",'insertcode':'コード言語', - 'fontfamily':'フォント', 'fontsize':'フォントサイズ', 'paragraph':'段落書式', 'simpleupload':'単一画像アップロード', 'insertimage':'複数画像アップロード','edittable':'表属性','edittd':'セル属性', 'link':'ハイパーリンク', - 'emotion':'絵文字', 'spechars':'特殊文字', 'searchreplace':'置換', 'map':'Baiduマップ', 'gmap':'Googleマップ', - 'insertvideo':'ビデオ', 'help':'ヘルプ','justifyleft':'左揃え', 'justifyright':'右揃え', 'justifycenter':'中央揃え', - 'justifyjustify':'両端揃え', 'forecolor':'フォントの色', 'backcolor':'背景色', 'insertorderedlist':'順序付きリスト', - 'insertunorderedlist':'順序付けられていないリスト', 'fullscreen':'フルスクリーン', 'directionalityltr':'左から右へ', 'directionalityrtl':'右から左へ', - 'rowspacingtop':'段落前の間隔', 'rowspacingbottom':'段落後の間隔', 'pagebreak':'ページ区切り', 'insertframe':'Iframeの挿入', 'imagenone':'デフォルト', - 'imageleft':'左フロート', 'imageright':'右フロート', 'attachment':'添付ファイル', 'imagecenter':'中央揃え', 'wordimage':'画像ダンプ', - 'lineheight':'行間隔','edittip' :'編集チップ','customstyle':'カスタムタイトル', 'autotypeset':'自動レイアウト', - 'webapp':'baiduapp','touppercase':'大文字', 'tolowercase':'小文字','background':'背景','template':'テンプレート','scrawl':'绘画', - 'music':'音楽', 'inserttable':'表の挿入','drafts': '下書きから読み込み', 'charts': 'チャート' - }, - 'insertorderedlist':{ - 'num':'1,2,3...', - 'num1':'1),2),3)...', - 'num2':'(1),(2),(3)...', - 'cn':'一,二,三....', - 'cn1':'一),二),三)....', - 'cn2':'(一),(二),(三)....', - 'decimal':'1,2,3...', - 'lower-alpha':'a,b,c...', - 'lower-roman':'i,ii,iii...', - 'upper-alpha':'A,B,C...', - 'upper-roman':'I,II,III...' - }, - 'insertunorderedlist':{ - 'circle':'○ サークル', - 'disc':'● ディスク', - 'square':'■ スクエア ', - 'dash' :'— ダッシュ', - 'dot':' 。 ドット' - }, - 'paragraph':{'p':'段落', 'h1':'見出し1', 'h2':'見出し2', 'h3':'見出し3', 'h4':'見出し4', 'h5':'見出し5', 'h6':'見出し6'}, - 'fontfamily':{ - 'songti':'明朝体', - 'kaiti':'楷書体', - 'heiti':'ゴチック体', - 'lishu':'隷書', - 'yahei':'Msyh', - 'andaleMono':'andale mono', - 'arial': 'arial', - 'arialBlack':'arial black', - 'comicSansMs':'comic sans ms', - 'impact':'impact', - 'timesNewRoman':'times new roman' - }, - 'customstyle':{ - 'tc':'タイトル中央揃え', - 'tl':'タイトル左揃え', - 'im':'強調', - 'hi':'強調斜体' - }, - 'autoupload': { - 'exceedSizeError': 'ファイルサイズが上限を超えています', - 'exceedTypeError': 'ファイル形式が許可されていません', - 'jsonEncodeError': 'サーバーは形式エラーを返しました', - 'loading':"アップロード中...", - 'loadError':"アップロードエラー", - 'errorLoadConfig': 'バックグラウンド設定が正しく読み込まれていないため、プラグインのアップロードが正しく動作できません!' - }, - 'simpleupload':{ - 'exceedSizeError': 'ファイルサイズが上限を超えています', - 'exceedTypeError': 'ファイル形式が許可されていません', - 'jsonEncodeError': 'サーバーは形式エラーを返しました', - 'loading':"アップロード中...", - 'loadError':"アップロードエラー", - 'errorLoadConfig': 'バックグラウンド設定が正しく読み込まれていないため、プラグインのアップロードが正しく動作できません!' - }, - 'elementPathTip':"エレメントパス", - 'wordCountTip':"文字カウント", - 'wordCountMsg':'現在、{#count}文字が入力されました。また、{#leave}文字を入力できます。 ', - 'wordOverFlowMsg':'文字の数が許容される最大値を超えているため、サーバーは保存を拒否する可能性があります。!', - 'ok':"ok", - 'cancel':"キャンセル", - 'closeDialog':"閉じる", - 'tableDrag':"表をドラッグするにはuiUtils.jsを導入しなければなりません!", - 'autofloatMsg':"ツールバーのフロートはエディタUIと関連しているので、UIファイルを導入しなければなりません!", - 'loadconfigError': 'バックグラウンド設定リクエスト獲得エラー、アップロードできません!', - 'loadconfigFormatError': 'バックグラウンド設定項目は形式エラーを返します。アップロードできません!', - 'loadconfigHttpError': 'バックグラウンド設定項目をリクエストするhttpエラー、アップロードできません!', - 'snapScreen_plugin':{ - 'browserMsg':"IEブラウザのみをサポートしています!", - 'callBackErrorMsg':"サーバーはデータエラーを返しました。設定項目を確認してからもう一度お試しください。", - 'uploadErrorMsg':"スクリーンショットのアップロードは失敗しました。サーバー側の環境を確認してください!! " - }, - 'insertcode':{ - 'as3':'ActionScript 3', - 'bash':'Bash/Shell', - 'cpp':'C/C++', - 'css':'CSS', - 'cf':'ColdFusion', - 'c#':'C#', - 'delphi':'Delphi', - 'diff':'Diff', - 'erlang':'Erlang', - 'groovy':'Groovy', - 'html':'HTML', - 'java':'Java', - 'jfx':'JavaFX', - 'js':'JavaScript', - 'pl':'Perl', - 'php':'PHP', - 'plain':'Plain Text', - 'ps':'PowerShell', - 'python':'Python', - 'ruby':'Ruby', - 'scala':'Scala', - 'sql':'SQL', - 'vb':'Visual Basic', - 'xml':'XML' - }, - 'confirmClear':"現在のドキュメントをクリアしてもよろしいですか?", - 'contextMenu':{ - 'delete':"削除", - 'selectall':"すべて選択", - 'deletecode':"コードを削除する", - 'cleardoc':"ドキュメントをクリア", - 'confirmclear':"現在のドキュメントをクリアしてもよろしいですか?", - 'unlink':"ハイパーリンクを削除", - 'paragraph':"段落書式", - 'edittable':"表属性", - 'aligntd':"セルの配置", - 'aligntable':'表の配置', - 'tableleft':'左フロート', - 'tablecenter':'中央表示', - 'tableright':'右フロート', - 'edittd':"セル属性", - 'setbordervisible':'表エッジ表示の設定', - 'justifyleft':'左揃え', - 'justifyright':'右揃え', - 'justifycenter':'中央揃え', - 'justifyjustify':'両端揃え', - 'table':"表", - 'inserttable':'表の挿入', - 'deletetable':"表の削除", - 'insertparagraphbefore':"前に段落を挿入する", - 'insertparagraphafter':'後に段落を挿入する', - 'deleterow':"現在の行を削除する", - 'deletecol':"現在の列を削除する", - 'insertrow':"前に行を挿入する", - 'insertcol':"左に列を挿入する", - 'insertrownext':'後に行を挿入する', - 'insertcolnext':'右に列を挿入する', - 'insertcaption':'表名を挿入する', - 'deletecaption':'表名を削除する', - 'inserttitle':'表のタイトル行を挿入', - 'deletetitle':'表のタイトル行を削除', - 'inserttitlecol':'表のタイトル列を挿入', - 'deletetitlecol':'表のタイトル列を削除', - 'averageDiseRow':'各行の平均分布', - 'averageDisCol':'各列の平均分布', - 'mergeright':"右にマージする", - 'mergeleft':"左にマージする", - 'mergedown':"下にマージする", - 'mergecells':"セルをマージする", - 'splittocells':"セルを完全に分割する", - 'splittocols':"列に分割", - 'splittorows':"行に分割", - 'tablesort':'表のソート', - 'enablesort':'表のソート可能を設定', - 'disablesort':'表のソート可能を取り消し', - 'reversecurrent':'逆ソート', - 'orderbyasc':'ASCIIによって昇順', - 'reversebyasc':'ASCIIによって降順', - 'orderbynum':'数値によって昇順', - 'reversebynum':'数値によって降順', - 'borderbk':'ボーダーシェーディング', - 'setcolor':'テーブルのインターレース変色', - 'unsetcolor':'テーブルのインターレース変色をキャンセルする', - 'setbackground':'選択の背景インターレース', - 'unsetbackground':'選択の背景をキャンセルする', - 'redandblue':'赤と青間隔', - 'threecolorgradient':'3色グラデーション', - 'copy':"コピー(Ctrl + c)", - 'copymsg': "ブラウザはこれをサポートしません。「Ctrl + c」を使ってください", - 'paste':"貼り付け(Ctrl + v)", - 'pastemsg': "ブラウザはこれをサポートしません。「Ctrl + v」を使ってください" - }, - 'copymsg': "ブラウザはこれをサポートしません。「Ctrl + c」を使ってください", - 'pastemsg': "ブラウザはこれをサポートしません。「Ctrl + v」を使ってください", - 'anthorMsg':"リンク", - 'clearColor':'色をクリア', - 'standardColor':'標準色', - 'themeColor':'テーマの色', - 'property':'属性', - 'default':'デフォルト', - 'modify':'変更', - 'justifyleft':'左揃え', - 'justifyright':'右揃え', - 'justifycenter':'中央揃え', - 'justify':'デフォルト', - 'clear':'クリア', - 'anchorMsg':'アンカー', - 'delete':'削除', - 'clickToUpload':"アップロード", - 'unset':'言語ファイルが設定されていません', - 't_row':'行', - 't_col':'列', - 'more':'その他', - 'pasteOpt':'貼り付けのオプション', - 'pasteSourceFormat':"元の書式を保持", - 'tagFormat':'ラベルのみを保持', - 'pasteTextFormat':'テキストのみを保持', - 'autoTypeSet':{ - 'mergeLine':"空白行をマージ", - 'delLine':"空白行をクリア", - 'removeFormat':"書式をクリア", - 'indent':"字下げ", - 'alignment':"配置", - 'imageFloat':"画像フロート", - 'removeFontsize':"フォントサイズをクリア", - 'removeFontFamily':"フォントをクリア", - 'removeHtml':"HTMLコードをクリア", - 'pasteFilter':"貼り付けフィルタ", - 'run':"実行", - 'symbol':'シンボル変換', - 'bdc2sb':'全角から半角', - 'tobdc':'半角から全角' - }, - - 'background':{ - 'static':{ - 'lang_background_normal':'背景設定', - 'lang_background_local':'オンライン画像', - 'lang_background_set':'オプション', - 'lang_background_none':'背景色なし', - 'lang_background_colored':'背景色あり', - 'lang_background_color':'色の設定', - 'lang_background_netimg':'ネットワーク画像', - 'lang_background_align':'配置', - 'lang_background_position':'正確な位置付け', - 'repeatType':{'options':["中央揃え", "横方向の繰り返し", "縦方向の繰り返し", "タイル","カスタム"]} - - }, - 'noUploadImage':"まだ画像がアップロードされていません!", - 'toggleSelect':"クリックして選択ステータスを切り替え\n元のサイズ: " - }, - //===============dialog i18N======================= - 'insertimage':{ - 'static':{ - 'lang_tab_remote':"画像を挿入", //ノード - 'lang_tab_upload':"ローカルアップロード", - 'lang_tab_online':"オンライン管理", - 'lang_tab_search':"画像検索", - 'lang_input_url':"アドレス:", - 'lang_input_size':"サイズ:", - 'lang_input_width':"幅", - 'lang_input_height':"高さ", - 'lang_input_border':"ボーダー:", - 'lang_input_vhspace':"マージン:", - 'lang_input_title':"説明:", - 'lang_input_align':'画像フロート形式:', - 'lang_imgLoading':" 画像読み込み中...", - 'lang_start_upload':"アップロード", - 'lock':{'title':"アスペクト比をロック"}, //属性 - 'searchType':{'title':"イメージタイプ", 'options':["ニュース", "壁紙", "エモーション", "胸像"]}, //select的option        - 'searchTxt':{'value':"検索キーワードを入力してください"}, - 'searchBtn':{'value':"Baidu"}, - 'searchReset':{'value':"検索をクリア"}, - 'noneAlign':{'title':'ノーフロート'}, - 'leftAlign':{'title':'左フロート'}, - 'rightAlign':{'title':'右フロート'}, - 'centerAlign':{'title':'中央揃え、一行に占める'} - }, - 'uploadSelectFile':'クリックして画像を選択', - 'uploadAddFile':'追加を続ける', - 'uploadStart':'アップロードを開始する', - 'uploadPause':'アップロードを停止する', - 'uploadContinue':'アップロードを続ける', - 'uploadRetry':'アップロードを再試行する', - 'uploadDelete':'削除', - 'uploadTurnLeft':'左に回転', - 'uploadTurnRight':'右に回転', - 'uploadPreview':'プレビュー', - 'uploadNoPreview':'プレビューできません', - 'updateStatusReady': '_枚の画像を選択しました。合計で_KBです。', - 'updateStatusConfirm': '_枚の画像はアップロードしましたが。_枚の画像はアップロードしませんでした。', - 'updateStatusFinish': '合計で_枚(KB)です。_枚の画像はアップロードしました', - 'updateStatusError': '_枚の画像はアップロードしませんでした。', - 'errorNotSupport': 'WebUploaderはこのブラウザをサポートしません!IEブラウザを使用している場合、flashプレーヤーをアップグレードしてみてください。', - 'errorLoadConfig': 'バックググラウンド設定項目が正しく読み込まれていないため、アップロードプラグインは正しく動作できません!', - 'errorExceedSize':'フィイルサイズは超えました', - 'errorFileType':'ファイル形式は許可されていません', - 'errorInterrupt':'ファイル転送は中断しました', - 'errorUploadRetry':'アップロードに失敗しました。もう一度お試しください', - 'errorHttp':'httpリクエストエラー', - 'errorServerUpload':'サーバーはエラーを返しました', - 'remoteLockError':"幅と高さは正しくないため、設定できません", - 'numError':"正しい長さまたは幅の値を入力してください!たとえば、123,400", - 'imageUrlError':"許可されない画像形式または画像フィールド!", - 'imageLoadError':"イメージロードは失敗しました。リンクアドレス、ネット状態をチャックしてください!", - 'searchRemind':"検索キーワードを入力してください", - 'searchLoading':"イメージ読み込み中、お待ちください...", - 'searchRetry':" :( 申し訳ございません、写真が見つかりません!もう一度お試しください!" - }, - 'attachment':{ - 'static':{ - 'lang_tab_upload': '添付ファイルをアップロード', - 'lang_tab_online': 'オンライン添付ファイル', - 'lang_start_upload':"アップロード", - 'lang_drop_remind':"ファイルをここでドラッグして、一回、100個までのファイルを選択できます" - }, - 'uploadSelectFile':'ファイルを選択する', - 'uploadAddFile':'追加を続ける', - 'uploadStart':'アップロード', - 'uploadPause':'アップロードを停止する', - 'uploadContinue':'アップロードを続ける', - 'uploadRetry':'アップロードを再試行する', - 'uploadDelete':'削除', - 'uploadTurnLeft':'左に回転', - 'uploadTurnRight':'右に回転', - 'uploadPreview':'プレビュー', - 'updateStatusReady': '_枚の画像を選択しました。合計で_KBです。', - 'updateStatusConfirm': '_枚の画像はアップロードしましたが。_枚の画像はアップロードしませんでした', - 'updateStatusFinish': '合計で_枚(KB)です。_枚の画像はアップロードしました', - 'updateStatusError': ',_枚の画像はアップロードしませんでした。', - 'errorNotSupport': 'WebUploaderはこのブラウザをサポートしません!IEブラウザを使用している場合、flashプレーヤーをアップグレードしてみてください。', - 'errorLoadConfig': 'バックググラウンド設定項目が正しく読み込まれていないため、アップロードプラグインは正しく動作できません!', - 'errorExceedSize':'フィイルサイズは超えました', - 'errorFileType':'ファイル形式は許可されていません', - 'errorInterrupt':'ファイル転送は中断しました', - 'errorUploadRetry':'アップロードに失敗しました。もう一度お試しください。', - 'errorHttp':'httpリクエストエラー', - 'errorServerUpload':'サーバーはエラーを返しました' - }, - 'insertvideo':{ - 'static':{ - 'lang_tab_insertV':"動画を挿入", - 'lang_tab_searchV':"動画を検索", - 'lang_tab_uploadV':"動画をアップロード", - 'lang_video_url':"動画URL", - 'lang_video_size':"動画サイズ", - 'lang_videoW':"幅", - 'lang_videoH':"高さ", - 'lang_alignment':"配置", - 'videoSearchTxt':{'value':"検索キーワードを入力してください!"}, - 'videoType':{'options':["すべて", "人気", "娯楽", "お笑い", "スポーツ", "科学技術", "バラエティ"]}, - 'videoSearchBtn':{'value':"baidu"}, - 'videoSearchReset':{'value':"結果をクリア"}, - - 'lang_input_fileStatus':' ファイルをアップロードしていません', - 'startUpload':{'style':"background:url(upload.png) no-repeat;"}, - - 'lang_upload_size':"動画サイズ", - 'lang_upload_width':"幅", - 'lang_upload_height':"高さ", - 'lang_upload_alignment':"配置", - 'lang_format_advice':"mp4形式をおすすめします。." - - }, - 'numError':"123,400などの正しい値を入力してください", - 'floatLeft':"左フロート", - 'floatRight':"右フロート", - '"default"':"デフォルト", - 'block':"一行に占める", - 'urlError':"動画URLは間違っています。チャックしてからもう一度お試しください!", - 'loading':"  動画読み込み中、しばらくお待ちください...", - 'clickToSelect':"クリックして選択", - 'goToSource':'訪問元の動画', - 'noVideo':"    申し訳ございません。ビデオが見つかりませんでした、もう一度お試しください!", - - 'browseFiles':'ファイルブラウザ', - 'uploadSuccess':'アップロードしました!', - 'delSuccessFile':'アップロード済みのファイルから削除', - 'delFailSaveFile':'アップロード失敗ファイルを削除する', - 'statusPrompt':'のファイルがアップロードされました! ', - 'flashVersionError':'現在のFlashバージョンは低すぎます。FlashPlayerを更新してもう一度お試しください!', - 'flashLoadingError':'Flashロードに失敗しました!パスまたはネットワーク状態を確認してください', - 'fileUploadReady':'アップロード待ち……', - 'delUploadQueue':'アップロード中のファイルから削除', - 'limitPrompt1':' までのファイルを選択できません', - 'limitPrompt2':' のファイル!もう一度選択してください!', - 'delFailFile':'アップロード失敗したファイルを削除する', - 'fileSizeLimit':'ファイルサイズが上限を超えました!', - 'emptyFile':'文字なしのファイルをアップロードできません!', - 'fileTypeError':'ファイルタイプが許可されていません!', - 'unknownError':'不明なエラー!', - 'fileUploading':'アップロード中、お待ちください...', - 'cancelUpload':'アップロードをキャンセル', - 'netError':'ネットワークエラー', - 'failUpload':'アップロードに失敗しました!', - 'serverIOError':'サーバーIOエラー!', - 'noAuthority':'許可なし!', - 'fileNumLimit':'アップロード数量制限', - 'failCheck':'認証に失敗しました。今回のアップロードは省略されました!', - 'fileCanceling':'キャンセル中、お待ちください...', - 'stopUploading':'アップロードが停止されました...', - - 'uploadSelectFile':'ファイルを選択', - 'uploadAddFile':'追加を続ける', - 'uploadStart':'アップロード', - 'uploadPause':'アップロードを停止する', - 'uploadContinue':'アップロードを続ける', - 'uploadRetry':'アップロードを再試行する', - 'uploadDelete':'削除', - 'uploadTurnLeft':'左に回転', - 'uploadTurnRight':'右に回転', - 'uploadPreview':'プレビュー', - 'updateStatusReady': 'のファイルを選択し、合計で_KBです。', - 'updateStatusConfirm': '_枚のファイルをアップロードしました、_枚のファイルがアップロードしませんでした', - 'updateStatusFinish': '合計__(_KB)です、_のファイルをアップロードしました', - 'updateStatusError': ',_枚はアップロードしませんでした。。', - 'errorNotSupport': 'WebUploaderはこのブラウザをサポートしません!IEブラウザを使用している場合、flashプレーヤーをアップグレードしてみてください。', - 'errorLoadConfig': 'バックググラウンド設定項目が正しく読み込まれていないため、アップロードプラグインは正しく動作できません!', - 'errorExceedSize':'フィイルサイズは超えました', - 'errorFileType':'ファイル形式は許可されていません', - 'errorInterrupt':'ファイル転送は中断しました', - 'errorUploadRetry':'アップロードに失敗しました。もう一度お試しください。', - 'errorHttp':'httpリクエストエラー', - 'errorServerUpload':'サーバーがエラーを返しました' - }, - 'webapp':{ - 'tip1':"この機能はBaiduによって提供されています。このページが表示された場合、まずサイト管理者はBaidu APPKeyを申し込んでください!", - 'tip2':"申し込んでから、neditor.config.jsからのappkeyを設定してください! ", - 'applyFor':"申し込む", - 'anthorApi':"Baidu API" - }, - 'template':{ - 'static':{ - 'lang_template_bkcolor':'背景色', - 'lang_template_clear' : '元のコンテンツを保持', - 'lang_template_select' : 'テンプレートを選択' - }, - 'blank':"空白のテクスト", - 'blog':"ブログ", - 'resume':"履歴書", - 'richText':"イメージとテキスト", - 'sciPapers':"技術論文" - - - }, - 'scrawl':{ - 'static':{ - 'lang_input_previousStep':"前", - 'lang_input_nextsStep':"次へ", - 'lang_input_clear':'クリア', - 'lang_input_addPic':'背景を追加', - 'lang_input_ScalePic':'背景を拡大', - 'lang_input_removePic':'背景を削除', - 'J_imgTxt':{title:'背景画像を追加'} - }, - 'noScarwl':"何もかかっていない、空白の紙~", - 'scrawlUpLoading':"落書きのアップロード中、心配しないでください~", - 'continueBtn':"続行", - 'imageError':"やばい、画像の読み込みに失敗しました!", - 'backgroundUploading':'背景画像のアップロード中、心配しないでください~' - }, - 'music':{ - 'static':{ - 'lang_input_tips':"歌手/音楽/アルバムを入力し、興味のある音楽を検索してください!", - 'J_searchBtn':{value:'音楽を検索'} - }, - 'emptyTxt':'検索条件と一致する結果がありません。別のキーワードを変更してみてください。', - 'chapter':'音楽', - 'singer':'歌手', - 'special':'アルバム', - 'listenTest':'試聴' - }, - 'anchor':{ - 'static':{ - 'lang_input_anchorName':'アンカー名:' - } - }, - 'charts':{ - 'static':{ - 'lang_data_source':'データソース:', - 'lang_chart_format': 'グラフ形式:', - 'lang_data_align': 'データの配置', - 'lang_chart_align_same': 'データソースはグラフのXY軸と一致しています', - 'lang_chart_align_reverse': 'データソースはチャートXY軸と逆です', - 'lang_chart_title': 'チャートのタイトル', - 'lang_chart_main_title': 'メインタイトル:', - 'lang_chart_sub_title': 'サブタイトル:', - 'lang_chart_x_title': 'X軸タイトル:', - 'lang_chart_y_title': 'Y軸タイトル:', - 'lang_chart_tip': 'チップ文字', - 'lang_cahrt_tip_prefix': 'チップ文字プレフィックス:', - 'lang_cahrt_tip_description': '円グラフのみ有効です。マウスが円グラフに移動したとき、プロンプトボックス内のテキストのプレフィックスを表示します', - 'lang_chart_data_unit': 'データ単位', - 'lang_chart_data_unit_title': '単位:', - 'lang_chart_data_unit_description': '各データポイントに表示されるデータの単位。例えば、温度の単位°C', - 'lang_chart_type': 'グラフタイプ', - 'lang_prev_btn': '前', - 'lang_next_btn': '次へ' - } - }, - 'emotion':{ - 'static':{ - 'lang_input_choice':'選択', - 'lang_input_Tuzki':'Tuzki', - 'lang_input_BOBO':'BOBO', - 'lang_input_lvdouwa':'カブトムシ', - 'lang_input_babyCat':'baby猫', - 'lang_input_bubble':'バブル', - 'lang_input_youa':'はい' - } - }, - 'gmap':{ - 'static':{ - 'lang_input_address':'アドレス', - 'lang_input_search':'検索', - 'address':{value:"北京"} - }, - searchError:'このアドレスが見つかりません!' - }, - 'help':{ - 'static':{ - 'lang_input_about':'UEditorについて', - 'lang_input_shortcuts':'ショートカットキー', - 'lang_input_introduction':'UEditorは、Baidu WebフロントエンドのR&D部門によって開発された豊富なテキストWebエディタです。軽量で、カスタマイズ可能で、ユーザ優先などの特長が持っています。オープンソースはBSDプロトコルに基づいており、コードの自由な使用と変更が可能です。', - - 'lang_Txt_shortcuts':'ショートカットキー', - 'lang_Txt_func':'機能', - 'lang_Txt_bold':'選択された文字列を太字にします', - 'lang_Txt_copy':'選択されたコンテンツをコピーする', - 'lang_Txt_cut':'選択されたコンテンツをカットする', - 'lang_Txt_Paste':'貼り付け', - 'lang_Txt_undo':'最後の操作を再実行する', - 'lang_Txt_redo':'最後の操作を元に戻す', - 'lang_Txt_italic':'選択された文字列を斜体にします', - 'lang_Txt_underline':'選択された文字列に下線を引きます', - 'lang_Txt_selectAll':'すべて選択', - 'lang_Txt_visualEnter':'ソフトリターン', - 'lang_Txt_fullscreen':'フルスクリーン' - } - }, - 'insertframe':{ - 'static':{ - 'lang_input_address':'アドレス:', - 'lang_input_width':'幅', - 'lang_input_height':'高さ:', - 'lang_input_isScroll':'スクロールバーを許可', - 'lang_input_frameborder':'フレーム枠を表示', - 'lang_input_alignMode':'配置', - 'align':{title:"配置", options:["デフォルト", "左揃え", "右揃え", "中央揃え"]} - }, - 'enterAddress':'アドレスを入力してください!' - }, - 'link':{ - 'static':{ - 'lang_input_text':'コンテンツ:', - 'lang_input_url':'リンクアドレス:', - 'lang_input_title':'タイトル:', - 'lang_input_target':'新しいウィンドウで開きますか:' - }, - 'validLink':'リンクを選択する場合のみ、有効', - 'httpPrompt':'ご入力いただいたハイパーリンクにはhttpなどのプロトコル名が含まれておらず、デフォルトはhttp://を追加します' - }, - 'map':{ - 'static':{ - lang_city:"都市", - lang_address:"アドレス", - city:{value:"北京"}, - lang_search:"検索", - lang_dynamicmap:"ダイナミックマップを挿入する" - }, - cityMsg:"都市を選んでください", - errorMsg:"申し訳ございませんが、場所が見つかりません!" - }, - 'searchreplace':{ - 'static':{ - lang_tab_search:"検索", - lang_tab_replace:"置換", - lang_search1:"検索", - lang_search2:"検索", - lang_replace:"置換", - lang_searchReg:'正規表現をサポートします。前後方スラッシュを追加する場合は正規表現です。例えば、“/expression/”', - lang_searchReg1:'正規表現をサポートします。前後方スラッシュを追加する場合は正規表現です。例えば、“/expression/”', - lang_case_sensitive1:"大文字と小文字を区別", - lang_case_sensitive2:"大文字と小文字を区別", - nextFindBtn:{value:"次へ"}, - preFindBtn:{value:"前"}, - nextReplaceBtn:{value:"次へ"}, - preReplaceBtn:{value:"前"}, - repalceBtn:{value:"置換"}, - repalceAllBtn:{value:"すべて置換"} - }, - getEnd:"既にテキストの最後まで検索しました!", - getStart:"テキストのトップまで検索しました", - countMsg:"合計で{#count}を置き換えました!" - }, - 'snapscreen':{ - 'static':{ - lang_showMsg:"スクリーンショット機能を使うにはUEditorプラグインをインストールする必要があります!", - lang_download:"クリックしてダウンロード", - lang_step1:"ステップ1:UEditorプラグインをダウンロードしてからインストールしてください。", - lang_step2:"ステップ2:インストールした後に使用できますが、うまくいかない場合は、ブラウザを再起動して試してください!" - } - }, - 'spechars':{ - 'static':{}, - tsfh:"特殊文字", - lmsz:"ローマ", - szfh:"数字", - rwfh:"日本語", - xlzm:"ギリシャ", - ewzm:"ロシア語", - pyzm:"ピンイン文字", - yyyb:"英語音声", - zyzf:"その他" - }, - 'edittable':{ - 'static':{ - 'lang_tableStyle':'表の様式', - 'lang_insertCaption':'表名の行を追加', - 'lang_insertTitle':'表の見出し行を追加', - 'lang_insertTitleCol':'表の見出し列を追加', - 'lang_orderbycontent':"表の内容をソート可能にする", - 'lang_tableSize':'表のサイズを自動的に調整する', - 'lang_autoSizeContent':'表のテキストによる適応', - 'lang_autoSizePage':'ページ幅による適応', - 'lang_example':'例', - 'lang_borderStyle':'表の外枠', - 'lang_color':'色:' - }, - captionName:'表名', - titleName:'タイトル', - cellsName:'コンテンツ', - errorMsg:'マージされたセルがあるので、ソートできません' - }, - 'edittip':{ - 'static':{ - lang_delRow:'行全体を削除する', - lang_delCol:'列全体を削除する' - } - }, - 'edittd':{ - 'static':{ - lang_tdBkColor:'背景色:' - } - }, - 'formula':{ - 'static':{ - } - }, - 'wordimage':{ - 'static':{ - lang_resave:"保存ステップ", - uploadBtn:{src:"upload.png",alt:"アップロード"}, - clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"}, - lang_step:"1、トップのコピーボタンをクリックしてアドレスをクリップボードにコピーする; 2.写真の追加ボタンをクリックしてダイアログボックスで「Ctrl+V」を押してください3.開いてて画像アップロードプロセスを選択してください。" - }, - 'fileType':"イメージ", - 'flashError':"初期化に失敗しました。プラグインが正しくインストールされているか確認してください!", - 'netError':"ネットエラー、もう一度お試しください!", - 'copySuccess':"イメージURLがコピーされました!", - 'flashI18n':{} //ブランクがある場合、中国語を表示 - }, - 'autosave': { - 'saving':'保存中...', - 'success':'ローカル保存成功' - } -}; diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/copy.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/copy.png deleted file mode 100644 index b2536aac72e763b9a872b507462458ecb96990f0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/copy.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/localimage.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/localimage.png deleted file mode 100644 index 7303c364318b6ac27dc4a8ae6717124d8dafaff9..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/localimage.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/music.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/music.png deleted file mode 100644 index 842cb938703092b9024e609a2cc55c270cf35092..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/music.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/upload.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/upload.png deleted file mode 100644 index 08d4d9268204a20ca343bf75784302cc706d2417..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/images/upload.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/zh-cn.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/zh-cn.js deleted file mode 100644 index 5210c079822e34d6b5e74c49ecda8898f0d17b28..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/i18n/zh-cn/zh-cn.js +++ /dev/null @@ -1,669 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: taoqili - * Date: 12-6-12 - * Time: 下午5:02 - * To change this template use File | Settings | File Templates. - */ -UE.I18N['zh-cn'] = { - 'labelMap':{ - 'anchor':'锚点', 'undo':'撤销', 'redo':'重做', 'bold':'加粗', 'indent':'首行缩进', 'snapscreen':'截图', - 'italic':'斜体', 'underline':'下划线', 'strikethrough':'删除线', 'subscript':'下标','fontborder':'字符边框', - 'superscript':'上标', 'formatmatch':'格式刷', 'source':'源代码', 'blockquote':'引用', - 'pasteplain':'纯文本粘贴模式', 'selectall':'全选', 'print':'打印', 'preview':'预览', - 'horizontal':'分隔线', 'removeformat':'清除格式', 'time':'时间', 'date':'日期', - 'unlink':'取消链接', 'insertrow':'前插入行', 'insertcol':'前插入列', 'mergeright':'右合并单元格', 'mergedown':'下合并单元格', - 'deleterow':'删除行', 'deletecol':'删除列', 'splittorows':'拆分成行', - 'splittocols':'拆分成列', 'splittocells':'完全拆分单元格','deletecaption':'删除表格标题','inserttitle':'插入标题', - 'mergecells':'合并多个单元格', 'deletetable':'删除表格', 'cleardoc':'清空文档','insertparagraphbeforetable':"表格前插入行",'insertcode':'代码语言', - 'fontfamily':'字体', 'fontsize':'字号', 'paragraph':'段落格式', 'simpleupload':'单图上传', 'insertimage':'多图上传','edittable':'表格属性','edittd':'单元格属性', 'link':'超链接', - 'emotion':'表情', 'spechars':'特殊字符', 'searchreplace':'查询替换', 'map':'Baidu地图', 'gmap':'Google地图', - 'insertvideo':'视频', 'help':'帮助', 'justifyleft':'居左对齐', 'justifyright':'居右对齐', 'justifycenter':'居中对齐', - 'justifyjustify':'两端对齐', 'forecolor':'字体颜色', 'backcolor':'背景色', 'insertorderedlist':'有序列表', - 'insertunorderedlist':'无序列表', 'fullscreen':'全屏', 'directionalityltr':'从左向右输入', 'directionalityrtl':'从右向左输入', - 'rowspacingtop':'段前距', 'rowspacingbottom':'段后距', 'pagebreak':'分页', 'insertframe':'插入Iframe', 'imagenone':'默认', - 'imageleft':'左浮动', 'imageright':'右浮动', 'attachment':'附件', 'imagecenter':'居中', 'wordimage':'图片转存', - 'lineheight':'行间距','edittip' :'编辑提示','customstyle':'自定义标题', 'autotypeset':'自动排版', - 'webapp':'百度应用','touppercase':'字母大写', 'tolowercase':'字母小写','background':'背景','template':'模板','scrawl':'涂鸦', - 'music':'音乐','inserttable':'插入表格','drafts': '从草稿箱加载', 'charts': '图表' - }, - 'insertorderedlist':{ - 'num':'1,2,3...', - 'num1':'1),2),3)...', - 'num2':'(1),(2),(3)...', - 'cn':'一,二,三....', - 'cn1':'一),二),三)....', - 'cn2':'(一),(二),(三)....', - 'decimal':'1,2,3...', - 'lower-alpha':'a,b,c...', - 'lower-roman':'i,ii,iii...', - 'upper-alpha':'A,B,C...', - 'upper-roman':'I,II,III...' - }, - 'insertunorderedlist':{ - 'circle':'○ 大圆圈', - 'disc':'● 小黑点', - 'square':'■ 小方块 ', - 'dash' :'— 破折号', - 'dot':' 。 小圆圈' - }, - 'paragraph':{'p':'段落', 'h1':'标题 1', 'h2':'标题 2', 'h3':'标题 3', 'h4':'标题 4', 'h5':'标题 5', 'h6':'标题 6'}, - 'fontfamily':{ - 'songti':'宋体', - 'kaiti':'楷体', - 'heiti':'黑体', - 'lishu':'隶书', - 'yahei':'微软雅黑', - 'andaleMono':'andale mono', - 'arial': 'arial', - 'arialBlack':'arial black', - 'comicSansMs':'comic sans ms', - 'impact':'impact', - 'timesNewRoman':'times new roman' - }, - 'customstyle':{ - 'tc':'标题居中', - 'tl':'标题居左', - 'im':'强调', - 'hi':'明显强调' - }, - 'autoupload': { - 'exceedSizeError': '文件大小超出限制', - 'exceedTypeError': '文件格式不允许', - 'jsonEncodeError': '服务器返回格式错误', - 'loading':"正在上传...", - 'loadError':"上传错误", - 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!' - }, - 'simpleupload':{ - 'exceedSizeError': '文件大小超出限制', - 'exceedTypeError': '文件格式不允许', - 'jsonEncodeError': '服务器返回格式错误', - 'loading':"正在上传...", - 'loadError':"上传错误", - 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!' - }, - 'elementPathTip':"元素路径", - 'wordCountTip':"字数统计", - 'wordCountMsg':'当前已输入{#count}个字符, 您还可以输入{#leave}个字符。 ', - 'wordOverFlowMsg':'字数超出最大允许值,服务器可能拒绝保存!', - 'ok':"确认", - 'cancel':"取消", - 'closeDialog':"关闭对话框", - 'tableDrag':"表格拖动必须引入uiUtils.js文件!", - 'autofloatMsg':"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!", - 'loadconfigError': '获取后台配置项请求出错,上传功能将不能正常使用!', - 'loadconfigFormatError': '后台配置项返回格式出错,上传功能将不能正常使用!', - 'loadconfigHttpError': '请求后台配置项http错误,上传功能将不能正常使用!', - 'snapScreen_plugin':{ - 'browserMsg':"仅支持IE浏览器!", - 'callBackErrorMsg':"服务器返回数据有误,请检查配置项之后重试。", - 'uploadErrorMsg':"截图上传失败,请检查服务器端环境! " - }, - 'insertcode':{ - 'as3':'ActionScript 3', - 'bash':'Bash/Shell', - 'cpp':'C/C++', - 'css':'CSS', - 'cf':'ColdFusion', - 'c#':'C#', - 'delphi':'Delphi', - 'diff':'Diff', - 'erlang':'Erlang', - 'groovy':'Groovy', - 'html':'HTML', - 'java':'Java', - 'jfx':'JavaFX', - 'js':'JavaScript', - 'pl':'Perl', - 'php':'PHP', - 'plain':'Plain Text', - 'ps':'PowerShell', - 'python':'Python', - 'ruby':'Ruby', - 'scala':'Scala', - 'sql':'SQL', - 'vb':'Visual Basic', - 'xml':'XML' - }, - 'confirmClear':"确定清空当前文档么?", - 'contextMenu':{ - 'delete':"删除", - 'selectall':"全选", - 'deletecode':"删除代码", - 'cleardoc':"清空文档", - 'confirmclear':"确定清空当前文档么?", - 'unlink':"删除超链接", - 'paragraph':"段落格式", - 'edittable':"表格属性", - 'aligntd':"单元格对齐方式", - 'aligntable':'表格对齐方式', - 'tableleft':'左浮动', - 'tablecenter':'居中显示', - 'tableright':'右浮动', - 'edittd':"单元格属性", - 'setbordervisible':'设置表格边线可见', - 'justifyleft':'左对齐', - 'justifyright':'右对齐', - 'justifycenter':'居中对齐', - 'justifyjustify':'两端对齐', - 'table':"表格", - 'inserttable':'插入表格', - 'deletetable':"删除表格", - 'insertparagraphbefore':"前插入段落", - 'insertparagraphafter':'后插入段落', - 'deleterow':"删除当前行", - 'deletecol':"删除当前列", - 'insertrow':"前插入行", - 'insertcol':"左插入列", - 'insertrownext':'后插入行', - 'insertcolnext':'右插入列', - 'insertcaption':'插入表格名称', - 'deletecaption':'删除表格名称', - 'inserttitle':'插入表格标题行', - 'deletetitle':'删除表格标题行', - 'inserttitlecol':'插入表格标题列', - 'deletetitlecol':'删除表格标题列', - 'averageDiseRow':'平均分布各行', - 'averageDisCol':'平均分布各列', - 'mergeright':"向右合并", - 'mergeleft':"向左合并", - 'mergedown':"向下合并", - 'mergecells':"合并单元格", - 'splittocells':"完全拆分单元格", - 'splittocols':"拆分成列", - 'splittorows':"拆分成行", - 'tablesort':'表格排序', - 'enablesort':'设置表格可排序', - 'disablesort':'取消表格可排序', - 'reversecurrent':'逆序当前', - 'orderbyasc':'按ASCII字符升序', - 'reversebyasc':'按ASCII字符降序', - 'orderbynum':'按数值大小升序', - 'reversebynum':'按数值大小降序', - 'borderbk':'边框底纹', - 'setcolor':'表格隔行变色', - 'unsetcolor':'取消表格隔行变色', - 'setbackground':'选区背景隔行', - 'unsetbackground':'取消选区背景', - 'redandblue':'红蓝相间', - 'threecolorgradient':'三色渐变', - 'copy':"复制(Ctrl + c)", - 'copymsg': "浏览器不支持,请使用 'Ctrl + c'", - 'paste':"粘贴(Ctrl + v)", - 'pastemsg': "浏览器不支持,请使用 'Ctrl + v'" - }, - 'copymsg': "浏览器不支持,请使用 'Ctrl + c'", - 'pastemsg': "浏览器不支持,请使用 'Ctrl + v'", - 'anthorMsg':"链接", - 'clearColor':'清空颜色', - 'standardColor':'标准颜色', - 'themeColor':'主题颜色', - 'property':'属性', - 'default':'默认', - 'modify':'修改', - 'justifyleft':'左对齐', - 'justifyright':'右对齐', - 'justifycenter':'居中', - 'justify':'默认', - 'clear':'清除', - 'anchorMsg':'锚点', - 'delete':'删除', - 'clickToUpload':"点击上传", - 'unset':'尚未设置语言文件', - 't_row':'行', - 't_col':'列', - 'more':'更多', - 'pasteOpt':'粘贴选项', - 'pasteSourceFormat':"保留源格式", - 'tagFormat':'只保留标签', - 'pasteTextFormat':'只保留文本', - 'autoTypeSet':{ - 'mergeLine':"合并空行", - 'delLine':"清除空行", - 'removeFormat':"清除格式", - 'indent':"首行缩进", - 'alignment':"对齐方式", - 'imageFloat':"图片浮动", - 'removeFontsize':"清除字号", - 'removeFontFamily':"清除字体", - 'removeHtml':"清除冗余HTML代码", - 'pasteFilter':"粘贴过滤", - 'run':"执行", - 'symbol':'符号转换', - 'bdc2sb':'全角转半角', - 'tobdc':'半角转全角' - }, - - 'background':{ - 'static':{ - 'lang_background_normal':'背景设置', - 'lang_background_local':'在线图片', - 'lang_background_set':'选项', - 'lang_background_none':'无背景色', - 'lang_background_colored':'有背景色', - 'lang_background_color':'颜色设置', - 'lang_background_netimg':'网络图片', - 'lang_background_align':'对齐方式', - 'lang_background_position':'精确定位', - 'repeatType':{'options':["居中", "横向重复", "纵向重复", "平铺","自定义"]} - - }, - 'noUploadImage':"当前未上传过任何图片!", - 'toggleSelect':"单击可切换选中状态\n原图尺寸: " - }, - //===============dialog i18N======================= - 'insertimage':{ - 'static':{ - 'lang_tab_remote':"插入图片", //节点 - 'lang_tab_upload':"本地上传", - 'lang_tab_online':"在线管理", - 'lang_tab_search':"图片搜索", - 'lang_input_url':"地 址:", - 'lang_input_size':"大 小:", - 'lang_input_width':"宽度", - 'lang_input_height':"高度", - 'lang_input_border':"边 框:", - 'lang_input_vhspace':"边 距:", - 'lang_input_title':"描 述:", - 'lang_input_align':'图片浮动方式:', - 'lang_imgLoading':" 图片加载中……", - 'lang_start_upload':"开始上传", - 'lock':{'title':"锁定宽高比例"}, //属性 - 'searchType':{'title':"图片类型", 'options':["全部类型", "头像图片", "面部特写", "卡通画", "简笔画", "动态图片", "静态图片"]}, //select的option - 'searchTxt':{'value':"请输入搜索关键词"}, - 'searchBtn':{'value':"百度一下"}, - 'searchReset':{'value':"清空搜索"}, - 'noneAlign':{'title':'无浮动'}, - 'leftAlign':{'title':'左浮动'}, - 'rightAlign':{'title':'右浮动'}, - 'centerAlign':{'title':'居中独占一行'} - }, - 'uploadSelectFile':'点击选择图片', - 'uploadAddFile':'继续添加', - 'uploadStart':'开始上传', - 'uploadPause':'暂停上传', - 'uploadContinue':'继续上传', - 'uploadRetry':'重试上传', - 'uploadDelete':'删除', - 'uploadTurnLeft':'向左旋转', - 'uploadTurnRight':'向右旋转', - 'uploadPreview':'预览中', - 'uploadNoPreview':'不能预览', - 'updateStatusReady': '选中_张图片,共_KB。', - 'updateStatusConfirm': '已成功上传_张照片,_张照片上传失败', - 'updateStatusFinish': '共_张(_KB),_张上传成功', - 'updateStatusError': ',_张上传失败。', - 'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', - 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', - 'errorExceedSize':'文件大小超出', - 'errorFileType':'文件格式不允许', - 'errorInterrupt':'文件传输中断', - 'errorUploadRetry':'上传失败,请重试', - 'errorHttp':'http请求错误', - 'errorServerUpload':'服务器返回出错', - 'remoteLockError':"宽高不正确,不能所定比例", - 'numError':"请输入正确的长度或者宽度值!例如:123,400", - 'imageUrlError':"不允许的图片格式或者图片域!", - 'imageLoadError':"图片加载失败!请检查链接地址或网络状态!", - 'searchRemind':"请输入搜索关键词", - 'searchLoading':"图片加载中,请稍后……", - 'searchRetry':" :( ,抱歉,没有找到图片!请重试一次!" - }, - 'attachment':{ - 'static':{ - 'lang_tab_upload': '上传附件', - 'lang_tab_online': '在线附件', - 'lang_start_upload':"开始上传", - 'lang_drop_remind':"可以将文件拖到这里,单次最多可选100个文件" - }, - 'uploadSelectFile':'点击选择文件', - 'uploadAddFile':'继续添加', - 'uploadStart':'开始上传', - 'uploadPause':'暂停上传', - 'uploadContinue':'继续上传', - 'uploadRetry':'重试上传', - 'uploadDelete':'删除', - 'uploadTurnLeft':'向左旋转', - 'uploadTurnRight':'向右旋转', - 'uploadPreview':'预览中', - 'updateStatusReady': '选中_个文件,共_KB。', - 'updateStatusConfirm': '已成功上传_个文件,_个文件上传失败', - 'updateStatusFinish': '共_个(_KB),_个上传成功', - 'updateStatusError': ',_张上传失败。', - 'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', - 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', - 'errorExceedSize':'文件大小超出', - 'errorFileType':'文件格式不允许', - 'errorInterrupt':'文件传输中断', - 'errorUploadRetry':'上传失败,请重试', - 'errorHttp':'http请求错误', - 'errorServerUpload':'服务器返回出错' - }, - 'insertvideo':{ - 'static':{ - 'lang_tab_insertV':"插入视频", - 'lang_tab_searchV':"搜索视频", - 'lang_tab_uploadV':"上传视频", - 'lang_video_url':"视频网址", - 'lang_video_size':"视频尺寸", - 'lang_videoW':"宽度", - 'lang_videoH':"高度", - 'lang_alignment':"对齐方式", - 'videoSearchTxt':{'value':"请输入搜索关键字!"}, - 'videoType':{'options':["全部", "热门", "娱乐", "搞笑", "体育", "科技", "综艺"]}, - 'videoSearchBtn':{'value':"百度一下"}, - 'videoSearchReset':{'value':"清空结果"}, - - 'lang_input_fileStatus':' 当前未上传文件', - 'startUpload':{'style':"background:url(upload.png) no-repeat;"}, - - 'lang_upload_size':"视频尺寸", - 'lang_upload_width':"宽度", - 'lang_upload_height':"高度", - 'lang_upload_alignment':"对齐方式", - 'lang_format_advice':"建议使用mp4格式." - - }, - 'numError':"请输入正确的数值,如123,400", - 'floatLeft':"左浮动", - 'floatRight':"右浮动", - 'default':"默认", - 'block':"独占一行", - 'urlError':"输入的视频地址有误,请检查后再试!", - 'loading':"  视频加载中,请等待……", - 'clickToSelect':"点击选中", - 'goToSource':'访问源视频', - 'noVideo':"    抱歉,找不到对应的视频,请重试!", - - 'browseFiles':'浏览文件', - 'uploadSuccess':'上传成功!', - 'delSuccessFile':'从成功队列中移除', - 'delFailSaveFile':'移除保存失败文件', - 'statusPrompt':' 个文件已上传! ', - 'flashVersionError':'当前Flash版本过低,请更新FlashPlayer后重试!', - 'flashLoadingError':'Flash加载失败!请检查路径或网络状态', - 'fileUploadReady':'等待上传……', - 'delUploadQueue':'从上传队列中移除', - 'limitPrompt1':'单次不能选择超过', - 'limitPrompt2':'个文件!请重新选择!', - 'delFailFile':'移除失败文件', - 'fileSizeLimit':'文件大小超出限制!', - 'emptyFile':'空文件无法上传!', - 'fileTypeError':'文件类型不允许!', - 'unknownError':'未知错误!', - 'fileUploading':'上传中,请等待……', - 'cancelUpload':'取消上传', - 'netError':'网络错误', - 'failUpload':'上传失败!', - 'serverIOError':'服务器IO错误!', - 'noAuthority':'无权限!', - 'fileNumLimit':'上传个数限制', - 'failCheck':'验证失败,本次上传被跳过!', - 'fileCanceling':'取消中,请等待……', - 'stopUploading':'上传已停止……', - - 'uploadSelectFile':'点击选择文件', - 'uploadAddFile':'继续添加', - 'uploadStart':'开始上传', - 'uploadPause':'暂停上传', - 'uploadContinue':'继续上传', - 'uploadRetry':'重试上传', - 'uploadDelete':'删除', - 'uploadTurnLeft':'向左旋转', - 'uploadTurnRight':'向右旋转', - 'uploadPreview':'预览中', - 'updateStatusReady': '选中_个文件,共_KB。', - 'updateStatusConfirm': '成功上传_个,_个失败', - 'updateStatusFinish': '共_个(_KB),_个成功上传', - 'updateStatusError': ',_张上传失败。', - 'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', - 'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', - 'errorExceedSize':'文件大小超出', - 'errorFileType':'文件格式不允许', - 'errorInterrupt':'文件传输中断', - 'errorUploadRetry':'上传失败,请重试', - 'errorHttp':'http请求错误', - 'errorServerUpload':'服务器返回出错' - }, - 'webapp':{ - 'tip1':"本功能由百度APP提供,如看到此页面,请各位站长首先申请百度APPKey!", - 'tip2':"申请完成之后请至neditor.config.js中配置获得的appkey! ", - 'applyFor':"点此申请", - 'anthorApi':"百度API" - }, - 'template':{ - 'static':{ - 'lang_template_bkcolor':'背景颜色', - 'lang_template_clear' : '保留原有内容', - 'lang_template_select' : '选择模板' - }, - 'blank':"空白文档", - 'blog':"博客文章", - 'resume':"个人简历", - 'richText':"图文混排", - 'sciPapers':"科技论文" - - - }, - 'scrawl':{ - 'static':{ - 'lang_input_previousStep':"上一步", - 'lang_input_nextsStep':"下一步", - 'lang_input_clear':'清空', - 'lang_input_addPic':'添加背景', - 'lang_input_ScalePic':'缩放背景', - 'lang_input_removePic':'删除背景', - 'J_imgTxt':{title:'添加背景图片'} - }, - 'noScarwl':"尚未作画,白纸一张~", - 'scrawlUpLoading':"涂鸦上传中,别急哦~", - 'continueBtn':"继续", - 'imageError':"糟糕,图片读取失败了!", - 'backgroundUploading':'背景图片上传中,别急哦~' - }, - 'music':{ - 'static':{ - 'lang_input_tips':"输入歌手/歌曲/专辑,搜索您感兴趣的音乐!", - 'J_searchBtn':{value:'搜索歌曲'} - }, - 'emptyTxt':'未搜索到相关音乐结果,请换一个关键词试试。', - 'chapter':'歌曲', - 'singer':'歌手', - 'special':'专辑', - 'listenTest':'试听' - }, - 'anchor':{ - 'static':{ - 'lang_input_anchorName':'锚点名字:' - } - }, - 'charts':{ - 'static':{ - 'lang_data_source':'数据源:', - 'lang_chart_format': '图表格式:', - 'lang_data_align': '数据对齐方式', - 'lang_chart_align_same': '数据源与图表X轴Y轴一致', - 'lang_chart_align_reverse': '数据源与图表X轴Y轴相反', - 'lang_chart_title': '图表标题', - 'lang_chart_main_title': '主标题:', - 'lang_chart_sub_title': '子标题:', - 'lang_chart_x_title': 'X轴标题:', - 'lang_chart_y_title': 'Y轴标题:', - 'lang_chart_tip': '提示文字', - 'lang_cahrt_tip_prefix': '提示文字前缀:', - 'lang_cahrt_tip_description': '仅饼图有效, 当鼠标移动到饼图中相应的块上时,提示框内的文字的前缀', - 'lang_chart_data_unit': '数据单位', - 'lang_chart_data_unit_title': '单位:', - 'lang_chart_data_unit_description': '显示在每个数据点上的数据的单位, 比如: 温度的单位 ℃', - 'lang_chart_type': '图表类型:', - 'lang_prev_btn': '上一个', - 'lang_next_btn': '下一个' - } - }, - 'emotion':{ - 'static':{ - 'lang_input_choice':'精选', - 'lang_input_Tuzki':'兔斯基', - 'lang_input_BOBO':'BOBO', - 'lang_input_lvdouwa':'绿豆蛙', - 'lang_input_babyCat':'baby猫', - 'lang_input_bubble':'泡泡', - 'lang_input_youa':'有啊' - } - }, - 'gmap':{ - 'static':{ - 'lang_input_address':'地址', - 'lang_input_search':'搜索', - 'address':{value:"北京"} - }, - searchError:'无法定位到该地址!' - }, - 'help':{ - 'static':{ - 'lang_input_about':'关于UEditor', - 'lang_input_shortcuts':'快捷键', - 'lang_input_introduction':'UEditor是由百度web前端研发部开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点。开源基于BSD协议,允许自由使用和修改代码。', - 'lang_Txt_shortcuts':'快捷键', - 'lang_Txt_func':'功能', - 'lang_Txt_bold':'给选中字设置为加粗', - 'lang_Txt_copy':'复制选中内容', - 'lang_Txt_cut':'剪切选中内容', - 'lang_Txt_Paste':'粘贴', - 'lang_Txt_undo':'重新执行上次操作', - 'lang_Txt_redo':'撤销上一次操作', - 'lang_Txt_italic':'给选中字设置为斜体', - 'lang_Txt_underline':'给选中字加下划线', - 'lang_Txt_selectAll':'全部选中', - 'lang_Txt_visualEnter':'软回车', - 'lang_Txt_fullscreen':'全屏' - } - }, - 'insertframe':{ - 'static':{ - 'lang_input_address':'地址:', - 'lang_input_width':'宽度:', - 'lang_input_height':'高度:', - 'lang_input_isScroll':'允许滚动条:', - 'lang_input_frameborder':'显示框架边框:', - 'lang_input_alignMode':'对齐方式:', - 'align':{title:"对齐方式", options:["默认", "左对齐", "右对齐", "居中"]} - }, - 'enterAddress':'请输入地址!' - }, - 'link':{ - 'static':{ - 'lang_input_text':'文本内容:', - 'lang_input_url':'链接地址:', - 'lang_input_title':'标题:', - 'lang_input_target':'是否在新窗口打开:' - }, - 'validLink':'只支持选中一个链接时生效', - 'httpPrompt':'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀' - }, - 'map':{ - 'static':{ - lang_city:"城市", - lang_address:"地址", - city:{value:"北京"}, - lang_search:"搜索", - lang_dynamicmap:"插入动态地图" - }, - cityMsg:"请选择城市", - errorMsg:"抱歉,找不到该位置!" - }, - 'searchreplace':{ - 'static':{ - lang_tab_search:"查找", - lang_tab_replace:"替换", - lang_search1:"查找", - lang_search2:"查找", - lang_replace:"替换", - lang_searchReg:'支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”', - lang_searchReg1:'支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”', - lang_case_sensitive1:"区分大小写", - lang_case_sensitive2:"区分大小写", - nextFindBtn:{value:"下一个"}, - preFindBtn:{value:"上一个"}, - nextReplaceBtn:{value:"下一个"}, - preReplaceBtn:{value:"上一个"}, - repalceBtn:{value:"替换"}, - repalceAllBtn:{value:"全部替换"} - }, - getEnd:"已经搜索到文章末尾!", - getStart:"已经搜索到文章头部", - countMsg:"总共替换了{#count}处!" - }, - 'snapscreen':{ - 'static':{ - lang_showMsg:"截图功能需要首先安装UEditor截图插件! ", - lang_download:"点此下载", - lang_step1:"第一步,下载UEditor截图插件并运行安装。", - lang_step2:"第二步,插件安装完成后即可使用,如不生效,请重启浏览器后再试!" - } - }, - 'spechars':{ - 'static':{}, - tsfh:"特殊字符", - lmsz:"罗马字符", - szfh:"数学字符", - rwfh:"日文字符", - xlzm:"希腊字母", - ewzm:"俄文字符", - pyzm:"拼音字母", - yyyb:"英语音标", - zyzf:"其他" - }, - 'edittable':{ - 'static':{ - 'lang_tableStyle':'表格样式', - 'lang_insertCaption':'添加表格名称行', - 'lang_insertTitle':'添加表格标题行', - 'lang_insertTitleCol':'添加表格标题列', - 'lang_orderbycontent':"使表格内容可排序", - 'lang_tableSize':'自动调整表格尺寸', - 'lang_autoSizeContent':'按表格文字自适应', - 'lang_autoSizePage':'按页面宽度自适应', - 'lang_example':'示例', - 'lang_borderStyle':'表格边框', - 'lang_color':'颜色:' - }, - captionName:'表格名称', - titleName:'标题', - cellsName:'内容', - errorMsg:'有合并单元格,不可排序' - }, - 'edittip':{ - 'static':{ - lang_delRow:'删除整行', - lang_delCol:'删除整列' - } - }, - 'edittd':{ - 'static':{ - lang_tdBkColor:'背景颜色:' - } - }, - 'formula':{ - 'static':{ - } - }, - 'wordimage':{ - 'static':{ - lang_resave:"转存步骤", - uploadBtn:{src:"upload.png",alt:"上传"}, - clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"}, - lang_step:"1、点击顶部复制按钮,将地址复制到剪贴板;2、点击添加照片按钮,在弹出的对话框中使用Ctrl+V粘贴地址;3、点击打开后选择图片上传流程。" - }, - 'fileType':"图片", - 'flashError':"FLASH初始化失败,请检查FLASH插件是否正确安装!", - 'netError':"网络连接错误,请重试!", - 'copySuccess':"图片地址已经复制!", - 'flashI18n':{} //留空默认中文 - }, - 'autosave': { - 'saving':'保存中...', - 'success':'本地保存成功' - } -}; diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/index.html b/api/src/main/resources/static/plug-in/neditor/2.1.13/index.html deleted file mode 100644 index e87f959924e98a35937d7adc00eb9eb82f806060..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/index.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - 完整demo - - - - - - - - - - - - - -
                      -

                      完整demo

                      - -
                      -
                      -
                      - - - - - - - - - - - -
                      -
                      - - - - - - - - -
                      - -
                      - - -
                      - -
                      -
                      - - -
                      - - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.all.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.all.js deleted file mode 100644 index 5d3319732a368ba93e2b3f9d8afaaa377b47a081..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.all.js +++ /dev/null @@ -1,33075 +0,0 @@ -/*! - * neditor - * version: 2.1.13 - * build: Sat Dec 29 2018 09:49:22 GMT+0000 (UTC) - */ - -(function(){ - -// editor.js -UEDITOR_CONFIG = window.UEDITOR_CONFIG || {}; - -var baidu = window.baidu || {}; - -window.baidu = baidu; - -window.UE = baidu.editor = { - plugins: {}, - commands: {}, - instants: {}, - I18N: {}, - _customizeUI: {}, - version: "1.5.0" -}; -var dom = (UE.dom = {}); - - -// core/browser.js -/** - * 浏览器判断模块 - * @file - * @module UE.browser - * @since 1.2.6.1 - */ - -/** - * 提供浏览器检测的模块 - * @unfile - * @module UE.browser - */ -var browser = (UE.browser = (function() { - var agent = navigator.userAgent.toLowerCase(), - opera = window.opera, - browser = { - /** - * @property {boolean} ie 检测当前浏览器是否为IE - * @example - * ```javascript - * if ( UE.browser.ie ) { - * console.log( '当前浏览器是IE' ); - * } - * ``` - */ - ie: /(msie\s|trident.*rv:)([\w.]+)/i.test(agent), - - /** - * @property {boolean} opera 检测当前浏览器是否为Opera - * @example - * ```javascript - * if ( UE.browser.opera ) { - * console.log( '当前浏览器是Opera' ); - * } - * ``` - */ - opera: !!opera && opera.version, - - /** - * @property {boolean} webkit 检测当前浏览器是否是webkit内核的浏览器 - * @example - * ```javascript - * if ( UE.browser.webkit ) { - * console.log( '当前浏览器是webkit内核浏览器' ); - * } - * ``` - */ - webkit: agent.indexOf(" applewebkit/") > -1, - - /** - * @property {boolean} mac 检测当前浏览器是否是运行在mac平台下 - * @example - * ```javascript - * if ( UE.browser.mac ) { - * console.log( '当前浏览器运行在mac平台下' ); - * } - * ``` - */ - mac: agent.indexOf("macintosh") > -1, - - /** - * @property {boolean} quirks 检测当前浏览器是否处于“怪异模式”下 - * @example - * ```javascript - * if ( UE.browser.quirks ) { - * console.log( '当前浏览器运行处于“怪异模式”' ); - * } - * ``` - */ - quirks: document.compatMode == "BackCompat" - }; - - /** - * @property {boolean} gecko 检测当前浏览器内核是否是gecko内核 - * @example - * ```javascript - * if ( UE.browser.gecko ) { - * console.log( '当前浏览器内核是gecko内核' ); - * } - * ``` - */ - browser.gecko = - navigator.product == "Gecko" && - !browser.webkit && - !browser.opera && - !browser.ie; - - var version = 0; - - // Internet Explorer 6.0+ - if (browser.ie) { - var v1 = agent.match(/(?:msie\s([\w.]+))/); - var v2 = agent.match(/(?:trident.*rv:([\w.]+))/); - if (v1 && v2 && v1[1] && v2[1]) { - version = Math.max(v1[1] * 1, v2[1] * 1); - } else if (v1 && v1[1]) { - version = v1[1] * 1; - } else if (v2 && v2[1]) { - version = v2[1] * 1; - } else { - version = 0; - } - - browser.ie11Compat = document.documentMode == 11; - /** - * @property { boolean } ie9Compat 检测浏览器模式是否为 IE9 兼容模式 - * @warning 如果浏览器不是IE, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.ie9Compat ) { - * console.log( '当前浏览器运行在IE9兼容模式下' ); - * } - * ``` - */ - browser.ie9Compat = document.documentMode == 9; - - /** - * @property { boolean } ie8 检测浏览器是否是IE8浏览器 - * @warning 如果浏览器不是IE, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.ie8 ) { - * console.log( '当前浏览器是IE8浏览器' ); - * } - * ``` - */ - browser.ie8 = !!document.documentMode; - - /** - * @property { boolean } ie8Compat 检测浏览器模式是否为 IE8 兼容模式 - * @warning 如果浏览器不是IE, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.ie8Compat ) { - * console.log( '当前浏览器运行在IE8兼容模式下' ); - * } - * ``` - */ - browser.ie8Compat = document.documentMode == 8; - - /** - * @property { boolean } ie7Compat 检测浏览器模式是否为 IE7 兼容模式 - * @warning 如果浏览器不是IE, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.ie7Compat ) { - * console.log( '当前浏览器运行在IE7兼容模式下' ); - * } - * ``` - */ - browser.ie7Compat = - (version == 7 && !document.documentMode) || document.documentMode == 7; - - /** - * @property { boolean } ie6Compat 检测浏览器模式是否为 IE6 模式 或者怪异模式 - * @warning 如果浏览器不是IE, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.ie6Compat ) { - * console.log( '当前浏览器运行在IE6模式或者怪异模式下' ); - * } - * ``` - */ - browser.ie6Compat = version < 7 || browser.quirks; - - browser.ie9above = version > 8; - - browser.ie9below = version < 9; - - browser.ie11above = version > 10; - - browser.ie11below = version < 11; - } - - // Gecko. - if (browser.gecko) { - var geckoRelease = agent.match(/rv:([\d\.]+)/); - if (geckoRelease) { - geckoRelease = geckoRelease[1].split("."); - version = - geckoRelease[0] * 10000 + - (geckoRelease[1] || 0) * 100 + - (geckoRelease[2] || 0) * 1; - } - } - - /** - * @property { Number } chrome 检测当前浏览器是否为Chrome, 如果是,则返回Chrome的大版本号 - * @warning 如果浏览器不是chrome, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.chrome ) { - * console.log( '当前浏览器是Chrome' ); - * } - * ``` - */ - if (/chrome\/(\d+\.\d)/i.test(agent)) { - browser.chrome = +RegExp["\x241"]; - } - - /** - * @property { Number } safari 检测当前浏览器是否为Safari, 如果是,则返回Safari的大版本号 - * @warning 如果浏览器不是safari, 则该值为undefined - * @example - * ```javascript - * if ( UE.browser.safari ) { - * console.log( '当前浏览器是Safari' ); - * } - * ``` - */ - if ( - /(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(agent) && - !/chrome/i.test(agent) - ) { - browser.safari = +(RegExp["\x241"] || RegExp["\x242"]); - } - - // Opera 9.50+ - if (browser.opera) version = parseFloat(opera.version()); - - // WebKit 522+ (Safari 3+) - if (browser.webkit) - version = parseFloat(agent.match(/ applewebkit\/(\d+)/)[1]); - - /** - * @property { Number } version 检测当前浏览器版本号 - * @remind - *
                        - *
                      • IE系列返回值为5,6,7,8,9,10等
                      • - *
                      • gecko系列会返回10900,158900等
                      • - *
                      • webkit系列会返回其build号 (如 522等)
                      • - *
                      - * @example - * ```javascript - * console.log( '当前浏览器版本号是: ' + UE.browser.version ); - * ``` - */ - browser.version = version; - - /** - * @property { boolean } isCompatible 检测当前浏览器是否能够与UEditor良好兼容 - * @example - * ```javascript - * if ( UE.browser.isCompatible ) { - * console.log( '浏览器与UEditor能够良好兼容' ); - * } - * ``` - */ - browser.isCompatible = - !browser.mobile && - ((browser.ie && version >= 6) || - (browser.gecko && version >= 10801) || - (browser.opera && version >= 9.5) || - (browser.air && version >= 1) || - (browser.webkit && version >= 522) || - false); - return browser; -})()); -//快捷方式 -var ie = browser.ie, - webkit = browser.webkit, - gecko = browser.gecko, - opera = browser.opera; - - -// core/utils.js -/** - * 工具函数包 - * @file - * @module UE.utils - * @since 1.2.6.1 - */ - -/** - * UEditor封装使用的静态工具函数 - * @module UE.utils - * @unfile - */ - -var utils = (UE.utils = { - /** - * 用给定的迭代器遍历对象 - * @method each - * @param { Object } obj 需要遍历的对象 - * @param { Function } iterator 迭代器, 该方法接受两个参数, 第一个参数是当前所处理的value, 第二个参数是当前遍历对象的key - * @example - * ```javascript - * var demoObj = { - * key1: 1, - * key2: 2 - * }; - * - * //output: key1: 1, key2: 2 - * UE.utils.each( demoObj, funciton ( value, key ) { - * - * console.log( key + ":" + value ); - * - * } ); - * ``` - */ - - /** - * 用给定的迭代器遍历数组或类数组对象 - * @method each - * @param { Array } array 需要遍历的数组或者类数组 - * @param { Function } iterator 迭代器, 该方法接受两个参数, 第一个参数是当前所处理的value, 第二个参数是当前遍历对象的key - * @example - * ```javascript - * var divs = document.getElmentByTagNames( "div" ); - * - * //output: 0: DIV, 1: DIV ... - * UE.utils.each( divs, funciton ( value, key ) { - * - * console.log( key + ":" + value.tagName ); - * - * } ); - * ``` - */ - each: function(obj, iterator, context) { - if (obj == null) return; - if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === false) return false; - } - } else { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - if (iterator.call(context, obj[key], key, obj) === false) - return false; - } - } - } - }, - - /** - * 以给定对象作为原型创建一个新对象 - * @method makeInstance - * @param { Object } protoObject 该对象将作为新创建对象的原型 - * @return { Object } 新的对象, 该对象的原型是给定的protoObject对象 - * @example - * ```javascript - * - * var protoObject = { sayHello: function () { console.log('Hello UEditor!'); } }; - * - * var newObject = UE.utils.makeInstance( protoObject ); - * //output: Hello UEditor! - * newObject.sayHello(); - * ``` - */ - makeInstance: function(obj) { - var noop = new Function(); - noop.prototype = obj; - obj = new noop(); - noop.prototype = null; - return obj; - }, - - /** - * 将source对象中的属性扩展到target对象上 - * @method extend - * @remind 该方法将强制把source对象上的属性复制到target对象上 - * @see UE.utils.extend(Object,Object,Boolean) - * @param { Object } target 目标对象, 新的属性将附加到该对象上 - * @param { Object } source 源对象, 该对象的属性会被附加到target对象上 - * @return { Object } 返回target对象 - * @example - * ```javascript - * - * var target = { name: 'target', sex: 1 }, - * source = { name: 'source', age: 17 }; - * - * UE.utils.extend( target, source ); - * - * //output: { name: 'source', sex: 1, age: 17 } - * console.log( target ); - * - * ``` - */ - - /** - * 将source对象中的属性扩展到target对象上, 根据指定的isKeepTarget值决定是否保留目标对象中与 - * 源对象属性名相同的属性值。 - * @method extend - * @param { Object } target 目标对象, 新的属性将附加到该对象上 - * @param { Object } source 源对象, 该对象的属性会被附加到target对象上 - * @param { Boolean } isKeepTarget 是否保留目标对象中与源对象中属性名相同的属性 - * @return { Object } 返回target对象 - * @example - * ```javascript - * - * var target = { name: 'target', sex: 1 }, - * source = { name: 'source', age: 17 }; - * - * UE.utils.extend( target, source, true ); - * - * //output: { name: 'target', sex: 1, age: 17 } - * console.log( target ); - * - * ``` - */ - extend: function(t, s, b) { - if (s) { - for (var k in s) { - if (!b || !t.hasOwnProperty(k)) { - t[k] = s[k]; - } - } - } - return t; - }, - - /** - * 将给定的多个对象的属性复制到目标对象target上 - * @method extend2 - * @remind 该方法将强制把源对象上的属性复制到target对象上 - * @remind 该方法支持两个及以上的参数, 从第二个参数开始, 其属性都会被复制到第一个参数上。 如果遇到同名的属性, - * 将会覆盖掉之前的值。 - * @param { Object } target 目标对象, 新的属性将附加到该对象上 - * @param { Object... } source 源对象, 支持多个对象, 该对象的属性会被附加到target对象上 - * @return { Object } 返回target对象 - * @example - * ```javascript - * - * var target = {}, - * source1 = { name: 'source', age: 17 }, - * source2 = { title: 'dev' }; - * - * UE.utils.extend2( target, source1, source2 ); - * - * //output: { name: 'source', age: 17, title: 'dev' } - * console.log( target ); - * - * ``` - */ - extend2: function(t) { - var a = arguments; - for (var i = 1; i < a.length; i++) { - var x = a[i]; - for (var k in x) { - if (!t.hasOwnProperty(k)) { - t[k] = x[k]; - } - } - } - return t; - }, - - /** - * 模拟继承机制, 使得subClass继承自superClass - * @method inherits - * @param { Object } subClass 子类对象 - * @param { Object } superClass 超类对象 - * @warning 该方法只能让subClass继承超类的原型, subClass对象自身的属性和方法不会被继承 - * @return { Object } 继承superClass后的子类对象 - * @example - * ```javascript - * function SuperClass(){ - * this.name = "小李"; - * } - * - * SuperClass.prototype = { - * hello:function(str){ - * console.log(this.name + str); - * } - * } - * - * function SubClass(){ - * this.name = "小张"; - * } - * - * UE.utils.inherits(SubClass,SuperClass); - * - * var sub = new SubClass(); - * //output: '小张早上好! - * sub.hello("早上好!"); - * ``` - */ - inherits: function(subClass, superClass) { - var oldP = subClass.prototype, - newP = utils.makeInstance(superClass.prototype); - utils.extend(newP, oldP, true); - subClass.prototype = newP; - return (newP.constructor = subClass); - }, - - /** - * 用指定的context对象作为函数fn的上下文 - * @method bind - * @param { Function } fn 需要绑定上下文的函数对象 - * @param { Object } content 函数fn新的上下文对象 - * @return { Function } 一个新的函数, 该函数作为原始函数fn的代理, 将完成fn的上下文调换工作。 - * @example - * ```javascript - * - * var name = 'window', - * newTest = null; - * - * function test () { - * console.log( this.name ); - * } - * - * newTest = UE.utils.bind( test, { name: 'object' } ); - * - * //output: object - * newTest(); - * - * //output: window - * test(); - * - * ``` - */ - bind: function(fn, context) { - return function() { - return fn.apply(context, arguments); - }; - }, - - /** - * 创建延迟指定时间后执行的函数fn - * @method defer - * @param { Function } fn 需要延迟执行的函数对象 - * @param { int } delay 延迟的时间, 单位是毫秒 - * @warning 该方法的时间控制是不精确的,仅仅只能保证函数的执行是在给定的时间之后, - * 而不能保证刚好到达延迟时间时执行。 - * @return { Function } 目标函数fn的代理函数, 只有执行该函数才能起到延时效果 - * @example - * ```javascript - * var start = 0; - * - * function test(){ - * console.log( new Date() - start ); - * } - * - * var testDefer = UE.utils.defer( test, 1000 ); - * // - * start = new Date(); - * //output: (大约在1000毫秒之后输出) 1000 - * testDefer(); - * ``` - */ - - /** - * 创建延迟指定时间后执行的函数fn, 如果在延迟时间内再次执行该方法, 将会根据指定的exclusion的值, - * 决定是否取消前一次函数的执行, 如果exclusion的值为true, 则取消执行,反之,将继续执行前一个方法。 - * @method defer - * @param { Function } fn 需要延迟执行的函数对象 - * @param { int } delay 延迟的时间, 单位是毫秒 - * @param { Boolean } exclusion 如果在延迟时间内再次执行该函数,该值将决定是否取消执行前一次函数的执行, - * 值为true表示取消执行, 反之则将在执行前一次函数之后才执行本次函数调用。 - * @warning 该方法的时间控制是不精确的,仅仅只能保证函数的执行是在给定的时间之后, - * 而不能保证刚好到达延迟时间时执行。 - * @return { Function } 目标函数fn的代理函数, 只有执行该函数才能起到延时效果 - * @example - * ```javascript - * - * function test(){ - * console.log(1); - * } - * - * var testDefer = UE.utils.defer( test, 1000, true ); - * - * //output: (两次调用仅有一次输出) 1 - * testDefer(); - * testDefer(); - * ``` - */ - defer: function(fn, delay, exclusion) { - var timerID; - return function() { - if (exclusion) { - clearTimeout(timerID); - } - timerID = setTimeout(fn, delay); - }; - }, - - /** - * 获取元素item在数组array中首次出现的位置, 如果未找到item, 则返回-1 - * @method indexOf - * @remind 该方法的匹配过程使用的是恒等“===” - * @param { Array } array 需要查找的数组对象 - * @param { * } item 需要在目标数组中查找的值 - * @return { int } 返回item在目标数组array中首次出现的位置, 如果在数组中未找到item, 则返回-1 - * @example - * ```javascript - * var item = 1, - * arr = [ 3, 4, 6, 8, 1, 1, 2 ]; - * - * //output: 4 - * console.log( UE.utils.indexOf( arr, item ) ); - * ``` - */ - - /** - * 获取元素item数组array中首次出现的位置, 如果未找到item, 则返回-1。通过start的值可以指定搜索的起始位置。 - * @method indexOf - * @remind 该方法的匹配过程使用的是恒等“===” - * @param { Array } array 需要查找的数组对象 - * @param { * } item 需要在目标数组中查找的值 - * @param { int } start 搜索的起始位置 - * @return { int } 返回item在目标数组array中的start位置之后首次出现的位置, 如果在数组中未找到item, 则返回-1 - * @example - * ```javascript - * var item = 1, - * arr = [ 3, 4, 6, 8, 1, 2, 8, 3, 2, 1, 1, 4 ]; - * - * //output: 9 - * console.log( UE.utils.indexOf( arr, item, 5 ) ); - * ``` - */ - indexOf: function(array, item, start) { - var index = -1; - start = this.isNumber(start) ? start : 0; - this.each(array, function(v, i) { - if (i >= start && v === item) { - index = i; - return false; - } - }); - return index; - }, - - /** - * 移除数组array中所有的元素item - * @method removeItem - * @param { Array } array 要移除元素的目标数组 - * @param { * } item 将要被移除的元素 - * @remind 该方法的匹配过程使用的是恒等“===” - * @example - * ```javascript - * var arr = [ 4, 5, 7, 1, 3, 4, 6 ]; - * - * UE.utils.removeItem( arr, 4 ); - * //output: [ 5, 7, 1, 3, 6 ] - * console.log( arr ); - * - * ``` - */ - removeItem: function(array, item) { - for (var i = 0, l = array.length; i < l; i++) { - if (array[i] === item) { - array.splice(i, 1); - i--; - } - } - }, - - /** - * 删除字符串str的首尾空格 - * @method trim - * @param { String } str 需要删除首尾空格的字符串 - * @return { String } 删除了首尾的空格后的字符串 - * @example - * ```javascript - * - * var str = " UEdtior "; - * - * //output: 9 - * console.log( str.length ); - * - * //output: 7 - * console.log( UE.utils.trim( " UEdtior " ).length ); - * - * //output: 9 - * console.log( str.length ); - * - * ``` - */ - trim: function(str) { - return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, ""); - }, - - /** - * 将字符串str以','分隔成数组后,将该数组转换成哈希对象, 其生成的hash对象的key为数组中的元素, value为1 - * @method listToMap - * @warning 该方法在生成的hash对象中,会为每一个key同时生成一个另一个全大写的key。 - * @param { String } str 该字符串将被以','分割为数组, 然后进行转化 - * @return { Object } 转化之后的hash对象 - * @example - * ```javascript - * - * //output: Object {UEdtior: 1, UEDTIOR: 1, Hello: 1, HELLO: 1} - * console.log( UE.utils.listToMap( 'UEdtior,Hello' ) ); - * - * ``` - */ - - /** - * 将字符串数组转换成哈希对象, 其生成的hash对象的key为数组中的元素, value为1 - * @method listToMap - * @warning 该方法在生成的hash对象中,会为每一个key同时生成一个另一个全大写的key。 - * @param { Array } arr 字符串数组 - * @return { Object } 转化之后的hash对象 - * @example - * ```javascript - * - * //output: Object {UEdtior: 1, UEDTIOR: 1, Hello: 1, HELLO: 1} - * console.log( UE.utils.listToMap( [ 'UEdtior', 'Hello' ] ) ); - * - * ``` - */ - listToMap: function(list) { - if (!list) return {}; - list = utils.isArray(list) ? list : list.split(","); - for (var i = 0, ci, obj = {}; (ci = list[i++]); ) { - obj[ci.toUpperCase()] = obj[ci] = 1; - } - return obj; - }, - - /** - * 将str中的html符号转义,将转义“',&,<,",>,”,“”七个字符 - * @method unhtml - * @param { String } str 需要转义的字符串 - * @return { String } 转义后的字符串 - * @example - * ```javascript - * var html = '&'; - * - * //output: <body>&</body> - * console.log( UE.utils.unhtml( html ) ); - * - * ``` - */ - unhtml: function(str, reg) { - return str - ? str.replace( - reg || /[&<">'](?:(amp|lt|ldquo|rdquo|quot|gt|#39|nbsp|#\d+);)?/g, - function(a, b) { - if (b) { - return a; - } else { - return { - "<": "<", - "&": "&", - '"': """, - "“": "“", - "”": "”", - ">": ">", - "'": "'" - }[a]; - } - } - ) - : ""; - }, - - /** - * 将str中的转义字符还原成html字符 - * @see UE.utils.unhtml(String); - * @method html - * @param { String } str 需要逆转义的字符串 - * @return { String } 逆转义后的字符串 - * @example - * ```javascript - * - * var str = '<body>&</body>'; - * - * //output: & - * console.log( UE.utils.html( str ) ); - * - * ``` - */ - html: function(str) { - return str - ? str.replace(/&((g|l|quo|ldquo|rdquo)t|amp|#39|nbsp);/g, function(m) { - return { - "<": "<", - "&": "&", - """: '"', - "“": "“", - "”": "”", - ">": ">", - "'": "'", - " ": " " - }[m]; - }) - : ""; - }, - - /** - * 将css样式转换为驼峰的形式 - * @method cssStyleToDomStyle - * @param { String } cssName 需要转换的css样式名 - * @return { String } 转换成驼峰形式后的css样式名 - * @example - * ```javascript - * - * var str = 'border-top'; - * - * //output: borderTop - * console.log( UE.utils.cssStyleToDomStyle( str ) ); - * - * ``` - */ - cssStyleToDomStyle: (function() { - var test = document.createElement("div").style, - cache = { - float: test.cssFloat != undefined - ? "cssFloat" - : test.styleFloat != undefined ? "styleFloat" : "float" - }; - - return function(cssName) { - return ( - cache[cssName] || - (cache[cssName] = cssName.toLowerCase().replace(/-./g, function(match) { - return match.charAt(1).toUpperCase(); - })) - ); - }; - })(), - - /** - * 动态加载文件到doc中 - * @method loadFile - * @param { DomDocument } document 需要加载资源文件的文档对象 - * @param { Object } options 加载资源文件的属性集合, 取值请参考代码示例 - * @example - * ```javascript - * - * UE.utils.loadFile( document, { - * src:"test.js", - * tag:"script", - * type:"text/javascript", - * defer:"defer" - * } ); - * - * ``` - */ - - /** - * 动态加载文件到doc中,加载成功后执行的回调函数fn - * @method loadFile - * @param { DomDocument } document 需要加载资源文件的文档对象 - * @param { Object } options 加载资源文件的属性集合, 该集合支持的值是script标签和style标签支持的所有属性。 - * @param { Function } fn 资源文件加载成功之后执行的回调 - * @warning 对于在同一个文档中多次加载同一URL的文件, 该方法会在第一次加载之后缓存该请求, - * 在此之后的所有同一URL的请求, 将会直接触发回调。 - * @example - * ```javascript - * - * UE.utils.loadFile( document, { - * src:"test.js", - * tag:"script", - * type:"text/javascript", - * defer:"defer" - * }, function () { - * console.log('加载成功'); - * } ); - * - * ``` - */ - loadFile: (function() { - var tmpList = []; - - function getItem(doc, obj) { - try { - for (var i = 0, ci; (ci = tmpList[i++]); ) { - if (ci.doc === doc && ci.url == (obj.src || obj.href)) { - return ci; - } - } - } catch (e) { - return null; - } - } - - return function(doc, obj, fn) { - var item = getItem(doc, obj); - if (item) { - if (item.ready) { - fn && fn(); - } else { - item.funs.push(fn); - } - return; - } - tmpList.push({ - doc: doc, - url: obj.src || obj.href, - funs: [fn] - }); - if (!doc.body) { - var html = []; - for (var p in obj) { - if (p == "tag") continue; - html.push(p + '="' + obj[p] + '"'); - } - doc.write( - "<" + obj.tag + " " + html.join(" ") + " >" - ); - return; - } - if (obj.id && doc.getElementById(obj.id)) { - return; - } - var element = doc.createElement(obj.tag); - delete obj.tag; - for (var p in obj) { - element.setAttribute(p, obj[p]); - } - element.onload = element.onreadystatechange = function() { - if (!this.readyState || /loaded|complete/.test(this.readyState)) { - item = getItem(doc, obj); - if (item.funs.length > 0) { - item.ready = 1; - for (var fi; (fi = item.funs.pop()); ) { - fi(); - } - } - element.onload = element.onreadystatechange = null; - } - }; - element.onerror = function() { - throw Error( - "The load " + - (obj.href || obj.src) + - " fails,check the url settings of file neditor.config.js " - ); - }; - doc.getElementsByTagName("head")[0].appendChild(element); - }; - })(), - - /** - * 判断obj对象是否为空 - * @method isEmptyObject - * @param { * } obj 需要判断的对象 - * @remind 如果判断的对象是NULL, 将直接返回true, 如果是数组且为空, 返回true, 如果是字符串, 且字符串为空, - * 返回true, 如果是普通对象, 且该对象没有任何实例属性, 返回true - * @return { Boolean } 对象是否为空 - * @example - * ```javascript - * - * //output: true - * console.log( UE.utils.isEmptyObject( {} ) ); - * - * //output: true - * console.log( UE.utils.isEmptyObject( [] ) ); - * - * //output: true - * console.log( UE.utils.isEmptyObject( "" ) ); - * - * //output: false - * console.log( UE.utils.isEmptyObject( { key: 1 } ) ); - * - * //output: false - * console.log( UE.utils.isEmptyObject( [1] ) ); - * - * //output: false - * console.log( UE.utils.isEmptyObject( "1" ) ); - * - * ``` - */ - isEmptyObject: function(obj) { - if (obj == null) return true; - if (this.isArray(obj) || this.isString(obj)) return obj.length === 0; - for (var key in obj) if (obj.hasOwnProperty(key)) return false; - return true; - }, - - /** - * 把rgb格式的颜色值转换成16进制格式 - * @method fixColor - * @param { String } rgb格式的颜色值 - * @param { String } - * @example - * rgb(255,255,255) => "#ffffff" - */ - fixColor: function(name, value) { - if (/color/i.test(name) && /rgba?/.test(value)) { - var array = value.split(","); - if (array.length > 3) return ""; - value = "#"; - for (var i = 0, color; (color = array[i++]); ) { - color = parseInt(color.replace(/[^\d]/gi, ""), 10).toString(16); - value += color.length == 1 ? "0" + color : color; - } - value = value.toUpperCase(); - } - return value; - }, - /** - * 只针对border,padding,margin做了处理,因为性能问题 - * @public - * @function - * @param {String} val style字符串 - */ - optCss: function(val) { - var padding, margin, border; - val = val.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi, function( - str, - key, - name, - val - ) { - if (val.split(" ").length == 1) { - switch (key) { - case "padding": - !padding && (padding = {}); - padding[name] = val; - return ""; - case "margin": - !margin && (margin = {}); - margin[name] = val; - return ""; - case "border": - return val == "initial" ? "" : str; - } - } - return str; - }); - - function opt(obj, name) { - if (!obj) { - return ""; - } - var t = obj.top, - b = obj.bottom, - l = obj.left, - r = obj.right, - val = ""; - if (!t || !l || !b || !r) { - for (var p in obj) { - val += ";" + name + "-" + p + ":" + obj[p] + ";"; - } - } else { - val += - ";" + - name + - ":" + - (t == b && b == l && l == r - ? t - : t == b && l == r - ? t + " " + l - : l == r - ? t + " " + l + " " + b - : t + " " + r + " " + b + " " + l) + - ";"; - } - return val; - } - - val += opt(padding, "padding") + opt(margin, "margin"); - return val - .replace(/^[ \n\r\t;]*|[ \n\r\t]*$/, "") - .replace(/;([ \n\r\t]+)|\1;/g, ";") - .replace(/(&((l|g)t|quot|#39))?;{2,}/g, function(a, b) { - return b ? b + ";;" : ";"; - }); - }, - - /** - * 克隆对象 - * @method clone - * @param { Object } source 源对象 - * @return { Object } source的一个副本 - */ - - /** - * 深度克隆对象,将source的属性克隆到target对象, 会覆盖target重名的属性。 - * @method clone - * @param { Object } source 源对象 - * @param { Object } target 目标对象 - * @return { Object } 附加了source对象所有属性的target对象 - */ - clone: function(source, target) { - var tmp; - target = target || {}; - for (var i in source) { - if (source.hasOwnProperty(i)) { - tmp = source[i]; - if (typeof tmp == "object") { - target[i] = utils.isArray(tmp) ? [] : {}; - utils.clone(source[i], target[i]); - } else { - target[i] = tmp; - } - } - } - return target; - }, - - /** - * 把cm/pt为单位的值转换为px为单位的值 - * @method transUnitToPx - * @param { String } 待转换的带单位的字符串 - * @return { String } 转换为px为计量单位的值的字符串 - * @example - * ```javascript - * - * //output: 500px - * console.log( UE.utils.transUnitToPx( '20cm' ) ); - * - * //output: 27px - * console.log( UE.utils.transUnitToPx( '20pt' ) ); - * - * ``` - */ - transUnitToPx: function(val) { - if (!/(pt|cm)/.test(val)) { - return val; - } - var unit; - val.replace(/([\d.]+)(\w+)/, function(str, v, u) { - val = v; - unit = u; - }); - switch (unit) { - case "cm": - val = parseFloat(val) * 25; - break; - case "pt": - val = Math.round(parseFloat(val) * 96 / 72); - } - return val + (val ? "px" : ""); - }, - - /** - * 在dom树ready之后执行给定的回调函数 - * @method domReady - * @remind 如果在执行该方法的时候, dom树已经ready, 那么回调函数将立刻执行 - * @param { Function } fn dom树ready之后的回调函数 - * @example - * ```javascript - * - * UE.utils.domReady( function () { - * - * console.log('123'); - * - * } ); - * - * ``` - */ - domReady: (function() { - var fnArr = []; - - function doReady(doc) { - //确保onready只执行一次 - doc.isReady = true; - for (var ci; (ci = fnArr.pop()); ci()) {} - } - - return function(onready, win) { - win = win || window; - var doc = win.document; - onready && fnArr.push(onready); - if (doc.readyState === "complete") { - doReady(doc); - } else { - doc.isReady && doReady(doc); - if (browser.ie && browser.version != 11) { - (function() { - if (doc.isReady) return; - try { - doc.documentElement.doScroll("left"); - } catch (error) { - setTimeout(arguments.callee, 0); - return; - } - doReady(doc); - })(); - win.attachEvent("onload", function() { - doReady(doc); - }); - } else { - doc.addEventListener( - "DOMContentLoaded", - function() { - doc.removeEventListener( - "DOMContentLoaded", - arguments.callee, - false - ); - doReady(doc); - }, - false - ); - win.addEventListener( - "load", - function() { - doReady(doc); - }, - false - ); - } - } - }; - })(), - - /** - * 动态添加css样式 - * @method cssRule - * @param { String } 节点名称 - * @grammar UE.utils.cssRule('添加的样式的节点名称',['样式','放到哪个document上']) - * @grammar UE.utils.cssRule('body','body{background:#ccc}') => null //给body添加背景颜色 - * @grammar UE.utils.cssRule('body') =>样式的字符串 //取得key值为body的样式的内容,如果没有找到key值先关的样式将返回空,例如刚才那个背景颜色,将返回 body{background:#ccc} - * @grammar UE.utils.cssRule('body',document) => 返回指定key的样式,并且指定是哪个document - * @grammar UE.utils.cssRule('body','') =>null //清空给定的key值的背景颜色 - */ - cssRule: browser.ie && browser.version != 11 - ? function(key, style, doc) { - var indexList, index; - if ( - style === undefined || - (style && style.nodeType && style.nodeType == 9) - ) { - //获取样式 - doc = style && style.nodeType && style.nodeType == 9 - ? style - : doc || document; - indexList = doc.indexList || (doc.indexList = {}); - index = indexList[key]; - if (index !== undefined) { - return doc.styleSheets[index].cssText; - } - return undefined; - } - doc = doc || document; - indexList = doc.indexList || (doc.indexList = {}); - index = indexList[key]; - //清除样式 - if (style === "") { - if (index !== undefined) { - doc.styleSheets[index].cssText = ""; - delete indexList[key]; - return true; - } - return false; - } - - //添加样式 - if (index !== undefined) { - sheetStyle = doc.styleSheets[index]; - } else { - sheetStyle = doc.createStyleSheet( - "", - (index = doc.styleSheets.length) - ); - indexList[key] = index; - } - sheetStyle.cssText = style; - } - : function(key, style, doc) { - var head, node; - if ( - style === undefined || - (style && style.nodeType && style.nodeType == 9) - ) { - //获取样式 - doc = style && style.nodeType && style.nodeType == 9 - ? style - : doc || document; - node = doc.getElementById(key); - return node ? node.innerHTML : undefined; - } - doc = doc || document; - node = doc.getElementById(key); - - //清除样式 - if (style === "") { - if (node) { - node.parentNode.removeChild(node); - return true; - } - return false; - } - - //添加样式 - if (node) { - node.innerHTML = style; - } else { - node = doc.createElement("style"); - node.id = key; - node.innerHTML = style; - doc.getElementsByTagName("head")[0].appendChild(node); - } - }, - sort: function(array, compareFn) { - compareFn = - compareFn || - function(item1, item2) { - return item1.localeCompare(item2); - }; - for (var i = 0, len = array.length; i < len; i++) { - for (var j = i, length = array.length; j < length; j++) { - if (compareFn(array[i], array[j]) > 0) { - var t = array[i]; - array[i] = array[j]; - array[j] = t; - } - } - } - return array; - }, - serializeParam: function(json) { - var strArr = []; - for (var i in json) { - //忽略默认的几个参数 - if (i == "method" || i == "timeout" || i == "async") continue; - //传递过来的对象和函数不在提交之列 - if ( - !( - (typeof json[i]).toLowerCase() == "function" || - (typeof json[i]).toLowerCase() == "object" - ) - ) { - strArr.push(encodeURIComponent(i) + "=" + encodeURIComponent(json[i])); - } else if (utils.isArray(json[i])) { - //支持传数组内容 - for (var j = 0; j < json[i].length; j++) { - strArr.push( - encodeURIComponent(i) + "[]=" + encodeURIComponent(json[i][j]) - ); - } - } - } - return strArr.join("&"); - }, - formatUrl: function(url) { - var u = url.replace(/&&/g, "&"); - u = u.replace(/\?&/g, "?"); - u = u.replace(/&$/g, ""); - u = u.replace(/&#/g, "#"); - u = u.replace(/&+/g, "&"); - return u; - }, - isCrossDomainUrl: function(url) { - var a = document.createElement("a"); - a.href = url; - if (browser.ie) { - a.href = a.href; - } - return !( - a.protocol == location.protocol && - a.hostname == location.hostname && - (a.port == location.port || - (a.port == "80" && location.port == "") || - (a.port == "" && location.port == "80")) - ); - }, - clearEmptyAttrs: function(obj) { - for (var p in obj) { - if (obj[p] === "") { - delete obj[p]; - } - } - return obj; - }, - str2json: function(s) { - if (!utils.isString(s)) return null; - if (window.JSON) { - return JSON.parse(s); - } else { - return new Function("return " + utils.trim(s || ""))(); - } - }, - json2str: (function() { - if (window.JSON) { - return JSON.stringify; - } else { - var escapeMap = { - "\b": "\\b", - "\t": "\\t", - "\n": "\\n", - "\f": "\\f", - "\r": "\\r", - '"': '\\"', - "\\": "\\\\" - }; - - function encodeString(source) { - if (/["\\\x00-\x1f]/.test(source)) { - source = source.replace(/["\\\x00-\x1f]/g, function(match) { - var c = escapeMap[match]; - if (c) { - return c; - } - c = match.charCodeAt(); - return ( - "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16) - ); - }); - } - return '"' + source + '"'; - } - - function encodeArray(source) { - var result = ["["], - l = source.length, - preComma, - i, - item; - - for (i = 0; i < l; i++) { - item = source[i]; - - switch (typeof item) { - case "undefined": - case "function": - case "unknown": - break; - default: - if (preComma) { - result.push(","); - } - result.push(utils.json2str(item)); - preComma = 1; - } - } - result.push("]"); - return result.join(""); - } - - function pad(source) { - return source < 10 ? "0" + source : source; - } - - function encodeDate(source) { - return ( - '"' + - source.getFullYear() + - "-" + - pad(source.getMonth() + 1) + - "-" + - pad(source.getDate()) + - "T" + - pad(source.getHours()) + - ":" + - pad(source.getMinutes()) + - ":" + - pad(source.getSeconds()) + - '"' - ); - } - - return function(value) { - switch (typeof value) { - case "undefined": - return "undefined"; - - case "number": - return isFinite(value) ? String(value) : "null"; - - case "string": - return encodeString(value); - - case "boolean": - return String(value); - - default: - if (value === null) { - return "null"; - } else if (utils.isArray(value)) { - return encodeArray(value); - } else if (utils.isDate(value)) { - return encodeDate(value); - } else { - var result = ["{"], - encode = utils.json2str, - preComma, - item; - - for (var key in value) { - if (Object.prototype.hasOwnProperty.call(value, key)) { - item = value[key]; - switch (typeof item) { - case "undefined": - case "unknown": - case "function": - break; - default: - if (preComma) { - result.push(","); - } - preComma = 1; - result.push(encode(key) + ":" + encode(item)); - } - } - } - result.push("}"); - return result.join(""); - } - } - }; - } - })(), - renderTplstr: function(tpl, data) { - return tpl.replace(/\$\{\s*(\w*?)\s*\}/g, function (match, variable) { - if (data.hasOwnProperty(variable)) { - return data[variable]; - } - }); - } -}); -/** - * 判断给定的对象是否是字符串 - * @method isString - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是字符串 - */ - -/** - * 判断给定的对象是否是数组 - * @method isArray - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是数组 - */ - -/** - * 判断给定的对象是否是一个Function - * @method isFunction - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是Function - */ - -/** - * 判断给定的对象是否是Number - * @method isNumber - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是Number - */ - -/** - * 判断给定的对象是否是一个正则表达式 - * @method isRegExp - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是正则表达式 - */ - -/** - * 判断给定的对象是否是一个普通对象 - * @method isObject - * @param { * } object 需要判断的对象 - * @return { Boolean } 给定的对象是否是普通对象 - */ -utils.each( - ["String", "Function", "Array", "Number", "RegExp", "Object", "Date"], - function(v) { - UE.utils["is" + v] = function(obj) { - return Object.prototype.toString.apply(obj) == "[object " + v + "]"; - }; - } -); - - -// core/EventBase.js -/** - * UE采用的事件基类 - * @file - * @module UE - * @class EventBase - * @since 1.2.6.1 - */ - -/** - * UEditor公用空间,UEditor所有的功能都挂载在该空间下 - * @unfile - * @module UE - */ - -/** - * UE采用的事件基类,继承此类的对应类将获取addListener,removeListener,fireEvent方法。 - * 在UE中,Editor以及所有ui实例都继承了该类,故可以在对应的ui对象以及editor对象上使用上述方法。 - * @unfile - * @module UE - * @class EventBase - */ - -/** - * 通过此构造器,子类可以继承EventBase获取事件监听的方法 - * @constructor - * @example - * ```javascript - * UE.EventBase.call(editor); - * ``` - */ -var EventBase = (UE.EventBase = function() {}); - -EventBase.prototype = { - /** - * 注册事件监听器 - * @method addListener - * @param { String } types 监听的事件名称,同时监听多个事件使用空格分隔 - * @param { Function } fn 监听的事件被触发时,会执行该回调函数 - * @waining 事件被触发时,监听的函数假如返回的值恒等于true,回调函数的队列中后面的函数将不执行 - * @example - * ```javascript - * editor.addListener('selectionchange',function(){ - * console.log("选区已经变化!"); - * }) - * editor.addListener('beforegetcontent aftergetcontent',function(type){ - * if(type == 'beforegetcontent'){ - * //do something - * }else{ - * //do something - * } - * console.log(this.getContent) // this是注册的事件的编辑器实例 - * }) - * ``` - * @see UE.EventBase:fireEvent(String) - */ - addListener: function(types, listener) { - types = utils.trim(types).split(/\s+/); - for (var i = 0, ti; (ti = types[i++]); ) { - getListener(this, ti, true).push(listener); - } - }, - - on: function(types, listener) { - return this.addListener(types, listener); - }, - off: function(types, listener) { - return this.removeListener(types, listener); - }, - trigger: function() { - return this.fireEvent.apply(this, arguments); - }, - /** - * 移除事件监听器 - * @method removeListener - * @param { String } types 移除的事件名称,同时移除多个事件使用空格分隔 - * @param { Function } fn 移除监听事件的函数引用 - * @example - * ```javascript - * //changeCallback为方法体 - * editor.removeListener("selectionchange",changeCallback); - * ``` - */ - removeListener: function(types, listener) { - types = utils.trim(types).split(/\s+/); - for (var i = 0, ti; (ti = types[i++]); ) { - utils.removeItem(getListener(this, ti) || [], listener); - } - }, - - /** - * 触发事件 - * @method fireEvent - * @param { String } types 触发的事件名称,同时触发多个事件使用空格分隔 - * @remind 该方法会触发addListener - * @return { * } 返回触发事件的队列中,最后执行的回调函数的返回值 - * @example - * ```javascript - * editor.fireEvent("selectionchange"); - * ``` - */ - - /** - * 触发事件 - * @method fireEvent - * @param { String } types 触发的事件名称,同时触发多个事件使用空格分隔 - * @param { *... } options 可选参数,可以传入一个或多个参数,会传给事件触发的回调函数 - * @return { * } 返回触发事件的队列中,最后执行的回调函数的返回值 - * @example - * ```javascript - * - * editor.addListener( "selectionchange", function ( type, arg1, arg2 ) { - * - * console.log( arg1 + " " + arg2 ); - * - * } ); - * - * //触发selectionchange事件, 会执行上面的事件监听器 - * //output: Hello World - * editor.fireEvent("selectionchange", "Hello", "World"); - * ``` - */ - fireEvent: function() { - var types = arguments[0]; - types = utils.trim(types).split(" "); - for (var i = 0, ti; (ti = types[i++]); ) { - var listeners = getListener(this, ti), - r, - t, - k; - if (listeners) { - k = listeners.length; - while (k--) { - if (!listeners[k]) continue; - t = listeners[k].apply(this, arguments); - if (t === true) { - return t; - } - if (t !== undefined) { - r = t; - } - } - } - if ((t = this["on" + ti.toLowerCase()])) { - r = t.apply(this, arguments); - } - } - return r; - } -}; -/** - * 获得对象所拥有监听类型的所有监听器 - * @unfile - * @module UE - * @since 1.2.6.1 - * @method getListener - * @public - * @param { Object } obj 查询监听器的对象 - * @param { String } type 事件类型 - * @param { Boolean } force 为true且当前所有type类型的侦听器不存在时,创建一个空监听器数组 - * @return { Array } 监听器数组 - */ -function getListener(obj, type, force) { - var allListeners; - type = type.toLowerCase(); - return ( - (allListeners = - obj.__allListeners || (force && (obj.__allListeners = {}))) && - (allListeners[type] || (force && (allListeners[type] = []))) - ); -} - - -// core/dtd.js -///import editor.js -///import core/dom/dom.js -///import core/utils.js -/** - * dtd html语义化的体现类 - * @constructor - * @namespace dtd - */ -var dtd = (dom.dtd = (function() { - function _(s) { - for (var k in s) { - s[k.toUpperCase()] = s[k]; - } - return s; - } - var X = utils.extend2; - var A = _({ isindex: 1, fieldset: 1 }), - B = _({ input: 1, button: 1, select: 1, textarea: 1, label: 1 }), - C = X(_({ a: 1 }), B), - D = X({ iframe: 1 }, C), - E = _({ - hr: 1, - ul: 1, - menu: 1, - div: 1, - blockquote: 1, - noscript: 1, - table: 1, - center: 1, - address: 1, - dir: 1, - pre: 1, - h5: 1, - dl: 1, - h4: 1, - noframes: 1, - h6: 1, - ol: 1, - h1: 1, - h3: 1, - h2: 1 - }), - F = _({ ins: 1, del: 1, script: 1, style: 1 }), - G = X( - _({ - mark: 1, - b: 1, - acronym: 1, - bdo: 1, - var: 1, - "#": 1, - abbr: 1, - code: 1, - br: 1, - i: 1, - cite: 1, - kbd: 1, - u: 1, - strike: 1, - s: 1, - tt: 1, - strong: 1, - q: 1, - samp: 1, - em: 1, - dfn: 1, - span: 1 - }), - F - ), - H = X( - _({ - sub: 1, - img: 1, - embed: 1, - object: 1, - sup: 1, - basefont: 1, - map: 1, - applet: 1, - font: 1, - big: 1, - small: 1 - }), - G - ), - I = X(_({ p: 1 }), H), - J = X(_({ iframe: 1 }), H, B), - K = _({ - img: 1, - embed: 1, - noscript: 1, - br: 1, - kbd: 1, - center: 1, - button: 1, - basefont: 1, - h5: 1, - h4: 1, - samp: 1, - h6: 1, - ol: 1, - h1: 1, - h3: 1, - h2: 1, - form: 1, - font: 1, - "#": 1, - select: 1, - menu: 1, - ins: 1, - abbr: 1, - label: 1, - code: 1, - table: 1, - script: 1, - cite: 1, - input: 1, - iframe: 1, - strong: 1, - textarea: 1, - noframes: 1, - big: 1, - small: 1, - span: 1, - hr: 1, - sub: 1, - bdo: 1, - var: 1, - div: 1, - object: 1, - sup: 1, - strike: 1, - dir: 1, - map: 1, - dl: 1, - applet: 1, - del: 1, - isindex: 1, - fieldset: 1, - ul: 1, - b: 1, - acronym: 1, - a: 1, - blockquote: 1, - i: 1, - u: 1, - s: 1, - tt: 1, - address: 1, - q: 1, - pre: 1, - p: 1, - em: 1, - dfn: 1 - }), - L = X(_({ a: 0 }), J), //a不能被切开,所以把他 - M = _({ tr: 1 }), - N = _({ "#": 1 }), - O = X(_({ param: 1 }), K), - P = X(_({ form: 1 }), A, D, E, I), - Q = _({ li: 1, ol: 1, ul: 1 }), - R = _({ style: 1, script: 1 }), - S = _({ base: 1, link: 1, meta: 1, title: 1 }), - T = X(S, R), - U = _({ head: 1, body: 1 }), - V = _({ html: 1 }); - - var block = _({ - address: 1, - blockquote: 1, - center: 1, - dir: 1, - div: 1, - dl: 1, - fieldset: 1, - form: 1, - h1: 1, - h2: 1, - h3: 1, - h4: 1, - h5: 1, - h6: 1, - hr: 1, - isindex: 1, - menu: 1, - noframes: 1, - ol: 1, - p: 1, - pre: 1, - table: 1, - ul: 1 - }), - empty = _({ - area: 1, - base: 1, - basefont: 1, - br: 1, - col: 1, - command: 1, - dialog: 1, - embed: 1, - hr: 1, - img: 1, - input: 1, - isindex: 1, - keygen: 1, - link: 1, - meta: 1, - param: 1, - source: 1, - track: 1, - wbr: 1 - }); - - return _({ - // $ 表示自定的属性 - - // body外的元素列表. - $nonBodyContent: X(V, U, S), - - //块结构元素列表 - $block: block, - - //内联元素列表 - $inline: L, - - $inlineWithA: X(_({ a: 1 }), L), - - $body: X(_({ script: 1, style: 1 }), block), - - $cdata: _({ script: 1, style: 1 }), - - //自闭和元素 - $empty: empty, - - //不是自闭合,但不能让range选中里边 - $nonChild: _({ iframe: 1, textarea: 1 }), - //列表元素列表 - $listItem: _({ dd: 1, dt: 1, li: 1 }), - - //列表根元素列表 - $list: _({ ul: 1, ol: 1, dl: 1 }), - - //不能认为是空的元素 - $isNotEmpty: _({ - table: 1, - ul: 1, - ol: 1, - dl: 1, - iframe: 1, - area: 1, - base: 1, - col: 1, - hr: 1, - img: 1, - embed: 1, - input: 1, - textarea: 1, - link: 1, - meta: 1, - param: 1, - h1: 1, - h2: 1, - h3: 1, - h4: 1, - h5: 1, - h6: 1 - }), - - //如果没有子节点就可以删除的元素列表,像span,a - $removeEmpty: _({ - a: 1, - abbr: 1, - acronym: 1, - address: 1, - b: 1, - bdo: 1, - big: 1, - cite: 1, - code: 1, - del: 1, - dfn: 1, - em: 1, - font: 1, - i: 1, - ins: 1, - label: 1, - kbd: 1, - q: 1, - s: 1, - samp: 1, - small: 1, - span: 1, - strike: 1, - strong: 1, - sub: 1, - sup: 1, - tt: 1, - u: 1, - var: 1 - }), - - $removeEmptyBlock: _({ p: 1, div: 1 }), - - //在table元素里的元素列表 - $tableContent: _({ - caption: 1, - col: 1, - colgroup: 1, - tbody: 1, - td: 1, - tfoot: 1, - th: 1, - thead: 1, - tr: 1, - table: 1 - }), - //不转换的标签 - $notTransContent: _({ pre: 1, script: 1, style: 1, textarea: 1 }), - html: U, - head: T, - style: N, - script: N, - body: P, - base: {}, - link: {}, - meta: {}, - title: N, - col: {}, - tr: _({ td: 1, th: 1 }), - img: {}, - embed: {}, - colgroup: _({ thead: 1, col: 1, tbody: 1, tr: 1, tfoot: 1 }), - noscript: P, - td: P, - br: {}, - th: P, - center: P, - kbd: L, - button: X(I, E), - basefont: {}, - h5: L, - h4: L, - samp: L, - h6: L, - ol: Q, - h1: L, - h3: L, - option: N, - h2: L, - form: X(A, D, E, I), - select: _({ optgroup: 1, option: 1 }), - font: L, - ins: L, - menu: Q, - abbr: L, - label: L, - table: _({ - thead: 1, - col: 1, - tbody: 1, - tr: 1, - colgroup: 1, - caption: 1, - tfoot: 1 - }), - code: L, - tfoot: M, - cite: L, - li: P, - input: {}, - iframe: P, - strong: L, - textarea: N, - noframes: P, - big: L, - small: L, - //trace: - span: _({ - "#": 1, - br: 1, - b: 1, - strong: 1, - u: 1, - i: 1, - em: 1, - sub: 1, - sup: 1, - strike: 1, - span: 1 - }), - hr: L, - dt: L, - sub: L, - optgroup: _({ option: 1 }), - param: {}, - bdo: L, - var: L, - div: P, - object: O, - sup: L, - dd: P, - strike: L, - area: {}, - dir: Q, - map: X(_({ area: 1, form: 1, p: 1 }), A, F, E), - applet: O, - dl: _({ dt: 1, dd: 1 }), - del: L, - isindex: {}, - fieldset: X(_({ legend: 1 }), K), - thead: M, - ul: Q, - acronym: L, - b: L, - a: X(_({ a: 1 }), J), - blockquote: X(_({ td: 1, tr: 1, tbody: 1, li: 1 }), P), - caption: L, - i: L, - u: L, - tbody: M, - s: L, - address: X(D, I), - tt: L, - legend: L, - q: L, - pre: X(G, C), - p: X(_({ a: 1 }), L), - em: L, - dfn: L, - mark: L - }); -})()); - - -// core/domUtils.js -/** - * Dom操作工具包 - * @file - * @module UE.dom.domUtils - * @since 1.2.6.1 - */ - -/** - * Dom操作工具包 - * @unfile - * @module UE.dom.domUtils - */ -function getDomNode(node, start, ltr, startFromChild, fn, guard) { - var tmpNode = startFromChild && node[start], - parent; - !tmpNode && (tmpNode = node[ltr]); - while (!tmpNode && (parent = (parent || node).parentNode)) { - if (parent.tagName == "BODY" || (guard && !guard(parent))) { - return null; - } - tmpNode = parent[ltr]; - } - if (tmpNode && fn && !fn(tmpNode)) { - return getDomNode(tmpNode, start, ltr, false, fn); - } - return tmpNode; -} -var attrFix = ie && browser.version < 9 - ? { - tabindex: "tabIndex", - readonly: "readOnly", - for: "htmlFor", - class: "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder" - } - : { - tabindex: "tabIndex", - readonly: "readOnly" - }, - styleBlock = utils.listToMap([ - "-webkit-box", - "-moz-box", - "block", - "list-item", - "table", - "table-row-group", - "table-header-group", - "table-footer-group", - "table-row", - "table-column-group", - "table-column", - "table-cell", - "table-caption" - ]); -var domUtils = (dom.domUtils = { - //节点常量 - NODE_ELEMENT: 1, - NODE_DOCUMENT: 9, - NODE_TEXT: 3, - NODE_COMMENT: 8, - NODE_DOCUMENT_FRAGMENT: 11, - - //位置关系 - POSITION_IDENTICAL: 0, - POSITION_DISCONNECTED: 1, - POSITION_FOLLOWING: 2, - POSITION_PRECEDING: 4, - POSITION_IS_CONTAINED: 8, - POSITION_CONTAINS: 16, - //ie6使用其他的会有一段空白出现 - fillChar: ie && browser.version == "6" ? "\ufeff" : "\u200B", - //-------------------------Node部分-------------------------------- - keys: { - /*Backspace*/ 8: 1, - /*Delete*/ 46: 1, - /*Shift*/ 16: 1, - /*Ctrl*/ 17: 1, - /*Alt*/ 18: 1, - 37: 1, - 38: 1, - 39: 1, - 40: 1, - 13: 1 /*enter*/ - }, - /** - * 获取节点A相对于节点B的位置关系 - * @method getPosition - * @param { Node } nodeA 需要查询位置关系的节点A - * @param { Node } nodeB 需要查询位置关系的节点B - * @return { Number } 节点A与节点B的关系 - * @example - * ```javascript - * //output: 20 - * var position = UE.dom.domUtils.getPosition( document.documentElement, document.body ); - * - * switch ( position ) { - * - * //0 - * case UE.dom.domUtils.POSITION_IDENTICAL: - * console.log('元素相同'); - * break; - * //1 - * case UE.dom.domUtils.POSITION_DISCONNECTED: - * console.log('两个节点在不同的文档中'); - * break; - * //2 - * case UE.dom.domUtils.POSITION_FOLLOWING: - * console.log('节点A在节点B之后'); - * break; - * //4 - * case UE.dom.domUtils.POSITION_PRECEDING; - * console.log('节点A在节点B之前'); - * break; - * //8 - * case UE.dom.domUtils.POSITION_IS_CONTAINED: - * console.log('节点A被节点B包含'); - * break; - * case 10: - * console.log('节点A被节点B包含且节点A在节点B之后'); - * break; - * //16 - * case UE.dom.domUtils.POSITION_CONTAINS: - * console.log('节点A包含节点B'); - * break; - * case 20: - * console.log('节点A包含节点B且节点A在节点B之前'); - * break; - * - * } - * ``` - */ - getPosition: function(nodeA, nodeB) { - // 如果两个节点是同一个节点 - if (nodeA === nodeB) { - // domUtils.POSITION_IDENTICAL - return 0; - } - var node, - parentsA = [nodeA], - parentsB = [nodeB]; - node = nodeA; - while ((node = node.parentNode)) { - // 如果nodeB是nodeA的祖先节点 - if (node === nodeB) { - // domUtils.POSITION_IS_CONTAINED + domUtils.POSITION_FOLLOWING - return 10; - } - parentsA.push(node); - } - node = nodeB; - while ((node = node.parentNode)) { - // 如果nodeA是nodeB的祖先节点 - if (node === nodeA) { - // domUtils.POSITION_CONTAINS + domUtils.POSITION_PRECEDING - return 20; - } - parentsB.push(node); - } - parentsA.reverse(); - parentsB.reverse(); - if (parentsA[0] !== parentsB[0]) { - // domUtils.POSITION_DISCONNECTED - return 1; - } - var i = -1; - while ((i++, parentsA[i] === parentsB[i])) {} - nodeA = parentsA[i]; - nodeB = parentsB[i]; - while ((nodeA = nodeA.nextSibling)) { - if (nodeA === nodeB) { - // domUtils.POSITION_PRECEDING - return 4; - } - } - // domUtils.POSITION_FOLLOWING - return 2; - }, - - /** - * 检测节点node在父节点中的索引位置 - * @method getNodeIndex - * @param { Node } node 需要检测的节点对象 - * @return { Number } 该节点在父节点中的位置 - * @see UE.dom.domUtils.getNodeIndex(Node,Boolean) - */ - - /** - * 检测节点node在父节点中的索引位置, 根据给定的mergeTextNode参数决定是否要合并多个连续的文本节点为一个节点 - * @method getNodeIndex - * @param { Node } node 需要检测的节点对象 - * @param { Boolean } mergeTextNode 是否合并多个连续的文本节点为一个节点 - * @return { Number } 该节点在父节点中的位置 - * @example - * ```javascript - * - * var node = document.createElement("div"); - * - * node.appendChild( document.createTextNode( "hello" ) ); - * node.appendChild( document.createTextNode( "world" ) ); - * node.appendChild( node = document.createElement( "div" ) ); - * - * //output: 2 - * console.log( UE.dom.domUtils.getNodeIndex( node ) ); - * - * //output: 1 - * console.log( UE.dom.domUtils.getNodeIndex( node, true ) ); - * - * ``` - */ - getNodeIndex: function(node, ignoreTextNode) { - var preNode = node, - i = 0; - while ((preNode = preNode.previousSibling)) { - if (ignoreTextNode && preNode.nodeType == 3) { - if (preNode.nodeType != preNode.nextSibling.nodeType) { - i++; - } - continue; - } - i++; - } - return i; - }, - - /** - * 检测节点node是否在给定的document对象上 - * @method inDoc - * @param { Node } node 需要检测的节点对象 - * @param { DomDocument } doc 需要检测的document对象 - * @return { Boolean } 该节点node是否在给定的document的dom树上 - * @example - * ```javascript - * - * var node = document.createElement("div"); - * - * //output: false - * console.log( UE.do.domUtils.inDoc( node, document ) ); - * - * document.body.appendChild( node ); - * - * //output: true - * console.log( UE.do.domUtils.inDoc( node, document ) ); - * - * ``` - */ - inDoc: function(node, doc) { - return domUtils.getPosition(node, doc) == 10; - }, - /** - * 根据给定的过滤规则filterFn, 查找符合该过滤规则的node节点的第一个祖先节点, - * 查找的起点是给定node节点的父节点。 - * @method findParent - * @param { Node } node 需要查找的节点 - * @param { Function } filterFn 自定义的过滤方法。 - * @warning 查找的终点是到body节点为止 - * @remind 自定义的过滤方法filterFn接受一个Node对象作为参数, 该对象代表当前执行检测的祖先节点。 如果该 - * 节点满足过滤条件, 则要求返回true, 这时将直接返回该节点作为findParent()的结果, 否则, 请返回false。 - * @return { Node | Null } 如果找到符合过滤条件的节点, 就返回该节点, 否则返回NULL - * @example - * ```javascript - * var filterNode = UE.dom.domUtils.findParent( document.body.firstChild, function ( node ) { - * - * //由于查找的终点是body节点, 所以永远也不会匹配当前过滤器的条件, 即这里永远会返回false - * return node.tagName === "HTML"; - * - * } ); - * - * //output: true - * console.log( filterNode === null ); - * ``` - */ - - /** - * 根据给定的过滤规则filterFn, 查找符合该过滤规则的node节点的第一个祖先节点, - * 如果includeSelf的值为true,则查找的起点是给定的节点node, 否则, 起点是node的父节点 - * @method findParent - * @param { Node } node 需要查找的节点 - * @param { Function } filterFn 自定义的过滤方法。 - * @param { Boolean } includeSelf 查找过程是否包含自身 - * @warning 查找的终点是到body节点为止 - * @remind 自定义的过滤方法filterFn接受一个Node对象作为参数, 该对象代表当前执行检测的祖先节点。 如果该 - * 节点满足过滤条件, 则要求返回true, 这时将直接返回该节点作为findParent()的结果, 否则, 请返回false。 - * @remind 如果includeSelf为true, 则过滤器第一次执行时的参数会是节点本身。 - * 反之, 过滤器第一次执行时的参数将是该节点的父节点。 - * @return { Node | Null } 如果找到符合过滤条件的节点, 就返回该节点, 否则返回NULL - * @example - * ```html - * - * - *
                      - *
                      - * - * - * - * ``` - */ - findParent: function(node, filterFn, includeSelf) { - if (node && !domUtils.isBody(node)) { - node = includeSelf ? node : node.parentNode; - while (node) { - if (!filterFn || filterFn(node) || domUtils.isBody(node)) { - return filterFn && !filterFn(node) && domUtils.isBody(node) - ? null - : node; - } - node = node.parentNode; - } - } - return null; - }, - /** - * 查找node的节点名为tagName的第一个祖先节点, 查找的起点是node节点的父节点。 - * @method findParentByTagName - * @param { Node } node 需要查找的节点对象 - * @param { Array } tagNames 需要查找的父节点的名称数组 - * @warning 查找的终点是到body节点为止 - * @return { Node | NULL } 如果找到符合条件的节点, 则返回该节点, 否则返回NULL - * @example - * ```javascript - * var node = UE.dom.domUtils.findParentByTagName( document.getElementsByTagName("div")[0], [ "BODY" ] ); - * //output: BODY - * console.log( node.tagName ); - * ``` - */ - - /** - * 查找node的节点名为tagName的祖先节点, 如果includeSelf的值为true,则查找的起点是给定的节点node, - * 否则, 起点是node的父节点。 - * @method findParentByTagName - * @param { Node } node 需要查找的节点对象 - * @param { Array } tagNames 需要查找的父节点的名称数组 - * @param { Boolean } includeSelf 查找过程是否包含node节点自身 - * @warning 查找的终点是到body节点为止 - * @return { Node | NULL } 如果找到符合条件的节点, 则返回该节点, 否则返回NULL - * @example - * ```javascript - * var queryTarget = document.getElementsByTagName("div")[0]; - * var node = UE.dom.domUtils.findParentByTagName( queryTarget, [ "DIV" ], true ); - * //output: true - * console.log( queryTarget === node ); - * ``` - */ - findParentByTagName: function(node, tagNames, includeSelf, excludeFn) { - tagNames = utils.listToMap(utils.isArray(tagNames) ? tagNames : [tagNames]); - return domUtils.findParent( - node, - function(node) { - return tagNames[node.tagName] && !(excludeFn && excludeFn(node)); - }, - includeSelf - ); - }, - /** - * 查找节点node的祖先节点集合, 查找的起点是给定节点的父节点,结果集中不包含给定的节点。 - * @method findParents - * @param { Node } node 需要查找的节点对象 - * @return { Array } 给定节点的祖先节点数组 - * @grammar UE.dom.domUtils.findParents(node) => Array //返回一个祖先节点数组集合,不包含自身 - * @grammar UE.dom.domUtils.findParents(node,includeSelf) => Array //返回一个祖先节点数组集合,includeSelf指定是否包含自身 - * @grammar UE.dom.domUtils.findParents(node,includeSelf,filterFn) => Array //返回一个祖先节点数组集合,filterFn指定过滤条件,返回true的node将被选取 - * @grammar UE.dom.domUtils.findParents(node,includeSelf,filterFn,closerFirst) => Array //返回一个祖先节点数组集合,closerFirst为true的话,node的直接父亲节点是数组的第0个 - */ - - /** - * 查找节点node的祖先节点集合, 如果includeSelf的值为true, - * 则返回的结果集中允许出现当前给定的节点, 否则, 该节点不会出现在其结果集中。 - * @method findParents - * @param { Node } node 需要查找的节点对象 - * @param { Boolean } includeSelf 查找的结果中是否允许包含当前查找的节点对象 - * @return { Array } 给定节点的祖先节点数组 - */ - findParents: function(node, includeSelf, filterFn, closerFirst) { - var parents = includeSelf && ((filterFn && filterFn(node)) || !filterFn) - ? [node] - : []; - while ((node = domUtils.findParent(node, filterFn))) { - parents.push(node); - } - return closerFirst ? parents : parents.reverse(); - }, - - /** - * 在节点node后面插入新节点newNode - * @method insertAfter - * @param { Node } node 目标节点 - * @param { Node } newNode 新插入的节点, 该节点将置于目标节点之后 - * @return { Node } 新插入的节点 - */ - insertAfter: function(node, newNode) { - return node.nextSibling - ? node.parentNode.insertBefore(newNode, node.nextSibling) - : node.parentNode.appendChild(newNode); - }, - - /** - * 删除节点node及其下属的所有节点 - * @method remove - * @param { Node } node 需要删除的节点对象 - * @return { Node } 返回刚删除的节点对象 - * @example - * ```html - *
                      - *
                      你好
                      - *
                      - * - * ``` - */ - - /** - * 删除节点node,并根据keepChildren的值决定是否保留子节点 - * @method remove - * @param { Node } node 需要删除的节点对象 - * @param { Boolean } keepChildren 是否需要保留子节点 - * @return { Node } 返回刚删除的节点对象 - * @example - * ```html - *
                      - *
                      你好
                      - *
                      - * - * ``` - */ - remove: function(node, keepChildren) { - var parent = node.parentNode, - child; - if (parent) { - if (keepChildren && node.hasChildNodes()) { - while ((child = node.firstChild)) { - parent.insertBefore(child, node); - } - } - parent.removeChild(node); - } - return node; - }, - - /** - * 取得node节点的下一个兄弟节点, 如果该节点其后没有兄弟节点, 则递归查找其父节点之后的第一个兄弟节点, - * 直到找到满足条件的节点或者递归到BODY节点之后才会结束。 - * @method getNextDomNode - * @param { Node } node 需要获取其后的兄弟节点的节点对象 - * @return { Node | NULL } 如果找满足条件的节点, 则返回该节点, 否则返回NULL - * @example - * ```html - * - *
                      - * - *
                      - * xxx - * - * - * ``` - * @example - * ```html - * - *
                      - * - * xxx - *
                      - * xxx - * - * - * ``` - */ - - /** - * 取得node节点的下一个兄弟节点, 如果startFromChild的值为ture,则先获取其子节点, - * 如果有子节点则直接返回第一个子节点;如果没有子节点或者startFromChild的值为false, - * 则执行getNextDomNode(Node node)的查找过程。 - * @method getNextDomNode - * @param { Node } node 需要获取其后的兄弟节点的节点对象 - * @param { Boolean } startFromChild 查找过程是否从其子节点开始 - * @return { Node | NULL } 如果找满足条件的节点, 则返回该节点, 否则返回NULL - * @see UE.dom.domUtils.getNextDomNode(Node) - */ - getNextDomNode: function(node, startFromChild, filterFn, guard) { - return getDomNode( - node, - "firstChild", - "nextSibling", - startFromChild, - filterFn, - guard - ); - }, - getPreDomNode: function(node, startFromChild, filterFn, guard) { - return getDomNode( - node, - "lastChild", - "previousSibling", - startFromChild, - filterFn, - guard - ); - }, - /** - * 检测节点node是否属是UEditor定义的bookmark节点 - * @method isBookmarkNode - * @private - * @param { Node } node 需要检测的节点对象 - * @return { Boolean } 是否是bookmark节点 - * @example - * ```html - * - * - * ``` - */ - isBookmarkNode: function(node) { - return node.nodeType == 1 && node.id && /^_baidu_bookmark_/i.test(node.id); - }, - /** - * 获取节点node所属的window对象 - * @method getWindow - * @param { Node } node 节点对象 - * @return { Window } 当前节点所属的window对象 - * @example - * ```javascript - * //output: true - * console.log( UE.dom.domUtils.getWindow( document.body ) === window ); - * ``` - */ - getWindow: function(node) { - var doc = node.ownerDocument || node; - return doc.defaultView || doc.parentWindow; - }, - /** - * 获取离nodeA与nodeB最近的公共的祖先节点 - * @method getCommonAncestor - * @param { Node } nodeA 第一个节点 - * @param { Node } nodeB 第二个节点 - * @remind 如果给定的两个节点是同一个节点, 将直接返回该节点。 - * @return { Node | NULL } 如果未找到公共节点, 返回NULL, 否则返回最近的公共祖先节点。 - * @example - * ```javascript - * var commonAncestor = UE.dom.domUtils.getCommonAncestor( document.body, document.body.firstChild ); - * //output: true - * console.log( commonAncestor.tagName.toLowerCase() === 'body' ); - * ``` - */ - getCommonAncestor: function(nodeA, nodeB) { - if (nodeA === nodeB) return nodeA; - var parentsA = [nodeA], - parentsB = [nodeB], - parent = nodeA, - i = -1; - while ((parent = parent.parentNode)) { - if (parent === nodeB) { - return parent; - } - parentsA.push(parent); - } - parent = nodeB; - while ((parent = parent.parentNode)) { - if (parent === nodeA) return parent; - parentsB.push(parent); - } - parentsA.reverse(); - parentsB.reverse(); - while ((i++, parentsA[i] === parentsB[i])) {} - return i == 0 ? null : parentsA[i - 1]; - }, - /** - * 清除node节点左右连续为空的兄弟inline节点 - * @method clearEmptySibling - * @param { Node } node 执行的节点对象, 如果该节点的左右连续的兄弟节点是空的inline节点, - * 则这些兄弟节点将被删除 - * @grammar UE.dom.domUtils.clearEmptySibling(node,ignoreNext) //ignoreNext指定是否忽略右边空节点 - * @grammar UE.dom.domUtils.clearEmptySibling(node,ignoreNext,ignorePre) //ignorePre指定是否忽略左边空节点 - * @example - * ```html - * - *
                      - * - * - * - * xxx - * - * - * - * ``` - */ - - /** - * 清除node节点左右连续为空的兄弟inline节点, 如果ignoreNext的值为true, - * 则忽略对右边兄弟节点的操作。 - * @method clearEmptySibling - * @param { Node } node 执行的节点对象, 如果该节点的左右连续的兄弟节点是空的inline节点, - * @param { Boolean } ignoreNext 是否忽略忽略对右边的兄弟节点的操作 - * 则这些兄弟节点将被删除 - * @see UE.dom.domUtils.clearEmptySibling(Node) - */ - - /** - * 清除node节点左右连续为空的兄弟inline节点, 如果ignoreNext的值为true, - * 则忽略对右边兄弟节点的操作, 如果ignorePre的值为true,则忽略对左边兄弟节点的操作。 - * @method clearEmptySibling - * @param { Node } node 执行的节点对象, 如果该节点的左右连续的兄弟节点是空的inline节点, - * @param { Boolean } ignoreNext 是否忽略忽略对右边的兄弟节点的操作 - * @param { Boolean } ignorePre 是否忽略忽略对左边的兄弟节点的操作 - * 则这些兄弟节点将被删除 - * @see UE.dom.domUtils.clearEmptySibling(Node) - */ - clearEmptySibling: function(node, ignoreNext, ignorePre) { - function clear(next, dir) { - var tmpNode; - while ( - next && - !domUtils.isBookmarkNode(next) && - (domUtils.isEmptyInlineElement(next) || - //这里不能把空格算进来会吧空格干掉,出现文字间的空格丢掉了 - !new RegExp("[^\t\n\r" + domUtils.fillChar + "]").test( - next.nodeValue - )) - ) { - tmpNode = next[dir]; - domUtils.remove(next); - next = tmpNode; - } - } - !ignoreNext && clear(node.nextSibling, "nextSibling"); - !ignorePre && clear(node.previousSibling, "previousSibling"); - }, - /** - * 将一个文本节点textNode拆分成两个文本节点,offset指定拆分位置 - * @method split - * @param { Node } textNode 需要拆分的文本节点对象 - * @param { int } offset 需要拆分的位置, 位置计算从0开始 - * @return { Node } 拆分后形成的新节点 - * @example - * ```html - *
                      abcdef
                      - * - * ``` - */ - split: function(node, offset) { - var doc = node.ownerDocument; - if (browser.ie && offset == node.nodeValue.length) { - var next = doc.createTextNode(""); - return domUtils.insertAfter(node, next); - } - var retval = node.splitText(offset); - //ie8下splitText不会跟新childNodes,我们手动触发他的更新 - if (browser.ie8) { - var tmpNode = doc.createTextNode(""); - domUtils.insertAfter(retval, tmpNode); - domUtils.remove(tmpNode); - } - return retval; - }, - - /** - * 检测文本节点textNode是否为空节点(包括空格、换行、占位符等字符) - * @method isWhitespace - * @param { Node } node 需要检测的节点对象 - * @return { Boolean } 检测的节点是否为空 - * @example - * ```html - *
                      - * - *
                      - * - * ``` - */ - isWhitespace: function(node) { - return !new RegExp("[^ \t\n\r" + domUtils.fillChar + "]").test( - node.nodeValue - ); - }, - /** - * 获取元素element相对于viewport的位置坐标 - * @method getXY - * @param { Node } element 需要计算位置的节点对象 - * @return { Object } 返回形如{x:left,y:top}的一个key-value映射对象, 其中键x代表水平偏移距离, - * y代表垂直偏移距离。 - * - * @example - * ```javascript - * var location = UE.dom.domUtils.getXY( document.getElementById("test") ); - * //output: test的坐标为: 12, 24 - * console.log( 'test的坐标为: ', location.x, ',', location.y ); - * ``` - */ - getXY: function(element) { - var x = 0, - y = 0; - while (element.offsetParent) { - y += element.offsetTop; - x += element.offsetLeft; - element = element.offsetParent; - } - return { x: x, y: y }; - }, - /** - * 为元素element绑定原生DOM事件,type为事件类型,handler为处理函数 - * @method on - * @param { Node } element 需要绑定事件的节点对象 - * @param { String } type 绑定的事件类型 - * @param { Function } handler 事件处理器 - * @example - * ```javascript - * UE.dom.domUtils.on(document.body,"click",function(e){ - * //e为事件对象,this为被点击元素对戏那个 - * }); - * ``` - */ - - /** - * 为元素element绑定原生DOM事件,type为事件类型,handler为处理函数 - * @method on - * @param { Node } element 需要绑定事件的节点对象 - * @param { Array } type 绑定的事件类型数组 - * @param { Function } handler 事件处理器 - * @example - * ```javascript - * UE.dom.domUtils.on(document.body,["click","mousedown"],function(evt){ - * //evt为事件对象,this为被点击元素对象 - * }); - * ``` - */ - on: function(element, type, handler) { - var types = utils.isArray(type) ? type : utils.trim(type).split(/\s+/), - k = types.length; - if (k) - while (k--) { - type = types[k]; - if (element.addEventListener) { - element.addEventListener(type, handler, false); - } else { - if (!handler._d) { - handler._d = { - els: [] - }; - } - var key = type + handler.toString(), - index = utils.indexOf(handler._d.els, element); - if (!handler._d[key] || index == -1) { - if (index == -1) { - handler._d.els.push(element); - } - if (!handler._d[key]) { - handler._d[key] = function(evt) { - return handler.call(evt.srcElement, evt || window.event); - }; - } - - element.attachEvent("on" + type, handler._d[key]); - } - } - } - element = null; - }, - /** - * 解除DOM事件绑定 - * @method un - * @param { Node } element 需要解除事件绑定的节点对象 - * @param { String } type 需要接触绑定的事件类型 - * @param { Function } handler 对应的事件处理器 - * @example - * ```javascript - * UE.dom.domUtils.un(document.body,"click",function(evt){ - * //evt为事件对象,this为被点击元素对象 - * }); - * ``` - */ - - /** - * 解除DOM事件绑定 - * @method un - * @param { Node } element 需要解除事件绑定的节点对象 - * @param { Array } type 需要接触绑定的事件类型数组 - * @param { Function } handler 对应的事件处理器 - * @example - * ```javascript - * UE.dom.domUtils.un(document.body, ["click","mousedown"],function(evt){ - * //evt为事件对象,this为被点击元素对象 - * }); - * ``` - */ - un: function(element, type, handler) { - var types = utils.isArray(type) ? type : utils.trim(type).split(/\s+/), - k = types.length; - if (k) - while (k--) { - type = types[k]; - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else { - var key = type + handler.toString(); - try { - element.detachEvent( - "on" + type, - handler._d ? handler._d[key] : handler - ); - } catch (e) {} - if (handler._d && handler._d[key]) { - var index = utils.indexOf(handler._d.els, element); - if (index != -1) { - handler._d.els.splice(index, 1); - } - handler._d.els.length == 0 && delete handler._d[key]; - } - } - } - }, - - /** - * 比较节点nodeA与节点nodeB是否具有相同的标签名、属性名以及属性值 - * @method isSameElement - * @param { Node } nodeA 需要比较的节点 - * @param { Node } nodeB 需要比较的节点 - * @return { Boolean } 两个节点是否具有相同的标签名、属性名以及属性值 - * @example - * ```html - * ssss - * bbbbb - * ssss - * bbbbb - * - * - * ``` - */ - isSameElement: function(nodeA, nodeB) { - if (nodeA.tagName != nodeB.tagName) { - return false; - } - var thisAttrs = nodeA.attributes, - otherAttrs = nodeB.attributes; - if (!ie && thisAttrs.length != otherAttrs.length) { - return false; - } - var attrA, - attrB, - al = 0, - bl = 0; - for (var i = 0; (attrA = thisAttrs[i++]); ) { - if (attrA.nodeName == "style") { - if (attrA.specified) { - al++; - } - if (domUtils.isSameStyle(nodeA, nodeB)) { - continue; - } else { - return false; - } - } - if (ie) { - if (attrA.specified) { - al++; - attrB = otherAttrs.getNamedItem(attrA.nodeName); - } else { - continue; - } - } else { - attrB = nodeB.attributes[attrA.nodeName]; - } - if (!attrB.specified || attrA.nodeValue != attrB.nodeValue) { - return false; - } - } - // 有可能attrB的属性包含了attrA的属性之外还有自己的属性 - if (ie) { - for (i = 0; (attrB = otherAttrs[i++]); ) { - if (attrB.specified) { - bl++; - } - } - if (al != bl) { - return false; - } - } - return true; - }, - - /** - * 判断节点nodeA与节点nodeB的元素的style属性是否一致 - * @method isSameStyle - * @param { Node } nodeA 需要比较的节点 - * @param { Node } nodeB 需要比较的节点 - * @return { Boolean } 两个节点是否具有相同的style属性值 - * @example - * ```html - * ssss - * bbbbb - * ssss - * bbbbb - * - * - * ``` - */ - isSameStyle: function(nodeA, nodeB) { - var styleA = nodeA.style.cssText - .replace(/( ?; ?)/g, ";") - .replace(/( ?: ?)/g, ":"), - styleB = nodeB.style.cssText - .replace(/( ?; ?)/g, ";") - .replace(/( ?: ?)/g, ":"); - if (browser.opera) { - styleA = nodeA.style; - styleB = nodeB.style; - if (styleA.length != styleB.length) return false; - for (var p in styleA) { - if (/^(\d+|csstext)$/i.test(p)) { - continue; - } - if (styleA[p] != styleB[p]) { - return false; - } - } - return true; - } - if (!styleA || !styleB) { - return styleA == styleB; - } - styleA = styleA.split(";"); - styleB = styleB.split(";"); - if (styleA.length != styleB.length) { - return false; - } - for (var i = 0, ci; (ci = styleA[i++]); ) { - if (utils.indexOf(styleB, ci) == -1) { - return false; - } - } - return true; - }, - /** - * 检查节点node是否为block元素 - * @method isBlockElm - * @param { Node } node 需要检测的节点对象 - * @return { Boolean } 是否是block元素节点 - * @warning 该方法的判断规则如下: 如果该元素原本是block元素, 则不论该元素当前的css样式是什么都会返回true; - * 否则,检测该元素的css样式, 如果该元素当前是block元素, 则返回true。 其余情况下都返回false。 - * @example - * ```html - * - * - *
                      - * - * - * ``` - */ - isBlockElm: function(node) { - return ( - node.nodeType == 1 && - (dtd.$block[node.tagName] || - styleBlock[domUtils.getComputedStyle(node, "display")]) && - !dtd.$nonChild[node.tagName] - ); - }, - /** - * 检测node节点是否为body节点 - * @method isBody - * @param { Element } node 需要检测的dom元素 - * @return { Boolean } 给定的元素是否是body元素 - * @example - * ```javascript - * //output: true - * console.log( UE.dom.domUtils.isBody( document.body ) ); - * ``` - */ - isBody: function(node) { - return node && node.nodeType == 1 && node.tagName.toLowerCase() == "body"; - }, - /** - * 以node节点为分界,将该节点的指定祖先节点parent拆分成两个独立的节点, - * 拆分形成的两个节点之间是node节点 - * @method breakParent - * @param { Node } node 作为分界的节点对象 - * @param { Node } parent 该节点必须是node节点的祖先节点, 且是block节点。 - * @return { Node } 给定的node分界节点 - * @example - * ```javascript - * - * var node = document.createElement("span"), - * wrapNode = document.createElement( "div" ), - * parent = document.createElement("p"); - * - * parent.appendChild( node ); - * wrapNode.appendChild( parent ); - * - * //拆分前 - * //output:

                      - * console.log( wrapNode.innerHTML ); - * - * - * UE.dom.domUtils.breakParent( node, parent ); - * //拆分后 - * //output:

                      - * console.log( wrapNode.innerHTML ); - * - * ``` - */ - breakParent: function(node, parent) { - var tmpNode, - parentClone = node, - clone = node, - leftNodes, - rightNodes; - do { - parentClone = parentClone.parentNode; - if (leftNodes) { - tmpNode = parentClone.cloneNode(false); - tmpNode.appendChild(leftNodes); - leftNodes = tmpNode; - tmpNode = parentClone.cloneNode(false); - tmpNode.appendChild(rightNodes); - rightNodes = tmpNode; - } else { - leftNodes = parentClone.cloneNode(false); - rightNodes = leftNodes.cloneNode(false); - } - while ((tmpNode = clone.previousSibling)) { - leftNodes.insertBefore(tmpNode, leftNodes.firstChild); - } - while ((tmpNode = clone.nextSibling)) { - rightNodes.appendChild(tmpNode); - } - clone = parentClone; - } while (parent !== parentClone); - tmpNode = parent.parentNode; - tmpNode.insertBefore(leftNodes, parent); - tmpNode.insertBefore(rightNodes, parent); - tmpNode.insertBefore(node, rightNodes); - domUtils.remove(parent); - return node; - }, - /** - * 检查节点node是否是空inline节点 - * @method isEmptyInlineElement - * @param { Node } node 需要检测的节点对象 - * @return { Number } 如果给定的节点是空的inline节点, 则返回1, 否则返回0。 - * @example - * ```html - * => 1 - * => 1 - * => 1 - * xx => 0 - * ``` - */ - isEmptyInlineElement: function(node) { - if (node.nodeType != 1 || !dtd.$removeEmpty[node.tagName]) { - return 0; - } - node = node.firstChild; - while (node) { - //如果是创建的bookmark就跳过 - if (domUtils.isBookmarkNode(node)) { - return 0; - } - if ( - (node.nodeType == 1 && !domUtils.isEmptyInlineElement(node)) || - (node.nodeType == 3 && !domUtils.isWhitespace(node)) - ) { - return 0; - } - node = node.nextSibling; - } - return 1; - }, - - /** - * 删除node节点下首尾两端的空白文本子节点 - * @method trimWhiteTextNode - * @param { Element } node 需要执行删除操作的元素对象 - * @example - * ```javascript - * var node = document.createElement("div"); - * - * node.appendChild( document.createTextNode( "" ) ); - * - * node.appendChild( document.createElement("div") ); - * - * node.appendChild( document.createTextNode( "" ) ); - * - * //3 - * console.log( node.childNodes.length ); - * - * UE.dom.domUtils.trimWhiteTextNode( node ); - * - * //1 - * console.log( node.childNodes.length ); - * ``` - */ - trimWhiteTextNode: function(node) { - function remove(dir) { - var child; - while ( - (child = node[dir]) && - child.nodeType == 3 && - domUtils.isWhitespace(child) - ) { - node.removeChild(child); - } - } - remove("firstChild"); - remove("lastChild"); - }, - - /** - * 合并node节点下相同的子节点 - * @name mergeChild - * @desc - * UE.dom.domUtils.mergeChild(node,tagName) //tagName要合并的子节点的标签 - * @example - *

                      xxaaxx

                      - * ==> UE.dom.domUtils.mergeChild(node,'span') - *

                      xxaaxx

                      - */ - mergeChild: function(node, tagName, attrs) { - var list = domUtils.getElementsByTagName(node, node.tagName.toLowerCase()); - for (var i = 0, ci; (ci = list[i++]); ) { - if (!ci.parentNode || domUtils.isBookmarkNode(ci)) { - continue; - } - //span单独处理 - if (ci.tagName.toLowerCase() == "span") { - if (node === ci.parentNode) { - domUtils.trimWhiteTextNode(node); - if (node.childNodes.length == 1) { - node.style.cssText = ci.style.cssText + ";" + node.style.cssText; - domUtils.remove(ci, true); - continue; - } - } - ci.style.cssText = node.style.cssText + ";" + ci.style.cssText; - if (attrs) { - var style = attrs.style; - if (style) { - style = style.split(";"); - for (var j = 0, s; (s = style[j++]); ) { - ci.style[utils.cssStyleToDomStyle(s.split(":")[0])] = s.split( - ":" - )[1]; - } - } - } - if (domUtils.isSameStyle(ci, node)) { - domUtils.remove(ci, true); - } - continue; - } - if (domUtils.isSameElement(node, ci)) { - domUtils.remove(ci, true); - } - } - }, - - /** - * 原生方法getElementsByTagName的封装 - * @method getElementsByTagName - * @param { Node } node 目标节点对象 - * @param { String } tagName 需要查找的节点的tagName, 多个tagName以空格分割 - * @return { Array } 符合条件的节点集合 - */ - getElementsByTagName: function(node, name, filter) { - if (filter && utils.isString(filter)) { - var className = filter; - filter = function(node) { - return domUtils.hasClass(node, className); - }; - } - name = utils.trim(name).replace(/[ ]{2,}/g, " ").split(" "); - var arr = []; - for (var n = 0, ni; (ni = name[n++]); ) { - var list = node.getElementsByTagName(ni); - for (var i = 0, ci; (ci = list[i++]); ) { - if (!filter || filter(ci)) arr.push(ci); - } - } - - return arr; - }, - /** - * 将节点node提取到父节点上 - * @method mergeToParent - * @param { Element } node 需要提取的元素对象 - * @example - * ```html - *
                      - *
                      - * - *
                      - *
                      - * - * - * ``` - */ - mergeToParent: function(node) { - var parent = node.parentNode; - while (parent && dtd.$removeEmpty[parent.tagName]) { - if (parent.tagName == node.tagName || parent.tagName == "A") { - //针对a标签单独处理 - domUtils.trimWhiteTextNode(parent); - //span需要特殊处理 不处理这样的情况 xxxxxxxxx - if ( - (parent.tagName == "SPAN" && !domUtils.isSameStyle(parent, node)) || - (parent.tagName == "A" && node.tagName == "SPAN") - ) { - if (parent.childNodes.length > 1 || parent !== node.parentNode) { - node.style.cssText = - parent.style.cssText + ";" + node.style.cssText; - parent = parent.parentNode; - continue; - } else { - parent.style.cssText += ";" + node.style.cssText; - //trace:952 a标签要保持下划线 - if (parent.tagName == "A") { - parent.style.textDecoration = "underline"; - } - } - } - if (parent.tagName != "A") { - parent === node.parentNode && domUtils.remove(node, true); - break; - } - } - parent = parent.parentNode; - } - }, - /** - * 合并节点node的左右兄弟节点 - * @method mergeSibling - * @param { Element } node 需要合并的目标节点 - * @example - * ```html - * xxxxoooxxxx - * - * - * ``` - */ - - /** - * 合并节点node的左右兄弟节点, 可以根据给定的条件选择是否忽略合并左节点。 - * @method mergeSibling - * @param { Element } node 需要合并的目标节点 - * @param { Boolean } ignorePre 是否忽略合并左节点 - * @example - * ```html - * xxxxoooxxxx - * - * - * ``` - */ - - /** - * 合并节点node的左右兄弟节点,可以根据给定的条件选择是否忽略合并左右节点。 - * @method mergeSibling - * @param { Element } node 需要合并的目标节点 - * @param { Boolean } ignorePre 是否忽略合并左节点 - * @param { Boolean } ignoreNext 是否忽略合并右节点 - * @remind 如果同时忽略左右节点, 则该操作什么也不会做 - * @example - * ```html - * xxxxoooxxxx - * - * - * ``` - */ - mergeSibling: function(node, ignorePre, ignoreNext) { - function merge(rtl, start, node) { - var next; - if ( - (next = node[rtl]) && - !domUtils.isBookmarkNode(next) && - next.nodeType == 1 && - domUtils.isSameElement(node, next) - ) { - while (next.firstChild) { - if (start == "firstChild") { - node.insertBefore(next.lastChild, node.firstChild); - } else { - node.appendChild(next.firstChild); - } - } - domUtils.remove(next); - } - } - !ignorePre && merge("previousSibling", "firstChild", node); - !ignoreNext && merge("nextSibling", "lastChild", node); - }, - - /** - * 设置节点node及其子节点不会被选中 - * @method unSelectable - * @param { Element } node 需要执行操作的dom元素 - * @remind 执行该操作后的节点, 将不能被鼠标选中 - * @example - * ```javascript - * UE.dom.domUtils.unSelectable( document.body ); - * ``` - */ - unSelectable: (ie && browser.ie9below) || browser.opera - ? function(node) { - //for ie9 - node.onselectstart = function() { - return false; - }; - node.onclick = node.onkeyup = node.onkeydown = function() { - return false; - }; - node.unselectable = "on"; - node.setAttribute("unselectable", "on"); - for (var i = 0, ci; (ci = node.all[i++]); ) { - switch (ci.tagName.toLowerCase()) { - case "iframe": - case "textarea": - case "input": - case "select": - break; - default: - ci.unselectable = "on"; - node.setAttribute("unselectable", "on"); - } - } - } - : function(node) { - node.style.MozUserSelect = node.style.webkitUserSelect = node.style.msUserSelect = node.style.KhtmlUserSelect = - "none"; - }, - /** - * 删除节点node上的指定属性名称的属性 - * @method removeAttributes - * @param { Node } node 需要删除属性的节点对象 - * @param { String } attrNames 可以是空格隔开的多个属性名称,该操作将会依次删除相应的属性 - * @example - * ```html - *
                      - * xxxxx - *
                      - * - * - * ``` - */ - - /** - * 删除节点node上的指定属性名称的属性 - * @method removeAttributes - * @param { Node } node 需要删除属性的节点对象 - * @param { Array } attrNames 需要删除的属性名数组 - * @example - * ```html - *
                      - * xxxxx - *
                      - * - * - * ``` - */ - removeAttributes: function(node, attrNames) { - attrNames = utils.isArray(attrNames) - ? attrNames - : utils.trim(attrNames).replace(/[ ]{2,}/g, " ").split(" "); - for (var i = 0, ci; (ci = attrNames[i++]); ) { - ci = attrFix[ci] || ci; - switch (ci) { - case "className": - node[ci] = ""; - break; - case "style": - node.style.cssText = ""; - var val = node.getAttributeNode("style"); - !browser.ie && val && node.removeAttributeNode(val); - } - node.removeAttribute(ci); - } - }, - /** - * 在doc下创建一个标签名为tag,属性为attrs的元素 - * @method createElement - * @param { DomDocument } doc 新创建的元素属于该document节点创建 - * @param { String } tagName 需要创建的元素的标签名 - * @param { Object } attrs 新创建的元素的属性key-value集合 - * @return { Element } 新创建的元素对象 - * @example - * ```javascript - * var ele = UE.dom.domUtils.createElement( document, 'div', { - * id: 'test' - * } ); - * - * //output: DIV - * console.log( ele.tagName ); - * - * //output: test - * console.log( ele.id ); - * - * ``` - */ - createElement: function(doc, tag, attrs) { - return domUtils.setAttributes(doc.createElement(tag), attrs); - }, - /** - * 为节点node添加属性attrs,attrs为属性键值对 - * @method setAttributes - * @param { Element } node 需要设置属性的元素对象 - * @param { Object } attrs 需要设置的属性名-值对 - * @return { Element } 设置属性的元素对象 - * @example - * ```html - * - * - * - * - */ - setAttributes: function(node, attrs) { - for (var attr in attrs) { - if (attrs.hasOwnProperty(attr)) { - var value = attrs[attr]; - switch (attr) { - case "class": - //ie下要这样赋值,setAttribute不起作用 - node.className = value; - break; - case "style": - node.style.cssText = node.style.cssText + ";" + value; - break; - case "innerHTML": - node[attr] = value; - break; - case "value": - node.value = value; - break; - default: - node.setAttribute(attrFix[attr] || attr, value); - } - } - } - return node; - }, - - /** - * 获取元素element经过计算后的样式值 - * @method getComputedStyle - * @param { Element } element 需要获取样式的元素对象 - * @param { String } styleName 需要获取的样式名 - * @return { String } 获取到的样式值 - * @example - * ```html - * - * - * - * - * - * ``` - */ - getComputedStyle: function(element, styleName) { - //一下的属性单独处理 - var pros = "width height top left"; - - if (pros.indexOf(styleName) > -1) { - return ( - element[ - "offset" + - styleName.replace(/^\w/, function(s) { - return s.toUpperCase(); - }) - ] + "px" - ); - } - //忽略文本节点 - if (element.nodeType == 3) { - element = element.parentNode; - } - //ie下font-size若body下定义了font-size,则从currentStyle里会取到这个font-size. 取不到实际值,故此修改. - if ( - browser.ie && - browser.version < 9 && - styleName == "font-size" && - !element.style.fontSize && - !dtd.$empty[element.tagName] && - !dtd.$nonChild[element.tagName] - ) { - var span = element.ownerDocument.createElement("span"); - span.style.cssText = "padding:0;border:0;font-family:simsun;"; - span.innerHTML = "."; - element.appendChild(span); - var result = span.offsetHeight; - element.removeChild(span); - span = null; - return result + "px"; - } - try { - var value = domUtils.getStyle(element, styleName) || - (window.getComputedStyle - ? domUtils.getWindow(element).getComputedStyle(element, "").getPropertyValue(styleName) - : (element.currentStyle || element.style)[utils.cssStyleToDomStyle(styleName)]); - } catch (e) { - return ""; - } - return utils.transUnitToPx(utils.fixColor(styleName, value)); - }, - /** - * 删除元素element指定的className - * @method removeClasses - * @param { Element } ele 需要删除class的元素节点 - * @param { String } classNames 需要删除的className, 多个className之间以空格分开 - * @example - * ```html - * xxx - * - * - * ``` - */ - - /** - * 删除元素element指定的className - * @method removeClasses - * @param { Element } ele 需要删除class的元素节点 - * @param { Array } classNames 需要删除的className数组 - * @example - * ```html - * xxx - * - * - * ``` - */ - removeClasses: function(elm, classNames) { - classNames = utils.isArray(classNames) - ? classNames - : utils.trim(classNames).replace(/[ ]{2,}/g, " ").split(" "); - for (var i = 0, ci, cls = elm.className; (ci = classNames[i++]); ) { - cls = cls.replace(new RegExp("\\b" + ci + "\\b"), ""); - } - cls = utils.trim(cls).replace(/[ ]{2,}/g, " "); - if (cls) { - elm.className = cls; - } else { - domUtils.removeAttributes(elm, ["class"]); - } - }, - /** - * 给元素element添加className - * @method addClass - * @param { Node } ele 需要增加className的元素 - * @param { String } classNames 需要添加的className, 多个className之间以空格分割 - * @remind 相同的类名不会被重复添加 - * @example - * ```html - * - * - * - * ``` - */ - - /** - * 判断元素element是否包含给定的样式类名className - * @method hasClass - * @param { Node } ele 需要检测的元素 - * @param { Array } classNames 需要检测的className数组 - * @return { Boolean } 元素是否包含所有给定的className - * @example - * ```html - * - * - * - * ``` - */ - hasClass: function(element, className) { - if (utils.isRegExp(className)) { - return className.test(element.className); - } - className = utils.trim(className).replace(/[ ]{2,}/g, " ").split(" "); - for (var i = 0, ci, cls = element.className; (ci = className[i++]); ) { - if (!new RegExp("\\b" + ci + "\\b", "i").test(cls)) { - return false; - } - } - return i - 1 == className.length; - }, - - /** - * 阻止事件默认行为 - * @method preventDefault - * @param { Event } evt 需要阻止默认行为的事件对象 - * @example - * ```javascript - * UE.dom.domUtils.preventDefault( evt ); - * ``` - */ - preventDefault: function(evt) { - evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); - }, - /** - * 删除元素element指定的样式 - * @method removeStyle - * @param { Element } element 需要删除样式的元素 - * @param { String } styleName 需要删除的样式名 - * @example - * ```html - * - * - * - * ``` - */ - removeStyle: function(element, name) { - if (browser.ie) { - //针对color先单独处理一下 - if (name == "color") { - name = "(^|;)" + name; - } - element.style.cssText = element.style.cssText.replace( - new RegExp(name + "[^:]*:[^;]+;?", "ig"), - "" - ); - } else { - if (element.style.removeProperty) { - element.style.removeProperty(name); - } else { - element.style.removeAttribute(utils.cssStyleToDomStyle(name)); - } - } - - if (!element.style.cssText) { - domUtils.removeAttributes(element, ["style"]); - } - }, - /** - * 获取元素element的style属性的指定值 - * @method getStyle - * @param { Element } element 需要获取属性值的元素 - * @param { String } styleName 需要获取的style的名称 - * @warning 该方法仅获取元素style属性中所标明的值 - * @return { String } 该元素包含指定的style属性值 - * @example - * ```html - *
                      - * - * - * ``` - */ - getStyle: function(element, name) { - var value = element.style[utils.cssStyleToDomStyle(name)]; - return utils.fixColor(name, value); - }, - /** - * 为元素element设置样式属性值 - * @method setStyle - * @param { Element } element 需要设置样式的元素 - * @param { String } styleName 样式名 - * @param { String } styleValue 样式值 - * @example - * ```html - *
                      - * - * - * ``` - */ - setStyle: function(element, name, value) { - element.style[utils.cssStyleToDomStyle(name)] = value; - if (!utils.trim(element.style.cssText)) { - this.removeAttributes(element, "style"); - } - }, - /** - * 为元素element设置多个样式属性值 - * @method setStyles - * @param { Element } element 需要设置样式的元素 - * @param { Object } styles 样式名值对 - * @example - * ```html - *
                      - * - * - * ``` - */ - setStyles: function(element, styles) { - for (var name in styles) { - if (styles.hasOwnProperty(name)) { - domUtils.setStyle(element, name, styles[name]); - } - } - }, - /** - * 删除_moz_dirty属性 - * @private - * @method removeDirtyAttr - */ - removeDirtyAttr: function(node) { - for ( - var i = 0, ci, nodes = node.getElementsByTagName("*"); - (ci = nodes[i++]); - - ) { - ci.removeAttribute("_moz_dirty"); - } - node.removeAttribute("_moz_dirty"); - }, - /** - * 获取子节点的数量 - * @method getChildCount - * @param { Element } node 需要检测的元素 - * @return { Number } 给定的node元素的子节点数量 - * @example - * ```html - *
                      - * - *
                      - * - * - * ``` - */ - - /** - * 根据给定的过滤规则, 获取符合条件的子节点的数量 - * @method getChildCount - * @param { Element } node 需要检测的元素 - * @param { Function } fn 过滤器, 要求对符合条件的子节点返回true, 反之则要求返回false - * @return { Number } 符合过滤条件的node元素的子节点数量 - * @example - * ```html - *
                      - * - *
                      - * - * - * ``` - */ - getChildCount: function(node, fn) { - var count = 0, - first = node.firstChild; - fn = - fn || - function() { - return 1; - }; - while (first) { - if (fn(first)) { - count++; - } - first = first.nextSibling; - } - return count; - }, - - /** - * 判断给定节点是否为空节点 - * @method isEmptyNode - * @param { Node } node 需要检测的节点对象 - * @return { Boolean } 节点是否为空 - * @example - * ```javascript - * UE.dom.domUtils.isEmptyNode( document.body ); - * ``` - */ - isEmptyNode: function(node) { - return ( - !node.firstChild || - domUtils.getChildCount(node, function(node) { - return ( - !domUtils.isBr(node) && - !domUtils.isBookmarkNode(node) && - !domUtils.isWhitespace(node) - ); - }) == 0 - ); - }, - clearSelectedArr: function(nodes) { - var node; - while ((node = nodes.pop())) { - domUtils.removeAttributes(node, ["class"]); - } - }, - /** - * 将显示区域滚动到指定节点的位置 - * @method scrollToView - * @param {Node} node 节点 - * @param {window} win window对象 - * @param {Number} offsetTop 距离上方的偏移量 - */ - scrollToView: function(node, win, offsetTop) { - var getViewPaneSize = function() { - var doc = win.document, - mode = doc.compatMode == "CSS1Compat"; - return { - width: - (mode ? doc.documentElement.clientWidth : doc.body.clientWidth) || 0, - height: - (mode ? doc.documentElement.clientHeight : doc.body.clientHeight) || 0 - }; - }, - getScrollPosition = function(win) { - if ("pageXOffset" in win) { - return { - x: win.pageXOffset || 0, - y: win.pageYOffset || 0 - }; - } else { - var doc = win.document; - return { - x: doc.documentElement.scrollLeft || doc.body.scrollLeft || 0, - y: doc.documentElement.scrollTop || doc.body.scrollTop || 0 - }; - } - }; - var winHeight = getViewPaneSize().height, - offset = winHeight * -1 + offsetTop; - offset += node.offsetHeight || 0; - var elementPosition = domUtils.getXY(node); - offset += elementPosition.y; - var currentScroll = getScrollPosition(win).y; - // offset += 50; - if (offset > currentScroll || offset < currentScroll - winHeight) { - win.scrollTo(0, offset + (offset < 0 ? -20 : 20)); - } - }, - /** - * 判断给定节点是否为br - * @method isBr - * @param { Node } node 需要判断的节点对象 - * @return { Boolean } 给定的节点是否是br节点 - */ - isBr: function(node) { - return node.nodeType == 1 && node.tagName == "BR"; - }, - /** - * 判断给定的节点是否是一个“填充”节点 - * @private - * @method isFillChar - * @param { Node } node 需要判断的节点 - * @param { Boolean } isInStart 是否从节点内容的开始位置匹配 - * @returns { Boolean } 节点是否是填充节点 - */ - isFillChar: function(node, isInStart) { - if (node.nodeType != 3) return false; - var text = node.nodeValue; - if (isInStart) { - return new RegExp("^" + domUtils.fillChar).test(text); - } - return !text.replace(new RegExp(domUtils.fillChar, "g"), "").length; - }, - isStartInblock: function(range) { - var tmpRange = range.cloneRange(), - flag = 0, - start = tmpRange.startContainer, - tmp; - if (start.nodeType == 1 && start.childNodes[tmpRange.startOffset]) { - start = start.childNodes[tmpRange.startOffset]; - var pre = start.previousSibling; - while (pre && domUtils.isFillChar(pre)) { - start = pre; - pre = pre.previousSibling; - } - } - if (this.isFillChar(start, true) && tmpRange.startOffset == 1) { - tmpRange.setStartBefore(start); - start = tmpRange.startContainer; - } - - while (start && domUtils.isFillChar(start)) { - tmp = start; - start = start.previousSibling; - } - if (tmp) { - tmpRange.setStartBefore(tmp); - start = tmpRange.startContainer; - } - if ( - start.nodeType == 1 && - domUtils.isEmptyNode(start) && - tmpRange.startOffset == 1 - ) { - tmpRange.setStart(start, 0).collapse(true); - } - while (!tmpRange.startOffset) { - start = tmpRange.startContainer; - if (domUtils.isBlockElm(start) || domUtils.isBody(start)) { - flag = 1; - break; - } - var pre = tmpRange.startContainer.previousSibling, - tmpNode; - if (!pre) { - tmpRange.setStartBefore(tmpRange.startContainer); - } else { - while (pre && domUtils.isFillChar(pre)) { - tmpNode = pre; - pre = pre.previousSibling; - } - if (tmpNode) { - tmpRange.setStartBefore(tmpNode); - } else { - tmpRange.setStartBefore(tmpRange.startContainer); - } - } - } - return flag && !domUtils.isBody(tmpRange.startContainer) ? 1 : 0; - }, - - /** - * 判断给定的元素是否是一个空元素 - * @method isEmptyBlock - * @param { Element } node 需要判断的元素 - * @return { Boolean } 是否是空元素 - * @example - * ```html - *
                      - * - * - * ``` - */ - - /** - * 根据指定的判断规则判断给定的元素是否是一个空元素 - * @method isEmptyBlock - * @param { Element } node 需要判断的元素 - * @param { RegExp } reg 对内容执行判断的正则表达式对象 - * @return { Boolean } 是否是空元素 - */ - isEmptyBlock: function(node, reg) { - if (node.nodeType != 1) return 0; - reg = reg || new RegExp("[ \xa0\t\r\n" + domUtils.fillChar + "]", "g"); - - if ( - node[browser.ie ? "innerText" : "textContent"].replace(reg, "").length > 0 - ) { - return 0; - } - for (var n in dtd.$isNotEmpty) { - if (node.getElementsByTagName(n).length) { - return 0; - } - } - return 1; - }, - - /** - * 移动元素使得该元素的位置移动指定的偏移量的距离 - * @method setViewportOffset - * @param { Element } element 需要设置偏移量的元素 - * @param { Object } offset 偏移量, 形如{ left: 100, top: 50 }的一个键值对, 表示该元素将在 - * 现有的位置上向水平方向偏移offset.left的距离, 在竖直方向上偏移 - * offset.top的距离 - * @example - * ```html - *
                      - * - * - * ``` - */ - setViewportOffset: function(element, offset) { - var left = parseInt(element.style.left) | 0; - var top = parseInt(element.style.top) | 0; - var rect = element.getBoundingClientRect(); - var offsetLeft = offset.left - rect.left; - var offsetTop = offset.top - rect.top; - if (offsetLeft) { - element.style.left = left + offsetLeft + "px"; - } - if (offsetTop) { - element.style.top = top + offsetTop + "px"; - } - }, - - /** - * 用“填充字符”填充节点 - * @method fillNode - * @private - * @param { DomDocument } doc 填充的节点所在的docment对象 - * @param { Node } node 需要填充的节点对象 - * @example - * ```html - *
                      - * - * - * ``` - */ - fillNode: function(doc, node) { - var tmpNode = browser.ie - ? doc.createTextNode(domUtils.fillChar) - : doc.createElement("br"); - node.innerHTML = ""; - node.appendChild(tmpNode); - }, - - /** - * 把节点src的所有子节点追加到另一个节点tag上去 - * @method moveChild - * @param { Node } src 源节点, 该节点下的所有子节点将被移除 - * @param { Node } tag 目标节点, 从源节点移除的子节点将被追加到该节点下 - * @example - * ```html - *
                      - * - *
                      - *
                      - *
                      - *
                      - * - * - * ``` - */ - - /** - * 把节点src的所有子节点移动到另一个节点tag上去, 可以通过dir参数控制附加的行为是“追加”还是“插入顶部” - * @method moveChild - * @param { Node } src 源节点, 该节点下的所有子节点将被移除 - * @param { Node } tag 目标节点, 从源节点移除的子节点将被附加到该节点下 - * @param { Boolean } dir 附加方式, 如果为true, 则附加进去的节点将被放到目标节点的顶部, 反之,则放到末尾 - * @example - * ```html - *
                      - * - *
                      - *
                      - *
                      - *
                      - * - * - * ``` - */ - moveChild: function(src, tag, dir) { - while (src.firstChild) { - if (dir && tag.firstChild) { - tag.insertBefore(src.lastChild, tag.firstChild); - } else { - tag.appendChild(src.firstChild); - } - } - }, - - /** - * 判断节点的标签上是否不存在任何属性 - * @method hasNoAttributes - * @private - * @param { Node } node 需要检测的节点对象 - * @return { Boolean } 节点是否不包含任何属性 - * @example - * ```html - *
                      xxxx
                      - * - * - * ``` - */ - hasNoAttributes: function(node) { - return browser.ie - ? /^<\w+\s*?>/.test(node.outerHTML) - : node.attributes.length == 0; - }, - - /** - * 检测节点是否是UEditor所使用的辅助节点 - * @method isCustomeNode - * @private - * @param { Node } node 需要检测的节点 - * @remind 辅助节点是指编辑器要完成工作临时添加的节点, 在输出的时候将会从编辑器内移除, 不会影响最终的结果。 - * @return { Boolean } 给定的节点是否是一个辅助节点 - */ - isCustomeNode: function(node) { - return node.nodeType == 1 && node.getAttribute("_ue_custom_node_"); - }, - - /** - * 检测节点的标签是否是给定的标签 - * @method isTagNode - * @param { Node } node 需要检测的节点对象 - * @param { String } tagName 标签 - * @return { Boolean } 节点的标签是否是给定的标签 - * @example - * ```html - *
                      - * - * - * ``` - */ - isTagNode: function(node, tagNames) { - return ( - node.nodeType == 1 && - new RegExp("\\b" + node.tagName + "\\b", "i").test(tagNames) - ); - }, - - /** - * 给定一个节点数组,在通过指定的过滤器过滤后, 获取其中满足过滤条件的第一个节点 - * @method filterNodeList - * @param { Array } nodeList 需要过滤的节点数组 - * @param { Function } fn 过滤器, 对符合条件的节点, 执行结果返回true, 反之则返回false - * @return { Node | NULL } 如果找到符合过滤条件的节点, 则返回该节点, 否则返回NULL - * @example - * ```javascript - * var divNodes = document.getElementsByTagName("div"); - * divNodes = [].slice.call( divNodes, 0 ); - * - * //output: null - * console.log( UE.dom.domUtils.filterNodeList( divNodes, function ( node ) { - * return node.tagName.toLowerCase() !== 'div'; - * } ) ); - * ``` - */ - - /** - * 给定一个节点数组nodeList和一组标签名tagNames, 获取其中能够匹配标签名的节点集合中的第一个节点 - * @method filterNodeList - * @param { Array } nodeList 需要过滤的节点数组 - * @param { String } tagNames 需要匹配的标签名, 多个标签名之间用空格分割 - * @return { Node | NULL } 如果找到标签名匹配的节点, 则返回该节点, 否则返回NULL - * @example - * ```javascript - * var divNodes = document.getElementsByTagName("div"); - * divNodes = [].slice.call( divNodes, 0 ); - * - * //output: null - * console.log( UE.dom.domUtils.filterNodeList( divNodes, 'a span' ) ); - * ``` - */ - - /** - * 给定一个节点数组,在通过指定的过滤器过滤后, 如果参数forAll为true, 则会返回所有满足过滤 - * 条件的节点集合, 否则, 返回满足条件的节点集合中的第一个节点 - * @method filterNodeList - * @param { Array } nodeList 需要过滤的节点数组 - * @param { Function } fn 过滤器, 对符合条件的节点, 执行结果返回true, 反之则返回false - * @param { Boolean } forAll 是否返回整个节点数组, 如果该参数为false, 则返回节点集合中的第一个节点 - * @return { Array | Node | NULL } 如果找到符合过滤条件的节点, 则根据参数forAll的值决定返回满足 - * 过滤条件的节点数组或第一个节点, 否则返回NULL - * @example - * ```javascript - * var divNodes = document.getElementsByTagName("div"); - * divNodes = [].slice.call( divNodes, 0 ); - * - * //output: 3(假定有3个div) - * console.log( divNodes.length ); - * - * var nodes = UE.dom.domUtils.filterNodeList( divNodes, function ( node ) { - * return node.tagName.toLowerCase() === 'div'; - * }, true ); - * - * //output: 3 - * console.log( nodes.length ); - * - * var node = UE.dom.domUtils.filterNodeList( divNodes, function ( node ) { - * return node.tagName.toLowerCase() === 'div'; - * }, false ); - * - * //output: div - * console.log( node.nodeName ); - * ``` - */ - filterNodeList: function(nodelist, filter, forAll) { - var results = []; - if (!utils.isFunction(filter)) { - var str = filter; - filter = function(n) { - return ( - utils.indexOf( - utils.isArray(str) ? str : str.split(" "), - n.tagName.toLowerCase() - ) != -1 - ); - }; - } - utils.each(nodelist, function(n) { - filter(n) && results.push(n); - }); - return results.length == 0 - ? null - : results.length == 1 || !forAll ? results[0] : results; - }, - - /** - * 查询给定的range选区是否在给定的node节点内,且在该节点的最末尾 - * @method isInNodeEndBoundary - * @param { UE.dom.Range } rng 需要判断的range对象, 该对象的startContainer不能为NULL - * @param node 需要检测的节点对象 - * @return { Number } 如果给定的选取range对象是在node内部的最末端, 则返回1, 否则返回0 - */ - isInNodeEndBoundary: function(rng, node) { - var start = rng.startContainer; - if (start.nodeType == 3 && rng.startOffset != start.nodeValue.length) { - return 0; - } - if (start.nodeType == 1 && rng.startOffset != start.childNodes.length) { - return 0; - } - while (start !== node) { - if (start.nextSibling) { - return 0; - } - start = start.parentNode; - } - return 1; - }, - isBoundaryNode: function(node, dir) { - var tmp; - while (!domUtils.isBody(node)) { - tmp = node; - node = node.parentNode; - if (tmp !== node[dir]) { - return false; - } - } - return true; - }, - fillHtml: browser.ie11below ? " " : "
                      " -}); -var fillCharReg = new RegExp(domUtils.fillChar, "g"); - - -// core/Range.js -/** - * Range封装 - * @file - * @module UE.dom - * @class Range - * @since 1.2.6.1 - */ - -/** - * dom操作封装 - * @unfile - * @module UE.dom - */ - -/** - * Range实现类,本类是UEditor底层核心类,封装不同浏览器之间的Range操作。 - * @unfile - * @module UE.dom - * @class Range - */ - -;(function() { - var guid = 0, - fillChar = domUtils.fillChar, - fillData; - - /** - * 更新range的collapse状态 - * @param {Range} range range对象 - */ - function updateCollapse(range) { - range.collapsed = - range.startContainer && - range.endContainer && - range.startContainer === range.endContainer && - range.startOffset == range.endOffset; - } - - function selectOneNode(rng) { - return ( - !rng.collapsed && - rng.startContainer.nodeType == 1 && - rng.startContainer === rng.endContainer && - rng.endOffset - rng.startOffset == 1 - ); - } - function setEndPoint(toStart, node, offset, range) { - //如果node是自闭合标签要处理 - if ( - node.nodeType == 1 && - (dtd.$empty[node.tagName] || dtd.$nonChild[node.tagName]) - ) { - offset = domUtils.getNodeIndex(node) + (toStart ? 0 : 1); - node = node.parentNode; - } - if (toStart) { - range.startContainer = node; - range.startOffset = offset; - if (!range.endContainer) { - range.collapse(true); - } - } else { - range.endContainer = node; - range.endOffset = offset; - if (!range.startContainer) { - range.collapse(false); - } - } - updateCollapse(range); - return range; - } - - function execContentsAction(range, action) { - //调整边界 - //range.includeBookmark(); - var start = range.startContainer, - end = range.endContainer, - startOffset = range.startOffset, - endOffset = range.endOffset, - doc = range.document, - frag = doc.createDocumentFragment(), - tmpStart, - tmpEnd; - if (start.nodeType == 1) { - start = - start.childNodes[startOffset] || - (tmpStart = start.appendChild(doc.createTextNode(""))); - } - if (end.nodeType == 1) { - end = - end.childNodes[endOffset] || - (tmpEnd = end.appendChild(doc.createTextNode(""))); - } - if (start === end && start.nodeType == 3) { - frag.appendChild( - doc.createTextNode( - start.substringData(startOffset, endOffset - startOffset) - ) - ); - //is not clone - if (action) { - start.deleteData(startOffset, endOffset - startOffset); - range.collapse(true); - } - return frag; - } - var current, - currentLevel, - clone = frag, - startParents = domUtils.findParents(start, true), - endParents = domUtils.findParents(end, true); - for (var i = 0; startParents[i] == endParents[i]; ) { - i++; - } - for (var j = i, si; (si = startParents[j]); j++) { - current = si.nextSibling; - if (si == start) { - if (!tmpStart) { - if (range.startContainer.nodeType == 3) { - clone.appendChild( - doc.createTextNode(start.nodeValue.slice(startOffset)) - ); - //is not clone - if (action) { - start.deleteData( - startOffset, - start.nodeValue.length - startOffset - ); - } - } else { - clone.appendChild(!action ? start.cloneNode(true) : start); - } - } - } else { - currentLevel = si.cloneNode(false); - clone.appendChild(currentLevel); - } - while (current) { - if (current === end || current === endParents[j]) { - break; - } - si = current.nextSibling; - clone.appendChild(!action ? current.cloneNode(true) : current); - current = si; - } - clone = currentLevel; - } - clone = frag; - if (!startParents[i]) { - clone.appendChild(startParents[i - 1].cloneNode(false)); - clone = clone.firstChild; - } - for (var j = i, ei; (ei = endParents[j]); j++) { - current = ei.previousSibling; - if (ei == end) { - if (!tmpEnd && range.endContainer.nodeType == 3) { - clone.appendChild( - doc.createTextNode(end.substringData(0, endOffset)) - ); - //is not clone - if (action) { - end.deleteData(0, endOffset); - } - } - } else { - currentLevel = ei.cloneNode(false); - clone.appendChild(currentLevel); - } - //如果两端同级,右边第一次已经被开始做了 - if (j != i || !startParents[i]) { - while (current) { - if (current === start) { - break; - } - ei = current.previousSibling; - clone.insertBefore( - !action ? current.cloneNode(true) : current, - clone.firstChild - ); - current = ei; - } - } - clone = currentLevel; - } - if (action) { - range - .setStartBefore( - !endParents[i] - ? endParents[i - 1] - : !startParents[i] ? startParents[i - 1] : endParents[i] - ) - .collapse(true); - } - tmpStart && domUtils.remove(tmpStart); - tmpEnd && domUtils.remove(tmpEnd); - return frag; - } - - /** - * 创建一个跟document绑定的空的Range实例 - * @constructor - * @param { Document } document 新建的选区所属的文档对象 - */ - - /** - * @property { Node } startContainer 当前Range的开始边界的容器节点, 可以是一个元素节点或者是文本节点 - */ - - /** - * @property { Node } startOffset 当前Range的开始边界容器节点的偏移量, 如果是元素节点, - * 该值就是childNodes中的第几个节点, 如果是文本节点就是文本内容的第几个字符 - */ - - /** - * @property { Node } endContainer 当前Range的结束边界的容器节点, 可以是一个元素节点或者是文本节点 - */ - - /** - * @property { Node } endOffset 当前Range的结束边界容器节点的偏移量, 如果是元素节点, - * 该值就是childNodes中的第几个节点, 如果是文本节点就是文本内容的第几个字符 - */ - - /** - * @property { Boolean } collapsed 当前Range是否闭合 - * @default true - * @remind Range是闭合的时候, startContainer === endContainer && startOffset === endOffset - */ - - /** - * @property { Document } document 当前Range所属的Document对象 - * @remind 不同range的的document属性可以是不同的 - */ - var Range = (dom.Range = function(document) { - var me = this; - me.startContainer = me.startOffset = me.endContainer = me.endOffset = null; - me.document = document; - me.collapsed = true; - }); - - /** - * 删除fillData - * @param doc - * @param excludeNode - */ - function removeFillData(doc, excludeNode) { - try { - if (fillData && domUtils.inDoc(fillData, doc)) { - if (!fillData.nodeValue.replace(fillCharReg, "").length) { - var tmpNode = fillData.parentNode; - domUtils.remove(fillData); - while ( - tmpNode && - domUtils.isEmptyInlineElement(tmpNode) && - //safari的contains有bug - (browser.safari - ? !( - domUtils.getPosition(tmpNode, excludeNode) & - domUtils.POSITION_CONTAINS - ) - : !tmpNode.contains(excludeNode)) - ) { - fillData = tmpNode.parentNode; - domUtils.remove(tmpNode); - tmpNode = fillData; - } - } else { - fillData.nodeValue = fillData.nodeValue.replace(fillCharReg, ""); - } - } - } catch (e) {} - } - - /** - * @param node - * @param dir - */ - function mergeSibling(node, dir) { - var tmpNode; - node = node[dir]; - while (node && domUtils.isFillChar(node)) { - tmpNode = node[dir]; - domUtils.remove(node); - node = tmpNode; - } - } - - Range.prototype = { - /** - * 克隆选区的内容到一个DocumentFragment里 - * @method cloneContents - * @return { DocumentFragment | NULL } 如果选区是闭合的将返回null, 否则, 返回包含所clone内容的DocumentFragment元素 - * @example - * ```html - * - * - * xx[xxx]x - * - * - * - * ``` - */ - cloneContents: function() { - return this.collapsed ? null : execContentsAction(this, 0); - }, - - /** - * 删除当前选区范围中的所有内容 - * @method deleteContents - * @remind 执行完该操作后, 当前Range对象变成了闭合状态 - * @return { UE.dom.Range } 当前操作的Range对象 - * @example - * ```html - * - * - * xx[xxx]x - * - * - * - * ``` - */ - deleteContents: function() { - var txt; - if (!this.collapsed) { - execContentsAction(this, 1); - } - if (browser.webkit) { - txt = this.startContainer; - if (txt.nodeType == 3 && !txt.nodeValue.length) { - this.setStartBefore(txt).collapse(true); - domUtils.remove(txt); - } - } - return this; - }, - - /** - * 将当前选区的内容提取到一个DocumentFragment里 - * @method extractContents - * @remind 执行该操作后, 选区将变成闭合状态 - * @warning 执行该操作后, 原来选区所选中的内容将从dom树上剥离出来 - * @return { DocumentFragment } 返回包含所提取内容的DocumentFragment对象 - * @example - * ```html - * - * - * xx[xxx]x - * - * - * - */ - extractContents: function() { - return this.collapsed ? null : execContentsAction(this, 2); - }, - - /** - * 设置Range的开始容器节点和偏移量 - * @method setStart - * @remind 如果给定的节点是元素节点,那么offset指的是其子元素中索引为offset的元素, - * 如果是文本节点,那么offset指的是其文本内容的第offset个字符 - * @remind 如果提供的容器节点是一个不能包含子元素的节点, 则该选区的开始容器将被设置 - * 为该节点的父节点, 此时, 其距离开始容器的偏移量也变成了该节点在其父节点 - * 中的索引 - * @param { Node } node 将被设为当前选区开始边界容器的节点对象 - * @param { int } offset 选区的开始位置偏移量 - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * xxxxxxxxxxxxx[xxx] - * - * - * ``` - * @example - * ```html - * - * xxx[xx]x - * - * - * ``` - */ - setStart: function(node, offset) { - return setEndPoint(true, node, offset, this); - }, - - /** - * 设置Range的结束容器和偏移量 - * @method setEnd - * @param { Node } node 作为当前选区结束边界容器的节点对象 - * @param { int } offset 结束边界的偏移量 - * @see UE.dom.Range:setStart(Node,int) - * @return { UE.dom.Range } 当前range对象 - */ - setEnd: function(node, offset) { - return setEndPoint(false, node, offset, this); - }, - - /** - * 将Range开始位置设置到node节点之后 - * @method setStartAfter - * @remind 该操作将会把给定节点的父节点作为range的开始容器, 且偏移量是该节点在其父节点中的位置索引+1 - * @param { Node } node 选区的开始边界将紧接着该节点之后 - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * xxxxxxx[xxxx] - * - * - * ``` - */ - setStartAfter: function(node) { - return this.setStart(node.parentNode, domUtils.getNodeIndex(node) + 1); - }, - - /** - * 将Range开始位置设置到node节点之前 - * @method setStartBefore - * @remind 该操作将会把给定节点的父节点作为range的开始容器, 且偏移量是该节点在其父节点中的位置索引 - * @param { Node } node 新的选区开始位置在该节点之前 - * @see UE.dom.Range:setStartAfter(Node) - * @return { UE.dom.Range } 当前range对象 - */ - setStartBefore: function(node) { - return this.setStart(node.parentNode, domUtils.getNodeIndex(node)); - }, - - /** - * 将Range结束位置设置到node节点之后 - * @method setEndAfter - * @remind 该操作将会把给定节点的父节点作为range的结束容器, 且偏移量是该节点在其父节点中的位置索引+1 - * @param { Node } node 目标节点 - * @see UE.dom.Range:setStartAfter(Node) - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * [xxxxxxx]xxxx - * - * - * ``` - */ - setEndAfter: function(node) { - return this.setEnd(node.parentNode, domUtils.getNodeIndex(node) + 1); - }, - - /** - * 将Range结束位置设置到node节点之前 - * @method setEndBefore - * @remind 该操作将会把给定节点的父节点作为range的结束容器, 且偏移量是该节点在其父节点中的位置索引 - * @param { Node } node 目标节点 - * @see UE.dom.Range:setEndAfter(Node) - * @return { UE.dom.Range } 当前range对象 - */ - setEndBefore: function(node) { - return this.setEnd(node.parentNode, domUtils.getNodeIndex(node)); - }, - - /** - * 设置Range的开始位置到node节点内的第一个子节点之前 - * @method setStartAtFirst - * @remind 选区的开始容器将变成给定的节点, 且偏移量为0 - * @remind 如果给定的节点是元素节点, 则该节点必须是允许包含子节点的元素。 - * @param { Node } node 目标节点 - * @see UE.dom.Range:setStartBefore(Node) - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * xxxxx[xx]xxxx - * - * - * ``` - */ - setStartAtFirst: function(node) { - return this.setStart(node, 0); - }, - - /** - * 设置Range的开始位置到node节点内的最后一个节点之后 - * @method setStartAtLast - * @remind 选区的开始容器将变成给定的节点, 且偏移量为该节点的子节点数 - * @remind 如果给定的节点是元素节点, 则该节点必须是允许包含子节点的元素。 - * @param { Node } node 目标节点 - * @see UE.dom.Range:setStartAtFirst(Node) - * @return { UE.dom.Range } 当前range对象 - */ - setStartAtLast: function(node) { - return this.setStart( - node, - node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length - ); - }, - - /** - * 设置Range的结束位置到node节点内的第一个节点之前 - * @method setEndAtFirst - * @param { Node } node 目标节点 - * @remind 选区的结束容器将变成给定的节点, 且偏移量为0 - * @remind node必须是一个元素节点, 且必须是允许包含子节点的元素。 - * @see UE.dom.Range:setStartAtFirst(Node) - * @return { UE.dom.Range } 当前range对象 - */ - setEndAtFirst: function(node) { - return this.setEnd(node, 0); - }, - - /** - * 设置Range的结束位置到node节点内的最后一个节点之后 - * @method setEndAtLast - * @param { Node } node 目标节点 - * @remind 选区的结束容器将变成给定的节点, 且偏移量为该节点的子节点数量 - * @remind node必须是一个元素节点, 且必须是允许包含子节点的元素。 - * @see UE.dom.Range:setStartAtFirst(Node) - * @return { UE.dom.Range } 当前range对象 - */ - setEndAtLast: function(node) { - return this.setEnd( - node, - node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length - ); - }, - - /** - * 选中给定节点 - * @method selectNode - * @remind 此时, 选区的开始容器和结束容器都是该节点的父节点, 其startOffset是该节点在父节点中的位置索引, - * 而endOffset为startOffset+1 - * @param { Node } node 需要选中的节点 - * @return { UE.dom.Range } 当前range对象,此时的range仅包含当前给定的节点对象 - * @example - * ```html - * - * xxxxx[xx]xxxx - * - * - * ``` - */ - selectNode: function(node) { - return this.setStartBefore(node).setEndAfter(node); - }, - - /** - * 选中给定节点内部的所有节点 - * @method selectNodeContents - * @remind 此时, 选区的开始容器和结束容器都是该节点, 其startOffset为0, - * 而endOffset是该节点的子节点数。 - * @param { Node } node 目标节点, 当前range将包含该节点内的所有节点 - * @return { UE.dom.Range } 当前range对象, 此时range仅包含给定节点的所有子节点 - * @example - * ```html - * - * xxxxx[xx]xxxx - * - * - * ``` - */ - selectNodeContents: function(node) { - return this.setStart(node, 0).setEndAtLast(node); - }, - - /** - * clone当前Range对象 - * @method cloneRange - * @remind 返回的range是一个全新的range对象, 其内部所有属性与当前被clone的range相同。 - * @return { UE.dom.Range } 当前range对象的一个副本 - */ - cloneRange: function() { - var me = this; - return new Range(me.document) - .setStart(me.startContainer, me.startOffset) - .setEnd(me.endContainer, me.endOffset); - }, - - /** - * 向当前选区的结束处闭合选区 - * @method collapse - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * xxxxx[xx]xxxx - * - * - * ``` - */ - - /** - * 闭合当前选区,根据给定的toStart参数项决定是向当前选区开始处闭合还是向结束处闭合, - * 如果toStart的值为true,则向开始位置闭合, 反之,向结束位置闭合。 - * @method collapse - * @param { Boolean } toStart 是否向选区开始处闭合 - * @return { UE.dom.Range } 当前range对象,此时range对象处于闭合状态 - * @see UE.dom.Range:collapse() - * @example - * ```html - * - * xxxxx[xx]xxxx - * - * - * ``` - */ - collapse: function(toStart) { - var me = this; - if (toStart) { - me.endContainer = me.startContainer; - me.endOffset = me.startOffset; - } else { - me.startContainer = me.endContainer; - me.startOffset = me.endOffset; - } - me.collapsed = true; - return me; - }, - - /** - * 调整range的开始位置和结束位置,使其"收缩"到最小的位置 - * @method shrinkBoundary - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * xxxx[xxxxx] => xxxx[xxxxx] - * ``` - * - * @example - * ```html - * - * x[xx]xxx - * - * - * ``` - * - * @example - * ```html - * [xxxxxxxxxxx] => [xxxxxxxxxxx] - * ``` - */ - - /** - * 调整range的开始位置和结束位置,使其"收缩"到最小的位置, - * 如果ignoreEnd的值为true,则忽略对结束位置的调整 - * @method shrinkBoundary - * @param { Boolean } ignoreEnd 是否忽略对结束位置的调整 - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.domUtils.Range:shrinkBoundary() - */ - shrinkBoundary: function(ignoreEnd) { - var me = this, - child, - collapsed = me.collapsed; - function check(node) { - return ( - node.nodeType == 1 && - !domUtils.isBookmarkNode(node) && - !dtd.$empty[node.tagName] && - !dtd.$nonChild[node.tagName] - ); - } - while ( - me.startContainer.nodeType == 1 && //是element - (child = me.startContainer.childNodes[me.startOffset]) && //子节点也是element - check(child) - ) { - me.setStart(child, 0); - } - if (collapsed) { - return me.collapse(true); - } - if (!ignoreEnd) { - while ( - me.endContainer.nodeType == 1 && //是element - me.endOffset > 0 && //如果是空元素就退出 endOffset=0那么endOffst-1为负值,childNodes[endOffset]报错 - (child = me.endContainer.childNodes[me.endOffset - 1]) && //子节点也是element - check(child) - ) { - me.setEnd(child, child.childNodes.length); - } - } - return me; - }, - - /** - * 获取离当前选区内包含的所有节点最近的公共祖先节点, - * @method getCommonAncestor - * @remind 返回的公共祖先节点一定不是range自身的容器节点, 但有可能是一个文本节点 - * @return { Node } 当前range对象内所有节点的公共祖先节点 - * @example - * ```html - * //选区示例 - * xxxx[xxx]xxxxxx - * - * ``` - */ - - /** - * 获取当前选区所包含的所有节点的公共祖先节点, 可以根据给定的参数 includeSelf 决定获取到 - * 的公共祖先节点是否可以是当前选区的startContainer或endContainer节点, 如果 includeSelf - * 的取值为true, 则返回的节点可以是自身的容器节点, 否则, 则不能是容器节点 - * @method getCommonAncestor - * @param { Boolean } includeSelf 是否允许获取到的公共祖先节点是当前range对象的容器节点 - * @return { Node } 当前range对象内所有节点的公共祖先节点 - * @see UE.dom.Range:getCommonAncestor() - * @example - * ```html - * - * - * - * xxxxxxxxx[xxx]xxxxxxxx - * - * - * - * - * ``` - */ - - /** - * 获取当前选区所包含的所有节点的公共祖先节点, 可以根据给定的参数 includeSelf 决定获取到 - * 的公共祖先节点是否可以是当前选区的startContainer或endContainer节点, 如果 includeSelf - * 的取值为true, 则返回的节点可以是自身的容器节点, 否则, 则不能是容器节点; 同时可以根据 - * ignoreTextNode 参数的取值决定是否忽略类型为文本节点的祖先节点。 - * @method getCommonAncestor - * @param { Boolean } includeSelf 是否允许获取到的公共祖先节点是当前range对象的容器节点 - * @param { Boolean } ignoreTextNode 获取祖先节点的过程中是否忽略类型为文本节点的祖先节点 - * @return { Node } 当前range对象内所有节点的公共祖先节点 - * @see UE.dom.Range:getCommonAncestor() - * @see UE.dom.Range:getCommonAncestor(Boolean) - * @example - * ```html - * - * - * - * xxxxxxxx[x]xxxxxxxxxxx - * - * - * - * - * ``` - */ - getCommonAncestor: function(includeSelf, ignoreTextNode) { - var me = this, - start = me.startContainer, - end = me.endContainer; - if (start === end) { - if (includeSelf && selectOneNode(this)) { - start = start.childNodes[me.startOffset]; - if (start.nodeType == 1) return start; - } - //只有在上来就相等的情况下才会出现是文本的情况 - return ignoreTextNode && start.nodeType == 3 ? start.parentNode : start; - } - return domUtils.getCommonAncestor(start, end); - }, - - /** - * 调整当前Range的开始和结束边界容器,如果是容器节点是文本节点,就调整到包含该文本节点的父节点上 - * @method trimBoundary - * @remind 该操作有可能会引起文本节点被切开 - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * //选区示例 - * xxx[xxxxx]xxx - * - * - * ``` - */ - - /** - * 调整当前Range的开始和结束边界容器,如果是容器节点是文本节点,就调整到包含该文本节点的父节点上, - * 可以根据 ignoreEnd 参数的值决定是否调整对结束边界的调整 - * @method trimBoundary - * @param { Boolean } ignoreEnd 是否忽略对结束边界的调整 - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * //选区示例 - * xxx[xxxxx]xxx - * - * - * ``` - */ - trimBoundary: function(ignoreEnd) { - this.txtToElmBoundary(); - var start = this.startContainer, - offset = this.startOffset, - collapsed = this.collapsed, - end = this.endContainer; - if (start.nodeType == 3) { - if (offset == 0) { - this.setStartBefore(start); - } else { - if (offset >= start.nodeValue.length) { - this.setStartAfter(start); - } else { - var textNode = domUtils.split(start, offset); - //跟新结束边界 - if (start === end) { - this.setEnd(textNode, this.endOffset - offset); - } else if (start.parentNode === end) { - this.endOffset += 1; - } - this.setStartBefore(textNode); - } - } - if (collapsed) { - return this.collapse(true); - } - } - if (!ignoreEnd) { - offset = this.endOffset; - end = this.endContainer; - if (end.nodeType == 3) { - if (offset == 0) { - this.setEndBefore(end); - } else { - offset < end.nodeValue.length && domUtils.split(end, offset); - this.setEndAfter(end); - } - } - } - return this; - }, - - /** - * 如果选区在文本的边界上,就扩展选区到文本的父节点上, 如果当前选区是闭合的, 则什么也不做 - * @method txtToElmBoundary - * @remind 该操作不会修改dom节点 - * @return { UE.dom.Range } 当前range对象 - */ - - /** - * 如果选区在文本的边界上,就扩展选区到文本的父节点上, 如果当前选区是闭合的, 则根据参数项 - * ignoreCollapsed 的值决定是否执行该调整 - * @method txtToElmBoundary - * @param { Boolean } ignoreCollapsed 是否忽略选区的闭合状态, 如果该参数取值为true, 则 - * 不论选区是否闭合, 都会执行该操作, 反之, 则不会对闭合的选区执行该操作 - * @return { UE.dom.Range } 当前range对象 - */ - txtToElmBoundary: function(ignoreCollapsed) { - function adjust(r, c) { - var container = r[c + "Container"], - offset = r[c + "Offset"]; - if (container.nodeType == 3) { - if (!offset) { - r[ - "set" + - c.replace(/(\w)/, function(a) { - return a.toUpperCase(); - }) + - "Before" - ](container); - } else if (offset >= container.nodeValue.length) { - r[ - "set" + - c.replace(/(\w)/, function(a) { - return a.toUpperCase(); - }) + - "After" - ](container); - } - } - } - - if (ignoreCollapsed || !this.collapsed) { - adjust(this, "start"); - adjust(this, "end"); - } - return this; - }, - - /** - * 在当前选区的开始位置前插入节点,新插入的节点会被该range包含 - * @method insertNode - * @param { Node } node 需要插入的节点 - * @remind 插入的节点可以是一个DocumentFragment依次插入多个节点 - * @return { UE.dom.Range } 当前range对象 - */ - insertNode: function(node) { - var first = node, - length = 1; - if (node.nodeType == 11) { - first = node.firstChild; - length = node.childNodes.length; - } - this.trimBoundary(true); - var start = this.startContainer, - offset = this.startOffset; - var nextNode = start.childNodes[offset]; - if (nextNode) { - start.insertBefore(node, nextNode); - } else { - start.appendChild(node); - } - if (first.parentNode === this.endContainer) { - this.endOffset = this.endOffset + length; - } - return this.setStartBefore(first); - }, - - /** - * 闭合选区到当前选区的开始位置, 并且定位光标到闭合后的位置 - * @method setCursor - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.Range:collapse() - */ - - /** - * 闭合选区,可以根据参数toEnd的值控制选区是向前闭合还是向后闭合, 并且定位光标到闭合后的位置。 - * @method setCursor - * @param { Boolean } toEnd 是否向后闭合, 如果为true, 则闭合选区时, 将向结束容器方向闭合, - * 反之,则向开始容器方向闭合 - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.Range:collapse(Boolean) - */ - setCursor: function(toEnd, noFillData) { - return this.collapse(!toEnd).select(noFillData); - }, - - /** - * 创建当前range的一个书签,记录下当前range的位置,方便当dom树改变时,还能找回原来的选区位置 - * @method createBookmark - * @param { Boolean } serialize 控制返回的标记位置是对当前位置的引用还是ID,如果该值为true,则 - * 返回标记位置的ID, 反之则返回标记位置节点的引用 - * @return { Object } 返回一个书签记录键值对, 其包含的key有: start => 开始标记的ID或者引用, - * end => 结束标记的ID或引用, id => 当前标记的类型, 如果为true,则表示 - * 返回的记录的类型为ID, 反之则为引用 - */ - createBookmark: function(serialize, same) { - var endNode, - startNode = this.document.createElement("span"); - startNode.style.cssText = "display:none;line-height:0px;"; - startNode.appendChild(this.document.createTextNode("\u200D")); - startNode.id = "_baidu_bookmark_start_" + (same ? "" : guid++); - - if (!this.collapsed) { - endNode = startNode.cloneNode(true); - endNode.id = "_baidu_bookmark_end_" + (same ? "" : guid++); - } - this.insertNode(startNode); - if (endNode) { - this.collapse().insertNode(endNode).setEndBefore(endNode); - } - this.setStartAfter(startNode); - return { - start: serialize ? startNode.id : startNode, - end: endNode ? (serialize ? endNode.id : endNode) : null, - id: serialize - }; - }, - - /** - * 调整当前range的边界到书签位置,并删除该书签对象所标记的位置内的节点 - * @method moveToBookmark - * @param { BookMark } bookmark createBookmark所创建的标签对象 - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.Range:createBookmark(Boolean) - */ - moveToBookmark: function(bookmark) { - var start = bookmark.id - ? this.document.getElementById(bookmark.start) - : bookmark.start, - end = bookmark.end && bookmark.id - ? this.document.getElementById(bookmark.end) - : bookmark.end; - this.setStartBefore(start); - domUtils.remove(start); - if (end) { - this.setEndBefore(end); - domUtils.remove(end); - } else { - this.collapse(true); - } - return this; - }, - - /** - * 调整range的边界,使其"放大"到最近的父节点 - * @method enlarge - * @remind 会引起选区的变化 - * @return { UE.dom.Range } 当前range对象 - */ - - /** - * 调整range的边界,使其"放大"到最近的父节点,根据参数 toBlock 的取值, 可以 - * 要求扩大之后的父节点是block节点 - * @method enlarge - * @param { Boolean } toBlock 是否要求扩大之后的父节点必须是block节点 - * @return { UE.dom.Range } 当前range对象 - */ - enlarge: function(toBlock, stopFn) { - var isBody = domUtils.isBody, - pre, - node, - tmp = this.document.createTextNode(""); - if (toBlock) { - node = this.startContainer; - if (node.nodeType == 1) { - if (node.childNodes[this.startOffset]) { - pre = node = node.childNodes[this.startOffset]; - } else { - node.appendChild(tmp); - pre = node = tmp; - } - } else { - pre = node; - } - while (1) { - if (domUtils.isBlockElm(node)) { - node = pre; - while ((pre = node.previousSibling) && !domUtils.isBlockElm(pre)) { - node = pre; - } - this.setStartBefore(node); - break; - } - pre = node; - node = node.parentNode; - } - node = this.endContainer; - if (node.nodeType == 1) { - if ((pre = node.childNodes[this.endOffset])) { - node.insertBefore(tmp, pre); - } else { - node.appendChild(tmp); - } - pre = node = tmp; - } else { - pre = node; - } - while (1) { - if (domUtils.isBlockElm(node)) { - node = pre; - while ((pre = node.nextSibling) && !domUtils.isBlockElm(pre)) { - node = pre; - } - this.setEndAfter(node); - break; - } - pre = node; - node = node.parentNode; - } - if (tmp.parentNode === this.endContainer) { - this.endOffset--; - } - domUtils.remove(tmp); - } - - // 扩展边界到最大 - if (!this.collapsed) { - while (this.startOffset == 0) { - if (stopFn && stopFn(this.startContainer)) { - break; - } - if (isBody(this.startContainer)) { - break; - } - this.setStartBefore(this.startContainer); - } - while ( - this.endOffset == - (this.endContainer.nodeType == 1 - ? this.endContainer.childNodes.length - : this.endContainer.nodeValue.length) - ) { - if (stopFn && stopFn(this.endContainer)) { - break; - } - if (isBody(this.endContainer)) { - break; - } - this.setEndAfter(this.endContainer); - } - } - return this; - }, - enlargeToBlockElm: function(ignoreEnd) { - while (!domUtils.isBlockElm(this.startContainer)) { - this.setStartBefore(this.startContainer); - } - if (!ignoreEnd) { - while (!domUtils.isBlockElm(this.endContainer)) { - this.setEndAfter(this.endContainer); - } - } - return this; - }, - /** - * 调整Range的边界,使其"缩小"到最合适的位置 - * @method adjustmentBoundary - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.Range:shrinkBoundary() - */ - adjustmentBoundary: function() { - if (!this.collapsed) { - while ( - !domUtils.isBody(this.startContainer) && - this.startOffset == - this.startContainer[ - this.startContainer.nodeType == 3 ? "nodeValue" : "childNodes" - ].length && - this.startContainer[ - this.startContainer.nodeType == 3 ? "nodeValue" : "childNodes" - ].length - ) { - this.setStartAfter(this.startContainer); - } - while ( - !domUtils.isBody(this.endContainer) && - !this.endOffset && - this.endContainer[ - this.endContainer.nodeType == 3 ? "nodeValue" : "childNodes" - ].length - ) { - this.setEndBefore(this.endContainer); - } - } - return this; - }, - - /** - * 给range选区中的内容添加给定的inline标签 - * @method applyInlineStyle - * @param { String } tagName 需要添加的标签名 - * @example - * ```html - *

                      xxxx[xxxx]x

                      ==> range.applyInlineStyle("strong") ==>

                      xxxx[xxxx]x

                      - * ``` - */ - - /** - * 给range选区中的内容添加给定的inline标签, 并且为标签附加上一些初始化属性。 - * @method applyInlineStyle - * @param { String } tagName 需要添加的标签名 - * @param { Object } attrs 跟随新添加的标签的属性 - * @return { UE.dom.Range } 当前选区 - * @example - * ```html - *

                      xxxx[xxxx]x

                      - * - * ==> - * - * - * range.applyInlineStyle("strong",{"style":"font-size:12px"}) - * - * ==> - * - *

                      xxxx[xxxx]x

                      - * ``` - */ - applyInlineStyle: function(tagName, attrs, list) { - if (this.collapsed) return this; - this.trimBoundary() - .enlarge(false, function(node) { - return node.nodeType == 1 && domUtils.isBlockElm(node); - }) - .adjustmentBoundary(); - var bookmark = this.createBookmark(), - end = bookmark.end, - filterFn = function(node) { - return node.nodeType == 1 - ? node.tagName.toLowerCase() != "br" - : !domUtils.isWhitespace(node); - }, - current = domUtils.getNextDomNode(bookmark.start, false, filterFn), - node, - pre, - range = this.cloneRange(); - while ( - current && - domUtils.getPosition(current, end) & domUtils.POSITION_PRECEDING - ) { - if (current.nodeType == 3 || dtd[tagName][current.tagName]) { - range.setStartBefore(current); - node = current; - while ( - node && - (node.nodeType == 3 || dtd[tagName][node.tagName]) && - node !== end - ) { - pre = node; - node = domUtils.getNextDomNode( - node, - node.nodeType == 1, - null, - function(parent) { - return dtd[tagName][parent.tagName]; - } - ); - } - var frag = range.setEndAfter(pre).extractContents(), - elm; - if (list && list.length > 0) { - var level, top; - top = level = list[0].cloneNode(false); - for (var i = 1, ci; (ci = list[i++]); ) { - level.appendChild(ci.cloneNode(false)); - level = level.firstChild; - } - elm = level; - } else { - elm = range.document.createElement(tagName); - } - if (attrs) { - domUtils.setAttributes(elm, attrs); - } - elm.appendChild(frag); - //针对嵌套span的全局样式指定,做容错处理 - if (elm.tagName == "SPAN" && attrs && attrs.style) { - utils.each(elm.getElementsByTagName("span"), function(s) { - s.style.cssText = s.style.cssText + ";" + attrs.style; - }); - } - range.insertNode(list ? top : elm); - //处理下滑线在a上的情况 - var aNode; - if ( - tagName == "span" && - attrs.style && - /text\-decoration/.test(attrs.style) && - (aNode = domUtils.findParentByTagName(elm, "a", true)) - ) { - domUtils.setAttributes(aNode, attrs); - domUtils.remove(elm, true); - elm = aNode; - } else { - domUtils.mergeSibling(elm); - domUtils.clearEmptySibling(elm); - } - //去除子节点相同的 - domUtils.mergeChild(elm, attrs); - current = domUtils.getNextDomNode(elm, false, filterFn); - domUtils.mergeToParent(elm); - if (node === end) { - break; - } - } else { - current = domUtils.getNextDomNode(current, true, filterFn); - } - } - return this.moveToBookmark(bookmark); - }, - - /** - * 移除当前选区内指定的inline标签,但保留其中的内容 - * @method removeInlineStyle - * @param { String } tagName 需要移除的标签名 - * @return { UE.dom.Range } 当前的range对象 - * @example - * ```html - * xx[xxxxyyyzz]z => range.removeInlineStyle(["em"]) => xx[xxxxyyyzz]z - * ``` - */ - - /** - * 移除当前选区内指定的一组inline标签,但保留其中的内容 - * @method removeInlineStyle - * @param { Array } tagNameArr 需要移除的标签名的数组 - * @return { UE.dom.Range } 当前的range对象 - * @see UE.dom.Range:removeInlineStyle(String) - */ - removeInlineStyle: function(tagNames) { - if (this.collapsed) return this; - tagNames = utils.isArray(tagNames) ? tagNames : [tagNames]; - this.shrinkBoundary().adjustmentBoundary(); - var start = this.startContainer, - end = this.endContainer; - while (1) { - if (start.nodeType == 1) { - if (utils.indexOf(tagNames, start.tagName.toLowerCase()) > -1) { - break; - } - if (start.tagName.toLowerCase() == "body") { - start = null; - break; - } - } - start = start.parentNode; - } - while (1) { - if (end.nodeType == 1) { - if (utils.indexOf(tagNames, end.tagName.toLowerCase()) > -1) { - break; - } - if (end.tagName.toLowerCase() == "body") { - end = null; - break; - } - } - end = end.parentNode; - } - var bookmark = this.createBookmark(), - frag, - tmpRange; - if (start) { - tmpRange = this.cloneRange() - .setEndBefore(bookmark.start) - .setStartBefore(start); - frag = tmpRange.extractContents(); - tmpRange.insertNode(frag); - domUtils.clearEmptySibling(start, true); - start.parentNode.insertBefore(bookmark.start, start); - } - if (end) { - tmpRange = this.cloneRange() - .setStartAfter(bookmark.end) - .setEndAfter(end); - frag = tmpRange.extractContents(); - tmpRange.insertNode(frag); - domUtils.clearEmptySibling(end, false, true); - end.parentNode.insertBefore(bookmark.end, end.nextSibling); - } - var current = domUtils.getNextDomNode(bookmark.start, false, function( - node - ) { - return node.nodeType == 1; - }), - next; - while (current && current !== bookmark.end) { - next = domUtils.getNextDomNode(current, true, function(node) { - return node.nodeType == 1; - }); - if (utils.indexOf(tagNames, current.tagName.toLowerCase()) > -1) { - domUtils.remove(current, true); - } - current = next; - } - return this.moveToBookmark(bookmark); - }, - - /** - * 获取当前选中的自闭合的节点 - * @method getClosedNode - * @return { Node | NULL } 如果当前选中的是自闭合节点, 则返回该节点, 否则返回NULL - */ - getClosedNode: function() { - var node; - if (!this.collapsed) { - var range = this.cloneRange().adjustmentBoundary().shrinkBoundary(); - if (selectOneNode(range)) { - var child = range.startContainer.childNodes[range.startOffset]; - if ( - child && - child.nodeType == 1 && - (dtd.$empty[child.tagName] || dtd.$nonChild[child.tagName]) - ) { - node = child; - } - } - } - return node; - }, - - /** - * 在页面上高亮range所表示的选区 - * @method select - * @return { UE.dom.Range } 返回当前Range对象 - */ - //这里不区分ie9以上,trace:3824 - select: browser.ie - ? function(noFillData, textRange) { - var nativeRange; - if (!this.collapsed) this.shrinkBoundary(); - var node = this.getClosedNode(); - if (node && !textRange) { - try { - nativeRange = this.document.body.createControlRange(); - nativeRange.addElement(node); - nativeRange.select(); - } catch (e) {} - return this; - } - var bookmark = this.createBookmark(), - start = bookmark.start, - end; - nativeRange = this.document.body.createTextRange(); - nativeRange.moveToElementText(start); - nativeRange.moveStart("character", 1); - if (!this.collapsed) { - var nativeRangeEnd = this.document.body.createTextRange(); - end = bookmark.end; - nativeRangeEnd.moveToElementText(end); - nativeRange.setEndPoint("EndToEnd", nativeRangeEnd); - } else { - if (!noFillData && this.startContainer.nodeType != 3) { - //使用|x固定住光标 - var tmpText = this.document.createTextNode(fillChar), - tmp = this.document.createElement("span"); - tmp.appendChild(this.document.createTextNode(fillChar)); - start.parentNode.insertBefore(tmp, start); - start.parentNode.insertBefore(tmpText, start); - //当点b,i,u时,不能清除i上边的b - removeFillData(this.document, tmpText); - fillData = tmpText; - mergeSibling(tmp, "previousSibling"); - mergeSibling(start, "nextSibling"); - nativeRange.moveStart("character", -1); - nativeRange.collapse(true); - } - } - this.moveToBookmark(bookmark); - tmp && domUtils.remove(tmp); - //IE在隐藏状态下不支持range操作,catch一下 - try { - nativeRange.select(); - } catch (e) {} - return this; - } - : function(notInsertFillData) { - function checkOffset(rng) { - function check(node, offset, dir) { - if (node.nodeType == 3 && node.nodeValue.length < offset) { - rng[dir + "Offset"] = node.nodeValue.length; - } - } - check(rng.startContainer, rng.startOffset, "start"); - check(rng.endContainer, rng.endOffset, "end"); - } - var win = domUtils.getWindow(this.document), - sel = win.getSelection(), - txtNode; - //FF下关闭自动长高时滚动条在关闭dialog时会跳 - //ff下如果不body.focus将不能定位闭合光标到编辑器内 - browser.gecko ? this.document.body.focus() : win.focus(); - if (sel) { - sel.removeAllRanges(); - // trace:870 chrome/safari后边是br对于闭合得range不能定位 所以去掉了判断 - // this.startContainer.nodeType != 3 &&! ((child = this.startContainer.childNodes[this.startOffset]) && child.nodeType == 1 && child.tagName == 'BR' - if (this.collapsed && !notInsertFillData) { - // //opear如果没有节点接着,原生的不能够定位,不能在body的第一级插入空白节点 - // if (notInsertFillData && browser.opera && !domUtils.isBody(this.startContainer) && this.startContainer.nodeType == 1) { - // var tmp = this.document.createTextNode(''); - // this.insertNode(tmp).setStart(tmp, 0).collapse(true); - // } - // - //处理光标落在文本节点的情况 - //处理以下的情况 - //|xxxx - //xxxx|xxxx - //xxxx| - var start = this.startContainer, - child = start; - if (start.nodeType == 1) { - child = start.childNodes[this.startOffset]; - } - if ( - !(start.nodeType == 3 && this.startOffset) && - (child - ? !child.previousSibling || - child.previousSibling.nodeType != 3 - : !start.lastChild || start.lastChild.nodeType != 3) - ) { - txtNode = this.document.createTextNode(fillChar); - //跟着前边走 - this.insertNode(txtNode); - removeFillData(this.document, txtNode); - mergeSibling(txtNode, "previousSibling"); - mergeSibling(txtNode, "nextSibling"); - fillData = txtNode; - this.setStart(txtNode, browser.webkit ? 1 : 0).collapse(true); - } - } - var nativeRange = this.document.createRange(); - if ( - this.collapsed && - browser.opera && - this.startContainer.nodeType == 1 - ) { - var child = this.startContainer.childNodes[this.startOffset]; - if (!child) { - //往前靠拢 - child = this.startContainer.lastChild; - if (child && domUtils.isBr(child)) { - this.setStartBefore(child).collapse(true); - } - } else { - //向后靠拢 - while (child && domUtils.isBlockElm(child)) { - if (child.nodeType == 1 && child.childNodes[0]) { - child = child.childNodes[0]; - } else { - break; - } - } - child && this.setStartBefore(child).collapse(true); - } - } - //是createAddress最后一位算的不准,现在这里进行微调 - checkOffset(this); - nativeRange.setStart(this.startContainer, this.startOffset); - nativeRange.setEnd(this.endContainer, this.endOffset); - sel.addRange(nativeRange); - } - return this; - }, - - /** - * 滚动到当前range开始的位置 - * @method scrollToView - * @param { Window } win 当前range对象所属的window对象 - * @return { UE.dom.Range } 当前Range对象 - */ - - /** - * 滚动到距离当前range开始位置 offset 的位置处 - * @method scrollToView - * @param { Window } win 当前range对象所属的window对象 - * @param { Number } offset 距离range开始位置处的偏移量, 如果为正数, 则向下偏移, 反之, 则向上偏移 - * @return { UE.dom.Range } 当前Range对象 - */ - scrollToView: function(win, offset) { - win = win ? window : domUtils.getWindow(this.document); - var me = this, - span = me.document.createElement("span"); - //trace:717 - span.innerHTML = " "; - me.cloneRange().insertNode(span); - domUtils.scrollToView(span, win, offset); - domUtils.remove(span); - return me; - }, - - /** - * 判断当前选区内容是否占位符 - * @private - * @method inFillChar - * @return { Boolean } 如果是占位符返回true,否则返回false - */ - inFillChar: function() { - var start = this.startContainer; - if ( - this.collapsed && - start.nodeType == 3 && - start.nodeValue.replace(new RegExp("^" + domUtils.fillChar), "") - .length + - 1 == - start.nodeValue.length - ) { - return true; - } - return false; - }, - - /** - * 保存 - * @method createAddress - * @private - * @return { Boolean } 返回开始和结束的位置 - * @example - * ```html - * - *

                      - * aaaa - * - * - * bbbb - * - * - *

                      - * - * - * - * ``` - */ - createAddress: function(ignoreEnd, ignoreTxt) { - var addr = {}, - me = this; - - function getAddress(isStart) { - var node = isStart ? me.startContainer : me.endContainer; - var parents = domUtils.findParents(node, true, function(node) { - return !domUtils.isBody(node); - }), - addrs = []; - for (var i = 0, ci; (ci = parents[i++]); ) { - addrs.push(domUtils.getNodeIndex(ci, ignoreTxt)); - } - var firstIndex = 0; - - if (ignoreTxt) { - if (node.nodeType == 3) { - var tmpNode = node.previousSibling; - while (tmpNode && tmpNode.nodeType == 3) { - firstIndex += tmpNode.nodeValue.replace(fillCharReg, "").length; - tmpNode = tmpNode.previousSibling; - } - firstIndex += isStart ? me.startOffset : me.endOffset; // - (fillCharReg.test(node.nodeValue) ? 1 : 0 ) - } else { - node = node.childNodes[isStart ? me.startOffset : me.endOffset]; - if (node) { - firstIndex = domUtils.getNodeIndex(node, ignoreTxt); - } else { - node = isStart ? me.startContainer : me.endContainer; - var first = node.firstChild; - while (first) { - if (domUtils.isFillChar(first)) { - first = first.nextSibling; - continue; - } - firstIndex++; - if (first.nodeType == 3) { - while (first && first.nodeType == 3) { - first = first.nextSibling; - } - } else { - first = first.nextSibling; - } - } - } - } - } else { - firstIndex = isStart - ? domUtils.isFillChar(node) ? 0 : me.startOffset - : me.endOffset; - } - if (firstIndex < 0) { - firstIndex = 0; - } - addrs.push(firstIndex); - return addrs; - } - addr.startAddress = getAddress(true); - if (!ignoreEnd) { - addr.endAddress = me.collapsed - ? [].concat(addr.startAddress) - : getAddress(); - } - return addr; - }, - - /** - * 保存 - * @method createAddress - * @private - * @return { Boolean } 返回开始和结束的位置 - * @example - * ```html - * - *

                      - * aaaa - * - * - * bbbb - * - * - *

                      - * - * - * - * ``` - */ - moveToAddress: function(addr, ignoreEnd) { - var me = this; - function getNode(address, isStart) { - var tmpNode = me.document.body, - parentNode, - offset; - for (var i = 0, ci, l = address.length; i < l; i++) { - ci = address[i]; - parentNode = tmpNode; - tmpNode = tmpNode.childNodes[ci]; - if (!tmpNode) { - offset = ci; - break; - } - } - if (isStart) { - if (tmpNode) { - me.setStartBefore(tmpNode); - } else { - me.setStart(parentNode, offset); - } - } else { - if (tmpNode) { - me.setEndBefore(tmpNode); - } else { - me.setEnd(parentNode, offset); - } - } - } - getNode(addr.startAddress, true); - !ignoreEnd && addr.endAddress && getNode(addr.endAddress); - return me; - }, - - /** - * 判断给定的Range对象是否和当前Range对象表示的是同一个选区 - * @method equals - * @param { UE.dom.Range } 需要判断的Range对象 - * @return { Boolean } 如果给定的Range对象与当前Range对象表示的是同一个选区, 则返回true, 否则返回false - */ - equals: function(rng) { - for (var p in this) { - if (this.hasOwnProperty(p)) { - if (this[p] !== rng[p]) return false; - } - } - return true; - }, - - /** - * 遍历range内的节点。每当遍历一个节点时, 都会执行参数项 doFn 指定的函数, 该函数的接受当前遍历的节点 - * 作为其参数。 - * @method traversal - * @param { Function } doFn 对每个遍历的节点要执行的方法, 该方法接受当前遍历的节点作为其参数 - * @return { UE.dom.Range } 当前range对象 - * @example - * ```html - * - * - * - * - * - * - * - * - * - * - * ``` - */ - - /** - * 遍历range内的节点。 - * 每当遍历一个节点时, 都会执行参数项 doFn 指定的函数, 该函数的接受当前遍历的节点 - * 作为其参数。 - * 可以通过参数项 filterFn 来指定一个过滤器, 只有符合该过滤器过滤规则的节点才会触 - * 发doFn函数的执行 - * @method traversal - * @param { Function } doFn 对每个遍历的节点要执行的方法, 该方法接受当前遍历的节点作为其参数 - * @param { Function } filterFn 过滤器, 该函数接受当前遍历的节点作为参数, 如果该节点满足过滤 - * 规则, 请返回true, 该节点会触发doFn, 否则, 请返回false, 则该节点不 - * 会触发doFn。 - * @return { UE.dom.Range } 当前range对象 - * @see UE.dom.Range:traversal(Function) - * @example - * ```html - * - * - * - * - * - * - * - * - * - * - * ``` - */ - traversal: function(doFn, filterFn) { - if (this.collapsed) return this; - var bookmark = this.createBookmark(), - end = bookmark.end, - current = domUtils.getNextDomNode(bookmark.start, false, filterFn); - while ( - current && - current !== end && - domUtils.getPosition(current, end) & domUtils.POSITION_PRECEDING - ) { - var tmpNode = domUtils.getNextDomNode(current, false, filterFn); - doFn(current); - current = tmpNode; - } - return this.moveToBookmark(bookmark); - } - }; -})(); - - -// core/Selection.js -/** - * 选集 - * @file - * @module UE.dom - * @class Selection - * @since 1.2.6.1 - */ - -/** - * 选区集合 - * @unfile - * @module UE.dom - * @class Selection - */ -;(function() { - function getBoundaryInformation(range, start) { - var getIndex = domUtils.getNodeIndex; - range = range.duplicate(); - range.collapse(start); - var parent = range.parentElement(); - //如果节点里没有子节点,直接退出 - if (!parent.hasChildNodes()) { - return { container: parent, offset: 0 }; - } - var siblings = parent.children, - child, - testRange = range.duplicate(), - startIndex = 0, - endIndex = siblings.length - 1, - index = -1, - distance; - while (startIndex <= endIndex) { - index = Math.floor((startIndex + endIndex) / 2); - child = siblings[index]; - testRange.moveToElementText(child); - var position = testRange.compareEndPoints("StartToStart", range); - if (position > 0) { - endIndex = index - 1; - } else if (position < 0) { - startIndex = index + 1; - } else { - //trace:1043 - return { container: parent, offset: getIndex(child) }; - } - } - if (index == -1) { - testRange.moveToElementText(parent); - testRange.setEndPoint("StartToStart", range); - distance = testRange.text.replace(/(\r\n|\r)/g, "\n").length; - siblings = parent.childNodes; - if (!distance) { - child = siblings[siblings.length - 1]; - return { container: child, offset: child.nodeValue.length }; - } - - var i = siblings.length; - while (distance > 0) { - distance -= siblings[--i].nodeValue.length; - } - return { container: siblings[i], offset: -distance }; - } - testRange.collapse(position > 0); - testRange.setEndPoint(position > 0 ? "StartToStart" : "EndToStart", range); - distance = testRange.text.replace(/(\r\n|\r)/g, "\n").length; - if (!distance) { - return dtd.$empty[child.tagName] || dtd.$nonChild[child.tagName] - ? { - container: parent, - offset: getIndex(child) + (position > 0 ? 0 : 1) - } - : { - container: child, - offset: position > 0 ? 0 : child.childNodes.length - }; - } - while (distance > 0) { - try { - var pre = child; - child = child[position > 0 ? "previousSibling" : "nextSibling"]; - distance -= child.nodeValue.length; - } catch (e) { - return { container: parent, offset: getIndex(pre) }; - } - } - return { - container: child, - offset: position > 0 ? -distance : child.nodeValue.length + distance - }; - } - - /** - * 将ieRange转换为Range对象 - * @param {Range} ieRange ieRange对象 - * @param {Range} range Range对象 - * @return {Range} range 返回转换后的Range对象 - */ - function transformIERangeToRange(ieRange, range) { - if (ieRange.item) { - range.selectNode(ieRange.item(0)); - } else { - var bi = getBoundaryInformation(ieRange, true); - range.setStart(bi.container, bi.offset); - if (ieRange.compareEndPoints("StartToEnd", ieRange) != 0) { - bi = getBoundaryInformation(ieRange, false); - range.setEnd(bi.container, bi.offset); - } - } - return range; - } - - /** - * 获得ieRange - * @param {Selection} sel Selection对象 - * @return {ieRange} 得到ieRange - */ - function _getIERange(sel) { - var ieRange; - //ie下有可能报错 - try { - ieRange = sel.getNative().createRange(); - } catch (e) { - return null; - } - var el = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); - if ((el.ownerDocument || el) === sel.document) { - return ieRange; - } - return null; - } - - var Selection = (dom.Selection = function(doc) { - var me = this, - iframe; - me.document = doc; - if (browser.ie9below) { - iframe = domUtils.getWindow(doc).frameElement; - domUtils.on(iframe, "beforedeactivate", function() { - me._bakIERange = me.getIERange(); - }); - domUtils.on(iframe, "activate", function() { - try { - if (!_getIERange(me) && me._bakIERange) { - me._bakIERange.select(); - } - } catch (ex) {} - me._bakIERange = null; - }); - } - iframe = doc = null; - }); - - Selection.prototype = { - rangeInBody: function(rng, txtRange) { - var node = browser.ie9below || txtRange - ? rng.item ? rng.item() : rng.parentElement() - : rng.startContainer; - - return node === this.document.body || domUtils.inDoc(node, this.document); - }, - - /** - * 获取原生seleciton对象 - * @method getNative - * @return { Object } 获得selection对象 - * @example - * ```javascript - * editor.selection.getNative(); - * ``` - */ - getNative: function() { - var doc = this.document; - try { - return !doc - ? null - : browser.ie9below - ? doc.selection - : domUtils.getWindow(doc).getSelection(); - } catch (e) { - return null; - } - }, - - /** - * 获得ieRange - * @method getIERange - * @return { Object } 返回ie原生的Range - * @example - * ```javascript - * editor.selection.getIERange(); - * ``` - */ - getIERange: function() { - var ieRange = _getIERange(this); - if (!ieRange) { - if (this._bakIERange) { - return this._bakIERange; - } - } - return ieRange; - }, - - /** - * 缓存当前选区的range和选区的开始节点 - * @method cache - */ - cache: function() { - this.clear(); - this._cachedRange = this.getRange(); - this._cachedStartElement = this.getStart(); - this._cachedStartElementPath = this.getStartElementPath(); - }, - - /** - * 获取选区开始位置的父节点到body - * @method getStartElementPath - * @return { Array } 返回父节点集合 - * @example - * ```javascript - * editor.selection.getStartElementPath(); - * ``` - */ - getStartElementPath: function() { - if (this._cachedStartElementPath) { - return this._cachedStartElementPath; - } - var start = this.getStart(); - if (start) { - return domUtils.findParents(start, true, null, true); - } - return []; - }, - - /** - * 清空缓存 - * @method clear - */ - clear: function() { - this._cachedStartElementPath = this._cachedRange = this._cachedStartElement = null; - }, - - /** - * 编辑器是否得到了选区 - * @method isFocus - */ - isFocus: function() { - try { - if (browser.ie9below) { - var nativeRange = _getIERange(this); - return !!(nativeRange && this.rangeInBody(nativeRange)); - } else { - return !!this.getNative().rangeCount; - } - } catch (e) { - return false; - } - }, - - /** - * 获取选区对应的Range - * @method getRange - * @return { Object } 得到Range对象 - * @example - * ```javascript - * editor.selection.getRange(); - * ``` - */ - getRange: function() { - var me = this; - function optimze(range) { - var child = me.document.body.firstChild, - collapsed = range.collapsed; - while (child && child.firstChild) { - range.setStart(child, 0); - child = child.firstChild; - } - if (!range.startContainer) { - range.setStart(me.document.body, 0); - } - if (collapsed) { - range.collapse(true); - } - } - - if (me._cachedRange != null) { - return this._cachedRange; - } - var range = new baidu.editor.dom.Range(me.document); - - if (browser.ie9below) { - var nativeRange = me.getIERange(); - if (nativeRange) { - //备份的_bakIERange可能已经实效了,dom树发生了变化比如从源码模式切回来,所以try一下,实效就放到body开始位置 - try { - transformIERangeToRange(nativeRange, range); - } catch (e) { - optimze(range); - } - } else { - optimze(range); - } - } else { - var sel = me.getNative(); - if (sel && sel.rangeCount) { - var firstRange = sel.getRangeAt(0); - var lastRange = sel.getRangeAt(sel.rangeCount - 1); - range - .setStart(firstRange.startContainer, firstRange.startOffset) - .setEnd(lastRange.endContainer, lastRange.endOffset); - if ( - range.collapsed && - domUtils.isBody(range.startContainer) && - !range.startOffset - ) { - optimze(range); - } - } else { - //trace:1734 有可能已经不在dom树上了,标识的节点 - if ( - this._bakRange && - domUtils.inDoc(this._bakRange.startContainer, this.document) - ) { - return this._bakRange; - } - optimze(range); - } - } - return (this._bakRange = range); - }, - - /** - * 获取开始元素,用于状态反射 - * @method getStart - * @return { Element } 获得开始元素 - * @example - * ```javascript - * editor.selection.getStart(); - * ``` - */ - getStart: function() { - if (this._cachedStartElement) { - return this._cachedStartElement; - } - var range = browser.ie9below ? this.getIERange() : this.getRange(), - tmpRange, - start, - tmp, - parent; - if (browser.ie9below) { - if (!range) { - //todo 给第一个值可能会有问题 - return this.document.body.firstChild; - } - //control元素 - if (range.item) { - return range.item(0); - } - tmpRange = range.duplicate(); - //修正ie下x[xx] 闭合后 x|xx - tmpRange.text.length > 0 && tmpRange.moveStart("character", 1); - tmpRange.collapse(1); - start = tmpRange.parentElement(); - parent = tmp = range.parentElement(); - while ((tmp = tmp.parentNode)) { - if (tmp == start) { - start = parent; - break; - } - } - } else { - range.shrinkBoundary(); - start = range.startContainer; - if (start.nodeType == 1 && start.hasChildNodes()) { - start = - start.childNodes[ - Math.min(start.childNodes.length - 1, range.startOffset) - ]; - } - if (start.nodeType == 3) { - return start.parentNode; - } - } - return start; - }, - - /** - * 得到选区中的文本 - * @method getText - * @return { String } 选区中包含的文本 - * @example - * ```javascript - * editor.selection.getText(); - * ``` - */ - getText: function() { - var nativeSel, nativeRange; - if (this.isFocus() && (nativeSel = this.getNative())) { - nativeRange = browser.ie9below - ? nativeSel.createRange() - : nativeSel.getRangeAt(0); - return browser.ie9below ? nativeRange.text : nativeRange.toString(); - } - return ""; - }, - - /** - * 清除选区 - * @method clearRange - * @example - * ```javascript - * editor.selection.clearRange(); - * ``` - */ - clearRange: function() { - this.getNative()[browser.ie9below ? "empty" : "removeAllRanges"](); - } - }; -})(); - - -// core/Editor.js -/** - * 编辑器主类,包含编辑器提供的大部分公用接口 - * @file - * @module UE - * @class Editor - * @since 1.2.6.1 - */ - -/** - * UEditor公用空间,UEditor所有的功能都挂载在该空间下 - * @unfile - * @module UE - */ - -/** - * UEditor的核心类,为用户提供与编辑器交互的接口。 - * @unfile - * @module UE - * @class Editor - */ - -;(function() { - var uid = 0, - _selectionChangeTimer; - - /** - * 获取编辑器的html内容,赋值到编辑器所在表单的textarea文本域里面 - * @private - * @method setValue - * @param { UE.Editor } editor 编辑器事例 - */ - function setValue(form, editor) { - var textarea; - if (editor.options.textarea) { - if (utils.isString(editor.options.textarea)) { - for ( - var i = 0, ti, tis = domUtils.getElementsByTagName(form, "textarea"); - (ti = tis[i++]); - - ) { - if (ti.id == "ueditor_textarea_" + editor.options.textarea) { - textarea = ti; - break; - } - } - } else { - textarea = editor.textarea; - } - } - if (!textarea) { - form.appendChild( - (textarea = domUtils.createElement(document, "textarea", { - name: editor.options.textarea, - id: "ueditor_textarea_" + editor.options.textarea, - style: "display:none" - })) - ); - //不要产生多个textarea - editor.textarea = textarea; - } - !textarea.getAttribute("name") && - textarea.setAttribute("name", editor.options.textarea); - textarea.value = editor.hasContents() - ? editor.options.allHtmlEnabled - ? editor.getAllHtml() - : editor.getContent(null, null, true) - : ""; - } - function loadPlugins(me) { - //初始化插件 - for (var pi in UE.plugins) { - UE.plugins[pi].call(me); - } - } - function checkCurLang(I18N) { - for (var lang in I18N) { - return lang; - } - } - - function langReadied(me) { - me.langIsReady = true; - - me.fireEvent("langReady"); - } - - /** - * 编辑器准备就绪后会触发该事件 - * @module UE - * @class Editor - * @event ready - * @remind render方法执行完成之后,会触发该事件 - * @remind - * @example - * ```javascript - * editor.addListener( 'ready', function( editor ) { - * editor.execCommand( 'focus' ); //编辑器家在完成后,让编辑器拿到焦点 - * } ); - * ``` - */ - /** - * 执行destroy方法,会触发该事件 - * @module UE - * @class Editor - * @event destroy - * @see UE.Editor:destroy() - */ - /** - * 执行reset方法,会触发该事件 - * @module UE - * @class Editor - * @event reset - * @see UE.Editor:reset() - */ - /** - * 执行focus方法,会触发该事件 - * @module UE - * @class Editor - * @event focus - * @see UE.Editor:focus(Boolean) - */ - /** - * 语言加载完成会触发该事件 - * @module UE - * @class Editor - * @event langReady - */ - /** - * 运行命令之后会触发该命令 - * @module UE - * @class Editor - * @event beforeExecCommand - */ - /** - * 运行命令之后会触发该命令 - * @module UE - * @class Editor - * @event afterExecCommand - */ - /** - * 运行命令之前会触发该命令 - * @module UE - * @class Editor - * @event firstBeforeExecCommand - */ - /** - * 在getContent方法执行之前会触发该事件 - * @module UE - * @class Editor - * @event beforeGetContent - * @see UE.Editor:getContent() - */ - /** - * 在getContent方法执行之后会触发该事件 - * @module UE - * @class Editor - * @event afterGetContent - * @see UE.Editor:getContent() - */ - /** - * 在getAllHtml方法执行时会触发该事件 - * @module UE - * @class Editor - * @event getAllHtml - * @see UE.Editor:getAllHtml() - */ - /** - * 在setContent方法执行之前会触发该事件 - * @module UE - * @class Editor - * @event beforeSetContent - * @see UE.Editor:setContent(String) - */ - /** - * 在setContent方法执行之后会触发该事件 - * @module UE - * @class Editor - * @event afterSetContent - * @see UE.Editor:setContent(String) - */ - /** - * 每当编辑器内部选区发生改变时,将触发该事件 - * @event selectionchange - * @warning 该事件的触发非常频繁,不建议在该事件的处理过程中做重量级的处理 - * @example - * ```javascript - * editor.addListener( 'selectionchange', function( editor ) { - * console.log('选区发生改变'); - * } - */ - /** - * 在所有selectionchange的监听函数执行之前,会触发该事件 - * @module UE - * @class Editor - * @event beforeSelectionChange - * @see UE.Editor:selectionchange - */ - /** - * 在所有selectionchange的监听函数执行完之后,会触发该事件 - * @module UE - * @class Editor - * @event afterSelectionChange - * @see UE.Editor:selectionchange - */ - /** - * 编辑器内容发生改变时会触发该事件 - * @module UE - * @class Editor - * @event contentChange - */ - - /** - * 以默认参数构建一个编辑器实例 - * @constructor - * @remind 通过 改构造方法实例化的编辑器,不带ui层.需要render到一个容器,编辑器实例才能正常渲染到页面 - * @example - * ```javascript - * var editor = new UE.Editor(); - * editor.execCommand('blod'); - * ``` - * @see UE.Config - */ - - /** - * 以给定的参数集合创建一个编辑器实例,对于未指定的参数,将应用默认参数。 - * @constructor - * @remind 通过 改构造方法实例化的编辑器,不带ui层.需要render到一个容器,编辑器实例才能正常渲染到页面 - * @param { Object } setting 创建编辑器的参数 - * @example - * ```javascript - * var editor = new UE.Editor(); - * editor.execCommand('blod'); - * ``` - * @see UE.Config - */ - var Editor = (UE.Editor = function(options) { - var me = this; - me.uid = uid++; - EventBase.call(me); - me.commands = {}; - me.options = utils.extend(utils.clone(options || {}), UEDITOR_CONFIG, true); - me.shortcutkeys = {}; - me.inputRules = []; - me.outputRules = []; - //设置默认的常用属性 - me.setOpt(Editor.defaultOptions(me)); - - /* 尝试异步加载后台配置 */ - //me.loadServerConfig(); - - if (!utils.isEmptyObject(UE.I18N)) { - //修改默认的语言类型 - me.options.lang = checkCurLang(UE.I18N); - UE.plugin.load(me); - langReadied(me); - } else { - utils.loadFile( - document, - { - src: - me.options.langPath + - me.options.lang + - "/" + - me.options.lang + - ".js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - UE.plugin.load(me); - langReadied(me); - } - ); - } - - UE.instants["ueditorInstant" + me.uid] = me; - }); - Editor.prototype = { - registerCommand: function(name, obj) { - this.commands[name] = obj; - }, - /** - * 编辑器对外提供的监听ready事件的接口, 通过调用该方法,达到的效果与监听ready事件是一致的 - * @method ready - * @param { Function } fn 编辑器ready之后所执行的回调, 如果在注册事件之前编辑器已经ready,将会 - * 立即触发该回调。 - * @remind 需要等待编辑器加载完成后才能执行的代码,可以使用该方法传入 - * @example - * ```javascript - * editor.ready( function( editor ) { - * editor.setContent('初始化完毕'); - * } ); - * ``` - * @see UE.Editor.event:ready - */ - ready: function(fn) { - var me = this; - if (fn) { - me.isReady ? fn.apply(me) : me.addListener("ready", fn); - } - }, - /** - * 该方法用于设置placeholder - * @method setPlaceholder - * @param { String } placeholder 编辑器的placeholder文案 - * @example - * ```javascript - * editor.setPlaceholder('请输入内容'); - * ``` - */ - setPlaceholder: function(){ - - function contentChange(){ - var localHtml = this.getPlainTxt(); - if(!localHtml.trim()){ - UE.dom.domUtils.addClass( this.body, 'empty' ); - }else{ - UE.dom.domUtils.removeClasses( this.body, 'empty' ); - } - } - - return function(placeholder){ - var _editor = this; - - _editor.ready(function () { - contentChange.call(_editor); - _editor.body.setAttribute('placeholder', placeholder); - }); - _editor.removeListener('keyup contentchange', contentChange); - _editor.addListener('keyup contentchange', contentChange); - } - }(), - - /** - * 该方法是提供给插件里面使用,设置配置项默认值 - * @method setOpt - * @warning 三处设置配置项的优先级: 实例化时传入参数 > setOpt()设置 > config文件里设置 - * @warning 该方法仅供编辑器插件内部和编辑器初始化时调用,其他地方不能调用。 - * @param { String } key 编辑器的可接受的选项名称 - * @param { * } val 该选项可接受的值 - * @example - * ```javascript - * editor.setOpt( 'initContent', '欢迎使用编辑器' ); - * ``` - */ - - /** - * 该方法是提供给插件里面使用,以{key:value}集合的方式设置插件内用到的配置项默认值 - * @method setOpt - * @warning 三处设置配置项的优先级: 实例化时传入参数 > setOpt()设置 > config文件里设置 - * @warning 该方法仅供编辑器插件内部和编辑器初始化时调用,其他地方不能调用。 - * @param { Object } options 将要设置的选项的键值对对象 - * @example - * ```javascript - * editor.setOpt( { - * 'initContent': '欢迎使用编辑器' - * } ); - * ``` - */ - setOpt: function(key, val) { - var obj = {}; - if (utils.isString(key)) { - obj[key] = val; - } else { - obj = key; - } - utils.extend(this.options, obj, true); - }, - getOpt: function(key) { - return this.options[key]; - }, - /** - * 销毁编辑器实例,使用textarea代替 - * @method destroy - * @example - * ```javascript - * editor.destroy(); - * ``` - */ - destroy: function() { - var me = this; - me.fireEvent("destroy"); - var container = me.container.parentNode; - var textarea = me.textarea; - if (!textarea) { - textarea = document.createElement("textarea"); - container.parentNode.insertBefore(textarea, container); - } else { - textarea.style.display = ""; - } - - textarea.style.width = me.iframe.offsetWidth + "px"; - textarea.style.height = me.iframe.offsetHeight + "px"; - textarea.value = me.getContent(); - textarea.id = me.key; - container.innerHTML = ""; - domUtils.remove(container); - var key = me.key; - //trace:2004 - for (var p in me) { - if (me.hasOwnProperty(p)) { - delete this[p]; - } - } - UE.delEditor(key); - }, - - /** - * 渲染编辑器的DOM到指定容器 - * @method render - * @param { String } containerId 指定一个容器ID - * @remind 执行该方法,会触发ready事件 - * @warning 必须且只能调用一次 - */ - - /** - * 渲染编辑器的DOM到指定容器 - * @method render - * @param { Element } containerDom 直接指定容器对象 - * @remind 执行该方法,会触发ready事件 - * @warning 必须且只能调用一次 - */ - render: function(container) { - var me = this, - options = me.options, - getStyleValue = function(attr) { - return parseInt(domUtils.getComputedStyle(container, attr)); - }; - if (utils.isString(container)) { - container = document.getElementById(container); - } - if (container) { - if (options.initialFrameWidth) { - options.minFrameWidth = options.initialFrameWidth; - } else { - options.minFrameWidth = options.initialFrameWidth = - container.offsetWidth; - } - if (options.initialFrameHeight) { - options.minFrameHeight = options.initialFrameHeight; - } else { - options.initialFrameHeight = options.minFrameHeight = - container.offsetHeight; - } - - container.style.width = /%$/.test(options.initialFrameWidth) - ? "100%" - : options.initialFrameWidth - - getStyleValue("padding-left") - - getStyleValue("padding-right") + - "px"; - container.style.height = /%$/.test(options.initialFrameHeight) - ? "100%" - : options.initialFrameHeight - - getStyleValue("padding-top") - - getStyleValue("padding-bottom") + - "px"; - - container.style.zIndex = options.zIndex; - - var html = - (ie && browser.version < 9 ? "" : "") + - "" + - "" + - "" + - (options.iframeCssUrl - ? "" - : "") + - (options.initialStyle - ? "" - : "") + - "" + - "" + - "" + - (options.iframeJsUrl - ? "" - : "") + - ""; - - container.appendChild( - domUtils.createElement(document, "iframe", { - id: "ueditor_" + me.uid, - width: "100%", - height: "100%", - frameborder: "0", - //先注释掉了,加的原因忘记了,但开启会直接导致全屏模式下内容多时不会出现滚动条 - // scrolling :'no', - src: - "javascript:void(function(){document.open();" + - (options.customDomain && document.domain != location.hostname - ? 'document.domain="' + document.domain + '";' - : "") + - 'document.write("' + - html + - '");document.close();}())' - }) - ); - container.style.overflow = "hidden"; - //解决如果是给定的百分比,会导致高度算不对的问题 - setTimeout(function() { - if (/%$/.test(options.initialFrameWidth)) { - options.minFrameWidth = options.initialFrameWidth = - container.offsetWidth; - //如果这里给定宽度,会导致ie在拖动窗口大小时,编辑区域不随着变化 - // container.style.width = options.initialFrameWidth + 'px'; - } - if (/%$/.test(options.initialFrameHeight)) { - options.minFrameHeight = options.initialFrameHeight = - container.offsetHeight; - container.style.height = options.initialFrameHeight + "px"; - } - }); - } - }, - - /** - * 编辑器初始化 - * @method _setup - * @private - * @param { Element } doc 编辑器Iframe中的文档对象 - */ - _setup: function(doc) { - var me = this, - options = me.options; - if (ie) { - doc.body.disabled = true; - doc.body.contentEditable = true; - doc.body.disabled = false; - } else { - doc.body.contentEditable = true; - } - doc.body.spellcheck = false; - me.document = doc; - me.window = doc.defaultView || doc.parentWindow; - me.iframe = me.window.frameElement; - me.body = doc.body; - me.selection = new dom.Selection(doc); - //gecko初始化就能得到range,无法判断isFocus了 - var geckoSel; - if (browser.gecko && (geckoSel = this.selection.getNative())) { - geckoSel.removeAllRanges(); - } - this._initEvents(); - //为form提交提供一个隐藏的textarea - for ( - var form = this.iframe.parentNode; - !domUtils.isBody(form); - form = form.parentNode - ) { - if (form.tagName == "FORM") { - me.form = form; - if (me.options.autoSyncData) { - domUtils.on(me.window, "blur", function() { - setValue(form, me); - }); - } else { - domUtils.on(form, "submit", function() { - setValue(this, me); - }); - } - break; - } - } - if (options.initialContent) { - if (options.autoClearinitialContent) { - var oldExecCommand = me.execCommand; - me.execCommand = function() { - me.fireEvent("firstBeforeExecCommand"); - return oldExecCommand.apply(me, arguments); - }; - this._setDefaultContent(options.initialContent); - } else this.setContent(options.initialContent, false, true); - } - - //编辑器不能为空内容 - - if (domUtils.isEmptyNode(me.body)) { - me.body.innerHTML = "

                      " + (browser.ie ? "" : "
                      ") + "

                      "; - } - //如果要求focus, 就把光标定位到内容开始 - if (options.focus) { - setTimeout(function() { - me.focus(me.options.focusInEnd); - //如果自动清除开着,就不需要做selectionchange; - !me.options.autoClearinitialContent && me._selectionChange(); - }, 0); - } - if (!me.container) { - me.container = this.iframe.parentNode; - } - if (options.fullscreen && me.ui) { - me.ui.setFullScreen(true); - } - - try { - me.document.execCommand("2D-position", false, false); - } catch (e) {} - try { - me.document.execCommand("enableInlineTableEditing", false, false); - } catch (e) {} - try { - me.document.execCommand("enableObjectResizing", false, false); - } catch (e) {} - - //挂接快捷键 - me._bindshortcutKeys(); - me.isReady = 1; - me.fireEvent("ready"); - options.onready && options.onready.call(me); - if (!browser.ie9below) { - domUtils.on(me.window, ["blur", "focus"], function(e) { - //chrome下会出现alt+tab切换时,导致选区位置不对 - if (e.type == "blur") { - me._bakRange = me.selection.getRange(); - try { - me._bakNativeRange = me.selection.getNative().getRangeAt(0); - me.selection.getNative().removeAllRanges(); - } catch (e) { - me._bakNativeRange = null; - } - } else { - try { - me._bakRange && me._bakRange.select(); - } catch (e) {} - } - }); - } - //trace:1518 ff3.6body不够寛,会导致点击空白处无法获得焦点 - if (browser.gecko && browser.version <= 10902) { - //修复ff3.6初始化进来,不能点击获得焦点 - me.body.contentEditable = false; - setTimeout(function() { - me.body.contentEditable = true; - }, 100); - setInterval(function() { - me.body.style.height = me.iframe.offsetHeight - 20 + "px"; - }, 100); - } - - !options.isShow && me.setHide(); - options.readonly && me.setDisabled(); - }, - - /** - * 同步数据到编辑器所在的form - * 从编辑器的容器节点向上查找form元素,若找到,就同步编辑内容到找到的form里,为提交数据做准备,主要用于是手动提交的情况 - * 后台取得数据的键值,使用你容器上的name属性,如果没有就使用参数里的textarea项 - * @method sync - * @example - * ```javascript - * editor.sync(); - * form.sumbit(); //form变量已经指向了form元素 - * ``` - */ - - /** - * 根据传入的formId,在页面上查找要同步数据的表单,若找到,就同步编辑内容到找到的form里,为提交数据做准备 - * 后台取得数据的键值,该键值默认使用给定的编辑器容器的name属性,如果没有name属性则使用参数项里给定的“textarea”项 - * @method sync - * @param { String } formID 指定一个要同步数据的form的id,编辑器的数据会同步到你指定form下 - */ - sync: function(formId) { - var me = this, - form = formId - ? document.getElementById(formId) - : domUtils.findParent( - me.iframe.parentNode, - function(node) { - return node.tagName == "FORM"; - }, - true - ); - form && setValue(form, me); - }, - - /** - * 设置编辑器高度 - * @method setHeight - * @remind 当配置项autoHeightEnabled为真时,该方法无效 - * @param { Number } number 设置的高度值,纯数值,不带单位 - * @example - * ```javascript - * editor.setHeight(number); - * ``` - */ - setHeight: function(height, notSetHeight) { - if (height !== parseInt(this.iframe.parentNode.style.height)) { - this.iframe.parentNode.style.height = height + "px"; - } - !notSetHeight && - (this.options.minFrameHeight = this.options.initialFrameHeight = height); - this.body.style.height = height + "px"; - !notSetHeight && this.trigger("setHeight"); - }, - - /** - * 为编辑器的编辑命令提供快捷键 - * 这个接口是为插件扩展提供的接口,主要是为新添加的插件,如果需要添加快捷键,所提供的接口 - * @method addshortcutkey - * @param { Object } keyset 命令名和快捷键键值对对象,多个按钮的快捷键用“+”分隔 - * @example - * ```javascript - * editor.addshortcutkey({ - * "Bold" : "ctrl+66",//^B - * "Italic" : "ctrl+73", //^I - * }); - * ``` - */ - /** - * 这个接口是为插件扩展提供的接口,主要是为新添加的插件,如果需要添加快捷键,所提供的接口 - * @method addshortcutkey - * @param { String } cmd 触发快捷键时,响应的命令 - * @param { String } keys 快捷键的字符串,多个按钮用“+”分隔 - * @example - * ```javascript - * editor.addshortcutkey("Underline", "ctrl+85"); //^U - * ``` - */ - addshortcutkey: function(cmd, keys) { - var obj = {}; - if (keys) { - obj[cmd] = keys; - } else { - obj = cmd; - } - utils.extend(this.shortcutkeys, obj); - }, - - /** - * 对编辑器设置keydown事件监听,绑定快捷键和命令,当快捷键组合触发成功,会响应对应的命令 - * @method _bindshortcutKeys - * @private - */ - _bindshortcutKeys: function() { - var me = this, - shortcutkeys = this.shortcutkeys; - me.addListener("keydown", function(type, e) { - var keyCode = e.keyCode || e.which; - for (var i in shortcutkeys) { - var tmp = shortcutkeys[i].split(","); - for (var t = 0, ti; (ti = tmp[t++]); ) { - ti = ti.split(":"); - var key = ti[0], - param = ti[1]; - if ( - /^(ctrl)(\+shift)?\+(\d+)$/.test(key.toLowerCase()) || - /^(\d+)$/.test(key) - ) { - if ( - ((RegExp.$1 == "ctrl" ? e.ctrlKey || e.metaKey : 0) && - (RegExp.$2 != "" ? e[RegExp.$2.slice(1) + "Key"] : 1) && - keyCode == RegExp.$3) || - keyCode == RegExp.$1 - ) { - if (me.queryCommandState(i, param) != -1) - me.execCommand(i, param); - domUtils.preventDefault(e); - } - } - } - } - }); - }, - - /** - * 获取编辑器的内容 - * @method getContent - * @warning 该方法获取到的是经过编辑器内置的过滤规则进行过滤后得到的内容 - * @return { String } 编辑器的内容字符串, 如果编辑器的内容为空,或者是空的标签内容(如:”<p><br/></p>“), 则返回空字符串 - * @example - * ```javascript - * //编辑器html内容:

                      123456

                      - * var content = editor.getContent(); //返回值:

                      123456

                      - * ``` - */ - - /** - * 获取编辑器的内容。 可以通过参数定义编辑器内置的判空规则 - * @method getContent - * @param { Function } fn 自定的判空规则, 要求该方法返回一个boolean类型的值, - * 代表当前编辑器的内容是否空, - * 如果返回true, 则该方法将直接返回空字符串;如果返回false,则编辑器将返回 - * 经过内置过滤规则处理后的内容。 - * @remind 该方法在处理包含有初始化内容的时候能起到很好的作用。 - * @warning 该方法获取到的是经过编辑器内置的过滤规则进行过滤后得到的内容 - * @return { String } 编辑器的内容字符串 - * @example - * ```javascript - * // editor 是一个编辑器的实例 - * var content = editor.getContent( function ( editor ) { - * return editor.body.innerHTML === '欢迎使用UEditor'; //返回空字符串 - * } ); - * ``` - */ - getContent: function(cmd, fn, notSetCursor, ignoreBlank, formatter) { - var me = this; - if (cmd && utils.isFunction(cmd)) { - fn = cmd; - cmd = ""; - } - if (fn ? !fn() : !this.hasContents()) { - return ""; - } - me.fireEvent("beforegetcontent"); - var root = UE.htmlparser(me.body.innerHTML, ignoreBlank); - me.filterOutputRule(root); - me.fireEvent("aftergetcontent", cmd, root); - return root.toHtml(formatter); - }, - - /** - * 取得完整的html代码,可以直接显示成完整的html文档 - * @method getAllHtml - * @return { String } 编辑器的内容html文档字符串 - * @eaxmple - * ```javascript - * editor.getAllHtml(); //返回格式大致是: ...... - * ``` - */ - getAllHtml: function() { - var me = this, - headHtml = [], - html = ""; - me.fireEvent("getAllHtml", headHtml); - if (browser.ie && browser.version > 8) { - var headHtmlForIE9 = ""; - utils.each(me.document.styleSheets, function(si) { - headHtmlForIE9 += si.href - ? '' - : ""; - }); - utils.each(me.document.getElementsByTagName("script"), function(si) { - headHtmlForIE9 += si.outerHTML; - }); - } - return ( - "" + - (me.options.charset - ? '' - : "") + - (headHtmlForIE9 || - me.document.getElementsByTagName("head")[0].innerHTML) + - headHtml.join("\n") + - "" + - "" + - me.getContent(null, null, true) + - "" - ); - }, - - /** - * 得到编辑器的纯文本内容,但会保留段落格式 - * @method getPlainTxt - * @return { String } 编辑器带段落格式的纯文本内容字符串 - * @example - * ```javascript - * //编辑器html内容:

                      1

                      2

                      - * console.log(editor.getPlainTxt()); //输出:"1\n2\n - * ``` - */ - getPlainTxt: function() { - var reg = new RegExp(domUtils.fillChar, "g"), - html = this.body.innerHTML.replace(/[\n\r]/g, ""); //ie要先去了\n在处理 - html = html - .replace(/<(p|div)[^>]*>(| )<\/\1>/gi, "\n") - .replace(//gi, "\n") - .replace(/<[^>/]+>/g, "") - .replace(/(\n)?<\/([^>]+)>/g, function(a, b, c) { - return dtd.$block[c] ? "\n" : b ? b : ""; - }); - //取出来的空格会有c2a0会变成乱码,处理这种情况\u00a0 - return html - .replace(reg, "") - .replace(/\u00a0/g, " ") - .replace(/ /g, " "); - }, - - /** - * 获取编辑器中的纯文本内容,没有段落格式 - * @method getContentTxt - * @return { String } 编辑器不带段落格式的纯文本内容字符串 - * @example - * ```javascript - * //编辑器html内容:

                      1

                      2

                      - * console.log(editor.getPlainTxt()); //输出:"12 - * ``` - */ - getContentTxt: function() { - var reg = new RegExp(domUtils.fillChar, "g"); - //取出来的空格会有c2a0会变成乱码,处理这种情况\u00a0 - return this.body[browser.ie ? "innerText" : "textContent"] - .replace(reg, "") - .replace(/\u00a0/g, " "); - }, - - /** - * 设置编辑器的内容,可修改编辑器当前的html内容 - * @method setContent - * @warning 通过该方法插入的内容,是经过编辑器内置的过滤规则进行过滤后得到的内容 - * @warning 该方法会触发selectionchange事件 - * @param { String } html 要插入的html内容 - * @example - * ```javascript - * editor.getContent('

                      test

                      '); - * ``` - */ - - /** - * 设置编辑器的内容,可修改编辑器当前的html内容 - * @method setContent - * @warning 通过该方法插入的内容,是经过编辑器内置的过滤规则进行过滤后得到的内容 - * @warning 该方法会触发selectionchange事件 - * @param { String } html 要插入的html内容 - * @param { Boolean } isAppendTo 若传入true,不清空原来的内容,在最后插入内容,否则,清空内容再插入 - * @example - * ```javascript - * //假设设置前的编辑器内容是

                      old text

                      - * editor.setContent('

                      new text

                      ', true); //插入的结果是

                      old text

                      new text

                      - * ``` - */ - setContent: function(html, isAppendTo, notFireSelectionchange) { - var me = this; - - me.fireEvent("beforesetcontent", html); - var root = UE.htmlparser(html); - me.filterInputRule(root); - html = root.toHtml(); - - me.body.innerHTML = (isAppendTo ? me.body.innerHTML : "") + html; - - function isCdataDiv(node) { - return node.tagName == "DIV" && node.getAttribute("cdata_tag"); - } - //给文本或者inline节点套p标签 - if (me.options.enterTag == "p") { - var child = this.body.firstChild, - tmpNode; - if ( - !child || - (child.nodeType == 1 && - (dtd.$cdata[child.tagName] || - isCdataDiv(child) || - domUtils.isCustomeNode(child)) && - child === this.body.lastChild) - ) { - this.body.innerHTML = - "

                      " + - (browser.ie ? " " : "
                      ") + - "

                      " + - this.body.innerHTML; - } else { - var p = me.document.createElement("p"); - while (child) { - while ( - child && - (child.nodeType == 3 || - (child.nodeType == 1 && - dtd.p[child.tagName] && - !dtd.$cdata[child.tagName])) - ) { - tmpNode = child.nextSibling; - p.appendChild(child); - child = tmpNode; - } - if (p.firstChild) { - if (!child) { - me.body.appendChild(p); - break; - } else { - child.parentNode.insertBefore(p, child); - p = me.document.createElement("p"); - } - } - child = child.nextSibling; - } - } - } - me.fireEvent("aftersetcontent"); - me.fireEvent("contentchange"); - - !notFireSelectionchange && me._selectionChange(); - //清除保存的选区 - me._bakRange = me._bakIERange = me._bakNativeRange = null; - //trace:1742 setContent后gecko能得到焦点问题 - var geckoSel; - if (browser.gecko && (geckoSel = this.selection.getNative())) { - geckoSel.removeAllRanges(); - } - if (me.options.autoSyncData) { - me.form && setValue(me.form, me); - } - }, - - /** - * 让编辑器获得焦点,默认focus到编辑器头部 - * @method focus - * @example - * ```javascript - * editor.focus() - * ``` - */ - - /** - * 让编辑器获得焦点,toEnd确定focus位置 - * @method focus - * @param { Boolean } toEnd 默认focus到编辑器头部,toEnd为true时focus到内容尾部 - * @example - * ```javascript - * editor.focus(true) - * ``` - */ - focus: function(toEnd) { - try { - var me = this, - rng = me.selection.getRange(); - if (toEnd) { - var node = me.body.lastChild; - if (node && node.nodeType == 1 && !dtd.$empty[node.tagName]) { - if (domUtils.isEmptyBlock(node)) { - rng.setStartAtFirst(node); - } else { - rng.setStartAtLast(node); - } - rng.collapse(true); - } - rng.setCursor(true); - } else { - if ( - !rng.collapsed && - domUtils.isBody(rng.startContainer) && - rng.startOffset == 0 - ) { - var node = me.body.firstChild; - if (node && node.nodeType == 1 && !dtd.$empty[node.tagName]) { - rng.setStartAtFirst(node).collapse(true); - } - } - - rng.select(true); - } - this.fireEvent("focus selectionchange"); - } catch (e) {} - }, - isFocus: function() { - return this.selection.isFocus(); - }, - blur: function() { - var sel = this.selection.getNative(); - if (sel.empty && browser.ie) { - var nativeRng = document.body.createTextRange(); - nativeRng.moveToElementText(document.body); - nativeRng.collapse(true); - nativeRng.select(); - sel.empty(); - } else { - sel.removeAllRanges(); - } - - //this.fireEvent('blur selectionchange'); - }, - /** - * 初始化UE事件及部分事件代理 - * @method _initEvents - * @private - */ - _initEvents: function() { - var me = this, - doc = me.document, - win = me.window; - me._proxyDomEvent = utils.bind(me._proxyDomEvent, me); - domUtils.on( - doc, - [ - "click", - "contextmenu", - "mousedown", - "keydown", - "keyup", - "keypress", - "mouseup", - "mouseover", - "mouseout", - "selectstart" - ], - me._proxyDomEvent - ); - domUtils.on(win, ["focus", "blur"], me._proxyDomEvent); - domUtils.on(me.body, "drop", function(e) { - //阻止ff下默认的弹出新页面打开图片 - if (browser.gecko && e.stopPropagation) { - e.stopPropagation(); - } - me.fireEvent("contentchange"); - }); - domUtils.on(doc, ["mouseup", "keydown"], function(evt) { - //特殊键不触发selectionchange - if ( - evt.type == "keydown" && - (evt.ctrlKey || evt.metaKey || evt.shiftKey || evt.altKey) - ) { - return; - } - if (evt.button == 2) return; - me._selectionChange(250, evt); - }); - }, - /** - * 触发事件代理 - * @method _proxyDomEvent - * @private - * @return { * } fireEvent的返回值 - * @see UE.EventBase:fireEvent(String) - */ - _proxyDomEvent: function(evt) { - if ( - this.fireEvent("before" + evt.type.replace(/^on/, "").toLowerCase()) === - false - ) { - return false; - } - if (this.fireEvent(evt.type.replace(/^on/, ""), evt) === false) { - return false; - } - return this.fireEvent( - "after" + evt.type.replace(/^on/, "").toLowerCase() - ); - }, - /** - * 变化选区 - * @method _selectionChange - * @private - */ - _selectionChange: function(delay, evt) { - var me = this; - //有光标才做selectionchange 为了解决未focus时点击source不能触发更改工具栏状态的问题(source命令notNeedUndo=1) - // if ( !me.selection.isFocus() ){ - // return; - // } - - var hackForMouseUp = false; - var mouseX, mouseY; - if (browser.ie && browser.version < 9 && evt && evt.type == "mouseup") { - var range = this.selection.getRange(); - if (!range.collapsed) { - hackForMouseUp = true; - mouseX = evt.clientX; - mouseY = evt.clientY; - } - } - clearTimeout(_selectionChangeTimer); - _selectionChangeTimer = setTimeout(function() { - if (!me.selection || !me.selection.getNative()) { - return; - } - //修复一个IE下的bug: 鼠标点击一段已选择的文本中间时,可能在mouseup后的一段时间内取到的range是在selection的type为None下的错误值. - //IE下如果用户是拖拽一段已选择文本,则不会触发mouseup事件,所以这里的特殊处理不会对其有影响 - var ieRange; - if (hackForMouseUp && me.selection.getNative().type == "None") { - ieRange = me.document.body.createTextRange(); - try { - ieRange.moveToPoint(mouseX, mouseY); - } catch (ex) { - ieRange = null; - } - } - var bakGetIERange; - if (ieRange) { - bakGetIERange = me.selection.getIERange; - me.selection.getIERange = function() { - return ieRange; - }; - } - me.selection.cache(); - if (bakGetIERange) { - me.selection.getIERange = bakGetIERange; - } - if (me.selection._cachedRange && me.selection._cachedStartElement) { - me.fireEvent("beforeselectionchange"); - // 第二个参数causeByUi为true代表由用户交互造成的selectionchange. - me.fireEvent("selectionchange", !!evt); - me.fireEvent("afterselectionchange"); - me.selection.clear(); - } - }, delay || 50); - }, - - /** - * 执行编辑命令 - * @method _callCmdFn - * @private - * @param { String } fnName 函数名称 - * @param { * } args 传给命令函数的参数 - * @return { * } 返回命令函数运行的返回值 - */ - _callCmdFn: function(fnName, args) { - var cmdName = args[0].toLowerCase(), - cmd, - cmdFn; - cmd = this.commands[cmdName] || UE.commands[cmdName]; - cmdFn = cmd && cmd[fnName]; - //没有querycommandstate或者没有command的都默认返回0 - if ((!cmd || !cmdFn) && fnName == "queryCommandState") { - return 0; - } else if (cmdFn) { - return cmdFn.apply(this, args); - } - }, - - /** - * 执行编辑命令cmdName,完成富文本编辑效果 - * @method execCommand - * @param { String } cmdName 需要执行的命令 - * @remind 具体命令的使用请参考命令列表 - * @return { * } 返回命令函数运行的返回值 - * @example - * ```javascript - * editor.execCommand(cmdName); - * ``` - */ - execCommand: function(cmdName) { - cmdName = cmdName.toLowerCase(); - var me = this; - var result; - var cmd = me.commands[cmdName] || UE.commands[cmdName]; - if (!cmd || !cmd.execCommand) { - return null; - } - if (!cmd.notNeedUndo && !me.__hasEnterExecCommand) { - me.__hasEnterExecCommand = true; - if (me.queryCommandState.apply(me, arguments) != -1) { - me.fireEvent("saveScene"); - me.fireEvent.apply( - me, - ["beforeexeccommand", cmdName].concat(arguments) - ); - result = this._callCmdFn("execCommand", arguments); - //保存场景时,做了内容对比,再看是否进行contentchange触发,这里多触发了一次,去掉 - // (!cmd.ignoreContentChange && !me._ignoreContentChange) && me.fireEvent('contentchange'); - me.fireEvent.apply( - me, - ["afterexeccommand", cmdName].concat(arguments) - ); - me.fireEvent("saveScene"); - } - me.__hasEnterExecCommand = false; - } else { - result = this._callCmdFn("execCommand", arguments); - !me.__hasEnterExecCommand && - !cmd.ignoreContentChange && - !me._ignoreContentChange && - me.fireEvent("contentchange"); - } - !me.__hasEnterExecCommand && - !cmd.ignoreContentChange && - !me._ignoreContentChange && - me._selectionChange(); - return result; - }, - - /** - * 根据传入的command命令,查选编辑器当前的选区,返回命令的状态 - * @method queryCommandState - * @param { String } cmdName 需要查询的命令名称 - * @remind 具体命令的使用请参考命令列表 - * @return { Number } number 返回放前命令的状态,返回值三种情况:(-1|0|1) - * @example - * ```javascript - * editor.queryCommandState(cmdName) => (-1|0|1) - * ``` - * @see COMMAND.LIST - */ - queryCommandState: function(cmdName) { - return this._callCmdFn("queryCommandState", arguments); - }, - - /** - * 根据传入的command命令,查选编辑器当前的选区,根据命令返回相关的值 - * @method queryCommandValue - * @param { String } cmdName 需要查询的命令名称 - * @remind 具体命令的使用请参考命令列表 - * @remind 只有部分插件有此方法 - * @return { * } 返回每个命令特定的当前状态值 - * @grammar editor.queryCommandValue(cmdName) => {*} - * @see COMMAND.LIST - */ - queryCommandValue: function(cmdName) { - return this._callCmdFn("queryCommandValue", arguments); - }, - - /** - * 检查编辑区域中是否有内容 - * @method hasContents - * @remind 默认有文本内容,或者有以下节点都不认为是空 - * table,ul,ol,dl,iframe,area,base,col,hr,img,embed,input,link,meta,param - * @return { Boolean } 检查有内容返回true,否则返回false - * @example - * ```javascript - * editor.hasContents() - * ``` - */ - - /** - * 检查编辑区域中是否有内容,若包含参数tags中的节点类型,直接返回true - * @method hasContents - * @param { Array } tags 传入数组判断时用到的节点类型 - * @return { Boolean } 若文档中包含tags数组里对应的tag,返回true,否则返回false - * @example - * ```javascript - * editor.hasContents(['span']); - * ``` - */ - hasContents: function(tags) { - if (tags) { - for (var i = 0, ci; (ci = tags[i++]); ) { - if (this.document.getElementsByTagName(ci).length > 0) { - return true; - } - } - } - if (!domUtils.isEmptyBlock(this.body)) { - return true; - } - //随时添加,定义的特殊标签如果存在,不能认为是空 - tags = ["div"]; - for (i = 0; (ci = tags[i++]); ) { - var nodes = domUtils.getElementsByTagName(this.document, ci); - for (var n = 0, cn; (cn = nodes[n++]); ) { - if (domUtils.isCustomeNode(cn)) { - return true; - } - } - } - return false; - }, - - /** - * 重置编辑器,可用来做多个tab使用同一个编辑器实例 - * @method reset - * @remind 此方法会清空编辑器内容,清空回退列表,会触发reset事件 - * @example - * ```javascript - * editor.reset() - * ``` - */ - reset: function() { - this.fireEvent("reset"); - }, - - /** - * 设置当前编辑区域可以编辑 - * @method setEnabled - * @example - * ```javascript - * editor.setEnabled() - * ``` - */ - setEnabled: function() { - var me = this, - range; - if (me.body.contentEditable == "false") { - me.body.contentEditable = true; - range = me.selection.getRange(); - //有可能内容丢失了 - try { - range.moveToBookmark(me.lastBk); - delete me.lastBk; - } catch (e) { - range.setStartAtFirst(me.body).collapse(true); - } - range.select(true); - if (me.bkqueryCommandState) { - me.queryCommandState = me.bkqueryCommandState; - delete me.bkqueryCommandState; - } - if (me.bkqueryCommandValue) { - me.queryCommandValue = me.bkqueryCommandValue; - delete me.bkqueryCommandValue; - } - me.fireEvent("selectionchange"); - } - }, - enable: function() { - return this.setEnabled(); - }, - - /** 设置当前编辑区域不可编辑 - * @method setDisabled - */ - - /** 设置当前编辑区域不可编辑,except中的命令除外 - * @method setDisabled - * @param { String } except 例外命令的字符串 - * @remind 即使设置了disable,此处配置的例外命令仍然可以执行 - * @example - * ```javascript - * editor.setDisabled('bold'); //禁用工具栏中除加粗之外的所有功能 - * ``` - */ - - /** 设置当前编辑区域不可编辑,except中的命令除外 - * @method setDisabled - * @param { Array } except 例外命令的字符串数组,数组中的命令仍然可以执行 - * @remind 即使设置了disable,此处配置的例外命令仍然可以执行 - * @example - * ```javascript - * editor.setDisabled(['bold','insertimage']); //禁用工具栏中除加粗和插入图片之外的所有功能 - * ``` - */ - setDisabled: function(except) { - var me = this; - except = except ? (utils.isArray(except) ? except : [except]) : []; - if (me.body.contentEditable == "true") { - if (!me.lastBk) { - me.lastBk = me.selection.getRange().createBookmark(true); - } - me.body.contentEditable = false; - me.bkqueryCommandState = me.queryCommandState; - me.bkqueryCommandValue = me.queryCommandValue; - me.queryCommandState = function(type) { - if (utils.indexOf(except, type) != -1) { - return me.bkqueryCommandState.apply(me, arguments); - } - return -1; - }; - me.queryCommandValue = function(type) { - if (utils.indexOf(except, type) != -1) { - return me.bkqueryCommandValue.apply(me, arguments); - } - return null; - }; - me.fireEvent("selectionchange"); - } - }, - disable: function(except) { - return this.setDisabled(except); - }, - - /** - * 设置默认内容 - * @method _setDefaultContent - * @private - * @param { String } cont 要存入的内容 - */ - _setDefaultContent: (function() { - function clear() { - var me = this; - if (me.document.getElementById("initContent")) { - me.body.innerHTML = "

                      " + (ie ? "" : "
                      ") + "

                      "; - me.removeListener("firstBeforeExecCommand focus", clear); - setTimeout(function() { - me.focus(); - me._selectionChange(); - }, 0); - } - } - - return function(cont) { - var me = this; - me.body.innerHTML = '

                      ' + cont + "

                      "; - - me.addListener("firstBeforeExecCommand focus", clear); - }; - })(), - - /** - * 显示编辑器 - * @method setShow - * @example - * ```javascript - * editor.setShow() - * ``` - */ - setShow: function() { - var me = this, - range = me.selection.getRange(); - if (me.container.style.display == "none") { - //有可能内容丢失了 - try { - range.moveToBookmark(me.lastBk); - delete me.lastBk; - } catch (e) { - range.setStartAtFirst(me.body).collapse(true); - } - //ie下focus实效,所以做了个延迟 - setTimeout(function() { - range.select(true); - }, 100); - me.container.style.display = ""; - } - }, - show: function() { - return this.setShow(); - }, - /** - * 隐藏编辑器 - * @method setHide - * @example - * ```javascript - * editor.setHide() - * ``` - */ - setHide: function() { - var me = this; - if (!me.lastBk) { - me.lastBk = me.selection.getRange().createBookmark(true); - } - me.container.style.display = "none"; - }, - hide: function() { - return this.setHide(); - }, - - /** - * 根据指定的路径,获取对应的语言资源 - * @method getLang - * @param { String } path 路径根据的是lang目录下的语言文件的路径结构 - * @return { Object | String } 根据路径返回语言资源的Json格式对象或者语言字符串 - * @example - * ```javascript - * editor.getLang('contextMenu.delete'); //如果当前是中文,那返回是的是'删除' - * ``` - */ - getLang: function(path) { - var lang = UE.I18N[this.options.lang]; - if (!lang) { - throw Error("not import language file"); - } - path = (path || "").split("."); - for (var i = 0, ci; (ci = path[i++]); ) { - lang = lang[ci]; - if (!lang) break; - } - return lang; - }, - - /** - * 计算编辑器html内容字符串的长度 - * @method getContentLength - * @return { Number } 返回计算的长度 - * @example - * ```javascript - * //编辑器html内容

                      132

                      - * editor.getContentLength() //返回27 - * ``` - */ - /** - * 计算编辑器当前纯文本内容的长度 - * @method getContentLength - * @param { Boolean } ingoneHtml 传入true时,只按照纯文本来计算 - * @return { Number } 返回计算的长度,内容中有hr/img/iframe标签,长度加1 - * @example - * ```javascript - * //编辑器html内容

                      132

                      - * editor.getContentLength() //返回3 - * ``` - */ - getContentLength: function(ingoneHtml, tagNames) { - var count = this.getContent(false, false, true).length; - if (ingoneHtml) { - tagNames = (tagNames || []).concat(["hr", "img", "iframe"]); - count = this.getContentTxt().replace(/[\t\r\n]+/g, "").length; - for (var i = 0, ci; (ci = tagNames[i++]); ) { - count += this.document.getElementsByTagName(ci).length; - } - } - return count; - }, - - /** - * 注册输入过滤规则 - * @method addInputRule - * @param { Function } rule 要添加的过滤规则 - * @example - * ```javascript - * editor.addInputRule(function(root){ - * $.each(root.getNodesByTagName('div'),function(i,node){ - * node.tagName="p"; - * }); - * }); - * ``` - */ - addInputRule: function(rule) { - this.inputRules.push(rule); - }, - - /** - * 执行注册的过滤规则 - * @method filterInputRule - * @param { UE.uNode } root 要过滤的uNode节点 - * @remind 执行editor.setContent方法和执行'inserthtml'命令后,会运行该过滤函数 - * @example - * ```javascript - * editor.filterInputRule(editor.body); - * ``` - * @see UE.Editor:addInputRule - */ - filterInputRule: function(root) { - for (var i = 0, ci; (ci = this.inputRules[i++]); ) { - ci.call(this, root); - } - }, - - /** - * 注册输出过滤规则 - * @method addOutputRule - * @param { Function } rule 要添加的过滤规则 - * @example - * ```javascript - * editor.addOutputRule(function(root){ - * $.each(root.getNodesByTagName('p'),function(i,node){ - * node.tagName="div"; - * }); - * }); - * ``` - */ - addOutputRule: function(rule) { - this.outputRules.push(rule); - }, - - /** - * 根据输出过滤规则,过滤编辑器内容 - * @method filterOutputRule - * @remind 执行editor.getContent方法的时候,会先运行该过滤函数 - * @param { UE.uNode } root 要过滤的uNode节点 - * @example - * ```javascript - * editor.filterOutputRule(editor.body); - * ``` - * @see UE.Editor:addOutputRule - */ - filterOutputRule: function(root) { - for (var i = 0, ci; (ci = this.outputRules[i++]); ) { - ci.call(this, root); - } - }, - - /** - * 根据action名称获取请求的路径 - * @method getActionUrl - * @remind 假如没有设置serverUrl,会根据imageUrl设置默认的controller路径 - * @param { String } action action名称 - * @example - * ```javascript - * editor.getActionUrl('config'); //返回 "/ueditor/php/controller.php?action=config" - * editor.getActionUrl('image'); //返回 "/ueditor/php/controller.php?action=uplaodimage" - * editor.getActionUrl('scrawl'); //返回 "/ueditor/php/controller.php?action=uplaodscrawl" - * editor.getActionUrl('imageManager'); //返回 "/ueditor/php/controller.php?action=listimage" - * ``` - */ - getActionUrl: function(action) { - var actionName = this.getOpt(action) || action, - imageUrl = this.getOpt("imageUrl"), - serverUrl = this.getOpt("serverUrl"); - /* if (!serverUrl && imageUrl) { - serverUrl = imageUrl.replace(/^(.*[\/]).+([\.].+)$/, "$1controller$2"); - } - - if (serverUrl) { - serverUrl = - serverUrl + - (serverUrl.indexOf("?") == -1 ? "?" : "&") + - "action=" + - (actionName || ""); - return utils.formatUrl(serverUrl); - } else { - return ""; - } */ - - if (serverUrl) { - serverUrl = serverUrl + "?"; - return utils.formatUrl(serverUrl); - } else { - return ""; - } - } - }; - utils.inherits(Editor, EventBase); -})(); - - -// core/Editor.defaultoptions.js -//维护编辑器一下默认的不在插件中的配置项 -UE.Editor.defaultOptions = function(editor) { - var _url = editor.options.UEDITOR_HOME_URL; - return { - isShow: true, - initialContent: "", - initialStyle: "", - autoClearinitialContent: false, - iframeCssUrl: _url + "themes/iframe.css", - textarea: "editorValue", - focus: false, - focusInEnd: true, - autoClearEmptyNode: true, - fullscreen: false, - readonly: false, - zIndex: 999, - imagePopup: true, - enterTag: "p", - customDomain: false, - lang: "zh-cn", - langPath: _url + "i18n/", - theme: "default", - themePath: _url + "themes/", - allHtmlEnabled: false, - scaleEnabled: false, - tableNativeEditInFF: false, - autoSyncData: true, - fileNameFormat: "{time}{rand:6}" - }; -}; - - -// core/loadconfig.js -;(function() { - UE.Editor.prototype.loadServerConfig = function() { - var me = this; - setTimeout(function() { - try { - me.options.imageUrl && - me.setOpt( - "serverUrl", - me.options.imageUrl.replace( - /^(.*[\/]).+([\.].+)$/, - "$1controller$2" - ) - ); - - var configUrl = me.getActionUrl("config"), - isJsonp = utils.isCrossDomainUrl(configUrl); - - /* 发出ajax请求 */ - me._serverConfigLoaded = false; - - configUrl && - UE.ajax.request(configUrl, { - method: "GET", - dataType: isJsonp ? "jsonp" : "", - onsuccess: function(r) { - try { - var config = isJsonp ? r : eval("(" + r.responseText + ")"); - utils.extend(me.options, config); - me.fireEvent("serverConfigLoaded"); - me._serverConfigLoaded = true; - } catch (e) { - showErrorMsg(me.getLang("loadconfigFormatError")); - } - }, - onerror: function() { - showErrorMsg(me.getLang("loadconfigHttpError")); - } - }); - } catch (e) { - showErrorMsg(me.getLang("loadconfigError")); - } - }); - - function showErrorMsg(msg) { - console && console.error(msg); - //me.fireEvent('showMessage', { - // 'title': msg, - // 'type': 'error' - //}); - } - }; - - UE.Editor.prototype.isServerConfigLoaded = function() { - var me = this; - return me._serverConfigLoaded || false; - }; - - UE.Editor.prototype.afterConfigReady = function(handler) { - if (!handler || !utils.isFunction(handler)) return; - var me = this; - var readyHandler = function() { - handler.apply(me, arguments); - me.removeListener("serverConfigLoaded", readyHandler); - }; - - if (me.isServerConfigLoaded()) { - handler.call(me, "serverConfigLoaded"); - } else { - me.addListener("serverConfigLoaded", readyHandler); - } - }; -})(); - - -// core/ajax.js -/** - * @file - * @module UE.ajax - * @since 1.2.6.1 - */ - -/** - * 提供对ajax请求的支持 - * @module UE.ajax - */ -UE.ajax = (function() { - //创建一个ajaxRequest对象 - var fnStr = "XMLHttpRequest()"; - try { - new ActiveXObject("Msxml2.XMLHTTP"); - fnStr = "ActiveXObject('Msxml2.XMLHTTP')"; - } catch (e) { - try { - new ActiveXObject("Microsoft.XMLHTTP"); - fnStr = "ActiveXObject('Microsoft.XMLHTTP')"; - } catch (e) {} - } - var creatAjaxRequest = new Function("return new " + fnStr); - - /** - * 将json参数转化成适合ajax提交的参数列表 - * @param json - */ - function json2str(json) { - var strArr = []; - for (var i in json) { - //忽略默认的几个参数 - if ( - i == "method" || - i == "timeout" || - i == "async" || - i == "dataType" || - i == "callback" - ) - continue; - //忽略控制 - if (json[i] == undefined || json[i] == null) continue; - //传递过来的对象和函数不在提交之列 - if ( - !( - (typeof json[i]).toLowerCase() == "function" || - (typeof json[i]).toLowerCase() == "object" - ) - ) { - strArr.push(encodeURIComponent(i) + "=" + encodeURIComponent(json[i])); - } else if (utils.isArray(json[i])) { - //支持传数组内容 - for (var j = 0; j < json[i].length; j++) { - strArr.push( - encodeURIComponent(i) + "[]=" + encodeURIComponent(json[i][j]) - ); - } - } - } - return strArr.join("&"); - } - - function doAjax(url, ajaxOptions) { - var xhr = creatAjaxRequest(), - //是否超时 - timeIsOut = false, - //默认参数 - defaultAjaxOptions = { - method: "POST", - timeout: 5000, - async: true, - data: {}, //需要传递对象的话只能覆盖 - onsuccess: function() {}, - onerror: function() {} - }; - - if (typeof url === "object") { - ajaxOptions = url; - url = ajaxOptions.url; - } - if (!xhr || !url) return; - var ajaxOpts = ajaxOptions - ? utils.extend(defaultAjaxOptions, ajaxOptions) - : defaultAjaxOptions; - - var submitStr = json2str(ajaxOpts); // { name:"Jim",city:"Beijing" } --> "name=Jim&city=Beijing" - //如果用户直接通过data参数传递json对象过来,则也要将此json对象转化为字符串 - if (!utils.isEmptyObject(ajaxOpts.data)) { - submitStr += (submitStr ? "&" : "") + json2str(ajaxOpts.data); - } - //超时检测 - var timerID = setTimeout(function() { - if (xhr.readyState != 4) { - timeIsOut = true; - xhr.abort(); - clearTimeout(timerID); - } - }, ajaxOpts.timeout); - - var method = ajaxOpts.method.toUpperCase(); - var str = - url + - (url.indexOf("?") == -1 ? "?" : "&") + - (method == "POST" ? "" : submitStr + "&noCache=" + +new Date()); - xhr.open(method, str, ajaxOpts.async); - xhr.onreadystatechange = function() { - if (xhr.readyState == 4) { - if (!timeIsOut && xhr.status == 200) { - ajaxOpts.onsuccess(xhr); - } else { - ajaxOpts.onerror(xhr); - } - } - }; - if (method == "POST") { - xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - xhr.send(submitStr); - } else { - xhr.send(null); - } - } - - function doJsonp(url, opts) { - var successhandler = opts.onsuccess || function() {}, - scr = document.createElement("SCRIPT"), - options = opts || {}, - charset = options["charset"], - callbackField = options["jsonp"] || "callback", - callbackFnName, - timeOut = options["timeOut"] || 0, - timer, - reg = new RegExp("(\\?|&)" + callbackField + "=([^&]*)"), - matches; - - if (utils.isFunction(successhandler)) { - callbackFnName = - "bd__editor__" + Math.floor(Math.random() * 2147483648).toString(36); - window[callbackFnName] = getCallBack(0); - } else if (utils.isString(successhandler)) { - callbackFnName = successhandler; - } else { - if ((matches = reg.exec(url))) { - callbackFnName = matches[2]; - } - } - - url = url.replace(reg, "\x241" + callbackField + "=" + callbackFnName); - - if (url.search(reg) < 0) { - url += - (url.indexOf("?") < 0 ? "?" : "&") + - callbackField + - "=" + - callbackFnName; - } - - var queryStr = json2str(opts); // { name:"Jim",city:"Beijing" } --> "name=Jim&city=Beijing" - //如果用户直接通过data参数传递json对象过来,则也要将此json对象转化为字符串 - if (!utils.isEmptyObject(opts.data)) { - queryStr += (queryStr ? "&" : "") + json2str(opts.data); - } - if (queryStr) { - url = url.replace(/\?/, "?" + queryStr + "&"); - } - - scr.onerror = getCallBack(1); - if (timeOut) { - timer = setTimeout(getCallBack(1), timeOut); - } - createScriptTag(scr, url, charset); - - function createScriptTag(scr, url, charset) { - scr.setAttribute("type", "text/javascript"); - scr.setAttribute("defer", "defer"); - charset && scr.setAttribute("charset", charset); - scr.setAttribute("src", url); - document.getElementsByTagName("head")[0].appendChild(scr); - } - - function getCallBack(onTimeOut) { - return function() { - try { - if (onTimeOut) { - options.onerror && options.onerror(); - } else { - try { - clearTimeout(timer); - successhandler.apply(window, arguments); - } catch (e) {} - } - } catch (exception) { - options.onerror && options.onerror.call(window, exception); - } finally { - options.oncomplete && options.oncomplete.apply(window, arguments); - scr.parentNode && scr.parentNode.removeChild(scr); - window[callbackFnName] = null; - try { - delete window[callbackFnName]; - } catch (e) {} - } - }; - } - } - - return { - /** - * 根据给定的参数项,向指定的url发起一个ajax请求。 ajax请求完成后,会根据请求结果调用相应回调: 如果请求 - * 成功, 则调用onsuccess回调, 失败则调用 onerror 回调 - * @method request - * @param { URLString } url ajax请求的url地址 - * @param { Object } ajaxOptions ajax请求选项的键值对,支持的选项如下: - * @example - * ```javascript - * //向sayhello.php发起一个异步的Ajax GET请求, 请求超时时间为10s, 请求完成后执行相应的回调。 - * UE.ajax.requeset( 'sayhello.php', { - * - * //请求方法。可选值: 'GET', 'POST',默认值是'POST' - * method: 'GET', - * - * //超时时间。 默认为5000, 单位是ms - * timeout: 10000, - * - * //是否是异步请求。 true为异步请求, false为同步请求 - * async: true, - * - * //请求携带的数据。如果请求为GET请求, data会经过stringify后附加到请求url之后。 - * data: { - * name: 'neditor' - * }, - * - * //请求成功后的回调, 该回调接受当前的XMLHttpRequest对象作为参数。 - * onsuccess: function ( xhr ) { - * console.log( xhr.responseText ); - * }, - * - * //请求失败或者超时后的回调。 - * onerror: function ( xhr ) { - * alert( 'Ajax请求失败' ); - * } - * - * } ); - * ``` - */ - - /** - * 根据给定的参数项发起一个ajax请求, 参数项里必须包含一个url地址。 ajax请求完成后,会根据请求结果调用相应回调: 如果请求 - * 成功, 则调用onsuccess回调, 失败则调用 onerror 回调。 - * @method request - * @warning 如果在参数项里未提供一个key为“url”的地址值,则该请求将直接退出。 - * @param { Object } ajaxOptions ajax请求选项的键值对,支持的选项如下: - * @example - * ```javascript - * - * //向sayhello.php发起一个异步的Ajax POST请求, 请求超时时间为5s, 请求完成后不执行任何回调。 - * UE.ajax.requeset( 'sayhello.php', { - * - * //请求的地址, 该项是必须的。 - * url: 'sayhello.php' - * - * } ); - * ``` - */ - request: function(url, opts) { - if (opts && opts.dataType == "jsonp") { - doJsonp(url, opts); - } else { - doAjax(url, opts); - } - }, - getJSONP: function(url, data, fn) { - var opts = { - data: data, - oncomplete: fn - }; - doJsonp(url, opts); - } - }; -})(); - - -// core/filterword.js -/** - * UE过滤word的静态方法 - * @file - */ - -/** - * UEditor公用空间,UEditor所有的功能都挂载在该空间下 - * @module UE - */ - -/** - * 根据传入html字符串过滤word - * @module UE - * @since 1.2.6.1 - * @method filterWord - * @param { String } html html字符串 - * @return { String } 已过滤后的结果字符串 - * @example - * ```javascript - * UE.filterWord(html); - * ``` - */ -var filterWord = (UE.filterWord = (function() { - //是否是word过来的内容 - function isWordDocument(str) { - return /(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<(v|o):|lang=)/gi.test( - str - ); - } - //去掉小数 - function transUnit(v) { - v = v.replace(/[\d.]+\w+/g, function(m) { - return utils.transUnitToPx(m); - }); - return v; - } - - function filterPasteWord(str) { - return ( - str - .replace(/[\t\r\n]+/g, " ") - .replace(//gi, "") - //转换图片 - .replace(/]*>[\s\S]*?.<\/v:shape>/gi, function(str) { - //opera能自己解析出image所这里直接返回空 - if (browser.opera) { - return ""; - } - try { - //有可能是bitmap占为图,无用,直接过滤掉,主要体现在粘贴excel表格中 - if (/Bitmap/i.test(str)) { - return ""; - } - var width = str.match(/width:([ \d.]*p[tx])/i)[1], - height = str.match(/height:([ \d.]*p[tx])/i)[1], - src = str.match(/src=\s*"([^"]*)"/i)[1]; - return ( - '' - ); - } catch (e) { - return ""; - } - }) - //针对wps添加的多余标签处理 - .replace(/<\/?div[^>]*>/g, "") - //去掉多余的属性 - .replace(/v:\w+=(["']?)[^'"]+\1/g, "") - .replace( - /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi, - "" - ) - .replace( - /

                      ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, - "

                      $1

                      " - ) - //去掉多余的属性 - .replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/gi, function( - str, - name, - marks, - val - ) { - //保留list的标示 - return name == "class" && val == "MsoListParagraph" ? str : ""; - }) - //清除多余的font/span不能匹配 有可能是空格 - .replace(/<(font|span)[^>]*>(\s*)<\/\1>/gi, function(a, b, c) { - return c.replace(/[\t\r\n ]+/g, " "); - }) - //处理style的问题 - .replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi, function( - str, - tag, - tmp, - style - ) { - var n = [], - s = style - .replace(/^\s+|\s+$/, "") - .replace(/'/g, "'") - .replace(/"/gi, "'") - .replace(/[\d.]+(cm|pt)/g, function(str) { - return utils.transUnitToPx(str); - }) - .split(/;\s*/g); - - for (var i = 0, v; (v = s[i]); i++) { - var name, - value, - parts = v.split(":"); - - if (parts.length == 2) { - name = parts[0].toLowerCase(); - value = parts[1].toLowerCase(); - if ( - (/^(background)\w*/.test(name) && - value.replace(/(initial|\s)/g, "").length == 0) || - (/^(margin)\w*/.test(name) && /^0\w+$/.test(value)) - ) { - continue; - } - - switch (name) { - case "mso-padding-alt": - case "mso-padding-top-alt": - case "mso-padding-right-alt": - case "mso-padding-bottom-alt": - case "mso-padding-left-alt": - case "mso-margin-alt": - case "mso-margin-top-alt": - case "mso-margin-right-alt": - case "mso-margin-bottom-alt": - case "mso-margin-left-alt": - //ie下会出现挤到一起的情况 - //case "mso-table-layout-alt": - case "mso-height": - case "mso-width": - case "mso-vertical-align-alt": - //trace:1819 ff下会解析出padding在table上 - if (!/]/.test(html)) { - return UE.htmlparser(html).children[0]; - } else { - return new uNode({ - type: "element", - children: [], - tagName: html - }); - } - }; - uNode.createText = function(data, noTrans) { - return new UE.uNode({ - type: "text", - data: noTrans ? data : utils.unhtml(data || "") - }); - }; - function nodeToHtml(node, arr, formatter, current) { - switch (node.type) { - case "root": - for (var i = 0, ci; (ci = node.children[i++]); ) { - //插入新行 - if ( - formatter && - ci.type == "element" && - !dtd.$inlineWithA[ci.tagName] && - i > 1 - ) { - insertLine(arr, current, true); - insertIndent(arr, current); - } - nodeToHtml(ci, arr, formatter, current); - } - break; - case "text": - isText(node, arr); - break; - case "element": - isElement(node, arr, formatter, current); - break; - case "comment": - isComment(node, arr, formatter); - } - return arr; - } - - function isText(node, arr) { - if (node.parentNode.tagName == "pre") { - //源码模式下输入html标签,不能做转换处理,直接输出 - arr.push(node.data); - } else { - arr.push( - notTransTagName[node.parentNode.tagName] - ? utils.html(node.data) - : node.data.replace(/[ ]{2}/g, "  ") - ); - } - } - - function isElement(node, arr, formatter, current) { - var attrhtml = ""; - if (node.attrs) { - attrhtml = []; - var attrs = node.attrs; - for (var a in attrs) { - //这里就针对 - //

                      '

                      - //这里边的\"做转换,要不用innerHTML直接被截断了,属性src - //有可能做的不够 - attrhtml.push( - a + - (attrs[a] !== undefined - ? '="' + - (notTransAttrs[a] - ? utils.html(attrs[a]).replace(/["]/g, function(a) { - return """; - }) - : utils.unhtml(attrs[a])) + - '"' - : "") - ); - } - attrhtml = attrhtml.join(" "); - } - arr.push( - "<" + - node.tagName + - (attrhtml ? " " + attrhtml : "") + - (dtd.$empty[node.tagName] ? "/" : "") + - ">" - ); - //插入新行 - if (formatter && !dtd.$inlineWithA[node.tagName] && node.tagName != "pre") { - if (node.children && node.children.length) { - current = insertLine(arr, current, true); - insertIndent(arr, current); - } - } - if (node.children && node.children.length) { - for (var i = 0, ci; (ci = node.children[i++]); ) { - if ( - formatter && - ci.type == "element" && - !dtd.$inlineWithA[ci.tagName] && - i > 1 - ) { - insertLine(arr, current); - insertIndent(arr, current); - } - nodeToHtml(ci, arr, formatter, current); - } - } - if (!dtd.$empty[node.tagName]) { - if ( - formatter && - !dtd.$inlineWithA[node.tagName] && - node.tagName != "pre" - ) { - if (node.children && node.children.length) { - current = insertLine(arr, current); - insertIndent(arr, current); - } - } - arr.push(""); - } - } - - function isComment(node, arr) { - arr.push(""); - } - - function getNodeById(root, id) { - var node; - if (root.type == "element" && root.getAttr("id") == id) { - return root; - } - if (root.children && root.children.length) { - for (var i = 0, ci; (ci = root.children[i++]); ) { - if ((node = getNodeById(ci, id))) { - return node; - } - } - } - } - - function getNodesByTagName(node, tagName, arr) { - if (node.type == "element" && node.tagName == tagName) { - arr.push(node); - } - if (node.children && node.children.length) { - for (var i = 0, ci; (ci = node.children[i++]); ) { - getNodesByTagName(ci, tagName, arr); - } - } - } - function nodeTraversal(root, fn) { - if (root.children && root.children.length) { - for (var i = 0, ci; (ci = root.children[i]); ) { - nodeTraversal(ci, fn); - //ci被替换的情况,这里就不再走 fn了 - if (ci.parentNode) { - if (ci.children && ci.children.length) { - fn(ci); - } - if (ci.parentNode) i++; - } - } - } else { - fn(root); - } - } - uNode.prototype = { - /** - * 当前节点对象,转换成html文本 - * @method toHtml - * @return { String } 返回转换后的html字符串 - * @example - * ```javascript - * node.toHtml(); - * ``` - */ - - /** - * 当前节点对象,转换成html文本 - * @method toHtml - * @param { Boolean } formatter 是否格式化返回值 - * @return { String } 返回转换后的html字符串 - * @example - * ```javascript - * node.toHtml( true ); - * ``` - */ - toHtml: function(formatter) { - var arr = []; - nodeToHtml(this, arr, formatter, 0); - return arr.join(""); - }, - - /** - * 获取节点的html内容 - * @method innerHTML - * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 - * @return { String } 返回节点的html内容 - * @example - * ```javascript - * var htmlstr = node.innerHTML(); - * ``` - */ - - /** - * 设置节点的html内容 - * @method innerHTML - * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 - * @param { String } htmlstr 传入要设置的html内容 - * @return { UE.uNode } 返回节点本身 - * @example - * ```javascript - * node.innerHTML('text'); - * ``` - */ - innerHTML: function(htmlstr) { - if (this.type != "element" || dtd.$empty[this.tagName]) { - return this; - } - if (utils.isString(htmlstr)) { - if (this.children) { - for (var i = 0, ci; (ci = this.children[i++]); ) { - ci.parentNode = null; - } - } - this.children = []; - var tmpRoot = UE.htmlparser(htmlstr); - for (var i = 0, ci; (ci = tmpRoot.children[i++]); ) { - this.children.push(ci); - ci.parentNode = this; - } - return this; - } else { - var tmpRoot = new UE.uNode({ - type: "root", - children: this.children - }); - return tmpRoot.toHtml(); - } - }, - - /** - * 获取节点的纯文本内容 - * @method innerText - * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 - * @return { String } 返回节点的存文本内容 - * @example - * ```javascript - * var textStr = node.innerText(); - * ``` - */ - - /** - * 设置节点的纯文本内容 - * @method innerText - * @warning 假如节点的type不是'element',或节点的标签名称不在dtd列表里,直接返回当前节点 - * @param { String } textStr 传入要设置的文本内容 - * @return { UE.uNode } 返回节点本身 - * @example - * ```javascript - * node.innerText('text'); - * ``` - */ - innerText: function(textStr, noTrans) { - if (this.type != "element" || dtd.$empty[this.tagName]) { - return this; - } - if (textStr) { - if (this.children) { - for (var i = 0, ci; (ci = this.children[i++]); ) { - ci.parentNode = null; - } - } - this.children = []; - this.appendChild(uNode.createText(textStr, noTrans)); - return this; - } else { - return this.toHtml().replace(/<[^>]+>/g, ""); - } - }, - - /** - * 获取当前对象的data属性 - * @method getData - * @return { Object } 若节点的type值是elemenet,返回空字符串,否则返回节点的data属性 - * @example - * ```javascript - * node.getData(); - * ``` - */ - getData: function() { - if (this.type == "element") return ""; - return this.data; - }, - - /** - * 获取当前节点下的第一个子节点 - * @method firstChild - * @return { UE.uNode } 返回第一个子节点 - * @example - * ```javascript - * node.firstChild(); //返回第一个子节点 - * ``` - */ - firstChild: function() { - // if (this.type != 'element' || dtd.$empty[this.tagName]) { - // return this; - // } - return this.children ? this.children[0] : null; - }, - - /** - * 获取当前节点下的最后一个子节点 - * @method lastChild - * @return { UE.uNode } 返回最后一个子节点 - * @example - * ```javascript - * node.lastChild(); //返回最后一个子节点 - * ``` - */ - lastChild: function() { - // if (this.type != 'element' || dtd.$empty[this.tagName] ) { - // return this; - // } - return this.children ? this.children[this.children.length - 1] : null; - }, - - /** - * 获取和当前节点有相同父亲节点的前一个节点 - * @method previousSibling - * @return { UE.uNode } 返回前一个节点 - * @example - * ```javascript - * node.children[2].previousSibling(); //返回子节点node.children[1] - * ``` - */ - previousSibling: function() { - var parent = this.parentNode; - for (var i = 0, ci; (ci = parent.children[i]); i++) { - if (ci === this) { - return i == 0 ? null : parent.children[i - 1]; - } - } - }, - - /** - * 获取和当前节点有相同父亲节点的后一个节点 - * @method nextSibling - * @return { UE.uNode } 返回后一个节点,找不到返回null - * @example - * ```javascript - * node.children[2].nextSibling(); //如果有,返回子节点node.children[3] - * ``` - */ - nextSibling: function() { - var parent = this.parentNode; - for (var i = 0, ci; (ci = parent.children[i++]); ) { - if (ci === this) { - return parent.children[i]; - } - } - }, - - /** - * 用新的节点替换当前节点 - * @method replaceChild - * @param { UE.uNode } target 要替换成该节点参数 - * @param { UE.uNode } source 要被替换掉的节点 - * @return { UE.uNode } 返回替换之后的节点对象 - * @example - * ```javascript - * node.replaceChild(newNode, childNode); //用newNode替换childNode,childNode是node的子节点 - * ``` - */ - replaceChild: function(target, source) { - if (this.children) { - if (target.parentNode) { - target.parentNode.removeChild(target); - } - for (var i = 0, ci; (ci = this.children[i]); i++) { - if (ci === source) { - this.children.splice(i, 1, target); - source.parentNode = null; - target.parentNode = this; - return target; - } - } - } - }, - - /** - * 在节点的子节点列表最后位置插入一个节点 - * @method appendChild - * @param { UE.uNode } node 要插入的节点 - * @return { UE.uNode } 返回刚插入的子节点 - * @example - * ```javascript - * node.appendChild( newNode ); //在node内插入子节点newNode - * ``` - */ - appendChild: function(node) { - if ( - this.type == "root" || - (this.type == "element" && !dtd.$empty[this.tagName]) - ) { - if (!this.children) { - this.children = []; - } - if (node.parentNode) { - node.parentNode.removeChild(node); - } - for (var i = 0, ci; (ci = this.children[i]); i++) { - if (ci === node) { - this.children.splice(i, 1); - break; - } - } - this.children.push(node); - node.parentNode = this; - return node; - } - }, - - /** - * 在传入节点的前面插入一个节点 - * @method insertBefore - * @param { UE.uNode } target 要插入的节点 - * @param { UE.uNode } source 在该参数节点前面插入 - * @return { UE.uNode } 返回刚插入的子节点 - * @example - * ```javascript - * node.parentNode.insertBefore(newNode, node); //在node节点后面插入newNode - * ``` - */ - insertBefore: function(target, source) { - if (this.children) { - if (target.parentNode) { - target.parentNode.removeChild(target); - } - for (var i = 0, ci; (ci = this.children[i]); i++) { - if (ci === source) { - this.children.splice(i, 0, target); - target.parentNode = this; - return target; - } - } - } - }, - - /** - * 在传入节点的后面插入一个节点 - * @method insertAfter - * @param { UE.uNode } target 要插入的节点 - * @param { UE.uNode } source 在该参数节点后面插入 - * @return { UE.uNode } 返回刚插入的子节点 - * @example - * ```javascript - * node.parentNode.insertAfter(newNode, node); //在node节点后面插入newNode - * ``` - */ - insertAfter: function(target, source) { - if (this.children) { - if (target.parentNode) { - target.parentNode.removeChild(target); - } - for (var i = 0, ci; (ci = this.children[i]); i++) { - if (ci === source) { - this.children.splice(i + 1, 0, target); - target.parentNode = this; - return target; - } - } - } - }, - - /** - * 从当前节点的子节点列表中,移除节点 - * @method removeChild - * @param { UE.uNode } node 要移除的节点引用 - * @param { Boolean } keepChildren 是否保留移除节点的子节点,若传入true,自动把移除节点的子节点插入到移除的位置 - * @return { * } 返回刚移除的子节点 - * @example - * ```javascript - * node.removeChild(childNode,true); //在node的子节点列表中移除child节点,并且吧child的子节点插入到移除的位置 - * ``` - */ - removeChild: function(node, keepChildren) { - if (this.children) { - for (var i = 0, ci; (ci = this.children[i]); i++) { - if (ci === node) { - this.children.splice(i, 1); - ci.parentNode = null; - if (keepChildren && ci.children && ci.children.length) { - for (var j = 0, cj; (cj = ci.children[j]); j++) { - this.children.splice(i + j, 0, cj); - cj.parentNode = this; - } - } - return ci; - } - } - } - }, - - /** - * 获取当前节点所代表的元素属性,即获取attrs对象下的属性值 - * @method getAttr - * @param { String } attrName 要获取的属性名称 - * @return { * } 返回attrs对象下的属性值 - * @example - * ```javascript - * node.getAttr('title'); - * ``` - */ - getAttr: function(attrName) { - return this.attrs && this.attrs[attrName.toLowerCase()]; - }, - - /** - * 设置当前节点所代表的元素属性,即设置attrs对象下的属性值 - * @method setAttr - * @param { String } attrName 要设置的属性名称 - * @param { * } attrVal 要设置的属性值,类型视设置的属性而定 - * @return { * } 返回attrs对象下的属性值 - * @example - * ```javascript - * node.setAttr('title','标题'); - * ``` - */ - setAttr: function(attrName, attrVal) { - if (!attrName) { - delete this.attrs; - return; - } - if (!this.attrs) { - this.attrs = {}; - } - if (utils.isObject(attrName)) { - for (var a in attrName) { - if (!attrName[a]) { - delete this.attrs[a]; - } else { - this.attrs[a.toLowerCase()] = attrName[a]; - } - } - } else { - if (!attrVal) { - delete this.attrs[attrName]; - } else { - this.attrs[attrName.toLowerCase()] = attrVal; - } - } - }, - - /** - * 获取当前节点在父节点下的位置索引 - * @method getIndex - * @return { Number } 返回索引数值,如果没有父节点,返回-1 - * @example - * ```javascript - * node.getIndex(); - * ``` - */ - getIndex: function() { - var parent = this.parentNode; - for (var i = 0, ci; (ci = parent.children[i]); i++) { - if (ci === this) { - return i; - } - } - return -1; - }, - - /** - * 在当前节点下,根据id查找节点 - * @method getNodeById - * @param { String } id 要查找的id - * @return { UE.uNode } 返回找到的节点 - * @example - * ```javascript - * node.getNodeById('textId'); - * ``` - */ - getNodeById: function(id) { - var node; - if (this.children && this.children.length) { - for (var i = 0, ci; (ci = this.children[i++]); ) { - if ((node = getNodeById(ci, id))) { - return node; - } - } - } - }, - - /** - * 在当前节点下,根据元素名称查找节点列表 - * @method getNodesByTagName - * @param { String } tagNames 要查找的元素名称 - * @return { Array } 返回找到的节点列表 - * @example - * ```javascript - * node.getNodesByTagName('span'); - * ``` - */ - getNodesByTagName: function(tagNames) { - tagNames = utils.trim(tagNames).replace(/[ ]{2,}/g, " ").split(" "); - var arr = [], - me = this; - utils.each(tagNames, function(tagName) { - if (me.children && me.children.length) { - for (var i = 0, ci; (ci = me.children[i++]); ) { - getNodesByTagName(ci, tagName, arr); - } - } - }); - return arr; - }, - - /** - * 根据样式名称,获取节点的样式值 - * @method getStyle - * @param { String } name 要获取的样式名称 - * @return { String } 返回样式值 - * @example - * ```javascript - * node.getStyle('font-size'); - * ``` - */ - getStyle: function(name) { - var cssStyle = this.getAttr("style"); - if (!cssStyle) { - return ""; - } - var reg = new RegExp("(^|;)\\s*" + name + ":([^;]+)", "i"); - var match = cssStyle.match(reg); - if (match && match[0]) { - return match[2]; - } - return ""; - }, - - /** - * 给节点设置样式 - * @method setStyle - * @param { String } name 要设置的的样式名称 - * @param { String } val 要设置的的样值 - * @example - * ```javascript - * node.setStyle('font-size', '12px'); - * ``` - */ - setStyle: function(name, val) { - function exec(name, val) { - var reg = new RegExp("(^|;)\\s*" + name + ":([^;]+;?)", "gi"); - cssStyle = cssStyle.replace(reg, "$1"); - if (val) { - cssStyle = name + ":" + utils.unhtml(val) + ";" + cssStyle; - } - } - - var cssStyle = this.getAttr("style"); - if (!cssStyle) { - cssStyle = ""; - } - if (utils.isObject(name)) { - for (var a in name) { - exec(a, name[a]); - } - } else { - exec(name, val); - } - this.setAttr("style", utils.trim(cssStyle)); - }, - - /** - * 传入一个函数,递归遍历当前节点下的所有节点 - * @method traversal - * @param { Function } fn 遍历到节点的时,传入节点作为参数,运行此函数 - * @example - * ```javascript - * traversal(node, function(){ - * console.log(node.type); - * }); - * ``` - */ - traversal: function(fn) { - if (this.children && this.children.length) { - nodeTraversal(this, fn); - } - return this; - } - }; -})(); - - -// core/htmlparser.js -/** - * html字符串转换成uNode节点 - * @file - * @module UE - * @since 1.2.6.1 - */ - -/** - * UEditor公用空间,UEditor所有的功能都挂载在该空间下 - * @unfile - * @module UE - */ - -/** - * html字符串转换成uNode节点的静态方法 - * @method htmlparser - * @param { String } htmlstr 要转换的html代码 - * @param { Boolean } ignoreBlank 若设置为true,转换的时候忽略\n\r\t等空白字符 - * @return { uNode } 给定的html片段转换形成的uNode对象 - * @example - * ```javascript - * var root = UE.htmlparser('

                      htmlparser

                      ', true); - * ``` - */ - -var htmlparser = (UE.htmlparser = function(htmlstr, ignoreBlank) { - //todo 原来的方式 [^"'<>\/] 有\/就不能配对上 " - ); - } - html.push(""); - } - //禁止指定table-width - return "
                      这样的标签了 - //先去掉了,加上的原因忘了,这里先记录 - //var re_tag = /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g, - //以上的正则表达式无法匹配:

                      - //修改为如下正则表达式: - var re_tag = /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g, - re_attr = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g; - - //ie下取得的html可能会有\n存在,要去掉,在处理replace(/[\t\r\n]*/g,'');代码高量的\n不能去除 - var allowEmptyTags = { - b: 1, - code: 1, - i: 1, - u: 1, - strike: 1, - s: 1, - tt: 1, - strong: 1, - q: 1, - samp: 1, - em: 1, - span: 1, - sub: 1, - img: 1, - sup: 1, - font: 1, - big: 1, - small: 1, - iframe: 1, - a: 1, - br: 1, - pre: 1 - }; - htmlstr = htmlstr.replace(new RegExp(domUtils.fillChar, "g"), ""); - if (!ignoreBlank) { - htmlstr = htmlstr.replace( - new RegExp( - "[\\r\\t\\n" + - (ignoreBlank ? "" : " ") + - "]*]*)>[\\r\\t\\n" + - (ignoreBlank ? "" : " ") + - "]*", - "g" - ), - function(a, b) { - //br暂时单独处理 - if (b && allowEmptyTags[b.toLowerCase()]) { - return a.replace(/(^[\n\r]+)|([\n\r]+$)/g, ""); - } - return a - .replace(new RegExp("^[\\r\\n" + (ignoreBlank ? "" : " ") + "]+"), "") - .replace( - new RegExp("[\\r\\n" + (ignoreBlank ? "" : " ") + "]+$"), - "" - ); - } - ); - } - - var notTransAttrs = { - href: 1, - src: 1 - }; - - var uNode = UE.uNode, - needParentNode = { - td: "tr", - tr: ["tbody", "thead", "tfoot"], - tbody: "table", - th: "tr", - thead: "table", - tfoot: "table", - caption: "table", - li: ["ul", "ol"], - dt: "dl", - dd: "dl", - option: "select" - }, - needChild = { - ol: "li", - ul: "li" - }; - - function text(parent, data) { - if (needChild[parent.tagName]) { - var tmpNode = uNode.createElement(needChild[parent.tagName]); - parent.appendChild(tmpNode); - tmpNode.appendChild(uNode.createText(data)); - parent = tmpNode; - } else { - parent.appendChild(uNode.createText(data)); - } - } - - function element(parent, tagName, htmlattr) { - var needParentTag; - if ((needParentTag = needParentNode[tagName])) { - var tmpParent = parent, - hasParent; - while (tmpParent.type != "root") { - if ( - utils.isArray(needParentTag) - ? utils.indexOf(needParentTag, tmpParent.tagName) != -1 - : needParentTag == tmpParent.tagName - ) { - parent = tmpParent; - hasParent = true; - break; - } - tmpParent = tmpParent.parentNode; - } - if (!hasParent) { - parent = element( - parent, - utils.isArray(needParentTag) ? needParentTag[0] : needParentTag - ); - } - } - //按dtd处理嵌套 - // if(parent.type != 'root' && !dtd[parent.tagName][tagName]) - // parent = parent.parentNode; - var elm = new uNode({ - parentNode: parent, - type: "element", - tagName: tagName.toLowerCase(), - //是自闭合的处理一下 - children: dtd.$empty[tagName] ? null : [] - }); - //如果属性存在,处理属性 - if (htmlattr) { - var attrs = {}, - match; - while ((match = re_attr.exec(htmlattr))) { - attrs[match[1].toLowerCase()] = notTransAttrs[match[1].toLowerCase()] - ? match[2] || match[3] || match[4] - : utils.unhtml(match[2] || match[3] || match[4]); - } - elm.attrs = attrs; - } - //trace:3970 - // //如果parent下不能放elm - // if(dtd.$inline[parent.tagName] && dtd.$block[elm.tagName] && !dtd[parent.tagName][elm.tagName]){ - // parent = parent.parentNode; - // elm.parentNode = parent; - // } - parent.children.push(elm); - //如果是自闭合节点返回父亲节点 - return dtd.$empty[tagName] ? parent : elm; - } - - function comment(parent, data) { - parent.children.push( - new uNode({ - type: "comment", - data: data, - parentNode: parent - }) - ); - } - - var match, - currentIndex = 0, - nextIndex = 0; - //设置根节点 - var root = new uNode({ - type: "root", - children: [] - }); - var currentParent = root; - - while ((match = re_tag.exec(htmlstr))) { - currentIndex = match.index; - try { - if (currentIndex > nextIndex) { - //text node - text(currentParent, htmlstr.slice(nextIndex, currentIndex)); - } - if (match[3]) { - if (dtd.$cdata[currentParent.tagName]) { - text(currentParent, match[0]); - } else { - //start tag - currentParent = element( - currentParent, - match[3].toLowerCase(), - match[4] - ); - } - } else if (match[1]) { - if (currentParent.type != "root") { - if (dtd.$cdata[currentParent.tagName] && !dtd.$cdata[match[1]]) { - text(currentParent, match[0]); - } else { - var tmpParent = currentParent; - while ( - currentParent.type == "element" && - currentParent.tagName != match[1].toLowerCase() - ) { - currentParent = currentParent.parentNode; - if (currentParent.type == "root") { - currentParent = tmpParent; - throw "break"; - } - } - //end tag - currentParent = currentParent.parentNode; - } - } - } else if (match[2]) { - //comment - comment(currentParent, match[2]); - } - } catch (e) {} - - nextIndex = re_tag.lastIndex; - } - //如果结束是文本,就有可能丢掉,所以这里手动判断一下 - //例如
                    • sdfsdfsdf
                    • sdfsdfsdfsdf - if (nextIndex < htmlstr.length) { - text(currentParent, htmlstr.slice(nextIndex)); - } - return root; -}); - - -// core/filternode.js -/** - * UE过滤节点的静态方法 - * @file - */ - -/** - * UEditor公用空间,UEditor所有的功能都挂载在该空间下 - * @module UE - */ - -/** - * 根据传入节点和过滤规则过滤相应节点 - * @module UE - * @since 1.2.6.1 - * @method filterNode - * @param { Object } root 指定root节点 - * @param { Object } rules 过滤规则json对象 - * @example - * ```javascript - * UE.filterNode(root,editor.options.filterRules); - * ``` - */ -var filterNode = (UE.filterNode = (function() { - function filterNode(node, rules) { - switch (node.type) { - case "text": - break; - case "element": - var val; - if ((val = rules[node.tagName])) { - if (val === "-") { - node.parentNode.removeChild(node); - } else if (utils.isFunction(val)) { - var parentNode = node.parentNode, - index = node.getIndex(); - val(node); - if (node.parentNode) { - if (node.children) { - for (var i = 0, ci; (ci = node.children[i]); ) { - filterNode(ci, rules); - if (ci.parentNode) { - i++; - } - } - } - } else { - for (var i = index, ci; (ci = parentNode.children[i]); ) { - filterNode(ci, rules); - if (ci.parentNode) { - i++; - } - } - } - } else { - var attrs = val["$"]; - if (attrs && node.attrs) { - var tmpAttrs = {}, - tmpVal; - for (var a in attrs) { - tmpVal = node.getAttr(a); - //todo 只先对style单独处理 - if (a == "style" && utils.isArray(attrs[a])) { - var tmpCssStyle = []; - utils.each(attrs[a], function(v) { - var tmp; - if ((tmp = node.getStyle(v))) { - tmpCssStyle.push(v + ":" + tmp); - } - }); - tmpVal = tmpCssStyle.join(";"); - } - if (tmpVal) { - tmpAttrs[a] = tmpVal; - } - } - node.attrs = tmpAttrs; - } - if (node.children) { - for (var i = 0, ci; (ci = node.children[i]); ) { - filterNode(ci, rules); - if (ci.parentNode) { - i++; - } - } - } - } - } else { - //如果不在名单里扣出子节点并删除该节点,cdata除外 - if (dtd.$cdata[node.tagName]) { - node.parentNode.removeChild(node); - } else { - var parentNode = node.parentNode, - index = node.getIndex(); - node.parentNode.removeChild(node, true); - for (var i = index, ci; (ci = parentNode.children[i]); ) { - filterNode(ci, rules); - if (ci.parentNode) { - i++; - } - } - } - } - break; - case "comment": - node.parentNode.removeChild(node); - } - } - return function(root, rules) { - if (utils.isEmptyObject(rules)) { - return root; - } - var val; - if ((val = rules["-"])) { - utils.each(val.split(" "), function(k) { - rules[k] = "-"; - }); - } - for (var i = 0, ci; (ci = root.children[i]); ) { - filterNode(ci, rules); - if (ci.parentNode) { - i++; - } - } - return root; - }; -})()); - - -// core/plugin.js -/** - * Created with JetBrains PhpStorm. - * User: campaign - * Date: 10/8/13 - * Time: 6:15 PM - * To change this template use File | Settings | File Templates. - */ -UE.plugin = (function() { - var _plugins = {}; - return { - register: function(pluginName, fn, oldOptionName, afterDisabled) { - if (oldOptionName && utils.isFunction(oldOptionName)) { - afterDisabled = oldOptionName; - oldOptionName = null; - } - _plugins[pluginName] = { - optionName: oldOptionName || pluginName, - execFn: fn, - //当插件被禁用时执行 - afterDisabled: afterDisabled - }; - }, - load: function(editor) { - utils.each(_plugins, function(plugin) { - var _export = plugin.execFn.call(editor); - if (editor.options[plugin.optionName] !== false) { - if (_export) { - //后边需要再做扩展 - utils.each(_export, function(v, k) { - switch (k.toLowerCase()) { - case "shortcutkey": - editor.addshortcutkey(v); - break; - case "bindevents": - utils.each(v, function(fn, eventName) { - editor.addListener(eventName, fn); - }); - break; - case "bindmultievents": - utils.each(utils.isArray(v) ? v : [v], function(event) { - var types = utils.trim(event.type).split(/\s+/); - utils.each(types, function(eventName) { - editor.addListener(eventName, event.handler); - }); - }); - break; - case "commands": - utils.each(v, function(execFn, execName) { - editor.commands[execName] = execFn; - }); - break; - case "outputrule": - editor.addOutputRule(v); - break; - case "inputrule": - editor.addInputRule(v); - break; - case "defaultoptions": - editor.setOpt(v); - } - }); - } - } else if (plugin.afterDisabled) { - plugin.afterDisabled.call(editor); - } - }); - //向下兼容 - utils.each(UE.plugins, function(plugin) { - plugin.call(editor); - }); - }, - run: function(pluginName, editor) { - var plugin = _plugins[pluginName]; - if (plugin) { - plugin.exeFn.call(editor); - } - } - }; -})(); - - -// core/keymap.js -var keymap = (UE.keymap = { - Backspace: 8, - Tab: 9, - Enter: 13, - - Shift: 16, - Control: 17, - Alt: 18, - CapsLock: 20, - - Esc: 27, - - Spacebar: 32, - - PageUp: 33, - PageDown: 34, - End: 35, - Home: 36, - - Left: 37, - Up: 38, - Right: 39, - Down: 40, - - Insert: 45, - - Del: 46, - - NumLock: 144, - - Cmd: 91, - - "=": 187, - "-": 189, - - b: 66, - i: 73, - //回退 - z: 90, - y: 89, - //粘贴 - v: 86, - x: 88, - - s: 83, - - n: 78 -}); - - -// core/localstorage.js -//存储媒介封装 -var LocalStorage = (UE.LocalStorage = (function() { - var storage = window.localStorage || getUserData() || null, - LOCAL_FILE = "localStorage"; - - return { - saveLocalData: function(key, data) { - if (storage && data) { - storage.setItem(key, data); - return true; - } - - return false; - }, - - getLocalData: function(key) { - if (storage) { - return storage.getItem(key); - } - - return null; - }, - - removeItem: function(key) { - storage && storage.removeItem(key); - } - }; - - function getUserData() { - var container = document.createElement("div"); - container.style.display = "none"; - - if (!container.addBehavior) { - return null; - } - - container.addBehavior("#default#userdata"); - - return { - getItem: function(key) { - var result = null; - - try { - document.body.appendChild(container); - container.load(LOCAL_FILE); - result = container.getAttribute(key); - document.body.removeChild(container); - } catch (e) {} - - return result; - }, - - setItem: function(key, value) { - document.body.appendChild(container); - container.setAttribute(key, value); - container.save(LOCAL_FILE); - document.body.removeChild(container); - }, - - //// 暂时没有用到 - //clear: function () { - // - // var expiresTime = new Date(); - // expiresTime.setFullYear(expiresTime.getFullYear() - 1); - // document.body.appendChild(container); - // container.expires = expiresTime.toUTCString(); - // container.save(LOCAL_FILE); - // document.body.removeChild(container); - // - //}, - - removeItem: function(key) { - document.body.appendChild(container); - container.removeAttribute(key); - container.save(LOCAL_FILE); - document.body.removeChild(container); - } - }; - } -})()); - -;(function() { - var ROOTKEY = "ueditor_preference"; - - UE.Editor.prototype.setPreferences = function(key, value) { - var obj = {}; - if (utils.isString(key)) { - obj[key] = value; - } else { - obj = key; - } - var data = LocalStorage.getLocalData(ROOTKEY); - if (data && (data = utils.str2json(data))) { - utils.extend(data, obj); - } else { - data = obj; - } - data && LocalStorage.saveLocalData(ROOTKEY, utils.json2str(data)); - }; - - UE.Editor.prototype.getPreferences = function(key) { - var data = LocalStorage.getLocalData(ROOTKEY); - if (data && (data = utils.str2json(data))) { - return key ? data[key] : data; - } - return null; - }; - - UE.Editor.prototype.removePreferences = function(key) { - var data = LocalStorage.getLocalData(ROOTKEY); - if (data && (data = utils.str2json(data))) { - data[key] = undefined; - delete data[key]; - } - data && LocalStorage.saveLocalData(ROOTKEY, utils.json2str(data)); - }; -})(); - - -// plugins/defaultfilter.js -///import core -///plugin 编辑器默认的过滤转换机制 - -UE.plugins["defaultfilter"] = function() { - var me = this; - me.setOpt({ - allowDivTransToP: true, - disabledTableInTable: true, - rgb2Hex: true - }); - //默认的过滤处理 - //进入编辑器的内容处理 - me.addInputRule(function(root) { - var allowDivTransToP = this.options.allowDivTransToP; - var val; - function tdParent(node) { - while (node && node.type == "element") { - if (node.tagName == "td") { - return true; - } - node = node.parentNode; - } - return false; - } - //进行默认的处理 - root.traversal(function(node) { - if (node.type == "element") { - if ( - !dtd.$cdata[node.tagName] && - me.options.autoClearEmptyNode && - dtd.$inline[node.tagName] && - !dtd.$empty[node.tagName] && - (!node.attrs || utils.isEmptyObject(node.attrs)) - ) { - if (!node.firstChild()) node.parentNode.removeChild(node); - else if ( - node.tagName == "span" && - (!node.attrs || utils.isEmptyObject(node.attrs)) - ) { - node.parentNode.removeChild(node, true); - } - return; - } - switch (node.tagName) { - case "style": - case "script": - node.setAttr({ - cdata_tag: node.tagName, - cdata_data: node.innerHTML() || "", - _ue_custom_node_: "true" - }); - node.tagName = "div"; - node.innerHTML(""); - break; - case "a": - if ((val = node.getAttr("href"))) { - node.setAttr("_href", val); - } - break; - case "img": - //todo base64暂时去掉,后边做远程图片上传后,干掉这个 - if ((val = node.getAttr("src"))) { - if (/^data:/.test(val)) { - node.parentNode.removeChild(node); - break; - } - } - node.setAttr("_src", node.getAttr("src")); - break; - case "span": - if (browser.webkit && (val = node.getStyle("white-space"))) { - if (/nowrap|normal/.test(val)) { - node.setStyle("white-space", ""); - if ( - me.options.autoClearEmptyNode && - utils.isEmptyObject(node.attrs) - ) { - node.parentNode.removeChild(node, true); - } - } - } - val = node.getAttr("id"); - if (val && /^_baidu_bookmark_/i.test(val)) { - node.parentNode.removeChild(node); - } - break; - case "p": - if ((val = node.getAttr("align"))) { - node.setAttr("align"); - node.setStyle("text-align", val); - } - //trace:3431 - // var cssStyle = node.getAttr('style'); - // if (cssStyle) { - // cssStyle = cssStyle.replace(/(margin|padding)[^;]+/g, ''); - // node.setAttr('style', cssStyle) - // - // } - //p标签不允许嵌套 - utils.each(node.children, function(n) { - if (n.type == "element" && n.tagName == "p") { - var next = n.nextSibling(); - node.parentNode.insertAfter(n, node); - var last = n; - while (next) { - var tmp = next.nextSibling(); - node.parentNode.insertAfter(next, last); - last = next; - next = tmp; - } - return false; - } - }); - if (!node.firstChild()) { - node.innerHTML(browser.ie ? " " : "
                      "); - } - break; - case "div": - if (node.getAttr("cdata_tag")) { - break; - } - //针对代码这里不处理插入代码的div - val = node.getAttr("class"); - if (val && /^line number\d+/.test(val)) { - break; - } - if (!allowDivTransToP) { - break; - } - var tmpNode, - p = UE.uNode.createElement("p"); - while ((tmpNode = node.firstChild())) { - if ( - tmpNode.type == "text" || - !UE.dom.dtd.$block[tmpNode.tagName] - ) { - p.appendChild(tmpNode); - } else { - if (p.firstChild()) { - node.parentNode.insertBefore(p, node); - p = UE.uNode.createElement("p"); - } else { - node.parentNode.insertBefore(tmpNode, node); - } - } - } - if (p.firstChild()) { - node.parentNode.insertBefore(p, node); - } - node.parentNode.removeChild(node); - break; - case "dl": - node.tagName = "ul"; - break; - case "dt": - case "dd": - node.tagName = "li"; - break; - case "li": - var className = node.getAttr("class"); - if (!className || !/list\-/.test(className)) { - node.setAttr(); - } - var tmpNodes = node.getNodesByTagName("ol ul"); - UE.utils.each(tmpNodes, function(n) { - node.parentNode.insertAfter(n, node); - }); - break; - case "td": - case "th": - case "caption": - if (!node.children || !node.children.length) { - node.appendChild( - browser.ie11below - ? UE.uNode.createText(" ") - : UE.uNode.createElement("br") - ); - } - break; - case "table": - if (me.options.disabledTableInTable && tdParent(node)) { - node.parentNode.insertBefore( - UE.uNode.createText(node.innerText()), - node - ); - node.parentNode.removeChild(node); - } - } - } - // if(node.type == 'comment'){ - // node.parentNode.removeChild(node); - // } - }); - }); - - //从编辑器出去的内容处理 - me.addOutputRule(function(root) { - var val; - root.traversal(function(node) { - if (node.type == "element") { - if ( - me.options.autoClearEmptyNode && - dtd.$inline[node.tagName] && - !dtd.$empty[node.tagName] && - (!node.attrs || utils.isEmptyObject(node.attrs)) - ) { - if (!node.firstChild()) node.parentNode.removeChild(node); - else if ( - node.tagName == "span" && - (!node.attrs || utils.isEmptyObject(node.attrs)) - ) { - node.parentNode.removeChild(node, true); - } - return; - } - switch (node.tagName) { - case "div": - if ((val = node.getAttr("cdata_tag"))) { - node.tagName = val; - node.appendChild(UE.uNode.createText(node.getAttr("cdata_data"))); - node.setAttr({ - cdata_tag: "", - cdata_data: "", - _ue_custom_node_: "" - }); - } - break; - case "a": - if ((val = node.getAttr("_href"))) { - node.setAttr({ - href: utils.html(val), - _href: "" - }); - } - break; - break; - case "span": - val = node.getAttr("id"); - if (val && /^_baidu_bookmark_/i.test(val)) { - node.parentNode.removeChild(node); - } - //将color的rgb格式转换为#16进制格式 - if (me.getOpt("rgb2Hex")) { - var cssStyle = node.getAttr("style"); - if (cssStyle) { - node.setAttr( - "style", - cssStyle.replace(/rgba?\(([\d,\s]+)\)/g, function(a, value) { - var array = value.split(","); - if (array.length > 3) return ""; - value = "#"; - for (var i = 0, color; (color = array[i++]); ) { - color = parseInt( - color.replace(/[^\d]/gi, ""), - 10 - ).toString(16); - value += color.length == 1 ? "0" + color : color; - } - return value.toUpperCase(); - }) - ); - } - } - break; - case "img": - if ((val = node.getAttr("_src"))) { - node.setAttr({ - src: node.getAttr("_src"), - _src: "" - }); - } - } - } - }); - }); -}; - - -// plugins/inserthtml.js -/** - * 插入html字符串插件 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入html代码 - * @command inserthtml - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } html 插入的html字符串 - * @remaind 插入的标签内容是在当前的选区位置上插入,如果当前是闭合状态,那直接插入内容, 如果当前是选中状态,将先清除当前选中内容后,再做插入 - * @warning 注意:该命令会对当前选区的位置,对插入的内容进行过滤转换处理。 过滤的规则遵循html语意化的原则。 - * @example - * ```javascript - * //xxx[BB]xxx 当前选区为非闭合选区,选中BB这两个文本 - * //执行命令,插入CC - * //插入后的效果 xxxCCxxx - * //

                      xx|xxx

                      当前选区为闭合状态 - * //插入

                      CC

                      - * //结果

                      xx

                      CC

                      xxx

                      - * //

                      xxxx

                      |

                      xxx

                      当前选区在两个p标签之间 - * //插入 xxxx - * //结果

                      xxxx

                      xxxx

                      xxx

                      - * ``` - */ - -UE.commands["inserthtml"] = { - execCommand: function(command, html, notNeedFilter) { - var me = this, - range, - div; - if (!html) { - return; - } - if (me.fireEvent("beforeinserthtml", html) === true) { - return; - } - range = me.selection.getRange(); - div = range.document.createElement("div"); - div.style.display = "inline"; - - if (!notNeedFilter) { - var root = UE.htmlparser(html); - //如果给了过滤规则就先进行过滤 - if (me.options.filterRules) { - UE.filterNode(root, me.options.filterRules); - } - //执行默认的处理 - me.filterInputRule(root); - html = root.toHtml(); - } - div.innerHTML = utils.trim(html); - - if (!range.collapsed) { - var tmpNode = range.startContainer; - if (domUtils.isFillChar(tmpNode)) { - range.setStartBefore(tmpNode); - } - tmpNode = range.endContainer; - if (domUtils.isFillChar(tmpNode)) { - range.setEndAfter(tmpNode); - } - range.txtToElmBoundary(); - //结束边界可能放到了br的前边,要把br包含进来 - // x[xxx]
                      - if (range.endContainer && range.endContainer.nodeType == 1) { - tmpNode = range.endContainer.childNodes[range.endOffset]; - if (tmpNode && domUtils.isBr(tmpNode)) { - range.setEndAfter(tmpNode); - } - } - if (range.startOffset == 0) { - tmpNode = range.startContainer; - if (domUtils.isBoundaryNode(tmpNode, "firstChild")) { - tmpNode = range.endContainer; - if ( - range.endOffset == - (tmpNode.nodeType == 3 - ? tmpNode.nodeValue.length - : tmpNode.childNodes.length) && - domUtils.isBoundaryNode(tmpNode, "lastChild") - ) { - me.body.innerHTML = "

                      " + (browser.ie ? "" : "
                      ") + "

                      "; - range.setStart(me.body.firstChild, 0).collapse(true); - } - } - } - !range.collapsed && range.deleteContents(); - if (range.startContainer.nodeType == 1) { - var child = range.startContainer.childNodes[range.startOffset], - pre; - if ( - child && - domUtils.isBlockElm(child) && - (pre = child.previousSibling) && - domUtils.isBlockElm(pre) - ) { - range.setEnd(pre, pre.childNodes.length).collapse(); - while (child.firstChild) { - pre.appendChild(child.firstChild); - } - domUtils.remove(child); - } - } - } - - var child, - parent, - pre, - tmp, - hadBreak = 0, - nextNode; - //如果当前位置选中了fillchar要干掉,要不会产生空行 - if (range.inFillChar()) { - child = range.startContainer; - if (domUtils.isFillChar(child)) { - range.setStartBefore(child).collapse(true); - domUtils.remove(child); - } else if (domUtils.isFillChar(child, true)) { - child.nodeValue = child.nodeValue.replace(fillCharReg, ""); - range.startOffset--; - range.collapsed && range.collapse(true); - } - } - //列表单独处理 - var li = domUtils.findParentByTagName(range.startContainer, "li", true); - if (li) { - var next, last; - while ((child = div.firstChild)) { - //针对hr单独处理一下先 - while ( - child && - (child.nodeType == 3 || - !domUtils.isBlockElm(child) || - child.tagName == "HR") - ) { - next = child.nextSibling; - range.insertNode(child).collapse(); - last = child; - child = next; - } - if (child) { - if (/^(ol|ul)$/i.test(child.tagName)) { - while (child.firstChild) { - last = child.firstChild; - domUtils.insertAfter(li, child.firstChild); - li = li.nextSibling; - } - domUtils.remove(child); - } else { - var tmpLi; - next = child.nextSibling; - tmpLi = me.document.createElement("li"); - domUtils.insertAfter(li, tmpLi); - tmpLi.appendChild(child); - last = child; - child = next; - li = tmpLi; - } - } - } - li = domUtils.findParentByTagName(range.startContainer, "li", true); - if (domUtils.isEmptyBlock(li)) { - domUtils.remove(li); - } - if (last) { - range.setStartAfter(last).collapse(true).select(true); - } - } else { - while ((child = div.firstChild)) { - if (hadBreak) { - var p = me.document.createElement("p"); - while (child && (child.nodeType == 3 || !dtd.$block[child.tagName])) { - nextNode = child.nextSibling; - p.appendChild(child); - child = nextNode; - } - if (p.firstChild) { - child = p; - } - } - range.insertNode(child); - nextNode = child.nextSibling; - if ( - !hadBreak && - child.nodeType == domUtils.NODE_ELEMENT && - domUtils.isBlockElm(child) - ) { - parent = domUtils.findParent(child, function(node) { - return domUtils.isBlockElm(node); - }); - if ( - parent && - parent.tagName.toLowerCase() != "body" && - !( - dtd[parent.tagName][child.nodeName] && child.parentNode === parent - ) - ) { - if (!dtd[parent.tagName][child.nodeName]) { - pre = parent; - } else { - tmp = child.parentNode; - while (tmp !== parent) { - pre = tmp; - tmp = tmp.parentNode; - } - } - - domUtils.breakParent(child, pre || tmp); - //去掉break后前一个多余的节点

                      |<[p> ==>

                      |

                      - var pre = child.previousSibling; - domUtils.trimWhiteTextNode(pre); - if (!pre.childNodes.length) { - domUtils.remove(pre); - } - //trace:2012,在非ie的情况,切开后剩下的节点有可能不能点入光标添加br占位 - - if ( - !browser.ie && - (next = child.nextSibling) && - domUtils.isBlockElm(next) && - next.lastChild && - !domUtils.isBr(next.lastChild) - ) { - next.appendChild(me.document.createElement("br")); - } - hadBreak = 1; - } - } - var next = child.nextSibling; - if (!div.firstChild && next && domUtils.isBlockElm(next)) { - range.setStart(next, 0).collapse(true); - break; - } - range.setEndAfter(child).collapse(); - } - - child = range.startContainer; - - if (nextNode && domUtils.isBr(nextNode)) { - domUtils.remove(nextNode); - } - //用chrome可能有空白展位符 - if (domUtils.isBlockElm(child) && domUtils.isEmptyNode(child)) { - if ((nextNode = child.nextSibling)) { - domUtils.remove(child); - if (nextNode.nodeType == 1 && dtd.$block[nextNode.tagName]) { - range.setStart(nextNode, 0).collapse(true).shrinkBoundary(); - } - } else { - try { - child.innerHTML = browser.ie ? domUtils.fillChar : "
                      "; - } catch (e) { - range.setStartBefore(child); - domUtils.remove(child); - } - } - } - //加上true因为在删除表情等时会删两次,第一次是删的fillData - try { - range.select(true); - } catch (e) {} - } - - setTimeout(function() { - range = me.selection.getRange(); - range.scrollToView( - me.autoHeightEnabled, - me.autoHeightEnabled ? domUtils.getXY(me.iframe).y : 0 - ); - me.fireEvent("afterinserthtml", html); - }, 200); - } -}; - - -// plugins/autotypeset.js -/** - * 自动排版 - * @file - * @since 1.2.6.1 - */ - -/** - * 对当前编辑器的内容执行自动排版, 排版的行为根据config配置文件里的“autotypeset”选项进行控制。 - * @command autotypeset - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'autotypeset' ); - * ``` - */ - -UE.plugins["autotypeset"] = function() { - this.setOpt({ - autotypeset: { - mergeEmptyline: true, //合并空行 - removeClass: true, //去掉冗余的class - removeEmptyline: false, //去掉空行 - textAlign: "left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版 - imageBlockLine: "center", //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版 - pasteFilter: false, //根据规则过滤没事粘贴进来的内容 - clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号 - clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体 - removeEmptyNode: false, // 去掉空节点 - //可以去掉的标签 - removeTagNames: utils.extend({ div: 1 }, dtd.$removeEmpty), - indent: false, // 行首缩进 - indentValue: "2em", //行首缩进的大小 - bdc2sb: false, - tobdc: false - } - }); - - var me = this, - opt = me.options.autotypeset, - remainClass = { - selectTdClass: 1, - pagebreak: 1, - anchorclass: 1 - }, - remainTag = { - li: 1 - }, - tags = { - div: 1, - p: 1, - //trace:2183 这些也认为是行 - blockquote: 1, - center: 1, - h1: 1, - h2: 1, - h3: 1, - h4: 1, - h5: 1, - h6: 1, - span: 1 - }, - highlightCont; - //升级了版本,但配置项目里没有autotypeset - if (!opt) { - return; - } - - readLocalOpts(); - - function isLine(node, notEmpty) { - if (!node || node.nodeType == 3) return 0; - if (domUtils.isBr(node)) return 1; - if (node && node.parentNode && tags[node.tagName.toLowerCase()]) { - if ( - (highlightCont && highlightCont.contains(node)) || - node.getAttribute("pagebreak") - ) { - return 0; - } - - return notEmpty - ? !domUtils.isEmptyBlock(node) - : domUtils.isEmptyBlock( - node, - new RegExp("[\\s" + domUtils.fillChar + "]", "g") - ); - } - } - - function removeNotAttributeSpan(node) { - if (!node.style.cssText) { - domUtils.removeAttributes(node, ["style"]); - if ( - node.tagName.toLowerCase() == "span" && - domUtils.hasNoAttributes(node) - ) { - domUtils.remove(node, true); - } - } - } - function autotype(type, html) { - var me = this, - cont; - if (html) { - if (!opt.pasteFilter) { - return; - } - cont = me.document.createElement("div"); - cont.innerHTML = html.html; - } else { - cont = me.document.body; - } - var nodes = domUtils.getElementsByTagName(cont, "*"); - - // 行首缩进,段落方向,段间距,段内间距 - for (var i = 0, ci; (ci = nodes[i++]); ) { - if (me.fireEvent("excludeNodeinautotype", ci) === true) { - continue; - } - //font-size - if (opt.clearFontSize && ci.style.fontSize) { - domUtils.removeStyle(ci, "font-size"); - - removeNotAttributeSpan(ci); - } - //font-family - if (opt.clearFontFamily && ci.style.fontFamily) { - domUtils.removeStyle(ci, "font-family"); - removeNotAttributeSpan(ci); - } - - if (isLine(ci)) { - //合并空行 - if (opt.mergeEmptyline) { - var next = ci.nextSibling, - tmpNode, - isBr = domUtils.isBr(ci); - while (isLine(next)) { - tmpNode = next; - next = tmpNode.nextSibling; - if (isBr && (!next || (next && !domUtils.isBr(next)))) { - break; - } - domUtils.remove(tmpNode); - } - } - //去掉空行,保留占位的空行 - if ( - opt.removeEmptyline && - domUtils.inDoc(ci, cont) && - !remainTag[ci.parentNode.tagName.toLowerCase()] - ) { - if (domUtils.isBr(ci)) { - next = ci.nextSibling; - if (next && !domUtils.isBr(next)) { - continue; - } - } - domUtils.remove(ci); - continue; - } - } - if (isLine(ci, true) && ci.tagName != "SPAN") { - if (opt.indent) { - ci.style.textIndent = opt.indentValue; - } - if (opt.textAlign) { - ci.style.textAlign = opt.textAlign; - } - // if(opt.lineHeight) - // ci.style.lineHeight = opt.lineHeight + 'cm'; - } - - //去掉class,保留的class不去掉 - if ( - opt.removeClass && - ci.className && - !remainClass[ci.className.toLowerCase()] - ) { - if (highlightCont && highlightCont.contains(ci)) { - continue; - } - domUtils.removeAttributes(ci, ["class"]); - } - - //表情不处理 - if ( - opt.imageBlockLine && - ci.tagName.toLowerCase() == "img" && - !ci.getAttribute("emotion") - ) { - if (html) { - var img = ci; - switch (opt.imageBlockLine) { - case "left": - case "right": - case "none": - var pN = img.parentNode, - tmpNode, - pre, - next; - while (dtd.$inline[pN.tagName] || pN.tagName == "A") { - pN = pN.parentNode; - } - tmpNode = pN; - if ( - tmpNode.tagName == "P" && - domUtils.getStyle(tmpNode, "text-align") == "center" - ) { - if ( - !domUtils.isBody(tmpNode) && - domUtils.getChildCount(tmpNode, function(node) { - return !domUtils.isBr(node) && !domUtils.isWhitespace(node); - }) == 1 - ) { - pre = tmpNode.previousSibling; - next = tmpNode.nextSibling; - if ( - pre && - next && - pre.nodeType == 1 && - next.nodeType == 1 && - pre.tagName == next.tagName && - domUtils.isBlockElm(pre) - ) { - pre.appendChild(tmpNode.firstChild); - while (next.firstChild) { - pre.appendChild(next.firstChild); - } - domUtils.remove(tmpNode); - domUtils.remove(next); - } else { - domUtils.setStyle(tmpNode, "text-align", ""); - } - } - } - domUtils.setStyle(img, "float", opt.imageBlockLine); - break; - case "center": - if (me.queryCommandValue("imagefloat") != "center") { - pN = img.parentNode; - domUtils.setStyle(img, "float", "none"); - tmpNode = img; - while ( - pN && - domUtils.getChildCount(pN, function(node) { - return !domUtils.isBr(node) && !domUtils.isWhitespace(node); - }) == 1 && - (dtd.$inline[pN.tagName] || pN.tagName == "A") - ) { - tmpNode = pN; - pN = pN.parentNode; - } - var pNode = me.document.createElement("p"); - domUtils.setAttributes(pNode, { - style: "text-align:center" - }); - tmpNode.parentNode.insertBefore(pNode, tmpNode); - pNode.appendChild(tmpNode); - domUtils.setStyle(tmpNode, "float", ""); - } - } - } else { - var range = me.selection.getRange(); - range.selectNode(ci).select(); - me.execCommand("imagefloat", opt.imageBlockLine); - } - } - - //去掉冗余的标签 - if (opt.removeEmptyNode) { - if ( - opt.removeTagNames[ci.tagName.toLowerCase()] && - domUtils.hasNoAttributes(ci) && - domUtils.isEmptyBlock(ci) - ) { - domUtils.remove(ci); - } - } - } - if (opt.tobdc) { - var root = UE.htmlparser(cont.innerHTML); - root.traversal(function(node) { - if (node.type == "text") { - node.data = ToDBC(node.data); - } - }); - cont.innerHTML = root.toHtml(); - } - if (opt.bdc2sb) { - var root = UE.htmlparser(cont.innerHTML); - root.traversal(function(node) { - if (node.type == "text") { - node.data = DBC2SB(node.data); - } - }); - cont.innerHTML = root.toHtml(); - } - if (html) { - html.html = cont.innerHTML; - } - } - if (opt.pasteFilter) { - me.addListener("beforepaste", autotype); - } - - function DBC2SB(str) { - var result = ""; - for (var i = 0; i < str.length; i++) { - var code = str.charCodeAt(i); //获取当前字符的unicode编码 - if (code >= 65281 && code <= 65373) { - //在这个unicode编码范围中的是所有的英文字母已经各种字符 - result += String.fromCharCode(str.charCodeAt(i) - 65248); //把全角字符的unicode编码转换为对应半角字符的unicode码 - } else if (code == 12288) { - //空格 - result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32); - } else { - result += str.charAt(i); - } - } - return result; - } - function ToDBC(txtstring) { - txtstring = utils.html(txtstring); - var tmp = ""; - var mark = ""; /*用于判断,如果是html尖括里的标记,则不进行全角的转换*/ - for (var i = 0; i < txtstring.length; i++) { - if (txtstring.charCodeAt(i) == 32) { - tmp = tmp + String.fromCharCode(12288); - } else if (txtstring.charCodeAt(i) < 127) { - tmp = tmp + String.fromCharCode(txtstring.charCodeAt(i) + 65248); - } else { - tmp += txtstring.charAt(i); - } - } - return tmp; - } - - function readLocalOpts() { - var cookieOpt = me.getPreferences("autotypeset"); - utils.extend(me.options.autotypeset, cookieOpt); - } - - me.commands["autotypeset"] = { - execCommand: function() { - me.removeListener("beforepaste", autotype); - if (opt.pasteFilter) { - me.addListener("beforepaste", autotype); - } - autotype.call(me); - } - }; -}; - - -// plugins/autosubmit.js -/** - * 快捷键提交 - * @file - * @since 1.2.6.1 - */ - -/** - * 提交表单 - * @command autosubmit - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'autosubmit' ); - * ``` - */ - -UE.plugin.register("autosubmit", function() { - return { - shortcutkey: { - autosubmit: "ctrl+13" //手动提交 - }, - commands: { - autosubmit: { - execCommand: function() { - var me = this, - form = domUtils.findParentByTagName(me.iframe, "form", false); - if (form) { - if (me.fireEvent("beforesubmit") === false) { - return; - } - me.sync(); - form.submit(); - } - } - } - } - }; -}); - - -// plugins/background.js -/** - * 背景插件,为UEditor提供设置背景功能 - * @file - * @since 1.2.6.1 - */ -UE.plugin.register("background", function() { - var me = this, - cssRuleId = "editor_background", - isSetColored, - reg = new RegExp("body[\\s]*\\{(.+)\\}", "i"); - - function stringToObj(str) { - var obj = {}, - styles = str.split(";"); - utils.each(styles, function(v) { - var index = v.indexOf(":"), - key = utils.trim(v.substr(0, index)).toLowerCase(); - key && (obj[key] = utils.trim(v.substr(index + 1) || "")); - }); - return obj; - } - - function setBackground(obj) { - if (obj) { - var styles = []; - for (var name in obj) { - if (obj.hasOwnProperty(name)) { - styles.push(name + ":" + obj[name] + "; "); - } - } - utils.cssRule( - cssRuleId, - styles.length ? "body{" + styles.join("") + "}" : "", - me.document - ); - } else { - utils.cssRule(cssRuleId, "", me.document); - } - } - //重写editor.hasContent方法 - - var orgFn = me.hasContents; - me.hasContents = function() { - if (me.queryCommandValue("background")) { - return true; - } - return orgFn.apply(me, arguments); - }; - return { - bindEvents: { - getAllHtml: function(type, headHtml) { - var body = this.body, - su = domUtils.getComputedStyle(body, "background-image"), - url = ""; - if (su.indexOf(me.options.imagePath) > 0) { - url = su - .substring(su.indexOf(me.options.imagePath), su.length - 1) - .replace(/"|\(|\)/gi, ""); - } else { - url = su != "none" ? su.replace(/url\("?|"?\)/gi, "") : ""; - } - var html = ' "; - headHtml.push(html); - }, - aftersetcontent: function() { - if (isSetColored == false) setBackground(); - } - }, - inputRule: function(root) { - isSetColored = false; - utils.each(root.getNodesByTagName("p"), function(p) { - var styles = p.getAttr("data-background"); - if (styles) { - isSetColored = true; - setBackground(stringToObj(styles)); - p.parentNode.removeChild(p); - } - }); - }, - outputRule: function(root) { - var me = this, - styles = (utils.cssRule(cssRuleId, me.document) || "") - .replace(/[\n\r]+/g, "") - .match(reg); - if (styles) { - root.appendChild( - UE.uNode.createElement( - '


                      ' - ) - ); - } - }, - commands: { - background: { - execCommand: function(cmd, obj) { - setBackground(obj); - }, - queryCommandValue: function() { - var me = this, - styles = (utils.cssRule(cssRuleId, me.document) || "") - .replace(/[\n\r]+/g, "") - .match(reg); - return styles ? stringToObj(styles[1]) : null; - }, - notNeedUndo: true - } - } - }; -}); - - -// plugins/image.js -/** - * 图片插入、排版插件 - * @file - * @since 1.2.6.1 - */ - -/** - * 图片对齐方式 - * @command imagefloat - * @method execCommand - * @remind 值center为独占一行居中 - * @param { String } cmd 命令字符串 - * @param { String } align 对齐方式,可传left、right、none、center - * @remaind center表示图片独占一行 - * @example - * ```javascript - * editor.execCommand( 'imagefloat', 'center' ); - * ``` - */ - -/** - * 如果选区所在位置是图片区域 - * @command imagefloat - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回图片对齐方式 - * @example - * ```javascript - * editor.queryCommandValue( 'imagefloat' ); - * ``` - */ - -UE.commands["imagefloat"] = { - execCommand: function(cmd, align) { - var me = this, - range = me.selection.getRange(); - if (!range.collapsed) { - var img = range.getClosedNode(); - if (img && img.tagName == "IMG") { - switch (align) { - case "left": - case "right": - case "none": - var pN = img.parentNode, - tmpNode, - pre, - next; - while (dtd.$inline[pN.tagName] || pN.tagName == "A") { - pN = pN.parentNode; - } - tmpNode = pN; - if ( - tmpNode.tagName == "P" && - domUtils.getStyle(tmpNode, "text-align") == "center" - ) { - if ( - !domUtils.isBody(tmpNode) && - domUtils.getChildCount(tmpNode, function(node) { - return !domUtils.isBr(node) && !domUtils.isWhitespace(node); - }) == 1 - ) { - pre = tmpNode.previousSibling; - next = tmpNode.nextSibling; - if ( - pre && - next && - pre.nodeType == 1 && - next.nodeType == 1 && - pre.tagName == next.tagName && - domUtils.isBlockElm(pre) - ) { - pre.appendChild(tmpNode.firstChild); - while (next.firstChild) { - pre.appendChild(next.firstChild); - } - domUtils.remove(tmpNode); - domUtils.remove(next); - } else { - domUtils.setStyle(tmpNode, "text-align", ""); - } - } - - range.selectNode(img).select(); - } - domUtils.setStyle(img, "float", align == "none" ? "" : align); - if (align == "none") { - domUtils.removeAttributes(img, "align"); - } - - break; - case "center": - if (me.queryCommandValue("imagefloat") != "center") { - var pN = img.parentNode; - domUtils.setStyle(img, "float", ""); - domUtils.removeAttributes(img, "align"); - tmpNode = img; - while ( - pN && - domUtils.getChildCount(pN, function(node) { - return !domUtils.isBr(node) && !domUtils.isWhitespace(node); - }) == 1 && - (dtd.$inline[pN.tagName] || pN.tagName == "A") - ) { - tmpNode = pN; - pN = pN.parentNode; - } - range.setStartBefore(tmpNode).setCursor(false); - pN = me.document.createElement("div"); - pN.appendChild(tmpNode); - domUtils.setStyle(tmpNode, "float", ""); - - me.execCommand( - "insertHtml", - '

                      ' + - pN.innerHTML + - "

                      " - ); - - tmpNode = me.document.getElementsByClassName("_img_parent_tmp")[0]; - tmpNode.removeAttribute("class"); - tmpNode = tmpNode.firstChild; - range.selectNode(tmpNode).select(); - //去掉后边多余的元素 - next = tmpNode.parentNode.nextSibling; - if (next && domUtils.isEmptyNode(next)) { - domUtils.remove(next); - } - } - - break; - } - } - } - }, - queryCommandValue: function() { - var range = this.selection.getRange(), - startNode, - floatStyle; - if (range.collapsed) { - return "none"; - } - startNode = range.getClosedNode(); - if (startNode && startNode.nodeType == 1 && startNode.tagName == "IMG") { - floatStyle = - domUtils.getComputedStyle(startNode, "float") || - startNode.getAttribute("align"); - - if (floatStyle == "none") { - floatStyle = domUtils.getComputedStyle( - startNode.parentNode, - "text-align" - ) == "center" - ? "center" - : floatStyle; - } - return { - left: 1, - right: 1, - center: 1 - }[floatStyle] - ? floatStyle - : "none"; - } - return "none"; - }, - queryCommandState: function() { - var range = this.selection.getRange(), - startNode; - - if (range.collapsed) return -1; - - startNode = range.getClosedNode(); - if (startNode && startNode.nodeType == 1 && startNode.tagName == "IMG") { - return 0; - } - return -1; - } -}; - -/** - * 插入图片 - * @command insertimage - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Object } opt 属性键值对,这些属性都将被复制到当前插入图片 - * @remind 该命令第二个参数可接受一个图片配置项对象的数组,可以插入多张图片, - * 此时数组的每一个元素都是一个Object类型的图片属性集合。 - * @example - * ```javascript - * editor.execCommand( 'insertimage', { - * src:'a/b/c.jpg', - * width:'100', - * height:'100' - * } ); - * ``` - * @example - * ```javascript - * editor.execCommand( 'insertimage', [{ - * src:'a/b/c.jpg', - * width:'100', - * height:'100' - * },{ - * src:'a/b/d.jpg', - * width:'100', - * height:'100' - * }] ); - * ``` - */ - -UE.commands["insertimage"] = { - execCommand: function(cmd, opt) { - opt = utils.isArray(opt) ? opt : [opt]; - if (!opt.length) { - return; - } - var me = this, - range = me.selection.getRange(), - img = range.getClosedNode(); - - if (me.fireEvent("beforeinsertimage", opt) === true) { - return; - } - - if ( - img && - /img/i.test(img.tagName) && - (img.className != "edui-faked-video" || - img.className.indexOf("edui-upload-video") != -1) && - !img.getAttribute("word_img") - ) { - var first = opt.shift(); - var floatStyle = first["floatStyle"]; - delete first["floatStyle"]; - //// img.style.border = (first.border||0) +"px solid #000"; - //// img.style.margin = (first.margin||0) +"px"; - // img.style.cssText += ';margin:' + (first.margin||0) +"px;" + 'border:' + (first.border||0) +"px solid #000"; - domUtils.setAttributes(img, first); - me.execCommand("imagefloat", floatStyle); - if (opt.length > 0) { - range.setStartAfter(img).setCursor(false, true); - me.execCommand("insertimage", opt); - } - } else { - var html = [], - str = "", - ci; - ci = opt[0]; - if (opt.length == 1) { - str = - '' + ci.alt + '"; - if (ci["floatStyle"] == "center") { - str = '

                      ' + str + "

                      "; - } - html.push(str); - } else { - for (var i = 0; (ci = opt[i++]); ) { - str = - "

                      "; - html.push(str); - } - } - - me.execCommand("insertHtml", html.join("")); - } - - me.fireEvent("afterinsertimage", opt); - } -}; - - -// plugins/justify.js -/** - * 段落格式 - * @file - * @since 1.2.6.1 - */ - -/** - * 段落对齐方式 - * @command justify - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } align 对齐方式:left => 居左,right => 居右,center => 居中,justify => 两端对齐 - * @example - * ```javascript - * editor.execCommand( 'justify', 'center' ); - * ``` - */ -/** - * 如果选区所在位置是段落区域,返回当前段落对齐方式 - * @command justify - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回段落对齐方式 - * @example - * ```javascript - * editor.queryCommandValue( 'justify' ); - * ``` - */ - -UE.plugins["justify"] = function() { - var me = this, - block = domUtils.isBlockElm, - defaultValue = { - left: 1, - right: 1, - center: 1, - justify: 1 - }, - doJustify = function(range, style) { - var bookmark = range.createBookmark(), - filterFn = function(node) { - return node.nodeType == 1 - ? node.tagName.toLowerCase() != "br" && - !domUtils.isBookmarkNode(node) - : !domUtils.isWhitespace(node); - }; - - range.enlarge(true); - var bookmark2 = range.createBookmark(), - current = domUtils.getNextDomNode(bookmark2.start, false, filterFn), - tmpRange = range.cloneRange(), - tmpNode; - while ( - current && - !( - domUtils.getPosition(current, bookmark2.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - if (current.nodeType == 3 || !block(current)) { - tmpRange.setStartBefore(current); - while (current && current !== bookmark2.end && !block(current)) { - tmpNode = current; - current = domUtils.getNextDomNode(current, false, null, function( - node - ) { - return !block(node); - }); - } - tmpRange.setEndAfter(tmpNode); - var common = tmpRange.getCommonAncestor(); - if (!domUtils.isBody(common) && block(common)) { - domUtils.setStyles( - common, - utils.isString(style) ? { "text-align": style } : style - ); - current = common; - } else { - var p = range.document.createElement("p"); - domUtils.setStyles( - p, - utils.isString(style) ? { "text-align": style } : style - ); - var frag = tmpRange.extractContents(); - p.appendChild(frag); - tmpRange.insertNode(p); - current = p; - } - current = domUtils.getNextDomNode(current, false, filterFn); - } else { - current = domUtils.getNextDomNode(current, true, filterFn); - } - } - return range.moveToBookmark(bookmark2).moveToBookmark(bookmark); - }; - - UE.commands["justify"] = { - execCommand: function(cmdName, align) { - var range = this.selection.getRange(), - txt; - - //闭合时单独处理 - if (range.collapsed) { - txt = this.document.createTextNode("p"); - range.insertNode(txt); - } - doJustify(range, align); - if (txt) { - range.setStartBefore(txt).collapse(true); - domUtils.remove(txt); - } - - range.select(); - - return true; - }, - queryCommandValue: function() { - var startNode = this.selection.getStart(), - value = domUtils.getComputedStyle(startNode, "text-align"); - return defaultValue[value] ? value : "left"; - }, - queryCommandState: function() { - var start = this.selection.getStart(), - cell = - start && - domUtils.findParentByTagName(start, ["td", "th", "caption"], true); - - return cell ? -1 : 0; - } - }; -}; - - -// plugins/font.js -/** - * 字体颜色,背景色,字号,字体,下划线,删除线 - * @file - * @since 1.2.6.1 - */ - -/** - * 字体颜色 - * @command forecolor - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } value 色值(必须十六进制) - * @example - * ```javascript - * editor.execCommand( 'forecolor', '#000' ); - * ``` - */ -/** - * 返回选区字体颜色 - * @command forecolor - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回字体颜色 - * @example - * ```javascript - * editor.queryCommandValue( 'forecolor' ); - * ``` - */ - -/** - * 字体背景颜色 - * @command backcolor - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } value 色值(必须十六进制) - * @example - * ```javascript - * editor.execCommand( 'backcolor', '#000' ); - * ``` - */ -/** - * 返回选区字体颜色 - * @command backcolor - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回字体背景颜色 - * @example - * ```javascript - * editor.queryCommandValue( 'backcolor' ); - * ``` - */ - -/** - * 字体大小 - * @command fontsize - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } value 字体大小 - * @example - * ```javascript - * editor.execCommand( 'fontsize', '14px' ); - * ``` - */ -/** - * 返回选区字体大小 - * @command fontsize - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回字体大小 - * @example - * ```javascript - * editor.queryCommandValue( 'fontsize' ); - * ``` - */ - -/** - * 字体样式 - * @command fontfamily - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } value 字体样式 - * @example - * ```javascript - * editor.execCommand( 'fontfamily', '微软雅黑' ); - * ``` - */ -/** - * 返回选区字体样式 - * @command fontfamily - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回字体样式 - * @example - * ```javascript - * editor.queryCommandValue( 'fontfamily' ); - * ``` - */ - -/** - * 字体下划线,与删除线互斥 - * @command underline - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'underline' ); - * ``` - */ - -/** - * 字体删除线,与下划线互斥 - * @command strikethrough - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'strikethrough' ); - * ``` - */ - -/** - * 字体边框 - * @command fontborder - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'fontborder' ); - * ``` - */ - -UE.plugins["font"] = function() { - var me = this, - fonts = { - forecolor: "color", - backcolor: "background-color", - fontsize: "font-size", - fontfamily: "font-family", - underline: "text-decoration", - strikethrough: "text-decoration", - fontborder: "border" - }, - needCmd = { underline: 1, strikethrough: 1, fontborder: 1 }, - needSetChild = { - forecolor: "color", - backcolor: "background-color", - fontsize: "font-size", - fontfamily: "font-family" - }; - me.setOpt({ - fontfamily: [ - { name: "songti", val: "宋体,SimSun" }, - { name: "yahei", val: "微软雅黑,Microsoft YaHei" }, - { name: "kaiti", val: "楷体,楷体_GB2312, SimKai" }, - { name: "heiti", val: "黑体, SimHei" }, - { name: "lishu", val: "隶书, SimLi" }, - { name: "andaleMono", val: "andale mono" }, - { name: "arial", val: "arial, helvetica,sans-serif" }, - { name: "arialBlack", val: "arial black,avant garde" }, - { name: "comicSansMs", val: "comic sans ms" }, - { name: "impact", val: "impact,chicago" }, - { name: "timesNewRoman", val: "times new roman" } - ], - fontsize: [10, 11, 12, 14, 16, 18, 20, 24, 36] - }); - - function mergeWithParent(node) { - var parent; - while ((parent = node.parentNode)) { - if ( - parent.tagName == "SPAN" && - domUtils.getChildCount(parent, function(child) { - return !domUtils.isBookmarkNode(child) && !domUtils.isBr(child); - }) == 1 - ) { - parent.style.cssText += node.style.cssText; - domUtils.remove(node, true); - node = parent; - } else { - break; - } - } - } - function mergeChild(rng, cmdName, value) { - if (needSetChild[cmdName]) { - rng.adjustmentBoundary(); - if (!rng.collapsed && rng.startContainer.nodeType == 1) { - rng.traversal(function(node){ - var start; - if(domUtils.isTagNode(node,'span')){ - start = node; - }else{ - start = domUtils.getElementsByTagName(node,'span')[0]; - } - if (start && domUtils.isTagNode(start, "span")) { - var bk = rng.createBookmark(); - utils.each(domUtils.getElementsByTagName(start, "span"), function( - span - ) { - if (!span.parentNode || domUtils.isBookmarkNode(span)) return; - if ( - cmdName == "backcolor" && - domUtils - .getComputedStyle(span, "background-color") - .toLowerCase() === value - ) { - return; - } - domUtils.removeStyle(span, needSetChild[cmdName]); - if (span.style.cssText.replace(/^\s+$/, "").length == 0) { - domUtils.remove(span, true); - } - }); - rng.moveToBookmark(bk); - } - }); - } - } - } - function mergesibling(rng, cmdName, value) { - var collapsed = rng.collapsed, - bk = rng.createBookmark(), - common; - if (collapsed) { - common = bk.start.parentNode; - while (dtd.$inline[common.tagName]) { - common = common.parentNode; - } - } else { - common = domUtils.getCommonAncestor(bk.start, bk.end); - } - utils.each(domUtils.getElementsByTagName(common, "span"), function(span) { - if (!span.parentNode || domUtils.isBookmarkNode(span)) return; - if (/\s*border\s*:\s*none;?\s*/i.test(span.style.cssText)) { - if (/^\s*border\s*:\s*none;?\s*$/.test(span.style.cssText)) { - domUtils.remove(span, true); - } else { - domUtils.removeStyle(span, "border"); - } - return; - } - if ( - /border/i.test(span.style.cssText) && - span.parentNode.tagName == "SPAN" && - /border/i.test(span.parentNode.style.cssText) - ) { - span.style.cssText = span.style.cssText.replace( - /border[^:]*:[^;]+;?/gi, - "" - ); - } - if (!(cmdName == "fontborder" && value == "none")) { - var next = span.nextSibling; - while (next && next.nodeType == 1 && next.tagName == "SPAN") { - if (domUtils.isBookmarkNode(next) && cmdName == "fontborder") { - span.appendChild(next); - next = span.nextSibling; - continue; - } - if (next.style.cssText == span.style.cssText) { - domUtils.moveChild(next, span); - domUtils.remove(next); - } - if (span.nextSibling === next) break; - next = span.nextSibling; - } - } - - mergeWithParent(span); - if (browser.ie && browser.version > 8) { - //拷贝父亲们的特别的属性,这里只做背景颜色的处理 - var parent = domUtils.findParent(span, function(n) { - return ( - n.tagName == "SPAN" && /background-color/.test(n.style.cssText) - ); - }); - if (parent && !/background-color/.test(span.style.cssText)) { - span.style.backgroundColor = parent.style.backgroundColor; - } - } - }); - rng.moveToBookmark(bk); - mergeChild(rng, cmdName, value); - } - - me.addInputRule(function(root) { - utils.each(root.getNodesByTagName("u s del font strike"), function(node) { - if (node.tagName == "font") { - var cssStyle = []; - for (var p in node.attrs) { - switch (p) { - case "size": - cssStyle.push( - "font-size:" + - ({ - "1": "10", - "2": "12", - "3": "16", - "4": "18", - "5": "24", - "6": "32", - "7": "48" - }[node.attrs[p]] || node.attrs[p]) + - "px" - ); - break; - case "color": - cssStyle.push("color:" + node.attrs[p]); - break; - case "face": - cssStyle.push("font-family:" + node.attrs[p]); - break; - case "style": - cssStyle.push(node.attrs[p]); - } - } - node.attrs = { - style: cssStyle.join(";") - }; - } else { - var val = node.tagName == "u" ? "underline" : "line-through"; - node.attrs = { - style: (node.getAttr("style") || "") + "text-decoration:" + val + ";" - }; - } - node.tagName = "span"; - }); - // utils.each(root.getNodesByTagName('span'), function (node) { - // var val; - // if(val = node.getAttr('class')){ - // if(/fontstrikethrough/.test(val)){ - // node.setStyle('text-decoration','line-through'); - // if(node.attrs['class']){ - // node.attrs['class'] = node.attrs['class'].replace(/fontstrikethrough/,''); - // }else{ - // node.setAttr('class') - // } - // } - // if(/fontborder/.test(val)){ - // node.setStyle('border','1px solid #000'); - // if(node.attrs['class']){ - // node.attrs['class'] = node.attrs['class'].replace(/fontborder/,''); - // }else{ - // node.setAttr('class') - // } - // } - // } - // }); - }); - // me.addOutputRule(function(root){ - // utils.each(root.getNodesByTagName('span'), function (node) { - // var val; - // if(val = node.getStyle('text-decoration')){ - // if(/line-through/.test(val)){ - // if(node.attrs['class']){ - // node.attrs['class'] += ' fontstrikethrough'; - // }else{ - // node.setAttr('class','fontstrikethrough') - // } - // } - // - // node.setStyle('text-decoration') - // } - // if(val = node.getStyle('border')){ - // if(/1px/.test(val) && /solid/.test(val)){ - // if(node.attrs['class']){ - // node.attrs['class'] += ' fontborder'; - // - // }else{ - // node.setAttr('class','fontborder') - // } - // } - // node.setStyle('border') - // - // } - // }); - // }); - for (var p in fonts) { - (function(cmd, style) { - UE.commands[cmd] = { - execCommand: function(cmdName, value) { - value = - value || - (this.queryCommandState(cmdName) - ? "none" - : cmdName == "underline" - ? "underline" - : cmdName == "fontborder" ? "1px solid #000" : "line-through"); - var me = this, - range = this.selection.getRange(), - text; - - if (value == "default") { - if (range.collapsed) { - text = me.document.createTextNode("font"); - range.insertNode(text).select(); - } - me.execCommand("removeFormat", "span,a", style); - if (text) { - range.setStartBefore(text).collapse(true); - domUtils.remove(text); - } - mergesibling(range, cmdName, value); - range.select(); - } else { - if (!range.collapsed) { - if (needCmd[cmd] && me.queryCommandValue(cmd)) { - me.execCommand("removeFormat", "span,a", style); - } - range = me.selection.getRange(); - - range.applyInlineStyle("span", { style: style + ":" + value }); - mergesibling(range, cmdName, value); - range.select(); - } else { - var span = domUtils.findParentByTagName( - range.startContainer, - "span", - true - ); - text = me.document.createTextNode("font"); - if ( - span && - !span.children.length && - !span[browser.ie ? "innerText" : "textContent"].replace( - fillCharReg, - "" - ).length - ) { - //for ie hack when enter - range.insertNode(text); - if (needCmd[cmd]) { - range.selectNode(text).select(); - me.execCommand("removeFormat", "span,a", style, null); - - span = domUtils.findParentByTagName(text, "span", true); - range.setStartBefore(text); - } - span && (span.style.cssText += ";" + style + ":" + value); - range.collapse(true).select(); - } else { - range.insertNode(text); - range.selectNode(text).select(); - span = range.document.createElement("span"); - - if (needCmd[cmd]) { - //a标签内的不处理跳过 - if (domUtils.findParentByTagName(text, "a", true)) { - range.setStartBefore(text).setCursor(); - domUtils.remove(text); - return; - } - me.execCommand("removeFormat", "span,a", style); - } - - span.style.cssText = style + ":" + value; - - text.parentNode.insertBefore(span, text); - //修复,span套span 但样式不继承的问题 - if (!browser.ie || (browser.ie && browser.version == 9)) { - var spanParent = span.parentNode; - while (!domUtils.isBlockElm(spanParent)) { - if (spanParent.tagName == "SPAN") { - //opera合并style不会加入";" - span.style.cssText = - spanParent.style.cssText + ";" + span.style.cssText; - } - spanParent = spanParent.parentNode; - } - } - - if (opera) { - setTimeout(function() { - range.setStart(span, 0).collapse(true); - mergesibling(range, cmdName, value); - range.select(); - }); - } else { - range.setStart(span, 0).collapse(true); - mergesibling(range, cmdName, value); - range.select(); - } - - //trace:981 - //domUtils.mergeToParent(span) - } - domUtils.remove(text); - } - } - return true; - }, - queryCommandValue: function(cmdName) { - var startNode = this.selection.getStart(); - - //trace:946 - if (cmdName == "underline" || cmdName == "strikethrough") { - var tmpNode = startNode, - value; - while ( - tmpNode && - !domUtils.isBlockElm(tmpNode) && - !domUtils.isBody(tmpNode) - ) { - if (tmpNode.nodeType == 1) { - value = domUtils.getComputedStyle(tmpNode, style); - if (value != "none") { - return value; - } - } - - tmpNode = tmpNode.parentNode; - } - return "none"; - } - if (cmdName == "fontborder") { - var tmp = startNode, - val; - while (tmp && dtd.$inline[tmp.tagName]) { - if ((val = domUtils.getComputedStyle(tmp, "border"))) { - if (/1px/.test(val) && /solid/.test(val)) { - return val; - } - } - tmp = tmp.parentNode; - } - return ""; - } - - if (cmdName == "FontSize") { - var styleVal = domUtils.getComputedStyle(startNode, style), - tmp = /^([\d\.]+)(\w+)$/.exec(styleVal); - - if (tmp) { - return Math.floor(tmp[1]) + tmp[2]; - } - - return styleVal; - } - - return domUtils.getComputedStyle(startNode, style); - }, - queryCommandState: function(cmdName) { - if (!needCmd[cmdName]) return 0; - var val = this.queryCommandValue(cmdName); - if (cmdName == "fontborder") { - return /1px/.test(val) && /solid/.test(val); - } else { - return cmdName == "underline" - ? /underline/.test(val) - : /line\-through/.test(val); - } - } - }; - })(p, fonts[p]); - } -}; - - -// plugins/link.js -/** - * 超链接 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入超链接 - * @command link - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Object } options 设置自定义属性,例如:url、title、target - * @example - * ```javascript - * editor.execCommand( 'link', '{ - * url:'neditor.baidu.com', - * title:'neditor', - * target:'_blank' - * }' ); - * ``` - */ -/** - * 返回当前选中的第一个超链接节点 - * @command link - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { Element } 超链接节点 - * @example - * ```javascript - * editor.queryCommandValue( 'link' ); - * ``` - */ - -/** - * 取消超链接 - * @command unlink - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'unlink'); - * ``` - */ - -UE.plugins["link"] = function() { - function optimize(range) { - var start = range.startContainer, - end = range.endContainer; - - if ((start = domUtils.findParentByTagName(start, "a", true))) { - range.setStartBefore(start); - } - if ((end = domUtils.findParentByTagName(end, "a", true))) { - range.setEndAfter(end); - } - } - - UE.commands["unlink"] = { - execCommand: function() { - var range = this.selection.getRange(), - bookmark; - if ( - range.collapsed && - !domUtils.findParentByTagName(range.startContainer, "a", true) - ) { - return; - } - bookmark = range.createBookmark(); - optimize(range); - range.removeInlineStyle("a").moveToBookmark(bookmark).select(); - }, - queryCommandState: function() { - return !this.highlight && this.queryCommandValue("link") ? 0 : -1; - } - }; - function doLink(range, opt, me) { - var rngClone = range.cloneRange(), - link = me.queryCommandValue("link"); - optimize((range = range.adjustmentBoundary())); - var start = range.startContainer; - if (start.nodeType == 1 && link) { - start = start.childNodes[range.startOffset]; - if ( - start && - start.nodeType == 1 && - start.tagName == "A" && - /^(?:https?|ftp|file)\s*:\s*\/\//.test( - start[browser.ie ? "innerText" : "textContent"] - ) - ) { - start[browser.ie ? "innerText" : "textContent"] = utils.html( - opt.textValue || opt.href - ); - } - } - if (!rngClone.collapsed || link) { - range.removeInlineStyle("a"); - rngClone = range.cloneRange(); - } - - if (rngClone.collapsed) { - var a = range.document.createElement("a"), - text = ""; - if (opt.textValue) { - text = utils.html(opt.textValue); - delete opt.textValue; - } else { - text = utils.html(opt.href); - } - domUtils.setAttributes(a, opt); - start = domUtils.findParentByTagName(rngClone.startContainer, "a", true); - if (start && domUtils.isInNodeEndBoundary(rngClone, start)) { - range.setStartAfter(start).collapse(true); - } - a[browser.ie ? "innerText" : "textContent"] = text; - range.insertNode(a).selectNode(a); - } else { - range.applyInlineStyle("a", opt); - } - } - UE.commands["link"] = { - execCommand: function(cmdName, opt) { - var range; - opt._href && (opt._href = utils.unhtml(opt._href, /[<">]/g)); - opt.href && (opt.href = utils.unhtml(opt.href, /[<">]/g)); - opt.textValue && (opt.textValue = utils.unhtml(opt.textValue, /[<">]/g)); - doLink((range = this.selection.getRange()), opt, this); - //闭合都不加占位符,如果加了会在a后边多个占位符节点,导致a是图片背景组成的列表,出现空白问题 - range.collapse().select(true); - }, - queryCommandValue: function() { - var range = this.selection.getRange(), - node; - if (range.collapsed) { - // node = this.selection.getStart(); - //在ie下getstart()取值偏上了 - node = range.startContainer; - node = node.nodeType == 1 ? node : node.parentNode; - - if ( - node && - (node = domUtils.findParentByTagName(node, "a", true)) && - !domUtils.isInNodeEndBoundary(range, node) - ) { - return node; - } - } else { - //trace:1111 如果是

                      xx

                      startContainer是p就会找不到a - range.shrinkBoundary(); - var start = range.startContainer.nodeType == 3 || - !range.startContainer.childNodes[range.startOffset] - ? range.startContainer - : range.startContainer.childNodes[range.startOffset], - end = range.endContainer.nodeType == 3 || range.endOffset == 0 - ? range.endContainer - : range.endContainer.childNodes[range.endOffset - 1], - common = range.getCommonAncestor(); - node = domUtils.findParentByTagName(common, "a", true); - if (!node && common.nodeType == 1) { - var as = common.getElementsByTagName("a"), - ps, - pe; - - for (var i = 0, ci; (ci = as[i++]); ) { - (ps = domUtils.getPosition(ci, start)), (pe = domUtils.getPosition( - ci, - end - )); - if ( - (ps & domUtils.POSITION_FOLLOWING || - ps & domUtils.POSITION_CONTAINS) && - (pe & domUtils.POSITION_PRECEDING || - pe & domUtils.POSITION_CONTAINS) - ) { - node = ci; - break; - } - } - } - return node; - } - }, - queryCommandState: function() { - //判断如果是视频的话连接不可用 - //fix 853 - var img = this.selection.getRange().getClosedNode(), - flag = - img && - (img.className == "edui-faked-video" || - img.className.indexOf("edui-upload-video") != -1); - return flag ? -1 : 0; - } - }; -}; - - -// plugins/iframe.js -///import core -///import plugins\inserthtml.js -///commands 插入框架 -///commandsName InsertFrame -///commandsTitle 插入Iframe -///commandsDialog dialogs\insertframe - -UE.plugins["insertframe"] = function() { - var me = this; - function deleteIframe() { - me._iframe && delete me._iframe; - } - - me.addListener("selectionchange", function() { - deleteIframe(); - }); -}; - - -// plugins/scrawl.js -///import core -///commands 涂鸦 -///commandsName Scrawl -///commandsTitle 涂鸦 -///commandsDialog dialogs\scrawl -UE.commands["scrawl"] = { - queryCommandState: function() { - return browser.ie && browser.version <= 8 ? -1 : 0; - } -}; - - -// plugins/removeformat.js -/** - * 清除格式 - * @file - * @since 1.2.6.1 - */ - -/** - * 清除文字样式 - * @command removeformat - * @method execCommand - * @param { String } cmd 命令字符串 - * @param {String} tags 以逗号隔开的标签。如:strong - * @param {String} style 样式如:color - * @param {String} attrs 属性如:width - * @example - * ```javascript - * editor.execCommand( 'removeformat', 'strong','color','width' ); - * ``` - */ - -UE.plugins["removeformat"] = function() { - var me = this; - me.setOpt({ - removeFormatTags: - "b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var", - removeFormatAttributes: "class,style,lang,width,height,align,hspace,valign" - }); - me.commands["removeformat"] = { - execCommand: function(cmdName, tags, style, attrs, notIncludeA) { - var tagReg = new RegExp( - "^(?:" + - (tags || this.options.removeFormatTags).replace(/,/g, "|") + - ")$", - "i" - ), - removeFormatAttributes = style - ? [] - : (attrs || this.options.removeFormatAttributes).split(","), - range = new dom.Range(this.document), - bookmark, - node, - parent, - filter = function(node) { - return node.nodeType == 1; - }; - - function isRedundantSpan(node) { - if (node.nodeType == 3 || node.tagName.toLowerCase() != "span") { - return 0; - } - if (browser.ie) { - //ie 下判断实效,所以只能简单用style来判断 - //return node.style.cssText == '' ? 1 : 0; - var attrs = node.attributes; - if (attrs.length) { - for (var i = 0, l = attrs.length; i < l; i++) { - if (attrs[i].specified) { - return 0; - } - } - return 1; - } - } - return !node.attributes.length; - } - function doRemove(range) { - var bookmark1 = range.createBookmark(); - if (range.collapsed) { - range.enlarge(true); - } - - //不能把a标签切了 - if (!notIncludeA) { - var aNode = domUtils.findParentByTagName( - range.startContainer, - "a", - true - ); - if (aNode) { - range.setStartBefore(aNode); - } - - aNode = domUtils.findParentByTagName(range.endContainer, "a", true); - if (aNode) { - range.setEndAfter(aNode); - } - } - - bookmark = range.createBookmark(); - - node = bookmark.start; - - //切开始 - while ((parent = node.parentNode) && !domUtils.isBlockElm(parent)) { - domUtils.breakParent(node, parent); - - domUtils.clearEmptySibling(node); - } - if (bookmark.end) { - //切结束 - node = bookmark.end; - while ((parent = node.parentNode) && !domUtils.isBlockElm(parent)) { - domUtils.breakParent(node, parent); - domUtils.clearEmptySibling(node); - } - - //开始去除样式 - var current = domUtils.getNextDomNode(bookmark.start, false, filter), - next; - while (current) { - if (current == bookmark.end) { - break; - } - - next = domUtils.getNextDomNode(current, true, filter); - - if ( - !dtd.$empty[current.tagName.toLowerCase()] && - !domUtils.isBookmarkNode(current) - ) { - if (tagReg.test(current.tagName)) { - if (style) { - domUtils.removeStyle(current, style); - if (isRedundantSpan(current) && style != "text-decoration") { - domUtils.remove(current, true); - } - } else { - domUtils.remove(current, true); - } - } else { - //trace:939 不能把list上的样式去掉 - if ( - !dtd.$tableContent[current.tagName] && - !dtd.$list[current.tagName] - ) { - domUtils.removeAttributes(current, removeFormatAttributes); - if (isRedundantSpan(current)) { - domUtils.remove(current, true); - } - } - } - } - current = next; - } - } - //trace:1035 - //trace:1096 不能把td上的样式去掉,比如边框 - var pN = bookmark.start.parentNode; - if ( - domUtils.isBlockElm(pN) && - !dtd.$tableContent[pN.tagName] && - !dtd.$list[pN.tagName] - ) { - domUtils.removeAttributes(pN, removeFormatAttributes); - } - pN = bookmark.end.parentNode; - if ( - bookmark.end && - domUtils.isBlockElm(pN) && - !dtd.$tableContent[pN.tagName] && - !dtd.$list[pN.tagName] - ) { - domUtils.removeAttributes(pN, removeFormatAttributes); - } - range.moveToBookmark(bookmark).moveToBookmark(bookmark1); - //清除冗余的代码 - var node = range.startContainer, - tmp, - collapsed = range.collapsed; - while ( - node.nodeType == 1 && - domUtils.isEmptyNode(node) && - dtd.$removeEmpty[node.tagName] - ) { - tmp = node.parentNode; - range.setStartBefore(node); - //trace:937 - //更新结束边界 - if (range.startContainer === range.endContainer) { - range.endOffset--; - } - domUtils.remove(node); - node = tmp; - } - - if (!collapsed) { - node = range.endContainer; - while ( - node.nodeType == 1 && - domUtils.isEmptyNode(node) && - dtd.$removeEmpty[node.tagName] - ) { - tmp = node.parentNode; - range.setEndBefore(node); - domUtils.remove(node); - - node = tmp; - } - } - } - - range = this.selection.getRange(); - doRemove(range); - range.select(); - } - }; -}; - - -// plugins/blockquote.js -/** - * 添加引用 - * @file - * @since 1.2.6.1 - */ - -/** - * 添加引用 - * @command blockquote - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'blockquote' ); - * ``` - */ - -/** - * 添加引用 - * @command blockquote - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Object } attrs 节点属性 - * @example - * ```javascript - * editor.execCommand( 'blockquote',{ - * style: "color: red;" - * } ); - * ``` - */ - -UE.plugins["blockquote"] = function() { - var me = this; - function getObj(editor) { - return domUtils.filterNodeList( - editor.selection.getStartElementPath(), - "blockquote" - ); - } - me.commands["blockquote"] = { - execCommand: function(cmdName, attrs) { - var range = this.selection.getRange(), - obj = getObj(this), - blockquote = dtd.blockquote, - bookmark = range.createBookmark(); - - if (obj) { - var start = range.startContainer, - startBlock = domUtils.isBlockElm(start) - ? start - : domUtils.findParent(start, function(node) { - return domUtils.isBlockElm(node); - }), - end = range.endContainer, - endBlock = domUtils.isBlockElm(end) - ? end - : domUtils.findParent(end, function(node) { - return domUtils.isBlockElm(node); - }); - - //处理一下li - startBlock = - domUtils.findParentByTagName(startBlock, "li", true) || startBlock; - endBlock = - domUtils.findParentByTagName(endBlock, "li", true) || endBlock; - - if ( - startBlock.tagName == "LI" || - startBlock.tagName == "TD" || - startBlock === obj || - domUtils.isBody(startBlock) - ) { - domUtils.remove(obj, true); - } else { - domUtils.breakParent(startBlock, obj); - } - - if (startBlock !== endBlock) { - obj = domUtils.findParentByTagName(endBlock, "blockquote"); - if (obj) { - if ( - endBlock.tagName == "LI" || - endBlock.tagName == "TD" || - domUtils.isBody(endBlock) - ) { - obj.parentNode && domUtils.remove(obj, true); - } else { - domUtils.breakParent(endBlock, obj); - } - } - } - - var blockquotes = domUtils.getElementsByTagName( - this.document, - "blockquote" - ); - for (var i = 0, bi; (bi = blockquotes[i++]); ) { - if (!bi.childNodes.length) { - domUtils.remove(bi); - } else if ( - domUtils.getPosition(bi, startBlock) & - domUtils.POSITION_FOLLOWING && - domUtils.getPosition(bi, endBlock) & domUtils.POSITION_PRECEDING - ) { - domUtils.remove(bi, true); - } - } - } else { - var tmpRange = range.cloneRange(), - node = tmpRange.startContainer.nodeType == 1 - ? tmpRange.startContainer - : tmpRange.startContainer.parentNode, - preNode = node, - doEnd = 1; - - //调整开始 - while (1) { - if (domUtils.isBody(node)) { - if (preNode !== node) { - if (range.collapsed) { - tmpRange.selectNode(preNode); - doEnd = 0; - } else { - tmpRange.setStartBefore(preNode); - } - } else { - tmpRange.setStart(node, 0); - } - - break; - } - if (!blockquote[node.tagName]) { - if (range.collapsed) { - tmpRange.selectNode(preNode); - } else { - tmpRange.setStartBefore(preNode); - } - break; - } - - preNode = node; - node = node.parentNode; - } - - //调整结束 - if (doEnd) { - preNode = node = node = tmpRange.endContainer.nodeType == 1 - ? tmpRange.endContainer - : tmpRange.endContainer.parentNode; - while (1) { - if (domUtils.isBody(node)) { - if (preNode !== node) { - tmpRange.setEndAfter(preNode); - } else { - tmpRange.setEnd(node, node.childNodes.length); - } - - break; - } - if (!blockquote[node.tagName]) { - tmpRange.setEndAfter(preNode); - break; - } - - preNode = node; - node = node.parentNode; - } - } - - node = range.document.createElement("blockquote"); - domUtils.setAttributes(node, attrs); - node.appendChild(tmpRange.extractContents()); - tmpRange.insertNode(node); - //去除重复的 - var childs = domUtils.getElementsByTagName(node, "blockquote"); - for (var i = 0, ci; (ci = childs[i++]); ) { - if (ci.parentNode) { - domUtils.remove(ci, true); - } - } - } - range.moveToBookmark(bookmark).select(); - }, - queryCommandState: function() { - return getObj(this) ? 1 : 0; - } - }; -}; - - -// plugins/convertcase.js -/** - * 大小写转换 - * @file - * @since 1.2.6.1 - */ - -/** - * 把选区内文本变大写,与“tolowercase”命令互斥 - * @command touppercase - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'touppercase' ); - * ``` - */ - -/** - * 把选区内文本变小写,与“touppercase”命令互斥 - * @command tolowercase - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'tolowercase' ); - * ``` - */ -UE.commands["touppercase"] = UE.commands["tolowercase"] = { - execCommand: function(cmd) { - var me = this; - var rng = me.selection.getRange(); - if (rng.collapsed) { - return rng; - } - var bk = rng.createBookmark(), - bkEnd = bk.end, - filterFn = function(node) { - return !domUtils.isBr(node) && !domUtils.isWhitespace(node); - }, - curNode = domUtils.getNextDomNode(bk.start, false, filterFn); - while ( - curNode && - domUtils.getPosition(curNode, bkEnd) & domUtils.POSITION_PRECEDING - ) { - if (curNode.nodeType == 3) { - curNode.nodeValue = curNode.nodeValue[ - cmd == "touppercase" ? "toUpperCase" : "toLowerCase" - ](); - } - curNode = domUtils.getNextDomNode(curNode, true, filterFn); - if (curNode === bkEnd) { - break; - } - } - rng.moveToBookmark(bk).select(); - } -}; - - -// plugins/indent.js -/** - * 首行缩进 - * @file - * @since 1.2.6.1 - */ - -/** - * 缩进 - * @command indent - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'indent' ); - * ``` - */ -UE.commands["indent"] = { - execCommand: function() { - var me = this, - value = me.queryCommandState("indent") - ? "0em" - : me.options.indentValue || "2em"; - me.execCommand("Paragraph", "p", { style: "text-indent:" + value }); - }, - queryCommandState: function() { - var pN = domUtils.filterNodeList( - this.selection.getStartElementPath(), - "p h1 h2 h3 h4 h5 h6" - ); - return pN && pN.style.textIndent && parseInt(pN.style.textIndent) ? 1 : 0; - } -}; - - -// plugins/print.js -/** - * 打印 - * @file - * @since 1.2.6.1 - */ - -/** - * 打印 - * @command print - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'print' ); - * ``` - */ -UE.commands["print"] = { - execCommand: function() { - this.window.print(); - }, - notNeedUndo: 1 -}; - - -// plugins/preview.js -/** - * 预览 - * @file - * @since 1.2.6.1 - */ - -/** - * 预览 - * @command preview - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'preview' ); - * ``` - */ -UE.commands["preview"] = { - execCommand: function() { - var w = window.open("", "_blank", ""), - d = w.document; - d.open(); - d.write( - '
                      " + - this.getContent(null, null, true) + - "
                      " - ); - d.close(); - }, - notNeedUndo: 1 -}; - - -// plugins/selectall.js -/** - * 全选 - * @file - * @since 1.2.6.1 - */ - -/** - * 选中所有内容 - * @command selectall - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'selectall' ); - * ``` - */ -UE.plugins["selectall"] = function() { - var me = this; - me.commands["selectall"] = { - execCommand: function() { - //去掉了原生的selectAll,因为会出现报错和当内容为空时,不能出现闭合状态的光标 - var me = this, - body = me.body, - range = me.selection.getRange(); - range.selectNodeContents(body); - if (domUtils.isEmptyBlock(body)) { - //opera不能自动合并到元素的里边,要手动处理一下 - if (browser.opera && body.firstChild && body.firstChild.nodeType == 1) { - range.setStartAtFirst(body.firstChild); - } - range.collapse(true); - } - range.select(true); - }, - notNeedUndo: 1 - }; - - //快捷键 - me.addshortcutkey({ - selectAll: "ctrl+65" - }); -}; - - -// plugins/paragraph.js -/** - * 段落样式 - * @file - * @since 1.2.6.1 - */ - -/** - * 段落格式 - * @command paragraph - * @method execCommand - * @param { String } cmd 命令字符串 - * @param {String} style 标签值为:'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' - * @param {Object} attrs 标签的属性 - * @example - * ```javascript - * editor.execCommand( 'Paragraph','h1','{ - * class:'test' - * }' ); - * ``` - */ - -/** - * 返回选区内节点标签名 - * @command paragraph - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 节点标签名 - * @example - * ```javascript - * editor.queryCommandValue( 'Paragraph' ); - * ``` - */ - -UE.plugins["paragraph"] = function () { - var me = this, - block = domUtils.isBlockElm, - notExchange = ["TD", "LI", "PRE"], - doParagraph = function (range, style, attrs, sourceCmdName) { - var bookmark = range.createBookmark(), - filterFn = function (node) { - return node.nodeType == 1 - ? node.tagName.toLowerCase() != "br" && - !domUtils.isBookmarkNode(node) - : !domUtils.isWhitespace(node); - }, - para; - - range.enlarge(true); - var bookmark2 = range.createBookmark(), - current = domUtils.getNextDomNode(bookmark2.start, false, filterFn), - tmpRange = range.cloneRange(), - tmpNode; - while ( - current && - !( - domUtils.getPosition(current, bookmark2.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - if (current.nodeType == 3 || !block(current)) { - tmpRange.setStartBefore(current); - while (current && current !== bookmark2.end && !block(current)) { - tmpNode = current; - current = domUtils.getNextDomNode(current, false, null, function ( - node - ) { - return !block(node); - }); - } - tmpRange.setEndAfter(tmpNode); - - para = range.document.createElement(style); - if (attrs) { - domUtils.setAttributes(para, attrs); - if ( - sourceCmdName && - sourceCmdName == "customstyle" && - attrs.style - ) { - para.style.cssText = attrs.style; - } - } - para.appendChild(tmpRange.extractContents()); - //需要内容占位 - if (domUtils.isEmptyNode(para)) { - domUtils.fillChar(range.document, para); - } - - tmpRange.insertNode(para); - - var parent = para.parentNode; - //如果para上一级是一个block元素且不是body,td就删除它 - if ( - block(parent) && - !domUtils.isBody(para.parentNode) && - utils.indexOf(notExchange, parent.tagName) == -1 - ) { - //存储dir,style - if (!(sourceCmdName && sourceCmdName == "customstyle")) { - parent.getAttribute("dir") && - para.setAttribute("dir", parent.getAttribute("dir")); - //trace:1070 - parent.style.cssText && - (para.style.cssText = - parent.style.cssText + ";" + para.style.cssText); - //trace:1030 - parent.style.textAlign && - !para.style.textAlign && - (para.style.textAlign = parent.style.textAlign); - parent.style.textIndent && - !para.style.textIndent && - (para.style.textIndent = parent.style.textIndent); - parent.style.padding && - !para.style.padding && - (para.style.padding = parent.style.padding); - } - - //trace:1706 选择的就是h1-6要删除 - if ( - attrs && - /h\d/i.test(parent.tagName) && - !/h\d/i.test(para.tagName) - ) { - domUtils.setAttributes(parent, attrs); - if ( - sourceCmdName && - sourceCmdName == "customstyle" && - attrs.style - ) { - parent.style.cssText = attrs.style; - } - domUtils.remove(para, true); - para = parent; - } else { - domUtils.remove(para.parentNode, true); - } - } - - if (utils.indexOf(notExchange, parent.tagName) != -1) { - current = parent; - } else { - current = para; - } - - current = domUtils.getNextDomNode(current, false, filterFn); - } else { - current = domUtils.getNextDomNode(current, true, filterFn); - } - } - return range.moveToBookmark(bookmark2).moveToBookmark(bookmark); - }; - me.setOpt("paragraph", { - p: "", - h1: "", - h2: "", - h3: "", - h4: "", - h5: "", - h6: "" - }); - me.commands["paragraph"] = { - execCommand: function (cmdName, style, attrs, sourceCmdName) { - var range = this.selection.getRange(); - //闭合时单独处理 - if (range.collapsed) { - var txt = this.document.createTextNode("p"); - range.insertNode(txt); - //去掉冗余的fillchar - if (browser.ie) { - var node = txt.previousSibling; - if (node && domUtils.isWhitespace(node)) { - domUtils.remove(node); - } - node = txt.nextSibling; - if (node && domUtils.isWhitespace(node)) { - domUtils.remove(node); - } - } - } - range = doParagraph(range, style, attrs, sourceCmdName); - if (txt) { - range.setStartBefore(txt).collapse(true); - pN = txt.parentNode; - - domUtils.remove(txt); - - if (domUtils.isBlockElm(pN) && domUtils.isEmptyNode(pN)) { - domUtils.fillNode(this.document, pN); - } - } - - if ( - browser.gecko && - range.collapsed && - range.startContainer.nodeType == 1 - ) { - var child = range.startContainer.childNodes[range.startOffset]; - if ( - child && - child.nodeType == 1 && - child.tagName.toLowerCase() == style - ) { - range.setStart(child, 0).collapse(true); - } - } - //trace:1097 原来有true,原因忘了,但去了就不能清除多余的占位符了 - range.select(); - - return true; - }, - queryCommandValue: function () { - var node = domUtils.filterNodeList( - this.selection.getStartElementPath(), - "p h1 h2 h3 h4 h5 h6" - ); - return node ? node.tagName.toLowerCase() : ""; - } - }; -}; - - -// plugins/directionality.js -/** - * 设置文字输入的方向的插件 - * @file - * @since 1.2.6.1 - */ -;(function() { - var block = domUtils.isBlockElm, - getObj = function(editor) { - // var startNode = editor.selection.getStart(), - // parents; - // if ( startNode ) { - // //查找所有的是block的父亲节点 - // parents = domUtils.findParents( startNode, true, block, true ); - // for ( var i = 0,ci; ci = parents[i++]; ) { - // if ( ci.getAttribute( 'dir' ) ) { - // return ci; - // } - // } - // } - return domUtils.filterNodeList( - editor.selection.getStartElementPath(), - function(n) { - return n && n.nodeType == 1 && n.getAttribute("dir"); - } - ); - }, - doDirectionality = function(range, editor, forward) { - var bookmark, - filterFn = function(node) { - return node.nodeType == 1 - ? !domUtils.isBookmarkNode(node) - : !domUtils.isWhitespace(node); - }, - obj = getObj(editor); - - if (obj && range.collapsed) { - obj.setAttribute("dir", forward); - return range; - } - bookmark = range.createBookmark(); - range.enlarge(true); - var bookmark2 = range.createBookmark(), - current = domUtils.getNextDomNode(bookmark2.start, false, filterFn), - tmpRange = range.cloneRange(), - tmpNode; - while ( - current && - !( - domUtils.getPosition(current, bookmark2.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - if (current.nodeType == 3 || !block(current)) { - tmpRange.setStartBefore(current); - while (current && current !== bookmark2.end && !block(current)) { - tmpNode = current; - current = domUtils.getNextDomNode(current, false, null, function( - node - ) { - return !block(node); - }); - } - tmpRange.setEndAfter(tmpNode); - var common = tmpRange.getCommonAncestor(); - if (!domUtils.isBody(common) && block(common)) { - //遍历到了block节点 - common.setAttribute("dir", forward); - current = common; - } else { - //没有遍历到,添加一个block节点 - var p = range.document.createElement("p"); - p.setAttribute("dir", forward); - var frag = tmpRange.extractContents(); - p.appendChild(frag); - tmpRange.insertNode(p); - current = p; - } - - current = domUtils.getNextDomNode(current, false, filterFn); - } else { - current = domUtils.getNextDomNode(current, true, filterFn); - } - } - return range.moveToBookmark(bookmark2).moveToBookmark(bookmark); - }; - - /** - * 文字输入方向 - * @command directionality - * @method execCommand - * @param { String } cmdName 命令字符串 - * @param { String } forward 传入'ltr'表示从左向右输入,传入'rtl'表示从右向左输入 - * @example - * ```javascript - * editor.execCommand( 'directionality', 'ltr'); - * ``` - */ - - /** - * 查询当前选区的文字输入方向 - * @command directionality - * @method queryCommandValue - * @param { String } cmdName 命令字符串 - * @return { String } 返回'ltr'表示从左向右输入,返回'rtl'表示从右向左输入 - * @example - * ```javascript - * editor.queryCommandValue( 'directionality'); - * ``` - */ - UE.commands["directionality"] = { - execCommand: function(cmdName, forward) { - var range = this.selection.getRange(); - //闭合时单独处理 - if (range.collapsed) { - var txt = this.document.createTextNode("d"); - range.insertNode(txt); - } - doDirectionality(range, this, forward); - if (txt) { - range.setStartBefore(txt).collapse(true); - domUtils.remove(txt); - } - - range.select(); - return true; - }, - queryCommandValue: function() { - var node = getObj(this); - return node ? node.getAttribute("dir") : "ltr"; - } - }; -})(); - - -// plugins/horizontal.js -/** - * 插入分割线插件 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入分割线 - * @command horizontal - * @method execCommand - * @param { String } cmdName 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'horizontal' ); - * ``` - */ -UE.plugins["horizontal"] = function() { - var me = this; - me.commands["horizontal"] = { - execCommand: function(cmdName) { - var me = this; - if (me.queryCommandState(cmdName) !== -1) { - me.execCommand("insertHtml", "
                      "); - var range = me.selection.getRange(), - start = range.startContainer; - if (start.nodeType == 1 && !start.childNodes[range.startOffset]) { - var tmp; - if ((tmp = start.childNodes[range.startOffset - 1])) { - if (tmp.nodeType == 1 && tmp.tagName == "HR") { - if (me.options.enterTag == "p") { - tmp = me.document.createElement("p"); - range.insertNode(tmp); - range.setStart(tmp, 0).setCursor(); - } else { - tmp = me.document.createElement("br"); - range.insertNode(tmp); - range.setStartBefore(tmp).setCursor(); - } - } - } - } - return true; - } - }, - //边界在table里不能加分隔线 - queryCommandState: function() { - return domUtils.filterNodeList( - this.selection.getStartElementPath(), - "table" - ) - ? -1 - : 0; - } - }; - // me.addListener('delkeyup',function(){ - // var rng = this.selection.getRange(); - // if(browser.ie && browser.version > 8){ - // rng.txtToElmBoundary(true); - // if(domUtils.isStartInblock(rng)){ - // var tmpNode = rng.startContainer; - // var pre = tmpNode.previousSibling; - // if(pre && domUtils.isTagNode(pre,'hr')){ - // domUtils.remove(pre); - // rng.select(); - // return; - // } - // } - // } - // if(domUtils.isBody(rng.startContainer)){ - // var hr = rng.startContainer.childNodes[rng.startOffset -1]; - // if(hr && hr.nodeName == 'HR'){ - // var next = hr.nextSibling; - // if(next){ - // rng.setStart(next,0) - // }else if(hr.previousSibling){ - // rng.setStartAtLast(hr.previousSibling) - // }else{ - // var p = this.document.createElement('p'); - // hr.parentNode.insertBefore(p,hr); - // domUtils.fillNode(this.document,p); - // rng.setStart(p,0); - // } - // domUtils.remove(hr); - // rng.setCursor(false,true); - // } - // } - // }) - me.addListener("delkeydown", function(name, evt) { - var rng = this.selection.getRange(); - rng.txtToElmBoundary(true); - if (domUtils.isStartInblock(rng)) { - var tmpNode = rng.startContainer; - var pre = tmpNode.previousSibling; - if (pre && domUtils.isTagNode(pre, "hr")) { - domUtils.remove(pre); - rng.select(); - domUtils.preventDefault(evt); - return true; - } - } - }); -}; - - -// plugins/time.js -/** - * 插入时间和日期 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入时间,默认格式:12:59:59 - * @command time - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'time'); - * ``` - */ - -/** - * 插入日期,默认格式:2013-08-30 - * @command date - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'date'); - * ``` - */ -UE.commands["time"] = UE.commands["date"] = { - execCommand: function(cmd, format) { - var date = new Date(); - - function formatTime(date, format) { - var hh = ("0" + date.getHours()).slice(-2), - ii = ("0" + date.getMinutes()).slice(-2), - ss = ("0" + date.getSeconds()).slice(-2); - format = format || "hh:ii:ss"; - return format.replace(/hh/gi, hh).replace(/ii/gi, ii).replace(/ss/gi, ss); - } - function formatDate(date, format) { - var yyyy = ("000" + date.getFullYear()).slice(-4), - yy = yyyy.slice(-2), - mm = ("0" + (date.getMonth() + 1)).slice(-2), - dd = ("0" + date.getDate()).slice(-2); - format = format || "yyyy-mm-dd"; - return format - .replace(/yyyy/gi, yyyy) - .replace(/yy/gi, yy) - .replace(/mm/gi, mm) - .replace(/dd/gi, dd); - } - - this.execCommand( - "insertHtml", - cmd == "time" ? formatTime(date, format) : formatDate(date, format) - ); - } -}; - - -// plugins/rowspacing.js -/** - * 段前段后间距插件 - * @file - * @since 1.2.6.1 - */ - -/** - * 设置段间距 - * @command rowspacing - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } value 段间距的值,以px为单位 - * @param { String } dir 间距位置,top或bottom,分别表示段前和段后 - * @example - * ```javascript - * editor.execCommand( 'rowspacing', '10', 'top' ); - * ``` - */ - -UE.plugins["rowspacing"] = function() { - var me = this; - me.setOpt({ - rowspacingtop: ["5", "10", "15", "20", "25"], - rowspacingbottom: ["5", "10", "15", "20", "25"] - }); - me.commands["rowspacing"] = { - execCommand: function(cmdName, value, dir) { - this.execCommand("paragraph", "p", { - style: "margin-" + dir + ":" + value + "px" - }); - return true; - }, - queryCommandValue: function(cmdName, dir) { - var pN = domUtils.filterNodeList( - this.selection.getStartElementPath(), - function(node) { - return domUtils.isBlockElm(node); - } - ), - value; - //trace:1026 - if (pN) { - value = domUtils - .getComputedStyle(pN, "margin-" + dir) - .replace(/[^\d]/g, ""); - return !value ? 0 : value; - } - return 0; - } - }; -}; - - -// plugins/lineheight.js -/** - * 设置行内间距 - * @file - * @since 1.2.6.1 - */ -UE.plugins["lineheight"] = function() { - var me = this; - me.setOpt({ lineheight: ["1", "1.5", "1.75", "2", "3", "4", "5"] }); - - /** - * 行距 - * @command lineheight - * @method execCommand - * @param { String } cmdName 命令字符串 - * @param { String } value 传入的行高值, 该值是当前字体的倍数, 例如: 1.5, 1.75 - * @example - * ```javascript - * editor.execCommand( 'lineheight', 1.5); - * ``` - */ - /** - * 查询当前选区内容的行高大小 - * @command lineheight - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回当前行高大小 - * @example - * ```javascript - * editor.queryCommandValue( 'lineheight' ); - * ``` - */ - - me.commands["lineheight"] = { - execCommand: function(cmdName, value) { - this.execCommand("paragraph", "p", { - style: "line-height:" + (value == "1" ? "normal" : value + "em") - }); - return true; - }, - queryCommandValue: function() { - var pN = domUtils.filterNodeList( - this.selection.getStartElementPath(), - function(node) { - return domUtils.isBlockElm(node); - } - ); - if (pN) { - var value = domUtils.getComputedStyle(pN, "line-height"); - return value == "normal" ? 1 : value.replace(/[^\d.]*/gi, ""); - } - } - }; -}; - - -// plugins/insertcode.js -/** - * 插入代码插件 - * @file - * @since 1.2.6.1 - */ - -UE.plugins["insertcode"] = function() { - var me = this; - me.ready(function() { - utils.cssRule( - "pre", - "pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}", - me.document - ); - }); - me.setOpt("insertcode", { - as3: "ActionScript3", - bash: "Bash/Shell", - cpp: "C/C++", - css: "Css", - cf: "CodeFunction", - "c#": "C#", - delphi: "Delphi", - diff: "Diff", - erlang: "Erlang", - groovy: "Groovy", - html: "Html", - java: "Java", - jfx: "JavaFx", - js: "Javascript", - pl: "Perl", - php: "Php", - plain: "Plain Text", - ps: "PowerShell", - python: "Python", - ruby: "Ruby", - scala: "Scala", - sql: "Sql", - vb: "Vb", - xml: "Xml" - }); - - /** - * 插入代码 - * @command insertcode - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } lang 插入代码的语言 - * @example - * ```javascript - * editor.execCommand( 'insertcode', 'javascript' ); - * ``` - */ - - /** - * 如果选区所在位置是插入插入代码区域,返回代码的语言 - * @command insertcode - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回代码的语言 - * @example - * ```javascript - * editor.queryCommandValue( 'insertcode' ); - * ``` - */ - - me.commands["insertcode"] = { - execCommand: function(cmd, lang) { - var me = this, - rng = me.selection.getRange(), - pre = domUtils.findParentByTagName(rng.startContainer, "pre", true); - if (pre) { - pre.className = "brush:" + lang + ";toolbar:false;"; - } else { - var code = ""; - if (rng.collapsed) { - code = browser.ie && browser.ie11below - ? browser.version <= 8 ? " " : "" - : "
                      "; - } else { - var frag = rng.extractContents(); - var div = me.document.createElement("div"); - div.appendChild(frag); - - utils.each( - UE.filterNode( - UE.htmlparser(div.innerHTML.replace(/[\r\t]/g, "")), - me.options.filterTxtRules - ).children, - function(node) { - if (browser.ie && browser.ie11below && browser.version > 8) { - if (node.type == "element") { - if (node.tagName == "br") { - code += "\n"; - } else if (!dtd.$empty[node.tagName]) { - utils.each(node.children, function(cn) { - if (cn.type == "element") { - if (cn.tagName == "br") { - code += "\n"; - } else if (!dtd.$empty[node.tagName]) { - code += cn.innerText(); - } - } else { - code += cn.data; - } - }); - if (!/\n$/.test(code)) { - code += "\n"; - } - } - } else { - code += node.data + "\n"; - } - if (!node.nextSibling() && /\n$/.test(code)) { - code = code.replace(/\n$/, ""); - } - } else { - if (browser.ie && browser.ie11below) { - if (node.type == "element") { - if (node.tagName == "br") { - code += "
                      "; - } else if (!dtd.$empty[node.tagName]) { - utils.each(node.children, function(cn) { - if (cn.type == "element") { - if (cn.tagName == "br") { - code += "
                      "; - } else if (!dtd.$empty[node.tagName]) { - code += cn.innerText(); - } - } else { - code += cn.data; - } - }); - if (!/br>$/.test(code)) { - code += "
                      "; - } - } - } else { - code += node.data + "
                      "; - } - if (!node.nextSibling() && /
                      $/.test(code)) { - code = code.replace(/
                      $/, ""); - } - } else { - code += node.type == "element" - ? dtd.$empty[node.tagName] ? "" : node.innerText() - : node.data; - if (!/br\/?\s*>$/.test(code)) { - if (!node.nextSibling()) return; - code += "
                      "; - } - } - } - } - ); - } - me.execCommand( - "inserthtml", - '
                      ' +
                      -            code +
                      -            "
                      ", - true - ); - - pre = me.document.getElementById("coder"); - domUtils.removeAttributes(pre, "id"); - var tmpNode = pre.previousSibling; - - if ( - tmpNode && - ((tmpNode.nodeType == 3 && - tmpNode.nodeValue.length == 1 && - browser.ie && - browser.version == 6) || - domUtils.isEmptyBlock(tmpNode)) - ) { - domUtils.remove(tmpNode); - } - var rng = me.selection.getRange(); - if (domUtils.isEmptyBlock(pre)) { - rng.setStart(pre, 0).setCursor(false, true); - } else { - rng.selectNodeContents(pre).select(); - } - } - }, - queryCommandValue: function() { - var path = this.selection.getStartElementPath(); - var lang = ""; - utils.each(path, function(node) { - if (node.nodeName == "PRE") { - var match = node.className.match(/brush:([^;]+)/); - lang = match && match[1] ? match[1] : ""; - return false; - } - }); - return lang; - } - }; - - me.addInputRule(function(root) { - utils.each(root.getNodesByTagName("pre"), function(pre) { - var brs = pre.getNodesByTagName("br"); - if (brs.length) { - browser.ie && - browser.ie11below && - browser.version > 8 && - utils.each(brs, function(br) { - var txt = UE.uNode.createText("\n"); - br.parentNode.insertBefore(txt, br); - br.parentNode.removeChild(br); - }); - return; - } - if (browser.ie && browser.ie11below && browser.version > 8) return; - var code = pre.innerText().split(/\n/); - pre.innerHTML(""); - utils.each(code, function(c) { - if (c.length) { - pre.appendChild(UE.uNode.createText(c)); - } - pre.appendChild(UE.uNode.createElement("br")); - }); - }); - }); - me.addOutputRule(function(root) { - utils.each(root.getNodesByTagName("pre"), function(pre) { - var code = ""; - utils.each(pre.children, function(n) { - if (n.type == "text") { - //在ie下文本内容有可能末尾带有\n要去掉 - //trace:3396 - code += n.data.replace(/[ ]/g, " ").replace(/\n$/, ""); - } else { - if (n.tagName == "br") { - code += "\n"; - } else { - code += !dtd.$empty[n.tagName] ? "" : n.innerText(); - } - } - }); - - pre.innerText(code.replace(/( |\n)+$/, "")); - }); - }); - //不需要判断highlight的command列表 - me.notNeedCodeQuery = { - help: 1, - undo: 1, - redo: 1, - source: 1, - print: 1, - searchreplace: 1, - fullscreen: 1, - preview: 1, - insertparagraph: 1, - elementpath: 1, - insertcode: 1, - inserthtml: 1, - selectall: 1 - }; - //将queyCommamndState重置 - var orgQuery = me.queryCommandState; - me.queryCommandState = function(cmd) { - var me = this; - - if ( - !me.notNeedCodeQuery[cmd.toLowerCase()] && - me.selection && - me.queryCommandValue("insertcode") - ) { - return -1; - } - return UE.Editor.prototype.queryCommandState.apply(this, arguments); - }; - me.addListener("beforeenterkeydown", function() { - var rng = me.selection.getRange(); - var pre = domUtils.findParentByTagName(rng.startContainer, "pre", true); - if (pre) { - me.fireEvent("saveScene"); - if (!rng.collapsed) { - rng.deleteContents(); - } - if (!browser.ie || browser.ie9above) { - var tmpNode = me.document.createElement("br"), - pre; - rng.insertNode(tmpNode).setStartAfter(tmpNode).collapse(true); - var next = tmpNode.nextSibling; - if (!next && (!browser.ie || browser.version > 10)) { - rng.insertNode(tmpNode.cloneNode(false)); - } else { - rng.setStartAfter(tmpNode); - } - pre = tmpNode.previousSibling; - var tmp; - while (pre) { - tmp = pre; - pre = pre.previousSibling; - if (!pre || pre.nodeName == "BR") { - pre = tmp; - break; - } - } - if (pre) { - var str = ""; - while ( - pre && - pre.nodeName != "BR" && - new RegExp("^[\\s" + domUtils.fillChar + "]*$").test(pre.nodeValue) - ) { - str += pre.nodeValue; - pre = pre.nextSibling; - } - if (pre.nodeName != "BR") { - var match = pre.nodeValue.match( - new RegExp("^([\\s" + domUtils.fillChar + "]+)") - ); - if (match && match[1]) { - str += match[1]; - } - } - if (str) { - str = me.document.createTextNode(str); - rng.insertNode(str).setStartAfter(str); - } - } - rng.collapse(true).select(true); - } else { - if (browser.version > 8) { - var txt = me.document.createTextNode("\n"); - var start = rng.startContainer; - if (rng.startOffset == 0) { - var preNode = start.previousSibling; - if (preNode) { - rng.insertNode(txt); - var fillchar = me.document.createTextNode(" "); - rng - .setStartAfter(txt) - .insertNode(fillchar) - .setStart(fillchar, 0) - .collapse(true) - .select(true); - } - } else { - rng.insertNode(txt).setStartAfter(txt); - var fillchar = me.document.createTextNode(" "); - start = rng.startContainer.childNodes[rng.startOffset]; - if (start && !/^\n/.test(start.nodeValue)) { - rng.setStartBefore(txt); - } - rng - .insertNode(fillchar) - .setStart(fillchar, 0) - .collapse(true) - .select(true); - } - } else { - var tmpNode = me.document.createElement("br"); - rng.insertNode(tmpNode); - rng.insertNode(me.document.createTextNode(domUtils.fillChar)); - rng.setStartAfter(tmpNode); - pre = tmpNode.previousSibling; - var tmp; - while (pre) { - tmp = pre; - pre = pre.previousSibling; - if (!pre || pre.nodeName == "BR") { - pre = tmp; - break; - } - } - if (pre) { - var str = ""; - while ( - pre && - pre.nodeName != "BR" && - new RegExp("^[ " + domUtils.fillChar + "]*$").test(pre.nodeValue) - ) { - str += pre.nodeValue; - pre = pre.nextSibling; - } - if (pre.nodeName != "BR") { - var match = pre.nodeValue.match( - new RegExp("^([ " + domUtils.fillChar + "]+)") - ); - if (match && match[1]) { - str += match[1]; - } - } - - str = me.document.createTextNode(str); - rng.insertNode(str).setStartAfter(str); - } - rng.collapse(true).select(); - } - } - me.fireEvent("saveScene"); - return true; - } - }); - - me.addListener("tabkeydown", function(cmd, evt) { - var rng = me.selection.getRange(); - var pre = domUtils.findParentByTagName(rng.startContainer, "pre", true); - if (pre) { - me.fireEvent("saveScene"); - if (evt.shiftKey) { - } else { - if (!rng.collapsed) { - var bk = rng.createBookmark(); - var start = bk.start.previousSibling; - - while (start) { - if (pre.firstChild === start && !domUtils.isBr(start)) { - pre.insertBefore(me.document.createTextNode(" "), start); - - break; - } - if (domUtils.isBr(start)) { - pre.insertBefore( - me.document.createTextNode(" "), - start.nextSibling - ); - - break; - } - start = start.previousSibling; - } - var end = bk.end; - start = bk.start.nextSibling; - if (pre.firstChild === bk.start) { - pre.insertBefore( - me.document.createTextNode(" "), - start.nextSibling - ); - } - while (start && start !== end) { - if (domUtils.isBr(start) && start.nextSibling) { - if (start.nextSibling === end) { - break; - } - pre.insertBefore( - me.document.createTextNode(" "), - start.nextSibling - ); - } - - start = start.nextSibling; - } - rng.moveToBookmark(bk).select(); - } else { - var tmpNode = me.document.createTextNode(" "); - rng - .insertNode(tmpNode) - .setStartAfter(tmpNode) - .collapse(true) - .select(true); - } - } - - me.fireEvent("saveScene"); - return true; - } - }); - - me.addListener("beforeinserthtml", function(evtName, html) { - var me = this, - rng = me.selection.getRange(), - pre = domUtils.findParentByTagName(rng.startContainer, "pre", true); - if (pre) { - if (!rng.collapsed) { - rng.deleteContents(); - } - var htmlstr = ""; - if (browser.ie && browser.version > 8) { - utils.each( - UE.filterNode(UE.htmlparser(html), me.options.filterTxtRules) - .children, - function(node) { - if (node.type == "element") { - if (node.tagName == "br") { - htmlstr += "\n"; - } else if (!dtd.$empty[node.tagName]) { - utils.each(node.children, function(cn) { - if (cn.type == "element") { - if (cn.tagName == "br") { - htmlstr += "\n"; - } else if (!dtd.$empty[node.tagName]) { - htmlstr += cn.innerText(); - } - } else { - htmlstr += cn.data; - } - }); - if (!/\n$/.test(htmlstr)) { - htmlstr += "\n"; - } - } - } else { - htmlstr += node.data + "\n"; - } - if (!node.nextSibling() && /\n$/.test(htmlstr)) { - htmlstr = htmlstr.replace(/\n$/, ""); - } - } - ); - var tmpNode = me.document.createTextNode( - utils.html(htmlstr.replace(/ /g, " ")) - ); - rng.insertNode(tmpNode).selectNode(tmpNode).select(); - } else { - var frag = me.document.createDocumentFragment(); - - utils.each( - UE.filterNode(UE.htmlparser(html), me.options.filterTxtRules) - .children, - function(node) { - if (node.type == "element") { - if (node.tagName == "br") { - frag.appendChild(me.document.createElement("br")); - } else if (!dtd.$empty[node.tagName]) { - utils.each(node.children, function(cn) { - if (cn.type == "element") { - if (cn.tagName == "br") { - frag.appendChild(me.document.createElement("br")); - } else if (!dtd.$empty[node.tagName]) { - frag.appendChild( - me.document.createTextNode( - utils.html(cn.innerText().replace(/ /g, " ")) - ) - ); - } - } else { - frag.appendChild( - me.document.createTextNode( - utils.html(cn.data.replace(/ /g, " ")) - ) - ); - } - }); - if (frag.lastChild.nodeName != "BR") { - frag.appendChild(me.document.createElement("br")); - } - } - } else { - frag.appendChild( - me.document.createTextNode( - utils.html(node.data.replace(/ /g, " ")) - ) - ); - } - if (!node.nextSibling() && frag.lastChild.nodeName == "BR") { - frag.removeChild(frag.lastChild); - } - } - ); - rng.insertNode(frag).select(); - } - - return true; - } - }); - //方向键的处理 - me.addListener("keydown", function(cmd, evt) { - var me = this, - keyCode = evt.keyCode || evt.which; - if (keyCode == 40) { - var rng = me.selection.getRange(), - pre, - start = rng.startContainer; - if ( - rng.collapsed && - (pre = domUtils.findParentByTagName(rng.startContainer, "pre", true)) && - !pre.nextSibling - ) { - var last = pre.lastChild; - while (last && last.nodeName == "BR") { - last = last.previousSibling; - } - if ( - last === start || - (rng.startContainer === pre && - rng.startOffset == pre.childNodes.length) - ) { - me.execCommand("insertparagraph"); - domUtils.preventDefault(evt); - } - } - } - }); - //trace:3395 - me.addListener("delkeydown", function(type, evt) { - var rng = this.selection.getRange(); - rng.txtToElmBoundary(true); - var start = rng.startContainer; - if ( - domUtils.isTagNode(start, "pre") && - rng.collapsed && - domUtils.isStartInblock(rng) - ) { - var p = me.document.createElement("p"); - domUtils.fillNode(me.document, p); - start.parentNode.insertBefore(p, start); - domUtils.remove(start); - rng.setStart(p, 0).setCursor(false, true); - domUtils.preventDefault(evt); - return true; - } - }); -}; - - -// plugins/cleardoc.js -/** - * 清空文档插件 - * @file - * @since 1.2.6.1 - */ - -/** - * 清空文档 - * @command cleardoc - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * //editor 是编辑器实例 - * editor.execCommand('cleardoc'); - * ``` - */ - -UE.commands["cleardoc"] = { - execCommand: function(cmdName) { - var me = this, - enterTag = me.options.enterTag, - range = me.selection.getRange(); - if (enterTag == "br") { - me.body.innerHTML = "
                      "; - range.setStart(me.body, 0).setCursor(); - } else { - me.body.innerHTML = "

                      " + (ie ? "" : "
                      ") + "

                      "; - range.setStart(me.body.firstChild, 0).setCursor(false, true); - } - setTimeout(function() { - me.fireEvent("clearDoc"); - }, 0); - } -}; - - -// plugins/anchor.js -/** - * 锚点插件,为UEditor提供插入锚点支持 - * @file - * @since 1.2.6.1 - */ -UE.plugin.register("anchor", function () { - var me = this; - return { - bindEvents: { - ready: function () { - utils.cssRule( - "anchor", - ".anchorclass{background: url('" + - this.options.themePath + - this.options.theme + - "/images/anchor.gif') no-repeat scroll left center transparent;cursor: auto;display: inline-block;height: 16px;width: 16px;}", - this.document - ); - } - }, - outputRule: function (root) { - utils.each(root.getNodesByTagName("img"), function (a) { - var val; - if ((val = a.getAttr("anchorname"))) { - a.tagName = "a"; - a.setAttr({ - anchorname: "", - name: val, - class: "" - }); - } - }); - }, - inputRule: function (root) { - utils.each(root.getNodesByTagName("a"), function (a) { - var val; - if ((val = a.getAttr("name")) && !a.getAttr("href")) { - //过滤掉word冗余标签 - //_Toc\d+有可能勿命中 - if (/^\_Toc\d+$/.test(val)) { - a.parentNode.removeChild(a); - return; - } - a.tagName = "img"; - a.setAttr({ - anchorname: a.getAttr("name"), - class: "anchorclass" - }); - a.setAttr("name"); - } - }); - }, - commands: { - /** - * 插入锚点 - * @command anchor - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } name 锚点名称字符串 - * @example - * ```javascript - * //editor 是编辑器实例 - * editor.execCommand('anchor', 'anchor1'); - * ``` - */ - anchor: { - execCommand: function (cmd, name) { - var range = this.selection.getRange(), - img = range.getClosedNode(); - - if (img && img.getAttribute("anchorname")) { - if (name) { - img.setAttribute("anchorname", name); - } else { - range.setStartBefore(img).setCursor(); - domUtils.remove(img); - } - } else { - if (name) { - //只在选区的开始插入 - var anchor = utils.renderTplstr('', { - name: name - }); - me.execCommand("inserthtml", anchor, true); - } - } - } - } - } - }; -}); - - -// plugins/wordcount.js -///import core -///commands 字数统计 -///commandsName WordCount,wordCount -///commandsTitle 字数统计 -/* - * Created by JetBrains WebStorm. - * User: taoqili - * Date: 11-9-7 - * Time: 下午8:18 - * To change this template use File | Settings | File Templates. - */ - -UE.plugins["wordcount"] = function() { - var me = this; - me.setOpt("wordCount", true); - me.addListener("contentchange", function() { - me.fireEvent("wordcount"); - }); - var timer; - me.addListener("ready", function() { - var me = this; - domUtils.on(me.body, "keyup", function(evt) { - var code = evt.keyCode || evt.which, - //忽略的按键,ctr,alt,shift,方向键 - ignores = { - "16": 1, - "18": 1, - "20": 1, - "37": 1, - "38": 1, - "39": 1, - "40": 1 - }; - if (code in ignores) return; - clearTimeout(timer); - timer = setTimeout(function() { - me.fireEvent("wordcount"); - }, 200); - }); - }); -}; - - -// plugins/pagebreak.js -/** - * 分页功能插件 - * @file - * @since 1.2.6.1 - */ -UE.plugins["pagebreak"] = function() { - var me = this, - notBreakTags = ["td"]; - me.setOpt("pageBreakTag", "_ueditor_page_break_tag_"); - - function fillNode(node) { - if (domUtils.isEmptyBlock(node)) { - var firstChild = node.firstChild, - tmpNode; - - while ( - firstChild && - firstChild.nodeType == 1 && - domUtils.isEmptyBlock(firstChild) - ) { - tmpNode = firstChild; - firstChild = firstChild.firstChild; - } - !tmpNode && (tmpNode = node); - domUtils.fillNode(me.document, tmpNode); - } - } - //分页符样式添加 - - me.ready(function() { - utils.cssRule( - "pagebreak", - ".pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}", - me.document - ); - }); - function isHr(node) { - return ( - node && - node.nodeType == 1 && - node.tagName == "HR" && - node.className == "pagebreak" - ); - } - me.addInputRule(function(root) { - root.traversal(function(node) { - if (node.type == "text" && node.data == me.options.pageBreakTag) { - var hr = UE.uNode.createElement( - '
                      ' - ); - node.parentNode.insertBefore(hr, node); - node.parentNode.removeChild(node); - } - }); - }); - me.addOutputRule(function(node) { - utils.each(node.getNodesByTagName("hr"), function(n) { - if (n.getAttr("class") == "pagebreak") { - var txt = UE.uNode.createText(me.options.pageBreakTag); - n.parentNode.insertBefore(txt, n); - n.parentNode.removeChild(n); - } - }); - }); - - /** - * 插入分页符 - * @command pagebreak - * @method execCommand - * @param { String } cmd 命令字符串 - * @remind 在表格中插入分页符会把表格切分成两部分 - * @remind 获取编辑器内的数据时, 编辑器会把分页符转换成“_ueditor_page_break_tag_”字符串, - * 以便于提交数据到服务器端后处理分页。 - * @example - * ```javascript - * editor.execCommand( 'pagebreak'); //插入一个hr标签,带有样式类名pagebreak - * ``` - */ - - me.commands["pagebreak"] = { - execCommand: function() { - var range = me.selection.getRange(), - hr = me.document.createElement("hr"); - domUtils.setAttributes(hr, { - class: "pagebreak", - noshade: "noshade", - size: "5" - }); - domUtils.unSelectable(hr); - //table单独处理 - var node = domUtils.findParentByTagName( - range.startContainer, - notBreakTags, - true - ), - parents = [], - pN; - if (node) { - switch (node.tagName) { - case "TD": - pN = node.parentNode; - if (!pN.previousSibling) { - var table = domUtils.findParentByTagName(pN, "table"); - // var tableWrapDiv = table.parentNode; - // if(tableWrapDiv && tableWrapDiv.nodeType == 1 - // && tableWrapDiv.tagName == 'DIV' - // && tableWrapDiv.getAttribute('dropdrag') - // ){ - // domUtils.remove(tableWrapDiv,true); - // } - table.parentNode.insertBefore(hr, table); - parents = domUtils.findParents(hr, true); - } else { - pN.parentNode.insertBefore(hr, pN); - parents = domUtils.findParents(hr); - } - pN = parents[1]; - if (hr !== pN) { - domUtils.breakParent(hr, pN); - } - //table要重写绑定一下拖拽 - me.fireEvent("afteradjusttable", me.document); - } - } else { - if (!range.collapsed) { - range.deleteContents(); - var start = range.startContainer; - while ( - !domUtils.isBody(start) && - domUtils.isBlockElm(start) && - domUtils.isEmptyNode(start) - ) { - range.setStartBefore(start).collapse(true); - domUtils.remove(start); - start = range.startContainer; - } - } - range.insertNode(hr); - - var pN = hr.parentNode, - nextNode; - while (!domUtils.isBody(pN)) { - domUtils.breakParent(hr, pN); - nextNode = hr.nextSibling; - if (nextNode && domUtils.isEmptyBlock(nextNode)) { - domUtils.remove(nextNode); - } - pN = hr.parentNode; - } - nextNode = hr.nextSibling; - var pre = hr.previousSibling; - if (isHr(pre)) { - domUtils.remove(pre); - } else { - pre && fillNode(pre); - } - - if (!nextNode) { - var p = me.document.createElement("p"); - - hr.parentNode.appendChild(p); - domUtils.fillNode(me.document, p); - range.setStart(p, 0).collapse(true); - } else { - if (isHr(nextNode)) { - domUtils.remove(nextNode); - } else { - fillNode(nextNode); - } - range.setEndAfter(hr).collapse(false); - } - - range.select(true); - } - } - }; -}; - - -// plugins/wordimage.js -///import core -///commands 本地图片引导上传 -///commandsName WordImage -///commandsTitle 本地图片引导上传 -///commandsDialog dialogs\wordimage - -UE.plugin.register("wordimage", function() { - var me = this, - images = []; - return { - commands: { - wordimage: { - execCommand: function() { - var images = domUtils.getElementsByTagName(me.body, "img"); - var urlList = []; - for (var i = 0, ci; (ci = images[i++]); ) { - var url = ci.getAttribute("word_img"); - url && urlList.push(url); - } - return urlList; - }, - queryCommandState: function() { - images = domUtils.getElementsByTagName(me.body, "img"); - for (var i = 0, ci; (ci = images[i++]); ) { - if (ci.getAttribute("word_img")) { - return 1; - } - } - return -1; - }, - notNeedUndo: true - } - }, - inputRule: function(root) { - utils.each(root.getNodesByTagName("img"), function(img) { - var attrs = img.attrs, - flag = parseInt(attrs.width) < 128 || parseInt(attrs.height) < 43, - opt = me.options, - src = opt.UEDITOR_HOME_URL + "themes/notadd/images/spacer.gif"; - if (attrs["src"] && /^(?:(file:\/+))/.test(attrs["src"])) { - img.setAttr({ - width: attrs.width, - height: attrs.height, - alt: attrs.alt, - word_img: attrs.src, - src: src, - style: - "background:url(" + - (flag - ? opt.themePath + opt.theme + "/images/word.gif" - : opt.langPath + opt.lang + "/images/localimage.png") + - ") no-repeat center center;border:1px solid #ddd" - }); - } - }); - } - }; -}); - - -// plugins/dragdrop.js -UE.plugins["dragdrop"] = function() { - var me = this; - me.ready(function() { - domUtils.on(this.body, "dragend", function() { - var rng = me.selection.getRange(); - var node = rng.getClosedNode() || me.selection.getStart(); - - if (node && node.tagName == "IMG") { - var pre = node.previousSibling, - next; - while ((next = node.nextSibling)) { - if ( - next.nodeType == 1 && - next.tagName == "SPAN" && - !next.firstChild - ) { - domUtils.remove(next); - } else { - break; - } - } - - if ( - ((pre && pre.nodeType == 1 && !domUtils.isEmptyBlock(pre)) || !pre) && - (!next || (next && !domUtils.isEmptyBlock(next))) - ) { - if (pre && pre.tagName == "P" && !domUtils.isEmptyBlock(pre)) { - pre.appendChild(node); - domUtils.moveChild(next, pre); - domUtils.remove(next); - } else if ( - next && - next.tagName == "P" && - !domUtils.isEmptyBlock(next) - ) { - next.insertBefore(node, next.firstChild); - } - - if (pre && pre.tagName == "P" && domUtils.isEmptyBlock(pre)) { - domUtils.remove(pre); - } - if (next && next.tagName == "P" && domUtils.isEmptyBlock(next)) { - domUtils.remove(next); - } - rng.selectNode(node).select(); - me.fireEvent("saveScene"); - } - } - }); - }); - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - if (keyCode == 13) { - var rng = me.selection.getRange(), - node; - if ( - (node = domUtils.findParentByTagName(rng.startContainer, "p", true)) - ) { - if (domUtils.getComputedStyle(node, "text-align") == "center") { - domUtils.removeStyle(node, "text-align"); - } - } - } - }); -}; - - -// plugins/undo.js -/** - * undo redo - * @file - * @since 1.2.6.1 - */ - -/** - * 撤销上一次执行的命令 - * @command undo - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'undo' ); - * ``` - */ - -/** - * 重做上一次执行的命令 - * @command redo - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'redo' ); - * ``` - */ - -UE.plugins["undo"] = function() { - var saveSceneTimer; - var me = this, - maxUndoCount = me.options.maxUndoCount || 20, - maxInputCount = me.options.maxInputCount || 20, - fillchar = new RegExp(domUtils.fillChar + "|", "gi"); // ie会产生多余的 - var noNeedFillCharTags = { - ol: 1, - ul: 1, - table: 1, - tbody: 1, - tr: 1, - body: 1 - }; - var orgState = me.options.autoClearEmptyNode; - function compareAddr(indexA, indexB) { - if (indexA.length != indexB.length) return 0; - for (var i = 0, l = indexA.length; i < l; i++) { - if (indexA[i] != indexB[i]) return 0; - } - return 1; - } - - function compareRangeAddress(rngAddrA, rngAddrB) { - if (rngAddrA.collapsed != rngAddrB.collapsed) { - return 0; - } - if ( - !compareAddr(rngAddrA.startAddress, rngAddrB.startAddress) || - !compareAddr(rngAddrA.endAddress, rngAddrB.endAddress) - ) { - return 0; - } - return 1; - } - - function UndoManager() { - this.list = []; - this.index = 0; - this.hasUndo = false; - this.hasRedo = false; - this.undo = function() { - if (this.hasUndo) { - if (!this.list[this.index - 1] && this.list.length == 1) { - this.reset(); - return; - } - while ( - this.list[this.index].content == this.list[this.index - 1].content - ) { - this.index--; - if (this.index == 0) { - return this.restore(0); - } - } - this.restore(--this.index); - } - }; - this.redo = function() { - if (this.hasRedo) { - while ( - this.list[this.index].content == this.list[this.index + 1].content - ) { - this.index++; - if (this.index == this.list.length - 1) { - return this.restore(this.index); - } - } - this.restore(++this.index); - } - }; - - this.restore = function() { - var me = this.editor; - var scene = this.list[this.index]; - var root = UE.htmlparser(scene.content.replace(fillchar, "")); - me.options.autoClearEmptyNode = false; - me.filterInputRule(root); - me.options.autoClearEmptyNode = orgState; - //trace:873 - //去掉展位符 - me.document.body.innerHTML = root.toHtml(); - me.fireEvent("afterscencerestore"); - //处理undo后空格不展位的问题 - if (browser.ie) { - utils.each( - domUtils.getElementsByTagName(me.document, "td th caption p"), - function(node) { - if (domUtils.isEmptyNode(node)) { - domUtils.fillNode(me.document, node); - } - } - ); - } - - try { - var rng = new dom.Range(me.document).moveToAddress(scene.address); - rng.select( - noNeedFillCharTags[rng.startContainer.nodeName.toLowerCase()] - ); - } catch (e) {} - - this.update(); - this.clearKey(); - //不能把自己reset了 - me.fireEvent("reset", true); - }; - - this.getScene = function() { - var me = this.editor; - var rng = me.selection.getRange(), - rngAddress = rng.createAddress(false, true); - me.fireEvent("beforegetscene"); - var root = UE.htmlparser(me.body.innerHTML); - me.options.autoClearEmptyNode = false; - me.filterOutputRule(root); - me.options.autoClearEmptyNode = orgState; - var cont = root.toHtml(); - //trace:3461 - //这个会引起回退时导致空格丢失的情况 - // browser.ie && (cont = cont.replace(/> <').replace(/\s*\s*/g, '>')); - me.fireEvent("aftergetscene"); - - return { - address: rngAddress, - content: cont - }; - }; - this.save = function(notCompareRange, notSetCursor) { - clearTimeout(saveSceneTimer); - var currentScene = this.getScene(notSetCursor), - lastScene = this.list[this.index]; - - if (lastScene && lastScene.content != currentScene.content) { - me.trigger("contentchange"); - } - //内容相同位置相同不存 - if ( - lastScene && - lastScene.content == currentScene.content && - (notCompareRange - ? 1 - : compareRangeAddress(lastScene.address, currentScene.address)) - ) { - return; - } - this.list = this.list.slice(0, this.index + 1); - this.list.push(currentScene); - //如果大于最大数量了,就把最前的剔除 - if (this.list.length > maxUndoCount) { - this.list.shift(); - } - this.index = this.list.length - 1; - this.clearKey(); - //跟新undo/redo状态 - this.update(); - }; - this.update = function() { - this.hasRedo = !!this.list[this.index + 1]; - this.hasUndo = !!this.list[this.index - 1]; - }; - this.reset = function() { - this.list = []; - this.index = 0; - this.hasUndo = false; - this.hasRedo = false; - this.clearKey(); - }; - this.clearKey = function() { - keycont = 0; - lastKeyCode = null; - }; - } - - me.undoManger = new UndoManager(); - me.undoManger.editor = me; - function saveScene() { - this.undoManger.save(); - } - - me.addListener("saveScene", function() { - var args = Array.prototype.splice.call(arguments, 1); - this.undoManger.save.apply(this.undoManger, args); - }); - - // me.addListener('beforeexeccommand', saveScene); - // me.addListener('afterexeccommand', saveScene); - - me.addListener("reset", function(type, exclude) { - if (!exclude) { - this.undoManger.reset(); - } - }); - me.commands["redo"] = me.commands["undo"] = { - execCommand: function(cmdName) { - this.undoManger[cmdName](); - }, - queryCommandState: function(cmdName) { - return this.undoManger[ - "has" + (cmdName.toLowerCase() == "undo" ? "Undo" : "Redo") - ] - ? 0 - : -1; - }, - notNeedUndo: 1 - }; - - var keys = { - // /*Backspace*/ 8:1, /*Delete*/ 46:1, - /*Shift*/ 16: 1, - /*Ctrl*/ 17: 1, - /*Alt*/ 18: 1, - 37: 1, - 38: 1, - 39: 1, - 40: 1 - }, - keycont = 0, - lastKeyCode; - //输入法状态下不计算字符数 - var inputType = false; - me.addListener("ready", function() { - domUtils.on(this.body, "compositionstart", function() { - inputType = true; - }); - domUtils.on(this.body, "compositionend", function() { - inputType = false; - }); - }); - //快捷键 - me.addshortcutkey({ - Undo: "ctrl+90", //undo - Redo: "ctrl+89" //redo - }); - var isCollapsed = true; - me.addListener("keydown", function(type, evt) { - var me = this; - var keyCode = evt.keyCode || evt.which; - if ( - !keys[keyCode] && - !evt.ctrlKey && - !evt.metaKey && - !evt.shiftKey && - !evt.altKey - ) { - if (inputType) return; - - if (!me.selection.getRange().collapsed) { - me.undoManger.save(false, true); - isCollapsed = false; - return; - } - if (me.undoManger.list.length == 0) { - me.undoManger.save(true); - } - clearTimeout(saveSceneTimer); - function save(cont) { - cont.undoManger.save(false, true); - cont.fireEvent("selectionchange"); - } - saveSceneTimer = setTimeout(function() { - if (inputType) { - var interalTimer = setInterval(function() { - if (!inputType) { - save(me); - clearInterval(interalTimer); - } - }, 300); - return; - } - save(me); - }, 200); - - lastKeyCode = keyCode; - keycont++; - if (keycont >= maxInputCount) { - save(me); - } - } - }); - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - if ( - !keys[keyCode] && - !evt.ctrlKey && - !evt.metaKey && - !evt.shiftKey && - !evt.altKey - ) { - if (inputType) return; - if (!isCollapsed) { - this.undoManger.save(false, true); - isCollapsed = true; - } - } - }); - //扩展实例,添加关闭和开启命令undo - me.stopCmdUndo = function() { - me.__hasEnterExecCommand = true; - }; - me.startCmdUndo = function() { - me.__hasEnterExecCommand = false; - }; -}; - - -// plugins/copy.js -UE.plugin.register("copy", function() { - var me = this; - - function initZeroClipboard() { - ZeroClipboard.config({ - debug: false, - swfPath: - me.options.UEDITOR_HOME_URL + - "third-party/zeroclipboard/ZeroClipboard.swf" - }); - - var client = (me.zeroclipboard = new ZeroClipboard()); - - // 复制内容 - client.on("copy", function(e) { - var client = e.client, - rng = me.selection.getRange(), - div = document.createElement("div"); - - div.appendChild(rng.cloneContents()); - client.setText(div.innerText || div.textContent); - client.setHtml(div.innerHTML); - rng.select(); - }); - // hover事件传递到target - client.on("mouseover mouseout", function(e) { - var target = e.target; - if (target) { - if (e.type == "mouseover") { - domUtils.addClass(target, "edui-state-hover"); - } else if (e.type == "mouseout") { - domUtils.removeClasses(target, "edui-state-hover"); - } - } - }); - // flash加载不成功 - client.on("wrongflash noflash", function() { - ZeroClipboard.destroy(); - }); - - // 触发事件 - me.fireEvent("zeroclipboardready", client); - } - - return { - bindEvents: { - ready: function() { - if (!browser.ie) { - if (window.ZeroClipboard) { - initZeroClipboard(); - } else { - utils.loadFile( - document, - { - src: - me.options.UEDITOR_HOME_URL + - "third-party/zeroclipboard/ZeroClipboard.js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - initZeroClipboard(); - } - ); - } - } - } - }, - commands: { - copy: { - execCommand: function(cmd) { - if (!me.document.execCommand("copy")) { - alert(me.getLang("copymsg")); - } - } - } - } - }; -}); - - -// plugins/paste.js -///import core -///import plugins/inserthtml.js -///import plugins/undo.js -///import plugins/serialize.js -///commands 粘贴 -///commandsName PastePlain -///commandsTitle 纯文本粘贴模式 -/** - * @description 粘贴 - * @author zhanyi - */ -UE.plugins["paste"] = function() { - function getClipboardData(callback) { - var doc = this.document; - if (doc.getElementById("baidu_pastebin")) { - return; - } - var range = this.selection.getRange(), - bk = range.createBookmark(), - //创建剪贴的容器div - pastebin = doc.createElement("div"); - pastebin.id = "baidu_pastebin"; - // Safari 要求div必须有内容,才能粘贴内容进来 - browser.webkit && - pastebin.appendChild( - doc.createTextNode(domUtils.fillChar + domUtils.fillChar) - ); - doc.body.appendChild(pastebin); - //trace:717 隐藏的span不能得到top - //bk.start.innerHTML = ' '; - bk.start.style.display = ""; - pastebin.style.cssText = - "position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:" + - //要在现在光标平行的位置加入,否则会出现跳动的问题 - domUtils.getXY(bk.start).y + - "px"; - - range.selectNodeContents(pastebin).select(true); - - setTimeout(function() { - if (browser.webkit) { - for ( - var i = 0, pastebins = doc.querySelectorAll("#baidu_pastebin"), pi; - (pi = pastebins[i++]); - - ) { - if (domUtils.isEmptyNode(pi)) { - domUtils.remove(pi); - } else { - pastebin = pi; - break; - } - } - } - try { - pastebin.parentNode.removeChild(pastebin); - } catch (e) {} - range.moveToBookmark(bk).select(true); - callback(pastebin); - }, 0); - } - - var me = this; - - me.setOpt({ - retainOnlyLabelPasted: false - }); - - var txtContent, htmlContent, address; - - function getPureHtml(html) { - return html.replace(/<(\/?)([\w\-]+)([^>]*)>/gi, function( - a, - b, - tagName, - attrs - ) { - tagName = tagName.toLowerCase(); - if ({ img: 1 }[tagName]) { - return a; - } - attrs = attrs.replace( - /([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi, - function(str, atr, val) { - if ( - { - src: 1, - href: 1, - name: 1 - }[atr.toLowerCase()] - ) { - return atr + "=" + val + " "; - } - return ""; - } - ); - if ( - { - span: 1, - div: 1 - }[tagName] - ) { - return ""; - } else { - return "<" + b + tagName + " " + utils.trim(attrs) + ">"; - } - }); - } - function filter(div) { - var html; - if (div.firstChild) { - //去掉cut中添加的边界值 - var nodes = domUtils.getElementsByTagName(div, "span"); - for (var i = 0, ni; (ni = nodes[i++]); ) { - if (ni.id == "_baidu_cut_start" || ni.id == "_baidu_cut_end") { - domUtils.remove(ni); - } - } - - if (browser.webkit) { - var brs = div.querySelectorAll("div br"); - for (var i = 0, bi; (bi = brs[i++]); ) { - var pN = bi.parentNode; - if (pN.tagName == "DIV" && pN.childNodes.length == 1) { - pN.innerHTML = "


                      "; - domUtils.remove(pN); - } - } - var divs = div.querySelectorAll("#baidu_pastebin"); - for (var i = 0, di; (di = divs[i++]); ) { - var tmpP = me.document.createElement("p"); - di.parentNode.insertBefore(tmpP, di); - while (di.firstChild) { - tmpP.appendChild(di.firstChild); - } - domUtils.remove(di); - } - - var metas = div.querySelectorAll("meta"); - for (var i = 0, ci; (ci = metas[i++]); ) { - domUtils.remove(ci); - } - - var brs = div.querySelectorAll("br"); - for (i = 0; (ci = brs[i++]); ) { - if (/^apple-/i.test(ci.className)) { - domUtils.remove(ci); - } - } - } - if (browser.gecko) { - var dirtyNodes = div.querySelectorAll("[_moz_dirty]"); - for (i = 0; (ci = dirtyNodes[i++]); ) { - ci.removeAttribute("_moz_dirty"); - } - } - if (!browser.ie) { - var spans = div.querySelectorAll("span.Apple-style-span"); - for (var i = 0, ci; (ci = spans[i++]); ) { - domUtils.remove(ci, true); - } - } - - //ie下使用innerHTML会产生多余的\r\n字符,也会产生 这里过滤掉 - html = div.innerHTML; //.replace(/>(?:(\s| )*?)<'); - - //过滤word粘贴过来的冗余属性 - html = UE.filterWord(html); - //取消了忽略空白的第二个参数,粘贴过来的有些是有空白的,会被套上相关的标签 - var root = UE.htmlparser(html); - //如果给了过滤规则就先进行过滤 - if (me.options.filterRules) { - UE.filterNode(root, me.options.filterRules); - } - //执行默认的处理 - me.filterInputRule(root); - //针对chrome的处理 - if (browser.webkit) { - var br = root.lastChild(); - if (br && br.type == "element" && br.tagName == "br") { - root.removeChild(br); - } - utils.each(me.body.querySelectorAll("div"), function(node) { - if (domUtils.isEmptyBlock(node)) { - domUtils.remove(node, true); - } - }); - } - html = { html: root.toHtml() }; - me.fireEvent("beforepaste", html, root); - //抢了默认的粘贴,那后边的内容就不执行了,比如表格粘贴 - if (!html.html) { - return; - } - root = UE.htmlparser(html.html, true); - //如果开启了纯文本模式 - if (me.queryCommandState("pasteplain") === 1) { - me.execCommand( - "insertHtml", - UE.filterNode(root, me.options.filterTxtRules).toHtml(), - true - ); - } else { - //文本模式 - UE.filterNode(root, me.options.filterTxtRules); - txtContent = root.toHtml(); - //完全模式 - htmlContent = html.html; - - address = me.selection.getRange().createAddress(true); - me.execCommand( - "insertHtml", - me.getOpt("retainOnlyLabelPasted") === true - ? getPureHtml(htmlContent) - : htmlContent, - true - ); - } - me.fireEvent("afterpaste", html); - } - } - - me.addListener("pasteTransfer", function(cmd, plainType) { - if (address && txtContent && htmlContent && txtContent != htmlContent) { - var range = me.selection.getRange(); - range.moveToAddress(address, true); - - if (!range.collapsed) { - while (!domUtils.isBody(range.startContainer)) { - var start = range.startContainer; - if (start.nodeType == 1) { - start = start.childNodes[range.startOffset]; - if (!start) { - range.setStartBefore(range.startContainer); - continue; - } - var pre = start.previousSibling; - - if ( - pre && - pre.nodeType == 3 && - new RegExp("^[\n\r\t " + domUtils.fillChar + "]*$").test( - pre.nodeValue - ) - ) { - range.setStartBefore(pre); - } - } - if (range.startOffset == 0) { - range.setStartBefore(range.startContainer); - } else { - break; - } - } - while (!domUtils.isBody(range.endContainer)) { - var end = range.endContainer; - if (end.nodeType == 1) { - end = end.childNodes[range.endOffset]; - if (!end) { - range.setEndAfter(range.endContainer); - continue; - } - var next = end.nextSibling; - if ( - next && - next.nodeType == 3 && - new RegExp("^[\n\r\t" + domUtils.fillChar + "]*$").test( - next.nodeValue - ) - ) { - range.setEndAfter(next); - } - } - if ( - range.endOffset == - range.endContainer[ - range.endContainer.nodeType == 3 ? "nodeValue" : "childNodes" - ].length - ) { - range.setEndAfter(range.endContainer); - } else { - break; - } - } - } - - range.deleteContents(); - range.select(true); - me.__hasEnterExecCommand = true; - var html = htmlContent; - if (plainType === 2) { - html = getPureHtml(html); - } else if (plainType) { - html = txtContent; - } - me.execCommand("inserthtml", html, true); - me.__hasEnterExecCommand = false; - var rng = me.selection.getRange(); - while ( - !domUtils.isBody(rng.startContainer) && - !rng.startOffset && - rng.startContainer[ - rng.startContainer.nodeType == 3 ? "nodeValue" : "childNodes" - ].length - ) { - rng.setStartBefore(rng.startContainer); - } - var tmpAddress = rng.createAddress(true); - address.endAddress = tmpAddress.startAddress; - } - }); - - me.addListener("ready", function() { - domUtils.on(me.body, "cut", function() { - var range = me.selection.getRange(); - if (!range.collapsed && me.undoManger) { - if (me.undoManger.list.length < 1) me.undoManger.save(); - setTimeout(function() { - me.undoManger.save(); - }); - } - }); - - //ie下beforepaste在点击右键时也会触发,所以用监控键盘才处理 - domUtils.on( - me.body, - browser.ie || browser.opera ? "keydown" : "paste", - function(e) { - if ( - (browser.ie || browser.opera) && - ((!e.ctrlKey && !e.metaKey) || e.keyCode != "86") - ) { - return; - } - getClipboardData.call(me, function(div) { - filter(div); - }); - } - ); - }); - - me.commands["paste"] = { - execCommand: function(cmd) { - if (browser.ie) { - getClipboardData.call(me, function(div) { - filter(div); - }); - me.document.execCommand("paste"); - } else { - alert(me.getLang("pastemsg")); - } - } - }; -}; - - -// plugins/puretxtpaste.js -/** - * 纯文本粘贴插件 - * @file - * @since 1.2.6.1 - */ - -UE.plugins["pasteplain"] = function() { - var me = this; - me.setOpt({ - pasteplain: false, - filterTxtRules: (function() { - function transP(node) { - node.tagName = "p"; - node.setStyle(); - } - function removeNode(node) { - node.parentNode.removeChild(node, true); - } - return { - //直接删除及其字节点内容 - "-": "script style object iframe embed input select", - p: { $: {} }, - br: { $: {} }, - div: function(node) { - var tmpNode, - p = UE.uNode.createElement("p"); - while ((tmpNode = node.firstChild())) { - if (tmpNode.type == "text" || !UE.dom.dtd.$block[tmpNode.tagName]) { - p.appendChild(tmpNode); - } else { - if (p.firstChild()) { - node.parentNode.insertBefore(p, node); - p = UE.uNode.createElement("p"); - } else { - node.parentNode.insertBefore(tmpNode, node); - } - } - } - if (p.firstChild()) { - node.parentNode.insertBefore(p, node); - } - node.parentNode.removeChild(node); - }, - ol: removeNode, - ul: removeNode, - dl: removeNode, - dt: removeNode, - dd: removeNode, - li: removeNode, - caption: transP, - th: transP, - tr: transP, - h1: transP, - h2: transP, - h3: transP, - h4: transP, - h5: transP, - h6: transP, - td: function(node) { - //没有内容的td直接删掉 - var txt = !!node.innerText(); - if (txt) { - node.parentNode.insertAfter( - UE.uNode.createText("    "), - node - ); - } - node.parentNode.removeChild(node, node.innerText()); - } - }; - })() - }); - //暂时这里支持一下老版本的属性 - var pasteplain = me.options.pasteplain; - - /** - * 启用或取消纯文本粘贴模式 - * @command pasteplain - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.queryCommandState( 'pasteplain' ); - * ``` - */ - - /** - * 查询当前是否处于纯文本粘贴模式 - * @command pasteplain - * @method queryCommandState - * @param { String } cmd 命令字符串 - * @return { int } 如果处于纯文本模式,返回1,否则,返回0 - * @example - * ```javascript - * editor.queryCommandState( 'pasteplain' ); - * ``` - */ - me.commands["pasteplain"] = { - queryCommandState: function() { - return pasteplain ? 1 : 0; - }, - execCommand: function() { - pasteplain = !pasteplain | 0; - }, - notNeedUndo: 1 - }; -}; - - -// plugins/list.js -/** - * 有序列表,无序列表插件 - * @file - * @since 1.2.6.1 - */ - -UE.plugins["list"] = function() { - var me = this, - notExchange = { - TD: 1, - PRE: 1, - BLOCKQUOTE: 1 - }; - var customStyle = { - cn: "cn-1-", - cn1: "cn-2-", - cn2: "cn-3-", - num: "num-1-", - num1: "num-2-", - num2: "num-3-", - dash: "dash", - dot: "dot" - }; - - me.setOpt({ - autoTransWordToList: false, - insertorderedlist: { - num: "", - num1: "", - num2: "", - cn: "", - cn1: "", - cn2: "", - decimal: "", - "lower-alpha": "", - "lower-roman": "", - "upper-alpha": "", - "upper-roman": "" - }, - insertunorderedlist: { - circle: "", - disc: "", - square: "", - dash: "", - dot: "" - }, - listDefaultPaddingLeft: "30", - listiconpath: "http://bs.baidu.com/listicon/", - maxListLevel: -1, //-1不限制 - disablePInList: false - }); - function listToArray(list) { - var arr = []; - for (var p in list) { - arr.push(p); - } - return arr; - } - var listStyle = { - OL: listToArray(me.options.insertorderedlist), - UL: listToArray(me.options.insertunorderedlist) - }; - var liiconpath = me.options.listiconpath; - - //根据用户配置,调整customStyle - for (var s in customStyle) { - if ( - !me.options.insertorderedlist.hasOwnProperty(s) && - !me.options.insertunorderedlist.hasOwnProperty(s) - ) { - delete customStyle[s]; - } - } - - me.ready(function() { - var customCss = []; - for (var p in customStyle) { - if (p == "dash" || p == "dot") { - customCss.push( - "li.list-" + - customStyle[p] + - "{background-image:url(" + - liiconpath + - customStyle[p] + - ".gif)}" - ); - customCss.push( - "ul.custom_" + - p + - "{list-style:none;}ul.custom_" + - p + - " li{background-position:0 3px;background-repeat:no-repeat}" - ); - } else { - for (var i = 0; i < 99; i++) { - customCss.push( - "li.list-" + - customStyle[p] + - i + - "{background-image:url(" + - liiconpath + - "list-" + - customStyle[p] + - i + - ".gif)}" - ); - } - customCss.push( - "ol.custom_" + - p + - "{list-style:none;}ol.custom_" + - p + - " li{background-position:0 3px;background-repeat:no-repeat}" - ); - } - switch (p) { - case "cn": - customCss.push("li.list-" + p + "-paddingleft-1{padding-left:25px}"); - customCss.push("li.list-" + p + "-paddingleft-2{padding-left:40px}"); - customCss.push("li.list-" + p + "-paddingleft-3{padding-left:55px}"); - break; - case "cn1": - customCss.push("li.list-" + p + "-paddingleft-1{padding-left:30px}"); - customCss.push("li.list-" + p + "-paddingleft-2{padding-left:40px}"); - customCss.push("li.list-" + p + "-paddingleft-3{padding-left:55px}"); - break; - case "cn2": - customCss.push("li.list-" + p + "-paddingleft-1{padding-left:40px}"); - customCss.push("li.list-" + p + "-paddingleft-2{padding-left:55px}"); - customCss.push("li.list-" + p + "-paddingleft-3{padding-left:68px}"); - break; - case "num": - case "num1": - customCss.push("li.list-" + p + "-paddingleft-1{padding-left:25px}"); - break; - case "num2": - customCss.push("li.list-" + p + "-paddingleft-1{padding-left:35px}"); - customCss.push("li.list-" + p + "-paddingleft-2{padding-left:40px}"); - break; - case "dash": - customCss.push("li.list-" + p + "-paddingleft{padding-left:35px}"); - break; - case "dot": - customCss.push("li.list-" + p + "-paddingleft{padding-left:20px}"); - } - } - customCss.push(".list-paddingleft-1{padding-left:0}"); - customCss.push( - ".list-paddingleft-2{padding-left:" + - me.options.listDefaultPaddingLeft + - "px}" - ); - customCss.push( - ".list-paddingleft-3{padding-left:" + - me.options.listDefaultPaddingLeft * 2 + - "px}" - ); - //如果不给宽度会在自定应样式里出现滚动条 - utils.cssRule( - "list", - "ol,ul{margin:0;pading:0;" + - (browser.ie ? "" : "width:95%") + - "}li{clear:both;}" + - customCss.join("\n"), - me.document - ); - }); - //单独处理剪切的问题 - me.ready(function() { - domUtils.on(me.body, "cut", function() { - setTimeout(function() { - var rng = me.selection.getRange(), - li; - //trace:3416 - if (!rng.collapsed) { - if ( - (li = domUtils.findParentByTagName(rng.startContainer, "li", true)) - ) { - if (!li.nextSibling && domUtils.isEmptyBlock(li)) { - var pn = li.parentNode, - node; - if ((node = pn.previousSibling)) { - domUtils.remove(pn); - rng.setStartAtLast(node).collapse(true); - rng.select(true); - } else if ((node = pn.nextSibling)) { - domUtils.remove(pn); - rng.setStartAtFirst(node).collapse(true); - rng.select(true); - } else { - var tmpNode = me.document.createElement("p"); - domUtils.fillNode(me.document, tmpNode); - pn.parentNode.insertBefore(tmpNode, pn); - domUtils.remove(pn); - rng.setStart(tmpNode, 0).collapse(true); - rng.select(true); - } - } - } - } - }); - }); - }); - - function getStyle(node) { - var cls = node.className; - if (domUtils.hasClass(node, /custom_/)) { - return cls.match(/custom_(\w+)/)[1]; - } - return domUtils.getStyle(node, "list-style-type"); - } - - me.addListener("beforepaste", function(type, html) { - var me = this, - rng = me.selection.getRange(), - li; - var root = UE.htmlparser(html.html, true); - if ((li = domUtils.findParentByTagName(rng.startContainer, "li", true))) { - var list = li.parentNode, - tagName = list.tagName == "OL" ? "ul" : "ol"; - utils.each(root.getNodesByTagName(tagName), function(n) { - n.tagName = list.tagName; - n.setAttr(); - if (n.parentNode === root) { - type = getStyle(list) || (list.tagName == "OL" ? "decimal" : "disc"); - } else { - var className = n.parentNode.getAttr("class"); - if (className && /custom_/.test(className)) { - type = className.match(/custom_(\w+)/)[1]; - } else { - type = n.parentNode.getStyle("list-style-type"); - } - if (!type) { - type = list.tagName == "OL" ? "decimal" : "disc"; - } - } - var index = utils.indexOf(listStyle[list.tagName], type); - if (n.parentNode !== root) - index = index + 1 == listStyle[list.tagName].length ? 0 : index + 1; - var currentStyle = listStyle[list.tagName][index]; - if (customStyle[currentStyle]) { - n.setAttr("class", "custom_" + currentStyle); - } else { - n.setStyle("list-style-type", currentStyle); - } - }); - } - - html.html = root.toHtml(); - }); - //导出时,去掉p标签 - me.getOpt("disablePInList") === true && - me.addOutputRule(function(root) { - utils.each(root.getNodesByTagName("li"), function(li) { - var newChildrens = [], - index = 0; - utils.each(li.children, function(n) { - if (n.tagName == "p") { - var tmpNode; - while ((tmpNode = n.children.pop())) { - newChildrens.splice(index, 0, tmpNode); - tmpNode.parentNode = li; - lastNode = tmpNode; - } - tmpNode = newChildrens[newChildrens.length - 1]; - if ( - !tmpNode || - tmpNode.type != "element" || - tmpNode.tagName != "br" - ) { - var br = UE.uNode.createElement("br"); - br.parentNode = li; - newChildrens.push(br); - } - - index = newChildrens.length; - } - }); - if (newChildrens.length) { - li.children = newChildrens; - } - }); - }); - //进入编辑器的li要套p标签 - me.addInputRule(function(root) { - utils.each(root.getNodesByTagName("li"), function(li) { - var tmpP = UE.uNode.createElement("p"); - for (var i = 0, ci; (ci = li.children[i]); ) { - if (ci.type == "text" || dtd.p[ci.tagName]) { - tmpP.appendChild(ci); - } else { - if (tmpP.firstChild()) { - li.insertBefore(tmpP, ci); - tmpP = UE.uNode.createElement("p"); - i = i + 2; - } else { - i++; - } - } - } - if ((tmpP.firstChild() && !tmpP.parentNode) || !li.firstChild()) { - li.appendChild(tmpP); - } - //trace:3357 - //p不能为空 - if (!tmpP.firstChild()) { - tmpP.innerHTML(browser.ie ? " " : "
                      "); - } - //去掉末尾的空白 - var p = li.firstChild(); - var lastChild = p.lastChild(); - if ( - lastChild && - lastChild.type == "text" && - /^\s*$/.test(lastChild.data) - ) { - p.removeChild(lastChild); - } - }); - if (me.options.autoTransWordToList) { - var orderlisttype = { - num1: /^\d+\)/, - decimal: /^\d+\./, - "lower-alpha": /^[a-z]+\)/, - "upper-alpha": /^[A-Z]+\./, - cn: /^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/, - cn2: /^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/ - }, - unorderlisttype = { - square: "n" - }; - function checkListType(content, container) { - var span = container.firstChild(); - if ( - span && - span.type == "element" && - span.tagName == "span" && - /Wingdings|Symbol/.test(span.getStyle("font-family")) - ) { - for (var p in unorderlisttype) { - if (unorderlisttype[p] == span.data) { - return p; - } - } - return "disc"; - } - for (var p in orderlisttype) { - if (orderlisttype[p].test(content)) { - return p; - } - } - } - utils.each(root.getNodesByTagName("p"), function(node) { - if (node.getAttr("class") != "MsoListParagraph") { - return; - } - - //word粘贴过来的会带有margin要去掉,但这样也可能会误命中一些央视 - node.setStyle("margin", ""); - node.setStyle("margin-left", ""); - node.setAttr("class", ""); - - function appendLi(list, p, type) { - if (list.tagName == "ol") { - if (browser.ie) { - var first = p.firstChild(); - if ( - first.type == "element" && - first.tagName == "span" && - orderlisttype[type].test(first.innerText()) - ) { - p.removeChild(first); - } - } else { - p.innerHTML(p.innerHTML().replace(orderlisttype[type], "")); - } - } else { - p.removeChild(p.firstChild()); - } - - var li = UE.uNode.createElement("li"); - li.appendChild(p); - list.appendChild(li); - } - var tmp = node, - type, - cacheNode = node; - - if ( - node.parentNode.tagName != "li" && - (type = checkListType(node.innerText(), node)) - ) { - var list = UE.uNode.createElement( - me.options.insertorderedlist.hasOwnProperty(type) ? "ol" : "ul" - ); - if (customStyle[type]) { - list.setAttr("class", "custom_" + type); - } else { - list.setStyle("list-style-type", type); - } - while ( - node && - node.parentNode.tagName != "li" && - checkListType(node.innerText(), node) - ) { - tmp = node.nextSibling(); - if (!tmp) { - node.parentNode.insertBefore(list, node); - } - appendLi(list, node, type); - node = tmp; - } - if (!list.parentNode && node && node.parentNode) { - node.parentNode.insertBefore(list, node); - } - } - var span = cacheNode.firstChild(); - if ( - span && - span.type == "element" && - span.tagName == "span" && - /^\s*( )+\s*$/.test(span.innerText()) - ) { - span.parentNode.removeChild(span); - } - }); - } - }); - - //调整索引标签 - me.addListener("contentchange", function() { - adjustListStyle(me.document); - }); - - function adjustListStyle(doc, ignore) { - utils.each(domUtils.getElementsByTagName(doc, "ol ul"), function(node) { - if (!domUtils.inDoc(node, doc)) return; - - var parent = node.parentNode; - if (parent.tagName == node.tagName) { - var nodeStyleType = - getStyle(node) || (node.tagName == "OL" ? "decimal" : "disc"), - parentStyleType = - getStyle(parent) || (parent.tagName == "OL" ? "decimal" : "disc"); - if (nodeStyleType == parentStyleType) { - var styleIndex = utils.indexOf( - listStyle[node.tagName], - nodeStyleType - ); - styleIndex = styleIndex + 1 == listStyle[node.tagName].length - ? 0 - : styleIndex + 1; - setListStyle(node, listStyle[node.tagName][styleIndex]); - } - } - var index = 0, - type = 2; - if (domUtils.hasClass(node, /custom_/)) { - if ( - !( - /[ou]l/i.test(parent.tagName) && - domUtils.hasClass(parent, /custom_/) - ) - ) { - type = 1; - } - } else { - if ( - /[ou]l/i.test(parent.tagName) && - domUtils.hasClass(parent, /custom_/) - ) { - type = 3; - } - } - - var style = domUtils.getStyle(node, "list-style-type"); - style && (node.style.cssText = "list-style-type:" + style); - node.className = - utils.trim(node.className.replace(/list-paddingleft-\w+/, "")) + - " list-paddingleft-" + - type; - utils.each(domUtils.getElementsByTagName(node, "li"), function(li) { - li.style.cssText && (li.style.cssText = ""); - if (!li.firstChild) { - domUtils.remove(li); - return; - } - if (li.parentNode !== node) { - return; - } - index++; - if (domUtils.hasClass(node, /custom_/)) { - var paddingLeft = 1, - currentStyle = getStyle(node); - if (node.tagName == "OL") { - if (currentStyle) { - switch (currentStyle) { - case "cn": - case "cn1": - case "cn2": - if ( - index > 10 && - (index % 10 == 0 || (index > 10 && index < 20)) - ) { - paddingLeft = 2; - } else if (index > 20) { - paddingLeft = 3; - } - break; - case "num2": - if (index > 9) { - paddingLeft = 2; - } - } - } - li.className = - "list-" + - customStyle[currentStyle] + - index + - " " + - "list-" + - currentStyle + - "-paddingleft-" + - paddingLeft; - } else { - li.className = - "list-" + - customStyle[currentStyle] + - " " + - "list-" + - currentStyle + - "-paddingleft"; - } - } else { - li.className = li.className.replace(/list-[\w\-]+/gi, ""); - } - var className = li.getAttribute("class"); - if (className !== null && !className.replace(/\s/g, "")) { - domUtils.removeAttributes(li, "class"); - } - }); - !ignore && - adjustList( - node, - node.tagName.toLowerCase(), - getStyle(node) || domUtils.getStyle(node, "list-style-type"), - true - ); - }); - } - function adjustList(list, tag, style, ignoreEmpty) { - var nextList = list.nextSibling; - if ( - nextList && - nextList.nodeType == 1 && - nextList.tagName.toLowerCase() == tag && - (getStyle(nextList) || - domUtils.getStyle(nextList, "list-style-type") || - (tag == "ol" ? "decimal" : "disc")) == style - ) { - domUtils.moveChild(nextList, list); - if (nextList.childNodes.length == 0) { - domUtils.remove(nextList); - } - } - if (nextList && domUtils.isFillChar(nextList)) { - domUtils.remove(nextList); - } - var preList = list.previousSibling; - if ( - preList && - preList.nodeType == 1 && - preList.tagName.toLowerCase() == tag && - (getStyle(preList) || - domUtils.getStyle(preList, "list-style-type") || - (tag == "ol" ? "decimal" : "disc")) == style - ) { - domUtils.moveChild(list, preList); - } - if (preList && domUtils.isFillChar(preList)) { - domUtils.remove(preList); - } - !ignoreEmpty && domUtils.isEmptyBlock(list) && domUtils.remove(list); - if (getStyle(list)) { - adjustListStyle(list.ownerDocument, true); - } - } - - function setListStyle(list, style) { - if (customStyle[style]) { - list.className = "custom_" + style; - } - try { - domUtils.setStyle(list, "list-style-type", style); - } catch (e) {} - } - function clearEmptySibling(node) { - var tmpNode = node.previousSibling; - if (tmpNode && domUtils.isEmptyBlock(tmpNode)) { - domUtils.remove(tmpNode); - } - tmpNode = node.nextSibling; - if (tmpNode && domUtils.isEmptyBlock(tmpNode)) { - domUtils.remove(tmpNode); - } - } - - me.addListener("keydown", function(type, evt) { - function preventAndSave() { - evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); - me.fireEvent("contentchange"); - me.undoManger && me.undoManger.save(); - } - function findList(node, filterFn) { - while (node && !domUtils.isBody(node)) { - if (filterFn(node)) { - return null; - } - if (node.nodeType == 1 && /[ou]l/i.test(node.tagName)) { - return node; - } - node = node.parentNode; - } - return null; - } - var keyCode = evt.keyCode || evt.which; - if (keyCode == 13 && !evt.shiftKey) { - //回车 - var rng = me.selection.getRange(), - parent = domUtils.findParent( - rng.startContainer, - function(node) { - return domUtils.isBlockElm(node); - }, - true - ), - li = domUtils.findParentByTagName(rng.startContainer, "li", true); - if (parent && parent.tagName != "PRE" && !li) { - var html = parent.innerHTML.replace( - new RegExp(domUtils.fillChar, "g"), - "" - ); - if (/^\s*1\s*\.[^\d]/.test(html)) { - parent.innerHTML = html.replace(/^\s*1\s*\./, ""); - rng.setStartAtLast(parent).collapse(true).select(); - me.__hasEnterExecCommand = true; - me.execCommand("insertorderedlist"); - me.__hasEnterExecCommand = false; - } - } - var range = me.selection.getRange(), - start = findList(range.startContainer, function(node) { - return node.tagName == "TABLE"; - }), - end = range.collapsed - ? start - : findList(range.endContainer, function(node) { - return node.tagName == "TABLE"; - }); - - if (start && end && start === end) { - if (!range.collapsed) { - start = domUtils.findParentByTagName( - range.startContainer, - "li", - true - ); - end = domUtils.findParentByTagName(range.endContainer, "li", true); - if (start && end && start === end) { - range.deleteContents(); - li = domUtils.findParentByTagName(range.startContainer, "li", true); - if (li && domUtils.isEmptyBlock(li)) { - pre = li.previousSibling; - next = li.nextSibling; - p = me.document.createElement("p"); - - domUtils.fillNode(me.document, p); - parentList = li.parentNode; - if (pre && next) { - range.setStart(next, 0).collapse(true).select(true); - domUtils.remove(li); - } else { - if ((!pre && !next) || !pre) { - parentList.parentNode.insertBefore(p, parentList); - } else { - li.parentNode.parentNode.insertBefore( - p, - parentList.nextSibling - ); - } - domUtils.remove(li); - if (!parentList.firstChild) { - domUtils.remove(parentList); - } - range.setStart(p, 0).setCursor(); - } - preventAndSave(); - return; - } - } else { - var tmpRange = range.cloneRange(), - bk = tmpRange.collapse(false).createBookmark(); - - range.deleteContents(); - tmpRange.moveToBookmark(bk); - var li = domUtils.findParentByTagName( - tmpRange.startContainer, - "li", - true - ); - - clearEmptySibling(li); - tmpRange.select(); - preventAndSave(); - return; - } - } - - li = domUtils.findParentByTagName(range.startContainer, "li", true); - - if (li) { - if (domUtils.isEmptyBlock(li)) { - bk = range.createBookmark(); - var parentList = li.parentNode; - if (li !== parentList.lastChild) { - domUtils.breakParent(li, parentList); - clearEmptySibling(li); - } else { - parentList.parentNode.insertBefore(li, parentList.nextSibling); - if (domUtils.isEmptyNode(parentList)) { - domUtils.remove(parentList); - } - } - //嵌套不处理 - if (!dtd.$list[li.parentNode.tagName]) { - if (!domUtils.isBlockElm(li.firstChild)) { - p = me.document.createElement("p"); - li.parentNode.insertBefore(p, li); - while (li.firstChild) { - p.appendChild(li.firstChild); - } - domUtils.remove(li); - } else { - domUtils.remove(li, true); - } - } - range.moveToBookmark(bk).select(); - } else { - var first = li.firstChild; - if (!first || !domUtils.isBlockElm(first)) { - var p = me.document.createElement("p"); - - !li.firstChild && domUtils.fillNode(me.document, p); - while (li.firstChild) { - p.appendChild(li.firstChild); - } - li.appendChild(p); - first = p; - } - - var span = me.document.createElement("span"); - - range.insertNode(span); - domUtils.breakParent(span, li); - - var nextLi = span.nextSibling; - first = nextLi.firstChild; - - if (!first) { - p = me.document.createElement("p"); - - domUtils.fillNode(me.document, p); - nextLi.appendChild(p); - first = p; - } - if (domUtils.isEmptyNode(first)) { - first.innerHTML = ""; - domUtils.fillNode(me.document, first); - } - - range.setStart(first, 0).collapse(true).shrinkBoundary().select(); - domUtils.remove(span); - var pre = nextLi.previousSibling; - if (pre && domUtils.isEmptyBlock(pre)) { - pre.innerHTML = "

                      "; - domUtils.fillNode(me.document, pre.firstChild); - } - } - // } - preventAndSave(); - } - } - } - if (keyCode == 8) { - //修中ie中li下的问题 - range = me.selection.getRange(); - if (range.collapsed && domUtils.isStartInblock(range)) { - tmpRange = range.cloneRange().trimBoundary(); - li = domUtils.findParentByTagName(range.startContainer, "li", true); - //要在li的最左边,才能处理 - if (li && domUtils.isStartInblock(tmpRange)) { - start = domUtils.findParentByTagName(range.startContainer, "p", true); - if (start && start !== li.firstChild) { - var parentList = domUtils.findParentByTagName(start, ["ol", "ul"]); - domUtils.breakParent(start, parentList); - clearEmptySibling(start); - me.fireEvent("contentchange"); - range.setStart(start, 0).setCursor(false, true); - me.fireEvent("saveScene"); - domUtils.preventDefault(evt); - return; - } - - if (li && (pre = li.previousSibling)) { - if (keyCode == 46 && li.childNodes.length) { - return; - } - //有可能上边的兄弟节点是个2级菜单,要追加到2级菜单的最后的li - if (dtd.$list[pre.tagName]) { - pre = pre.lastChild; - } - me.undoManger && me.undoManger.save(); - first = li.firstChild; - if (domUtils.isBlockElm(first)) { - if (domUtils.isEmptyNode(first)) { - // range.setEnd(pre, pre.childNodes.length).shrinkBoundary().collapse().select(true); - pre.appendChild(first); - range.setStart(first, 0).setCursor(false, true); - //first不是唯一的节点 - while (li.firstChild) { - pre.appendChild(li.firstChild); - } - } else { - span = me.document.createElement("span"); - range.insertNode(span); - //判断pre是否是空的节点,如果是


                      类型的空节点,干掉p标签防止它占位 - if (domUtils.isEmptyBlock(pre)) { - pre.innerHTML = ""; - } - domUtils.moveChild(li, pre); - range.setStartBefore(span).collapse(true).select(true); - - domUtils.remove(span); - } - } else { - if (domUtils.isEmptyNode(li)) { - var p = me.document.createElement("p"); - pre.appendChild(p); - range.setStart(p, 0).setCursor(); - // range.setEnd(pre, pre.childNodes.length).shrinkBoundary().collapse().select(true); - } else { - range - .setEnd(pre, pre.childNodes.length) - .collapse() - .select(true); - while (li.firstChild) { - pre.appendChild(li.firstChild); - } - } - } - domUtils.remove(li); - me.fireEvent("contentchange"); - me.fireEvent("saveScene"); - domUtils.preventDefault(evt); - return; - } - //trace:980 - - if (li && !li.previousSibling) { - var parentList = li.parentNode; - var bk = range.createBookmark(); - if (domUtils.isTagNode(parentList.parentNode, "ol ul")) { - parentList.parentNode.insertBefore(li, parentList); - if (domUtils.isEmptyNode(parentList)) { - domUtils.remove(parentList); - } - } else { - while (li.firstChild) { - parentList.parentNode.insertBefore(li.firstChild, parentList); - } - - domUtils.remove(li); - if (domUtils.isEmptyNode(parentList)) { - domUtils.remove(parentList); - } - } - range.moveToBookmark(bk).setCursor(false, true); - me.fireEvent("contentchange"); - me.fireEvent("saveScene"); - domUtils.preventDefault(evt); - return; - } - } - } - } - }); - - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - if (keyCode == 8) { - var rng = me.selection.getRange(), - list; - if ( - (list = domUtils.findParentByTagName( - rng.startContainer, - ["ol", "ul"], - true - )) - ) { - adjustList( - list, - list.tagName.toLowerCase(), - getStyle(list) || domUtils.getComputedStyle(list, "list-style-type"), - true - ); - } - } - }); - //处理tab键 - me.addListener("tabkeydown", function() { - var range = me.selection.getRange(); - - //控制级数 - function checkLevel(li) { - if (me.options.maxListLevel != -1) { - var level = li.parentNode, - levelNum = 0; - while (/[ou]l/i.test(level.tagName)) { - levelNum++; - level = level.parentNode; - } - if (levelNum >= me.options.maxListLevel) { - return true; - } - } - } - //只以开始为准 - //todo 后续改进 - var li = domUtils.findParentByTagName(range.startContainer, "li", true); - if (li) { - var bk; - if (range.collapsed) { - if (checkLevel(li)) return true; - var parentLi = li.parentNode, - list = me.document.createElement(parentLi.tagName), - index = utils.indexOf( - listStyle[list.tagName], - getStyle(parentLi) || - domUtils.getComputedStyle(parentLi, "list-style-type") - ); - index = index + 1 == listStyle[list.tagName].length ? 0 : index + 1; - var currentStyle = listStyle[list.tagName][index]; - setListStyle(list, currentStyle); - if (domUtils.isStartInblock(range)) { - me.fireEvent("saveScene"); - bk = range.createBookmark(); - parentLi.insertBefore(list, li); - list.appendChild(li); - adjustList(list, list.tagName.toLowerCase(), currentStyle); - me.fireEvent("contentchange"); - range.moveToBookmark(bk).select(true); - return true; - } - } else { - me.fireEvent("saveScene"); - bk = range.createBookmark(); - for ( - var i = 0, closeList, parents = domUtils.findParents(li), ci; - (ci = parents[i++]); - - ) { - if (domUtils.isTagNode(ci, "ol ul")) { - closeList = ci; - break; - } - } - var current = li; - if (bk.end) { - while ( - current && - !( - domUtils.getPosition(current, bk.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - if (checkLevel(current)) { - current = domUtils.getNextDomNode(current, false, null, function( - node - ) { - return node !== closeList; - }); - continue; - } - var parentLi = current.parentNode, - list = me.document.createElement(parentLi.tagName), - index = utils.indexOf( - listStyle[list.tagName], - getStyle(parentLi) || - domUtils.getComputedStyle(parentLi, "list-style-type") - ); - var currentIndex = index + 1 == listStyle[list.tagName].length - ? 0 - : index + 1; - var currentStyle = listStyle[list.tagName][currentIndex]; - setListStyle(list, currentStyle); - parentLi.insertBefore(list, current); - while ( - current && - !( - domUtils.getPosition(current, bk.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - li = current.nextSibling; - list.appendChild(current); - if (!li || domUtils.isTagNode(li, "ol ul")) { - if (li) { - while ((li = li.firstChild)) { - if (li.tagName == "LI") { - break; - } - } - } else { - li = domUtils.getNextDomNode(current, false, null, function( - node - ) { - return node !== closeList; - }); - } - break; - } - current = li; - } - adjustList(list, list.tagName.toLowerCase(), currentStyle); - current = li; - } - } - me.fireEvent("contentchange"); - range.moveToBookmark(bk).select(); - return true; - } - } - }); - function getLi(start) { - while (start && !domUtils.isBody(start)) { - if (start.nodeName == "TABLE") { - return null; - } - if (start.nodeName == "LI") { - return start; - } - start = start.parentNode; - } - } - - /** - * 有序列表,与“insertunorderedlist”命令互斥 - * @command insertorderedlist - * @method execCommand - * @param { String } command 命令字符串 - * @param { String } style 插入的有序列表类型,值为:decimal,lower-alpha,lower-roman,upper-alpha,upper-roman,cn,cn1,cn2,num,num1,num2 - * @example - * ```javascript - * editor.execCommand( 'insertorderedlist','decimal'); - * ``` - */ - /** - * 查询当前选区内容是否有序列表 - * @command insertorderedlist - * @method queryCommandState - * @param { String } cmd 命令字符串 - * @return { int } 如果当前选区是有序列表返回1,否则返回0 - * @example - * ```javascript - * editor.queryCommandState( 'insertorderedlist' ); - * ``` - */ - /** - * 查询当前选区内容是否有序列表 - * @command insertorderedlist - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @return { String } 返回当前有序列表的类型,值为null或decimal,lower-alpha,lower-roman,upper-alpha,upper-roman,cn,cn1,cn2,num,num1,num2 - * @example - * ```javascript - * editor.queryCommandValue( 'insertorderedlist' ); - * ``` - */ - - /** - * 无序列表,与“insertorderedlist”命令互斥 - * @command insertunorderedlist - * @method execCommand - * @param { String } command 命令字符串 - * @param { String } style 插入的无序列表类型,值为:circle,disc,square,dash,dot - * @example - * ```javascript - * editor.execCommand( 'insertunorderedlist','circle'); - * ``` - */ - /** - * 查询当前是否有word文档粘贴进来的图片 - * @command insertunorderedlist - * @method insertunorderedlist - * @param { String } command 命令字符串 - * @return { int } 如果当前选区是无序列表返回1,否则返回0 - * @example - * ```javascript - * editor.queryCommandState( 'insertunorderedlist' ); - * ``` - */ - /** - * 查询当前选区内容是否有序列表 - * @command insertunorderedlist - * @method queryCommandValue - * @param { String } command 命令字符串 - * @return { String } 返回当前无序列表的类型,值为null或circle,disc,square,dash,dot - * @example - * ```javascript - * editor.queryCommandValue( 'insertunorderedlist' ); - * ``` - */ - - me.commands["insertorderedlist"] = me.commands["insertunorderedlist"] = { - execCommand: function(command, style) { - if (!style) { - style = command.toLowerCase() == "insertorderedlist" - ? "decimal" - : "disc"; - } - var me = this, - range = this.selection.getRange(), - filterFn = function(node) { - return node.nodeType == 1 - ? node.tagName.toLowerCase() != "br" - : !domUtils.isWhitespace(node); - }, - tag = command.toLowerCase() == "insertorderedlist" ? "ol" : "ul", - frag = me.document.createDocumentFragment(); - //去掉是因为会出现选到末尾,导致adjustmentBoundary缩到ol/ul的位置 - //range.shrinkBoundary();//.adjustmentBoundary(); - range.adjustmentBoundary().shrinkBoundary(); - var bko = range.createBookmark(true), - start = getLi(me.document.getElementById(bko.start)), - modifyStart = 0, - end = getLi(me.document.getElementById(bko.end)), - modifyEnd = 0, - startParent, - endParent, - list, - tmp; - - if (start || end) { - start && (startParent = start.parentNode); - if (!bko.end) { - end = start; - } - end && (endParent = end.parentNode); - - if (startParent === endParent) { - while (start !== end) { - tmp = start; - start = start.nextSibling; - if (!domUtils.isBlockElm(tmp.firstChild)) { - var p = me.document.createElement("p"); - while (tmp.firstChild) { - p.appendChild(tmp.firstChild); - } - tmp.appendChild(p); - } - frag.appendChild(tmp); - } - tmp = me.document.createElement("span"); - startParent.insertBefore(tmp, end); - if (!domUtils.isBlockElm(end.firstChild)) { - p = me.document.createElement("p"); - while (end.firstChild) { - p.appendChild(end.firstChild); - } - end.appendChild(p); - } - frag.appendChild(end); - domUtils.breakParent(tmp, startParent); - if (domUtils.isEmptyNode(tmp.previousSibling)) { - domUtils.remove(tmp.previousSibling); - } - if (domUtils.isEmptyNode(tmp.nextSibling)) { - domUtils.remove(tmp.nextSibling); - } - var nodeStyle = - getStyle(startParent) || - domUtils.getComputedStyle(startParent, "list-style-type") || - (command.toLowerCase() == "insertorderedlist" ? "decimal" : "disc"); - if (startParent.tagName.toLowerCase() == tag && nodeStyle == style) { - for ( - var i = 0, ci, tmpFrag = me.document.createDocumentFragment(); - (ci = frag.firstChild); - - ) { - if (domUtils.isTagNode(ci, "ol ul")) { - // 删除时,子列表不处理 - // utils.each(domUtils.getElementsByTagName(ci,'li'),function(li){ - // while(li.firstChild){ - // tmpFrag.appendChild(li.firstChild); - // } - // - // }); - tmpFrag.appendChild(ci); - } else { - while (ci.firstChild) { - tmpFrag.appendChild(ci.firstChild); - domUtils.remove(ci); - } - } - } - tmp.parentNode.insertBefore(tmpFrag, tmp); - } else { - list = me.document.createElement(tag); - setListStyle(list, style); - list.appendChild(frag); - tmp.parentNode.insertBefore(list, tmp); - } - - domUtils.remove(tmp); - list && adjustList(list, tag, style); - range.moveToBookmark(bko).select(); - return; - } - //开始 - if (start) { - while (start) { - tmp = start.nextSibling; - if (domUtils.isTagNode(start, "ol ul")) { - frag.appendChild(start); - } else { - var tmpfrag = me.document.createDocumentFragment(), - hasBlock = 0; - while (start.firstChild) { - if (domUtils.isBlockElm(start.firstChild)) { - hasBlock = 1; - } - tmpfrag.appendChild(start.firstChild); - } - if (!hasBlock) { - var tmpP = me.document.createElement("p"); - tmpP.appendChild(tmpfrag); - frag.appendChild(tmpP); - } else { - frag.appendChild(tmpfrag); - } - domUtils.remove(start); - } - - start = tmp; - } - startParent.parentNode.insertBefore(frag, startParent.nextSibling); - if (domUtils.isEmptyNode(startParent)) { - range.setStartBefore(startParent); - domUtils.remove(startParent); - } else { - range.setStartAfter(startParent); - } - modifyStart = 1; - } - - if (end && domUtils.inDoc(endParent, me.document)) { - //结束 - start = endParent.firstChild; - while (start && start !== end) { - tmp = start.nextSibling; - if (domUtils.isTagNode(start, "ol ul")) { - frag.appendChild(start); - } else { - tmpfrag = me.document.createDocumentFragment(); - hasBlock = 0; - while (start.firstChild) { - if (domUtils.isBlockElm(start.firstChild)) { - hasBlock = 1; - } - tmpfrag.appendChild(start.firstChild); - } - if (!hasBlock) { - tmpP = me.document.createElement("p"); - tmpP.appendChild(tmpfrag); - frag.appendChild(tmpP); - } else { - frag.appendChild(tmpfrag); - } - domUtils.remove(start); - } - start = tmp; - } - var tmpDiv = domUtils.createElement(me.document, "div", { - tmpDiv: 1 - }); - domUtils.moveChild(end, tmpDiv); - - frag.appendChild(tmpDiv); - domUtils.remove(end); - endParent.parentNode.insertBefore(frag, endParent); - range.setEndBefore(endParent); - if (domUtils.isEmptyNode(endParent)) { - domUtils.remove(endParent); - } - - modifyEnd = 1; - } - } - - if (!modifyStart) { - range.setStartBefore(me.document.getElementById(bko.start)); - } - if (bko.end && !modifyEnd) { - range.setEndAfter(me.document.getElementById(bko.end)); - } - range.enlarge(true, function(node) { - return notExchange[node.tagName]; - }); - - frag = me.document.createDocumentFragment(); - - var bk = range.createBookmark(), - current = domUtils.getNextDomNode(bk.start, false, filterFn), - tmpRange = range.cloneRange(), - tmpNode, - block = domUtils.isBlockElm; - - while ( - current && - current !== bk.end && - domUtils.getPosition(current, bk.end) & domUtils.POSITION_PRECEDING - ) { - if (current.nodeType == 3 || dtd.li[current.tagName]) { - if (current.nodeType == 1 && dtd.$list[current.tagName]) { - while (current.firstChild) { - frag.appendChild(current.firstChild); - } - tmpNode = domUtils.getNextDomNode(current, false, filterFn); - domUtils.remove(current); - current = tmpNode; - continue; - } - tmpNode = current; - tmpRange.setStartBefore(current); - - while ( - current && - current !== bk.end && - (!block(current) || domUtils.isBookmarkNode(current)) - ) { - tmpNode = current; - current = domUtils.getNextDomNode(current, false, null, function( - node - ) { - return !notExchange[node.tagName]; - }); - } - - if (current && block(current)) { - tmp = domUtils.getNextDomNode(tmpNode, false, filterFn); - if (tmp && domUtils.isBookmarkNode(tmp)) { - current = domUtils.getNextDomNode(tmp, false, filterFn); - tmpNode = tmp; - } - } - tmpRange.setEndAfter(tmpNode); - - current = domUtils.getNextDomNode(tmpNode, false, filterFn); - - var li = range.document.createElement("li"); - - li.appendChild(tmpRange.extractContents()); - if (domUtils.isEmptyNode(li)) { - var tmpNode = range.document.createElement("p"); - while (li.firstChild) { - tmpNode.appendChild(li.firstChild); - } - li.appendChild(tmpNode); - } - frag.appendChild(li); - } else { - current = domUtils.getNextDomNode(current, true, filterFn); - } - } - range.moveToBookmark(bk).collapse(true); - list = me.document.createElement(tag); - setListStyle(list, style); - list.appendChild(frag); - range.insertNode(list); - //当前list上下看能否合并 - adjustList(list, tag, style); - //去掉冗余的tmpDiv - for ( - var i = 0, ci, tmpDivs = domUtils.getElementsByTagName(list, "div"); - (ci = tmpDivs[i++]); - - ) { - if (ci.getAttribute("tmpDiv")) { - domUtils.remove(ci, true); - } - } - range.moveToBookmark(bko).select(); - }, - queryCommandState: function(command) { - var tag = command.toLowerCase() == "insertorderedlist" ? "ol" : "ul"; - var path = this.selection.getStartElementPath(); - for (var i = 0, ci; (ci = path[i++]); ) { - if (ci.nodeName == "TABLE") { - return 0; - } - if (tag == ci.nodeName.toLowerCase()) { - return 1; - } - } - return 0; - }, - queryCommandValue: function(command) { - var tag = command.toLowerCase() == "insertorderedlist" ? "ol" : "ul"; - var path = this.selection.getStartElementPath(), - node; - for (var i = 0, ci; (ci = path[i++]); ) { - if (ci.nodeName == "TABLE") { - node = null; - break; - } - if (tag == ci.nodeName.toLowerCase()) { - node = ci; - break; - } - } - return node - ? getStyle(node) || domUtils.getComputedStyle(node, "list-style-type") - : null; - } - }; -}; - - -// plugins/source.js -/** - * 源码编辑插件 - * @file - * @since 1.2.6.1 - */ - -;(function() { - var sourceEditors = { - textarea: function(editor, holder) { - var textarea = holder.ownerDocument.createElement("textarea"); - textarea.style.cssText = - "position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;"; - // todo: IE下只有onresize属性可用... 很纠结 - if (browser.ie && browser.version < 8) { - textarea.style.width = holder.offsetWidth + "px"; - textarea.style.height = holder.offsetHeight + "px"; - holder.onresize = function() { - textarea.style.width = holder.offsetWidth + "px"; - textarea.style.height = holder.offsetHeight + "px"; - }; - } - holder.appendChild(textarea); - return { - setContent: function(content) { - textarea.value = content; - }, - getContent: function() { - return textarea.value; - }, - select: function() { - var range; - if (browser.ie) { - range = textarea.createTextRange(); - range.collapse(true); - range.select(); - } else { - //todo: chrome下无法设置焦点 - textarea.setSelectionRange(0, 0); - textarea.focus(); - } - }, - dispose: function() { - holder.removeChild(textarea); - // todo - holder.onresize = null; - textarea = null; - holder = null; - }, - focus: function (){ - textarea.focus(); - }, - blur: function (){ - textarea.blur(); - } - }; - }, - codemirror: function(editor, holder) { - var codeEditor = window.CodeMirror(holder, { - mode: "text/html", - tabMode: "indent", - lineNumbers: true, - lineWrapping: true - }); - var dom = codeEditor.getWrapperElement(); - dom.style.cssText = - 'position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;'; - codeEditor.getScrollerElement().style.cssText = - "position:absolute;left:0;top:0;width:100%;height:100%;"; - codeEditor.refresh(); - return { - getCodeMirror: function() { - return codeEditor; - }, - setContent: function(content) { - codeEditor.setValue(content); - }, - getContent: function() { - return codeEditor.getValue(); - }, - select: function() { - codeEditor.focus(); - }, - dispose: function() { - holder.removeChild(dom); - dom = null; - codeEditor = null; - }, - focus: function (){ - codeEditor.focus(); - }, - blur: function (){ - // codeEditor.blur(); - // since codemirror not support blur() - codeEditor.setOption('readOnly', true); - codeEditor.setOption('readOnly', false); - } - }; - } - }; - - UE.plugins["source"] = function() { - var me = this; - var opt = this.options; - var sourceMode = false; - var sourceEditor; - var orgSetContent; - var orgFocus; - var orgBlur; - opt.sourceEditor = browser.ie - ? "textarea" - : opt.sourceEditor || "codemirror"; - - me.setOpt({ - sourceEditorFirst: false - }); - function createSourceEditor(holder) { - return sourceEditors[ - opt.sourceEditor == "codemirror" && window.CodeMirror - ? "codemirror" - : "textarea" - ](me, holder); - } - - var bakCssText; - //解决在源码模式下getContent不能得到最新的内容问题 - var oldGetContent, bakAddress; - - /** - * 切换源码模式和编辑模式 - * @command source - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'source'); - * ``` - */ - - /** - * 查询当前编辑区域的状态是源码模式还是可视化模式 - * @command source - * @method queryCommandState - * @param { String } cmd 命令字符串 - * @return { int } 如果当前是源码编辑模式,返回1,否则返回0 - * @example - * ```javascript - * editor.queryCommandState( 'source' ); - * ``` - */ - - me.commands["source"] = { - execCommand: function() { - sourceMode = !sourceMode; - if (sourceMode) { - bakAddress = me.selection.getRange().createAddress(false, true); - me.undoManger && me.undoManger.save(true); - if (browser.gecko) { - me.body.contentEditable = false; - } - - bakCssText = me.iframe.style.cssText; - me.iframe.style.cssText += - "position:absolute;left:-32768px;top:-32768px;"; - - me.fireEvent("beforegetcontent"); - var root = UE.htmlparser(me.body.innerHTML); - me.filterOutputRule(root); - root.traversal(function(node) { - if (node.type == "element") { - switch (node.tagName) { - case "td": - case "th": - case "caption": - if (node.children && node.children.length == 1) { - if (node.firstChild().tagName == "br") { - node.removeChild(node.firstChild()); - } - } - break; - case "pre": - node.innerText(node.innerText().replace(/ /g, " ")); - } - } - }); - - me.fireEvent("aftergetcontent"); - - var content = root.toHtml(true); - - sourceEditor = createSourceEditor(me.iframe.parentNode); - - sourceEditor.setContent(content); - - orgSetContent = me.setContent; - - me.setContent = function(html) { - //这里暂时不触发事件,防止报错 - var root = UE.htmlparser(html); - me.filterInputRule(root); - html = root.toHtml(); - sourceEditor.setContent(html); - }; - - setTimeout(function() { - sourceEditor.select(); - me.addListener("fullscreenchanged", function() { - try { - sourceEditor.getCodeMirror().refresh(); - } catch (e) {} - }); - }); - - //重置getContent,源码模式下取值也能是最新的数据 - oldGetContent = me.getContent; - me.getContent = function() { - return ( - sourceEditor.getContent() || - "

                      " + (browser.ie ? "" : "
                      ") + "

                      " - ); - }; - - orgFocus = me.focus; - orgBlur = me.blur; - - me.focus = function(){ - sourceEditor.focus(); - }; - - me.blur = function(){ - orgBlur.call(me); - sourceEditor.blur(); - }; - } else { - me.iframe.style.cssText = bakCssText; - var cont = - sourceEditor.getContent() || - "

                      " + (browser.ie ? "" : "
                      ") + "

                      "; - //处理掉block节点前后的空格,有可能会误命中,暂时不考虑 - cont = cont.replace( - new RegExp("[\\r\\t\\n ]*]*)>", "g"), - function(a, b) { - if (b && !dtd.$inlineWithA[b.toLowerCase()]) { - return a.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g, ""); - } - return a.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g, ""); - } - ); - - me.setContent = orgSetContent; - - me.setContent(cont); - sourceEditor.dispose(); - sourceEditor = null; - //还原getContent方法 - me.getContent = oldGetContent; - me.focus = orgFocus; - me.blur = orgBlur; - var first = me.body.firstChild; - //trace:1106 都删除空了,下边会报错,所以补充一个p占位 - if (!first) { - me.body.innerHTML = "

                      " + (browser.ie ? "" : "
                      ") + "

                      "; - first = me.body.firstChild; - } - - //要在ifm为显示时ff才能取到selection,否则报错 - //这里不能比较位置了 - me.undoManger && me.undoManger.save(true); - - if (browser.gecko) { - var input = document.createElement("input"); - input.style.cssText = "position:absolute;left:0;top:-32768px"; - - document.body.appendChild(input); - - me.body.contentEditable = false; - setTimeout(function() { - domUtils.setViewportOffset(input, { left: -32768, top: 0 }); - input.focus(); - setTimeout(function() { - me.body.contentEditable = true; - me.selection.getRange().moveToAddress(bakAddress).select(true); - domUtils.remove(input); - }); - }); - } else { - //ie下有可能报错,比如在代码顶头的情况 - try { - me.selection.getRange().moveToAddress(bakAddress).select(true); - } catch (e) {} - } - } - this.fireEvent("sourcemodechanged", sourceMode); - }, - queryCommandState: function() { - return sourceMode | 0; - }, - notNeedUndo: 1 - }; - var oldQueryCommandState = me.queryCommandState; - - me.queryCommandState = function(cmdName) { - cmdName = cmdName.toLowerCase(); - if (sourceMode) { - //源码模式下可以开启的命令 - return cmdName in - { - source: 1, - fullscreen: 1 - } - ? 1 - : -1; - } - return oldQueryCommandState.apply(this, arguments); - }; - - if (opt.sourceEditor == "codemirror") { - me.addListener("ready", function() { - utils.loadFile( - document, - { - src: - opt.codeMirrorJsUrl || - opt.UEDITOR_HOME_URL + "third-party/codemirror/codemirror.js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - if (opt.sourceEditorFirst) { - setTimeout(function() { - me.execCommand("source"); - }, 0); - } - } - ); - utils.loadFile(document, { - tag: "link", - rel: "stylesheet", - type: "text/css", - href: - opt.codeMirrorCssUrl || - opt.UEDITOR_HOME_URL + "third-party/codemirror/codemirror.css" - }); - }); - } - }; -})(); - - -// plugins/enterkey.js -///import core -///import plugins/undo.js -///commands 设置回车标签p或br -///commandsName EnterKey -///commandsTitle 设置回车标签p或br -/** - * @description 处理回车 - * @author zhanyi - */ -UE.plugins["enterkey"] = function() { - var hTag, - me = this, - tag = me.options.enterTag; - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - if (keyCode == 13) { - var range = me.selection.getRange(), - start = range.startContainer, - doSave; - - //修正在h1-h6里边回车后不能嵌套p的问题 - if (!browser.ie) { - if (/h\d/i.test(hTag)) { - if (browser.gecko) { - var h = domUtils.findParentByTagName( - start, - [ - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "blockquote", - "caption", - "table" - ], - true - ); - if (!h) { - me.document.execCommand("formatBlock", false, "

                      "); - doSave = 1; - } - } else { - //chrome remove div - if (start.nodeType == 1) { - var tmp = me.document.createTextNode(""), - div; - range.insertNode(tmp); - div = domUtils.findParentByTagName(tmp, "div", true); - if (div) { - var p = me.document.createElement("p"); - while (div.firstChild) { - p.appendChild(div.firstChild); - } - div.parentNode.insertBefore(p, div); - domUtils.remove(div); - range.setStartBefore(tmp).setCursor(); - doSave = 1; - } - domUtils.remove(tmp); - } - } - - if (me.undoManger && doSave) { - me.undoManger.save(); - } - } - //没有站位符,会出现多行的问题 - browser.opera && range.select(); - } else { - me.fireEvent("saveScene", true, true); - } - } - }); - - me.addListener("keydown", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - if (keyCode == 13) { - //回车 - if (me.fireEvent("beforeenterkeydown")) { - domUtils.preventDefault(evt); - return; - } - me.fireEvent("saveScene", true, true); - hTag = ""; - - var range = me.selection.getRange(); - - if (!range.collapsed) { - //跨td不能删 - var start = range.startContainer, - end = range.endContainer, - startTd = domUtils.findParentByTagName(start, "td", true), - endTd = domUtils.findParentByTagName(end, "td", true); - if ( - (startTd && endTd && startTd !== endTd) || - (!startTd && endTd) || - (startTd && !endTd) - ) { - evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); - return; - } - } - if (tag == "p") { - if (!browser.ie) { - start = domUtils.findParentByTagName( - range.startContainer, - [ - "ol", - "ul", - "p", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "blockquote", - "caption" - ], - true - ); - - //opera下执行formatblock会在table的场景下有问题,回车在opera原生支持很好,所以暂时在opera去掉调用这个原生的command - //trace:2431 - if (!start && !browser.opera) { - me.document.execCommand("formatBlock", false, "

                      "); - - if (browser.gecko) { - range = me.selection.getRange(); - start = domUtils.findParentByTagName( - range.startContainer, - "p", - true - ); - start && domUtils.removeDirtyAttr(start); - } - } else { - hTag = start.tagName; - start.tagName.toLowerCase() == "p" && - browser.gecko && - domUtils.removeDirtyAttr(start); - } - } - } else { - evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); - - if (!range.collapsed) { - range.deleteContents(); - start = range.startContainer; - if ( - start.nodeType == 1 && - (start = start.childNodes[range.startOffset]) - ) { - while (start.nodeType == 1) { - if (dtd.$empty[start.tagName]) { - range.setStartBefore(start).setCursor(); - if (me.undoManger) { - me.undoManger.save(); - } - return false; - } - if (!start.firstChild) { - var br = range.document.createElement("br"); - start.appendChild(br); - range.setStart(start, 0).setCursor(); - if (me.undoManger) { - me.undoManger.save(); - } - return false; - } - start = start.firstChild; - } - if (start === range.startContainer.childNodes[range.startOffset]) { - br = range.document.createElement("br"); - range.insertNode(br).setCursor(); - } else { - range.setStart(start, 0).setCursor(); - } - } else { - br = range.document.createElement("br"); - range.insertNode(br).setStartAfter(br).setCursor(); - } - } else { - br = range.document.createElement("br"); - range.insertNode(br); - var parent = br.parentNode; - if (parent.lastChild === br) { - br.parentNode.insertBefore(br.cloneNode(true), br); - range.setStartBefore(br); - } else { - range.setStartAfter(br); - } - range.setCursor(); - } - } - } - }); -}; - - -// plugins/keystrokes.js -/* 处理特殊键的兼容性问题 */ -UE.plugins["keystrokes"] = function() { - var me = this; - var collapsed = true; - me.addListener("keydown", function(type, evt) { - var keyCode = evt.keyCode || evt.which, - rng = me.selection.getRange(); - - //处理全选的情况 - if ( - !rng.collapsed && - !(evt.ctrlKey || evt.shiftKey || evt.altKey || evt.metaKey) && - ((keyCode >= 65 && keyCode <= 90) || - (keyCode >= 48 && keyCode <= 57) || - (keyCode >= 96 && keyCode <= 111) || - { - 13: 1, - 8: 1, - 46: 1 - }[keyCode]) - ) { - var tmpNode = rng.startContainer; - if (domUtils.isFillChar(tmpNode)) { - rng.setStartBefore(tmpNode); - } - tmpNode = rng.endContainer; - if (domUtils.isFillChar(tmpNode)) { - rng.setEndAfter(tmpNode); - } - rng.txtToElmBoundary(); - //结束边界可能放到了br的前边,要把br包含进来 - // x[xxx]
                      - if (rng.endContainer && rng.endContainer.nodeType == 1) { - tmpNode = rng.endContainer.childNodes[rng.endOffset]; - if (tmpNode && domUtils.isBr(tmpNode)) { - rng.setEndAfter(tmpNode); - } - } - if (rng.startOffset == 0) { - tmpNode = rng.startContainer; - if (domUtils.isBoundaryNode(tmpNode, "firstChild")) { - tmpNode = rng.endContainer; - if ( - rng.endOffset == - (tmpNode.nodeType == 3 - ? tmpNode.nodeValue.length - : tmpNode.childNodes.length) && - domUtils.isBoundaryNode(tmpNode, "lastChild") - ) { - me.fireEvent("saveScene"); - me.body.innerHTML = "

                      " + (browser.ie ? "" : "
                      ") + "

                      "; - rng.setStart(me.body.firstChild, 0).setCursor(false, true); - me._selectionChange(); - return; - } - } - } - } - - //处理backspace - if (keyCode == keymap.Backspace) { - rng = me.selection.getRange(); - collapsed = rng.collapsed; - if (me.fireEvent("delkeydown", evt)) { - return; - } - var start, end; - //避免按两次删除才能生效的问题 - if (rng.collapsed && rng.inFillChar()) { - start = rng.startContainer; - - if (domUtils.isFillChar(start)) { - rng.setStartBefore(start).shrinkBoundary(true).collapse(true); - domUtils.remove(start); - } else { - start.nodeValue = start.nodeValue.replace( - new RegExp("^" + domUtils.fillChar), - "" - ); - rng.startOffset--; - rng.collapse(true).select(true); - } - } - - //解决选中control元素不能删除的问题 - if ((start = rng.getClosedNode())) { - me.fireEvent("saveScene"); - rng.setStartBefore(start); - domUtils.remove(start); - rng.setCursor(); - me.fireEvent("saveScene"); - domUtils.preventDefault(evt); - return; - } - //阻止在table上的删除 - if (!browser.ie) { - start = domUtils.findParentByTagName(rng.startContainer, "table", true); - end = domUtils.findParentByTagName(rng.endContainer, "table", true); - if ((start && !end) || (!start && end) || start !== end) { - evt.preventDefault(); - return; - } - } - } - //处理tab键的逻辑 - if (keyCode == keymap.Tab) { - //不处理以下标签 - var excludeTagNameForTabKey = { - ol: 1, - ul: 1, - table: 1 - }; - //处理组件里的tab按下事件 - if (me.fireEvent("tabkeydown", evt)) { - domUtils.preventDefault(evt); - return; - } - var range = me.selection.getRange(); - me.fireEvent("saveScene"); - for ( - var i = 0, - txt = "", - tabSize = me.options.tabSize || 4, - tabNode = me.options.tabNode || " "; - i < tabSize; - i++ - ) { - txt += tabNode; - } - var span = me.document.createElement("span"); - span.innerHTML = txt + domUtils.fillChar; - if (range.collapsed) { - range.insertNode(span.cloneNode(true).firstChild).setCursor(true); - } else { - var filterFn = function(node) { - return ( - domUtils.isBlockElm(node) && - !excludeTagNameForTabKey[node.tagName.toLowerCase()] - ); - }; - //普通的情况 - start = domUtils.findParent(range.startContainer, filterFn, true); - end = domUtils.findParent(range.endContainer, filterFn, true); - if (start && end && start === end) { - range.deleteContents(); - range.insertNode(span.cloneNode(true).firstChild).setCursor(true); - } else { - var bookmark = range.createBookmark(); - range.enlarge(true); - var bookmark2 = range.createBookmark(), - current = domUtils.getNextDomNode(bookmark2.start, false, filterFn); - while ( - current && - !( - domUtils.getPosition(current, bookmark2.end) & - domUtils.POSITION_FOLLOWING - ) - ) { - current.insertBefore( - span.cloneNode(true).firstChild, - current.firstChild - ); - current = domUtils.getNextDomNode(current, false, filterFn); - } - range.moveToBookmark(bookmark2).moveToBookmark(bookmark).select(); - } - } - domUtils.preventDefault(evt); - } - //trace:1634 - //ff的del键在容器空的时候,也会删除 - if (browser.gecko && keyCode == 46) { - range = me.selection.getRange(); - if (range.collapsed) { - start = range.startContainer; - if (domUtils.isEmptyBlock(start)) { - var parent = start.parentNode; - while ( - domUtils.getChildCount(parent) == 1 && - !domUtils.isBody(parent) - ) { - start = parent; - parent = parent.parentNode; - } - if (start === parent.lastChild) evt.preventDefault(); - return; - } - } - } - - /* 修复在编辑区域快捷键 (Mac:meta+alt+I; Win:ctrl+shift+I) 打不开 chrome 控制台的问题 */ - browser.chrome && - me.on("keydown", function(type, e) { - var keyCode = e.keyCode || e.which; - if ( - ((e.metaKey && e.altKey) || (e.ctrlKey && e.shiftKey)) && - keyCode == 73 - ) { - return true; - } - }); - }); - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which, - rng, - me = this; - if (keyCode == keymap.Backspace) { - if (me.fireEvent("delkeyup")) { - return; - } - rng = me.selection.getRange(); - if (rng.collapsed) { - var tmpNode, - autoClearTagName = ["h1", "h2", "h3", "h4", "h5", "h6"]; - if ( - (tmpNode = domUtils.findParentByTagName( - rng.startContainer, - autoClearTagName, - true - )) - ) { - if (domUtils.isEmptyBlock(tmpNode)) { - var pre = tmpNode.previousSibling; - if (pre && pre.nodeName != "TABLE") { - domUtils.remove(tmpNode); - rng.setStartAtLast(pre).setCursor(false, true); - return; - } else { - var next = tmpNode.nextSibling; - if (next && next.nodeName != "TABLE") { - domUtils.remove(tmpNode); - rng.setStartAtFirst(next).setCursor(false, true); - return; - } - } - } - } - //处理当删除到body时,要重新给p标签展位 - if (domUtils.isBody(rng.startContainer)) { - var tmpNode = domUtils.createElement(me.document, "p", { - innerHTML: browser.ie ? domUtils.fillChar : "
                      " - }); - rng.insertNode(tmpNode).setStart(tmpNode, 0).setCursor(false, true); - } - } - - //chrome下如果删除了inline标签,浏览器会有记忆,在输入文字还是会套上刚才删除的标签,所以这里再选一次就不会了 - if ( - !collapsed && - (rng.startContainer.nodeType == 3 || - (rng.startContainer.nodeType == 1 && - domUtils.isEmptyBlock(rng.startContainer))) - ) { - if (browser.ie) { - var span = rng.document.createElement("span"); - rng.insertNode(span).setStartBefore(span).collapse(true); - rng.select(); - domUtils.remove(span); - } else { - rng.select(); - } - } - } - }); -}; - - -// plugins/fiximgclick.js -///import core -///commands 修复chrome下图片不能点击的问题,出现八个角可改变大小 -///commandsName FixImgClick -///commandsTitle 修复chrome下图片不能点击的问题,出现八个角可改变大小 -//修复chrome下图片不能点击的问题,出现八个角可改变大小 - -UE.plugins["fiximgclick"] = (function() { - var elementUpdated = false; - function Scale() { - this.editor = null; - this.resizer = null; - this.cover = null; - this.doc = document; - this.prePos = { x: 0, y: 0 }; - this.startPos = { x: 0, y: 0 }; - } - - (function() { - var rect = [ - //[left, top, width, height] - [0, 0, -1, -1], - [0, 0, 0, -1], - [0, 0, 1, -1], - [0, 0, -1, 0], - [0, 0, 1, 0], - [0, 0, -1, 1], - [0, 0, 0, 1], - [0, 0, 1, 1] - ]; - - Scale.prototype = { - init: function(editor) { - var me = this; - me.editor = editor; - me.startPos = this.prePos = { x: 0, y: 0 }; - me.dragId = -1; - - var hands = [], - cover = (me.cover = document.createElement("div")), - resizer = (me.resizer = document.createElement("div")); - - cover.id = me.editor.ui.id + "_imagescale_cover"; - cover.style.cssText = - "position:absolute;display:none;z-index:" + - me.editor.options.zIndex + - ";filter:alpha(opacity=0); opacity:0;background:#CCC;"; - domUtils.on(cover, "mousedown click", function() { - me.hide(); - }); - - for (i = 0; i < 8; i++) { - hands.push( - '' - ); - } - resizer.id = me.editor.ui.id + "_imagescale"; - resizer.className = "edui-editor-imagescale"; - resizer.innerHTML = hands.join(""); - resizer.style.cssText += - ";display:none;border:1px solid #3b77ff;z-index:" + - me.editor.options.zIndex + - ";"; - - me.editor.ui.getDom().appendChild(cover); - me.editor.ui.getDom().appendChild(resizer); - - me.initStyle(); - me.initEvents(); - }, - initStyle: function() { - utils.cssRule( - "imagescale", - ".edui-editor-imagescale{display:none;position:absolute;border:1px solid #38B2CE;cursor:hand;-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}" + - ".edui-editor-imagescale span{position:absolute;width:6px;height:6px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}" + - ".edui-editor-imagescale .edui-editor-imagescale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}" - ); - }, - initEvents: function() { - var me = this; - - me.startPos.x = me.startPos.y = 0; - me.isDraging = false; - }, - _eventHandler: function(e) { - var me = this; - switch (e.type) { - case "mousedown": - var hand = e.target || e.srcElement, - hand; - if ( - hand.className.indexOf("edui-editor-imagescale-hand") != -1 && - me.dragId == -1 - ) { - me.dragId = hand.className.slice(-1); - me.startPos.x = me.prePos.x = e.clientX; - me.startPos.y = me.prePos.y = e.clientY; - domUtils.on(me.doc, "mousemove", me.proxy(me._eventHandler, me)); - } - break; - case "mousemove": - if (me.dragId != -1) { - me.updateContainerStyle(me.dragId, { - x: e.clientX - me.prePos.x, - y: e.clientY - me.prePos.y - }); - me.prePos.x = e.clientX; - me.prePos.y = e.clientY; - elementUpdated = true; - me.updateTargetElement(); - } - break; - case "mouseup": - if (me.dragId != -1) { - me.updateContainerStyle(me.dragId, { - x: e.clientX - me.prePos.x, - y: e.clientY - me.prePos.y - }); - me.updateTargetElement(); - if (me.target.parentNode) me.attachTo(me.target); - me.dragId = -1; - } - domUtils.un(me.doc, "mousemove", me.proxy(me._eventHandler, me)); - //修复只是点击挪动点,但没有改变大小,不应该触发contentchange - if (elementUpdated) { - elementUpdated = false; - me.editor.fireEvent("contentchange"); - } - - break; - default: - break; - } - }, - updateTargetElement: function() { - var me = this; - domUtils.setStyles(me.target, { - width: me.resizer.style.width, - height: me.resizer.style.height - }); - me.target.width = parseInt(me.resizer.style.width); - me.target.height = parseInt(me.resizer.style.height); - me.attachTo(me.target); - }, - updateContainerStyle: function(dir, offset) { - var me = this, - dom = me.resizer, - tmp; - - if (rect[dir][0] != 0) { - tmp = parseInt(dom.style.left) + offset.x; - dom.style.left = me._validScaledProp("left", tmp) + "px"; - } - if (rect[dir][1] != 0) { - tmp = parseInt(dom.style.top) + offset.y; - dom.style.top = me._validScaledProp("top", tmp) + "px"; - } - if (rect[dir][2] != 0) { - tmp = dom.clientWidth + rect[dir][2] * offset.x; - dom.style.width = me._validScaledProp("width", tmp) + "px"; - } - if (rect[dir][3] != 0) { - tmp = dom.clientHeight + rect[dir][3] * offset.y; - dom.style.height = me._validScaledProp("height", tmp) + "px"; - } - }, - _validScaledProp: function(prop, value) { - var ele = this.resizer, - wrap = document; - - value = isNaN(value) ? 0 : value; - switch (prop) { - case "left": - return value < 0 - ? 0 - : value + ele.clientWidth > wrap.clientWidth - ? wrap.clientWidth - ele.clientWidth - : value; - case "top": - return value < 0 - ? 0 - : value + ele.clientHeight > wrap.clientHeight - ? wrap.clientHeight - ele.clientHeight - : value; - case "width": - return value <= 0 - ? 1 - : value + ele.offsetLeft > wrap.clientWidth - ? wrap.clientWidth - ele.offsetLeft - : value; - case "height": - return value <= 0 - ? 1 - : value + ele.offsetTop > wrap.clientHeight - ? wrap.clientHeight - ele.offsetTop - : value; - } - }, - hideCover: function() { - this.cover.style.display = "none"; - }, - showCover: function() { - var me = this, - editorPos = domUtils.getXY(me.editor.ui.getDom()), - iframePos = domUtils.getXY(me.editor.iframe); - - domUtils.setStyles(me.cover, { - width: me.editor.iframe.offsetWidth + "px", - height: me.editor.iframe.offsetHeight + "px", - top: iframePos.y - editorPos.y + "px", - left: iframePos.x - editorPos.x + "px", - position: "absolute", - display: "" - }); - }, - show: function(targetObj) { - var me = this; - me.resizer.style.display = "block"; - if (targetObj) me.attachTo(targetObj); - - domUtils.on(this.resizer, "mousedown", me.proxy(me._eventHandler, me)); - domUtils.on(me.doc, "mouseup", me.proxy(me._eventHandler, me)); - - me.showCover(); - me.editor.fireEvent("afterscaleshow", me); - me.editor.fireEvent("saveScene"); - }, - hide: function() { - var me = this; - me.hideCover(); - me.resizer.style.display = "none"; - - domUtils.un(me.resizer, "mousedown", me.proxy(me._eventHandler, me)); - domUtils.un(me.doc, "mouseup", me.proxy(me._eventHandler, me)); - me.editor.fireEvent("afterscalehide", me); - }, - proxy: function(fn, context) { - return function(e) { - return fn.apply(context || this, arguments); - }; - }, - attachTo: function(targetObj) { - var me = this, - target = (me.target = targetObj), - resizer = this.resizer, - imgPos = domUtils.getXY(target), - iframePos = domUtils.getXY(me.editor.iframe), - editorPos = domUtils.getXY(resizer.parentNode); - - var doc = me.editor.document; - domUtils.setStyles(resizer, { - width: target.width + "px", - height: target.height + "px", - left: - iframePos.x + - imgPos.x - - (doc.documentElement.scrollLeft || doc.body.scrollLeft || 0) - - editorPos.x - - parseInt(resizer.style.borderLeftWidth) + - "px", - top: - iframePos.y + - imgPos.y - - (doc.documentElement.scrollTop || doc.body.scrollTop || 0) - - editorPos.y - - parseInt(resizer.style.borderTopWidth) + - "px" - }); - } - }; - })(); - - return function() { - var me = this, - imageScale; - - me.setOpt("imageScaleEnabled", true); - - if (!browser.ie && me.options.imageScaleEnabled) { - me.addListener("click", function(type, e) { - var range = me.selection.getRange(), - img = range.getClosedNode(); - - if (img && img.tagName == "IMG" && me.body.contentEditable != "false") { - if ( - img.className.indexOf("edui-faked-music") != -1 || - img.getAttribute("anchorname") || - domUtils.hasClass(img, "loadingclass") || - domUtils.hasClass(img, "loaderrorclass") - ) { - return; - } - - if (!imageScale) { - imageScale = new Scale(); - imageScale.init(me); - me.ui.getDom().appendChild(imageScale.resizer); - - var _keyDownHandler = function(e) { - imageScale.hide(); - if (imageScale.target) - me.selection.getRange().selectNode(imageScale.target).select(); - }, - _mouseDownHandler = function(e) { - var ele = e.target || e.srcElement; - if ( - ele && - (ele.className === undefined || - ele.className.indexOf("edui-editor-imagescale") == -1) - ) { - _keyDownHandler(e); - } - }, - timer; - - me.addListener("afterscaleshow", function(e) { - me.addListener("beforekeydown", _keyDownHandler); - me.addListener("beforemousedown", _mouseDownHandler); - domUtils.on(document, "keydown", _keyDownHandler); - domUtils.on(document, "mousedown", _mouseDownHandler); - me.selection.getNative().removeAllRanges(); - }); - me.addListener("afterscalehide", function(e) { - me.removeListener("beforekeydown", _keyDownHandler); - me.removeListener("beforemousedown", _mouseDownHandler); - domUtils.un(document, "keydown", _keyDownHandler); - domUtils.un(document, "mousedown", _mouseDownHandler); - var target = imageScale.target; - if (target.parentNode) { - me.selection.getRange().selectNode(target).select(); - } - }); - //TODO 有iframe的情况,mousedown不能往下传。。 - domUtils.on(imageScale.resizer, "mousedown", function(e) { - me.selection.getNative().removeAllRanges(); - var ele = e.target || e.srcElement; - if ( - ele && - ele.className.indexOf("edui-editor-imagescale-hand") == -1 - ) { - timer = setTimeout(function() { - imageScale.hide(); - if (imageScale.target) - me.selection.getRange().selectNode(ele).select(); - }, 200); - } - }); - domUtils.on(imageScale.resizer, "mouseup", function(e) { - var ele = e.target || e.srcElement; - if ( - ele && - ele.className.indexOf("edui-editor-imagescale-hand") == -1 - ) { - clearTimeout(timer); - } - }); - } - imageScale.show(img); - } else { - if (imageScale && imageScale.resizer.style.display != "none") - imageScale.hide(); - } - }); - } - - if (browser.webkit) { - me.addListener("click", function(type, e) { - if (e.target.tagName == "IMG" && me.body.contentEditable != "false") { - var range = new dom.Range(me.document); - range.selectNode(e.target).select(); - } - }); - } - }; -})(); - - -// plugins/autolink.js -///import core -///commands 为非ie浏览器自动添加a标签 -///commandsName AutoLink -///commandsTitle 自动增加链接 -/** - * @description 为非ie浏览器自动添加a标签 - * @author zhanyi - */ - -UE.plugin.register( - "autolink", - function() { - var cont = 0; - - return !browser.ie - ? { - bindEvents: { - reset: function() { - cont = 0; - }, - keydown: function(type, evt) { - var me = this; - var keyCode = evt.keyCode || evt.which; - - if (keyCode == 32 || keyCode == 13) { - var sel = me.selection.getNative(), - range = sel.getRangeAt(0).cloneRange(), - offset, - charCode; - - var start = range.startContainer; - while (start.nodeType == 1 && range.startOffset > 0) { - start = - range.startContainer.childNodes[range.startOffset - 1]; - if (!start) { - break; - } - range.setStart( - start, - start.nodeType == 1 - ? start.childNodes.length - : start.nodeValue.length - ); - range.collapse(true); - start = range.startContainer; - } - - do { - if (range.startOffset == 0) { - start = range.startContainer.previousSibling; - - while (start && start.nodeType == 1) { - start = start.lastChild; - } - if (!start || domUtils.isFillChar(start)) { - break; - } - offset = start.nodeValue.length; - } else { - start = range.startContainer; - offset = range.startOffset; - } - range.setStart(start, offset - 1); - charCode = range.toString().charCodeAt(0); - } while (charCode != 160 && charCode != 32); - - if ( - range - .toString() - .replace(new RegExp(domUtils.fillChar, "g"), "") - .match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i) - ) { - while (range.toString().length) { - if ( - /^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test( - range.toString() - ) - ) { - break; - } - try { - range.setStart( - range.startContainer, - range.startOffset + 1 - ); - } catch (e) { - //trace:2121 - var start = range.startContainer; - while (!(next = start.nextSibling)) { - if (domUtils.isBody(start)) { - return; - } - start = start.parentNode; - } - range.setStart(next, 0); - } - } - //range的开始边界已经在a标签里的不再处理 - if ( - domUtils.findParentByTagName( - range.startContainer, - "a", - true - ) - ) { - return; - } - var a = me.document.createElement("a"), - text = me.document.createTextNode(" "), - href; - - me.undoManger && me.undoManger.save(); - a.appendChild(range.extractContents()); - a.href = a.innerHTML = a.innerHTML.replace(/<[^>]+>/g, ""); - href = a - .getAttribute("href") - .replace(new RegExp(domUtils.fillChar, "g"), ""); - href = /^(?:https?:\/\/)/gi.test(href) - ? href - : "http://" + href; - a.setAttribute("_src", utils.html(href)); - a.href = utils.html(href); - - range.insertNode(a); - a.parentNode.insertBefore(text, a.nextSibling); - range.setStart(text, 0); - range.collapse(true); - sel.removeAllRanges(); - sel.addRange(range); - me.undoManger && me.undoManger.save(); - } - } - } - } - } - : {}; - }, - function() { - var keyCodes = { - 37: 1, - 38: 1, - 39: 1, - 40: 1, - 13: 1, - 32: 1 - }; - function checkIsCludeLink(node) { - if (node.nodeType == 3) { - return null; - } - if (node.nodeName == "A") { - return node; - } - var lastChild = node.lastChild; - - while (lastChild) { - if (lastChild.nodeName == "A") { - return lastChild; - } - if (lastChild.nodeType == 3) { - if (domUtils.isWhitespace(lastChild)) { - lastChild = lastChild.previousSibling; - continue; - } - return null; - } - lastChild = lastChild.lastChild; - } - } - browser.ie && - this.addListener("keyup", function(cmd, evt) { - var me = this, - keyCode = evt.keyCode; - if (keyCodes[keyCode]) { - var rng = me.selection.getRange(); - var start = rng.startContainer; - - if (keyCode == 13) { - while ( - start && - !domUtils.isBody(start) && - !domUtils.isBlockElm(start) - ) { - start = start.parentNode; - } - if (start && !domUtils.isBody(start) && start.nodeName == "P") { - var pre = start.previousSibling; - if (pre && pre.nodeType == 1) { - var pre = checkIsCludeLink(pre); - if (pre && !pre.getAttribute("_href")) { - domUtils.remove(pre, true); - } - } - } - } else if (keyCode == 32) { - if (start.nodeType == 3 && /^\s$/.test(start.nodeValue)) { - start = start.previousSibling; - if ( - start && - start.nodeName == "A" && - !start.getAttribute("_href") - ) { - domUtils.remove(start, true); - } - } - } else { - start = domUtils.findParentByTagName(start, "a", true); - if (start && !start.getAttribute("_href")) { - var bk = rng.createBookmark(); - - domUtils.remove(start, true); - rng.moveToBookmark(bk).select(true); - } - } - } - }); - } -); - - -// plugins/autoheight.js -///import core -///commands 当输入内容超过编辑器高度时,编辑器自动增高 -///commandsName AutoHeight,autoHeightEnabled -///commandsTitle 自动增高 -/** - * @description 自动伸展 - * @author zhanyi - */ -UE.plugins["autoheight"] = function() { - var me = this; - //提供开关,就算加载也可以关闭 - me.autoHeightEnabled = me.options.autoHeightEnabled !== false; - if (!me.autoHeightEnabled) { - return; - } - - var bakOverflow, - lastHeight = 0, - options = me.options, - currentHeight, - timer; - - function adjustHeight() { - var me = this; - clearTimeout(timer); - if (isFullscreen) return; - if ( - !me.queryCommandState || - (me.queryCommandState && me.queryCommandState("source") != 1) - ) { - timer = setTimeout(function() { - var node = me.body.lastChild; - while (node && node.nodeType != 1) { - node = node.previousSibling; - } - if (node && node.nodeType == 1) { - node.style.clear = "both"; - currentHeight = Math.max( - domUtils.getXY(node).y + node.offsetHeight + 25, - Math.max(options.minFrameHeight, options.initialFrameHeight) - ); - if (currentHeight != lastHeight) { - if (currentHeight !== parseInt(me.iframe.parentNode.style.height)) { - me.iframe.parentNode.style.height = currentHeight + "px"; - } - me.body.style.height = currentHeight + "px"; - lastHeight = currentHeight; - } - domUtils.removeStyle(node, "clear"); - } - }, 50); - } - } - var isFullscreen; - me.addListener("fullscreenchanged", function(cmd, f) { - isFullscreen = f; - }); - me.addListener("destroy", function() { - domUtils.un(me.window, "scroll", fixedScrollTop); - me.removeListener( - "contentchange afterinserthtml keyup mouseup", - adjustHeight - ); - }); - me.enableAutoHeight = function() { - var me = this; - if (!me.autoHeightEnabled) { - return; - } - var doc = me.document; - me.autoHeightEnabled = true; - bakOverflow = doc.body.style.overflowY; - doc.body.style.overflowY = "hidden"; - me.addListener("contentchange afterinserthtml keyup mouseup", adjustHeight); - //ff不给事件算得不对 - - setTimeout(function() { - adjustHeight.call(me); - }, browser.gecko ? 100 : 0); - me.fireEvent("autoheightchanged", me.autoHeightEnabled); - }; - me.disableAutoHeight = function() { - me.body.style.overflowY = bakOverflow || ""; - - me.removeListener("contentchange", adjustHeight); - me.removeListener("keyup", adjustHeight); - me.removeListener("mouseup", adjustHeight); - me.autoHeightEnabled = false; - me.fireEvent("autoheightchanged", me.autoHeightEnabled); - }; - - me.on("setHeight", function() { - me.disableAutoHeight(); - }); - me.addListener("ready", function() { - me.enableAutoHeight(); - //trace:1764 - var timer; - domUtils.on( - browser.ie ? me.body : me.document, - browser.webkit ? "dragover" : "drop", - function() { - clearTimeout(timer); - timer = setTimeout(function() { - //trace:3681 - adjustHeight.call(me); - }, 100); - } - ); - //修复内容过多时,回到顶部,顶部内容被工具栏遮挡问题 - domUtils.on(me.window, "scroll", fixedScrollTop); - }); - - var lastScrollY; - - function fixedScrollTop() { - if (!me.window) return; - if (lastScrollY === null) { - lastScrollY = me.window.scrollY; - } else if (me.window.scrollY == 0 && lastScrollY != 0) { - me.window.scrollTo(0, 0); - lastScrollY = null; - } - } -}; - - -// plugins/autofloat.js -///import core -///commands 悬浮工具栏 -///commandsName AutoFloat,autoFloatEnabled -///commandsTitle 悬浮工具栏 -/** - * modified by chengchao01 - * 注意: 引入此功能后,在IE6下会将body的背景图片覆盖掉! - */ -UE.plugins["autofloat"] = function() { - var me = this, - lang = me.getLang(); - me.setOpt({ - topOffset: 0 - }); - var optsAutoFloatEnabled = me.options.autoFloatEnabled !== false, - topOffset = me.options.topOffset; - - //如果不固定toolbar的位置,则直接退出 - if (!optsAutoFloatEnabled) { - return; - } - var uiUtils = UE.ui.uiUtils, - LteIE6 = browser.ie && browser.version <= 6, - quirks = browser.quirks; - - function checkHasUI() { - if (!UE.ui) { - alert(lang.autofloatMsg); - return 0; - } - return 1; - } - function fixIE6FixedPos() { - var docStyle = document.body.style; - docStyle.backgroundImage = 'url("about:blank")'; - docStyle.backgroundAttachment = "fixed"; - } - var bakCssText, - placeHolder = document.createElement("div"), - toolbarBox, - orgTop, - getPosition, - flag = true; //ie7模式下需要偏移 - function setFloating() { - var toobarBoxPos = domUtils.getXY(toolbarBox), - origalFloat = domUtils.getComputedStyle(toolbarBox, "position"), - origalLeft = domUtils.getComputedStyle(toolbarBox, "left"); - toolbarBox.style.width = toolbarBox.offsetWidth + "px"; - toolbarBox.style.zIndex = me.options.zIndex * 1 + 1; - toolbarBox.parentNode.insertBefore(placeHolder, toolbarBox); - if (LteIE6 || (quirks && browser.ie)) { - if (toolbarBox.style.position != "absolute") { - toolbarBox.style.position = "absolute"; - } - toolbarBox.style.top = - (document.body.scrollTop || document.documentElement.scrollTop) - - orgTop + - topOffset + - "px"; - } else { - if (browser.ie7Compat && flag) { - flag = false; - toolbarBox.style.left = - domUtils.getXY(toolbarBox).x - - document.documentElement.getBoundingClientRect().left + - 2 + - "px"; - } - if (toolbarBox.style.position != "fixed") { - toolbarBox.style.position = "fixed"; - toolbarBox.style.top = topOffset + "px"; - (origalFloat == "absolute" || origalFloat == "relative") && - parseFloat(origalLeft) && - (toolbarBox.style.left = toobarBoxPos.x + "px"); - } - } - } - function unsetFloating() { - flag = true; - if (placeHolder.parentNode) { - placeHolder.parentNode.removeChild(placeHolder); - } - - toolbarBox.style.cssText = bakCssText; - } - - function updateFloating() { - var rect3 = getPosition(me.container); - var offset = me.options.toolbarTopOffset || 0; - if (rect3.top < 0 && rect3.bottom - toolbarBox.offsetHeight > offset) { - setFloating(); - } else { - unsetFloating(); - } - } - var defer_updateFloating = utils.defer( - function() { - updateFloating(); - }, - browser.ie ? 200 : 100, - true - ); - - me.addListener("destroy", function() { - domUtils.un(window, ["scroll", "resize"], updateFloating); - me.removeListener("keydown", defer_updateFloating); - //适用于在DIV scrollbox中滚动,但页面不滚动的浮动toolbar - var scrollBox = document.getElementById("scrollBox"); - if (scrollBox) { - domUtils.un(scrollBox, ['scroll','resize'], updateFloating); - } - }); - - me.addListener("ready", function() { - if (checkHasUI(me)) { - //加载了ui组件,但在new时,没有加载ui,导致编辑器实例上没有ui类,所以这里做判断 - if (!me.ui) { - return; - } - getPosition = uiUtils.getClientRect; - toolbarBox = me.ui.getDom("toolbarbox"); - orgTop = getPosition(toolbarBox).top; - bakCssText = toolbarBox.style.cssText; - placeHolder.style.height = me.ui.getDom("iframeholder").offsetHeight + "px"; - if (LteIE6) { - fixIE6FixedPos(); - } - domUtils.on(window, ["scroll", "resize"], updateFloating); - me.addListener("keydown", defer_updateFloating); - //适用于在DIV scrollbox中滚动,但页面不滚动的浮动toolbar - var scrollBox = document.getElementById("scrollBox"); - if (scrollBox) { - domUtils.on(scrollBox, ['scroll','resize'], updateFloating); - } - me.addListener("beforefullscreenchange", function(t, enabled) { - if (enabled) { - unsetFloating(); - } - }); - me.addListener("fullscreenchanged", function(t, enabled) { - if (!enabled) { - updateFloating(); - } - }); - me.addListener("sourcemodechanged", function(t, enabled) { - setTimeout(function() { - updateFloating(); - }, 0); - }); - me.addListener("clearDoc", function() { - setTimeout(function() { - updateFloating(); - }, 0); - }); - } - }); -}; - - -// plugins/video.js -/** - * video插件, 为UEditor提供视频插入支持 - * @file - * @since 1.2.6.1 - */ - -UE.plugins["video"] = function() { - var me = this; - - /** - * 创建插入视频字符窜 - * @param url 视频地址 - * @param width 视频宽度 - * @param height 视频高度 - * @param align 视频对齐 - * @param toEmbed 是否以flash代替显示 - * @param addParagraph 是否需要添加P 标签 - */ - function creatInsertStr(url, width, height, id, align, classname, type) { - var str; - switch (type) { - case "image": - str = - "'; - break; - case "embed": - str = - ''; - break; - case "video": - var ext = url.substr(url.lastIndexOf(".") + 1); - if (ext == "ogv") ext = "ogg"; - str = - "' + - ''; - break; - } - return str; - } - - function switchImgAndVideo(root, img2video) { - utils.each( - root.getNodesByTagName(img2video ? "img" : "embed video"), - function(node) { - var className = node.getAttr("class"); - if (className && className.indexOf("edui-faked-video") != -1) { - var html = creatInsertStr( - img2video ? node.getAttr("_url") : node.getAttr("src"), - node.getAttr("width"), - node.getAttr("height"), - null, - node.getStyle("float") || "", - className, - img2video ? "embed" : "image" - ); - node.parentNode.replaceChild(UE.uNode.createElement(html), node); - } - if (className && className.indexOf("edui-upload-video") != -1) { - var html = creatInsertStr( - img2video ? node.getAttr("_url") : node.getAttr("src"), - node.getAttr("width"), - node.getAttr("height"), - null, - node.getStyle("float") || "", - className, - img2video ? "video" : "image" - ); - node.parentNode.replaceChild(UE.uNode.createElement(html), node); - } - } - ); - } - - me.addOutputRule(function(root) { - switchImgAndVideo(root, true); - }); - me.addInputRule(function(root) { - switchImgAndVideo(root); - }); - - /** - * 插入视频 - * @command insertvideo - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Object } videoAttr 键值对对象, 描述一个视频的所有属性 - * @example - * ```javascript - * - * var videoAttr = { - * //视频地址 - * url: 'http://www.youku.com/xxx', - * //视频宽高值, 单位px - * width: 200, - * height: 100 - * }; - * - * //editor 是编辑器实例 - * //向编辑器插入单个视频 - * editor.execCommand( 'insertvideo', videoAttr ); - * ``` - */ - - /** - * 插入视频 - * @command insertvideo - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Array } videoArr 需要插入的视频的数组, 其中的每一个元素都是一个键值对对象, 描述了一个视频的所有属性 - * @example - * ```javascript - * - * var videoAttr1 = { - * //视频地址 - * url: 'http://www.youku.com/xxx', - * //视频宽高值, 单位px - * width: 200, - * height: 100 - * }, - * videoAttr2 = { - * //视频地址 - * url: 'http://www.youku.com/xxx', - * //视频宽高值, 单位px - * width: 200, - * height: 100 - * } - * - * //editor 是编辑器实例 - * //该方法将会向编辑器内插入两个视频 - * editor.execCommand( 'insertvideo', [ videoAttr1, videoAttr2 ] ); - * ``` - */ - - /** - * 查询当前光标所在处是否是一个视频 - * @command insertvideo - * @method queryCommandState - * @param { String } cmd 需要查询的命令字符串 - * @return { int } 如果当前光标所在处的元素是一个视频对象, 则返回1,否则返回0 - * @example - * ```javascript - * - * //editor 是编辑器实例 - * editor.queryCommandState( 'insertvideo' ); - * ``` - */ - me.commands["insertvideo"] = { - execCommand: function(cmd, videoObjs, type) { - videoObjs = utils.isArray(videoObjs) ? videoObjs : [videoObjs]; - - if (me.fireEvent("beforeinsertvideo", videoObjs) === true) { - return; - } - - var html = [], - id = "tmpVedio", - cl; - for (var i = 0, vi, len = videoObjs.length; i < len; i++) { - vi = videoObjs[i]; - cl = type == "upload" - ? "edui-upload-video video-js vjs-default-skin" - : "edui-faked-video"; - html.push( - creatInsertStr( - vi.url, - vi.width || 420, - vi.height || 280, - id + i, - null, - cl, - "image" - ) - ); - } - me.execCommand("inserthtml", html.join(""), true); - var rng = this.selection.getRange(); - for (var i = 0, len = videoObjs.length; i < len; i++) { - var img = this.document.getElementById("tmpVedio" + i); - domUtils.removeAttributes(img, "id"); - rng.selectNode(img).select(); - me.execCommand("imagefloat", videoObjs[i].align); - } - - me.fireEvent("afterinsertvideo", videoObjs); - }, - queryCommandState: function() { - var img = me.selection.getRange().getClosedNode(), - flag = - img && - (img.className == "edui-faked-video" || - img.className.indexOf("edui-upload-video") != -1); - return flag ? 1 : 0; - } - }; -}; - - -// plugins/table.core.js -/** - * Created with JetBrains WebStorm. - * User: taoqili - * Date: 13-1-18 - * Time: 上午11:09 - * To change this template use File | Settings | File Templates. - */ -/** - * UE表格操作类 - * @param table - * @constructor - */ -;(function() { - var UETable = (UE.UETable = function(table) { - this.table = table; - this.indexTable = []; - this.selectedTds = []; - this.cellsRange = {}; - this.update(table); - }); - - //===以下为静态工具方法=== - UETable.removeSelectedClass = function(cells) { - utils.each(cells, function(cell) { - domUtils.removeClasses(cell, "selectTdClass"); - }); - }; - UETable.addSelectedClass = function(cells) { - utils.each(cells, function(cell) { - domUtils.addClass(cell, "selectTdClass"); - }); - }; - UETable.isEmptyBlock = function(node) { - var reg = new RegExp(domUtils.fillChar, "g"); - if ( - node[browser.ie ? "innerText" : "textContent"] - .replace(/^\s*$/, "") - .replace(reg, "").length > 0 - ) { - return 0; - } - for (var i in dtd.$isNotEmpty) - if (dtd.$isNotEmpty.hasOwnProperty(i)) { - if (node.getElementsByTagName(i).length) { - return 0; - } - } - return 1; - }; - UETable.getWidth = function(cell) { - if (!cell) return 0; - return parseInt(domUtils.getComputedStyle(cell, "width"), 10); - }; - - /** - * 获取单元格或者单元格组的“对齐”状态。 如果当前的检测对象是一个单元格组, 只有在满足所有单元格的 水平和竖直 对齐属性都相同的 - * 条件时才会返回其状态值,否则将返回null; 如果当前只检测了一个单元格, 则直接返回当前单元格的对齐状态; - * @param table cell or table cells , 支持单个单元格dom对象 或者 单元格dom对象数组 - * @return { align: 'left' || 'right' || 'center', valign: 'top' || 'middle' || 'bottom' } 或者 null - */ - UETable.getTableCellAlignState = function(cells) { - !utils.isArray(cells) && (cells = [cells]); - - var result = {}, - status = ["align", "valign"], - tempStatus = null, - isSame = true; //状态是否相同 - - utils.each(cells, function(cellNode) { - utils.each(status, function(currentState) { - tempStatus = cellNode.getAttribute(currentState); - - if (!result[currentState] && tempStatus) { - result[currentState] = tempStatus; - } else if ( - !result[currentState] || - tempStatus !== result[currentState] - ) { - isSame = false; - return false; - } - }); - - return isSame; - }); - - return isSame ? result : null; - }; - - /** - * 根据当前选区获取相关的table信息 - * @return {Object} - */ - UETable.getTableItemsByRange = function(editor) { - var start = editor.selection.getStart(); - - //ff下会选中bookmark - if ( - start && - start.id && - start.id.indexOf("_baidu_bookmark_start_") === 0 && - start.nextSibling - ) { - start = start.nextSibling; - } - - //在table或者td边缘有可能存在选中tr的情况 - var cell = start && domUtils.findParentByTagName(start, ["td", "th"], true), - tr = cell && cell.parentNode, - table = tr && domUtils.findParentByTagName(tr, ["table"]), - caption = table && table.getElementsByTagName("caption")[0]; - - return { - cell: cell, - tr: tr, - table: table, - caption: caption - }; - }; - UETable.getUETableBySelected = function(editor) { - var table = UETable.getTableItemsByRange(editor).table; - if (table && table.ueTable && table.ueTable.selectedTds.length) { - return table.ueTable; - } - return null; - }; - - UETable.getDefaultValue = function(editor, table) { - var borderMap = { - thin: "0px", - medium: "1px", - thick: "2px" - }, - tableBorder, - tdPadding, - tdBorder, - tmpValue; - if (!table) { - table = editor.document.createElement("table"); - table.insertRow(0).insertCell(0).innerHTML = "xxx"; - editor.body.appendChild(table); - var td = table.getElementsByTagName("td")[0]; - tmpValue = domUtils.getComputedStyle(table, "border-left-width"); - tableBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); - tmpValue = domUtils.getComputedStyle(td, "padding-left"); - tdPadding = parseInt(borderMap[tmpValue] || tmpValue, 10); - tmpValue = domUtils.getComputedStyle(td, "border-left-width"); - tdBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); - domUtils.remove(table); - return { - tableBorder: tableBorder, - tdPadding: tdPadding, - tdBorder: tdBorder - }; - } else { - td = table.getElementsByTagName("td")[0]; - tmpValue = domUtils.getComputedStyle(table, "border-left-width"); - tableBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); - tmpValue = domUtils.getComputedStyle(td, "padding-left"); - tdPadding = parseInt(borderMap[tmpValue] || tmpValue, 10); - tmpValue = domUtils.getComputedStyle(td, "border-left-width"); - tdBorder = parseInt(borderMap[tmpValue] || tmpValue, 10); - return { - tableBorder: tableBorder, - tdPadding: tdPadding, - tdBorder: tdBorder - }; - } - }; - /** - * 根据当前点击的td或者table获取索引对象 - * @param tdOrTable - */ - UETable.getUETable = function(tdOrTable) { - var tag = tdOrTable.tagName.toLowerCase(); - tdOrTable = tag == "td" || tag == "th" || tag == "caption" - ? domUtils.findParentByTagName(tdOrTable, "table", true) - : tdOrTable; - if (!tdOrTable.ueTable) { - tdOrTable.ueTable = new UETable(tdOrTable); - } - return tdOrTable.ueTable; - }; - - UETable.cloneCell = function(cell, ignoreMerge, keepPro) { - if (!cell || utils.isString(cell)) { - return this.table.ownerDocument.createElement(cell || "td"); - } - var flag = domUtils.hasClass(cell, "selectTdClass"); - flag && domUtils.removeClasses(cell, "selectTdClass"); - var tmpCell = cell.cloneNode(true); - if (ignoreMerge) { - tmpCell.rowSpan = tmpCell.colSpan = 1; - } - //去掉宽高 - !keepPro && domUtils.removeAttributes(tmpCell, "width height"); - !keepPro && domUtils.removeAttributes(tmpCell, "style"); - - tmpCell.style.borderLeftStyle = ""; - tmpCell.style.borderTopStyle = ""; - tmpCell.style.borderLeftColor = cell.style.borderRightColor; - tmpCell.style.borderLeftWidth = cell.style.borderRightWidth; - tmpCell.style.borderTopColor = cell.style.borderBottomColor; - tmpCell.style.borderTopWidth = cell.style.borderBottomWidth; - flag && domUtils.addClass(cell, "selectTdClass"); - return tmpCell; - }; - - UETable.prototype = { - getMaxRows: function() { - var rows = this.table.rows, - maxLen = 1; - for (var i = 0, row; (row = rows[i]); i++) { - var currentMax = 1; - for (var j = 0, cj; (cj = row.cells[j++]); ) { - currentMax = Math.max(cj.rowSpan || 1, currentMax); - } - maxLen = Math.max(currentMax + i, maxLen); - } - return maxLen; - }, - /** - * 获取当前表格的最大列数 - */ - getMaxCols: function() { - var rows = this.table.rows, - maxLen = 0, - cellRows = {}; - for (var i = 0, row; (row = rows[i]); i++) { - var cellsNum = 0; - for (var j = 0, cj; (cj = row.cells[j++]); ) { - cellsNum += cj.colSpan || 1; - if (cj.rowSpan && cj.rowSpan > 1) { - for (var k = 1; k < cj.rowSpan; k++) { - if (!cellRows["row_" + (i + k)]) { - cellRows["row_" + (i + k)] = cj.colSpan || 1; - } else { - cellRows["row_" + (i + k)]++; - } - } - } - } - cellsNum += cellRows["row_" + i] || 0; - maxLen = Math.max(cellsNum, maxLen); - } - return maxLen; - }, - getCellColIndex: function(cell) {}, - /** - * 获取当前cell旁边的单元格, - * @param cell - * @param right - */ - getHSideCell: function(cell, right) { - try { - var cellInfo = this.getCellInfo(cell), - previewRowIndex, - previewColIndex; - var len = this.selectedTds.length, - range = this.cellsRange; - //首行或者首列没有前置单元格 - if ( - (!right && (!len ? !cellInfo.colIndex : !range.beginColIndex)) || - (right && - (!len - ? cellInfo.colIndex == this.colsNum - 1 - : range.endColIndex == this.colsNum - 1)) - ) - return null; - - previewRowIndex = !len ? cellInfo.rowIndex : range.beginRowIndex; - previewColIndex = !right - ? !len - ? cellInfo.colIndex < 1 ? 0 : cellInfo.colIndex - 1 - : range.beginColIndex - 1 - : !len ? cellInfo.colIndex + 1 : range.endColIndex + 1; - return this.getCell( - this.indexTable[previewRowIndex][previewColIndex].rowIndex, - this.indexTable[previewRowIndex][previewColIndex].cellIndex - ); - } catch (e) { - showError(e); - } - }, - getTabNextCell: function(cell, preRowIndex) { - var cellInfo = this.getCellInfo(cell), - rowIndex = preRowIndex || cellInfo.rowIndex, - colIndex = cellInfo.colIndex + 1 + (cellInfo.colSpan - 1), - nextCell; - try { - nextCell = this.getCell( - this.indexTable[rowIndex][colIndex].rowIndex, - this.indexTable[rowIndex][colIndex].cellIndex - ); - } catch (e) { - try { - rowIndex = rowIndex * 1 + 1; - colIndex = 0; - nextCell = this.getCell( - this.indexTable[rowIndex][colIndex].rowIndex, - this.indexTable[rowIndex][colIndex].cellIndex - ); - } catch (e) {} - } - return nextCell; - }, - /** - * 获取视觉上的后置单元格 - * @param cell - * @param bottom - */ - getVSideCell: function(cell, bottom, ignoreRange) { - try { - var cellInfo = this.getCellInfo(cell), - nextRowIndex, - nextColIndex; - var len = this.selectedTds.length && !ignoreRange, - range = this.cellsRange; - //末行或者末列没有后置单元格 - if ( - (!bottom && cellInfo.rowIndex == 0) || - (bottom && - (!len - ? cellInfo.rowIndex + cellInfo.rowSpan > this.rowsNum - 1 - : range.endRowIndex == this.rowsNum - 1)) - ) - return null; - - nextRowIndex = !bottom - ? !len ? cellInfo.rowIndex - 1 : range.beginRowIndex - 1 - : !len ? cellInfo.rowIndex + cellInfo.rowSpan : range.endRowIndex + 1; - nextColIndex = !len ? cellInfo.colIndex : range.beginColIndex; - return this.getCell( - this.indexTable[nextRowIndex][nextColIndex].rowIndex, - this.indexTable[nextRowIndex][nextColIndex].cellIndex - ); - } catch (e) { - showError(e); - } - }, - /** - * 获取相同结束位置的单元格,xOrY指代了是获取x轴相同还是y轴相同 - */ - getSameEndPosCells: function(cell, xOrY) { - try { - var flag = xOrY.toLowerCase() === "x", - end = - domUtils.getXY(cell)[flag ? "x" : "y"] + - cell["offset" + (flag ? "Width" : "Height")], - rows = this.table.rows, - cells = null, - returns = []; - for (var i = 0; i < this.rowsNum; i++) { - cells = rows[i].cells; - for (var j = 0, tmpCell; (tmpCell = cells[j++]); ) { - var tmpEnd = - domUtils.getXY(tmpCell)[flag ? "x" : "y"] + - tmpCell["offset" + (flag ? "Width" : "Height")]; - //对应行的td已经被上面行rowSpan了 - if (tmpEnd > end && flag) break; - if (cell == tmpCell || end == tmpEnd) { - //只获取单一的单元格 - //todo 仅获取单一单元格在特定情况下会造成returns为空,从而影响后续的拖拽实现,修正这个。需考虑性能 - if (tmpCell[flag ? "colSpan" : "rowSpan"] == 1) { - returns.push(tmpCell); - } - if (flag) break; - } - } - } - return returns; - } catch (e) { - showError(e); - } - }, - setCellContent: function(cell, content) { - cell.innerHTML = content || (browser.ie ? domUtils.fillChar : "
                      "); - }, - cloneCell: UETable.cloneCell, - /** - * 获取跟当前单元格的右边竖线为左边的所有未合并单元格 - */ - getSameStartPosXCells: function(cell) { - try { - var start = domUtils.getXY(cell).x + cell.offsetWidth, - rows = this.table.rows, - cells, - returns = []; - for (var i = 0; i < this.rowsNum; i++) { - cells = rows[i].cells; - for (var j = 0, tmpCell; (tmpCell = cells[j++]); ) { - var tmpStart = domUtils.getXY(tmpCell).x; - if (tmpStart > start) break; - if (tmpStart == start && tmpCell.colSpan == 1) { - returns.push(tmpCell); - break; - } - } - } - return returns; - } catch (e) { - showError(e); - } - }, - /** - * 更新table对应的索引表 - */ - update: function(table) { - this.table = table || this.table; - this.selectedTds = []; - this.cellsRange = {}; - this.indexTable = []; - var rows = this.table.rows, - rowsNum = this.getMaxRows(), - dNum = rowsNum - rows.length, - colsNum = this.getMaxCols(); - while (dNum--) { - this.table.insertRow(rows.length); - } - this.rowsNum = rowsNum; - this.colsNum = colsNum; - for (var i = 0, len = rows.length; i < len; i++) { - this.indexTable[i] = new Array(colsNum); - } - //填充索引表 - for (var rowIndex = 0, row; (row = rows[rowIndex]); rowIndex++) { - for ( - var cellIndex = 0, cell, cells = row.cells; - (cell = cells[cellIndex]); - cellIndex++ - ) { - //修正整行被rowSpan时导致的行数计算错误 - if (cell.rowSpan > rowsNum) { - cell.rowSpan = rowsNum; - } - var colIndex = cellIndex, - rowSpan = cell.rowSpan || 1, - colSpan = cell.colSpan || 1; - //当已经被上一行rowSpan或者被前一列colSpan了,则跳到下一个单元格进行 - while (this.indexTable[rowIndex][colIndex]) colIndex++; - for (var j = 0; j < rowSpan; j++) { - for (var k = 0; k < colSpan; k++) { - this.indexTable[rowIndex + j][colIndex + k] = { - rowIndex: rowIndex, - cellIndex: cellIndex, - colIndex: colIndex, - rowSpan: rowSpan, - colSpan: colSpan - }; - } - } - } - } - //修复残缺td - for (j = 0; j < rowsNum; j++) { - for (k = 0; k < colsNum; k++) { - if (this.indexTable[j][k] === undefined) { - row = rows[j]; - cell = row.cells[row.cells.length - 1]; - cell = cell - ? cell.cloneNode(true) - : this.table.ownerDocument.createElement("td"); - this.setCellContent(cell); - if (cell.colSpan !== 1) cell.colSpan = 1; - if (cell.rowSpan !== 1) cell.rowSpan = 1; - row.appendChild(cell); - this.indexTable[j][k] = { - rowIndex: j, - cellIndex: cell.cellIndex, - colIndex: k, - rowSpan: 1, - colSpan: 1 - }; - } - } - } - //当框选后删除行或者列后撤销,需要重建选区。 - var tds = domUtils.getElementsByTagName(this.table, "td"), - selectTds = []; - utils.each(tds, function(td) { - if (domUtils.hasClass(td, "selectTdClass")) { - selectTds.push(td); - } - }); - if (selectTds.length) { - var start = selectTds[0], - end = selectTds[selectTds.length - 1], - startInfo = this.getCellInfo(start), - endInfo = this.getCellInfo(end); - this.selectedTds = selectTds; - this.cellsRange = { - beginRowIndex: startInfo.rowIndex, - beginColIndex: startInfo.colIndex, - endRowIndex: endInfo.rowIndex + endInfo.rowSpan - 1, - endColIndex: endInfo.colIndex + endInfo.colSpan - 1 - }; - } - //给第一行设置firstRow的样式名称,在排序图标的样式上使用到 - if (!domUtils.hasClass(this.table.rows[0], "firstRow")) { - domUtils.addClass(this.table.rows[0], "firstRow"); - for (var i = 1; i < this.table.rows.length; i++) { - domUtils.removeClasses(this.table.rows[i], "firstRow"); - } - } - }, - /** - * 获取单元格的索引信息 - */ - getCellInfo: function(cell) { - if (!cell) return; - var cellIndex = cell.cellIndex, - rowIndex = cell.parentNode.rowIndex, - rowInfo = this.indexTable[rowIndex], - numCols = this.colsNum; - for (var colIndex = cellIndex; colIndex < numCols; colIndex++) { - var cellInfo = rowInfo[colIndex]; - if ( - cellInfo.rowIndex === rowIndex && - cellInfo.cellIndex === cellIndex - ) { - return cellInfo; - } - } - }, - /** - * 根据行列号获取单元格 - */ - getCell: function(rowIndex, cellIndex) { - return ( - (rowIndex < this.rowsNum && - this.table.rows[rowIndex].cells[cellIndex]) || - null - ); - }, - /** - * 删除单元格 - */ - deleteCell: function(cell, rowIndex) { - rowIndex = typeof rowIndex == "number" - ? rowIndex - : cell.parentNode.rowIndex; - var row = this.table.rows[rowIndex]; - row.deleteCell(cell.cellIndex); - }, - /** - * 根据始末两个单元格获取被框选的所有单元格范围 - */ - getCellsRange: function(cellA, cellB) { - function checkRange( - beginRowIndex, - beginColIndex, - endRowIndex, - endColIndex - ) { - var tmpBeginRowIndex = beginRowIndex, - tmpBeginColIndex = beginColIndex, - tmpEndRowIndex = endRowIndex, - tmpEndColIndex = endColIndex, - cellInfo, - colIndex, - rowIndex; - // 通过indexTable检查是否存在超出TableRange上边界的情况 - if (beginRowIndex > 0) { - for (colIndex = beginColIndex; colIndex < endColIndex; colIndex++) { - cellInfo = me.indexTable[beginRowIndex][colIndex]; - rowIndex = cellInfo.rowIndex; - if (rowIndex < beginRowIndex) { - tmpBeginRowIndex = Math.min(rowIndex, tmpBeginRowIndex); - } - } - } - // 通过indexTable检查是否存在超出TableRange右边界的情况 - if (endColIndex < me.colsNum) { - for (rowIndex = beginRowIndex; rowIndex < endRowIndex; rowIndex++) { - cellInfo = me.indexTable[rowIndex][endColIndex]; - colIndex = cellInfo.colIndex + cellInfo.colSpan - 1; - if (colIndex > endColIndex) { - tmpEndColIndex = Math.max(colIndex, tmpEndColIndex); - } - } - } - // 检查是否有超出TableRange下边界的情况 - if (endRowIndex < me.rowsNum) { - for (colIndex = beginColIndex; colIndex < endColIndex; colIndex++) { - cellInfo = me.indexTable[endRowIndex][colIndex]; - rowIndex = cellInfo.rowIndex + cellInfo.rowSpan - 1; - if (rowIndex > endRowIndex) { - tmpEndRowIndex = Math.max(rowIndex, tmpEndRowIndex); - } - } - } - // 检查是否有超出TableRange左边界的情况 - if (beginColIndex > 0) { - for (rowIndex = beginRowIndex; rowIndex < endRowIndex; rowIndex++) { - cellInfo = me.indexTable[rowIndex][beginColIndex]; - colIndex = cellInfo.colIndex; - if (colIndex < beginColIndex) { - tmpBeginColIndex = Math.min(cellInfo.colIndex, tmpBeginColIndex); - } - } - } - //递归调用直至所有完成所有框选单元格的扩展 - if ( - tmpBeginRowIndex != beginRowIndex || - tmpBeginColIndex != beginColIndex || - tmpEndRowIndex != endRowIndex || - tmpEndColIndex != endColIndex - ) { - return checkRange( - tmpBeginRowIndex, - tmpBeginColIndex, - tmpEndRowIndex, - tmpEndColIndex - ); - } else { - // 不需要扩展TableRange的情况 - return { - beginRowIndex: beginRowIndex, - beginColIndex: beginColIndex, - endRowIndex: endRowIndex, - endColIndex: endColIndex - }; - } - } - - try { - var me = this, - cellAInfo = me.getCellInfo(cellA); - if (cellA === cellB) { - return { - beginRowIndex: cellAInfo.rowIndex, - beginColIndex: cellAInfo.colIndex, - endRowIndex: cellAInfo.rowIndex + cellAInfo.rowSpan - 1, - endColIndex: cellAInfo.colIndex + cellAInfo.colSpan - 1 - }; - } - var cellBInfo = me.getCellInfo(cellB); - // 计算TableRange的四个边 - var beginRowIndex = Math.min(cellAInfo.rowIndex, cellBInfo.rowIndex), - beginColIndex = Math.min(cellAInfo.colIndex, cellBInfo.colIndex), - endRowIndex = Math.max( - cellAInfo.rowIndex + cellAInfo.rowSpan - 1, - cellBInfo.rowIndex + cellBInfo.rowSpan - 1 - ), - endColIndex = Math.max( - cellAInfo.colIndex + cellAInfo.colSpan - 1, - cellBInfo.colIndex + cellBInfo.colSpan - 1 - ); - - return checkRange( - beginRowIndex, - beginColIndex, - endRowIndex, - endColIndex - ); - } catch (e) { - //throw e; - } - }, - /** - * 依据cellsRange获取对应的单元格集合 - */ - getCells: function(range) { - //每次获取cells之前必须先清除上次的选择,否则会对后续获取操作造成影响 - this.clearSelected(); - var beginRowIndex = range.beginRowIndex, - beginColIndex = range.beginColIndex, - endRowIndex = range.endRowIndex, - endColIndex = range.endColIndex, - cellInfo, - rowIndex, - colIndex, - tdHash = {}, - returnTds = []; - for (var i = beginRowIndex; i <= endRowIndex; i++) { - for (var j = beginColIndex; j <= endColIndex; j++) { - cellInfo = this.indexTable[i][j]; - rowIndex = cellInfo.rowIndex; - colIndex = cellInfo.colIndex; - // 如果Cells里已经包含了此Cell则跳过 - var key = rowIndex + "|" + colIndex; - if (tdHash[key]) continue; - tdHash[key] = 1; - if ( - rowIndex < i || - colIndex < j || - rowIndex + cellInfo.rowSpan - 1 > endRowIndex || - colIndex + cellInfo.colSpan - 1 > endColIndex - ) { - return null; - } - returnTds.push(this.getCell(rowIndex, cellInfo.cellIndex)); - } - } - return returnTds; - }, - /** - * 清理已经选中的单元格 - */ - clearSelected: function() { - UETable.removeSelectedClass(this.selectedTds); - this.selectedTds = []; - this.cellsRange = {}; - }, - /** - * 根据range设置已经选中的单元格 - */ - setSelected: function(range) { - var cells = this.getCells(range); - UETable.addSelectedClass(cells); - this.selectedTds = cells; - this.cellsRange = range; - }, - isFullRow: function() { - var range = this.cellsRange; - return range.endColIndex - range.beginColIndex + 1 == this.colsNum; - }, - isFullCol: function() { - var range = this.cellsRange, - table = this.table, - ths = table.getElementsByTagName("th"), - rows = range.endRowIndex - range.beginRowIndex + 1; - return !ths.length - ? rows == this.rowsNum - : rows == this.rowsNum || rows == this.rowsNum - 1; - }, - /** - * 获取视觉上的前置单元格,默认是左边,top传入时 - * @param cell - * @param top - */ - getNextCell: function(cell, bottom, ignoreRange) { - try { - var cellInfo = this.getCellInfo(cell), - nextRowIndex, - nextColIndex; - var len = this.selectedTds.length && !ignoreRange, - range = this.cellsRange; - //末行或者末列没有后置单元格 - if ( - (!bottom && cellInfo.rowIndex == 0) || - (bottom && - (!len - ? cellInfo.rowIndex + cellInfo.rowSpan > this.rowsNum - 1 - : range.endRowIndex == this.rowsNum - 1)) - ) - return null; - - nextRowIndex = !bottom - ? !len ? cellInfo.rowIndex - 1 : range.beginRowIndex - 1 - : !len ? cellInfo.rowIndex + cellInfo.rowSpan : range.endRowIndex + 1; - nextColIndex = !len ? cellInfo.colIndex : range.beginColIndex; - return this.getCell( - this.indexTable[nextRowIndex][nextColIndex].rowIndex, - this.indexTable[nextRowIndex][nextColIndex].cellIndex - ); - } catch (e) { - showError(e); - } - }, - getPreviewCell: function(cell, top) { - try { - var cellInfo = this.getCellInfo(cell), - previewRowIndex, - previewColIndex; - var len = this.selectedTds.length, - range = this.cellsRange; - //首行或者首列没有前置单元格 - if ( - (!top && (!len ? !cellInfo.colIndex : !range.beginColIndex)) || - (top && - (!len - ? cellInfo.rowIndex > this.colsNum - 1 - : range.endColIndex == this.colsNum - 1)) - ) - return null; - - previewRowIndex = !top - ? !len ? cellInfo.rowIndex : range.beginRowIndex - : !len - ? cellInfo.rowIndex < 1 ? 0 : cellInfo.rowIndex - 1 - : range.beginRowIndex; - previewColIndex = !top - ? !len - ? cellInfo.colIndex < 1 ? 0 : cellInfo.colIndex - 1 - : range.beginColIndex - 1 - : !len ? cellInfo.colIndex : range.endColIndex + 1; - return this.getCell( - this.indexTable[previewRowIndex][previewColIndex].rowIndex, - this.indexTable[previewRowIndex][previewColIndex].cellIndex - ); - } catch (e) { - showError(e); - } - }, - /** - * 移动单元格中的内容 - */ - moveContent: function(cellTo, cellFrom) { - if (UETable.isEmptyBlock(cellFrom)) return; - if (UETable.isEmptyBlock(cellTo)) { - cellTo.innerHTML = cellFrom.innerHTML; - return; - } - var child = cellTo.lastChild; - if (child.nodeType == 3 || !dtd.$block[child.tagName]) { - cellTo.appendChild(cellTo.ownerDocument.createElement("br")); - } - while ((child = cellFrom.firstChild)) { - cellTo.appendChild(child); - } - }, - /** - * 向右合并单元格 - */ - mergeRight: function(cell) { - var cellInfo = this.getCellInfo(cell), - rightColIndex = cellInfo.colIndex + cellInfo.colSpan, - rightCellInfo = this.indexTable[cellInfo.rowIndex][rightColIndex], - rightCell = this.getCell( - rightCellInfo.rowIndex, - rightCellInfo.cellIndex - ); - //合并 - cell.colSpan = cellInfo.colSpan + rightCellInfo.colSpan; - //被合并的单元格不应存在宽度属性 - cell.removeAttribute("width"); - //移动内容 - this.moveContent(cell, rightCell); - //删掉被合并的Cell - this.deleteCell(rightCell, rightCellInfo.rowIndex); - this.update(); - }, - /** - * 向下合并单元格 - */ - mergeDown: function(cell) { - var cellInfo = this.getCellInfo(cell), - downRowIndex = cellInfo.rowIndex + cellInfo.rowSpan, - downCellInfo = this.indexTable[downRowIndex][cellInfo.colIndex], - downCell = this.getCell(downCellInfo.rowIndex, downCellInfo.cellIndex); - cell.rowSpan = cellInfo.rowSpan + downCellInfo.rowSpan; - cell.removeAttribute("height"); - this.moveContent(cell, downCell); - this.deleteCell(downCell, downCellInfo.rowIndex); - this.update(); - }, - /** - * 合并整个range中的内容 - */ - mergeRange: function() { - //由于合并操作可以在任意时刻进行,所以无法通过鼠标位置等信息实时生成range,只能通过缓存实例中的cellsRange对象来访问 - var range = this.cellsRange, - leftTopCell = this.getCell( - range.beginRowIndex, - this.indexTable[range.beginRowIndex][range.beginColIndex].cellIndex - ); - - // 这段关于行表头或者列表头的特殊处理会导致表头合并范围错误 - // 为什么有这段代码的原因未明,暂且注释掉,希望原作者看到后出面说明下 - // if ( - // leftTopCell.tagName == "TH" && - // range.endRowIndex !== range.beginRowIndex - // ) { - // var index = this.indexTable, - // info = this.getCellInfo(leftTopCell); - // leftTopCell = this.getCell(1, index[1][info.colIndex].cellIndex); - // range = this.getCellsRange( - // leftTopCell, - // this.getCell( - // index[this.rowsNum - 1][info.colIndex].rowIndex, - // index[this.rowsNum - 1][info.colIndex].cellIndex - // ) - // ); - // } - - // 删除剩余的Cells - var cells = this.getCells(range); - for (var i = 0, ci; (ci = cells[i++]); ) { - if (ci !== leftTopCell) { - this.moveContent(leftTopCell, ci); - this.deleteCell(ci); - } - } - // 修改左上角Cell的rowSpan和colSpan,并调整宽度属性设置 - leftTopCell.rowSpan = range.endRowIndex - range.beginRowIndex + 1; - leftTopCell.rowSpan > 1 && leftTopCell.removeAttribute("height"); - leftTopCell.colSpan = range.endColIndex - range.beginColIndex + 1; - leftTopCell.colSpan > 1 && leftTopCell.removeAttribute("width"); - if (leftTopCell.rowSpan == this.rowsNum && leftTopCell.colSpan != 1) { - leftTopCell.colSpan = 1; - } - - if (leftTopCell.colSpan == this.colsNum && leftTopCell.rowSpan != 1) { - var rowIndex = leftTopCell.parentNode.rowIndex; - //解决IE下的表格操作问题 - if (this.table.deleteRow) { - for ( - var i = rowIndex + 1, - curIndex = rowIndex + 1, - len = leftTopCell.rowSpan; - i < len; - i++ - ) { - this.table.deleteRow(curIndex); - } - } else { - for (var i = 0, len = leftTopCell.rowSpan - 1; i < len; i++) { - var row = this.table.rows[rowIndex + 1]; - row.parentNode.removeChild(row); - } - } - leftTopCell.rowSpan = 1; - } - this.update(); - }, - /** - * 插入一行单元格 - */ - insertRow: function(rowIndex, sourceCell) { - var numCols = this.colsNum, - table = this.table, - row = table.insertRow(rowIndex), - cell, - thead = null, - isInsertTitle = - typeof sourceCell == "string" && sourceCell.toUpperCase() == "TH"; - - function replaceTdToTh(colIndex, cell, tableRow) { - if (colIndex == 0) { - var tr = tableRow.nextSibling || tableRow.previousSibling, - th = tr.cells[colIndex]; - if (th.tagName == "TH") { - th = cell.ownerDocument.createElement("th"); - th.appendChild(cell.firstChild); - tableRow.insertBefore(th, cell); - domUtils.remove(cell); - } - } else { - if (cell.tagName == "TH") { - var td = cell.ownerDocument.createElement("td"); - td.appendChild(cell.firstChild); - tableRow.insertBefore(td, cell); - domUtils.remove(cell); - } - } - } - - //首行直接插入,无需考虑部分单元格被rowspan的情况 - if (rowIndex == 0 || rowIndex == this.rowsNum) { - for (var colIndex = 0; colIndex < numCols; colIndex++) { - cell = this.cloneCell(sourceCell, true); - this.setCellContent(cell); - cell.getAttribute("vAlign") && - cell.setAttribute("vAlign", cell.getAttribute("vAlign")); - row.appendChild(cell); - if (!isInsertTitle) replaceTdToTh(colIndex, cell, row); - } - - if (isInsertTitle) { - thead = table.createTHead(); - thead.insertBefore(row, thead.firstChild); - } - } else { - var infoRow = this.indexTable[rowIndex], - cellIndex = 0; - for (colIndex = 0; colIndex < numCols; colIndex++) { - var cellInfo = infoRow[colIndex]; - //如果存在某个单元格的rowspan穿过待插入行的位置,则修改该单元格的rowspan即可,无需插入单元格 - if (cellInfo.rowIndex < rowIndex) { - cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); - cell.rowSpan = cellInfo.rowSpan + 1; - } else { - cell = this.cloneCell(sourceCell, true); - this.setCellContent(cell); - row.appendChild(cell); - } - if (!isInsertTitle) replaceTdToTh(colIndex, cell, row); - } - } - //框选时插入不触发contentchange,需要手动更新索引。 - this.update(); - return row; - }, - /** - * 删除一行单元格 - * @param rowIndex - */ - deleteRow: function(rowIndex) { - var row = this.table.rows[rowIndex], - infoRow = this.indexTable[rowIndex], - colsNum = this.colsNum, - count = 0; //处理计数 - for (var colIndex = 0; colIndex < colsNum; ) { - var cellInfo = infoRow[colIndex], - cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); - if (cell.rowSpan > 1) { - if (cellInfo.rowIndex == rowIndex) { - var clone = cell.cloneNode(true); - clone.rowSpan = cell.rowSpan - 1; - clone.innerHTML = ""; - cell.rowSpan = 1; - var nextRowIndex = rowIndex + 1, - nextRow = this.table.rows[nextRowIndex], - insertCellIndex, - preMerged = - this.getPreviewMergedCellsNum(nextRowIndex, colIndex) - count; - if (preMerged < colIndex) { - insertCellIndex = colIndex - preMerged - 1; - //nextRow.insertCell(insertCellIndex); - domUtils.insertAfter(nextRow.cells[insertCellIndex], clone); - } else { - if (nextRow.cells.length) - nextRow.insertBefore(clone, nextRow.cells[0]); - } - count += 1; - //cell.parentNode.removeChild(cell); - } - } - colIndex += cell.colSpan || 1; - } - var deleteTds = [], - cacheMap = {}; - for (colIndex = 0; colIndex < colsNum; colIndex++) { - var tmpRowIndex = infoRow[colIndex].rowIndex, - tmpCellIndex = infoRow[colIndex].cellIndex, - key = tmpRowIndex + "_" + tmpCellIndex; - if (cacheMap[key]) continue; - cacheMap[key] = 1; - cell = this.getCell(tmpRowIndex, tmpCellIndex); - deleteTds.push(cell); - } - var mergeTds = []; - utils.each(deleteTds, function(td) { - if (td.rowSpan == 1) { - td.parentNode.removeChild(td); - } else { - mergeTds.push(td); - } - }); - utils.each(mergeTds, function(td) { - td.rowSpan--; - }); - row.parentNode.removeChild(row); - //浏览器方法本身存在bug,采用自定义方法删除 - //this.table.deleteRow(rowIndex); - this.update(); - }, - insertCol: function(colIndex, sourceCell, defaultValue) { - var rowsNum = this.rowsNum, - rowIndex = 0, - tableRow, - cell, - backWidth = parseInt( - (this.table.offsetWidth - - (this.colsNum + 1) * 20 - - (this.colsNum + 1)) / - (this.colsNum + 1), - 10 - ), - isInsertTitleCol = - typeof sourceCell == "string" && sourceCell.toUpperCase() == "TH"; - - function replaceTdToTh(rowIndex, cell, tableRow) { - if (rowIndex == 0) { - var th = cell.nextSibling || cell.previousSibling; - if (th.tagName == "TH") { - th = cell.ownerDocument.createElement("th"); - th.appendChild(cell.firstChild); - tableRow.insertBefore(th, cell); - domUtils.remove(cell); - } - } else { - if (cell.tagName == "TH") { - var td = cell.ownerDocument.createElement("td"); - td.appendChild(cell.firstChild); - tableRow.insertBefore(td, cell); - domUtils.remove(cell); - } - } - } - - var preCell; - if (colIndex == 0 || colIndex == this.colsNum) { - for (; rowIndex < rowsNum; rowIndex++) { - tableRow = this.table.rows[rowIndex]; - preCell = - tableRow.cells[colIndex == 0 ? colIndex : tableRow.cells.length]; - cell = this.cloneCell(sourceCell, true); //tableRow.insertCell(colIndex == 0 ? colIndex : tableRow.cells.length); - this.setCellContent(cell); - cell.setAttribute("vAlign", cell.getAttribute("vAlign")); - preCell && cell.setAttribute("width", preCell.getAttribute("width")); - if (!colIndex) { - tableRow.insertBefore(cell, tableRow.cells[0]); - } else { - domUtils.insertAfter( - tableRow.cells[tableRow.cells.length - 1], - cell - ); - } - if (!isInsertTitleCol) replaceTdToTh(rowIndex, cell, tableRow); - } - } else { - for (; rowIndex < rowsNum; rowIndex++) { - var cellInfo = this.indexTable[rowIndex][colIndex]; - if (cellInfo.colIndex < colIndex) { - cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); - cell.colSpan = cellInfo.colSpan + 1; - } else { - tableRow = this.table.rows[rowIndex]; - preCell = tableRow.cells[cellInfo.cellIndex]; - - cell = this.cloneCell(sourceCell, true); //tableRow.insertCell(cellInfo.cellIndex); - this.setCellContent(cell); - cell.setAttribute("vAlign", cell.getAttribute("vAlign")); - preCell && - cell.setAttribute("width", preCell.getAttribute("width")); - //防止IE下报错 - preCell - ? tableRow.insertBefore(cell, preCell) - : tableRow.appendChild(cell); - } - if (!isInsertTitleCol) replaceTdToTh(rowIndex, cell, tableRow); - } - } - //框选时插入不触发contentchange,需要手动更新索引 - this.update(); - this.updateWidth( - backWidth, - defaultValue || { tdPadding: 10, tdBorder: 1 } - ); - }, - updateWidth: function(width, defaultValue) { - var table = this.table, - tmpWidth = - UETable.getWidth(table) - - defaultValue.tdPadding * 2 - - defaultValue.tdBorder + - width; - if (tmpWidth < table.ownerDocument.body.offsetWidth) { - table.setAttribute("width", tmpWidth); - return; - } - var tds = domUtils.getElementsByTagName(this.table, "td th"); - utils.each(tds, function(td) { - td.setAttribute("width", width); - }); - }, - deleteCol: function(colIndex) { - var indexTable = this.indexTable, - tableRows = this.table.rows, - backTableWidth = this.table.getAttribute("width"), - backTdWidth = 0, - rowsNum = this.rowsNum, - cacheMap = {}; - for (var rowIndex = 0; rowIndex < rowsNum; ) { - var infoRow = indexTable[rowIndex], - cellInfo = infoRow[colIndex], - key = cellInfo.rowIndex + "_" + cellInfo.colIndex; - // 跳过已经处理过的Cell - if (cacheMap[key]) continue; - cacheMap[key] = 1; - var cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex); - if (!backTdWidth) - backTdWidth = - cell && parseInt(cell.offsetWidth / cell.colSpan, 10).toFixed(0); - // 如果Cell的colSpan大于1, 就修改colSpan, 否则就删掉这个Cell - if (cell.colSpan > 1) { - cell.colSpan--; - } else { - tableRows[rowIndex].deleteCell(cellInfo.cellIndex); - } - rowIndex += cellInfo.rowSpan || 1; - } - this.table.setAttribute("width", backTableWidth - backTdWidth); - this.update(); - }, - splitToCells: function(cell) { - var me = this, - cells = this.splitToRows(cell); - utils.each(cells, function(cell) { - me.splitToCols(cell); - }); - }, - splitToRows: function(cell) { - var cellInfo = this.getCellInfo(cell), - rowIndex = cellInfo.rowIndex, - colIndex = cellInfo.colIndex, - results = []; - // 修改Cell的rowSpan - cell.rowSpan = 1; - results.push(cell); - // 补齐单元格 - for ( - var i = rowIndex, endRow = rowIndex + cellInfo.rowSpan; - i < endRow; - i++ - ) { - if (i == rowIndex) continue; - var tableRow = this.table.rows[i], - tmpCell = tableRow.insertCell( - colIndex - this.getPreviewMergedCellsNum(i, colIndex) - ); - tmpCell.colSpan = cellInfo.colSpan; - this.setCellContent(tmpCell); - tmpCell.setAttribute("vAlign", cell.getAttribute("vAlign")); - tmpCell.setAttribute("align", cell.getAttribute("align")); - if (cell.style.cssText) { - tmpCell.style.cssText = cell.style.cssText; - } - results.push(tmpCell); - } - this.update(); - return results; - }, - getPreviewMergedCellsNum: function(rowIndex, colIndex) { - var indexRow = this.indexTable[rowIndex], - num = 0; - for (var i = 0; i < colIndex; ) { - var colSpan = indexRow[i].colSpan, - tmpRowIndex = indexRow[i].rowIndex; - num += colSpan - (tmpRowIndex == rowIndex ? 1 : 0); - i += colSpan; - } - return num; - }, - splitToCols: function(cell) { - var backWidth = (cell.offsetWidth / cell.colSpan - 22).toFixed(0), - cellInfo = this.getCellInfo(cell), - rowIndex = cellInfo.rowIndex, - colIndex = cellInfo.colIndex, - results = []; - // 修改Cell的rowSpan - cell.colSpan = 1; - cell.setAttribute("width", backWidth); - results.push(cell); - // 补齐单元格 - for ( - var j = colIndex, endCol = colIndex + cellInfo.colSpan; - j < endCol; - j++ - ) { - if (j == colIndex) continue; - var tableRow = this.table.rows[rowIndex], - tmpCell = tableRow.insertCell( - this.indexTable[rowIndex][j].cellIndex + 1 - ); - tmpCell.rowSpan = cellInfo.rowSpan; - this.setCellContent(tmpCell); - tmpCell.setAttribute("vAlign", cell.getAttribute("vAlign")); - tmpCell.setAttribute("align", cell.getAttribute("align")); - tmpCell.setAttribute("width", backWidth); - if (cell.style.cssText) { - tmpCell.style.cssText = cell.style.cssText; - } - //处理th的情况 - if (cell.tagName == "TH") { - var th = cell.ownerDocument.createElement("th"); - th.appendChild(tmpCell.firstChild); - th.setAttribute("vAlign", cell.getAttribute("vAlign")); - th.rowSpan = tmpCell.rowSpan; - tableRow.insertBefore(th, tmpCell); - domUtils.remove(tmpCell); - } - results.push(tmpCell); - } - this.update(); - return results; - }, - isLastCell: function(cell, rowsNum, colsNum) { - rowsNum = rowsNum || this.rowsNum; - colsNum = colsNum || this.colsNum; - var cellInfo = this.getCellInfo(cell); - return ( - cellInfo.rowIndex + cellInfo.rowSpan == rowsNum && - cellInfo.colIndex + cellInfo.colSpan == colsNum - ); - }, - getLastCell: function(cells) { - cells = cells || this.table.getElementsByTagName("td"); - var firstInfo = this.getCellInfo(cells[0]); - var me = this, - last = cells[0], - tr = last.parentNode, - cellsNum = 0, - cols = 0, - rows; - utils.each(cells, function(cell) { - if (cell.parentNode == tr) cols += cell.colSpan || 1; - cellsNum += cell.rowSpan * cell.colSpan || 1; - }); - rows = cellsNum / cols; - utils.each(cells, function(cell) { - if (me.isLastCell(cell, rows, cols)) { - last = cell; - return false; - } - }); - return last; - }, - selectRow: function(rowIndex) { - var indexRow = this.indexTable[rowIndex], - start = this.getCell(indexRow[0].rowIndex, indexRow[0].cellIndex), - end = this.getCell( - indexRow[this.colsNum - 1].rowIndex, - indexRow[this.colsNum - 1].cellIndex - ), - range = this.getCellsRange(start, end); - this.setSelected(range); - }, - selectTable: function() { - var tds = this.table.getElementsByTagName("td"), - range = this.getCellsRange(tds[0], tds[tds.length - 1]); - this.setSelected(range); - }, - setBackground: function(cells, value) { - if (typeof value === "string") { - utils.each(cells, function(cell) { - cell.style.backgroundColor = value; - }); - } else if (typeof value === "object") { - value = utils.extend( - { - repeat: true, - colorList: ["#ddd", "#fff"] - }, - value - ); - var rowIndex = this.getCellInfo(cells[0]).rowIndex, - count = 0, - colors = value.colorList, - getColor = function(list, index, repeat) { - return list[index] - ? list[index] - : repeat ? list[index % list.length] : ""; - }; - for (var i = 0, cell; (cell = cells[i++]); ) { - var cellInfo = this.getCellInfo(cell); - cell.style.backgroundColor = getColor( - colors, - rowIndex + count == cellInfo.rowIndex ? count : ++count, - value.repeat - ); - } - } - }, - removeBackground: function(cells) { - utils.each(cells, function(cell) { - cell.style.backgroundColor = ""; - }); - } - }; - function showError(e) {} -})(); - - -// plugins/table.cmds.js -/** - * Created with JetBrains PhpStorm. - * User: taoqili - * Date: 13-2-20 - * Time: 下午6:25 - * To change this template use File | Settings | File Templates. - */ -;(function() { - var UT = UE.UETable, - getTableItemsByRange = function(editor) { - return UT.getTableItemsByRange(editor); - }, - getUETableBySelected = function(editor) { - return UT.getUETableBySelected(editor); - }, - getDefaultValue = function(editor, table) { - return UT.getDefaultValue(editor, table); - }, - getUETable = function(tdOrTable) { - return UT.getUETable(tdOrTable); - }; - - UE.commands["inserttable"] = { - queryCommandState: function() { - return getTableItemsByRange(this).table ? -1 : 0; - }, - execCommand: function(cmd, opt) { - function createTable(opt, tdWidth) { - var html = [], - rowsNum = opt.numRows, - colsNum = opt.numCols; - for (var r = 0; r < rowsNum; r++) { - html.push(""); - for (var c = 0; c < colsNum; c++) { - html.push( - '
                    • ' + - (browser.ie && browser.version < 11 - ? domUtils.fillChar - : "
                      ") + - "
                      " + html.join("") + "
                      "; - } - - if (!opt) { - opt = utils.extend( - {}, - { - numCols: this.options.defaultCols, - numRows: this.options.defaultRows, - tdvalign: this.options.tdvalign - } - ); - } - var me = this; - var range = this.selection.getRange(), - start = range.startContainer, - firstParentBlock = - domUtils.findParent( - start, - function(node) { - return domUtils.isBlockElm(node); - }, - true - ) || me.body; - - var defaultValue = getDefaultValue(me), - tableWidth = firstParentBlock.offsetWidth, - tdWidth = Math.floor( - tableWidth / opt.numCols - - defaultValue.tdPadding * 2 - - defaultValue.tdBorder - ); - - //todo其他属性 - !opt.tdvalign && (opt.tdvalign = me.options.tdvalign); - me.execCommand("inserthtml", createTable(opt, tdWidth)); - } - }; - - UE.commands["insertparagraphbeforetable"] = { - queryCommandState: function() { - return getTableItemsByRange(this).cell ? 0 : -1; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var p = this.document.createElement("p"); - p.innerHTML = browser.ie ? " " : "
                      "; - table.parentNode.insertBefore(p, table); - this.selection.getRange().setStart(p, 0).setCursor(); - } - } - }; - - UE.commands["deletetable"] = { - queryCommandState: function() { - var rng = this.selection.getRange(); - return domUtils.findParentByTagName(rng.startContainer, "table", true) - ? 0 - : -1; - }, - execCommand: function(cmd, table) { - var rng = this.selection.getRange(); - table = - table || - domUtils.findParentByTagName(rng.startContainer, "table", true); - if (table) { - var next = table.nextSibling; - if (!next) { - next = domUtils.createElement(this.document, "p", { - innerHTML: browser.ie ? domUtils.fillChar : "
                      " - }); - table.parentNode.insertBefore(next, table); - } - domUtils.remove(table); - rng = this.selection.getRange(); - if (next.nodeType == 3) { - rng.setStartBefore(next); - } else { - rng.setStart(next, 0); - } - rng.setCursor(false, true); - this.fireEvent("tablehasdeleted"); - } - } - }; - UE.commands["cellalign"] = { - queryCommandState: function() { - return getSelectedArr(this).length ? 0 : -1; - }, - execCommand: function(cmd, align) { - var selectedTds = getSelectedArr(this); - if (selectedTds.length) { - for (var i = 0, ci; (ci = selectedTds[i++]); ) { - ci.setAttribute("align", align); - } - } - } - }; - UE.commands["cellvalign"] = { - queryCommandState: function() { - return getSelectedArr(this).length ? 0 : -1; - }, - execCommand: function(cmd, valign) { - var selectedTds = getSelectedArr(this); - if (selectedTds.length) { - for (var i = 0, ci; (ci = selectedTds[i++]); ) { - ci.setAttribute("vAlign", valign); - } - } - } - }; - UE.commands["insertcaption"] = { - queryCommandState: function() { - var table = getTableItemsByRange(this).table; - if (table) { - return table.getElementsByTagName("caption").length == 0 ? 1 : -1; - } - return -1; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var caption = this.document.createElement("caption"); - caption.innerHTML = browser.ie ? domUtils.fillChar : "
                      "; - table.insertBefore(caption, table.firstChild); - var range = this.selection.getRange(); - range.setStart(caption, 0).setCursor(); - } - } - }; - UE.commands["deletecaption"] = { - queryCommandState: function() { - var rng = this.selection.getRange(), - table = domUtils.findParentByTagName(rng.startContainer, "table"); - if (table) { - return table.getElementsByTagName("caption").length == 0 ? -1 : 1; - } - return -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - table = domUtils.findParentByTagName(rng.startContainer, "table"); - if (table) { - domUtils.remove(table.getElementsByTagName("caption")[0]); - var range = this.selection.getRange(); - range.setStart(table.rows[0].cells[0], 0).setCursor(); - } - } - }; - UE.commands["inserttitle"] = { - queryCommandState: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var firstRow = table.rows[0]; - return firstRow.cells[ - firstRow.cells.length - 1 - ].tagName.toLowerCase() != "th" - ? 0 - : -1; - } - return -1; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - if (table) { - getUETable(table).insertRow(0, "th"); - } - var th = table.getElementsByTagName("th")[0]; - this.selection.getRange().setStart(th, 0).setCursor(false, true); - } - }; - UE.commands["deletetitle"] = { - queryCommandState: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var firstRow = table.rows[0]; - return firstRow.cells[ - firstRow.cells.length - 1 - ].tagName.toLowerCase() == "th" - ? 0 - : -1; - } - return -1; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - if (table) { - domUtils.remove(table.rows[0]); - } - var td = table.getElementsByTagName("td")[0]; - this.selection.getRange().setStart(td, 0).setCursor(false, true); - } - }; - UE.commands["inserttitlecol"] = { - queryCommandState: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var lastRow = table.rows[table.rows.length - 1]; - return lastRow.getElementsByTagName("th").length ? -1 : 0; - } - return -1; - }, - execCommand: function(cmd) { - var table = getTableItemsByRange(this).table; - if (table) { - getUETable(table).insertCol(0, "th"); - } - resetTdWidth(table, this); - var th = table.getElementsByTagName("th")[0]; - this.selection.getRange().setStart(th, 0).setCursor(false, true); - } - }; - UE.commands["deletetitlecol"] = { - queryCommandState: function() { - var table = getTableItemsByRange(this).table; - if (table) { - var lastRow = table.rows[table.rows.length - 1]; - return lastRow.getElementsByTagName("th").length ? 0 : -1; - } - return -1; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - if (table) { - for (var i = 0; i < table.rows.length; i++) { - domUtils.remove(table.rows[i].children[0]); - } - } - resetTdWidth(table, this); - var td = table.getElementsByTagName("td")[0]; - this.selection.getRange().setStart(td, 0).setCursor(false, true); - } - }; - - UE.commands["mergeright"] = { - queryCommandState: function(cmd) { - var tableItems = getTableItemsByRange(this), - table = tableItems.table, - cell = tableItems.cell; - - if (!table || !cell) return -1; - var ut = getUETable(table); - if (ut.selectedTds.length) return -1; - - var cellInfo = ut.getCellInfo(cell), - rightColIndex = cellInfo.colIndex + cellInfo.colSpan; - if (rightColIndex >= ut.colsNum) return -1; // 如果处于最右边则不能向右合并 - - var rightCellInfo = ut.indexTable[cellInfo.rowIndex][rightColIndex], - rightCell = - table.rows[rightCellInfo.rowIndex].cells[rightCellInfo.cellIndex]; - if (!rightCell || cell.tagName != rightCell.tagName) return -1; // TH和TD不能相互合并 - - // 当且仅当两个Cell的开始列号和结束列号一致时能进行合并 - return rightCellInfo.rowIndex == cellInfo.rowIndex && - rightCellInfo.rowSpan == cellInfo.rowSpan - ? 0 - : -1; - }, - execCommand: function(cmd) { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell); - ut.mergeRight(cell); - rng.moveToBookmark(bk).select(); - } - }; - UE.commands["mergedown"] = { - queryCommandState: function(cmd) { - var tableItems = getTableItemsByRange(this), - table = tableItems.table, - cell = tableItems.cell; - - if (!table || !cell) return -1; - var ut = getUETable(table); - if (ut.selectedTds.length) return -1; - - var cellInfo = ut.getCellInfo(cell), - downRowIndex = cellInfo.rowIndex + cellInfo.rowSpan; - if (downRowIndex >= ut.rowsNum) return -1; // 如果处于最下边则不能向下合并 - - var downCellInfo = ut.indexTable[downRowIndex][cellInfo.colIndex], - downCell = - table.rows[downCellInfo.rowIndex].cells[downCellInfo.cellIndex]; - if (!downCell || cell.tagName != downCell.tagName) return -1; // TH和TD不能相互合并 - - // 当且仅当两个Cell的开始列号和结束列号一致时能进行合并 - return downCellInfo.colIndex == cellInfo.colIndex && - downCellInfo.colSpan == cellInfo.colSpan - ? 0 - : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell); - ut.mergeDown(cell); - rng.moveToBookmark(bk).select(); - } - }; - UE.commands["mergecells"] = { - queryCommandState: function() { - return getUETableBySelected(this) ? 0 : -1; - }, - execCommand: function() { - var ut = getUETableBySelected(this); - if (ut && ut.selectedTds.length) { - var cell = ut.selectedTds[0]; - ut.mergeRange(); - var rng = this.selection.getRange(); - if (domUtils.isEmptyBlock(cell)) { - rng.setStart(cell, 0).collapse(true); - } else { - rng.selectNodeContents(cell); - } - rng.select(); - } - } - }; - UE.commands["insertrow"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - return cell && - (cell.tagName == "TD" || - (cell.tagName == "TH" && - tableItems.tr !== tableItems.table.rows[0])) && - getUETable(tableItems.table).rowsNum < this.options.maxRowNum - ? 0 - : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell, - table = tableItems.table, - ut = getUETable(table), - cellInfo = ut.getCellInfo(cell); - //ut.insertRow(!ut.selectedTds.length ? cellInfo.rowIndex:ut.cellsRange.beginRowIndex,''); - if (!ut.selectedTds.length) { - ut.insertRow(cellInfo.rowIndex, cell); - } else { - var range = ut.cellsRange; - for ( - var i = 0, len = range.endRowIndex - range.beginRowIndex + 1; - i < len; - i++ - ) { - ut.insertRow(range.beginRowIndex, cell); - } - } - rng.moveToBookmark(bk).select(); - if (table.getAttribute("interlaced") === "enabled") - this.fireEvent("interlacetable", table); - } - }; - //后插入行 - UE.commands["insertrownext"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - return cell && - cell.tagName == "TD" && - getUETable(tableItems.table).rowsNum < this.options.maxRowNum - ? 0 - : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell, - table = tableItems.table, - ut = getUETable(table), - cellInfo = ut.getCellInfo(cell); - //ut.insertRow(!ut.selectedTds.length? cellInfo.rowIndex + cellInfo.rowSpan : ut.cellsRange.endRowIndex + 1,''); - if (!ut.selectedTds.length) { - ut.insertRow(cellInfo.rowIndex + cellInfo.rowSpan, cell); - } else { - var range = ut.cellsRange; - for ( - var i = 0, len = range.endRowIndex - range.beginRowIndex + 1; - i < len; - i++ - ) { - ut.insertRow(range.endRowIndex + 1, cell); - } - } - rng.moveToBookmark(bk).select(); - if (table.getAttribute("interlaced") === "enabled") - this.fireEvent("interlacetable", table); - } - }; - UE.commands["deleterow"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this); - return tableItems.cell ? 0 : -1; - }, - execCommand: function() { - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell), - cellsRange = ut.cellsRange, - cellInfo = ut.getCellInfo(cell), - preCell = ut.getVSideCell(cell), - nextCell = ut.getVSideCell(cell, true), - rng = this.selection.getRange(); - if (utils.isEmptyObject(cellsRange)) { - ut.deleteRow(cellInfo.rowIndex); - } else { - for ( - var i = cellsRange.beginRowIndex; - i < cellsRange.endRowIndex + 1; - i++ - ) { - ut.deleteRow(cellsRange.beginRowIndex); - } - } - var table = ut.table; - if (!table.getElementsByTagName("td").length) { - var nextSibling = table.nextSibling; - domUtils.remove(table); - if (nextSibling) { - rng.setStart(nextSibling, 0).setCursor(false, true); - } - } else { - if ( - cellInfo.rowSpan == 1 || - cellInfo.rowSpan == - cellsRange.endRowIndex - cellsRange.beginRowIndex + 1 - ) { - if (nextCell || preCell) - rng.selectNodeContents(nextCell || preCell).setCursor(false, true); - } else { - var newCell = ut.getCell( - cellInfo.rowIndex, - ut.indexTable[cellInfo.rowIndex][cellInfo.colIndex].cellIndex - ); - if (newCell) rng.selectNodeContents(newCell).setCursor(false, true); - } - } - if (table.getAttribute("interlaced") === "enabled") - this.fireEvent("interlacetable", table); - } - }; - UE.commands["insertcol"] = { - queryCommandState: function(cmd) { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - return cell && - (cell.tagName == "TD" || - (cell.tagName == "TH" && cell !== tableItems.tr.cells[0])) && - getUETable(tableItems.table).colsNum < this.options.maxColNum - ? 0 - : -1; - }, - execCommand: function(cmd) { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - if (this.queryCommandState(cmd) == -1) return; - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell), - cellInfo = ut.getCellInfo(cell); - - //ut.insertCol(!ut.selectedTds.length ? cellInfo.colIndex:ut.cellsRange.beginColIndex); - if (!ut.selectedTds.length) { - ut.insertCol(cellInfo.colIndex, cell); - } else { - var range = ut.cellsRange; - for ( - var i = 0, len = range.endColIndex - range.beginColIndex + 1; - i < len; - i++ - ) { - ut.insertCol(range.beginColIndex, cell); - } - } - rng.moveToBookmark(bk).select(true); - } - }; - UE.commands["insertcolnext"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - return cell && - getUETable(tableItems.table).colsNum < this.options.maxColNum - ? 0 - : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell), - cellInfo = ut.getCellInfo(cell); - //ut.insertCol(!ut.selectedTds.length ? cellInfo.colIndex + cellInfo.colSpan:ut.cellsRange.endColIndex +1); - if (!ut.selectedTds.length) { - ut.insertCol(cellInfo.colIndex + cellInfo.colSpan, cell); - } else { - var range = ut.cellsRange; - for ( - var i = 0, len = range.endColIndex - range.beginColIndex + 1; - i < len; - i++ - ) { - ut.insertCol(range.endColIndex + 1, cell); - } - } - rng.moveToBookmark(bk).select(); - } - }; - - UE.commands["deletecol"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this); - return tableItems.cell ? 0 : -1; - }, - execCommand: function() { - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell), - range = ut.cellsRange, - cellInfo = ut.getCellInfo(cell), - preCell = ut.getHSideCell(cell), - nextCell = ut.getHSideCell(cell, true); - if (utils.isEmptyObject(range)) { - ut.deleteCol(cellInfo.colIndex); - } else { - for (var i = range.beginColIndex; i < range.endColIndex + 1; i++) { - ut.deleteCol(range.beginColIndex); - } - } - var table = ut.table, - rng = this.selection.getRange(); - - if (!table.getElementsByTagName("td").length) { - var nextSibling = table.nextSibling; - domUtils.remove(table); - if (nextSibling) { - rng.setStart(nextSibling, 0).setCursor(false, true); - } - } else { - if (domUtils.inDoc(cell, this.document)) { - rng.setStart(cell, 0).setCursor(false, true); - } else { - if (nextCell && domUtils.inDoc(nextCell, this.document)) { - rng.selectNodeContents(nextCell).setCursor(false, true); - } else { - if (preCell && domUtils.inDoc(preCell, this.document)) { - rng.selectNodeContents(preCell).setCursor(true, true); - } - } - } - } - } - }; - UE.commands["splittocells"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - if (!cell) return -1; - var ut = getUETable(tableItems.table); - if (ut.selectedTds.length > 0) return -1; - return cell && (cell.colSpan > 1 || cell.rowSpan > 1) ? 0 : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell); - ut.splitToCells(cell); - rng.moveToBookmark(bk).select(); - } - }; - UE.commands["splittorows"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - if (!cell) return -1; - var ut = getUETable(tableItems.table); - if (ut.selectedTds.length > 0) return -1; - return cell && cell.rowSpan > 1 ? 0 : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell); - ut.splitToRows(cell); - rng.moveToBookmark(bk).select(); - } - }; - UE.commands["splittocols"] = { - queryCommandState: function() { - var tableItems = getTableItemsByRange(this), - cell = tableItems.cell; - if (!cell) return -1; - var ut = getUETable(tableItems.table); - if (ut.selectedTds.length > 0) return -1; - return cell && cell.colSpan > 1 ? 0 : -1; - }, - execCommand: function() { - var rng = this.selection.getRange(), - bk = rng.createBookmark(true); - var cell = getTableItemsByRange(this).cell, - ut = getUETable(cell); - ut.splitToCols(cell); - rng.moveToBookmark(bk).select(); - } - }; - - UE.commands["adaptbytext"] = UE.commands["adaptbywindow"] = { - queryCommandState: function() { - return getTableItemsByRange(this).table ? 0 : -1; - }, - execCommand: function(cmd) { - var tableItems = getTableItemsByRange(this), - table = tableItems.table; - if (table) { - if (cmd == "adaptbywindow") { - resetTdWidth(table, this); - } else { - var cells = domUtils.getElementsByTagName(table, "td th"); - utils.each(cells, function(cell) { - cell.removeAttribute("width"); - }); - table.removeAttribute("width"); - } - } - } - }; - - //平均分配各列 - UE.commands["averagedistributecol"] = { - queryCommandState: function() { - var ut = getUETableBySelected(this); - if (!ut) return -1; - return ut.isFullRow() || ut.isFullCol() ? 0 : -1; - }, - execCommand: function(cmd) { - var me = this, - ut = getUETableBySelected(me); - - function getAverageWidth() { - var tb = ut.table, - averageWidth, - sumWidth = 0, - colsNum = 0, - tbAttr = getDefaultValue(me, tb); - - if (ut.isFullRow()) { - sumWidth = tb.offsetWidth; - colsNum = ut.colsNum; - } else { - var begin = ut.cellsRange.beginColIndex, - end = ut.cellsRange.endColIndex, - node; - for (var i = begin; i <= end; ) { - node = ut.selectedTds[i]; - sumWidth += node.offsetWidth; - i += node.colSpan; - colsNum += 1; - } - } - averageWidth = - Math.ceil(sumWidth / colsNum) - - tbAttr.tdBorder * 2 - - tbAttr.tdPadding * 2; - return averageWidth; - } - - function setAverageWidth(averageWidth) { - utils.each(domUtils.getElementsByTagName(ut.table, "th"), function( - node - ) { - node.setAttribute("width", ""); - }); - var cells = ut.isFullRow() - ? domUtils.getElementsByTagName(ut.table, "td") - : ut.selectedTds; - - utils.each(cells, function(node) { - if (node.colSpan == 1) { - node.setAttribute("width", averageWidth); - } - }); - } - - if (ut && ut.selectedTds.length) { - setAverageWidth(getAverageWidth()); - } - } - }; - //平均分配各行 - UE.commands["averagedistributerow"] = { - queryCommandState: function() { - var ut = getUETableBySelected(this); - if (!ut) return -1; - if (ut.selectedTds && /th/gi.test(ut.selectedTds[0].tagName)) return -1; - return ut.isFullRow() || ut.isFullCol() ? 0 : -1; - }, - execCommand: function(cmd) { - var me = this, - ut = getUETableBySelected(me); - - function getAverageHeight() { - var averageHeight, - rowNum, - sumHeight = 0, - tb = ut.table, - tbAttr = getDefaultValue(me, tb), - tdpadding = parseInt( - domUtils.getComputedStyle( - tb.getElementsByTagName("td")[0], - "padding-top" - ) - ); - - if (ut.isFullCol()) { - var captionArr = domUtils.getElementsByTagName(tb, "caption"), - thArr = domUtils.getElementsByTagName(tb, "th"), - captionHeight, - thHeight; - - if (captionArr.length > 0) { - captionHeight = captionArr[0].offsetHeight; - } - if (thArr.length > 0) { - thHeight = thArr[0].offsetHeight; - } - - sumHeight = tb.offsetHeight - (captionHeight || 0) - (thHeight || 0); - rowNum = thArr.length == 0 ? ut.rowsNum : ut.rowsNum - 1; - } else { - var begin = ut.cellsRange.beginRowIndex, - end = ut.cellsRange.endRowIndex, - count = 0, - trs = domUtils.getElementsByTagName(tb, "tr"); - for (var i = begin; i <= end; i++) { - sumHeight += trs[i].offsetHeight; - count += 1; - } - rowNum = count; - } - //ie8下是混杂模式 - if (browser.ie && browser.version < 9) { - averageHeight = Math.ceil(sumHeight / rowNum); - } else { - averageHeight = - Math.ceil(sumHeight / rowNum) - tbAttr.tdBorder * 2 - tdpadding * 2; - } - return averageHeight; - } - - function setAverageHeight(averageHeight) { - var cells = ut.isFullCol() - ? domUtils.getElementsByTagName(ut.table, "td") - : ut.selectedTds; - utils.each(cells, function(node) { - if (node.rowSpan == 1) { - node.setAttribute("height", averageHeight); - } - }); - } - - if (ut && ut.selectedTds.length) { - setAverageHeight(getAverageHeight()); - } - } - }; - - //单元格对齐方式 - UE.commands["cellalignment"] = { - queryCommandState: function() { - return getTableItemsByRange(this).table ? 0 : -1; - }, - execCommand: function(cmd, data) { - var me = this, - ut = getUETableBySelected(me); - - if (!ut) { - var start = me.selection.getStart(), - cell = - start && - domUtils.findParentByTagName(start, ["td", "th", "caption"], true); - if (!/caption/gi.test(cell.tagName)) { - domUtils.setAttributes(cell, data); - } else { - cell.style.textAlign = data.align; - cell.style.verticalAlign = data.vAlign; - } - me.selection.getRange().setCursor(true); - } else { - utils.each(ut.selectedTds, function(cell) { - domUtils.setAttributes(cell, data); - }); - } - }, - /** - * 查询当前点击的单元格的对齐状态, 如果当前已经选择了多个单元格, 则会返回所有单元格经过统一协调过后的状态 - * @see UE.UETable.getTableCellAlignState - */ - queryCommandValue: function(cmd) { - var activeMenuCell = getTableItemsByRange(this).cell; - - if (!activeMenuCell) { - activeMenuCell = getSelectedArr(this)[0]; - } - - if (!activeMenuCell) { - return null; - } else { - //获取同时选中的其他单元格 - var cells = UE.UETable.getUETable(activeMenuCell).selectedTds; - - !cells.length && (cells = activeMenuCell); - - return UE.UETable.getTableCellAlignState(cells); - } - } - }; - //表格对齐方式 - UE.commands["tablealignment"] = { - queryCommandState: function() { - if (browser.ie && browser.version < 8) { - return -1; - } - return getTableItemsByRange(this).table ? 0 : -1; - }, - execCommand: function(cmd, value) { - var me = this, - start = me.selection.getStart(), - table = start && domUtils.findParentByTagName(start, ["table"], true); - - if (table) { - table.setAttribute("align", value); - } - } - }; - - //表格属性 - UE.commands["edittable"] = { - queryCommandState: function() { - return getTableItemsByRange(this).table ? 0 : -1; - }, - execCommand: function(cmd, color) { - var rng = this.selection.getRange(), - table = domUtils.findParentByTagName(rng.startContainer, "table"); - if (table) { - var arr = domUtils - .getElementsByTagName(table, "td") - .concat( - domUtils.getElementsByTagName(table, "th"), - domUtils.getElementsByTagName(table, "caption") - ); - utils.each(arr, function(node) { - node.style.borderColor = color; - }); - } - } - }; - //单元格属性 - UE.commands["edittd"] = { - queryCommandState: function() { - return getTableItemsByRange(this).table ? 0 : -1; - }, - execCommand: function(cmd, bkColor) { - var me = this, - ut = getUETableBySelected(me); - - if (!ut) { - var start = me.selection.getStart(), - cell = - start && - domUtils.findParentByTagName(start, ["td", "th", "caption"], true); - if (cell) { - cell.style.backgroundColor = bkColor; - } - } else { - utils.each(ut.selectedTds, function(cell) { - cell.style.backgroundColor = bkColor; - }); - } - } - }; - - UE.commands["settablebackground"] = { - queryCommandState: function() { - return getSelectedArr(this).length > 1 ? 0 : -1; - }, - execCommand: function(cmd, value) { - var cells, ut; - cells = getSelectedArr(this); - ut = getUETable(cells[0]); - ut.setBackground(cells, value); - } - }; - - UE.commands["cleartablebackground"] = { - queryCommandState: function() { - var cells = getSelectedArr(this); - if (!cells.length) return -1; - for (var i = 0, cell; (cell = cells[i++]); ) { - if (cell.style.backgroundColor !== "") return 0; - } - return -1; - }, - execCommand: function() { - var cells = getSelectedArr(this), - ut = getUETable(cells[0]); - ut.removeBackground(cells); - } - }; - - UE.commands["interlacetable"] = UE.commands["uninterlacetable"] = { - queryCommandState: function(cmd) { - var table = getTableItemsByRange(this).table; - if (!table) return -1; - var interlaced = table.getAttribute("interlaced"); - if (cmd == "interlacetable") { - //TODO 待定 - //是否需要待定,如果设置,则命令只能单次执行成功,但反射具备toggle效果;否则可以覆盖前次命令,但反射将不存在toggle效果 - return interlaced === "enabled" ? -1 : 0; - } else { - return !interlaced || interlaced === "disabled" ? -1 : 0; - } - }, - execCommand: function(cmd, classList) { - var table = getTableItemsByRange(this).table; - if (cmd == "interlacetable") { - table.setAttribute("interlaced", "enabled"); - this.fireEvent("interlacetable", table, classList); - } else { - table.setAttribute("interlaced", "disabled"); - this.fireEvent("uninterlacetable", table); - } - } - }; - UE.commands["setbordervisible"] = { - queryCommandState: function(cmd) { - var table = getTableItemsByRange(this).table; - if (!table) return -1; - return 0; - }, - execCommand: function() { - var table = getTableItemsByRange(this).table; - utils.each(domUtils.getElementsByTagName(table, "td"), function(td) { - td.style.borderWidth = "1px"; - td.style.borderStyle = "solid"; - }); - } - }; - function resetTdWidth(table, editor) { - var tds = domUtils.getElementsByTagName(table, "td th"); - utils.each(tds, function(td) { - td.removeAttribute("width"); - }); - table.setAttribute( - "width", - getTableWidth(editor, true, getDefaultValue(editor, table)) - ); - var tdsWidths = []; - setTimeout(function() { - utils.each(tds, function(td) { - td.colSpan == 1 && tdsWidths.push(td.offsetWidth); - }); - utils.each(tds, function(td, i) { - td.colSpan == 1 && td.setAttribute("width", tdsWidths[i] + ""); - }); - }, 0); - } - - function getTableWidth(editor, needIEHack, defaultValue) { - var body = editor.body; - return ( - body.offsetWidth - - (needIEHack - ? parseInt(domUtils.getComputedStyle(body, "margin-left"), 10) * 2 - : 0) - - defaultValue.tableBorder * 2 - - (editor.options.offsetWidth || 0) - ); - } - - function getSelectedArr(editor) { - var cell = getTableItemsByRange(editor).cell; - if (cell) { - var ut = getUETable(cell); - return ut.selectedTds.length ? ut.selectedTds : [cell]; - } else { - return []; - } - } -})(); - - -// plugins/table.action.js -/** - * Created with JetBrains PhpStorm. - * User: taoqili - * Date: 12-10-12 - * Time: 上午10:05 - * To change this template use File | Settings | File Templates. - */ -UE.plugins["table"] = function() { - var me = this, - tabTimer = null, - //拖动计时器 - tableDragTimer = null, - //双击计时器 - tableResizeTimer = null, - //单元格最小宽度 - cellMinWidth = 5, - isInResizeBuffer = false, - //单元格边框大小 - cellBorderWidth = 5, - //鼠标偏移距离 - offsetOfTableCell = 10, - //记录在有限时间内的点击状态, 共有3个取值, 0, 1, 2。 0代表未初始化, 1代表单击了1次,2代表2次 - singleClickState = 0, - userActionStatus = null, - //双击允许的时间范围 - dblclickTime = 360, - UT = UE.UETable, - getUETable = function(tdOrTable) { - return UT.getUETable(tdOrTable); - }, - getUETableBySelected = function(editor) { - return UT.getUETableBySelected(editor); - }, - getDefaultValue = function(editor, table) { - return UT.getDefaultValue(editor, table); - }, - removeSelectedClass = function(cells) { - return UT.removeSelectedClass(cells); - }; - - function showError(e) { - // throw e; - } - me.ready(function() { - var me = this; - var orgGetText = me.selection.getText; - me.selection.getText = function() { - var table = getUETableBySelected(me); - if (table) { - var str = ""; - utils.each(table.selectedTds, function(td) { - str += td[browser.ie ? "innerText" : "textContent"]; - }); - return str; - } else { - return orgGetText.call(me.selection); - } - }; - }); - - //处理拖动及框选相关方法 - var startTd = null, //鼠标按下时的锚点td - currentTd = null, //当前鼠标经过时的td - onDrag = "", //指示当前拖动状态,其值可为"","h","v" ,分别表示未拖动状态,横向拖动状态,纵向拖动状态,用于鼠标移动过程中的判断 - onBorder = false, //检测鼠标按下时是否处在单元格边缘位置 - dragButton = null, - dragOver = false, - dragLine = null, //模拟的拖动线 - dragTd = null; //发生拖动的目标td - - var mousedown = false, - //todo 判断混乱模式 - needIEHack = true; - - me.setOpt({ - maxColNum: 20, - maxRowNum: 100, - defaultCols: 5, - defaultRows: 5, - tdvalign: "top", - cursorpath: me.options.UEDITOR_HOME_URL + "themes/" + me.options.theme + "/images/cursor_", - tableDragable: false, - classList: [ - "ue-table-interlace-color-single", - "ue-table-interlace-color-double" - ] - }); - me.getUETable = getUETable; - var commands = { - deletetable: 1, - inserttable: 1, - cellvalign: 1, - insertcaption: 1, - deletecaption: 1, - inserttitle: 1, - deletetitle: 1, - mergeright: 1, - mergedown: 1, - mergecells: 1, - insertrow: 1, - insertrownext: 1, - deleterow: 1, - insertcol: 1, - insertcolnext: 1, - deletecol: 1, - splittocells: 1, - splittorows: 1, - splittocols: 1, - adaptbytext: 1, - adaptbywindow: 1, - adaptbycustomer: 1, - insertparagraph: 1, - insertparagraphbeforetable: 1, - averagedistributecol: 1, - averagedistributerow: 1 - }; - me.ready(function() { - utils.cssRule( - "table", - //选中的td上的样式 - ".selectTdClass{background-color:#edf5fa !important}" + - "table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}" + - //插入的表格的默认样式 - "table{margin-bottom:10px;border-collapse:collapse;display:table;}" + - "td,th{padding: 5px 10px;border: 1px solid #DDD;}" + - "caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}" + - "th{border-top:1px solid #BBB;background-color:#F7F7F7;}" + - "table tr.firstRow th{border-top-width:2px;}" + - ".ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }" + - "td p{margin:0;padding:0;}", - me.document - ); - - var tableCopyList, isFullCol, isFullRow; - //注册del/backspace事件 - me.addListener("keydown", function(cmd, evt) { - var me = this; - var keyCode = evt.keyCode || evt.which; - - if (keyCode == 8) { - var ut = getUETableBySelected(me); - if (ut && ut.selectedTds.length) { - if (ut.isFullCol()) { - me.execCommand("deletecol"); - } else if (ut.isFullRow()) { - me.execCommand("deleterow"); - } else { - me.fireEvent("delcells"); - } - domUtils.preventDefault(evt); - } - - var caption = domUtils.findParentByTagName( - me.selection.getStart(), - "caption", - true - ), - range = me.selection.getRange(); - if (range.collapsed && caption && isEmptyBlock(caption)) { - me.fireEvent("saveScene"); - var table = caption.parentNode; - domUtils.remove(caption); - if (table) { - range.setStart(table.rows[0].cells[0], 0).setCursor(false, true); - } - me.fireEvent("saveScene"); - } - } - - if (keyCode == 46) { - ut = getUETableBySelected(me); - if (ut) { - me.fireEvent("saveScene"); - for (var i = 0, ci; (ci = ut.selectedTds[i++]); ) { - domUtils.fillNode(me.document, ci); - } - me.fireEvent("saveScene"); - domUtils.preventDefault(evt); - } - } - if (keyCode == 13) { - var rng = me.selection.getRange(), - caption = domUtils.findParentByTagName( - rng.startContainer, - "caption", - true - ); - if (caption) { - var table = domUtils.findParentByTagName(caption, "table"); - if (!rng.collapsed) { - rng.deleteContents(); - me.fireEvent("saveScene"); - } else { - if (caption) { - rng.setStart(table.rows[0].cells[0], 0).setCursor(false, true); - } - } - domUtils.preventDefault(evt); - return; - } - if (rng.collapsed) { - var table = domUtils.findParentByTagName(rng.startContainer, "table"); - if (table) { - var cell = table.rows[0].cells[0], - start = domUtils.findParentByTagName( - me.selection.getStart(), - ["td", "th"], - true - ), - preNode = table.previousSibling; - if ( - cell === start && - (!preNode || - (preNode.nodeType == 1 && preNode.tagName == "TABLE")) && - domUtils.isStartInblock(rng) - ) { - var first = domUtils.findParent( - me.selection.getStart(), - function(n) { - return domUtils.isBlockElm(n); - }, - true - ); - if ( - first && - (/t(h|d)/i.test(first.tagName) || first === start.firstChild) - ) { - me.execCommand("insertparagraphbeforetable"); - domUtils.preventDefault(evt); - } - } - } - } - } - - if ((evt.ctrlKey || evt.metaKey) && evt.keyCode == "67") { - tableCopyList = null; - var ut = getUETableBySelected(me); - if (ut) { - var tds = ut.selectedTds; - isFullCol = ut.isFullCol(); - isFullRow = ut.isFullRow(); - tableCopyList = [[ut.cloneCell(tds[0], null, true)]]; - for (var i = 1, ci; (ci = tds[i]); i++) { - if (ci.parentNode !== tds[i - 1].parentNode) { - tableCopyList.push([ut.cloneCell(ci, null, true)]); - } else { - tableCopyList[tableCopyList.length - 1].push( - ut.cloneCell(ci, null, true) - ); - } - } - } - } - }); - me.addListener("tablehasdeleted", function() { - toggleDraggableState(this, false, "", null); - if (dragButton) domUtils.remove(dragButton); - }); - - me.addListener("beforepaste", function(cmd, html) { - var me = this; - var rng = me.selection.getRange(); - if (domUtils.findParentByTagName(rng.startContainer, "caption", true)) { - var div = me.document.createElement("div"); - div.innerHTML = html.html; - //trace:3729 - html.html = div[browser.ie9below ? "innerText" : "textContent"]; - return; - } - var table = getUETableBySelected(me); - if (tableCopyList) { - me.fireEvent("saveScene"); - var rng = me.selection.getRange(); - var td = domUtils.findParentByTagName( - rng.startContainer, - ["td", "th"], - true - ), - tmpNode, - preNode; - if (td) { - var ut = getUETable(td); - if (isFullRow) { - var rowIndex = ut.getCellInfo(td).rowIndex; - if (td.tagName == "TH") { - rowIndex++; - } - for (var i = 0, ci; (ci = tableCopyList[i++]); ) { - var tr = ut.insertRow(rowIndex++, "td"); - for (var j = 0, cj; (cj = ci[j]); j++) { - var cell = tr.cells[j]; - if (!cell) { - cell = tr.insertCell(j); - } - cell.innerHTML = cj.innerHTML; - cj.getAttribute("width") && - cell.setAttribute("width", cj.getAttribute("width")); - cj.getAttribute("vAlign") && - cell.setAttribute("vAlign", cj.getAttribute("vAlign")); - cj.getAttribute("align") && - cell.setAttribute("align", cj.getAttribute("align")); - cj.style.cssText && (cell.style.cssText = cj.style.cssText); - } - for (var j = 0, cj; (cj = tr.cells[j]); j++) { - if (!ci[j]) break; - cj.innerHTML = ci[j].innerHTML; - ci[j].getAttribute("width") && - cj.setAttribute("width", ci[j].getAttribute("width")); - ci[j].getAttribute("vAlign") && - cj.setAttribute("vAlign", ci[j].getAttribute("vAlign")); - ci[j].getAttribute("align") && - cj.setAttribute("align", ci[j].getAttribute("align")); - ci[j].style.cssText && (cj.style.cssText = ci[j].style.cssText); - } - } - } else { - if (isFullCol) { - cellInfo = ut.getCellInfo(td); - var maxColNum = 0; - for (var j = 0, ci = tableCopyList[0], cj; (cj = ci[j++]); ) { - maxColNum += cj.colSpan || 1; - } - me.__hasEnterExecCommand = true; - for (i = 0; i < maxColNum; i++) { - me.execCommand("insertcol"); - } - me.__hasEnterExecCommand = false; - td = ut.table.rows[0].cells[cellInfo.cellIndex]; - if (td.tagName == "TH") { - td = ut.table.rows[1].cells[cellInfo.cellIndex]; - } - } - for (var i = 0, ci; (ci = tableCopyList[i++]); ) { - tmpNode = td; - for (var j = 0, cj; (cj = ci[j++]); ) { - if (td) { - td.innerHTML = cj.innerHTML; - //todo 定制处理 - cj.getAttribute("width") && - td.setAttribute("width", cj.getAttribute("width")); - cj.getAttribute("vAlign") && - td.setAttribute("vAlign", cj.getAttribute("vAlign")); - cj.getAttribute("align") && - td.setAttribute("align", cj.getAttribute("align")); - cj.style.cssText && (td.style.cssText = cj.style.cssText); - preNode = td; - td = td.nextSibling; - } else { - var cloneTd = cj.cloneNode(true); - domUtils.removeAttributes(cloneTd, [ - "class", - "rowSpan", - "colSpan" - ]); - - preNode.parentNode.appendChild(cloneTd); - } - } - td = ut.getNextCell(tmpNode, true, true); - if (!tableCopyList[i]) break; - if (!td) { - var cellInfo = ut.getCellInfo(tmpNode); - ut.table.insertRow(ut.table.rows.length); - ut.update(); - td = ut.getVSideCell(tmpNode, true); - } - } - } - ut.update(); - } else { - table = me.document.createElement("table"); - for (var i = 0, ci; (ci = tableCopyList[i++]); ) { - var tr = table.insertRow(table.rows.length); - for (var j = 0, cj; (cj = ci[j++]); ) { - cloneTd = UT.cloneCell(cj, null, true); - domUtils.removeAttributes(cloneTd, ["class"]); - tr.appendChild(cloneTd); - } - if (j == 2 && cloneTd.rowSpan > 1) { - cloneTd.rowSpan = 1; - } - } - - var defaultValue = getDefaultValue(me), - width = - me.body.offsetWidth - - (needIEHack - ? parseInt( - domUtils.getComputedStyle(me.body, "margin-left"), - 10 - ) * 2 - : 0) - - defaultValue.tableBorder * 2 - - (me.options.offsetWidth || 0); - me.execCommand( - "insertHTML", - "" + - table.innerHTML - .replace(/>\s*<") - .replace(/\bth\b/gi, "td") + - "
                      " - ); - } - me.fireEvent("contentchange"); - me.fireEvent("saveScene"); - html.html = ""; - return true; - } else { - var div = me.document.createElement("div"), - tables; - div.innerHTML = html.html; - tables = div.getElementsByTagName("table"); - if (domUtils.findParentByTagName(me.selection.getStart(), "table")) { - utils.each(tables, function(t) { - domUtils.remove(t); - }); - if ( - domUtils.findParentByTagName( - me.selection.getStart(), - "caption", - true - ) - ) { - div.innerHTML = div[browser.ie ? "innerText" : "textContent"]; - } - } else { - utils.each(tables, function(table) { - removeStyleSize(table, true); - domUtils.removeAttributes(table, ["style", "border"]); - utils.each(domUtils.getElementsByTagName(table, "td"), function( - td - ) { - if (isEmptyBlock(td)) { - domUtils.fillNode(me.document, td); - } - removeStyleSize(td, true); - // domUtils.removeAttributes(td, ['style']) - }); - }); - } - html.html = div.innerHTML; - } - }); - - me.addListener("afterpaste", function() { - utils.each(domUtils.getElementsByTagName(me.body, "table"), function( - table - ) { - if (table.offsetWidth > me.body.offsetWidth) { - var defaultValue = getDefaultValue(me, table); - table.style.width = - me.body.offsetWidth - - (needIEHack - ? parseInt( - domUtils.getComputedStyle(me.body, "margin-left"), - 10 - ) * 2 - : 0) - - defaultValue.tableBorder * 2 - - (me.options.offsetWidth || 0) + - "px"; - } - }); - }); - me.addListener("blur", function() { - tableCopyList = null; - }); - var timer; - me.addListener("keydown", function() { - clearTimeout(timer); - timer = setTimeout(function() { - var rng = me.selection.getRange(), - cell = domUtils.findParentByTagName( - rng.startContainer, - ["th", "td"], - true - ); - if (cell) { - var table = cell.parentNode.parentNode.parentNode; - if (table.offsetWidth > table.getAttribute("width")) { - cell.style.wordBreak = "break-all"; - } - } - }, 100); - }); - me.addListener("selectionchange", function() { - toggleDraggableState(me, false, "", null); - }); - - //内容变化时触发索引更新 - //todo 可否考虑标记检测,如果不涉及表格的变化就不进行索引重建和更新 - me.addListener("contentchange", function() { - var me = this; - //尽可能排除一些不需要更新的状况 - hideDragLine(me); - if (getUETableBySelected(me)) return; - var rng = me.selection.getRange(); - var start = rng.startContainer; - start = domUtils.findParentByTagName(start, ["td", "th"], true); - utils.each(domUtils.getElementsByTagName(me.document, "table"), function( - table - ) { - if (me.fireEvent("excludetable", table) === true) return; - table.ueTable = new UT(table); - //trace:3742 - // utils.each(domUtils.getElementsByTagName(me.document, 'td'), function (td) { - // - // if (domUtils.isEmptyBlock(td) && td !== start) { - // domUtils.fillNode(me.document, td); - // if (browser.ie && browser.version == 6) { - // td.innerHTML = ' ' - // } - // } - // }); - // utils.each(domUtils.getElementsByTagName(me.document, 'th'), function (th) { - // if (domUtils.isEmptyBlock(th) && th !== start) { - // domUtils.fillNode(me.document, th); - // if (browser.ie && browser.version == 6) { - // th.innerHTML = ' ' - // } - // } - // }); - table.onmouseover = function() { - me.fireEvent("tablemouseover", table); - }; - table.onmousemove = function() { - me.fireEvent("tablemousemove", table); - me.options.tableDragable && toggleDragButton(true, this, me); - utils.defer(function() { - me.fireEvent("contentchange", 50); - }, true); - }; - table.onmouseout = function() { - me.fireEvent("tablemouseout", table); - toggleDraggableState(me, false, "", null); - hideDragLine(me); - }; - table.onclick = function(evt) { - evt = me.window.event || evt; - var target = getParentTdOrTh(evt.target || evt.srcElement); - if (!target) return; - var ut = getUETable(target), - table = ut.table, - cellInfo = ut.getCellInfo(target), - cellsRange, - rng = me.selection.getRange(); - // if ("topLeft" == inPosition(table, mouseCoords(evt))) { - // cellsRange = ut.getCellsRange(ut.table.rows[0].cells[0], ut.getLastCell()); - // ut.setSelected(cellsRange); - // return; - // } - // if ("bottomRight" == inPosition(table, mouseCoords(evt))) { - // - // return; - // } - if (inTableSide(table, target, evt, true)) { - var endTdCol = ut.getCell( - ut.indexTable[ut.rowsNum - 1][cellInfo.colIndex].rowIndex, - ut.indexTable[ut.rowsNum - 1][cellInfo.colIndex].cellIndex - ); - if (evt.shiftKey && ut.selectedTds.length) { - if (ut.selectedTds[0] !== endTdCol) { - cellsRange = ut.getCellsRange(ut.selectedTds[0], endTdCol); - ut.setSelected(cellsRange); - } else { - rng && rng.selectNodeContents(endTdCol).select(); - } - } else { - if (target !== endTdCol) { - cellsRange = ut.getCellsRange(target, endTdCol); - ut.setSelected(cellsRange); - } else { - rng && rng.selectNodeContents(endTdCol).select(); - } - } - return; - } - if (inTableSide(table, target, evt)) { - var endTdRow = ut.getCell( - ut.indexTable[cellInfo.rowIndex][ut.colsNum - 1].rowIndex, - ut.indexTable[cellInfo.rowIndex][ut.colsNum - 1].cellIndex - ); - if (evt.shiftKey && ut.selectedTds.length) { - if (ut.selectedTds[0] !== endTdRow) { - cellsRange = ut.getCellsRange(ut.selectedTds[0], endTdRow); - ut.setSelected(cellsRange); - } else { - rng && rng.selectNodeContents(endTdRow).select(); - } - } else { - if (target !== endTdRow) { - cellsRange = ut.getCellsRange(target, endTdRow); - ut.setSelected(cellsRange); - } else { - rng && rng.selectNodeContents(endTdRow).select(); - } - } - } - }; - }); - - switchBorderColor(me, true); - }); - - domUtils.on(me.document, "mousemove", mouseMoveEvent); - - domUtils.on(me.document, "mouseout", function(evt) { - var target = evt.target || evt.srcElement; - if (target.tagName == "TABLE") { - toggleDraggableState(me, false, "", null); - } - }); - /** - * 表格隔行变色 - */ - me.addListener("interlacetable", function(type, table, classList) { - if (!table) return; - var me = this, - rows = table.rows, - len = rows.length, - getClass = function(list, index, repeat) { - return list[index] - ? list[index] - : repeat ? list[index % list.length] : ""; - }; - for (var i = 0; i < len; i++) { - rows[i].className = getClass( - classList || me.options.classList, - i, - true - ); - } - }); - me.addListener("uninterlacetable", function(type, table) { - if (!table) return; - var me = this, - rows = table.rows, - classList = me.options.classList, - len = rows.length; - for (var i = 0; i < len; i++) { - domUtils.removeClasses(rows[i], classList); - } - }); - - me.addListener("mousedown", mouseDownEvent); - me.addListener("mouseup", mouseUpEvent); - //拖动的时候触发mouseup - domUtils.on(me.body, "dragstart", function(evt) { - mouseUpEvent.call(me, "dragstart", evt); - }); - me.addOutputRule(function(root) { - utils.each(root.getNodesByTagName("div"), function(n) { - if (n.getAttr("id") == "ue_tableDragLine") { - n.parentNode.removeChild(n); - } - }); - }); - - var currentRowIndex = 0; - me.addListener("mousedown", function() { - currentRowIndex = 0; - }); - me.addListener("tabkeydown", function() { - var range = this.selection.getRange(), - common = range.getCommonAncestor(true, true), - table = domUtils.findParentByTagName(common, "table"); - if (table) { - if (domUtils.findParentByTagName(common, "caption", true)) { - var cell = domUtils.getElementsByTagName(table, "th td"); - if (cell && cell.length) { - range.setStart(cell[0], 0).setCursor(false, true); - } - } else { - var cell = domUtils.findParentByTagName(common, ["td", "th"], true), - ua = getUETable(cell); - currentRowIndex = cell.rowSpan > 1 - ? currentRowIndex - : ua.getCellInfo(cell).rowIndex; - var nextCell = ua.getTabNextCell(cell, currentRowIndex); - if (nextCell) { - if (isEmptyBlock(nextCell)) { - range.setStart(nextCell, 0).setCursor(false, true); - } else { - range.selectNodeContents(nextCell).select(); - } - } else { - me.fireEvent("saveScene"); - me.__hasEnterExecCommand = true; - this.execCommand("insertrownext"); - me.__hasEnterExecCommand = false; - range = this.selection.getRange(); - range - .setStart(table.rows[table.rows.length - 1].cells[0], 0) - .setCursor(); - me.fireEvent("saveScene"); - } - } - return true; - } - }); - browser.ie && - me.addListener("selectionchange", function() { - toggleDraggableState(this, false, "", null); - }); - me.addListener("keydown", function(type, evt) { - var me = this; - //处理在表格的最后一个输入tab产生新的表格 - var keyCode = evt.keyCode || evt.which; - if (keyCode == 8 || keyCode == 46) { - return; - } - var notCtrlKey = - !evt.ctrlKey && !evt.metaKey && !evt.shiftKey && !evt.altKey; - notCtrlKey && - removeSelectedClass(domUtils.getElementsByTagName(me.body, "td")); - var ut = getUETableBySelected(me); - if (!ut) return; - notCtrlKey && ut.clearSelected(); - }); - - me.addListener("beforegetcontent", function() { - switchBorderColor(this, false); - browser.ie && - utils.each(this.document.getElementsByTagName("caption"), function(ci) { - if (domUtils.isEmptyNode(ci)) { - ci.innerHTML = " "; - } - }); - }); - me.addListener("aftergetcontent", function() { - switchBorderColor(this, true); - }); - me.addListener("getAllHtml", function() { - removeSelectedClass(me.document.getElementsByTagName("td")); - }); - //修正全屏状态下插入的表格宽度在非全屏状态下撑开编辑器的情况 - me.addListener("fullscreenchanged", function(type, fullscreen) { - if (!fullscreen) { - var ratio = this.body.offsetWidth / document.body.offsetWidth, - tables = domUtils.getElementsByTagName(this.body, "table"); - utils.each(tables, function(table) { - if (table.offsetWidth < me.body.offsetWidth) return false; - var tds = domUtils.getElementsByTagName(table, "td"), - backWidths = []; - utils.each(tds, function(td) { - backWidths.push(td.offsetWidth); - }); - for (var i = 0, td; (td = tds[i]); i++) { - td.setAttribute("width", Math.floor(backWidths[i] * ratio)); - } - table.setAttribute( - "width", - Math.floor(getTableWidth(me, needIEHack, getDefaultValue(me))) - ); - }); - } - }); - - //重写execCommand命令,用于处理框选时的处理 - var oldExecCommand = me.execCommand; - me.execCommand = function(cmd, datatat) { - var me = this, - args = arguments; - - cmd = cmd.toLowerCase(); - var ut = getUETableBySelected(me), - tds, - range = new dom.Range(me.document), - cmdFun = me.commands[cmd] || UE.commands[cmd], - result; - if (!cmdFun) return; - if ( - ut && - !commands[cmd] && - !cmdFun.notNeedUndo && - !me.__hasEnterExecCommand - ) { - me.__hasEnterExecCommand = true; - me.fireEvent("beforeexeccommand", cmd); - tds = ut.selectedTds; - var lastState = -2, - lastValue = -2, - value, - state; - for (var i = 0, td; (td = tds[i]); i++) { - if (isEmptyBlock(td)) { - range.setStart(td, 0).setCursor(false, true); - } else { - range.selectNode(td).select(true); - } - state = me.queryCommandState(cmd); - value = me.queryCommandValue(cmd); - if (state != -1) { - if (lastState !== state || lastValue !== value) { - me._ignoreContentChange = true; - result = oldExecCommand.apply(me, arguments); - me._ignoreContentChange = false; - } - lastState = me.queryCommandState(cmd); - lastValue = me.queryCommandValue(cmd); - if (domUtils.isEmptyBlock(td)) { - domUtils.fillNode(me.document, td); - } - } - } - range.setStart(tds[0], 0).shrinkBoundary(true).setCursor(false, true); - me.fireEvent("contentchange"); - me.fireEvent("afterexeccommand", cmd); - me.__hasEnterExecCommand = false; - me._selectionChange(); - } else { - result = oldExecCommand.apply(me, arguments); - } - return result; - }; - }); - /** - * 删除obj的宽高style,改成属性宽高 - * @param obj - * @param replaceToProperty - */ - function removeStyleSize(obj, replaceToProperty) { - removeStyle(obj, "width", true); - removeStyle(obj, "height", true); - } - - function removeStyle(obj, styleName, replaceToProperty) { - if (obj.style[styleName]) { - replaceToProperty && - obj.setAttribute(styleName, parseInt(obj.style[styleName], 10)); - obj.style[styleName] = ""; - } - } - - function getParentTdOrTh(ele) { - if (ele.tagName == "TD" || ele.tagName == "TH") return ele; - var td; - if ( - (td = - domUtils.findParentByTagName(ele, "td", true) || - domUtils.findParentByTagName(ele, "th", true)) - ) - return td; - return null; - } - - function isEmptyBlock(node) { - var reg = new RegExp(domUtils.fillChar, "g"); - if ( - node[browser.ie ? "innerText" : "textContent"] - .replace(/^\s*$/, "") - .replace(reg, "").length > 0 - ) { - return 0; - } - for (var n in dtd.$isNotEmpty) { - if (node.getElementsByTagName(n).length) { - return 0; - } - } - return 1; - } - - function mouseCoords(evt) { - if (evt.pageX || evt.pageY) { - return { x: evt.pageX, y: evt.pageY }; - } - return { - x: - evt.clientX + me.document.body.scrollLeft - me.document.body.clientLeft, - y: evt.clientY + me.document.body.scrollTop - me.document.body.clientTop - }; - } - - function mouseMoveEvent(evt) { - if (isEditorDisabled()) { - return; - } - - try { - //普通状态下鼠标移动 - var target = getParentTdOrTh(evt.target || evt.srcElement), - pos; - - //区分用户的行为是拖动还是双击 - if (isInResizeBuffer) { - me.body.style.webkitUserSelect = "none"; - - if ( - Math.abs(userActionStatus.x - evt.clientX) > offsetOfTableCell || - Math.abs(userActionStatus.y - evt.clientY) > offsetOfTableCell - ) { - clearTableDragTimer(); - isInResizeBuffer = false; - singleClickState = 0; - //drag action - tableBorderDrag(evt); - } - } - - //修改单元格大小时的鼠标移动 - if (onDrag && dragTd) { - singleClickState = 0; - me.body.style.webkitUserSelect = "none"; - me.selection.getNative()[ - browser.ie9below ? "empty" : "removeAllRanges" - ](); - pos = mouseCoords(evt); - toggleDraggableState(me, true, onDrag, pos, target); - if (onDrag == "h") { - dragLine.style.left = getPermissionX(dragTd, evt) + "px"; - } else if (onDrag == "v") { - dragLine.style.top = getPermissionY(dragTd, evt) + "px"; - } - return; - } - //当鼠标处于table上时,修改移动过程中的光标状态 - if (target) { - //针对使用table作为容器的组件不触发拖拽效果 - if (me.fireEvent("excludetable", target) === true) return; - pos = mouseCoords(evt); - var state = getRelation(target, pos), - table = domUtils.findParentByTagName(target, "table", true); - - if (inTableSide(table, target, evt, true)) { - if (me.fireEvent("excludetable", table) === true) return; - me.body.style.cursor = - "url(" + me.options.cursorpath + "h.png),pointer"; - } else if (inTableSide(table, target, evt)) { - if (me.fireEvent("excludetable", table) === true) return; - me.body.style.cursor = - "url(" + me.options.cursorpath + "v.png),pointer"; - } else { - me.body.style.cursor = "text"; - var curCell = target; - if (/\d/.test(state)) { - state = state.replace(/\d/, ""); - target = getUETable(target).getPreviewCell(target, state == "v"); - } - //位于第一行的顶部或者第一列的左边时不可拖动 - toggleDraggableState( - me, - target ? !!state : false, - target ? state : "", - pos, - target - ); - } - } else { - toggleDragButton(false, table, me); - } - } catch (e) { - showError(e); - } - } - - var dragButtonTimer; - - function toggleDragButton(show, table, editor) { - if (!show) { - if (dragOver) return; - dragButtonTimer = setTimeout(function() { - !dragOver && - dragButton && - dragButton.parentNode && - dragButton.parentNode.removeChild(dragButton); - }, 2000); - } else { - createDragButton(table, editor); - } - } - - function createDragButton(table, editor) { - var pos = domUtils.getXY(table), - doc = table.ownerDocument; - if (dragButton && dragButton.parentNode) return dragButton; - dragButton = doc.createElement("div"); - dragButton.contentEditable = false; - dragButton.innerHTML = ""; - dragButton.style.cssText = - "width:15px;height:15px;background-image:url(" + - editor.options.UEDITOR_HOME_URL + - "dialogs/table/dragicon.png);position: absolute;cursor:move;top:" + - (pos.y - 15) + - "px;left:" + - pos.x + - "px;"; - domUtils.unSelectable(dragButton); - dragButton.onmouseover = function(evt) { - dragOver = true; - }; - dragButton.onmouseout = function(evt) { - dragOver = false; - }; - domUtils.on(dragButton, "click", function(type, evt) { - doClick(evt, this); - }); - domUtils.on(dragButton, "dblclick", function(type, evt) { - doDblClick(evt); - }); - domUtils.on(dragButton, "dragstart", function(type, evt) { - domUtils.preventDefault(evt); - }); - var timer; - - function doClick(evt, button) { - // 部分浏览器下需要清理 - clearTimeout(timer); - timer = setTimeout(function() { - editor.fireEvent("tableClicked", table, button); - }, 300); - } - - function doDblClick(evt) { - clearTimeout(timer); - var ut = getUETable(table), - start = table.rows[0].cells[0], - end = ut.getLastCell(), - range = ut.getCellsRange(start, end); - editor.selection.getRange().setStart(start, 0).setCursor(false, true); - ut.setSelected(range); - } - - doc.body.appendChild(dragButton); - } - - // function inPosition(table, pos) { - // var tablePos = domUtils.getXY(table), - // width = table.offsetWidth, - // height = table.offsetHeight; - // if (pos.x - tablePos.x < 5 && pos.y - tablePos.y < 5) { - // return "topLeft"; - // } else if (tablePos.x + width - pos.x < 5 && tablePos.y + height - pos.y < 5) { - // return "bottomRight"; - // } - // } - - function inTableSide(table, cell, evt, top) { - var pos = mouseCoords(evt), - state = getRelation(cell, pos); - - if (top) { - var caption = table.getElementsByTagName("caption")[0], - capHeight = caption ? caption.offsetHeight : 0; - return state == "v1" && pos.y - domUtils.getXY(table).y - capHeight < 8; - } else { - return state == "h1" && pos.x - domUtils.getXY(table).x < 8; - } - } - - /** - * 获取拖动时允许的X轴坐标 - * @param dragTd - * @param evt - */ - function getPermissionX(dragTd, evt) { - var ut = getUETable(dragTd); - if (ut) { - var preTd = ut.getSameEndPosCells(dragTd, "x")[0], - nextTd = ut.getSameStartPosXCells(dragTd)[0], - mouseX = mouseCoords(evt).x, - left = - (preTd ? domUtils.getXY(preTd).x : domUtils.getXY(ut.table).x) + 20, - right = nextTd - ? domUtils.getXY(nextTd).x + nextTd.offsetWidth - 20 - : me.body.offsetWidth + 5 || - parseInt(domUtils.getComputedStyle(me.body, "width"), 10); - - left += cellMinWidth; - right -= cellMinWidth; - - return mouseX < left ? left : mouseX > right ? right : mouseX; - } - } - - /** - * 获取拖动时允许的Y轴坐标 - */ - function getPermissionY(dragTd, evt) { - try { - var top = domUtils.getXY(dragTd).y, - mousePosY = mouseCoords(evt).y; - return mousePosY < top ? top : mousePosY; - } catch (e) { - showError(e); - } - } - - /** - * 移动状态切换 - */ - function toggleDraggableState(editor, draggable, dir, mousePos, cell) { - try { - editor.body.style.cursor = dir == "h" - ? "col-resize" - : dir == "v" ? "row-resize" : "text"; - if (browser.ie) { - if (dir && !mousedown && !getUETableBySelected(editor)) { - getDragLine(editor, editor.document); - showDragLineAt(dir, cell); - } else { - hideDragLine(editor); - } - } - onBorder = draggable; - } catch (e) { - showError(e); - } - } - - /** - * 获取与UETable相关的resize line - * @param uetable UETable对象 - */ - function getResizeLineByUETable() { - var lineId = "_UETableResizeLine", - line = this.document.getElementById(lineId); - - if (!line) { - line = this.document.createElement("div"); - line.id = lineId; - line.contnetEditable = false; - line.setAttribute("unselectable", "on"); - - var styles = { - width: 2 * cellBorderWidth + 1 + "px", - position: "absolute", - "z-index": 100000, - cursor: "col-resize", - background: "red", - display: "none" - }; - - //切换状态 - line.onmouseout = function() { - this.style.display = "none"; - }; - - utils.extend(line.style, styles); - - this.document.body.appendChild(line); - } - - return line; - } - - /** - * 更新resize-line - */ - function updateResizeLine(cell, uetable) { - var line = getResizeLineByUETable.call(this), - table = uetable.table, - styles = { - top: domUtils.getXY(table).y + "px", - left: - domUtils.getXY(cell).x + cell.offsetWidth - cellBorderWidth + "px", - display: "block", - height: table.offsetHeight + "px" - }; - - utils.extend(line.style, styles); - } - - /** - * 显示resize-line - */ - function showResizeLine(cell) { - var uetable = getUETable(cell); - - updateResizeLine.call(this, cell, uetable); - } - - /** - * 获取鼠标与当前单元格的相对位置 - * @param ele - * @param mousePos - */ - function getRelation(ele, mousePos) { - var elePos = domUtils.getXY(ele); - - if (!elePos) { - return ""; - } - - if (elePos.x + ele.offsetWidth - mousePos.x < cellBorderWidth) { - return "h"; - } - if (mousePos.x - elePos.x < cellBorderWidth) { - return "h1"; - } - if (elePos.y + ele.offsetHeight - mousePos.y < cellBorderWidth) { - return "v"; - } - if (mousePos.y - elePos.y < cellBorderWidth) { - return "v1"; - } - return ""; - } - - function mouseDownEvent(type, evt) { - if (isEditorDisabled()) { - return; - } - - userActionStatus = { - x: evt.clientX, - y: evt.clientY - }; - - //右键菜单单独处理 - if (evt.button == 2) { - var ut = getUETableBySelected(me), - flag = false; - - if (ut) { - var td = getTargetTd(me, evt); - utils.each(ut.selectedTds, function(ti) { - if (ti === td) { - flag = true; - } - }); - if (!flag) { - removeSelectedClass(domUtils.getElementsByTagName(me.body, "th td")); - ut.clearSelected(); - } else { - td = ut.selectedTds[0]; - setTimeout(function() { - me.selection.getRange().setStart(td, 0).setCursor(false, true); - }, 0); - } - } - } else { - tableClickHander(evt); - } - } - - //清除表格的计时器 - function clearTableTimer() { - tabTimer && clearTimeout(tabTimer); - tabTimer = null; - } - - //双击收缩 - function tableDbclickHandler(evt) { - singleClickState = 0; - evt = evt || me.window.event; - var target = getParentTdOrTh(evt.target || evt.srcElement); - if (target) { - var h; - if ((h = getRelation(target, mouseCoords(evt)))) { - hideDragLine(me); - - if (h == "h1") { - h = "h"; - if ( - inTableSide( - domUtils.findParentByTagName(target, "table"), - target, - evt - ) - ) { - me.execCommand("adaptbywindow"); - } else { - target = getUETable(target).getPreviewCell(target); - if (target) { - var rng = me.selection.getRange(); - rng.selectNodeContents(target).setCursor(true, true); - } - } - } - if (h == "h") { - var ut = getUETable(target), - table = ut.table, - cells = getCellsByMoveBorder(target, table, true); - - cells = extractArray(cells, "left"); - - ut.width = ut.offsetWidth; - - var oldWidth = [], - newWidth = []; - - utils.each(cells, function(cell) { - oldWidth.push(cell.offsetWidth); - }); - - utils.each(cells, function(cell) { - cell.removeAttribute("width"); - }); - - window.setTimeout(function() { - //是否允许改变 - var changeable = true; - - utils.each(cells, function(cell, index) { - var width = cell.offsetWidth; - - if (width > oldWidth[index]) { - changeable = false; - return false; - } - - newWidth.push(width); - }); - - var change = changeable ? newWidth : oldWidth; - - utils.each(cells, function(cell, index) { - cell.width = change[index] - getTabcellSpace(); - }); - }, 0); - - // minWidth -= cellMinWidth; - // - // table.removeAttribute("width"); - // utils.each(cells, function (cell) { - // cell.style.width = ""; - // cell.width -= minWidth; - // }); - } - } - } - } - - function tableClickHander(evt) { - removeSelectedClass(domUtils.getElementsByTagName(me.body, "td th")); - //trace:3113 - //选中单元格,点击table外部,不会清掉table上挂的ueTable,会引起getUETableBySelected方法返回值 - utils.each(me.document.getElementsByTagName("table"), function(t) { - t.ueTable = null; - }); - startTd = getTargetTd(me, evt); - if (!startTd) return; - var table = domUtils.findParentByTagName(startTd, "table", true); - ut = getUETable(table); - ut && ut.clearSelected(); - - //判断当前鼠标状态 - if (!onBorder) { - me.document.body.style.webkitUserSelect = ""; - mousedown = true; - me.addListener("mouseover", mouseOverEvent); - } else { - //边框上的动作处理 - borderActionHandler(evt); - } - } - - //处理表格边框上的动作, 这里做延时处理,避免两种动作互相影响 - function borderActionHandler(evt) { - if (browser.ie) { - evt = reconstruct(evt); - } - - clearTableDragTimer(); - - //是否正在等待resize的缓冲中 - isInResizeBuffer = true; - - tableDragTimer = setTimeout(function() { - tableBorderDrag(evt); - }, dblclickTime); - } - - function extractArray(originArr, key) { - var result = [], - tmp = null; - - for (var i = 0, len = originArr.length; i < len; i++) { - tmp = originArr[i][key]; - - if (tmp) { - result.push(tmp); - } - } - - return result; - } - - function clearTableDragTimer() { - tableDragTimer && clearTimeout(tableDragTimer); - tableDragTimer = null; - } - - function reconstruct(obj) { - var attrs = [ - "pageX", - "pageY", - "clientX", - "clientY", - "srcElement", - "target" - ], - newObj = {}; - - if (obj) { - for (var i = 0, key, val; (key = attrs[i]); i++) { - val = obj[key]; - val && (newObj[key] = val); - } - } - - return newObj; - } - - //边框拖动 - function tableBorderDrag(evt) { - isInResizeBuffer = false; - - startTd = evt.target || evt.srcElement; - if (!startTd) return; - var state = getRelation(startTd, mouseCoords(evt)); - if (/\d/.test(state)) { - state = state.replace(/\d/, ""); - startTd = getUETable(startTd).getPreviewCell(startTd, state == "v"); - } - hideDragLine(me); - getDragLine(me, me.document); - me.fireEvent("saveScene"); - showDragLineAt(state, startTd); - mousedown = true; - //拖动开始 - onDrag = state; - dragTd = startTd; - } - - function mouseUpEvent(type, evt) { - if (isEditorDisabled()) { - return; - } - - clearTableDragTimer(); - - isInResizeBuffer = false; - - if (onBorder) { - singleClickState = ++singleClickState % 3; - - userActionStatus = { - x: evt.clientX, - y: evt.clientY - }; - - tableResizeTimer = setTimeout(function() { - singleClickState > 0 && singleClickState--; - }, dblclickTime); - - if (singleClickState === 2) { - singleClickState = 0; - tableDbclickHandler(evt); - return; - } - } - - if (evt.button == 2) return; - var me = this; - //清除表格上原生跨选问题 - var range = me.selection.getRange(), - start = domUtils.findParentByTagName(range.startContainer, "table", true), - end = domUtils.findParentByTagName(range.endContainer, "table", true); - - if (start || end) { - if (start === end) { - start = domUtils.findParentByTagName( - range.startContainer, - ["td", "th", "caption"], - true - ); - end = domUtils.findParentByTagName( - range.endContainer, - ["td", "th", "caption"], - true - ); - if (start !== end) { - me.selection.clearRange(); - } - } else { - me.selection.clearRange(); - } - } - mousedown = false; - me.document.body.style.webkitUserSelect = ""; - //拖拽状态下的mouseUP - if (onDrag && dragTd) { - me.selection.getNative()[ - browser.ie9below ? "empty" : "removeAllRanges" - ](); - - singleClickState = 0; - dragLine = me.document.getElementById("ue_tableDragLine"); - - // trace 3973 - if (dragLine) { - var dragTdPos = domUtils.getXY(dragTd), - dragLinePos = domUtils.getXY(dragLine); - - switch (onDrag) { - case "h": - changeColWidth(dragTd, dragLinePos.x - dragTdPos.x); - break; - case "v": - changeRowHeight( - dragTd, - dragLinePos.y - dragTdPos.y - dragTd.offsetHeight - ); - break; - default: - } - onDrag = ""; - dragTd = null; - - hideDragLine(me); - me.fireEvent("saveScene"); - return; - } - } - //正常状态下的mouseup - if (!startTd) { - var target = domUtils.findParentByTagName( - evt.target || evt.srcElement, - "td", - true - ); - if (!target) - target = domUtils.findParentByTagName( - evt.target || evt.srcElement, - "th", - true - ); - if (target && (target.tagName == "TD" || target.tagName == "TH")) { - if (me.fireEvent("excludetable", target) === true) return; - range = new dom.Range(me.document); - range.setStart(target, 0).setCursor(false, true); - } - } else { - var ut = getUETable(startTd), - cell = ut ? ut.selectedTds[0] : null; - if (cell) { - range = new dom.Range(me.document); - if (domUtils.isEmptyBlock(cell)) { - range.setStart(cell, 0).setCursor(false, true); - } else { - range - .selectNodeContents(cell) - .shrinkBoundary() - .setCursor(false, true); - } - } else { - range = me.selection.getRange().shrinkBoundary(); - if (!range.collapsed) { - var start = domUtils.findParentByTagName( - range.startContainer, - ["td", "th"], - true - ), - end = domUtils.findParentByTagName( - range.endContainer, - ["td", "th"], - true - ); - //在table里边的不能清除 - if ( - (start && !end) || - (!start && end) || - (start && end && start !== end) - ) { - range.setCursor(false, true); - } - } - } - startTd = null; - me.removeListener("mouseover", mouseOverEvent); - } - me._selectionChange(250, evt); - } - - function mouseOverEvent(type, evt) { - if (isEditorDisabled()) { - return; - } - - var me = this, - tar = evt.target || evt.srcElement; - currentTd = - domUtils.findParentByTagName(tar, "td", true) || - domUtils.findParentByTagName(tar, "th", true); - //需要判断两个TD是否位于同一个表格内 - if ( - startTd && - currentTd && - ((startTd.tagName == "TD" && currentTd.tagName == "TD") || - (startTd.tagName == "TH" && currentTd.tagName == "TH")) && - domUtils.findParentByTagName(startTd, "table") == - domUtils.findParentByTagName(currentTd, "table") - ) { - var ut = getUETable(currentTd); - if (startTd != currentTd) { - me.document.body.style.webkitUserSelect = "none"; - me.selection.getNative()[ - browser.ie9below ? "empty" : "removeAllRanges" - ](); - var range = ut.getCellsRange(startTd, currentTd); - ut.setSelected(range); - } else { - me.document.body.style.webkitUserSelect = ""; - ut.clearSelected(); - } - } - evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false); - } - - function setCellHeight(cell, height, backHeight) { - var lineHight = parseInt( - domUtils.getComputedStyle(cell, "line-height"), - 10 - ), - tmpHeight = backHeight + height; - height = tmpHeight < lineHight ? lineHight : tmpHeight; - if (cell.style.height) cell.style.height = ""; - cell.rowSpan == 1 - ? cell.setAttribute("height", height) - : cell.removeAttribute && cell.removeAttribute("height"); - } - - function getWidth(cell) { - if (!cell) return 0; - return parseInt(domUtils.getComputedStyle(cell, "width"), 10); - } - - function changeColWidth(cell, changeValue) { - var ut = getUETable(cell); - if (ut) { - //根据当前移动的边框获取相关的单元格 - var table = ut.table, - cells = getCellsByMoveBorder(cell, table); - - table.style.width = ""; - table.removeAttribute("width"); - - //修正改变量 - changeValue = correctChangeValue(changeValue, cell, cells); - - if (cell.nextSibling) { - var i = 0; - - utils.each(cells, function(cellGroup) { - cellGroup.left.width = +cellGroup.left.width + changeValue; - cellGroup.right && - (cellGroup.right.width = +cellGroup.right.width - changeValue); - }); - } else { - utils.each(cells, function(cellGroup) { - cellGroup.left.width -= -changeValue; - }); - } - } - } - - function isEditorDisabled() { - return me.body.contentEditable === "false"; - } - - function changeRowHeight(td, changeValue) { - if (Math.abs(changeValue) < 10) return; - var ut = getUETable(td); - if (ut) { - var cells = ut.getSameEndPosCells(td, "y"), - //备份需要连带变化的td的原始高度,否则后期无法获取正确的值 - backHeight = cells[0] ? cells[0].offsetHeight : 0; - for (var i = 0, cell; (cell = cells[i++]); ) { - setCellHeight(cell, changeValue, backHeight); - } - } - } - - /** - * 获取调整单元格大小的相关单元格 - * @isContainMergeCell 返回的结果中是否包含发生合并后的单元格 - */ - function getCellsByMoveBorder(cell, table, isContainMergeCell) { - if (!table) { - table = domUtils.findParentByTagName(cell, "table"); - } - - if (!table) { - return null; - } - - //获取到该单元格所在行的序列号 - var index = domUtils.getNodeIndex(cell), - temp = cell, - rows = table.rows, - colIndex = 0; - - while (temp) { - //获取到当前单元格在未发生单元格合并时的序列 - if (temp.nodeType === 1) { - colIndex += temp.colSpan || 1; - } - temp = temp.previousSibling; - } - - temp = null; - - //记录想关的单元格 - var borderCells = []; - - utils.each(rows, function(tabRow) { - var cells = tabRow.cells, - currIndex = 0; - - utils.each(cells, function(tabCell) { - currIndex += tabCell.colSpan || 1; - - if (currIndex === colIndex) { - borderCells.push({ - left: tabCell, - right: tabCell.nextSibling || null - }); - - return false; - } else if (currIndex > colIndex) { - if (isContainMergeCell) { - borderCells.push({ - left: tabCell - }); - } - - return false; - } - }); - }); - - return borderCells; - } - - /** - * 通过给定的单元格集合获取最小的单元格width - */ - function getMinWidthByTableCells(cells) { - var minWidth = Number.MAX_VALUE; - - for (var i = 0, curCell; (curCell = cells[i]); i++) { - minWidth = Math.min( - minWidth, - curCell.width || getTableCellWidth(curCell) - ); - } - - return minWidth; - } - - function correctChangeValue(changeValue, relatedCell, cells) { - //为单元格的paading预留空间 - changeValue -= getTabcellSpace(); - - if (changeValue < 0) { - return 0; - } - - changeValue -= getTableCellWidth(relatedCell); - - //确定方向 - var direction = changeValue < 0 ? "left" : "right"; - - changeValue = Math.abs(changeValue); - - //只关心非最后一个单元格就可以 - utils.each(cells, function(cellGroup) { - var curCell = cellGroup[direction]; - - //为单元格保留最小空间 - if (curCell) { - changeValue = Math.min( - changeValue, - getTableCellWidth(curCell) - cellMinWidth - ); - } - }); - - //修正越界 - changeValue = changeValue < 0 ? 0 : changeValue; - - return direction === "left" ? -changeValue : changeValue; - } - - function getTableCellWidth(cell) { - var width = 0, - //偏移纠正量 - offset = 0, - width = cell.offsetWidth - getTabcellSpace(); - - //最后一个节点纠正一下 - if (!cell.nextSibling) { - width -= getTableCellOffset(cell); - } - - width = width < 0 ? 0 : width; - - try { - cell.width = width; - } catch (e) {} - - return width; - } - - /** - * 获取单元格所在表格的最末单元格的偏移量 - */ - function getTableCellOffset(cell) { - tab = domUtils.findParentByTagName(cell, "table", false); - - if (tab.offsetVal === undefined) { - var prev = cell.previousSibling; - - if (prev) { - //最后一个单元格和前一个单元格的width diff结果 如果恰好为一个border width, 则条件成立 - tab.offsetVal = cell.offsetWidth - prev.offsetWidth === UT.borderWidth - ? UT.borderWidth - : 0; - } else { - tab.offsetVal = 0; - } - } - - return tab.offsetVal; - } - - function getTabcellSpace() { - if (UT.tabcellSpace === undefined) { - var cell = null, - tab = me.document.createElement("table"), - tbody = me.document.createElement("tbody"), - trow = me.document.createElement("tr"), - tabcell = me.document.createElement("td"), - mirror = null; - - tabcell.style.cssText = "border: 0;"; - tabcell.width = 1; - - trow.appendChild(tabcell); - trow.appendChild((mirror = tabcell.cloneNode(false))); - - tbody.appendChild(trow); - - tab.appendChild(tbody); - - tab.style.cssText = "visibility: hidden;"; - - me.body.appendChild(tab); - - UT.paddingSpace = tabcell.offsetWidth - 1; - - var tmpTabWidth = tab.offsetWidth; - - tabcell.style.cssText = ""; - mirror.style.cssText = ""; - - UT.borderWidth = (tab.offsetWidth - tmpTabWidth) / 3; - - UT.tabcellSpace = UT.paddingSpace + UT.borderWidth; - - me.body.removeChild(tab); - } - - getTabcellSpace = function() { - return UT.tabcellSpace; - }; - - return UT.tabcellSpace; - } - - function getDragLine(editor, doc) { - if (mousedown) return; - dragLine = editor.document.createElement("div"); - domUtils.setAttributes(dragLine, { - id: "ue_tableDragLine", - unselectable: "on", - contenteditable: false, - onresizestart: "return false", - ondragstart: "return false", - onselectstart: "return false", - style: - "background-color:blue;position:absolute;padding:0;margin:0;background-image:none;border:0px none;opacity:0;filter:alpha(opacity=0)" - }); - editor.body.appendChild(dragLine); - } - - function hideDragLine(editor) { - if (mousedown) return; - var line; - while ((line = editor.document.getElementById("ue_tableDragLine"))) { - domUtils.remove(line); - } - } - - /** - * 依据state(v|h)在cell位置显示横线 - * @param state - * @param cell - */ - function showDragLineAt(state, cell) { - if (!cell) return; - var table = domUtils.findParentByTagName(cell, "table"), - caption = table.getElementsByTagName("caption"), - width = table.offsetWidth, - height = - table.offsetHeight - (caption.length > 0 ? caption[0].offsetHeight : 0), - tablePos = domUtils.getXY(table), - cellPos = domUtils.getXY(cell), - css; - switch (state) { - case "h": - css = - "height:" + - height + - "px;top:" + - (tablePos.y + (caption.length > 0 ? caption[0].offsetHeight : 0)) + - "px;left:" + - (cellPos.x + cell.offsetWidth); - dragLine.style.cssText = - css + - "px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)"; - break; - case "v": - css = - "width:" + - width + - "px;left:" + - tablePos.x + - "px;top:" + - (cellPos.y + cell.offsetHeight); - //必须加上border:0和color:blue,否则低版ie不支持背景色显示 - dragLine.style.cssText = - css + - "px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)"; - break; - default: - } - } - - /** - * 当表格边框颜色为白色时设置为虚线,true为添加虚线 - * @param editor - * @param flag - */ - function switchBorderColor(editor, flag) { - var tableArr = domUtils.getElementsByTagName(editor.body, "table"), - color; - for (var i = 0, node; (node = tableArr[i++]); ) { - var td = domUtils.getElementsByTagName(node, "td"); - if (td[0]) { - if (flag) { - color = td[0].style.borderColor.replace(/\s/g, ""); - if (/(#ffffff)|(rgb\(255,255,255\))/gi.test(color)) - domUtils.addClass(node, "noBorderTable"); - } else { - domUtils.removeClasses(node, "noBorderTable"); - } - } - } - } - - function getTableWidth(editor, needIEHack, defaultValue) { - var body = editor.body; - return ( - body.offsetWidth - - (needIEHack - ? parseInt(domUtils.getComputedStyle(body, "margin-left"), 10) * 2 - : 0) - - defaultValue.tableBorder * 2 - - (editor.options.offsetWidth || 0) - ); - } - - /** - * 获取当前拖动的单元格 - */ - function getTargetTd(editor, evt) { - var target = domUtils.findParentByTagName( - evt.target || evt.srcElement, - ["td", "th"], - true - ), - dir = null; - - if (!target) { - return null; - } - - dir = getRelation(target, mouseCoords(evt)); - - //如果有前一个节点, 需要做一个修正, 否则可能会得到一个错误的td - - if (!target) { - return null; - } - - if (dir === "h1" && target.previousSibling) { - var position = domUtils.getXY(target), - cellWidth = target.offsetWidth; - - if (Math.abs(position.x + cellWidth - evt.clientX) > cellWidth / 3) { - target = target.previousSibling; - } - } else if (dir === "v1" && target.parentNode.previousSibling) { - var position = domUtils.getXY(target), - cellHeight = target.offsetHeight; - - if (Math.abs(position.y + cellHeight - evt.clientY) > cellHeight / 3) { - target = target.parentNode.previousSibling.firstChild; - } - } - - //排除了非td内部以及用于代码高亮部分的td - return target && !(editor.fireEvent("excludetable", target) === true) - ? target - : null; - } -}; - - -// plugins/table.sort.js -/** - * Created with JetBrains PhpStorm. - * User: Jinqn - * Date: 13-10-12 - * Time: 上午10:20 - * To change this template use File | Settings | File Templates. - */ - -UE.UETable.prototype.sortTable = function(sortByCellIndex, compareFn) { - var table = this.table, - rows = table.rows, - trArray = [], - flag = rows[0].cells[0].tagName === "TH", - lastRowIndex = 0; - if (this.selectedTds.length) { - var range = this.cellsRange, - len = range.endRowIndex + 1; - for (var i = range.beginRowIndex; i < len; i++) { - trArray[i] = rows[i]; - } - trArray.splice(0, range.beginRowIndex); - lastRowIndex = range.endRowIndex + 1 === this.rowsNum - ? 0 - : range.endRowIndex + 1; - } else { - for (var i = 0, len = rows.length; i < len; i++) { - trArray[i] = rows[i]; - } - } - - var Fn = { - reversecurrent: function(td1, td2) { - return 1; - }, - orderbyasc: function(td1, td2) { - var value1 = td1.innerText || td1.textContent, - value2 = td2.innerText || td2.textContent; - return value1.localeCompare(value2); - }, - reversebyasc: function(td1, td2) { - var value1 = td1.innerHTML, - value2 = td2.innerHTML; - return value2.localeCompare(value1); - }, - orderbynum: function(td1, td2) { - var value1 = td1[browser.ie ? "innerText" : "textContent"].match(/\d+/), - value2 = td2[browser.ie ? "innerText" : "textContent"].match(/\d+/); - if (value1) value1 = +value1[0]; - if (value2) value2 = +value2[0]; - return (value1 || 0) - (value2 || 0); - }, - reversebynum: function(td1, td2) { - var value1 = td1[browser.ie ? "innerText" : "textContent"].match(/\d+/), - value2 = td2[browser.ie ? "innerText" : "textContent"].match(/\d+/); - if (value1) value1 = +value1[0]; - if (value2) value2 = +value2[0]; - return (value2 || 0) - (value1 || 0); - } - }; - - //对表格设置排序的标记data-sort-type - table.setAttribute( - "data-sort-type", - compareFn && typeof compareFn === "string" && Fn[compareFn] ? compareFn : "" - ); - - //th不参与排序 - flag && trArray.splice(0, 1); - trArray = utils.sort(trArray, function(tr1, tr2) { - var result; - if (compareFn && typeof compareFn === "function") { - result = compareFn.call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } else if (compareFn && typeof compareFn === "number") { - result = 1; - } else if (compareFn && typeof compareFn === "string" && Fn[compareFn]) { - result = Fn[compareFn].call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } else { - result = Fn["orderbyasc"].call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } - return result; - }); - var fragment = table.ownerDocument.createDocumentFragment(); - for (var j = 0, len = trArray.length; j < len; j++) { - fragment.appendChild(trArray[j]); - } - var tbody = table.getElementsByTagName("tbody")[0]; - if (!lastRowIndex) { - tbody.appendChild(fragment); - } else { - tbody.insertBefore( - fragment, - rows[lastRowIndex - range.endRowIndex + range.beginRowIndex - 1] - ); - } -}; - -UE.plugins["tablesort"] = function() { - var me = this, - UT = UE.UETable, - getUETable = function(tdOrTable) { - return UT.getUETable(tdOrTable); - }, - getTableItemsByRange = function(editor) { - return UT.getTableItemsByRange(editor); - }; - - me.ready(function() { - //添加表格可排序的样式 - utils.cssRule( - "tablesort", - "table.sortEnabled tr.firstRow th,table.sortEnabled tr.firstRow td{padding-right:20px;background-repeat: no-repeat;background-position: center right;" + - " background-image:url(" + - me.options.themePath + - me.options.theme + - "/images/sortable.png);}", - me.document - ); - - //做单元格合并操作时,清除可排序标识 - me.addListener("afterexeccommand", function(type, cmd) { - if (cmd == "mergeright" || cmd == "mergedown" || cmd == "mergecells") { - this.execCommand("disablesort"); - } - }); - }); - - //表格排序 - UE.commands["sorttable"] = { - queryCommandState: function() { - var me = this, - tableItems = getTableItemsByRange(me); - if (!tableItems.cell) return -1; - var table = tableItems.table, - cells = table.getElementsByTagName("td"); - for (var i = 0, cell; (cell = cells[i++]); ) { - if (cell.rowSpan != 1 || cell.colSpan != 1) return -1; - } - return 0; - }, - execCommand: function(cmd, fn) { - var me = this, - range = me.selection.getRange(), - bk = range.createBookmark(true), - tableItems = getTableItemsByRange(me), - cell = tableItems.cell, - ut = getUETable(tableItems.table), - cellInfo = ut.getCellInfo(cell); - ut.sortTable(cellInfo.cellIndex, fn); - range.moveToBookmark(bk); - try { - range.select(); - } catch (e) {} - } - }; - - //设置表格可排序,清除表格可排序 - UE.commands["enablesort"] = UE.commands["disablesort"] = { - queryCommandState: function(cmd) { - var table = getTableItemsByRange(this).table; - if (table && cmd == "enablesort") { - var cells = domUtils.getElementsByTagName(table, "th td"); - for (var i = 0; i < cells.length; i++) { - if ( - cells[i].getAttribute("colspan") > 1 || - cells[i].getAttribute("rowspan") > 1 - ) - return -1; - } - } - - return !table - ? -1 - : (cmd == "enablesort") ^ - (table.getAttribute("data-sort") != "sortEnabled") - ? -1 - : 0; - }, - execCommand: function(cmd) { - var table = getTableItemsByRange(this).table; - table.setAttribute( - "data-sort", - cmd == "enablesort" ? "sortEnabled" : "sortDisabled" - ); - cmd == "enablesort" - ? domUtils.addClass(table, "sortEnabled") - : domUtils.removeClasses(table, "sortEnabled"); - } - }; -}; - - -// plugins/contextmenu.js -///import core -///commands 右键菜单 -///commandsName ContextMenu -///commandsTitle 右键菜单 -/** - * 右键菜单 - * @function - * @name baidu.editor.plugins.contextmenu - * @author zhanyi - */ - -UE.plugins["contextmenu"] = function() { - var me = this; - - me.setOpt("enableContextMenu", me.getOpt("enableContextMenu") || true); - - if (me.getOpt("enableContextMenu") === false) { - return; - } - var lang = me.getLang("contextMenu"), - menu, - items = me.options.contextMenu || [ - { label: lang["selectall"], cmdName: "selectall" }, - { - label: lang.cleardoc, - cmdName: "cleardoc", - exec: function() { - if (confirm(lang.confirmclear)) { - this.execCommand("cleardoc"); - } - } - }, - "-", - { - label: lang.unlink, - cmdName: "unlink" - }, - "-", - { - group: lang.paragraph, - icon: "justifyjustify", - subMenu: [ - { - label: lang.justifyleft, - cmdName: "justify", - value: "left" - }, - { - label: lang.justifyright, - cmdName: "justify", - value: "right" - }, - { - label: lang.justifycenter, - cmdName: "justify", - value: "center" - }, - { - label: lang.justifyjustify, - cmdName: "justify", - value: "justify" - } - ] - }, - "-", - { - group: lang.table, - icon: "table", - subMenu: [ - { - label: lang.inserttable, - cmdName: "inserttable" - }, - { - label: lang.deletetable, - cmdName: "deletetable" - }, - "-", - { - label: lang.deleterow, - cmdName: "deleterow" - }, - { - label: lang.deletecol, - cmdName: "deletecol" - }, - { - label: lang.insertcol, - cmdName: "insertcol" - }, - { - label: lang.insertcolnext, - cmdName: "insertcolnext" - }, - { - label: lang.insertrow, - cmdName: "insertrow" - }, - { - label: lang.insertrownext, - cmdName: "insertrownext" - }, - "-", - { - label: lang.insertcaption, - cmdName: "insertcaption" - }, - { - label: lang.deletecaption, - cmdName: "deletecaption" - }, - { - label: lang.inserttitle, - cmdName: "inserttitle" - }, - { - label: lang.deletetitle, - cmdName: "deletetitle" - }, - { - label: lang.inserttitlecol, - cmdName: "inserttitlecol" - }, - { - label: lang.deletetitlecol, - cmdName: "deletetitlecol" - }, - "-", - { - label: lang.mergecells, - cmdName: "mergecells" - }, - { - label: lang.mergeright, - cmdName: "mergeright" - }, - { - label: lang.mergedown, - cmdName: "mergedown" - }, - "-", - { - label: lang.splittorows, - cmdName: "splittorows" - }, - { - label: lang.splittocols, - cmdName: "splittocols" - }, - { - label: lang.splittocells, - cmdName: "splittocells" - }, - "-", - { - label: lang.averageDiseRow, - cmdName: "averagedistributerow" - }, - { - label: lang.averageDisCol, - cmdName: "averagedistributecol" - }, - "-", - { - label: lang.edittd, - cmdName: "edittd", - exec: function() { - if (UE.ui["edittd"]) { - new UE.ui["edittd"](this); - } - this.getDialog("edittd").open(); - } - }, - { - label: lang.edittable, - cmdName: "edittable", - exec: function() { - if (UE.ui["edittable"]) { - new UE.ui["edittable"](this); - } - this.getDialog("edittable").open(); - } - }, - { - label: lang.setbordervisible, - cmdName: "setbordervisible" - } - ] - }, - { - group: lang.tablesort, - icon: "tablesort", - subMenu: [ - { - label: lang.enablesort, - cmdName: "enablesort" - }, - { - label: lang.disablesort, - cmdName: "disablesort" - }, - "-", - { - label: lang.reversecurrent, - cmdName: "sorttable", - value: "reversecurrent" - }, - { - label: lang.orderbyasc, - cmdName: "sorttable", - value: "orderbyasc" - }, - { - label: lang.reversebyasc, - cmdName: "sorttable", - value: "reversebyasc" - }, - { - label: lang.orderbynum, - cmdName: "sorttable", - value: "orderbynum" - }, - { - label: lang.reversebynum, - cmdName: "sorttable", - value: "reversebynum" - } - ] - }, - { - group: lang.borderbk, - icon: "borderBack", - subMenu: [ - { - label: lang.setcolor, - cmdName: "interlacetable", - exec: function() { - this.execCommand("interlacetable"); - } - }, - { - label: lang.unsetcolor, - cmdName: "uninterlacetable", - exec: function() { - this.execCommand("uninterlacetable"); - } - }, - { - label: lang.setbackground, - cmdName: "settablebackground", - exec: function() { - this.execCommand("settablebackground", { - repeat: true, - colorList: ["#bbb", "#ccc"] - }); - } - }, - { - label: lang.unsetbackground, - cmdName: "cleartablebackground", - exec: function() { - this.execCommand("cleartablebackground"); - } - }, - { - label: lang.redandblue, - cmdName: "settablebackground", - exec: function() { - this.execCommand("settablebackground", { - repeat: true, - colorList: ["red", "blue"] - }); - } - }, - { - label: lang.threecolorgradient, - cmdName: "settablebackground", - exec: function() { - this.execCommand("settablebackground", { - repeat: true, - colorList: ["#aaa", "#bbb", "#ccc"] - }); - } - } - ] - }, - { - group: lang.aligntd, - icon: "aligntd", - subMenu: [ - { - cmdName: "cellalignment", - value: { align: "left", vAlign: "top" } - }, - { - cmdName: "cellalignment", - value: { align: "center", vAlign: "top" } - }, - { - cmdName: "cellalignment", - value: { align: "right", vAlign: "top" } - }, - { - cmdName: "cellalignment", - value: { align: "left", vAlign: "middle" } - }, - { - cmdName: "cellalignment", - value: { align: "center", vAlign: "middle" } - }, - { - cmdName: "cellalignment", - value: { align: "right", vAlign: "middle" } - }, - { - cmdName: "cellalignment", - value: { align: "left", vAlign: "bottom" } - }, - { - cmdName: "cellalignment", - value: { align: "center", vAlign: "bottom" } - }, - { - cmdName: "cellalignment", - value: { align: "right", vAlign: "bottom" } - } - ] - }, - { - group: lang.aligntable, - icon: "aligntable", - subMenu: [ - { - cmdName: "tablealignment", - className: "left", - label: lang.tableleft, - value: "left" - }, - { - cmdName: "tablealignment", - className: "center", - label: lang.tablecenter, - value: "center" - }, - { - cmdName: "tablealignment", - className: "right", - label: lang.tableright, - value: "right" - } - ] - }, - "-", - { - label: lang.insertparagraphbefore, - cmdName: "insertparagraph", - value: true - }, - { - label: lang.insertparagraphafter, - cmdName: "insertparagraph" - }, - { - label: lang["copy"], - cmdName: "copy" - }, - { - label: lang["paste"], - cmdName: "paste" - } - ]; - if (!items.length) { - return; - } - var uiUtils = UE.ui.uiUtils; - - me.addListener("contextmenu", function(type, evt) { - var offset = uiUtils.getViewportOffsetByEvent(evt); - me.fireEvent("beforeselectionchange"); - if (menu) { - menu.destroy(); - } - for (var i = 0, ti, contextItems = []; (ti = items[i]); i++) { - var last; - (function(item) { - if (item == "-") { - if ((last = contextItems[contextItems.length - 1]) && last !== "-") { - contextItems.push("-"); - } - } else if (item.hasOwnProperty("group")) { - for (var j = 0, cj, subMenu = []; (cj = item.subMenu[j]); j++) { - (function(subItem) { - if (subItem == "-") { - if ((last = subMenu[subMenu.length - 1]) && last !== "-") { - subMenu.push("-"); - } else { - subMenu.splice(subMenu.length - 1); - } - } else { - if ( - (me.commands[subItem.cmdName] || - UE.commands[subItem.cmdName] || - subItem.query) && - (subItem.query - ? subItem.query() - : me.queryCommandState(subItem.cmdName)) > -1 - ) { - subMenu.push({ - label: - subItem.label || - me.getLang( - "contextMenu." + - subItem.cmdName + - (subItem.value || "") - ) || - "", - className: - "edui-for-" + - subItem.cmdName + - (subItem.className - ? " edui-for-" + - subItem.cmdName + - "-" + - subItem.className - : ""), - onclick: subItem.exec - ? function() { - subItem.exec.call(me); - } - : function() { - me.execCommand(subItem.cmdName, subItem.value); - } - }); - } - } - })(cj); - } - if (subMenu.length) { - function getLabel() { - switch (item.icon) { - case "table": - return me.getLang("contextMenu.table"); - case "justifyjustify": - return me.getLang("contextMenu.paragraph"); - case "aligntd": - return me.getLang("contextMenu.aligntd"); - case "aligntable": - return me.getLang("contextMenu.aligntable"); - case "tablesort": - return lang.tablesort; - case "borderBack": - return lang.borderbk; - default: - return ""; - } - } - contextItems.push({ - //todo 修正成自动获取方式 - label: getLabel(), - className: "edui-for-" + item.icon, - subMenu: { - items: subMenu, - editor: me - } - }); - } - } else { - //有可能commmand没有加载右键不能出来,或者没有command也想能展示出来添加query方法 - if ( - (me.commands[item.cmdName] || - UE.commands[item.cmdName] || - item.query) && - (item.query - ? item.query.call(me) - : me.queryCommandState(item.cmdName)) > -1 - ) { - contextItems.push({ - label: item.label || me.getLang("contextMenu." + item.cmdName), - className: - "edui-for-" + - (item.icon ? item.icon : item.cmdName + (item.value || "")), - onclick: item.exec - ? function() { - item.exec.call(me); - } - : function() { - me.execCommand(item.cmdName, item.value); - } - }); - } - } - })(ti); - } - if (contextItems[contextItems.length - 1] == "-") { - contextItems.pop(); - } - - menu = new UE.ui.Menu({ - items: contextItems, - className: "edui-contextmenu", - editor: me - }); - menu.render(); - menu.showAt(offset); - - me.fireEvent("aftershowcontextmenu", menu); - - domUtils.preventDefault(evt); - if (browser.ie) { - var ieRange; - try { - ieRange = me.selection.getNative().createRange(); - } catch (e) { - return; - } - if (ieRange.item) { - var range = new dom.Range(me.document); - range.selectNode(ieRange.item(0)).select(true, true); - } - } - }); - - // 添加复制的flash按钮 - me.addListener("aftershowcontextmenu", function(type, menu) { - if (me.zeroclipboard) { - var items = menu.items; - for (var key in items) { - if (items[key].className == "edui-for-copy") { - me.zeroclipboard.clip(items[key].getDom()); - } - } - } - }); -}; - - -// plugins/shortcutmenu.js -///import core -///commands 弹出菜单 -// commandsName popupmenu -///commandsTitle 弹出菜单 -/** - * 弹出菜单 - * @function - * @name baidu.editor.plugins.popupmenu - * @author xuheng - */ - -UE.plugins["shortcutmenu"] = function() { - var me = this, - menu, - items = me.options.shortcutMenu || []; - - if (!items.length) { - return; - } - - me.addListener("contextmenu mouseup", function(type, e) { - var me = this, - customEvt = { - type: type, - target: e.target || e.srcElement, - screenX: e.screenX, - screenY: e.screenY, - clientX: e.clientX, - clientY: e.clientY - }; - - setTimeout(function() { - var rng = me.selection.getRange(); - if (rng.collapsed === false || type == "contextmenu") { - if (!menu) { - menu = new baidu.editor.ui.ShortCutMenu({ - editor: me, - items: items, - theme: me.options.theme, - className: "edui-shortcutmenu" - }); - - menu.render(); - me.fireEvent("afterrendershortcutmenu", menu); - } - - menu.show(customEvt, !!UE.plugins["contextmenu"]); - } - }); - - if (type == "contextmenu") { - domUtils.preventDefault(e); - if (browser.ie9below) { - var ieRange; - try { - ieRange = me.selection.getNative().createRange(); - } catch (e) { - return; - } - if (ieRange.item) { - var range = new dom.Range(me.document); - range.selectNode(ieRange.item(0)).select(true, true); - } - } - } - }); - - me.addListener("keydown", function(type) { - if (type == "keydown") { - menu && !menu.isHidden && menu.hide(); - } - }); -}; - - -// plugins/basestyle.js -/** - * B、I、sub、super命令支持 - * @file - * @since 1.2.6.1 - */ - -UE.plugins["basestyle"] = function() { - /** - * 字体加粗 - * @command bold - * @param { String } cmd 命令字符串 - * @remind 对已加粗的文本内容执行该命令, 将取消加粗 - * @method execCommand - * @example - * ```javascript - * //editor是编辑器实例 - * //对当前选中的文本内容执行加粗操作 - * //第一次执行, 文本内容加粗 - * editor.execCommand( 'bold' ); - * - * //第二次执行, 文本内容取消加粗 - * editor.execCommand( 'bold' ); - * ``` - */ - - /** - * 字体倾斜 - * @command italic - * @method execCommand - * @param { String } cmd 命令字符串 - * @remind 对已倾斜的文本内容执行该命令, 将取消倾斜 - * @example - * ```javascript - * //editor是编辑器实例 - * //对当前选中的文本内容执行斜体操作 - * //第一次操作, 文本内容将变成斜体 - * editor.execCommand( 'italic' ); - * - * //再次对同一文本内容执行, 则文本内容将恢复正常 - * editor.execCommand( 'italic' ); - * ``` - */ - - /** - * 下标文本,与“superscript”命令互斥 - * @command subscript - * @method execCommand - * @remind 把选中的文本内容切换成下标文本, 如果当前选中的文本已经是下标, 则该操作会把文本内容还原成正常文本 - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * //editor是编辑器实例 - * //对当前选中的文本内容执行下标操作 - * //第一次操作, 文本内容将变成下标文本 - * editor.execCommand( 'subscript' ); - * - * //再次对同一文本内容执行, 则文本内容将恢复正常 - * editor.execCommand( 'subscript' ); - * ``` - */ - - /** - * 上标文本,与“subscript”命令互斥 - * @command superscript - * @method execCommand - * @remind 把选中的文本内容切换成上标文本, 如果当前选中的文本已经是上标, 则该操作会把文本内容还原成正常文本 - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * //editor是编辑器实例 - * //对当前选中的文本内容执行上标操作 - * //第一次操作, 文本内容将变成上标文本 - * editor.execCommand( 'superscript' ); - * - * //再次对同一文本内容执行, 则文本内容将恢复正常 - * editor.execCommand( 'superscript' ); - * ``` - */ - var basestyles = { - bold: ["strong", "b"], - italic: ["em", "i"], - subscript: ["sub"], - superscript: ["sup"] - }, - getObj = function(editor, tagNames) { - return domUtils.filterNodeList( - editor.selection.getStartElementPath(), - tagNames - ); - }, - me = this; - //添加快捷键 - me.addshortcutkey({ - Bold: "ctrl+66", //^B - Italic: "ctrl+73", //^I - Underline: "ctrl+85" //^U - }); - me.addInputRule(function(root) { - utils.each(root.getNodesByTagName("b i"), function(node) { - switch (node.tagName) { - case "b": - node.tagName = "strong"; - break; - case "i": - node.tagName = "em"; - } - }); - }); - for (var style in basestyles) { - (function(cmd, tagNames) { - me.commands[cmd] = { - execCommand: function(cmdName) { - var range = me.selection.getRange(), - obj = getObj(this, tagNames); - if (range.collapsed) { - if (obj) { - var tmpText = me.document.createTextNode(""); - range.insertNode(tmpText).removeInlineStyle(tagNames); - range.setStartBefore(tmpText); - domUtils.remove(tmpText); - } else { - var tmpNode = range.document.createElement(tagNames[0]); - if (cmdName == "superscript" || cmdName == "subscript") { - tmpText = me.document.createTextNode(""); - range - .insertNode(tmpText) - .removeInlineStyle(["sub", "sup"]) - .setStartBefore(tmpText) - .collapse(true); - } - range.insertNode(tmpNode).setStart(tmpNode, 0); - } - range.collapse(true); - } else { - if (cmdName == "superscript" || cmdName == "subscript") { - if (!obj || obj.tagName.toLowerCase() != cmdName) { - range.removeInlineStyle(["sub", "sup"]); - } - } - obj - ? range.removeInlineStyle(tagNames) - : range.applyInlineStyle(tagNames[0]); - } - range.select(); - }, - queryCommandState: function() { - return getObj(this, tagNames) ? 1 : 0; - } - }; - })(style, basestyles[style]); - } -}; - - -// plugins/elementpath.js -/** - * 选取路径命令 - * @file - */ -UE.plugins["elementpath"] = function() { - var currentLevel, - tagNames, - me = this; - me.setOpt("elementPathEnabled", true); - if (!me.options.elementPathEnabled) { - return; - } - me.commands["elementpath"] = { - execCommand: function(cmdName, level) { - var start = tagNames[level], - range = me.selection.getRange(); - currentLevel = level * 1; - range.selectNode(start).select(); - }, - queryCommandValue: function() { - //产生一个副本,不能修改原来的startElementPath; - var parents = [].concat(this.selection.getStartElementPath()).reverse(), - names = []; - tagNames = parents; - for (var i = 0, ci; (ci = parents[i]); i++) { - if (ci.nodeType == 3) { - continue; - } - var name = ci.tagName.toLowerCase(); - if (name == "img" && ci.getAttribute("anchorname")) { - name = "anchor"; - } - names[i] = name; - if (currentLevel == i) { - currentLevel = -1; - break; - } - } - return names; - } - }; -}; - - -// plugins/formatmatch.js -/** - * 格式刷,只格式inline的 - * @file - * @since 1.2.6.1 - */ - -/** - * 格式刷 - * @command formatmatch - * @method execCommand - * @remind 该操作不能复制段落格式 - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * //editor是编辑器实例 - * //获取格式刷 - * editor.execCommand( 'formatmatch' ); - * ``` - */ -UE.plugins["formatmatch"] = function() { - var me = this, - list = [], - img, - flag = 0; - - me.addListener("reset", function() { - list = []; - flag = 0; - }); - - function addList(type, evt) { - if (browser.webkit) { - var target = evt.target.tagName == "IMG" ? evt.target : null; - } - - function addFormat(range) { - if (text) { - range.selectNode(text); - } - return range.applyInlineStyle(list[list.length - 1].tagName, null, list); - } - - me.undoManger && me.undoManger.save(); - - var range = me.selection.getRange(), - imgT = target || range.getClosedNode(); - if (img && imgT && imgT.tagName == "IMG") { - //trace:964 - - imgT.style.cssText += - ";float:" + - (img.style.cssFloat || img.style.styleFloat || "none") + - ";display:" + - (img.style.display || "inline"); - - img = null; - } else { - if (!img) { - var collapsed = range.collapsed; - if (collapsed) { - var text = me.document.createTextNode("match"); - range.insertNode(text).select(); - } - me.__hasEnterExecCommand = true; - //不能把block上的属性干掉 - //trace:1553 - var removeFormatAttributes = me.options.removeFormatAttributes; - me.options.removeFormatAttributes = ""; - me.execCommand("removeformat"); - me.options.removeFormatAttributes = removeFormatAttributes; - me.__hasEnterExecCommand = false; - //trace:969 - range = me.selection.getRange(); - if (list.length) { - addFormat(range); - } - if (text) { - range.setStartBefore(text).collapse(true); - } - range.select(); - text && domUtils.remove(text); - } - } - - me.undoManger && me.undoManger.save(); - me.removeListener("mouseup", addList); - flag = 0; - } - - me.commands["formatmatch"] = { - execCommand: function(cmdName) { - if (flag) { - flag = 0; - list = []; - me.removeListener("mouseup", addList); - return; - } - - var range = me.selection.getRange(); - img = range.getClosedNode(); - if (!img || img.tagName != "IMG") { - range.collapse(true).shrinkBoundary(); - var start = range.startContainer; - list = domUtils.findParents(start, true, function(node) { - return !domUtils.isBlockElm(node) && node.nodeType == 1; - }); - //a不能加入格式刷, 并且克隆节点 - for (var i = 0, ci; (ci = list[i]); i++) { - if (ci.tagName == "A") { - list.splice(i, 1); - break; - } - } - } - - me.addListener("mouseup", addList); - flag = 1; - }, - queryCommandState: function() { - return flag; - }, - notNeedUndo: 1 - }; -}; - - -// plugins/searchreplace.js -///import core -///commands 查找替换 -///commandsName SearchReplace -///commandsTitle 查询替换 -///commandsDialog dialogs\searchreplace -/** - * @description 查找替换 - * @author zhanyi - */ - -UE.plugin.register("searchreplace", function() { - var me = this; - - var _blockElm = { table: 1, tbody: 1, tr: 1, ol: 1, ul: 1 }; - - var lastRng = null; - - function getText(node) { - var text = node.nodeType == 3 - ? node.nodeValue - : node[browser.ie ? "innerText" : "textContent"]; - return text.replace(domUtils.fillChar, ""); - } - - function findTextInString(textContent, opt, currentIndex) { - var str = opt.searchStr; - - var reg = new RegExp(str, "g" + (opt.casesensitive ? "" : "i")), - match; - - if (opt.dir == -1) { - textContent = textContent.substr(0, currentIndex); - textContent = textContent.split("").reverse().join(""); - str = str.split("").reverse().join(""); - match = reg.exec(textContent); - if (match) { - return currentIndex - match.index - str.length; - } - } else { - textContent = textContent.substr(currentIndex); - match = reg.exec(textContent); - if (match) { - return match.index + currentIndex; - } - } - - return -1; - } - function findTextBlockElm(node, currentIndex, opt) { - var textContent, - index, - methodName = opt.all || opt.dir == 1 ? "getNextDomNode" : "getPreDomNode"; - if (domUtils.isBody(node)) { - node = node.firstChild; - } - var first = 1; - while (node) { - textContent = getText(node); - index = findTextInString(textContent, opt, currentIndex); - first = 0; - if (index != -1) { - return { - node: node, - index: index - }; - } - node = domUtils[methodName](node); - while (node && _blockElm[node.nodeName.toLowerCase()]) { - node = domUtils[methodName](node, true); - } - if (node) { - currentIndex = opt.dir == -1 ? getText(node).length : 0; - } - } - } - function findNTextInBlockElm(node, index, str) { - var currentIndex = 0, - currentNode = node.firstChild, - currentNodeLength = 0, - result; - while (currentNode) { - if (currentNode.nodeType == 3) { - currentNodeLength = getText(currentNode).replace( - /(^[\t\r\n]+)|([\t\r\n]+$)/, - "" - ).length; - currentIndex += currentNodeLength; - if (currentIndex >= index) { - return { - node: currentNode, - index: currentNodeLength - (currentIndex - index) - }; - } - } else if (!dtd.$empty[currentNode.tagName]) { - currentNodeLength = getText(currentNode).replace( - /(^[\t\r\n]+)|([\t\r\n]+$)/, - "" - ).length; - currentIndex += currentNodeLength; - if (currentIndex >= index) { - result = findNTextInBlockElm( - currentNode, - currentNodeLength - (currentIndex - index), - str - ); - if (result) { - return result; - } - } - } - currentNode = domUtils.getNextDomNode(currentNode); - } - } - - function searchReplace(me, opt) { - var rng = lastRng || me.selection.getRange(), - startBlockNode, - searchStr = opt.searchStr, - span = me.document.createElement("span"); - span.innerHTML = "$$ueditor_searchreplace_key$$"; - - rng.shrinkBoundary(true); - - //判断是不是第一次选中 - if (!rng.collapsed) { - rng.select(); - var rngText = me.selection.getText(); - if ( - new RegExp( - "^" + opt.searchStr + "$", - opt.casesensitive ? "" : "i" - ).test(rngText) - ) { - if (opt.replaceStr != undefined) { - replaceText(rng, opt.replaceStr); - rng.select(); - return true; - } else { - rng.collapse(opt.dir == -1); - } - } - } - - rng.insertNode(span); - rng.enlargeToBlockElm(true); - startBlockNode = rng.startContainer; - var currentIndex = getText(startBlockNode).indexOf( - "$$ueditor_searchreplace_key$$" - ); - rng.setStartBefore(span); - domUtils.remove(span); - var result = findTextBlockElm(startBlockNode, currentIndex, opt); - if (result) { - var rngStart = findNTextInBlockElm(result.node, result.index, searchStr); - var rngEnd = findNTextInBlockElm( - result.node, - result.index + searchStr.length, - searchStr - ); - rng - .setStart(rngStart.node, rngStart.index) - .setEnd(rngEnd.node, rngEnd.index); - - if (opt.replaceStr !== undefined) { - replaceText(rng, opt.replaceStr); - } - rng.select(); - return true; - } else { - rng.setCursor(); - } - } - function replaceText(rng, str) { - str = me.document.createTextNode(str); - rng.deleteContents().insertNode(str); - } - return { - commands: { - searchreplace: { - execCommand: function(cmdName, opt) { - utils.extend( - opt, - { - all: false, - casesensitive: false, - dir: 1 - }, - true - ); - var num = 0; - if (opt.all) { - lastRng = null; - var rng = me.selection.getRange(), - first = me.body.firstChild; - if (first && first.nodeType == 1) { - rng.setStart(first, 0); - rng.shrinkBoundary(true); - } else if (first.nodeType == 3) { - rng.setStartBefore(first); - } - rng.collapse(true).select(true); - if (opt.replaceStr !== undefined) { - me.fireEvent("saveScene"); - } - while (searchReplace(this, opt)) { - num++; - lastRng = me.selection.getRange(); - lastRng.collapse(opt.dir == -1); - } - if (num) { - me.fireEvent("saveScene"); - } - } else { - if (opt.replaceStr !== undefined) { - me.fireEvent("saveScene"); - } - if (searchReplace(this, opt)) { - num++; - lastRng = me.selection.getRange(); - lastRng.collapse(opt.dir == -1); - } - if (num) { - me.fireEvent("saveScene"); - } - } - - return num; - }, - notNeedUndo: 1 - } - }, - bindEvents: { - clearlastSearchResult: function() { - lastRng = null; - } - } - }; -}); - - -// plugins/customstyle.js -/** - * 自定义样式 - * @file - * @since 1.2.6.1 - */ - -/** - * 根据config配置文件里“customstyle”选项的值对匹配的标签执行样式替换。 - * @command customstyle - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand( 'customstyle' ); - * ``` - */ -UE.plugins["customstyle"] = function() { - var me = this; - me.setOpt({ - customstyle: [ - { - tag: "h1", - name: "tc", - style: - "font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;" - }, - { - tag: "h1", - name: "tl", - style: - "font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:left;margin:0 0 10px 0;" - }, - { - tag: "span", - name: "im", - style: - "font-size:16px;font-style:italic;font-weight:bold;line-height:18px;" - }, - { - tag: "span", - name: "hi", - style: - "font-size:16px;font-style:italic;font-weight:bold;color:rgb(51, 153, 204);line-height:18px;" - } - ] - }); - me.commands["customstyle"] = { - execCommand: function(cmdName, obj) { - var me = this, - tagName = obj.tag, - node = domUtils.findParent( - me.selection.getStart(), - function(node) { - return node.getAttribute("label"); - }, - true - ), - range, - bk, - tmpObj = {}; - for (var p in obj) { - if (obj[p] !== undefined) tmpObj[p] = obj[p]; - } - delete tmpObj.tag; - if (node && node.getAttribute("label") == obj.label) { - range = this.selection.getRange(); - bk = range.createBookmark(); - if (range.collapsed) { - //trace:1732 删掉自定义标签,要有p来回填站位 - if (dtd.$block[node.tagName]) { - var fillNode = me.document.createElement("p"); - domUtils.moveChild(node, fillNode); - node.parentNode.insertBefore(fillNode, node); - domUtils.remove(node); - } else { - domUtils.remove(node, true); - } - } else { - var common = domUtils.getCommonAncestor(bk.start, bk.end), - nodes = domUtils.getElementsByTagName(common, tagName); - if (new RegExp(tagName, "i").test(common.tagName)) { - nodes.push(common); - } - for (var i = 0, ni; (ni = nodes[i++]); ) { - if (ni.getAttribute("label") == obj.label) { - var ps = domUtils.getPosition(ni, bk.start), - pe = domUtils.getPosition(ni, bk.end); - if ( - (ps & domUtils.POSITION_FOLLOWING || - ps & domUtils.POSITION_CONTAINS) && - (pe & domUtils.POSITION_PRECEDING || - pe & domUtils.POSITION_CONTAINS) - ) - if (dtd.$block[tagName]) { - var fillNode = me.document.createElement("p"); - domUtils.moveChild(ni, fillNode); - ni.parentNode.insertBefore(fillNode, ni); - } - domUtils.remove(ni, true); - } - } - node = domUtils.findParent( - common, - function(node) { - return node.getAttribute("label") == obj.label; - }, - true - ); - if (node) { - domUtils.remove(node, true); - } - } - range.moveToBookmark(bk).select(); - } else { - if (dtd.$block[tagName]) { - this.execCommand("paragraph", tagName, tmpObj, "customstyle"); - range = me.selection.getRange(); - if (!range.collapsed) { - range.collapse(); - node = domUtils.findParent( - me.selection.getStart(), - function(node) { - return node.getAttribute("label") == obj.label; - }, - true - ); - var pNode = me.document.createElement("p"); - domUtils.insertAfter(node, pNode); - domUtils.fillNode(me.document, pNode); - range.setStart(pNode, 0).setCursor(); - } - } else { - range = me.selection.getRange(); - if (range.collapsed) { - node = me.document.createElement(tagName); - domUtils.setAttributes(node, tmpObj); - range.insertNode(node).setStart(node, 0).setCursor(); - - return; - } - - bk = range.createBookmark(); - range.applyInlineStyle(tagName, tmpObj).moveToBookmark(bk).select(); - } - } - }, - queryCommandValue: function() { - var parent = domUtils.filterNodeList( - this.selection.getStartElementPath(), - function(node) { - return node.getAttribute("label"); - } - ); - return parent ? parent.getAttribute("label") : ""; - } - }; - //当去掉customstyle是,如果是块元素,用p代替 - me.addListener("keyup", function(type, evt) { - var keyCode = evt.keyCode || evt.which; - - if (keyCode == 32 || keyCode == 13) { - var range = me.selection.getRange(); - if (range.collapsed) { - var node = domUtils.findParent( - me.selection.getStart(), - function(node) { - return node.getAttribute("label"); - }, - true - ); - if (node && dtd.$block[node.tagName] && domUtils.isEmptyNode(node)) { - var p = me.document.createElement("p"); - domUtils.insertAfter(node, p); - domUtils.fillNode(me.document, p); - domUtils.remove(node); - range.setStart(p, 0).setCursor(); - } - } - } - }); -}; - - -// plugins/catchremoteimage.js -///import core -///commands 远程图片抓取 -///commandsName catchRemoteImage,catchremoteimageenable -///commandsTitle 远程图片抓取 -/** - * 远程图片抓取,当开启本插件时所有不符合本地域名的图片都将被抓取成为本地服务器上的图片 - */ -UE.plugins["catchremoteimage"] = function() { - var me = this, - ajax = UE.ajax; - - /* 设置默认值 */ - if (me.options.catchRemoteImageEnable === false) return; - me.setOpt({ - catchRemoteImageEnable: false - }); - - me.addListener("afterpaste", function() { - me.fireEvent("catchRemoteImage"); - }); - - me.addListener("catchRemoteImage", function() { - var catcherLocalDomain = me.getOpt("catcherLocalDomain"), - catcherActionUrl = me.getActionUrl(me.getOpt("catcherActionName")), - catcherUrlPrefix = me.getOpt("catcherUrlPrefix"), - catcherFieldName = me.getOpt("catcherFieldName"); - - var remoteImages = [], - loadingIMG = me.options.themePath + me.options.theme + '/images/spacer.gif', - imgs = me.document.querySelectorAll('[style*="url"],img'), - test = function(src, urls) { - if (src.indexOf(location.host) != -1 || /(^\.)|(^\/)/.test(src)) { - return true; - } - if (urls) { - for (var j = 0, url; (url = urls[j++]); ) { - if (src.indexOf(url) !== -1) { - return true; - } - } - } - return false; - }; - - for (var i = 0, ci; (ci = imgs[i++]); ) { - if (ci.getAttribute("word_img")) { - continue; - } - if(ci.nodeName == "IMG"){ - var src = ci.getAttribute("_src") || ci.src || ""; - if (/^(https?|ftp):/i.test(src) && !test(src, catcherLocalDomain)) { - remoteImages.push(src); - // 添加上传时的uploading动画 - domUtils.setAttributes(ci, { - class: "loadingclass", - _src: src, - src: loadingIMG - }) - } - } else { - // 获取背景图片url - var backgroundImageurl = ci.style.cssText.replace(/.*\s?url\([\'\"]?/, '').replace(/[\'\"]?\).*/, ''); - if (/^(https?|ftp):/i.test(backgroundImageurl) && !test(backgroundImageurl, catcherLocalDomain)) { - remoteImages.push(backgroundImageurl); - ci.style.cssText = ci.style.cssText.replace(backgroundImageurl, loadingIMG); - domUtils.setAttributes(ci, { - "data-background": backgroundImageurl - }) - } - } - } - - if (remoteImages.length) { - catchremoteimage(remoteImages, { - //成功抓取 - success: function(r) { - try { - var info = r.state !== undefined - ? r - : eval("(" + r.responseText + ")"); - } catch (e) { - return; - } - - /* 获取源路径和新路径 */ - var i, - j, - ci, - cj, - oldSrc, - newSrc, - list = info.list; - - /* 抓取失败统计 */ - var catchFailList = []; - /* 抓取成功统计 */ - var catchSuccessList = []; - /* 抓取失败时显示的图片 */ - var failIMG = me.options.themePath + me.options.theme + '/images/img-cracked.png'; - - for (i = 0; ci = imgs[i++];) { - oldSrc = ci.getAttribute("_src") || ci.src || ""; - oldBgIMG = ci.getAttribute("data-background") || ""; - for (j = 0; cj = list[j++];) { - if (oldSrc == cj.source && cj.state == "SUCCESS") { - newSrc = catcherUrlPrefix + cj.url; - // 上传成功是删除uploading动画 - domUtils.removeClasses( ci, "loadingclass" ); - domUtils.setAttributes(ci, { - "src": newSrc, - "_src": newSrc, - "data-catchResult":"img_catchSuccess" // 添加catch成功标记 - }); - catchSuccessList.push(ci); - break; - } else if (oldSrc == cj.source && cj.state == "FAIL") { - // 替换成统一的失败图片 - domUtils.removeClasses( ci, "loadingclass" ); - domUtils.setAttributes(ci, { - "src": failIMG, - "_src": failIMG, - "data-catchResult":"img_catchFail" // 添加catch失败标记 - }); - catchFailList.push(ci); - break; - } else if (oldBgIMG == cj.source && cj.state == "SUCCESS") { - newBgIMG = catcherUrlPrefix + cj.url; - ci.style.cssText = ci.style.cssText.replace(loadingIMG, newBgIMG); - domUtils.removeAttributes(ci,"data-background"); - domUtils.setAttributes(ci, { - "data-catchResult":"img_catchSuccess" // 添加catch成功标记 - }); - catchSuccessList.push(ci); - break; - } else if (oldBgIMG == cj.source && cj.state == "FAIL"){ - ci.style.cssText = ci.style.cssText.replace(loadingIMG, failIMG); - domUtils.removeAttributes(ci,"data-background"); - domUtils.setAttributes(ci, { - "data-catchResult":"img_catchFail" // 添加catch失败标记 - }); - catchFailList.push(ci); - break; - } - } - - } - // 监听事件添加成功抓取和抓取失败的dom列表参数 - me.fireEvent('catchremotesuccess',catchSuccessList,catchFailList); - }, - //回调失败,本次请求超时 - error: function() { - me.fireEvent("catchremoteerror"); - } - }); - } - - function catchremoteimage(imgs, callbacks) { - var params = - utils.serializeParam(me.queryCommandValue("serverparam")) || "", - url = utils.formatUrl( - catcherActionUrl + - (catcherActionUrl.indexOf("?") == -1 ? "?" : "&") + - params - ), - isJsonp = utils.isCrossDomainUrl(url), - opt = { - method: "POST", - dataType: isJsonp ? "jsonp" : "", - timeout: 60000, //单位:毫秒,回调请求超时设置。目标用户如果网速不是很快的话此处建议设置一个较大的数值 - onsuccess: callbacks["success"], - onerror: callbacks["error"] - }; - opt[catcherFieldName] = imgs; - ajax.request(url, opt); - } - }); -}; - - -// plugins/snapscreen.js -/** - * 截屏插件,为UEditor提供插入支持 - * @file - * @since 1.4.2 - */ -UE.plugin.register("snapscreen", function() { - var me = this; - var snapplugin; - - function getLocation(url) { - var search, - a = document.createElement("a"), - params = utils.serializeParam(me.queryCommandValue("serverparam")) || ""; - - a.href = url; - if (browser.ie) { - a.href = a.href; - } - - search = a.search; - if (params) { - search = search + (search.indexOf("?") == -1 ? "?" : "&") + params; - search = search.replace(/[&]+/gi, "&"); - } - return { - port: a.port, - hostname: a.hostname, - path: a.pathname + search || +a.hash - }; - } - - return { - commands: { - /** - * 字体背景颜色 - * @command snapscreen - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand('snapscreen'); - * ``` - */ - snapscreen: { - execCommand: function(cmd) { - var url, local, res; - var lang = me.getLang("snapScreen_plugin"); - - if (!snapplugin) { - var container = me.container; - var doc = me.container.ownerDocument || me.container.document; - snapplugin = doc.createElement("object"); - try { - snapplugin.type = "application/x-pluginbaidusnap"; - } catch (e) { - return; - } - snapplugin.style.cssText = - "position:absolute;left:-9999px;width:0;height:0;"; - snapplugin.setAttribute("width", "0"); - snapplugin.setAttribute("height", "0"); - container.appendChild(snapplugin); - } - - function onSuccess(rs) { - try { - rs = eval("(" + rs + ")"); - if (rs.state == "SUCCESS") { - var opt = me.options; - me.execCommand("insertimage", { - src: opt.snapscreenUrlPrefix + rs.url, - _src: opt.snapscreenUrlPrefix + rs.url, - alt: rs.title || "", - floatStyle: opt.snapscreenImgAlign - }); - } else { - alert(rs.state); - } - } catch (e) { - alert(lang.callBackErrorMsg); - } - } - url = me.getActionUrl(me.getOpt("snapscreenActionName")); - local = getLocation(url); - setTimeout(function() { - try { - res = snapplugin.saveSnapshot( - local.hostname, - local.path, - local.port - ); - } catch (e) { - me.ui._dialogs["snapscreenDialog"].open(); - return; - } - - onSuccess(res); - }, 50); - }, - queryCommandState: function() { - return navigator.userAgent.indexOf("Windows", 0) != -1 ? 0 : -1; - } - } - } - }; -}); - - -// plugins/insertparagraph.js -/** - * 插入段落 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入段落 - * @command insertparagraph - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * //editor是编辑器实例 - * editor.execCommand( 'insertparagraph' ); - * ``` - */ - -UE.commands["insertparagraph"] = { - execCommand: function(cmdName, front) { - var me = this, - range = me.selection.getRange(), - start = range.startContainer, - tmpNode; - while (start) { - if (domUtils.isBody(start)) { - break; - } - tmpNode = start; - start = start.parentNode; - } - if (tmpNode) { - var p = me.document.createElement("p"); - if (front) { - tmpNode.parentNode.insertBefore(p, tmpNode); - } else { - tmpNode.parentNode.insertBefore(p, tmpNode.nextSibling); - } - domUtils.fillNode(me.document, p); - range.setStart(p, 0).setCursor(false, true); - } - } -}; - - -// plugins/webapp.js -/** - * 百度应用 - * @file - * @since 1.2.6.1 - */ - -/** - * 插入百度应用 - * @command webapp - * @method execCommand - * @remind 需要百度APPKey - * @remind 百度应用主页: http://app.baidu.com/ - * @param { Object } appOptions 应用所需的参数项, 支持的key有: title=>应用标题, width=>应用容器宽度, - * height=>应用容器高度,logo=>应用logo,url=>应用地址 - * @example - * ```javascript - * //editor是编辑器实例 - * //在编辑器里插入一个“植物大战僵尸”的APP - * editor.execCommand( 'webapp' , { - * title: '植物大战僵尸', - * width: 560, - * height: 465, - * logo: '应用展示的图片', - * url: '百度应用的地址' - * } ); - * ``` - */ - -//UE.plugins['webapp'] = function () { -// var me = this; -// function createInsertStr( obj, toIframe, addParagraph ) { -// return !toIframe ? -// (addParagraph ? '

                      ' : '') + '' + -// (addParagraph ? '

                      ' : '') -// : -// ''; -// } -// -// function switchImgAndIframe( img2frame ) { -// var tmpdiv, -// nodes = domUtils.getElementsByTagName( me.document, !img2frame ? "iframe" : "img" ); -// for ( var i = 0, node; node = nodes[i++]; ) { -// if ( node.className != "edui-faked-webapp" ){ -// continue; -// } -// tmpdiv = me.document.createElement( "div" ); -// tmpdiv.innerHTML = createInsertStr( img2frame ? {url:node.getAttribute( "_url" ), width:node.width, height:node.height,title:node.title,logo:node.style.backgroundImage.replace("url(","").replace(")","")} : {url:node.getAttribute( "src", 2 ),title:node.title, width:node.width, height:node.height,logo:node.getAttribute("logo_url")}, img2frame ? true : false,false ); -// node.parentNode.replaceChild( tmpdiv.firstChild, node ); -// } -// } -// -// me.addListener( "beforegetcontent", function () { -// switchImgAndIframe( true ); -// } ); -// me.addListener( 'aftersetcontent', function () { -// switchImgAndIframe( false ); -// } ); -// me.addListener( 'aftergetcontent', function ( cmdName ) { -// if ( cmdName == 'aftergetcontent' && me.queryCommandState( 'source' ) ){ -// return; -// } -// switchImgAndIframe( false ); -// } ); -// -// me.commands['webapp'] = { -// execCommand:function ( cmd, obj ) { -// me.execCommand( "inserthtml", createInsertStr( obj, false,true ) ); -// } -// }; -//}; - -UE.plugin.register("webapp", function() { - var me = this; - function createInsertStr(obj, toEmbed) { - return !toEmbed - ? '" - : ''; - } - return { - outputRule: function(root) { - utils.each(root.getNodesByTagName("img"), function(node) { - var html; - if (node.getAttr("class") == "edui-faked-webapp") { - html = createInsertStr( - { - title: node.getAttr("title"), - width: node.getAttr("width"), - height: node.getAttr("height"), - align: node.getAttr("align"), - cssfloat: node.getStyle("float"), - url: node.getAttr("_url"), - logo: node.getAttr("_logo_url") - }, - true - ); - var embed = UE.uNode.createElement(html); - node.parentNode.replaceChild(embed, node); - } - }); - }, - inputRule: function(root) { - utils.each(root.getNodesByTagName("iframe"), function(node) { - if (node.getAttr("class") == "edui-faked-webapp") { - var img = UE.uNode.createElement( - createInsertStr({ - title: node.getAttr("title"), - width: node.getAttr("width"), - height: node.getAttr("height"), - align: node.getAttr("align"), - cssfloat: node.getStyle("float"), - url: node.getAttr("src"), - logo: node.getAttr("logo_url") - }) - ); - node.parentNode.replaceChild(img, node); - } - }); - }, - commands: { - /** - * 插入百度应用 - * @command webapp - * @method execCommand - * @remind 需要百度APPKey - * @remind 百度应用主页: http://app.baidu.com/ - * @param { Object } appOptions 应用所需的参数项, 支持的key有: title=>应用标题, width=>应用容器宽度, - * height=>应用容器高度,logo=>应用logo,url=>应用地址 - * @example - * ```javascript - * //editor是编辑器实例 - * //在编辑器里插入一个“植物大战僵尸”的APP - * editor.execCommand( 'webapp' , { - * title: '植物大战僵尸', - * width: 560, - * height: 465, - * logo: '应用展示的图片', - * url: '百度应用的地址' - * } ); - * ``` - */ - webapp: { - execCommand: function(cmd, obj) { - var me = this, - str = createInsertStr( - utils.extend(obj, { - align: "none" - }), - false - ); - me.execCommand("inserthtml", str); - }, - queryCommandState: function() { - var me = this, - img = me.selection.getRange().getClosedNode(), - flag = img && img.className == "edui-faked-webapp"; - return flag ? 1 : 0; - } - } - } - }; -}); - - -// plugins/template.js -///import core -///import plugins\inserthtml.js -///import plugins\cleardoc.js -///commands 模板 -///commandsName template -///commandsTitle 模板 -///commandsDialog dialogs\template -UE.plugins["template"] = function() { - UE.commands["template"] = { - execCommand: function(cmd, obj) { - obj.html && this.execCommand("inserthtml", obj.html); - } - }; - this.addListener("click", function(type, evt) { - var el = evt.target || evt.srcElement, - range = this.selection.getRange(); - var tnode = domUtils.findParent( - el, - function(node) { - if (node.className && domUtils.hasClass(node, "ue_t")) { - return node; - } - }, - true - ); - tnode && range.selectNode(tnode).shrinkBoundary().select(); - }); - this.addListener("keydown", function(type, evt) { - var range = this.selection.getRange(); - if (!range.collapsed) { - if (!evt.ctrlKey && !evt.metaKey && !evt.shiftKey && !evt.altKey) { - var tnode = domUtils.findParent( - range.startContainer, - function(node) { - if (node.className && domUtils.hasClass(node, "ue_t")) { - return node; - } - }, - true - ); - if (tnode) { - domUtils.removeClasses(tnode, ["ue_t"]); - } - } - } - }); -}; - - -// plugins/music.js -/** - * 插入音乐命令 - * @file - */ -UE.plugin.register("music", function() { - var me = this; - function creatInsertStr(url, width, height, align, cssfloat, toEmbed) { - return !toEmbed - ? "' - : ''; - } - return { - outputRule: function(root) { - utils.each(root.getNodesByTagName("img"), function(node) { - var html; - if (node.getAttr("class") == "edui-faked-music") { - var cssfloat = node.getStyle("float"); - var align = node.getAttr("align"); - html = creatInsertStr( - node.getAttr("_url"), - node.getAttr("width"), - node.getAttr("height"), - align, - cssfloat, - true - ); - var embed = UE.uNode.createElement(html); - node.parentNode.replaceChild(embed, node); - } - }); - }, - inputRule: function(root) { - utils.each(root.getNodesByTagName("embed"), function(node) { - if (node.getAttr("class") == "edui-faked-music") { - var cssfloat = node.getStyle("float"); - var align = node.getAttr("align"); - html = creatInsertStr( - node.getAttr("src"), - node.getAttr("width"), - node.getAttr("height"), - align, - cssfloat, - false - ); - var img = UE.uNode.createElement(html); - node.parentNode.replaceChild(img, node); - } - }); - }, - commands: { - /** - * 插入音乐 - * @command music - * @method execCommand - * @param { Object } musicOptions 插入音乐的参数项, 支持的key有: url=>音乐地址; - * width=>音乐容器宽度;height=>音乐容器高度;align=>音乐文件的对齐方式, 可选值有: left, center, right, none - * @example - * ```javascript - * //editor是编辑器实例 - * //在编辑器里插入一个“植物大战僵尸”的APP - * editor.execCommand( 'music' , { - * width: 400, - * height: 95, - * align: "center", - * url: "音乐地址" - * } ); - * ``` - */ - music: { - execCommand: function(cmd, musicObj) { - var me = this, - str = creatInsertStr( - musicObj.url, - musicObj.width || 400, - musicObj.height || 95, - "none", - false - ); - me.execCommand("inserthtml", str); - }, - queryCommandState: function() { - var me = this, - img = me.selection.getRange().getClosedNode(), - flag = img && img.className == "edui-faked-music"; - return flag ? 1 : 0; - } - } - } - }; -}); - - -// plugins/autoupload.js -/** - * @description - * 1.拖放文件到编辑区域,自动上传并插入到选区 - * 2.插入粘贴板的图片,自动上传并插入到选区 - * @author Jinqn - * @date 2013-10-14 - */ -UE.plugin.register("autoupload", function() { - function sendAndInsertFile(file, editor) { - var me = editor; - //模拟数据 - var fieldName, - urlPrefix, - maxSize, - allowFiles, - actionUrl, - loadingHtml, - errorHandler, - successHandler, - filetype = /image\/\w+/i.test(file.type) ? "image" : "file", - loadingId = "loading_" + (+new Date()).toString(36); - - fieldName = me.getOpt(filetype + "FieldName"); - urlPrefix = me.getOpt(filetype + "UrlPrefix"); - maxSize = me.getOpt(filetype + "MaxSize"); - allowFiles = me.getOpt(filetype + "AllowFiles"); - actionUrl = me.getActionUrl(me.getOpt(filetype + "ActionName")); - errorHandler = function(title) { - var loader = me.document.getElementById(loadingId); - loader && domUtils.remove(loader); - me.fireEvent("showmessage", { - id: loadingId, - content: title, - type: "error", - timeout: 4000 - }); - }; - - if (filetype == "image") { - loadingHtml = - ''; - successHandler = function(data) { - var link = urlPrefix + data.url, - loader = me.document.getElementById(loadingId); - if (loader) { - domUtils.removeClasses(loader, "loadingclass"); - loader.setAttribute("src", link); - loader.setAttribute("_src", link); - loader.setAttribute("alt", data.original || ""); - loader.removeAttribute("id"); - me.trigger("contentchange", loader); - } - }; - } else { - loadingHtml = - "

                      " + - '' + - "

                      "; - successHandler = function(data) { - var link = urlPrefix + data.url, - loader = me.document.getElementById(loadingId); - - var rng = me.selection.getRange(), - bk = rng.createBookmark(); - rng.selectNode(loader).select(); - me.execCommand("insertfile", { url: link }); - rng.moveToBookmark(bk).select(); - }; - } - - /* 插入loading的占位符 */ - me.execCommand("inserthtml", loadingHtml); - /* 判断后端配置是否没有加载成功 */ - if (!me.getOpt(filetype + "ActionName")) { - errorHandler(me.getLang("autoupload.errorLoadConfig")); - return; - } - /* 判断文件大小是否超出限制 */ - if (file.size > maxSize) { - errorHandler(me.getLang("autoupload.exceedSizeError")); - return; - } - /* 判断文件格式是否超出允许 */ - var fileext = file.name ? file.name.substr(file.name.lastIndexOf(".")) : ""; - if ( - (fileext && filetype != "image") || - (allowFiles && - (allowFiles.join("") + ".").indexOf(fileext.toLowerCase() + ".") == -1) - ) { - errorHandler(me.getLang("autoupload.exceedTypeError")); - return; - } - - /* 创建Ajax并提交 */ - var xhr = new XMLHttpRequest(), - fd = new FormData(), - params = utils.serializeParam(me.queryCommandValue("serverparam")) || "", - url = utils.formatUrl( - actionUrl + (actionUrl.indexOf("?") == -1 ? "?" : "&") + params - ); - - fd.append( - fieldName, - file, - file.name || "blob." + file.type.substr("image/".length) - ); - fd.append("type", "ajax"); - xhr.open("post", url, true); - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - xhr.addEventListener("load", function(e) { - try { - var json = new Function("return " + utils.trim(e.target.response))(); - if (json.state == "SUCCESS" && json.url) { - successHandler(json); - } else { - errorHandler(json.state); - } - } catch (er) { - errorHandler(me.getLang("autoupload.loadError")); - } - }); - xhr.send(fd); - } - - function getPasteImage(e) { - return e.clipboardData && - e.clipboardData.items && - e.clipboardData.items.length == 1 && - /^image\//.test(e.clipboardData.items[0].type) - ? e.clipboardData.items - : null; - } - function getDropImage(e) { - return e.dataTransfer && e.dataTransfer.files ? e.dataTransfer.files : null; - } - - return { - outputRule: function(root) { - utils.each(root.getNodesByTagName("img"), function(n) { - if (/\b(loaderrorclass)|(bloaderrorclass)\b/.test(n.getAttr("class"))) { - n.parentNode.removeChild(n); - } - }); - utils.each(root.getNodesByTagName("p"), function(n) { - if (/\bloadpara\b/.test(n.getAttr("class"))) { - n.parentNode.removeChild(n); - } - }); - }, - bindEvents: { - defaultOptions: { - //默认间隔时间 - enableDragUpload: true, - enablePasteUpload: true - }, - //插入粘贴板的图片,拖放插入图片 - ready: function(e) { - var me = this; - if (window.FormData && window.FileReader) { - var handler = function(e) { - var hasImg = false, - items; - //获取粘贴板文件列表或者拖放文件列表 - items = e.type == "paste" ? getPasteImage(e) : getDropImage(e); - if (items) { - var len = items.length, - file; - while (len--) { - file = items[len]; - if (file.getAsFile) file = file.getAsFile(); - if (file && file.size > 0) { - sendAndInsertFile(file, me); - hasImg = true; - } - } - hasImg && e.preventDefault(); - } - }; - - if (me.getOpt("enablePasteUpload") !== false) { - domUtils.on(me.body, "paste ", handler); - } - if (me.getOpt("enableDragUpload") !== false) { - domUtils.on(me.body, "drop", handler); - //取消拖放图片时出现的文字光标位置提示 - domUtils.on(me.body, "dragover", function(e) { - if (e.dataTransfer.types[0] == "Files") { - e.preventDefault(); - } - }); - } else { - if (browser.gecko) { - domUtils.on(me.body, "drop", function(e) { - if (getDropImage(e)) { - e.preventDefault(); - } - }); - } - } - - //设置loading的样式 - utils.cssRule( - "loading", - ".loadingclass{display:inline-block;cursor:default;background: url('" + - this.options.themePath + - this.options.theme + - "/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-left:1px;height: 22px;width: 22px;}\n" + - ".loaderrorclass{display:inline-block;cursor:default;background: url('" + - this.options.themePath + - this.options.theme + - "/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;" + - "}", - this.document - ); - } - } - } - }; -}); - - -// plugins/autosave.js -UE.plugin.register("autosave", function() { - var me = this, - //无限循环保护 - lastSaveTime = new Date(), - //最小保存间隔时间 - MIN_TIME = 20, - //auto save key - saveKey = null; - - function save(editor) { - var saveData; - - if (new Date() - lastSaveTime < MIN_TIME) { - return; - } - - if (!editor.hasContents()) { - //这里不能调用命令来删除, 会造成事件死循环 - saveKey && me.removePreferences(saveKey); - return; - } - - lastSaveTime = new Date(); - - editor._saveFlag = null; - - saveData = me.body.innerHTML; - - if ( - editor.fireEvent("beforeautosave", { - content: saveData - }) === false - ) { - return; - } - - me.setPreferences(saveKey, saveData); - - editor.fireEvent("afterautosave", { - content: saveData - }); - } - - return { - defaultOptions: { - //默认间隔时间 - saveInterval: 500, - enableAutoSave: true - }, - bindEvents: { - ready: function() { - var _suffix = "-drafts-data", - key = null; - - if (me.key) { - key = me.key + _suffix; - } else { - key = (me.container.parentNode.id || "ue-common") + _suffix; - } - - //页面地址+编辑器ID 保持唯一 - saveKey = - (location.protocol + location.host + location.pathname).replace( - /[.:\/]/g, - "_" - ) + key; - }, - - contentchange: function() { - if (!me.getOpt("enableAutoSave")) { - return; - } - - if (!saveKey) { - return; - } - - if (me._saveFlag) { - window.clearTimeout(me._saveFlag); - } - - if (me.options.saveInterval > 0) { - me._saveFlag = window.setTimeout(function() { - save(me); - }, me.options.saveInterval); - } else { - save(me); - } - } - }, - commands: { - clearlocaldata: { - execCommand: function(cmd, name) { - if (saveKey && me.getPreferences(saveKey)) { - me.removePreferences(saveKey); - } - }, - notNeedUndo: true, - ignoreContentChange: true - }, - - getlocaldata: { - execCommand: function(cmd, name) { - return saveKey ? me.getPreferences(saveKey) || "" : ""; - }, - notNeedUndo: true, - ignoreContentChange: true - }, - - drafts: { - execCommand: function(cmd, name) { - if (saveKey) { - window.setTimeout(function(){ - me.body.innerHTML = - me.getPreferences(saveKey) || "

                      " + domUtils.fillHtml + "

                      "; - // me.focus(true); - }, 0); - } - }, - queryCommandState: function() { - return saveKey ? (me.getPreferences(saveKey) === null ? -1 : 0) : -1; - }, - notNeedUndo: true, - ignoreContentChange: true - } - } - }; -}); - - -// plugins/charts.js -UE.plugin.register("charts", function() { - var me = this; - - return { - bindEvents: { - chartserror: function() {} - }, - commands: { - charts: { - execCommand: function(cmd, data) { - var tableNode = domUtils.findParentByTagName( - this.selection.getRange().startContainer, - "table", - true - ), - flagText = [], - config = {}; - - if (!tableNode) { - return false; - } - - if (!validData(tableNode)) { - me.fireEvent("chartserror"); - return false; - } - - config.title = data.title || ""; - config.subTitle = data.subTitle || ""; - config.xTitle = data.xTitle || ""; - config.yTitle = data.yTitle || ""; - config.suffix = data.suffix || ""; - config.tip = data.tip || ""; - //数据对齐方式 - config.dataFormat = data.tableDataFormat || ""; - //图表类型 - config.chartType = data.chartType || 0; - - for (var key in config) { - if (!config.hasOwnProperty(key)) { - continue; - } - - flagText.push(key + ":" + config[key]); - } - - tableNode.setAttribute("data-chart", flagText.join(";")); - domUtils.addClass(tableNode, "edui-charts-table"); - }, - queryCommandState: function(cmd, name) { - var tableNode = domUtils.findParentByTagName( - this.selection.getRange().startContainer, - "table", - true - ); - return tableNode && validData(tableNode) ? 0 : -1; - } - } - }, - inputRule: function(root) { - utils.each(root.getNodesByTagName("table"), function(tableNode) { - if (tableNode.getAttr("data-chart") !== undefined) { - tableNode.setAttr("style"); - } - }); - }, - outputRule: function(root) { - utils.each(root.getNodesByTagName("table"), function(tableNode) { - if (tableNode.getAttr("data-chart") !== undefined) { - tableNode.setAttr("style", "display: none;"); - } - }); - } - }; - - function validData(table) { - var firstRows = null, - cellCount = 0; - - //行数不够 - if (table.rows.length < 2) { - return false; - } - - //列数不够 - if (table.rows[0].cells.length < 2) { - return false; - } - - //第一行所有cell必须是th - firstRows = table.rows[0].cells; - cellCount = firstRows.length; - - for (var i = 0, cell; (cell = firstRows[i]); i++) { - if (cell.tagName.toLowerCase() !== "th") { - return false; - } - } - - for (var i = 1, row; (row = table.rows[i]); i++) { - //每行单元格数不匹配, 返回false - if (row.cells.length != cellCount) { - return false; - } - - //第一列不是th也返回false - if (row.cells[0].tagName.toLowerCase() !== "th") { - return false; - } - - for (var j = 1, cell; (cell = row.cells[j]); j++) { - var value = utils.trim(cell.innerText || cell.textContent || ""); - - value = value - .replace(new RegExp(UE.dom.domUtils.fillChar, "g"), "") - .replace(/^\s+|\s+$/g, ""); - - //必须是数字 - if (!/^\d*\.?\d+$/.test(value)) { - return false; - } - } - } - - return true; - } -}); - - -// plugins/section.js -/** - * 目录大纲支持插件 - * @file - * @since 1.3.0 - */ -UE.plugin.register("section", function() { - /* 目录节点对象 */ - function Section(option) { - this.tag = ""; - (this.level = -1), (this.dom = null); - this.nextSection = null; - this.previousSection = null; - this.parentSection = null; - this.startAddress = []; - this.endAddress = []; - this.children = []; - } - function getSection(option) { - var section = new Section(); - return utils.extend(section, option); - } - function getNodeFromAddress(startAddress, root) { - var current = root; - for (var i = 0; i < startAddress.length; i++) { - if (!current.childNodes) return null; - current = current.childNodes[startAddress[i]]; - } - return current; - } - - var me = this; - - return { - bindMultiEvents: { - type: "aftersetcontent afterscencerestore", - handler: function() { - me.fireEvent("updateSections"); - } - }, - bindEvents: { - /* 初始化、拖拽、粘贴、执行setcontent之后 */ - ready: function() { - me.fireEvent("updateSections"); - domUtils.on(me.body, "drop paste", function() { - me.fireEvent("updateSections"); - }); - }, - /* 执行paragraph命令之后 */ - afterexeccommand: function(type, cmd) { - if (cmd == "paragraph") { - me.fireEvent("updateSections"); - } - }, - /* 部分键盘操作,触发updateSections事件 */ - keyup: function(type, e) { - var me = this, - range = me.selection.getRange(); - if (range.collapsed != true) { - me.fireEvent("updateSections"); - } else { - var keyCode = e.keyCode || e.which; - if (keyCode == 13 || keyCode == 8 || keyCode == 46) { - me.fireEvent("updateSections"); - } - } - } - }, - commands: { - getsections: { - execCommand: function(cmd, levels) { - var levelFn = levels || ["h1", "h2", "h3", "h4", "h5", "h6"]; - - for (var i = 0; i < levelFn.length; i++) { - if (typeof levelFn[i] == "string") { - levelFn[i] = (function(fn) { - return function(node) { - return node.tagName == fn.toUpperCase(); - }; - })(levelFn[i]); - } else if (typeof levelFn[i] != "function") { - levelFn[i] = function(node) { - return null; - }; - } - } - function getSectionLevel(node) { - for (var i = 0; i < levelFn.length; i++) { - if (levelFn[i](node)) return i; - } - return -1; - } - - var me = this, - Directory = getSection({ level: -1, title: "root" }), - previous = Directory; - - function traversal(node, Directory) { - var level, - tmpSection = null, - parent, - child, - children = node.childNodes; - for (var i = 0, len = children.length; i < len; i++) { - child = children[i]; - level = getSectionLevel(child); - if (level >= 0) { - var address = me.selection - .getRange() - .selectNode(child) - .createAddress(true).startAddress, - current = getSection({ - tag: child.tagName, - title: child.innerText || child.textContent || "", - level: level, - dom: child, - startAddress: utils.clone(address, []), - endAddress: utils.clone(address, []), - children: [] - }); - previous.nextSection = current; - current.previousSection = previous; - parent = previous; - while (level <= parent.level) { - parent = parent.parentSection; - } - current.parentSection = parent; - parent.children.push(current); - tmpSection = previous = current; - } else { - child.nodeType === 1 && traversal(child, Directory); - tmpSection && - tmpSection.endAddress[tmpSection.endAddress.length - 1]++; - } - } - } - traversal(me.body, Directory); - return Directory; - }, - notNeedUndo: true - }, - movesection: { - execCommand: function(cmd, sourceSection, targetSection, isAfter) { - var me = this, - targetAddress, - target; - - if (!sourceSection || !targetSection || targetSection.level == -1) - return; - - targetAddress = isAfter - ? targetSection.endAddress - : targetSection.startAddress; - target = getNodeFromAddress(targetAddress, me.body); - - /* 判断目标地址是否被源章节包含 */ - if ( - !targetAddress || - !target || - isContainsAddress( - sourceSection.startAddress, - sourceSection.endAddress, - targetAddress - ) - ) - return; - - var startNode = getNodeFromAddress( - sourceSection.startAddress, - me.body - ), - endNode = getNodeFromAddress(sourceSection.endAddress, me.body), - current, - nextNode; - - if (isAfter) { - current = endNode; - while ( - current && - !( - domUtils.getPosition(startNode, current) & - domUtils.POSITION_FOLLOWING - ) - ) { - nextNode = current.previousSibling; - domUtils.insertAfter(target, current); - if (current == startNode) break; - current = nextNode; - } - } else { - current = startNode; - while ( - current && - !( - domUtils.getPosition(current, endNode) & - domUtils.POSITION_FOLLOWING - ) - ) { - nextNode = current.nextSibling; - target.parentNode.insertBefore(current, target); - if (current == endNode) break; - current = nextNode; - } - } - - me.fireEvent("updateSections"); - - /* 获取地址的包含关系 */ - function isContainsAddress(startAddress, endAddress, addressTarget) { - var isAfterStartAddress = false, - isBeforeEndAddress = false; - for (var i = 0; i < startAddress.length; i++) { - if (i >= addressTarget.length) break; - if (addressTarget[i] > startAddress[i]) { - isAfterStartAddress = true; - break; - } else if (addressTarget[i] < startAddress[i]) { - break; - } - } - for (var i = 0; i < endAddress.length; i++) { - if (i >= addressTarget.length) break; - if (addressTarget[i] < startAddress[i]) { - isBeforeEndAddress = true; - break; - } else if (addressTarget[i] > startAddress[i]) { - break; - } - } - return isAfterStartAddress && isBeforeEndAddress; - } - } - }, - deletesection: { - execCommand: function(cmd, section, keepChildren) { - var me = this; - - if (!section) return; - - function getNodeFromAddress(startAddress) { - var current = me.body; - for (var i = 0; i < startAddress.length; i++) { - if (!current.childNodes) return null; - current = current.childNodes[startAddress[i]]; - } - return current; - } - - var startNode = getNodeFromAddress(section.startAddress), - endNode = getNodeFromAddress(section.endAddress), - current = startNode, - nextNode; - - if (!keepChildren) { - while ( - current && - domUtils.inDoc(endNode, me.document) && - !( - domUtils.getPosition(current, endNode) & - domUtils.POSITION_FOLLOWING - ) - ) { - nextNode = current.nextSibling; - domUtils.remove(current); - current = nextNode; - } - } else { - domUtils.remove(current); - } - - me.fireEvent("updateSections"); - } - }, - selectsection: { - execCommand: function(cmd, section) { - if (!section && !section.dom) return false; - var me = this, - range = me.selection.getRange(), - address = { - startAddress: utils.clone(section.startAddress, []), - endAddress: utils.clone(section.endAddress, []) - }; - address.endAddress[address.endAddress.length - 1]++; - range.moveToAddress(address).select().scrollToView(); - return true; - }, - notNeedUndo: true - }, - scrolltosection: { - execCommand: function(cmd, section) { - if (!section && !section.dom) return false; - var me = this, - range = me.selection.getRange(), - address = { - startAddress: section.startAddress, - endAddress: section.endAddress - }; - address.endAddress[address.endAddress.length - 1]++; - range.moveToAddress(address).scrollToView(); - return true; - }, - notNeedUndo: true - } - } - }; -}); - - -// plugins/simpleupload.js -/** - * @description - * 简单上传:点击按钮,直接选择文件上传 - * @author Jinqn - * @date 2014-03-31 - */ -UE.plugin.register("simpleupload", function() { - var me = this, - isLoaded = false, - containerBtn; - - function initUploadBtn() { - var w = containerBtn.offsetWidth || 20, - h = containerBtn.offsetHeight || 20, - btnIframe = document.createElement("iframe"), - btnStyle = - "display:block;width:" + - w + - "px;height:" + - h + - "px;overflow:hidden;border:0;margin:0;padding:0;position:absolute;top:0;left:0;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;cursor:pointer;"; - - domUtils.on(btnIframe, "load", function() { - var timestrap = (+new Date()).toString(36), - wrapper, - btnIframeDoc, - btnIframeBody; - - btnIframeDoc = - btnIframe.contentDocument || btnIframe.contentWindow.document; - btnIframeBody = btnIframeDoc.body; - wrapper = btnIframeDoc.createElement("div"); - - wrapper.innerHTML = - '
                      ' + - '' + - "
                      " + - ''; - - wrapper.className = "edui-" + me.options.theme; - wrapper.id = me.ui.id + "_iframeupload"; - btnIframeBody.style.cssText = btnStyle; - btnIframeBody.style.width = w + "px"; - btnIframeBody.style.height = h + "px"; - btnIframeBody.appendChild(wrapper); - - if (btnIframeBody.parentNode) { - btnIframeBody.parentNode.style.width = w + "px"; - btnIframeBody.parentNode.style.height = w + "px"; - } - - var form = btnIframeDoc.getElementById("edui_form_" + timestrap); - var input = btnIframeDoc.getElementById("edui_input_" + timestrap); - var iframe = btnIframeDoc.getElementById("edui_iframe_" + timestrap); - - domUtils.on(input, "change", function() { - if (!input.value) return; - var loadingId = "loading_" + (+new Date()).toString(36); - var params = - utils.serializeParam(me.queryCommandValue("serverparam")) || ""; - - var imageActionUrl = me.getActionUrl(me.getOpt("imageActionName")); - var allowFiles = me.getOpt("imageAllowFiles"); - - me.focus(); - me.execCommand( - "inserthtml", - '' - ); - - function callback() { - try { - var link, - json, - loader, - body = (iframe.contentDocument || iframe.contentWindow.document) - .body, - result = body.innerText || body.textContent || ""; - json = new Function("return " + result)(); - link = me.options.imageUrlPrefix + json.url; - if (json.state == "SUCCESS" && json.url) { - loader = me.document.getElementById(loadingId); - domUtils.removeClasses(loader, "loadingclass"); - domUtils.on(loader,'load',function(){ - me.fireEvent('contentchange'); - }); - loader.setAttribute("src", link); - loader.setAttribute("_src", link); - loader.setAttribute("alt", json.original || ""); - loader.removeAttribute("id"); - } else { - showErrorLoader && showErrorLoader(json.state); - } - } catch (er) { - showErrorLoader && - showErrorLoader(me.getLang("simpleupload.loadError")); - } - form.reset(); - domUtils.un(iframe, "load", callback); - } - function showErrorLoader(title) { - if (loadingId) { - var loader = me.document.getElementById(loadingId); - loader && domUtils.remove(loader); - me.fireEvent("showmessage", { - id: loadingId, - content: title, - type: "error", - timeout: 4000 - }); - } - } - - /* 判断后端配置是否没有加载成功 */ - if (!me.getOpt("imageActionName")) { - errorHandler(me.getLang("autoupload.errorLoadConfig")); - return; - } - // 判断文件格式是否错误 - var filename = input.value, - fileext = filename ? filename.substr(filename.lastIndexOf(".")) : ""; - if ( - !fileext || - (allowFiles && - (allowFiles.join("") + ".").indexOf(fileext.toLowerCase() + ".") == - -1) - ) { - showErrorLoader(me.getLang("simpleupload.exceedTypeError")); - return; - } - - domUtils.on(iframe, "load", callback); - form.action = utils.formatUrl( - imageActionUrl + - (imageActionUrl.indexOf("?") == -1 ? "?" : "&") + - params - ); - form.submit(); - }); - - var stateTimer; - me.addListener("selectionchange", function() { - clearTimeout(stateTimer); - stateTimer = setTimeout(function() { - var state = me.queryCommandState("simpleupload"); - if (state == -1) { - input.disabled = "disabled"; - } else { - input.disabled = false; - } - }, 400); - }); - isLoaded = true; - }); - - btnIframe.style.cssText = btnStyle; - containerBtn.appendChild(btnIframe); - } - - return { - bindEvents: { - ready: function() { - //设置loading的样式 - utils.cssRule( - "loading", - ".loadingclass{display:inline-block;cursor:default;background: url('" + - this.options.themePath + - this.options.theme + - "/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}\n" + - ".loaderrorclass{display:inline-block;cursor:default;background: url('" + - this.options.themePath + - this.options.theme + - "/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;" + - "}", - this.document - ); - }, - /* 初始化简单上传按钮 */ - simpleuploadbtnready: function(type, container) { - containerBtn = container; - me.afterConfigReady(initUploadBtn); - } - }, - outputRule: function(root) { - utils.each(root.getNodesByTagName("img"), function(n) { - if (/\b(loaderrorclass)|(bloaderrorclass)\b/.test(n.getAttr("class"))) { - n.parentNode.removeChild(n); - } - }); - }, - commands: { - simpleupload: { - queryCommandState: function() { - return isLoaded ? 0 : -1; - } - } - } - }; -}); - - -// plugins/serverparam.js -/** - * 服务器提交的额外参数列表设置插件 - * @file - * @since 1.2.6.1 - */ -UE.plugin.register("serverparam", function() { - var me = this, - serverParam = {}; - - return { - commands: { - /** - * 修改服务器提交的额外参数列表,清除所有项 - * @command serverparam - * @method execCommand - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.execCommand('serverparam'); - * editor.queryCommandValue('serverparam'); //返回空 - * ``` - */ - /** - * 修改服务器提交的额外参数列表,删除指定项 - * @command serverparam - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } key 要清除的属性 - * @example - * ```javascript - * editor.execCommand('serverparam', 'name'); //删除属性name - * ``` - */ - /** - * 修改服务器提交的额外参数列表,使用键值添加项 - * @command serverparam - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { String } key 要添加的属性 - * @param { String } value 要添加属性的值 - * @example - * ```javascript - * editor.execCommand('serverparam', 'name', 'hello'); - * editor.queryCommandValue('serverparam'); //返回对象 {'name': 'hello'} - * ``` - */ - /** - * 修改服务器提交的额外参数列表,传入键值对对象添加多项 - * @command serverparam - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Object } key 传入的键值对对象 - * @example - * ```javascript - * editor.execCommand('serverparam', {'name': 'hello'}); - * editor.queryCommandValue('serverparam'); //返回对象 {'name': 'hello'} - * ``` - */ - /** - * 修改服务器提交的额外参数列表,使用自定义函数添加多项 - * @command serverparam - * @method execCommand - * @param { String } cmd 命令字符串 - * @param { Function } key 自定义获取参数的函数 - * @example - * ```javascript - * editor.execCommand('serverparam', function(editor){ - * return {'key': 'value'}; - * }); - * editor.queryCommandValue('serverparam'); //返回对象 {'key': 'value'} - * ``` - */ - - /** - * 获取服务器提交的额外参数列表 - * @command serverparam - * @method queryCommandValue - * @param { String } cmd 命令字符串 - * @example - * ```javascript - * editor.queryCommandValue( 'serverparam' ); //返回对象 {'key': 'value'} - * ``` - */ - serverparam: { - execCommand: function(cmd, key, value) { - if (key === undefined || key === null) { - //不传参数,清空列表 - serverParam = {}; - } else if (utils.isString(key)) { - //传入键值 - if (value === undefined || value === null) { - delete serverParam[key]; - } else { - serverParam[key] = value; - } - } else if (utils.isObject(key)) { - //传入对象,覆盖列表项 - utils.extend(serverParam, key, false); - } else if (utils.isFunction(key)) { - //传入函数,添加列表项 - utils.extend(serverParam, key(), false); - } - }, - queryCommandValue: function() { - return serverParam || {}; - } - } - } - }; -}); - - -// plugins/insertfile.js -/** - * 插入附件 - */ -UE.plugin.register("insertfile", function() { - var me = this; - - function getFileIcon(url) { - var ext = url.substr(url.lastIndexOf(".") + 1).toLowerCase(), - maps = { - rar: "icon_rar.gif", - zip: "icon_rar.gif", - tar: "icon_rar.gif", - gz: "icon_rar.gif", - bz2: "icon_rar.gif", - doc: "icon_doc.gif", - docx: "icon_doc.gif", - pdf: "icon_pdf.gif", - mp3: "icon_mp3.gif", - xls: "icon_xls.gif", - chm: "icon_chm.gif", - ppt: "icon_ppt.gif", - pptx: "icon_ppt.gif", - avi: "icon_mv.gif", - rmvb: "icon_mv.gif", - wmv: "icon_mv.gif", - flv: "icon_mv.gif", - swf: "icon_mv.gif", - rm: "icon_mv.gif", - exe: "icon_exe.gif", - psd: "icon_psd.gif", - txt: "icon_txt.gif", - jpg: "icon_jpg.gif", - png: "icon_jpg.gif", - jpeg: "icon_jpg.gif", - gif: "icon_jpg.gif", - ico: "icon_jpg.gif", - bmp: "icon_jpg.gif" - }; - return maps[ext] ? maps[ext] : maps["txt"]; - } - - return { - commands: { - insertfile: { - execCommand: function(command, filelist) { - filelist = utils.isArray(filelist) ? filelist : [filelist]; - - if (me.fireEvent("beforeinsertfile", filelist) === true) { - return; - } - - var i, - item, - icon, - title, - html = "", - URL = me.getOpt("UEDITOR_HOME_URL"), - iconDir = - URL + - (URL.substr(URL.length - 1) == "/" ? "" : "/") + - "dialogs/attachment/fileTypeImages/"; - for (i = 0; i < filelist.length; i++) { - item = filelist[i]; - icon = iconDir + getFileIcon(item.url); - title = - item.title || item.url.substr(item.url.lastIndexOf("/") + 1); - html += - '

                      ' + - '' + - '' + - title + - "" + - "

                      "; - } - me.execCommand("insertHtml", html); - - me.fireEvent("afterinsertfile", filelist); - } - } - } - }; -}); - - -// plugins/xssFilter.js -/** - * @file xssFilter.js - * @desc xss过滤器 - * @author robbenmu - */ - -UE.plugins.xssFilter = function() { - - var config = UEDITOR_CONFIG; - var whitList = config.whitList; - - function filter(node) { - - var tagName = node.tagName; - var attrs = node.attrs; - - if (!whitList.hasOwnProperty(tagName)) { - node.parentNode.removeChild(node); - return false; - } - - UE.utils.each(attrs, function (val, key) { - - if (whitList[tagName].indexOf(key) === -1) { - node.setAttr(key); - } - }); - } - - // 添加inserthtml\paste等操作用的过滤规则 - if (whitList && config.xssFilterRules) { - this.options.filterRules = function () { - - var result = {}; - - UE.utils.each(whitList, function(val, key) { - result[key] = function (node) { - return filter(node); - }; - }); - - return result; - }(); - } - - var tagList = []; - - UE.utils.each(whitList, function (val, key) { - tagList.push(key); - }); - - // 添加input过滤规则 - // - if (whitList && config.inputXssFilter) { - this.addInputRule(function (root) { - - root.traversal(function(node) { - if (node.type !== 'element') { - return false; - } - filter(node); - }); - }); - } - // 添加output过滤规则 - // - if (whitList && config.outputXssFilter) { - this.addOutputRule(function (root) { - - root.traversal(function(node) { - if (node.type !== 'element') { - return false; - } - filter(node); - }); - }); - } - -}; - - -// ui/ui.js -var baidu = baidu || {}; -baidu.editor = baidu.editor || {}; -UE.ui = baidu.editor.ui = {}; - - -// ui/uiutils.js -;(function() { - var browser = baidu.editor.browser, - domUtils = baidu.editor.dom.domUtils; - - var magic = "$EDITORUI"; - var root = (window[magic] = {}); - var uidMagic = "ID" + magic; - var uidCount = 0; - - var uiUtils = (baidu.editor.ui.uiUtils = { - uid: function(obj) { - return obj ? obj[uidMagic] || (obj[uidMagic] = ++uidCount) : ++uidCount; - }, - hook: function(fn, callback) { - var dg; - if (fn && fn._callbacks) { - dg = fn; - } else { - dg = function() { - var q; - if (fn) { - q = fn.apply(this, arguments); - } - var callbacks = dg._callbacks; - var k = callbacks.length; - while (k--) { - var r = callbacks[k].apply(this, arguments); - if (q === undefined) { - q = r; - } - } - return q; - }; - dg._callbacks = []; - } - dg._callbacks.push(callback); - return dg; - }, - createElementByHtml: function(html) { - var el = document.createElement("div"); - el.innerHTML = html; - el = el.firstChild; - el.parentNode.removeChild(el); - return el; - }, - getViewportElement: function() { - return browser.ie && browser.quirks - ? document.body - : document.documentElement; - }, - getClientRect: function(element) { - var bcr; - //trace IE6下在控制编辑器显隐时可能会报错,catch一下 - try { - bcr = element.getBoundingClientRect(); - } catch (e) { - bcr = { left: 0, top: 0, height: 0, width: 0 }; - } - var rect = { - left: Math.round(bcr.left), - top: Math.round(bcr.top), - height: Math.round(bcr.bottom - bcr.top), - width: Math.round(bcr.right - bcr.left) - }; - var doc; - while ( - (doc = element.ownerDocument) !== document && - (element = domUtils.getWindow(doc).frameElement) - ) { - bcr = element.getBoundingClientRect(); - rect.left += bcr.left; - rect.top += bcr.top; - } - rect.bottom = rect.top + rect.height; - rect.right = rect.left + rect.width; - return rect; - }, - getViewportRect: function() { - var viewportEl = uiUtils.getViewportElement(); - var width = (window.innerWidth || viewportEl.clientWidth) | 0; - var height = (window.innerHeight || viewportEl.clientHeight) | 0; - return { - left: 0, - top: 0, - height: height, - width: width, - bottom: height, - right: width - }; - }, - setViewportOffset: function(element, offset) { - var rect; - var fixedLayer = uiUtils.getFixedLayer(); - if (element.parentNode === fixedLayer) { - element.style.left = offset.left + "px"; - element.style.top = offset.top + "px"; - } else { - domUtils.setViewportOffset(element, offset); - } - }, - getEventOffset: function(evt) { - var el = evt.target || evt.srcElement; - var rect = uiUtils.getClientRect(el); - var offset = uiUtils.getViewportOffsetByEvent(evt); - return { - left: offset.left - rect.left, - top: offset.top - rect.top - }; - }, - getViewportOffsetByEvent: function(evt) { - var el = evt.target || evt.srcElement; - var frameEl = domUtils.getWindow(el).frameElement; - var offset = { - left: evt.clientX, - top: evt.clientY - }; - if (frameEl && el.ownerDocument !== document) { - var rect = uiUtils.getClientRect(frameEl); - offset.left += rect.left; - offset.top += rect.top; - } - return offset; - }, - setGlobal: function(id, obj) { - root[id] = obj; - return magic + '["' + id + '"]'; - }, - unsetGlobal: function(id) { - delete root[id]; - }, - copyAttributes: function(tgt, src) { - var attributes = src.attributes; - var k = attributes.length; - while (k--) { - var attrNode = attributes[k]; - if ( - attrNode.nodeName != "style" && - attrNode.nodeName != "class" && - (!browser.ie || attrNode.specified) - ) { - tgt.setAttribute(attrNode.nodeName, attrNode.nodeValue); - } - } - if (src.className) { - domUtils.addClass(tgt, src.className); - } - if (src.style.cssText) { - tgt.style.cssText += ";" + src.style.cssText; - } - }, - removeStyle: function(el, styleName) { - if (el.style.removeProperty) { - el.style.removeProperty(styleName); - } else if (el.style.removeAttribute) { - el.style.removeAttribute(styleName); - } else throw ""; - }, - contains: function(elA, elB) { - return ( - elA && - elB && - (elA === elB - ? false - : elA.contains - ? elA.contains(elB) - : elA.compareDocumentPosition(elB) & 16) - ); - }, - startDrag: function(evt, callbacks, doc) { - var doc = doc || document; - var startX = evt.clientX; - var startY = evt.clientY; - function handleMouseMove(evt) { - var x = evt.clientX - startX; - var y = evt.clientY - startY; - callbacks.ondragmove(x, y, evt); - if (evt.stopPropagation) { - evt.stopPropagation(); - } else { - evt.cancelBubble = true; - } - } - if (doc.addEventListener) { - function handleMouseUp(evt) { - doc.removeEventListener("mousemove", handleMouseMove, true); - doc.removeEventListener("mouseup", handleMouseUp, true); - window.removeEventListener("mouseup", handleMouseUp, true); - callbacks.ondragstop(); - } - doc.addEventListener("mousemove", handleMouseMove, true); - doc.addEventListener("mouseup", handleMouseUp, true); - window.addEventListener("mouseup", handleMouseUp, true); - - evt.preventDefault(); - } else { - var elm = evt.srcElement; - elm.setCapture(); - function releaseCaptrue() { - elm.releaseCapture(); - elm.detachEvent("onmousemove", handleMouseMove); - elm.detachEvent("onmouseup", releaseCaptrue); - elm.detachEvent("onlosecaptrue", releaseCaptrue); - callbacks.ondragstop(); - } - elm.attachEvent("onmousemove", handleMouseMove); - elm.attachEvent("onmouseup", releaseCaptrue); - elm.attachEvent("onlosecaptrue", releaseCaptrue); - evt.returnValue = false; - } - callbacks.ondragstart(); - }, - getFixedLayer: function() { - var layer = document.getElementById("edui_fixedlayer"); - if (layer == null) { - layer = document.createElement("div"); - layer.id = "edui_fixedlayer"; - document.body.appendChild(layer); - if (browser.ie && browser.version <= 8) { - layer.style.position = "absolute"; - bindFixedLayer(); - setTimeout(updateFixedOffset); - } else { - layer.style.position = "fixed"; - } - layer.style.left = "0"; - layer.style.top = "0"; - layer.style.width = "0"; - layer.style.height = "0"; - } - return layer; - }, - makeUnselectable: function(element) { - if (browser.opera || (browser.ie && browser.version < 9)) { - element.unselectable = "on"; - if (element.hasChildNodes()) { - for (var i = 0; i < element.childNodes.length; i++) { - if (element.childNodes[i].nodeType == 1) { - uiUtils.makeUnselectable(element.childNodes[i]); - } - } - } - } else { - if (element.style.MozUserSelect !== undefined) { - element.style.MozUserSelect = "none"; - } else if (element.style.WebkitUserSelect !== undefined) { - element.style.WebkitUserSelect = "none"; - } else if (element.style.KhtmlUserSelect !== undefined) { - element.style.KhtmlUserSelect = "none"; - } - } - } - }); - function updateFixedOffset() { - var layer = document.getElementById("edui_fixedlayer"); - uiUtils.setViewportOffset(layer, { - left: 0, - top: 0 - }); - // layer.style.display = 'none'; - // layer.style.display = 'block'; - - //#trace: 1354 - // setTimeout(updateFixedOffset); - } - function bindFixedLayer(adjOffset) { - domUtils.on(window, "scroll", updateFixedOffset); - domUtils.on( - window, - "resize", - baidu.editor.utils.defer(updateFixedOffset, 0, true) - ); - } -})(); - - -// ui/uibase.js -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - EventBase = baidu.editor.EventBase, - UIBase = (baidu.editor.ui.UIBase = function() {}); - - UIBase.prototype = { - className: "", - uiName: "", - initOptions: function(options) { - var me = this; - for (var k in options) { - me[k] = options[k]; - } - this.id = this.id || "edui" + uiUtils.uid(); - }, - initUIBase: function() { - this._globalKey = utils.unhtml(uiUtils.setGlobal(this.id, this)); - }, - render: function(holder) { - var html = this.renderHtml(); - var el = uiUtils.createElementByHtml(html); - - //by xuheng 给每个node添加class - var list = domUtils.getElementsByTagName(el, "*"); - var theme = "edui-" + (this.theme || this.editor.options.theme); - var layer = document.getElementById("edui_fixedlayer"); - for (var i = 0, node; (node = list[i++]); ) { - domUtils.addClass(node, theme); - } - domUtils.addClass(el, theme); - if (layer) { - layer.className = ""; - domUtils.addClass(layer, theme); - } - - var seatEl = this.getDom(); - if (seatEl != null) { - seatEl.parentNode.replaceChild(el, seatEl); - uiUtils.copyAttributes(el, seatEl); - } else { - if (typeof holder == "string") { - holder = document.getElementById(holder); - } - holder = holder || uiUtils.getFixedLayer(); - domUtils.addClass(holder, theme); - holder.appendChild(el); - } - this.postRender(); - }, - getDom: function(name) { - if (!name) { - return document.getElementById(this.id); - } else { - return document.getElementById(this.id + "_" + name); - } - }, - postRender: function() { - this.fireEvent("postrender"); - }, - getHtmlTpl: function() { - return ""; - }, - formatHtml: function(tpl) { - var prefix = "edui-" + this.uiName; - return tpl - .replace(/##/g, this.id) - .replace(/%%-/g, this.uiName ? prefix + "-" : "") - .replace(/%%/g, (this.uiName ? prefix : "") + " " + this.className) - .replace(/\$\$/g, this._globalKey); - }, - renderHtml: function() { - return this.formatHtml(this.getHtmlTpl()); - }, - dispose: function() { - var box = this.getDom(); - if (box) baidu.editor.dom.domUtils.remove(box); - uiUtils.unsetGlobal(this.id); - } - }; - utils.inherits(UIBase, EventBase); -})(); - - -// ui/separator.js -;(function() { - var utils = baidu.editor.utils, - UIBase = baidu.editor.ui.UIBase, - Separator = (baidu.editor.ui.Separator = function(options) { - this.initOptions(options); - this.initSeparator(); - }); - Separator.prototype = { - uiName: "separator", - initSeparator: function() { - this.initUIBase(); - }, - getHtmlTpl: function() { - return '
                      '; - } - }; - utils.inherits(Separator, UIBase); -})(); - - -// ui/mask.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - domUtils = baidu.editor.dom.domUtils, - UIBase = baidu.editor.ui.UIBase, - uiUtils = baidu.editor.ui.uiUtils; - - var Mask = (baidu.editor.ui.Mask = function(options) { - this.initOptions(options); - this.initUIBase(); - }); - Mask.prototype = { - getHtmlTpl: function() { - return '
                      '; - }, - postRender: function() { - var me = this; - domUtils.on(window, "resize", function() { - setTimeout(function() { - if (!me.isHidden()) { - me._fill(); - } - }); - }); - }, - show: function(zIndex) { - this._fill(); - this.getDom().style.display = ""; - this.getDom().style.zIndex = zIndex; - }, - hide: function() { - this.getDom().style.display = "none"; - this.getDom().style.zIndex = ""; - }, - isHidden: function() { - return this.getDom().style.display == "none"; - }, - _onMouseDown: function() { - return false; - }, - _onClick: function(e, target) { - this.fireEvent("click", e, target); - }, - _fill: function() { - var el = this.getDom(); - var vpRect = uiUtils.getViewportRect(); - el.style.width = vpRect.width + "px"; - el.style.height = vpRect.height + "px"; - } - }; - utils.inherits(Mask, UIBase); -})(); - - -// ui/popup.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - domUtils = baidu.editor.dom.domUtils, - UIBase = baidu.editor.ui.UIBase, - Popup = (baidu.editor.ui.Popup = function(options) { - this.initOptions(options); - this.initPopup(); - }); - - var allPopups = []; - function closeAllPopup(evt, el) { - for (var i = 0; i < allPopups.length; i++) { - var pop = allPopups[i]; - if (!pop.isHidden()) { - if (pop.queryAutoHide(el) !== false) { - if ( - evt && - /scroll/gi.test(evt.type) && - pop.className == "edui-wordpastepop" - ) - return; - pop.hide(); - } - } - } - - if (allPopups.length) pop.editor.fireEvent("afterhidepop"); - } - - Popup.postHide = closeAllPopup; - - var ANCHOR_CLASSES = [ - "edui-anchor-topleft", - "edui-anchor-topright", - "edui-anchor-bottomleft", - "edui-anchor-bottomright" - ]; - Popup.prototype = { - SHADOW_RADIUS: 5, - content: null, - _hidden: false, - autoRender: true, - canSideLeft: true, - canSideUp: true, - initPopup: function() { - this.initUIBase(); - allPopups.push(this); - }, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ' + - ' ' + - '
                      ' + - '
                      ' + - this.getContentHtmlTpl() + - "
                      " + - "
                      " + - "
                      " - ); - }, - getContentHtmlTpl: function() { - if (this.content) { - if (typeof this.content == "string") { - return this.content; - } - return this.content.renderHtml(); - } else { - return ""; - } - }, - _UIBase_postRender: UIBase.prototype.postRender, - postRender: function() { - if (this.content instanceof UIBase) { - this.content.postRender(); - } - - //捕获鼠标滚轮 - if (this.captureWheel && !this.captured) { - this.captured = true; - - var winHeight = - (document.documentElement.clientHeight || - document.body.clientHeight) - 80, - _height = this.getDom().offsetHeight, - _top = uiUtils.getClientRect(this.combox.getDom()).top, - content = this.getDom("content"), - ifr = this.getDom("body").getElementsByTagName("iframe"), - me = this; - - ifr.length && (ifr = ifr[0]); - - while (_top + _height > winHeight) { - _height -= 30; - } - content.style.height = _height + "px"; - //同步更改iframe高度 - ifr && (ifr.style.height = _height + "px"); - - //阻止在combox上的鼠标滚轮事件, 防止用户的正常操作被误解 - if (window.XMLHttpRequest) { - domUtils.on( - content, - "onmousewheel" in document.body ? "mousewheel" : "DOMMouseScroll", - function(e) { - if (e.preventDefault) { - e.preventDefault(); - } else { - e.returnValue = false; - } - - if (e.wheelDelta) { - content.scrollTop -= e.wheelDelta / 120 * 60; - } else { - content.scrollTop -= e.detail / -3 * 60; - } - } - ); - } else { - //ie6 - domUtils.on(this.getDom(), "mousewheel", function(e) { - e.returnValue = false; - - me.getDom("content").scrollTop -= e.wheelDelta / 120 * 60; - }); - } - } - this.fireEvent("postRenderAfter"); - this.hide(true); - this._UIBase_postRender(); - }, - _doAutoRender: function() { - if (!this.getDom() && this.autoRender) { - this.render(); - } - }, - mesureSize: function() { - var box = this.getDom("content"); - return uiUtils.getClientRect(box); - }, - fitSize: function() { - if (this.captureWheel && this.sized) { - return this.__size; - } - this.sized = true; - var popBodyEl = this.getDom("body"); - popBodyEl.style.width = ""; - popBodyEl.style.height = ""; - var size = this.mesureSize(); - if (this.captureWheel) { - popBodyEl.style.width = -(-20 - size.width) + "px"; - var height = parseInt(this.getDom("content").style.height, 10); - !window.isNaN(height) && (size.height = height); - } else { - popBodyEl.style.width = size.width + "px"; - } - popBodyEl.style.height = size.height + "px"; - this.__size = size; - this.captureWheel && (this.getDom("content").style.overflow = "auto"); - return size; - }, - showAnchor: function(element, hoz) { - this.showAnchorRect(uiUtils.getClientRect(element), hoz); - }, - showAnchorRect: function(rect, hoz, adj) { - this._doAutoRender(); - var vpRect = uiUtils.getViewportRect(); - this.getDom().style.visibility = "hidden"; - this._show(); - var popSize = this.fitSize(); - - var sideLeft, sideUp, left, top; - if (hoz) { - sideLeft = - this.canSideLeft && - (rect.right + popSize.width > vpRect.right && - rect.left > popSize.width); - sideUp = - this.canSideUp && - (rect.top + popSize.height > vpRect.bottom && - rect.bottom > popSize.height); - left = sideLeft ? rect.left - popSize.width : rect.right; - top = sideUp ? rect.bottom - popSize.height : rect.top; - } else { - sideLeft = - this.canSideLeft && - (rect.right + popSize.width > vpRect.right && - rect.left > popSize.width); - sideUp = - this.canSideUp && - (rect.top + popSize.height > vpRect.bottom && - rect.bottom > popSize.height); - left = sideLeft ? rect.right - popSize.width : rect.left; - top = sideUp ? rect.top - popSize.height : rect.bottom; - } - - var popEl = this.getDom(); - uiUtils.setViewportOffset(popEl, { - left: left, - top: top - }); - domUtils.removeClasses(popEl, ANCHOR_CLASSES); - popEl.className += - " " + ANCHOR_CLASSES[(sideUp ? 1 : 0) * 2 + (sideLeft ? 1 : 0)]; - if (this.editor) { - popEl.style.zIndex = this.editor.container.style.zIndex * 1 + 10; - baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex = - popEl.style.zIndex - 1; - } - this.getDom().style.visibility = "visible"; - }, - showAt: function(offset) { - var left = offset.left; - var top = offset.top; - var rect = { - left: left, - top: top, - right: left, - bottom: top, - height: 0, - width: 0 - }; - this.showAnchorRect(rect, false, true); - }, - _show: function() { - if (this._hidden) { - var box = this.getDom(); - box.style.display = ""; - this._hidden = false; - // if (box.setActive) { - // box.setActive(); - // } - this.fireEvent("show"); - } - }, - isHidden: function() { - return this._hidden; - }, - show: function() { - this._doAutoRender(); - this._show(); - }, - hide: function(notNofity) { - if (!this._hidden && this.getDom()) { - this.getDom().style.display = "none"; - this._hidden = true; - if (!notNofity) { - this.fireEvent("hide"); - } - } - }, - queryAutoHide: function(el) { - return !el || !uiUtils.contains(this.getDom(), el); - } - }; - utils.inherits(Popup, UIBase); - - domUtils.on(document, "mousedown", function(evt) { - var el = evt.target || evt.srcElement; - closeAllPopup(evt, el); - }); - domUtils.on(window, "scroll", function(evt, el) { - closeAllPopup(evt, el); - }); -})(); - - -// ui/colorpicker.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - UIBase = baidu.editor.ui.UIBase, - ColorPicker = (baidu.editor.ui.ColorPicker = function(options) { - this.initOptions(options); - this.noColorText = this.noColorText || this.editor.getLang("clearColor"); - this.initUIBase(); - }); - - ColorPicker.prototype = { - getHtmlTpl: function() { - return genColorPicker(this.noColorText, this.editor); - }, - _onTableClick: function(evt) { - var tgt = evt.target || evt.srcElement; - var color = tgt.getAttribute("data-color"); - if (color) { - this.fireEvent("pickcolor", color); - } - }, - _onTableOver: function(evt) { - var tgt = evt.target || evt.srcElement; - var color = tgt.getAttribute("data-color"); - if (color) { - this.getDom("preview").style.backgroundColor = color; - } - }, - _onTableOut: function() { - this.getDom("preview").style.backgroundColor = ""; - }, - _onPickNoColor: function() { - this.fireEvent("picknocolor"); - } - }; - utils.inherits(ColorPicker, UIBase); - - var COLORS = ("ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646," + - "f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada," + - "d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5," + - "bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f," + - "a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09," + - "7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806," + - "c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,").split( - "," - ); - - function genColorPicker(noColorText, editor) { - var html = - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - noColorText + - "
                      " + - "
                      " + - '' + - '" + - ''; - for (var i = 0; i < COLORS.length; i++) { - if (i && i % 10 === 0) { - html += - "" + - (i == 60 - ? '" - : "") + - ""; - } - html += i < 70 - ? '" - : ""; - } - html += "
                      ' + - editor.getLang("themeColor") + - "
                      ' + - editor.getLang("standardColor") + - "
                      = 60 - ? "border-width:1px;" - : i >= 10 && i < 20 - ? "border-width:1px 1px 0 1px;" - : "border-width:0 1px 0 1px;") + - '"' + - ">
                      "; - return html; - } -})(); - - -// ui/tablepicker.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - UIBase = baidu.editor.ui.UIBase; - - var TablePicker = (baidu.editor.ui.TablePicker = function(options) { - this.initOptions(options); - this.initTablePicker(); - }); - TablePicker.prototype = { - defaultNumRows: 10, - defaultNumCols: 10, - maxNumRows: 20, - maxNumCols: 20, - numRows: 10, - numCols: 10, - lengthOfCellSide: 22, - initTablePicker: function() { - this.initUIBase(); - }, - getHtmlTpl: function() { - var me = this; - return ( - '
                      ' + - '
                      ' + - '
                      ' + - '' + - "
                      " + - '
                      " + - '
                      ' + - "
                      " + - "
                      " + - "
                      " - ); - }, - _UIBase_render: UIBase.prototype.render, - render: function(holder) { - this._UIBase_render(holder); - this.getDom("label").innerHTML = - "0" + - this.editor.getLang("t_row") + - " x 0" + - this.editor.getLang("t_col"); - }, - _track: function(numCols, numRows) { - var style = this.getDom("overlay").style; - var sideLen = this.lengthOfCellSide; - style.width = numCols * sideLen + "px"; - style.height = numRows * sideLen + "px"; - var label = this.getDom("label"); - label.innerHTML = - numCols + - this.editor.getLang("t_col") + - " x " + - numRows + - this.editor.getLang("t_row"); - this.numCols = numCols; - this.numRows = numRows; - }, - _onMouseOver: function(evt, el) { - var rel = evt.relatedTarget || evt.fromElement; - if (!uiUtils.contains(el, rel) && el !== rel) { - this.getDom("label").innerHTML = - "0" + - this.editor.getLang("t_col") + - " x 0" + - this.editor.getLang("t_row"); - this.getDom("overlay").style.visibility = ""; - } - }, - _onMouseOut: function(evt, el) { - var rel = evt.relatedTarget || evt.toElement; - if (!uiUtils.contains(el, rel) && el !== rel) { - this.getDom("label").innerHTML = - "0" + - this.editor.getLang("t_col") + - " x 0" + - this.editor.getLang("t_row"); - this.getDom("overlay").style.visibility = "hidden"; - } - }, - _onMouseMove: function(evt, el) { - var style = this.getDom("overlay").style; - var offset = uiUtils.getEventOffset(evt); - var sideLen = this.lengthOfCellSide; - var numCols = Math.ceil(offset.left / sideLen); - var numRows = Math.ceil(offset.top / sideLen); - this._track(numCols, numRows); - }, - _onClick: function() { - this.fireEvent("picktable", this.numCols, this.numRows); - } - }; - utils.inherits(TablePicker, UIBase); -})(); - - -// ui/stateful.js -;(function() { - var browser = baidu.editor.browser, - domUtils = baidu.editor.dom.domUtils, - uiUtils = baidu.editor.ui.uiUtils; - - var TPL_STATEFUL = - 'onmousedown="$$.Stateful_onMouseDown(event, this);"' + - ' onmouseup="$$.Stateful_onMouseUp(event, this);"' + - (browser.ie - ? ' onmouseenter="$$.Stateful_onMouseEnter(event, this);"' + - ' onmouseleave="$$.Stateful_onMouseLeave(event, this);"' - : ' onmouseover="$$.Stateful_onMouseOver(event, this);"' + - ' onmouseout="$$.Stateful_onMouseOut(event, this);"'); - - baidu.editor.ui.Stateful = { - alwalysHoverable: false, - target: null, //目标元素和this指向dom不一样 - Stateful_init: function() { - this._Stateful_dGetHtmlTpl = this.getHtmlTpl; - this.getHtmlTpl = this.Stateful_getHtmlTpl; - }, - Stateful_getHtmlTpl: function() { - var tpl = this._Stateful_dGetHtmlTpl(); - // 使用function避免$转义 - return tpl.replace(/stateful/g, function() { - return TPL_STATEFUL; - }); - }, - Stateful_onMouseEnter: function(evt, el) { - this.target = el; - if (!this.isDisabled() || this.alwalysHoverable) { - this.addState("hover"); - this.fireEvent("over"); - } - }, - Stateful_onMouseLeave: function(evt, el) { - if (!this.isDisabled() || this.alwalysHoverable) { - this.removeState("hover"); - this.removeState("active"); - this.fireEvent("out"); - } - }, - Stateful_onMouseOver: function(evt, el) { - var rel = evt.relatedTarget; - if (!uiUtils.contains(el, rel) && el !== rel) { - this.Stateful_onMouseEnter(evt, el); - } - }, - Stateful_onMouseOut: function(evt, el) { - var rel = evt.relatedTarget; - if (!uiUtils.contains(el, rel) && el !== rel) { - this.Stateful_onMouseLeave(evt, el); - } - }, - Stateful_onMouseDown: function(evt, el) { - if (!this.isDisabled()) { - this.addState("active"); - } - }, - Stateful_onMouseUp: function(evt, el) { - if (!this.isDisabled()) { - this.removeState("active"); - } - }, - Stateful_postRender: function() { - if (this.disabled && !this.hasState("disabled")) { - this.addState("disabled"); - } - }, - hasState: function(state) { - return domUtils.hasClass(this.getStateDom(), "edui-state-" + state); - }, - addState: function(state) { - if (!this.hasState(state)) { - this.getStateDom().className += " edui-state-" + state; - } - }, - removeState: function(state) { - if (this.hasState(state)) { - domUtils.removeClasses(this.getStateDom(), ["edui-state-" + state]); - } - }, - getStateDom: function() { - return this.getDom("state"); - }, - isChecked: function() { - return this.hasState("checked"); - }, - setChecked: function(checked) { - if (!this.isDisabled() && checked) { - this.addState("checked"); - } else { - this.removeState("checked"); - } - }, - isDisabled: function() { - return this.hasState("disabled"); - }, - setDisabled: function(disabled) { - if (disabled) { - this.removeState("hover"); - this.removeState("checked"); - this.removeState("active"); - this.addState("disabled"); - } else { - this.removeState("disabled"); - } - } - }; -})(); - - -// ui/button.js -///import core -///import uicore -///import ui/stateful.js -;(function() { - var utils = baidu.editor.utils, - UIBase = baidu.editor.ui.UIBase, - Stateful = baidu.editor.ui.Stateful, - Button = (baidu.editor.ui.Button = function(options) { - if (options.name) { - var btnName = options.name; - var cssRules = options.cssRules; - if (!options.className) { - options.className = "edui-for-" + btnName; - } - options.cssRules = - ".edui-" + - (options.theme || "default") + - " .edui-toolbar .edui-button.edui-for-" + - btnName + - " .edui-icon {" + - cssRules + - "}"; - } - this.initOptions(options); - this.initButton(); - }); - Button.prototype = { - uiName: "button", - label: "", - title: "", - showIcon: true, - showText: true, - cssRules: "", - initButton: function() { - this.initUIBase(); - this.Stateful_init(); - if (this.cssRules) { - utils.cssRule("edui-customize-" + this.name + "-style", this.cssRules); - } - }, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ' + - '
                      ' + - (this.showIcon ? '
                      ' : "") + - (this.showText - ? '
                      ' + this.label + "
                      " - : "") + - "
                      " + - "
                      " + - "
                      " - ); - }, - postRender: function() { - this.Stateful_postRender(); - this.setDisabled(this.disabled); - }, - _onMouseDown: function(e) { - var target = e.target || e.srcElement, - tagName = target && target.tagName && target.tagName.toLowerCase(); - if (tagName == "input" || tagName == "object" || tagName == "object") { - return false; - } - }, - _onClick: function() { - if (!this.isDisabled()) { - this.fireEvent("click"); - } - }, - setTitle: function(text) { - var label = this.getDom("label"); - label.innerHTML = text; - } - }; - utils.inherits(Button, UIBase); - utils.extend(Button.prototype, Stateful); -})(); - - -// ui/splitbutton.js -///import core -///import uicore -///import ui/stateful.js -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - domUtils = baidu.editor.dom.domUtils, - UIBase = baidu.editor.ui.UIBase, - Stateful = baidu.editor.ui.Stateful, - SplitButton = (baidu.editor.ui.SplitButton = function(options) { - this.initOptions(options); - this.initSplitButton(); - }); - SplitButton.prototype = { - popup: null, - uiName: "splitbutton", - title: "", - initSplitButton: function() { - this.initUIBase(); - this.Stateful_init(); - var me = this; - if (this.popup != null) { - var popup = this.popup; - this.popup = null; - this.setPopup(popup); - } - }, - _UIBase_postRender: UIBase.prototype.postRender, - postRender: function() { - this.Stateful_postRender(); - this._UIBase_postRender(); - }, - setPopup: function(popup) { - if (this.popup === popup) return; - if (this.popup != null) { - this.popup.dispose(); - } - popup.addListener("show", utils.bind(this._onPopupShow, this)); - popup.addListener("hide", utils.bind(this._onPopupHide, this)); - popup.addListener( - "postrender", - utils.bind(function() { - popup - .getDom("body") - .appendChild( - uiUtils.createElementByHtml( - '
                      ' - ) - ); - popup.getDom().className += " " + this.className; - }, this) - ); - this.popup = popup; - }, - _onPopupShow: function() { - this.addState("opened"); - }, - _onPopupHide: function() { - this.removeState("opened"); - }, - getHtmlTpl: function() { - return ( - '
                      ' + - "
                      ' + - '
                      ' + - '
                      ' + - "
                      " + - '
                      ' + - '
                      ' + - "
                      " - ); - }, - showPopup: function() { - // 当popup往上弹出的时候,做特殊处理 - var rect = uiUtils.getClientRect(this.getDom()); - rect.top -= this.popup.SHADOW_RADIUS; - rect.height += this.popup.SHADOW_RADIUS; - this.popup.showAnchorRect(rect); - }, - _onArrowClick: function(event, el) { - if (!this.isDisabled()) { - this.showPopup(); - } - }, - _onButtonClick: function() { - if (!this.isDisabled()) { - this.fireEvent("buttonclick"); - } - } - }; - utils.inherits(SplitButton, UIBase); - utils.extend(SplitButton.prototype, Stateful, true); -})(); - - -// ui/colorbutton.js -///import core -///import uicore -///import ui/colorpicker.js -///import ui/popup.js -///import ui/splitbutton.js -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - ColorPicker = baidu.editor.ui.ColorPicker, - Popup = baidu.editor.ui.Popup, - SplitButton = baidu.editor.ui.SplitButton, - ColorButton = (baidu.editor.ui.ColorButton = function(options) { - this.initOptions(options); - this.initColorButton(); - }); - ColorButton.prototype = { - initColorButton: function() { - var me = this; - this.popup = new Popup({ - content: new ColorPicker({ - noColorText: me.editor.getLang("clearColor"), - editor: me.editor, - onpickcolor: function(t, color) { - me._onPickColor(color); - }, - onpicknocolor: function(t, color) { - me._onPickNoColor(color); - } - }), - editor: me.editor - }); - this.initSplitButton(); - }, - _SplitButton_postRender: SplitButton.prototype.postRender, - postRender: function() { - this._SplitButton_postRender(); - this.getDom("button_body").appendChild( - uiUtils.createElementByHtml( - '
                      ' - ) - ); - this.getDom().className += " edui-colorbutton"; - }, - setColor: function(color) { - this.getDom("colorlump").style.backgroundColor = color; - this.color = color; - }, - _onPickColor: function(color) { - if (this.fireEvent("pickcolor", color) !== false) { - this.setColor(color); - this.popup.hide(); - } - }, - _onPickNoColor: function(color) { - if (this.fireEvent("picknocolor") !== false) { - this.popup.hide(); - } - } - }; - utils.inherits(ColorButton, SplitButton); -})(); - - -// ui/tablebutton.js -///import core -///import uicore -///import ui/popup.js -///import ui/tablepicker.js -///import ui/splitbutton.js -;(function() { - var utils = baidu.editor.utils, - Popup = baidu.editor.ui.Popup, - TablePicker = baidu.editor.ui.TablePicker, - SplitButton = baidu.editor.ui.SplitButton, - TableButton = (baidu.editor.ui.TableButton = function(options) { - this.initOptions(options); - this.initTableButton(); - }); - TableButton.prototype = { - initTableButton: function() { - var me = this; - this.popup = new Popup({ - content: new TablePicker({ - editor: me.editor, - onpicktable: function(t, numCols, numRows) { - me._onPickTable(numCols, numRows); - } - }), - editor: me.editor - }); - this.initSplitButton(); - }, - _onPickTable: function(numCols, numRows) { - if (this.fireEvent("picktable", numCols, numRows) !== false) { - this.popup.hide(); - } - } - }; - utils.inherits(TableButton, SplitButton); -})(); - - -// ui/autotypesetpicker.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - UIBase = baidu.editor.ui.UIBase; - - var AutoTypeSetPicker = (baidu.editor.ui.AutoTypeSetPicker = function( - options - ) { - this.initOptions(options); - this.initAutoTypeSetPicker(); - }); - AutoTypeSetPicker.prototype = { - initAutoTypeSetPicker: function() { - this.initUIBase(); - }, - getHtmlTpl: function() { - var me = this.editor, - opt = me.options.autotypeset, - lang = me.getLang("autoTypeSet"); - - var textAlignInputName = "textAlignValue" + me.uid, - imageBlockInputName = "imageBlockLineValue" + me.uid, - symbolConverInputName = "symbolConverValue" + me.uid; - - return ( - '
                      ' + - '
                      ' + - "" + - '" + - '" + - "" + - '" + - '" + - "" + - "" + - '" + - '" + - "" + - '" + - '" + - '" + - "" + - '" + - '" + - '" + - "" + - "
                      " + - lang.mergeLine + - '" + - lang.delLine + - "
                      " + - lang.removeFormat + - '" + - lang.indent + - "
                      " + - lang.alignment + - "' + - '" + - me.getLang("justifyleft") + - '" + - me.getLang("justifycenter") + - '" + - me.getLang("justifyright") + - "
                      " + - lang.imageFloat + - "' + - '" + - me.getLang("default") + - '" + - me.getLang("justifyleft") + - '" + - me.getLang("justifycenter") + - '" + - me.getLang("justifyright") + - "
                      " + - lang.removeFontsize + - '" + - lang.removeFontFamily + - "
                      " + - lang.removeHtml + - "
                      " + - lang.pasteFilter + - "
                      " + - lang.symbol + - "' + - '" + - lang.bdc2sb + - '" + - lang.tobdc + - "" + - "
                      " + - "
                      " + - "
                      " - ); - }, - _UIBase_render: UIBase.prototype.render - }; - utils.inherits(AutoTypeSetPicker, UIBase); -})(); - - -// ui/autotypesetbutton.js -///import core -///import uicore -///import ui/popup.js -///import ui/autotypesetpicker.js -///import ui/splitbutton.js -;(function() { - var utils = baidu.editor.utils, - Popup = baidu.editor.ui.Popup, - AutoTypeSetPicker = baidu.editor.ui.AutoTypeSetPicker, - SplitButton = baidu.editor.ui.SplitButton, - AutoTypeSetButton = (baidu.editor.ui.AutoTypeSetButton = function(options) { - this.initOptions(options); - this.initAutoTypeSetButton(); - }); - function getPara(me) { - var opt = {}, - cont = me.getDom(), - editorId = me.editor.uid, - inputType = null, - attrName = null, - ipts = domUtils.getElementsByTagName(cont, "input"); - for (var i = ipts.length - 1, ipt; (ipt = ipts[i--]); ) { - inputType = ipt.getAttribute("type"); - if (inputType == "checkbox") { - attrName = ipt.getAttribute("name"); - opt[attrName] && delete opt[attrName]; - if (ipt.checked) { - var attrValue = document.getElementById( - attrName + "Value" + editorId - ); - if (attrValue) { - if (/input/gi.test(attrValue.tagName)) { - opt[attrName] = attrValue.value; - } else { - var iptChilds = attrValue.getElementsByTagName("input"); - for ( - var j = iptChilds.length - 1, iptchild; - (iptchild = iptChilds[j--]); - - ) { - if (iptchild.checked) { - opt[attrName] = iptchild.value; - break; - } - } - } - } else { - opt[attrName] = true; - } - } else { - opt[attrName] = false; - } - } else { - opt[ipt.getAttribute("value")] = ipt.checked; - } - } - - var selects = domUtils.getElementsByTagName(cont, "select"); - for (var i = 0, si; (si = selects[i++]); ) { - var attr = si.getAttribute("name"); - opt[attr] = opt[attr] ? si.value : ""; - } - - utils.extend(me.editor.options.autotypeset, opt); - - me.editor.setPreferences("autotypeset", opt); - } - - AutoTypeSetButton.prototype = { - initAutoTypeSetButton: function() { - var me = this; - this.popup = new Popup({ - //传入配置参数 - content: new AutoTypeSetPicker({ editor: me.editor }), - editor: me.editor, - hide: function() { - if (!this._hidden && this.getDom()) { - getPara(this); - this.getDom().style.display = "none"; - this._hidden = true; - this.fireEvent("hide"); - } - } - }); - var flag = 0; - this.popup.addListener("postRenderAfter", function() { - var popupUI = this; - if (flag) return; - var cont = this.getDom(), - btn = cont.getElementsByTagName("button")[0]; - - btn.onclick = function() { - getPara(popupUI); - me.editor.execCommand("autotypeset"); - popupUI.hide(); - }; - - domUtils.on(cont, "click", function(e) { - var target = e.target || e.srcElement, - editorId = me.editor.uid; - if (target && target.tagName == "INPUT") { - // 点击图片浮动的checkbox,去除对应的radio - if ( - target.name == "imageBlockLine" || - target.name == "textAlign" || - target.name == "symbolConver" - ) { - var checked = target.checked, - radioTd = document.getElementById( - target.name + "Value" + editorId - ), - radios = radioTd.getElementsByTagName("input"), - defalutSelect = { - imageBlockLine: "none", - textAlign: "left", - symbolConver: "tobdc" - }; - - for (var i = 0; i < radios.length; i++) { - if (checked) { - if (radios[i].value == defalutSelect[target.name]) { - radios[i].checked = "checked"; - } - } else { - radios[i].checked = false; - } - } - } - // 点击radio,选中对应的checkbox - if ( - target.name == "imageBlockLineValue" + editorId || - target.name == "textAlignValue" + editorId || - target.name == "bdc" - ) { - var checkboxs = target.parentNode.previousSibling.getElementsByTagName( - "input" - ); - checkboxs && (checkboxs[0].checked = true); - } - - getPara(popupUI); - } - }); - - flag = 1; - }); - this.initSplitButton(); - } - }; - utils.inherits(AutoTypeSetButton, SplitButton); -})(); - - -// ui/cellalignpicker.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - Popup = baidu.editor.ui.Popup, - Stateful = baidu.editor.ui.Stateful, - UIBase = baidu.editor.ui.UIBase; - - /** - * 该参数将新增一个参数: selected, 参数类型为一个Object, 形如{ 'align': 'center', 'valign': 'top' }, 表示单元格的初始 - * 对齐状态为: 竖直居上,水平居中; 其中 align的取值为:'center', 'left', 'right'; valign的取值为: 'top', 'middle', 'bottom' - * @update 2013/4/2 hancong03@baidu.com - */ - var CellAlignPicker = (baidu.editor.ui.CellAlignPicker = function(options) { - this.initOptions(options); - this.initSelected(); - this.initCellAlignPicker(); - }); - CellAlignPicker.prototype = { - //初始化选中状态, 该方法将根据传递进来的参数获取到应该选中的对齐方式图标的索引 - initSelected: function() { - var status = { - valign: { - top: 0, - middle: 1, - bottom: 2 - }, - align: { - left: 0, - center: 1, - right: 2 - }, - count: 3 - }, - result = -1; - - if (this.selected) { - this.selectedIndex = - status.valign[this.selected.valign] * status.count + - status.align[this.selected.align]; - } - }, - initCellAlignPicker: function() { - this.initUIBase(); - this.Stateful_init(); - }, - getHtmlTpl: function() { - var alignType = ["left", "center", "right"], - COUNT = 9, - tempClassName = null, - tempIndex = -1, - tmpl = []; - - for (var i = 0; i < COUNT; i++) { - tempClassName = this.selectedIndex === i - ? ' class="edui-cellalign-selected" ' - : ""; - tempIndex = i % 3; - - tempIndex === 0 && tmpl.push(""); - - tmpl.push( - '
                      ' - ); - - tempIndex === 2 && tmpl.push(""); - } - - return ( - '
                      ' + - '
                      ' + - '' + - tmpl.join("") + - "
                      " + - "
                      " + - "
                      " - ); - }, - getStateDom: function() { - return this.target; - }, - _onClick: function(evt) { - var target = evt.target || evt.srcElement; - if (/icon/.test(target.className)) { - this.items[target.parentNode.getAttribute("index")].onclick(); - Popup.postHide(evt); - } - }, - _UIBase_render: UIBase.prototype.render - }; - utils.inherits(CellAlignPicker, UIBase); - utils.extend(CellAlignPicker.prototype, Stateful, true); -})(); - - -// ui/pastepicker.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - Stateful = baidu.editor.ui.Stateful, - uiUtils = baidu.editor.ui.uiUtils, - UIBase = baidu.editor.ui.UIBase; - - var PastePicker = (baidu.editor.ui.PastePicker = function(options) { - this.initOptions(options); - this.initPastePicker(); - }); - PastePicker.prototype = { - initPastePicker: function() { - this.initUIBase(); - this.Stateful_init(); - }, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ' + - '
                      ' + - this.editor.getLang("pasteOpt") + - "
                      " + - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - "
                      " + - "
                      " + - "
                      " - ); - }, - getStateDom: function() { - return this.target; - }, - format: function(param) { - this.editor.ui._isTransfer = true; - this.editor.fireEvent("pasteTransfer", param); - }, - _onClick: function(cur) { - var node = domUtils.getNextDomNode(cur), - screenHt = uiUtils.getViewportRect().height, - subPop = uiUtils.getClientRect(node); - - if (subPop.top + subPop.height > screenHt) - node.style.top = -subPop.height - cur.offsetHeight + "px"; - else node.style.top = ""; - - if (/hidden/gi.test(domUtils.getComputedStyle(node, "visibility"))) { - node.style.visibility = "visible"; - domUtils.addClass(cur, "edui-state-opened"); - } else { - node.style.visibility = "hidden"; - domUtils.removeClasses(cur, "edui-state-opened"); - } - }, - _UIBase_render: UIBase.prototype.render - }; - utils.inherits(PastePicker, UIBase); - utils.extend(PastePicker.prototype, Stateful, true); -})(); - - -// ui/toolbar.js -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - UIBase = baidu.editor.ui.UIBase, - Toolbar = (baidu.editor.ui.Toolbar = function(options) { - this.initOptions(options); - this.initToolbar(); - }); - Toolbar.prototype = { - items: null, - initToolbar: function() { - this.items = this.items || []; - this.initUIBase(); - }, - add: function(item, index) { - if (index === undefined) { - this.items.push(item); - } else { - this.items.splice(index, 0, item); - } - }, - getHtmlTpl: function() { - var buff = []; - for (var i = 0; i < this.items.length; i++) { - buff[i] = this.items[i].renderHtml(); - } - return ( - '
                      ' + - buff.join("") + - "
                      " - ); - }, - postRender: function() { - var box = this.getDom(); - for (var i = 0; i < this.items.length; i++) { - this.items[i].postRender(); - } - uiUtils.makeUnselectable(box); - }, - _onMouseDown: function(e) { - var target = e.target || e.srcElement, - tagName = target && target.tagName && target.tagName.toLowerCase(); - if (tagName == "input" || tagName == "object" || tagName == "object") { - return false; - } - } - }; - utils.inherits(Toolbar, UIBase); -})(); - - -// ui/menu.js -///import core -///import uicore -///import ui\popup.js -///import ui\stateful.js -;(function() { - var utils = baidu.editor.utils, - domUtils = baidu.editor.dom.domUtils, - uiUtils = baidu.editor.ui.uiUtils, - UIBase = baidu.editor.ui.UIBase, - Popup = baidu.editor.ui.Popup, - Stateful = baidu.editor.ui.Stateful, - CellAlignPicker = baidu.editor.ui.CellAlignPicker, - Menu = (baidu.editor.ui.Menu = function(options) { - this.initOptions(options); - this.initMenu(); - }); - - var menuSeparator = { - renderHtml: function() { - return '
                      '; - }, - postRender: function() {}, - queryAutoHide: function() { - return true; - } - }; - Menu.prototype = { - items: null, - uiName: "menu", - initMenu: function() { - this.items = this.items || []; - this.initPopup(); - this.initItems(); - }, - initItems: function() { - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - if (item == "-") { - this.items[i] = this.getSeparator(); - } else if (!(item instanceof MenuItem)) { - item.editor = this.editor; - item.theme = this.editor.options.theme; - this.items[i] = this.createItem(item); - } - } - }, - getSeparator: function() { - return menuSeparator; - }, - createItem: function(item) { - //新增一个参数menu, 该参数存储了menuItem所对应的menu引用 - item.menu = this; - return new MenuItem(item); - }, - _Popup_getContentHtmlTpl: Popup.prototype.getContentHtmlTpl, - getContentHtmlTpl: function() { - if (this.items.length == 0) { - return this._Popup_getContentHtmlTpl(); - } - var buff = []; - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - buff[i] = item.renderHtml(); - } - return '
                      ' + buff.join("") + "
                      "; - }, - _Popup_postRender: Popup.prototype.postRender, - postRender: function() { - var me = this; - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - item.ownerMenu = this; - item.postRender(); - } - domUtils.on(this.getDom(), "mouseover", function(evt) { - evt = evt || event; - var rel = evt.relatedTarget || evt.fromElement; - var el = me.getDom(); - if (!uiUtils.contains(el, rel) && el !== rel) { - me.fireEvent("over"); - } - }); - this._Popup_postRender(); - }, - queryAutoHide: function(el) { - if (el) { - if (uiUtils.contains(this.getDom(), el)) { - return false; - } - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - if (item.queryAutoHide(el) === false) { - return false; - } - } - } - }, - clearItems: function() { - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - clearTimeout(item._showingTimer); - clearTimeout(item._closingTimer); - if (item.subMenu) { - item.subMenu.destroy(); - } - } - this.items = []; - }, - destroy: function() { - if (this.getDom()) { - domUtils.remove(this.getDom()); - } - this.clearItems(); - }, - dispose: function() { - this.destroy(); - } - }; - utils.inherits(Menu, Popup); - - /** - * @update 2013/04/03 hancong03 新增一个参数menu, 该参数存储了menuItem所对应的menu引用 - * @type {Function} - */ - var MenuItem = (baidu.editor.ui.MenuItem = function(options) { - this.initOptions(options); - this.initUIBase(); - this.Stateful_init(); - if (this.subMenu && !(this.subMenu instanceof Menu)) { - if (options.className && options.className.indexOf("aligntd") != -1) { - var me = this; - - //获取单元格对齐初始状态 - this.subMenu.selected = this.editor.queryCommandValue("cellalignment"); - - this.subMenu = new Popup({ - content: new CellAlignPicker(this.subMenu), - parentMenu: me, - editor: me.editor, - destroy: function() { - if (this.getDom()) { - domUtils.remove(this.getDom()); - } - } - }); - this.subMenu.addListener("postRenderAfter", function() { - domUtils.on(this.getDom(), "mouseover", function() { - me.addState("opened"); - }); - }); - } else { - this.subMenu = new Menu(this.subMenu); - } - } - }); - MenuItem.prototype = { - label: "", - subMenu: null, - ownerMenu: null, - uiName: "menuitem", - alwalysHoverable: true, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ' + - this.renderLabelHtml() + - "
                      " + - "
                      " - ); - }, - postRender: function() { - var me = this; - this.addListener("over", function() { - me.ownerMenu.fireEvent("submenuover", me); - if (me.subMenu) { - me.delayShowSubMenu(); - } - }); - if (this.subMenu) { - this.getDom().className += " edui-hassubmenu"; - this.subMenu.render(); - this.addListener("out", function() { - me.delayHideSubMenu(); - }); - this.subMenu.addListener("over", function() { - clearTimeout(me._closingTimer); - me._closingTimer = null; - me.addState("opened"); - }); - this.ownerMenu.addListener("hide", function() { - me.hideSubMenu(); - }); - this.ownerMenu.addListener("submenuover", function(t, subMenu) { - if (subMenu !== me) { - me.delayHideSubMenu(); - } - }); - this.subMenu._bakQueryAutoHide = this.subMenu.queryAutoHide; - this.subMenu.queryAutoHide = function(el) { - if (el && uiUtils.contains(me.getDom(), el)) { - return false; - } - return this._bakQueryAutoHide(el); - }; - } - this.getDom().style.tabIndex = "-1"; - uiUtils.makeUnselectable(this.getDom()); - this.Stateful_postRender(); - }, - delayShowSubMenu: function() { - var me = this; - if (!me.isDisabled()) { - me.addState("opened"); - clearTimeout(me._showingTimer); - clearTimeout(me._closingTimer); - me._closingTimer = null; - me._showingTimer = setTimeout(function() { - me.showSubMenu(); - }, 250); - } - }, - delayHideSubMenu: function() { - var me = this; - if (!me.isDisabled()) { - me.removeState("opened"); - clearTimeout(me._showingTimer); - if (!me._closingTimer) { - me._closingTimer = setTimeout(function() { - if (!me.hasState("opened")) { - me.hideSubMenu(); - } - me._closingTimer = null; - }, 400); - } - } - }, - renderLabelHtml: function() { - return ( - '
                      ' + - '
                      ' + - '
                      ' + - (this.label || "") + - "
                      " - ); - }, - getStateDom: function() { - return this.getDom(); - }, - queryAutoHide: function(el) { - if (this.subMenu && this.hasState("opened")) { - return this.subMenu.queryAutoHide(el); - } - }, - _onClick: function(event, this_) { - if (this.hasState("disabled")) return; - if (this.fireEvent("click", event, this_) !== false) { - if (this.subMenu) { - this.showSubMenu(); - } else { - Popup.postHide(event); - } - } - }, - showSubMenu: function() { - var rect = uiUtils.getClientRect(this.getDom()); - rect.right -= 5; - rect.left += 2; - rect.width -= 7; - rect.top -= 4; - rect.bottom += 4; - rect.height += 8; - this.subMenu.showAnchorRect(rect, true, true); - }, - hideSubMenu: function() { - this.subMenu.hide(); - } - }; - utils.inherits(MenuItem, UIBase); - utils.extend(MenuItem.prototype, Stateful, true); -})(); - - -// ui/combox.js -///import core -///import uicore -///import ui/menu.js -///import ui/splitbutton.js -;(function() { - // todo: menu和item提成通用list - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - Menu = baidu.editor.ui.Menu, - SplitButton = baidu.editor.ui.SplitButton, - Combox = (baidu.editor.ui.Combox = function(options) { - this.initOptions(options); - this.initCombox(); - }); - Combox.prototype = { - uiName: "combox", - onbuttonclick: function() { - this.showPopup(); - }, - initCombox: function() { - var me = this; - this.items = this.items || []; - for (var i = 0; i < this.items.length; i++) { - var item = this.items[i]; - item.uiName = "listitem"; - item.index = i; - item.onclick = function() { - me.selectByIndex(this.index); - }; - } - this.popup = new Menu({ - items: this.items, - uiName: "list", - editor: this.editor, - captureWheel: true, - combox: this - }); - - this.initSplitButton(); - }, - _SplitButton_postRender: SplitButton.prototype.postRender, - postRender: function() { - this._SplitButton_postRender(); - this.setLabel(this.label || ""); - this.setValue(this.initValue || ""); - }, - showPopup: function() { - var rect = uiUtils.getClientRect(this.getDom()); - rect.top += 1; - rect.bottom -= 1; - rect.height -= 2; - this.popup.showAnchorRect(rect); - }, - getValue: function() { - return this.value; - }, - setValue: function(value) { - var index = this.indexByValue(value); - if (index != -1) { - this.selectedIndex = index; - this.setLabel(this.items[index].label); - this.value = this.items[index].value; - } else { - this.selectedIndex = -1; - this.setLabel(this.getLabelForUnknowValue(value)); - this.value = value; - } - }, - setLabel: function(label) { - this.getDom("button_body").innerHTML = label; - this.label = label; - }, - getLabelForUnknowValue: function(value) { - return value; - }, - indexByValue: function(value) { - for (var i = 0; i < this.items.length; i++) { - if (value == this.items[i].value) { - return i; - } - } - return -1; - }, - getItem: function(index) { - return this.items[index]; - }, - selectByIndex: function(index) { - if ( - index < this.items.length && - this.fireEvent("select", index) !== false - ) { - this.selectedIndex = index; - this.value = this.items[index].value; - this.setLabel(this.items[index].label); - } - } - }; - utils.inherits(Combox, SplitButton); -})(); - - -// ui/dialog.js -///import core -///import uicore -///import ui/mask.js -///import ui/button.js -;(function() { - var utils = baidu.editor.utils, - domUtils = baidu.editor.dom.domUtils, - uiUtils = baidu.editor.ui.uiUtils, - Mask = baidu.editor.ui.Mask, - UIBase = baidu.editor.ui.UIBase, - Button = baidu.editor.ui.Button, - Dialog = (baidu.editor.ui.Dialog = function(options) { - if (options.name) { - var name = options.name; - var cssRules = options.cssRules; - if (!options.className) { - options.className = "edui-for-" + name; - } - if (cssRules) { - options.cssRules = - ".edui-for-" + name + " .edui-dialog-content {" + cssRules + "}"; - } - } - this.initOptions( - utils.extend( - { - autoReset: true, - draggable: true, - onok: function() {}, - oncancel: function() {}, - onclose: function(t, ok) { - return ok ? this.onok() : this.oncancel(); - }, - //是否控制dialog中的scroll事件, 默认为不阻止 - holdScroll: false - }, - options - ) - ); - this.initDialog(); - }); - var modalMask; - var dragMask; - var activeDialog; - Dialog.prototype = { - draggable: false, - uiName: "dialog", - initDialog: function() { - var me = this, - theme = this.editor.options.theme; - if (this.cssRules) { - this.cssRules = ".edui-" + theme + " " + this.cssRules; - utils.cssRule("edui-customize-" + this.name + "-style", this.cssRules); - } - this.initUIBase(); - this.modalMask = - modalMask || - (modalMask = new Mask({ - className: "edui-dialog-modalmask", - theme: theme, - onclick: function() { - activeDialog && activeDialog.close(false); - } - })); - this.dragMask = - dragMask || - (dragMask = new Mask({ - className: "edui-dialog-dragmask", - theme: theme - })); - this.closeButton = new Button({ - className: "edui-dialog-closebutton", - title: me.closeDialog, - theme: theme, - onclick: function() { - me.close(false); - } - }); - - this.fullscreen && this.initResizeEvent(); - - if (this.buttons) { - for (var i = 0; i < this.buttons.length; i++) { - if (!(this.buttons[i] instanceof Button)) { - this.buttons[i] = new Button( - utils.extend( - this.buttons[i], - { - editor: this.editor - }, - true - ) - ); - } - } - } - }, - initResizeEvent: function() { - var me = this; - - domUtils.on(window, "resize", function() { - if (me._hidden || me._hidden === undefined) { - return; - } - - if (me.__resizeTimer) { - window.clearTimeout(me.__resizeTimer); - } - - me.__resizeTimer = window.setTimeout(function() { - me.__resizeTimer = null; - - var dialogWrapNode = me.getDom(), - contentNode = me.getDom("content"), - wrapRect = UE.ui.uiUtils.getClientRect(dialogWrapNode), - contentRect = UE.ui.uiUtils.getClientRect(contentNode), - vpRect = uiUtils.getViewportRect(); - - contentNode.style.width = - vpRect.width - wrapRect.width + contentRect.width + "px"; - contentNode.style.height = - vpRect.height - wrapRect.height + contentRect.height + "px"; - - dialogWrapNode.style.width = vpRect.width + "px"; - dialogWrapNode.style.height = vpRect.height + "px"; - - me.fireEvent("resize"); - }, 100); - }); - }, - fitSize: function() { - var popBodyEl = this.getDom("body"); - // if (!(baidu.editor.browser.ie && baidu.editor.browser.version == 7)) { - // uiUtils.removeStyle(popBodyEl, 'width'); - // uiUtils.removeStyle(popBodyEl, 'height'); - // } - var size = this.mesureSize(); - popBodyEl.style.width = size.width + "px"; - popBodyEl.style.height = size.height + "px"; - return size; - }, - safeSetOffset: function(offset) { - var me = this; - var el = me.getDom(); - var vpRect = uiUtils.getViewportRect(); - var rect = uiUtils.getClientRect(el); - var left = offset.left; - if (left + rect.width > vpRect.right) { - left = vpRect.right - rect.width; - } - var top = offset.top; - if (top + rect.height > vpRect.bottom) { - top = vpRect.bottom - rect.height; - } - el.style.left = Math.max(left, 0) + "px"; - el.style.top = Math.max(top, 0) + "px"; - }, - showAtCenter: function() { - var vpRect = uiUtils.getViewportRect(); - - if (!this.fullscreen) { - this.getDom().style.display = ""; - var popSize = this.fitSize(); - var titleHeight = this.getDom("titlebar").offsetHeight | 0; - var left = vpRect.width / 2 - popSize.width / 2; - var top = - vpRect.height / 2 - (popSize.height - titleHeight) / 2 - titleHeight; - var popEl = this.getDom(); - this.safeSetOffset({ - left: Math.max(left | 0, 0), - top: Math.max(top | 0, 0) - }); - if (!domUtils.hasClass(popEl, "edui-state-centered")) { - popEl.className += " edui-state-centered"; - } - } else { - var dialogWrapNode = this.getDom(), - contentNode = this.getDom("content"); - - dialogWrapNode.style.display = "block"; - - var wrapRect = UE.ui.uiUtils.getClientRect(dialogWrapNode), - contentRect = UE.ui.uiUtils.getClientRect(contentNode); - dialogWrapNode.style.left = "-100000px"; - - contentNode.style.width = - vpRect.width - wrapRect.width + contentRect.width + "px"; - contentNode.style.height = - vpRect.height - wrapRect.height + contentRect.height + "px"; - - dialogWrapNode.style.width = vpRect.width + "px"; - dialogWrapNode.style.height = vpRect.height + "px"; - dialogWrapNode.style.left = 0; - - //保存环境的overflow值 - this._originalContext = { - html: { - overflowX: document.documentElement.style.overflowX, - overflowY: document.documentElement.style.overflowY - }, - body: { - overflowX: document.body.style.overflowX, - overflowY: document.body.style.overflowY - } - }; - - document.documentElement.style.overflowX = "hidden"; - document.documentElement.style.overflowY = "hidden"; - document.body.style.overflowX = "hidden"; - document.body.style.overflowY = "hidden"; - } - - this._show(); - }, - getContentHtml: function() { - var contentHtml = ""; - if (typeof this.content == "string") { - contentHtml = this.content; - } else if (this.iframeUrl) { - contentHtml = - ''; - } - return contentHtml; - }, - getHtmlTpl: function() { - var footHtml = ""; - - if (this.buttons) { - var buff = []; - for (var i = 0; i < this.buttons.length; i++) { - buff[i] = this.buttons[i].renderHtml(); - } - footHtml = - '
                      ' + - '
                      ' + - buff.join("") + - "
                      " + - "
                      "; - } - - return ( - '
                      ' + - '
                      ' + - '
                      ' + - '
                      ' + - '' + - (this.title || "") + - "" + - "
                      " + - this.closeButton.renderHtml() + - "
                      " + - '
                      ' + - (this.autoReset ? "" : this.getContentHtml()) + - "
                      " + - footHtml + - "
                      " - ); - }, - postRender: function() { - // todo: 保持居中/记住上次关闭位置选项 - if (!this.modalMask.getDom()) { - this.modalMask.render(); - this.modalMask.hide(); - } - if (!this.dragMask.getDom()) { - this.dragMask.render(); - this.dragMask.hide(); - } - var me = this; - this.addListener("show", function() { - me.modalMask.show(this.getDom().style.zIndex - 2); - }); - this.addListener("hide", function() { - me.modalMask.hide(); - }); - if (this.buttons) { - for (var i = 0; i < this.buttons.length; i++) { - this.buttons[i].postRender(); - } - } - domUtils.on(window, "resize", function() { - setTimeout(function() { - if (!me.isHidden()) { - me.safeSetOffset(uiUtils.getClientRect(me.getDom())); - } - }); - }); - - //hold住scroll事件,防止dialog的滚动影响页面 - // if( this.holdScroll ) { - // - // if( !me.iframeUrl ) { - // domUtils.on( document.getElementById( me.id + "_iframe"), !browser.gecko ? "mousewheel" : "DOMMouseScroll", function(e){ - // domUtils.preventDefault(e); - // } ); - // } else { - // me.addListener('dialogafterreset', function(){ - // window.setTimeout(function(){ - // var iframeWindow = document.getElementById( me.id + "_iframe").contentWindow; - // - // if( browser.ie ) { - // - // var timer = window.setInterval(function(){ - // - // if( iframeWindow.document && iframeWindow.document.body ) { - // window.clearInterval( timer ); - // timer = null; - // domUtils.on( iframeWindow.document.body, !browser.gecko ? "mousewheel" : "DOMMouseScroll", function(e){ - // domUtils.preventDefault(e); - // } ); - // } - // - // }, 100); - // - // } else { - // domUtils.on( iframeWindow, !browser.gecko ? "mousewheel" : "DOMMouseScroll", function(e){ - // domUtils.preventDefault(e); - // } ); - // } - // - // }, 1); - // }); - // } - // - // } - this._hide(); - }, - mesureSize: function() { - var body = this.getDom("body"); - var width = uiUtils.getClientRect(this.getDom("content")).width; - var dialogBodyStyle = body.style; - dialogBodyStyle.width = width; - return uiUtils.getClientRect(body); - }, - _onTitlebarMouseDown: function(evt, el) { - if (this.draggable) { - var rect; - var vpRect = uiUtils.getViewportRect(); - var me = this; - uiUtils.startDrag(evt, { - ondragstart: function() { - rect = uiUtils.getClientRect(me.getDom()); - me.getDom("contmask").style.visibility = "visible"; - me.dragMask.show(me.getDom().style.zIndex - 1); - }, - ondragmove: function(x, y) { - var left = rect.left + x; - var top = rect.top + y; - me.safeSetOffset({ - left: left, - top: top - }); - }, - ondragstop: function() { - me.getDom("contmask").style.visibility = "hidden"; - domUtils.removeClasses(me.getDom(), ["edui-state-centered"]); - me.dragMask.hide(); - } - }); - } - }, - reset: function() { - this.getDom("content").innerHTML = this.getContentHtml(); - this.fireEvent("dialogafterreset"); - }, - _show: function() { - if (this._hidden) { - this.getDom().style.display = ""; - - //要高过编辑器的zindxe - this.editor.container.style.zIndex && - (this.getDom().style.zIndex = - this.editor.container.style.zIndex * 1 + 10); - this._hidden = false; - this.fireEvent("show"); - baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex = - this.getDom().style.zIndex - 4; - } - }, - isHidden: function() { - return this._hidden; - }, - _hide: function() { - if (!this._hidden) { - var wrapNode = this.getDom(); - wrapNode.style.display = "none"; - wrapNode.style.zIndex = ""; - wrapNode.style.width = ""; - wrapNode.style.height = ""; - this._hidden = true; - this.fireEvent("hide"); - } - }, - open: function() { - if (this.autoReset) { - //有可能还没有渲染 - try { - this.reset(); - } catch (e) { - this.render(); - this.open(); - } - } - this.showAtCenter(); - if (this.iframeUrl) { - try { - this.getDom("iframe").focus(); - } catch (ex) {} - } - activeDialog = this; - }, - _onCloseButtonClick: function(evt, el) { - this.close(false); - }, - close: function(ok) { - if (this.fireEvent("close", ok) !== false) { - //还原环境 - if (this.fullscreen) { - document.documentElement.style.overflowX = this._originalContext.html.overflowX; - document.documentElement.style.overflowY = this._originalContext.html.overflowY; - document.body.style.overflowX = this._originalContext.body.overflowX; - document.body.style.overflowY = this._originalContext.body.overflowY; - delete this._originalContext; - } - this._hide(); - - //销毁content - var content = this.getDom("content"); - var iframe = this.getDom("iframe"); - if (content && iframe) { - var doc = iframe.contentDocument || iframe.contentWindow.document; - doc && (doc.body.innerHTML = ""); - domUtils.remove(content); - } - } - } - }; - utils.inherits(Dialog, UIBase); -})(); - - -// ui/menubutton.js -///import core -///import uicore -///import ui/menu.js -///import ui/splitbutton.js -;(function() { - var utils = baidu.editor.utils, - Menu = baidu.editor.ui.Menu, - SplitButton = baidu.editor.ui.SplitButton, - MenuButton = (baidu.editor.ui.MenuButton = function(options) { - this.initOptions(options); - this.initMenuButton(); - }); - MenuButton.prototype = { - initMenuButton: function() { - var me = this; - this.uiName = "menubutton"; - this.popup = new Menu({ - items: me.items, - className: me.className, - editor: me.editor - }); - this.popup.addListener("show", function() { - var list = this; - for (var i = 0; i < list.items.length; i++) { - list.items[i].removeState("checked"); - if (list.items[i].value == me._value) { - list.items[i].addState("checked"); - this.value = me._value; - } - } - }); - this.initSplitButton(); - }, - setValue: function(value) { - this._value = value; - } - }; - utils.inherits(MenuButton, SplitButton); -})(); - - -// ui/multiMenu.js -///import core -///import uicore -///commands 表情 -;(function() { - var utils = baidu.editor.utils, - Popup = baidu.editor.ui.Popup, - SplitButton = baidu.editor.ui.SplitButton, - MultiMenuPop = (baidu.editor.ui.MultiMenuPop = function(options) { - this.initOptions(options); - this.initMultiMenu(); - }); - - MultiMenuPop.prototype = { - initMultiMenu: function() { - var me = this; - this.popup = new Popup({ - content: "", - editor: me.editor, - iframe_rendered: false, - onshow: function() { - if (!this.iframe_rendered) { - this.iframe_rendered = true; - this.getDom("content").innerHTML = - ''; - me.editor.container.style.zIndex && - (this.getDom().style.zIndex = - me.editor.container.style.zIndex * 1 + 1); - } - } - // canSideUp:false, - // canSideLeft:false - }); - this.onbuttonclick = function() { - this.showPopup(); - }; - this.initSplitButton(); - } - }; - - utils.inherits(MultiMenuPop, SplitButton); -})(); - - -// ui/shortcutmenu.js -;(function() { - var UI = baidu.editor.ui, - UIBase = UI.UIBase, - uiUtils = UI.uiUtils, - utils = baidu.editor.utils, - domUtils = baidu.editor.dom.domUtils; - - var allMenus = [], //存储所有快捷菜单 - timeID, - isSubMenuShow = false; //是否有子pop显示 - - var ShortCutMenu = (UI.ShortCutMenu = function(options) { - this.initOptions(options); - this.initShortCutMenu(); - }); - - ShortCutMenu.postHide = hideAllMenu; - - ShortCutMenu.prototype = { - isHidden: true, - SPACE: 5, - initShortCutMenu: function() { - this.items = this.items || []; - this.initUIBase(); - this.initItems(); - this.initEvent(); - allMenus.push(this); - }, - initEvent: function() { - var me = this, - doc = me.editor.document; - - domUtils.on(doc, "mousemove", function(e) { - if (me.isHidden === false) { - //有pop显示就不隐藏快捷菜单 - if (me.getSubMenuMark() || me.eventType == "contextmenu") return; - - var flag = true, - el = me.getDom(), - wt = el.offsetWidth, - ht = el.offsetHeight, - distanceX = wt / 2 + me.SPACE, //距离中心X标准 - distanceY = ht / 2, //距离中心Y标准 - x = Math.abs(e.screenX - me.left), //离中心距离横坐标 - y = Math.abs(e.screenY - me.top); //离中心距离纵坐标 - - clearTimeout(timeID); - timeID = setTimeout(function() { - if (y > 0 && y < distanceY) { - me.setOpacity(el, "1"); - } else if (y > distanceY && y < distanceY + 70) { - me.setOpacity(el, "0.5"); - flag = false; - } else if (y > distanceY + 70 && y < distanceY + 140) { - me.hide(); - } - - if (flag && x > 0 && x < distanceX) { - me.setOpacity(el, "1"); - } else if (x > distanceX && x < distanceX + 70) { - me.setOpacity(el, "0.5"); - } else if (x > distanceX + 70 && x < distanceX + 140) { - me.hide(); - } - }); - } - }); - - //ie\ff下 mouseout不准 - if (browser.chrome) { - domUtils.on(doc, "mouseout", function(e) { - var relatedTgt = e.relatedTarget || e.toElement; - - if (relatedTgt == null || relatedTgt.tagName == "HTML") { - me.hide(); - } - }); - } - - me.editor.addListener("afterhidepop", function() { - if (!me.isHidden) { - isSubMenuShow = true; - } - }); - }, - initItems: function() { - if (utils.isArray(this.items)) { - for (var i = 0, len = this.items.length; i < len; i++) { - var item = this.items[i].toLowerCase(); - - if (UI[item]) { - this.items[i] = new UI[item](this.editor); - this.items[i].className += " edui-shortcutsubmenu "; - } - } - } - }, - setOpacity: function(el, value) { - if (browser.ie && browser.version < 9) { - el.style.filter = "alpha(opacity = " + parseFloat(value) * 100 + ");"; - } else { - el.style.opacity = value; - } - }, - getSubMenuMark: function() { - isSubMenuShow = false; - var layerEle = uiUtils.getFixedLayer(); - var list = domUtils.getElementsByTagName(layerEle, "div", function(node) { - return domUtils.hasClass(node, "edui-shortcutsubmenu edui-popup"); - }); - - for (var i = 0, node; (node = list[i++]); ) { - if (node.style.display != "none") { - isSubMenuShow = true; - } - } - return isSubMenuShow; - }, - show: function(e, hasContextmenu) { - var me = this, - offset = {}, - el = this.getDom(), - fixedlayer = uiUtils.getFixedLayer(); - - function setPos(offset) { - if (offset.left < 0) { - offset.left = 0; - } - if (offset.top < 0) { - offset.top = 0; - } - el.style.cssText = - "position:absolute;left:" + - offset.left + - "px;top:" + - offset.top + - "px;"; - } - - function setPosByCxtMenu(menu) { - if (!menu.tagName) { - menu = menu.getDom(); - } - offset.left = parseInt(menu.style.left); - offset.top = parseInt(menu.style.top); - offset.top -= el.offsetHeight + 15; - setPos(offset); - } - - me.eventType = e.type; - el.style.cssText = "display:block;left:-9999px"; - - if (e.type == "contextmenu" && hasContextmenu) { - var menu = domUtils.getElementsByTagName( - fixedlayer, - "div", - "edui-contextmenu" - )[0]; - if (menu) { - setPosByCxtMenu(menu); - } else { - me.editor.addListener("aftershowcontextmenu", function(type, menu) { - setPosByCxtMenu(menu); - }); - } - } else { - offset = uiUtils.getViewportOffsetByEvent(e); - offset.top -= el.offsetHeight + me.SPACE; - offset.left += me.SPACE + 20; - setPos(offset); - me.setOpacity(el, 0.2); - } - - me.isHidden = false; - me.left = e.screenX + el.offsetWidth / 2 - me.SPACE; - me.top = e.screenY - el.offsetHeight / 2 - me.SPACE; - - if (me.editor) { - el.style.zIndex = me.editor.container.style.zIndex * 1 + 10; - fixedlayer.style.zIndex = el.style.zIndex - 1; - } - }, - hide: function() { - if (this.getDom()) { - this.getDom().style.display = "none"; - } - this.isHidden = true; - }, - postRender: function() { - if (utils.isArray(this.items)) { - for (var i = 0, item; (item = this.items[i++]); ) { - item.postRender(); - } - } - }, - getHtmlTpl: function() { - var buff; - if (utils.isArray(this.items)) { - buff = []; - for (var i = 0; i < this.items.length; i++) { - buff[i] = this.items[i].renderHtml(); - } - buff = buff.join(""); - } else { - buff = this.items; - } - - return ( - '
                      ' + - buff + - "
                      " - ); - } - }; - - utils.inherits(ShortCutMenu, UIBase); - - function hideAllMenu(e) { - var tgt = e.target || e.srcElement, - cur = domUtils.findParent( - tgt, - function(node) { - return ( - domUtils.hasClass(node, "edui-shortcutmenu") || - domUtils.hasClass(node, "edui-popup") - ); - }, - true - ); - - if (!cur) { - for (var i = 0, menu; (menu = allMenus[i++]); ) { - menu.hide(); - } - } - } - - domUtils.on(document, "mousedown", function(e) { - hideAllMenu(e); - }); - - domUtils.on(window, "scroll", function(e) { - hideAllMenu(e); - }); -})(); - - -// ui/breakline.js -;(function() { - var utils = baidu.editor.utils, - UIBase = baidu.editor.ui.UIBase, - Breakline = (baidu.editor.ui.Breakline = function(options) { - this.initOptions(options); - this.initSeparator(); - }); - Breakline.prototype = { - uiName: "Breakline", - initSeparator: function() { - this.initUIBase(); - }, - getHtmlTpl: function() { - return "
                      "; - } - }; - utils.inherits(Breakline, UIBase); -})(); - - -// ui/message.js -///import core -///import uicore -;(function() { - var utils = baidu.editor.utils, - domUtils = baidu.editor.dom.domUtils, - UIBase = baidu.editor.ui.UIBase, - Message = (baidu.editor.ui.Message = function(options) { - this.initOptions(options); - this.initMessage(); - }); - - Message.prototype = { - initMessage: function() { - this.initUIBase(); - }, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ×
                      ' + - '
                      ' + - ' ' + - '
                      ' + - '
                      ' + - "
                      " + - "
                      " + - "
                      " - ); - }, - reset: function(opt) { - var me = this; - if (!opt.keepshow) { - clearTimeout(this.timer); - me.timer = setTimeout(function() { - me.hide(); - }, opt.timeout || 4000); - } - - opt.content !== undefined && me.setContent(opt.content); - opt.type !== undefined && me.setType(opt.type); - - me.show(); - }, - postRender: function() { - var me = this, - closer = this.getDom("closer"); - closer && - domUtils.on(closer, "click", function() { - me.hide(); - }); - }, - setContent: function(content) { - this.getDom("content").innerHTML = content; - }, - setType: function(type) { - type = type || "info"; - var body = this.getDom("body"); - body.className = body.className.replace( - /edui-message-type-[\w-]+/, - "edui-message-type-" + type - ); - }, - getContent: function() { - return this.getDom("content").innerHTML; - }, - getType: function() { - var arr = this.getDom("body").match(/edui-message-type-([\w-]+)/); - return arr ? arr[1] : ""; - }, - show: function() { - this.getDom().style.display = "block"; - }, - hide: function() { - var dom = this.getDom(); - if (dom) { - dom.style.display = "none"; - dom.parentNode && dom.parentNode.removeChild(dom); - } - } - }; - - utils.inherits(Message, UIBase); -})(); - - -// ui/iconfont.js -!function(o){var h,p='',l=(h=document.getElementsByTagName("script"))[h.length-1].getAttribute("data-injectcss");if(l&&!o.__iconfont__svg__cssinject__){o.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}!function(h){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(h,0);else{var l=function(){document.removeEventListener("DOMContentLoaded",l,!1),h()};document.addEventListener("DOMContentLoaded",l,!1)}else document.attachEvent&&(a=h,t=o.document,i=!1,v=function(){i||(i=!0,a())},(p=function(){try{t.documentElement.doScroll("left")}catch(h){return void setTimeout(p,50)}v()})(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,v())});var a,t,i,v,p}(function(){var h,l,a,t,i,v;(h=document.createElement("div")).innerHTML=p,p=null,(l=h.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",a=l,(t=document.body).firstChild?(i=a,(v=t.firstChild).parentNode.insertBefore(i,v)):t.appendChild(a))})}(window); - -// adapter/editorui.js -//ui跟编辑器的适配層 -//那个按钮弹出是dialog,是下拉筐等都是在这个js中配置 -//自己写的ui也要在这里配置,放到baidu.editor.ui下边,当编辑器实例化的时候会根据neditor.config中的toolbars找到相应的进行实例化 -;(function() { - var utils = baidu.editor.utils; - var editorui = baidu.editor.ui; - var _Dialog = editorui.Dialog; - editorui.buttons = {}; - - editorui.Dialog = function(options) { - var dialog = new _Dialog(options); - dialog.addListener("hide", function() { - if (dialog.editor) { - var editor = dialog.editor; - try { - if (browser.gecko) { - var y = editor.window.scrollY, - x = editor.window.scrollX; - editor.body.focus(); - editor.window.scrollTo(x, y); - } else { - editor.focus(); - } - } catch (ex) {} - } - }); - return dialog; - }; - - var iframeUrlMap = { - anchor: "~/dialogs/anchor/anchor.html", - insertimage: "~/dialogs/image/image.html", - link: "~/dialogs/link/link.html", - spechars: "~/dialogs/spechars/spechars.html", - searchreplace: "~/dialogs/searchreplace/searchreplace.html", - map: "~/dialogs/map/map.html", - gmap: "~/dialogs/gmap/gmap.html", - insertvideo: "~/dialogs/video/video.html", - help: "~/dialogs/help/help.html", - preview: "~/dialogs/preview/preview.html", - emotion: "~/dialogs/emotion/emotion.html", - wordimage: "~/dialogs/wordimage/wordimage.html", - attachment: "~/dialogs/attachment/attachment.html", - insertframe: "~/dialogs/insertframe/insertframe.html", - edittip: "~/dialogs/table/edittip.html", - edittable: "~/dialogs/table/edittable.html", - edittd: "~/dialogs/table/edittd.html", - webapp: "~/dialogs/webapp/webapp.html", - snapscreen: "~/dialogs/snapscreen/snapscreen.html", - scrawl: "~/dialogs/scrawl/scrawl.html", - music: "~/dialogs/music/music.html", - template: "~/dialogs/template/template.html", - background: "~/dialogs/background/background.html", - charts: "~/dialogs/charts/charts.html" - }; - //为工具栏添加按钮,以下都是统一的按钮触发命令,所以写在一起 - var btnCmds = [ - "undo", - "redo", - "formatmatch", - "bold", - "italic", - "underline", - "fontborder", - "touppercase", - "tolowercase", - "strikethrough", - "subscript", - "superscript", - "source", - "indent", - "outdent", - "blockquote", - "pasteplain", - "pagebreak", - "selectall", - "print", - "horizontal", - "removeformat", - "time", - "date", - "unlink", - "insertparagraphbeforetable", - "insertrow", - "insertcol", - "mergeright", - "mergedown", - "deleterow", - "deletecol", - "splittorows", - "splittocols", - "splittocells", - "mergecells", - "deletetable", - "drafts" - ]; - - for (var i = 0, ci; (ci = btnCmds[i++]); ) { - ci = ci.toLowerCase(); - editorui[ci] = (function(cmd) { - return function(editor) { - var ui = new editorui.Button({ - className: "edui-for-" + cmd, - title: - editor.options.labelMap[cmd] || - editor.getLang("labelMap." + cmd) || - "", - onclick: function() { - editor.execCommand(cmd); - }, - theme: editor.options.theme, - showText: false - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function( - type, - causeByUi, - uiReady - ) { - var state = editor.queryCommandState(cmd); - if (state == -1) { - ui.setDisabled(true); - ui.setChecked(false); - } else { - if (!uiReady) { - ui.setDisabled(false); - ui.setChecked(state); - } - } - }); - return ui; - }; - })(ci); - } - - //清除文档 - editorui.cleardoc = function(editor) { - var ui = new editorui.Button({ - className: "edui-for-cleardoc", - title: - editor.options.labelMap.cleardoc || - editor.getLang("labelMap.cleardoc") || - "", - theme: editor.options.theme, - onclick: function() { - if (confirm(editor.getLang("confirmClear"))) { - editor.execCommand("cleardoc"); - } - } - }); - editorui.buttons["cleardoc"] = ui; - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState("cleardoc") == -1); - }); - return ui; - }; - - //排版,图片排版,文字方向 - var typeset = { - justify: ["left", "right", "center", "justify"], - imagefloat: ["none", "left", "center", "right"], - directionality: ["ltr", "rtl"] - }; - - for (var p in typeset) { - (function(cmd, val) { - for (var i = 0, ci; (ci = val[i++]); ) { - (function(cmd2) { - editorui[cmd.replace("float", "") + cmd2] = function(editor) { - var ui = new editorui.Button({ - className: "edui-for-" + cmd.replace("float", "") + cmd2, - title: - editor.options.labelMap[cmd.replace("float", "") + cmd2] || - editor.getLang( - "labelMap." + cmd.replace("float", "") + cmd2 - ) || - "", - theme: editor.options.theme, - onclick: function() { - editor.execCommand(cmd, cmd2); - } - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function( - type, - causeByUi, - uiReady - ) { - ui.setDisabled(editor.queryCommandState(cmd) == -1); - ui.setChecked(editor.queryCommandValue(cmd) == cmd2 && !uiReady); - }); - return ui; - }; - })(ci); - } - })(p, typeset[p]); - } - - //字体颜色和背景颜色 - for (var i = 0, ci; (ci = ["backcolor", "forecolor"][i++]); ) { - editorui[ci] = (function(cmd) { - return function(editor) { - var ui = new editorui.ColorButton({ - className: "edui-for-" + cmd, - color: "default", - title: - editor.options.labelMap[cmd] || - editor.getLang("labelMap." + cmd) || - "", - editor: editor, - onpickcolor: function(t, color) { - editor.execCommand(cmd, color); - }, - onpicknocolor: function() { - editor.execCommand(cmd, "default"); - this.setColor("transparent"); - this.color = "default"; - }, - onbuttonclick: function() { - editor.execCommand(cmd, this.color); - } - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState(cmd) == -1); - }); - return ui; - }; - })(ci); - } - - var dialogBtns = { - noOk: ["searchreplace", "help", "spechars", "webapp", "preview"], - ok: [ - "attachment", - "anchor", - "link", - "insertimage", - "map", - "gmap", - "insertframe", - "wordimage", - "insertvideo", - "insertframe", - "edittip", - "edittable", - "edittd", - "scrawl", - "template", - "music", - "background", - "charts" - ] - }; - - for (var p in dialogBtns) { - (function(type, vals) { - for (var i = 0, ci; (ci = vals[i++]); ) { - //todo opera下存在问题 - if (browser.opera && ci === "searchreplace") { - continue; - } - (function(cmd) { - editorui[cmd] = function(editor, iframeUrl, title) { - iframeUrl = - iframeUrl || - (editor.options.iframeUrlMap || {})[cmd] || - iframeUrlMap[cmd]; - title = - editor.options.labelMap[cmd] || - editor.getLang("labelMap." + cmd) || - ""; - - var dialog; - //没有iframeUrl不创建dialog - if (iframeUrl) { - dialog = new editorui.Dialog( - utils.extend( - { - iframeUrl: editor.ui.mapUrl(iframeUrl), - editor: editor, - className: "edui-for-" + cmd, - title: title, - holdScroll: cmd === "insertimage", - fullscreen: /charts|preview/.test(cmd), - closeDialog: editor.getLang("closeDialog") - }, - type == "ok" - ? { - buttons: [ - { - className: "edui-okbutton", - label: editor.getLang("ok"), - editor: editor, - onclick: function() { - dialog.close(true); - } - }, - { - className: "edui-cancelbutton", - label: editor.getLang("cancel"), - editor: editor, - onclick: function() { - dialog.close(false); - } - } - ] - } - : {} - ) - ); - - editor.ui._dialogs[cmd + "Dialog"] = dialog; - } - - var ui = new editorui.Button({ - className: "edui-for-" + cmd, - title: title, - onclick: function() { - if (dialog) { - switch (cmd) { - case "wordimage": - var images = editor.execCommand("wordimage"); - if (images && images.length) { - dialog.render(); - dialog.open(); - } - break; - case "scrawl": - if (editor.queryCommandState("scrawl") != -1) { - dialog.render(); - dialog.open(); - } - - break; - default: - dialog.render(); - dialog.open(); - } - } - }, - theme: editor.options.theme, - disabled: - (cmd == "scrawl" && editor.queryCommandState("scrawl") == -1) || - cmd == "charts" - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function() { - //只存在于右键菜单而无工具栏按钮的ui不需要检测状态 - var unNeedCheckState = { edittable: 1 }; - if (cmd in unNeedCheckState) return; - - var state = editor.queryCommandState(cmd); - if (ui.getDom()) { - ui.setDisabled(state == -1); - ui.setChecked(state); - } - }); - - return ui; - }; - })(ci.toLowerCase()); - } - })(p, dialogBtns[p]); - } - - editorui.snapscreen = function(editor, iframeUrl, title) { - title = - editor.options.labelMap["snapscreen"] || - editor.getLang("labelMap.snapscreen") || - ""; - var ui = new editorui.Button({ - className: "edui-for-snapscreen", - title: title, - onclick: function() { - editor.execCommand("snapscreen"); - }, - theme: editor.options.theme - }); - editorui.buttons["snapscreen"] = ui; - iframeUrl = - iframeUrl || - (editor.options.iframeUrlMap || {})["snapscreen"] || - iframeUrlMap["snapscreen"]; - if (iframeUrl) { - var dialog = new editorui.Dialog({ - iframeUrl: editor.ui.mapUrl(iframeUrl), - editor: editor, - className: "edui-for-snapscreen", - title: title, - buttons: [ - { - className: "edui-okbutton", - label: editor.getLang("ok"), - editor: editor, - onclick: function() { - dialog.close(true); - } - }, - { - className: "edui-cancelbutton", - label: editor.getLang("cancel"), - editor: editor, - onclick: function() { - dialog.close(false); - } - } - ] - }); - dialog.render(); - editor.ui._dialogs["snapscreenDialog"] = dialog; - } - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState("snapscreen") == -1); - }); - return ui; - }; - - editorui.insertcode = function(editor, list, title) { - list = editor.options["insertcode"] || []; - title = - editor.options.labelMap["insertcode"] || - editor.getLang("labelMap.insertcode") || - ""; - // if (!list.length) return; - var items = []; - utils.each(list, function(key, val) { - items.push({ - label: key, - value: val, - theme: editor.options.theme, - renderLabelHtml: function() { - return ( - '
                      ' + (this.label || "") + "
                      " - ); - } - }); - }); - - var ui = new editorui.Combox({ - editor: editor, - items: items, - onselect: function(t, index) { - editor.execCommand("insertcode", this.items[index].value); - }, - onbuttonclick: function() { - this.showPopup(); - }, - title: title, - initValue: title, - className: "edui-for-insertcode", - indexByValue: function(value) { - if (value) { - for (var i = 0, ci; (ci = this.items[i]); i++) { - if (ci.value.indexOf(value) != -1) return i; - } - } - - return -1; - } - }); - editorui.buttons["insertcode"] = ui; - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - if (!uiReady) { - var state = editor.queryCommandState("insertcode"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("insertcode"); - if (!value) { - ui.setValue(title); - return; - } - //trace:1871 ie下从源码模式切换回来时,字体会带单引号,而且会有逗号 - value && (value = value.replace(/['"]/g, "").split(",")[0]); - ui.setValue(value); - } - } - }); - return ui; - }; - editorui.fontfamily = function(editor, list, title) { - list = editor.options["fontfamily"] || []; - title = - editor.options.labelMap["fontfamily"] || - editor.getLang("labelMap.fontfamily") || - ""; - if (!list.length) return; - for (var i = 0, ci, items = []; (ci = list[i]); i++) { - var langLabel = editor.getLang("fontfamily")[ci.name] || ""; - (function(key, val) { - items.push({ - label: key, - value: val, - theme: editor.options.theme, - renderLabelHtml: function() { - return ( - '
                      ' + - (this.label || "") + - "
                      " - ); - } - }); - })(ci.label || langLabel, ci.val); - } - var ui = new editorui.Combox({ - editor: editor, - items: items, - onselect: function(t, index) { - editor.execCommand("FontFamily", this.items[index].value); - }, - onbuttonclick: function() { - this.showPopup(); - }, - title: title, - initValue: title, - className: "edui-for-fontfamily", - indexByValue: function(value) { - if (value) { - for (var i = 0, ci; (ci = this.items[i]); i++) { - if (ci.value.indexOf(value) != -1) return i; - } - } - - return -1; - } - }); - editorui.buttons["fontfamily"] = ui; - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - if (!uiReady) { - var state = editor.queryCommandState("FontFamily"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("FontFamily"); - //trace:1871 ie下从源码模式切换回来时,字体会带单引号,而且会有逗号 - value && (value = value.replace(/['"]/g, "").split(",")[0]); - ui.setValue(value); - } - } - }); - return ui; - }; - - editorui.fontsize = function(editor, list, title) { - title = - editor.options.labelMap["fontsize"] || - editor.getLang("labelMap.fontsize") || - ""; - list = list || editor.options["fontsize"] || []; - if (!list.length) return; - var items = []; - for (var i = 0; i < list.length; i++) { - var size = list[i] + "px"; - items.push({ - label: size, - value: size, - theme: editor.options.theme, - renderLabelHtml: function() { - return ( - '
                      ' + - (this.label || "") + - "
                      " - ); - } - }); - } - var ui = new editorui.Combox({ - editor: editor, - items: items, - title: title, - initValue: title, - onselect: function(t, index) { - editor.execCommand("FontSize", this.items[index].value); - }, - onbuttonclick: function() { - this.showPopup(); - }, - className: "edui-for-fontsize" - }); - editorui.buttons["fontsize"] = ui; - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - if (!uiReady) { - var state = editor.queryCommandState("FontSize"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - ui.setValue(editor.queryCommandValue("FontSize")); - } - } - }); - return ui; - }; - - editorui.paragraph = function(editor, list, title) { - title = - editor.options.labelMap["paragraph"] || - editor.getLang("labelMap.paragraph") || - ""; - list = editor.options["paragraph"] || []; - if (utils.isEmptyObject(list)) return; - var items = []; - for (var i in list) { - items.push({ - value: i, - label: list[i] || editor.getLang("paragraph")[i], - theme: editor.options.theme, - renderLabelHtml: function() { - return ( - '
                      ' + - (this.label || "") + - "
                      " - ); - } - }); - } - var ui = new editorui.Combox({ - editor: editor, - items: items, - title: title, - initValue: title, - className: "edui-for-paragraph", - onselect: function(t, index) { - editor.execCommand("Paragraph", this.items[index].value); - }, - onbuttonclick: function() { - this.showPopup(); - } - }); - editorui.buttons["paragraph"] = ui; - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - if (!uiReady) { - var state = editor.queryCommandState("Paragraph"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("Paragraph"); - var index = ui.indexByValue(value); - if (index != -1) { - ui.setValue(value); - } else { - ui.setValue(ui.initValue); - } - } - } - }); - return ui; - }; - - //自定义标题 - editorui.customstyle = function(editor) { - var list = editor.options["customstyle"] || [], - title = - editor.options.labelMap["customstyle"] || - editor.getLang("labelMap.customstyle") || - ""; - if (!list.length) return; - var langCs = editor.getLang("customstyle"); - for (var i = 0, items = [], t; (t = list[i++]); ) { - (function(t) { - var ck = {}; - ck.label = t.label ? t.label : langCs[t.name]; - ck.style = t.style; - ck.className = t.className; - ck.tag = t.tag; - items.push({ - label: ck.label, - value: ck, - theme: editor.options.theme, - renderLabelHtml: function() { - return ( - '
                      ' + - "<" + - ck.tag + - " " + - (ck.className ? ' class="' + ck.className + '"' : "") + - (ck.style ? ' style="' + ck.style + '"' : "") + - ">" + - ck.label + - "" + - "
                      " - ); - } - }); - })(t); - } - - var ui = new editorui.Combox({ - editor: editor, - items: items, - title: title, - initValue: title, - className: "edui-for-customstyle", - onselect: function(t, index) { - editor.execCommand("customstyle", this.items[index].value); - }, - onbuttonclick: function() { - this.showPopup(); - }, - indexByValue: function(value) { - for (var i = 0, ti; (ti = this.items[i++]); ) { - if (ti.label == value) { - return i - 1; - } - } - return -1; - } - }); - editorui.buttons["customstyle"] = ui; - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - if (!uiReady) { - var state = editor.queryCommandState("customstyle"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("customstyle"); - var index = ui.indexByValue(value); - if (index != -1) { - ui.setValue(value); - } else { - ui.setValue(ui.initValue); - } - } - } - }); - return ui; - }; - editorui.inserttable = function(editor, iframeUrl, title) { - title = - editor.options.labelMap["inserttable"] || - editor.getLang("labelMap.inserttable") || - ""; - var ui = new editorui.TableButton({ - editor: editor, - title: title, - className: "edui-for-inserttable", - onpicktable: function(t, numCols, numRows) { - editor.execCommand("InsertTable", { - numRows: numRows, - numCols: numCols, - border: 1 - }); - }, - onbuttonclick: function() { - this.showPopup(); - } - }); - editorui.buttons["inserttable"] = ui; - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState("inserttable") == -1); - }); - return ui; - }; - - editorui.lineheight = function(editor) { - var val = editor.options.lineheight || []; - if (!val.length) return; - for (var i = 0, ci, items = []; (ci = val[i++]); ) { - items.push({ - //todo:写死了 - label: ci, - value: ci, - theme: editor.options.theme, - onclick: function() { - editor.execCommand("lineheight", this.value); - } - }); - } - var ui = new editorui.MenuButton({ - editor: editor, - className: "edui-for-lineheight", - title: - editor.options.labelMap["lineheight"] || - editor.getLang("labelMap.lineheight") || - "", - items: items, - onbuttonclick: function() { - var value = editor.queryCommandValue("LineHeight") || this.value; - editor.execCommand("LineHeight", value); - } - }); - editorui.buttons["lineheight"] = ui; - editor.addListener("selectionchange", function() { - var state = editor.queryCommandState("LineHeight"); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("LineHeight"); - value && ui.setValue((value + "").replace(/cm/, "")); - ui.setChecked(state); - } - }); - return ui; - }; - - var rowspacings = ["top", "bottom"]; - for (var r = 0, ri; (ri = rowspacings[r++]); ) { - (function(cmd) { - editorui["rowspacing" + cmd] = function(editor) { - var val = editor.options["rowspacing" + cmd] || []; - if (!val.length) return null; - for (var i = 0, ci, items = []; (ci = val[i++]); ) { - items.push({ - label: ci, - value: ci, - theme: editor.options.theme, - onclick: function() { - editor.execCommand("rowspacing", this.value, cmd); - } - }); - } - var ui = new editorui.MenuButton({ - editor: editor, - className: "edui-for-rowspacing" + cmd, - title: - editor.options.labelMap["rowspacing" + cmd] || - editor.getLang("labelMap.rowspacing" + cmd) || - "", - items: items, - onbuttonclick: function() { - var value = - editor.queryCommandValue("rowspacing", cmd) || this.value; - editor.execCommand("rowspacing", value, cmd); - } - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function() { - var state = editor.queryCommandState("rowspacing", cmd); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue("rowspacing", cmd); - value && ui.setValue((value + "").replace(/%/, "")); - ui.setChecked(state); - } - }); - return ui; - }; - })(ri); - } - //有序,无序列表 - var lists = ["insertorderedlist", "insertunorderedlist"]; - for (var l = 0, cl; (cl = lists[l++]); ) { - (function(cmd) { - editorui[cmd] = function(editor) { - var vals = editor.options[cmd], - _onMenuClick = function() { - editor.execCommand(cmd, this.value); - }, - items = []; - for (var i in vals) { - items.push({ - label: vals[i] || editor.getLang()[cmd][i] || "", - value: i, - theme: editor.options.theme, - onclick: _onMenuClick - }); - } - var ui = new editorui.MenuButton({ - editor: editor, - className: "edui-for-" + cmd, - title: editor.getLang("labelMap." + cmd) || "", - items: items, - onbuttonclick: function() { - var value = editor.queryCommandValue(cmd) || this.value; - editor.execCommand(cmd, value); - } - }); - editorui.buttons[cmd] = ui; - editor.addListener("selectionchange", function() { - var state = editor.queryCommandState(cmd); - if (state == -1) { - ui.setDisabled(true); - } else { - ui.setDisabled(false); - var value = editor.queryCommandValue(cmd); - ui.setValue(value); - ui.setChecked(state); - } - }); - return ui; - }; - })(cl); - } - - editorui.fullscreen = function(editor, title) { - title = - editor.options.labelMap["fullscreen"] || - editor.getLang("labelMap.fullscreen") || - ""; - var ui = new editorui.Button({ - className: "edui-for-fullscreen", - title: title, - theme: editor.options.theme, - onclick: function() { - if (editor.ui) { - editor.ui.setFullScreen(!editor.ui.isFullScreen()); - } - this.setChecked(editor.ui.isFullScreen()); - } - }); - editorui.buttons["fullscreen"] = ui; - editor.addListener("selectionchange", function() { - var state = editor.queryCommandState("fullscreen"); - ui.setDisabled(state == -1); - ui.setChecked(editor.ui.isFullScreen()); - }); - return ui; - }; - - // 表情 - editorui["emotion"] = function(editor, iframeUrl) { - var cmd = "emotion"; - var ui = new editorui.MultiMenuPop({ - title: - editor.options.labelMap[cmd] || - editor.getLang("labelMap." + cmd + "") || - "", - editor: editor, - className: "edui-for-" + cmd, - iframeUrl: editor.ui.mapUrl( - iframeUrl || - (editor.options.iframeUrlMap || {})[cmd] || - iframeUrlMap[cmd] - ) - }); - editorui.buttons[cmd] = ui; - - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState(cmd) == -1); - }); - return ui; - }; - - editorui.autotypeset = function(editor) { - var ui = new editorui.AutoTypeSetButton({ - editor: editor, - title: - editor.options.labelMap["autotypeset"] || - editor.getLang("labelMap.autotypeset") || - "", - className: "edui-for-autotypeset", - onbuttonclick: function() { - editor.execCommand("autotypeset"); - } - }); - editorui.buttons["autotypeset"] = ui; - editor.addListener("selectionchange", function() { - ui.setDisabled(editor.queryCommandState("autotypeset") == -1); - }); - return ui; - }; - - /* 简单上传插件 */ - editorui["simpleupload"] = function(editor) { - var name = "simpleupload", - ui = new editorui.Button({ - className: "edui-for-" + name, - title: - editor.options.labelMap[name] || - editor.getLang("labelMap." + name) || - "", - onclick: function() {}, - theme: editor.options.theme, - showText: false - }); - editorui.buttons[name] = ui; - editor.addListener("ready", function() { - var b = ui.getDom("body"), - iconSpan = b.children[0]; - editor.fireEvent("simpleuploadbtnready", iconSpan); - }); - editor.addListener("selectionchange", function(type, causeByUi, uiReady) { - var state = editor.queryCommandState(name); - if (state == -1) { - ui.setDisabled(true); - ui.setChecked(false); - } else { - if (!uiReady) { - ui.setDisabled(false); - ui.setChecked(state); - } - } - }); - return ui; - }; -})(); - - -// adapter/editor.js -///import core -///commands 全屏 -///commandsName FullScreen -///commandsTitle 全屏 -;(function() { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - UIBase = baidu.editor.ui.UIBase, - domUtils = baidu.editor.dom.domUtils; - var nodeStack = []; - - function EditorUI(options) { - this.initOptions(options); - this.initEditorUI(); - } - - EditorUI.prototype = { - uiName: "editor", - initEditorUI: function() { - this.editor.ui = this; - this._dialogs = {}; - this.initUIBase(); - this._initToolbars(); - var editor = this.editor, - me = this; - - editor.addListener("ready", function() { - //提供getDialog方法 - editor.getDialog = function(name) { - return editor.ui._dialogs[name + "Dialog"]; - }; - domUtils.on(editor.window, "scroll", function(evt) { - baidu.editor.ui.Popup.postHide(evt); - }); - //提供编辑器实时宽高(全屏时宽高不变化) - editor.ui._actualFrameWidth = editor.options.initialFrameWidth; - - UE.browser.ie && - UE.browser.version === 6 && - editor.container.ownerDocument.execCommand( - "BackgroundImageCache", - false, - true - ); - - //display bottom-bar label based on config - if (editor.options.elementPathEnabled) { - editor.ui.getDom("elementpath").innerHTML = - '
                      ' + - editor.getLang("elementPathTip") + - ":
                      "; - } - if (editor.options.wordCount) { - function countFn() { - setCount(editor, me); - domUtils.un(editor.document, "click", arguments.callee); - } - domUtils.on(editor.document, "click", countFn); - editor.ui.getDom("wordcount").innerHTML = editor.getLang( - "wordCountTip" - ); - } - editor.ui._scale(); - if (editor.options.scaleEnabled) { - if (editor.autoHeightEnabled) { - editor.disableAutoHeight(); - } - me.enableScale(); - } else { - me.disableScale(); - } - if ( - !editor.options.elementPathEnabled && - !editor.options.wordCount && - !editor.options.scaleEnabled - ) { - editor.ui.getDom("elementpath").style.display = "none"; - editor.ui.getDom("wordcount").style.display = "none"; - editor.ui.getDom("scale").style.display = "none"; - } - - if (!editor.selection.isFocus()) return; - editor.fireEvent("selectionchange", false, true); - }); - - editor.addListener("mousedown", function(t, evt) { - var el = evt.target || evt.srcElement; - baidu.editor.ui.Popup.postHide(evt, el); - baidu.editor.ui.ShortCutMenu.postHide(evt); - }); - editor.addListener("delcells", function() { - if (UE.ui["edittip"]) { - new UE.ui["edittip"](editor); - } - editor.getDialog("edittip").open(); - }); - - var pastePop, - isPaste = false, - timer; - editor.addListener("afterpaste", function() { - if (editor.queryCommandState("pasteplain")) return; - if (baidu.editor.ui.PastePicker) { - pastePop = new baidu.editor.ui.Popup({ - content: new baidu.editor.ui.PastePicker({ editor: editor }), - editor: editor, - className: "edui-wordpastepop" - }); - pastePop.render(); - } - isPaste = true; - }); - - editor.addListener("afterinserthtml", function() { - clearTimeout(timer); - timer = setTimeout(function() { - if (pastePop && (isPaste || editor.ui._isTransfer)) { - if (pastePop.isHidden()) { - var span = domUtils.createElement(editor.document, "span", { - style: "line-height:0px;", - innerHTML: "\ufeff" - }), - range = editor.selection.getRange(); - range.insertNode(span); - var tmp = getDomNode(span, "firstChild", "previousSibling"); - tmp && - pastePop.showAnchor(tmp.nodeType == 3 ? tmp.parentNode : tmp); - domUtils.remove(span); - } else { - pastePop.show(); - } - delete editor.ui._isTransfer; - isPaste = false; - } - }, 200); - }); - editor.addListener("contextmenu", function(t, evt) { - baidu.editor.ui.Popup.postHide(evt); - }); - editor.addListener("keydown", function(t, evt) { - if (pastePop) pastePop.dispose(evt); - var keyCode = evt.keyCode || evt.which; - if (evt.altKey && keyCode == 90) { - UE.ui.buttons["fullscreen"].onclick(); - } - }); - editor.addListener("wordcount", function(type) { - setCount(this, me); - }); - function setCount(editor, ui) { - editor.setOpt({ - wordCount: true, - maximumWords: 10000, - wordCountMsg: - editor.options.wordCountMsg || editor.getLang("wordCountMsg"), - wordOverFlowMsg: - editor.options.wordOverFlowMsg || editor.getLang("wordOverFlowMsg") - }); - var opt = editor.options, - max = opt.maximumWords, - msg = opt.wordCountMsg, - errMsg = opt.wordOverFlowMsg, - countDom = ui.getDom("wordcount"); - if (!opt.wordCount) { - return; - } - var count = editor.getContentLength(true); - if (count > max) { - countDom.innerHTML = errMsg; - editor.fireEvent("wordcountoverflow"); - } else { - countDom.innerHTML = msg - .replace("{#leave}", max - count) - .replace("{#count}", count); - } - } - - editor.addListener("selectionchange", function() { - if (editor.options.elementPathEnabled) { - me[ - (editor.queryCommandState("elementpath") == -1 ? "dis" : "en") + - "ableElementPath" - ](); - } - if (editor.options.scaleEnabled) { - me[ - (editor.queryCommandState("scale") == -1 ? "dis" : "en") + - "ableScale" - ](); - } - }); - var popup = new baidu.editor.ui.Popup({ - editor: editor, - content: "", - className: "edui-bubble", - _onEditButtonClick: function() { - this.hide(); - editor.ui._dialogs.linkDialog.open(); - }, - _onImgEditButtonClick: function(name) { - this.hide(); - editor.ui._dialogs[name] && editor.ui._dialogs[name].open(); - }, - _onImgSetFloat: function(value) { - this.hide(); - editor.execCommand("imagefloat", value); - }, - _setIframeAlign: function(value) { - var frame = popup.anchorEl; - var newFrame = frame.cloneNode(true); - switch (value) { - case -2: - newFrame.setAttribute("align", ""); - break; - case -1: - newFrame.setAttribute("align", "left"); - break; - case 1: - newFrame.setAttribute("align", "right"); - break; - } - frame.parentNode.insertBefore(newFrame, frame); - domUtils.remove(frame); - popup.anchorEl = newFrame; - popup.showAnchor(popup.anchorEl); - }, - _updateIframe: function() { - var frame = (editor._iframe = popup.anchorEl); - if (domUtils.hasClass(frame, "ueditor_baidumap")) { - editor.selection.getRange().selectNode(frame).select(); - editor.ui._dialogs.mapDialog.open(); - popup.hide(); - } else { - editor.ui._dialogs.insertframeDialog.open(); - popup.hide(); - } - }, - _onRemoveButtonClick: function(cmdName) { - editor.execCommand(cmdName); - this.hide(); - }, - queryAutoHide: function(el) { - if (el && el.ownerDocument == editor.document) { - if ( - el.tagName.toLowerCase() == "img" || - domUtils.findParentByTagName(el, "a", true) - ) { - return el !== popup.anchorEl; - } - } - return baidu.editor.ui.Popup.prototype.queryAutoHide.call(this, el); - } - }); - popup.render(); - if (editor.options.imagePopup) { - editor.addListener("mouseover", function(t, evt) { - evt = evt || window.event; - var el = evt.target || evt.srcElement; - if ( - editor.ui._dialogs.insertframeDialog && - /iframe/gi.test(el.tagName) - ) { - var html = popup.formatHtml( - "" + - editor.getLang("property") + - ': ' + - editor.getLang("default") + - '  ' + - editor.getLang("justifyleft") + - '  ' + - editor.getLang("justifyright") + - "  " + - ' ' + - editor.getLang("modify") + - "" - ); - if (html) { - popup.getDom("content").innerHTML = html; - popup.anchorEl = el; - popup.showAnchor(popup.anchorEl); - } else { - popup.hide(); - } - } - }); - editor.addListener("selectionchange", function(t, causeByUi) { - if (!causeByUi) return; - var html = "", - str = "", - img = editor.selection.getRange().getClosedNode(), - dialogs = editor.ui._dialogs; - if (img && img.tagName == "IMG") { - var dialogName = "insertimageDialog"; - if ( - img.className.indexOf("edui-faked-video") != -1 || - img.className.indexOf("edui-upload-video") != -1 - ) { - dialogName = "insertvideoDialog"; - } - if (img.className.indexOf("edui-faked-webapp") != -1) { - dialogName = "webappDialog"; - } - if (img.src.indexOf("https://api.map.baidu.com") != -1) { - dialogName = "mapDialog"; - } - if (img.className.indexOf("edui-faked-music") != -1) { - dialogName = "musicDialog"; - } - if ( - img.src.indexOf("http://maps.google.com/maps/api/staticmap") != -1 - ) { - dialogName = "gmapDialog"; - } - if (img.getAttribute("anchorname")) { - dialogName = "anchorDialog"; - html = popup.formatHtml( - "" + - editor.getLang("property") + - ': ' + - editor.getLang("modify") + - "  " + - "" + - editor.getLang("delete") + - "" - ); - } - if (img.getAttribute("word_img")) { - //todo 放到dialog去做查询 - editor.word_img = [img.getAttribute("word_img")]; - dialogName = "wordimageDialog"; - } - if ( - domUtils.hasClass(img, "loadingclass") || - domUtils.hasClass(img, "loaderrorclass") - ) { - dialogName = ""; - } - if (!dialogs[dialogName]) { - return; - } - str = - "" + - editor.getLang("property") + - ": " + - '' + - editor.getLang("default") + - "  " + - '' + - editor.getLang("justifyleft") + - "  " + - '' + - editor.getLang("justifyright") + - "  " + - '' + - editor.getLang("justifycenter") + - "  " + - "' + - editor.getLang("modify") + - ""; - - !html && (html = popup.formatHtml(str)); - } - if (editor.ui._dialogs.linkDialog) { - var link = editor.queryCommandValue("link"); - var url; - if ( - link && - (url = link.getAttribute("_href") || link.getAttribute("href", 2)) - ) { - var txt = url; - if (url.length > 30) { - txt = url.substring(0, 20) + "..."; - } - if (html) { - html += '
                      '; - } - html += popup.formatHtml( - "" + - editor.getLang("anthorMsg") + - ': ' + - txt + - "" + - ' ' + - editor.getLang("modify") + - "" + - ' ' + - editor.getLang("clear") + - "" - ); - popup.showAnchor(link); - } - } - - if (html) { - popup.getDom("content").innerHTML = html; - popup.anchorEl = img || link; - popup.showAnchor(popup.anchorEl); - } else { - popup.hide(); - } - }); - } - }, - _initToolbars: function() { - var editor = this.editor; - var toolbars = this.toolbars || []; - var toolbarUis = []; - var extraUIs = []; - for (var i = 0; i < toolbars.length; i++) { - var toolbar = toolbars[i]; - var toolbarUi = new baidu.editor.ui.Toolbar({ - theme: editor.options.theme - }); - for (var j = 0; j < toolbar.length; j++) { - var toolbarItem = toolbar[j]; - var toolbarItemUi = null; - if (typeof toolbarItem == "string") { - toolbarItem = toolbarItem.toLowerCase(); - if (toolbarItem == "|") { - toolbarItem = "Separator"; - } - if (toolbarItem == "||") { - toolbarItem = "Breakline"; - } - var ui = baidu.editor.ui[toolbarItem]; - if (ui) { - if (utils.isFunction(ui)) { - toolbarItemUi = new baidu.editor.ui[toolbarItem](editor); - } else { - if (ui.id && ui.id != editor.key) { - continue; - } - var itemUI = ui.execFn.call(editor, editor, toolbarItem); - if (itemUI) { - if (ui.index === undefined) { - toolbarUi.add(itemUI); - continue; - } else { - extraUIs.push({ - index: ui.index, - itemUI: itemUI - }); - } - } - } - } - //fullscreen这里单独处理一下,放到首行去 - if (toolbarItem == "fullscreen") { - if (toolbarUis && toolbarUis[0]) { - toolbarUis[0].items.splice(0, 0, toolbarItemUi); - } else { - toolbarItemUi && toolbarUi.items.splice(0, 0, toolbarItemUi); - } - continue; - } - } else { - toolbarItemUi = toolbarItem; - } - if (toolbarItemUi && toolbarItemUi.id) { - toolbarUi.add(toolbarItemUi); - } - } - toolbarUis[i] = toolbarUi; - } - - //接受外部定制的UI - - utils.each(extraUIs, function(obj) { - toolbarUi.add(obj.itemUI, obj.index); - }); - this.toolbars = toolbarUis; - }, - getHtmlTpl: function() { - return ( - '
                      ' + - '
                      ' + - (this.toolbars.length - ? '
                      ' + - this.renderToolbarBoxHtml() + - "
                      " - : "") + - '" + - '
                      ' + - "
                      " + - '
                      ' + - "
                      " + - //modify wdcount by matao - '
                      ' + - '' + - '' + - '' + - "
                      " + - '
                      ' + - "
                      " - ); - }, - showWordImageDialog: function() { - this._dialogs["wordimageDialog"].open(); - }, - renderToolbarBoxHtml: function() { - var buff = []; - for (var i = 0; i < this.toolbars.length; i++) { - buff.push(this.toolbars[i].renderHtml()); - } - return buff.join(""); - }, - setFullScreen: function(fullscreen) { - var editor = this.editor, - container = editor.container.parentNode.parentNode; - if (this._fullscreen != fullscreen) { - this._fullscreen = fullscreen; - this.editor.fireEvent("beforefullscreenchange", fullscreen); - if (baidu.editor.browser.gecko) { - var bk = editor.selection.getRange().createBookmark(); - } - if (fullscreen) { - while (container.tagName != "BODY") { - var position = baidu.editor.dom.domUtils.getComputedStyle( - container, - "position" - ); - nodeStack.push(position); - container.style.position = "static"; - container = container.parentNode; - } - this._bakHtmlOverflow = document.documentElement.style.overflow; - this._bakBodyOverflow = document.body.style.overflow; - this._bakAutoHeight = this.editor.autoHeightEnabled; - this._bakScrollTop = Math.max( - document.documentElement.scrollTop, - document.body.scrollTop - ); - - this._bakEditorContaninerWidth = editor.iframe.parentNode.offsetWidth; - if (this._bakAutoHeight) { - //当全屏时不能执行自动长高 - editor.autoHeightEnabled = false; - this.editor.disableAutoHeight(); - } - - document.documentElement.style.overflow = "hidden"; - //修复,滚动条不收起的问题 - - window.scrollTo(0, window.scrollY); - this._bakCssText = this.getDom().style.cssText; - this._bakCssText1 = this.getDom("iframeholder").style.cssText; - editor.iframe.parentNode.style.width = ""; - this._updateFullScreen(); - } else { - while (container.tagName != "BODY") { - container.style.position = nodeStack.shift(); - container = container.parentNode; - } - this.getDom().style.cssText = this._bakCssText; - this.getDom("iframeholder").style.cssText = this._bakCssText1; - if (this._bakAutoHeight) { - editor.autoHeightEnabled = true; - this.editor.enableAutoHeight(); - } - - document.documentElement.style.overflow = this._bakHtmlOverflow; - document.body.style.overflow = this._bakBodyOverflow; - editor.iframe.parentNode.style.width = - this._bakEditorContaninerWidth + "px"; - window.scrollTo(0, this._bakScrollTop); - } - if (browser.gecko && editor.body.contentEditable === "true") { - var input = document.createElement("input"); - document.body.appendChild(input); - editor.body.contentEditable = false; - setTimeout(function() { - input.focus(); - setTimeout(function() { - editor.body.contentEditable = true; - editor.fireEvent("fullscreenchanged", fullscreen); - editor.selection.getRange().moveToBookmark(bk).select(true); - baidu.editor.dom.domUtils.remove(input); - fullscreen && window.scroll(0, 0); - }, 0); - }, 0); - } - - if (editor.body.contentEditable === "true") { - this.editor.fireEvent("fullscreenchanged", fullscreen); - this.triggerLayout(); - } - } - }, - _updateFullScreen: function() { - if (this._fullscreen) { - var vpRect = uiUtils.getViewportRect(); - this.getDom().style.cssText = - "border:0;position:absolute;left:0;top:" + - (this.editor.options.topOffset || 0) + - "px;width:" + - vpRect.width + - "px;height:" + - vpRect.height + - "px;z-index:" + - (this.getDom().style.zIndex * 1 + 100); - uiUtils.setViewportOffset(this.getDom(), { - left: 0, - top: this.editor.options.topOffset || 0 - }); - this.editor.setHeight( - vpRect.height - - this.getDom("toolbarbox").offsetHeight - - this.getDom("bottombar").offsetHeight - - (this.editor.options.topOffset || 0), - true - ); - //不手动调一下,会导致全屏失效 - if (browser.gecko) { - try { - window.onresize(); - } catch (e) {} - } - } - }, - _updateElementPath: function() { - var bottom = this.getDom("elementpath"), - list; - if ( - this.elementPathEnabled && - (list = this.editor.queryCommandValue("elementpath")) - ) { - var buff = []; - for (var i = 0, ci; (ci = list[i]); i++) { - buff[i] = this.formatHtml( - '' + - ci + - "" - ); - } - bottom.innerHTML = - '
                      ' + - this.editor.getLang("elementPathTip") + - ": " + - buff.join(" > ") + - "
                      "; - } else { - bottom.style.display = "none"; - } - }, - disableElementPath: function() { - var bottom = this.getDom("elementpath"); - bottom.innerHTML = ""; - bottom.style.display = "none"; - this.elementPathEnabled = false; - }, - enableElementPath: function() { - var bottom = this.getDom("elementpath"); - bottom.style.display = ""; - this.elementPathEnabled = true; - this._updateElementPath(); - }, - _scale: function() { - var doc = document, - editor = this.editor, - editorHolder = editor.container, - editorDocument = editor.document, - toolbarBox = this.getDom("toolbarbox"), - bottombar = this.getDom("bottombar"), - scale = this.getDom("scale"), - scalelayer = this.getDom("scalelayer"); - - var isMouseMove = false, - position = null, - minEditorHeight = 0, - minEditorWidth = editor.options.minFrameWidth, - pageX = 0, - pageY = 0, - scaleWidth = 0, - scaleHeight = 0; - - function down() { - position = domUtils.getXY(editorHolder); - - if (!minEditorHeight) { - minEditorHeight = - editor.options.minFrameHeight + - toolbarBox.offsetHeight + - bottombar.offsetHeight; - } - - scalelayer.style.cssText = - "position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:" + - editorHolder.offsetWidth + - "px;height:" + - editorHolder.offsetHeight + - "px;z-index:" + - (editor.options.zIndex + 1); - - domUtils.on(doc, "mousemove", move); - domUtils.on(editorDocument, "mouseup", up); - domUtils.on(doc, "mouseup", up); - } - - var me = this; - //by xuheng 全屏时关掉缩放 - this.editor.addListener("fullscreenchanged", function(e, fullScreen) { - if (fullScreen) { - me.disableScale(); - } else { - if (me.editor.options.scaleEnabled) { - me.enableScale(); - var tmpNode = me.editor.document.createElement("span"); - me.editor.body.appendChild(tmpNode); - me.editor.body.style.height = - Math.max( - domUtils.getXY(tmpNode).y, - me.editor.iframe.offsetHeight - 20 - ) + "px"; - domUtils.remove(tmpNode); - } - } - }); - function move(event) { - clearSelection(); - var e = event || window.event; - pageX = e.pageX || doc.documentElement.scrollLeft + e.clientX; - pageY = e.pageY || doc.documentElement.scrollTop + e.clientY; - scaleWidth = pageX - position.x; - scaleHeight = pageY - position.y; - - if (scaleWidth >= minEditorWidth) { - isMouseMove = true; - scalelayer.style.width = scaleWidth + "px"; - } - if (scaleHeight >= minEditorHeight) { - isMouseMove = true; - scalelayer.style.height = scaleHeight + "px"; - } - } - - function up() { - if (isMouseMove) { - isMouseMove = false; - editor.ui._actualFrameWidth = scalelayer.offsetWidth - 2; - editorHolder.style.width = editor.ui._actualFrameWidth + "px"; - - editor.setHeight( - scalelayer.offsetHeight - - bottombar.offsetHeight - - toolbarBox.offsetHeight - - 2, - true - ); - } - if (scalelayer) { - scalelayer.style.display = "none"; - } - clearSelection(); - domUtils.un(doc, "mousemove", move); - domUtils.un(editorDocument, "mouseup", up); - domUtils.un(doc, "mouseup", up); - } - - function clearSelection() { - if (browser.ie) doc.selection.clear(); - else window.getSelection().removeAllRanges(); - } - - this.enableScale = function() { - //trace:2868 - if (editor.queryCommandState("source") == 1) return; - scale.style.display = ""; - this.scaleEnabled = true; - domUtils.on(scale, "mousedown", down); - }; - this.disableScale = function() { - scale.style.display = "none"; - this.scaleEnabled = false; - domUtils.un(scale, "mousedown", down); - }; - }, - isFullScreen: function() { - return this._fullscreen; - }, - postRender: function() { - UIBase.prototype.postRender.call(this); - for (var i = 0; i < this.toolbars.length; i++) { - this.toolbars[i].postRender(); - } - var me = this; - var timerId, - domUtils = baidu.editor.dom.domUtils, - updateFullScreenTime = function() { - clearTimeout(timerId); - timerId = setTimeout(function() { - me._updateFullScreen(); - }); - }; - domUtils.on(window, "resize", updateFullScreenTime); - - me.addListener("destroy", function() { - domUtils.un(window, "resize", updateFullScreenTime); - clearTimeout(timerId); - }); - }, - showToolbarMsg: function(msg, flag) { - this.getDom("toolbarmsg_label").innerHTML = msg; - this.getDom("toolbarmsg").style.display = ""; - // - if (!flag) { - var w = this.getDom("upload_dialog"); - w.style.display = "none"; - } - }, - hideToolbarMsg: function() { - this.getDom("toolbarmsg").style.display = "none"; - }, - mapUrl: function(url) { - return url - ? url.replace("~/", this.editor.options.UEDITOR_HOME_URL || "") - : ""; - }, - triggerLayout: function() { - var dom = this.getDom(); - if (dom.style.zoom == "1") { - dom.style.zoom = "100%"; - } else { - dom.style.zoom = "1"; - } - } - }; - utils.inherits(EditorUI, baidu.editor.ui.UIBase); - - var instances = {}; - - UE.ui.Editor = function(options) { - var editor = new UE.Editor(options); - editor.options.editor = editor; - utils.loadFile(document, { - href: - editor.options.themePath + editor.options.theme + "/css/neditor.css", - tag: "link", - type: "text/css", - rel: "stylesheet" - }); - - var oldRender = editor.render; - editor.render = function(holder) { - if (holder.constructor === String) { - editor.key = holder; - instances[holder] = editor; - } - utils.domReady(function() { - editor.langIsReady - ? renderUI() - : editor.addListener("langReady", renderUI); - function renderUI() { - editor.setOpt({ - labelMap: editor.options.labelMap || editor.getLang("labelMap") - }); - new EditorUI(editor.options); - if (holder) { - if (holder.constructor === String) { - holder = document.getElementById(holder); - } - holder && - holder.getAttribute("name") && - (editor.options.textarea = holder.getAttribute("name")); - if (holder && /script|textarea/gi.test(holder.tagName)) { - var newDiv = document.createElement("div"); - holder.parentNode.insertBefore(newDiv, holder); - var cont = holder.value || holder.innerHTML; - editor.options.initialContent = /^[\t\r\n ]*$/.test(cont) - ? editor.options.initialContent - : cont - .replace(/>[\n\r\t]+([ ]{4})+/g, ">") - .replace(/[\n\r\t]+([ ]{4})+[\n\r\t]+<"); - holder.className && (newDiv.className = holder.className); - holder.style.cssText && - (newDiv.style.cssText = holder.style.cssText); - if (/textarea/i.test(holder.tagName)) { - editor.textarea = holder; - editor.textarea.style.display = "none"; - } else { - holder.parentNode.removeChild(holder); - } - if (holder.id) { - newDiv.id = holder.id; - domUtils.removeAttributes(holder, "id"); - } - holder = newDiv; - holder.innerHTML = ""; - } - } - domUtils.addClass(holder, "edui-" + editor.options.theme); - editor.ui.render(holder); - var opt = editor.options; - //给实例添加一个编辑器的容器引用 - editor.container = editor.ui.getDom(); - var parents = domUtils.findParents(holder, true); - var displays = []; - for (var i = 0, ci; (ci = parents[i]); i++) { - displays[i] = ci.style.display; - ci.style.display = "block"; - } - if (opt.initialFrameWidth) { - opt.minFrameWidth = opt.initialFrameWidth; - } else { - opt.minFrameWidth = opt.initialFrameWidth = holder.offsetWidth; - var styleWidth = holder.style.width; - if (/%$/.test(styleWidth)) { - opt.initialFrameWidth = styleWidth; - } - } - if (opt.initialFrameHeight) { - opt.minFrameHeight = opt.initialFrameHeight; - } else { - opt.initialFrameHeight = opt.minFrameHeight = holder.offsetHeight; - } - for (var i = 0, ci; (ci = parents[i]); i++) { - ci.style.display = displays[i]; - } - //编辑器最外容器设置了高度,会导致,编辑器不占位 - //todo 先去掉,没有找到原因 - if (holder.style.height) { - holder.style.height = ""; - } - editor.container.style.width = - opt.initialFrameWidth + - (/%$/.test(opt.initialFrameWidth) ? "" : "px"); - editor.container.style.zIndex = opt.zIndex; - oldRender.call(editor, editor.ui.getDom("iframeholder")); - editor.fireEvent("afteruiready"); - } - }); - }; - return editor; - }; - - /** - * @file - * @name UE - * @short UE - * @desc UEditor的顶部命名空间 - */ - /** - * @name getEditor - * @since 1.2.4+ - * @grammar UE.getEditor(id,[opt]) => Editor实例 - * @desc 提供一个全局的方法得到编辑器实例 - * - * * ''id'' 放置编辑器的容器id, 如果容器下的编辑器已经存在,就直接返回 - * * ''opt'' 编辑器的可选参数 - * @example - * UE.getEditor('containerId',{onready:function(){//创建一个编辑器实例 - * this.setContent('hello') - * }}); - * UE.getEditor('containerId'); //返回刚创建的实例 - * - */ - UE.getEditor = function(id, opt) { - var editor = instances[id]; - if (!editor) { - editor = instances[id] = new UE.ui.Editor(opt); - editor.render(id); - } - return editor; - }; - - UE.delEditor = function(id) { - var editor; - if ((editor = instances[id])) { - editor.key && editor.destroy(); - delete instances[id]; - } - }; - - UE.registerUI = function(uiName, fn, index, editorId) { - utils.each(uiName.split(/\s+/), function(name) { - baidu.editor.ui[name] = { - id: editorId, - execFn: fn, - index: index - }; - }); - }; -})(); - - -// adapter/message.js -UE.registerUI("message", function(editor) { - var editorui = baidu.editor.ui; - var Message = editorui.Message; - var holder; - var _messageItems = []; - var me = editor; - - me.setOpt("enableMessageShow", true); - if (me.getOpt("enableMessageShow") === false) { - return; - } - - me.addListener("ready", function() { - holder = document.getElementById(me.ui.id + "_message_holder"); - updateHolderPos(); - setTimeout(function() { - updateHolderPos(); - }, 500); - }); - - me.addListener("showmessage", function(type, opt) { - opt = utils.isString(opt) - ? { - content: opt - } - : opt; - var message = new Message({ - timeout: opt.timeout, - type: opt.type, - content: opt.content, - keepshow: opt.keepshow, - editor: me - }), - mid = opt.id || "msg_" + (+new Date()).toString(36); - message.render(holder); - _messageItems[mid] = message; - message.reset(opt); - updateHolderPos(); - return mid; - }); - - me.addListener("updatemessage", function(type, id, opt) { - opt = utils.isString(opt) - ? { - content: opt - } - : opt; - var message = _messageItems[id]; - message.render(holder); - message && message.reset(opt); - }); - - me.addListener("hidemessage", function(type, id) { - var message = _messageItems[id]; - message && message.hide(); - }); - - function updateHolderPos() { - if (!holder || !me.ui) return; - var toolbarbox = me.ui.getDom("toolbarbox"); - if (toolbarbox) { - holder.style.top = toolbarbox.offsetHeight + 3 + "px"; - } - holder.style.zIndex = - Math.max(me.options.zIndex, me.iframe.style.zIndex) + 1; - } -}); - - -// adapter/autosave.js -UE.registerUI("autosave", function(editor) { - var timer = null, - uid = null; - editor.on("afterautosave", function() { - clearTimeout(timer); - - timer = setTimeout(function() { - if (uid) { - editor.trigger("hidemessage", uid); - } - uid = editor.trigger("showmessage", { - content: editor.getLang("autosave.success"), - timeout: 2000 - }); - }, 2000); - }); -}); - - - -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.all.min.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.all.min.js deleted file mode 100644 index b8fd585e216bb1fbe544c2d90328604003ad35da..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.all.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * neditor - * version: 2.1.13 - * build: Sat Dec 29 2018 09:49:22 GMT+0000 (UTC) - */!function(){function getListener(a,b,c){var d;return b=b.toLowerCase(),(d=a.__allListeners||c&&(a.__allListeners={}))&&(d[b]||c&&(d[b]=[]))}function getDomNode(a,b,c,d,e,f){var g,h=d&&a[b];for(!h&&(h=a[c]);!h&&(g=(g||a).parentNode);){if("BODY"==g.tagName||f&&!f(g))return null;h=g[c]}return h&&e&&!e(h)?getDomNode(h,b,c,!1,e):h}UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var baidu=window.baidu||{};window.baidu=baidu,window.UE=baidu.editor={plugins:{},commands:{},instants:{},I18N:{},_customizeUI:{},version:"1.5.0"};var dom=UE.dom={},browser=UE.browser=function(){var a=navigator.userAgent.toLowerCase(),b=window.opera,c={ie:/(msie\s|trident.*rv:)([\w.]+)/i.test(a),opera:!!b&&b.version,webkit:a.indexOf(" applewebkit/")>-1,mac:a.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode};c.gecko="Gecko"==navigator.product&&!c.webkit&&!c.opera&&!c.ie;var d=0;if(c.ie){var e=a.match(/(?:msie\s([\w.]+))/),f=a.match(/(?:trident.*rv:([\w.]+))/);d=e&&f&&e[1]&&f[1]?Math.max(1*e[1],1*f[1]):e&&e[1]?1*e[1]:f&&f[1]?1*f[1]:0,c.ie11Compat=11==document.documentMode,c.ie9Compat=9==document.documentMode,c.ie8=!!document.documentMode,c.ie8Compat=8==document.documentMode,c.ie7Compat=7==d&&!document.documentMode||7==document.documentMode,c.ie6Compat=d<7||c.quirks,c.ie9above=d>8,c.ie9below=d<9,c.ie11above=d>10,c.ie11below=d<11}if(c.gecko){var g=a.match(/rv:([\d\.]+)/);g&&(g=g[1].split("."),d=1e4*g[0]+100*(g[1]||0)+1*(g[2]||0))}return/chrome\/(\d+\.\d)/i.test(a)&&(c.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(a)&&!/chrome/i.test(a)&&(c.safari=+(RegExp.$1||RegExp.$2)),c.opera&&(d=parseFloat(b.version())),c.webkit&&(d=parseFloat(a.match(/ applewebkit\/(\d+)/)[1])),c.version=d,c.isCompatible=!c.mobile&&(c.ie&&d>=6||c.gecko&&d>=10801||c.opera&&d>=9.5||c.air&&d>=1||c.webkit&&d>=522||!1),c}(),ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera,utils=UE.utils={each:function(a,b,c){if(null!=a)if(a.length===+a.length){for(var d=0,e=a.length;d=c&&a===b)return d=e,!1}),d},removeItem:function(a,b){for(var c=0,d=a.length;c'](?:(amp|lt|ldquo|rdquo|quot|gt|#39|nbsp|#\d+);)?/g,function(a,b){return b?a:{"<":"<","&":"&",'"':""","“":"“","”":"”",">":">","'":"'"}[a]}):""},html:function(a){return a?a.replace(/&((g|l|quo|ldquo|rdquo)t|amp|#39|nbsp);/g,function(a){return{"<":"<","&":"&",""":'"',"“":"“","”":"”",">":">","'":"'"," ":" "}[a]}):""},cssStyleToDomStyle:function(){var a=document.createElement("div").style,b={"float":void 0!=a.cssFloat?"cssFloat":void 0!=a.styleFloat?"styleFloat":"float"};return function(a){return b[a]||(b[a]=a.toLowerCase().replace(/-./g,function(a){return a.charAt(1).toUpperCase()}))}}(),loadFile:function(){function a(a,c){try{for(var d,e=0;d=b[e++];)if(d.doc===a&&d.url==(c.src||c.href))return d}catch(f){return null}}var b=[];return function(c,d,e){var f=a(c,d);if(f)return void(f.ready?e&&e():f.funs.push(e));if(b.push({doc:c,url:d.src||d.href,funs:[e]}),!c.body){var g=[];for(var h in d)"tag"!=h&&g.push(h+'="'+d[h]+'"');return void c.write("<"+d.tag+" "+g.join(" ")+" >")}if(!d.id||!c.getElementById(d.id)){var i=c.createElement(d.tag);delete d.tag;for(var h in d)i.setAttribute(h,d[h]);i.onload=i.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(f=a(c,d),f.funs.length>0){f.ready=1;for(var b;b=f.funs.pop();)b()}i.onload=i.onreadystatechange=null}},i.onerror=function(){throw Error("The load "+(d.href||d.src)+" fails,check the url settings of file neditor.config.js ")},c.getElementsByTagName("head")[0].appendChild(i)}}}(),isEmptyObject:function(a){if(null==a)return!0;if(this.isArray(a)||this.isString(a))return 0===a.length;for(var b in a)if(a.hasOwnProperty(b))return!1;return!0},fixColor:function(a,b){if(/color/i.test(a)&&/rgba?/.test(b)){var c=b.split(",");if(c.length>3)return"";b="#";for(var d,e=0;d=c[e++];)d=parseInt(d.replace(/[^\d]/gi,""),10).toString(16),b+=1==d.length?"0"+d:d;b=b.toUpperCase()}return b},optCss:function(a){function b(a,b){if(!a)return"";var c=a.top,d=a.bottom,e=a.left,f=a.right,g="";if(c&&e&&d&&f)g+=";"+b+":"+(c==d&&d==e&&e==f?c:c==d&&e==f?c+" "+e:e==f?c+" "+e+" "+d:c+" "+f+" "+d+" "+e)+";";else for(var h in a)g+=";"+b+"-"+h+":"+a[h]+";";return g}var c,d;return a=a.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,function(a,b,e,f){if(1==f.split(" ").length)switch(b){case"padding":return!c&&(c={}),c[e]=f,"";case"margin":return!d&&(d={}),d[e]=f,"";case"border":return"initial"==f?"":a}return a}),a+=b(c,"padding")+b(d,"margin"),a.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,function(a,b){return b?b+";;":";"})},clone:function(a,b){var c;b=b||{};for(var d in a)a.hasOwnProperty(d)&&(c=a[d],"object"==typeof c?(b[d]=utils.isArray(c)?[]:{},utils.clone(a[d],b[d])):b[d]=c);return b},transUnitToPx:function(a){if(!/(pt|cm)/.test(a))return a;var b;switch(a.replace(/([\d.]+)(\w+)/,function(c,d,e){a=d,b=e}),b){case"cm":a=25*parseFloat(a);break;case"pt":a=Math.round(96*parseFloat(a)/72)}return a+(a?"px":"")},domReady:function(){function a(a){a.isReady=!0;for(var c;c=b.pop();c());}var b=[];return function(c,d){d=d||window;var e=d.document;c&&b.push(c),"complete"===e.readyState?a(e):(e.isReady&&a(e),browser.ie&&11!=browser.version?(!function(){if(!e.isReady){try{e.documentElement.doScroll("left")}catch(b){return void setTimeout(arguments.callee,0)}a(e)}}(),d.attachEvent("onload",function(){a(e)})):(e.addEventListener("DOMContentLoaded",function(){e.removeEventListener("DOMContentLoaded",arguments.callee,!1),a(e)},!1),d.addEventListener("load",function(){a(e)},!1)))}}(),cssRule:browser.ie&&11!=browser.version?function(a,b,c){var d,e;if(void 0===b||b&&b.nodeType&&9==b.nodeType){if(c=b&&b.nodeType&&9==b.nodeType?b:c||document,d=c.indexList||(c.indexList={}),e=d[a],void 0!==e)return c.styleSheets[e].cssText}else{if(c=c||document,d=c.indexList||(c.indexList={}),e=d[a],""===b)return void 0!==e&&(c.styleSheets[e].cssText="",delete d[a],!0);void 0!==e?sheetStyle=c.styleSheets[e]:(sheetStyle=c.createStyleSheet("",e=c.styleSheets.length),d[a]=e),sheetStyle.cssText=b}}:function(a,b,c){var d;return void 0===b||b&&b.nodeType&&9==b.nodeType?(c=b&&b.nodeType&&9==b.nodeType?b:c||document,d=c.getElementById(a),d?d.innerHTML:void 0):(c=c||document,d=c.getElementById(a),""===b?!!d&&(d.parentNode.removeChild(d),!0):void(d?d.innerHTML=b:(d=c.createElement("style"),d.id=a,d.innerHTML=b,c.getElementsByTagName("head")[0].appendChild(d))))},sort:function(a,b){b=b||function(a,b){return a.localeCompare(b)};for(var c=0,d=a.length;c0){var g=a[c];a[c]=a[e],a[e]=g}return a},serializeParam:function(a){var b=[];for(var c in a)if("method"!=c&&"timeout"!=c&&"async"!=c)if("function"!=(typeof a[c]).toLowerCase()&&"object"!=(typeof a[c]).toLowerCase())b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));else if(utils.isArray(a[c]))for(var d=0;d1||b!==a.parentNode){a.style.cssText=b.style.cssText+";"+a.style.cssText,b=b.parentNode;continue}b.style.cssText+=";"+a.style.cssText,"A"==b.tagName&&(b.style.textDecoration="underline")}if("A"!=b.tagName){b===a.parentNode&&domUtils.remove(a,!0);break}}b=b.parentNode}},mergeSibling:function(a,b,c){function d(a,b,c){var d;if((d=c[a])&&!domUtils.isBookmarkNode(d)&&1==d.nodeType&&domUtils.isSameElement(c,d)){for(;d.firstChild;)"firstChild"==b?c.insertBefore(d.lastChild,c.firstChild):c.appendChild(d.firstChild);domUtils.remove(d)}}!b&&d("previousSibling","firstChild",a),!c&&d("nextSibling","lastChild",a)},unSelectable:ie&&browser.ie9below||browser.opera?function(a){a.onselectstart=function(){return!1},a.onclick=a.onkeyup=a.onkeydown=function(){return!1},a.unselectable="on",a.setAttribute("unselectable","on");for(var b,c=0;b=a.all[c++];)switch(b.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:b.unselectable="on",a.setAttribute("unselectable","on")}}:function(a){a.style.MozUserSelect=a.style.webkitUserSelect=a.style.msUserSelect=a.style.KhtmlUserSelect="none"},removeAttributes:function(a,b){b=utils.isArray(b)?b:utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0;c=b[d++];){switch(c=attrFix[c]||c){case"className":a[c]="";break;case"style":a.style.cssText="";var e=a.getAttributeNode("style");!browser.ie&&e&&a.removeAttributeNode(e)}a.removeAttribute(c)}},createElement:function(a,b,c){return domUtils.setAttributes(a.createElement(b),c)},setAttributes:function(a,b){for(var c in b)if(b.hasOwnProperty(c)){var d=b[c];switch(c){case"class":a.className=d;break;case"style":a.style.cssText=a.style.cssText+";"+d;break;case"innerHTML":a[c]=d;break;case"value":a.value=d;break;default:a.setAttribute(attrFix[c]||c,d)}}return a},getComputedStyle:function(a,b){var c="width height top left";if(c.indexOf(b)>-1)return a["offset"+b.replace(/^\w/,function(a){return a.toUpperCase()})]+"px";if(3==a.nodeType&&(a=a.parentNode),browser.ie&&browser.version<9&&"font-size"==b&&!a.style.fontSize&&!dtd.$empty[a.tagName]&&!dtd.$nonChild[a.tagName]){var d=a.ownerDocument.createElement("span");d.style.cssText="padding:0;border:0;font-family:simsun;",d.innerHTML=".",a.appendChild(d);var e=d.offsetHeight;return a.removeChild(d),d=null,e+"px"}try{var f=domUtils.getStyle(a,b)||(window.getComputedStyle?domUtils.getWindow(a).getComputedStyle(a,"").getPropertyValue(b):(a.currentStyle||a.style)[utils.cssStyleToDomStyle(b)])}catch(g){return""}return utils.transUnitToPx(utils.fixColor(b,f))},removeClasses:function(a,b){b=utils.isArray(b)?b:utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)e=e.replace(new RegExp("\\b"+c+"\\b"),"");e=utils.trim(e).replace(/[ ]{2,}/g," "),e?a.className=e:domUtils.removeAttributes(a,["class"])},addClass:function(a,b){if(a){b=utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)new RegExp("\\b"+c+"\\b").test(e)||(e+=" "+c);a.className=utils.trim(e)}},hasClass:function(a,b){if(utils.isRegExp(b))return b.test(a.className);b=utils.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)if(!new RegExp("\\b"+c+"\\b","i").test(e))return!1;return d-1==b.length},preventDefault:function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},removeStyle:function(a,b){browser.ie?("color"==b&&(b="(^|;)"+b),a.style.cssText=a.style.cssText.replace(new RegExp(b+"[^:]*:[^;]+;?","ig"),"")):a.style.removeProperty?a.style.removeProperty(b):a.style.removeAttribute(utils.cssStyleToDomStyle(b)),a.style.cssText||domUtils.removeAttributes(a,["style"])},getStyle:function(a,b){var c=a.style[utils.cssStyleToDomStyle(b)];return utils.fixColor(b,c)},setStyle:function(a,b,c){a.style[utils.cssStyleToDomStyle(b)]=c,utils.trim(a.style.cssText)||this.removeAttributes(a,"style")},setStyles:function(a,b){for(var c in b)b.hasOwnProperty(c)&&domUtils.setStyle(a,c,b[c])},removeDirtyAttr:function(a){for(var b,c=0,d=a.getElementsByTagName("*");b=d[c++];)b.removeAttribute("_moz_dirty");a.removeAttribute("_moz_dirty")},getChildCount:function(a,b){var c=0,d=a.firstChild;for(b=b||function(){return 1};d;)b(d)&&c++,d=d.nextSibling;return c},isEmptyNode:function(a){return!a.firstChild||0==domUtils.getChildCount(a,function(a){return!domUtils.isBr(a)&&!domUtils.isBookmarkNode(a)&&!domUtils.isWhitespace(a)})},clearSelectedArr:function(a){for(var b;b=a.pop();)domUtils.removeAttributes(b,["class"])},scrollToView:function(a,b,c){var d=function(){var a=b.document,c="CSS1Compat"==a.compatMode;return{width:(c?a.documentElement.clientWidth:a.body.clientWidth)||0,height:(c?a.documentElement.clientHeight:a.body.clientHeight)||0}},e=function(a){if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};var b=a.document;return{x:b.documentElement.scrollLeft||b.body.scrollLeft||0,y:b.documentElement.scrollTop||b.body.scrollTop||0}},f=d().height,g=f*-1+c;g+=a.offsetHeight||0;var h=domUtils.getXY(a);g+=h.y;var i=e(b).y;(g>i||g0)return 0;for(var c in dtd.$isNotEmpty)if(a.getElementsByTagName(c).length)return 0;return 1},setViewportOffset:function(a,b){var c=0|parseInt(a.style.left),d=0|parseInt(a.style.top),e=a.getBoundingClientRect(),f=b.left-e.left,g=b.top-e.top;f&&(a.style.left=c+f+"px"),g&&(a.style.top=d+g+"px")},fillNode:function(a,b){var c=browser.ie?a.createTextNode(domUtils.fillChar):a.createElement("br");b.innerHTML="",b.appendChild(c)},moveChild:function(a,b,c){for(;a.firstChild;)c&&b.firstChild?b.insertBefore(a.lastChild,b.firstChild):b.appendChild(a.firstChild)},hasNoAttributes:function(a){return browser.ie?/^<\w+\s*?>/.test(a.outerHTML):0==a.attributes.length},isCustomeNode:function(a){return 1==a.nodeType&&a.getAttribute("_ue_custom_node_")},isTagNode:function(a,b){return 1==a.nodeType&&new RegExp("\\b"+a.tagName+"\\b","i").test(b)},filterNodeList:function(a,b,c){var d=[];if(!utils.isFunction(b)){var e=b;b=function(a){return utils.indexOf(utils.isArray(e)?e:e.split(" "),a.tagName.toLowerCase())!=-1}}return utils.each(a,function(a){b(a)&&d.push(a)}),0==d.length?null:1!=d.length&&c?d:d[0]},isInNodeEndBoundary:function(a,b){var c=a.startContainer;if(3==c.nodeType&&a.startOffset!=c.nodeValue.length)return 0;if(1==c.nodeType&&a.startOffset!=c.childNodes.length)return 0;for(;c!==b;){if(c.nextSibling)return 0;c=c.parentNode}return 1},isBoundaryNode:function(a,b){for(var c;!domUtils.isBody(a);)if(c=a,a=a.parentNode,c!==a[b])return!1;return!0},fillHtml:browser.ie11below?" ":"
                      "},fillCharReg=new RegExp(domUtils.fillChar,"g");!function(){function a(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer===a.endContainer&&a.startOffset==a.endOffset}function b(a){return!a.collapsed&&1==a.startContainer.nodeType&&a.startContainer===a.endContainer&&a.endOffset-a.startOffset==1}function c(b,c,d,e){return 1==c.nodeType&&(dtd.$empty[c.tagName]||dtd.$nonChild[c.tagName])&&(d=domUtils.getNodeIndex(c)+(b?0:1),c=c.parentNode),b?(e.startContainer=c,e.startOffset=d,e.endContainer||e.collapse(!0)):(e.endContainer=c,e.endOffset=d,e.startContainer||e.collapse(!1)),a(e),e}function d(a,b){var c,d,e=a.startContainer,f=a.endContainer,g=a.startOffset,h=a.endOffset,i=a.document,j=i.createDocumentFragment();if(1==e.nodeType&&(e=e.childNodes[g]||(c=e.appendChild(i.createTextNode("")))),1==f.nodeType&&(f=f.childNodes[h]||(d=f.appendChild(i.createTextNode("")))),e===f&&3==e.nodeType)return j.appendChild(i.createTextNode(e.substringData(g,h-g))),b&&(e.deleteData(g,h-g),a.collapse(!0)),j;for(var k,l,m=j,n=domUtils.findParents(e,!0),o=domUtils.findParents(f,!0),p=0;n[p]==o[p];)p++;for(var q,r=p;q=n[r];r++){for(k=q.nextSibling,q==e?c||(3==a.startContainer.nodeType?(m.appendChild(i.createTextNode(e.nodeValue.slice(g))),b&&e.deleteData(g,e.nodeValue.length-g)):m.appendChild(b?e:e.cloneNode(!0))):(l=q.cloneNode(!1),m.appendChild(l));k&&k!==f&&k!==o[r];)q=k.nextSibling,m.appendChild(b?k:k.cloneNode(!0)),k=q;m=l}m=j,n[p]||(m.appendChild(n[p-1].cloneNode(!1)),m=m.firstChild);for(var s,r=p;s=o[r];r++){if(k=s.previousSibling,s==f?d||3!=a.endContainer.nodeType||(m.appendChild(i.createTextNode(f.substringData(0,h))),b&&f.deleteData(0,h)):(l=s.cloneNode(!1),m.appendChild(l)),r!=p||!n[p])for(;k&&k!==e;)s=k.previousSibling,m.insertBefore(b?k:k.cloneNode(!0),m.firstChild),k=s;m=l}return b&&a.setStartBefore(o[p]?n[p]?o[p]:n[p-1]:o[p-1]).collapse(!0),c&&domUtils.remove(c),d&&domUtils.remove(d),j}function e(a,b){try{if(g&&domUtils.inDoc(g,a))if(g.nodeValue.replace(fillCharReg,"").length)g.nodeValue=g.nodeValue.replace(fillCharReg,"");else{var c=g.parentNode;for(domUtils.remove(g);c&&domUtils.isEmptyInlineElement(c)&&(browser.safari?!(domUtils.getPosition(c,b)&domUtils.POSITION_CONTAINS):!c.contains(b));)g=c.parentNode, -domUtils.remove(c),c=g}}catch(d){}}function f(a,b){var c;for(a=a[b];a&&domUtils.isFillChar(a);)c=a[b],domUtils.remove(a),a=c}var g,h=0,i=domUtils.fillChar,j=dom.Range=function(a){var b=this;b.startContainer=b.startOffset=b.endContainer=b.endOffset=null,b.document=a,b.collapsed=!0};j.prototype={cloneContents:function(){return this.collapsed?null:d(this,0)},deleteContents:function(){var a;return this.collapsed||d(this,1),browser.webkit&&(a=this.startContainer,3!=a.nodeType||a.nodeValue.length||(this.setStartBefore(a).collapse(!0),domUtils.remove(a))),this},extractContents:function(){return this.collapsed?null:d(this,2)},setStart:function(a,b){return c(!0,a,b,this)},setEnd:function(a,b){return c(!1,a,b,this)},setStartAfter:function(a){return this.setStart(a.parentNode,domUtils.getNodeIndex(a)+1)},setStartBefore:function(a){return this.setStart(a.parentNode,domUtils.getNodeIndex(a))},setEndAfter:function(a){return this.setEnd(a.parentNode,domUtils.getNodeIndex(a)+1)},setEndBefore:function(a){return this.setEnd(a.parentNode,domUtils.getNodeIndex(a))},setStartAtFirst:function(a){return this.setStart(a,0)},setStartAtLast:function(a){return this.setStart(a,3==a.nodeType?a.nodeValue.length:a.childNodes.length)},setEndAtFirst:function(a){return this.setEnd(a,0)},setEndAtLast:function(a){return this.setEnd(a,3==a.nodeType?a.nodeValue.length:a.childNodes.length)},selectNode:function(a){return this.setStartBefore(a).setEndAfter(a)},selectNodeContents:function(a){return this.setStart(a,0).setEndAtLast(a)},cloneRange:function(){var a=this;return new j(a.document).setStart(a.startContainer,a.startOffset).setEnd(a.endContainer,a.endOffset)},collapse:function(a){var b=this;return a?(b.endContainer=b.startContainer,b.endOffset=b.startOffset):(b.startContainer=b.endContainer,b.startOffset=b.endOffset),b.collapsed=!0,b},shrinkBoundary:function(a){function b(a){return 1==a.nodeType&&!domUtils.isBookmarkNode(a)&&!dtd.$empty[a.tagName]&&!dtd.$nonChild[a.tagName]}for(var c,d=this,e=d.collapsed;1==d.startContainer.nodeType&&(c=d.startContainer.childNodes[d.startOffset])&&b(c);)d.setStart(c,0);if(e)return d.collapse(!0);if(!a)for(;1==d.endContainer.nodeType&&d.endOffset>0&&(c=d.endContainer.childNodes[d.endOffset-1])&&b(c);)d.setEnd(c,c.childNodes.length);return d},getCommonAncestor:function(a,c){var d=this,e=d.startContainer,f=d.endContainer;return e===f?a&&b(this)&&(e=e.childNodes[d.startOffset],1==e.nodeType)?e:c&&3==e.nodeType?e.parentNode:e:domUtils.getCommonAncestor(e,f)},trimBoundary:function(a){this.txtToElmBoundary();var b=this.startContainer,c=this.startOffset,d=this.collapsed,e=this.endContainer;if(3==b.nodeType){if(0==c)this.setStartBefore(b);else if(c>=b.nodeValue.length)this.setStartAfter(b);else{var f=domUtils.split(b,c);b===e?this.setEnd(f,this.endOffset-c):b.parentNode===e&&(this.endOffset+=1),this.setStartBefore(f)}if(d)return this.collapse(!0)}return a||(c=this.endOffset,e=this.endContainer,3==e.nodeType&&(0==c?this.setEndBefore(e):(c=c.nodeValue.length&&a["set"+b.replace(/(\w)/,function(a){return a.toUpperCase()})+"After"](c):a["set"+b.replace(/(\w)/,function(a){return a.toUpperCase()})+"Before"](c))}return!a&&this.collapsed||(b(this,"start"),b(this,"end")),this},insertNode:function(a){var b=a,c=1;11==a.nodeType&&(b=a.firstChild,c=a.childNodes.length),this.trimBoundary(!0);var d=this.startContainer,e=this.startOffset,f=d.childNodes[e];return f?d.insertBefore(a,f):d.appendChild(a),b.parentNode===this.endContainer&&(this.endOffset=this.endOffset+c),this.setStartBefore(b)},setCursor:function(a,b){return this.collapse(!a).select(b)},createBookmark:function(a,b){var c,d=this.document.createElement("span");return d.style.cssText="display:none;line-height:0px;",d.appendChild(this.document.createTextNode("‍")),d.id="_baidu_bookmark_start_"+(b?"":h++),this.collapsed||(c=d.cloneNode(!0),c.id="_baidu_bookmark_end_"+(b?"":h++)),this.insertNode(d),c&&this.collapse().insertNode(c).setEndBefore(c),this.setStartAfter(d),{start:a?d.id:d,end:c?a?c.id:c:null,id:a}},moveToBookmark:function(a){var b=a.id?this.document.getElementById(a.start):a.start,c=a.end&&a.id?this.document.getElementById(a.end):a.end;return this.setStartBefore(b),domUtils.remove(b),c?(this.setEndBefore(c),domUtils.remove(c)):this.collapse(!0),this},enlarge:function(a,b){var c,d,e=domUtils.isBody,f=this.document.createTextNode("");if(a){for(d=this.startContainer,1==d.nodeType?d.childNodes[this.startOffset]?c=d=d.childNodes[this.startOffset]:(d.appendChild(f),c=d=f):c=d;;){if(domUtils.isBlockElm(d)){for(d=c;(c=d.previousSibling)&&!domUtils.isBlockElm(c);)d=c;this.setStartBefore(d);break}c=d,d=d.parentNode}for(d=this.endContainer,1==d.nodeType?((c=d.childNodes[this.endOffset])?d.insertBefore(f,c):d.appendChild(f),c=d=f):c=d;;){if(domUtils.isBlockElm(d)){for(d=c;(c=d.nextSibling)&&!domUtils.isBlockElm(c);)d=c;this.setEndAfter(d);break}c=d,d=d.parentNode}f.parentNode===this.endContainer&&this.endOffset--,domUtils.remove(f)}if(!this.collapsed){for(;!(0!=this.startOffset||b&&b(this.startContainer)||e(this.startContainer));)this.setStartBefore(this.startContainer);for(;!(this.endOffset!=(1==this.endContainer.nodeType?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)||b&&b(this.endContainer)||e(this.endContainer));)this.setEndAfter(this.endContainer)}return this},enlargeToBlockElm:function(a){for(;!domUtils.isBlockElm(this.startContainer);)this.setStartBefore(this.startContainer);if(!a)for(;!domUtils.isBlockElm(this.endContainer);)this.setEndAfter(this.endContainer);return this},adjustmentBoundary:function(){if(!this.collapsed){for(;!domUtils.isBody(this.startContainer)&&this.startOffset==this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length&&this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length;)this.setStartAfter(this.startContainer);for(;!domUtils.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length;)this.setEndBefore(this.endContainer)}return this},applyInlineStyle:function(a,b,c){if(this.collapsed)return this;this.trimBoundary().enlarge(!1,function(a){return 1==a.nodeType&&domUtils.isBlockElm(a)}).adjustmentBoundary();for(var d,e,f=this.createBookmark(),g=f.end,h=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!domUtils.isWhitespace(a)},i=domUtils.getNextDomNode(f.start,!1,h),j=this.cloneRange();i&&domUtils.getPosition(i,g)&domUtils.POSITION_PRECEDING;)if(3==i.nodeType||dtd[a][i.tagName]){for(j.setStartBefore(i),d=i;d&&(3==d.nodeType||dtd[a][d.tagName])&&d!==g;)e=d,d=domUtils.getNextDomNode(d,1==d.nodeType,null,function(b){return dtd[a][b.tagName]});var k,l=j.setEndAfter(e).extractContents();if(c&&c.length>0){var m,n;n=m=c[0].cloneNode(!1);for(var o,p=1;o=c[p++];)m.appendChild(o.cloneNode(!1)),m=m.firstChild;k=m}else k=j.document.createElement(a);b&&domUtils.setAttributes(k,b),k.appendChild(l),"SPAN"==k.tagName&&b&&b.style&&utils.each(k.getElementsByTagName("span"),function(a){a.style.cssText=a.style.cssText+";"+b.style}),j.insertNode(c?n:k);var q;if("span"==a&&b.style&&/text\-decoration/.test(b.style)&&(q=domUtils.findParentByTagName(k,"a",!0))?(domUtils.setAttributes(q,b),domUtils.remove(k,!0),k=q):(domUtils.mergeSibling(k),domUtils.clearEmptySibling(k)),domUtils.mergeChild(k,b),i=domUtils.getNextDomNode(k,!1,h),domUtils.mergeToParent(k),d===g)break}else i=domUtils.getNextDomNode(i,!0,h);return this.moveToBookmark(f)},removeInlineStyle:function(a){if(this.collapsed)return this;a=utils.isArray(a)?a:[a],this.shrinkBoundary().adjustmentBoundary();for(var b=this.startContainer,c=this.endContainer;;){if(1==b.nodeType){if(utils.indexOf(a,b.tagName.toLowerCase())>-1)break;if("body"==b.tagName.toLowerCase()){b=null;break}}b=b.parentNode}for(;;){if(1==c.nodeType){if(utils.indexOf(a,c.tagName.toLowerCase())>-1)break;if("body"==c.tagName.toLowerCase()){c=null;break}}c=c.parentNode}var d,e,f=this.createBookmark();b&&(e=this.cloneRange().setEndBefore(f.start).setStartBefore(b),d=e.extractContents(),e.insertNode(d),domUtils.clearEmptySibling(b,!0),b.parentNode.insertBefore(f.start,b)),c&&(e=this.cloneRange().setStartAfter(f.end).setEndAfter(c),d=e.extractContents(),e.insertNode(d),domUtils.clearEmptySibling(c,!1,!0),c.parentNode.insertBefore(f.end,c.nextSibling));for(var g,h=domUtils.getNextDomNode(f.start,!1,function(a){return 1==a.nodeType});h&&h!==f.end;)g=domUtils.getNextDomNode(h,!0,function(a){return 1==a.nodeType}),utils.indexOf(a,h.tagName.toLowerCase())>-1&&domUtils.remove(h,!0),h=g;return this.moveToBookmark(f)},getClosedNode:function(){var a;if(!this.collapsed){var c=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(b(c)){var d=c.startContainer.childNodes[c.startOffset];d&&1==d.nodeType&&(dtd.$empty[d.tagName]||dtd.$nonChild[d.tagName])&&(a=d)}}return a},select:browser.ie?function(a,b){var c;this.collapsed||this.shrinkBoundary();var d=this.getClosedNode();if(d&&!b){try{c=this.document.body.createControlRange(),c.addElement(d),c.select()}catch(h){}return this}var j,k=this.createBookmark(),l=k.start;if(c=this.document.body.createTextRange(),c.moveToElementText(l),c.moveStart("character",1),this.collapsed){if(!a&&3!=this.startContainer.nodeType){var m=this.document.createTextNode(i),n=this.document.createElement("span");n.appendChild(this.document.createTextNode(i)),l.parentNode.insertBefore(n,l),l.parentNode.insertBefore(m,l),e(this.document,m),g=m,f(n,"previousSibling"),f(l,"nextSibling"),c.moveStart("character",-1),c.collapse(!0)}}else{var o=this.document.body.createTextRange();j=k.end,o.moveToElementText(j),c.setEndPoint("EndToEnd",o)}this.moveToBookmark(k),n&&domUtils.remove(n);try{c.select()}catch(h){}return this}:function(a){function b(a){function b(b,c,d){3==b.nodeType&&b.nodeValue.length0)j=k-1;else{if(!(l<0))return{container:d,offset:c(e)};i=k+1}}if(k==-1){if(h.moveToElementText(d),h.setEndPoint("StartToStart",a),f=h.text.replace(/(\r\n|\r)/g,"\n").length,g=d.childNodes,!f)return e=g[g.length-1],{container:e,offset:e.nodeValue.length};for(var m=g.length;f>0;)f-=g[--m].nodeValue.length;return{container:g[m],offset:-f}}if(h.collapse(l>0),h.setEndPoint(l>0?"StartToStart":"EndToStart",a),f=h.text.replace(/(\r\n|\r)/g,"\n").length,!f)return dtd.$empty[e.tagName]||dtd.$nonChild[e.tagName]?{container:d,offset:c(e)+(l>0?0:1)}:{container:e,offset:l>0?0:e.childNodes.length};for(;f>0;)try{var n=e;e=e[l>0?"previousSibling":"nextSibling"],f-=e.nodeValue.length}catch(o){return{container:d,offset:c(n)}}return{container:e,offset:l>0?-f:e.nodeValue.length+f}}function b(b,c){if(b.item)c.selectNode(b.item(0));else{var d=a(b,!0);c.setStart(d.container,d.offset),0!=b.compareEndPoints("StartToEnd",b)&&(d=a(b,!1),c.setEnd(d.container,d.offset))}return c}function c(a){var b;try{b=a.getNative().createRange()}catch(c){return null}var d=b.item?b.item(0):b.parentElement();return(d.ownerDocument||d)===a.document?b:null}var d=dom.Selection=function(a){var b,d=this;d.document=a,browser.ie9below&&(b=domUtils.getWindow(a).frameElement,domUtils.on(b,"beforedeactivate",function(){d._bakIERange=d.getIERange()}),domUtils.on(b,"activate",function(){try{!c(d)&&d._bakIERange&&d._bakIERange.select()}catch(a){}d._bakIERange=null})),b=a=null};d.prototype={rangeInBody:function(a,b){var c=browser.ie9below||b?a.item?a.item():a.parentElement():a.startContainer;return c===this.document.body||domUtils.inDoc(c,this.document)},getNative:function(){var a=this.document;try{return a?browser.ie9below?a.selection:domUtils.getWindow(a).getSelection():null}catch(b){return null}},getIERange:function(){var a=c(this);return!a&&this._bakIERange?this._bakIERange:a},cache:function(){this.clear(),this._cachedRange=this.getRange(),this._cachedStartElement=this.getStart(),this._cachedStartElementPath=this.getStartElementPath()},getStartElementPath:function(){if(this._cachedStartElementPath)return this._cachedStartElementPath;var a=this.getStart();return a?domUtils.findParents(a,!0,null,!0):[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{if(browser.ie9below){var a=c(this);return!(!a||!this.rangeInBody(a))}return!!this.getNative().rangeCount}catch(b){return!1}},getRange:function(){function a(a){for(var b=c.document.body.firstChild,d=a.collapsed;b&&b.firstChild;)a.setStart(b,0),b=b.firstChild;a.startContainer||a.setStart(c.document.body,0),d&&a.collapse(!0)}var c=this;if(null!=c._cachedRange)return this._cachedRange;var d=new baidu.editor.dom.Range(c.document);if(browser.ie9below){var e=c.getIERange();if(e)try{b(e,d)}catch(f){a(d)}else a(d)}else{var g=c.getNative();if(g&&g.rangeCount){var h=g.getRangeAt(0),i=g.getRangeAt(g.rangeCount-1);d.setStart(h.startContainer,h.startOffset).setEnd(i.endContainer,i.endOffset),d.collapsed&&domUtils.isBody(d.startContainer)&&!d.startOffset&&a(d)}else{if(this._bakRange&&domUtils.inDoc(this._bakRange.startContainer,this.document))return this._bakRange;a(d)}}return this._bakRange=d},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement;var a,b,c,d,e=browser.ie9below?this.getIERange():this.getRange();if(browser.ie9below){if(!e)return this.document.body.firstChild;if(e.item)return e.item(0);for(a=e.duplicate(),a.text.length>0&&a.moveStart("character",1),a.collapse(1),b=a.parentElement(),d=c=e.parentElement();c=c.parentNode;)if(c==b){b=d;break}}else if(e.shrinkBoundary(),b=e.startContainer,1==b.nodeType&&b.hasChildNodes()&&(b=b.childNodes[Math.min(b.childNodes.length-1,e.startOffset)]),3==b.nodeType)return b.parentNode;return b},getText:function(){var a,b;return this.isFocus()&&(a=this.getNative())?(b=browser.ie9below?a.createRange():a.getRangeAt(0),browser.ie9below?b.text:b.toString()):""},clearRange:function(){this.getNative()[browser.ie9below?"empty":"removeAllRanges"]()}}}(),function(){function a(a,b){var c;if(b.options.textarea)if(utils.isString(b.options.textarea)){for(var d,e=0,f=domUtils.getElementsByTagName(a,"textarea");d=f[e++];)if(d.id=="ueditor_textarea_"+b.options.textarea){c=d;break}}else c=b.textarea;c||(a.appendChild(c=domUtils.createElement(document,"textarea",{name:b.options.textarea,id:"ueditor_textarea_"+b.options.textarea,style:"display:none"})),b.textarea=c),!c.getAttribute("name")&&c.setAttribute("name",b.options.textarea),c.value=b.hasContents()?b.options.allHtmlEnabled?b.getAllHtml():b.getContent(null,null,!0):""}function b(a){for(var b in a)return b}function c(a){a.langIsReady=!0,a.fireEvent("langReady")}var d,e=0,f=UE.Editor=function(a){var d=this;d.uid=e++,EventBase.call(d),d.commands={},d.options=utils.extend(utils.clone(a||{}),UEDITOR_CONFIG,!0),d.shortcutkeys={},d.inputRules=[],d.outputRules=[],d.setOpt(f.defaultOptions(d)),utils.isEmptyObject(UE.I18N)?utils.loadFile(document,{src:d.options.langPath+d.options.lang+"/"+d.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){UE.plugin.load(d),c(d)}):(d.options.lang=b(UE.I18N),UE.plugin.load(d),c(d)),UE.instants["ueditorInstant"+d.uid]=d};f.prototype={registerCommand:function(a,b){this.commands[a]=b},ready:function(a){var b=this;a&&(b.isReady?a.apply(b):b.addListener("ready",a))},setPlaceholder:function(){function a(){var a=this.getPlainTxt();a.trim()?UE.dom.domUtils.removeClasses(this.body,"empty"):UE.dom.domUtils.addClass(this.body,"empty")}return function(b){var c=this;c.ready(function(){a.call(c),c.body.setAttribute("placeholder",b)}),c.removeListener("keyup contentchange",a),c.addListener("keyup contentchange",a)}}(),setOpt:function(a,b){var c={};utils.isString(a)?c[a]=b:c=a,utils.extend(this.options,c,!0)},getOpt:function(a){return this.options[a]},destroy:function(){var a=this;a.fireEvent("destroy");var b=a.container.parentNode,c=a.textarea;c?c.style.display="":(c=document.createElement("textarea"),b.parentNode.insertBefore(c,b)),c.style.width=a.iframe.offsetWidth+"px",c.style.height=a.iframe.offsetHeight+"px",c.value=a.getContent(),c.id=a.key,b.innerHTML="",domUtils.remove(b);var d=a.key;for(var e in a)a.hasOwnProperty(e)&&delete this[e];UE.delEditor(d)},render:function(a){var b=this,c=b.options,d=function(b){return parseInt(domUtils.getComputedStyle(a,b))};if(utils.isString(a)&&(a=document.getElementById(a)),a){c.initialFrameWidth?c.minFrameWidth=c.initialFrameWidth:c.minFrameWidth=c.initialFrameWidth=a.offsetWidth,c.initialFrameHeight?c.minFrameHeight=c.initialFrameHeight:c.initialFrameHeight=c.minFrameHeight=a.offsetHeight,a.style.width=/%$/.test(c.initialFrameWidth)?"100%":c.initialFrameWidth-d("padding-left")-d("padding-right")+"px",a.style.height=/%$/.test(c.initialFrameHeight)?"100%":c.initialFrameHeight-d("padding-top")-d("padding-bottom")+"px",a.style.zIndex=c.zIndex;var e=(ie&&browser.version<9?"":"")+""+(c.iframeCssUrl?"":"")+(c.initialStyle?"":"")+""+(c.iframeJsUrl?"":"")+"";a.appendChild(domUtils.createElement(document,"iframe",{id:"ueditor_"+b.uid,width:"100%",height:"100%",frameborder:"0",src:"javascript:void(function(){document.open();"+(c.customDomain&&document.domain!=location.hostname?'document.domain="'+document.domain+'";':"")+'document.write("'+e+'");document.close();}())'})),a.style.overflow="hidden",setTimeout(function(){/%$/.test(c.initialFrameWidth)&&(c.minFrameWidth=c.initialFrameWidth=a.offsetWidth),/%$/.test(c.initialFrameHeight)&&(c.minFrameHeight=c.initialFrameHeight=a.offsetHeight,a.style.height=c.initialFrameHeight+"px")})}},_setup:function(b){var c=this,d=c.options;ie?(b.body.disabled=!0,b.body.contentEditable=!0,b.body.disabled=!1):b.body.contentEditable=!0,b.body.spellcheck=!1,c.document=b,c.window=b.defaultView||b.parentWindow,c.iframe=c.window.frameElement,c.body=b.body,c.selection=new dom.Selection(b);var e;browser.gecko&&(e=this.selection.getNative())&&e.removeAllRanges(),this._initEvents();for(var f=this.iframe.parentNode;!domUtils.isBody(f);f=f.parentNode)if("FORM"==f.tagName){c.form=f,c.options.autoSyncData?domUtils.on(c.window,"blur",function(){a(f,c)}):domUtils.on(f,"submit",function(){a(this,c)});break}if(d.initialContent)if(d.autoClearinitialContent){var g=c.execCommand;c.execCommand=function(){return c.fireEvent("firstBeforeExecCommand"),g.apply(c,arguments)},this._setDefaultContent(d.initialContent)}else this.setContent(d.initialContent,!1,!0);domUtils.isEmptyNode(c.body)&&(c.body.innerHTML="

                      "+(browser.ie?"":"
                      ")+"

                      "),d.focus&&setTimeout(function(){c.focus(c.options.focusInEnd),!c.options.autoClearinitialContent&&c._selectionChange()},0),c.container||(c.container=this.iframe.parentNode),d.fullscreen&&c.ui&&c.ui.setFullScreen(!0);try{c.document.execCommand("2D-position",!1,!1)}catch(h){}try{c.document.execCommand("enableInlineTableEditing",!1,!1)}catch(h){}try{c.document.execCommand("enableObjectResizing",!1,!1)}catch(h){}c._bindshortcutKeys(),c.isReady=1,c.fireEvent("ready"),d.onready&&d.onready.call(c),browser.ie9below||domUtils.on(c.window,["blur","focus"],function(a){if("blur"==a.type){c._bakRange=c.selection.getRange();try{c._bakNativeRange=c.selection.getNative().getRangeAt(0),c.selection.getNative().removeAllRanges()}catch(a){c._bakNativeRange=null}}else try{c._bakRange&&c._bakRange.select()}catch(a){}}),browser.gecko&&browser.version<=10902&&(c.body.contentEditable=!1,setTimeout(function(){c.body.contentEditable=!0},100),setInterval(function(){c.body.style.height=c.iframe.offsetHeight-20+"px"},100)),!d.isShow&&c.setHide(),d.readonly&&c.setDisabled()},sync:function(b){var c=this,d=b?document.getElementById(b):domUtils.findParent(c.iframe.parentNode,function(a){return"FORM"==a.tagName},!0);d&&a(d,c)},setHeight:function(a,b){a!==parseInt(this.iframe.parentNode.style.height)&&(this.iframe.parentNode.style.height=a+"px"),!b&&(this.options.minFrameHeight=this.options.initialFrameHeight=a),this.body.style.height=a+"px",!b&&this.trigger("setHeight")},addshortcutkey:function(a,b){var c={};b?c[a]=b:c=a,utils.extend(this.shortcutkeys,c)},_bindshortcutKeys:function(){var a=this,b=this.shortcutkeys;a.addListener("keydown",function(c,d){var e=d.keyCode||d.which;for(var f in b)for(var g,h=b[f].split(","),i=0;g=h[i++];){g=g.split(":");var j=g[0],k=g[1];(/^(ctrl)(\+shift)?\+(\d+)$/.test(j.toLowerCase())||/^(\d+)$/.test(j))&&(("ctrl"==RegExp.$1?d.ctrlKey||d.metaKey:0)&&(""!=RegExp.$2?d[RegExp.$2.slice(1)+"Key"]:1)&&e==RegExp.$3||e==RegExp.$1)&&(a.queryCommandState(f,k)!=-1&&a.execCommand(f,k),domUtils.preventDefault(d))}})},getContent:function(a,b,c,d,e){var f=this;if(a&&utils.isFunction(a)&&(b=a,a=""),b?!b():!this.hasContents())return"";f.fireEvent("beforegetcontent");var g=UE.htmlparser(f.body.innerHTML,d);return f.filterOutputRule(g),f.fireEvent("aftergetcontent",a,g),g.toHtml(e)},getAllHtml:function(){var a=this,b=[];if(a.fireEvent("getAllHtml",b),browser.ie&&browser.version>8){var c="";utils.each(a.document.styleSheets,function(a){c+=a.href?'':""}),utils.each(a.document.getElementsByTagName("script"),function(a){c+=a.outerHTML})}return""+(a.options.charset?'':"")+(c||a.document.getElementsByTagName("head")[0].innerHTML)+b.join("\n")+""+a.getContent(null,null,!0)+""},getPlainTxt:function(){var a=new RegExp(domUtils.fillChar,"g"),b=this.body.innerHTML.replace(/[\n\r]/g,"");return b=b.replace(/<(p|div)[^>]*>(| )<\/\1>/gi,"\n").replace(//gi,"\n").replace(/<[^>\/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,function(a,b,c){return dtd.$block[c]?"\n":b?b:""}),b.replace(a,"").replace(/\u00a0/g," ").replace(/ /g," ")},getContentTxt:function(){var a=new RegExp(domUtils.fillChar,"g");return this.body[browser.ie?"innerText":"textContent"].replace(a,"").replace(/\u00a0/g," ")},setContent:function(b,c,d){function e(a){return"DIV"==a.tagName&&a.getAttribute("cdata_tag")}var f=this;f.fireEvent("beforesetcontent",b);var g=UE.htmlparser(b);if(f.filterInputRule(g),b=g.toHtml(),f.body.innerHTML=(c?f.body.innerHTML:"")+b,"p"==f.options.enterTag){var h,i=this.body.firstChild;if(!i||1==i.nodeType&&(dtd.$cdata[i.tagName]||e(i)||domUtils.isCustomeNode(i))&&i===this.body.lastChild)this.body.innerHTML="

                      "+(browser.ie?" ":"
                      ")+"

                      "+this.body.innerHTML;else for(var j=f.document.createElement("p");i;){for(;i&&(3==i.nodeType||1==i.nodeType&&dtd.p[i.tagName]&&!dtd.$cdata[i.tagName]);)h=i.nextSibling,j.appendChild(i),i=h;if(j.firstChild){if(!i){f.body.appendChild(j);break}i.parentNode.insertBefore(j,i),j=f.document.createElement("p")}i=i.nextSibling}}f.fireEvent("aftersetcontent"),f.fireEvent("contentchange"),!d&&f._selectionChange(),f._bakRange=f._bakIERange=f._bakNativeRange=null;var k;browser.gecko&&(k=this.selection.getNative())&&k.removeAllRanges(),f.options.autoSyncData&&f.form&&a(f.form,f)},focus:function(a){try{var b=this,c=b.selection.getRange();if(a){var d=b.body.lastChild;d&&1==d.nodeType&&!dtd.$empty[d.tagName]&&(domUtils.isEmptyBlock(d)?c.setStartAtFirst(d):c.setStartAtLast(d),c.collapse(!0)),c.setCursor(!0)}else{if(!c.collapsed&&domUtils.isBody(c.startContainer)&&0==c.startOffset){var d=b.body.firstChild;d&&1==d.nodeType&&!dtd.$empty[d.tagName]&&c.setStartAtFirst(d).collapse(!0)}c.select(!0)}this.fireEvent("focus selectionchange")}catch(e){}},isFocus:function(){return this.selection.isFocus()},blur:function(){var a=this.selection.getNative();if(a.empty&&browser.ie){var b=document.body.createTextRange();b.moveToElementText(document.body),b.collapse(!0),b.select(),a.empty()}else a.removeAllRanges()},_initEvents:function(){var a=this,b=a.document,c=a.window;a._proxyDomEvent=utils.bind(a._proxyDomEvent,a),domUtils.on(b,["click","contextmenu","mousedown","keydown","keyup","keypress","mouseup","mouseover","mouseout","selectstart"],a._proxyDomEvent),domUtils.on(c,["focus","blur"],a._proxyDomEvent),domUtils.on(a.body,"drop",function(b){browser.gecko&&b.stopPropagation&&b.stopPropagation(),a.fireEvent("contentchange")}),domUtils.on(b,["mouseup","keydown"],function(b){"keydown"==b.type&&(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)||2!=b.button&&a._selectionChange(250,b)})},_proxyDomEvent:function(a){return this.fireEvent("before"+a.type.replace(/^on/,"").toLowerCase())!==!1&&(this.fireEvent(a.type.replace(/^on/,""),a)!==!1&&this.fireEvent("after"+a.type.replace(/^on/,"").toLowerCase()))},_selectionChange:function(a,b){var c,e,f=this,g=!1;if(browser.ie&&browser.version<9&&b&&"mouseup"==b.type){var h=this.selection.getRange();h.collapsed||(g=!0,c=b.clientX,e=b.clientY)}clearTimeout(d),d=setTimeout(function(){if(f.selection&&f.selection.getNative()){var a;if(g&&"None"==f.selection.getNative().type){a=f.document.body.createTextRange();try{a.moveToPoint(c,e)}catch(d){a=null}}var h;a&&(h=f.selection.getIERange,f.selection.getIERange=function(){return a}),f.selection.cache(),h&&(f.selection.getIERange=h),f.selection._cachedRange&&f.selection._cachedStartElement&&(f.fireEvent("beforeselectionchange"),f.fireEvent("selectionchange",!!b),f.fireEvent("afterselectionchange"),f.selection.clear())}},a||50)},_callCmdFn:function(a,b){var c,d,e=b[0].toLowerCase();return c=this.commands[e]||UE.commands[e],d=c&&c[a],c&&d||"queryCommandState"!=a?d?d.apply(this,b):void 0:0},execCommand:function(a){a=a.toLowerCase();var b,c=this,d=c.commands[a]||UE.commands[a];return d&&d.execCommand?(d.notNeedUndo||c.__hasEnterExecCommand?(b=this._callCmdFn("execCommand",arguments),!c.__hasEnterExecCommand&&!d.ignoreContentChange&&!c._ignoreContentChange&&c.fireEvent("contentchange")):(c.__hasEnterExecCommand=!0,c.queryCommandState.apply(c,arguments)!=-1&&(c.fireEvent("saveScene"),c.fireEvent.apply(c,["beforeexeccommand",a].concat(arguments)),b=this._callCmdFn("execCommand",arguments),c.fireEvent.apply(c,["afterexeccommand",a].concat(arguments)),c.fireEvent("saveScene")),c.__hasEnterExecCommand=!1),!c.__hasEnterExecCommand&&!d.ignoreContentChange&&!c._ignoreContentChange&&c._selectionChange(),b):null},queryCommandState:function(a){return this._callCmdFn("queryCommandState",arguments)},queryCommandValue:function(a){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(a){if(a)for(var b,c=0;b=a[c++];)if(this.document.getElementsByTagName(b).length>0)return!0;if(!domUtils.isEmptyBlock(this.body))return!0;for(a=["div"],c=0;b=a[c++];)for(var d,e=domUtils.getElementsByTagName(this.document,b),f=0;d=e[f++];)if(domUtils.isCustomeNode(d))return!0;return!1},reset:function(){this.fireEvent("reset")},setEnabled:function(){var a,b=this;if("false"==b.body.contentEditable){b.body.contentEditable=!0,a=b.selection.getRange();try{a.moveToBookmark(b.lastBk),delete b.lastBk}catch(c){a.setStartAtFirst(b.body).collapse(!0)}a.select(!0),b.bkqueryCommandState&&(b.queryCommandState=b.bkqueryCommandState,delete b.bkqueryCommandState),b.bkqueryCommandValue&&(b.queryCommandValue=b.bkqueryCommandValue,delete b.bkqueryCommandValue),b.fireEvent("selectionchange")}},enable:function(){return this.setEnabled()},setDisabled:function(a){var b=this;a=a?utils.isArray(a)?a:[a]:[],"true"==b.body.contentEditable&&(b.lastBk||(b.lastBk=b.selection.getRange().createBookmark(!0)),b.body.contentEditable=!1,b.bkqueryCommandState=b.queryCommandState,b.bkqueryCommandValue=b.queryCommandValue,b.queryCommandState=function(c){return utils.indexOf(a,c)!=-1?b.bkqueryCommandState.apply(b,arguments):-1},b.queryCommandValue=function(c){return utils.indexOf(a,c)!=-1?b.bkqueryCommandValue.apply(b,arguments):null},b.fireEvent("selectionchange"))},disable:function(a){return this.setDisabled(a)},_setDefaultContent:function(){ -function a(){var b=this;b.document.getElementById("initContent")&&(b.body.innerHTML="

                      "+(ie?"":"
                      ")+"

                      ",b.removeListener("firstBeforeExecCommand focus",a),setTimeout(function(){b.focus(),b._selectionChange()},0))}return function(b){var c=this;c.body.innerHTML='

                      '+b+"

                      ",c.addListener("firstBeforeExecCommand focus",a)}}(),setShow:function(){var a=this,b=a.selection.getRange();if("none"==a.container.style.display){try{b.moveToBookmark(a.lastBk),delete a.lastBk}catch(c){b.setStartAtFirst(a.body).collapse(!0)}setTimeout(function(){b.select(!0)},100),a.container.style.display=""}},show:function(){return this.setShow()},setHide:function(){var a=this;a.lastBk||(a.lastBk=a.selection.getRange().createBookmark(!0)),a.container.style.display="none"},hide:function(){return this.setHide()},getLang:function(a){var b=UE.I18N[this.options.lang];if(!b)throw Error("not import language file");a=(a||"").split(".");for(var c,d=0;(c=a[d++])&&(b=b[c],b););return b},getContentLength:function(a,b){var c=this.getContent(!1,!1,!0).length;if(a){b=(b||[]).concat(["hr","img","iframe"]),c=this.getContentTxt().replace(/[\t\r\n]+/g,"").length;for(var d,e=0;d=b[e++];)c+=this.document.getElementsByTagName(d).length}return c},addInputRule:function(a){this.inputRules.push(a)},filterInputRule:function(a){for(var b,c=0;b=this.inputRules[c++];)b.call(this,a)},addOutputRule:function(a){this.outputRules.push(a)},filterOutputRule:function(a){for(var b,c=0;b=this.outputRules[c++];)b.call(this,a)},getActionUrl:function(a){var b=(this.getOpt(a)||a,this.getOpt("imageUrl"),this.getOpt("serverUrl"));return b?(b+="?",utils.formatUrl(b)):""}},utils.inherits(f,EventBase)}(),UE.Editor.defaultOptions=function(a){var b=a.options.UEDITOR_HOME_URL;return{isShow:!0,initialContent:"",initialStyle:"",autoClearinitialContent:!1,iframeCssUrl:b+"themes/iframe.css",textarea:"editorValue",focus:!1,focusInEnd:!0,autoClearEmptyNode:!0,fullscreen:!1,readonly:!1,zIndex:999,imagePopup:!0,enterTag:"p",customDomain:!1,lang:"zh-cn",langPath:b+"i18n/",theme:"default",themePath:b+"themes/",allHtmlEnabled:!1,scaleEnabled:!1,tableNativeEditInFF:!1,autoSyncData:!0,fileNameFormat:"{time}{rand:6}"}},function(){UE.Editor.prototype.loadServerConfig=function(){function showErrorMsg(a){console&&console.error(a)}var me=this;setTimeout(function(){try{me.options.imageUrl&&me.setOpt("serverUrl",me.options.imageUrl.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2"));var configUrl=me.getActionUrl("config"),isJsonp=utils.isCrossDomainUrl(configUrl);me._serverConfigLoaded=!1,configUrl&&UE.ajax.request(configUrl,{method:"GET",dataType:isJsonp?"jsonp":"",onsuccess:function(r){try{var config=isJsonp?r:eval("("+r.responseText+")");utils.extend(me.options,config),me.fireEvent("serverConfigLoaded"),me._serverConfigLoaded=!0}catch(e){showErrorMsg(me.getLang("loadconfigFormatError"))}},onerror:function(){showErrorMsg(me.getLang("loadconfigHttpError"))}})}catch(e){showErrorMsg(me.getLang("loadconfigError"))}})},UE.Editor.prototype.isServerConfigLoaded=function(){var a=this;return a._serverConfigLoaded||!1},UE.Editor.prototype.afterConfigReady=function(a){if(a&&utils.isFunction(a)){var b=this,c=function(){a.apply(b,arguments),b.removeListener("serverConfigLoaded",c)};b.isServerConfigLoaded()?a.call(b,"serverConfigLoaded"):b.addListener("serverConfigLoaded",c)}}}(),UE.ajax=function(){function a(a){var b=[];for(var c in a)if("method"!=c&&"timeout"!=c&&"async"!=c&&"dataType"!=c&&"callback"!=c&&void 0!=a[c]&&null!=a[c])if("function"!=(typeof a[c]).toLowerCase()&&"object"!=(typeof a[c]).toLowerCase())b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));else if(utils.isArray(a[c]))for(var d=0;d/gi,"").replace(/]*>[\s\S]*?.<\/v:shape>/gi,function(a){if(browser.opera)return"";try{if(/Bitmap/i.test(a))return"";var c=a.match(/width:([ \d.]*p[tx])/i)[1],d=a.match(/height:([ \d.]*p[tx])/i)[1],e=a.match(/src=\s*"([^"]*)"/i)[1];return''}catch(f){return""}}).replace(/<\/?div[^>]*>/g,"").replace(/v:\w+=(["']?)[^'"]+\1/g,"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/

                      ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

                      $1

                      ").replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/gi,function(a,b,c,d){return"class"==b&&"MsoListParagraph"==d?a:""}).replace(/<(font|span)[^>]*>(\s*)<\/\1>/gi,function(a,b,c){return c.replace(/[\t\r\n ]+/g," ")}).replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,function(a,c,d,e){for(var f,g=[],h=e.replace(/^\s+|\s+$/,"").replace(/'/g,"'").replace(/"/gi,"'").replace(/[\d.]+(cm|pt)/g,function(a){return utils.transUnitToPx(a)}).split(/;\s*/g),i=0;f=h[i];i++){var j,k,l=f.split(":");if(2==l.length){if(j=l[0].toLowerCase(),k=l[1].toLowerCase(),/^(background)\w*/.test(j)&&0==k.replace(/(initial|\s)/g,"").length||/^(margin)\w*/.test(j)&&/^0\w+$/.test(k))continue;switch(j){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":/1&&(a(h,j,!0),b(h,j)),c(k,h,i,j);break;case"text":d(g,h);break;case"element":e(g,h,i,j);break;case"comment":f(g,h,i)}return h}function d(a,b){"pre"==a.parentNode.tagName?b.push(a.data):b.push(l[a.parentNode.tagName]?utils.html(a.data):a.data.replace(/[ ]{2}/g,"  "))}function e(d,e,f,g){var h="";if(d.attrs){h=[];var i=d.attrs;for(var j in i)h.push(j+(void 0!==i[j]?'="'+(k[j]?utils.html(i[j]).replace(/["]/g,function(a){return"""}):utils.unhtml(i[j]))+'"':""));h=h.join(" ")}if(e.push("<"+d.tagName+(h?" "+h:"")+(dtd.$empty[d.tagName]?"/":"")+">"),f&&!dtd.$inlineWithA[d.tagName]&&"pre"!=d.tagName&&d.children&&d.children.length&&(g=a(e,g,!0),b(e,g)),d.children&&d.children.length)for(var l,m=0;l=d.children[m++];)f&&"element"==l.type&&!dtd.$inlineWithA[l.tagName]&&m>1&&(a(e,g),b(e,g)),c(l,e,f,g);dtd.$empty[d.tagName]||(f&&!dtd.$inlineWithA[d.tagName]&&"pre"!=d.tagName&&d.children&&d.children.length&&(g=a(e,g),b(e,g)),e.push(""))}function f(a,b){b.push("")}function g(a,b){var c;if("element"==a.type&&a.getAttr("id")==b)return a;if(a.children&&a.children.length)for(var d,e=0;d=a.children[e++];)if(c=g(d,b))return c}function h(a,b,c){if("element"==a.type&&a.tagName==b&&c.push(a),a.children&&a.children.length)for(var d,e=0;d=a.children[e++];)h(d,b,c)}function i(a,b){if(a.children&&a.children.length)for(var c,d=0;c=a.children[d];)i(c,b),c.parentNode&&(c.children&&c.children.length&&b(c),c.parentNode&&d++);else b(a)}var j=UE.uNode=function(a){this.type=a.type,this.data=a.data,this.tagName=a.tagName,this.parentNode=a.parentNode,this.attrs=a.attrs||{},this.children=a.children},k={href:1,src:1,_src:1,_href:1,cdata_data:1},l={style:1,script:1},m=" ",n="\n";j.createElement=function(a){return/[<>]/.test(a)?UE.htmlparser(a).children[0]:new j({type:"element",children:[],tagName:a})},j.createText=function(a,b){return new UE.uNode({type:"text",data:b?a:utils.unhtml(a||"")})},j.prototype={toHtml:function(a){var b=[];return c(this,b,a,0),b.join("")},innerHTML:function(a){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(utils.isString(a)){if(this.children)for(var b,c=0;b=this.children[c++];)b.parentNode=null;this.children=[];for(var b,d=UE.htmlparser(a),c=0;b=d.children[c++];)this.children.push(b),b.parentNode=this;return this}var d=new UE.uNode({type:"root",children:this.children});return d.toHtml()},innerText:function(a,b){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(a){if(this.children)for(var c,d=0;c=this.children[d++];)c.parentNode=null;return this.children=[],this.appendChild(j.createText(a,b)),this}return this.toHtml().replace(/<[^>]+>/g,"")},getData:function(){return"element"==this.type?"":this.data},firstChild:function(){return this.children?this.children[0]:null},lastChild:function(){return this.children?this.children[this.children.length-1]:null},previousSibling:function(){for(var a,b=this.parentNode,c=0;a=b.children[c];c++)if(a===this)return 0==c?null:b.children[c-1]},nextSibling:function(){for(var a,b=this.parentNode,c=0;a=b.children[c++];)if(a===this)return b.children[c]},replaceChild:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c,d=0;c=this.children[d];d++)if(c===b)return this.children.splice(d,1,a),b.parentNode=null,a.parentNode=this,a}},appendChild:function(a){if("root"==this.type||"element"==this.type&&!dtd.$empty[this.tagName]){this.children||(this.children=[]),a.parentNode&&a.parentNode.removeChild(a);for(var b,c=0;b=this.children[c];c++)if(b===a){this.children.splice(c,1);break}return this.children.push(a),a.parentNode=this,a}},insertBefore:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c,d=0;c=this.children[d];d++)if(c===b)return this.children.splice(d,0,a),a.parentNode=this,a}},insertAfter:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c,d=0;c=this.children[d];d++)if(c===b)return this.children.splice(d+1,0,a),a.parentNode=this,a}},removeChild:function(a,b){if(this.children)for(var c,d=0;c=this.children[d];d++)if(c===a){if(this.children.splice(d,1),c.parentNode=null,b&&c.children&&c.children.length)for(var e,f=0;e=c.children[f];f++)this.children.splice(d+f,0,e),e.parentNode=this;return c}},getAttr:function(a){return this.attrs&&this.attrs[a.toLowerCase()]},setAttr:function(a,b){if(!a)return void delete this.attrs;if(this.attrs||(this.attrs={}),utils.isObject(a))for(var c in a)a[c]?this.attrs[c.toLowerCase()]=a[c]:delete this.attrs[c];else b?this.attrs[a.toLowerCase()]=b:delete this.attrs[a]},getIndex:function(){for(var a,b=this.parentNode,c=0;a=b.children[c];c++)if(a===this)return c;return-1},getNodeById:function(a){var b;if(this.children&&this.children.length)for(var c,d=0;c=this.children[d++];)if(b=g(c,a))return b},getNodesByTagName:function(a){a=utils.trim(a).replace(/[ ]{2,}/g," ").split(" ");var b=[],c=this;return utils.each(a,function(a){if(c.children&&c.children.length)for(var d,e=0;d=c.children[e++];)h(d,a,b)}),b},getStyle:function(a){var b=this.getAttr("style");if(!b)return"";var c=new RegExp("(^|;)\\s*"+a+":([^;]+)","i"),d=b.match(c);return d&&d[0]?d[2]:""},setStyle:function(a,b){function c(a,b){var c=new RegExp("(^|;)\\s*"+a+":([^;]+;?)","gi");d=d.replace(c,"$1"),b&&(d=a+":"+utils.unhtml(b)+";"+d)}var d=this.getAttr("style");if(d||(d=""),utils.isObject(a))for(var e in a)c(e,a[e]);else c(a,b);this.setAttr("style",utils.trim(d))},traversal:function(a){return this.children&&this.children.length&&i(this,a),this}}}();var htmlparser=UE.htmlparser=function(a,b){function c(a,b){if(m[a.tagName]){var c=k.createElement(m[a.tagName]);a.appendChild(c),c.appendChild(k.createText(b)),a=c}else a.appendChild(k.createText(b))}function d(a,b,c){var e;if(e=l[b]){for(var f,h=a;"root"!=h.type;){if(utils.isArray(e)?utils.indexOf(e,h.tagName)!=-1:e==h.tagName){a=h,f=!0;break}h=h.parentNode}f||(a=d(a,utils.isArray(e)?e[0]:e))}var i=new k({parentNode:a,type:"element",tagName:b.toLowerCase(),children:dtd.$empty[b]?null:[]});if(c){for(var m,n={};m=g.exec(c);)n[m[1].toLowerCase()]=j[m[1].toLowerCase()]?m[2]||m[3]||m[4]:utils.unhtml(m[2]||m[3]||m[4]);i.attrs=n}return a.children.push(i),dtd.$empty[b]?a:i}function e(a,b){a.children.push(new k({type:"comment",data:b,parentNode:a}))}var f=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g,g=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,h={b:1,code:1,i:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,span:1,sub:1,img:1,sup:1,font:1,big:1,small:1,iframe:1,a:1,br:1,pre:1};a=a.replace(new RegExp(domUtils.fillChar,"g"),""),b||(a=a.replace(new RegExp("[\\r\\t\\n"+(b?"":" ")+"]*]*)>[\\r\\t\\n"+(b?"":" ")+"]*","g"),function(a,c){return c&&h[c.toLowerCase()]?a.replace(/(^[\n\r]+)|([\n\r]+$)/g,""):a.replace(new RegExp("^[\\r\\n"+(b?"":" ")+"]+"),"").replace(new RegExp("[\\r\\n"+(b?"":" ")+"]+$"),"")}));for(var i,j={href:1,src:1},k=UE.uNode,l={td:"tr",tr:["tbody","thead","tfoot"],tbody:"table",th:"tr",thead:"table",tfoot:"table",caption:"table",li:["ul","ol"],dt:"dl",dd:"dl",option:"select"},m={ol:"li",ul:"li"},n=0,o=0,p=new k({type:"root",children:[]}),q=p;i=f.exec(a);){n=i.index;try{if(n>o&&c(q,a.slice(o,n)),i[3])dtd.$cdata[q.tagName]?c(q,i[0]):q=d(q,i[3].toLowerCase(),i[4]);else if(i[1]){if("root"!=q.type)if(dtd.$cdata[q.tagName]&&!dtd.$cdata[i[1]])c(q,i[0]);else{for(var r=q;"element"==q.type&&q.tagName!=i[1].toLowerCase();)if(q=q.parentNode,"root"==q.type)throw q=r,"break";q=q.parentNode}}else i[2]&&e(q,i[2])}catch(s){}o=f.lastIndex}return o");break;case"div":if(b.getAttr("cdata_tag"))break;if(d=b.getAttr("class"),d&&/^line number\d+/.test(d))break;if(!e)break;for(var f,g=UE.uNode.createElement("p");f=b.firstChild();)"text"!=f.type&&UE.dom.dtd.$block[f.tagName]?g.firstChild()?(b.parentNode.insertBefore(g,b),g=UE.uNode.createElement("p")):b.parentNode.insertBefore(f,b):g.appendChild(f);g.firstChild()&&b.parentNode.insertBefore(g,b),b.parentNode.removeChild(b);break;case"dl":b.tagName="ul";break;case"dt":case"dd":b.tagName="li";break;case"li":var h=b.getAttr("class");h&&/list\-/.test(h)||b.setAttr();var i=b.getNodesByTagName("ol ul");UE.utils.each(i,function(a){b.parentNode.insertAfter(a,b)});break;case"td":case"th":case"caption":b.children&&b.children.length||b.appendChild(browser.ie11below?UE.uNode.createText(" "):UE.uNode.createElement("br"));break;case"table":a.options.disabledTableInTable&&c(b)&&(b.parentNode.insertBefore(UE.uNode.createText(b.innerText()),b),b.parentNode.removeChild(b))}}})}),a.addOutputRule(function(b){var c;b.traversal(function(b){if("element"==b.type){if(a.options.autoClearEmptyNode&&dtd.$inline[b.tagName]&&!dtd.$empty[b.tagName]&&(!b.attrs||utils.isEmptyObject(b.attrs)))return void(b.firstChild()?"span"!=b.tagName||b.attrs&&!utils.isEmptyObject(b.attrs)||b.parentNode.removeChild(b,!0):b.parentNode.removeChild(b));switch(b.tagName){case"div":(c=b.getAttr("cdata_tag"))&&(b.tagName=c,b.appendChild(UE.uNode.createText(b.getAttr("cdata_data"))),b.setAttr({cdata_tag:"",cdata_data:"",_ue_custom_node_:""}));break;case"a":(c=b.getAttr("_href"))&&b.setAttr({href:utils.html(c),_href:""});break;case"span":if(c=b.getAttr("id"),c&&/^_baidu_bookmark_/i.test(c)&&b.parentNode.removeChild(b),a.getOpt("rgb2Hex")){var d=b.getAttr("style");d&&b.setAttr("style",d.replace(/rgba?\(([\d,\s]+)\)/g,function(a,b){var c=b.split(",");if(c.length>3)return"";b="#";for(var d,e=0;d=c[e++];)d=parseInt(d.replace(/[^\d]/gi,""),10).toString(16),b+=1==d.length?"0"+d:d;return b.toUpperCase()}))}break;case"img":(c=b.getAttr("_src"))&&b.setAttr({src:b.getAttr("_src"),_src:""})}}})})},UE.commands.inserthtml={execCommand:function(a,b,c){var d,e,f=this;if(b&&f.fireEvent("beforeinserthtml",b)!==!0){if(d=f.selection.getRange(),e=d.document.createElement("div"),e.style.display="inline",!c){var g=UE.htmlparser(b);f.options.filterRules&&UE.filterNode(g,f.options.filterRules),f.filterInputRule(g),b=g.toHtml()}if(e.innerHTML=utils.trim(b),!d.collapsed){var h=d.startContainer;if(domUtils.isFillChar(h)&&d.setStartBefore(h),h=d.endContainer,domUtils.isFillChar(h)&&d.setEndAfter(h),d.txtToElmBoundary(),d.endContainer&&1==d.endContainer.nodeType&&(h=d.endContainer.childNodes[d.endOffset],h&&domUtils.isBr(h)&&d.setEndAfter(h)),0==d.startOffset&&(h=d.startContainer,domUtils.isBoundaryNode(h,"firstChild")&&(h=d.endContainer,d.endOffset==(3==h.nodeType?h.nodeValue.length:h.childNodes.length)&&domUtils.isBoundaryNode(h,"lastChild")&&(f.body.innerHTML="

                      "+(browser.ie?"":"
                      ")+"

                      ",d.setStart(f.body.firstChild,0).collapse(!0)))),!d.collapsed&&d.deleteContents(),1==d.startContainer.nodeType){var i,j=d.startContainer.childNodes[d.startOffset];if(j&&domUtils.isBlockElm(j)&&(i=j.previousSibling)&&domUtils.isBlockElm(i)){for(d.setEnd(i,i.childNodes.length).collapse();j.firstChild;)i.appendChild(j.firstChild);domUtils.remove(j)}}}var j,k,i,l,m,n=0;d.inFillChar()&&(j=d.startContainer,domUtils.isFillChar(j)?(d.setStartBefore(j).collapse(!0),domUtils.remove(j)):domUtils.isFillChar(j,!0)&&(j.nodeValue=j.nodeValue.replace(fillCharReg,""),d.startOffset--,d.collapsed&&d.collapse(!0)));var o=domUtils.findParentByTagName(d.startContainer,"li",!0);if(o){for(var p,q;j=e.firstChild;){for(;j&&(3==j.nodeType||!domUtils.isBlockElm(j)||"HR"==j.tagName);)p=j.nextSibling,d.insertNode(j).collapse(),q=j,j=p;if(j)if(/^(ol|ul)$/i.test(j.tagName)){for(;j.firstChild;)q=j.firstChild,domUtils.insertAfter(o,j.firstChild),o=o.nextSibling;domUtils.remove(j)}else{var r;p=j.nextSibling,r=f.document.createElement("li"),domUtils.insertAfter(o,r),r.appendChild(j),q=j,j=p,o=r}}o=domUtils.findParentByTagName(d.startContainer,"li",!0),domUtils.isEmptyBlock(o)&&domUtils.remove(o),q&&d.setStartAfter(q).collapse(!0).select(!0)}else{for(;j=e.firstChild;){if(n){for(var s=f.document.createElement("p");j&&(3==j.nodeType||!dtd.$block[j.tagName]);)m=j.nextSibling,s.appendChild(j),j=m;s.firstChild&&(j=s)}if(d.insertNode(j),m=j.nextSibling,!n&&j.nodeType==domUtils.NODE_ELEMENT&&domUtils.isBlockElm(j)&&(k=domUtils.findParent(j,function(a){return domUtils.isBlockElm(a)}),k&&"body"!=k.tagName.toLowerCase()&&(!dtd[k.tagName][j.nodeName]||j.parentNode!==k))){if(dtd[k.tagName][j.nodeName])for(l=j.parentNode;l!==k;)i=l,l=l.parentNode;else i=k;domUtils.breakParent(j,i||l);var i=j.previousSibling;domUtils.trimWhiteTextNode(i),i.childNodes.length||domUtils.remove(i),!browser.ie&&(p=j.nextSibling)&&domUtils.isBlockElm(p)&&p.lastChild&&!domUtils.isBr(p.lastChild)&&p.appendChild(f.document.createElement("br")),n=1}var p=j.nextSibling;if(!e.firstChild&&p&&domUtils.isBlockElm(p)){d.setStart(p,0).collapse(!0);break}d.setEndAfter(j).collapse()}if(j=d.startContainer,m&&domUtils.isBr(m)&&domUtils.remove(m),domUtils.isBlockElm(j)&&domUtils.isEmptyNode(j))if(m=j.nextSibling)domUtils.remove(j),1==m.nodeType&&dtd.$block[m.tagName]&&d.setStart(m,0).collapse(!0).shrinkBoundary();else try{j.innerHTML=browser.ie?domUtils.fillChar:"
                      "}catch(t){d.setStartBefore(j),domUtils.remove(j)}try{d.select(!0)}catch(t){}}setTimeout(function(){d=f.selection.getRange(),d.scrollToView(f.autoHeightEnabled,f.autoHeightEnabled?domUtils.getXY(f.iframe).y:0),f.fireEvent("afterinserthtml",b)},200)}}},UE.plugins.autotypeset=function(){function a(a,b){return a&&3!=a.nodeType?domUtils.isBr(a)?1:a&&a.parentNode&&l[a.tagName.toLowerCase()]?g&&g.contains(a)||a.getAttribute("pagebreak")?0:b?!domUtils.isEmptyBlock(a):domUtils.isEmptyBlock(a,new RegExp("[\\s"+domUtils.fillChar+"]","g")):void 0:0}function b(a){a.style.cssText||(domUtils.removeAttributes(a,["style"]),"span"==a.tagName.toLowerCase()&&domUtils.hasNoAttributes(a)&&domUtils.remove(a,!0))}function c(c,f){var h,l=this;if(f){if(!i.pasteFilter)return;h=l.document.createElement("div"),h.innerHTML=f.html}else h=l.document.body;for(var m,n=domUtils.getElementsByTagName(h,"*"),o=0;m=n[o++];)if(l.fireEvent("excludeNodeinautotype",m)!==!0){if(i.clearFontSize&&m.style.fontSize&&(domUtils.removeStyle(m,"font-size"),b(m)),i.clearFontFamily&&m.style.fontFamily&&(domUtils.removeStyle(m,"font-family"),b(m)),a(m)){if(i.mergeEmptyline)for(var p,q=m.nextSibling,r=domUtils.isBr(m);a(q)&&(p=q,q=p.nextSibling,!r||q&&(!q||domUtils.isBr(q)));)domUtils.remove(p);if(i.removeEmptyline&&domUtils.inDoc(m,h)&&!k[m.parentNode.tagName.toLowerCase()]){if(domUtils.isBr(m)&&(q=m.nextSibling,q&&!domUtils.isBr(q)))continue;domUtils.remove(m);continue}}if(a(m,!0)&&"SPAN"!=m.tagName&&(i.indent&&(m.style.textIndent=i.indentValue),i.textAlign&&(m.style.textAlign=i.textAlign)),i.removeClass&&m.className&&!j[m.className.toLowerCase()]){if(g&&g.contains(m))continue;domUtils.removeAttributes(m,["class"])}if(i.imageBlockLine&&"img"==m.tagName.toLowerCase()&&!m.getAttribute("emotion"))if(f){var s=m;switch(i.imageBlockLine){case"left":case"right":case"none":for(var p,t,q,u=s.parentNode;dtd.$inline[u.tagName]||"A"==u.tagName;)u=u.parentNode;if(p=u,"P"==p.tagName&&"center"==domUtils.getStyle(p,"text-align")&&!domUtils.isBody(p)&&1==domUtils.getChildCount(p,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)}))if(t=p.previousSibling,q=p.nextSibling,t&&q&&1==t.nodeType&&1==q.nodeType&&t.tagName==q.tagName&&domUtils.isBlockElm(t)){for(t.appendChild(p.firstChild);q.firstChild;)t.appendChild(q.firstChild);domUtils.remove(p),domUtils.remove(q)}else domUtils.setStyle(p,"text-align","");domUtils.setStyle(s,"float",i.imageBlockLine);break;case"center":if("center"!=l.queryCommandValue("imagefloat")){for(u=s.parentNode,domUtils.setStyle(s,"float","none"),p=s;u&&1==domUtils.getChildCount(u,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)})&&(dtd.$inline[u.tagName]||"A"==u.tagName);)p=u,u=u.parentNode;var v=l.document.createElement("p");domUtils.setAttributes(v,{style:"text-align:center"}),p.parentNode.insertBefore(v,p),v.appendChild(p),domUtils.setStyle(p,"float","")}}}else{var w=l.selection.getRange();w.selectNode(m).select(),l.execCommand("imagefloat",i.imageBlockLine)}i.removeEmptyNode&&i.removeTagNames[m.tagName.toLowerCase()]&&domUtils.hasNoAttributes(m)&&domUtils.isEmptyBlock(m)&&domUtils.remove(m)}if(i.tobdc){var x=UE.htmlparser(h.innerHTML);x.traversal(function(a){"text"==a.type&&(a.data=e(a.data))}),h.innerHTML=x.toHtml()}if(i.bdc2sb){var x=UE.htmlparser(h.innerHTML);x.traversal(function(a){"text"==a.type&&(a.data=d(a.data))}),h.innerHTML=x.toHtml()}f&&(f.html=h.innerHTML)}function d(a){for(var b="",c=0;c=65281&&d<=65373?String.fromCharCode(a.charCodeAt(c)-65248):12288==d?String.fromCharCode(a.charCodeAt(c)-12288+32):a.charAt(c)}return b}function e(a){a=utils.html(a);for(var b="",c=0;c0?e.substring(e.indexOf(d.options.imagePath),e.length-1).replace(/"|\(|\)/gi,""):"none"!=e?e.replace(/url\("?|"?\)/gi,""):"";var g=' ",b.push(g)},aftersetcontent:function(){0==c&&b()}},inputRule:function(d){c=!1,utils.each(d.getNodesByTagName("p"),function(d){var e=d.getAttr("data-background");e&&(c=!0,b(a(e)),d.parentNode.removeChild(d))})},outputRule:function(a){var b=this,c=(utils.cssRule(e,b.document)||"").replace(/[\n\r]+/g,"").match(f);c&&a.appendChild(UE.uNode.createElement('


                      '))},commands:{background:{execCommand:function(a,c){b(c)},queryCommandValue:function(){var b=this,c=(utils.cssRule(e,b.document)||"").replace(/[\n\r]+/g,"").match(f);return c?a(c[1]):null},notNeedUndo:!0}}}}),UE.commands.imagefloat={execCommand:function(a,b){var c=this,d=c.selection.getRange();if(!d.collapsed){var e=d.getClosedNode();if(e&&"IMG"==e.tagName)switch(b){case"left":case"right":case"none":for(var f,g,h,i=e.parentNode;dtd.$inline[i.tagName]||"A"==i.tagName;)i=i.parentNode;if(f=i,"P"==f.tagName&&"center"==domUtils.getStyle(f,"text-align")){if(!domUtils.isBody(f)&&1==domUtils.getChildCount(f,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)}))if(g=f.previousSibling,h=f.nextSibling,g&&h&&1==g.nodeType&&1==h.nodeType&&g.tagName==h.tagName&&domUtils.isBlockElm(g)){for(g.appendChild(f.firstChild);h.firstChild;)g.appendChild(h.firstChild);domUtils.remove(f),domUtils.remove(h)}else domUtils.setStyle(f,"text-align","");d.selectNode(e).select()}domUtils.setStyle(e,"float","none"==b?"":b),"none"==b&&domUtils.removeAttributes(e,"align");break;case"center":if("center"!=c.queryCommandValue("imagefloat")){var i=e.parentNode;for(domUtils.setStyle(e,"float",""),domUtils.removeAttributes(e,"align"),f=e;i&&1==domUtils.getChildCount(i,function(a){return!domUtils.isBr(a)&&!domUtils.isWhitespace(a)})&&(dtd.$inline[i.tagName]||"A"==i.tagName);)f=i,i=i.parentNode;d.setStartBefore(f).setCursor(!1),i=c.document.createElement("div"),i.appendChild(f),domUtils.setStyle(f,"float",""),c.execCommand("insertHtml",'

                      '+i.innerHTML+"

                      "),f=c.document.getElementsByClassName("_img_parent_tmp")[0],f.removeAttribute("class"),f=f.firstChild,d.selectNode(f).select(),h=f.parentNode.nextSibling,h&&domUtils.isEmptyNode(h)&&domUtils.remove(h)}}}},queryCommandValue:function(){var a,b,c=this.selection.getRange();return c.collapsed?"none":(a=c.getClosedNode(),a&&1==a.nodeType&&"IMG"==a.tagName?(b=domUtils.getComputedStyle(a,"float")||a.getAttribute("align"),"none"==b&&(b="center"==domUtils.getComputedStyle(a.parentNode,"text-align")?"center":b),{left:1,right:1,center:1}[b]?b:"none"):"none")},queryCommandState:function(){var a,b=this.selection.getRange();return b.collapsed?-1:(a=b.getClosedNode(),a&&1==a.nodeType&&"IMG"==a.tagName?0:-1)}},UE.commands.insertimage={execCommand:function(a,b){if(b=utils.isArray(b)?b:[b],b.length){var c=this,d=c.selection.getRange(),e=d.getClosedNode();if(c.fireEvent("beforeinsertimage",b)!==!0){if(!e||!/img/i.test(e.tagName)||"edui-faked-video"==e.className&&e.className.indexOf("edui-upload-video")==-1||e.getAttribute("word_img")){var f,g=[],h="";if(f=b[0],1==b.length)h=''+f.alt+'","center"==f.floatStyle&&(h='

                      '+h+"

                      "),g.push(h);else for(var i=0;f=b[i++];)h="

                      ",g.push(h);c.execCommand("insertHtml",g.join(""))}else{var j=b.shift(),k=j.floatStyle;delete j.floatStyle,domUtils.setAttributes(e,j),c.execCommand("imagefloat",k),b.length>0&&(d.setStartAfter(e).setCursor(!1,!0),c.execCommand("insertimage",b))}c.fireEvent("afterinsertimage",b)}}}},UE.plugins.justify=function(){var a=domUtils.isBlockElm,b={left:1,right:1,center:1,justify:1},c=function(b,c){var d=b.createBookmark(),e=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!domUtils.isBookmarkNode(a):!domUtils.isWhitespace(a)};b.enlarge(!0);for(var f,g=b.createBookmark(),h=domUtils.getNextDomNode(g.start,!1,e),i=b.cloneRange();h&&!(domUtils.getPosition(h,g.end)&domUtils.POSITION_FOLLOWING);)if(3!=h.nodeType&&a(h))h=domUtils.getNextDomNode(h,!0,e);else{for(i.setStartBefore(h);h&&h!==g.end&&!a(h);)f=h,h=domUtils.getNextDomNode(h,!1,null,function(b){return!a(b)});i.setEndAfter(f);var j=i.getCommonAncestor();if(!domUtils.isBody(j)&&a(j))domUtils.setStyles(j,utils.isString(c)?{"text-align":c}:c),h=j;else{var k=b.document.createElement("p");domUtils.setStyles(k,utils.isString(c)?{"text-align":c}:c);var l=i.extractContents();k.appendChild(l),i.insertNode(k),h=k}h=domUtils.getNextDomNode(h,!1,e)}return b.moveToBookmark(g).moveToBookmark(d)};UE.commands.justify={execCommand:function(a,b){var d,e=this.selection.getRange();return e.collapsed&&(d=this.document.createTextNode("p"),e.insertNode(d)),c(e,b),d&&(e.setStartBefore(d).collapse(!0),domUtils.remove(d)),e.select(),!0},queryCommandValue:function(){var a=this.selection.getStart(),c=domUtils.getComputedStyle(a,"text-align");return b[c]?c:"left"},queryCommandState:function(){var a=this.selection.getStart(),b=a&&domUtils.findParentByTagName(a,["td","th","caption"],!0);return b?-1:0}}},UE.plugins.font=function(){function a(a){for(var b;(b=a.parentNode)&&"SPAN"==b.tagName&&1==domUtils.getChildCount(b,function(a){return!domUtils.isBookmarkNode(a)&&!domUtils.isBr(a)});)b.style.cssText+=a.style.cssText,domUtils.remove(a,!0),a=b}function b(a,b,c){g[b]&&(a.adjustmentBoundary(),a.collapsed||1!=a.startContainer.nodeType||a.traversal(function(d){var e;if(e=domUtils.isTagNode(d,"span")?d:domUtils.getElementsByTagName(d,"span")[0],e&&domUtils.isTagNode(e,"span")){var f=a.createBookmark();utils.each(domUtils.getElementsByTagName(e,"span"),function(a){a.parentNode&&!domUtils.isBookmarkNode(a)&&("backcolor"==b&&domUtils.getComputedStyle(a,"background-color").toLowerCase()===c||(domUtils.removeStyle(a,g[b]),0==a.style.cssText.replace(/^\s+$/,"").length&&domUtils.remove(a,!0)))}),a.moveToBookmark(f)}}))}function c(c,d,e){var f,g=c.collapsed,h=c.createBookmark();if(g)for(f=h.start.parentNode;dtd.$inline[f.tagName];)f=f.parentNode;else f=domUtils.getCommonAncestor(h.start,h.end);utils.each(domUtils.getElementsByTagName(f,"span"),function(b){if(b.parentNode&&!domUtils.isBookmarkNode(b)){if(/\s*border\s*:\s*none;?\s*/i.test(b.style.cssText))return void(/^\s*border\s*:\s*none;?\s*$/.test(b.style.cssText)?domUtils.remove(b,!0):domUtils.removeStyle(b,"border"));if(/border/i.test(b.style.cssText)&&"SPAN"==b.parentNode.tagName&&/border/i.test(b.parentNode.style.cssText)&&(b.style.cssText=b.style.cssText.replace(/border[^:]*:[^;]+;?/gi,"")),"fontborder"!=d||"none"!=e)for(var c=b.nextSibling;c&&1==c.nodeType&&"SPAN"==c.tagName;)if(domUtils.isBookmarkNode(c)&&"fontborder"==d)b.appendChild(c),c=b.nextSibling;else{if(c.style.cssText==b.style.cssText&&(domUtils.moveChild(c,b),domUtils.remove(c)),b.nextSibling===c)break;c=b.nextSibling}if(a(b),browser.ie&&browser.version>8){var f=domUtils.findParent(b,function(a){return"SPAN"==a.tagName&&/background-color/.test(a.style.cssText)});f&&!/background-color/.test(b.style.cssText)&&(b.style.backgroundColor=f.style.backgroundColor)}}}),c.moveToBookmark(h),b(c,d,e)}var d=this,e={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family",underline:"text-decoration",strikethrough:"text-decoration",fontborder:"border"},f={underline:1,strikethrough:1,fontborder:1},g={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family"};d.setOpt({fontfamily:[{name:"songti",val:"宋体,SimSun"},{name:"yahei",val:"微软雅黑,Microsoft YaHei"},{name:"kaiti",val:"楷体,楷体_GB2312, SimKai"},{name:"heiti",val:"黑体, SimHei"},{name:"lishu",val:"隶书, SimLi"},{name:"andaleMono",val:"andale mono"},{name:"arial",val:"arial, helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"comicSansMs",val:"comic sans ms"},{name:"impact",val:"impact,chicago"},{name:"timesNewRoman",val:"times new roman"}],fontsize:[10,11,12,14,16,18,20,24,36]}),d.addInputRule(function(a){utils.each(a.getNodesByTagName("u s del font strike"),function(a){if("font"==a.tagName){var b=[];for(var c in a.attrs)switch(c){case"size":b.push("font-size:"+({1:"10",2:"12",3:"16",4:"18",5:"24",6:"32",7:"48"}[a.attrs[c]]||a.attrs[c])+"px");break;case"color":b.push("color:"+a.attrs[c]);break;case"face":b.push("font-family:"+a.attrs[c]);break;case"style":b.push(a.attrs[c])}a.attrs={style:b.join(";")}}else{var d="u"==a.tagName?"underline":"line-through";a.attrs={style:(a.getAttr("style")||"")+"text-decoration:"+d+";"}}a.tagName="span"})});for(var h in e)!function(a,b){UE.commands[a]={execCommand:function(d,e){e=e||(this.queryCommandState(d)?"none":"underline"==d?"underline":"fontborder"==d?"1px solid #000":"line-through");var g,h=this,i=this.selection.getRange();if("default"==e)i.collapsed&&(g=h.document.createTextNode("font"),i.insertNode(g).select()),h.execCommand("removeFormat","span,a",b),g&&(i.setStartBefore(g).collapse(!0),domUtils.remove(g)),c(i,d,e),i.select();else if(i.collapsed){var j=domUtils.findParentByTagName(i.startContainer,"span",!0);if(g=h.document.createTextNode("font"),!j||j.children.length||j[browser.ie?"innerText":"textContent"].replace(fillCharReg,"").length){if(i.insertNode(g),i.selectNode(g).select(),j=i.document.createElement("span"),f[a]){if(domUtils.findParentByTagName(g,"a",!0))return i.setStartBefore(g).setCursor(),void domUtils.remove(g);h.execCommand("removeFormat","span,a",b)}if(j.style.cssText=b+":"+e,g.parentNode.insertBefore(j,g),!browser.ie||browser.ie&&9==browser.version)for(var k=j.parentNode;!domUtils.isBlockElm(k);)"SPAN"==k.tagName&&(j.style.cssText=k.style.cssText+";"+j.style.cssText),k=k.parentNode;opera?setTimeout(function(){i.setStart(j,0).collapse(!0),c(i,d,e),i.select()}):(i.setStart(j,0).collapse(!0),c(i,d,e),i.select())}else i.insertNode(g),f[a]&&(i.selectNode(g).select(),h.execCommand("removeFormat","span,a",b,null),j=domUtils.findParentByTagName(g,"span",!0),i.setStartBefore(g)),j&&(j.style.cssText+=";"+b+":"+e),i.collapse(!0).select();domUtils.remove(g)}else f[a]&&h.queryCommandValue(a)&&h.execCommand("removeFormat","span,a",b),i=h.selection.getRange(),i.applyInlineStyle("span",{style:b+":"+e}),c(i,d,e),i.select();return!0},queryCommandValue:function(a){var c=this.selection.getStart();if("underline"==a||"strikethrough"==a){for(var d,e=c;e&&!domUtils.isBlockElm(e)&&!domUtils.isBody(e);){if(1==e.nodeType&&(d=domUtils.getComputedStyle(e,b),"none"!=d))return d;e=e.parentNode}return"none"}if("fontborder"==a){for(var f,g=c;g&&dtd.$inline[g.tagName];){if((f=domUtils.getComputedStyle(g,"border"))&&/1px/.test(f)&&/solid/.test(f))return f;g=g.parentNode}return""}if("FontSize"==a){var h=domUtils.getComputedStyle(c,b),g=/^([\d\.]+)(\w+)$/.exec(h);return g?Math.floor(g[1])+g[2]:h}return domUtils.getComputedStyle(c,b)},queryCommandState:function(a){if(!f[a])return 0;var b=this.queryCommandValue(a);return"fontborder"==a?/1px/.test(b)&&/solid/.test(b):"underline"==a?/underline/.test(b):/line\-through/.test(b)}}}(h,e[h])},UE.plugins.link=function(){function a(a){var b=a.startContainer,c=a.endContainer;(b=domUtils.findParentByTagName(b,"a",!0))&&a.setStartBefore(b),(c=domUtils.findParentByTagName(c,"a",!0))&&a.setEndAfter(c)}function b(b,c,d){var e=b.cloneRange(),f=d.queryCommandValue("link");a(b=b.adjustmentBoundary());var g=b.startContainer;if(1==g.nodeType&&f&&(g=g.childNodes[b.startOffset],g&&1==g.nodeType&&"A"==g.tagName&&/^(?:https?|ftp|file)\s*:\s*\/\//.test(g[browser.ie?"innerText":"textContent"])&&(g[browser.ie?"innerText":"textContent"]=utils.html(c.textValue||c.href))),e.collapsed&&!f||(b.removeInlineStyle("a"),e=b.cloneRange()),e.collapsed){var h=b.document.createElement("a"),i="";c.textValue?(i=utils.html(c.textValue),delete c.textValue):i=utils.html(c.href),domUtils.setAttributes(h,c),g=domUtils.findParentByTagName(e.startContainer,"a",!0),g&&domUtils.isInNodeEndBoundary(e,g)&&b.setStartAfter(g).collapse(!0),h[browser.ie?"innerText":"textContent"]=i,b.insertNode(h).selectNode(h)}else b.applyInlineStyle("a",c)}UE.commands.unlink={execCommand:function(){var b,c=this.selection.getRange();c.collapsed&&!domUtils.findParentByTagName(c.startContainer,"a",!0)||(b=c.createBookmark(),a(c),c.removeInlineStyle("a").moveToBookmark(b).select())},queryCommandState:function(){return!this.highlight&&this.queryCommandValue("link")?0:-1}},UE.commands.link={execCommand:function(a,c){var d;c._href&&(c._href=utils.unhtml(c._href,/[<">]/g)),c.href&&(c.href=utils.unhtml(c.href,/[<">]/g)),c.textValue&&(c.textValue=utils.unhtml(c.textValue,/[<">]/g)),b(d=this.selection.getRange(),c,this),d.collapse().select(!0)},queryCommandValue:function(){var a,b=this.selection.getRange();if(!b.collapsed){b.shrinkBoundary();var c=3!=b.startContainer.nodeType&&b.startContainer.childNodes[b.startOffset]?b.startContainer.childNodes[b.startOffset]:b.startContainer,d=3==b.endContainer.nodeType||0==b.endOffset?b.endContainer:b.endContainer.childNodes[b.endOffset-1],e=b.getCommonAncestor();if(a=domUtils.findParentByTagName(e,"a",!0),!a&&1==e.nodeType)for(var f,g,h,i=e.getElementsByTagName("a"),j=0;h=i[j++];)if(f=domUtils.getPosition(h,c),g=domUtils.getPosition(h,d),(f&domUtils.POSITION_FOLLOWING||f&domUtils.POSITION_CONTAINS)&&(g&domUtils.POSITION_PRECEDING||g&domUtils.POSITION_CONTAINS)){a=h;break}return a}if(a=b.startContainer,a=1==a.nodeType?a:a.parentNode,a&&(a=domUtils.findParentByTagName(a,"a",!0))&&!domUtils.isInNodeEndBoundary(b,a))return a},queryCommandState:function(){var a=this.selection.getRange().getClosedNode(),b=a&&("edui-faked-video"==a.className||a.className.indexOf("edui-upload-video")!=-1);return b?-1:0}}},UE.plugins.insertframe=function(){function a(){b._iframe&&delete b._iframe}var b=this;b.addListener("selectionchange",function(){a()})},UE.commands.scrawl={queryCommandState:function(){return browser.ie&&browser.version<=8?-1:0}},UE.plugins.removeformat=function(){var a=this;a.setOpt({removeFormatTags:"b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var",removeFormatAttributes:"class,style,lang,width,height,align,hspace,valign"}),a.commands.removeformat={execCommand:function(a,b,c,d,e){function f(a){if(3==a.nodeType||"span"!=a.tagName.toLowerCase())return 0;if(browser.ie){var b=a.attributes;if(b.length){for(var c=0,d=b.length;c
                      "+this.getContent(null,null,!0)+"
                      "),b.close()},notNeedUndo:1},UE.plugins.selectall=function(){var a=this;a.commands.selectall={execCommand:function(){var a=this,b=a.body,c=a.selection.getRange();c.selectNodeContents(b),domUtils.isEmptyBlock(b)&&(browser.opera&&b.firstChild&&1==b.firstChild.nodeType&&c.setStartAtFirst(b.firstChild),c.collapse(!0)),c.select(!0)},notNeedUndo:1},a.addshortcutkey({selectAll:"ctrl+65"})},UE.plugins.paragraph=function(){var a=this,b=domUtils.isBlockElm,c=["TD","LI","PRE"],d=function(a,d,e,f){var g,h=a.createBookmark(),i=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!domUtils.isBookmarkNode(a):!domUtils.isWhitespace(a)};a.enlarge(!0);for(var j,k=a.createBookmark(),l=domUtils.getNextDomNode(k.start,!1,i),m=a.cloneRange();l&&!(domUtils.getPosition(l,k.end)&domUtils.POSITION_FOLLOWING);)if(3!=l.nodeType&&b(l))l=domUtils.getNextDomNode(l,!0,i);else{for(m.setStartBefore(l);l&&l!==k.end&&!b(l);)j=l,l=domUtils.getNextDomNode(l,!1,null,function(a){return!b(a)});m.setEndAfter(j),g=a.document.createElement(d),e&&(domUtils.setAttributes(g,e),f&&"customstyle"==f&&e.style&&(g.style.cssText=e.style)),g.appendChild(m.extractContents()),domUtils.isEmptyNode(g)&&domUtils.fillChar(a.document,g),m.insertNode(g);var n=g.parentNode;b(n)&&!domUtils.isBody(g.parentNode)&&utils.indexOf(c,n.tagName)==-1&&(f&&"customstyle"==f||(n.getAttribute("dir")&&g.setAttribute("dir",n.getAttribute("dir")),n.style.cssText&&(g.style.cssText=n.style.cssText+";"+g.style.cssText),n.style.textAlign&&!g.style.textAlign&&(g.style.textAlign=n.style.textAlign),n.style.textIndent&&!g.style.textIndent&&(g.style.textIndent=n.style.textIndent),n.style.padding&&!g.style.padding&&(g.style.padding=n.style.padding)),e&&/h\d/i.test(n.tagName)&&!/h\d/i.test(g.tagName)?(domUtils.setAttributes(n,e),f&&"customstyle"==f&&e.style&&(n.style.cssText=e.style),domUtils.remove(g,!0),g=n):domUtils.remove(g.parentNode,!0)),l=utils.indexOf(c,n.tagName)!=-1?n:g,l=domUtils.getNextDomNode(l,!1,i)}return a.moveToBookmark(k).moveToBookmark(h)};a.setOpt("paragraph",{p:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:""}),a.commands.paragraph={execCommand:function(a,b,c,e){var f=this.selection.getRange();if(f.collapsed){var g=this.document.createTextNode("p");if(f.insertNode(g),browser.ie){var h=g.previousSibling;h&&domUtils.isWhitespace(h)&&domUtils.remove(h),h=g.nextSibling,h&&domUtils.isWhitespace(h)&&domUtils.remove(h)}}if(f=d(f,b,c,e),g&&(f.setStartBefore(g).collapse(!0),pN=g.parentNode,domUtils.remove(g),domUtils.isBlockElm(pN)&&domUtils.isEmptyNode(pN)&&domUtils.fillNode(this.document,pN)),browser.gecko&&f.collapsed&&1==f.startContainer.nodeType){var i=f.startContainer.childNodes[f.startOffset];i&&1==i.nodeType&&i.tagName.toLowerCase()==b&&f.setStart(i,0).collapse(!0)}return f.select(),!0},queryCommandValue:function(){var a=domUtils.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return a?a.tagName.toLowerCase():""}}},function(){var a=domUtils.isBlockElm,b=function(a){return domUtils.filterNodeList(a.selection.getStartElementPath(),function(a){return a&&1==a.nodeType&&a.getAttribute("dir")})},c=function(c,d,e){var f,g=function(a){return 1==a.nodeType?!domUtils.isBookmarkNode(a):!domUtils.isWhitespace(a)},h=b(d);if(h&&c.collapsed)return h.setAttribute("dir",e),c;f=c.createBookmark(),c.enlarge(!0);for(var i,j=c.createBookmark(),k=domUtils.getNextDomNode(j.start,!1,g),l=c.cloneRange();k&&!(domUtils.getPosition(k,j.end)&domUtils.POSITION_FOLLOWING);)if(3!=k.nodeType&&a(k))k=domUtils.getNextDomNode(k,!0,g);else{for(l.setStartBefore(k);k&&k!==j.end&&!a(k);)i=k,k=domUtils.getNextDomNode(k,!1,null,function(b){return!a(b)});l.setEndAfter(i);var m=l.getCommonAncestor();if(!domUtils.isBody(m)&&a(m))m.setAttribute("dir",e),k=m;else{var n=c.document.createElement("p");n.setAttribute("dir",e);var o=l.extractContents();n.appendChild(o),l.insertNode(n),k=n}k=domUtils.getNextDomNode(k,!1,g)}return c.moveToBookmark(j).moveToBookmark(f)};UE.commands.directionality={execCommand:function(a,b){var d=this.selection.getRange();if(d.collapsed){var e=this.document.createTextNode("d");d.insertNode(e)}return c(d,this,b),e&&(d.setStartBefore(e).collapse(!0),domUtils.remove(e)),d.select(),!0},queryCommandValue:function(){var a=b(this);return a?a.getAttribute("dir"):"ltr"}}}(),UE.plugins.horizontal=function(){var a=this;a.commands.horizontal={execCommand:function(a){var b=this;if(b.queryCommandState(a)!==-1){b.execCommand("insertHtml","
                      ");var c=b.selection.getRange(),d=c.startContainer;if(1==d.nodeType&&!d.childNodes[c.startOffset]){var e;(e=d.childNodes[c.startOffset-1])&&1==e.nodeType&&"HR"==e.tagName&&("p"==b.options.enterTag?(e=b.document.createElement("p"),c.insertNode(e),c.setStart(e,0).setCursor()):(e=b.document.createElement("br"),c.insertNode(e),c.setStartBefore(e).setCursor()))}return!0}},queryCommandState:function(){return domUtils.filterNodeList(this.selection.getStartElementPath(),"table")?-1:0}},a.addListener("delkeydown",function(a,b){var c=this.selection.getRange();if(c.txtToElmBoundary(!0),domUtils.isStartInblock(c)){var d=c.startContainer,e=d.previousSibling;if(e&&domUtils.isTagNode(e,"hr"))return domUtils.remove(e),c.select(),domUtils.preventDefault(b),!0}})},UE.commands.time=UE.commands.date={execCommand:function(a,b){function c(a,b){var c=("0"+a.getHours()).slice(-2),d=("0"+a.getMinutes()).slice(-2),e=("0"+a.getSeconds()).slice(-2);return b=b||"hh:ii:ss",b.replace(/hh/gi,c).replace(/ii/gi,d).replace(/ss/gi,e)}function d(a,b){var c=("000"+a.getFullYear()).slice(-4),d=c.slice(-2),e=("0"+(a.getMonth()+1)).slice(-2),f=("0"+a.getDate()).slice(-2);return b=b||"yyyy-mm-dd",b.replace(/yyyy/gi,c).replace(/yy/gi,d).replace(/mm/gi,e).replace(/dd/gi,f)}var e=new Date;this.execCommand("insertHtml","time"==a?c(e,b):d(e,b))}},UE.plugins.rowspacing=function(){var a=this;a.setOpt({rowspacingtop:["5","10","15","20","25"],rowspacingbottom:["5","10","15","20","25"]}),a.commands.rowspacing={execCommand:function(a,b,c){return this.execCommand("paragraph","p",{style:"margin-"+c+":"+b+"px"}),!0},queryCommandValue:function(a,b){var c,d=domUtils.filterNodeList(this.selection.getStartElementPath(),function(a){return domUtils.isBlockElm(a)});return d?(c=domUtils.getComputedStyle(d,"margin-"+b).replace(/[^\d]/g,""),c?c:0):0}}},UE.plugins.lineheight=function(){var a=this;a.setOpt({lineheight:["1","1.5","1.75","2","3","4","5"]}),a.commands.lineheight={execCommand:function(a,b){return this.execCommand("paragraph","p",{style:"line-height:"+("1"==b?"normal":b+"em")}),!0},queryCommandValue:function(){var a=domUtils.filterNodeList(this.selection.getStartElementPath(),function(a){return domUtils.isBlockElm(a)});if(a){var b=domUtils.getComputedStyle(a,"line-height");return"normal"==b?1:b.replace(/[^\d.]*/gi,"")}}}},UE.plugins.insertcode=function(){var a=this;a.ready(function(){utils.cssRule("pre","pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}",a.document)}),a.setOpt("insertcode",{as3:"ActionScript3",bash:"Bash/Shell",cpp:"C/C++",css:"Css",cf:"CodeFunction","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"Html",java:"Java",jfx:"JavaFx",js:"Javascript",pl:"Perl",php:"Php",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"Sql",vb:"Vb",xml:"Xml"}),a.commands.insertcode={execCommand:function(a,b){var c=this,d=c.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"pre",!0);if(e)e.className="brush:"+b+";toolbar:false;";else{var f="";if(d.collapsed)f=browser.ie&&browser.ie11below?browser.version<=8?" ":"":"
                      ";else{var g=d.extractContents(),h=c.document.createElement("div");h.appendChild(g),utils.each(UE.filterNode(UE.htmlparser(h.innerHTML.replace(/[\r\t]/g,"")),c.options.filterTxtRules).children,function(a){if(browser.ie&&browser.ie11below&&browser.version>8)"element"==a.type?"br"==a.tagName?f+="\n":dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?f+="\n":dtd.$empty[a.tagName]||(f+=b.innerText()):f+=b.data}),/\n$/.test(f)||(f+="\n")):f+=a.data+"\n",!a.nextSibling()&&/\n$/.test(f)&&(f=f.replace(/\n$/,""));else if(browser.ie&&browser.ie11below)"element"==a.type?"br"==a.tagName?f+="
                      ":dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?f+="
                      ":dtd.$empty[a.tagName]||(f+=b.innerText()):f+=b.data}),/br>$/.test(f)||(f+="
                      ")):f+=a.data+"
                      ",!a.nextSibling()&&/
                      $/.test(f)&&(f=f.replace(/
                      $/,""));else if(f+="element"==a.type?dtd.$empty[a.tagName]?"":a.innerText():a.data,!/br\/?\s*>$/.test(f)){if(!a.nextSibling())return;f+="
                      "}})}c.execCommand("inserthtml",'
                      '+f+"
                      ",!0),e=c.document.getElementById("coder"),domUtils.removeAttributes(e,"id");var i=e.previousSibling;i&&(3==i.nodeType&&1==i.nodeValue.length&&browser.ie&&6==browser.version||domUtils.isEmptyBlock(i))&&domUtils.remove(i);var d=c.selection.getRange();domUtils.isEmptyBlock(e)?d.setStart(e,0).setCursor(!1,!0):d.selectNodeContents(e).select()}},queryCommandValue:function(){var a=this.selection.getStartElementPath(),b="";return utils.each(a,function(a){if("PRE"==a.nodeName){var c=a.className.match(/brush:([^;]+)/);return b=c&&c[1]?c[1]:"",!1}}),b}},a.addInputRule(function(a){utils.each(a.getNodesByTagName("pre"),function(a){var b=a.getNodesByTagName("br");if(b.length)return void(browser.ie&&browser.ie11below&&browser.version>8&&utils.each(b,function(a){var b=UE.uNode.createText("\n");a.parentNode.insertBefore(b,a),a.parentNode.removeChild(a)}));if(!(browser.ie&&browser.ie11below&&browser.version>8)){var c=a.innerText().split(/\n/);a.innerHTML(""),utils.each(c,function(b){b.length&&a.appendChild(UE.uNode.createText(b)),a.appendChild(UE.uNode.createElement("br"))})}})}),a.addOutputRule(function(a){utils.each(a.getNodesByTagName("pre"),function(a){var b="";utils.each(a.children,function(a){b+="text"==a.type?a.data.replace(/[ ]/g," ").replace(/\n$/,""):"br"==a.tagName?"\n":dtd.$empty[a.tagName]?a.innerText():""}),a.innerText(b.replace(/( |\n)+$/,""))})}),a.notNeedCodeQuery={help:1,undo:1,redo:1,source:1,print:1,searchreplace:1, -fullscreen:1,preview:1,insertparagraph:1,elementpath:1,insertcode:1,inserthtml:1,selectall:1};a.queryCommandState;a.queryCommandState=function(a){var b=this;return!b.notNeedCodeQuery[a.toLowerCase()]&&b.selection&&b.queryCommandValue("insertcode")?-1:UE.Editor.prototype.queryCommandState.apply(this,arguments)},a.addListener("beforeenterkeydown",function(){var b=a.selection.getRange(),c=domUtils.findParentByTagName(b.startContainer,"pre",!0);if(c){if(a.fireEvent("saveScene"),b.collapsed||b.deleteContents(),!browser.ie||browser.ie9above){var c,d=a.document.createElement("br");b.insertNode(d).setStartAfter(d).collapse(!0);var e=d.nextSibling;e||browser.ie&&!(browser.version>10)?b.setStartAfter(d):b.insertNode(d.cloneNode(!1)),c=d.previousSibling;for(var f;c;)if(f=c,c=c.previousSibling,!c||"BR"==c.nodeName){c=f;break}if(c){for(var g="";c&&"BR"!=c.nodeName&&new RegExp("^[\\s"+domUtils.fillChar+"]*$").test(c.nodeValue);)g+=c.nodeValue,c=c.nextSibling;if("BR"!=c.nodeName){var h=c.nodeValue.match(new RegExp("^([\\s"+domUtils.fillChar+"]+)"));h&&h[1]&&(g+=h[1])}g&&(g=a.document.createTextNode(g),b.insertNode(g).setStartAfter(g))}b.collapse(!0).select(!0)}else if(browser.version>8){var i=a.document.createTextNode("\n"),j=b.startContainer;if(0==b.startOffset){var k=j.previousSibling;if(k){b.insertNode(i);var l=a.document.createTextNode(" ");b.setStartAfter(i).insertNode(l).setStart(l,0).collapse(!0).select(!0)}}else{b.insertNode(i).setStartAfter(i);var l=a.document.createTextNode(" ");j=b.startContainer.childNodes[b.startOffset],j&&!/^\n/.test(j.nodeValue)&&b.setStartBefore(i),b.insertNode(l).setStart(l,0).collapse(!0).select(!0)}}else{var d=a.document.createElement("br");b.insertNode(d),b.insertNode(a.document.createTextNode(domUtils.fillChar)),b.setStartAfter(d),c=d.previousSibling;for(var f;c;)if(f=c,c=c.previousSibling,!c||"BR"==c.nodeName){c=f;break}if(c){for(var g="";c&&"BR"!=c.nodeName&&new RegExp("^[ "+domUtils.fillChar+"]*$").test(c.nodeValue);)g+=c.nodeValue,c=c.nextSibling;if("BR"!=c.nodeName){var h=c.nodeValue.match(new RegExp("^([ "+domUtils.fillChar+"]+)"));h&&h[1]&&(g+=h[1])}g=a.document.createTextNode(g),b.insertNode(g).setStartAfter(g)}b.collapse(!0).select()}return a.fireEvent("saveScene"),!0}}),a.addListener("tabkeydown",function(b,c){var d=a.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"pre",!0);if(e){if(a.fireEvent("saveScene"),c.shiftKey);else if(d.collapsed){var f=a.document.createTextNode(" ");d.insertNode(f).setStartAfter(f).collapse(!0).select(!0)}else{for(var g=d.createBookmark(),h=g.start.previousSibling;h;){if(e.firstChild===h&&!domUtils.isBr(h)){e.insertBefore(a.document.createTextNode(" "),h);break}if(domUtils.isBr(h)){e.insertBefore(a.document.createTextNode(" "),h.nextSibling);break}h=h.previousSibling}var i=g.end;for(h=g.start.nextSibling,e.firstChild===g.start&&e.insertBefore(a.document.createTextNode(" "),h.nextSibling);h&&h!==i;){if(domUtils.isBr(h)&&h.nextSibling){if(h.nextSibling===i)break;e.insertBefore(a.document.createTextNode(" "),h.nextSibling)}h=h.nextSibling}d.moveToBookmark(g).select()}return a.fireEvent("saveScene"),!0}}),a.addListener("beforeinserthtml",function(a,b){var c=this,d=c.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"pre",!0);if(e){d.collapsed||d.deleteContents();var f="";if(browser.ie&&browser.version>8){utils.each(UE.filterNode(UE.htmlparser(b),c.options.filterTxtRules).children,function(a){"element"==a.type?"br"==a.tagName?f+="\n":dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?f+="\n":dtd.$empty[a.tagName]||(f+=b.innerText()):f+=b.data}),/\n$/.test(f)||(f+="\n")):f+=a.data+"\n",!a.nextSibling()&&/\n$/.test(f)&&(f=f.replace(/\n$/,""))});var g=c.document.createTextNode(utils.html(f.replace(/ /g," ")));d.insertNode(g).selectNode(g).select()}else{var h=c.document.createDocumentFragment();utils.each(UE.filterNode(UE.htmlparser(b),c.options.filterTxtRules).children,function(a){"element"==a.type?"br"==a.tagName?h.appendChild(c.document.createElement("br")):dtd.$empty[a.tagName]||(utils.each(a.children,function(b){"element"==b.type?"br"==b.tagName?h.appendChild(c.document.createElement("br")):dtd.$empty[a.tagName]||h.appendChild(c.document.createTextNode(utils.html(b.innerText().replace(/ /g," ")))):h.appendChild(c.document.createTextNode(utils.html(b.data.replace(/ /g," "))))}),"BR"!=h.lastChild.nodeName&&h.appendChild(c.document.createElement("br"))):h.appendChild(c.document.createTextNode(utils.html(a.data.replace(/ /g," ")))),a.nextSibling()||"BR"!=h.lastChild.nodeName||h.removeChild(h.lastChild)}),d.insertNode(h).select()}return!0}}),a.addListener("keydown",function(a,b){var c=this,d=b.keyCode||b.which;if(40==d){var e,f=c.selection.getRange(),g=f.startContainer;if(f.collapsed&&(e=domUtils.findParentByTagName(f.startContainer,"pre",!0))&&!e.nextSibling){for(var h=e.lastChild;h&&"BR"==h.nodeName;)h=h.previousSibling;(h===g||f.startContainer===e&&f.startOffset==e.childNodes.length)&&(c.execCommand("insertparagraph"),domUtils.preventDefault(b))}}}),a.addListener("delkeydown",function(b,c){var d=this.selection.getRange();d.txtToElmBoundary(!0);var e=d.startContainer;if(domUtils.isTagNode(e,"pre")&&d.collapsed&&domUtils.isStartInblock(d)){var f=a.document.createElement("p");return domUtils.fillNode(a.document,f),e.parentNode.insertBefore(f,e),domUtils.remove(e),d.setStart(f,0).setCursor(!1,!0),domUtils.preventDefault(c),!0}})},UE.commands.cleardoc={execCommand:function(a){var b=this,c=b.options.enterTag,d=b.selection.getRange();"br"==c?(b.body.innerHTML="
                      ",d.setStart(b.body,0).setCursor()):(b.body.innerHTML="

                      "+(ie?"":"
                      ")+"

                      ",d.setStart(b.body.firstChild,0).setCursor(!1,!0)),setTimeout(function(){b.fireEvent("clearDoc")},0)}},UE.plugin.register("anchor",function(){var a=this;return{bindEvents:{ready:function(){utils.cssRule("anchor",".anchorclass{background: url('"+this.options.themePath+this.options.theme+"/images/anchor.gif') no-repeat scroll left center transparent;cursor: auto;display: inline-block;height: 16px;width: 16px;}",this.document)}},outputRule:function(a){utils.each(a.getNodesByTagName("img"),function(a){var b;(b=a.getAttr("anchorname"))&&(a.tagName="a",a.setAttr({anchorname:"",name:b,"class":""}))})},inputRule:function(a){utils.each(a.getNodesByTagName("a"),function(a){var b;if((b=a.getAttr("name"))&&!a.getAttr("href")){if(/^\_Toc\d+$/.test(b))return void a.parentNode.removeChild(a);a.tagName="img",a.setAttr({anchorname:a.getAttr("name"),"class":"anchorclass"}),a.setAttr("name")}})},commands:{anchor:{execCommand:function(b,c){var d=this.selection.getRange(),e=d.getClosedNode();if(e&&e.getAttribute("anchorname"))c?e.setAttribute("anchorname",c):(d.setStartBefore(e).setCursor(),domUtils.remove(e));else if(c){var f=utils.renderTplstr('',{name:c});a.execCommand("inserthtml",f,!0)}}}}}}),UE.plugins.wordcount=function(){var a=this;a.setOpt("wordCount",!0),a.addListener("contentchange",function(){a.fireEvent("wordcount")});var b;a.addListener("ready",function(){var a=this;domUtils.on(a.body,"keyup",function(c){var d=c.keyCode||c.which,e={16:1,18:1,20:1,37:1,38:1,39:1,40:1};d in e||(clearTimeout(b),b=setTimeout(function(){a.fireEvent("wordcount")},200))})})},UE.plugins.pagebreak=function(){function a(a){if(domUtils.isEmptyBlock(a)){for(var b,d=a.firstChild;d&&1==d.nodeType&&domUtils.isEmptyBlock(d);)b=d,d=d.firstChild;!b&&(b=a),domUtils.fillNode(c.document,b)}}function b(a){return a&&1==a.nodeType&&"HR"==a.tagName&&"pagebreak"==a.className}var c=this,d=["td"];c.setOpt("pageBreakTag","_ueditor_page_break_tag_"),c.ready(function(){utils.cssRule("pagebreak",".pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}",c.document)}),c.addInputRule(function(a){a.traversal(function(a){if("text"==a.type&&a.data==c.options.pageBreakTag){var b=UE.uNode.createElement('
                      ');a.parentNode.insertBefore(b,a),a.parentNode.removeChild(a)}})}),c.addOutputRule(function(a){utils.each(a.getNodesByTagName("hr"),function(a){if("pagebreak"==a.getAttr("class")){var b=UE.uNode.createText(c.options.pageBreakTag);a.parentNode.insertBefore(b,a),a.parentNode.removeChild(a)}})}),c.commands.pagebreak={execCommand:function(){var e=c.selection.getRange(),f=c.document.createElement("hr");domUtils.setAttributes(f,{"class":"pagebreak",noshade:"noshade",size:"5"}),domUtils.unSelectable(f);var g,h=domUtils.findParentByTagName(e.startContainer,d,!0),i=[];if(h)switch(h.tagName){case"TD":if(g=h.parentNode,g.previousSibling)g.parentNode.insertBefore(f,g),i=domUtils.findParents(f);else{var j=domUtils.findParentByTagName(g,"table");j.parentNode.insertBefore(f,j),i=domUtils.findParents(f,!0)}g=i[1],f!==g&&domUtils.breakParent(f,g),c.fireEvent("afteradjusttable",c.document)}else{if(!e.collapsed){e.deleteContents();for(var k=e.startContainer;!domUtils.isBody(k)&&domUtils.isBlockElm(k)&&domUtils.isEmptyNode(k);)e.setStartBefore(k).collapse(!0),domUtils.remove(k),k=e.startContainer}e.insertNode(f);for(var l,g=f.parentNode;!domUtils.isBody(g);)domUtils.breakParent(f,g),l=f.nextSibling,l&&domUtils.isEmptyBlock(l)&&domUtils.remove(l),g=f.parentNode;l=f.nextSibling;var m=f.previousSibling;if(b(m)?domUtils.remove(m):m&&a(m),l)b(l)?domUtils.remove(l):a(l),e.setEndAfter(f).collapse(!1);else{var n=c.document.createElement("p");f.parentNode.appendChild(n),domUtils.fillNode(c.document,n),e.setStart(n,0).collapse(!0)}e.select(!0)}}}},UE.plugin.register("wordimage",function(){var a=this,b=[];return{commands:{wordimage:{execCommand:function(){for(var b,c=domUtils.getElementsByTagName(a.body,"img"),d=[],e=0;b=c[e++];){var f=b.getAttribute("word_img");f&&d.push(f)}return d},queryCommandState:function(){b=domUtils.getElementsByTagName(a.body,"img");for(var c,d=0;c=b[d++];)if(c.getAttribute("word_img"))return 1;return-1},notNeedUndo:!0}},inputRule:function(b){utils.each(b.getNodesByTagName("img"),function(b){var c=b.attrs,d=parseInt(c.width)<128||parseInt(c.height)<43,e=a.options,f=e.UEDITOR_HOME_URL+"themes/notadd/images/spacer.gif";c.src&&/^(?:(file:\/+))/.test(c.src)&&b.setAttr({width:c.width,height:c.height,alt:c.alt,word_img:c.src,src:f,style:"background:url("+(d?e.themePath+e.theme+"/images/word.gif":e.langPath+e.lang+"/images/localimage.png")+") no-repeat center center;border:1px solid #ddd"})})}}}),UE.plugins.dragdrop=function(){var a=this;a.ready(function(){domUtils.on(this.body,"dragend",function(){var b=a.selection.getRange(),c=b.getClosedNode()||a.selection.getStart();if(c&&"IMG"==c.tagName){for(var d,e=c.previousSibling;(d=c.nextSibling)&&1==d.nodeType&&"SPAN"==d.tagName&&!d.firstChild;)domUtils.remove(d);(!e||1!=e.nodeType||domUtils.isEmptyBlock(e))&&e||d&&(!d||domUtils.isEmptyBlock(d))||(e&&"P"==e.tagName&&!domUtils.isEmptyBlock(e)?(e.appendChild(c),domUtils.moveChild(d,e),domUtils.remove(d)):d&&"P"==d.tagName&&!domUtils.isEmptyBlock(d)&&d.insertBefore(c,d.firstChild),e&&"P"==e.tagName&&domUtils.isEmptyBlock(e)&&domUtils.remove(e),d&&"P"==d.tagName&&domUtils.isEmptyBlock(d)&&domUtils.remove(d),b.selectNode(c).select(),a.fireEvent("saveScene"))}})}),a.addListener("keyup",function(b,c){var d=c.keyCode||c.which;if(13==d){var e,f=a.selection.getRange();(e=domUtils.findParentByTagName(f.startContainer,"p",!0))&&"center"==domUtils.getComputedStyle(e,"text-align")&&domUtils.removeStyle(e,"text-align")}})},UE.plugins.undo=function(){function a(a,b){if(a.length!=b.length)return 0;for(var c=0,d=a.length;cf&&this.list.shift(),this.index=this.list.length-1,this.clearKey(),this.update())},this.update=function(){this.hasRedo=!!this.list[this.index+1],this.hasUndo=!!this.list[this.index-1]},this.reset=function(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.clearKey()},this.clearKey=function(){m=0,k=null}}var d,e=this,f=e.options.maxUndoCount||20,g=e.options.maxInputCount||20,h=new RegExp(domUtils.fillChar+"|","gi"),i={ol:1,ul:1,table:1,tbody:1,tr:1,body:1},j=e.options.autoClearEmptyNode;e.undoManger=new c,e.undoManger.editor=e,e.addListener("saveScene",function(){var a=Array.prototype.splice.call(arguments,1);this.undoManger.save.apply(this.undoManger,a)}),e.addListener("reset",function(a,b){b||this.undoManger.reset()}),e.commands.redo=e.commands.undo={execCommand:function(a){this.undoManger[a]()},queryCommandState:function(a){return this.undoManger["has"+("undo"==a.toLowerCase()?"Undo":"Redo")]?0:-1},notNeedUndo:1};var k,l={16:1,17:1,18:1,37:1,38:1,39:1,40:1},m=0,n=!1;e.addListener("ready",function(){domUtils.on(this.body,"compositionstart",function(){n=!0}),domUtils.on(this.body,"compositionend",function(){n=!1})}),e.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89"});var o=!0;e.addListener("keydown",function(a,b){function c(a){a.undoManger.save(!1,!0),a.fireEvent("selectionchange")}var e=this,f=b.keyCode||b.which;if(!(l[f]||b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)){if(n)return;if(!e.selection.getRange().collapsed)return e.undoManger.save(!1,!0),void(o=!1);0==e.undoManger.list.length&&e.undoManger.save(!0),clearTimeout(d),d=setTimeout(function(){if(n)var a=setInterval(function(){n||(c(e),clearInterval(a))},300);else c(e)},200),k=f,m++,m>=g&&c(e)}}),e.addListener("keyup",function(a,b){var c=b.keyCode||b.which;if(!(l[c]||b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)){if(n)return;o||(this.undoManger.save(!1,!0),o=!0)}}),e.stopCmdUndo=function(){e.__hasEnterExecCommand=!0},e.startCmdUndo=function(){e.__hasEnterExecCommand=!1}},UE.plugin.register("copy",function(){function a(){ZeroClipboard.config({debug:!1,swfPath:b.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.swf"});var a=b.zeroclipboard=new ZeroClipboard;a.on("copy",function(a){var c=a.client,d=b.selection.getRange(),e=document.createElement("div");e.appendChild(d.cloneContents()),c.setText(e.innerText||e.textContent),c.setHtml(e.innerHTML),d.select()}),a.on("mouseover mouseout",function(a){var b=a.target;b&&("mouseover"==a.type?domUtils.addClass(b,"edui-state-hover"):"mouseout"==a.type&&domUtils.removeClasses(b,"edui-state-hover"))}),a.on("wrongflash noflash",function(){ZeroClipboard.destroy()}),b.fireEvent("zeroclipboardready",a)}var b=this;return{bindEvents:{ready:function(){browser.ie||(window.ZeroClipboard?a():utils.loadFile(document,{src:b.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.js",tag:"script",type:"text/javascript",defer:"defer"},function(){a()}))}},commands:{copy:{execCommand:function(a){b.document.execCommand("copy")||alert(b.getLang("copymsg"))}}}}}),UE.plugins.paste=function(){function a(a){var b=this.document;if(!b.getElementById("baidu_pastebin")){var c=this.selection.getRange(),d=c.createBookmark(),e=b.createElement("div");e.id="baidu_pastebin",browser.webkit&&e.appendChild(b.createTextNode(domUtils.fillChar+domUtils.fillChar)),b.body.appendChild(e),d.start.style.display="",e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+domUtils.getXY(d.start).y+"px",c.selectNodeContents(e).select(!0),setTimeout(function(){if(browser.webkit)for(var f,g=0,h=b.querySelectorAll("#baidu_pastebin");f=h[g++];){if(!domUtils.isEmptyNode(f)){e=f;break}domUtils.remove(f)}try{e.parentNode.removeChild(e)}catch(i){}c.moveToBookmark(d).select(!0),a(e)},0)}}function b(a){return a.replace(/<(\/?)([\w\-]+)([^>]*)>/gi,function(a,b,c,d){return c=c.toLowerCase(),{img:1}[c]?a:(d=d.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,function(a,b,c){return{src:1,href:1,name:1}[b.toLowerCase()]?b+"="+c+" ":""}),{span:1,div:1}[c]?"":"<"+b+c+" "+utils.trim(d)+">")})}function c(a){var c;if(a.firstChild){for(var h,i=domUtils.getElementsByTagName(a,"span"),j=0;h=i[j++];)"_baidu_cut_start"!=h.id&&"_baidu_cut_end"!=h.id||domUtils.remove(h);if(browser.webkit){for(var k,l=a.querySelectorAll("div br"),j=0;k=l[j++];){var m=k.parentNode;"DIV"==m.tagName&&1==m.childNodes.length&&(m.innerHTML="


                      ",domUtils.remove(m))}for(var n,o=a.querySelectorAll("#baidu_pastebin"),j=0;n=o[j++];){var p=d.document.createElement("p");for(n.parentNode.insertBefore(p,n);n.firstChild;)p.appendChild(n.firstChild);domUtils.remove(n)}for(var q,r=a.querySelectorAll("meta"),j=0;q=r[j++];)domUtils.remove(q);var l=a.querySelectorAll("br");for(j=0;q=l[j++];)/^apple-/i.test(q.className)&&domUtils.remove(q)}if(browser.gecko){var s=a.querySelectorAll("[_moz_dirty]");for(j=0;q=s[j++];)q.removeAttribute("_moz_dirty")}if(!browser.ie)for(var q,t=a.querySelectorAll("span.Apple-style-span"),j=0;q=t[j++];)domUtils.remove(q,!0);c=a.innerHTML,c=UE.filterWord(c);var u=UE.htmlparser(c);if(d.options.filterRules&&UE.filterNode(u,d.options.filterRules),d.filterInputRule(u),browser.webkit){var v=u.lastChild();v&&"element"==v.type&&"br"==v.tagName&&u.removeChild(v),utils.each(d.body.querySelectorAll("div"),function(a){domUtils.isEmptyBlock(a)&&domUtils.remove(a,!0)})}if(c={html:u.toHtml()},d.fireEvent("beforepaste",c,u),!c.html)return;u=UE.htmlparser(c.html,!0),1===d.queryCommandState("pasteplain")?d.execCommand("insertHtml",UE.filterNode(u,d.options.filterTxtRules).toHtml(),!0):(UE.filterNode(u,d.options.filterTxtRules),e=u.toHtml(),f=c.html,g=d.selection.getRange().createAddress(!0),d.execCommand("insertHtml",d.getOpt("retainOnlyLabelPasted")===!0?b(f):f,!0)),d.fireEvent("afterpaste",c)}}var d=this;d.setOpt({retainOnlyLabelPasted:!1});var e,f,g;d.addListener("pasteTransfer",function(a,c){if(g&&e&&f&&e!=f){var h=d.selection.getRange();if(h.moveToAddress(g,!0),!h.collapsed){for(;!domUtils.isBody(h.startContainer);){var i=h.startContainer;if(1==i.nodeType){if(i=i.childNodes[h.startOffset],!i){h.setStartBefore(h.startContainer);continue}var j=i.previousSibling;j&&3==j.nodeType&&new RegExp("^[\n\r\t "+domUtils.fillChar+"]*$").test(j.nodeValue)&&h.setStartBefore(j)}if(0!=h.startOffset)break;h.setStartBefore(h.startContainer)}for(;!domUtils.isBody(h.endContainer);){var k=h.endContainer;if(1==k.nodeType){if(k=k.childNodes[h.endOffset],!k){h.setEndAfter(h.endContainer);continue}var l=k.nextSibling;l&&3==l.nodeType&&new RegExp("^[\n\r\t"+domUtils.fillChar+"]*$").test(l.nodeValue)&&h.setEndAfter(l)}if(h.endOffset!=h.endContainer[3==h.endContainer.nodeType?"nodeValue":"childNodes"].length)break;h.setEndAfter(h.endContainer)}}h.deleteContents(),h.select(!0),d.__hasEnterExecCommand=!0;var m=f;2===c?m=b(m):c&&(m=e),d.execCommand("inserthtml",m,!0),d.__hasEnterExecCommand=!1;for(var n=d.selection.getRange();!domUtils.isBody(n.startContainer)&&!n.startOffset&&n.startContainer[3==n.startContainer.nodeType?"nodeValue":"childNodes"].length;)n.setStartBefore(n.startContainer);var o=n.createAddress(!0);g.endAddress=o.startAddress}}),d.addListener("ready",function(){domUtils.on(d.body,"cut",function(){var a=d.selection.getRange();!a.collapsed&&d.undoManger&&(d.undoManger.list.length<1&&d.undoManger.save(),setTimeout(function(){d.undoManger.save()}))}),domUtils.on(d.body,browser.ie||browser.opera?"keydown":"paste",function(b){(!browser.ie&&!browser.opera||(b.ctrlKey||b.metaKey)&&"86"==b.keyCode)&&a.call(d,function(a){c(a)})})}),d.commands.paste={execCommand:function(b){browser.ie?(a.call(d,function(a){c(a)}),d.document.execCommand("paste")):alert(d.getLang("pastemsg"))}}},UE.plugins.pasteplain=function(){var a=this;a.setOpt({pasteplain:!1,filterTxtRules:function(){function a(a){a.tagName="p",a.setStyle()}function b(a){a.parentNode.removeChild(a,!0)}return{"-":"script style object iframe embed input select",p:{$:{}},br:{$:{}},div:function(a){for(var b,c=UE.uNode.createElement("p");b=a.firstChild();)"text"!=b.type&&UE.dom.dtd.$block[b.tagName]?c.firstChild()?(a.parentNode.insertBefore(c,a),c=UE.uNode.createElement("p")):a.parentNode.insertBefore(b,a):c.appendChild(b);c.firstChild()&&a.parentNode.insertBefore(c,a),a.parentNode.removeChild(a)},ol:b,ul:b,dl:b,dt:b,dd:b,li:b,caption:a,th:a,tr:a,h1:a,h2:a,h3:a,h4:a,h5:a,h6:a,td:function(a){var b=!!a.innerText();b&&a.parentNode.insertAfter(UE.uNode.createText("    "),a),a.parentNode.removeChild(a,a.innerText())}}}()});var b=a.options.pasteplain;a.commands.pasteplain={queryCommandState:function(){return b?1:0},execCommand:function(){b=0|!b},notNeedUndo:1}},UE.plugins.list=function(){function a(a){var b=[];for(var c in a)b.push(c);return b}function b(a){var b=a.className;return domUtils.hasClass(a,/custom_/)?b.match(/custom_(\w+)/)[1]:domUtils.getStyle(a,"list-style-type")}function c(a,c){utils.each(domUtils.getElementsByTagName(a,"ol ul"),function(f){if(domUtils.inDoc(f,a)){var g=f.parentNode;if(g.tagName==f.tagName){var h=b(f)||("OL"==f.tagName?"decimal":"disc"),i=b(g)||("OL"==g.tagName?"decimal":"disc");if(h==i){var l=utils.indexOf(k[f.tagName],h);l=l+1==k[f.tagName].length?0:l+1,e(f,k[f.tagName][l])}}var m=0,n=2;domUtils.hasClass(f,/custom_/)?/[ou]l/i.test(g.tagName)&&domUtils.hasClass(g,/custom_/)||(n=1):/[ou]l/i.test(g.tagName)&&domUtils.hasClass(g,/custom_/)&&(n=3);var o=domUtils.getStyle(f,"list-style-type");o&&(f.style.cssText="list-style-type:"+o),f.className=utils.trim(f.className.replace(/list-paddingleft-\w+/,""))+" list-paddingleft-"+n,utils.each(domUtils.getElementsByTagName(f,"li"),function(a){if(a.style.cssText&&(a.style.cssText=""),!a.firstChild)return void domUtils.remove(a);if(a.parentNode===f){if(m++,domUtils.hasClass(f,/custom_/)){var c=1,d=b(f);if("OL"==f.tagName){if(d)switch(d){case"cn":case"cn1":case"cn2":m>10&&(m%10==0||m>10&&m<20)?c=2:m>20&&(c=3);break;case"num2":m>9&&(c=2)}a.className="list-"+j[d]+m+" list-"+d+"-paddingleft-"+c}else a.className="list-"+j[d]+" list-"+d+"-paddingleft"}else a.className=a.className.replace(/list-[\w\-]+/gi,"");var e=a.getAttribute("class");null===e||e.replace(/\s/g,"")||domUtils.removeAttributes(a,"class")}}),!c&&d(f,f.tagName.toLowerCase(),b(f)||domUtils.getStyle(f,"list-style-type"),!0)}})}function d(a,d,e,f){var g=a.nextSibling;g&&1==g.nodeType&&g.tagName.toLowerCase()==d&&(b(g)||domUtils.getStyle(g,"list-style-type")||("ol"==d?"decimal":"disc"))==e&&(domUtils.moveChild(g,a),0==g.childNodes.length&&domUtils.remove(g)),g&&domUtils.isFillChar(g)&&domUtils.remove(g);var h=a.previousSibling;h&&1==h.nodeType&&h.tagName.toLowerCase()==d&&(b(h)||domUtils.getStyle(h,"list-style-type")||("ol"==d?"decimal":"disc"))==e&&domUtils.moveChild(a,h),h&&domUtils.isFillChar(h)&&domUtils.remove(h),!f&&domUtils.isEmptyBlock(a)&&domUtils.remove(a),b(a)&&c(a.ownerDocument,!0)}function e(a,b){j[b]&&(a.className="custom_"+b);try{domUtils.setStyle(a,"list-style-type",b)}catch(c){}}function f(a){var b=a.previousSibling;b&&domUtils.isEmptyBlock(b)&&domUtils.remove(b),b=a.nextSibling,b&&domUtils.isEmptyBlock(b)&&domUtils.remove(b)}function g(a){for(;a&&!domUtils.isBody(a);){if("TABLE"==a.nodeName)return null;if("LI"==a.nodeName)return a;a=a.parentNode}}var h=this,i={TD:1,PRE:1,BLOCKQUOTE:1},j={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};h.setOpt({autoTransWordToList:!1,insertorderedlist:{num:"",num1:"",num2:"",cn:"",cn1:"",cn2:"",decimal:"","lower-alpha":"","lower-roman":"","upper-alpha":"","upper-roman":""},insertunorderedlist:{circle:"",disc:"",square:"",dash:"",dot:""},listDefaultPaddingLeft:"30",listiconpath:"http://bs.baidu.com/listicon/",maxListLevel:-1,disablePInList:!1});var k={OL:a(h.options.insertorderedlist),UL:a(h.options.insertunorderedlist)},l=h.options.listiconpath;for(var m in j)h.options.insertorderedlist.hasOwnProperty(m)||h.options.insertunorderedlist.hasOwnProperty(m)||delete j[m];h.ready(function(){var a=[];for(var b in j){if("dash"==b||"dot"==b)a.push("li.list-"+j[b]+"{background-image:url("+l+j[b]+".gif)}"),a.push("ul.custom_"+b+"{list-style:none;}ul.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}");else{for(var c=0;c<99;c++)a.push("li.list-"+j[b]+c+"{background-image:url("+l+"list-"+j[b]+c+".gif)}");a.push("ol.custom_"+b+"{list-style:none;}ol.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(b){case"cn":a.push("li.list-"+b+"-paddingleft-1{padding-left:25px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}"),a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case"cn1":a.push("li.list-"+b+"-paddingleft-1{padding-left:30px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}"),a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case"cn2":a.push("li.list-"+b+"-paddingleft-1{padding-left:40px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:55px}"),a.push("li.list-"+b+"-paddingleft-3{padding-left:68px}");break;case"num":case"num1":a.push("li.list-"+b+"-paddingleft-1{padding-left:25px}");break;case"num2":a.push("li.list-"+b+"-paddingleft-1{padding-left:35px}"),a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}");break;case"dash":a.push("li.list-"+b+"-paddingleft{padding-left:35px}");break;case"dot":a.push("li.list-"+b+"-paddingleft{padding-left:20px}")}}a.push(".list-paddingleft-1{padding-left:0}"),a.push(".list-paddingleft-2{padding-left:"+h.options.listDefaultPaddingLeft+"px}"),a.push(".list-paddingleft-3{padding-left:"+2*h.options.listDefaultPaddingLeft+"px}"),utils.cssRule("list","ol,ul{margin:0;pading:0;"+(browser.ie?"":"width:95%")+"}li{clear:both;}"+a.join("\n"),h.document)}),h.ready(function(){domUtils.on(h.body,"cut",function(){setTimeout(function(){var a,b=h.selection.getRange();if(!b.collapsed&&(a=domUtils.findParentByTagName(b.startContainer,"li",!0))&&!a.nextSibling&&domUtils.isEmptyBlock(a)){var c,d=a.parentNode;if(c=d.previousSibling)domUtils.remove(d),b.setStartAtLast(c).collapse(!0),b.select(!0);else if(c=d.nextSibling)domUtils.remove(d),b.setStartAtFirst(c).collapse(!0),b.select(!0);else{var e=h.document.createElement("p");domUtils.fillNode(h.document,e),d.parentNode.insertBefore(e,d),domUtils.remove(d),b.setStart(e,0).collapse(!0),b.select(!0)}}})})}),h.addListener("beforepaste",function(a,c){var d,e=this,f=e.selection.getRange(),g=UE.htmlparser(c.html,!0);if(d=domUtils.findParentByTagName(f.startContainer,"li",!0)){var h=d.parentNode,i="OL"==h.tagName?"ul":"ol";utils.each(g.getNodesByTagName(i),function(c){if(c.tagName=h.tagName,c.setAttr(),c.parentNode===g)a=b(h)||("OL"==h.tagName?"decimal":"disc");else{var d=c.parentNode.getAttr("class");a=d&&/custom_/.test(d)?d.match(/custom_(\w+)/)[1]:c.parentNode.getStyle("list-style-type"),a||(a="OL"==h.tagName?"decimal":"disc")}var e=utils.indexOf(k[h.tagName],a);c.parentNode!==g&&(e=e+1==k[h.tagName].length?0:e+1);var f=k[h.tagName][e];j[f]?c.setAttr("class","custom_"+f):c.setStyle("list-style-type",f)})}c.html=g.toHtml()}),h.getOpt("disablePInList")===!0&&h.addOutputRule(function(a){utils.each(a.getNodesByTagName("li"),function(a){var b=[],c=0;utils.each(a.children,function(d){if("p"==d.tagName){for(var e;e=d.children.pop();)b.splice(c,0,e),e.parentNode=a,lastNode=e;if(e=b[b.length-1],!e||"element"!=e.type||"br"!=e.tagName){var f=UE.uNode.createElement("br");f.parentNode=a,b.push(f)}c=b.length}}),b.length&&(a.children=b)})}),h.addInputRule(function(a){function b(a,b){var e=b.firstChild();if(e&&"element"==e.type&&"span"==e.tagName&&/Wingdings|Symbol/.test(e.getStyle("font-family"))){for(var f in d)if(d[f]==e.data)return f;return"disc"}for(var f in c)if(c[f].test(a))return f}if(utils.each(a.getNodesByTagName("li"),function(a){for(var b,c=UE.uNode.createElement("p"),d=0;b=a.children[d];)"text"==b.type||dtd.p[b.tagName]?c.appendChild(b):c.firstChild()?(a.insertBefore(c,b),c=UE.uNode.createElement("p"),d+=2):d++;(c.firstChild()&&!c.parentNode||!a.firstChild())&&a.appendChild(c),c.firstChild()||c.innerHTML(browser.ie?" ":"
                      ");var e=a.firstChild(),f=e.lastChild();f&&"text"==f.type&&/^\s*$/.test(f.data)&&e.removeChild(f)}),h.options.autoTransWordToList){var c={num1:/^\d+\)/,decimal:/^\d+\./,"lower-alpha":/^[a-z]+\)/,"upper-alpha":/^[A-Z]+\./,cn:/^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/,cn2:/^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/},d={square:"n"};utils.each(a.getNodesByTagName("p"),function(a){function d(a,b,d){if("ol"==a.tagName)if(browser.ie){var e=b.firstChild();"element"==e.type&&"span"==e.tagName&&c[d].test(e.innerText())&&b.removeChild(e)}else b.innerHTML(b.innerHTML().replace(c[d],""));else b.removeChild(b.firstChild());var f=UE.uNode.createElement("li");f.appendChild(b),a.appendChild(f)}if("MsoListParagraph"==a.getAttr("class")){a.setStyle("margin",""),a.setStyle("margin-left",""),a.setAttr("class","");var e,f=a,g=a;if("li"!=a.parentNode.tagName&&(e=b(a.innerText(),a))){var i=UE.uNode.createElement(h.options.insertorderedlist.hasOwnProperty(e)?"ol":"ul");for(j[e]?i.setAttr("class","custom_"+e):i.setStyle("list-style-type",e);a&&"li"!=a.parentNode.tagName&&b(a.innerText(),a);)f=a.nextSibling(),f||a.parentNode.insertBefore(i,a),d(i,a,e),a=f;!i.parentNode&&a&&a.parentNode&&a.parentNode.insertBefore(i,a)}var k=g.firstChild();k&&"element"==k.type&&"span"==k.tagName&&/^\s*( )+\s*$/.test(k.innerText())&&k.parentNode.removeChild(k)}})}}),h.addListener("contentchange",function(){c(h.document)}),h.addListener("keydown",function(a,b){function c(){b.preventDefault?b.preventDefault():b.returnValue=!1,h.fireEvent("contentchange"),h.undoManger&&h.undoManger.save()}function d(a,b){for(;a&&!domUtils.isBody(a);){if(b(a))return null;if(1==a.nodeType&&/[ou]l/i.test(a.tagName))return a;a=a.parentNode}return null}var e=b.keyCode||b.which;if(13==e&&!b.shiftKey){var g=h.selection.getRange(),i=domUtils.findParent(g.startContainer,function(a){return domUtils.isBlockElm(a)},!0),j=domUtils.findParentByTagName(g.startContainer,"li",!0);if(i&&"PRE"!=i.tagName&&!j){var k=i.innerHTML.replace(new RegExp(domUtils.fillChar,"g"),"");/^\s*1\s*\.[^\d]/.test(k)&&(i.innerHTML=k.replace(/^\s*1\s*\./,""),g.setStartAtLast(i).collapse(!0).select(),h.__hasEnterExecCommand=!0,h.execCommand("insertorderedlist"),h.__hasEnterExecCommand=!1)}var l=h.selection.getRange(),m=d(l.startContainer,function(a){return"TABLE"==a.tagName}),n=l.collapsed?m:d(l.endContainer,function(a){return"TABLE"==a.tagName});if(m&&n&&m===n){ -if(!l.collapsed){if(m=domUtils.findParentByTagName(l.startContainer,"li",!0),n=domUtils.findParentByTagName(l.endContainer,"li",!0),!m||!n||m!==n){var o=l.cloneRange(),p=o.collapse(!1).createBookmark();l.deleteContents(),o.moveToBookmark(p);var j=domUtils.findParentByTagName(o.startContainer,"li",!0);return f(j),o.select(),void c()}if(l.deleteContents(),j=domUtils.findParentByTagName(l.startContainer,"li",!0),j&&domUtils.isEmptyBlock(j))return v=j.previousSibling,next=j.nextSibling,s=h.document.createElement("p"),domUtils.fillNode(h.document,s),q=j.parentNode,v&&next?(l.setStart(next,0).collapse(!0).select(!0),domUtils.remove(j)):((v||next)&&v?j.parentNode.parentNode.insertBefore(s,q.nextSibling):q.parentNode.insertBefore(s,q),domUtils.remove(j),q.firstChild||domUtils.remove(q),l.setStart(s,0).setCursor()),void c()}if(j=domUtils.findParentByTagName(l.startContainer,"li",!0)){if(domUtils.isEmptyBlock(j)){p=l.createBookmark();var q=j.parentNode;if(j!==q.lastChild?(domUtils.breakParent(j,q),f(j)):(q.parentNode.insertBefore(j,q.nextSibling),domUtils.isEmptyNode(q)&&domUtils.remove(q)),!dtd.$list[j.parentNode.tagName])if(domUtils.isBlockElm(j.firstChild))domUtils.remove(j,!0);else{for(s=h.document.createElement("p"),j.parentNode.insertBefore(s,j);j.firstChild;)s.appendChild(j.firstChild);domUtils.remove(j)}l.moveToBookmark(p).select()}else{var r=j.firstChild;if(!r||!domUtils.isBlockElm(r)){var s=h.document.createElement("p");for(!j.firstChild&&domUtils.fillNode(h.document,s);j.firstChild;)s.appendChild(j.firstChild);j.appendChild(s),r=s}var t=h.document.createElement("span");l.insertNode(t),domUtils.breakParent(t,j);var u=t.nextSibling;r=u.firstChild,r||(s=h.document.createElement("p"),domUtils.fillNode(h.document,s),u.appendChild(s),r=s),domUtils.isEmptyNode(r)&&(r.innerHTML="",domUtils.fillNode(h.document,r)),l.setStart(r,0).collapse(!0).shrinkBoundary().select(),domUtils.remove(t);var v=u.previousSibling;v&&domUtils.isEmptyBlock(v)&&(v.innerHTML="

                      ",domUtils.fillNode(h.document,v.firstChild))}c()}}}if(8==e&&(l=h.selection.getRange(),l.collapsed&&domUtils.isStartInblock(l)&&(o=l.cloneRange().trimBoundary(),j=domUtils.findParentByTagName(l.startContainer,"li",!0),j&&domUtils.isStartInblock(o)))){if(m=domUtils.findParentByTagName(l.startContainer,"p",!0),m&&m!==j.firstChild){var q=domUtils.findParentByTagName(m,["ol","ul"]);return domUtils.breakParent(m,q),f(m),h.fireEvent("contentchange"),l.setStart(m,0).setCursor(!1,!0),h.fireEvent("saveScene"),void domUtils.preventDefault(b)}if(j&&(v=j.previousSibling)){if(46==e&&j.childNodes.length)return;if(dtd.$list[v.tagName]&&(v=v.lastChild),h.undoManger&&h.undoManger.save(),r=j.firstChild,domUtils.isBlockElm(r))if(domUtils.isEmptyNode(r))for(v.appendChild(r),l.setStart(r,0).setCursor(!1,!0);j.firstChild;)v.appendChild(j.firstChild);else t=h.document.createElement("span"),l.insertNode(t),domUtils.isEmptyBlock(v)&&(v.innerHTML=""),domUtils.moveChild(j,v),l.setStartBefore(t).collapse(!0).select(!0),domUtils.remove(t);else if(domUtils.isEmptyNode(j)){var s=h.document.createElement("p");v.appendChild(s),l.setStart(s,0).setCursor()}else for(l.setEnd(v,v.childNodes.length).collapse().select(!0);j.firstChild;)v.appendChild(j.firstChild);return domUtils.remove(j),h.fireEvent("contentchange"),h.fireEvent("saveScene"),void domUtils.preventDefault(b)}if(j&&!j.previousSibling){var q=j.parentNode,p=l.createBookmark();if(domUtils.isTagNode(q.parentNode,"ol ul"))q.parentNode.insertBefore(j,q),domUtils.isEmptyNode(q)&&domUtils.remove(q);else{for(;j.firstChild;)q.parentNode.insertBefore(j.firstChild,q);domUtils.remove(j),domUtils.isEmptyNode(q)&&domUtils.remove(q)}return l.moveToBookmark(p).setCursor(!1,!0),h.fireEvent("contentchange"),h.fireEvent("saveScene"),void domUtils.preventDefault(b)}}}),h.addListener("keyup",function(a,c){var e=c.keyCode||c.which;if(8==e){var f,g=h.selection.getRange();(f=domUtils.findParentByTagName(g.startContainer,["ol","ul"],!0))&&d(f,f.tagName.toLowerCase(),b(f)||domUtils.getComputedStyle(f,"list-style-type"),!0)}}),h.addListener("tabkeydown",function(){function a(a){if(h.options.maxListLevel!=-1){for(var b=a.parentNode,c=0;/[ou]l/i.test(b.tagName);)c++,b=b.parentNode;if(c>=h.options.maxListLevel)return!0}}var c=h.selection.getRange(),f=domUtils.findParentByTagName(c.startContainer,"li",!0);if(f){var g;if(!c.collapsed){h.fireEvent("saveScene"),g=c.createBookmark();for(var i,j,l=0,m=domUtils.findParents(f);j=m[l++];)if(domUtils.isTagNode(j,"ol ul")){i=j;break}var n=f;if(g.end)for(;n&&!(domUtils.getPosition(n,g.end)&domUtils.POSITION_FOLLOWING);)if(a(n))n=domUtils.getNextDomNode(n,!1,null,function(a){return a!==i});else{var o=n.parentNode,p=h.document.createElement(o.tagName),q=utils.indexOf(k[p.tagName],b(o)||domUtils.getComputedStyle(o,"list-style-type")),r=q+1==k[p.tagName].length?0:q+1,s=k[p.tagName][r];for(e(p,s),o.insertBefore(p,n);n&&!(domUtils.getPosition(n,g.end)&domUtils.POSITION_FOLLOWING);){if(f=n.nextSibling,p.appendChild(n),!f||domUtils.isTagNode(f,"ol ul")){if(f)for(;(f=f.firstChild)&&"LI"!=f.tagName;);else f=domUtils.getNextDomNode(n,!1,null,function(a){return a!==i});break}n=f}d(p,p.tagName.toLowerCase(),s),n=f}return h.fireEvent("contentchange"),c.moveToBookmark(g).select(),!0}if(a(f))return!0;var o=f.parentNode,p=h.document.createElement(o.tagName),q=utils.indexOf(k[p.tagName],b(o)||domUtils.getComputedStyle(o,"list-style-type"));q=q+1==k[p.tagName].length?0:q+1;var s=k[p.tagName][q];if(e(p,s),domUtils.isStartInblock(c))return h.fireEvent("saveScene"),g=c.createBookmark(),o.insertBefore(p,f),p.appendChild(f),d(p,p.tagName.toLowerCase(),s),h.fireEvent("contentchange"),c.moveToBookmark(g).select(!0),!0}}),h.commands.insertorderedlist=h.commands.insertunorderedlist={execCommand:function(a,c){c||(c="insertorderedlist"==a.toLowerCase()?"decimal":"disc");var f=this,h=this.selection.getRange(),j=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!domUtils.isWhitespace(a)},k="insertorderedlist"==a.toLowerCase()?"ol":"ul",l=f.document.createDocumentFragment();h.adjustmentBoundary().shrinkBoundary();var m,n,o,p,q=h.createBookmark(!0),r=g(f.document.getElementById(q.start)),s=0,t=g(f.document.getElementById(q.end)),u=0;if(r||t){if(r&&(m=r.parentNode),q.end||(t=r),t&&(n=t.parentNode),m===n){for(;r!==t;){if(p=r,r=r.nextSibling,!domUtils.isBlockElm(p.firstChild)){for(var v=f.document.createElement("p");p.firstChild;)v.appendChild(p.firstChild);p.appendChild(v)}l.appendChild(p)}if(p=f.document.createElement("span"),m.insertBefore(p,t),!domUtils.isBlockElm(t.firstChild)){for(v=f.document.createElement("p");t.firstChild;)v.appendChild(t.firstChild);t.appendChild(v)}l.appendChild(t),domUtils.breakParent(p,m),domUtils.isEmptyNode(p.previousSibling)&&domUtils.remove(p.previousSibling),domUtils.isEmptyNode(p.nextSibling)&&domUtils.remove(p.nextSibling);var w=b(m)||domUtils.getComputedStyle(m,"list-style-type")||("insertorderedlist"==a.toLowerCase()?"decimal":"disc");if(m.tagName.toLowerCase()==k&&w==c){for(var x,y=0,z=f.document.createDocumentFragment();x=l.firstChild;)if(domUtils.isTagNode(x,"ol ul"))z.appendChild(x);else for(;x.firstChild;)z.appendChild(x.firstChild),domUtils.remove(x);p.parentNode.insertBefore(z,p)}else o=f.document.createElement(k),e(o,c),o.appendChild(l),p.parentNode.insertBefore(o,p);return domUtils.remove(p),o&&d(o,k,c),void h.moveToBookmark(q).select()}if(r){for(;r;){if(p=r.nextSibling,domUtils.isTagNode(r,"ol ul"))l.appendChild(r);else{for(var A=f.document.createDocumentFragment(),B=0;r.firstChild;)domUtils.isBlockElm(r.firstChild)&&(B=1),A.appendChild(r.firstChild);if(B)l.appendChild(A);else{var C=f.document.createElement("p");C.appendChild(A),l.appendChild(C)}domUtils.remove(r)}r=p}m.parentNode.insertBefore(l,m.nextSibling),domUtils.isEmptyNode(m)?(h.setStartBefore(m),domUtils.remove(m)):h.setStartAfter(m),s=1}if(t&&domUtils.inDoc(n,f.document)){for(r=n.firstChild;r&&r!==t;){if(p=r.nextSibling,domUtils.isTagNode(r,"ol ul"))l.appendChild(r);else{for(A=f.document.createDocumentFragment(),B=0;r.firstChild;)domUtils.isBlockElm(r.firstChild)&&(B=1),A.appendChild(r.firstChild);B?l.appendChild(A):(C=f.document.createElement("p"),C.appendChild(A),l.appendChild(C)),domUtils.remove(r)}r=p}var D=domUtils.createElement(f.document,"div",{tmpDiv:1});domUtils.moveChild(t,D),l.appendChild(D),domUtils.remove(t),n.parentNode.insertBefore(l,n),h.setEndBefore(n),domUtils.isEmptyNode(n)&&domUtils.remove(n),u=1}}s||h.setStartBefore(f.document.getElementById(q.start)),q.end&&!u&&h.setEndAfter(f.document.getElementById(q.end)),h.enlarge(!0,function(a){return i[a.tagName]}),l=f.document.createDocumentFragment();for(var E,F=h.createBookmark(),G=domUtils.getNextDomNode(F.start,!1,j),H=h.cloneRange(),I=domUtils.isBlockElm;G&&G!==F.end&&domUtils.getPosition(G,F.end)&domUtils.POSITION_PRECEDING;)if(3==G.nodeType||dtd.li[G.tagName]){if(1==G.nodeType&&dtd.$list[G.tagName]){for(;G.firstChild;)l.appendChild(G.firstChild);E=domUtils.getNextDomNode(G,!1,j),domUtils.remove(G),G=E;continue}for(E=G,H.setStartBefore(G);G&&G!==F.end&&(!I(G)||domUtils.isBookmarkNode(G));)E=G,G=domUtils.getNextDomNode(G,!1,null,function(a){return!i[a.tagName]});G&&I(G)&&(p=domUtils.getNextDomNode(E,!1,j),p&&domUtils.isBookmarkNode(p)&&(G=domUtils.getNextDomNode(p,!1,j),E=p)),H.setEndAfter(E),G=domUtils.getNextDomNode(E,!1,j);var J=h.document.createElement("li");if(J.appendChild(H.extractContents()),domUtils.isEmptyNode(J)){for(var E=h.document.createElement("p");J.firstChild;)E.appendChild(J.firstChild);J.appendChild(E)}l.appendChild(J)}else G=domUtils.getNextDomNode(G,!0,j);h.moveToBookmark(F).collapse(!0),o=f.document.createElement(k),e(o,c),o.appendChild(l),h.insertNode(o),d(o,k,c);for(var x,y=0,K=domUtils.getElementsByTagName(o,"div");x=K[y++];)x.getAttribute("tmpDiv")&&domUtils.remove(x,!0);h.moveToBookmark(q).select()},queryCommandState:function(a){for(var b,c="insertorderedlist"==a.toLowerCase()?"ol":"ul",d=this.selection.getStartElementPath(),e=0;b=d[e++];){if("TABLE"==b.nodeName)return 0;if(c==b.nodeName.toLowerCase())return 1}return 0},queryCommandValue:function(a){for(var c,d,e="insertorderedlist"==a.toLowerCase()?"ol":"ul",f=this.selection.getStartElementPath(),g=0;d=f[g++];){if("TABLE"==d.nodeName){c=null;break}if(e==d.nodeName.toLowerCase()){c=d;break}}return c?b(c)||domUtils.getComputedStyle(c,"list-style-type"):null}}},function(){var a={textarea:function(a,b){var c=b.ownerDocument.createElement("textarea");return c.style.cssText="position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;",browser.ie&&browser.version<8&&(c.style.width=b.offsetWidth+"px",c.style.height=b.offsetHeight+"px",b.onresize=function(){c.style.width=b.offsetWidth+"px",c.style.height=b.offsetHeight+"px"}),b.appendChild(c),{setContent:function(a){c.value=a},getContent:function(){return c.value},select:function(){var a;browser.ie?(a=c.createTextRange(),a.collapse(!0),a.select()):(c.setSelectionRange(0,0),c.focus())},dispose:function(){b.removeChild(c),b.onresize=null,c=null,b=null},focus:function(){c.focus()},blur:function(){c.blur()}}},codemirror:function(a,b){var c=window.CodeMirror(b,{mode:"text/html",tabMode:"indent",lineNumbers:!0,lineWrapping:!0}),d=c.getWrapperElement();return d.style.cssText='position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;',c.getScrollerElement().style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;",c.refresh(),{getCodeMirror:function(){return c},setContent:function(a){c.setValue(a)},getContent:function(){return c.getValue()},select:function(){c.focus()},dispose:function(){b.removeChild(d),d=null,c=null},focus:function(){c.focus()},blur:function(){c.setOption("readOnly",!0),c.setOption("readOnly",!1)}}}};UE.plugins.source=function(){function b(b){return a["codemirror"==h.sourceEditor&&window.CodeMirror?"codemirror":"textarea"](g,b)}var c,d,e,f,g=this,h=this.options,i=!1;h.sourceEditor=browser.ie?"textarea":h.sourceEditor||"codemirror",g.setOpt({sourceEditorFirst:!1});var j,k,l;g.commands.source={execCommand:function(){if(i=!i){l=g.selection.getRange().createAddress(!1,!0),g.undoManger&&g.undoManger.save(!0),browser.gecko&&(g.body.contentEditable=!1),j=g.iframe.style.cssText,g.iframe.style.cssText+="position:absolute;left:-32768px;top:-32768px;",g.fireEvent("beforegetcontent");var a=UE.htmlparser(g.body.innerHTML);g.filterOutputRule(a),a.traversal(function(a){if("element"==a.type)switch(a.tagName){case"td":case"th":case"caption":a.children&&1==a.children.length&&"br"==a.firstChild().tagName&&a.removeChild(a.firstChild());break;case"pre":a.innerText(a.innerText().replace(/ /g," "))}}),g.fireEvent("aftergetcontent");var h=a.toHtml(!0);c=b(g.iframe.parentNode),c.setContent(h),d=g.setContent,g.setContent=function(a){var b=UE.htmlparser(a);g.filterInputRule(b),a=b.toHtml(),c.setContent(a)},setTimeout(function(){c.select(),g.addListener("fullscreenchanged",function(){try{c.getCodeMirror().refresh()}catch(a){}})}),k=g.getContent,g.getContent=function(){return c.getContent()||"

                      "+(browser.ie?"":"
                      ")+"

                      "},e=g.focus,f=g.blur,g.focus=function(){c.focus()},g.blur=function(){f.call(g),c.blur()}}else{g.iframe.style.cssText=j;var m=c.getContent()||"

                      "+(browser.ie?"":"
                      ")+"

                      ";m=m.replace(new RegExp("[\\r\\t\\n ]*]*)>","g"),function(a,b){return b&&!dtd.$inlineWithA[b.toLowerCase()]?a.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g,""):a.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g,"")}),g.setContent=d,g.setContent(m),c.dispose(),c=null,g.getContent=k,g.focus=e,g.blur=f;var n=g.body.firstChild;if(n||(g.body.innerHTML="

                      "+(browser.ie?"":"
                      ")+"

                      ",n=g.body.firstChild),g.undoManger&&g.undoManger.save(!0),browser.gecko){var o=document.createElement("input");o.style.cssText="position:absolute;left:0;top:-32768px",document.body.appendChild(o),g.body.contentEditable=!1,setTimeout(function(){domUtils.setViewportOffset(o,{left:-32768,top:0}),o.focus(),setTimeout(function(){g.body.contentEditable=!0,g.selection.getRange().moveToAddress(l).select(!0),domUtils.remove(o)})})}else try{g.selection.getRange().moveToAddress(l).select(!0)}catch(p){}}this.fireEvent("sourcemodechanged",i)},queryCommandState:function(){return 0|i},notNeedUndo:1};var m=g.queryCommandState;g.queryCommandState=function(a){return a=a.toLowerCase(),i?a in{source:1,fullscreen:1}?1:-1:m.apply(this,arguments)},"codemirror"==h.sourceEditor&&g.addListener("ready",function(){utils.loadFile(document,{src:h.codeMirrorJsUrl||h.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.js",tag:"script",type:"text/javascript",defer:"defer"},function(){h.sourceEditorFirst&&setTimeout(function(){g.execCommand("source")},0)}),utils.loadFile(document,{tag:"link",rel:"stylesheet",type:"text/css",href:h.codeMirrorCssUrl||h.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.css"})})}}(),UE.plugins.enterkey=function(){var a,b=this,c=b.options.enterTag;b.addListener("keyup",function(c,d){var e=d.keyCode||d.which;if(13==e){var f,g=b.selection.getRange(),h=g.startContainer;if(browser.ie)b.fireEvent("saveScene",!0,!0);else{if(/h\d/i.test(a)){if(browser.gecko){var i=domUtils.findParentByTagName(h,["h1","h2","h3","h4","h5","h6","blockquote","caption","table"],!0);i||(b.document.execCommand("formatBlock",!1,"

                      "),f=1)}else if(1==h.nodeType){var j,k=b.document.createTextNode("");if(g.insertNode(k),j=domUtils.findParentByTagName(k,"div",!0)){for(var l=b.document.createElement("p");j.firstChild;)l.appendChild(j.firstChild);j.parentNode.insertBefore(l,j),domUtils.remove(j),g.setStartBefore(k).setCursor(),f=1}domUtils.remove(k)}b.undoManger&&f&&b.undoManger.save()}browser.opera&&g.select()}}}),b.addListener("keydown",function(d,e){var f=e.keyCode||e.which;if(13==f){if(b.fireEvent("beforeenterkeydown"))return void domUtils.preventDefault(e);b.fireEvent("saveScene",!0,!0),a="";var g=b.selection.getRange();if(!g.collapsed){var h=g.startContainer,i=g.endContainer,j=domUtils.findParentByTagName(h,"td",!0),k=domUtils.findParentByTagName(i,"td",!0);if(j&&k&&j!==k||!j&&k||j&&!k)return void(e.preventDefault?e.preventDefault():e.returnValue=!1)}if("p"==c)browser.ie||(h=domUtils.findParentByTagName(g.startContainer,["ol","ul","p","h1","h2","h3","h4","h5","h6","blockquote","caption"],!0),h||browser.opera?(a=h.tagName,"p"==h.tagName.toLowerCase()&&browser.gecko&&domUtils.removeDirtyAttr(h)):(b.document.execCommand("formatBlock",!1,"

                      "),browser.gecko&&(g=b.selection.getRange(),h=domUtils.findParentByTagName(g.startContainer,"p",!0),h&&domUtils.removeDirtyAttr(h))));else if(e.preventDefault?e.preventDefault():e.returnValue=!1,g.collapsed){m=g.document.createElement("br"),g.insertNode(m);var l=m.parentNode;l.lastChild===m?(m.parentNode.insertBefore(m.cloneNode(!0),m),g.setStartBefore(m)):g.setStartAfter(m),g.setCursor()}else if(g.deleteContents(),h=g.startContainer,1==h.nodeType&&(h=h.childNodes[g.startOffset])){for(;1==h.nodeType;){if(dtd.$empty[h.tagName])return g.setStartBefore(h).setCursor(),b.undoManger&&b.undoManger.save(),!1;if(!h.firstChild){var m=g.document.createElement("br");return h.appendChild(m),g.setStart(h,0).setCursor(),b.undoManger&&b.undoManger.save(),!1}h=h.firstChild}h===g.startContainer.childNodes[g.startOffset]?(m=g.document.createElement("br"),g.insertNode(m).setCursor()):g.setStart(h,0).setCursor()}else m=g.document.createElement("br"),g.insertNode(m).setStartAfter(m).setCursor()}})},UE.plugins.keystrokes=function(){var a=this,b=!0;a.addListener("keydown",function(c,d){var e=d.keyCode||d.which,f=a.selection.getRange();if(!f.collapsed&&!(d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)&&(e>=65&&e<=90||e>=48&&e<=57||e>=96&&e<=111||{13:1,8:1,46:1}[e])){var g=f.startContainer;if(domUtils.isFillChar(g)&&f.setStartBefore(g),g=f.endContainer,domUtils.isFillChar(g)&&f.setEndAfter(g),f.txtToElmBoundary(),f.endContainer&&1==f.endContainer.nodeType&&(g=f.endContainer.childNodes[f.endOffset],g&&domUtils.isBr(g)&&f.setEndAfter(g)),0==f.startOffset&&(g=f.startContainer,domUtils.isBoundaryNode(g,"firstChild")&&(g=f.endContainer,f.endOffset==(3==g.nodeType?g.nodeValue.length:g.childNodes.length)&&domUtils.isBoundaryNode(g,"lastChild"))))return a.fireEvent("saveScene"),a.body.innerHTML="

                      "+(browser.ie?"":"
                      ")+"

                      ",f.setStart(a.body.firstChild,0).setCursor(!1,!0),void a._selectionChange()}if(e==keymap.Backspace){if(f=a.selection.getRange(),b=f.collapsed,a.fireEvent("delkeydown",d))return;var h,i;if(f.collapsed&&f.inFillChar()&&(h=f.startContainer,domUtils.isFillChar(h)?(f.setStartBefore(h).shrinkBoundary(!0).collapse(!0),domUtils.remove(h)):(h.nodeValue=h.nodeValue.replace(new RegExp("^"+domUtils.fillChar),""),f.startOffset--,f.collapse(!0).select(!0))),h=f.getClosedNode())return a.fireEvent("saveScene"),f.setStartBefore(h),domUtils.remove(h),f.setCursor(),a.fireEvent("saveScene"),void domUtils.preventDefault(d);if(!browser.ie&&(h=domUtils.findParentByTagName(f.startContainer,"table",!0),i=domUtils.findParentByTagName(f.endContainer,"table",!0),h&&!i||!h&&i||h!==i))return void d.preventDefault()}if(e==keymap.Tab){var j={ol:1,ul:1,table:1};if(a.fireEvent("tabkeydown",d))return void domUtils.preventDefault(d);var k=a.selection.getRange();a.fireEvent("saveScene");for(var l=0,m="",n=a.options.tabSize||4,o=a.options.tabNode||" ";l"});d.insertNode(g).setStart(g,0).setCursor(!1,!0)}}if(!b&&(3==d.startContainer.nodeType||1==d.startContainer.nodeType&&domUtils.isEmptyBlock(d.startContainer)))if(browser.ie){var k=d.document.createElement("span");d.insertNode(k).setStartBefore(k).collapse(!0),d.select(),domUtils.remove(k)}else d.select()}})},UE.plugins.fiximgclick=function(){function a(){this.editor=null,this.resizer=null,this.cover=null,this.doc=document,this.prePos={x:0,y:0},this.startPos={x:0,y:0}}var b=!1;return function(){var c=[[0,0,-1,-1],[0,0,0,-1],[0,0,1,-1],[0,0,-1,0],[0,0,1,0],[0,0,-1,1],[0,0,0,1],[0,0,1,1]];a.prototype={init:function(a){var b=this;b.editor=a,b.startPos=this.prePos={x:0,y:0},b.dragId=-1;var c=[],d=b.cover=document.createElement("div"),e=b.resizer=document.createElement("div");for(d.id=b.editor.ui.id+"_imagescale_cover",d.style.cssText="position:absolute;display:none;z-index:"+b.editor.options.zIndex+";filter:alpha(opacity=0); opacity:0;background:#CCC;",domUtils.on(d,"mousedown click",function(){b.hide()}),i=0;i<8;i++)c.push('');e.id=b.editor.ui.id+"_imagescale",e.className="edui-editor-imagescale",e.innerHTML=c.join(""),e.style.cssText+=";display:none;border:1px solid #3b77ff;z-index:"+b.editor.options.zIndex+";",b.editor.ui.getDom().appendChild(d),b.editor.ui.getDom().appendChild(e),b.initStyle(),b.initEvents()},initStyle:function(){utils.cssRule("imagescale",".edui-editor-imagescale{display:none;position:absolute;border:1px solid #38B2CE;cursor:hand;-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}.edui-editor-imagescale span{position:absolute;width:6px;height:6px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}.edui-editor-imagescale .edui-editor-imagescale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}")},initEvents:function(){var a=this;a.startPos.x=a.startPos.y=0,a.isDraging=!1},_eventHandler:function(a){var c=this;switch(a.type){case"mousedown":var d,d=a.target||a.srcElement;d.className.indexOf("edui-editor-imagescale-hand")!=-1&&c.dragId==-1&&(c.dragId=d.className.slice(-1),c.startPos.x=c.prePos.x=a.clientX,c.startPos.y=c.prePos.y=a.clientY,domUtils.on(c.doc,"mousemove",c.proxy(c._eventHandler,c)));break;case"mousemove":c.dragId!=-1&&(c.updateContainerStyle(c.dragId,{x:a.clientX-c.prePos.x,y:a.clientY-c.prePos.y}),c.prePos.x=a.clientX,c.prePos.y=a.clientY,b=!0,c.updateTargetElement());break;case"mouseup":c.dragId!=-1&&(c.updateContainerStyle(c.dragId,{x:a.clientX-c.prePos.x,y:a.clientY-c.prePos.y}),c.updateTargetElement(),c.target.parentNode&&c.attachTo(c.target),c.dragId=-1),domUtils.un(c.doc,"mousemove",c.proxy(c._eventHandler,c)),b&&(b=!1,c.editor.fireEvent("contentchange"))}},updateTargetElement:function(){var a=this;domUtils.setStyles(a.target,{width:a.resizer.style.width,height:a.resizer.style.height}),a.target.width=parseInt(a.resizer.style.width),a.target.height=parseInt(a.resizer.style.height),a.attachTo(a.target)},updateContainerStyle:function(a,b){var d,e=this,f=e.resizer;0!=c[a][0]&&(d=parseInt(f.style.left)+b.x,f.style.left=e._validScaledProp("left",d)+"px"),0!=c[a][1]&&(d=parseInt(f.style.top)+b.y,f.style.top=e._validScaledProp("top",d)+"px"),0!=c[a][2]&&(d=f.clientWidth+c[a][2]*b.x,f.style.width=e._validScaledProp("width",d)+"px"),0!=c[a][3]&&(d=f.clientHeight+c[a][3]*b.y,f.style.height=e._validScaledProp("height",d)+"px")},_validScaledProp:function(a,b){var c=this.resizer,d=document;switch(b=isNaN(b)?0:b,a){case"left":return b<0?0:b+c.clientWidth>d.clientWidth?d.clientWidth-c.clientWidth:b;case"top":return b<0?0:b+c.clientHeight>d.clientHeight?d.clientHeight-c.clientHeight:b;case"width":return b<=0?1:b+c.offsetLeft>d.clientWidth?d.clientWidth-c.offsetLeft:b;case"height":return b<=0?1:b+c.offsetTop>d.clientHeight?d.clientHeight-c.offsetTop:b}},hideCover:function(){this.cover.style.display="none"},showCover:function(){var a=this,b=domUtils.getXY(a.editor.ui.getDom()),c=domUtils.getXY(a.editor.iframe);domUtils.setStyles(a.cover,{width:a.editor.iframe.offsetWidth+"px",height:a.editor.iframe.offsetHeight+"px",top:c.y-b.y+"px",left:c.x-b.x+"px",position:"absolute",display:""})},show:function(a){var b=this;b.resizer.style.display="block",a&&b.attachTo(a),domUtils.on(this.resizer,"mousedown",b.proxy(b._eventHandler,b)),domUtils.on(b.doc,"mouseup",b.proxy(b._eventHandler,b)),b.showCover(),b.editor.fireEvent("afterscaleshow",b),b.editor.fireEvent("saveScene")},hide:function(){var a=this;a.hideCover(),a.resizer.style.display="none",domUtils.un(a.resizer,"mousedown",a.proxy(a._eventHandler,a)),domUtils.un(a.doc,"mouseup",a.proxy(a._eventHandler,a)),a.editor.fireEvent("afterscalehide",a)},proxy:function(a,b){return function(c){return a.apply(b||this,arguments)}},attachTo:function(a){var b=this,c=b.target=a,d=this.resizer,e=domUtils.getXY(c),f=domUtils.getXY(b.editor.iframe),g=domUtils.getXY(d.parentNode),h=b.editor.document;domUtils.setStyles(d,{width:c.width+"px",height:c.height+"px",left:f.x+e.x-(h.documentElement.scrollLeft||h.body.scrollLeft||0)-g.x-parseInt(d.style.borderLeftWidth)+"px",top:f.y+e.y-(h.documentElement.scrollTop||h.body.scrollTop||0)-g.y-parseInt(d.style.borderTopWidth)+"px"})}}}(),function(){var b,c=this;c.setOpt("imageScaleEnabled",!0),!browser.ie&&c.options.imageScaleEnabled&&c.addListener("click",function(d,e){var f=c.selection.getRange(),g=f.getClosedNode();if(g&&"IMG"==g.tagName&&"false"!=c.body.contentEditable){if(g.className.indexOf("edui-faked-music")!=-1||g.getAttribute("anchorname")||domUtils.hasClass(g,"loadingclass")||domUtils.hasClass(g,"loaderrorclass"))return;if(!b){b=new a,b.init(c),c.ui.getDom().appendChild(b.resizer);var h,i=function(a){b.hide(),b.target&&c.selection.getRange().selectNode(b.target).select()},j=function(a){var b=a.target||a.srcElement;!b||void 0!==b.className&&b.className.indexOf("edui-editor-imagescale")!=-1||i(a)};c.addListener("afterscaleshow",function(a){c.addListener("beforekeydown",i),c.addListener("beforemousedown",j),domUtils.on(document,"keydown",i),domUtils.on(document,"mousedown",j),c.selection.getNative().removeAllRanges()}),c.addListener("afterscalehide",function(a){c.removeListener("beforekeydown",i),c.removeListener("beforemousedown",j),domUtils.un(document,"keydown",i),domUtils.un(document,"mousedown",j);var d=b.target;d.parentNode&&c.selection.getRange().selectNode(d).select()}),domUtils.on(b.resizer,"mousedown",function(a){c.selection.getNative().removeAllRanges();var d=a.target||a.srcElement;d&&d.className.indexOf("edui-editor-imagescale-hand")==-1&&(h=setTimeout(function(){b.hide(),b.target&&c.selection.getRange().selectNode(d).select()},200))}),domUtils.on(b.resizer,"mouseup",function(a){var b=a.target||a.srcElement;b&&b.className.indexOf("edui-editor-imagescale-hand")==-1&&clearTimeout(h)})}b.show(g)}else b&&"none"!=b.resizer.style.display&&b.hide()}),browser.webkit&&c.addListener("click",function(a,b){if("IMG"==b.target.tagName&&"false"!=c.body.contentEditable){var d=new dom.Range(c.document);d.selectNode(b.target).select()}})}}(),UE.plugin.register("autolink",function(){var a=0;return browser.ie?{}:{bindEvents:{reset:function(){a=0},keydown:function(a,b){var c=this,d=b.keyCode||b.which;if(32==d||13==d){for(var e,f,g=c.selection.getNative(),h=g.getRangeAt(0).cloneRange(),i=h.startContainer;1==i.nodeType&&h.startOffset>0&&(i=h.startContainer.childNodes[h.startOffset-1]);)h.setStart(i,1==i.nodeType?i.childNodes.length:i.nodeValue.length),h.collapse(!0),i=h.startContainer;do{if(0==h.startOffset){for(i=h.startContainer.previousSibling;i&&1==i.nodeType;)i=i.lastChild;if(!i||domUtils.isFillChar(i))break;e=i.nodeValue.length}else i=h.startContainer,e=h.startOffset;h.setStart(i,e-1),f=h.toString().charCodeAt(0)}while(160!=f&&32!=f);if(h.toString().replace(new RegExp(domUtils.fillChar,"g"),"").match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)){for(;h.toString().length&&!/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(h.toString());)try{h.setStart(h.startContainer,h.startOffset+1)}catch(j){for(var i=h.startContainer;!(next=i.nextSibling);){if(domUtils.isBody(i))return;i=i.parentNode}h.setStart(next,0)}if(domUtils.findParentByTagName(h.startContainer,"a",!0))return;var k,l=c.document.createElement("a"),m=c.document.createTextNode(" ");c.undoManger&&c.undoManger.save(),l.appendChild(h.extractContents()),l.href=l.innerHTML=l.innerHTML.replace(/<[^>]+>/g,""),k=l.getAttribute("href").replace(new RegExp(domUtils.fillChar,"g"),""),k=/^(?:https?:\/\/)/gi.test(k)?k:"http://"+k,l.setAttribute("_src",utils.html(k)),l.href=utils.html(k),h.insertNode(l),l.parentNode.insertBefore(m,l.nextSibling),h.setStart(m,0),h.collapse(!0),g.removeAllRanges(),g.addRange(h),c.undoManger&&c.undoManger.save()}}}}}},function(){function a(a){if(3==a.nodeType)return null;if("A"==a.nodeName)return a;for(var b=a.lastChild;b;){if("A"==b.nodeName)return b;if(3==b.nodeType){if(domUtils.isWhitespace(b)){b=b.previousSibling;continue}return null}b=b.lastChild}}var b={37:1,38:1,39:1,40:1,13:1,32:1};browser.ie&&this.addListener("keyup",function(c,d){var e=this,f=d.keyCode;if(b[f]){var g=e.selection.getRange(),h=g.startContainer;if(13==f){for(;h&&!domUtils.isBody(h)&&!domUtils.isBlockElm(h);)h=h.parentNode;if(h&&!domUtils.isBody(h)&&"P"==h.nodeName){var i=h.previousSibling;if(i&&1==i.nodeType){var i=a(i);i&&!i.getAttribute("_href")&&domUtils.remove(i,!0)}}}else if(32==f)3==h.nodeType&&/^\s$/.test(h.nodeValue)&&(h=h.previousSibling,h&&"A"==h.nodeName&&!h.getAttribute("_href")&&domUtils.remove(h,!0));else if(h=domUtils.findParentByTagName(h,"a",!0),h&&!h.getAttribute("_href")){var j=g.createBookmark();domUtils.remove(h,!0),g.moveToBookmark(j).select(!0)}}})}),UE.plugins.autoheight=function(){function a(){var a=this;clearTimeout(f),g||(!a.queryCommandState||a.queryCommandState&&1!=a.queryCommandState("source"))&&(f=setTimeout(function(){for(var b=a.body.lastChild;b&&1!=b.nodeType;)b=b.previousSibling;b&&1==b.nodeType&&(b.style.clear="both",e=Math.max(domUtils.getXY(b).y+b.offsetHeight+25,Math.max(i.minFrameHeight,i.initialFrameHeight)), -e!=h&&(e!==parseInt(a.iframe.parentNode.style.height)&&(a.iframe.parentNode.style.height=e+"px"),a.body.style.height=e+"px",h=e),domUtils.removeStyle(b,"clear"))},50))}function b(){c.window&&(null===j?j=c.window.scrollY:0==c.window.scrollY&&0!=j&&(c.window.scrollTo(0,0),j=null))}var c=this;if(c.autoHeightEnabled=c.options.autoHeightEnabled!==!1,c.autoHeightEnabled){var d,e,f,g,h=0,i=c.options;c.addListener("fullscreenchanged",function(a,b){g=b}),c.addListener("destroy",function(){domUtils.un(c.window,"scroll",b),c.removeListener("contentchange afterinserthtml keyup mouseup",a)}),c.enableAutoHeight=function(){var b=this;if(b.autoHeightEnabled){var c=b.document;b.autoHeightEnabled=!0,d=c.body.style.overflowY,c.body.style.overflowY="hidden",b.addListener("contentchange afterinserthtml keyup mouseup",a),setTimeout(function(){a.call(b)},browser.gecko?100:0),b.fireEvent("autoheightchanged",b.autoHeightEnabled)}},c.disableAutoHeight=function(){c.body.style.overflowY=d||"",c.removeListener("contentchange",a),c.removeListener("keyup",a),c.removeListener("mouseup",a),c.autoHeightEnabled=!1,c.fireEvent("autoheightchanged",c.autoHeightEnabled)},c.on("setHeight",function(){c.disableAutoHeight()}),c.addListener("ready",function(){c.enableAutoHeight();var d;domUtils.on(browser.ie?c.body:c.document,browser.webkit?"dragover":"drop",function(){clearTimeout(d),d=setTimeout(function(){a.call(c)},100)}),domUtils.on(c.window,"scroll",b)});var j}},UE.plugins.autofloat=function(){function a(){return UE.ui?1:(alert(g.autofloatMsg),0)}function b(){var a=document.body.style;a.backgroundImage='url("about:blank")',a.backgroundAttachment="fixed"}function c(){var a=domUtils.getXY(k),b=domUtils.getComputedStyle(k,"position"),c=domUtils.getComputedStyle(k,"left");k.style.width=k.offsetWidth+"px",k.style.zIndex=1*f.options.zIndex+1,k.parentNode.insertBefore(q,k),o||p&&browser.ie?("absolute"!=k.style.position&&(k.style.position="absolute"),k.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-l+i+"px"):(browser.ie7Compat&&r&&(r=!1,k.style.left=domUtils.getXY(k).x-document.documentElement.getBoundingClientRect().left+2+"px"),"fixed"!=k.style.position&&(k.style.position="fixed",k.style.top=i+"px",("absolute"==b||"relative"==b)&&parseFloat(c)&&(k.style.left=a.x+"px")))}function d(){r=!0,q.parentNode&&q.parentNode.removeChild(q),k.style.cssText=j}function e(){var a=m(f.container),b=f.options.toolbarTopOffset||0;a.top<0&&a.bottom-k.offsetHeight>b?c():d()}var f=this,g=f.getLang();f.setOpt({topOffset:0});var h=f.options.autoFloatEnabled!==!1,i=f.options.topOffset;if(h){var j,k,l,m,n=UE.ui.uiUtils,o=browser.ie&&browser.version<=6,p=browser.quirks,q=document.createElement("div"),r=!0,s=utils.defer(function(){e()},browser.ie?200:100,!0);f.addListener("destroy",function(){domUtils.un(window,["scroll","resize"],e),f.removeListener("keydown",s);var a=document.getElementById("scrollBox");a&&domUtils.un(a,["scroll","resize"],e)}),f.addListener("ready",function(){if(a(f)){if(!f.ui)return;m=n.getClientRect,k=f.ui.getDom("toolbarbox"),l=m(k).top,j=k.style.cssText,q.style.height=f.ui.getDom("iframeholder").offsetHeight+"px",o&&b(),domUtils.on(window,["scroll","resize"],e),f.addListener("keydown",s);var c=document.getElementById("scrollBox");c&&domUtils.on(c,["scroll","resize"],e),f.addListener("beforefullscreenchange",function(a,b){b&&d()}),f.addListener("fullscreenchanged",function(a,b){b||e()}),f.addListener("sourcemodechanged",function(a,b){setTimeout(function(){e()},0)}),f.addListener("clearDoc",function(){setTimeout(function(){e()},0)})}})}},UE.plugins.video=function(){function a(a,b,d,e,f,g,h){var i;switch(h){case"image":i="';break;case"embed":i='';break;case"video":var j=a.substr(a.lastIndexOf(".")+1);"ogv"==j&&(j="ogg"),i="'}return i}function b(b,c){utils.each(b.getNodesByTagName(c?"img":"embed video"),function(b){var d=b.getAttr("class");if(d&&d.indexOf("edui-faked-video")!=-1){var e=a(c?b.getAttr("_url"):b.getAttr("src"),b.getAttr("width"),b.getAttr("height"),null,b.getStyle("float")||"",d,c?"embed":"image");b.parentNode.replaceChild(UE.uNode.createElement(e),b)}if(d&&d.indexOf("edui-upload-video")!=-1){var e=a(c?b.getAttr("_url"):b.getAttr("src"),b.getAttr("width"),b.getAttr("height"),null,b.getStyle("float")||"",d,c?"video":"image");b.parentNode.replaceChild(UE.uNode.createElement(e),b)}})}var c=this;c.addOutputRule(function(a){b(a,!0)}),c.addInputRule(function(a){b(a)}),c.commands.insertvideo={execCommand:function(b,d,e){if(d=utils.isArray(d)?d:[d],c.fireEvent("beforeinsertvideo",d)!==!0){for(var f,g,h=[],i="tmpVedio",j=0,k=d.length;j0)return 0;for(var c in dtd.$isNotEmpty)if(dtd.$isNotEmpty.hasOwnProperty(c)&&a.getElementsByTagName(c).length)return 0;return 1},b.getWidth=function(a){return a?parseInt(domUtils.getComputedStyle(a,"width"),10):0},b.getTableCellAlignState=function(a){!utils.isArray(a)&&(a=[a]);var b={},c=["align","valign"],d=null,e=!0;return utils.each(a,function(a){return utils.each(c,function(c){if(d=a.getAttribute(c),!b[c]&&d)b[c]=d;else if(!b[c]||d!==b[c])return e=!1,!1}),e}),e?b:null},b.getTableItemsByRange=function(a){var b=a.selection.getStart();b&&b.id&&0===b.id.indexOf("_baidu_bookmark_start_")&&b.nextSibling&&(b=b.nextSibling);var c=b&&domUtils.findParentByTagName(b,["td","th"],!0),d=c&&c.parentNode,e=d&&domUtils.findParentByTagName(d,["table"]),f=e&&e.getElementsByTagName("caption")[0];return{cell:c,tr:d,table:e,caption:f}},b.getUETableBySelected=function(a){var c=b.getTableItemsByRange(a).table;return c&&c.ueTable&&c.ueTable.selectedTds.length?c.ueTable:null},b.getDefaultValue=function(a,b){var c,d,e,f,g={thin:"0px",medium:"1px",thick:"2px"};if(b)return h=b.getElementsByTagName("td")[0],f=domUtils.getComputedStyle(b,"border-left-width"),c=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"padding-left"),d=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"border-left-width"),e=parseInt(g[f]||f,10),{tableBorder:c,tdPadding:d,tdBorder:e};b=a.document.createElement("table"),b.insertRow(0).insertCell(0).innerHTML="xxx",a.body.appendChild(b);var h=b.getElementsByTagName("td")[0];return f=domUtils.getComputedStyle(b,"border-left-width"),c=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"padding-left"),d=parseInt(g[f]||f,10),f=domUtils.getComputedStyle(h,"border-left-width"),e=parseInt(g[f]||f,10),domUtils.remove(b),{tableBorder:c,tdPadding:d,tdBorder:e}},b.getUETable=function(a){var c=a.tagName.toLowerCase();return a="td"==c||"th"==c||"caption"==c?domUtils.findParentByTagName(a,"table",!0):a,a.ueTable||(a.ueTable=new b(a)),a.ueTable},b.cloneCell=function(a,b,c){if(!a||utils.isString(a))return this.table.ownerDocument.createElement(a||"td");var d=domUtils.hasClass(a,"selectTdClass");d&&domUtils.removeClasses(a,"selectTdClass");var e=a.cloneNode(!0);return b&&(e.rowSpan=e.colSpan=1),!c&&domUtils.removeAttributes(e,"width height"),!c&&domUtils.removeAttributes(e,"style"),e.style.borderLeftStyle="",e.style.borderTopStyle="",e.style.borderLeftColor=a.style.borderRightColor,e.style.borderLeftWidth=a.style.borderRightWidth,e.style.borderTopColor=a.style.borderBottomColor,e.style.borderTopWidth=a.style.borderBottomWidth,d&&domUtils.addClass(a,"selectTdClass"),e},b.prototype={getMaxRows:function(){for(var a,b=this.table.rows,c=1,d=0;a=b[d];d++){for(var e,f=1,g=0;e=a.cells[g++];)f=Math.max(e.rowSpan||1,f);c=Math.max(f+d,c)}return c},getMaxCols:function(){for(var a,b=this.table.rows,c=0,d={},e=0;a=b[e];e++){for(var f,g=0,h=0;f=a.cells[h++];)if(g+=f.colSpan||1,f.rowSpan&&f.rowSpan>1)for(var i=1;ithis.rowsNum-1)?null:(e=c?h?i.endRowIndex+1:g.rowIndex+g.rowSpan:h?i.beginRowIndex-1:g.rowIndex-1,f=h?i.beginColIndex:g.colIndex,this.getCell(this.indexTable[e][f].rowIndex,this.indexTable[e][f].cellIndex))}catch(j){a(j)}},getSameEndPosCells:function(b,c){try{for(var d="x"===c.toLowerCase(),e=domUtils.getXY(b)[d?"x":"y"]+b["offset"+(d?"Width":"Height")],f=this.table.rows,g=null,h=[],i=0;ie&&d)break;if((b==j||e==l)&&(1==j[d?"colSpan":"rowSpan"]&&h.push(j),d))break}}return h}catch(m){a(m)}},setCellContent:function(a,b){a.innerHTML=b||(browser.ie?domUtils.fillChar:"
                      ")},cloneCell:b.cloneCell,getSameStartPosXCells:function(b){try{for(var c,d=domUtils.getXY(b).x+b.offsetWidth,e=this.table.rows,f=[],g=0;gd)break;if(j==d&&1==h.colSpan){f.push(h);break}}}return f}catch(k){a(k)}},update:function(a){this.table=a||this.table,this.selectedTds=[],this.cellsRange={},this.indexTable=[];for(var b=this.table.rows,c=this.getMaxRows(),d=c-b.length,e=this.getMaxCols();d--;)this.table.insertRow(b.length);this.rowsNum=c,this.colsNum=e;for(var f=0,g=b.length;fc&&(j.rowSpan=c);for(var m=k,n=j.rowSpan||1,o=j.colSpan||1;this.indexTable[i][m];)m++;for(var p=0;p0)for(h=b;hf&&(m=Math.max(h,m));if(ee&&(l=Math.max(i,l));if(b>0)for(i=a;ig||d+b.colSpan-1>h)return null;j.push(this.getCell(c,b.cellIndex))}}return j},clearSelected:function(){b.removeSelectedClass(this.selectedTds),this.selectedTds=[],this.cellsRange={}},setSelected:function(a){var c=this.getCells(a);b.addSelectedClass(c),this.selectedTds=c,this.cellsRange=a},isFullRow:function(){var a=this.cellsRange;return a.endColIndex-a.beginColIndex+1==this.colsNum},isFullCol:function(){var a=this.cellsRange,b=this.table,c=b.getElementsByTagName("th"),d=a.endRowIndex-a.beginRowIndex+1;return c.length?d==this.rowsNum||d==this.rowsNum-1:d==this.rowsNum},getNextCell:function(b,c,d){try{var e,f,g=this.getCellInfo(b),h=this.selectedTds.length&&!d,i=this.cellsRange;return!c&&0==g.rowIndex||c&&(h?i.endRowIndex==this.rowsNum-1:g.rowIndex+g.rowSpan>this.rowsNum-1)?null:(e=c?h?i.endRowIndex+1:g.rowIndex+g.rowSpan:h?i.beginRowIndex-1:g.rowIndex-1,f=h?i.beginColIndex:g.colIndex,this.getCell(this.indexTable[e][f].rowIndex,this.indexTable[e][f].cellIndex))}catch(j){a(j)}},getPreviewCell:function(b,c){try{var d,e,f=this.getCellInfo(b),g=this.selectedTds.length,h=this.cellsRange;return!c&&(g?!h.beginColIndex:!f.colIndex)||c&&(g?h.endColIndex==this.colsNum-1:f.rowIndex>this.colsNum-1)?null:(d=c?g?h.beginRowIndex:f.rowIndex<1?0:f.rowIndex-1:g?h.beginRowIndex:f.rowIndex,e=c?g?h.endColIndex+1:f.colIndex:g?h.beginColIndex-1:f.colIndex<1?0:f.colIndex-1,this.getCell(this.indexTable[d][e].rowIndex,this.indexTable[d][e].cellIndex))}catch(i){a(i)}},moveContent:function(a,c){if(!b.isEmptyBlock(c)){if(b.isEmptyBlock(a))return void(a.innerHTML=c.innerHTML);var d=a.lastChild;for(3!=d.nodeType&&dtd.$block[d.tagName]||a.appendChild(a.ownerDocument.createElement("br"));d=c.firstChild;)a.appendChild(d)}},mergeRight:function(a){var b=this.getCellInfo(a),c=b.colIndex+b.colSpan,d=this.indexTable[b.rowIndex][c],e=this.getCell(d.rowIndex,d.cellIndex);a.colSpan=b.colSpan+d.colSpan,a.removeAttribute("width"),this.moveContent(a,e),this.deleteCell(e,d.rowIndex),this.update()},mergeDown:function(a){var b=this.getCellInfo(a),c=b.rowIndex+b.rowSpan,d=this.indexTable[c][b.colIndex],e=this.getCell(d.rowIndex,d.cellIndex);a.rowSpan=b.rowSpan+d.rowSpan,a.removeAttribute("height"),this.moveContent(a,e),this.deleteCell(e,d.rowIndex),this.update()},mergeRange:function(){for(var a,b=this.cellsRange,c=this.getCell(b.beginRowIndex,this.indexTable[b.beginRowIndex][b.beginColIndex].cellIndex),d=this.getCells(b),e=0;a=d[e++];)a!==c&&(this.moveContent(c,a),this.deleteCell(a));if(c.rowSpan=b.endRowIndex-b.beginRowIndex+1,c.rowSpan>1&&c.removeAttribute("height"),c.colSpan=b.endColIndex-b.beginColIndex+1,c.colSpan>1&&c.removeAttribute("width"),c.rowSpan==this.rowsNum&&1!=c.colSpan&&(c.colSpan=1),c.colSpan==this.colsNum&&1!=c.rowSpan){var f=c.parentNode.rowIndex;if(this.table.deleteRow)for(var e=f+1,g=f+1,h=c.rowSpan;e1&&g.rowIndex==a){var i=h.cloneNode(!0);i.rowSpan=h.rowSpan-1,i.innerHTML="",h.rowSpan=1;var j,k=a+1,l=this.table.rows[k],m=this.getPreviewMergedCellsNum(k,f)-e;m1?l.colSpan--:c[h].deleteCell(j.cellIndex),h+=j.rowSpan||1}}this.table.setAttribute("width",d-e),this.update()},splitToCells:function(a){var b=this,c=this.splitToRows(a);utils.each(c,function(a){b.splitToCols(a)})},splitToRows:function(a){var b=this.getCellInfo(a),c=b.rowIndex,d=b.colIndex,e=[];a.rowSpan=1,e.push(a);for(var f=c,g=c+b.rowSpan;f");for(var g=0;g'+(browser.ie&&browser.version<11?domUtils.fillChar:"
                      ")+"");c.push("")}return"
                      "+c.join("")+"
                      "}b||(b=utils.extend({},{numCols:this.options.defaultCols,numRows:this.options.defaultRows,tdvalign:this.options.tdvalign}));var d=this,e=this.selection.getRange(),f=e.startContainer,h=domUtils.findParent(f,function(a){return domUtils.isBlockElm(a)},!0)||d.body,i=g(d),j=h.offsetWidth,k=Math.floor(j/b.numCols-2*i.tdPadding-i.tdBorder);!b.tdvalign&&(b.tdvalign=d.options.tdvalign),d.execCommand("inserthtml",c(b,k))}},UE.commands.insertparagraphbeforetable={queryCommandState:function(){return e(this).cell?0:-1},execCommand:function(){var a=e(this).table;if(a){var b=this.document.createElement("p");b.innerHTML=browser.ie?" ":"
                      ",a.parentNode.insertBefore(b,a),this.selection.getRange().setStart(b,0).setCursor()}}},UE.commands.deletetable={queryCommandState:function(){var a=this.selection.getRange();return domUtils.findParentByTagName(a.startContainer,"table",!0)?0:-1},execCommand:function(a,b){var c=this.selection.getRange();if(b=b||domUtils.findParentByTagName(c.startContainer,"table",!0)){var d=b.nextSibling;d||(d=domUtils.createElement(this.document,"p",{innerHTML:browser.ie?domUtils.fillChar:"
                      "}),b.parentNode.insertBefore(d,b)),domUtils.remove(b),c=this.selection.getRange(),3==d.nodeType?c.setStartBefore(d):c.setStart(d,0),c.setCursor(!1,!0),this.fireEvent("tablehasdeleted")}}},UE.commands.cellalign={queryCommandState:function(){return c(this).length?0:-1},execCommand:function(a,b){var d=c(this);if(d.length)for(var e,f=0;e=d[f++];)e.setAttribute("align",b)}},UE.commands.cellvalign={queryCommandState:function(){return c(this).length?0:-1},execCommand:function(a,b){var d=c(this);if(d.length)for(var e,f=0;e=d[f++];)e.setAttribute("vAlign",b)}},UE.commands.insertcaption={queryCommandState:function(){var a=e(this).table;return a&&0==a.getElementsByTagName("caption").length?1:-1},execCommand:function(){var a=e(this).table;if(a){var b=this.document.createElement("caption");b.innerHTML=browser.ie?domUtils.fillChar:"
                      ",a.insertBefore(b,a.firstChild);var c=this.selection.getRange();c.setStart(b,0).setCursor()}}},UE.commands.deletecaption={queryCommandState:function(){var a=this.selection.getRange(),b=domUtils.findParentByTagName(a.startContainer,"table");return b?0==b.getElementsByTagName("caption").length?-1:1:-1},execCommand:function(){var a=this.selection.getRange(),b=domUtils.findParentByTagName(a.startContainer,"table");if(b){domUtils.remove(b.getElementsByTagName("caption")[0]);var c=this.selection.getRange();c.setStart(b.rows[0].cells[0],0).setCursor()}}},UE.commands.inserttitle={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[0];return"th"!=b.cells[b.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var a=e(this).table;a&&h(a).insertRow(0,"th");var b=a.getElementsByTagName("th")[0];this.selection.getRange().setStart(b,0).setCursor(!1,!0)}},UE.commands.deletetitle={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[0];return"th"==b.cells[b.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var a=e(this).table;a&&domUtils.remove(a.rows[0]);var b=a.getElementsByTagName("td")[0];this.selection.getRange().setStart(b,0).setCursor(!1,!0)}},UE.commands.inserttitlecol={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[a.rows.length-1];return b.getElementsByTagName("th").length?-1:0}return-1},execCommand:function(b){var c=e(this).table;c&&h(c).insertCol(0,"th"),a(c,this);var d=c.getElementsByTagName("th")[0];this.selection.getRange().setStart(d,0).setCursor(!1,!0)}},UE.commands.deletetitlecol={queryCommandState:function(){var a=e(this).table;if(a){var b=a.rows[a.rows.length-1];return b.getElementsByTagName("th").length?0:-1}return-1},execCommand:function(){var b=e(this).table;if(b)for(var c=0;c=f.colsNum)return-1;var j=f.indexTable[g.rowIndex][i],k=c.rows[j.rowIndex].cells[j.cellIndex];return k&&d.tagName==k.tagName&&j.rowIndex==g.rowIndex&&j.rowSpan==g.rowSpan?0:-1},execCommand:function(a){var b=this.selection.getRange(),c=b.createBookmark(!0),d=e(this).cell,f=h(d);f.mergeRight(d),b.moveToBookmark(c).select()}},UE.commands.mergedown={queryCommandState:function(a){var b=e(this),c=b.table,d=b.cell;if(!c||!d)return-1;var f=h(c);if(f.selectedTds.length)return-1;var g=f.getCellInfo(d),i=g.rowIndex+g.rowSpan;if(i>=f.rowsNum)return-1;var j=f.indexTable[i][g.colIndex],k=c.rows[j.rowIndex].cells[j.cellIndex];return k&&d.tagName==k.tagName&&j.colIndex==g.colIndex&&j.colSpan==g.colSpan?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.mergeDown(c),a.moveToBookmark(b).select()}},UE.commands.mergecells={queryCommandState:function(){return f(this)?0:-1},execCommand:function(){var a=f(this);if(a&&a.selectedTds.length){var b=a.selectedTds[0];a.mergeRange();var c=this.selection.getRange();domUtils.isEmptyBlock(b)?c.setStart(b,0).collapse(!0):c.selectNodeContents(b),c.select()}}},UE.commands.insertrow={queryCommandState:function(){var a=e(this),b=a.cell;return b&&("TD"==b.tagName||"TH"==b.tagName&&a.tr!==a.table.rows[0])&&h(a.table).rowsNum0?-1:b&&(b.colSpan>1||b.rowSpan>1)?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.splitToCells(c),a.moveToBookmark(b).select()}},UE.commands.splittorows={queryCommandState:function(){var a=e(this),b=a.cell;if(!b)return-1;var c=h(a.table);return c.selectedTds.length>0?-1:b&&b.rowSpan>1?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.splitToRows(c),a.moveToBookmark(b).select()}},UE.commands.splittocols={queryCommandState:function(){var a=e(this),b=a.cell;if(!b)return-1;var c=h(a.table);return c.selectedTds.length>0?-1:b&&b.colSpan>1?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c);d.splitToCols(c),a.moveToBookmark(b).select()}},UE.commands.adaptbytext=UE.commands.adaptbywindow={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(b){var c=e(this),d=c.table;if(d)if("adaptbywindow"==b)a(d,this);else{var f=domUtils.getElementsByTagName(d,"td th");utils.each(f,function(a){a.removeAttribute("width")}),d.removeAttribute("width")}}},UE.commands.averagedistributecol={queryCommandState:function(){var a=f(this);return a&&(a.isFullRow()||a.isFullCol())?0:-1},execCommand:function(a){function b(){var a,b=e.table,c=0,f=0,h=g(d,b);if(e.isFullRow())c=b.offsetWidth,f=e.colsNum;else for(var i,j=e.cellsRange.beginColIndex,k=e.cellsRange.endColIndex,l=j;l<=k;)i=e.selectedTds[l],c+=i.offsetWidth,l+=i.colSpan,f+=1;return a=Math.ceil(c/f)-2*h.tdBorder-2*h.tdPadding}function c(a){utils.each(domUtils.getElementsByTagName(e.table,"th"),function(a){a.setAttribute("width","")});var b=e.isFullRow()?domUtils.getElementsByTagName(e.table,"td"):e.selectedTds;utils.each(b,function(b){1==b.colSpan&&b.setAttribute("width",a)})}var d=this,e=f(d);e&&e.selectedTds.length&&c(b())}},UE.commands.averagedistributerow={queryCommandState:function(){var a=f(this);return a?a.selectedTds&&/th/gi.test(a.selectedTds[0].tagName)?-1:a.isFullRow()||a.isFullCol()?0:-1:-1},execCommand:function(a){function b(){var a,b,c=0,f=e.table,h=g(d,f),i=parseInt(domUtils.getComputedStyle(f.getElementsByTagName("td")[0],"padding-top"));if(e.isFullCol()){var j,k,l=domUtils.getElementsByTagName(f,"caption"),m=domUtils.getElementsByTagName(f,"th");l.length>0&&(j=l[0].offsetHeight),m.length>0&&(k=m[0].offsetHeight),c=f.offsetHeight-(j||0)-(k||0),b=0==m.length?e.rowsNum:e.rowsNum-1}else{for(var n=e.cellsRange.beginRowIndex,o=e.cellsRange.endRowIndex,p=0,q=domUtils.getElementsByTagName(f,"tr"),r=n;r<=o;r++)c+=q[r].offsetHeight,p+=1;b=p}return a=browser.ie&&browser.version<9?Math.ceil(c/b):Math.ceil(c/b)-2*h.tdBorder-2*i}function c(a){var b=e.isFullCol()?domUtils.getElementsByTagName(e.table,"td"):e.selectedTds;utils.each(b,function(b){1==b.rowSpan&&b.setAttribute("height",a)})}var d=this,e=f(d);e&&e.selectedTds.length&&c(b())}},UE.commands.cellalignment={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(a,b){var c=this,d=f(c);if(d)utils.each(d.selectedTds,function(a){domUtils.setAttributes(a,b)});else{var e=c.selection.getStart(),g=e&&domUtils.findParentByTagName(e,["td","th","caption"],!0);/caption/gi.test(g.tagName)?(g.style.textAlign=b.align,g.style.verticalAlign=b.vAlign):domUtils.setAttributes(g,b),c.selection.getRange().setCursor(!0)}},queryCommandValue:function(a){var b=e(this).cell;if(b||(b=c(this)[0]),b){var d=UE.UETable.getUETable(b).selectedTds;return!d.length&&(d=b),UE.UETable.getTableCellAlignState(d)}return null}},UE.commands.tablealignment={queryCommandState:function(){return browser.ie&&browser.version<8?-1:e(this).table?0:-1},execCommand:function(a,b){var c=this,d=c.selection.getStart(),e=d&&domUtils.findParentByTagName(d,["table"],!0);e&&e.setAttribute("align",b)}},UE.commands.edittable={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(a,b){var c=this.selection.getRange(),d=domUtils.findParentByTagName(c.startContainer,"table");if(d){var e=domUtils.getElementsByTagName(d,"td").concat(domUtils.getElementsByTagName(d,"th"),domUtils.getElementsByTagName(d,"caption"));utils.each(e,function(a){a.style.borderColor=b})}}},UE.commands.edittd={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(a,b){var c=this,d=f(c);if(d)utils.each(d.selectedTds,function(a){a.style.backgroundColor=b});else{var e=c.selection.getStart(),g=e&&domUtils.findParentByTagName(e,["td","th","caption"],!0);g&&(g.style.backgroundColor=b)}}},UE.commands.settablebackground={queryCommandState:function(){return c(this).length>1?0:-1},execCommand:function(a,b){var d,e;d=c(this),e=h(d[0]),e.setBackground(d,b)}},UE.commands.cleartablebackground={queryCommandState:function(){var a=c(this);if(!a.length)return-1;for(var b,d=0;b=a[d++];)if(""!==b.style.backgroundColor)return 0;return-1},execCommand:function(){var a=c(this),b=h(a[0]);b.removeBackground(a)}},UE.commands.interlacetable=UE.commands.uninterlacetable={queryCommandState:function(a){var b=e(this).table;if(!b)return-1;var c=b.getAttribute("interlaced");return"interlacetable"==a?"enabled"===c?-1:0:c&&"disabled"!==c?0:-1},execCommand:function(a,b){var c=e(this).table;"interlacetable"==a?(c.setAttribute("interlaced","enabled"),this.fireEvent("interlacetable",c,b)):(c.setAttribute("interlaced","disabled"),this.fireEvent("uninterlacetable",c))}},UE.commands.setbordervisible={queryCommandState:function(a){var b=e(this).table;return b?0:-1},execCommand:function(){var a=e(this).table;utils.each(domUtils.getElementsByTagName(a,"td"),function(a){a.style.borderWidth="1px",a.style.borderStyle="solid"})}}}(),UE.plugins.table=function(){function a(a){}function b(a,b){c(a,"width",!0),c(a,"height",!0)}function c(a,b,c){a.style[b]&&(c&&a.setAttribute(b,parseInt(a.style[b],10)),a.style[b]="")}function d(a){if("TD"==a.tagName||"TH"==a.tagName)return a;var b;return(b=domUtils.findParentByTagName(a,"td",!0)||domUtils.findParentByTagName(a,"th",!0))?b:null}function e(a){var b=new RegExp(domUtils.fillChar,"g");if(a[browser.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(b,"").length>0)return 0;for(var c in dtd.$isNotEmpty)if(a.getElementsByTagName(c).length)return 0;return 1}function f(a){return a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+N.document.body.scrollLeft-N.document.body.clientLeft,y:a.clientY+N.document.body.scrollTop-N.document.body.clientTop}}function g(b){if(!A())try{var c,e=d(b.target||b.srcElement);if(R&&(N.body.style.webkitUserSelect="none",(Math.abs(V.x-b.clientX)>T||Math.abs(V.y-b.clientY)>T)&&(t(),R=!1,U=0,v(b))),ca&&ha)return U=0,N.body.style.webkitUserSelect="none",N.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),c=f(b),m(N,!0,ca,c,e),void("h"==ca?ga.style.left=k(ha,b)+"px":"v"==ca&&(ga.style.top=l(ha,b)+"px"));if(e){if(N.fireEvent("excludetable",e)===!0)return;c=f(b);var g=n(e,c),i=domUtils.findParentByTagName(e,"table",!0);if(j(i,e,b,!0)){if(N.fireEvent("excludetable",i)===!0)return;N.body.style.cursor="url("+N.options.cursorpath+"h.png),pointer"}else if(j(i,e,b)){if(N.fireEvent("excludetable",i)===!0)return;N.body.style.cursor="url("+N.options.cursorpath+"v.png),pointer"}else{N.body.style.cursor="text";/\d/.test(g)&&(g=g.replace(/\d/,""),e=Y(e).getPreviewCell(e,"v"==g)),m(N,!!e&&!!g,e?g:"",c,e)}}else h(!1,i,N)}catch(o){a(o)}}function h(a,b,c){if(a)i(b,c);else{if(fa)return;la=setTimeout(function(){!fa&&ea&&ea.parentNode&&ea.parentNode.removeChild(ea)},2e3)}}function i(a,b){function c(c,d){clearTimeout(g),g=setTimeout(function(){b.fireEvent("tableClicked",a,d)},300)}function d(c){clearTimeout(g);var d=Y(a),e=a.rows[0].cells[0],f=d.getLastCell(),h=d.getCellsRange(e,f);b.selection.getRange().setStart(e,0).setCursor(!1,!0),d.setSelected(h)}var e=domUtils.getXY(a),f=a.ownerDocument;if(ea&&ea.parentNode)return ea;ea=f.createElement("div"),ea.contentEditable=!1,ea.innerHTML="",ea.style.cssText="width:15px;height:15px;background-image:url("+b.options.UEDITOR_HOME_URL+"dialogs/table/dragicon.png);position: absolute;cursor:move;top:"+(e.y-15)+"px;left:"+e.x+"px;",domUtils.unSelectable(ea),ea.onmouseover=function(a){fa=!0},ea.onmouseout=function(a){fa=!1},domUtils.on(ea,"click",function(a,b){c(b,this)}),domUtils.on(ea,"dblclick",function(a,b){d(b)}),domUtils.on(ea,"dragstart",function(a,b){domUtils.preventDefault(b)});var g;f.body.appendChild(ea)}function j(a,b,c,d){var e=f(c),g=n(b,e);if(d){var h=a.getElementsByTagName("caption")[0],i=h?h.offsetHeight:0;return"v1"==g&&e.y-domUtils.getXY(a).y-i<8}return"h1"==g&&e.x-domUtils.getXY(a).x<8}function k(a,b){var c=Y(a);if(c){var d=c.getSameEndPosCells(a,"x")[0],e=c.getSameStartPosXCells(a)[0],g=f(b).x,h=(d?domUtils.getXY(d).x:domUtils.getXY(c.table).x)+20,i=e?domUtils.getXY(e).x+e.offsetWidth-20:N.body.offsetWidth+5||parseInt(domUtils.getComputedStyle(N.body,"width"),10);return h+=Q,i-=Q,gi?i:g}}function l(b,c){try{var d=domUtils.getXY(b).y,e=f(c).y;return ek[c]?(a=!1,!1):void l.push(d)});var b=a?l:k;utils.each(i,function(a,c){a.width=b[c]-G()})},0)}}}}function q(a){if(_(domUtils.getElementsByTagName(N.body,"td th")),utils.each(N.document.getElementsByTagName("table"),function(a){a.ueTable=null}),aa=M(N,a)){var b=domUtils.findParentByTagName(aa,"table",!0);ut=Y(b),ut&&ut.clearSelected(),da?r(a):(N.document.body.style.webkitUserSelect="",ia=!0,N.addListener("mouseover",x))}}function r(a){browser.ie&&(a=u(a)),t(),R=!0,O=setTimeout(function(){v(a)},W)}function s(a,b){for(var c=[],d=null,e=0,f=a.length;e0&&U--},W),2===U))return U=0,void p(b);if(2!=b.button){var c=this,d=c.selection.getRange(),e=domUtils.findParentByTagName(d.startContainer,"table",!0),f=domUtils.findParentByTagName(d.endContainer,"table",!0);if((e||f)&&(e===f?(e=domUtils.findParentByTagName(d.startContainer,["td","th","caption"],!0),f=domUtils.findParentByTagName(d.endContainer,["td","th","caption"],!0),e!==f&&c.selection.clearRange()):c.selection.clearRange()),ia=!1,c.document.body.style.webkitUserSelect="",ca&&ha&&(c.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),U=0,ga=c.document.getElementById("ue_tableDragLine"))){var g=domUtils.getXY(ha),h=domUtils.getXY(ga);switch(ca){case"h":z(ha,h.x-g.x);break;case"v":B(ha,h.y-g.y-ha.offsetHeight)}return ca="",ha=null,I(c),void c.fireEvent("saveScene")}if(aa){var i=Y(aa),j=i?i.selectedTds[0]:null;if(j)d=new dom.Range(c.document),domUtils.isEmptyBlock(j)?d.setStart(j,0).setCursor(!1,!0):d.selectNodeContents(j).shrinkBoundary().setCursor(!1,!0);else if(d=c.selection.getRange().shrinkBoundary(),!d.collapsed){var e=domUtils.findParentByTagName(d.startContainer,["td","th"],!0),f=domUtils.findParentByTagName(d.endContainer,["td","th"],!0);(e&&!f||!e&&f||e&&f&&e!==f)&&d.setCursor(!1,!0)}aa=null,c.removeListener("mouseover",x)}else{var k=domUtils.findParentByTagName(b.target||b.srcElement,"td",!0);if(k||(k=domUtils.findParentByTagName(b.target||b.srcElement,"th",!0)),k&&("TD"==k.tagName||"TH"==k.tagName)){if(c.fireEvent("excludetable",k)===!0)return;d=new dom.Range(c.document),d.setStart(k,0).setCursor(!1,!0)}}c._selectionChange(250,b)}}}function x(a,b){if(!A()){var c=this,d=b.target||b.srcElement;if(ba=domUtils.findParentByTagName(d,"td",!0)||domUtils.findParentByTagName(d,"th",!0),aa&&ba&&("TD"==aa.tagName&&"TD"==ba.tagName||"TH"==aa.tagName&&"TH"==ba.tagName)&&domUtils.findParentByTagName(aa,"table")==domUtils.findParentByTagName(ba,"table")){var e=Y(ba);if(aa!=ba){c.document.body.style.webkitUserSelect="none",c.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"]();var f=e.getCellsRange(aa,ba);e.setSelected(f)}else c.document.body.style.webkitUserSelect="",e.clearSelected()}b.preventDefault?b.preventDefault():b.returnValue=!1}}function y(a,b,c){var d=parseInt(domUtils.getComputedStyle(a,"line-height"),10),e=c+b;b=ef?(c&&g.push({left:a}),!1):void 0})}),g}function D(a,b,c){if(a-=G(),a<0)return 0;a-=E(b);var d=a<0?"left":"right";return a=Math.abs(a),utils.each(c,function(b){var c=b[d];c&&(a=Math.min(a,E(c)-Q))}),a=a<0?0:a,"left"===d?-a:a}function E(a){var b=0,b=a.offsetWidth-G();a.nextSibling||(b-=F(a)),b=b<0?0:b;try{a.width=b}catch(c){}return b}function F(a){if(tab=domUtils.findParentByTagName(a,"table",!1),void 0===tab.offsetVal){var b=a.previousSibling;b?tab.offsetVal=a.offsetWidth-b.offsetWidth===X.borderWidth?X.borderWidth:0:tab.offsetVal=0}return tab.offsetVal}function G(){if(void 0===X.tabcellSpace){var a=N.document.createElement("table"),b=N.document.createElement("tbody"),c=N.document.createElement("tr"),d=N.document.createElement("td"),e=null;d.style.cssText="border: 0;",d.width=1,c.appendChild(d),c.appendChild(e=d.cloneNode(!1)),b.appendChild(c),a.appendChild(b),a.style.cssText="visibility: hidden;",N.body.appendChild(a),X.paddingSpace=d.offsetWidth-1;var f=a.offsetWidth;d.style.cssText="",e.style.cssText="",X.borderWidth=(a.offsetWidth-f)/3,X.tabcellSpace=X.paddingSpace+X.borderWidth,N.body.removeChild(a)}return G=function(){return X.tabcellSpace},X.tabcellSpace}function H(a,b){ia||(ga=a.document.createElement("div"),domUtils.setAttributes(ga,{id:"ue_tableDragLine",unselectable:"on",contenteditable:!1,onresizestart:"return false",ondragstart:"return false",onselectstart:"return false",style:"background-color:blue;position:absolute;padding:0;margin:0;background-image:none;border:0px none;opacity:0;filter:alpha(opacity=0)"}),a.body.appendChild(ga))}function I(a){if(!ia)for(var b;b=a.document.getElementById("ue_tableDragLine");)domUtils.remove(b)}function J(a,b){if(b){var c,d=domUtils.findParentByTagName(b,"table"),e=d.getElementsByTagName("caption"),f=d.offsetWidth,g=d.offsetHeight-(e.length>0?e[0].offsetHeight:0),h=domUtils.getXY(d),i=domUtils.getXY(b);switch(a){case"h":c="height:"+g+"px;top:"+(h.y+(e.length>0?e[0].offsetHeight:0))+"px;left:"+(i.x+b.offsetWidth),ga.style.cssText=c+"px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)";break;case"v":c="width:"+f+"px;left:"+h.x+"px;top:"+(i.y+b.offsetHeight),ga.style.cssText=c+"px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)"}}}function K(a,b){for(var c,d,e=domUtils.getElementsByTagName(a.body,"table"),f=0;d=e[f++];){var g=domUtils.getElementsByTagName(d,"td");g[0]&&(b?(c=g[0].style.borderColor.replace(/\s/g,""),/(#ffffff)|(rgb\(255,255,255\))/gi.test(c)&&domUtils.addClass(d,"noBorderTable")):domUtils.removeClasses(d,"noBorderTable"))}}function L(a,b,c){var d=a.body;return d.offsetWidth-(b?2*parseInt(domUtils.getComputedStyle(d,"margin-left"),10):0)-2*c.tableBorder-(a.options.offsetWidth||0)}function M(a,b){var c=domUtils.findParentByTagName(b.target||b.srcElement,["td","th"],!0),d=null;if(!c)return null;if(d=n(c,f(b)),!c)return null;if("h1"===d&&c.previousSibling){var e=domUtils.getXY(c),g=c.offsetWidth;Math.abs(e.x+g-b.clientX)>g/3&&(c=c.previousSibling)}else if("v1"===d&&c.parentNode.previousSibling){var e=domUtils.getXY(c),h=c.offsetHeight;Math.abs(e.y+h-b.clientY)>h/3&&(c=c.parentNode.previousSibling.firstChild)}return c&&a.fireEvent("excludetable",c)!==!0?c:null}var N=this,O=null,P=null,Q=5,R=!1,S=5,T=10,U=0,V=null,W=360,X=UE.UETable,Y=function(a){return X.getUETable(a)},Z=function(a){return X.getUETableBySelected(a)},$=function(a,b){return X.getDefaultValue(a,b)},_=function(a){return X.removeSelectedClass(a)};N.ready(function(){var a=this,b=a.selection.getText;a.selection.getText=function(){var c=Z(a);if(c){var d="";return utils.each(c.selectedTds,function(a){d+=a[browser.ie?"innerText":"textContent"]}),d}return b.call(a.selection)}});var aa=null,ba=null,ca="",da=!1,ea=null,fa=!1,ga=null,ha=null,ia=!1,ja=!0;N.setOpt({maxColNum:20,maxRowNum:100,defaultCols:5,defaultRows:5,tdvalign:"top",cursorpath:N.options.UEDITOR_HOME_URL+"themes/"+N.options.theme+"/images/cursor_",tableDragable:!1,classList:["ue-table-interlace-color-single","ue-table-interlace-color-double"]}),N.getUETable=Y;var ka={deletetable:1,inserttable:1,cellvalign:1,insertcaption:1,deletecaption:1,inserttitle:1,deletetitle:1,mergeright:1,mergedown:1,mergecells:1,insertrow:1,insertrownext:1,deleterow:1,insertcol:1,insertcolnext:1,deletecol:1,splittocells:1,splittorows:1,splittocols:1,adaptbytext:1,adaptbywindow:1,adaptbycustomer:1,insertparagraph:1,insertparagraphbeforetable:1,averagedistributecol:1,averagedistributerow:1};N.ready(function(){utils.cssRule("table",".selectTdClass{background-color:#edf5fa !important}table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}table{margin-bottom:10px;border-collapse:collapse;display:table;}td,th{padding: 5px 10px;border: 1px solid #DDD;}caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}th{border-top:1px solid #BBB;background-color:#F7F7F7;}table tr.firstRow th{border-top-width:2px;}.ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }td p{margin:0;padding:0;}",N.document);var a,c,f;N.addListener("keydown",function(b,d){var g=this,h=d.keyCode||d.which;if(8==h){var i=Z(g);i&&i.selectedTds.length&&(i.isFullCol()?g.execCommand("deletecol"):i.isFullRow()?g.execCommand("deleterow"):g.fireEvent("delcells"),domUtils.preventDefault(d));var j=domUtils.findParentByTagName(g.selection.getStart(),"caption",!0),k=g.selection.getRange();if(k.collapsed&&j&&e(j)){g.fireEvent("saveScene");var l=j.parentNode;domUtils.remove(j),l&&k.setStart(l.rows[0].cells[0],0).setCursor(!1,!0),g.fireEvent("saveScene")}}if(46==h&&(i=Z(g))){g.fireEvent("saveScene");for(var m,n=0;m=i.selectedTds[n++];)domUtils.fillNode(g.document,m);g.fireEvent("saveScene"),domUtils.preventDefault(d)}if(13==h){var o=g.selection.getRange(),j=domUtils.findParentByTagName(o.startContainer,"caption",!0);if(j){var l=domUtils.findParentByTagName(j,"table");return o.collapsed?j&&o.setStart(l.rows[0].cells[0],0).setCursor(!1,!0):(o.deleteContents(),g.fireEvent("saveScene")),void domUtils.preventDefault(d)}if(o.collapsed){var l=domUtils.findParentByTagName(o.startContainer,"table");if(l){var p=l.rows[0].cells[0],q=domUtils.findParentByTagName(g.selection.getStart(),["td","th"],!0),r=l.previousSibling;if(p===q&&(!r||1==r.nodeType&&"TABLE"==r.tagName)&&domUtils.isStartInblock(o)){var s=domUtils.findParent(g.selection.getStart(),function(a){return domUtils.isBlockElm(a)},!0);s&&(/t(h|d)/i.test(s.tagName)||s===q.firstChild)&&(g.execCommand("insertparagraphbeforetable"),domUtils.preventDefault(d))}}}}if((d.ctrlKey||d.metaKey)&&"67"==d.keyCode){a=null;var i=Z(g);if(i){var t=i.selectedTds;c=i.isFullCol(),f=i.isFullRow(),a=[[i.cloneCell(t[0],null,!0)]];for(var m,n=1;m=t[n];n++)m.parentNode!==t[n-1].parentNode?a.push([i.cloneCell(m,null,!0)]):a[a.length-1].push(i.cloneCell(m,null,!0))}}}),N.addListener("tablehasdeleted",function(){m(this,!1,"",null),ea&&domUtils.remove(ea)}),N.addListener("beforepaste",function(d,g){var h=this,i=h.selection.getRange();if(domUtils.findParentByTagName(i.startContainer,"caption",!0)){var j=h.document.createElement("div");return j.innerHTML=g.html,void(g.html=j[browser.ie9below?"innerText":"textContent"])}var k=Z(h);if(a){h.fireEvent("saveScene");var l,m,i=h.selection.getRange(),n=domUtils.findParentByTagName(i.startContainer,["td","th"],!0);if(n){var o=Y(n);if(f){var p=o.getCellInfo(n).rowIndex;"TH"==n.tagName&&p++;for(var q,r=0;q=a[r++];){for(var s,t=o.insertRow(p++,"td"),u=0;s=q[u];u++){var v=t.cells[u];v||(v=t.insertCell(u)),v.innerHTML=s.innerHTML,s.getAttribute("width")&&v.setAttribute("width",s.getAttribute("width")),s.getAttribute("vAlign")&&v.setAttribute("vAlign",s.getAttribute("vAlign")),s.getAttribute("align")&&v.setAttribute("align",s.getAttribute("align")),s.style.cssText&&(v.style.cssText=s.style.cssText)}for(var s,u=0;(s=t.cells[u])&&q[u];u++)s.innerHTML=q[u].innerHTML,q[u].getAttribute("width")&&s.setAttribute("width",q[u].getAttribute("width")),q[u].getAttribute("vAlign")&&s.setAttribute("vAlign",q[u].getAttribute("vAlign")),q[u].getAttribute("align")&&s.setAttribute("align",q[u].getAttribute("align")),q[u].style.cssText&&(s.style.cssText=q[u].style.cssText)}}else{if(c){y=o.getCellInfo(n);for(var s,w=0,u=0,q=a[0];s=q[u++];)w+=s.colSpan||1;for(h.__hasEnterExecCommand=!0,r=0;r1&&(x.rowSpan=1)}var z=$(h),A=h.body.offsetWidth-(ja?2*parseInt(domUtils.getComputedStyle(h.body,"margin-left"),10):0)-2*z.tableBorder-(h.options.offsetWidth||0);h.execCommand("insertHTML",""+k.innerHTML.replace(/>\s*<").replace(/\bth\b/gi,"td")+"
                      ")}return h.fireEvent("contentchange"),h.fireEvent("saveScene"),g.html="",!0}var B,j=h.document.createElement("div");j.innerHTML=g.html,B=j.getElementsByTagName("table"),domUtils.findParentByTagName(h.selection.getStart(),"table")?(utils.each(B,function(a){domUtils.remove(a)}),domUtils.findParentByTagName(h.selection.getStart(),"caption",!0)&&(j.innerHTML=j[browser.ie?"innerText":"textContent"])):utils.each(B,function(a){b(a,!0),domUtils.removeAttributes(a,["style","border"]),utils.each(domUtils.getElementsByTagName(a,"td"),function(a){e(a)&&domUtils.fillNode(h.document,a),b(a,!0)})}),g.html=j.innerHTML}),N.addListener("afterpaste",function(){utils.each(domUtils.getElementsByTagName(N.body,"table"),function(a){if(a.offsetWidth>N.body.offsetWidth){var b=$(N,a);a.style.width=N.body.offsetWidth-(ja?2*parseInt(domUtils.getComputedStyle(N.body,"margin-left"),10):0)-2*b.tableBorder-(N.options.offsetWidth||0)+"px"}})}),N.addListener("blur",function(){a=null});var i;N.addListener("keydown",function(){clearTimeout(i),i=setTimeout(function(){var a=N.selection.getRange(),b=domUtils.findParentByTagName(a.startContainer,["th","td"],!0);if(b){var c=b.parentNode.parentNode.parentNode;c.offsetWidth>c.getAttribute("width")&&(b.style.wordBreak="break-all")}},100)}),N.addListener("selectionchange",function(){m(N,!1,"",null)}),N.addListener("contentchange",function(){var a=this;if(I(a),!Z(a)){var b=a.selection.getRange(),c=b.startContainer;c=domUtils.findParentByTagName(c,["td","th"],!0),utils.each(domUtils.getElementsByTagName(a.document,"table"),function(b){a.fireEvent("excludetable",b)!==!0&&(b.ueTable=new X(b),b.onmouseover=function(){a.fireEvent("tablemouseover",b)},b.onmousemove=function(){a.fireEvent("tablemousemove",b),a.options.tableDragable&&h(!0,this,a),utils.defer(function(){a.fireEvent("contentchange",50)},!0)},b.onmouseout=function(){a.fireEvent("tablemouseout",b),m(a,!1,"",null),I(a)},b.onclick=function(b){b=a.window.event||b;var c=d(b.target||b.srcElement);if(c){var e,f=Y(c),g=f.table,h=f.getCellInfo(c),i=a.selection.getRange();if(j(g,c,b,!0)){var k=f.getCell(f.indexTable[f.rowsNum-1][h.colIndex].rowIndex,f.indexTable[f.rowsNum-1][h.colIndex].cellIndex);return void(b.shiftKey&&f.selectedTds.length?f.selectedTds[0]!==k?(e=f.getCellsRange(f.selectedTds[0],k),f.setSelected(e)):i&&i.selectNodeContents(k).select():c!==k?(e=f.getCellsRange(c,k),f.setSelected(e)):i&&i.selectNodeContents(k).select())}if(j(g,c,b)){var l=f.getCell(f.indexTable[h.rowIndex][f.colsNum-1].rowIndex,f.indexTable[h.rowIndex][f.colsNum-1].cellIndex);b.shiftKey&&f.selectedTds.length?f.selectedTds[0]!==l?(e=f.getCellsRange(f.selectedTds[0],l),f.setSelected(e)):i&&i.selectNodeContents(l).select():c!==l?(e=f.getCellsRange(c,l),f.setSelected(e)):i&&i.selectNodeContents(l).select()}}})}),K(a,!0)}}),domUtils.on(N.document,"mousemove",g),domUtils.on(N.document,"mouseout",function(a){var b=a.target||a.srcElement;"TABLE"==b.tagName&&m(N,!1,"",null)}),N.addListener("interlacetable",function(a,b,c){if(b)for(var d=this,e=b.rows,f=e.length,g=function(a,b,c){return a[b]?a[b]:c?a[b%a.length]:""},h=0;h1?k:f.getCellInfo(d).rowIndex;var g=f.getTabNextCell(d,k);g?e(g)?a.setStart(g,0).setCursor(!1,!0):a.selectNodeContents(g).select():(N.fireEvent("saveScene"),N.__hasEnterExecCommand=!0,this.execCommand("insertrownext"),N.__hasEnterExecCommand=!1,a=this.selection.getRange(),a.setStart(c.rows[c.rows.length-1].cells[0],0).setCursor(),N.fireEvent("saveScene"))}return!0}}),browser.ie&&N.addListener("selectionchange",function(){m(this,!1,"",null)}),N.addListener("keydown",function(a,b){var c=this,d=b.keyCode||b.which;if(8!=d&&46!=d){var e=!(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey);e&&_(domUtils.getElementsByTagName(c.body,"td"));var f=Z(c);f&&e&&f.clearSelected()}}),N.addListener("beforegetcontent",function(){K(this,!1),browser.ie&&utils.each(this.document.getElementsByTagName("caption"),function(a){domUtils.isEmptyNode(a)&&(a.innerHTML=" ")})}),N.addListener("aftergetcontent",function(){K(this,!0)}),N.addListener("getAllHtml",function(){_(N.document.getElementsByTagName("td"))}),N.addListener("fullscreenchanged",function(a,b){if(!b){var c=this.body.offsetWidth/document.body.offsetWidth,d=domUtils.getElementsByTagName(this.body,"table");utils.each(d,function(a){if(a.offsetWidth1||c[e].getAttribute("rowspan")>1)return-1;return b?"enablesort"==a^"sortEnabled"!=b.getAttribute("data-sort")?-1:0:-1},execCommand:function(a){var b=d(this).table;b.setAttribute("data-sort","enablesort"==a?"sortEnabled":"sortDisabled"),"enablesort"==a?domUtils.addClass(b,"sortEnabled"):domUtils.removeClasses(b,"sortEnabled")}}},UE.plugins.contextmenu=function(){var a=this;if(a.setOpt("enableContextMenu",a.getOpt("enableContextMenu")||!0),a.getOpt("enableContextMenu")!==!1){var b,c=a.getLang("contextMenu"),d=a.options.contextMenu||[{label:c.selectall,cmdName:"selectall"},{label:c.cleardoc,cmdName:"cleardoc",exec:function(){confirm(c.confirmclear)&&this.execCommand("cleardoc")}},"-",{label:c.unlink,cmdName:"unlink"},"-",{group:c.paragraph,icon:"justifyjustify",subMenu:[{label:c.justifyleft,cmdName:"justify",value:"left"},{label:c.justifyright,cmdName:"justify",value:"right"},{label:c.justifycenter,cmdName:"justify",value:"center"},{label:c.justifyjustify,cmdName:"justify",value:"justify"}]},"-",{group:c.table,icon:"table",subMenu:[{label:c.inserttable,cmdName:"inserttable"},{label:c.deletetable,cmdName:"deletetable"},"-",{label:c.deleterow,cmdName:"deleterow"},{label:c.deletecol,cmdName:"deletecol"},{label:c.insertcol,cmdName:"insertcol"},{label:c.insertcolnext,cmdName:"insertcolnext"},{label:c.insertrow,cmdName:"insertrow"},{label:c.insertrownext,cmdName:"insertrownext"},"-",{label:c.insertcaption,cmdName:"insertcaption"},{label:c.deletecaption,cmdName:"deletecaption"},{label:c.inserttitle,cmdName:"inserttitle"},{label:c.deletetitle,cmdName:"deletetitle"},{label:c.inserttitlecol,cmdName:"inserttitlecol"},{label:c.deletetitlecol,cmdName:"deletetitlecol"},"-",{label:c.mergecells,cmdName:"mergecells"},{label:c.mergeright,cmdName:"mergeright"},{label:c.mergedown,cmdName:"mergedown"},"-",{label:c.splittorows,cmdName:"splittorows"},{label:c.splittocols,cmdName:"splittocols"},{label:c.splittocells,cmdName:"splittocells"},"-",{label:c.averageDiseRow,cmdName:"averagedistributerow"},{label:c.averageDisCol,cmdName:"averagedistributecol"},"-",{label:c.edittd,cmdName:"edittd",exec:function(){UE.ui.edittd&&new UE.ui.edittd(this),this.getDialog("edittd").open()}},{label:c.edittable,cmdName:"edittable",exec:function(){UE.ui.edittable&&new UE.ui.edittable(this),this.getDialog("edittable").open()}},{label:c.setbordervisible,cmdName:"setbordervisible"}]},{group:c.tablesort,icon:"tablesort",subMenu:[{label:c.enablesort,cmdName:"enablesort"},{label:c.disablesort,cmdName:"disablesort"},"-",{label:c.reversecurrent,cmdName:"sorttable",value:"reversecurrent"},{label:c.orderbyasc,cmdName:"sorttable",value:"orderbyasc"},{label:c.reversebyasc,cmdName:"sorttable",value:"reversebyasc"},{label:c.orderbynum,cmdName:"sorttable",value:"orderbynum"},{label:c.reversebynum,cmdName:"sorttable",value:"reversebynum"}]},{group:c.borderbk,icon:"borderBack",subMenu:[{label:c.setcolor,cmdName:"interlacetable",exec:function(){this.execCommand("interlacetable")}},{label:c.unsetcolor,cmdName:"uninterlacetable",exec:function(){this.execCommand("uninterlacetable")}},{label:c.setbackground,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#bbb","#ccc"]})}},{label:c.unsetbackground,cmdName:"cleartablebackground",exec:function(){this.execCommand("cleartablebackground")}},{label:c.redandblue,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["red","blue"]})}},{label:c.threecolorgradient,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#aaa","#bbb","#ccc"]})}}]},{group:c.aligntd,icon:"aligntd",subMenu:[{cmdName:"cellalignment",value:{align:"left",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"bottom"}}]},{group:c.aligntable,icon:"aligntable",subMenu:[{cmdName:"tablealignment",className:"left",label:c.tableleft,value:"left"},{cmdName:"tablealignment",className:"center",label:c.tablecenter,value:"center"},{cmdName:"tablealignment",className:"right",label:c.tableright,value:"right"}]},"-",{label:c.insertparagraphbefore,cmdName:"insertparagraph",value:!0},{label:c.insertparagraphafter,cmdName:"insertparagraph"},{label:c.copy,cmdName:"copy"},{label:c.paste,cmdName:"paste"}];if(d.length){var e=UE.ui.uiUtils;a.addListener("contextmenu",function(f,g){var h=e.getViewportOffsetByEvent(g);a.fireEvent("beforeselectionchange"),b&&b.destroy();for(var i,j=0,k=[];i=d[j];j++){var l;!function(b){function d(){switch(b.icon){case"table":return a.getLang("contextMenu.table");case"justifyjustify":return a.getLang("contextMenu.paragraph");case"aligntd":return a.getLang("contextMenu.aligntd");case"aligntable":return a.getLang("contextMenu.aligntable");case"tablesort":return c.tablesort;case"borderBack":return c.borderbk;default:return""}}if("-"==b)(l=k[k.length-1])&&"-"!==l&&k.push("-");else if(b.hasOwnProperty("group")){for(var e,f=0,g=[];e=b.subMenu[f];f++)!function(b){"-"==b?(l=g[g.length-1])&&"-"!==l?g.push("-"):g.splice(g.length-1):(a.commands[b.cmdName]||UE.commands[b.cmdName]||b.query)&&(b.query?b.query():a.queryCommandState(b.cmdName))>-1&&g.push({label:b.label||a.getLang("contextMenu."+b.cmdName+(b.value||""))||"",className:"edui-for-"+b.cmdName+(b.className?" edui-for-"+b.cmdName+"-"+b.className:""),onclick:b.exec?function(){b.exec.call(a)}:function(){a.execCommand(b.cmdName,b.value)}})}(e);g.length&&k.push({label:d(),className:"edui-for-"+b.icon,subMenu:{items:g,editor:a}})}else(a.commands[b.cmdName]||UE.commands[b.cmdName]||b.query)&&(b.query?b.query.call(a):a.queryCommandState(b.cmdName))>-1&&k.push({label:b.label||a.getLang("contextMenu."+b.cmdName),className:"edui-for-"+(b.icon?b.icon:b.cmdName+(b.value||"")),onclick:b.exec?function(){b.exec.call(a)}:function(){a.execCommand(b.cmdName,b.value)}})}(i)}if("-"==k[k.length-1]&&k.pop(),b=new UE.ui.Menu({items:k,className:"edui-contextmenu",editor:a}),b.render(),b.showAt(h),a.fireEvent("aftershowcontextmenu",b),domUtils.preventDefault(g),browser.ie){var m;try{m=a.selection.getNative().createRange()}catch(n){return}if(m.item){var o=new dom.Range(a.document);o.selectNode(m.item(0)).select(!0,!0)}}}),a.addListener("aftershowcontextmenu",function(b,c){if(a.zeroclipboard){var d=c.items;for(var e in d)"edui-for-copy"==d[e].className&&a.zeroclipboard.clip(d[e].getDom())}})}}},UE.plugins.shortcutmenu=function(){var a,b=this,c=b.options.shortcutMenu||[];c.length&&(b.addListener("contextmenu mouseup",function(b,d){var e=this,f={type:b,target:d.target||d.srcElement,screenX:d.screenX,screenY:d.screenY,clientX:d.clientX,clientY:d.clientY};if(setTimeout(function(){var d=e.selection.getRange();d.collapsed!==!1&&"contextmenu"!=b||(a||(a=new baidu.editor.ui.ShortCutMenu({editor:e,items:c,theme:e.options.theme,className:"edui-shortcutmenu"}),a.render(),e.fireEvent("afterrendershortcutmenu",a)),a.show(f,!!UE.plugins.contextmenu))}),"contextmenu"==b&&(domUtils.preventDefault(d),browser.ie9below)){var g;try{g=e.selection.getNative().createRange()}catch(d){return}if(g.item){var h=new dom.Range(e.document);h.selectNode(g.item(0)).select(!0,!0)}}}),b.addListener("keydown",function(b){"keydown"==b&&a&&!a.isHidden&&a.hide()}))},UE.plugins.basestyle=function(){var a={bold:["strong","b"],italic:["em","i"],subscript:["sub"],superscript:["sup"]},b=function(a,b){return domUtils.filterNodeList(a.selection.getStartElementPath(),b)},c=this;c.addshortcutkey({Bold:"ctrl+66",Italic:"ctrl+73",Underline:"ctrl+85"}),c.addInputRule(function(a){utils.each(a.getNodesByTagName("b i"),function(a){switch(a.tagName){case"b":a.tagName="strong";break;case"i":a.tagName="em"}})});for(var d in a)!function(a,d){c.commands[a]={execCommand:function(a){var e=c.selection.getRange(),f=b(this,d);if(e.collapsed){if(f){var g=c.document.createTextNode("");e.insertNode(g).removeInlineStyle(d),e.setStartBefore(g),domUtils.remove(g)}else{var h=e.document.createElement(d[0]);"superscript"!=a&&"subscript"!=a||(g=c.document.createTextNode(""),e.insertNode(g).removeInlineStyle(["sub","sup"]).setStartBefore(g).collapse(!0)),e.insertNode(h).setStart(h,0)}e.collapse(!0)}else"superscript"!=a&&"subscript"!=a||f&&f.tagName.toLowerCase()==a||e.removeInlineStyle(["sub","sup"]),f?e.removeInlineStyle(d):e.applyInlineStyle(d[0]);e.select()},queryCommandState:function(){return b(this,d)?1:0}}}(d,a[d])},UE.plugins.elementpath=function(){var a,b,c=this;c.setOpt("elementPathEnabled",!0),c.options.elementPathEnabled&&(c.commands.elementpath={execCommand:function(d,e){var f=b[e],g=c.selection.getRange();a=1*e,g.selectNode(f).select()},queryCommandValue:function(){var c=[].concat(this.selection.getStartElementPath()).reverse(),d=[];b=c;for(var e,f=0;e=c[f];f++)if(3!=e.nodeType){var g=e.tagName.toLowerCase();if("img"==g&&e.getAttribute("anchorname")&&(g="anchor"),d[f]=g,a==f){a=-1;break}}return d}})},UE.plugins.formatmatch=function(){function a(f,g){function h(a){return m&&a.selectNode(m),a.applyInlineStyle(d[d.length-1].tagName,null,d)}if(browser.webkit)var i="IMG"==g.target.tagName?g.target:null;c.undoManger&&c.undoManger.save();var j=c.selection.getRange(),k=i||j.getClosedNode();if(b&&k&&"IMG"==k.tagName)k.style.cssText+=";float:"+(b.style.cssFloat||b.style.styleFloat||"none")+";display:"+(b.style.display||"inline"),b=null;else if(!b){var l=j.collapsed;if(l){var m=c.document.createTextNode("match");j.insertNode(m).select()}c.__hasEnterExecCommand=!0;var n=c.options.removeFormatAttributes;c.options.removeFormatAttributes="",c.execCommand("removeformat"),c.options.removeFormatAttributes=n,c.__hasEnterExecCommand=!1,j=c.selection.getRange(),d.length&&h(j),m&&j.setStartBefore(m).collapse(!0),j.select(),m&&domUtils.remove(m)}c.undoManger&&c.undoManger.save(),c.removeListener("mouseup",a),e=0}var b,c=this,d=[],e=0;c.addListener("reset",function(){d=[],e=0}),c.commands.formatmatch={execCommand:function(f){if(e)return e=0,d=[],void c.removeListener("mouseup",a);var g=c.selection.getRange();if(b=g.getClosedNode(),!b||"IMG"!=b.tagName){g.collapse(!0).shrinkBoundary();var h=g.startContainer;d=domUtils.findParents(h,!0,function(a){return!domUtils.isBlockElm(a)&&1==a.nodeType});for(var i,j=0;i=d[j];j++)if("A"==i.tagName){d.splice(j,1);break}}c.addListener("mouseup",a),e=1},queryCommandState:function(){return e},notNeedUndo:1}},UE.plugin.register("searchreplace",function(){function a(a){var b=3==a.nodeType?a.nodeValue:a[browser.ie?"innerText":"textContent"];return b.replace(domUtils.fillChar,"")}function b(a,b,c){var d,e=b.searchStr,f=new RegExp(e,"g"+(b.casesensitive?"":"i"));if(b.dir==-1){if(a=a.substr(0,c),a=a.split("").reverse().join(""),e=e.split("").reverse().join(""),d=f.exec(a))return c-d.index-e.length}else if(a=a.substr(c),d=f.exec(a))return d.index+c;return-1}function c(c,d,e){var f,g,i=e.all||1==e.dir?"getNextDomNode":"getPreDomNode";domUtils.isBody(c)&&(c=c.firstChild);for(var j=1;c;){if(f=a(c),g=b(f,e,d),j=0,g!=-1)return{node:c,index:g};for(c=domUtils[i](c);c&&h[c.nodeName.toLowerCase()];)c=domUtils[i](c,!0);c&&(d=e.dir==-1?a(c).length:0)}}function d(b,c,e){for(var f,g=0,h=b.firstChild,i=0;h;){if(3==h.nodeType){if(i=a(h).replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,g+=i,g>=c)return{node:h,index:i-(g-c)}}else if(!dtd.$empty[h.tagName]&&(i=a(h).replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,g+=i,g>=c&&(f=d(h,i-(g-c),e))))return f;h=domUtils.getNextDomNode(h)}}function e(b,e){var g,h=i||b.selection.getRange(),j=e.searchStr,k=b.document.createElement("span");if(k.innerHTML="$$ueditor_searchreplace_key$$",h.shrinkBoundary(!0),!h.collapsed){h.select();var l=b.selection.getText();if(new RegExp("^"+e.searchStr+"$",e.casesensitive?"":"i").test(l)){if(void 0!=e.replaceStr)return f(h,e.replaceStr),h.select(),!0;h.collapse(e.dir==-1)}}h.insertNode(k),h.enlargeToBlockElm(!0),g=h.startContainer;var m=a(g).indexOf("$$ueditor_searchreplace_key$$");h.setStartBefore(k),domUtils.remove(k);var n=c(g,m,e);if(n){var o=d(n.node,n.index,j),p=d(n.node,n.index+j.length,j);return h.setStart(o.node,o.index).setEnd(p.node,p.index),void 0!==e.replaceStr&&f(h,e.replaceStr),h.select(),!0}h.setCursor()}function f(a,b){b=g.document.createTextNode(b),a.deleteContents().insertNode(b)}var g=this,h={table:1,tbody:1,tr:1,ol:1,ul:1},i=null;return{commands:{searchreplace:{execCommand:function(a,b){utils.extend(b,{all:!1,casesensitive:!1,dir:1},!0);var c=0;if(b.all){i=null;var d=g.selection.getRange(),f=g.body.firstChild;for(f&&1==f.nodeType?(d.setStart(f,0),d.shrinkBoundary(!0)):3==f.nodeType&&d.setStartBefore(f),d.collapse(!0).select(!0),void 0!==b.replaceStr&&g.fireEvent("saveScene");e(this,b);)c++,i=g.selection.getRange(),i.collapse(b.dir==-1);c&&g.fireEvent("saveScene")}else void 0!==b.replaceStr&&g.fireEvent("saveScene"),e(this,b)&&(c++,i=g.selection.getRange(),i.collapse(b.dir==-1)),c&&g.fireEvent("saveScene");return c},notNeedUndo:1}},bindEvents:{clearlastSearchResult:function(){i=null}}}}),UE.plugins.customstyle=function(){var a=this;a.setOpt({customstyle:[{tag:"h1",name:"tc",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;"},{tag:"h1",name:"tl",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:left;margin:0 0 10px 0;"},{tag:"span",name:"im",style:"font-size:16px;font-style:italic;font-weight:bold;line-height:18px;"},{tag:"span",name:"hi",style:"font-size:16px;font-style:italic;font-weight:bold;color:rgb(51, 153, 204);line-height:18px;"}]}),a.commands.customstyle={execCommand:function(a,b){var c,d,e=this,f=b.tag,g=domUtils.findParent(e.selection.getStart(),function(a){return a.getAttribute("label")},!0),h={};for(var i in b)void 0!==b[i]&&(h[i]=b[i]);if(delete h.tag,g&&g.getAttribute("label")==b.label){if(c=this.selection.getRange(),d=c.createBookmark(),c.collapsed)if(dtd.$block[g.tagName]){var j=e.document.createElement("p");domUtils.moveChild(g,j),g.parentNode.insertBefore(j,g),domUtils.remove(g)}else domUtils.remove(g,!0);else{var k=domUtils.getCommonAncestor(d.start,d.end),l=domUtils.getElementsByTagName(k,f);new RegExp(f,"i").test(k.tagName)&&l.push(k);for(var m,n=0;m=l[n++];)if(m.getAttribute("label")==b.label){var o=domUtils.getPosition(m,d.start),p=domUtils.getPosition(m,d.end);if((o&domUtils.POSITION_FOLLOWING||o&domUtils.POSITION_CONTAINS)&&(p&domUtils.POSITION_PRECEDING||p&domUtils.POSITION_CONTAINS)&&dtd.$block[f]){var j=e.document.createElement("p");domUtils.moveChild(m,j),m.parentNode.insertBefore(j,m)}domUtils.remove(m,!0)}g=domUtils.findParent(k,function(a){return a.getAttribute("label")==b.label},!0),g&&domUtils.remove(g,!0)}c.moveToBookmark(d).select()}else if(dtd.$block[f]){if(this.execCommand("paragraph",f,h,"customstyle"),c=e.selection.getRange(),!c.collapsed){c.collapse(),g=domUtils.findParent(e.selection.getStart(),function(a){return a.getAttribute("label")==b.label},!0);var q=e.document.createElement("p");domUtils.insertAfter(g,q),domUtils.fillNode(e.document,q),c.setStart(q,0).setCursor()}}else{if(c=e.selection.getRange(),c.collapsed)return g=e.document.createElement(f),domUtils.setAttributes(g,h),void c.insertNode(g).setStart(g,0).setCursor();d=c.createBookmark(),c.applyInlineStyle(f,h).moveToBookmark(d).select()}},queryCommandValue:function(){var a=domUtils.filterNodeList(this.selection.getStartElementPath(),function(a){return a.getAttribute("label")});return a?a.getAttribute("label"):""}},a.addListener("keyup",function(b,c){var d=c.keyCode||c.which;if(32==d||13==d){var e=a.selection.getRange();if(e.collapsed){var f=domUtils.findParent(a.selection.getStart(),function(a){return a.getAttribute("label")},!0);if(f&&dtd.$block[f.tagName]&&domUtils.isEmptyNode(f)){var g=a.document.createElement("p");domUtils.insertAfter(f,g),domUtils.fillNode(a.document,g),domUtils.remove(f),e.setStart(g,0).setCursor()}}}})},UE.plugins.catchremoteimage=function(){var me=this,ajax=UE.ajax;me.options.catchRemoteImageEnable!==!1&&(me.setOpt({catchRemoteImageEnable:!1}),me.addListener("afterpaste",function(){me.fireEvent("catchRemoteImage")}),me.addListener("catchRemoteImage",function(){function catchremoteimage(a,b){var c=utils.serializeParam(me.queryCommandValue("serverparam"))||"",d=utils.formatUrl(catcherActionUrl+(catcherActionUrl.indexOf("?")==-1?"?":"&")+c),e=utils.isCrossDomainUrl(d),f={method:"POST",dataType:e?"jsonp":"",timeout:6e4,onsuccess:b.success,onerror:b.error};f[catcherFieldName]=a,ajax.request(d,f)}for(var catcherLocalDomain=me.getOpt("catcherLocalDomain"),catcherActionUrl=me.getActionUrl(me.getOpt("catcherActionName")),catcherUrlPrefix=me.getOpt("catcherUrlPrefix"),catcherFieldName=me.getOpt("catcherFieldName"),remoteImages=[],loadingIMG=me.options.themePath+me.options.theme+"/images/spacer.gif",imgs=me.document.querySelectorAll('[style*="url"],img'),test=function(a,b){if(a.indexOf(location.host)!=-1||/(^\.)|(^\/)/.test(a))return!0;if(b)for(var c,d=0;c=b[d++];)if(a.indexOf(c)!==-1)return!0;return!1},i=0,ci;ci=imgs[i++];)if(!ci.getAttribute("word_img"))if("IMG"==ci.nodeName){var src=ci.getAttribute("_src")||ci.src||"";/^(https?|ftp):/i.test(src)&&!test(src,catcherLocalDomain)&&(remoteImages.push(src),domUtils.setAttributes(ci,{"class":"loadingclass",_src:src,src:loadingIMG}))}else{var backgroundImageurl=ci.style.cssText.replace(/.*\s?url\([\'\"]?/,"").replace(/[\'\"]?\).*/,"");/^(https?|ftp):/i.test(backgroundImageurl)&&!test(backgroundImageurl,catcherLocalDomain)&&(remoteImages.push(backgroundImageurl),ci.style.cssText=ci.style.cssText.replace(backgroundImageurl,loadingIMG),domUtils.setAttributes(ci,{"data-background":backgroundImageurl}))}remoteImages.length&&catchremoteimage(remoteImages,{success:function(r){try{var info=void 0!==r.state?r:eval("("+r.responseText+")")}catch(e){return}var i,j,ci,cj,oldSrc,newSrc,list=info.list,catchFailList=[],catchSuccessList=[],failIMG=me.options.themePath+me.options.theme+"/images/img-cracked.png";for(i=0;ci=imgs[i++];)for(oldSrc=ci.getAttribute("_src")||ci.src||"",oldBgIMG=ci.getAttribute("data-background")||"",j=0;cj=list[j++];){if(oldSrc==cj.source&&"SUCCESS"==cj.state){newSrc=catcherUrlPrefix+cj.url,domUtils.removeClasses(ci,"loadingclass"),domUtils.setAttributes(ci,{src:newSrc,_src:newSrc,"data-catchResult":"img_catchSuccess"}),catchSuccessList.push(ci);break}if(oldSrc==cj.source&&"FAIL"==cj.state){domUtils.removeClasses(ci,"loadingclass"),domUtils.setAttributes(ci,{src:failIMG,_src:failIMG,"data-catchResult":"img_catchFail"}),catchFailList.push(ci);break}if(oldBgIMG==cj.source&&"SUCCESS"==cj.state){newBgIMG=catcherUrlPrefix+cj.url,ci.style.cssText=ci.style.cssText.replace(loadingIMG,newBgIMG),domUtils.removeAttributes(ci,"data-background"),domUtils.setAttributes(ci,{"data-catchResult":"img_catchSuccess"}),catchSuccessList.push(ci);break}if(oldBgIMG==cj.source&&"FAIL"==cj.state){ci.style.cssText=ci.style.cssText.replace(loadingIMG,failIMG),domUtils.removeAttributes(ci,"data-background"),domUtils.setAttributes(ci,{"data-catchResult":"img_catchFail"}),catchFailList.push(ci);break}}me.fireEvent("catchremotesuccess",catchSuccessList,catchFailList)},error:function(){me.fireEvent("catchremoteerror")}})}))},UE.plugin.register("snapscreen",function(){function getLocation(a){var b,c=document.createElement("a"),d=utils.serializeParam(me.queryCommandValue("serverparam"))||"";return c.href=a,browser.ie&&(c.href=c.href),b=c.search,d&&(b=b+(b.indexOf("?")==-1?"?":"&")+d,b=b.replace(/[&]+/gi,"&")),{port:c.port,hostname:c.hostname,path:c.pathname+b||+c.hash}}var me=this,snapplugin;return{commands:{snapscreen:{execCommand:function(cmd){function onSuccess(rs){try{if(rs=eval("("+rs+")"),"SUCCESS"==rs.state){var opt=me.options;me.execCommand("insertimage",{src:opt.snapscreenUrlPrefix+rs.url,_src:opt.snapscreenUrlPrefix+rs.url,alt:rs.title||"",floatStyle:opt.snapscreenImgAlign})}else alert(rs.state)}catch(e){alert(lang.callBackErrorMsg)}}var url,local,res,lang=me.getLang("snapScreen_plugin");if(!snapplugin){var container=me.container,doc=me.container.ownerDocument||me.container.document;snapplugin=doc.createElement("object");try{snapplugin.type="application/x-pluginbaidusnap"}catch(e){return}snapplugin.style.cssText="position:absolute;left:-9999px;width:0;height:0;",snapplugin.setAttribute("width","0"),snapplugin.setAttribute("height","0"),container.appendChild(snapplugin)}url=me.getActionUrl(me.getOpt("snapscreenActionName")),local=getLocation(url),setTimeout(function(){try{res=snapplugin.saveSnapshot(local.hostname,local.path,local.port)}catch(a){return void me.ui._dialogs.snapscreenDialog.open()}onSuccess(res)},50)},queryCommandState:function(){return navigator.userAgent.indexOf("Windows",0)!=-1?0:-1}}}}}),UE.commands.insertparagraph={execCommand:function(a,b){for(var c,d=this,e=d.selection.getRange(),f=e.startContainer;f&&!domUtils.isBody(f);)c=f,f=f.parentNode;if(c){var g=d.document.createElement("p");b?c.parentNode.insertBefore(g,c):c.parentNode.insertBefore(g,c.nextSibling),domUtils.fillNode(d.document,g),e.setStart(g,0).setCursor(!1,!0)}}},UE.plugin.register("webapp",function(){function a(a,c){return c?'':'"}var b=this;return{outputRule:function(b){utils.each(b.getNodesByTagName("img"),function(b){var c;if("edui-faked-webapp"==b.getAttr("class")){c=a({title:b.getAttr("title"),width:b.getAttr("width"),height:b.getAttr("height"),align:b.getAttr("align"),cssfloat:b.getStyle("float"),url:b.getAttr("_url"),logo:b.getAttr("_logo_url")},!0);var d=UE.uNode.createElement(c);b.parentNode.replaceChild(d,b)}})},inputRule:function(b){utils.each(b.getNodesByTagName("iframe"),function(b){if("edui-faked-webapp"==b.getAttr("class")){var c=UE.uNode.createElement(a({title:b.getAttr("title"),width:b.getAttr("width"),height:b.getAttr("height"),align:b.getAttr("align"),cssfloat:b.getStyle("float"),url:b.getAttr("src"),logo:b.getAttr("logo_url")}));b.parentNode.replaceChild(c,b)}})},commands:{webapp:{execCommand:function(b,c){var d=this,e=a(utils.extend(c,{align:"none"}),!1);d.execCommand("inserthtml",e)},queryCommandState:function(){var a=this,b=a.selection.getRange().getClosedNode(),c=b&&"edui-faked-webapp"==b.className;return c?1:0}}}}}),UE.plugins.template=function(){UE.commands.template={execCommand:function(a,b){b.html&&this.execCommand("inserthtml",b.html)}},this.addListener("click",function(a,b){var c=b.target||b.srcElement,d=this.selection.getRange(),e=domUtils.findParent(c,function(a){if(a.className&&domUtils.hasClass(a,"ue_t"))return a},!0);e&&d.selectNode(e).shrinkBoundary().select()}),this.addListener("keydown",function(a,b){var c=this.selection.getRange();if(!c.collapsed&&!(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)){var d=domUtils.findParent(c.startContainer,function(a){if(a.className&&domUtils.hasClass(a,"ue_t"))return a},!0);d&&domUtils.removeClasses(d,["ue_t"])}})},UE.plugin.register("music",function(){function a(a,c,d,e,f,g){return g?'':"'}var b=this;return{outputRule:function(b){utils.each(b.getNodesByTagName("img"),function(b){var c;if("edui-faked-music"==b.getAttr("class")){var d=b.getStyle("float"),e=b.getAttr("align");c=a(b.getAttr("_url"),b.getAttr("width"),b.getAttr("height"),e,d,!0);var f=UE.uNode.createElement(c);b.parentNode.replaceChild(f,b)}})},inputRule:function(b){utils.each(b.getNodesByTagName("embed"),function(b){if("edui-faked-music"==b.getAttr("class")){var c=b.getStyle("float"),d=b.getAttr("align");html=a(b.getAttr("src"),b.getAttr("width"),b.getAttr("height"),d,c,!1);var e=UE.uNode.createElement(html);b.parentNode.replaceChild(e,b)}})},commands:{music:{execCommand:function(b,c){var d=this,e=a(c.url,c.width||400,c.height||95,"none",!1);d.execCommand("inserthtml",e)},queryCommandState:function(){var a=this,b=a.selection.getRange().getClosedNode(),c=b&&"edui-faked-music"==b.className;return c?1:0}}}}}),UE.plugin.register("autoupload",function(){function a(a,b){var c,d,e,f,g,h,i,j,k=b,l=/image\/\w+/i.test(a.type)?"image":"file",m="loading_"+(+new Date).toString(36);if(c=k.getOpt(l+"FieldName"),d=k.getOpt(l+"UrlPrefix"),e=k.getOpt(l+"MaxSize"),f=k.getOpt(l+"AllowFiles"),g=k.getActionUrl(k.getOpt(l+"ActionName")),i=function(a){var b=k.document.getElementById(m);b&&domUtils.remove(b),k.fireEvent("showmessage",{id:m,content:a,type:"error",timeout:4e3})},"image"==l?(h='',j=function(a){var b=d+a.url,c=k.document.getElementById(m);c&&(domUtils.removeClasses(c,"loadingclass"),c.setAttribute("src",b),c.setAttribute("_src",b),c.setAttribute("alt",a.original||""),c.removeAttribute("id"),k.trigger("contentchange",c))}):(h='

                      ',j=function(a){var b=d+a.url,c=k.document.getElementById(m),e=k.selection.getRange(),f=e.createBookmark();e.selectNode(c).select(),k.execCommand("insertfile",{url:b}),e.moveToBookmark(f).select()}),k.execCommand("inserthtml",h),!k.getOpt(l+"ActionName"))return void i(k.getLang("autoupload.errorLoadConfig"));if(a.size>e)return void i(k.getLang("autoupload.exceedSizeError"));var n=a.name?a.name.substr(a.name.lastIndexOf(".")):"";if(n&&"image"!=l||f&&(f.join("")+".").indexOf(n.toLowerCase()+".")==-1)return void i(k.getLang("autoupload.exceedTypeError"));var o=new XMLHttpRequest,p=new FormData,q=utils.serializeParam(k.queryCommandValue("serverparam"))||"",r=utils.formatUrl(g+(g.indexOf("?")==-1?"?":"&")+q);p.append(c,a,a.name||"blob."+a.type.substr("image/".length)),p.append("type","ajax"),o.open("post",r,!0),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.addEventListener("load",function(a){try{var b=new Function("return "+utils.trim(a.target.response))();"SUCCESS"==b.state&&b.url?j(b):i(b.state)}catch(c){i(k.getLang("autoupload.loadError"))}}),o.send(p)}function b(a){return a.clipboardData&&a.clipboardData.items&&1==a.clipboardData.items.length&&/^image\//.test(a.clipboardData.items[0].type)?a.clipboardData.items:null}function c(a){return a.dataTransfer&&a.dataTransfer.files?a.dataTransfer.files:null}return{outputRule:function(a){utils.each(a.getNodesByTagName("img"),function(a){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(a.getAttr("class"))&&a.parentNode.removeChild(a)}),utils.each(a.getNodesByTagName("p"),function(a){/\bloadpara\b/.test(a.getAttr("class"))&&a.parentNode.removeChild(a)})},bindEvents:{defaultOptions:{enableDragUpload:!0,enablePasteUpload:!0},ready:function(d){var e=this;if(window.FormData&&window.FileReader){var f=function(d){var f,g=!1;if(f="paste"==d.type?b(d):c(d)){for(var h,i=f.length;i--;)h=f[i],h.getAsFile&&(h=h.getAsFile()),h&&h.size>0&&(a(h,e),g=!0);g&&d.preventDefault()}};e.getOpt("enablePasteUpload")!==!1&&domUtils.on(e.body,"paste ",f), -e.getOpt("enableDragUpload")!==!1?(domUtils.on(e.body,"drop",f),domUtils.on(e.body,"dragover",function(a){"Files"==a.dataTransfer.types[0]&&a.preventDefault()})):browser.gecko&&domUtils.on(e.body,"drop",function(a){c(a)&&a.preventDefault()}),utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-left:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document)}}}}}),UE.plugin.register("autosave",function(){function a(a){var f;if(!(new Date-c0?b._saveFlag=window.setTimeout(function(){a(b)},b.options.saveInterval):a(b))}},commands:{clearlocaldata:{execCommand:function(a,c){e&&b.getPreferences(e)&&b.removePreferences(e)},notNeedUndo:!0,ignoreContentChange:!0},getlocaldata:{execCommand:function(a,c){return e?b.getPreferences(e)||"":""},notNeedUndo:!0,ignoreContentChange:!0},drafts:{execCommand:function(a,c){e&&window.setTimeout(function(){b.body.innerHTML=b.getPreferences(e)||"

                      "+domUtils.fillHtml+"

                      "},0)},queryCommandState:function(){return e?null===b.getPreferences(e)?-1:0:-1},notNeedUndo:!0,ignoreContentChange:!0}}}}),UE.plugin.register("charts",function(){function a(a){var b=null,c=0;if(a.rows.length<2)return!1;if(a.rows[0].cells.length<2)return!1;b=a.rows[0].cells,c=b.length;for(var d,e=0;d=b[e];e++)if("th"!==d.tagName.toLowerCase())return!1;for(var f,e=1;f=a.rows[e];e++){if(f.cells.length!=c)return!1;if("th"!==f.cells[0].tagName.toLowerCase())return!1;for(var d,g=1;d=f.cells[g];g++){var h=utils.trim(d.innerText||d.textContent||"");if(h=h.replace(new RegExp(UE.dom.domUtils.fillChar,"g"),"").replace(/^\s+|\s+$/g,""),!/^\d*\.?\d+$/.test(h))return!1}}return!0}var b=this;return{bindEvents:{chartserror:function(){}},commands:{charts:{execCommand:function(c,d){var e=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0),f=[],g={};if(!e)return!1;if(!a(e))return b.fireEvent("chartserror"),!1;g.title=d.title||"",g.subTitle=d.subTitle||"",g.xTitle=d.xTitle||"",g.yTitle=d.yTitle||"",g.suffix=d.suffix||"",g.tip=d.tip||"",g.dataFormat=d.tableDataFormat||"",g.chartType=d.chartType||0;for(var h in g)g.hasOwnProperty(h)&&f.push(h+":"+g[h]);e.setAttribute("data-chart",f.join(";")),domUtils.addClass(e,"edui-charts-table")},queryCommandState:function(b,c){var d=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0);return d&&a(d)?0:-1}}},inputRule:function(a){utils.each(a.getNodesByTagName("table"),function(a){void 0!==a.getAttr("data-chart")&&a.setAttr("style")})},outputRule:function(a){utils.each(a.getNodesByTagName("table"),function(a){void 0!==a.getAttr("data-chart")&&a.setAttr("style","display: none;")})}}}),UE.plugin.register("section",function(){function a(a){this.tag="",this.level=-1,this.dom=null,this.nextSection=null,this.previousSection=null,this.parentSection=null,this.startAddress=[],this.endAddress=[],this.children=[]}function b(b){var c=new a;return utils.extend(c,b)}function c(a,b){for(var c=b,d=0;d=0){var o=h.selection.getRange().selectNode(i).createAddress(!0).startAddress,p=b({tag:i.tagName,title:i.innerText||i.textContent||"",level:f,dom:i,startAddress:utils.clone(o,[]),endAddress:utils.clone(o,[]),children:[]});for(j.nextSection=p,p.previousSection=j,g=j;f<=g.level;)g=g.parentSection;p.parentSection=g,g.children.push(p),k=j=p}else 1===i.nodeType&&e(i,c),k&&k.endAddress[k.endAddress.length-1]++}for(var f=c||["h1","h2","h3","h4","h5","h6"],g=0;g=c.length);f++){if(c[f]>a[f]){d=!0;break}if(c[f]=c.length);f++){if(c[f]a[f])break}return d&&e}var g,h,i=this;if(b&&d&&d.level!=-1&&(g=e?d.endAddress:d.startAddress,h=c(g,i.body),g&&h&&!f(b.startAddress,b.endAddress,g))){var j,k,l=c(b.startAddress,i.body),m=c(b.endAddress,i.body);if(e)for(j=m;j&&!(domUtils.getPosition(l,j)&domUtils.POSITION_FOLLOWING)&&(k=j.previousSibling,domUtils.insertAfter(h,j),j!=l);)j=k;else for(j=l;j&&!(domUtils.getPosition(j,m)&domUtils.POSITION_FOLLOWING)&&(k=j.nextSibling,h.parentNode.insertBefore(j,h),j!=m);)j=k;i.fireEvent("updateSections")}}},deletesection:{execCommand:function(a,b,c){function d(a){for(var b=e.body,c=0;c',b.className="edui-"+c.options.theme,b.id=c.ui.id+"_iframeupload",i.style.cssText=g,i.style.width=a+"px",i.style.height=e+"px",i.appendChild(b),i.parentNode&&(i.parentNode.style.width=a+"px",i.parentNode.style.height=a+"px");var k=h.getElementById("edui_form_"+j),l=h.getElementById("edui_input_"+j),m=h.getElementById("edui_iframe_"+j);domUtils.on(l,"change",function(){function a(){try{var e,f,g,h=(m.contentDocument||m.contentWindow.document).body,i=h.innerText||h.textContent||"";f=new Function("return "+i)(),e=c.options.imageUrlPrefix+f.url,"SUCCESS"==f.state&&f.url?(g=c.document.getElementById(d),domUtils.removeClasses(g,"loadingclass"),domUtils.on(g,"load",function(){c.fireEvent("contentchange")}),g.setAttribute("src",e),g.setAttribute("_src",e),g.setAttribute("alt",f.original||""),g.removeAttribute("id")):b&&b(f.state)}catch(j){b&&b(c.getLang("simpleupload.loadError"))}k.reset(),domUtils.un(m,"load",a)}function b(a){if(d){var b=c.document.getElementById(d);b&&domUtils.remove(b),c.fireEvent("showmessage",{id:d,content:a,type:"error",timeout:4e3})}}if(l.value){var d="loading_"+(+new Date).toString(36),e=utils.serializeParam(c.queryCommandValue("serverparam"))||"",f=c.getActionUrl(c.getOpt("imageActionName")),g=c.getOpt("imageAllowFiles");if(c.focus(),c.execCommand("inserthtml",''),!c.getOpt("imageActionName"))return void errorHandler(c.getLang("autoupload.errorLoadConfig"));var h=l.value,i=h?h.substr(h.lastIndexOf(".")):"";if(!i||g&&(g.join("")+".").indexOf(i.toLowerCase()+".")==-1)return void b(c.getLang("simpleupload.exceedTypeError"));domUtils.on(m,"load",a),k.action=utils.formatUrl(f+(f.indexOf("?")==-1?"?":"&")+e),k.submit()}});var n;c.addListener("selectionchange",function(){clearTimeout(n),n=setTimeout(function(){var a=c.queryCommandState("simpleupload");a==-1?l.disabled="disabled":l.disabled=!1},400)}),d=!0}),f.style.cssText=g,b.appendChild(f)}var b,c=this,d=!1;return{bindEvents:{ready:function(){utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document)},simpleuploadbtnready:function(d,e){b=e,c.afterConfigReady(a)}},outputRule:function(a){utils.each(a.getNodesByTagName("img"),function(a){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(a.getAttr("class"))&&a.parentNode.removeChild(a)})},commands:{simpleupload:{queryCommandState:function(){return d?0:-1}}}}}),UE.plugin.register("serverparam",function(){var a={};return{commands:{serverparam:{execCommand:function(b,c,d){void 0===c||null===c?a={}:utils.isString(c)?void 0===d||null===d?delete a[c]:a[c]=d:utils.isObject(c)?utils.extend(a,c,!1):utils.isFunction(c)&&utils.extend(a,c(),!1)},queryCommandValue:function(){return a||{}}}}}}),UE.plugin.register("insertfile",function(){function a(a){var b=a.substr(a.lastIndexOf(".")+1).toLowerCase(),c={rar:"icon_rar.gif",zip:"icon_rar.gif",tar:"icon_rar.gif",gz:"icon_rar.gif",bz2:"icon_rar.gif",doc:"icon_doc.gif",docx:"icon_doc.gif",pdf:"icon_pdf.gif",mp3:"icon_mp3.gif",xls:"icon_xls.gif",chm:"icon_chm.gif",ppt:"icon_ppt.gif",pptx:"icon_ppt.gif",avi:"icon_mv.gif",rmvb:"icon_mv.gif",wmv:"icon_mv.gif",flv:"icon_mv.gif",swf:"icon_mv.gif",rm:"icon_mv.gif",exe:"icon_exe.gif",psd:"icon_psd.gif",txt:"icon_txt.gif",jpg:"icon_jpg.gif",png:"icon_jpg.gif",jpeg:"icon_jpg.gif",gif:"icon_jpg.gif",ico:"icon_jpg.gif",bmp:"icon_jpg.gif"};return c[b]?c[b]:c.txt}var b=this;return{commands:{insertfile:{execCommand:function(c,d){if(d=utils.isArray(d)?d:[d],b.fireEvent("beforeinsertfile",d)!==!0){var e,f,g,h,i="",j=b.getOpt("UEDITOR_HOME_URL"),k=j+("/"==j.substr(j.length-1)?"":"/")+"dialogs/attachment/fileTypeImages/";for(e=0;e'+h+"

                      ";b.execCommand("insertHtml",i),b.fireEvent("afterinsertfile",d)}}}}}}),UE.plugins.xssFilter=function(){function a(a){var b=a.tagName,d=a.attrs;return c.hasOwnProperty(b)?void UE.utils.each(d,function(d,e){c[b].indexOf(e)===-1&&a.setAttr(e)}):(a.parentNode.removeChild(a),!1)}var b=UEDITOR_CONFIG,c=b.whitList;c&&b.xssFilterRules&&(this.options.filterRules=function(){var b={};return UE.utils.each(c,function(c,d){b[d]=function(b){return a(b)}}),b}());var d=[];UE.utils.each(c,function(a,b){d.push(b)}),c&&b.inputXssFilter&&this.addInputRule(function(b){b.traversal(function(b){return"element"===b.type&&void a(b)})}),c&&b.outputXssFilter&&this.addOutputRule(function(b){b.traversal(function(b){return"element"===b.type&&void a(b)})})};var baidu=baidu||{};baidu.editor=baidu.editor||{},UE.ui=baidu.editor.ui={},function(){function a(){var a=document.getElementById("edui_fixedlayer");i.setViewportOffset(a,{left:0,top:0})}function b(b){d.on(window,"scroll",a),d.on(window,"resize",baidu.editor.utils.defer(a,0,!0))}var c=baidu.editor.browser,d=baidu.editor.dom.domUtils,e="$EDITORUI",f=window[e]={},g="ID"+e,h=0,i=baidu.editor.ui.uiUtils={uid:function(a){return a?a[g]||(a[g]=++h):++h},hook:function(a,b){var c;return a&&a._callbacks?c=a:(c=function(){var b;a&&(b=a.apply(this,arguments));for(var d=c._callbacks,e=d.length;e--;){var f=d[e].apply(this,arguments);void 0===b&&(b=f)}return b},c._callbacks=[]),c._callbacks.push(b),c},createElementByHtml:function(a){var b=document.createElement("div");return b.innerHTML=a,b=b.firstChild,b.parentNode.removeChild(b),b},getViewportElement:function(){return c.ie&&c.quirks?document.body:document.documentElement},getClientRect:function(a){var b;try{b=a.getBoundingClientRect()}catch(c){b={left:0,top:0,height:0,width:0}}for(var e,f={left:Math.round(b.left),top:Math.round(b.top),height:Math.round(b.bottom-b.top),width:Math.round(b.right-b.left)};(e=a.ownerDocument)!==document&&(a=d.getWindow(e).frameElement);)b=a.getBoundingClientRect(),f.left+=b.left,f.top+=b.top;return f.bottom=f.top+f.height,f.right=f.left+f.width,f},getViewportRect:function(){var a=i.getViewportElement(),b=0|(window.innerWidth||a.clientWidth),c=0|(window.innerHeight||a.clientHeight);return{left:0,top:0,height:c,width:b,bottom:c,right:b}},setViewportOffset:function(a,b){var c=i.getFixedLayer();a.parentNode===c?(a.style.left=b.left+"px",a.style.top=b.top+"px"):d.setViewportOffset(a,b)},getEventOffset:function(a){var b=a.target||a.srcElement,c=i.getClientRect(b),d=i.getViewportOffsetByEvent(a);return{left:d.left-c.left,top:d.top-c.top}},getViewportOffsetByEvent:function(a){var b=a.target||a.srcElement,c=d.getWindow(b).frameElement,e={left:a.clientX,top:a.clientY};if(c&&b.ownerDocument!==document){var f=i.getClientRect(c);e.left+=f.left,e.top+=f.top}return e},setGlobal:function(a,b){return f[a]=b,e+'["'+a+'"]'},unsetGlobal:function(a){delete f[a]},copyAttributes:function(a,b){for(var e=b.attributes,f=e.length;f--;){var g=e[f];"style"==g.nodeName||"class"==g.nodeName||c.ie&&!g.specified||a.setAttribute(g.nodeName,g.nodeValue)}b.className&&d.addClass(a,b.className),b.style.cssText&&(a.style.cssText+=";"+b.style.cssText)},removeStyle:function(a,b){if(a.style.removeProperty)a.style.removeProperty(b);else{if(!a.style.removeAttribute)throw"";a.style.removeAttribute(b)}},contains:function(a,b){return a&&b&&a!==b&&(a.contains?a.contains(b):16&a.compareDocumentPosition(b))},startDrag:function(a,b,c){function d(a){var c=a.clientX-g,d=a.clientY-h;b.ondragmove(c,d,a),a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function e(a){c.removeEventListener("mousemove",d,!0),c.removeEventListener("mouseup",e,!0),window.removeEventListener("mouseup",e,!0),b.ondragstop()}function f(){i.releaseCapture(),i.detachEvent("onmousemove",d),i.detachEvent("onmouseup",f),i.detachEvent("onlosecaptrue",f),b.ondragstop()}var c=c||document,g=a.clientX,h=a.clientY;if(c.addEventListener)c.addEventListener("mousemove",d,!0),c.addEventListener("mouseup",e,!0),window.addEventListener("mouseup",e,!0),a.preventDefault();else{var i=a.srcElement;i.setCapture(),i.attachEvent("onmousemove",d),i.attachEvent("onmouseup",f),i.attachEvent("onlosecaptrue",f),a.returnValue=!1}b.ondragstart()},getFixedLayer:function(){var d=document.getElementById("edui_fixedlayer");return null==d&&(d=document.createElement("div"),d.id="edui_fixedlayer",document.body.appendChild(d),c.ie&&c.version<=8?(d.style.position="absolute",b(),setTimeout(a)):d.style.position="fixed",d.style.left="0",d.style.top="0",d.style.width="0",d.style.height="0"),d},makeUnselectable:function(a){if(c.opera||c.ie&&c.version<9){if(a.unselectable="on",a.hasChildNodes())for(var b=0;b
                      '}},a.inherits(c,b)}(),function(){var a=baidu.editor.utils,b=baidu.editor.dom.domUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.uiUtils,e=baidu.editor.ui.Mask=function(a){this.initOptions(a),this.initUIBase()};e.prototype={getHtmlTpl:function(){return'
                      '},postRender:function(){var a=this;b.on(window,"resize",function(){setTimeout(function(){a.isHidden()||a._fill()})})},show:function(a){this._fill(),this.getDom().style.display="",this.getDom().style.zIndex=a},hide:function(){this.getDom().style.display="none",this.getDom().style.zIndex=""},isHidden:function(){return"none"==this.getDom().style.display},_onMouseDown:function(){return!1},_onClick:function(a,b){this.fireEvent("click",a,b)},_fill:function(){var a=this.getDom(),b=d.getViewportRect();a.style.width=b.width+"px",a.style.height=b.height+"px"}},a.inherits(e,c)}(),function(){function a(a,b){for(var c=0;c
                      '+this.getContentHtmlTpl()+"
                      "},getContentHtmlTpl:function(){return this.content?"string"==typeof this.content?this.content:this.content.renderHtml():""},_UIBase_postRender:e.prototype.postRender,postRender:function(){if(this.content instanceof e&&this.content.postRender(),this.captureWheel&&!this.captured){this.captured=!0;var a=(document.documentElement.clientHeight||document.body.clientHeight)-80,b=this.getDom().offsetHeight,f=c.getClientRect(this.combox.getDom()).top,g=this.getDom("content"),h=this.getDom("body").getElementsByTagName("iframe"),i=this;for(h.length&&(h=h[0]);f+b>a;)b-=30;g.style.height=b+"px",h&&(h.style.height=b+"px"),window.XMLHttpRequest?d.on(g,"onmousewheel"in document.body?"mousewheel":"DOMMouseScroll",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1,a.wheelDelta?g.scrollTop-=a.wheelDelta/120*60:g.scrollTop-=a.detail/-3*60}):d.on(this.getDom(),"mousewheel",function(a){a.returnValue=!1,i.getDom("content").scrollTop-=a.wheelDelta/120*60})}this.fireEvent("postRenderAfter"),this.hide(!0),this._UIBase_postRender()},_doAutoRender:function(){!this.getDom()&&this.autoRender&&this.render()},mesureSize:function(){var a=this.getDom("content");return c.getClientRect(a)},fitSize:function(){if(this.captureWheel&&this.sized)return this.__size;this.sized=!0;var a=this.getDom("body");a.style.width="",a.style.height="";var b=this.mesureSize();if(this.captureWheel){a.style.width=-(-20-b.width)+"px";var c=parseInt(this.getDom("content").style.height,10);!window.isNaN(c)&&(b.height=c)}else a.style.width=b.width+"px";return a.style.height=b.height+"px",this.__size=b,this.captureWheel&&(this.getDom("content").style.overflow="auto"),b},showAnchor:function(a,b){this.showAnchorRect(c.getClientRect(a),b)},showAnchorRect:function(a,b,e){this._doAutoRender();var f=c.getViewportRect();this.getDom().style.visibility="hidden",this._show();var g,i,j,k,l=this.fitSize();b?(g=this.canSideLeft&&a.right+l.width>f.right&&a.left>l.width,i=this.canSideUp&&a.top+l.height>f.bottom&&a.bottom>l.height,j=g?a.left-l.width:a.right,k=i?a.bottom-l.height:a.top):(g=this.canSideLeft&&a.right+l.width>f.right&&a.left>l.width,i=this.canSideUp&&a.top+l.height>f.bottom&&a.bottom>l.height,j=g?a.right-l.width:a.left,k=i?a.top-l.height:a.bottom);var m=this.getDom();c.setViewportOffset(m,{left:j,top:k}),d.removeClasses(m,h),m.className+=" "+h[2*(i?1:0)+(g?1:0)],this.editor&&(m.style.zIndex=1*this.editor.container.style.zIndex+10,baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=m.style.zIndex-1),this.getDom().style.visibility="visible"},showAt:function(a){var b=a.left,c=a.top,d={left:b,top:c,right:b,bottom:c,height:0,width:0};this.showAnchorRect(d,!1,!0)},_show:function(){if(this._hidden){var a=this.getDom();a.style.display="",this._hidden=!1,this.fireEvent("show")}},isHidden:function(){return this._hidden},show:function(){this._doAutoRender(),this._show()},hide:function(a){!this._hidden&&this.getDom()&&(this.getDom().style.display="none",this._hidden=!0,a||this.fireEvent("hide"))},queryAutoHide:function(a){return!a||!c.contains(this.getDom(),a)}},b.inherits(f,e),d.on(document,"mousedown",function(b){var c=b.target||b.srcElement;a(b,c)}),d.on(window,"scroll",function(b,c){a(b,c)})}(),function(){function a(a,b){for(var c='
                      '+a+'
                      ',d=0;d"+(60==d?'":"")+""),c+=d<70?'':"";return c+="
                      '+b.getLang("themeColor")+'
                      '+b.getLang("standardColor")+"
                      =60?"border-width:1px;":d>=10&&d<20?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'">
                      "}var b=baidu.editor.utils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.ColorPicker=function(a){this.initOptions(a),this.noColorText=this.noColorText||this.editor.getLang("clearColor"),this.initUIBase()};d.prototype={getHtmlTpl:function(){return a(this.noColorText,this.editor)},_onTableClick:function(a){var b=a.target||a.srcElement,c=b.getAttribute("data-color");c&&this.fireEvent("pickcolor",c)},_onTableOver:function(a){var b=a.target||a.srcElement,c=b.getAttribute("data-color");c&&(this.getDom("preview").style.backgroundColor=c)},_onTableOut:function(){this.getDom("preview").style.backgroundColor=""},_onPickNoColor:function(){this.fireEvent("picknocolor")}},b.inherits(d,c);var e="ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646,f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806,c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,".split(",")}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.TablePicker=function(a){this.initOptions(a),this.initTablePicker()};d.prototype={defaultNumRows:10,defaultNumCols:10,maxNumRows:20,maxNumCols:20,numRows:10,numCols:10,lengthOfCellSide:22,initTablePicker:function(){this.initUIBase()},getHtmlTpl:function(){return'
                      '},_UIBase_render:c.prototype.render,render:function(a){this._UIBase_render(a),this.getDom("label").innerHTML="0"+this.editor.getLang("t_row")+" x 0"+this.editor.getLang("t_col")},_track:function(a,b){var c=this.getDom("overlay").style,d=this.lengthOfCellSide;c.width=a*d+"px",c.height=b*d+"px";var e=this.getDom("label");e.innerHTML=a+this.editor.getLang("t_col")+" x "+b+this.editor.getLang("t_row"),this.numCols=a,this.numRows=b},_onMouseOver:function(a,c){var d=a.relatedTarget||a.fromElement;b.contains(c,d)||c===d||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="")},_onMouseOut:function(a,c){var d=a.relatedTarget||a.toElement;b.contains(c,d)||c===d||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="hidden")},_onMouseMove:function(a,c){var d=(this.getDom("overlay").style,b.getEventOffset(a)),e=this.lengthOfCellSide,f=Math.ceil(d.left/e),g=Math.ceil(d.top/e);this._track(f,g)},_onClick:function(){this.fireEvent("picktable",this.numCols,this.numRows)}},a.inherits(d,c)}(),function(){var a=baidu.editor.browser,b=baidu.editor.dom.domUtils,c=baidu.editor.ui.uiUtils,d='onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"'+(a.ie?' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"':' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"');baidu.editor.ui.Stateful={alwalysHoverable:!1,target:null,Stateful_init:function(){this._Stateful_dGetHtmlTpl=this.getHtmlTpl,this.getHtmlTpl=this.Stateful_getHtmlTpl},Stateful_getHtmlTpl:function(){var a=this._Stateful_dGetHtmlTpl();return a.replace(/stateful/g,function(){return d})},Stateful_onMouseEnter:function(a,b){this.target=b,this.isDisabled()&&!this.alwalysHoverable||(this.addState("hover"),this.fireEvent("over"))},Stateful_onMouseLeave:function(a,b){this.isDisabled()&&!this.alwalysHoverable||(this.removeState("hover"),this.removeState("active"),this.fireEvent("out"))},Stateful_onMouseOver:function(a,b){var d=a.relatedTarget;c.contains(b,d)||b===d||this.Stateful_onMouseEnter(a,b)},Stateful_onMouseOut:function(a,b){var d=a.relatedTarget;c.contains(b,d)||b===d||this.Stateful_onMouseLeave(a,b)},Stateful_onMouseDown:function(a,b){this.isDisabled()||this.addState("active")},Stateful_onMouseUp:function(a,b){this.isDisabled()||this.removeState("active")},Stateful_postRender:function(){this.disabled&&!this.hasState("disabled")&&this.addState("disabled")},hasState:function(a){return b.hasClass(this.getStateDom(),"edui-state-"+a)},addState:function(a){this.hasState(a)||(this.getStateDom().className+=" edui-state-"+a)},removeState:function(a){this.hasState(a)&&b.removeClasses(this.getStateDom(),["edui-state-"+a])},getStateDom:function(){return this.getDom("state")},isChecked:function(){return this.hasState("checked")},setChecked:function(a){!this.isDisabled()&&a?this.addState("checked"):this.removeState("checked")},isDisabled:function(){return this.hasState("disabled")},setDisabled:function(a){a?(this.removeState("hover"),this.removeState("checked"),this.removeState("active"),this.addState("disabled")):this.removeState("disabled")}}}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase,c=baidu.editor.ui.Stateful,d=baidu.editor.ui.Button=function(a){if(a.name){var b=a.name,c=a.cssRules;a.className||(a.className="edui-for-"+b),a.cssRules=".edui-"+(a.theme||"default")+" .edui-toolbar .edui-button.edui-for-"+b+" .edui-icon {"+c+"}"}this.initOptions(a),this.initButton()};d.prototype={uiName:"button",label:"",title:"",showIcon:!0,showText:!0,cssRules:"",initButton:function(){this.initUIBase(),this.Stateful_init(),this.cssRules&&a.cssRule("edui-customize-"+this.name+"-style",this.cssRules)},getHtmlTpl:function(){return'
                      '+(this.showIcon?'
                      ':"")+(this.showText?'
                      '+this.label+"
                      ":"")+"
                      "; -},postRender:function(){this.Stateful_postRender(),this.setDisabled(this.disabled)},_onMouseDown:function(a){var b=a.target||a.srcElement,c=b&&b.tagName&&b.tagName.toLowerCase();if("input"==c||"object"==c||"object"==c)return!1},_onClick:function(){this.isDisabled()||this.fireEvent("click")},setTitle:function(a){var b=this.getDom("label");b.innerHTML=a}},a.inherits(d,b),a.extend(d.prototype,c)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=(baidu.editor.dom.domUtils,baidu.editor.ui.UIBase),d=baidu.editor.ui.Stateful,e=baidu.editor.ui.SplitButton=function(a){this.initOptions(a),this.initSplitButton()};e.prototype={popup:null,uiName:"splitbutton",title:"",initSplitButton:function(){this.initUIBase(),this.Stateful_init();if(null!=this.popup){var a=this.popup;this.popup=null,this.setPopup(a)}},_UIBase_postRender:c.prototype.postRender,postRender:function(){this.Stateful_postRender(),this._UIBase_postRender()},setPopup:function(c){this.popup!==c&&(null!=this.popup&&this.popup.dispose(),c.addListener("show",a.bind(this._onPopupShow,this)),c.addListener("hide",a.bind(this._onPopupHide,this)),c.addListener("postrender",a.bind(function(){c.getDom("body").appendChild(b.createElementByHtml('
                      ')),c.getDom().className+=" "+this.className},this)),this.popup=c)},_onPopupShow:function(){this.addState("opened")},_onPopupHide:function(){this.removeState("opened")},getHtmlTpl:function(){return'
                      '},showPopup:function(){var a=b.getClientRect(this.getDom());a.top-=this.popup.SHADOW_RADIUS,a.height+=this.popup.SHADOW_RADIUS,this.popup.showAnchorRect(a)},_onArrowClick:function(a,b){this.isDisabled()||this.showPopup()},_onButtonClick:function(){this.isDisabled()||this.fireEvent("buttonclick")}},a.inherits(e,c),a.extend(e.prototype,d,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.ColorPicker,d=baidu.editor.ui.Popup,e=baidu.editor.ui.SplitButton,f=baidu.editor.ui.ColorButton=function(a){this.initOptions(a),this.initColorButton()};f.prototype={initColorButton:function(){var a=this;this.popup=new d({content:new c({noColorText:a.editor.getLang("clearColor"),editor:a.editor,onpickcolor:function(b,c){a._onPickColor(c)},onpicknocolor:function(b,c){a._onPickNoColor(c)}}),editor:a.editor}),this.initSplitButton()},_SplitButton_postRender:e.prototype.postRender,postRender:function(){this._SplitButton_postRender(),this.getDom("button_body").appendChild(b.createElementByHtml('
                      ')),this.getDom().className+=" edui-colorbutton"},setColor:function(a){this.getDom("colorlump").style.backgroundColor=a,this.color=a},_onPickColor:function(a){this.fireEvent("pickcolor",a)!==!1&&(this.setColor(a),this.popup.hide())},_onPickNoColor:function(a){this.fireEvent("picknocolor")!==!1&&this.popup.hide()}},a.inherits(f,e)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.Popup,c=baidu.editor.ui.TablePicker,d=baidu.editor.ui.SplitButton,e=baidu.editor.ui.TableButton=function(a){this.initOptions(a),this.initTableButton()};e.prototype={initTableButton:function(){var a=this;this.popup=new b({content:new c({editor:a.editor,onpicktable:function(b,c,d){a._onPickTable(c,d)}}),editor:a.editor}),this.initSplitButton()},_onPickTable:function(a,b){this.fireEvent("picktable",a,b)!==!1&&this.popup.hide()}},a.inherits(e,d)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase,c=baidu.editor.ui.AutoTypeSetPicker=function(a){this.initOptions(a),this.initAutoTypeSetPicker()};c.prototype={initAutoTypeSetPicker:function(){this.initUIBase()},getHtmlTpl:function(){var a=this.editor,b=a.options.autotypeset,c=a.getLang("autoTypeSet"),d="textAlignValue"+a.uid,e="imageBlockLineValue"+a.uid,f="symbolConverValue"+a.uid;return'
                      "+c.mergeLine+'"+c.delLine+'
                      "+c.removeFormat+'"+c.indent+'
                      "+c.alignment+'"+a.getLang("justifyleft")+'"+a.getLang("justifycenter")+'"+a.getLang("justifyright")+'
                      "+c.imageFloat+'"+a.getLang("default")+'"+a.getLang("justifyleft")+'"+a.getLang("justifycenter")+'"+a.getLang("justifyright")+'
                      "+c.removeFontsize+'"+c.removeFontFamily+'
                      "+c.removeHtml+'
                      "+c.pasteFilter+'
                      "+c.symbol+'"+c.bdc2sb+'"+c.tobdc+'
                      "},_UIBase_render:b.prototype.render},a.inherits(c,b)}(),function(){function a(a){for(var c,d={},e=a.getDom(),f=a.editor.uid,g=null,h=null,i=domUtils.getElementsByTagName(e,"input"),j=i.length-1;c=i[j--];)if(g=c.getAttribute("type"),"checkbox"==g)if(h=c.getAttribute("name"),d[h]&&delete d[h],c.checked){var k=document.getElementById(h+"Value"+f);if(k){if(/input/gi.test(k.tagName))d[h]=k.value;else for(var l,m=k.getElementsByTagName("input"),n=m.length-1;l=m[n--];)if(l.checked){d[h]=l.value;break}}else d[h]=!0}else d[h]=!1;else d[c.getAttribute("value")]=c.checked;for(var o,p=domUtils.getElementsByTagName(e,"select"),j=0;o=p[j++];){var q=o.getAttribute("name");d[q]=d[q]?o.value:""}b.extend(a.editor.options.autotypeset,d),a.editor.setPreferences("autotypeset",d)}var b=baidu.editor.utils,c=baidu.editor.ui.Popup,d=baidu.editor.ui.AutoTypeSetPicker,e=baidu.editor.ui.SplitButton,f=baidu.editor.ui.AutoTypeSetButton=function(a){this.initOptions(a),this.initAutoTypeSetButton()};f.prototype={initAutoTypeSetButton:function(){var b=this;this.popup=new c({content:new d({editor:b.editor}),editor:b.editor,hide:function(){!this._hidden&&this.getDom()&&(a(this),this.getDom().style.display="none",this._hidden=!0,this.fireEvent("hide"))}});var e=0;this.popup.addListener("postRenderAfter",function(){var c=this;if(!e){var d=this.getDom(),f=d.getElementsByTagName("button")[0];f.onclick=function(){a(c),b.editor.execCommand("autotypeset"),c.hide()},domUtils.on(d,"click",function(d){var e=d.target||d.srcElement,f=b.editor.uid;if(e&&"INPUT"==e.tagName){if("imageBlockLine"==e.name||"textAlign"==e.name||"symbolConver"==e.name)for(var g=e.checked,h=document.getElementById(e.name+"Value"+f),i=h.getElementsByTagName("input"),j={imageBlockLine:"none",textAlign:"left",symbolConver:"tobdc"},k=0;k"),e.push('
                      '),2===d&&e.push("");return'
                      '+e.join("")+"
                      "},getStateDom:function(){return this.target},_onClick:function(a){var c=a.target||a.srcElement;/icon/.test(c.className)&&(this.items[c.parentNode.getAttribute("index")].onclick(),b.postHide(a))},_UIBase_render:d.prototype.render},a.inherits(e,d),a.extend(e.prototype,c,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.Stateful,c=baidu.editor.ui.uiUtils,d=baidu.editor.ui.UIBase,e=baidu.editor.ui.PastePicker=function(a){this.initOptions(a),this.initPastePicker()};e.prototype={initPastePicker:function(){this.initUIBase(),this.Stateful_init()},getHtmlTpl:function(){return'
                      '+this.editor.getLang("pasteOpt")+'
                      '},getStateDom:function(){return this.target},format:function(a){this.editor.ui._isTransfer=!0,this.editor.fireEvent("pasteTransfer",a)},_onClick:function(a){var b=domUtils.getNextDomNode(a),d=c.getViewportRect().height,e=c.getClientRect(b);e.top+e.height>d?b.style.top=-e.height-a.offsetHeight+"px":b.style.top="",/hidden/gi.test(domUtils.getComputedStyle(b,"visibility"))?(b.style.visibility="visible",domUtils.addClass(a,"edui-state-opened")):(b.style.visibility="hidden",domUtils.removeClasses(a,"edui-state-opened"))},_UIBase_render:d.prototype.render},a.inherits(e,d),a.extend(e.prototype,b,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.Toolbar=function(a){this.initOptions(a),this.initToolbar()};d.prototype={items:null,initToolbar:function(){this.items=this.items||[],this.initUIBase()},add:function(a,b){void 0===b?this.items.push(a):this.items.splice(b,0,a)},getHtmlTpl:function(){for(var a=[],b=0;b'+a.join("")+"
                      "},postRender:function(){for(var a=this.getDom(),c=0;c
                      '},postRender:function(){},queryAutoHide:function(){return!0}};h.prototype={items:null,uiName:"menu",initMenu:function(){this.items=this.items||[],this.initPopup(),this.initItems()},initItems:function(){for(var a=0;a'+a.join("")+""},_Popup_postRender:e.prototype.postRender,postRender:function(){for(var a=this,d=0;d
                      '+this.renderLabelHtml()+"
                      "},postRender:function(){var a=this;this.addListener("over",function(){a.ownerMenu.fireEvent("submenuover",a),a.subMenu&&a.delayShowSubMenu()}),this.subMenu&&(this.getDom().className+=" edui-hassubmenu",this.subMenu.render(),this.addListener("out",function(){a.delayHideSubMenu()}),this.subMenu.addListener("over",function(){clearTimeout(a._closingTimer),a._closingTimer=null,a.addState("opened")}),this.ownerMenu.addListener("hide",function(){a.hideSubMenu()}),this.ownerMenu.addListener("submenuover",function(b,c){c!==a&&a.delayHideSubMenu()}),this.subMenu._bakQueryAutoHide=this.subMenu.queryAutoHide,this.subMenu.queryAutoHide=function(b){return(!b||!c.contains(a.getDom(),b))&&this._bakQueryAutoHide(b)}),this.getDom().style.tabIndex="-1",c.makeUnselectable(this.getDom()),this.Stateful_postRender()},delayShowSubMenu:function(){var a=this;a.isDisabled()||(a.addState("opened"),clearTimeout(a._showingTimer),clearTimeout(a._closingTimer),a._closingTimer=null,a._showingTimer=setTimeout(function(){a.showSubMenu()},250))},delayHideSubMenu:function(){var a=this;a.isDisabled()||(a.removeState("opened"),clearTimeout(a._showingTimer),a._closingTimer||(a._closingTimer=setTimeout(function(){a.hasState("opened")||a.hideSubMenu(),a._closingTimer=null},400)))},renderLabelHtml:function(){return'
                      '+(this.label||"")+"
                      "},getStateDom:function(){return this.getDom()},queryAutoHide:function(a){if(this.subMenu&&this.hasState("opened"))return this.subMenu.queryAutoHide(a)},_onClick:function(a,b){this.hasState("disabled")||this.fireEvent("click",a,b)!==!1&&(this.subMenu?this.showSubMenu():e.postHide(a))},showSubMenu:function(){var a=c.getClientRect(this.getDom());a.right-=5,a.left+=2,a.width-=7,a.top-=4,a.bottom+=4,a.height+=8,this.subMenu.showAnchorRect(a,!0,!0)},hideSubMenu:function(){this.subMenu.hide()}},a.inherits(j,d),a.extend(j.prototype,f,!0)}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.Menu,d=baidu.editor.ui.SplitButton,e=baidu.editor.ui.Combox=function(a){this.initOptions(a),this.initCombox()};e.prototype={uiName:"combox",onbuttonclick:function(){this.showPopup()},initCombox:function(){var a=this;this.items=this.items||[];for(var b=0;bd.right&&(g=d.right-e.width);var h=a.top;h+e.height>d.bottom&&(h=d.bottom-e.height),c.style.left=Math.max(g,0)+"px",c.style.top=Math.max(h,0)+"px"},showAtCenter:function(){var a=f.getViewportRect();if(this.fullscreen){var b=this.getDom(),c=this.getDom("content");b.style.display="block";var d=UE.ui.uiUtils.getClientRect(b),g=UE.ui.uiUtils.getClientRect(c);b.style.left="-100000px",c.style.width=a.width-d.width+g.width+"px",c.style.height=a.height-d.height+g.height+"px",b.style.width=a.width+"px",b.style.height=a.height+"px",b.style.left=0,this._originalContext={html:{overflowX:document.documentElement.style.overflowX,overflowY:document.documentElement.style.overflowY},body:{overflowX:document.body.style.overflowX,overflowY:document.body.style.overflowY}},document.documentElement.style.overflowX="hidden",document.documentElement.style.overflowY="hidden",document.body.style.overflowX="hidden",document.body.style.overflowY="hidden"}else{this.getDom().style.display="";var h=this.fitSize(),i=0|this.getDom("titlebar").offsetHeight,j=a.width/2-h.width/2,k=a.height/2-(h.height-i)/2-i,l=this.getDom();this.safeSetOffset({left:Math.max(0|j,0),top:Math.max(0|k,0)}),e.hasClass(l,"edui-state-centered")||(l.className+=" edui-state-centered")}this._show()},getContentHtml:function(){var a="";return"string"==typeof this.content?a=this.content:this.iframeUrl&&(a=''),a},getHtmlTpl:function(){var a="";if(this.buttons){for(var b=[],c=0;c
                      '+b.join("")+"
                      "}return'
                      '+(this.title||"")+"
                      "+this.closeButton.renderHtml()+'
                      '+(this.autoReset?"":this.getContentHtml())+"
                      "+a+"
                      "},postRender:function(){this.modalMask.getDom()||(this.modalMask.render(),this.modalMask.hide()),this.dragMask.getDom()||(this.dragMask.render(),this.dragMask.hide());var a=this;if(this.addListener("show",function(){a.modalMask.show(this.getDom().style.zIndex-2)}),this.addListener("hide",function(){a.modalMask.hide()}),this.buttons)for(var b=0;b',a.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*a.editor.container.style.zIndex+1))}}),this.onbuttonclick=function(){this.showPopup()},this.initSplitButton()}},a.inherits(d,c)}(),function(){function a(a){var b=a.target||a.srcElement,c=g.findParent(b,function(a){return g.hasClass(a,"edui-shortcutmenu")||g.hasClass(a,"edui-popup")},!0);if(!c)for(var d,e=0;d=h[e++];)d.hide()}var b,c=baidu.editor.ui,d=c.UIBase,e=c.uiUtils,f=baidu.editor.utils,g=baidu.editor.dom.domUtils,h=[],i=!1,j=c.ShortCutMenu=function(a){this.initOptions(a),this.initShortCutMenu()};j.postHide=a,j.prototype={isHidden:!0,SPACE:5,initShortCutMenu:function(){this.items=this.items||[],this.initUIBase(),this.initItems(),this.initEvent(),h.push(this)},initEvent:function(){var a=this,c=a.editor.document;g.on(c,"mousemove",function(c){if(a.isHidden===!1){if(a.getSubMenuMark()||"contextmenu"==a.eventType)return;var d=!0,e=a.getDom(),f=e.offsetWidth,g=e.offsetHeight,h=f/2+a.SPACE,i=g/2,j=Math.abs(c.screenX-a.left),k=Math.abs(c.screenY-a.top);clearTimeout(b),b=setTimeout(function(){k>0&&ki&&ki+70&&k0&&jh&&jh+70&&j'+a+""}},f.inherits(j,d),g.on(document,"mousedown",function(b){a(b)}),g.on(window,"scroll",function(b){a(b)})}(),function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase,c=baidu.editor.ui.Breakline=function(a){this.initOptions(a),this.initSeparator()};c.prototype={uiName:"Breakline",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return"
                      "}},a.inherits(c,b)}(),function(){var a=baidu.editor.utils,b=baidu.editor.dom.domUtils,c=baidu.editor.ui.UIBase,d=baidu.editor.ui.Message=function(a){this.initOptions(a),this.initMessage()};d.prototype={initMessage:function(){this.initUIBase()},getHtmlTpl:function(){return'
                      ×
                      '},reset:function(a){var b=this;a.keepshow||(clearTimeout(this.timer),b.timer=setTimeout(function(){b.hide()},a.timeout||4e3)),void 0!==a.content&&b.setContent(a.content),void 0!==a.type&&b.setType(a.type),b.show()},postRender:function(){var a=this,c=this.getDom("closer");c&&b.on(c,"click",function(){a.hide()})},setContent:function(a){this.getDom("content").innerHTML=a},setType:function(a){a=a||"info";var b=this.getDom("body");b.className=b.className.replace(/edui-message-type-[\w-]+/,"edui-message-type-"+a); -},getContent:function(){return this.getDom("content").innerHTML},getType:function(){var a=this.getDom("body").match(/edui-message-type-([\w-]+)/);return a?a[1]:""},show:function(){this.getDom().style.display="block"},hide:function(){var a=this.getDom();a&&(a.style.display="none",a.parentNode&&a.parentNode.removeChild(a))}},a.inherits(d,c)}(),!function(a){var b,c='',d=(b=document.getElementsByTagName("script"))[b.length-1].getAttribute("data-injectcss"); -if(d&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(b){console&&console.log(b)}}!function(b){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(b,0);else{var c=function(){document.removeEventListener("DOMContentLoaded",c,!1),b()};document.addEventListener("DOMContentLoaded",c,!1)}else document.attachEvent&&(d=b,e=a.document,f=!1,g=function(){f||(f=!0,d())},(h=function(){try{e.documentElement.doScroll("left")}catch(a){return void setTimeout(h,50)}g()})(),e.onreadystatechange=function(){"complete"==e.readyState&&(e.onreadystatechange=null,g())});var d,e,f,g,h}(function(){var a,b,d,e,f,g;(a=document.createElement("div")).innerHTML=c,c=null,(b=a.getElementsByTagName("svg")[0])&&(b.setAttribute("aria-hidden","true"),b.style.position="absolute",b.style.width=0,b.style.height=0,b.style.overflow="hidden",d=b,(e=document.body).firstChild?(f=d,(g=e.firstChild).parentNode.insertBefore(f,g)):e.appendChild(d))})}(window),function(){var a=baidu.editor.utils,b=baidu.editor.ui,c=b.Dialog;b.buttons={},b.Dialog=function(a){var b=new c(a);return b.addListener("hide",function(){if(b.editor){var a=b.editor;try{if(browser.gecko){var c=a.window.scrollY,d=a.window.scrollX;a.body.focus(),a.window.scrollTo(d,c)}else a.focus()}catch(e){}}}),b};for(var d,e={anchor:"~/dialogs/anchor/anchor.html",insertimage:"~/dialogs/image/image.html",link:"~/dialogs/link/link.html",spechars:"~/dialogs/spechars/spechars.html",searchreplace:"~/dialogs/searchreplace/searchreplace.html",map:"~/dialogs/map/map.html",gmap:"~/dialogs/gmap/gmap.html",insertvideo:"~/dialogs/video/video.html",help:"~/dialogs/help/help.html",preview:"~/dialogs/preview/preview.html",emotion:"~/dialogs/emotion/emotion.html",wordimage:"~/dialogs/wordimage/wordimage.html",attachment:"~/dialogs/attachment/attachment.html",insertframe:"~/dialogs/insertframe/insertframe.html",edittip:"~/dialogs/table/edittip.html",edittable:"~/dialogs/table/edittable.html",edittd:"~/dialogs/table/edittd.html",webapp:"~/dialogs/webapp/webapp.html",snapscreen:"~/dialogs/snapscreen/snapscreen.html",scrawl:"~/dialogs/scrawl/scrawl.html",music:"~/dialogs/music/music.html",template:"~/dialogs/template/template.html",background:"~/dialogs/background/background.html",charts:"~/dialogs/charts/charts.html"},f=["undo","redo","formatmatch","bold","italic","underline","fontborder","touppercase","tolowercase","strikethrough","subscript","superscript","source","indent","outdent","blockquote","pasteplain","pagebreak","selectall","print","horizontal","removeformat","time","date","unlink","insertparagraphbeforetable","insertrow","insertcol","mergeright","mergedown","deleterow","deletecol","splittorows","splittocols","splittocells","mergecells","deletetable","drafts"],g=0;d=f[g++];)d=d.toLowerCase(),b[d]=function(a){return function(c){var d=new b.Button({className:"edui-for-"+a,title:c.options.labelMap[a]||c.getLang("labelMap."+a)||"",onclick:function(){c.execCommand(a)},theme:c.options.theme,showText:!1});return b.buttons[a]=d,c.addListener("selectionchange",function(b,e,f){var g=c.queryCommandState(a);g==-1?(d.setDisabled(!0),d.setChecked(!1)):f||(d.setDisabled(!1),d.setChecked(g))}),d}}(d);b.cleardoc=function(a){var c=new b.Button({className:"edui-for-cleardoc",title:a.options.labelMap.cleardoc||a.getLang("labelMap.cleardoc")||"",theme:a.options.theme,onclick:function(){confirm(a.getLang("confirmClear"))&&a.execCommand("cleardoc")}});return b.buttons.cleardoc=c,a.addListener("selectionchange",function(){c.setDisabled(a.queryCommandState("cleardoc")==-1)}),c};var h={justify:["left","right","center","justify"],imagefloat:["none","left","center","right"],directionality:["ltr","rtl"]};for(var i in h)!function(a,c){for(var d,e=0;d=c[e++];)!function(c){b[a.replace("float","")+c]=function(d){var e=new b.Button({className:"edui-for-"+a.replace("float","")+c,title:d.options.labelMap[a.replace("float","")+c]||d.getLang("labelMap."+a.replace("float","")+c)||"",theme:d.options.theme,onclick:function(){d.execCommand(a,c)}});return b.buttons[a]=e,d.addListener("selectionchange",function(b,f,g){e.setDisabled(d.queryCommandState(a)==-1),e.setChecked(d.queryCommandValue(a)==c&&!g)}),e}}(d)}(i,h[i]);for(var d,g=0;d=["backcolor","forecolor"][g++];)b[d]=function(a){return function(c){var d=new b.ColorButton({className:"edui-for-"+a,color:"default",title:c.options.labelMap[a]||c.getLang("labelMap."+a)||"",editor:c,onpickcolor:function(b,d){c.execCommand(a,d)},onpicknocolor:function(){c.execCommand(a,"default"),this.setColor("transparent"),this.color="default"},onbuttonclick:function(){c.execCommand(a,this.color)}});return b.buttons[a]=d,c.addListener("selectionchange",function(){d.setDisabled(c.queryCommandState(a)==-1)}),d}}(d);var j={noOk:["searchreplace","help","spechars","webapp","preview"],ok:["attachment","anchor","link","insertimage","map","gmap","insertframe","wordimage","insertvideo","insertframe","edittip","edittable","edittd","scrawl","template","music","background","charts"]};for(var i in j)!function(c,d){for(var f,g=0;f=d[g++];)browser.opera&&"searchreplace"===f||!function(d){b[d]=function(f,g,h){g=g||(f.options.iframeUrlMap||{})[d]||e[d],h=f.options.labelMap[d]||f.getLang("labelMap."+d)||"";var i;g&&(i=new b.Dialog(a.extend({iframeUrl:f.ui.mapUrl(g),editor:f,className:"edui-for-"+d,title:h,holdScroll:"insertimage"===d,fullscreen:/charts|preview/.test(d),closeDialog:f.getLang("closeDialog")},"ok"==c?{buttons:[{className:"edui-okbutton",label:f.getLang("ok"),editor:f,onclick:function(){i.close(!0)}},{className:"edui-cancelbutton",label:f.getLang("cancel"),editor:f,onclick:function(){i.close(!1)}}]}:{})),f.ui._dialogs[d+"Dialog"]=i);var j=new b.Button({className:"edui-for-"+d,title:h,onclick:function(){if(i)switch(d){case"wordimage":var a=f.execCommand("wordimage");a&&a.length&&(i.render(),i.open());break;case"scrawl":f.queryCommandState("scrawl")!=-1&&(i.render(),i.open());break;default:i.render(),i.open()}},theme:f.options.theme,disabled:"scrawl"==d&&f.queryCommandState("scrawl")==-1||"charts"==d});return b.buttons[d]=j,f.addListener("selectionchange",function(){var a={edittable:1};if(!(d in a)){var b=f.queryCommandState(d);j.getDom()&&(j.setDisabled(b==-1),j.setChecked(b))}}),j}}(f.toLowerCase())}(i,j[i]);b.snapscreen=function(a,c,d){d=a.options.labelMap.snapscreen||a.getLang("labelMap.snapscreen")||"";var f=new b.Button({className:"edui-for-snapscreen",title:d,onclick:function(){a.execCommand("snapscreen")},theme:a.options.theme});if(b.buttons.snapscreen=f,c=c||(a.options.iframeUrlMap||{}).snapscreen||e.snapscreen){var g=new b.Dialog({iframeUrl:a.ui.mapUrl(c),editor:a,className:"edui-for-snapscreen",title:d,buttons:[{className:"edui-okbutton",label:a.getLang("ok"),editor:a,onclick:function(){g.close(!0)}},{className:"edui-cancelbutton",label:a.getLang("cancel"),editor:a,onclick:function(){g.close(!1)}}]});g.render(),a.ui._dialogs.snapscreenDialog=g}return a.addListener("selectionchange",function(){f.setDisabled(a.queryCommandState("snapscreen")==-1)}),f},b.insertcode=function(c,d,e){d=c.options.insertcode||[],e=c.options.labelMap.insertcode||c.getLang("labelMap.insertcode")||"";var f=[];a.each(d,function(a,b){f.push({label:a,value:b,theme:c.options.theme,renderLabelHtml:function(){return'
                      '+(this.label||"")+"
                      "}})});var g=new b.Combox({editor:c,items:f,onselect:function(a,b){c.execCommand("insertcode",this.items[b].value)},onbuttonclick:function(){this.showPopup()},title:e,initValue:e,className:"edui-for-insertcode",indexByValue:function(a){if(a)for(var b,c=0;b=this.items[c];c++)if(b.value.indexOf(a)!=-1)return c;return-1}});return b.buttons.insertcode=g,c.addListener("selectionchange",function(a,b,d){if(!d){var f=c.queryCommandState("insertcode");if(f==-1)g.setDisabled(!0);else{g.setDisabled(!1);var h=c.queryCommandValue("insertcode");if(!h)return void g.setValue(e);h&&(h=h.replace(/['"]/g,"").split(",")[0]),g.setValue(h)}}}),g},b.fontfamily=function(c,d,e){if(d=c.options.fontfamily||[],e=c.options.labelMap.fontfamily||c.getLang("labelMap.fontfamily")||"",d.length){for(var f,g=0,h=[];f=d[g];g++){var i=c.getLang("fontfamily")[f.name]||"";!function(b,d){h.push({label:b,value:d,theme:c.options.theme,renderLabelHtml:function(){return'
                      '+(this.label||"")+"
                      "}})}(f.label||i,f.val)}var j=new b.Combox({editor:c,items:h,onselect:function(a,b){c.execCommand("FontFamily",this.items[b].value)},onbuttonclick:function(){this.showPopup()},title:e,initValue:e,className:"edui-for-fontfamily",indexByValue:function(a){if(a)for(var b,c=0;b=this.items[c];c++)if(b.value.indexOf(a)!=-1)return c;return-1}});return b.buttons.fontfamily=j,c.addListener("selectionchange",function(a,b,d){if(!d){var e=c.queryCommandState("FontFamily");if(e==-1)j.setDisabled(!0);else{j.setDisabled(!1);var f=c.queryCommandValue("FontFamily");f&&(f=f.replace(/['"]/g,"").split(",")[0]),j.setValue(f)}}}),j}},b.fontsize=function(a,c,d){if(d=a.options.labelMap.fontsize||a.getLang("labelMap.fontsize")||"",c=c||a.options.fontsize||[],c.length){for(var e=[],f=0;f'+(this.label||"")+""}})}var h=new b.Combox({editor:a,items:e,title:d,initValue:d,onselect:function(b,c){a.execCommand("FontSize",this.items[c].value)},onbuttonclick:function(){this.showPopup()},className:"edui-for-fontsize"});return b.buttons.fontsize=h,a.addListener("selectionchange",function(b,c,d){if(!d){var e=a.queryCommandState("FontSize");e==-1?h.setDisabled(!0):(h.setDisabled(!1),h.setValue(a.queryCommandValue("FontSize")))}}),h}},b.paragraph=function(c,d,e){if(e=c.options.labelMap.paragraph||c.getLang("labelMap.paragraph")||"",d=c.options.paragraph||[],!a.isEmptyObject(d)){var f=[];for(var g in d)f.push({value:g,label:d[g]||c.getLang("paragraph")[g],theme:c.options.theme,renderLabelHtml:function(){return'
                      '+(this.label||"")+"
                      "}});var h=new b.Combox({editor:c,items:f,title:e,initValue:e,className:"edui-for-paragraph",onselect:function(a,b){c.execCommand("Paragraph",this.items[b].value)},onbuttonclick:function(){this.showPopup()}});return b.buttons.paragraph=h,c.addListener("selectionchange",function(a,b,d){if(!d){var e=c.queryCommandState("Paragraph");if(e==-1)h.setDisabled(!0);else{h.setDisabled(!1);var f=c.queryCommandValue("Paragraph"),g=h.indexByValue(f);g!=-1?h.setValue(f):h.setValue(h.initValue)}}}),h}},b.customstyle=function(a){var c=a.options.customstyle||[],d=a.options.labelMap.customstyle||a.getLang("labelMap.customstyle")||"";if(c.length){for(var e,f=a.getLang("customstyle"),g=0,h=[];e=c[g++];)!function(b){var c={};c.label=b.label?b.label:f[b.name],c.style=b.style,c.className=b.className,c.tag=b.tag,h.push({label:c.label,value:c,theme:a.options.theme,renderLabelHtml:function(){return'
                      <'+c.tag+" "+(c.className?' class="'+c.className+'"':"")+(c.style?' style="'+c.style+'"':"")+">"+c.label+"
                      "}})}(e);var i=new b.Combox({editor:a,items:h,title:d,initValue:d,className:"edui-for-customstyle",onselect:function(b,c){a.execCommand("customstyle",this.items[c].value)},onbuttonclick:function(){this.showPopup()},indexByValue:function(a){for(var b,c=0;b=this.items[c++];)if(b.label==a)return c-1;return-1}});return b.buttons.customstyle=i,a.addListener("selectionchange",function(b,c,d){if(!d){var e=a.queryCommandState("customstyle");if(e==-1)i.setDisabled(!0);else{i.setDisabled(!1);var f=a.queryCommandValue("customstyle"),g=i.indexByValue(f);g!=-1?i.setValue(f):i.setValue(i.initValue)}}}),i}},b.inserttable=function(a,c,d){d=a.options.labelMap.inserttable||a.getLang("labelMap.inserttable")||"";var e=new b.TableButton({editor:a,title:d,className:"edui-for-inserttable",onpicktable:function(b,c,d){a.execCommand("InsertTable",{numRows:d,numCols:c,border:1})},onbuttonclick:function(){this.showPopup()}});return b.buttons.inserttable=e,a.addListener("selectionchange",function(){e.setDisabled(a.queryCommandState("inserttable")==-1)}),e},b.lineheight=function(a){var c=a.options.lineheight||[];if(c.length){for(var d,e=0,f=[];d=c[e++];)f.push({label:d,value:d,theme:a.options.theme,onclick:function(){a.execCommand("lineheight",this.value)}});var g=new b.MenuButton({editor:a,className:"edui-for-lineheight",title:a.options.labelMap.lineheight||a.getLang("labelMap.lineheight")||"",items:f,onbuttonclick:function(){var b=a.queryCommandValue("LineHeight")||this.value;a.execCommand("LineHeight",b)}});return b.buttons.lineheight=g,a.addListener("selectionchange",function(){var b=a.queryCommandState("LineHeight");if(b==-1)g.setDisabled(!0);else{g.setDisabled(!1);var c=a.queryCommandValue("LineHeight");c&&g.setValue((c+"").replace(/cm/,"")),g.setChecked(b)}}),g}};for(var k,l=["top","bottom"],m=0;k=l[m++];)!function(a){b["rowspacing"+a]=function(c){var d=c.options["rowspacing"+a]||[];if(!d.length)return null;for(var e,f=0,g=[];e=d[f++];)g.push({label:e,value:e,theme:c.options.theme,onclick:function(){c.execCommand("rowspacing",this.value,a)}});var h=new b.MenuButton({editor:c,className:"edui-for-rowspacing"+a,title:c.options.labelMap["rowspacing"+a]||c.getLang("labelMap.rowspacing"+a)||"",items:g,onbuttonclick:function(){var b=c.queryCommandValue("rowspacing",a)||this.value;c.execCommand("rowspacing",b,a)}});return b.buttons[a]=h,c.addListener("selectionchange",function(){var b=c.queryCommandState("rowspacing",a);if(b==-1)h.setDisabled(!0);else{h.setDisabled(!1);var d=c.queryCommandValue("rowspacing",a);d&&h.setValue((d+"").replace(/%/,"")),h.setChecked(b)}}),h}}(k);for(var n,o=["insertorderedlist","insertunorderedlist"],p=0;n=o[p++];)!function(a){b[a]=function(c){var d=c.options[a],e=function(){c.execCommand(a,this.value)},f=[];for(var g in d)f.push({label:d[g]||c.getLang()[a][g]||"",value:g,theme:c.options.theme,onclick:e});var h=new b.MenuButton({editor:c,className:"edui-for-"+a,title:c.getLang("labelMap."+a)||"",items:f,onbuttonclick:function(){var b=c.queryCommandValue(a)||this.value;c.execCommand(a,b)}});return b.buttons[a]=h,c.addListener("selectionchange",function(){var b=c.queryCommandState(a);if(b==-1)h.setDisabled(!0);else{h.setDisabled(!1);var d=c.queryCommandValue(a);h.setValue(d),h.setChecked(b)}}),h}}(n);b.fullscreen=function(a,c){c=a.options.labelMap.fullscreen||a.getLang("labelMap.fullscreen")||"";var d=new b.Button({className:"edui-for-fullscreen",title:c,theme:a.options.theme,onclick:function(){a.ui&&a.ui.setFullScreen(!a.ui.isFullScreen()),this.setChecked(a.ui.isFullScreen())}});return b.buttons.fullscreen=d,a.addListener("selectionchange",function(){var b=a.queryCommandState("fullscreen");d.setDisabled(b==-1),d.setChecked(a.ui.isFullScreen())}),d},b.emotion=function(a,c){var d="emotion",f=new b.MultiMenuPop({title:a.options.labelMap[d]||a.getLang("labelMap."+d)||"",editor:a,className:"edui-for-"+d,iframeUrl:a.ui.mapUrl(c||(a.options.iframeUrlMap||{})[d]||e[d])});return b.buttons[d]=f,a.addListener("selectionchange",function(){f.setDisabled(a.queryCommandState(d)==-1)}),f},b.autotypeset=function(a){var c=new b.AutoTypeSetButton({editor:a,title:a.options.labelMap.autotypeset||a.getLang("labelMap.autotypeset")||"",className:"edui-for-autotypeset",onbuttonclick:function(){a.execCommand("autotypeset")}});return b.buttons.autotypeset=c,a.addListener("selectionchange",function(){c.setDisabled(a.queryCommandState("autotypeset")==-1)}),c},b.simpleupload=function(a){var c="simpleupload",d=new b.Button({className:"edui-for-"+c,title:a.options.labelMap[c]||a.getLang("labelMap."+c)||"",onclick:function(){},theme:a.options.theme,showText:!1});return b.buttons[c]=d,a.addListener("ready",function(){var b=d.getDom("body"),c=b.children[0];a.fireEvent("simpleuploadbtnready",c)}),a.addListener("selectionchange",function(b,e,f){var g=a.queryCommandState(c);g==-1?(d.setDisabled(!0),d.setChecked(!1)):f||(d.setDisabled(!1),d.setChecked(g))}),d}}(),function(){function a(a){this.initOptions(a),this.initEditorUI()}var b=baidu.editor.utils,c=baidu.editor.ui.uiUtils,d=baidu.editor.ui.UIBase,e=baidu.editor.dom.domUtils,f=[];a.prototype={uiName:"editor",initEditorUI:function(){function a(a,b){a.setOpt({wordCount:!0,maximumWords:1e4,wordCountMsg:a.options.wordCountMsg||a.getLang("wordCountMsg"),wordOverFlowMsg:a.options.wordOverFlowMsg||a.getLang("wordOverFlowMsg")});var c=a.options,d=c.maximumWords,e=c.wordCountMsg,f=c.wordOverFlowMsg,g=b.getDom("wordcount");if(c.wordCount){var h=a.getContentLength(!0);h>d?(g.innerHTML=f,a.fireEvent("wordcountoverflow")):g.innerHTML=e.replace("{#leave}",d-h).replace("{#count}",h)}}this.editor.ui=this,this._dialogs={},this.initUIBase(),this._initToolbars();var b=this.editor,c=this;b.addListener("ready",function(){function d(){a(b,c),e.un(b.document,"click",arguments.callee)}b.getDialog=function(a){return b.ui._dialogs[a+"Dialog"]},e.on(b.window,"scroll",function(a){baidu.editor.ui.Popup.postHide(a)}),b.ui._actualFrameWidth=b.options.initialFrameWidth,UE.browser.ie&&6===UE.browser.version&&b.container.ownerDocument.execCommand("BackgroundImageCache",!1,!0),b.options.elementPathEnabled&&(b.ui.getDom("elementpath").innerHTML='
                      '+b.getLang("elementPathTip")+":
                      "),b.options.wordCount&&(e.on(b.document,"click",d),b.ui.getDom("wordcount").innerHTML=b.getLang("wordCountTip")),b.ui._scale(),b.options.scaleEnabled?(b.autoHeightEnabled&&b.disableAutoHeight(),c.enableScale()):c.disableScale(),b.options.elementPathEnabled||b.options.wordCount||b.options.scaleEnabled||(b.ui.getDom("elementpath").style.display="none",b.ui.getDom("wordcount").style.display="none",b.ui.getDom("scale").style.display="none"),b.selection.isFocus()&&b.fireEvent("selectionchange",!1,!0)}),b.addListener("mousedown",function(a,b){var c=b.target||b.srcElement;baidu.editor.ui.Popup.postHide(b,c),baidu.editor.ui.ShortCutMenu.postHide(b)}),b.addListener("delcells",function(){UE.ui.edittip&&new UE.ui.edittip(b),b.getDialog("edittip").open()});var d,f,g=!1;b.addListener("afterpaste",function(){b.queryCommandState("pasteplain")||(baidu.editor.ui.PastePicker&&(d=new baidu.editor.ui.Popup({content:new baidu.editor.ui.PastePicker({editor:b}),editor:b,className:"edui-wordpastepop"}),d.render()),g=!0)}),b.addListener("afterinserthtml",function(){clearTimeout(f),f=setTimeout(function(){if(d&&(g||b.ui._isTransfer)){if(d.isHidden()){var a=e.createElement(b.document,"span",{style:"line-height:0px;",innerHTML:"\ufeff"}),c=b.selection.getRange();c.insertNode(a);var f=getDomNode(a,"firstChild","previousSibling");f&&d.showAnchor(3==f.nodeType?f.parentNode:f),e.remove(a)}else d.show();delete b.ui._isTransfer,g=!1}},200)}),b.addListener("contextmenu",function(a,b){baidu.editor.ui.Popup.postHide(b)}),b.addListener("keydown",function(a,b){d&&d.dispose(b);var c=b.keyCode||b.which;b.altKey&&90==c&&UE.ui.buttons.fullscreen.onclick()}),b.addListener("wordcount",function(b){a(this,c)}),b.addListener("selectionchange",function(){b.options.elementPathEnabled&&c[(b.queryCommandState("elementpath")==-1?"dis":"en")+"ableElementPath"](),b.options.scaleEnabled&&c[(b.queryCommandState("scale")==-1?"dis":"en")+"ableScale"]()});var h=new baidu.editor.ui.Popup({editor:b,content:"",className:"edui-bubble",_onEditButtonClick:function(){this.hide(),b.ui._dialogs.linkDialog.open()},_onImgEditButtonClick:function(a){this.hide(),b.ui._dialogs[a]&&b.ui._dialogs[a].open()},_onImgSetFloat:function(a){this.hide(),b.execCommand("imagefloat",a)},_setIframeAlign:function(a){var b=h.anchorEl,c=b.cloneNode(!0);switch(a){case-2:c.setAttribute("align","");break;case-1:c.setAttribute("align","left");break;case 1:c.setAttribute("align","right")}b.parentNode.insertBefore(c,b),e.remove(b),h.anchorEl=c,h.showAnchor(h.anchorEl)},_updateIframe:function(){var a=b._iframe=h.anchorEl;e.hasClass(a,"ueditor_baidumap")?(b.selection.getRange().selectNode(a).select(),b.ui._dialogs.mapDialog.open(),h.hide()):(b.ui._dialogs.insertframeDialog.open(),h.hide())},_onRemoveButtonClick:function(a){b.execCommand(a),this.hide()},queryAutoHide:function(a){return a&&a.ownerDocument==b.document&&("img"==a.tagName.toLowerCase()||e.findParentByTagName(a,"a",!0))?a!==h.anchorEl:baidu.editor.ui.Popup.prototype.queryAutoHide.call(this,a)}});h.render(),b.options.imagePopup&&(b.addListener("mouseover",function(a,c){c=c||window.event;var d=c.target||c.srcElement;if(b.ui._dialogs.insertframeDialog&&/iframe/gi.test(d.tagName)){var e=h.formatHtml(""+b.getLang("property")+': '+b.getLang("default")+'  '+b.getLang("justifyleft")+'  '+b.getLang("justifyright")+'   '+b.getLang("modify")+"");e?(h.getDom("content").innerHTML=e,h.anchorEl=d,h.showAnchor(h.anchorEl)):h.hide()}}),b.addListener("selectionchange",function(a,c){if(c){var d="",f="",g=b.selection.getRange().getClosedNode(),i=b.ui._dialogs;if(g&&"IMG"==g.tagName){var j="insertimageDialog";if(g.className.indexOf("edui-faked-video")==-1&&g.className.indexOf("edui-upload-video")==-1||(j="insertvideoDialog"),g.className.indexOf("edui-faked-webapp")!=-1&&(j="webappDialog"),g.src.indexOf("https://api.map.baidu.com")!=-1&&(j="mapDialog"),g.className.indexOf("edui-faked-music")!=-1&&(j="musicDialog"),g.src.indexOf("http://maps.google.com/maps/api/staticmap")!=-1&&(j="gmapDialog"),g.getAttribute("anchorname")&&(j="anchorDialog",d=h.formatHtml(""+b.getLang("property")+': '+b.getLang("modify")+"  "+b.getLang("delete")+"")),g.getAttribute("word_img")&&(b.word_img=[g.getAttribute("word_img")],j="wordimageDialog"),(e.hasClass(g,"loadingclass")||e.hasClass(g,"loaderrorclass"))&&(j=""),!i[j])return;f=""+b.getLang("property")+': '+b.getLang("default")+'  '+b.getLang("justifyleft")+'  '+b.getLang("justifyright")+'  '+b.getLang("justifycenter")+"  '+b.getLang("modify")+"",!d&&(d=h.formatHtml(f))}if(b.ui._dialogs.linkDialog){var k,l=b.queryCommandValue("link");if(l&&(k=l.getAttribute("_href")||l.getAttribute("href",2))){var m=k;k.length>30&&(m=k.substring(0,20)+"..."),d&&(d+='
                      '),d+=h.formatHtml(""+b.getLang("anthorMsg")+': '+m+' '+b.getLang("modify")+' '+b.getLang("clear")+""),h.showAnchor(l)}}d?(h.getDom("content").innerHTML=d,h.anchorEl=g||l,h.showAnchor(h.anchorEl)):h.hide()}}))},_initToolbars:function(){for(var a=this.editor,c=this.toolbars||[],d=[],e=[],f=0;f
                      '+(this.toolbars.length?'
                      '+this.renderToolbarBoxHtml()+"
                      ":"")+'
                      '},showWordImageDialog:function(){this._dialogs.wordimageDialog.open()},renderToolbarBoxHtml:function(){for(var a=[],b=0;b'+c+"");b.innerHTML='
                      '+this.editor.getLang("elementPathTip")+": "+d.join(" > ")+"
                      "}else b.style.display="none"},disableElementPath:function(){var a=this.getDom("elementpath");a.innerHTML="",a.style.display="none",this.elementPathEnabled=!1},enableElementPath:function(){var a=this.getDom("elementpath");a.style.display="",this.elementPathEnabled=!0,this._updateElementPath()},_scale:function(){function a(){o=e.getXY(h),p||(p=g.options.minFrameHeight+j.offsetHeight+k.offsetHeight),m.style.cssText="position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:"+h.offsetWidth+"px;height:"+h.offsetHeight+"px;z-index:"+(g.options.zIndex+1),e.on(f,"mousemove",b),e.on(i,"mouseup",c),e.on(f,"mouseup",c)}function b(a){d();var b=a||window.event;r=b.pageX||f.documentElement.scrollLeft+b.clientX,s=b.pageY||f.documentElement.scrollTop+b.clientY,t=r-o.x,u=s-o.y,t>=q&&(n=!0,m.style.width=t+"px"),u>=p&&(n=!0,m.style.height=u+"px")}function c(){n&&(n=!1,g.ui._actualFrameWidth=m.offsetWidth-2,h.style.width=g.ui._actualFrameWidth+"px",g.setHeight(m.offsetHeight-k.offsetHeight-j.offsetHeight-2,!0)),m&&(m.style.display="none"),d(),e.un(f,"mousemove",b),e.un(i,"mouseup",c),e.un(f,"mouseup",c)}function d(){browser.ie?f.selection.clear():window.getSelection().removeAllRanges()}var f=document,g=this.editor,h=g.container,i=g.document,j=this.getDom("toolbarbox"),k=this.getDom("bottombar"),l=this.getDom("scale"),m=this.getDom("scalelayer"),n=!1,o=null,p=0,q=g.options.minFrameWidth,r=0,s=0,t=0,u=0,v=this;this.editor.addListener("fullscreenchanged",function(a,b){if(b)v.disableScale();else if(v.editor.options.scaleEnabled){v.enableScale();var c=v.editor.document.createElement("span");v.editor.body.appendChild(c),v.editor.body.style.height=Math.max(e.getXY(c).y,v.editor.iframe.offsetHeight-20)+"px",e.remove(c)}}),this.enableScale=function(){1!=g.queryCommandState("source")&&(l.style.display="",this.scaleEnabled=!0,e.on(l,"mousedown",a))},this.disableScale=function(){l.style.display="none",this.scaleEnabled=!1,e.un(l,"mousedown",a)}},isFullScreen:function(){return this._fullscreen},postRender:function(){d.prototype.postRender.call(this);for(var a=0;a[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+[\n\r\t]+<"),c.className&&(b.className=c.className),c.style.cssText&&(b.style.cssText=c.style.cssText),/textarea/i.test(c.tagName)?(d.textarea=c,d.textarea.style.display="none"):c.parentNode.removeChild(c),c.id&&(b.id=c.id,e.removeAttributes(c,"id")),c=b,c.innerHTML=""}e.addClass(c,"edui-"+d.options.theme),d.ui.render(c);var h=d.options;d.container=d.ui.getDom();for(var i,j=e.findParents(c,!0),k=[],l=0;i=j[l];l++)k[l]=i.style.display,i.style.display="block";if(h.initialFrameWidth)h.minFrameWidth=h.initialFrameWidth;else{h.minFrameWidth=h.initialFrameWidth=c.offsetWidth;var m=c.style.width;/%$/.test(m)&&(h.initialFrameWidth=m)}h.initialFrameHeight?h.minFrameHeight=h.initialFrameHeight:h.initialFrameHeight=h.minFrameHeight=c.offsetHeight;for(var i,l=0;i=j[l];l++)i.style.display=k[l];c.style.height&&(c.style.height=""),d.container.style.width=h.initialFrameWidth+(/%$/.test(h.initialFrameWidth)?"":"px"),d.container.style.zIndex=h.zIndex,f.call(d,d.ui.getDom("iframeholder")),d.fireEvent("afteruiready")}d.langIsReady?b():d.addListener("langReady",b)})},d},UE.getEditor=function(a,b){var c=g[a];return c||(c=g[a]=new UE.ui.Editor(b),c.render(a)),c},UE.delEditor=function(a){var b;(b=g[a])&&(b.key&&b.destroy(),delete g[a])},UE.registerUI=function(a,c,d,e){b.each(a.split(/\s+/),function(a){baidu.editor.ui[a]={id:e,execFn:c,index:d}})}}(),UE.registerUI("message",function(a){function b(){if(c&&g.ui){var a=g.ui.getDom("toolbarbox");a&&(c.style.top=a.offsetHeight+3+"px"),c.style.zIndex=Math.max(g.options.zIndex,g.iframe.style.zIndex)+1}}var c,d=baidu.editor.ui,e=d.Message,f=[],g=a;g.setOpt("enableMessageShow",!0),g.getOpt("enableMessageShow")!==!1&&(g.addListener("ready",function(){c=document.getElementById(g.ui.id+"_message_holder"),b(),setTimeout(function(){b()},500)}),g.addListener("showmessage",function(a,d){d=utils.isString(d)?{content:d}:d;var h=new e({timeout:d.timeout,type:d.type,content:d.content,keepshow:d.keepshow,editor:g}),i=d.id||"msg_"+(+new Date).toString(36);return h.render(c),f[i]=h,h.reset(d),b(),i}),g.addListener("updatemessage",function(a,b,d){d=utils.isString(d)?{content:d}:d;var e=f[b];e.render(c),e&&e.reset(d)}),g.addListener("hidemessage",function(a,b){var c=f[b];c&&c.hide()}))}),UE.registerUI("autosave",function(a){var b=null,c=null;a.on("afterautosave",function(){clearTimeout(b),b=setTimeout(function(){c&&a.trigger("hidemessage",c),c=a.trigger("showmessage",{content:a.getLang("autosave.success"),timeout:2e3})},2e3)})})}(); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.config.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.config.js deleted file mode 100644 index 77d0aaed679505c89e00a0377a2184cdc5ff46da..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.config.js +++ /dev/null @@ -1,604 +0,0 @@ -/** - * neditor完整配置项 - * 可以在这里配置整个编辑器的特性 - */ -/**************************提示******************************** - * 所有被注释的配置项均为UEditor默认值。 - * 修改默认配置请首先确保已经完全明确该参数的真实用途。 - * 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。 - * 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。 - **************************提示********************************/ - -(function () { - /** - * 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。 - * 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。 - * "相对于网站根目录的相对路径"也就是以斜杠开头的形如"/myProject/neditor/"这样的路径。 - * 如果站点中有多个不在同一层级的页面需要实例化编辑器,且引用了同一UEditor的时候,此处的URL可能不适用于每个页面的编辑器。 - * 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。 - * window.UEDITOR_HOME_URL = "/xxxx/xxxx/"; - */ - var URL = window.UEDITOR_HOME_URL || getUEBasePath(); - - /** - * 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。 - */ - window.UEDITOR_CONFIG = { - videoAllowFiles: [ - ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", - ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"], - //为编辑器实例添加一个路径,这个不能被注释 - UEDITOR_HOME_URL: URL, - - // 服务器统一请求接口路径 - //serverUrl: window.NEDITOR_UPLOAD || URL + "php/controller.php", - serverUrl: "/fileUploads/ueditor/upload/file", - imageActionName: "uploadimage", - scrawlActionName: "uploadscrawl", - videoActionName: "uploadvideo", - fileActionName: "uploadfile", - imageFieldName: "file", // 提交的图片表单名称 - imageMaxSize: 2048000, // 上传大小限制,单位B - imageUrlPrefix: "", - scrawlUrlPrefix: "", - videoUrlPrefix: "", - fileUrlPrefix: "", - catcherLocalDomain: "", - //工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义 - toolbars: [ - [ - "fullscreen", - "source", - "|", - "undo", - "redo", - "|", - "bold", - "italic", - "underline", - "fontborder", - "strikethrough", - "superscript", - "subscript", - "removeformat", - "formatmatch", - "autotypeset", - "blockquote", - "pasteplain", - "|", - "forecolor", - "backcolor", - "insertorderedlist", - "insertunorderedlist", - "selectall", - "cleardoc", - "|", - "rowspacingtop", - "rowspacingbottom", - "lineheight", - "|", - "customstyle", - "paragraph", - "fontfamily", - "fontsize", - "|", - "directionalityltr", - "directionalityrtl", - "indent", - "|", - "justifyleft", - "justifycenter", - "justifyright", - "justifyjustify", - "|", - "touppercase", - "tolowercase", - "|", - "link", - "unlink", - "anchor", - "|", - "imagenone", - "imageleft", - "imageright", - "imagecenter", - "|", - // "simpleupload", - "insertimage", - "emotion", - "scrawl", - "insertvideo", - "music", - "attachment", - "map", - "gmap", - "insertframe", - // "webapp", - "pagebreak", - "template", - "background", - "|", - "insertcode", - "horizontal", - "date", - "time", - "spechars", - "snapscreen", - "wordimage", - "|", - "inserttable", - "deletetable", - "insertparagraphbeforetable", - "insertrow", - "deleterow", - "insertcol", - "deletecol", - "mergecells", - "mergeright", - "mergedown", - "splittocells", - "splittorows", - "splittocols", - "charts", - "|", - "print", - "preview", - "searchreplace", - "drafts", - "help" - ] - ] - //当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准 - //,labelMap:{ - // 'anchor':'', 'undo':'' - //} - - //语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件: - //lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase() - //,lang:"zh-cn" - //,langPath:URL +"i18n/" - - //主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件: - //现有如下皮肤:default - , - theme: 'notadd' - //,themePath:URL +"themes/" - - , - zIndex: 1100 //编辑器层级的基数,默认是900 - - //针对getAllHtml方法,会在对应的head标签中增加该编码设置。 - //,charset:"utf-8" - - //若实例化编辑器的页面手动修改的domain,此处需要设置为true - //,customDomain:false - - //常用配置项目 - //,isShow : true //默认显示编辑器 - - //,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值 - - //,initialContent:'欢迎使用neditor!' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子 - - //,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了 - - //,focus:false //初始化时,是否让编辑器获得焦点true或false - - //如果自定义,最好给p标签如下的行高,要不输入中文时,会有跳动感 - //,initialStyle:'p{line-height:1em}'//编辑器层级的基数,可以用来改变字体等 - - //,iframeJsUrl: '' //给编辑区域的iframe引入一个js文件 - //,iframeCssUrl: URL + '/themes/iframe.css' //给编辑区域的iframe引入一个css文件 - - //indentValue - //首行缩进距离,默认是2em - //,indentValue:'2em' - - //,initialFrameWidth:1000 //初始化编辑器宽度,默认1000 - //,initialFrameHeight:320 //初始化编辑器高度,默认320 - - //,readonly : false //编辑器初始化结束后,编辑区域是否是只读的,默认是false - - //,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况) - - //启用自动保存 - //,enableAutoSave: true - //自动保存间隔时间, 单位ms - //,saveInterval: 500 - - //启用拖放上传 - //,enableDragUpload: true - //启用粘贴上传 - //,enablePasteUpload: true - - //启用图片拉伸缩放 - //,imageScaleEnabled: true - - //,fullscreen : false //是否开启初始化时即全屏,默认关闭 - - //,imagePopup:true //图片操作的浮层开关,默认打开 - - //,autoSyncData:true //自动同步编辑器要提交的数据 - //,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹 - - //粘贴只保留标签,去除标签所有属性 - //,retainOnlyLabelPasted: false - - //,pasteplain:false //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴 - //纯文本粘贴模式下的过滤规则 - //'filterTxtRules' : function(){ - // function transP(node){ - // node.tagName = 'p'; - // node.setStyle(); - // } - // return { - // //直接删除及其字节点内容 - // '-' : 'script style object iframe embed input select', - // 'p': {$:{}}, - // 'br':{$:{}}, - // 'div':{'$':{}}, - // 'li':{'$':{}}, - // 'caption':transP, - // 'th':transP, - // 'tr':transP, - // 'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP, - // 'td':function(node){ - // //没有内容的td直接删掉 - // var txt = !!node.innerText(); - // if(txt){ - // node.parentNode.insertAfter(UE.uNode.createText('    '),node); - // } - // node.parentNode.removeChild(node,node.innerText()) - // } - // } - //}() - - //,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串 - - //insertorderedlist - //有序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准 - //,'insertorderedlist':{ - // //自定的样式 - // 'num':'1,2,3...', - // 'num1':'1),2),3)...', - // 'num2':'(1),(2),(3)...', - // 'cn':'一,二,三....', - // 'cn1':'一),二),三)....', - // 'cn2':'(一),(二),(三)....', - // //系统自带 - // 'decimal' : '' , //'1,2,3...' - // 'lower-alpha' : '' , // 'a,b,c...' - // 'lower-roman' : '' , //'i,ii,iii...' - // 'upper-alpha' : '' , lang //'A,B,C' - // 'upper-roman' : '' //'I,II,III...' - //} - - //insertunorderedlist - //无序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准 - //,insertunorderedlist : { //自定的样式 - // 'dash' :'— 破折号', //-破折号 - // 'dot':' 。 小圆圈', //系统自带 - // 'circle' : '', // '○ 小圆圈' - // 'disc' : '', // '● 小圆点' - // 'square' : '' //'■ 小方块' - //} - //,listDefaultPaddingLeft : '30'//默认的左边缩进的基数倍 - //,listiconpath : 'http://bs.baidu.com/listicon/'//自定义标号的路径 - //,maxListLevel : 3 //限制可以tab的级数, 设置-1为不限制 - - //,autoTransWordToList:false //禁止word中粘贴进来的列表自动变成列表标签 - - //fontfamily - //字体设置 label留空支持多语言自动切换,若配置,则以配置值为准 - //,'fontfamily':[ - // { label:'',name:'songti',val:'宋体,SimSun'}, - // { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'}, - // { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'}, - // { label:'',name:'heiti',val:'黑体, SimHei'}, - // { label:'',name:'lishu',val:'隶书, SimLi'}, - // { label:'',name:'andaleMono',val:'andale mono'}, - // { label:'',name:'arial',val:'arial, helvetica,sans-serif'}, - // { label:'',name:'arialBlack',val:'arial black,avant garde'}, - // { label:'',name:'comicSansMs',val:'comic sans ms'}, - // { label:'',name:'impact',val:'impact,chicago'}, - // { label:'',name:'timesNewRoman',val:'times new roman'} - //] - - //fontsize - //字号 - //,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36] - - //paragraph - //段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准 - //,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''} - - //rowspacingtop - //段间距 值和显示的名字相同 - //,'rowspacingtop':['5', '10', '15', '20', '25'] - - //rowspacingBottom - //段间距 值和显示的名字相同 - //,'rowspacingbottom':['5', '10', '15', '20', '25'] - - //lineheight - //行内间距 值和显示的名字相同 - //,'lineheight':['1', '1.5','1.75','2', '3', '4', '5'] - - //customstyle - //自定义样式,不支持国际化,此处配置值即可最后显示值 - //block的元素是依据设置段落的逻辑设置的,inline的元素依据BIU的逻辑设置 - //尽量使用一些常用的标签 - //参数说明 - //tag 使用的标签名字 - //label 显示的名字也是用来标识不同类型的标识符,注意这个值每个要不同, - //style 添加的样式 - //每一个对象就是一个自定义的样式 - //,'customstyle':[ - // {tag:'h1', name:'tc', label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'}, - // {tag:'h1', name:'tl',label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;margin:0 0 10px 0;'}, - // {tag:'span',name:'im', label:'', style:'font-style:italic;font-weight:bold'}, - // {tag:'span',name:'hi', label:'', style:'font-style:italic;font-weight:bold;color:rgb(51, 153, 204)'} - //] - - //打开右键菜单功能 - //,enableContextMenu: true - //右键菜单的内容,可以参考plugins/contextmenu.js里边的默认菜单的例子,label留空支持国际化,否则以此配置为准 - //,contextMenu:[ - // { - // label:'', //显示的名称 - // cmdName:'selectall',//执行的command命令,当点击这个右键菜单时 - // //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName - // exec:function () { - // //this是当前编辑器的实例 - // //this.ui._dialogs['inserttableDialog'].open(); - // } - // } - //] - - //快捷菜单 - //,shortcutMenu:["fontfamily", "fontsize", "bold", "italic", "underline", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist"] - - //elementPathEnabled - //是否启用元素路径,默认是显示 - //,elementPathEnabled : true - - //wordCount - //,wordCount:true //是否开启字数统计 - //,maximumWords:10000 //允许的最大字符数 - //字数统计提示,{#count}代表当前字数,{#leave}代表还可以输入多少字符数,留空支持多语言自动切换,否则按此配置显示 - //,wordCountMsg:'' //当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符 - //超出字数限制提示 留空支持多语言自动切换,否则按此配置显示 - //,wordOverFlowMsg:'' //你输入的字符个数已经超出最大允许值,服务器可能会拒绝保存! - - //tab - //点击tab键时移动的距离,tabSize倍数,tabNode什么字符做为单位 - //,tabSize:4 - //,tabNode:' ' - - //removeFormat - //清除格式时可以删除的标签和属性 - //removeForamtTags标签 - //,removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var' - //removeFormatAttributes属性 - //,removeFormatAttributes:'class,style,lang,width,height,align,hspace,valign' - - //undo - //可以最多回退的次数,默认20 - //,maxUndoCount:20 - //当输入的字符数超过该值时,保存一次现场 - //,maxInputCount:1 - - //autoHeightEnabled - // 是否自动长高,默认true - , - autoHeightEnabled: false - - //scaleEnabled - //是否可以拉伸长高,默认true(当开启时,自动长高失效) - //,scaleEnabled:false - //,minFrameWidth:800 //编辑器拖动时最小宽度,默认800 - //,minFrameHeight:220 //编辑器拖动时最小高度,默认220 - - //autoFloatEnabled - //是否保持toolbar的位置不动,默认true - //,autoFloatEnabled:true - //浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面 - //,topOffset:30 - //编辑器底部距离工具栏高度(如果参数大于等于编辑器高度,则设置无效) - //,toolbarTopOffset:400 - - //设置远程图片是否抓取到本地保存 - //,catchRemoteImageEnable: true //设置是否抓取远程图片 - - //pageBreakTag - //分页标识符,默认是_neditor_page_break_tag_ - //,pageBreakTag:'_neditor_page_break_tag_' - - //autotypeset - //自动排版参数 - //,autotypeset: { - // mergeEmptyline: true, //合并空行 - // removeClass: true, //去掉冗余的class - // removeEmptyline: false, //去掉空行 - // textAlign:"left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版 - // imageBlockLine: 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版 - // pasteFilter: false, //根据规则过滤没事粘贴进来的内容 - // clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号 - // clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体 - // removeEmptyNode: false, // 去掉空节点 - // //可以去掉的标签 - // removeTagNames: {标签名字:1}, - // indent: false, // 行首缩进 - // indentValue : '2em', //行首缩进的大小 - // bdc2sb: false, - // tobdc: false - //} - - //tableDragable - //表格是否可以拖拽 - //,tableDragable: true - - //sourceEditor - //源码的查看方式,codemirror 是代码高亮,textarea是文本框,默认是codemirror - //注意默认codemirror只能在ie8+和非ie中使用 - //,sourceEditor:"codemirror" - //如果sourceEditor是codemirror,还用配置一下两个参数 - //codeMirrorJsUrl js加载的路径,默认是 URL + "third-party/codemirror/codemirror.js" - //,codeMirrorJsUrl:URL + "third-party/codemirror/codemirror.js" - //codeMirrorCssUrl css加载的路径,默认是 URL + "third-party/codemirror/codemirror.css" - //,codeMirrorCssUrl:URL + "third-party/codemirror/codemirror.css" - //编辑器初始化完成后是否进入源码模式,默认为否。 - //,sourceEditorFirst:false - - //iframeUrlMap - //dialog内容的路径 ~会被替换成URL,垓属性一旦打开,将覆盖所有的dialog的默认路径 - //,iframeUrlMap:{ - // 'anchor':'~/dialogs/anchor/anchor.html', - //} - - //allowLinkProtocol 允许的链接地址,有这些前缀的链接地址不会自动添加http - //, allowLinkProtocols: ['http:', 'https:', '#', '/', 'ftp:', 'mailto:', 'tel:', 'git:', 'svn:'] - - //webAppKey 百度应用的APIkey,每个站长必须首先去百度官网注册一个key后方能正常使用app功能,注册介绍,http://app.baidu.com/static/cms/getapikey.html - //, webAppKey: "" - - //默认过滤规则相关配置项目 - //,disabledTableInTable:true //禁止表格嵌套 - //,allowDivTransToP:true //允许进入编辑器的div标签自动变成p标签 - //,rgb2Hex:true //默认产出的数据中的color自动从rgb格式变成16进制格式 - - // xss 过滤是否开启,inserthtml等操作 - , - xssFilterRules: true - //input xss过滤 - , - inputXssFilter: true - //output xss过滤 - , - outputXssFilter: true - // xss过滤白名单 名单来源: https://raw.githubusercontent.com/leizongmin/js-xss/master/lib/default.js - , - whitList: { - a: ['target', 'href', 'title', 'class', 'style'], - abbr: ['title', 'class', 'style'], - address: ['class', 'style'], - area: ['shape', 'coords', 'href', 'alt'], - article: [], - aside: [], - audio: ['autoplay', 'controls', 'loop', 'preload', 'src', 'class', 'style'], - b: ['class', 'style'], - bdi: ['dir'], - bdo: ['dir'], - big: [], - blockquote: ['cite', 'class', 'style'], - br: [], - caption: ['class', 'style'], - center: [], - cite: [], - code: ['class', 'style'], - col: ['align', 'valign', 'span', 'width', 'class', 'style'], - colgroup: ['align', 'valign', 'span', 'width', 'class', 'style'], - dd: ['class', 'style'], - del: ['datetime'], - details: ['open'], - div: ['class', 'style'], - dl: ['class', 'style'], - dt: ['class', 'style'], - em: ['class', 'style'], - font: ['color', 'size', 'face'], - footer: [], - h1: ['class', 'style'], - h2: ['class', 'style'], - h3: ['class', 'style'], - h4: ['class', 'style'], - h5: ['class', 'style'], - h6: ['class', 'style'], - header: [], - hr: [], - i: ['class', 'style'], - img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', '_url', 'loadingclass', 'class', 'data-latex'], - ins: ['datetime'], - li: ['class', 'style'], - mark: [], - nav: [], - ol: ['class', 'style'], - p: ['class', 'style'], - pre: ['class', 'style'], - s: [], - section: [], - small: [], - span: ['class', 'style'], - sub: ['class', 'style'], - sup: ['class', 'style'], - strong: ['class', 'style'], - table: ['width', 'border', 'align', 'valign', 'class', 'style'], - tbody: ['align', 'valign', 'class', 'style'], - td: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'], - tfoot: ['align', 'valign', 'class', 'style'], - th: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'], - thead: ['align', 'valign', 'class', 'style'], - tr: ['rowspan', 'align', 'valign', 'class', 'style'], - tt: [], - u: [], - ul: ['class', 'style'], - video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'class', 'style'], - source: ['src', 'type'], - embed: ['type', 'class', 'pluginspage', 'src', 'width', 'height', 'align', 'style', 'wmode', 'play', 'autoplay', 'loop', 'menu', 'allowscriptaccess', 'allowfullscreen', 'controls', 'preload'], - iframe: ['src', 'class', 'height', 'width', 'max-width', 'max-height', 'align', 'frameborder', 'allowfullscreen'] - } - }; - - function getUEBasePath(docUrl, confUrl) { - return getBasePath( - docUrl || self.document.URL || self.location.href, - confUrl || getConfigFilePath() - ); - } - - function getConfigFilePath() { - var configPath = document.getElementsByTagName("script"); - - return configPath[configPath.length - 1].src; - } - - function getBasePath(docUrl, confUrl) { - var basePath = confUrl; - - if (/^(\/|\\\\)/.test(confUrl)) { - basePath = - /^.+?\w(\/|\\\\)/.exec(docUrl)[0] + confUrl.replace(/^(\/|\\\\)/, ""); - } else if (!/^[a-z]+:/i.test(confUrl)) { - docUrl = docUrl.split("#")[0].split("?")[0].replace(/[^\\\/]+$/, ""); - - basePath = docUrl + "" + confUrl; - } - - return optimizationPath(basePath); - } - - function optimizationPath(path) { - var protocol = /^[a-z]+:\/\//.exec(path)[0], - tmp = null, - res = []; - - path = path.replace(protocol, "").split("?")[0].split("#")[0]; - - path = path.replace(/\\/g, "/").split(/\//); - - path[path.length - 1] = ""; - - while (path.length) { - if ((tmp = path.shift()) === "..") { - res.pop(); - } else if (tmp !== ".") { - res.push(tmp); - } - } - - return protocol + res.join("/"); - } - - window.UE = { - getUEBasePath: getUEBasePath - }; -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.parse.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.parse.js deleted file mode 100644 index 22c342dfd868de0241695a528fc15192521a4eba..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.parse.js +++ /dev/null @@ -1,1230 +0,0 @@ -/*! - * neditor parse - * version: 2.1.13 - * build: Sat Dec 29 2018 09:49:22 GMT+0000 (UTC) - */ - -(function(){ - -(function() { - UE = window.UE || {}; - var isIE = !!window.ActiveXObject; - //定义utils工具 - var utils = { - removeLastbs: function(url) { - return url.replace(/\/$/, ""); - }, - extend: function(t, s) { - var a = arguments, - notCover = this.isBoolean(a[a.length - 1]) ? a[a.length - 1] : false, - len = this.isBoolean(a[a.length - 1]) ? a.length - 1 : a.length; - for (var i = 1; i < len; i++) { - var x = a[i]; - for (var k in x) { - if (!notCover || !t.hasOwnProperty(k)) { - t[k] = x[k]; - } - } - } - return t; - }, - isIE: isIE, - cssRule: isIE - ? function(key, style, doc) { - var indexList, index; - doc = doc || document; - if (doc.indexList) { - indexList = doc.indexList; - } else { - indexList = doc.indexList = {}; - } - var sheetStyle; - if (!indexList[key]) { - if (style === undefined) { - return ""; - } - sheetStyle = doc.createStyleSheet( - "", - (index = doc.styleSheets.length) - ); - indexList[key] = index; - } else { - sheetStyle = doc.styleSheets[indexList[key]]; - } - if (style === undefined) { - return sheetStyle.cssText; - } - sheetStyle.cssText = sheetStyle.cssText + "\n" + (style || ""); - } - : function(key, style, doc) { - doc = doc || document; - var head = doc.getElementsByTagName("head")[0], - node; - if (!(node = doc.getElementById(key))) { - if (style === undefined) { - return ""; - } - node = doc.createElement("style"); - node.id = key; - head.appendChild(node); - } - if (style === undefined) { - return node.innerHTML; - } - if (style !== "") { - node.innerHTML = node.innerHTML + "\n" + style; - } else { - head.removeChild(node); - } - }, - domReady: function(onready) { - var doc = window.document; - if (doc.readyState === "complete") { - onready(); - } else { - if (isIE) { - (function() { - if (doc.isReady) return; - try { - doc.documentElement.doScroll("left"); - } catch (error) { - setTimeout(arguments.callee, 0); - return; - } - onready(); - })(); - window.attachEvent("onload", function() { - onready(); - }); - } else { - doc.addEventListener( - "DOMContentLoaded", - function() { - doc.removeEventListener( - "DOMContentLoaded", - arguments.callee, - false - ); - onready(); - }, - false - ); - window.addEventListener( - "load", - function() { - onready(); - }, - false - ); - } - } - }, - each: function(obj, iterator, context) { - if (obj == null) return; - if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === false) return false; - } - } else { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - if (iterator.call(context, obj[key], key, obj) === false) - return false; - } - } - } - }, - inArray: function(arr, item) { - var index = -1; - this.each(arr, function(v, i) { - if (v === item) { - index = i; - return false; - } - }); - return index; - }, - pushItem: function(arr, item) { - if (this.inArray(arr, item) == -1) { - arr.push(item); - } - }, - trim: function(str) { - return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, ""); - }, - indexOf: function(array, item, start) { - var index = -1; - start = this.isNumber(start) ? start : 0; - this.each(array, function(v, i) { - if (i >= start && v === item) { - index = i; - return false; - } - }); - return index; - }, - hasClass: function(element, className) { - className = className - .replace(/(^[ ]+)|([ ]+$)/g, "") - .replace(/[ ]{2,}/g, " ") - .split(" "); - for (var i = 0, ci, cls = element.className; (ci = className[i++]); ) { - if (!new RegExp("\\b" + ci + "\\b", "i").test(cls)) { - return false; - } - } - return i - 1 == className.length; - }, - addClass: function(elm, classNames) { - if (!elm) return; - classNames = this.trim(classNames).replace(/[ ]{2,}/g, " ").split(" "); - for (var i = 0, ci, cls = elm.className; (ci = classNames[i++]); ) { - if (!new RegExp("\\b" + ci + "\\b").test(cls)) { - cls += " " + ci; - } - } - elm.className = utils.trim(cls); - }, - removeClass: function(elm, classNames) { - classNames = this.isArray(classNames) - ? classNames - : this.trim(classNames).replace(/[ ]{2,}/g, " ").split(" "); - for (var i = 0, ci, cls = elm.className; (ci = classNames[i++]); ) { - cls = cls.replace(new RegExp("\\b" + ci + "\\b"), ""); - } - cls = this.trim(cls).replace(/[ ]{2,}/g, " "); - elm.className = cls; - !cls && elm.removeAttribute("className"); - }, - on: function(element, type, handler) { - var types = this.isArray(type) ? type : type.split(/\s+/), - k = types.length; - if (k) - while (k--) { - type = types[k]; - if (element.addEventListener) { - element.addEventListener(type, handler, false); - } else { - if (!handler._d) { - handler._d = { - els: [] - }; - } - var key = type + handler.toString(), - index = utils.indexOf(handler._d.els, element); - if (!handler._d[key] || index == -1) { - if (index == -1) { - handler._d.els.push(element); - } - if (!handler._d[key]) { - handler._d[key] = function(evt) { - return handler.call(evt.srcElement, evt || window.event); - }; - } - - element.attachEvent("on" + type, handler._d[key]); - } - } - } - element = null; - }, - off: function(element, type, handler) { - var types = this.isArray(type) ? type : type.split(/\s+/), - k = types.length; - if (k) - while (k--) { - type = types[k]; - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else { - var key = type + handler.toString(); - try { - element.detachEvent( - "on" + type, - handler._d ? handler._d[key] : handler - ); - } catch (e) {} - if (handler._d && handler._d[key]) { - var index = utils.indexOf(handler._d.els, element); - if (index != -1) { - handler._d.els.splice(index, 1); - } - handler._d.els.length == 0 && delete handler._d[key]; - } - } - } - }, - loadFile: (function() { - var tmpList = []; - function getItem(doc, obj) { - try { - for (var i = 0, ci; (ci = tmpList[i++]); ) { - if (ci.doc === doc && ci.url == (obj.src || obj.href)) { - return ci; - } - } - } catch (e) { - return null; - } - } - return function(doc, obj, fn) { - var item = getItem(doc, obj); - if (item) { - if (item.ready) { - fn && fn(); - } else { - item.funs.push(fn); - } - return; - } - tmpList.push({ - doc: doc, - url: obj.src || obj.href, - funs: [fn] - }); - if (!doc.body) { - var html = []; - for (var p in obj) { - if (p == "tag") continue; - html.push(p + '="' + obj[p] + '"'); - } - doc.write( - "<" + obj.tag + " " + html.join(" ") + " >" - ); - return; - } - if (obj.id && doc.getElementById(obj.id)) { - return; - } - var element = doc.createElement(obj.tag); - delete obj.tag; - for (var p in obj) { - element.setAttribute(p, obj[p]); - } - element.onload = element.onreadystatechange = function() { - if (!this.readyState || /loaded|complete/.test(this.readyState)) { - item = getItem(doc, obj); - if (item.funs.length > 0) { - item.ready = 1; - for (var fi; (fi = item.funs.pop()); ) { - fi(); - } - } - element.onload = element.onreadystatechange = null; - } - }; - element.onerror = function() { - throw Error( - "The load " + (obj.href || obj.src) + " fails,check the url" - ); - }; - doc.getElementsByTagName("head")[0].appendChild(element); - }; - })() - }; - utils.each( - ["String", "Function", "Array", "Number", "RegExp", "Object", "Boolean"], - function(v) { - utils["is" + v] = function(obj) { - return Object.prototype.toString.apply(obj) == "[object " + v + "]"; - }; - } - ); - var parselist = {}; - UE.parse = { - register: function(parseName, fn) { - parselist[parseName] = fn; - }, - load: function(opt) { - utils.each(parselist, function(v) { - v.call(opt, utils); - }); - } - }; - uParse = function(selector, opt) { - utils.domReady(function() { - var contents; - if (document.querySelectorAll) { - contents = document.querySelectorAll(selector); - } else { - if (/^#/.test(selector)) { - contents = [document.getElementById(selector.replace(/^#/, ""))]; - } else if (/^\./.test(selector)) { - var contents = []; - utils.each(document.getElementsByTagName("*"), function(node) { - if ( - node.className && - new RegExp("\\b" + selector.replace(/^\./, "") + "\\b", "i").test( - node.className - ) - ) { - contents.push(node); - } - }); - } else { - contents = document.getElementsByTagName(selector); - } - } - utils.each(contents, function(v) { - UE.parse.load(utils.extend({ root: v, selector: selector }, opt)); - }); - }); - }; -})(); - -UE.parse.register("insertcode", function(utils) { - var pres = this.root.getElementsByTagName("pre"); - if (pres.length) { - if (typeof XRegExp == "undefined") { - var jsurl, cssurl; - if (this.rootPath !== undefined) { - jsurl = - utils.removeLastbs(this.rootPath) + - "/third-party/SyntaxHighlighter/shCore.js"; - cssurl = - utils.removeLastbs(this.rootPath) + - "/third-party/SyntaxHighlighter/shCoreDefault.css"; - } else { - jsurl = this.highlightJsUrl; - cssurl = this.highlightCssUrl; - } - utils.loadFile(document, { - id: "syntaxhighlighter_css", - tag: "link", - rel: "stylesheet", - type: "text/css", - href: cssurl - }); - utils.loadFile( - document, - { - id: "syntaxhighlighter_js", - src: jsurl, - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - utils.each(pres, function(pi) { - if (pi && /brush/i.test(pi.className)) { - SyntaxHighlighter.highlight(pi); - } - }); - } - ); - } else { - utils.each(pres, function(pi) { - if (pi && /brush/i.test(pi.className)) { - SyntaxHighlighter.highlight(pi); - } - }); - } - } -}); - -UE.parse.register("table", function(utils) { - var me = this, - root = this.root, - tables = root.getElementsByTagName("table"); - if (tables.length) { - var selector = this.selector; - //追加默认的表格样式 - utils.cssRule( - "table", - selector + - " table.noBorderTable td," + - selector + - " table.noBorderTable th," + - selector + - " table.noBorderTable caption{border:1px dashed #ddd !important}" + - selector + - " table.sortEnabled tr.firstRow th," + - selector + - " table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;" + - "background-position: center right; background-image:url(" + - this.rootPath + - "themes/default/images/sortable.png);}" + - selector + - " table.sortEnabled tr.firstRow th:hover," + - selector + - " table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}" + - selector + - " table{margin-bottom:10px;border-collapse:collapse;display:table;}" + - selector + - " td," + - selector + - " th{padding: 5px 10px;border: 1px solid #DDD;}" + - selector + - " caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}" + - selector + - " th{border-top:1px solid #BBB;background:#F7F7F7;}" + - selector + - " table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}" + - selector + - " tr.ue-table-interlace-color-single td{ background: #fcfcfc; }" + - selector + - " tr.ue-table-interlace-color-double td{ background: #f7faff; }" + - selector + - " td p{margin:0;padding:0;width:auto;height:auto;}", - document - ); - //填充空的单元格 - - utils.each("td th caption".split(" "), function(tag) { - var cells = root.getElementsByTagName(tag); - cells.length && - utils.each(cells, function(node) { - if (!node.firstChild) { - node.innerHTML = " "; - } - }); - }); - - //表格可排序 - var tables = root.getElementsByTagName("table"); - utils.each(tables, function(table) { - if (/\bsortEnabled\b/.test(table.className)) { - utils.on(table, "click", function(e) { - var target = e.target || e.srcElement, - cell = findParentByTagName(target, ["td", "th"]); - var table = findParentByTagName(target, "table"), - colIndex = utils.indexOf(table.rows[0].cells, cell), - sortType = table.getAttribute("data-sort-type"); - if (colIndex != -1) { - sortTable(table, colIndex, me.tableSortCompareFn || sortType); - updateTable(table); - } - }); - } - }); - - //按照标签名查找父节点 - function findParentByTagName(target, tagNames) { - var i, - current = target; - tagNames = utils.isArray(tagNames) ? tagNames : [tagNames]; - while (current) { - for (i = 0; i < tagNames.length; i++) { - if (current.tagName == tagNames[i].toUpperCase()) return current; - } - current = current.parentNode; - } - return null; - } - //表格排序 - function sortTable(table, sortByCellIndex, compareFn) { - var rows = table.rows, - trArray = [], - flag = rows[0].cells[0].tagName === "TH", - lastRowIndex = 0; - - for (var i = 0, len = rows.length; i < len; i++) { - trArray[i] = rows[i]; - } - - var Fn = { - reversecurrent: function(td1, td2) { - return 1; - }, - orderbyasc: function(td1, td2) { - var value1 = td1.innerText || td1.textContent, - value2 = td2.innerText || td2.textContent; - return value1.localeCompare(value2); - }, - reversebyasc: function(td1, td2) { - var value1 = td1.innerHTML, - value2 = td2.innerHTML; - return value2.localeCompare(value1); - }, - orderbynum: function(td1, td2) { - var value1 = td1[utils.isIE ? "innerText" : "textContent"].match( - /\d+/ - ), - value2 = td2[utils.isIE ? "innerText" : "textContent"].match(/\d+/); - if (value1) value1 = +value1[0]; - if (value2) value2 = +value2[0]; - return (value1 || 0) - (value2 || 0); - }, - reversebynum: function(td1, td2) { - var value1 = td1[utils.isIE ? "innerText" : "textContent"].match( - /\d+/ - ), - value2 = td2[utils.isIE ? "innerText" : "textContent"].match(/\d+/); - if (value1) value1 = +value1[0]; - if (value2) value2 = +value2[0]; - return (value2 || 0) - (value1 || 0); - } - }; - - //对表格设置排序的标记data-sort-type - table.setAttribute( - "data-sort-type", - compareFn && typeof compareFn === "string" && Fn[compareFn] - ? compareFn - : "" - ); - - //th不参与排序 - flag && trArray.splice(0, 1); - trArray = sort(trArray, function(tr1, tr2) { - var result; - if (compareFn && typeof compareFn === "function") { - result = compareFn.call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } else if (compareFn && typeof compareFn === "number") { - result = 1; - } else if ( - compareFn && - typeof compareFn === "string" && - Fn[compareFn] - ) { - result = Fn[compareFn].call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } else { - result = Fn["orderbyasc"].call( - this, - tr1.cells[sortByCellIndex], - tr2.cells[sortByCellIndex] - ); - } - return result; - }); - var fragment = table.ownerDocument.createDocumentFragment(); - for (var j = 0, len = trArray.length; j < len; j++) { - fragment.appendChild(trArray[j]); - } - var tbody = table.getElementsByTagName("tbody")[0]; - if (!lastRowIndex) { - tbody.appendChild(fragment); - } else { - tbody.insertBefore( - fragment, - rows[lastRowIndex - range.endRowIndex + range.beginRowIndex - 1] - ); - } - } - //冒泡排序 - function sort(array, compareFn) { - compareFn = - compareFn || - function(item1, item2) { - return item1.localeCompare(item2); - }; - for (var i = 0, len = array.length; i < len; i++) { - for (var j = i, length = array.length; j < length; j++) { - if (compareFn(array[i], array[j]) > 0) { - var t = array[i]; - array[i] = array[j]; - array[j] = t; - } - } - } - return array; - } - //更新表格 - function updateTable(table) { - //给第一行设置firstRow的样式名称,在排序图标的样式上使用到 - if (!utils.hasClass(table.rows[0], "firstRow")) { - for (var i = 1; i < table.rows.length; i++) { - utils.removeClass(table.rows[i], "firstRow"); - } - utils.addClass(table.rows[0], "firstRow"); - } - } - } -}); - -UE.parse.register("charts", function(utils) { - utils.cssRule( - "chartsContainerHeight", - ".edui-chart-container { height:" + - (this.chartContainerHeight || 300) + - "px}" - ); - var resourceRoot = this.rootPath, - containers = this.root, - sources = null; - - //不存在指定的根路径, 则直接退出 - if (!resourceRoot) { - return; - } - - if ((sources = parseSources())) { - loadResources(); - } - - function parseSources() { - if (!containers) { - return null; - } - - return extractChartData(containers); - } - - /** - * 提取数据 - */ - function extractChartData(rootNode) { - var data = [], - tables = rootNode.getElementsByTagName("table"); - - for (var i = 0, tableNode; (tableNode = tables[i]); i++) { - if (tableNode.getAttribute("data-chart") !== null) { - data.push(formatData(tableNode)); - } - } - - return data.length ? data : null; - } - - function formatData(tableNode) { - var meta = tableNode.getAttribute("data-chart"), - metaConfig = {}, - data = []; - - //提取table数据 - for (var i = 0, row; (row = tableNode.rows[i]); i++) { - var rowData = []; - - for (var j = 0, cell; (cell = row.cells[j]); j++) { - var value = cell.innerText || cell.textContent || ""; - rowData.push(cell.tagName == "TH" ? value : value | 0); - } - - data.push(rowData); - } - - //解析元信息 - meta = meta.split(";"); - for (var i = 0, metaData; (metaData = meta[i]); i++) { - metaData = metaData.split(":"); - metaConfig[metaData[0]] = metaData[1]; - } - - return { - table: tableNode, - meta: metaConfig, - data: data - }; - } - - //加载资源 - function loadResources() { - loadJQuery(); - } - - function loadJQuery() { - //不存在jquery, 则加载jquery - if (!window.jQuery) { - utils.loadFile( - document, - { - src: resourceRoot + "/third-party/jquery-1.10.2.min.js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - loadHighcharts(); - } - ); - } else { - loadHighcharts(); - } - } - - function loadHighcharts() { - //不存在Highcharts, 则加载Highcharts - if (!window.Highcharts) { - utils.loadFile( - document, - { - src: resourceRoot + "/third-party/highcharts/highcharts.js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - loadTypeConfig(); - } - ); - } else { - loadTypeConfig(); - } - } - - //加载图表差异化配置文件 - function loadTypeConfig() { - utils.loadFile( - document, - { - src: resourceRoot + "/dialogs/charts/chart.config.js", - tag: "script", - type: "text/javascript", - defer: "defer" - }, - function() { - render(); - } - ); - } - - //渲染图表 - function render() { - var config = null, - chartConfig = null, - container = null; - - for (var i = 0, len = sources.length; i < len; i++) { - config = sources[i]; - - chartConfig = analysisConfig(config); - - container = createContainer(config.table); - - renderChart(container, typeConfig[config.meta.chartType], chartConfig); - } - } - - /** - * 渲染图表 - * @param container 图表容器节点对象 - * @param typeConfig 图表类型配置 - * @param config 图表通用配置 - * */ - function renderChart(container, typeConfig, config) { - $(container).highcharts( - $.extend({}, typeConfig, { - credits: { - enabled: false - }, - exporting: { - enabled: false - }, - title: { - text: config.title, - x: -20 //center - }, - subtitle: { - text: config.subTitle, - x: -20 - }, - xAxis: { - title: { - text: config.xTitle - }, - categories: config.categories - }, - yAxis: { - title: { - text: config.yTitle - }, - plotLines: [ - { - value: 0, - width: 1, - color: "#808080" - } - ] - }, - tooltip: { - enabled: true, - valueSuffix: config.suffix - }, - legend: { - layout: "vertical", - align: "right", - verticalAlign: "middle", - borderWidth: 1 - }, - series: config.series - }) - ); - } - - /** - * 创建图表的容器 - * 新创建的容器会替换掉对应的table对象 - * */ - function createContainer(tableNode) { - var container = document.createElement("div"); - container.className = "edui-chart-container"; - - tableNode.parentNode.replaceChild(container, tableNode); - - return container; - } - - //根据config解析出正确的类别和图表数据信息 - function analysisConfig(config) { - var series = [], - //数据类别 - categories = [], - result = [], - data = config.data, - meta = config.meta; - - //数据对齐方式为相反的方式, 需要反转数据 - if (meta.dataFormat != "1") { - for (var i = 0, len = data.length; i < len; i++) { - for (var j = 0, jlen = data[i].length; j < jlen; j++) { - if (!result[j]) { - result[j] = []; - } - - result[j][i] = data[i][j]; - } - } - - data = result; - } - - result = {}; - - //普通图表 - if (meta.chartType != typeConfig.length - 1) { - categories = data[0].slice(1); - - for (var i = 1, curData; (curData = data[i]); i++) { - series.push({ - name: curData[0], - data: curData.slice(1) - }); - } - - result.series = series; - result.categories = categories; - result.title = meta.title; - result.subTitle = meta.subTitle; - result.xTitle = meta.xTitle; - result.yTitle = meta.yTitle; - result.suffix = meta.suffix; - } else { - var curData = []; - - for (var i = 1, len = data[0].length; i < len; i++) { - curData.push([data[0][i], data[1][i] | 0]); - } - - //饼图 - series[0] = { - type: "pie", - name: meta.tip, - data: curData - }; - - result.series = series; - result.title = meta.title; - result.suffix = meta.suffix; - } - - return result; - } -}); - -UE.parse.register("background", function(utils) { - var me = this, - root = me.root, - p = root.getElementsByTagName("p"), - styles; - - for (var i = 0, ci; (ci = p[i++]); ) { - styles = ci.getAttribute("data-background"); - if (styles) { - ci.parentNode.removeChild(ci); - } - } - - //追加默认的表格样式 - styles && - utils.cssRule( - "ueditor_background", - me.selector + "{" + styles + "}", - document - ); -}); - -UE.parse.register("list", function(utils) { - var customCss = [], - customStyle = { - cn: "cn-1-", - cn1: "cn-2-", - cn2: "cn-3-", - num: "num-1-", - num1: "num-2-", - num2: "num-3-", - dash: "dash", - dot: "dot" - }; - - utils.extend(this, { - liiconpath : utils.removeLastbs(this.rootPath) + '/themes/ueditor-list/', - listDefaultPaddingLeft: "20" - }); - - var root = this.root, - ols = root.getElementsByTagName("ol"), - uls = root.getElementsByTagName("ul"), - selector = this.selector; - - if (ols.length) { - applyStyle.call(this, ols); - } - - if (uls.length) { - applyStyle.call(this, uls); - } - - if (ols.length || uls.length) { - customCss.push(selector + " .list-paddingleft-1{padding-left:0}"); - customCss.push( - selector + - " .list-paddingleft-2{padding-left:" + - this.listDefaultPaddingLeft + - "px}" - ); - customCss.push( - selector + - " .list-paddingleft-3{padding-left:" + - this.listDefaultPaddingLeft * 2 + - "px}" - ); - - utils.cssRule( - "list", - selector + - " ol," + - selector + - " ul{margin:0;padding:0;}\n" + - selector + - " li{clear:both;}\n" + - customCss.join("\n"), - document - ); - } - function applyStyle(nodes) { - var T = this; - utils.each(nodes, function(list) { - if (list.className && /custom_/i.test(list.className)) { - var listStyle = list.className.match(/custom_(\w+)/)[1]; - if (listStyle == "dash" || listStyle == "dot") { - utils.pushItem( - customCss, - selector + - " li.list-" + - customStyle[listStyle] + - "{background-image:url(" + - T.liiconpath + - customStyle[listStyle] + - ".gif)}" - ); - utils.pushItem( - customCss, - selector + - " ul.custom_" + - listStyle + - "{list-style:none;} " + - selector + - " ul.custom_" + - listStyle + - " li{background-position:0 3px;background-repeat:no-repeat}" - ); - } else { - var index = 1; - utils.each(list.childNodes, function(li) { - if (li.tagName == "LI") { - utils.pushItem( - customCss, - selector + - " li.list-" + - customStyle[listStyle] + - index + - "{background-image:url(" + - T.liiconpath + - "list-" + - customStyle[listStyle] + - index + - ".gif)}" - ); - index++; - } - }); - utils.pushItem( - customCss, - selector + - " ol.custom_" + - listStyle + - "{list-style:none;}" + - selector + - " ol.custom_" + - listStyle + - " li{background-position:0 3px;background-repeat:no-repeat}" - ); - } - switch (listStyle) { - case "cn": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-1{padding-left:25px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-2{padding-left:40px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-3{padding-left:55px}" - ); - break; - case "cn1": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-1{padding-left:30px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-2{padding-left:40px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-3{padding-left:55px}" - ); - break; - case "cn2": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-1{padding-left:40px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-2{padding-left:55px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-3{padding-left:68px}" - ); - break; - case "num": - case "num1": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-1{padding-left:25px}" - ); - break; - case "num2": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-1{padding-left:35px}" - ); - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft-2{padding-left:40px}" - ); - break; - case "dash": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft{padding-left:35px}" - ); - break; - case "dot": - utils.pushItem( - customCss, - selector + - " li.list-" + - listStyle + - "-paddingleft{padding-left:20px}" - ); - } - } - }); - } -}); - -UE.parse.register("vedio", function(utils) { - var video = this.root.getElementsByTagName("video"), - audio = this.root.getElementsByTagName("audio"); - - document.createElement("video"); - document.createElement("audio"); - if (video.length || audio.length) { - var sourcePath = utils.removeLastbs(this.rootPath), - jsurl = sourcePath + "/third-party/video-js/video.js", - cssurl = sourcePath + "/third-party/video-js/video-js.min.css", - swfUrl = sourcePath + "/third-party/video-js/video-js.swf"; - - if (window.videojs) { - videojs.autoSetup(); - } else { - utils.loadFile(document, { - id: "video_css", - tag: "link", - rel: "stylesheet", - type: "text/css", - href: cssurl - }); - utils.loadFile( - document, - { - id: "video_js", - src: jsurl, - tag: "script", - type: "text/javascript" - }, - function() { - videojs.options.flash.swf = swfUrl; - videojs.autoSetup(); - } - ); - } - } -}); - - -})(); diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.parse.min.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.parse.min.js deleted file mode 100644 index 5e4b3787c0b16b15a1dbb8a1c07b9488cc17537d..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/neditor.parse.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * neditor parse - * version: 2.1.13 - * build: Sat Dec 29 2018 09:49:25 GMT+0000 (UTC) - */!function(){!function(){UE=window.UE||{};var a=!!window.ActiveXObject,b={removeLastbs:function(a){return a.replace(/\/$/,"")},extend:function(a,b){for(var c=arguments,d=!!this.isBoolean(c[c.length-1])&&c[c.length-1],e=this.isBoolean(c[c.length-1])?c.length-1:c.length,f=1;f=c&&a===b)return d=e,!1}),d},hasClass:function(a,b){b=b.replace(/(^[ ]+)|([ ]+$)/g,"").replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)if(!new RegExp("\\b"+c+"\\b","i").test(e))return!1;return d-1==b.length},addClass:function(a,c){if(a){c=this.trim(c).replace(/[ ]{2,}/g," ").split(" ");for(var d,e=0,f=a.className;d=c[e++];)new RegExp("\\b"+d+"\\b").test(f)||(f+=" "+d);a.className=b.trim(f)}},removeClass:function(a,b){b=this.isArray(b)?b:this.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)e=e.replace(new RegExp("\\b"+c+"\\b"),"");e=this.trim(e).replace(/[ ]{2,}/g," "),a.className=e,!e&&a.removeAttribute("className")},on:function(a,c,d){var e=this.isArray(c)?c:c.split(/\s+/),f=e.length;if(f)for(;f--;)if(c=e[f],a.addEventListener)a.addEventListener(c,d,!1);else{d._d||(d._d={els:[]});var g=c+d.toString(),h=b.indexOf(d._d.els,a);d._d[g]&&h!=-1||(h==-1&&d._d.els.push(a),d._d[g]||(d._d[g]=function(a){return d.call(a.srcElement,a||window.event)}),a.attachEvent("on"+c,d._d[g]))}a=null},off:function(a,c,d){var e=this.isArray(c)?c:c.split(/\s+/),f=e.length;if(f)for(;f--;)if(c=e[f],a.removeEventListener)a.removeEventListener(c,d,!1);else{var g=c+d.toString();try{a.detachEvent("on"+c,d._d?d._d[g]:d)}catch(h){}if(d._d&&d._d[g]){var i=b.indexOf(d._d.els,a);i!=-1&&d._d.els.splice(i,1),0==d._d.els.length&&delete d._d[g]}}},loadFile:function(){function a(a,c){try{for(var d,e=0;d=b[e++];)if(d.doc===a&&d.url==(c.src||c.href))return d}catch(f){return null}}var b=[];return function(c,d,e){var f=a(c,d);if(f)return void(f.ready?e&&e():f.funs.push(e));if(b.push({doc:c,url:d.src||d.href,funs:[e]}),!c.body){var g=[];for(var h in d)"tag"!=h&&g.push(h+'="'+d[h]+'"');return void c.write("<"+d.tag+" "+g.join(" ")+" >")}if(!d.id||!c.getElementById(d.id)){var i=c.createElement(d.tag);delete d.tag;for(var h in d)i.setAttribute(h,d[h]);i.onload=i.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(f=a(c,d),f.funs.length>0){f.ready=1;for(var b;b=f.funs.pop();)b()}i.onload=i.onreadystatechange=null}},i.onerror=function(){throw Error("The load "+(d.href||d.src)+" fails,check the url")},c.getElementsByTagName("head")[0].appendChild(i)}}}()};b.each(["String","Function","Array","Number","RegExp","Object","Boolean"],function(a){b["is"+a]=function(b){return Object.prototype.toString.apply(b)=="[object "+a+"]"}});var c={};UE.parse={register:function(a,b){c[a]=b},load:function(a){b.each(c,function(c){c.call(a,b)})}},uParse=function(a,c){b.domReady(function(){var d;if(document.querySelectorAll)d=document.querySelectorAll(a);else if(/^#/.test(a))d=[document.getElementById(a.replace(/^#/,""))];else if(/^\./.test(a)){var d=[];b.each(document.getElementsByTagName("*"),function(b){b.className&&new RegExp("\\b"+a.replace(/^\./,"")+"\\b","i").test(b.className)&&d.push(b)})}else d=document.getElementsByTagName(a);b.each(d,function(d){UE.parse.load(b.extend({root:d,selector:a},c))})})}}(),UE.parse.register("insertcode",function(a){var b=this.root.getElementsByTagName("pre");if(b.length)if("undefined"==typeof XRegExp){var c,d;void 0!==this.rootPath?(c=a.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCore.js",d=a.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCoreDefault.css"):(c=this.highlightJsUrl,d=this.highlightCssUrl),a.loadFile(document,{id:"syntaxhighlighter_css",tag:"link",rel:"stylesheet",type:"text/css",href:d}),a.loadFile(document,{id:"syntaxhighlighter_js",src:c,tag:"script",type:"text/javascript",defer:"defer"},function(){a.each(b,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})})}else a.each(b,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})}),UE.parse.register("table",function(a){function b(b,c){var d,e=b;for(c=a.isArray(c)?c:[c];e;){for(d=0;d0){var g=a[c];a[c]=a[e],a[e]=g}return a}function e(b){if(!a.hasClass(b.rows[0],"firstRow")){for(var c=1;c.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}")}catch(h){console&&console.log(h)}}!function(h){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(h,0);else{var l=function(){document.removeEventListener("DOMContentLoaded",l,!1),h()};document.addEventListener("DOMContentLoaded",l,!1)}else document.attachEvent&&(a=h,t=o.document,i=!1,v=function(){i||(i=!0,a())},(p=function(){try{t.documentElement.doScroll("left")}catch(h){return void setTimeout(p,50)}v()})(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,v())});var a,t,i,v,p}(function(){var h,l,a,t,i,v;(h=document.createElement("div")).innerHTML=p,p=null,(l=h.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",a=l,(t=document.body).firstChild?(i=a,(v=t.firstChild).parentNode.insertBefore(i,v)):t.appendChild(a))})}(window); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/fonts/iconfont.svg b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/fonts/iconfont.svg deleted file mode 100644 index f2e73d540dc4323fd2523d3cc6d352bdad5c4eee..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/fonts/iconfont.svg +++ /dev/null @@ -1,398 +0,0 @@ - - - - - -Created by iconfont - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/fonts/iconfont.ttf b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/fonts/iconfont.ttf deleted file mode 100644 index 294ff8550c1495f68b57d5a98aefb423b32ed6d8..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/fonts/iconfont.ttf and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/fonts/iconfont.woff b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/fonts/iconfont.woff deleted file mode 100644 index fc45fad96d0da853faedee837d81a82335d9050d..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/fonts/iconfont.woff and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/anchor.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/anchor.gif deleted file mode 100644 index fa4d420ada43da7064ebca58f79c80ba46488b64..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/anchor.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/arrow.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/arrow.png deleted file mode 100644 index d9008866ba56c4a4715a3f883ccb3be941031206..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/arrow.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/arrow_down.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/arrow_down.png deleted file mode 100644 index e9257e83b00375259f2f724c7cbac03d0df5ceb2..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/arrow_down.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/arrow_up.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/arrow_up.png deleted file mode 100644 index 74277af1e6a8ef91f8fe664efde11377a5292dbc..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/arrow_up.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/button-bg.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/button-bg.gif deleted file mode 100644 index ec7fa2eabf0705226fe0c488d65198508bf547e9..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/button-bg.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cancelbutton.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cancelbutton.gif deleted file mode 100644 index df4bc2c06d485df4403d689c98ee745a4cde8e97..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cancelbutton.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/charts.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/charts.png deleted file mode 100644 index 713965cc4c6971759c80a52290ddef9ab32776b6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/charts.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_h.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_h.gif deleted file mode 100644 index d7c3e7e9eb5755d57ec03c34097c258244abe61a..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_h.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_h.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_h.png deleted file mode 100644 index 2088fc24077a214aab0e758d571678a11dd41ce9..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_h.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_v.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_v.gif deleted file mode 100644 index bb508db552b6ac3f670f9ce1fcb1e55669db0dd6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_v.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_v.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_v.png deleted file mode 100644 index 6f39ca3d84d5e3c2cea3639b4d97c43df32aa4d7..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/cursor_v.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/dialog-title-bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/dialog-title-bg.png deleted file mode 100644 index f744f267f797ebf9993b746ecaff21b85d556e83..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/dialog-title-bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/filescan.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/filescan.png deleted file mode 100644 index 1d271588692c1726e3521032f71d8354b66fab0e..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/filescan.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/highlighted.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/highlighted.gif deleted file mode 100644 index 9272b4915ad2b8d4052a19b4c80a41b7c71cf1f1..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/highlighted.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/icons-all.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/icons-all.gif deleted file mode 100644 index 21915e59dede0aa22cda8c7097a14f0f1f68906c..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/icons-all.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/icons.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/icons.gif deleted file mode 100644 index 7abd30a1c6516cda6376f335902e3cadbae64c89..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/icons.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/icons.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/icons.png deleted file mode 100644 index c015e3aac9a84ebad11b932e84722124772d9641..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/icons.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/loaderror.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/loaderror.png deleted file mode 100644 index 35ff3336457d48dbecbc11698ef8245441a94f82..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/loaderror.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/loading.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/loading.gif deleted file mode 100644 index b713e27dfba708a01c380e7c731a13b52a34edfc..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/loading.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/lock.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/lock.gif deleted file mode 100644 index b4e6d7822a5af54c19e555f449a461baf464dc5e..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/lock.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/neweditor-tab-bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/neweditor-tab-bg.png deleted file mode 100644 index 8f398b0958cdc5136a23b9745becc23a833aa325..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/neweditor-tab-bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/pagebreak.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/pagebreak.gif deleted file mode 100644 index 8d1cffd64af72709b1180b3b0a51bbfe30bcb8c6..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/pagebreak.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/scale.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/scale.png deleted file mode 100644 index f45adb585717879be556fc978daf9f951de45e57..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/scale.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/sortable.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/sortable.png deleted file mode 100644 index 1bca649698e187a80e1b1951fde99ddea3d7b038..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/sortable.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/spacer.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/spacer.gif deleted file mode 100644 index 5bfd67a2d6f72ac3a55cbfcea5866e841d22f5d9..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/spacer.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/sparator_v.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/sparator_v.png deleted file mode 100644 index 8cf5662da8c36a446e1e08eb71b992c730ab8d15..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/sparator_v.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/table-cell-align.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/table-cell-align.png deleted file mode 100644 index ddf42853ea5c00663e74d9195d1f1264ab684252..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/table-cell-align.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/tangram-colorpicker.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/tangram-colorpicker.png deleted file mode 100644 index 738e500cfcf2c746f977189b05a7fe43544e80f0..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/tangram-colorpicker.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/toolbar_bg.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/toolbar_bg.png deleted file mode 100644 index 7ab685f4236ad543601b0d7dc43e429e041bee98..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/toolbar_bg.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/unhighlighted.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/unhighlighted.gif deleted file mode 100644 index 7ad0b67ae634d41e76848ec0b6696e8ac7e06983..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/unhighlighted.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/upload.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/upload.png deleted file mode 100644 index 08d4d9268204a20ca343bf75784302cc706d2417..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/upload.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/videologo.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/videologo.gif deleted file mode 100644 index d0c36c483f77acef63ee5ab20b6bc5b18f00302f..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/videologo.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/word.gif b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/word.gif deleted file mode 100644 index 9ef5d09b7b30c4f3225f77788462e429cc494b9b..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/word.gif and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/wordpaste.png b/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/wordpaste.png deleted file mode 100644 index 936775810b9ca1531a0973e73f9c3772eb6d69af..0000000000000000000000000000000000000000 Binary files a/api/src/main/resources/static/plug-in/neditor/2.1.13/themes/notadd/images/wordpaste.png and /dev/null differ diff --git a/api/src/main/resources/static/plug-in/neditor/2.1.13/third-party/SyntaxHighlighter/shCore.js b/api/src/main/resources/static/plug-in/neditor/2.1.13/third-party/SyntaxHighlighter/shCore.js deleted file mode 100644 index 32491842526a32527bb92877f312b7dd2e94e5ee..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/neditor/2.1.13/third-party/SyntaxHighlighter/shCore.js +++ /dev/null @@ -1,3655 +0,0 @@ -// XRegExp 1.5.1 -// (c) 2007-2012 Steven Levithan -// MIT License -// -// Provides an augmented, extensible, cross-browser implementation of regular expressions, -// including support for additional syntax, flags, and methods - -var XRegExp; - -if (XRegExp) { - // Avoid running twice, since that would break references to native globals - throw Error("can't load XRegExp twice in the same frame"); -} - -// Run within an anonymous function to protect variables and avoid new globals -(function (undefined) { - - //--------------------------------- - // Constructor - //--------------------------------- - - // Accepts a pattern and flags; returns a new, extended `RegExp` object. Differs from a native - // regular expression in that additional syntax and flags are supported and cross-browser - // syntax inconsistencies are ameliorated. `XRegExp(/regex/)` clones an existing regex and - // converts to type XRegExp - XRegExp = function (pattern, flags) { - var output = [], - currScope = XRegExp.OUTSIDE_CLASS, - pos = 0, - context, tokenResult, match, chr, regex; - - if (XRegExp.isRegExp(pattern)) { - if (flags !== undefined) - throw TypeError("can't supply flags when constructing one RegExp from another"); - return clone(pattern); - } - // Tokens become part of the regex construction process, so protect against infinite - // recursion when an XRegExp is constructed within a token handler or trigger - if (isInsideConstructor) - throw Error("can't call the XRegExp constructor within token definition functions"); - - flags = flags || ""; - context = { // `this` object for custom tokens - hasNamedCapture: false, - captureNames: [], - hasFlag: function (flag) {return flags.indexOf(flag) > -1;}, - setFlag: function (flag) {flags += flag;} - }; - - while (pos < pattern.length) { - // Check for custom tokens at the current position - tokenResult = runTokens(pattern, pos, currScope, context); - - if (tokenResult) { - output.push(tokenResult.output); - pos += (tokenResult.match[0].length || 1); - } else { - // Check for native multicharacter metasequences (excluding character classes) at - // the current position - if (match = nativ.exec.call(nativeTokens[currScope], pattern.slice(pos))) { - output.push(match[0]); - pos += match[0].length; - } else { - chr = pattern.charAt(pos); - if (chr === "[") - currScope = XRegExp.INSIDE_CLASS; - else if (chr === "]") - currScope = XRegExp.OUTSIDE_CLASS; - // Advance position one character - output.push(chr); - pos++; - } - } - } - - regex = RegExp(output.join(""), nativ.replace.call(flags, flagClip, "")); - regex._xregexp = { - source: pattern, - captureNames: context.hasNamedCapture ? context.captureNames : null - }; - return regex; - }; - - - //--------------------------------- - // Public properties - //--------------------------------- - - XRegExp.version = "1.5.1"; - - // Token scope bitflags - XRegExp.INSIDE_CLASS = 1; - XRegExp.OUTSIDE_CLASS = 2; - - - //--------------------------------- - // Private variables - //--------------------------------- - - var replacementToken = /\$(?:(\d\d?|[$&`'])|{([$\w]+)})/g, - flagClip = /[^gimy]+|([\s\S])(?=[\s\S]*\1)/g, // Nonnative and duplicate flags - quantifier = /^(?:[?*+]|{\d+(?:,\d*)?})\??/, - isInsideConstructor = false, - tokens = [], - // Copy native globals for reference ("native" is an ES3 reserved keyword) - nativ = { - exec: RegExp.prototype.exec, - test: RegExp.prototype.test, - match: String.prototype.match, - replace: String.prototype.replace, - split: String.prototype.split - }, - compliantExecNpcg = nativ.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups - compliantLastIndexIncrement = function () { - var x = /^/g; - nativ.test.call(x, ""); - return !x.lastIndex; - }(), - hasNativeY = RegExp.prototype.sticky !== undefined, - nativeTokens = {}; - - // `nativeTokens` match native multicharacter metasequences only (including deprecated octals, - // excluding character classes) - nativeTokens[XRegExp.INSIDE_CLASS] = /^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/; - nativeTokens[XRegExp.OUTSIDE_CLASS] = /^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/; - - - //--------------------------------- - // Public methods - //--------------------------------- - - // Lets you extend or change XRegExp syntax and create custom flags. This is used internally by - // the XRegExp library and can be used to create XRegExp plugins. This function is intended for - // users with advanced knowledge of JavaScript's regular expression syntax and behavior. It can - // be disabled by `XRegExp.freezeTokens` - XRegExp.addToken = function (regex, handler, scope, trigger) { - tokens.push({ - pattern: clone(regex, "g" + (hasNativeY ? "y" : "")), - handler: handler, - scope: scope || XRegExp.OUTSIDE_CLASS, - trigger: trigger || null - }); - }; - - // Accepts a pattern and flags; returns an extended `RegExp` object. If the pattern and flag - // combination has previously been cached, the cached copy is returned; otherwise the newly - // created regex is cached - XRegExp.cache = function (pattern, flags) { - var key = pattern + "/" + (flags || ""); - return XRegExp.cache[key] || (XRegExp.cache[key] = XRegExp(pattern, flags)); - }; - - // Accepts a `RegExp` instance; returns a copy with the `/g` flag set. The copy has a fresh - // `lastIndex` (set to zero). If you want to copy a regex without forcing the `global` - // property, use `XRegExp(regex)`. Do not use `RegExp(regex)` because it will not preserve - // special properties required for named capture - XRegExp.copyAsGlobal = function (regex) { - return clone(regex, "g"); - }; - - // Accepts a string; returns the string with regex metacharacters escaped. The returned string - // can safely be used at any point within a regex to match the provided literal string. Escaped - // characters are [ ] { } ( ) * + ? - . , \ ^ $ | # and whitespace - XRegExp.escape = function (str) { - return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - }; - - // Accepts a string to search, regex to search with, position to start the search within the - // string (default: 0), and an optional Boolean indicating whether matches must start at-or- - // after the position or at the specified position only. This function ignores the `lastIndex` - // of the provided regex in its own handling, but updates the property for compatibility - XRegExp.execAt = function (str, regex, pos, anchored) { - var r2 = clone(regex, "g" + ((anchored && hasNativeY) ? "y" : "")), - match; - r2.lastIndex = pos = pos || 0; - match = r2.exec(str); // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (anchored && match && match.index !== pos) - match = null; - if (regex.global) - regex.lastIndex = match ? r2.lastIndex : 0; - return match; - }; - - // Breaks the unrestorable link to XRegExp's private list of tokens, thereby preventing - // syntax and flag changes. Should be run after XRegExp and any plugins are loaded - XRegExp.freezeTokens = function () { - XRegExp.addToken = function () { - throw Error("can't run addToken after freezeTokens"); - }; - }; - - // Accepts any value; returns a Boolean indicating whether the argument is a `RegExp` object. - // Note that this is also `true` for regex literals and regexes created by the `XRegExp` - // constructor. This works correctly for variables created in another frame, when `instanceof` - // and `constructor` checks would fail to work as intended - XRegExp.isRegExp = function (o) { - return Object.prototype.toString.call(o) === "[object RegExp]"; - }; - - // Executes `callback` once per match within `str`. Provides a simpler and cleaner way to - // iterate over regex matches compared to the traditional approaches of subverting - // `String.prototype.replace` or repeatedly calling `exec` within a `while` loop - XRegExp.iterate = function (str, regex, callback, context) { - var r2 = clone(regex, "g"), - i = -1, match; - while (match = r2.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (regex.global) - regex.lastIndex = r2.lastIndex; // Doing this to follow expectations if `lastIndex` is checked within `callback` - callback.call(context, match, ++i, str, regex); - if (r2.lastIndex === match.index) - r2.lastIndex++; - } - if (regex.global) - regex.lastIndex = 0; - }; - - // Accepts a string and an array of regexes; returns the result of using each successive regex - // to search within the matches of the previous regex. The array of regexes can also contain - // objects with `regex` and `backref` properties, in which case the named or numbered back- - // references specified are passed forward to the next regex or returned. E.g.: - // var xregexpImgFileNames = XRegExp.matchChain(html, [ - // {regex: /]+)>/i, backref: 1}, // tag attributes - // {regex: XRegExp('(?ix) \\s src=" (? [^"]+ )'), backref: "src"}, // src attribute values - // {regex: XRegExp("^http://xregexp\\.com(/[^#?]+)", "i"), backref: 1}, // xregexp.com paths - // /[^\/]+$/ // filenames (strip directory paths) - // ]); - XRegExp.matchChain = function (str, chain) { - return function recurseChain (values, level) { - var item = chain[level].regex ? chain[level] : {regex: chain[level]}, - regex = clone(item.regex, "g"), - matches = [], i; - for (i = 0; i < values.length; i++) { - XRegExp.iterate(values[i], regex, function (match) { - matches.push(item.backref ? (match[item.backref] || "") : match[0]); - }); - } - return ((level === chain.length - 1) || !matches.length) ? - matches : recurseChain(matches, level + 1); - }([str], 0); - }; - - - //--------------------------------- - // New RegExp prototype methods - //--------------------------------- - - // Accepts a context object and arguments array; returns the result of calling `exec` with the - // first value in the arguments array. the context is ignored but is accepted for congruity - // with `Function.prototype.apply` - RegExp.prototype.apply = function (context, args) { - return this.exec(args[0]); - }; - - // Accepts a context object and string; returns the result of calling `exec` with the provided - // string. the context is ignored but is accepted for congruity with `Function.prototype.call` - RegExp.prototype.call = function (context, str) { - return this.exec(str); - }; - - - //--------------------------------- - // Overriden native methods - //--------------------------------- - - // Adds named capture support (with backreferences returned as `result.name`), and fixes two - // cross-browser issues per ES3: - // - Captured values for nonparticipating capturing groups should be returned as `undefined`, - // rather than the empty string. - // - `lastIndex` should not be incremented after zero-length matches. - RegExp.prototype.exec = function (str) { - var match, name, r2, origLastIndex; - if (!this.global) - origLastIndex = this.lastIndex; - match = nativ.exec.apply(this, arguments); - if (match) { - // Fix browsers whose `exec` methods don't consistently return `undefined` for - // nonparticipating capturing groups - if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { - r2 = RegExp(this.source, nativ.replace.call(getNativeFlags(this), "g", "")); - // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed - // matching due to characters outside the match - nativ.replace.call((str + "").slice(match.index), r2, function () { - for (var i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) - match[i] = undefined; - } - }); - } - // Attach named capture properties - if (this._xregexp && this._xregexp.captureNames) { - for (var i = 1; i < match.length; i++) { - name = this._xregexp.captureNames[i - 1]; - if (name) - match[name] = match[i]; - } - } - // Fix browsers that increment `lastIndex` after zero-length matches - if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - } - if (!this.global) - this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - return match; - }; - - // Fix browser bugs in native method - RegExp.prototype.test = function (str) { - // Use the native `exec` to skip some processing overhead, even though the altered - // `exec` would take care of the `lastIndex` fixes - var match, origLastIndex; - if (!this.global) - origLastIndex = this.lastIndex; - match = nativ.exec.call(this, str); - // Fix browsers that increment `lastIndex` after zero-length matches - if (match && !compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - if (!this.global) - this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - return !!match; - }; - - // Adds named capture support and fixes browser bugs in native method - String.prototype.match = function (regex) { - if (!XRegExp.isRegExp(regex)) - regex = RegExp(regex); // Native `RegExp` - if (regex.global) { - var result = nativ.match.apply(this, arguments); - regex.lastIndex = 0; // Fix IE bug - return result; - } - return regex.exec(this); // Run the altered `exec` - }; - - // Adds support for `${n}` tokens for named and numbered backreferences in replacement text, - // and provides named backreferences to replacement functions as `arguments[0].name`. Also - // fixes cross-browser differences in replacement text syntax when performing a replacement - // using a nonregex search value, and the value of replacement regexes' `lastIndex` property - // during replacement iterations. Note that this doesn't support SpiderMonkey's proprietary - // third (`flags`) parameter - String.prototype.replace = function (search, replacement) { - var isRegex = XRegExp.isRegExp(search), - captureNames, result, str, origLastIndex; - - // There are too many combinations of search/replacement types/values and browser bugs that - // preclude passing to native `replace`, so don't try - //if (...) - // return nativ.replace.apply(this, arguments); - - if (isRegex) { - if (search._xregexp) - captureNames = search._xregexp.captureNames; // Array or `null` - if (!search.global) - origLastIndex = search.lastIndex; - } else { - search = search + ""; // Type conversion - } - - if (Object.prototype.toString.call(replacement) === "[object Function]") { - result = nativ.replace.call(this + "", search, function () { - if (captureNames) { - // Change the `arguments[0]` string primitive to a String object which can store properties - arguments[0] = new String(arguments[0]); - // Store named backreferences on `arguments[0]` - for (var i = 0; i < captureNames.length; i++) { - if (captureNames[i]) - arguments[0][captureNames[i]] = arguments[i + 1]; - } - } - // Update `lastIndex` before calling `replacement` (fix browsers) - if (isRegex && search.global) - search.lastIndex = arguments[arguments.length - 2] + arguments[0].length; - return replacement.apply(null, arguments); - }); - } else { - str = this + ""; // Type conversion, so `args[args.length - 1]` will be a string (given nonstring `this`) - result = nativ.replace.call(str, search, function () { - var args = arguments; // Keep this function's `arguments` available through closure - return nativ.replace.call(replacement + "", replacementToken, function ($0, $1, $2) { - // Numbered backreference (without delimiters) or special variable - if ($1) { - switch ($1) { - case "$": return "$"; - case "&": return args[0]; - case "`": return args[args.length - 1].slice(0, args[args.length - 2]); - case "'": return args[args.length - 1].slice(args[args.length - 2] + args[0].length); - // Numbered backreference - default: - // What does "$10" mean? - // - Backreference 10, if 10 or more capturing groups exist - // - Backreference 1 followed by "0", if 1-9 capturing groups exist - // - Otherwise, it's the string "$10" - // Also note: - // - Backreferences cannot be more than two digits (enforced by `replacementToken`) - // - "$01" is equivalent to "$1" if a capturing group exists, otherwise it's the string "$01" - // - There is no "$0" token ("$&" is the entire match) - var literalNumbers = ""; - $1 = +$1; // Type conversion; drop leading zero - if (!$1) // `$1` was "0" or "00" - return $0; - while ($1 > args.length - 3) { - literalNumbers = String.prototype.slice.call($1, -1) + literalNumbers; - $1 = Math.floor($1 / 10); // Drop the last digit - } - return ($1 ? args[$1] || "" : "$") + literalNumbers; - } - // Named backreference or delimited numbered backreference - } else { - // What does "${n}" mean? - // - Backreference to numbered capture n. Two differences from "$n": - // - n can be more than two digits - // - Backreference 0 is allowed, and is the entire match - // - Backreference to named capture n, if it exists and is not a number overridden by numbered capture - // - Otherwise, it's the string "${n}" - var n = +$2; // Type conversion; drop leading zeros - if (n <= args.length - 3) - return args[n]; - n = captureNames ? indexOf(captureNames, $2) : -1; - return n > -1 ? args[n + 1] : $0; - } - }); - }); - } - - if (isRegex) { - if (search.global) - search.lastIndex = 0; // Fix IE, Safari bug (last tested IE 9.0.5, Safari 5.1.2 on Windows) - else - search.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - } - - return result; - }; - - // A consistent cross-browser, ES3 compliant `split` - String.prototype.split = function (s /* separator */, limit) { - // If separator `s` is not a regex, use the native `split` - if (!XRegExp.isRegExp(s)) - return nativ.split.apply(this, arguments); - - var str = this + "", // Type conversion - output = [], - lastLastIndex = 0, - match, lastLength; - - // Behavior for `limit`: if it's... - // - `undefined`: No limit - // - `NaN` or zero: Return an empty array - // - A positive number: Use `Math.floor(limit)` - // - A negative number: No limit - // - Other: Type-convert, then use the above rules - if (limit === undefined || +limit < 0) { - limit = Infinity; - } else { - limit = Math.floor(+limit); - if (!limit) - return []; - } - - // This is required if not `s.global`, and it avoids needing to set `s.lastIndex` to zero - // and restore it to its original value when we're done using the regex - s = XRegExp.copyAsGlobal(s); - - while (match = s.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (s.lastIndex > lastLastIndex) { - output.push(str.slice(lastLastIndex, match.index)); - - if (match.length > 1 && match.index < str.length) - Array.prototype.push.apply(output, match.slice(1)); - - lastLength = match[0].length; - lastLastIndex = s.lastIndex; - - if (output.length >= limit) - break; - } - - if (s.lastIndex === match.index) - s.lastIndex++; - } - - if (lastLastIndex === str.length) { - if (!nativ.test.call(s, "") || lastLength) - output.push(""); - } else { - output.push(str.slice(lastLastIndex)); - } - - return output.length > limit ? output.slice(0, limit) : output; - }; - - - //--------------------------------- - // Private helper functions - //--------------------------------- - - // Supporting function for `XRegExp`, `XRegExp.copyAsGlobal`, etc. Returns a copy of a `RegExp` - // instance with a fresh `lastIndex` (set to zero), preserving properties required for named - // capture. Also allows adding new flags in the process of copying the regex - function clone (regex, additionalFlags) { - if (!XRegExp.isRegExp(regex)) - throw TypeError("type RegExp expected"); - var x = regex._xregexp; - regex = XRegExp(regex.source, getNativeFlags(regex) + (additionalFlags || "")); - if (x) { - regex._xregexp = { - source: x.source, - captureNames: x.captureNames ? x.captureNames.slice(0) : null - }; - } - return regex; - } - - function getNativeFlags (regex) { - return (regex.global ? "g" : "") + - (regex.ignoreCase ? "i" : "") + - (regex.multiline ? "m" : "") + - (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 - (regex.sticky ? "y" : ""); - } - - function runTokens (pattern, index, scope, context) { - var i = tokens.length, - result, match, t; - // Protect against constructing XRegExps within token handler and trigger functions - isInsideConstructor = true; - // Must reset `isInsideConstructor`, even if a `trigger` or `handler` throws - try { - while (i--) { // Run in reverse order - t = tokens[i]; - if ((scope & t.scope) && (!t.trigger || t.trigger.call(context))) { - t.pattern.lastIndex = index; - match = t.pattern.exec(pattern); // Running the altered `exec` here allows use of named backreferences, etc. - if (match && match.index === index) { - result = { - output: t.handler.call(context, match, scope), - match: match - }; - break; - } - } - } - } catch (err) { - throw err; - } finally { - isInsideConstructor = false; - } - return result; - } - - function indexOf (array, item, from) { - if (Array.prototype.indexOf) // Use the native array method if available - return array.indexOf(item, from); - for (var i = from || 0; i < array.length; i++) { - if (array[i] === item) - return i; - } - return -1; - } - - - //--------------------------------- - // Built-in tokens - //--------------------------------- - - // Augment XRegExp's regular expression syntax and flags. Note that when adding tokens, the - // third (`scope`) argument defaults to `XRegExp.OUTSIDE_CLASS` - - // Comment pattern: (?# ) - XRegExp.addToken( - /\(\?#[^)]*\)/, - function (match) { - // Keep tokens separated unless the following token is a quantifier - return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; - } - ); - - // Capturing group (match the opening parenthesis only). - // Required for support of named capturing groups - XRegExp.addToken( - /\((?!\?)/, - function () { - this.captureNames.push(null); - return "("; - } - ); - - // Named capturing group (match the opening delimiter only): (? - XRegExp.addToken( - /\(\?<([$\w]+)>/, - function (match) { - this.captureNames.push(match[1]); - this.hasNamedCapture = true; - return "("; - } - ); - - // Named backreference: \k - XRegExp.addToken( - /\\k<([\w$]+)>/, - function (match) { - var index = indexOf(this.captureNames, match[1]); - // Keep backreferences separate from subsequent literal numbers. Preserve back- - // references to named groups that are undefined at this point as literal strings - return index > -1 ? - "\\" + (index + 1) + (isNaN(match.input.charAt(match.index + match[0].length)) ? "" : "(?:)") : - match[0]; - } - ); - - // Empty character class: [] or [^] - XRegExp.addToken( - /\[\^?]/, - function (match) { - // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. - // (?!) should work like \b\B, but is unreliable in Firefox - return match[0] === "[]" ? "\\b\\B" : "[\\s\\S]"; - } - ); - - // Mode modifier at the start of the pattern only, with any combination of flags imsx: (?imsx) - // Does not support x(?i), (?-i), (?i-m), (?i: ), (?i)(?m), etc. - XRegExp.addToken( - /^\(\?([imsx]+)\)/, - function (match) { - this.setFlag(match[1]); - return ""; - } - ); - - // Whitespace and comments, in free-spacing (aka extended) mode only - XRegExp.addToken( - /(?:\s+|#.*)+/, - function (match) { - // Keep tokens separated unless the following token is a quantifier - return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; - }, - XRegExp.OUTSIDE_CLASS, - function () {return this.hasFlag("x");} - ); - - // Dot, in dotall (aka singleline) mode only - XRegExp.addToken( - /\./, - function () {return "[\\s\\S]";}, - XRegExp.OUTSIDE_CLASS, - function () {return this.hasFlag("s");} - ); - - - //--------------------------------- - // Backward compatibility - //--------------------------------- - - // Uncomment the following block for compatibility with XRegExp 1.0-1.2: - /* - XRegExp.matchWithinChain = XRegExp.matchChain; - RegExp.prototype.addFlags = function (s) {return clone(this, s);}; - RegExp.prototype.execAll = function (s) {var r = []; XRegExp.iterate(s, this, function (m) {r.push(m);}); return r;}; - RegExp.prototype.forEachExec = function (s, f, c) {return XRegExp.iterate(s, this, f, c);}; - RegExp.prototype.validate = function (s) {var r = RegExp("^(?:" + this.source + ")$(?!\\s)", getNativeFlags(this)); if (this.global) this.lastIndex = 0; return s.search(r) === 0;}; - */ - -})(); - -// -// Begin anonymous function. This is used to contain local scope variables without polutting global scope. -// -if (typeof(SyntaxHighlighter) == 'undefined') var SyntaxHighlighter = function() { - -// CommonJS - if (typeof(require) != 'undefined' && typeof(XRegExp) == 'undefined') - { - XRegExp = require('XRegExp').XRegExp; - } - -// Shortcut object which will be assigned to the SyntaxHighlighter variable. -// This is a shorthand for local reference in order to avoid long namespace -// references to SyntaxHighlighter.whatever... - var sh = { - defaults : { - /** Additional CSS class names to be added to highlighter elements. */ - 'class-name' : '', - - /** First line number. */ - 'first-line' : 1, - - /** - * Pads line numbers. Possible values are: - * - * false - don't pad line numbers. - * true - automaticaly pad numbers with minimum required number of leading zeroes. - * [int] - length up to which pad line numbers. - */ - 'pad-line-numbers' : false, - - /** Lines to highlight. */ - 'highlight' : false, - - /** Title to be displayed above the code block. */ - 'title' : null, - - /** Enables or disables smart tabs. */ - 'smart-tabs' : true, - - /** Gets or sets tab size. */ - 'tab-size' : 4, - - /** Enables or disables gutter. */ - 'gutter' : true, - - /** Enables or disables toolbar. */ - 'toolbar' : true, - - /** Enables quick code copy and paste from double click. */ - 'quick-code' : true, - - /** Forces code view to be collapsed. */ - 'collapse' : false, - - /** Enables or disables automatic links. */ - 'auto-links' : false, - - /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */ - 'light' : false, - - 'unindent' : true, - - 'html-script' : false - }, - - config : { - space : ' ', - - /** Enables use of -``` - -To export the table in XLSX (Excel 2007+ XML Format) format, you need to include additionally: -```html - -``` - -To export the table as a PDF file the following includes are required: - -```html - - -``` - -To export the table in PNG format, you need to include: - -```html - -``` - -Regardless of the desired format, finally include: - -```html - -``` - -Please keep this include order. - - - -Dependencies -============ - -Library | Version ---------|-------- -[jQuery](https://github.com/jquery/jquery) | >= 1.9.1 -[FileSaver](https://github.com/hhurz/tableExport.jquery.plugin/blob/master/libs/FileSaver/FileSaver.min.js) | >= 1.2.0 -[html2canvas](https://github.com/niklasvh/html2canvas) | >= 0.5.0-beta4 -[jsPDF](https://github.com/MrRio/jsPDF) | 1.3.2 - 1.3.4 -[jsPDF-AutoTable](https://github.com/simonbengtsson/jsPDF-AutoTable) | 2.0.14 or 2.0.17 -[SheetJS](https://github.com/SheetJS/js-xlsx) | >= 0.12.5 - - - - -Examples -======== - -``` -// CSV format - -$('#tableID').tableExport({type:'csv'}); -``` - -``` -// Excel 2000 html format - -$('#tableID').tableExport({type:'excel'}); -``` - -``` -// XML Spreadsheet 2003 file format with multiple worksheet support - -$('table').tableExport({type:'excel', - mso: {fileFormat:'xmlss', - worksheetName: ['Table 1','Table 2', 'Table 3']}}); -``` - -``` -// PDF export using jsPDF only - -$('#tableID').tableExport({type:'pdf', - jspdf: {orientation: 'p', - margins: {left:20, top:10}, - autotable: false} - }); -``` - -``` -// PDF format using jsPDF and jsPDF Autotable - -$('#tableID').tableExport({type:'pdf', - jspdf: {orientation: 'l', - format: 'a3', - margins: {left:10, right:10, top:20, bottom:20}, - autotable: {styles: {fillColor: 'inherit', - textColor: 'inherit'}, - tableWidth: 'auto'} - } - }); -``` - -``` -// PDF format with callback example - -function DoCellData(cell, row, col, data) {} -function DoBeforeAutotable(table, headers, rows, AutotableSettings) {} - -$('table').tableExport({fileName: sFileName, - type: 'pdf', - jspdf: {format: 'bestfit', - margins: {left:20, right:10, top:20, bottom:20}, - autotable: {styles: {overflow: 'linebreak'}, - tableWidth: 'wrap', - tableExport: {onBeforeAutotable: DoBeforeAutotable, - onCellData: DoCellData}}} - }); -``` - -Options (Default settings) -======= - -``` -csvEnclosure: '"' -csvSeparator: ',' -csvUseBOM: true -displayTableName: false -escape: false -exportHiddenCells: false -fileName: 'tableExport' -htmlContent: false -ignoreColumn: [] -ignoreRow: [] -jsonScope: 'all' -jspdf: orientation: 'p' - unit:'pt' - format: 'a4' - margins: left: 20 - right: 10 - top: 10 - bottom: 10 - onDocCreated: null - autotable: styles: cellPadding: 2 - rowHeight: 12 - fontSize: 8 - fillColor: 255 - textColor: 50 - fontStyle: 'normal' - overflow: 'ellipsize' - halign: 'left' - valign: 'middle' - headerStyles: fillColor: [52, 73, 94] - textColor: 255 - fontStyle: 'bold' - halign: 'center' - alternateRowStyles: fillColor: 245 - tableExport: doc: null - onAfterAutotable: null - onBeforeAutotable: null - onAutotableText: null - onTable: null - outputImages: true -maxNestedTables: 1 -mso: fileFormat: 'xlshtml' - onMsoNumberFormat: null - pageFormat: 'a4' - pageOrientation: 'portrait' - rtl: false - styles: [] - worksheetName: '' -numbers: html: decimalMark: '.' - thousandsSeparator: ',' - output: decimalMark: '.', - thousandsSeparator: ',' -onCellData: null -onCellHtmlData: null -onIgnoreRow: null -outputMode: 'file' -pdfmake: enabled: false - docDefinition: pageOrientation: 'portrait' - defaultStyle: font: 'Roboto' - fonts: {} -tbodySelector: 'tr' -tfootSelector: 'tr' -theadSelector: 'tr' -tableName: 'myTableName' -type: 'csv' -``` - -```ignoreColumn``` can be either an array of indexes (i.e. [0, 2]) or field names (i.e. ["id", "name"]). -* Indexes correspond to the position of the header elements `th` in the DOM starting at 0. (If the `th` elements are removed or added to the DOM, the indexes will be shifted so use the functionality wisely!) -* Field names should correspond to the values set on the "data-field" attribute of the header elements `th` in the DOM. -* "Nameless" columns without data-field attribute will be named by their index number (converted to a string) - -To disable formatting of numbers in the exported output, which can be useful for csv and excel format, set the option ``` numbers: output ``` to ``` false ```. - -Set the option ``` mso.fileFormat ``` to ``` 'xmlss' ``` if you want to export in XML Spreadsheet 2003 file format. Use this format if multiple tables should be exported into a single file. Excel 2000 html format is the default excel file format which has better support of exporting table styles. - -The ``` mso.styles ``` option lets you define the css attributes of the original html table cells, that should be taken over when exporting to an excel worksheet (Excel 2000 html format only). - -To export in XSLX format [SheetJS/js-xlsx](https://github.com/SheetJS/js-xlsx) is used. Please note that the implementation of this format type lets you only export table data, but not any styling information of the html table. - -For jspdf options see the documentation of [jsPDF](https://github.com/MrRio/jsPDF) and [jsPDF-AutoTable](https://github.com/simonbengtsson/jsPDF-AutoTable) resp. - -There is an extended setting for ``` jsPDF option 'format' ```. Setting the option value to ``` 'bestfit' ``` lets the tableExport plugin try to choose the minimum required paper format and orientation in which the table (or tables in multitable mode) completely fits without column adjustment. - -Also there is an extended setting for the ``` jsPDF-AutoTable options 'fillColor', 'textColor' and 'fontStyle'```. When setting these option values to ``` 'inherit' ``` the original css values for background and text color will be used as fill and text color while exporting to pdf. A css font-weight >= 700 results in a bold fontStyle and the italic css font-style will be used as italic fontStyle. - -When exporting to pdf the option ``` outputImages ``` lets you enable or disable the output of images that are located in the original html table. - - -Optional html data attributes -============================= -(can be applied while generating the table that you want to export) - -

                      data-tableexport-cellformat

                      - -```html -... -> An empty data value preserves format of cell content. E.g. no number seperator conversion - - More cell formats to be come... -``` - -

                      data-tableexport-colspan

                      - -```html -... -> Overwrites the colspan attribute of the table cell during export. - This attribute can be used if there follow hidden cells, that will be exported by using the "data-tableexport-display" attribute. -``` - -

                      data-tableexport-display

                      - -```html -...
                      -> A hidden table will be exported - -... -> A hidden cell will be exported - -... -> This cell will not be exported - -... -> All cells of this row will not be exported -``` - -

                      data-tableexport-msonumberformat

                      - -```html -... -> Data value will be used to style excel cells with mso-number-format (Excel 2000 html format only) - Examples: - "\@" excel treats cell content alway as text, even numbers - "0" excel will display no decimals for numbers - "0\.000" excel displays numbers with 3 decimals - "0%" excel will display a number as percent with no decimals - "Percent" excel will display a number as percent with 2 decimals -``` - -

                      data-tableexport-rowspan

                      - -```html -... -> Overwrites the rowspan attribute of the table cell during export. - This attribute can be used if there follow hidden rows, that will be exported by using the "data-tableexport-display" attribute. -``` - -

                      data-tableexport-value

                      - -```html -title -> "export title" instead of "title" will be exported - -content -> "export content" instead of "content" will be exported -``` - -Excel Notes -=========== - -When exporting in Excel 2000 html format (xlshtml) the default extension of the result file is XLS although the type of the file content is HTML. When you open a file in Microsoft Office Excel 2007 or later that contains content that does not match the files extension, you receive the following warning message: -```The file you are trying to open, 'name.ext', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?``` -According to this [Knowledge base article](https://support.microsoft.com/en-us/help/948615/error-opening-file-the-file-format-differs-from-the-format-that-the-fi) The warning message can help prevent unexpected problems that might occur because of possible incompatibility between the actual content of the file and the file name extension. The article also gives you some hints to disable the warning message. diff --git a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/bower.json b/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/bower.json deleted file mode 100644 index 7324fd283a8a6a7ef6a75a0d5d2fb9ee7ae0c06c..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/bower.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "tableexport.jquery.plugin", - "version": "1.9.11", - "description": "html table export", - "main": "tableExport.js", - "authors": [ - "hhurz" - ], - "license": "MIT", - "keywords": [ - "html5", - "javascript", - "jquery", - "export", - "table" - ], - "homepage": "https://github.com/hhurz/tableExport.jquery.plugin", - "dependencies": { - "jquery": ">=1.9.1", - "file-saver": ">=1.2.0", - "html2canvas": "*", - "jspdf": "1.3.2 - 1.3.4", - "jspdf-autotable": "2.0.14 || 2.0.17" - }, - "moduleType": [ - "globals" - ], - "ignore": [ - "package.json", - "libs", - "tools", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/FileSaver/FileSaver.min.js b/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/FileSaver/FileSaver.min.js deleted file mode 100644 index 9a1e397f20b4f0b7ad8657e24b466ed36b36fa12..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/FileSaver/FileSaver.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ -var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})} diff --git a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/FileSaver/LICENSE.md b/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/FileSaver/LICENSE.md deleted file mode 100644 index 32ef3ca0ba706f9ae9ef437d7219748c90d1641b..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/FileSaver/LICENSE.md +++ /dev/null @@ -1,11 +0,0 @@ -The MIT License - -Copyright © 2016 [Eli Grey][1]. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - [1]: http://eligrey.com diff --git a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/html2canvas/LICENSE b/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/html2canvas/LICENSE deleted file mode 100644 index a73ffc9143edf0da1c821e920b6ec8582aba61f3..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/html2canvas/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Niklas von Hertzen - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/html2canvas/html2canvas.min.js b/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/html2canvas/html2canvas.min.js deleted file mode 100644 index be39289f6b1b5606c9129aaa9fb3b5eaec1a60d7..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/html2canvas/html2canvas.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - html2canvas 0.5.0-beta3 - Copyright (c) 2016 Niklas von Hertzen - - Released under License -*/ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.html2canvas=e()}}(function(){var e;return function n(e,f,o){function d(t,l){if(!f[t]){if(!e[t]){var s="function"==typeof require&&require;if(!l&&s)return s(t,!0);if(i)return i(t,!0);var u=new Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}var a=f[t]={exports:{}};e[t][0].call(a.exports,function(n){var f=e[t][1][n];return d(f?f:n)},a,a.exports,n,e,f,o)}return f[t].exports}for(var i="function"==typeof require&&require,t=0;td;)n=e.charCodeAt(d++),n>=55296&&56319>=n&&i>d?(f=e.charCodeAt(d++),56320==(64512&f)?o.push(((1023&n)<<10)+(1023&f)+65536):(o.push(n),d--)):o.push(n);return o}function u(e){return t(e,function(e){var n="";return e>65535&&(e-=65536,n+=L(e>>>10&1023|55296),e=56320|1023&e),n+=L(e)}).join("")}function a(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:k}function p(e,n){return e+22+75*(26>e)-((0!=n)<<5)}function c(e,n,f){var o=0;for(e=f?K(e/B):e>>1,e+=K(e/n);e>J*z>>1;o+=k)e=K(e/J);return K(o+(J+1)*e/(e+A))}function y(e){var n,f,o,d,t,l,s,p,y,m,r=[],v=e.length,w=0,b=D,g=C;for(f=e.lastIndexOf(E),0>f&&(f=0),o=0;f>o;++o)e.charCodeAt(o)>=128&&i("not-basic"),r.push(e.charCodeAt(o));for(d=f>0?f+1:0;v>d;){for(t=w,l=1,s=k;d>=v&&i("invalid-input"),p=a(e.charCodeAt(d++)),(p>=k||p>K((j-w)/l))&&i("overflow"),w+=p*l,y=g>=s?q:s>=g+z?z:s-g,!(y>p);s+=k)m=k-y,l>K(j/m)&&i("overflow"),l*=m;n=r.length+1,g=c(w-t,n,0==t),K(w/n)>j-b&&i("overflow"),b+=K(w/n),w%=n,r.splice(w++,0,b)}return u(r)}function m(e){var n,f,o,d,t,l,u,a,y,m,r,v,w,b,g,h=[];for(e=s(e),v=e.length,n=D,f=0,t=C,l=0;v>l;++l)r=e[l],128>r&&h.push(L(r));for(o=d=h.length,d&&h.push(E);v>o;){for(u=j,l=0;v>l;++l)r=e[l],r>=n&&u>r&&(u=r);for(w=o+1,u-n>K((j-f)/w)&&i("overflow"),f+=(u-n)*w,n=u,l=0;v>l;++l)if(r=e[l],n>r&&++f>j&&i("overflow"),r==n){for(a=f,y=k;m=t>=y?q:y>=t+z?z:y-t,!(m>a);y+=k)g=a-m,b=k-m,h.push(L(p(m+g%b,0))),a=K(g/b);h.push(L(p(a,0))),t=c(f,w,o==d),f=0,++o}++f,++n}return h.join("")}function r(e){return l(e,function(e){return F.test(e)?y(e.slice(4).toLowerCase()):e})}function v(e){return l(e,function(e){return G.test(e)?"xn--"+m(e):e})}var w="object"==typeof o&&o,b="object"==typeof f&&f&&f.exports==w&&f,g="object"==typeof n&&n;(g.global===g||g.window===g)&&(d=g);var h,x,j=2147483647,k=36,q=1,z=26,A=38,B=700,C=72,D=128,E="-",F=/^xn--/,G=/[^ -~]/,H=/\x2E|\u3002|\uFF0E|\uFF61/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},J=k-q,K=Math.floor,L=String.fromCharCode;if(h={version:"1.2.4",ucs2:{decode:s,encode:u},decode:y,encode:m,toASCII:v,toUnicode:r},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return h});else if(w&&!w.nodeType)if(b)b.exports=h;else for(x in h)h.hasOwnProperty(x)&&(w[x]=h[x]);else d.punycode=h}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,n){function f(e,n,f){!e.defaultView||n===e.defaultView.pageXOffset&&f===e.defaultView.pageYOffset||e.defaultView.scrollTo(n,f)}function o(e,n){try{n&&(n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e.getContext("2d").getImageData(0,0,e.width,e.height),0,0))}catch(f){t("Unable to copy canvas content from",e,f)}}function d(e,n){for(var f=3===e.nodeType?document.createTextNode(e.nodeValue):e.cloneNode(!1),i=e.firstChild;i;)(n===!0||1!==i.nodeType||"SCRIPT"!==i.nodeName)&&f.appendChild(d(i,n)),i=i.nextSibling;return 1===e.nodeType&&(f._scrollTop=e.scrollTop,f._scrollLeft=e.scrollLeft,"CANVAS"===e.nodeName?o(e,f):("TEXTAREA"===e.nodeName||"SELECT"===e.nodeName)&&(f.value=e.value)),f}function i(e){if(1===e.nodeType){e.scrollTop=e._scrollTop,e.scrollLeft=e._scrollLeft;for(var n=e.firstChild;n;)i(n),n=n.nextSibling}}var t=e("./log");n.exports=function(e,n,o,t,l,s,u){var a=d(e.documentElement,l.javascriptEnabled),p=n.createElement("iframe");return p.className="html2canvas-container",p.style.visibility="hidden",p.style.position="fixed",p.style.left="-10000px",p.style.top="0px",p.style.border="0",p.width=o,p.height=t,p.scrolling="no",n.body.appendChild(p),new Promise(function(n){var o=p.contentWindow.document;p.contentWindow.onload=p.onload=function(){var e=setInterval(function(){o.body.childNodes.length>0&&(i(o.documentElement),clearInterval(e),"view"===l.type&&(p.contentWindow.scrollTo(s,u),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||p.contentWindow.scrollY===u&&p.contentWindow.scrollX===s||(o.documentElement.style.top=-u+"px",o.documentElement.style.left=-s+"px",o.documentElement.style.position="absolute")),n(p))},50)},o.open(),o.write(""),f(e,s,u),o.replaceChild(o.adoptNode(a),o.documentElement),o.close()})}},{"./log":13}],3:[function(e,n){function f(e){this.r=0,this.g=0,this.b=0,this.a=null;this.fromArray(e)||this.namedColor(e)||this.rgb(e)||this.rgba(e)||this.hex6(e)||this.hex3(e)}f.prototype.darken=function(e){var n=1-e;return new f([Math.round(this.r*n),Math.round(this.g*n),Math.round(this.b*n),this.a])},f.prototype.isTransparent=function(){return 0===this.a},f.prototype.isBlack=function(){return 0===this.r&&0===this.g&&0===this.b},f.prototype.fromArray=function(e){return Array.isArray(e)&&(this.r=Math.min(e[0],255),this.g=Math.min(e[1],255),this.b=Math.min(e[2],255),e.length>3&&(this.a=e[3])),Array.isArray(e)};var o=/^#([a-f0-9]{3})$/i;f.prototype.hex3=function(e){var n=null;return null!==(n=e.match(o))&&(this.r=parseInt(n[1][0]+n[1][0],16),this.g=parseInt(n[1][1]+n[1][1],16),this.b=parseInt(n[1][2]+n[1][2],16)),null!==n};var d=/^#([a-f0-9]{6})$/i;f.prototype.hex6=function(e){var n=null;return null!==(n=e.match(d))&&(this.r=parseInt(n[1].substring(0,2),16),this.g=parseInt(n[1].substring(2,4),16),this.b=parseInt(n[1].substring(4,6),16)),null!==n};var i=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;f.prototype.rgb=function(e){var n=null;return null!==(n=e.match(i))&&(this.r=Number(n[1]),this.g=Number(n[2]),this.b=Number(n[3])),null!==n};var t=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;f.prototype.rgba=function(e){var n=null;return null!==(n=e.match(t))&&(this.r=Number(n[1]),this.g=Number(n[2]),this.b=Number(n[3]),this.a=Number(n[4])),null!==n},f.prototype.toString=function(){return null!==this.a&&1!==this.a?"rgba("+[this.r,this.g,this.b,this.a].join(",")+")":"rgb("+[this.r,this.g,this.b].join(",")+")"},f.prototype.namedColor=function(e){e=e.toLowerCase();var n=l[e];if(n)this.r=n[0],this.g=n[1],this.b=n[2];else if("transparent"===e)return this.r=this.g=this.b=this.a=0,!0;return!!n},f.prototype.isColor=!0;var l={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};n.exports=f},{}],4:[function(n,f){function o(e,n){var f=j++;if(n=n||{},n.logging&&(v.options.logging=!0,v.options.start=Date.now()),n.async="undefined"==typeof n.async?!0:n.async,n.allowTaint="undefined"==typeof n.allowTaint?!1:n.allowTaint,n.removeContainer="undefined"==typeof n.removeContainer?!0:n.removeContainer,n.javascriptEnabled="undefined"==typeof n.javascriptEnabled?!1:n.javascriptEnabled,n.imageTimeout="undefined"==typeof n.imageTimeout?1e4:n.imageTimeout,n.renderer="function"==typeof n.renderer?n.renderer:c,n.strict=!!n.strict,"string"==typeof e){if("string"!=typeof n.proxy)return Promise.reject("Proxy must be used when rendering url");var o=null!=n.width?n.width:window.innerWidth,t=null!=n.height?n.height:window.innerHeight;return g(a(e),n.proxy,document,o,t,n).then(function(e){return i(e.contentWindow.document.documentElement,e,n,o,t)})}var l=(void 0===e?[document.documentElement]:e.length?e:[e])[0];return l.setAttribute(x+f,f),d(l.ownerDocument,n,l.ownerDocument.defaultView.innerWidth,l.ownerDocument.defaultView.innerHeight,f).then(function(e){return"function"==typeof n.onrendered&&(v("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"),n.onrendered(e)),e})}function d(e,n,f,o,d){return b(e,e,f,o,n,e.defaultView.pageXOffset,e.defaultView.pageYOffset).then(function(t){v("Document cloned");var l=x+d,s="["+l+"='"+d+"']";e.querySelector(s).removeAttribute(l);var u=t.contentWindow,a=u.document.querySelector(s),p=Promise.resolve("function"==typeof n.onclone?n.onclone(u.document):!0);return p.then(function(){return i(a,t,n,f,o)})})}function i(e,n,f,o,d){var i=n.contentWindow,a=new p(i.document),c=new y(f,a),r=h(e),w="view"===f.type?o:s(i.document),b="view"===f.type?d:u(i.document),g=new f.renderer(w,b,c,f,document),x=new m(e,g,a,c,f);return x.ready.then(function(){v("Finished rendering");var o;return o="view"===f.type?l(g.canvas,{width:g.canvas.width,height:g.canvas.height,top:0,left:0,x:0,y:0}):e===i.document.body||e===i.document.documentElement||null!=f.canvas?g.canvas:l(g.canvas,{width:null!=f.width?f.width:r.width,height:null!=f.height?f.height:r.height,top:r.top,left:r.left,x:0,y:0}),t(n,f),o})}function t(e,n){n.removeContainer&&(e.parentNode.removeChild(e),v("Cleaned up container"))}function l(e,n){var f=document.createElement("canvas"),o=Math.min(e.width-1,Math.max(0,n.left)),d=Math.min(e.width,Math.max(1,n.left+n.width)),i=Math.min(e.height-1,Math.max(0,n.top)),t=Math.min(e.height,Math.max(1,n.top+n.height));f.width=n.width,f.height=n.height;var l=d-o,s=t-i;return v("Cropping canvas at:","left:",n.left,"top:",n.top,"width:",l,"height:",s),v("Resulting crop with width",n.width,"and height",n.height,"with x",o,"and y",i),f.getContext("2d").drawImage(e,o,i,l,s,n.x,n.y,l,s),f}function s(e){return Math.max(Math.max(e.body.scrollWidth,e.documentElement.scrollWidth),Math.max(e.body.offsetWidth,e.documentElement.offsetWidth),Math.max(e.body.clientWidth,e.documentElement.clientWidth))}function u(e){return Math.max(Math.max(e.body.scrollHeight,e.documentElement.scrollHeight),Math.max(e.body.offsetHeight,e.documentElement.offsetHeight),Math.max(e.body.clientHeight,e.documentElement.clientHeight))}function a(e){var n=document.createElement("a");return n.href=e,n.href=n.href,n}var p=n("./support"),c=n("./renderers/canvas"),y=n("./imageloader"),m=n("./nodeparser"),r=n("./nodecontainer"),v=n("./log"),w=n("./utils"),b=n("./clone"),g=n("./proxy").loadUrlDocument,h=w.getBounds,x="data-html2canvas-node",j=0;o.CanvasRenderer=c,o.NodeContainer=r,o.log=v,o.utils=w;var k="undefined"==typeof document||"function"!=typeof Object.create||"function"!=typeof document.createElement("canvas").getContext?function(){return Promise.reject("No canvas support")}:o;f.exports=k,"function"==typeof e&&e.amd&&e("html2canvas",[],function(){return k})},{"./clone":2,"./imageloader":11,"./log":13,"./nodecontainer":14,"./nodeparser":15,"./proxy":16,"./renderers/canvas":20,"./support":22,"./utils":26}],5:[function(e,n){function f(e){if(this.src=e,o("DummyImageContainer for",e),!this.promise||!this.image){o("Initiating DummyImageContainer"),f.prototype.image=new Image;var n=this.image;f.prototype.promise=new Promise(function(e,f){n.onload=e,n.onerror=f,n.src=d(),n.complete===!0&&e(n)})}}var o=e("./log"),d=e("./utils").smallImage;n.exports=f},{"./log":13,"./utils":26}],6:[function(e,n){function f(e,n){var f,d,i=document.createElement("div"),t=document.createElement("img"),l=document.createElement("span"),s="Hidden Text";i.style.visibility="hidden",i.style.fontFamily=e,i.style.fontSize=n,i.style.margin=0,i.style.padding=0,document.body.appendChild(i),t.src=o(),t.width=1,t.height=1,t.style.margin=0,t.style.padding=0,t.style.verticalAlign="baseline",l.style.fontFamily=e,l.style.fontSize=n,l.style.margin=0,l.style.padding=0,l.appendChild(document.createTextNode(s)),i.appendChild(l),i.appendChild(t),f=t.offsetTop-l.offsetTop+1,i.removeChild(l),i.appendChild(document.createTextNode(s)),i.style.lineHeight="normal",t.style.verticalAlign="super",d=t.offsetTop-i.offsetTop+1,document.body.removeChild(i),this.baseline=f,this.lineWidth=1,this.middle=d}var o=e("./utils").smallImage;n.exports=f},{"./utils":26}],7:[function(e,n){function f(){this.data={}}var o=e("./font");f.prototype.getMetrics=function(e,n){return void 0===this.data[e+"-"+n]&&(this.data[e+"-"+n]=new o(e,n)),this.data[e+"-"+n]},n.exports=f},{"./font":6}],8:[function(e,n){function f(n,f,o){this.image=null,this.src=n;var i=this,t=d(n);this.promise=(f?new Promise(function(e){"about:blank"===n.contentWindow.document.URL||null==n.contentWindow.document.documentElement?n.contentWindow.onload=n.onload=function(){e(n)}:e(n)}):this.proxyLoad(o.proxy,t,o)).then(function(n){var f=e("./core");return f(n.contentWindow.document.documentElement,{type:"view",width:n.width,height:n.height,proxy:o.proxy,javascriptEnabled:o.javascriptEnabled,removeContainer:o.removeContainer,allowTaint:o.allowTaint,imageTimeout:o.imageTimeout/2})}).then(function(e){return i.image=e})}var o=e("./utils"),d=o.getBounds,i=e("./proxy").loadUrlDocument;f.prototype.proxyLoad=function(e,n,f){var o=this.src;return i(o.src,e,o.ownerDocument,n.width,n.height,f)},n.exports=f},{"./core":4,"./proxy":16,"./utils":26}],9:[function(e,n){function f(e){this.src=e.value,this.colorStops=[],this.type=null,this.x0=.5,this.y0=.5,this.x1=.5,this.y1=.5,this.promise=Promise.resolve(!0)}f.TYPES={LINEAR:1,RADIAL:2},f.REGEXP_COLORSTOP=/^\s*(rgba?\(\s*\d{1,3},\s*\d{1,3},\s*\d{1,3}(?:,\s*[0-9\.]+)?\s*\)|[a-z]{3,20}|#[a-f0-9]{3,6})(?:\s+(\d{1,3}(?:\.\d+)?)(%|px)?)?(?:\s|$)/i,n.exports=f},{}],10:[function(e,n){function f(e,n){this.src=e,this.image=new Image;var f=this;this.tainted=null,this.promise=new Promise(function(o,d){f.image.onload=o,f.image.onerror=d,n&&(f.image.crossOrigin="anonymous"),f.image.src=e,f.image.complete===!0&&o(f.image)})}n.exports=f},{}],11:[function(e,n){function f(e,n){this.link=null,this.options=e,this.support=n,this.origin=this.getOrigin(window.location.href)}var o=e("./log"),d=e("./imagecontainer"),i=e("./dummyimagecontainer"),t=e("./proxyimagecontainer"),l=e("./framecontainer"),s=e("./svgcontainer"),u=e("./svgnodecontainer"),a=e("./lineargradientcontainer"),p=e("./webkitgradientcontainer"),c=e("./utils").bind;f.prototype.findImages=function(e){var n=[];return e.reduce(function(e,n){switch(n.node.nodeName){case"IMG":return e.concat([{args:[n.node.src],method:"url"}]);case"svg":case"IFRAME":return e.concat([{args:[n.node],method:n.node.nodeName}])}return e},[]).forEach(this.addImage(n,this.loadImage),this),n},f.prototype.findBackgroundImage=function(e,n){return n.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(e,this.loadImage),this),e},f.prototype.addImage=function(e,n){return function(f){f.args.forEach(function(d){this.imageExists(e,d)||(e.splice(0,0,n.call(this,f)),o("Added image #"+e.length,"string"==typeof d?d.substring(0,100):d))},this)}},f.prototype.hasImageBackground=function(e){return"none"!==e.method},f.prototype.loadImage=function(e){if("url"===e.method){var n=e.args[0];return!this.isSVG(n)||this.support.svg||this.options.allowTaint?n.match(/data:image\/.*;base64,/i)?new d(n.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),!1):this.isSameOrigin(n)||this.options.allowTaint===!0||this.isSVG(n)?new d(n,!1):this.support.cors&&!this.options.allowTaint&&this.options.useCORS?new d(n,!0):this.options.proxy?new t(n,this.options.proxy):new i(n):new s(n)}return"linear-gradient"===e.method?new a(e):"gradient"===e.method?new p(e):"svg"===e.method?new u(e.args[0],this.support.svg):"IFRAME"===e.method?new l(e.args[0],this.isSameOrigin(e.args[0].src),this.options):new i(e)},f.prototype.isSVG=function(e){return"svg"===e.substring(e.length-3).toLowerCase()||s.prototype.isInline(e)},f.prototype.imageExists=function(e,n){return e.some(function(e){return e.src===n})},f.prototype.isSameOrigin=function(e){return this.getOrigin(e)===this.origin},f.prototype.getOrigin=function(e){var n=this.link||(this.link=document.createElement("a"));return n.href=e,n.href=n.href,n.protocol+n.hostname+n.port},f.prototype.getPromise=function(e){return this.timeout(e,this.options.imageTimeout)["catch"](function(){var n=new i(e.src);return n.promise.then(function(n){e.image=n})})},f.prototype.get=function(e){var n=null;return this.images.some(function(f){return(n=f).src===e})?n:null},f.prototype.fetch=function(e){return this.images=e.reduce(c(this.findBackgroundImage,this),this.findImages(e)),this.images.forEach(function(e,n){e.promise.then(function(){o("Succesfully loaded image #"+(n+1),e)},function(f){o("Failed loading image #"+(n+1),e,f)})}),this.ready=Promise.all(this.images.map(this.getPromise,this)),o("Finished searching images"),this},f.prototype.timeout=function(e,n){var f,d=Promise.race([e.promise,new Promise(function(d,i){f=setTimeout(function(){o("Timed out loading image",e),i(e)},n)})]).then(function(e){return clearTimeout(f),e});return d["catch"](function(){clearTimeout(f)}),d},n.exports=f},{"./dummyimagecontainer":5,"./framecontainer":8,"./imagecontainer":10,"./lineargradientcontainer":12,"./log":13,"./proxyimagecontainer":17,"./svgcontainer":23,"./svgnodecontainer":24,"./utils":26,"./webkitgradientcontainer":27}],12:[function(e,n){function f(e){o.apply(this,arguments),this.type=o.TYPES.LINEAR;var n=f.REGEXP_DIRECTION.test(e.args[0])||!o.REGEXP_COLORSTOP.test(e.args[0]);n?e.args[0].split(/\s+/).reverse().forEach(function(e,n){switch(e){case"left":this.x0=0,this.x1=1;break;case"top":this.y0=0,this.y1=1;break;case"right":this.x0=1,this.x1=0;break;case"bottom":this.y0=1,this.y1=0;break;case"to":var f=this.y0,o=this.x0;this.y0=this.y1,this.x0=this.x1,this.x1=o,this.y1=f;break;case"center":break;default:var d=.01*parseFloat(e,10);if(isNaN(d))break;0===n?(this.y0=d,this.y1=1-this.y0):(this.x0=d,this.x1=1-this.x0)}},this):(this.y0=0,this.y1=1),this.colorStops=e.args.slice(n?1:0).map(function(e){var n=e.match(o.REGEXP_COLORSTOP),f=+n[2],i=0===f?"%":n[3];return{color:new d(n[1]),stop:"%"===i?f/100:null}}),null===this.colorStops[0].stop&&(this.colorStops[0].stop=0),null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1),this.colorStops.forEach(function(e,n){null===e.stop&&this.colorStops.slice(n).some(function(f,o){return null!==f.stop?(e.stop=(f.stop-this.colorStops[n-1].stop)/(o+1)+this.colorStops[n-1].stop,!0):!1},this)},this)}var o=e("./gradientcontainer"),d=e("./color");f.prototype=Object.create(o.prototype),f.REGEXP_DIRECTION=/^\s*(?:to|left|right|top|bottom|center|\d{1,3}(?:\.\d+)?%?)(?:\s|$)/i,n.exports=f},{"./color":3,"./gradientcontainer":9}],13:[function(e,n){var f=function(){f.options.logging&&window.console&&window.console.log&&Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-f.options.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)))};f.options={logging:!1},n.exports=f},{}],14:[function(e,n){function f(e,n){this.node=e,this.parent=n,this.stack=null,this.bounds=null,this.borders=null,this.clip=[],this.backgroundClip=[],this.offsetBounds=null,this.visible=null,this.computedStyles=null,this.colors={},this.styles={},this.backgroundImages=null,this.transformData=null,this.transformMatrix=null,this.isPseudoElement=!1,this.opacity=null}function o(e){var n=e.options[e.selectedIndex||0];return n?n.text||"":""}function d(e){if(e&&"matrix"===e[1])return e[2].split(",").map(function(e){return parseFloat(e.trim())});if(e&&"matrix3d"===e[1]){var n=e[2].split(",").map(function(e){return parseFloat(e.trim())});return[n[0],n[1],n[4],n[5],n[12],n[13]]}}function i(e){return-1!==e.toString().indexOf("%")}function t(e){return e.replace("px","")}function l(e){return parseFloat(e)}var s=e("./color"),u=e("./utils"),a=u.getBounds,p=u.parseBackgrounds,c=u.offsetBounds;f.prototype.cloneTo=function(e){e.visible=this.visible,e.borders=this.borders,e.bounds=this.bounds,e.clip=this.clip,e.backgroundClip=this.backgroundClip,e.computedStyles=this.computedStyles,e.styles=this.styles,e.backgroundImages=this.backgroundImages,e.opacity=this.opacity},f.prototype.getOpacity=function(){return null===this.opacity?this.opacity=this.cssFloat("opacity"):this.opacity},f.prototype.assignStack=function(e){this.stack=e,e.children.push(this)},f.prototype.isElementVisible=function(){return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:"none"!==this.css("display")&&"hidden"!==this.css("visibility")&&!this.node.hasAttribute("data-html2canvas-ignore")&&("INPUT"!==this.node.nodeName||"hidden"!==this.node.getAttribute("type"))},f.prototype.css=function(e){return this.computedStyles||(this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)),this.styles[e]||(this.styles[e]=this.computedStyles[e])},f.prototype.prefixedCss=function(e){var n=["webkit","moz","ms","o"],f=this.css(e);return void 0===f&&n.some(function(n){return f=this.css(n+e.substr(0,1).toUpperCase()+e.substr(1)),void 0!==f},this),void 0===f?null:f},f.prototype.computedStyle=function(e){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,e)},f.prototype.cssInt=function(e){var n=parseInt(this.css(e),10);return isNaN(n)?0:n},f.prototype.color=function(e){return this.colors[e]||(this.colors[e]=new s(this.css(e)))},f.prototype.cssFloat=function(e){var n=parseFloat(this.css(e));return isNaN(n)?0:n},f.prototype.fontWeight=function(){var e=this.css("fontWeight");switch(parseInt(e,10)){case 401:e="bold";break;case 400:e="normal"}return e},f.prototype.parseClip=function(){var e=this.css("clip").match(this.CLIP);return e?{top:parseInt(e[1],10),right:parseInt(e[2],10),bottom:parseInt(e[3],10),left:parseInt(e[4],10)}:null},f.prototype.parseBackgroundImages=function(){return this.backgroundImages||(this.backgroundImages=p(this.css("backgroundImage")))},f.prototype.cssList=function(e,n){var f=(this.css(e)||"").split(",");return f=f[n||0]||f[0]||"auto",f=f.trim().split(" "),1===f.length&&(f=[f[0],i(f[0])?"auto":f[0]]),f},f.prototype.parseBackgroundSize=function(e,n,f){var o,d,t=this.cssList("backgroundSize",f);if(i(t[0]))o=e.width*parseFloat(t[0])/100;else{if(/contain|cover/.test(t[0])){var l=e.width/e.height,s=n.width/n.height;return s>l^"contain"===t[0]?{width:e.height*s,height:e.height}:{width:e.width,height:e.width/s}}o=parseInt(t[0],10)}return d="auto"===t[0]&&"auto"===t[1]?n.height:"auto"===t[1]?o/n.width*n.height:i(t[1])?e.height*parseFloat(t[1])/100:parseInt(t[1],10),"auto"===t[0]&&(o=d/n.height*n.width),{width:o,height:d}},f.prototype.parseBackgroundPosition=function(e,n,f,o){var d,t,l=this.cssList("backgroundPosition",f);return d=i(l[0])?(e.width-(o||n).width)*(parseFloat(l[0])/100):parseInt(l[0],10),t="auto"===l[1]?d/n.width*n.height:i(l[1])?(e.height-(o||n).height)*parseFloat(l[1])/100:parseInt(l[1],10),"auto"===l[0]&&(d=t/n.height*n.width),{left:d,top:t}},f.prototype.parseBackgroundRepeat=function(e){return this.cssList("backgroundRepeat",e)[0]},f.prototype.parseTextShadows=function(){var e=this.css("textShadow"),n=[];if(e&&"none"!==e)for(var f=e.match(this.TEXT_SHADOW_PROPERTY),o=0;f&&o0?(this.renderIndex=0,this.asyncRenderer(this.renderQueue,e)):e():(this.renderQueue.forEach(this.paint,this),e())},this))},this))}function o(e){return e.parent&&e.parent.clip.length}function d(e){return e.replace(/(\-[a-z])/g,function(e){return e.toUpperCase().replace("-","")})}function i(){}function t(e,n,f,o){return e.map(function(d,i){if(d.width>0){var t=n.left,l=n.top,s=n.width,u=n.height-e[2].width;switch(i){case 0:u=e[0].width,d.args=a({c1:[t,l],c2:[t+s,l],c3:[t+s-e[1].width,l+u],c4:[t+e[3].width,l+u]},o[0],o[1],f.topLeftOuter,f.topLeftInner,f.topRightOuter,f.topRightInner);break;case 1:t=n.left+n.width-e[1].width,s=e[1].width,d.args=a({c1:[t+s,l],c2:[t+s,l+u+e[2].width],c3:[t,l+u],c4:[t,l+e[0].width]},o[1],o[2],f.topRightOuter,f.topRightInner,f.bottomRightOuter,f.bottomRightInner);break;case 2:l=l+n.height-e[2].width,u=e[2].width,d.args=a({c1:[t+s,l+u],c2:[t,l+u],c3:[t+e[3].width,l],c4:[t+s-e[3].width,l]},o[2],o[3],f.bottomRightOuter,f.bottomRightInner,f.bottomLeftOuter,f.bottomLeftInner);break;case 3:s=e[3].width,d.args=a({c1:[t,l+u+e[2].width],c2:[t,l],c3:[t+s,l+e[0].width],c4:[t+s,l+u]},o[3],o[0],f.bottomLeftOuter,f.bottomLeftInner,f.topLeftOuter,f.topLeftInner)}}return d})}function l(e,n,f,o){var d=4*((Math.sqrt(2)-1)/3),i=f*d,t=o*d,l=e+f,s=n+o;return{topLeft:u({x:e,y:s},{x:e,y:s-t},{x:l-i,y:n},{x:l,y:n}),topRight:u({x:e,y:n},{x:e+i,y:n},{x:l,y:s-t},{x:l,y:s}),bottomRight:u({x:l,y:n},{x:l,y:n+t},{x:e+i,y:s},{x:e,y:s}),bottomLeft:u({x:l,y:s},{x:l-i,y:s},{x:e,y:n+t},{x:e,y:n})}}function s(e,n,f){var o=e.left,d=e.top,i=e.width,t=e.height,s=n[0][0]i+f[3].width?0:a-f[3].width,p-f[0].width).topRight.subdivide(.5),bottomRightOuter:l(o+b,d+w,c,y).bottomRight.subdivide(.5),bottomRightInner:l(o+Math.min(b,i-f[3].width),d+Math.min(w,t+f[0].width),Math.max(0,c-f[1].width),y-f[2].width).bottomRight.subdivide(.5),bottomLeftOuter:l(o,d+g,m,r).bottomLeft.subdivide(.5),bottomLeftInner:l(o+f[3].width,d+g,Math.max(0,m-f[3].width),r-f[2].width).bottomLeft.subdivide(.5)} -}function u(e,n,f,o){var d=function(e,n,f){return{x:e.x+(n.x-e.x)*f,y:e.y+(n.y-e.y)*f}};return{start:e,startControl:n,endControl:f,end:o,subdivide:function(i){var t=d(e,n,i),l=d(n,f,i),s=d(f,o,i),a=d(t,l,i),p=d(l,s,i),c=d(a,p,i);return[u(e,t,a,c),u(c,p,s,o)]},curveTo:function(e){e.push(["bezierCurve",n.x,n.y,f.x,f.y,o.x,o.y])},curveToReversed:function(o){o.push(["bezierCurve",f.x,f.y,n.x,n.y,e.x,e.y])}}}function a(e,n,f,o,d,i,t){var l=[];return n[0]>0||n[1]>0?(l.push(["line",o[1].start.x,o[1].start.y]),o[1].curveTo(l)):l.push(["line",e.c1[0],e.c1[1]]),f[0]>0||f[1]>0?(l.push(["line",i[0].start.x,i[0].start.y]),i[0].curveTo(l),l.push(["line",t[0].end.x,t[0].end.y]),t[0].curveToReversed(l)):(l.push(["line",e.c2[0],e.c2[1]]),l.push(["line",e.c3[0],e.c3[1]])),n[0]>0||n[1]>0?(l.push(["line",d[1].end.x,d[1].end.y]),d[1].curveToReversed(l)):l.push(["line",e.c4[0],e.c4[1]]),l}function p(e,n,f,o,d,i,t){n[0]>0||n[1]>0?(e.push(["line",o[0].start.x,o[0].start.y]),o[0].curveTo(e),o[1].curveTo(e)):e.push(["line",i,t]),(f[0]>0||f[1]>0)&&e.push(["line",d[0].start.x,d[0].start.y])}function c(e){return e.cssInt("zIndex")<0}function y(e){return e.cssInt("zIndex")>0}function m(e){return 0===e.cssInt("zIndex")}function r(e){return-1!==["inline","inline-block","inline-table"].indexOf(e.css("display"))}function v(e){return e instanceof U}function w(e){return e.node.data.trim().length>0}function b(e){return/^(normal|none|0px)$/.test(e.parent.css("letterSpacing"))}function g(e){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(n){var f=e.css("border"+n+"Radius"),o=f.split(" ");return o.length<=1&&(o[1]=o[0]),o.map(F)})}function h(e){return e.nodeType===Node.TEXT_NODE||e.nodeType===Node.ELEMENT_NODE}function x(e){var n=e.css("position"),f=-1!==["absolute","relative","fixed"].indexOf(n)?e.css("zIndex"):"auto";return"auto"!==f}function j(e){return"static"!==e.css("position")}function k(e){return"none"!==e.css("float")}function q(e){return-1!==["inline-block","inline-table"].indexOf(e.css("display"))}function z(e){var n=this;return function(){return!e.apply(n,arguments)}}function A(e){return e.node.nodeType===Node.ELEMENT_NODE}function B(e){return e.isPseudoElement===!0}function C(e){return e.node.nodeType===Node.TEXT_NODE}function D(e){return function(n,f){return n.cssInt("zIndex")+e.indexOf(n)/e.length-(f.cssInt("zIndex")+e.indexOf(f)/e.length)}}function E(e){return e.getOpacity()<1}function F(e){return parseInt(e,10)}function G(e){return e.width}function H(e){return e.node.nodeType!==Node.ELEMENT_NODE||-1===["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(e.node.nodeName)}function I(e){return[].concat.apply([],e)}function J(e){var n=e.substr(0,1);return n===e.substr(e.length-1)&&n.match(/'|"/)?e.substr(1,e.length-2):e}function K(e){for(var n,f=[],o=0,d=!1;e.length;)L(e[o])===d?(n=e.splice(0,o),n.length&&f.push(O.ucs2.encode(n)),d=!d,o=0):o++,o>=e.length&&(n=e.splice(0,o),n.length&&f.push(O.ucs2.encode(n)));return f}function L(e){return-1!==[32,13,10,9,45].indexOf(e)}function M(e){return/[^\u0000-\u00ff]/.test(e)}var N=e("./log"),O=e("punycode"),P=e("./nodecontainer"),Q=e("./textcontainer"),R=e("./pseudoelementcontainer"),S=e("./fontmetrics"),T=e("./color"),U=e("./stackingcontext"),V=e("./utils"),W=V.bind,X=V.getBounds,Y=V.parseBackgrounds,Z=V.offsetBounds;f.prototype.calculateOverflowClips=function(){this.nodes.forEach(function(e){if(A(e)){B(e)&&e.appendToDOM(),e.borders=this.parseBorders(e);var n="hidden"===e.css("overflow")?[e.borders.clip]:[],f=e.parseClip();f&&-1!==["absolute","fixed"].indexOf(e.css("position"))&&n.push([["rect",e.bounds.left+f.left,e.bounds.top+f.top,f.right-f.left,f.bottom-f.top]]),e.clip=o(e)?e.parent.clip.concat(n):n,e.backgroundClip="hidden"!==e.css("overflow")?e.clip.concat([e.borders.clip]):e.clip,B(e)&&e.cleanDOM()}else C(e)&&(e.clip=o(e)?e.parent.clip:[]);B(e)||(e.bounds=null)},this)},f.prototype.asyncRenderer=function(e,n,f){f=f||Date.now(),this.paint(e[this.renderIndex++]),e.length===this.renderIndex?n():f+20>Date.now()?this.asyncRenderer(e,n,f):setTimeout(W(function(){this.asyncRenderer(e,n)},this),0)},f.prototype.createPseudoHideStyles=function(e){this.createStyles(e,"."+R.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }.'+R.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }')},f.prototype.disableAnimations=function(e){this.createStyles(e,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}")},f.prototype.createStyles=function(e,n){var f=e.createElement("style");f.innerHTML=n,e.body.appendChild(f)},f.prototype.getPseudoElements=function(e){var n=[[e]];if(e.node.nodeType===Node.ELEMENT_NODE){var f=this.getPseudoElement(e,":before"),o=this.getPseudoElement(e,":after");f&&n.push(f),o&&n.push(o)}return I(n)},f.prototype.getPseudoElement=function(e,n){var f=e.computedStyle(n);if(!f||!f.content||"none"===f.content||"-moz-alt-content"===f.content||"none"===f.display)return null;for(var o=J(f.content),i="url"===o.substr(0,3),t=document.createElement(i?"img":"html2canvaspseudoelement"),l=new R(t,e,n),s=f.length-1;s>=0;s--){var u=d(f.item(s));t.style[u]=f[u]}if(t.className=R.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+R.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER,i)return t.src=Y(o)[0].args[0],[l];var a=document.createTextNode(o);return t.appendChild(a),[l,new Q(a,l)]},f.prototype.getChildren=function(e){return I([].filter.call(e.node.childNodes,h).map(function(n){var f=[n.nodeType===Node.TEXT_NODE?new Q(n,e):new P(n,e)].filter(H);return n.nodeType===Node.ELEMENT_NODE&&f.length&&"TEXTAREA"!==n.tagName?f[0].isElementVisible()?f.concat(this.getChildren(f[0])):[]:f},this))},f.prototype.newStackingContext=function(e,n){var f=new U(n,e.getOpacity(),e.node,e.parent);e.cloneTo(f);var o=n?f.getParentStack(this):f.parent.stack;o.contexts.push(f),e.stack=f},f.prototype.createStackingContexts=function(){this.nodes.forEach(function(e){A(e)&&(this.isRootElement(e)||E(e)||x(e)||this.isBodyWithTransparentRoot(e)||e.hasTransform())?this.newStackingContext(e,!0):A(e)&&(j(e)&&m(e)||q(e)||k(e))?this.newStackingContext(e,!1):e.assignStack(e.parent.stack)},this)},f.prototype.isBodyWithTransparentRoot=function(e){return"BODY"===e.node.nodeName&&e.parent.color("backgroundColor").isTransparent()},f.prototype.isRootElement=function(e){return null===e.parent},f.prototype.sortStackingContexts=function(e){e.contexts.sort(D(e.contexts.slice(0))),e.contexts.forEach(this.sortStackingContexts,this)},f.prototype.parseTextBounds=function(e){return function(n,f,o){if("none"!==e.parent.css("textDecoration").substr(0,4)||0!==n.trim().length){if(this.support.rangeBounds&&!e.parent.hasTransform()){var d=o.slice(0,f).join("").length;return this.getRangeBounds(e.node,d,n.length)}if(e.node&&"string"==typeof e.node.data){var i=e.node.splitText(n.length),t=this.getWrapperBounds(e.node,e.parent.hasTransform());return e.node=i,t}}else(!this.support.rangeBounds||e.parent.hasTransform())&&(e.node=e.node.splitText(n.length));return{}}},f.prototype.getWrapperBounds=function(e,n){var f=e.ownerDocument.createElement("html2canvaswrapper"),o=e.parentNode,d=e.cloneNode(!0);f.appendChild(e.cloneNode(!0)),o.replaceChild(f,e);var i=n?Z(f):X(f);return o.replaceChild(d,f),i},f.prototype.getRangeBounds=function(e,n,f){var o=this.range||(this.range=e.ownerDocument.createRange());return o.setStart(e,n),o.setEnd(e,n+f),o.getBoundingClientRect()},f.prototype.parse=function(e){var n=e.contexts.filter(c),f=e.children.filter(A),o=f.filter(z(k)),d=o.filter(z(j)).filter(z(r)),t=f.filter(z(j)).filter(k),l=o.filter(z(j)).filter(r),s=e.contexts.concat(o.filter(j)).filter(m),u=e.children.filter(C).filter(w),a=e.contexts.filter(y);n.concat(d).concat(t).concat(l).concat(s).concat(u).concat(a).forEach(function(e){this.renderQueue.push(e),v(e)&&(this.parse(e),this.renderQueue.push(new i))},this)},f.prototype.paint=function(e){try{e instanceof i?this.renderer.ctx.restore():C(e)?(B(e.parent)&&e.parent.appendToDOM(),this.paintText(e),B(e.parent)&&e.parent.cleanDOM()):this.paintNode(e)}catch(n){if(N(n),this.options.strict)throw n}},f.prototype.paintNode=function(e){v(e)&&(this.renderer.setOpacity(e.opacity),this.renderer.ctx.save(),e.hasTransform()&&this.renderer.setTransform(e.parseTransform())),"INPUT"===e.node.nodeName&&"checkbox"===e.node.type?this.paintCheckbox(e):"INPUT"===e.node.nodeName&&"radio"===e.node.type?this.paintRadio(e):this.paintElement(e)},f.prototype.paintElement=function(e){var n=e.parseBounds();this.renderer.clip(e.backgroundClip,function(){this.renderer.renderBackground(e,n,e.borders.borders.map(G))},this),this.renderer.clip(e.clip,function(){this.renderer.renderBorders(e.borders.borders)},this),this.renderer.clip(e.backgroundClip,function(){switch(e.node.nodeName){case"svg":case"IFRAME":var f=this.images.get(e.node);f?this.renderer.renderImage(e,n,e.borders,f):N("Error loading <"+e.node.nodeName+">",e.node);break;case"IMG":var o=this.images.get(e.node.src);o?this.renderer.renderImage(e,n,e.borders,o):N("Error loading ",e.node.src);break;case"CANVAS":this.renderer.renderImage(e,n,e.borders,{image:e.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(e)}},this)},f.prototype.paintCheckbox=function(e){var n=e.parseBounds(),f=Math.min(n.width,n.height),o={width:f-1,height:f-1,top:n.top,left:n.left},d=[3,3],i=[d,d,d,d],l=[1,1,1,1].map(function(e){return{color:new T("#A5A5A5"),width:e}}),u=s(o,i,l);this.renderer.clip(e.backgroundClip,function(){this.renderer.rectangle(o.left+1,o.top+1,o.width-2,o.height-2,new T("#DEDEDE")),this.renderer.renderBorders(t(l,o,u,i)),e.node.checked&&(this.renderer.font(new T("#424242"),"normal","normal","bold",f-3+"px","arial"),this.renderer.text("✔",o.left+f/6,o.top+f-1))},this)},f.prototype.paintRadio=function(e){var n=e.parseBounds(),f=Math.min(n.width,n.height)-2;this.renderer.clip(e.backgroundClip,function(){this.renderer.circleStroke(n.left+1,n.top+1,f,new T("#DEDEDE"),1,new T("#A5A5A5")),e.node.checked&&this.renderer.circle(Math.ceil(n.left+f/4)+1,Math.ceil(n.top+f/4)+1,Math.floor(f/2),new T("#424242"))},this)},f.prototype.paintFormValue=function(e){var n=e.getValue();if(n.length>0){var f=e.node.ownerDocument,o=f.createElement("html2canvaswrapper"),d=["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"];d.forEach(function(n){try{o.style[n]=e.css(n)}catch(f){N("html2canvas: Parse: Exception caught in renderFormValue: "+f.message)}});var i=e.parseBounds();o.style.position="fixed",o.style.left=i.left+"px",o.style.top=i.top+"px",o.textContent=n,f.body.appendChild(o),this.paintText(new Q(o.firstChild,e)),f.body.removeChild(o)}},f.prototype.paintText=function(e){e.applyTextTransform();var n=O.ucs2.decode(e.node.data),f=this.options.letterRendering&&!b(e)||M(e.node.data)?n.map(function(e){return O.ucs2.encode([e])}):K(n),o=e.parent.fontWeight(),d=e.parent.css("fontSize"),i=e.parent.css("fontFamily"),t=e.parent.parseTextShadows();this.renderer.font(e.parent.color("color"),e.parent.css("fontStyle"),e.parent.css("fontVariant"),o,d,i),t.length?this.renderer.fontShadow(t[0].color,t[0].offsetX,t[0].offsetY,t[0].blur):this.renderer.clearShadow(),this.renderer.clip(e.parent.clip,function(){f.map(this.parseTextBounds(e),this).forEach(function(n,o){n&&(this.renderer.text(f[o],n.left,n.bottom),this.renderTextDecoration(e.parent,n,this.fontMetrics.getMetrics(i,d)))},this)},this)},f.prototype.renderTextDecoration=function(e,n,f){switch(e.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(n.left,Math.round(n.top+f.baseline+f.lineWidth),n.width,1,e.color("color"));break;case"overline":this.renderer.rectangle(n.left,Math.round(n.top),n.width,1,e.color("color"));break;case"line-through":this.renderer.rectangle(n.left,Math.ceil(n.top+f.middle+f.lineWidth),n.width,1,e.color("color"))}};var $={inset:[["darken",.6],["darken",.1],["darken",.1],["darken",.6]]};f.prototype.parseBorders=function(e){var n=e.parseBounds(),f=g(e),o=["Top","Right","Bottom","Left"].map(function(n,f){var o=e.css("border"+n+"Style"),d=e.color("border"+n+"Color");"inset"===o&&d.isBlack()&&(d=new T([255,255,255,d.a]));var i=$[o]?$[o][f]:null;return{width:e.cssInt("border"+n+"Width"),color:i?d[i[0]](i[1]):d,args:null}}),d=s(n,f,o);return{clip:this.parseBackgroundClip(e,d,o,f,n),borders:t(o,n,d,f)}},f.prototype.parseBackgroundClip=function(e,n,f,o,d){var i=e.css("backgroundClip"),t=[];switch(i){case"content-box":case"padding-box":p(t,o[0],o[1],n.topLeftInner,n.topRightInner,d.left+f[3].width,d.top+f[0].width),p(t,o[1],o[2],n.topRightInner,n.bottomRightInner,d.left+d.width-f[1].width,d.top+f[0].width),p(t,o[2],o[3],n.bottomRightInner,n.bottomLeftInner,d.left+d.width-f[1].width,d.top+d.height-f[2].width),p(t,o[3],o[0],n.bottomLeftInner,n.topLeftInner,d.left+f[3].width,d.top+d.height-f[2].width);break;default:p(t,o[0],o[1],n.topLeftOuter,n.topRightOuter,d.left,d.top),p(t,o[1],o[2],n.topRightOuter,n.bottomRightOuter,d.left+d.width,d.top),p(t,o[2],o[3],n.bottomRightOuter,n.bottomLeftOuter,d.left+d.width,d.top+d.height),p(t,o[3],o[0],n.bottomLeftOuter,n.topLeftOuter,d.left,d.top+d.height)}return t},n.exports=f},{"./color":3,"./fontmetrics":7,"./log":13,"./nodecontainer":14,"./pseudoelementcontainer":18,"./stackingcontext":21,"./textcontainer":25,"./utils":26,punycode:1}],16:[function(e,n,f){function o(e,n,f){var o="withCredentials"in new XMLHttpRequest;if(!n)return Promise.reject("No proxy configured");var d=t(o),s=l(n,e,d);return o?a(s):i(f,s,d).then(function(e){return m(e.content)})}function d(e,n,f){var o="crossOrigin"in new Image,d=t(o),s=l(n,e,d);return o?Promise.resolve(s):i(f,s,d).then(function(e){return"data:"+e.type+";base64,"+e.content})}function i(e,n,f){return new Promise(function(o,d){var i=e.createElement("script"),t=function(){delete window.html2canvas.proxy[f],e.body.removeChild(i)};window.html2canvas.proxy[f]=function(e){t(),o(e)},i.src=n,i.onerror=function(e){t(),d(e)},e.body.appendChild(i)})}function t(e){return e?"":"html2canvas_"+Date.now()+"_"+ ++r+"_"+Math.round(1e5*Math.random())}function l(e,n,f){return e+"?url="+encodeURIComponent(n)+(f.length?"&callback=html2canvas.proxy."+f:"")}function s(e){return function(n){var f,o=new DOMParser;try{f=o.parseFromString(n,"text/html")}catch(d){c("DOMParser not supported, falling back to createHTMLDocument"),f=document.implementation.createHTMLDocument("");try{f.open(),f.write(n),f.close()}catch(i){c("createHTMLDocument write not supported, falling back to document.body.innerHTML"),f.body.innerHTML=n}}var t=f.querySelector("base");if(!t||!t.href.host){var l=f.createElement("base");l.href=e,f.head.insertBefore(l,f.head.firstChild)}return f}}function u(e,n,f,d,i,t){return new o(e,n,window.document).then(s(e)).then(function(e){return y(e,f,d,i,t,0,0)})}var a=e("./xhr"),p=e("./utils"),c=e("./log"),y=e("./clone"),m=p.decode64,r=0;f.Proxy=o,f.ProxyURL=d,f.loadUrlDocument=u},{"./clone":2,"./log":13,"./utils":26,"./xhr":28}],17:[function(e,n){function f(e,n){var f=document.createElement("a");f.href=e,e=f.href,this.src=e,this.image=new Image;var d=this;this.promise=new Promise(function(f,i){d.image.crossOrigin="Anonymous",d.image.onload=f,d.image.onerror=i,new o(e,n,document).then(function(e){d.image.src=e})["catch"](i)})}var o=e("./proxy").ProxyURL;n.exports=f},{"./proxy":16}],18:[function(e,n){function f(e,n,f){o.call(this,e,n),this.isPseudoElement=!0,this.before=":before"===f}var o=e("./nodecontainer");f.prototype.cloneTo=function(e){f.prototype.cloneTo.call(this,e),e.isPseudoElement=!0,e.before=this.before},f.prototype=Object.create(o.prototype),f.prototype.appendToDOM=function(){this.before?this.parent.node.insertBefore(this.node,this.parent.node.firstChild):this.parent.node.appendChild(this.node),this.parent.node.className+=" "+this.getHideClass()},f.prototype.cleanDOM=function(){this.node.parentNode.removeChild(this.node),this.parent.node.className=this.parent.node.className.replace(this.getHideClass(),"")},f.prototype.getHideClass=function(){return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]},f.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before",f.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after",n.exports=f},{"./nodecontainer":14}],19:[function(e,n){function f(e,n,f,o,d){this.width=e,this.height=n,this.images=f,this.options=o,this.document=d}var o=e("./log");f.prototype.renderImage=function(e,n,f,o){var d=e.cssInt("paddingLeft"),i=e.cssInt("paddingTop"),t=e.cssInt("paddingRight"),l=e.cssInt("paddingBottom"),s=f.borders,u=n.width-(s[1].width+s[3].width+d+t),a=n.height-(s[0].width+s[2].width+i+l);this.drawImage(o,0,0,o.image.width||u,o.image.height||a,n.left+d+s[3].width,n.top+i+s[0].width,u,a)},f.prototype.renderBackground=function(e,n,f){n.height>0&&n.width>0&&(this.renderBackgroundColor(e,n),this.renderBackgroundImage(e,n,f))},f.prototype.renderBackgroundColor=function(e,n){var f=e.color("backgroundColor");f.isTransparent()||this.rectangle(n.left,n.top,n.width,n.height,f)},f.prototype.renderBorders=function(e){e.forEach(this.renderBorder,this)},f.prototype.renderBorder=function(e){e.color.isTransparent()||null===e.args||this.drawShape(e.args,e.color)},f.prototype.renderBackgroundImage=function(e,n,f){var d=e.parseBackgroundImages();d.reverse().forEach(function(d,i,t){switch(d.method){case"url":var l=this.images.get(d.args[0]);l?this.renderBackgroundRepeating(e,n,l,t.length-(i+1),f):o("Error loading background-image",d.args[0]);break;case"linear-gradient":case"gradient":var s=this.images.get(d.value);s?this.renderBackgroundGradient(s,n,f):o("Error loading background-image",d.args[0]);break;case"none":break;default:o("Unknown background-image type",d.args[0])}},this)},f.prototype.renderBackgroundRepeating=function(e,n,f,o,d){var i=e.parseBackgroundSize(n,f.image,o),t=e.parseBackgroundPosition(n,f.image,o,i),l=e.parseBackgroundRepeat(o);switch(l){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(f,t,i,n,n.left+d[3],n.top+t.top+d[0],99999,i.height,d);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(f,t,i,n,n.left+t.left+d[3],n.top+d[0],i.width,99999,d);break;case"no-repeat":this.backgroundRepeatShape(f,t,i,n,n.left+t.left+d[3],n.top+t.top+d[0],i.width,i.height,d);break;default:this.renderBackgroundRepeat(f,t,i,{top:n.top,left:n.left},d[3],d[0])}},n.exports=f},{"./log":13}],20:[function(e,n){function f(e,n){d.apply(this,arguments),this.canvas=this.options.canvas||this.document.createElement("canvas"),this.options.canvas||(this.canvas.width=e,this.canvas.height=n),this.ctx=this.canvas.getContext("2d"),this.taintCtx=this.document.createElement("canvas").getContext("2d"),this.ctx.textBaseline="bottom",this.variables={},t("Initialized CanvasRenderer with size",e,"x",n)}function o(e){return e.length>0}var d=e("../renderer"),i=e("../lineargradientcontainer"),t=e("../log");f.prototype=Object.create(d.prototype),f.prototype.setFillStyle=function(e){return this.ctx.fillStyle="object"==typeof e&&e.isColor?e.toString():e,this.ctx},f.prototype.rectangle=function(e,n,f,o,d){this.setFillStyle(d).fillRect(e,n,f,o)},f.prototype.circle=function(e,n,f,o){this.setFillStyle(o),this.ctx.beginPath(),this.ctx.arc(e+f/2,n+f/2,f/2,0,2*Math.PI,!0),this.ctx.closePath(),this.ctx.fill()},f.prototype.circleStroke=function(e,n,f,o,d,i){this.circle(e,n,f,o),this.ctx.strokeStyle=i.toString(),this.ctx.stroke()},f.prototype.drawShape=function(e,n){this.shape(e),this.setFillStyle(n).fill()},f.prototype.taints=function(e){if(null===e.tainted){this.taintCtx.drawImage(e.image,0,0);try{this.taintCtx.getImageData(0,0,1,1),e.tainted=!1}catch(n){this.taintCtx=document.createElement("canvas").getContext("2d"),e.tainted=!0}}return e.tainted},f.prototype.drawImage=function(e,n,f,o,d,i,t,l,s){(!this.taints(e)||this.options.allowTaint)&&this.ctx.drawImage(e.image,n,f,o,d,i,t,l,s)},f.prototype.clip=function(e,n,f){this.ctx.save(),e.filter(o).forEach(function(e){this.shape(e).clip()},this),n.call(f),this.ctx.restore()},f.prototype.shape=function(e){return this.ctx.beginPath(),e.forEach(function(e,n){"rect"===e[0]?this.ctx.rect.apply(this.ctx,e.slice(1)):this.ctx[0===n?"moveTo":e[0]+"To"].apply(this.ctx,e.slice(1))},this),this.ctx.closePath(),this.ctx},f.prototype.font=function(e,n,f,o,d,i){this.setFillStyle(e).font=[n,f,o,d,i].join(" ").split(",")[0]},f.prototype.fontShadow=function(e,n,f,o){this.setVariable("shadowColor",e.toString()).setVariable("shadowOffsetY",n).setVariable("shadowOffsetX",f).setVariable("shadowBlur",o)},f.prototype.clearShadow=function(){this.setVariable("shadowColor","rgba(0,0,0,0)")},f.prototype.setOpacity=function(e){this.ctx.globalAlpha=e},f.prototype.setTransform=function(e){this.ctx.translate(e.origin[0],e.origin[1]),this.ctx.transform.apply(this.ctx,e.matrix),this.ctx.translate(-e.origin[0],-e.origin[1])},f.prototype.setVariable=function(e,n){return this.variables[e]!==n&&(this.variables[e]=this.ctx[e]=n),this},f.prototype.text=function(e,n,f){this.ctx.fillText(e,n,f)},f.prototype.backgroundRepeatShape=function(e,n,f,o,d,i,t,l,s){var u=[["line",Math.round(d),Math.round(i)],["line",Math.round(d+t),Math.round(i)],["line",Math.round(d+t),Math.round(l+i)],["line",Math.round(d),Math.round(l+i)]];this.clip([u],function(){this.renderBackgroundRepeat(e,n,f,o,s[3],s[0])},this)},f.prototype.renderBackgroundRepeat=function(e,n,f,o,d,i){var t=Math.round(o.left+n.left+d),l=Math.round(o.top+n.top+i);this.setFillStyle(this.ctx.createPattern(this.resizeImage(e,f),"repeat")),this.ctx.translate(t,l),this.ctx.fill(),this.ctx.translate(-t,-l)},f.prototype.renderBackgroundGradient=function(e,n){if(e instanceof i){var f=this.ctx.createLinearGradient(n.left+n.width*e.x0,n.top+n.height*e.y0,n.left+n.width*e.x1,n.top+n.height*e.y1);e.colorStops.forEach(function(e){f.addColorStop(e.stop,e.color.toString())}),this.rectangle(n.left,n.top,n.width,n.height,f)}},f.prototype.resizeImage=function(e,n){var f=e.image;if(f.width===n.width&&f.height===n.height)return f;var o,d=document.createElement("canvas");return d.width=n.width,d.height=n.height,o=d.getContext("2d"),o.drawImage(f,0,0,f.width,f.height,0,0,n.width,n.height),d},n.exports=f},{"../lineargradientcontainer":12,"../log":13,"../renderer":19}],21:[function(e,n){function f(e,n,f,d){o.call(this,f,d),this.ownStacking=e,this.contexts=[],this.children=[],this.opacity=(this.parent?this.parent.stack.opacity:1)*n}var o=e("./nodecontainer");f.prototype=Object.create(o.prototype),f.prototype.getParentStack=function(e){var n=this.parent?this.parent.stack:null;return n?n.ownStacking?n:n.getParentStack(e):e.stack},n.exports=f},{"./nodecontainer":14}],22:[function(e,n){function f(e){this.rangeBounds=this.testRangeBounds(e),this.cors=this.testCORS(),this.svg=this.testSVG()}f.prototype.testRangeBounds=function(e){var n,f,o,d,i=!1;return e.createRange&&(n=e.createRange(),n.getBoundingClientRect&&(f=e.createElement("boundtest"),f.style.height="123px",f.style.display="block",e.body.appendChild(f),n.selectNode(f),o=n.getBoundingClientRect(),d=o.height,123===d&&(i=!0),e.body.removeChild(f))),i},f.prototype.testCORS=function(){return"undefined"!=typeof(new Image).crossOrigin},f.prototype.testSVG=function(){var e=new Image,n=document.createElement("canvas"),f=n.getContext("2d");e.src="data:image/svg+xml,";try{f.drawImage(e,0,0),n.toDataURL()}catch(o){return!1}return!0},n.exports=f},{}],23:[function(e,n){function f(e){this.src=e,this.image=null;var n=this;this.promise=this.hasFabric().then(function(){return n.isInline(e)?Promise.resolve(n.inlineFormatting(e)):o(e)}).then(function(e){return new Promise(function(f){window.html2canvas.svg.fabric.loadSVGFromString(e,n.createCanvas.call(n,f))})})}var o=e("./xhr"),d=e("./utils").decode64;f.prototype.hasFabric=function(){return window.html2canvas.svg&&window.html2canvas.svg.fabric?Promise.resolve():Promise.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg"))},f.prototype.inlineFormatting=function(e){return/^data:image\/svg\+xml;base64,/.test(e)?this.decode64(this.removeContentType(e)):this.removeContentType(e)},f.prototype.removeContentType=function(e){return e.replace(/^data:image\/svg\+xml(;base64)?,/,"")},f.prototype.isInline=function(e){return/^data:image\/svg\+xml/i.test(e)},f.prototype.createCanvas=function(e){var n=this;return function(f,o){var d=new window.html2canvas.svg.fabric.StaticCanvas("c");n.image=d.lowerCanvasEl,d.setWidth(o.width).setHeight(o.height).add(window.html2canvas.svg.fabric.util.groupSVGElements(f,o)).renderAll(),e(d.lowerCanvasEl)}},f.prototype.decode64=function(e){return"function"==typeof window.atob?window.atob(e):d(e)},n.exports=f},{"./utils":26,"./xhr":28}],24:[function(e,n){function f(e,n){this.src=e,this.image=null;var f=this;this.promise=n?new Promise(function(n,o){f.image=new Image,f.image.onload=n,f.image.onerror=o,f.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(e),f.image.complete===!0&&n(f.image)}):this.hasFabric().then(function(){return new Promise(function(n){window.html2canvas.svg.fabric.parseSVGDocument(e,f.createCanvas.call(f,n))})})}var o=e("./svgcontainer");f.prototype=Object.create(o.prototype),n.exports=f},{"./svgcontainer":23}],25:[function(e,n){function f(e,n){d.call(this,e,n)}function o(e,n,f){return e.length>0?n+f.toUpperCase():void 0}var d=e("./nodecontainer");f.prototype=Object.create(d.prototype),f.prototype.applyTextTransform=function(){this.node.data=this.transform(this.parent.css("textTransform"))},f.prototype.transform=function(e){var n=this.node.data;switch(e){case"lowercase":return n.toLowerCase();case"capitalize":return n.replace(/(^|\s|:|-|\(|\))([a-z])/g,o);case"uppercase":return n.toUpperCase();default:return n}},n.exports=f},{"./nodecontainer":14}],26:[function(e,n,f){f.smallImage=function(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},f.bind=function(e,n){return function(){return e.apply(n,arguments)}},f.decode64=function(e){var n,f,o,d,i,t,l,s,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=e.length,p="";for(n=0;a>n;n+=4)f=u.indexOf(e[n]),o=u.indexOf(e[n+1]),d=u.indexOf(e[n+2]),i=u.indexOf(e[n+3]),t=f<<2|o>>4,l=(15&o)<<4|d>>2,s=(3&d)<<6|i,p+=64===d?String.fromCharCode(t):64===i||-1===i?String.fromCharCode(t,l):String.fromCharCode(t,l,s);return p},f.getBounds=function(e){if(e.getBoundingClientRect){var n=e.getBoundingClientRect(),f=null==e.offsetWidth?n.width:e.offsetWidth;return{top:n.top,bottom:n.bottom||n.top+n.height,right:n.left+f,left:n.left,width:f,height:null==e.offsetHeight?n.height:e.offsetHeight}}return{}},f.offsetBounds=function(e){var n=e.offsetParent?f.offsetBounds(e.offsetParent):{top:0,left:0};return{top:e.offsetTop+n.top,bottom:e.offsetTop+e.offsetHeight+n.top,right:e.offsetLeft+n.left+e.offsetWidth,left:e.offsetLeft+n.left,width:e.offsetWidth,height:e.offsetHeight}},f.parseBackgrounds=function(e){var n,f,o,d,i,t,l,s=" \r\n ",u=[],a=0,p=0,c=function(){n&&('"'===f.substr(0,1)&&(f=f.substr(1,f.length-2)),f&&l.push(f),"-"===n.substr(0,1)&&(d=n.indexOf("-",1)+1)>0&&(o=n.substr(0,d),n=n.substr(d)),u.push({prefix:o,method:n.toLowerCase(),value:i,args:l,image:null})),l=[],n=o=f=i=""};return l=[],n=o=f=i="",e.split("").forEach(function(e){if(!(0===a&&s.indexOf(e)>-1)){switch(e){case'"':t?t===e&&(t=null):t=e;break;case"(":if(t)break;if(0===a)return a=1,void(i+=e);p++;break;case")":if(t)break;if(1===a){if(0===p)return a=0,i+=e,void c();p--}break;case",":if(t)break;if(0===a)return void c();if(1===a&&0===p&&!n.match(/^url$/i))return l.push(f),f="",void(i+=e)}i+=e,0===a?n+=e:f+=e}}),c(),u}},{}],27:[function(e,n){function f(e){o.apply(this,arguments),this.type="linear"===e.args[0]?o.TYPES.LINEAR:o.TYPES.RADIAL}var o=e("./gradientcontainer");f.prototype=Object.create(o.prototype),n.exports=f},{"./gradientcontainer":9}],28:[function(e,n){function f(e){return new Promise(function(n,f){var o=new XMLHttpRequest;o.open("GET",e),o.onload=function(){200===o.status?n(o.responseText):f(new Error(o.statusText))},o.onerror=function(){f(new Error("Network Error"))},o.send()})}n.exports=f},{}]},{},[4])(4)}); \ No newline at end of file diff --git a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/js-xlsx/LICENSE b/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/js-xlsx/LICENSE deleted file mode 100644 index bf49d68eb6f9b567f289cf784b0da25ec402cacb..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/js-xlsx/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright (C) 2012-present SheetJS LLC - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/js-xlsx/xlsx.core.min.js b/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/js-xlsx/xlsx.core.min.js deleted file mode 100644 index 95afae920ee88031c4428f183336636a1a6a9e28..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/js-xlsx/xlsx.core.min.js +++ /dev/null @@ -1,16 +0,0 @@ -/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */ -var DO_NOT_EXPORT_CODEPAGE=true;var DO_NOT_EXPORT_JSZIP=true;(function(e){if("object"==typeof exports&&"undefined"!=typeof module&&"undefined"==typeof DO_NOT_EXPORT_JSZIP)module.exports=e();else if("function"==typeof define&&define.amd){JSZipSync=e();define([],e)}else{var r;"undefined"!=typeof window?r=window:"undefined"!=typeof global?r=global:"undefined"!=typeof $&&$.global?r=$.global:"undefined"!=typeof self&&(r=self),r.JSZipSync=e()}})(function(){var e,r,t;return function a(e,r,t){function n(s,l){if(!r[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!l&&f)return f(s,!0);if(i)return i(s,!0);throw new Error("Cannot find module '"+s+"'")}var o=r[s]={exports:{}};e[s][0].call(o.exports,function(r){var t=e[s][1][r];return n(t?t:r)},o,o.exports,a,e,r,t)}return r[s].exports}var i=typeof require=="function"&&require;for(var s=0;s>2;f=(n&3)<<4|i>>4;o=(i&15)<<2|s>>6;c=s&63;if(isNaN(i)){o=c=64}else if(isNaN(s)){c=64}t=t+a.charAt(l)+a.charAt(f)+a.charAt(o)+a.charAt(c)}return t};t.decode=function(e,r){var t="";var n,i,s;var l,f,o,c;var u=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(u>4;i=(f&15)<<4|o>>2;s=(o&3)<<6|c;t=t+String.fromCharCode(n);if(o!=64){t=t+String.fromCharCode(i)}if(c!=64){t=t+String.fromCharCode(s)}}return t}},{}],2:[function(e,r,t){"use strict";function a(){this.compressedSize=0;this.uncompressedSize=0;this.crc32=0;this.compressionMethod=null;this.compressedContent=null}a.prototype={getContent:function(){return null},getCompressedContent:function(){return null}};r.exports=a},{}],3:[function(e,r,t){"use strict";t.STORE={magic:"\0\0",compress:function(e){return e},uncompress:function(e){return e},compressInputType:null,uncompressInputType:null};t.DEFLATE=e("./flate")},{"./flate":8}],4:[function(e,r,t){"use strict";var a=e("./utils");var n=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];r.exports=function i(e,r){if(typeof e==="undefined"||!e.length){return 0}var t=a.getTypeOf(e)!=="string";if(typeof r=="undefined"){r=0}var i=0;var s=0;var l=0;r=r^-1;for(var f=0,o=e.length;f>>8^i}return r^-1}},{"./utils":21}],5:[function(e,r,t){"use strict";var a=e("./utils");function n(e){this.data=null;this.length=0;this.index=0}n.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length=this.index;t--){r=(r<<8)+this.byteAt(t)}this.index+=e;return r},readString:function(e){return a.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1)}};r.exports=n},{"./utils":21}],6:[function(e,r,t){"use strict";t.base64=false;t.binary=false;t.dir=false;t.createFolders=false;t.date=null;t.compression=null;t.comment=null},{}],7:[function(e,r,t){"use strict";var a=e("./utils");t.string2binary=function(e){return a.string2binary(e)};t.string2Uint8Array=function(e){return a.transformTo("uint8array",e)};t.uint8Array2String=function(e){return a.transformTo("string",e)};t.string2Blob=function(e){var r=a.transformTo("arraybuffer",e);return a.arrayBuffer2Blob(r)};t.arrayBuffer2Blob=function(e){return a.arrayBuffer2Blob(e)};t.transformTo=function(e,r){return a.transformTo(e,r)};t.getTypeOf=function(e){return a.getTypeOf(e)};t.checkSupport=function(e){return a.checkSupport(e)};t.MAX_VALUE_16BITS=a.MAX_VALUE_16BITS;t.MAX_VALUE_32BITS=a.MAX_VALUE_32BITS;t.pretty=function(e){return a.pretty(e)};t.findCompression=function(e){return a.findCompression(e)};t.isRegExp=function(e){return a.isRegExp(e)}},{"./utils":21}],8:[function(e,r,t){"use strict";var a=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Uint32Array!=="undefined";var n=e("pako");t.uncompressInputType=a?"uint8array":"array";t.compressInputType=a?"uint8array":"array";t.magic="\b\0";t.compress=function(e){return n.deflateRaw(e)};t.uncompress=function(e){return n.inflateRaw(e)}},{pako:24}],9:[function(e,r,t){"use strict";var a=e("./base64");function n(e,r){if(!(this instanceof n))return new n(e,r);this.files={};this.comment=null;this.root="";if(e){this.load(e,r)}this.clone=function(){var e=new n;for(var r in this){if(typeof this[r]!=="function"){e[r]=this[r]}}return e}}n.prototype=e("./object");n.prototype.load=e("./load");n.support=e("./support");n.defaults=e("./defaults");n.utils=e("./deprecatedPublicUtils");n.base64={encode:function(e){return a.encode(e)},decode:function(e){return a.decode(e)}};n.compressions=e("./compressions");r.exports=n},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(e,r,t){"use strict";var a=e("./base64");var n=e("./zipEntries");r.exports=function(e,r){var t,i,s,l;r=r||{};if(r.base64){e=a.decode(e)}i=new n(e,r);t=i.files;for(s=0;s>>8}return t};var k=function(){var e={},r,t;for(r=0;r0?e.substring(0,r):""};var C=function(e,r){if(e.slice(-1)!="/"){e+="/"}r=typeof r!=="undefined"?r:false;if(!this.files[e]){S.call(this,e,null,{dir:true,createFolders:r})}return this.files[e]};var B=function(e,r){var t=new c,a;if(e._data instanceof c){t.uncompressedSize=e._data.uncompressedSize;t.crc32=e._data.crc32;if(t.uncompressedSize===0||e.dir){r=o["STORE"];t.compressedContent="";t.crc32=0}else if(e._data.compressionMethod===r.magic){t.compressedContent=e._data.getCompressedContent()}else{a=e._data.getContent();t.compressedContent=r.compress(n.transformTo(r.compressInputType,a))}}else{a=m(e);if(!a||a.length===0||e.dir){r=o["STORE"];a=""}t.uncompressedSize=a.length;t.crc32=i(a);t.compressedContent=r.compress(n.transformTo(r.compressInputType,a))}t.compressedSize=t.compressedContent.length;t.compressionMethod=r.magic;return t};var T=function(e,r,t,a){var l=t.compressedContent,f=n.transformTo("string",h.utf8encode(r.name)),o=r.comment||"",c=n.transformTo("string",h.utf8encode(o)),u=f.length!==r.name.length,d=c.length!==o.length,v=r.options,p,m,b="",g="",k="",w,S;if(r._initialMetadata.dir!==r.dir){w=r.dir}else{w=v.dir}if(r._initialMetadata.date!==r.date){S=r.date}else{S=v.date}p=S.getHours();p=p<<6;p=p|S.getMinutes();p=p<<5;p=p|S.getSeconds()/2;m=S.getFullYear()-1980;m=m<<4;m=m|S.getMonth()+1;m=m<<5;m=m|S.getDate();if(u){g=E(1,1)+E(i(f),4)+f;b+="up"+E(g.length,2)+g}if(d){k=E(1,1)+E(this.crc32(c),4)+c;b+="uc"+E(k.length,2)+k}var _="";_+="\n\0";_+=u||d?"\0\b":"\0\0";_+=t.compressionMethod;_+=E(p,2);_+=E(m,2);_+=E(t.crc32,4);_+=E(t.compressedSize,4);_+=E(t.uncompressedSize,4);_+=E(f.length,2);_+=E(b.length,2);var C=s.LOCAL_FILE_HEADER+_+f+b;var B=s.CENTRAL_FILE_HEADER+"\0"+_+E(c.length,2)+"\0\0"+"\0\0"+(w===true?"\0\0\0":"\0\0\0\0")+E(a,4)+f+b+c;return{fileRecord:C,dirRecord:B,compressedObject:t}};var x={load:function(e,r){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(e){var r=[],t,a,n,i;for(t in this.files){if(!this.files.hasOwnProperty(t)){continue}n=this.files[t];i=new g(n.name,n._data,k(n.options));a=t.slice(this.root.length,t.length);if(t.slice(0,this.root.length)===this.root&&e(a,i)){r.push(i)}}return r},file:function(e,r,t){if(arguments.length===1){if(n.isRegExp(e)){var a=e;return this.filter(function(e,r){return!r.dir&&a.test(e)})}else{return this.filter(function(r,t){return!t.dir&&r===e})[0]||null}}else{e=this.root+e;S.call(this,e,r,t)}return this},folder:function(e){if(!e){return this}if(n.isRegExp(e)){return this.filter(function(r,t){return t.dir&&e.test(r)})}var r=this.root+e;var t=C.call(this,r);var a=this.clone();a.root=t.name;return a},remove:function(e){e=this.root+e;var r=this.files[e];if(!r){if(e.slice(-1)!="/"){e+="/"}r=this.files[e]}if(r&&!r.dir){delete this.files[e]}else{var t=this.filter(function(r,t){return t.name.slice(0,e.length)===e});for(var a=0;a=0;--i){if(this.data[i]===r&&this.data[i+1]===t&&this.data[i+2]===a&&this.data[i+3]===n){return i}}return-1};n.prototype.readData=function(e){this.checkOffset(e);if(e===0){return new Uint8Array(0)}var r=this.data.subarray(this.index,this.index+e);this.index+=e;return r};r.exports=n},{"./dataReader":5}],19:[function(e,r,t){"use strict";var a=e("./utils");var n=function(e){this.data=new Uint8Array(e);this.index=0};n.prototype={append:function(e){if(e.length!==0){e=a.transformTo("uint8array",e);this.data.set(e,this.index);this.index+=e.length}},finalize:function(){return this.data}};r.exports=n},{"./utils":21}],20:[function(e,r,t){"use strict";var a=e("./utils");var n=e("./support");var i=e("./nodeBuffer");var s=new Array(256);for(var l=0;l<256;l++){s[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1}s[254]=s[254]=1;var f=function(e){var r,t,a,i,s,l=e.length,f=0;for(i=0;i>>6;r[s++]=128|t&63}else if(t<65536){r[s++]=224|t>>>12;r[s++]=128|t>>>6&63;r[s++]=128|t&63}else{r[s++]=240|t>>>18;r[s++]=128|t>>>12&63;r[s++]=128|t>>>6&63;r[s++]=128|t&63}}return r};var o=function(e,r){var t;r=r||e.length;if(r>e.length){r=e.length}t=r-1;while(t>=0&&(e[t]&192)===128){t--}if(t<0){return r}if(t===0){return r}return t+s[e[t]]>r?t:r};var c=function(e){var r,t,n,i,l;var f=e.length;var o=new Array(f*2);for(n=0,t=0;t4){o[n++]=65533;t+=l-1;continue}i&=l===2?31:l===3?15:7;while(l>1&&t1){o[n++]=65533;continue}if(i<65536){o[n++]=i}else{i-=65536;o[n++]=55296|i>>10&1023;o[n++]=56320|i&1023}}if(o.length!==n){if(o.subarray){o=o.subarray(0,n)}else{o.length=n}}return a.applyFromCharCode(o)};t.utf8encode=function u(e){if(n.nodebuffer){return i(e,"utf-8")}return f(e)};t.utf8decode=function h(e){if(n.nodebuffer){return a.transformTo("nodebuffer",e).toString("utf-8")}e=a.transformTo(n.uint8array?"uint8array":"array",e);var r=[],t=0,i=e.length,s=65536;while(t1){try{if(s==="array"||s==="nodebuffer"){a.push(String.fromCharCode.apply(null,e.slice(l,Math.min(l+r,n))))}else{a.push(String.fromCharCode.apply(null,e.subarray(l,Math.min(l+r,n))))}l+=r}catch(o){r=Math.floor(r/2)}}return a.join("")}t.applyFromCharCode=f;function o(e,r){for(var t=0;t1){throw new Error("Multi-volumes zip are not supported")}},readLocalFiles:function(){var e,r;for(e=0;e0){r.windowBits=-r.windowBits}else if(r.gzip&&r.windowBits>0&&r.windowBits<16){r.windowBits+=16}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new l;this.strm.avail_out=0;var t=a.deflateInit2(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy);if(t!==c){throw new Error(s[t])}if(r.header){a.deflateSetHeader(this.strm,r.header)}};p.prototype.push=function(e,r){var t=this.strm;var s=this.options.chunkSize;var l,h;if(this.ended){return false}h=r===~~r?r:r===true?o:f;if(typeof e==="string"){t.input=i.string2buf(e)}else{t.input=e}t.next_in=0;t.avail_in=t.input.length;do{if(t.avail_out===0){t.output=new n.Buf8(s);t.next_out=0;t.avail_out=s}l=a.deflate(t,h);if(l!==u&&l!==c){this.onEnd(l);this.ended=true;return false}if(t.avail_out===0||t.avail_in===0&&h===o){if(this.options.to==="string"){this.onData(i.buf2binstring(n.shrinkBuf(t.output,t.next_out)))}else{this.onData(n.shrinkBuf(t.output,t.next_out))}}}while((t.avail_in>0||t.avail_out===0)&&l!==u);if(h===o){l=a.deflateEnd(this.strm);this.onEnd(l);this.ended=true;return l===c}return true};p.prototype.onData=function(e){this.chunks.push(e)};p.prototype.onEnd=function(e){if(e===c){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=n.flattenChunks(this.chunks)}}this.chunks=[];this.err=e;this.msg=this.strm.msg};function m(e,r){var t=new p(r);t.push(e,true);if(t.err){throw t.msg}return t.result}function b(e,r){r=r||{};r.raw=true;return m(e,r)}function g(e,r){r=r||{};r.gzip=true;return m(e,r)}t.Deflate=p;t.deflate=m;t.deflateRaw=b;t.gzip=g},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(e,r,t){"use strict";var a=e("./zlib/inflate.js");var n=e("./utils/common");var i=e("./utils/strings");var s=e("./zlib/constants");var l=e("./zlib/messages");var f=e("./zlib/zstream");var o=e("./zlib/gzheader");var c=function(e){this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var r=this.options;if(r.raw&&r.windowBits>=0&&r.windowBits<16){r.windowBits=-r.windowBits;if(r.windowBits===0){r.windowBits=-15}}if(r.windowBits>=0&&r.windowBits<16&&!(e&&e.windowBits)){r.windowBits+=32}if(r.windowBits>15&&r.windowBits<48){if((r.windowBits&15)===0){r.windowBits|=15}}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new f;this.strm.avail_out=0;var t=a.inflateInit2(this.strm,r.windowBits);if(t!==s.Z_OK){throw new Error(l[t])}this.header=new o;a.inflateGetHeader(this.strm,this.header)};c.prototype.push=function(e,r){var t=this.strm;var l=this.options.chunkSize;var f,o;var c,u,h;if(this.ended){return false}o=r===~~r?r:r===true?s.Z_FINISH:s.Z_NO_FLUSH;if(typeof e==="string"){t.input=i.binstring2buf(e)}else{t.input=e}t.next_in=0;t.avail_in=t.input.length;do{if(t.avail_out===0){t.output=new n.Buf8(l);t.next_out=0;t.avail_out=l}f=a.inflate(t,s.Z_NO_FLUSH);if(f!==s.Z_STREAM_END&&f!==s.Z_OK){this.onEnd(f);this.ended=true;return false}if(t.next_out){if(t.avail_out===0||f===s.Z_STREAM_END||t.avail_in===0&&o===s.Z_FINISH){if(this.options.to==="string"){c=i.utf8border(t.output,t.next_out);u=t.next_out-c;h=i.buf2string(t.output,c);t.next_out=u;t.avail_out=l-u;if(u){n.arraySet(t.output,t.output,c,u,0)}this.onData(h)}else{this.onData(n.shrinkBuf(t.output,t.next_out))}}}}while(t.avail_in>0&&f!==s.Z_STREAM_END);if(f===s.Z_STREAM_END){o=s.Z_FINISH}if(o===s.Z_FINISH){f=a.inflateEnd(this.strm);this.onEnd(f);this.ended=true;return f===s.Z_OK}return true};c.prototype.onData=function(e){this.chunks.push(e)};c.prototype.onEnd=function(e){if(e===s.Z_OK){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=n.flattenChunks(this.chunks)}}this.chunks=[];this.err=e;this.msg=this.strm.msg};function u(e,r){var t=new c(r);t.push(e,true);if(t.err){throw t.msg}return t.result}function h(e,r){r=r||{};r.raw=true;return u(e,r)}t.Inflate=c;t.inflate=u;t.inflateRaw=h;t.ungzip=u},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(e,r,t){"use strict";var a=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";t.assign=function(e){var r=Array.prototype.slice.call(arguments,1);while(r.length){var t=r.shift();if(!t){continue}if(typeof t!=="object"){throw new TypeError(t+"must be non-object")}for(var a in t){if(t.hasOwnProperty(a)){e[a]=t[a]}}}return e};t.shrinkBuf=function(e,r){if(e.length===r){return e}if(e.subarray){return e.subarray(0,r)}e.length=r;return e};var n={arraySet:function(e,r,t,a,n){if(r.subarray&&e.subarray){e.set(r.subarray(t,t+a),n);return}for(var i=0;i=252?6:f>=248?5:f>=240?4:f>=224?3:f>=192?2:1}l[254]=l[254]=1;t.string2buf=function(e){var r,t,n,i,s,l=e.length,f=0;for(i=0;i>>6;r[s++]=128|t&63}else if(t<65536){r[s++]=224|t>>>12;r[s++]=128|t>>>6&63;r[s++]=128|t&63}else{r[s++]=240|t>>>18;r[s++]=128|t>>>12&63;r[s++]=128|t>>>6&63;r[s++]=128|t&63}}return r};function o(e,r){if(r<65537){if(e.subarray&&i||!e.subarray&&n){return String.fromCharCode.apply(null,a.shrinkBuf(e,r))}}var t="";for(var s=0;s4){f[a++]=65533;t+=i-1;continue}n&=i===2?31:i===3?15:7;while(i>1&&t1){f[a++]=65533;continue}if(n<65536){f[a++]=n}else{n-=65536;f[a++]=55296|n>>10&1023;f[a++]=56320|n&1023}}return o(f,a)};t.utf8border=function(e,r){var t;r=r||e.length;if(r>e.length){r=e.length}t=r-1;while(t>=0&&(e[t]&192)===128){t--}if(t<0){return r}if(t===0){return r}return t+l[e[t]]>r?t:r}},{"./common":27}],29:[function(e,r,t){"use strict";function a(e,r,t,a){var n=e&65535|0,i=e>>>16&65535|0,s=0;while(t!==0){s=t>2e3?2e3:t;t-=s;do{n=n+r[a++]|0;i=i+n|0}while(--s);n%=65521;i%=65521}return n|i<<16|0}r.exports=a},{}],30:[function(e,r,t){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],31:[function(e,r,t){"use strict";function a(){var e,r=[];for(var t=0;t<256;t++){e=t;for(var a=0;a<8;a++){e=e&1?3988292384^e>>>1:e>>>1}r[t]=e}return r}var n=a();function i(e,r,t,a){var i=n,s=a+t;e=e^-1;for(var l=a;l>>8^i[(e^r[l])&255]}return e^-1}r.exports=i},{}],32:[function(e,r,t){"use strict";var a=e("../utils/common");var n=e("./trees");var i=e("./adler32");var s=e("./crc32");var l=e("./messages");var f=0;var o=1;var c=3;var u=4;var h=5;var d=0;var v=1;var p=-2;var m=-3;var b=-5;var g=-1;var E=1;var k=2;var w=3;var S=4;var _=0;var C=2;var B=8;var T=9;var x=15;var y=8;var A=29;var I=256;var R=I+1+A;var D=30;var F=19;var O=2*R+1;var P=15;var N=3;var L=258;var M=L+N+1;var U=32;var H=42;var W=69;var V=73;var z=91;var X=103;var G=113;var j=666;var K=1;var Y=2;var $=3;var Z=4;var Q=3;function J(e,r){e.msg=l[r];return r}function q(e){return(e<<1)-(e>4?9:0)}function ee(e){var r=e.length;while(--r>=0){e[r]=0}}function re(e){var r=e.state;var t=r.pending;if(t>e.avail_out){t=e.avail_out}if(t===0){return}a.arraySet(e.output,r.pending_buf,r.pending_out,t,e.next_out);e.next_out+=t;r.pending_out+=t;e.total_out+=t;e.avail_out-=t;r.pending-=t;if(r.pending===0){r.pending_out=0}}function te(e,r){n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,r);e.block_start=e.strstart;re(e.strm)}function ae(e,r){e.pending_buf[e.pending++]=r}function ne(e,r){e.pending_buf[e.pending++]=r>>>8&255;e.pending_buf[e.pending++]=r&255}function ie(e,r,t,n){var l=e.avail_in;if(l>n){l=n}if(l===0){return 0}e.avail_in-=l;a.arraySet(r,e.input,e.next_in,l,t);if(e.state.wrap===1){e.adler=i(e.adler,r,l,t)}else if(e.state.wrap===2){e.adler=s(e.adler,r,l,t)}e.next_in+=l;e.total_in+=l;return l}function se(e,r){var t=e.max_chain_length;var a=e.strstart;var n;var i;var s=e.prev_length;var l=e.nice_match;var f=e.strstart>e.w_size-M?e.strstart-(e.w_size-M):0;var o=e.window;var c=e.w_mask;var u=e.prev;var h=e.strstart+L;var d=o[a+s-1];var v=o[a+s];if(e.prev_length>=e.good_match){t>>=2}if(l>e.lookahead){l=e.lookahead}do{n=r;if(o[n+s]!==v||o[n+s-1]!==d||o[n]!==o[a]||o[++n]!==o[a+1]){continue}a+=2;n++;do{}while(o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&o[++a]===o[++n]&&as){e.match_start=r;s=i;if(i>=l){break}d=o[a+s-1];v=o[a+s]}}while((r=u[r&c])>f&&--t!==0);if(s<=e.lookahead){return s}return e.lookahead}function le(e){var r=e.w_size;var t,n,i,s,l;do{s=e.window_size-e.lookahead-e.strstart;if(e.strstart>=r+(r-M)){a.arraySet(e.window,e.window,r,r,0);e.match_start-=r;e.strstart-=r;e.block_start-=r;n=e.hash_size;t=n;do{i=e.head[--t];e.head[t]=i>=r?i-r:0}while(--n);n=r;t=n;do{i=e.prev[--t];e.prev[t]=i>=r?i-r:0}while(--n);s+=r}if(e.strm.avail_in===0){break}n=ie(e.strm,e.window,e.strstart+e.lookahead,s);e.lookahead+=n;if(e.lookahead+e.insert>=N){l=e.strstart-e.insert;e.ins_h=e.window[l];e.ins_h=(e.ins_h<e.pending_buf_size-5){t=e.pending_buf_size-5}for(;;){if(e.lookahead<=1){le(e);if(e.lookahead===0&&r===f){return K}if(e.lookahead===0){break}}e.strstart+=e.lookahead;e.lookahead=0;var a=e.block_start+t;if(e.strstart===0||e.strstart>=a){e.lookahead=e.strstart-a;e.strstart=a;te(e,false);if(e.strm.avail_out===0){return K}}if(e.strstart-e.block_start>=e.w_size-M){te(e,false);if(e.strm.avail_out===0){return K}}}e.insert=0;if(r===u){te(e,true);if(e.strm.avail_out===0){return $}return Z}if(e.strstart>e.block_start){te(e,false);if(e.strm.avail_out===0){return K}}return K}function oe(e,r){var t;var a;for(;;){if(e.lookahead=N){e.ins_h=(e.ins_h<=N){a=n._tr_tally(e,e.strstart-e.match_start,e.match_length-N);e.lookahead-=e.match_length;if(e.match_length<=e.max_lazy_match&&e.lookahead>=N){e.match_length--;do{e.strstart++;e.ins_h=(e.ins_h<=N){e.ins_h=(e.ins_h<4096)){e.match_length=N-1}}if(e.prev_length>=N&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-N;a=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-N);e.lookahead-=e.prev_length-1;e.prev_length-=2;do{if(++e.strstart<=i){e.ins_h=(e.ins_h<=N&&e.strstart>0){i=e.strstart-1;a=l[i];if(a===l[++i]&&a===l[++i]&&a===l[++i]){s=e.strstart+L;do{}while(a===l[++i]&&a===l[++i]&&a===l[++i]&&a===l[++i]&&a===l[++i]&&a===l[++i]&&a===l[++i]&&a===l[++i]&&ie.lookahead){e.match_length=e.lookahead}}}if(e.match_length>=N){t=n._tr_tally(e,1,e.match_length-N);e.lookahead-=e.match_length;e.strstart+=e.match_length;e.match_length=0}else{t=n._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++}if(t){te(e,false);if(e.strm.avail_out===0){return K}}}e.insert=0;if(r===u){te(e,true);if(e.strm.avail_out===0){return $}return Z}if(e.last_lit){te(e,false);if(e.strm.avail_out===0){return K}}return Y}function he(e,r){var t;for(;;){if(e.lookahead===0){le(e);if(e.lookahead===0){if(r===f){return K}break}}e.match_length=0;t=n._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++;if(t){te(e,false);if(e.strm.avail_out===0){return K}}}e.insert=0;if(r===u){te(e,true);if(e.strm.avail_out===0){return $}return Z}if(e.last_lit){te(e,false);if(e.strm.avail_out===0){return K}}return Y}var de=function(e,r,t,a,n){this.good_length=e;this.max_lazy=r;this.nice_length=t;this.max_chain=a;this.func=n};var ve;ve=[new de(0,0,0,0,fe),new de(4,4,8,4,oe),new de(4,5,16,8,oe),new de(4,6,32,32,oe),new de(4,4,16,16,ce),new de(8,16,32,32,ce),new de(8,16,128,128,ce),new de(8,32,128,256,ce),new de(32,128,258,1024,ce),new de(32,258,258,4096,ce)];function pe(e){e.window_size=2*e.w_size;ee(e.head);e.max_lazy_match=ve[e.level].max_lazy;e.good_match=ve[e.level].good_length;e.nice_match=ve[e.level].nice_length;e.max_chain_length=ve[e.level].max_chain;e.strstart=0;e.block_start=0;e.lookahead=0;e.insert=0;e.match_length=e.prev_length=N-1;e.match_available=0;e.ins_h=0}function me(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=B;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new a.Buf16(O*2);this.dyn_dtree=new a.Buf16((2*D+1)*2);this.bl_tree=new a.Buf16((2*F+1)*2);ee(this.dyn_ltree);ee(this.dyn_dtree);ee(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new a.Buf16(P+1);this.heap=new a.Buf16(2*R+1);ee(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new a.Buf16(2*R+1);ee(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function be(e){var r;if(!e||!e.state){return J(e,p)}e.total_in=e.total_out=0;e.data_type=C;r=e.state;r.pending=0;r.pending_out=0;if(r.wrap<0){r.wrap=-r.wrap}r.status=r.wrap?H:G;e.adler=r.wrap===2?0:1;r.last_flush=f;n._tr_init(r);return d}function ge(e){var r=be(e);if(r===d){pe(e.state)}return r}function Ee(e,r){if(!e||!e.state){return p}if(e.state.wrap!==2){return p}e.state.gzhead=r;return d}function ke(e,r,t,n,i,s){if(!e){return p}var l=1;if(r===g){r=6}if(n<0){l=0;n=-n}else if(n>15){l=2;n-=16}if(i<1||i>T||t!==B||n<8||n>15||r<0||r>9||s<0||s>S){return J(e,p)}if(n===8){n=9}var f=new me;e.state=f;f.strm=e;f.wrap=l;f.gzhead=null;f.w_bits=n;f.w_size=1<>1;f.l_buf=(1+2)*f.lit_bufsize;f.level=r;f.strategy=s;f.method=t;return ge(e)}function we(e,r){return ke(e,r,B,x,y,_)}function Se(e,r){var t,a;var i,l;if(!e||!e.state||r>h||r<0){return e?J(e,p):p}a=e.state;if(!e.output||!e.input&&e.avail_in!==0||a.status===j&&r!==u){return J(e,e.avail_out===0?b:p)}a.strm=e;t=a.last_flush;a.last_flush=r;if(a.status===H){if(a.wrap===2){e.adler=0;ae(a,31);ae(a,139);ae(a,8);if(!a.gzhead){ae(a,0);ae(a,0);ae(a,0);ae(a,0);ae(a,0);ae(a,a.level===9?2:a.strategy>=k||a.level<2?4:0);ae(a,Q);a.status=G}else{ae(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(!a.gzhead.extra?0:4)+(!a.gzhead.name?0:8)+(!a.gzhead.comment?0:16));ae(a,a.gzhead.time&255);ae(a,a.gzhead.time>>8&255);ae(a,a.gzhead.time>>16&255);ae(a,a.gzhead.time>>24&255);ae(a,a.level===9?2:a.strategy>=k||a.level<2?4:0);ae(a,a.gzhead.os&255);if(a.gzhead.extra&&a.gzhead.extra.length){ae(a,a.gzhead.extra.length&255);ae(a,a.gzhead.extra.length>>8&255)}if(a.gzhead.hcrc){e.adler=s(e.adler,a.pending_buf,a.pending,0)}a.gzindex=0;a.status=W}}else{var m=B+(a.w_bits-8<<4)<<8;var g=-1;if(a.strategy>=k||a.level<2){g=0}else if(a.level<6){g=1}else if(a.level===6){g=2}else{g=3}m|=g<<6;if(a.strstart!==0){m|=U}m+=31-m%31;a.status=G;ne(a,m);if(a.strstart!==0){ne(a,e.adler>>>16);ne(a,e.adler&65535)}e.adler=1}}if(a.status===W){if(a.gzhead.extra){i=a.pending;while(a.gzindex<(a.gzhead.extra.length&65535)){if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i){e.adler=s(e.adler,a.pending_buf,a.pending-i,i)}re(e);i=a.pending;if(a.pending===a.pending_buf_size){break}}ae(a,a.gzhead.extra[a.gzindex]&255);a.gzindex++}if(a.gzhead.hcrc&&a.pending>i){e.adler=s(e.adler,a.pending_buf,a.pending-i,i)}if(a.gzindex===a.gzhead.extra.length){a.gzindex=0;a.status=V}}else{a.status=V}}if(a.status===V){if(a.gzhead.name){i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i){e.adler=s(e.adler,a.pending_buf,a.pending-i,i)}re(e);i=a.pending;if(a.pending===a.pending_buf_size){l=1;break}}if(a.gzindexi){e.adler=s(e.adler,a.pending_buf,a.pending-i,i)}if(l===0){a.gzindex=0;a.status=z}}else{a.status=z}}if(a.status===z){if(a.gzhead.comment){i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i){e.adler=s(e.adler,a.pending_buf,a.pending-i,i)}re(e);i=a.pending;if(a.pending===a.pending_buf_size){l=1;break}}if(a.gzindexi){e.adler=s(e.adler,a.pending_buf,a.pending-i,i)}if(l===0){a.status=X}}else{a.status=X}}if(a.status===X){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size){re(e)}if(a.pending+2<=a.pending_buf_size){ae(a,e.adler&255);ae(a,e.adler>>8&255);e.adler=0;a.status=G}}else{a.status=G}}if(a.pending!==0){re(e);if(e.avail_out===0){a.last_flush=-1;return d}}else if(e.avail_in===0&&q(r)<=q(t)&&r!==u){return J(e,b)}if(a.status===j&&e.avail_in!==0){return J(e,b)}if(e.avail_in!==0||a.lookahead!==0||r!==f&&a.status!==j){var E=a.strategy===k?he(a,r):a.strategy===w?ue(a,r):ve[a.level].func(a,r);if(E===$||E===Z){a.status=j}if(E===K||E===$){if(e.avail_out===0){a.last_flush=-1}return d}if(E===Y){if(r===o){n._tr_align(a)}else if(r!==h){n._tr_stored_block(a,0,0,false);if(r===c){ee(a.head);if(a.lookahead===0){a.strstart=0;a.block_start=0;a.insert=0}}}re(e);if(e.avail_out===0){a.last_flush=-1;return d}}}if(r!==u){return d}if(a.wrap<=0){return v}if(a.wrap===2){ae(a,e.adler&255);ae(a,e.adler>>8&255);ae(a,e.adler>>16&255);ae(a,e.adler>>24&255);ae(a,e.total_in&255);ae(a,e.total_in>>8&255);ae(a,e.total_in>>16&255);ae(a,e.total_in>>24&255)}else{ne(a,e.adler>>>16);ne(a,e.adler&65535)}re(e);if(a.wrap>0){a.wrap=-a.wrap}return a.pending!==0?d:v}function _e(e){var r;if(!e||!e.state){return p}r=e.state.status;if(r!==H&&r!==W&&r!==V&&r!==z&&r!==X&&r!==G&&r!==j){return J(e,p)}e.state=null;return r===G?J(e,m):d}t.deflateInit=we;t.deflateInit2=ke;t.deflateReset=ge;t.deflateResetKeep=be;t.deflateSetHeader=Ee;t.deflate=Se;t.deflateEnd=_e;t.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(e,r,t){"use strict";function a(){this.text=0;this.time=0;this.xflags=0;this.os=0;this.extra=null;this.extra_len=0;this.name="";this.comment="";this.hcrc=0;this.done=false}r.exports=a},{}],34:[function(e,r,t){"use strict";var a=30;var n=12;r.exports=function i(e,r){var t;var i;var s;var l;var f;var o;var c;var u;var h;var d;var v;var p;var m;var b;var g;var E;var k;var w;var S;var _;var C;var B;var T;var x,y;t=e.state;i=e.next_in;x=e.input;s=i+(e.avail_in-5);l=e.next_out;y=e.output;f=l-(r-e.avail_out);o=l+(e.avail_out-257);c=t.dmax;u=t.wsize;h=t.whave;d=t.wnext;v=t.window;p=t.hold;m=t.bits;b=t.lencode;g=t.distcode;E=(1<>>24;p>>>=S;m-=S;S=w>>>16&255;if(S===0){y[l++]=w&65535}else if(S&16){_=w&65535;S&=15;if(S){if(m>>=S;m-=S}if(m<15){p+=x[i++]<>>24;p>>>=S;m-=S;S=w>>>16&255;if(S&16){C=w&65535;S&=15;if(mc){e.msg="invalid distance too far back";t.mode=a;break e}p>>>=S;m-=S;S=l-f;if(C>S){S=C-S;if(S>h){if(t.sane){e.msg="invalid distance too far back";t.mode=a;break e}}B=0;T=v;if(d===0){B+=u-S;if(S<_){_-=S;do{y[l++]=v[B++]}while(--S);B=l-C;T=y}}else if(d2){y[l++]=T[B++];y[l++]=T[B++];y[l++]=T[B++];_-=3}if(_){y[l++]=T[B++];if(_>1){y[l++]=T[B++]}}}else{B=l-C;do{y[l++]=y[B++];y[l++]=y[B++];y[l++]=y[B++];_-=3}while(_>2);if(_){y[l++]=y[B++];if(_>1){y[l++]=y[B++]}}}}else if((S&64)===0){w=g[(w&65535)+(p&(1<>3;i-=_;m-=_<<3;p&=(1<>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function ie(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new a.Buf16(320);this.work=new a.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function se(e){var r;if(!e||!e.state){return b}r=e.state;e.total_in=e.total_out=r.total=0;e.msg="";if(r.wrap){e.adler=r.wrap&1}r.mode=S;r.last=0;r.havedict=0;r.dmax=32768;r.head=null;r.hold=0;r.bits=0;r.lencode=r.lendyn=new a.Buf32(ee);r.distcode=r.distdyn=new a.Buf32(re);r.sane=1;r.back=-1;return v}function le(e){var r;if(!e||!e.state){return b}r=e.state;r.wsize=0;r.whave=0;r.wnext=0;return se(e)}function fe(e,r){var t;var a;if(!e||!e.state){return b}a=e.state;if(r<0){t=0;r=-r}else{t=(r>>4)+1;if(r<48){r&=15}}if(r&&(r<8||r>15)){return b}if(a.window!==null&&a.wbits!==r){a.window=null}a.wrap=t;a.wbits=r;return le(e)}function oe(e,r){var t;var a;if(!e){return b}a=new ie;e.state=a;a.window=null;t=fe(e,r);if(t!==v){e.state=null}return t}function ce(e){return oe(e,ae)}var ue=true;var he,de;function ve(e){if(ue){var r;he=new a.Buf32(512);de=new a.Buf32(32);r=0;while(r<144){e.lens[r++]=8}while(r<256){e.lens[r++]=9}while(r<280){e.lens[r++]=7}while(r<288){e.lens[r++]=8}l(o,e.lens,0,288,he,0,e.work,{bits:9});r=0;while(r<32){e.lens[r++]=5}l(c,e.lens,0,32,de,0,e.work,{bits:5});ue=false}e.lencode=he;e.lenbits=9;e.distcode=de;e.distbits=5}function pe(e,r,t,n){var i;var s=e.state;if(s.window===null){s.wsize=1<=s.wsize){a.arraySet(s.window,r,t-s.wsize,s.wsize,0);s.wnext=0;s.whave=s.wsize}else{i=s.wsize-s.wnext;if(i>n){i=n}a.arraySet(s.window,r,t-n,i,s.wnext);n-=i;if(n){a.arraySet(s.window,r,t-n,n,0);s.wnext=n;s.whave=s.wsize}else{s.wnext+=i;if(s.wnext===s.wsize){s.wnext=0}if(s.whave>>8&255;t.check=i(t.check,Be,2,0);le=0;fe=0;t.mode=_;break}t.flags=0;if(t.head){t.head.done=false}if(!(t.wrap&1)||(((le&255)<<8)+(le>>8))%31){e.msg="incorrect header check";t.mode=Q;break}if((le&15)!==w){e.msg="unknown compression method";t.mode=Q;break}le>>>=4;fe-=4;_e=(le&15)+8;if(t.wbits===0){t.wbits=_e}else if(_e>t.wbits){e.msg="invalid window size";t.mode=Q;break}t.dmax=1<<_e;e.adler=t.check=1;t.mode=le&512?R:F;le=0;fe=0;break;case _:while(fe<16){if(ie===0){break e}ie--;le+=ee[te++]<>8&1}if(t.flags&512){Be[0]=le&255;Be[1]=le>>>8&255;t.check=i(t.check,Be,2,0)}le=0;fe=0;t.mode=C;case C:while(fe<32){if(ie===0){break e}ie--;le+=ee[te++]<>>8&255;Be[2]=le>>>16&255;Be[3]=le>>>24&255;t.check=i(t.check,Be,4,0)}le=0;fe=0;t.mode=B;case B:while(fe<16){if(ie===0){break e}ie--;le+=ee[te++]<>8}if(t.flags&512){Be[0]=le&255;Be[1]=le>>>8&255;t.check=i(t.check,Be,2,0)}le=0;fe=0;t.mode=T;case T:if(t.flags&1024){while(fe<16){if(ie===0){break e}ie--;le+=ee[te++]<>>8&255;t.check=i(t.check,Be,2,0)}le=0;fe=0}else if(t.head){t.head.extra=null}t.mode=x;case x:if(t.flags&1024){ue=t.length;if(ue>ie){ue=ie}if(ue){if(t.head){_e=t.head.extra_len-t.length;if(!t.head.extra){t.head.extra=new Array(t.head.extra_len)}a.arraySet(t.head.extra,ee,te,ue,_e)}if(t.flags&512){t.check=i(t.check,ee,ue,te)}ie-=ue;te+=ue;t.length-=ue}if(t.length){break e}}t.length=0;t.mode=y;case y:if(t.flags&2048){if(ie===0){break e}ue=0;do{_e=ee[te+ue++];if(t.head&&_e&&t.length<65536){t.head.name+=String.fromCharCode(_e)}}while(_e&&ue>9&1;t.head.done=true}e.adler=t.check=0;t.mode=F;break;case R:while(fe<32){if(ie===0){break e}ie--;le+=ee[te++]<>>=fe&7;fe-=fe&7;t.mode=Y;break}while(fe<3){if(ie===0){break e}ie--;le+=ee[te++]<>>=1;fe-=1;switch(le&3){case 0:t.mode=P;break;case 1:ve(t);t.mode=W;if(r===d){le>>>=2;fe-=2;break e}break;case 2:t.mode=M;break;case 3:e.msg="invalid block type";t.mode=Q;}le>>>=2;fe-=2;break;case P: -le>>>=fe&7;fe-=fe&7;while(fe<32){if(ie===0){break e}ie--;le+=ee[te++]<>>16^65535)){e.msg="invalid stored block lengths";t.mode=Q;break}t.length=le&65535;le=0;fe=0;t.mode=N;if(r===d){break e};case N:t.mode=L;case L:ue=t.length;if(ue){if(ue>ie){ue=ie}if(ue>se){ue=se}if(ue===0){break e}a.arraySet(re,ee,te,ue,ae);ie-=ue;te+=ue;se-=ue;ae+=ue;t.length-=ue;break}t.mode=F;break;case M:while(fe<14){if(ie===0){break e}ie--;le+=ee[te++]<>>=5;fe-=5;t.ndist=(le&31)+1;le>>>=5;fe-=5;t.ncode=(le&15)+4;le>>>=4;fe-=4;if(t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols";t.mode=Q;break}t.have=0;t.mode=U;case U:while(t.have>>=3;fe-=3}while(t.have<19){t.lens[ye[t.have++]]=0}t.lencode=t.lendyn;t.lenbits=7;Te={bits:t.lenbits};Ce=l(f,t.lens,0,19,t.lencode,0,t.work,Te);t.lenbits=Te.bits;if(Ce){e.msg="invalid code lengths set";t.mode=Q;break}t.have=0;t.mode=H;case H:while(t.have>>24;ge=me>>>16&255;Ee=me&65535;if(be<=fe){break}if(ie===0){break e}ie--;le+=ee[te++]<>>=be;fe-=be;t.lens[t.have++]=Ee}else{if(Ee===16){xe=be+2;while(fe>>=be;fe-=be;if(t.have===0){e.msg="invalid bit length repeat";t.mode=Q;break}_e=t.lens[t.have-1];ue=3+(le&3);le>>>=2;fe-=2}else if(Ee===17){xe=be+3;while(fe>>=be;fe-=be;_e=0;ue=3+(le&7);le>>>=3;fe-=3}else{xe=be+7;while(fe>>=be;fe-=be;_e=0;ue=11+(le&127);le>>>=7;fe-=7}if(t.have+ue>t.nlen+t.ndist){e.msg="invalid bit length repeat";t.mode=Q;break}while(ue--){t.lens[t.have++]=_e}}}if(t.mode===Q){break}if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block";t.mode=Q;break}t.lenbits=9;Te={bits:t.lenbits};Ce=l(o,t.lens,0,t.nlen,t.lencode,0,t.work,Te);t.lenbits=Te.bits;if(Ce){e.msg="invalid literal/lengths set";t.mode=Q;break}t.distbits=6;t.distcode=t.distdyn;Te={bits:t.distbits};Ce=l(c,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,Te);t.distbits=Te.bits;if(Ce){e.msg="invalid distances set";t.mode=Q;break}t.mode=W;if(r===d){break e};case W:t.mode=V;case V:if(ie>=6&&se>=258){e.next_out=ae;e.avail_out=se;e.next_in=te;e.avail_in=ie;t.hold=le;t.bits=fe;s(e,ce);ae=e.next_out;re=e.output;se=e.avail_out;te=e.next_in;ee=e.input;ie=e.avail_in;le=t.hold;fe=t.bits;if(t.mode===F){t.back=-1}break}t.back=0;for(;;){me=t.lencode[le&(1<>>24;ge=me>>>16&255;Ee=me&65535;if(be<=fe){break}if(ie===0){break e}ie--;le+=ee[te++]<>ke)];be=me>>>24;ge=me>>>16&255;Ee=me&65535;if(ke+be<=fe){break}if(ie===0){break e}ie--;le+=ee[te++]<>>=ke;fe-=ke;t.back+=ke}le>>>=be;fe-=be;t.back+=be;t.length=Ee;if(ge===0){t.mode=K;break}if(ge&32){t.back=-1;t.mode=F;break}if(ge&64){e.msg="invalid literal/length code";t.mode=Q;break}t.extra=ge&15;t.mode=z;case z:if(t.extra){xe=t.extra;while(fe>>=t.extra;fe-=t.extra;t.back+=t.extra}t.was=t.length;t.mode=X;case X:for(;;){me=t.distcode[le&(1<>>24;ge=me>>>16&255;Ee=me&65535;if(be<=fe){break}if(ie===0){break e}ie--;le+=ee[te++]<>ke)];be=me>>>24;ge=me>>>16&255;Ee=me&65535;if(ke+be<=fe){break}if(ie===0){break e}ie--;le+=ee[te++]<>>=ke;fe-=ke;t.back+=ke}le>>>=be;fe-=be;t.back+=be;if(ge&64){e.msg="invalid distance code";t.mode=Q;break}t.offset=Ee;t.extra=ge&15;t.mode=G;case G:if(t.extra){xe=t.extra;while(fe>>=t.extra;fe-=t.extra;t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back";t.mode=Q;break}t.mode=j;case j:if(se===0){break e}ue=ce-se;if(t.offset>ue){ue=t.offset-ue;if(ue>t.whave){if(t.sane){e.msg="invalid distance too far back";t.mode=Q;break}}if(ue>t.wnext){ue-=t.wnext;he=t.wsize-ue}else{he=t.wnext-ue}if(ue>t.length){ue=t.length}de=t.window}else{de=re;he=ae-t.offset;ue=t.length}if(ue>se){ue=se}se-=ue;t.length-=ue;do{re[ae++]=de[he++]}while(--ue);if(t.length===0){t.mode=V}break;case K:if(se===0){break e}re[ae++]=t.length;se--;t.mode=V;break;case Y:if(t.wrap){while(fe<32){if(ie===0){break e}ie--;le|=ee[te++]<=1;C--){if(U[C]!==0){break}}if(B>C){B=C}if(C===0){m[b++]=1<<24|64<<16|0;m[b++]=1<<24|64<<16|0;E.bits=1;return 0}for(_=1;_0&&(e===l||C!==1)){return-1}H[1]=0;for(w=1;wi||e===o&&A>s){return 1}var j=0;for(;;){j++;z=w-x;if(g[S]M){X=W[V+g[S]];G=N[L+g[S]]}else{X=32+64;G=0}R=1<>x)+D]=z<<24|X<<16|G|0}while(D!==0);R=1<>=1}if(R!==0){I&=R-1;I+=R}else{I=0}S++;if(--U[w]===0){if(w===C){break}w=r[t+g[S]]}if(w>B&&(I&O)!==F){if(x===0){x=B}P+=_;T=w-x;y=1<i||e===o&&A>s){return 1}F=I&O;m[F]=B<<24|T<<16|P-b|0}}if(I!==0){m[P+I]=w-x<<24|64<<16|0}E.bits=B;return 0}},{"../utils/common":27}],37:[function(e,r,t){"use strict";r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],38:[function(e,r,t){"use strict";var a=e("../utils/common");var n=4;var i=0;var s=1;var l=2;function f(e){var r=e.length;while(--r>=0){e[r]=0}}var o=0;var c=1;var u=2;var h=3;var d=258;var v=29;var p=256;var m=p+1+v;var b=30;var g=19;var E=2*m+1;var k=15;var w=16;var S=7;var _=256;var C=16;var B=17;var T=18;var x=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var y=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var R=512;var D=new Array((m+2)*2);f(D);var F=new Array(b*2);f(F);var O=new Array(R);f(O);var P=new Array(d-h+1);f(P);var N=new Array(v);f(N);var L=new Array(b);f(L);var M=function(e,r,t,a,n){this.static_tree=e;this.extra_bits=r;this.extra_base=t;this.elems=a;this.max_length=n;this.has_stree=e&&e.length};var U;var H;var W;var V=function(e,r){this.dyn_tree=e;this.max_code=0;this.stat_desc=r};function z(e){return e<256?O[e]:O[256+(e>>>7)]}function X(e,r){e.pending_buf[e.pending++]=r&255;e.pending_buf[e.pending++]=r>>>8&255}function G(e,r,t){if(e.bi_valid>w-t){e.bi_buf|=r<>w-e.bi_valid;e.bi_valid+=t-w}else{e.bi_buf|=r<>>=1;t<<=1}while(--r>0);return t>>>1}function Y(e){if(e.bi_valid===16){X(e,e.bi_buf);e.bi_buf=0;e.bi_valid=0}else if(e.bi_valid>=8){e.pending_buf[e.pending++]=e.bi_buf&255;e.bi_buf>>=8;e.bi_valid-=8}}function $(e,r){var t=r.dyn_tree;var a=r.max_code;var n=r.stat_desc.static_tree;var i=r.stat_desc.has_stree;var s=r.stat_desc.extra_bits;var l=r.stat_desc.extra_base;var f=r.stat_desc.max_length;var o;var c,u;var h;var d;var v;var p=0;for(h=0;h<=k;h++){e.bl_count[h]=0}t[e.heap[e.heap_max]*2+1]=0;for(o=e.heap_max+1;of){h=f;p++}t[c*2+1]=h;if(c>a){continue}e.bl_count[h]++;d=0;if(c>=l){d=s[c-l]}v=t[c*2];e.opt_len+=v*(h+d);if(i){e.static_len+=v*(n[c*2+1]+d)}}if(p===0){return}do{h=f-1;while(e.bl_count[h]===0){h--}e.bl_count[h]--;e.bl_count[h+1]+=2;e.bl_count[f]--;p-=2}while(p>0);for(h=f;h!==0;h--){c=e.bl_count[h];while(c!==0){u=e.heap[--o];if(u>a){continue}if(t[u*2+1]!==h){e.opt_len+=(h-t[u*2+1])*t[u*2];t[u*2+1]=h}c--}}}function Z(e,r,t){var a=new Array(k+1);var n=0;var i;var s;for(i=1;i<=k;i++){a[i]=n=n+t[i-1]<<1}for(s=0;s<=r;s++){var l=e[s*2+1];if(l===0){continue}e[s*2]=K(a[l]++,l)}}function Q(){var e;var r;var t;var a;var n;var i=new Array(k+1);t=0;for(a=0;a>=7;for(;a8){X(e,e.bi_buf)}else if(e.bi_valid>0){e.pending_buf[e.pending++]=e.bi_buf}e.bi_buf=0;e.bi_valid=0}function ee(e,r,t,n){q(e);if(n){X(e,t);X(e,~t)}a.arraySet(e.pending_buf,e.window,r,t,e.pending);e.pending+=t}function re(e,r,t,a){var n=r*2;var i=t*2;return e[n]>1;s>=1;s--){te(e,t,s)}o=i;do{s=e.heap[1];e.heap[1]=e.heap[e.heap_len--];te(e,t,1);l=e.heap[1];e.heap[--e.heap_max]=s;e.heap[--e.heap_max]=l;t[o*2]=t[s*2]+t[l*2];e.depth[o]=(e.depth[s]>=e.depth[l]?e.depth[s]:e.depth[l])+1;t[s*2+1]=t[l*2+1]=o;e.heap[1]=o++;te(e,t,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1];$(e,r);Z(t,f,e.bl_count)}function ie(e,r,t){var a;var n=-1;var i;var s=r[0*2+1];var l=0;var f=7;var o=4;if(s===0){f=138;o=3}r[(t+1)*2+1]=65535;for(a=0;a<=t;a++){i=s;s=r[(a+1)*2+1];if(++l=3;r--){if(e.bl_tree[I[r]*2+1]!==0){break}}e.opt_len+=3*(r+1)+5+5+4;return r}function fe(e,r,t,a){var n;G(e,r-257,5);G(e,t-1,5);G(e,a-4,4);for(n=0;n>>=1){if(r&1&&e.dyn_ltree[t*2]!==0){return i}}if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0){return s}for(t=32;t0){if(e.strm.data_type===l){e.strm.data_type=oe(e)}ne(e,e.l_desc);ne(e,e.d_desc);f=le(e);i=e.opt_len+3+7>>>3;s=e.static_len+3+7>>>3;if(s<=i){i=s}}else{i=s=t+5}if(t+4<=i&&r!==-1){he(e,r,t,a)}else if(e.strategy===n||s===i){G(e,(c<<1)+(a?1:0),3);ae(e,D,F)}else{G(e,(u<<1)+(a?1:0),3);fe(e,e.l_desc.max_code+1,e.d_desc.max_code+1,f+1);ae(e,e.dyn_ltree,e.dyn_dtree)}J(e);if(a){q(e)}}function pe(e,r,t){e.pending_buf[e.d_buf+e.last_lit*2]=r>>>8&255;e.pending_buf[e.d_buf+e.last_lit*2+1]=r&255;e.pending_buf[e.l_buf+e.last_lit]=t&255;e.last_lit++;if(r===0){e.dyn_ltree[t*2]++}else{e.matches++;r--;e.dyn_ltree[(P[t]+p+1)*2]++;e.dyn_dtree[z(r)*2]++}return e.last_lit===e.lit_bufsize-1}t._tr_init=ue;t._tr_stored_block=he;t._tr_flush_block=ve;t._tr_tally=pe;t._tr_align=de},{"../utils/common":27}],39:[function(e,r,t){"use strict";function a(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}r.exports=a},{}]},{},[9])(9)});var XLSX={};(function e(r){r.version="0.12.5";var t=1200,a=1252;if(typeof module!=="undefined"&&typeof require!=="undefined"){if(typeof cptable==="undefined")global.cptable=undefined}var n=[874,932,936,949,950];for(var i=0;i<=8;++i)n.push(1250+i);var s={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969};var l=function(e){if(n.indexOf(e)==-1)return;a=s[0]=e};function f(){l(1252)}var o=function(e){t=e;l(e)};function c(){o(1200);f()}function u(e){var r=[];for(var t=0,a=e.length;t>1;++t)r[t]=String.fromCharCode(e.charCodeAt(2*t)+(e.charCodeAt(2*t+1)<<8));return r.join("")}function d(e){var r=[];for(var t=0;t>1;++t)r[t]=String.fromCharCode(e.charCodeAt(2*t+1)+(e.charCodeAt(2*t)<<8));return r.join("")}var v=function(e){var r=e.charCodeAt(0),t=e.charCodeAt(1);if(r==255&&t==254)return h(e.slice(2));if(r==254&&t==255)return d(e.slice(2));if(r==65279)return e.slice(1);return e};var p=function Em(e){return String.fromCharCode(e)};if(typeof cptable!=="undefined"){o=function(e){t=e};v=function(e){if(e.charCodeAt(0)===255&&e.charCodeAt(1)===254){return cptable.utils.decode(1200,u(e.slice(2)))}return e};p=function km(e){if(t===1200)return String.fromCharCode(e);return cptable.utils.decode(t,[e&255,e>>8])[0]}}var m=null;var b=true;var g=function wm(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(r){var t="";var a=0,n=0,i=0,s=0,l=0,f=0,o=0;for(var c=0;c>2;n=r.charCodeAt(c++);l=(a&3)<<4|n>>4;i=r.charCodeAt(c++);f=(n&15)<<2|i>>6;o=i&63;if(isNaN(n)){f=o=64}else if(isNaN(i)){o=64}t+=e.charAt(s)+e.charAt(l)+e.charAt(f)+e.charAt(o)}return t},decode:function r(t){var a="";var n=0,i=0,s=0,l=0,f=0,o=0,c=0;t=t.replace(/[^\w\+\/\=]/g,"");for(var u=0;u>4;a+=String.fromCharCode(n);o=e.indexOf(t.charAt(u++));i=(f&15)<<4|o>>2;if(o!==64){a+=String.fromCharCode(i)}c=e.indexOf(t.charAt(u++));s=(o&3)<<6|c;if(c!==64){a+=String.fromCharCode(s)}}return a}}}();var E=typeof Buffer!=="undefined"&&typeof process!=="undefined"&&typeof process.versions!=="undefined"&&process.versions.node;function k(e){return new(E?Buffer:Array)(e)}function w(e){if(E)return new Buffer(e,"binary");return e.split("").map(function(e){return e.charCodeAt(0)&255})}function S(e){if(typeof ArrayBuffer==="undefined")return w(e);var r=new ArrayBuffer(e.length),t=new Uint8Array(r);for(var a=0;a!=e.length;++a)t[a]=e.charCodeAt(a)&255;return r}function _(e){if(Array.isArray(e))return e.map(vv).join("");var r=[];for(var t=0;t=0)r+=e.charAt(t--);return r}function t(e,r){var t="";while(t.length=r?a:t("0",r-a.length)+a}function n(e,r){var a=""+e;return a.length>=r?a:t(" ",r-a.length)+a}function i(e,r){var a=""+e;return a.length>=r?a:a+t(" ",r-a.length)}function s(e,r){var a=""+Math.round(e);return a.length>=r?a:t("0",r-a.length)+a}function l(e,r){var a=""+e;return a.length>=r?a:t("0",r-a.length)+a}var f=Math.pow(2,32);function o(e,r){if(e>f||e<-f)return s(e,r);var t=Math.round(e);return l(t,r)}function c(e,r){r=r||0;return e.length>=7+r&&(e.charCodeAt(r)|32)===103&&(e.charCodeAt(r+1)|32)===101&&(e.charCodeAt(r+2)|32)===110&&(e.charCodeAt(r+3)|32)===101&&(e.charCodeAt(r+4)|32)===114&&(e.charCodeAt(r+5)|32)===97&&(e.charCodeAt(r+6)|32)===108}var u=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]];var h=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function d(e){e[0]="General";e[1]="0";e[2]="0.00";e[3]="#,##0";e[4]="#,##0.00";e[9]="0%";e[10]="0.00%";e[11]="0.00E+00";e[12]="# ?/?";e[13]="# ??/??";e[14]="m/d/yy";e[15]="d-mmm-yy";e[16]="d-mmm";e[17]="mmm-yy";e[18]="h:mm AM/PM";e[19]="h:mm:ss AM/PM";e[20]="h:mm";e[21]="h:mm:ss";e[22]="m/d/yy h:mm";e[37]="#,##0 ;(#,##0)";e[38]="#,##0 ;[Red](#,##0)";e[39]="#,##0.00;(#,##0.00)";e[40]="#,##0.00;[Red](#,##0.00)";e[45]="mm:ss";e[46]="[h]:mm:ss";e[47]="mmss.0";e[48]="##0.0E+0";e[49]="@";e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "';e[65535]="General"}var v={};d(v);function p(e,r,t){var a=e<0?-1:1;var n=e*a;var i=0,s=1,l=0;var f=1,o=0,c=0;var u=Math.floor(n);while(or){if(o>r){c=f;l=i}else{c=o;l=s}}if(!t)return[0,a*l,c];var h=Math.floor(a*l/c);return[h,a*l-h*c,c]}function m(e,r,t){if(e>2958465||e<0)return null;var a=e|0,n=Math.floor(86400*(e-a)),i=0;var s=[];var l={D:a,T:n,u:86400*(e-a)-n,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(l.u)<1e-6)l.u=0;if(r&&r.date1904)a+=1462;if(l.u>.9999){l.u=0;if(++n==86400){l.T=n=0;++a;++l.D}}if(a===60){s=t?[1317,10,29]:[1900,2,29];i=3}else if(a===0){s=t?[1317,8,29]:[1900,1,0];i=6}else{if(a>60)--a;var f=new Date(1900,0,1);f.setDate(f.getDate()+a-1);s=[f.getFullYear(),f.getMonth()+1,f.getDate()];i=f.getDay();if(a<60)i=(i+6)%7;if(t)i=C(f,s)}l.y=s[0];l.m=s[1];l.d=s[2];l.S=n%60;n=Math.floor(n/60);l.M=n%60;n=Math.floor(n/60);l.H=n;l.q=i;return l}e.parse_date_code=m;var b=new Date(1899,11,31,0,0,0);var g=b.getTime();var E=new Date(1900,2,1,0,0,0);function k(e,r){var t=e.getTime();if(r)t-=1461*24*60*60*1e3;else if(e>=E)t+=24*60*60*1e3;return(t-(g+(e.getTimezoneOffset()-b.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function w(e){return e.toString(10)}e._general_int=w;var S=function M(){var e=/\.(\d*[1-9])0+$/,r=/\.0*$/,t=/\.(\d*[1-9])0+/,a=/\.0*[Ee]/,n=/(E[+-])(\d)$/;function i(e){var r=e<0?12:11;var t=f(e.toFixed(12));if(t.length<=r)return t;t=e.toPrecision(10);if(t.length<=r)return t;return e.toExponential(5)}function s(r){var t=r.toFixed(11).replace(e,".$1");if(t.length>(r<0?12:11))t=r.toPrecision(6);return t}function l(e){for(var r=0;r!=e.length;++r)if((e.charCodeAt(r)|32)===101)return e.replace(t,".$1").replace(a,"E").replace("e","E").replace(n,"$10$2");return e}function f(t){return t.indexOf(".")>-1?t.replace(r,"").replace(e,".$1"):t}return function o(e){var r=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),t;if(r>=-4&&r<=-1)t=e.toPrecision(10+r);else if(Math.abs(r)<=9)t=i(e);else if(r===10)t=e.toFixed(10).substr(0,12);else t=s(e);return f(l(t))}}();e._general_num=S;function _(e,r){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?w(e):S(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return N(14,k(e,r&&r.date1904),r);}throw new Error("unsupported value in General format: "+e)}e._general=_;function C(){return 0}function B(e,r,t,n){var i="",s=0,l=0,f=t.y,o,c=0;switch(e){case 98:f=t.y+543;case 121:switch(r.length){case 1:;case 2:o=f%100;c=2;break;default:o=f%1e4;c=4;break;}break;case 109:switch(r.length){case 1:;case 2:o=t.m;c=r.length;break;case 3:return h[t.m-1][1];case 5:return h[t.m-1][0];default:return h[t.m-1][2];}break;case 100:switch(r.length){case 1:;case 2:o=t.d;c=r.length;break;case 3:return u[t.q][0];default:return u[t.q][1];}break;case 104:switch(r.length){case 1:;case 2:o=1+(t.H+11)%12;c=r.length;break;default:throw"bad hour format: "+r;}break;case 72:switch(r.length){case 1:;case 2:o=t.H;c=r.length;break;default:throw"bad hour format: "+r;}break;case 77:switch(r.length){case 1:;case 2:o=t.M;c=r.length;break;default:throw"bad minute format: "+r;}break;case 115:if(r!="s"&&r!="ss"&&r!=".0"&&r!=".00"&&r!=".000")throw"bad second format: "+r;if(t.u===0&&(r=="s"||r=="ss"))return a(t.S,r.length);if(n>=2)l=n===3?1e3:100;else l=n===1?10:1;s=Math.round(l*(t.S+t.u));if(s>=60*l)s=0;if(r==="s")return s===0?"0":""+s/l;i=a(s,2+n);if(r==="ss")return i.substr(0,2);return"."+i.substr(2,r.length-1);case 90:switch(r){case"[h]":;case"[hh]":o=t.D*24+t.H;break;case"[m]":;case"[mm]":o=(t.D*24+t.H)*60+t.M;break;case"[s]":;case"[ss]":o=((t.D*24+t.H)*60+t.M)*60+Math.round(t.S+t.u);break;default:throw"bad abstime format: "+r;}c=r.length===3?1:2;break;case 101:o=f;c=1;}if(c>0)return a(o,c);else return""}function T(e){var r=3;if(e.length<=r)return e;var t=e.length%r,a=e.substr(0,t);for(;t!=e.length;t+=r)a+=(a.length>0?",":"")+e.substr(t,r);return a}var x=function U(){var e=/%/g;function s(r,a,n){var i=a.replace(e,""),s=a.length-i.length;return x(r,i,n*Math.pow(10,2*s))+t("%",s)}function l(e,r,t){var a=r.length-1;while(r.charCodeAt(a-1)===44)--a;return x(e,r.substr(0,a),t/Math.pow(10,3*(r.length-a)))}function f(e,r){var t;var a=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(r==0)return"0.0E+0";else if(r<0)return"-"+f(e,-r);var n=e.indexOf(".");if(n===-1)n=e.indexOf("E");var i=Math.floor(Math.log(r)*Math.LOG10E)%n;if(i<0)i+=n;t=(r/Math.pow(10,i)).toPrecision(a+1+(n+i)%n);if(t.indexOf("e")===-1){var s=Math.floor(Math.log(r)*Math.LOG10E);if(t.indexOf(".")===-1)t=t.charAt(0)+"."+t.substr(1)+"E+"+(s-t.length+i);else t+="E+"+(s-i);while(t.substr(0,2)==="0."){t=t.charAt(0)+t.substr(2,n)+"."+t.substr(2+n);t=t.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.")}t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(e,r,t,a){return r+t+a.substr(0,(n+i)%n)+"."+a.substr(i)+"E"})}else t=r.toExponential(a);if(e.match(/E\+00$/)&&t.match(/e[+-]\d$/))t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1);if(e.match(/E\-/)&&t.match(/e\+/))t=t.replace(/e\+/,"e");return t.replace("e","E")}var c=/# (\?+)( ?)\/( ?)(\d+)/;function u(e,r,i){var s=parseInt(e[4],10),l=Math.round(r*s),f=Math.floor(l/s);var o=l-f*s,c=s;return i+(f===0?"":""+f)+" "+(o===0?t(" ",e[1].length+1+e[4].length):n(o,e[1].length)+e[2]+"/"+e[3]+a(c,e[4].length))}function h(e,r,a){return a+(r===0?"":""+r)+t(" ",e[1].length+2+e[4].length)}var d=/^#*0*\.([0#]+)/;var v=/\).*[0#]/;var m=/\(###\) ###\\?-####/;function b(e){var r="",t;for(var a=0;a!=e.length;++a)switch(t=e.charCodeAt(a)){case 35:break;case 63:r+=" ";break;case 48:r+="0";break;default:r+=String.fromCharCode(t);}return r}function g(e,r){var t=Math.pow(10,r);return""+Math.round(e*t)/t}function E(e,r){if(r<(""+Math.round((e-Math.floor(e))*Math.pow(10,r))).length){return 0}return Math.round((e-Math.floor(e))*Math.pow(10,r))}function k(e,r){if(r<(""+Math.round((e-Math.floor(e))*Math.pow(10,r))).length){return 1}return 0}function w(e){if(e<2147483647&&e>-2147483648)return""+(e>=0?e|0:e-1|0);return""+Math.floor(e)}function S(e,h,_){if(e.charCodeAt(0)===40&&!h.match(v)){var C=h.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");if(_>=0)return S("n",C,_);return"("+S("n",C,-_)+")"}if(h.charCodeAt(h.length-1)===44)return l(e,h,_);if(h.indexOf("%")!==-1)return s(e,h,_);if(h.indexOf("E")!==-1)return f(h,_);if(h.charCodeAt(0)===36)return"$"+S(e,h.substr(h.charAt(1)==" "?2:1),_);var B;var y,A,I,R=Math.abs(_),D=_<0?"-":"";if(h.match(/^00+$/))return D+o(R,h.length);if(h.match(/^[#?]+$/)){B=o(_,0);if(B==="0")B="";return B.length>h.length?B:b(h.substr(0,h.length-B.length))+B}if(y=h.match(c))return u(y,R,D);if(h.match(/^#+0+$/))return D+o(R,h.length-h.indexOf("0"));if(y=h.match(d)){B=g(_,y[1].length).replace(/^([^\.]+)$/,"$1."+b(y[1])).replace(/\.$/,"."+b(y[1])).replace(/\.(\d*)$/,function(e,r){return"."+r+t("0",b(y[1]).length-r.length)});return h.indexOf("0.")!==-1?B:B.replace(/^0\./,".")}h=h.replace(/^#+([0.])/,"$1");if(y=h.match(/^(0*)\.(#*)$/)){return D+g(R,y[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,y[1].length?"0.":".")}if(y=h.match(/^#{1,3},##0(\.?)$/))return D+T(o(R,0));if(y=h.match(/^#,##0\.([#0]*0)$/)){return _<0?"-"+S(e,h,-_):T(""+(Math.floor(_)+k(_,y[1].length)))+"."+a(E(_,y[1].length),y[1].length)}if(y=h.match(/^#,#*,#0/))return S(e,h.replace(/^#,#*,/,""),_);if(y=h.match(/^([0#]+)(\\?-([0#]+))+$/)){B=r(S(e,h.replace(/[\\-]/g,""),_));A=0;return r(r(h.replace(/\\/g,"")).replace(/[0#]/g,function(e){return A=0)return y("n",f,l);return"("+y("n",f,-l)+")"}if(s.charCodeAt(s.length-1)===44)return _(e,s,l);if(s.indexOf("%")!==-1)return C(e,s,l);if(s.indexOf("E")!==-1)return B(s,l);if(s.charCodeAt(0)===36)return"$"+y(e,s.substr(s.charAt(1)==" "?2:1),l);var o;var u,g,E,k=Math.abs(l),w=l<0?"-":"";if(s.match(/^00+$/))return w+a(k,s.length);if(s.match(/^[#?]+$/)){o=""+l;if(l===0)o="";return o.length>s.length?o:b(s.substr(0,s.length-o.length))+o}if(u=s.match(c))return h(u,k,w);if(s.match(/^#+0+$/))return w+a(k,s.length-s.indexOf("0"));if(u=s.match(d)){o=(""+l).replace(/^([^\.]+)$/,"$1."+b(u[1])).replace(/\.$/,"."+b(u[1]));o=o.replace(/\.(\d*)$/,function(e,r){return"."+r+t("0",b(u[1]).length-r.length)});return s.indexOf("0.")!==-1?o:o.replace(/^0\./,".")}s=s.replace(/^#+([0.])/,"$1");if(u=s.match(/^(0*)\.(#*)$/)){return w+(""+k).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,u[1].length?"0.":".")}if(u=s.match(/^#{1,3},##0(\.?)$/))return w+T(""+k);if(u=s.match(/^#,##0\.([#0]*0)$/)){return l<0?"-"+y(e,s,-l):T(""+l)+"."+t("0",u[1].length); -}if(u=s.match(/^#,#*,#0/))return y(e,s.replace(/^#,#*,/,""),l);if(u=s.match(/^([0#]+)(\\?-([0#]+))+$/)){o=r(y(e,s.replace(/[\\-]/g,""),l));g=0;return r(r(s.replace(/\\/g,"")).replace(/[0#]/g,function(e){return g-1||t=="\\"&&e.charAt(r+1)=="-"&&"0#".indexOf(e.charAt(r+2))>-1)){}break;case"?":while(e.charAt(++r)===t){}break;case"*":++r;if(e.charAt(r)==" "||e.charAt(r)=="*")++r;break;case"(":;case")":++r;break;case"1":;case"2":;case"3":;case"4":;case"5":;case"6":;case"7":;case"8":;case"9":while(r-1){}break;case" ":++r;break;default:++r;break;}}return false}e.is_date=I;function R(e,r,t,a){var n=[],i="",s=0,l="",f="t",o,u,h;var d="H";while(s=12?"P":"A";b.t="T";d="h";s+=3}else if(e.substr(s,5).toUpperCase()==="AM/PM"){if(o!=null)b.v=o.H>=12?"PM":"AM";b.t="T";s+=5;d="h"}else{b.t="t";++s}if(o==null&&b.t==="T")return"";n[n.length]=b;f=l;break;case"[":i=l;while(e.charAt(s++)!=="]"&&s-1){i=(i.match(/\$([^-\[\]]*)/)||[])[1]||"$";if(!I(e))n[n.length]={t:"t",v:i}}break;case".":if(o!=null){i=l;while(++s-1||l=="\\"&&e.charAt(s+1)=="-"&&s-1)i+=l;n[n.length]={t:"n",v:i};break;case"?":i=l;while(e.charAt(++s)===l)i+=l;n[n.length]={t:l,v:i};f=l;break;case"*":++s;if(e.charAt(s)==" "||e.charAt(s)=="*")++s;break;case"(":;case")":n[n.length]={t:a===1?"t":l,v:l};++s;break;case"1":;case"2":;case"3":;case"4":;case"5":;case"6":;case"7":;case"8":;case"9":i=l;while(s-1)i+=e.charAt(s);n[n.length]={t:"D",v:i};break;case" ":n[n.length]={t:l,v:l};++s;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(l)===-1)throw new Error("unrecognized character "+l+" in "+e);n[n.length]={t:"t",v:l};++s;break;}}var g=0,E=0,k;for(s=n.length-1,f="t";s>=0;--s){switch(n[s].t){case"h":;case"H":n[s].t=d;f="h";if(g<1)g=1;break;case"s":if(k=n[s].v.match(/\.0+$/))E=Math.max(E,k[0].length-1);if(g<3)g=3;case"d":;case"y":;case"M":;case"e":f=n[s].t;break;case"m":if(f==="s"){n[s].t="M";if(g<2)g=2}break;case"X":break;case"Z":if(g<1&&n[s].v.match(/[Hh]/))g=1;if(g<2&&n[s].v.match(/[Mm]/))g=2;if(g<3&&n[s].v.match(/[Ss]/))g=3;}}switch(g){case 0:break;case 1:if(o.u>=.5){o.u=0;++o.S}if(o.S>=60){o.S=0;++o.M}if(o.M>=60){o.M=0;++o.H}break;case 2:if(o.u>=.5){o.u=0;++o.S}if(o.S>=60){o.S=0;++o.M}break;}var w="",S;for(s=0;s0){if(w.charCodeAt(0)==40){T=r<0&&w.charCodeAt(0)===45?-r:r;y=x("(",w,T)}else{T=r<0&&a>1?-r:r;y=x("n",w,T);if(T<0&&n[0]&&n[0].t=="t"){y=y.substr(1);n[0].v="-"+n[0].v}}S=y.length-1;var R=n.length;for(s=0;s-1){R=s;break}var D=n.length;if(R===n.length&&y.indexOf("E")===-1){for(s=n.length-1;s>=0;--s){if(n[s]==null||"n?(".indexOf(n[s].t)===-1)continue;if(S>=n[s].v.length-1){S-=n[s].v.length;n[s].v=y.substr(S+1,n[s].v.length)}else if(S<0)n[s].v="";else{n[s].v=y.substr(0,S+1);S=-1}n[s].t="t";D=s}if(S>=0&&D=0;--s){if(n[s]==null||"n?(".indexOf(n[s].t)===-1)continue;u=n[s].v.indexOf(".")>-1&&s===R?n[s].v.indexOf(".")-1:n[s].v.length-1;C=n[s].v.substr(u+1);for(;u>=0;--u){if(S>=0&&(n[s].v.charAt(u)==="0"||n[s].v.charAt(u)==="#"))C=y.charAt(S--)+C}n[s].v=C;n[s].t="t";D=s}if(S>=0&&D-1&&s===R?n[s].v.indexOf(".")+1:0;C=n[s].v.substr(0,u);for(;u-1){T=a>1&&r<0&&s>0&&n[s-1].v==="-"?-r:r;n[s].v=x(n[s].t,n[s].v,T);n[s].t="t"}var F="";for(s=0;s!==n.length;++s)if(n[s]!=null)F+=n[s].v;return F}e._eval=R;var D=/\[[=<>]/;var F=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function O(e,r){if(r==null)return false;var t=parseFloat(r[2]);switch(r[1]){case"=":if(e==t)return true;break;case">":if(e>t)return true;break;case"<":if(e":if(e!=t)return true;break;case">=":if(e>=t)return true;break;case"<=":if(e<=t)return true;break;}return false}function P(e,r){var t=y(e);var a=t.length,n=t[a-1].indexOf("@");if(a<4&&n>-1)--a;if(t.length>4)throw new Error("cannot find right format for |"+t.join("|")+"|");if(typeof r!=="number")return[4,t.length===4||n>-1?t[t.length-1]:"@"];switch(t.length){case 1:t=n>-1?["General","General","General",t[0]]:[t[0],t[0],t[0],"@"];break;case 2:t=n>-1?[t[0],t[0],t[0],t[1]]:[t[0],t[1],t[0],"@"];break;case 3:t=n>-1?[t[0],t[1],t[0],t[2]]:[t[0],t[1],t[2],"@"];break;case 4:break;}var i=r>0?t[0]:r<0?t[1]:t[2];if(t[0].indexOf("[")===-1&&t[1].indexOf("[")===-1)return[a,i];if(t[0].match(D)!=null||t[1].match(D)!=null){var s=t[0].match(F);var l=t[1].match(F);return O(r,s)?[a,t[0]]:O(r,l)?[a,t[1]]:[a,t[s!=null&&l!=null?2:1]]}return[a,i]}function N(e,r,t){if(t==null)t={};var a="";switch(typeof e){case"string":if(e=="m/d/yy"&&t.dateNF)a=t.dateNF;else a=e;break;case"number":if(e==14&&t.dateNF)a=t.dateNF;else a=(t.table!=null?t.table:v)[e];break;}if(c(a,0))return _(r,t);if(r instanceof Date)r=k(r,t.date1904);var n=P(a,r);if(c(n[1]))return _(r,t);if(r===true)r="TRUE";else if(r===false)r="FALSE";else if(r===""||r==null)return"";return R(n[1],r,t,n[0])}function L(e,r){if(typeof r!="number"){r=+r||-1;for(var t=0;t<392;++t){if(v[t]==undefined){if(r<0)r=t;continue}if(v[t]==e){r=t;break}}if(r<0)r=391}v[r]=e;return r}e.load=L;e._table=v;e.get_table=function H(){return v};e.load_table=function W(e){for(var r=0;r!=392;++r)if(e[r]!==undefined)L(e[r],r)};e.init_table=d;e.format=N};I(A);var R={"General Number":"General","General Date":A._table[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":A._table[15],"Short Date":A._table[14],"Long Time":A._table[19],"Medium Time":A._table[18],"Short Time":A._table[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:A._table[2],Standard:A._table[4],Percent:A._table[10],Scientific:A._table[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var D={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"};var F=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function O(e){var r=typeof e=="number"?A._table[e]:e;r=r.replace(F,"(\\d+)");return new RegExp("^"+r+"$")}function P(e,r,t){var a=-1,n=-1,i=-1,s=-1,l=-1,f=-1;(r.match(F)||[]).forEach(function(e,r){var o=parseInt(t[r+1],10);switch(e.toLowerCase().charAt(0)){case"y":a=o;break;case"d":i=o;break;case"h":s=o;break;case"s":f=o;break;case"m":if(s>=0)l=o;else n=o;break;}});if(f>=0&&l==-1&&n>=0){l=n;n=-1}var o=(""+(a>=0?a:(new Date).getFullYear())).slice(-4)+"-"+("00"+(n>=1?n:1)).slice(-2)+"-"+("00"+(i>=1?i:1)).slice(-2);if(o.length==7)o="0"+o;if(o.length==8)o="20"+o;var c=("00"+(s>=0?s:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2)+":"+("00"+(f>=0?f:0)).slice(-2);if(s==-1&&l==-1&&f==-1)return o;if(a==-1&&n==-1&&i==-1)return c;return o+"T"+c}var N=true;var L=function _m(){var e={};e.version="1.0.5";function r(e,r){var t=e.split("/"),a=r.split("/");for(var n=0,i=0,s=Math.min(t.length,a.length);n0&&u!==I)C[u].name="!MiniFAT";C[m[0]].name="!FAT";C.fat_addrs=m;C.ssz=a;var B={},T=[],x=[],y=[];p(s,C,_,T,n,B,x,u);c(x,y,T);T.shift();var A={FileIndex:x,FullPaths:y};if(r&&r.raw)A.raw={header:E,sectors:_};return A}function l(e){e.chk(R,"Header Signature: ");e.chk(F,"CLSID: ");var r=e._R(2,"u");return[e._R(2,"u"),r]}function f(e,r){var t=9;e.l+=2;switch(t=e._R(2)){case 9:if(r!=3)throw new Error("Sector Shift: Expected 9 saw "+t);break;case 12:if(r!=4)throw new Error("Sector Shift: Expected 12 saw "+t);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+t);}e.chk("0600","Mini Sector Shift: ");e.chk("000000000000","Reserved: ")}function o(e,r){var t=Math.ceil(e.length/r)-1;var a=[];for(var n=1;n0&&s>=0){i.push(r.slice(s*A,s*A+A));n-=A;s=Dr(t,s*4)}if(i.length===0)return Vr(0);return T(i).slice(0,e.size)}function h(e,r,t,a,n){var i=I;if(e===I){if(r!==0)throw new Error("DIFAT chain shorter than expected")}else if(e!==-1){var s=t[e],l=(a>>>2)-1;if(!s)return;for(var f=0;f=0;){n[f]=true;i[i.length]=f;s.push(e[f]);var c=t[Math.floor(f*4/a)];o=f*4&l;if(a<4+o)throw new Error("FAT boundary crossed: "+f+" 4 "+a);if(!e[c])break;f=Dr(e[c],o)}return{nodes:i,data:lr([s])}}function v(e,r,t,a){var n=e.length,i=[];var s=[],l=[],f=[];var o=a-1,c=0,u=0,h=0,d=0;for(c=0;c=n)h-=n;if(s[h])continue;f=[];for(u=h;u>=0;){s[u]=true;l[l.length]=u;f.push(e[u]);var v=t[Math.floor(u*4/a)];d=u*4&o;if(a<4+d)throw new Error("FAT boundary crossed: "+u+" 4 "+a);if(!e[v])break;u=Dr(e[v],d)}i[h]={nodes:l,data:lr([f])}}return i}function p(e,r,t,a,n,i,s,l){var f=0,o=a.length?2:0;var c=r[e].data;var h=0,v=0,p;for(;h0&&f!==I)r[f].name="!StreamData"}else if(g.size>=4096){g.storage="fat";if(r[g.start]===undefined)r[g.start]=d(t,g.start,r.fat_addrs,r.ssz);r[g.start].name=g.name;g.content=r[g.start].data.slice(0,g.size)}else{g.storage="minifat";if(g.size<0)g.size=0;else if(f!==I&&g.start!==I&&r[f]){g.content=u(g,r[f].data,(r[l]||{}).data)}}if(g.content)Hr(g.content,0);i[p]=g;s.push(g)}}function m(e,r){return new Date((Rr(e,r+4)/1e7*Math.pow(2,32)+Rr(e,r)/1e7-11644473600)*1e3)}function b(e,r){i();return s(n.readFileSync(e),r)}function E(e,r){switch(r&&r.type||"base64"){case"file":return b(e,r);case"base64":return s(w(g.decode(e)),r);case"binary":return s(w(e),r);}return s(e,r)}function k(e,r){var t=r||{},a=t.root||"Root Entry";if(!e.FullPaths)e.FullPaths=[];if(!e.FileIndex)e.FileIndex=[];if(e.FullPaths.length!==e.FileIndex.length)throw new Error("inconsistent CFB structure");if(e.FullPaths.length===0){e.FullPaths[0]=a+"/";e.FileIndex[0]={name:a,type:5}}if(t.CLSID)e.FileIndex[0].clsid=t.CLSID;S(e)}function S(e){var r="Sh33tJ5";if(L.find(e,"/"+r))return;var t=Vr(4);t[0]=55;t[1]=t[3]=50;t[2]=54;e.FileIndex.push({name:r,type:2,content:t,size:4,L:69,R:69,C:69});e.FullPaths.push(e.FullPaths[0]+r);_(e)}function _(e,n){k(e);var i=false,s=false;for(var l=e.FullPaths.length-1;l>=0;--l){var f=e.FileIndex[l];switch(f.type){case 0:if(s)i=true;else{e.FileIndex.pop();e.FullPaths.pop()}break;case 1:;case 2:;case 5:s=true;if(isNaN(f.R*f.L*f.C))i=true;if(f.R>-1&&f.L>-1&&f.R==f.L)i=true;break;default:i=true;break;}}if(!i&&!n)return;var o=new Date(1987,1,19),c=0;var u=[];for(l=0;l1?1:-1;d.size=0;d.type=5}else if(v.slice(-1)=="/"){for(c=l+1;c=u.length?-1:c;for(c=l+1;c=u.length?-1:c;d.type=1}else{if(t(e.FullPaths[l+1]||"")==t(v))d.R=l+1;d.type=2}}}function C(e,r){var t=r||{};_(e);var a=function(e){var r=0,t=0;for(var a=0;a0){if(i<4096)r+=i+63>>6;else t+=i+511>>9}}var s=e.FullPaths.length+3>>2;var l=r+7>>3;var f=r+127>>7;var o=l+t+s+f;var c=o+127>>7;var u=c<=109?0:Math.ceil((c-109)/127);while(o+c+u+127>>7>c)u=++c<=109?0:Math.ceil((c-109)/127);var h=[1,u,c,f,s,t,r,0];e.FileIndex[0].size=r<<6;h[7]=(e.FileIndex[0].start=h[0]+h[1]+h[2]+h[3]+h[4]+h[5])+(h[6]+7>>3);return h}(e);var n=Vr(a[7]<<9);var i=0,s=0;{for(i=0;i<8;++i)n._W(1,D[i]);for(i=0;i<8;++i)n._W(2,0);n._W(2,62);n._W(2,3);n._W(2,65534);n._W(2,9);n._W(2,6);for(i=0;i<3;++i)n._W(2,0);n._W(4,0);n._W(4,a[2]);n._W(4,a[0]+a[1]+a[2]+a[3]-1);n._W(4,0);n._W(4,1<<12);n._W(4,a[3]?a[0]+a[1]+a[2]-1:I);n._W(4,a[3]);n._W(-4,a[1]?a[0]-1:I);n._W(4,a[1]);for(i=0;i<109;++i)n._W(-4,i>9)}l(a[6]+7>>3);while(n.l&511)n._W(-4,O.ENDOFCHAIN);s=i=0;for(f=0;f=4096)continue;c.start=s;l(o+63>>6)}while(n.l&511)n._W(-4,O.ENDOFCHAIN);for(i=0;i=4096){n.l=c.start+1<<9;for(f=0;f0&&c.size<4096){for(f=0;f3)a=true;switch(n[i].slice(n[i].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+n[i].slice(n[i].length-1));case"D":t*=24;case"H":t*=60;case"M":if(!a)throw new Error("Unsupported ISO Duration Field: M");else t*=60;case"S":break;}r+=t*parseInt(n[i],10)}return r}var ee=new Date("2017-02-19T19:06:09.000Z");if(isNaN(ee.getFullYear()))ee=new Date("2/19/17");var re=ee.getFullYear()==2017;function te(e,r){var t=new Date(e);if(re){if(r>0)t.setTime(t.getTime()+t.getTimezoneOffset()*60*1e3);else if(r<0)t.setTime(t.getTime()-t.getTimezoneOffset()*60*1e3);return t}if(e instanceof Date)return e;if(ee.getFullYear()==1917&&!isNaN(t.getFullYear())){var a=t.getFullYear();if(e.indexOf(""+a)>-1)return t;t.setFullYear(t.getFullYear()+100);return t}var n=e.match(/\d+/g)||["2017","2","19","0","0","0"];var i=new Date(+n[0],+n[1]-1,+n[2],+n[3]||0,+n[4]||0,+n[5]||0);if(e.indexOf("Z")>-1)i=new Date(i.getTime()-i.getTimezoneOffset()*60*1e3);return i}function ae(e){var r="";for(var t=0;t!=e.length;++t)r+=String.fromCharCode(e[t]);return r}function ne(e){if(typeof JSON!="undefined"&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if(typeof e!="object"||e==null)return e;if(e instanceof Date)return new Date(e.getTime());var r={};for(var t in e)if(e.hasOwnProperty(t))r[t]=ne(e[t]);return r}function ie(e,r){var t="";while(t.length8099)return t;if((n>0||i>1)&&a!=101)return r;if(e.toLowerCase().match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/))return r;if(e.match(/[^-0-9:,\/\\]/))return t;return r}var fe="abacaba".split(/(:?b)/i).length==5;function oe(e,r,t){if(fe||typeof r=="string")return e.split(r);var a=e.split(r),n=[a[0]];for(var i=1;i\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g;var Se=/<[\/\?]?[a-zA-Z0-9:]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s?[\/\?]?>/g;if(!ke.match(Se))Se=/<[^>]*>/g;var _e=/<\w*:/,Ce=/<(\/?)\w+:/;function Be(e,r){var t={};var a=0,n=0;for(;a!==e.length;++a)if((n=e.charCodeAt(a))===32||n===10||n===13)break;if(!r)t[0]=e.slice(0,a);if(a===e.length)return t;var i=e.match(we),s=0,l="",f=0,o="",c="",u=1;if(i)for(f=0;f!=i.length;++f){c=i[f];for(n=0;n!=c.length;++n)if(c.charCodeAt(n)===61)break;o=c.slice(0,n).trim();while(c.charCodeAt(n+1)==32)++n;u=(a=c.charCodeAt(n+1))==34||a==39?1:0;l=c.slice(n+1+u,c.length-u);for(s=0;s!=o.length;++s)if(o.charCodeAt(s)===58)break;if(s===o.length){if(o.indexOf("_")>0)o=o.slice(0,o.indexOf("_"));t[o]=l}else{var h=(s===5&&o.slice(0,5)==="xmlns"?"xmlns":"")+o.slice(s+1);if(t[h]&&o.slice(s-3,s)=="ext")continue;t[h]=l}}return t}function Te(e){ -return e.replace(Ce,"<$1")}var xe={""":'"',"'":"'",">":">","<":"<","&":"&"};var ye=G(xe);var Ae=function(){var e=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/g,r=/_x([\da-fA-F]{4})_/g;return function t(a){var n=a+"",i=n.indexOf("-1?16:10))||e}).replace(r,function(e,r){return String.fromCharCode(parseInt(r,16))});var s=n.indexOf("]]>");return t(n.slice(0,i))+n.slice(i+9,s)+t(n.slice(s+3))}}();var Ie=/[&<>'"]/g,Re=/[\u0000-\u0008\u000b-\u001f]/g;function De(e){var r=e+"";return r.replace(Ie,function(e){return ye[e]}).replace(Re,function(e){return"_x"+("000"+e.charCodeAt(0).toString(16)).slice(-4)+"_"})}function Fe(e){return De(e).replace(/ /g,"_x0020_")}var Oe=/[\u0000-\u001f]/g;function Pe(e){var r=e+"";return r.replace(Ie,function(e){return ye[e]}).replace(Oe,function(e){return"&#x"+("000"+e.charCodeAt(0).toString(16)).slice(-4)+";"})}function Ne(e){var r=e+"";return r.replace(Ie,function(e){return ye[e]}).replace(Oe,function(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"})}var Le=function(){var e=/&#(\d+);/g;function r(e,r){return String.fromCharCode(parseInt(r,10))}return function t(a){return a.replace(e,r)}}();var Me=function(){return function e(r){return r.replace(/(\r\n|[\r\n])/g," ")}}();function Ue(e){switch(e){case 1:;case true:;case"1":;case"true":;case"TRUE":return true;default:return false;}}var He=function Cm(e){var r="",t=0,a=0,n=0,i=0,s=0,l=0;while(t191&&a<224){s=(a&31)<<6;s|=n&63;r+=String.fromCharCode(s);continue}i=e.charCodeAt(t++);if(a<240){r+=String.fromCharCode((a&15)<<12|(n&63)<<6|i&63);continue}s=e.charCodeAt(t++);l=((a&7)<<18|(n&63)<<12|(i&63)<<6|s&63)-65536;r+=String.fromCharCode(55296+(l>>>10&1023));r+=String.fromCharCode(56320+(l&1023))}return r};var We=function(e){var r=[],t=0,a=0,n=0;while(t>6)));r.push(String.fromCharCode(128+(a&63)));break;case a>=55296&&a<57344:a-=55296;n=e.charCodeAt(t++)-56320+(a<<10);r.push(String.fromCharCode(240+(n>>18&7)));r.push(String.fromCharCode(144+(n>>12&63)));r.push(String.fromCharCode(128+(n>>6&63)));r.push(String.fromCharCode(128+(n&63)));break;default:r.push(String.fromCharCode(224+(a>>12)));r.push(String.fromCharCode(128+(a>>6&63)));r.push(String.fromCharCode(128+(a&63)));}}return r.join("")};if(E){var Ve=function Bm(e){var r=new Buffer(2*e.length),t,a,n=1,i=0,s=0,l;for(a=0;a>>10&1023);t=56320+(t&1023)}if(s!==0){r[i++]=s&255;r[i++]=s>>>8;s=0}r[i++]=t%256;r[i++]=t>>>8}return r.slice(0,i).toString("ucs2")};var ze="foo bar baz☃🍣";if(He(ze)==Ve(ze))He=Ve;var Xe=function Tm(e){return Buffer(e,"binary").toString("utf8")};if(He(ze)==Xe(ze))He=Xe;We=function(e){return new Buffer(e,"utf8").toString("binary")}}var Ge=function(){var e={};return function r(t,a){var n=t+"|"+(a||"");if(e[n])return e[n];return e[n]=new RegExp("<(?:\\w+:)?"+t+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)",a||"")}}();var je=function(){var e=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(e){return[new RegExp("&"+e[0]+";","g"),e[1]]});return function r(t){var a=t.trim().replace(/\s+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,"");for(var n=0;n([\\s\\S]*?)","g")}}();var Ye=/<\/?(?:vt:)?variant>/g,$e=/<(?:vt:)([^>]*)>([\s\S]*)"+r+""}function qe(e){return z(e).map(function(r){return" "+r+'="'+e[r]+'"'}).join("")}function er(e,r,t){return"<"+e+(t!=null?qe(t):"")+(r!=null?(r.match(Qe)?' xml:space="preserve"':"")+">"+r+""}function rr(e,r){try{return e.toISOString().replace(/\.\d*/,"")}catch(t){if(r)throw t}return""}function tr(e){switch(typeof e){case"string":return er("vt:lpwstr",e);case"number":return er((e|0)==e?"vt:i4":"vt:r8",String(e));case"boolean":return er("vt:bool",e?"true":"false");}if(e instanceof Date)return er("vt:filetime",rr(e));throw new Error("Unable to serialize "+e)}var ar={dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"};ar.main=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"];var nr={o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel",ss:"urn:schemas-microsoft-com:office:spreadsheet",dt:"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",mv:"http://macVmlSchemaUri",v:"urn:schemas-microsoft-com:vml",html:"http://www.w3.org/TR/REC-html40"};function ir(e,r){var t=1-2*(e[r+7]>>>7);var a=((e[r+7]&127)<<4)+(e[r+6]>>>4&15);var n=e[r+6]&15;for(var i=5;i>=0;--i)n=n*256+e[r+i];if(a==2047)return n==0?t*Infinity:NaN;if(a==0)a=-1022;else{a-=1023;n+=Math.pow(2,52)}return t*Math.pow(2,a-52)*n}function sr(e,r,t){var a=(r<0||1/r==-Infinity?1:0)<<7,n=0,i=0;var s=a?-r:r;if(!isFinite(s)){n=2047;i=isNaN(r)?26985:0}else if(s==0)n=i=0;else{n=Math.floor(Math.log(s)/Math.LN2);i=s*Math.pow(2,52-n);if(n<=-1023&&(!isFinite(i)||i>4|a}var lr=function(e){var r=[],t=10240;for(var a=0;a0?dr(e,r+4,r+4+t-1):""};var mr=pr;var br=function(e,r){var t=Rr(e,r);return t>0?dr(e,r+4,r+4+t-1):""};var gr=br;var Er=function(e,r){var t=2*Rr(e,r);return t>0?dr(e,r+4,r+4+t-1):""};var kr=Er;var wr,Sr;wr=Sr=function xm(e,r){var t=Rr(e,r);return t>0?or(e,r+4,r+4+t):""};var _r=function(e,r){var t=Rr(e,r);return t>0?dr(e,r+4,r+4+t):""};var Cr=_r;var Br,Tr;Br=Tr=function(e,r){return ir(e,r)};var xr=function ym(e){return Array.isArray(e)};if(E){or=function(e,r,t){if(!Buffer.isBuffer(e))return cr(e,r,t);return e.toString("utf16le",r,t).replace(x,"")};ur=function(e,r,t){return Buffer.isBuffer(e)?e.toString("hex",r,r+t):hr(e,r,t)};pr=function Am(e,r){if(!Buffer.isBuffer(e))return mr(e,r);var t=e.readUInt32LE(r);return t>0?e.toString("utf8",r+4,r+4+t-1):""};br=function Im(e,r){if(!Buffer.isBuffer(e))return gr(e,r);var t=e.readUInt32LE(r);return t>0?e.toString("utf8",r+4,r+4+t-1):""};Er=function Rm(e,r){if(!Buffer.isBuffer(e))return kr(e,r);var t=2*e.readUInt32LE(r);return e.toString("utf16le",r+4,r+4+t-1)};wr=function Dm(e,r){if(!Buffer.isBuffer(e))return Sr(e,r);var t=e.readUInt32LE(r);return e.toString("utf16le",r+4,r+4+t)};_r=function Fm(e,r){if(!Buffer.isBuffer(e))return Cr(e,r);var t=e.readUInt32LE(r);return e.toString("utf8",r+4,r+4+t)};dr=function Om(e,r,t){return Buffer.isBuffer(e)?e.toString("utf8",r,t):vr(e,r,t)};lr=function(e){return e[0].length>0&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0]):fr(e)};T=function(e){return Buffer.isBuffer(e[0])?Buffer.concat(e):[].concat.apply([],e)};Br=function Pm(e,r){if(Buffer.isBuffer(e))return e.readDoubleLE(r);return Tr(e,r)};xr=function Nm(e){return Buffer.isBuffer(e)||Array.isArray(e)}}if(typeof cptable!=="undefined"){or=function(e,r,t){return cptable.utils.decode(1200,e.slice(r,t)).replace(x,"")};dr=function(e,r,t){return cptable.utils.decode(65001,e.slice(r,t))};pr=function(e,r){var t=Rr(e,r);return t>0?cptable.utils.decode(a,e.slice(r+4,r+4+t-1)):""};br=function(e,r){var a=Rr(e,r);return a>0?cptable.utils.decode(t,e.slice(r+4,r+4+a-1)):""};Er=function(e,r){var t=2*Rr(e,r);return t>0?cptable.utils.decode(1200,e.slice(r+4,r+4+t-1)):""};wr=function(e,r){var t=Rr(e,r);return t>0?cptable.utils.decode(1200,e.slice(r+4,r+4+t)):""};_r=function(e,r){var t=Rr(e,r);return t>0?cptable.utils.decode(65001,e.slice(r+4,r+4+t)):""}}var yr=function(e,r){return e[r]};var Ar=function(e,r){return e[r+1]*(1<<8)+e[r]};var Ir=function(e,r){var t=e[r+1]*(1<<8)+e[r];return t<32768?t:(65535-t+1)*-1};var Rr=function(e,r){return e[r+3]*(1<<24)+(e[r+2]<<16)+(e[r+1]<<8)+e[r]};var Dr=function(e,r){return e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]};var Fr=function(e,r){return e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]};function Or(e,r){var a="",n,i,s=[],l,f,o,c;switch(r){case"dbcs":c=this.l;if(E&&Buffer.isBuffer(this))a=this.slice(this.l,this.l+2*e).toString("utf16le");else for(o=0;o0?Dr:Fr)(this,this.l);this.l+=4;return n}else{i=Rr(this,this.l);this.l+=4}return i;case 8:;case-8:if(r==="f"){if(e==8)i=Br(this,this.l);else i=Br([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0);this.l+=8;return i}else e=8;case 16:a=ur(this,this.l,e);break;};}this.l+=e;return a}var Pr=function(e,r,t){e[t]=r&255;e[t+1]=r>>>8&255;e[t+2]=r>>>16&255;e[t+3]=r>>>24&255};var Nr=function(e,r,t){e[t]=r&255;e[t+1]=r>>8&255;e[t+2]=r>>16&255;e[t+3]=r>>24&255};var Lr=function(e,r,t){e[t]=r&255;e[t+1]=r>>>8&255};function Mr(e,r,t){var a=0,n=0;if(t==="dbcs"){for(n=0;n!=r.length;++n)Lr(this,r.charCodeAt(n),this.l+2*n);a=2*r.length}else if(t==="sbcs"){r=r.replace(/[^\x00-\x7F]/g,"_");for(n=0;n!=r.length;++n)this[this.l+n]=r.charCodeAt(n)&255;a=r.length}else if(t==="hex"){for(;n>8}while(this.l>>=8;this[this.l+1]=r&255;break;case 3:a=3;this[this.l]=r&255;r>>>=8;this[this.l+1]=r&255;r>>>=8;this[this.l+2]=r&255;break;case 4:a=4;Pr(this,r,this.l);break;case 8:a=8;if(t==="f"){sr(this,r,this.l);break};case 16:break;case-4:a=4;Nr(this,r,this.l);break;}this.l+=a;return this}function Ur(e,r){var t=ur(this,this.l,e.length>>1);if(t!==e)throw new Error(r+"Expected "+e+" saw "+t);this.l+=e.length>>1}function Hr(e,r){e.l=r;e._R=Or;e.chk=Ur;e._W=Mr}function Wr(e,r){e.l+=r}function Vr(e){var r=k(e);Hr(r,0);return r}function zr(e,r,t){if(!e)return;var a,n,i;Hr(e,e.l||0);var s=e.length,l=0,f=0;while(e.la.l){a=a.slice(0,a.l);a.l=a.length}if(a.length>0)e.push(a);a=null};var i=function c(e){if(a&&e=128?1:0)+1;if(a>=128)++i;if(a>=16384)++i;if(a>=2097152)++i;var s=e.next(i);if(n<=127)s._W(1,n);else{s._W(1,(n&127)+128);s._W(1,n>>7)}for(var l=0;l!=4;++l){if(a>=128){s._W(1,(a&127)+128);a>>=7}else{s._W(1,a);break}}if(a>0&&xr(t))e.push(t)}function jr(e,r,t){var a=ne(e);if(r.s){if(a.cRel)a.c+=r.s.c;if(a.rRel)a.r+=r.s.r}else{if(a.cRel)a.c+=r.c;if(a.rRel)a.r+=r.r}if(!t||t.biff<12){while(a.c>=256)a.c-=256;while(a.r>=65536)a.r-=65536}return a}function Kr(e,r,t){var a=ne(e);a.s=jr(a.s,r.s,t);a.e=jr(a.e,r.s,t);return a}function Yr(e,r){if(e.cRel&&e.c<0){e=ne(e);e.c+=r>8?16384:256}if(e.rRel&&e.r<0){e=ne(e);e.r+=r>8?1048576:r>5?65536:16384}var t=ft(e);if(e.cRel===0)t=nt(t);if(e.rRel===0)t=et(t);return t}function $r(e,r){if(e.s.r==0&&!e.s.rRel){if(e.e.r==(r.biff>=12?1048575:r.biff>=8?65536:16384)&&!e.e.rRel){return(e.s.cRel?"":"$")+at(e.s.c)+":"+(e.e.cRel?"":"$")+at(e.e.c)}}if(e.s.c==0&&!e.s.cRel){if(e.e.c==(r.biff>=12?65535:255)&&!e.e.cRel){return(e.s.rRel?"":"$")+qr(e.s.r)+":"+(e.e.rRel?"":"$")+qr(e.e.r)}}return Yr(e.s,r.biff)+":"+Yr(e.e,r.biff)}var Zr={};var Qr=function(e,r){var t;if(typeof r!=="undefined")t=r;else if(typeof require!=="undefined"){try{t=undefined}catch(a){t=null}}e.rc4=function(e,r){var t=new Array(256);var a=0,n=0,i=0,s=0;for(n=0;n!=256;++n)t[n]=n;for(n=0;n!=256;++n){i=i+t[n]+e[n%e.length].charCodeAt(0)&255;s=t[n];t[n]=t[i];t[i]=s}n=i=0;var l=Buffer(r.length);for(a=0;a!=r.length;++a){n=n+1&255;i=(i+t[n])%256;s=t[n];t[n]=t[i];t[i]=s;l[a]=r[a]^t[t[n]+t[i]&255]}return l};e.md5=function(e){if(!t)throw new Error("Unsupported crypto");return t.createHash("md5").update(e).digest("hex")}};Qr(Zr,typeof crypto!=="undefined"?crypto:undefined);function Jr(e){return parseInt(rt(e),10)-1}function qr(e){return""+(e+1)}function et(e){return e.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function rt(e){return e.replace(/\$(\d+)$/,"$1")}function tt(e){var r=it(e),t=0,a=0;for(;a!==r.length;++a)t=26*t+r.charCodeAt(a)-64;return t-1}function at(e){var r="";for(++e;e;e=Math.floor((e-1)/26))r=String.fromCharCode((e-1)%26+65)+r;return r}function nt(e){return e.replace(/^([A-Z])/,"$$$1")}function it(e){return e.replace(/^\$([A-Z])/,"$1")}function st(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function lt(e){var r=st(e);return{c:tt(r[0]),r:Jr(r[1])}}function ft(e){return at(e.c)+qr(e.r)}function ot(e){var r=e.split(":").map(lt);return{s:r[0],e:r[r.length-1]}}function ct(e,r){if(typeof r==="undefined"||typeof r==="number"){return ct(e.s,e.e)}if(typeof e!=="string")e=ft(e);if(typeof r!=="string")r=ft(r);return e==r?e:e+":"+r}function ut(e){var r={s:{c:0,r:0},e:{c:0,r:0}};var t=0,a=0,n=0;var i=e.length;for(t=0;a26)break;t=26*t+n}r.s.c=--t;for(t=0;a9)break;t=10*t+n}r.s.r=--t;if(a===i||e.charCodeAt(++a)===58){r.e.c=r.s.c;r.e.r=r.s.r;return r}for(t=0;a!=i;++a){if((n=e.charCodeAt(a)-64)<1||n>26)break;t=26*t+n}r.e.c=--t;for(t=0;a!=i;++a){if((n=e.charCodeAt(a)-48)<0||n>9)break;t=10*t+n}r.e.r=--t;return r}function ht(e,r){var t=e.t=="d"&&r instanceof Date;if(e.z!=null)try{return e.w=A.format(e.z,t?Q(r):r)}catch(a){}try{return e.w=A.format((e.XF||{}).numFmtId||(t?14:0),t?Q(r):r)}catch(a){return""+r}}function dt(e,r,t){if(e==null||e.t==null||e.t=="z")return"";if(e.w!==undefined)return e.w;if(e.t=="d"&&!e.z&&t&&t.dateNF)e.z=t.dateNF;if(r==undefined)return ht(e,e.v);return ht(e,r)}function vt(e,r){var t=r&&r.sheet?r.sheet:"Sheet1";var a={};a[t]=e;return{SheetNames:[t],Sheets:a}}function pt(e,r,t){var a=t||{};var n=e?Array.isArray(e):a.dense;if(m!=null&&n==null)n=m;var i=e||(n?[]:{});var s=0,l=0;if(i&&a.origin!=null){if(typeof a.origin=="number")s=a.origin;else{var f=typeof a.origin=="string"?lt(a.origin):a.origin;s=f.r;l=f.c}}var o={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(i["!ref"]){var c=ut(i["!ref"]);o.s.c=c.s.c;o.s.r=c.s.r;o.e.c=Math.max(o.e.c,c.e.c);o.e.r=Math.max(o.e.r,c.e.r);if(s==-1)o.e.r=s=c.e.r+1}for(var u=0;u!=r.length;++u){for(var h=0;h!=r[u].length;++h){if(typeof r[u][h]==="undefined")continue;var d={v:r[u][h]};if(Array.isArray(d.v)){d.f=r[u][h][1];d.v=d.v[0]}var v=s+u,p=l+h;if(o.s.r>v)o.s.r=v;if(o.s.c>p)o.s.c=p;if(o.e.r0)r._W(0,e,"dbcs");return t?r.slice(0,r.l):r}function kt(e){return{ich:e._R(2),ifnt:e._R(2)}}function wt(e,r){if(!r)r=Vr(4);r._W(2,e.ich||0);r._W(2,e.ifnt||0);return r}function St(e,r){var t=e.l;var a=e._R(1);var n=gt(e);var i=[];var s={t:n,h:n};if((a&1)!==0){var l=e._R(4);for(var f=0;f!=l;++f)i.push(kt(e));s.r=i}else s.r=[{ich:0,ifnt:0}];e.l=t+r;return s}function _t(e,r){var t=false;if(r==null){t=true;r=Vr(15+4*e.t.length)}r._W(1,0);Et(e.t,r);return t?r.slice(0,r.l):r}var Ct=St;function Bt(e,r){var t=false;if(r==null){t=true;r=Vr(23+4*e.t.length)}r._W(1,1);Et(e.t,r);r._W(4,1);wt({ich:0,ifnt:0},r);return t?r.slice(0,r.l):r}function Tt(e){var r=e._R(4);var t=e._R(2);t+=e._R(1)<<16;e.l++;return{c:r,iStyleRef:t}}function xt(e,r){if(r==null)r=Vr(8);r._W(-4,e.c);r._W(3,e.iStyleRef||e.s);r._W(1,0);return r}var yt=gt;var At=Et;function It(e){var r=e._R(4);return r===0||r===4294967295?"":e._R(r,"dbcs")}function Rt(e,r){var t=false;if(r==null){t=true;r=Vr(127)}r._W(4,e.length>0?e.length:4294967295);if(e.length>0)r._W(0,e,"dbcs");return t?r.slice(0,r.l):r}var Dt=gt;var Ft=It;var Ot=Rt;function Pt(e){var r=e.slice(e.l,e.l+4);var t=r[0]&1,a=r[0]&2;e.l+=4;r[0]&=252;var n=a===0?Br([0,0,0,0,r[0],r[1],r[2],r[3]],0):Dr(r,0)>>2;return t?n/100:n}function Nt(e,r){if(r==null)r=Vr(4);var t=0,a=0,n=e*100;if(e==(e|0)&&e>=-(1<<29)&&e<1<<29){a=1}else if(n==(n|0)&&n>=-(1<<29)&&n<1<<29){a=1;t=1}if(a)r._W(-4,((t?n:e)<<2)+(t+2));else throw new Error("unsupported RkNumber "+e)}function Lt(e){var r={s:{},e:{}};r.s.r=e._R(4);r.e.r=e._R(4);r.s.c=e._R(4);r.e.c=e._R(4);return r}function Mt(e,r){if(!r)r=Vr(16);r._W(4,e.s.r);r._W(4,e.e.r);r._W(4,e.s.c);r._W(4,e.e.c);return r}var Ut=Lt;var Ht=Mt;function Wt(e){return e._R(8,"f")}function Vt(e,r){return(r||Vr(8))._W(8,e,"f")}var zt={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"};var Xt=j(zt);function Gt(e){var r={};var t=e._R(1);var a=t>>>1;var n=e._R(1);var i=e._R(2,"i");var s=e._R(1);var l=e._R(1);var f=e._R(1);e.l++;switch(a){case 0:r.auto=1;break;case 1:r.index=n;var o=ba[n];if(o)r.rgb=Ol(o);break;case 2:r.rgb=Ol([s,l,f]);break;case 3:r.theme=n;break;}if(i!=0)r.tint=i>0?i/32767:i/32768;return r}function jt(e,r){if(!r)r=Vr(8);if(!e||e.auto){r._W(4,0);r._W(4,0);return r}if(e.index){r._W(1,2);r._W(1,e.index)}else if(e.theme){r._W(1,6);r._W(1,e.theme)}else{r._W(1,5);r._W(1,0)}var t=e.tint||0;if(t>0)t*=32767;else if(t<0)t*=32768;r._W(2,t);if(!e.rgb){r._W(2,0);r._W(1,0);r._W(1,0)}else{var a=e.rgb||"FFFFFF";r._W(1,parseInt(a.slice(0,2),16));r._W(1,parseInt(a.slice(2,4),16));r._W(1,parseInt(a.slice(4,6),16));r._W(1,255)}return r}function Kt(e){var r=e._R(1);e.l++;var t={fItalic:r&2,fStrikeout:r&8,fOutline:r&16,fShadow:r&32,fCondense:r&64,fExtend:r&128};return t}function Yt(e,r){if(!r)r=Vr(2);var t=(e.italic?2:0)|(e.strike?8:0)|(e.outline?16:0)|(e.shadow?32:0)|(e.condense?64:0)|(e.extend?128:0);r._W(1,t);r._W(1,0);return r}function $t(e,r){var t={2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"};var a=e._R(4);switch(a){case 0:return"";case 4294967295:;case 4294967294:return t[e._R(4)]||"";}if(a>400)throw new Error("Unsupported Clipboard: "+a.toString(16));e.l-=4;return e._R(0,r==1?"lpstr":"lpwstr")}function Zt(e){return $t(e,1)}function Qt(e){return $t(e,2)}var Jt=2;var qt=3;var ea=11;var ra=12;var ta=19;var aa=30;var na=64;var ia=65;var sa=71;var la=4096;var fa=80;var oa=81;var ca=[fa,oa];var ua={1:{n:"CodePage",t:Jt},2:{n:"Category",t:fa},3:{n:"PresentationFormat",t:fa},4:{n:"ByteCount",t:qt},5:{n:"LineCount",t:qt},6:{n:"ParagraphCount",t:qt},7:{n:"SlideCount",t:qt},8:{n:"NoteCount",t:qt},9:{n:"HiddenCount",t:qt},10:{n:"MultimediaClipCount",t:qt},11:{n:"Scale",t:ea},12:{n:"HeadingPair",t:la|ra},13:{n:"DocParts",t:la|aa},14:{n:"Manager",t:fa},15:{n:"Company",t:fa},16:{n:"LinksDirty",t:ea},17:{n:"CharacterCount",t:qt},19:{n:"SharedDoc",t:ea},22:{n:"HLinksChanged",t:ea},23:{n:"AppVersion",t:qt,p:"version"},24:{n:"DigSig",t:ia},26:{n:"ContentType",t:fa},27:{n:"ContentStatus",t:fa},28:{n:"Language",t:fa},29:{n:"Version",t:fa},255:{}};var ha={1:{n:"CodePage",t:Jt},2:{n:"Title",t:fa},3:{n:"Subject",t:fa},4:{n:"Author",t:fa},5:{n:"Keywords",t:fa},6:{n:"Comments",t:fa},7:{n:"Template",t:fa},8:{n:"LastAuthor",t:fa},9:{n:"RevNumber",t:fa},10:{n:"EditTime",t:na},11:{n:"LastPrinted",t:na},12:{n:"CreatedDate",t:na},13:{n:"ModifiedDate",t:na},14:{n:"PageCount",t:qt},15:{n:"WordCount",t:qt},16:{n:"CharCount",t:qt},17:{n:"Thumbnail",t:sa},18:{n:"ApplicationName",t:fa},19:{n:"DocumentSecurity",t:qt},255:{}};var da={2147483648:{n:"Locale",t:ta},2147483651:{n:"Behavior",t:ta},1919054434:{}};(function(){for(var e in da)if(da.hasOwnProperty(e))ua[e]=ha[e]=da[e]})();var va={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"};var pa=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function ma(e){return e.map(function(e){return[e>>16&255,e>>8&255,e&255]})}var ba=ma([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);var ga={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.sheetMetadata":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"TODO","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"vba","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"};var Ea=function(){var e={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"},comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};z(e).forEach(function(r){["xlsm","xlam"].forEach(function(t){if(!e[r][t])e[r][t]=e[r].xlsx})});z(e).forEach(function(r){z(e[r]).forEach(function(t){ga[e[r][t]]=r})});return e}();var ka=K(ga);ar.CT="http://schemas.openxmlformats.org/package/2006/content-types";function wa(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],TODO:[],xmlns:""}}function Sa(e){var r=wa();if(!e||!e.match)return r;var t={};(e.match(Se)||[]).forEach(function(e){var a=Be(e);switch(a[0].replace(_e,"<")){case"0?r.calcchains[0]:"";r.sst=r.strs.length>0?r.strs[0]:"";r.style=r.styles.length>0?r.styles[0]:"";r.defaults=t;delete r.calcchains;return r}var _a=er("Types",null,{xmlns:ar.CT,"xmlns:xsd":ar.xsd,"xmlns:xsi":ar.xsi});var Ca=[["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels",ka.rels[0]]].map(function(e){return er("Default",null,{Extension:e[0],ContentType:e[1]})});function Ba(e,r){var t=[],a;t[t.length]=ke;t[t.length]=_a;t=t.concat(Ca);var n=function(n){if(e[n]&&e[n].length>0){a=e[n][0];t[t.length]=er("Override",null,{PartName:(a[0]=="/"?"":"/")+a,ContentType:Ea[n][r.bookType||"xlsx"]})}};var i=function(a){(e[a]||[]).forEach(function(e){t[t.length]=er("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:Ea[a][r.bookType||"xlsx"]})})};var s=function(r){(e[r]||[]).forEach(function(e){t[t.length]=er("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:ka[r][0]})})};n("workbooks");i("sheets");i("charts");s("themes");["strs","styles"].forEach(n);["coreprops","extprops","custprops"].forEach(s);s("vba");s("comments");s("drawings");if(t.length>2){t[t.length]="";t[1]=t[1].replace("/>",">")}return t.join("")}var Ta={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function xa(e){var r=e.lastIndexOf("/");return e.slice(0,r+1)+"_rels/"+e.slice(r+1)+".rels"}function ya(e,r){if(!e)return e;if(r.charAt(0)!=="/"){r="/"+r}var t={};var a={};(e.match(Se)||[]).forEach(function(e){var n=Be(e);if(n[0]==="2){r[r.length]="";r[1]=r[1].replace("/>",">")}return r.join("")}function Ra(e,r,t,a,n){if(!n)n={};if(!e["!id"])e["!id"]={};if(r<0)for(r=1;e["!id"]["rId"+r];++r){}n.Id="rId"+r;n.Type=a;n.Target=t;if(n.Type==Ta.HLINK)n.TargetMode="External";if(e["!id"][n.Id])throw new Error("Cannot rewrite rId "+r);e["!id"][n.Id]=n;e[("/"+n.Target).replace("//","/")]=n;return r}var Da="application/vnd.oasis.opendocument.spreadsheet";function Fa(e,r){var t=_v(e);var a;var n;while(a=Cv.exec(t))switch(a[3]){case"manifest":break;case"file-entry":n=Be(a[0],false);if(n.path=="/"&&n.type!==Da)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":;case"algorithm":;case"start-key-generation":;case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(r&&r.WTF)throw a;}}function Oa(e){var r=[ke];r.push('\n');r.push(' \n');for(var t=0;t\n');r.push("");return r.join("")}function Pa(e,r,t){return[' \n',' \n'," \n"].join("")}function Na(e,r){return[' \n',' \n'," \n"].join("")}function La(e){var r=[ke];r.push('\n');for(var t=0;t!=e.length;++t){r.push(Pa(e[t][0],e[t][1]));r.push(Na("",e[t][0]))}r.push(Pa("","Document","pkg"));r.push("");return r.join("")}var Ma=function(){var e='Sheet'+"JS "+r.version+"";return function t(){return e}}();var Ua=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]];ar.CORE_PROPS="http://schemas.openxmlformats.org/package/2006/metadata/core-properties";Ta.CORE_PROPS="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";var Ha=function(){var e=new Array(Ua.length);for(var r=0;r]*>([\\s\\S]*?)")}return e}();function Wa(e){var r={};e=He(e);for(var t=0;t0)r[a[1]]=n[1];if(a[2]==="date"&&r[a[1]])r[a[1]]=te(r[a[1]])}return r}var Va=er("cp:coreProperties",null,{"xmlns:cp":ar.CORE_PROPS,"xmlns:dc":ar.dc,"xmlns:dcterms":ar.dcterms,"xmlns:dcmitype":ar.dcmitype,"xmlns:xsi":ar.xsi});function za(e,r,t,a,n){if(n[e]!=null||r==null||r==="")return;n[e]=r;a[a.length]=t?er(e,r,t):Je(e,r)}function Xa(e,r){var t=r||{};var a=[ke,Va],n={};if(!e&&!t.Props)return a.join("");if(e){if(e.CreatedDate!=null)za("dcterms:created",typeof e.CreatedDate==="string"?e.CreatedDate:rr(e.CreatedDate,t.WTF),{"xsi:type":"dcterms:W3CDTF"},a,n);if(e.ModifiedDate!=null)za("dcterms:modified",typeof e.ModifiedDate==="string"?e.ModifiedDate:rr(e.ModifiedDate,t.WTF),{"xsi:type":"dcterms:W3CDTF"},a,n)}for(var i=0;i!=Ua.length;++i){var s=Ua[i];var l=t.Props&&t.Props[s[1]]!=null?t.Props[s[1]]:e?e[s[1]]:null;if(l===true)l="1";else if(l===false)l="0";else if(typeof l=="number")l=String(l);if(l!=null)za(s[0],l,null,a,n)}if(a.length>2){a[a.length]="";a[1]=a[1].replace("/>",">")}return a.join("")}var Ga=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]];ar.EXT_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties";Ta.EXT_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";function ja(e,r,t){var a={};if(!r)r={};e=He(e);Ga.forEach(function(t){switch(t[2]){case"string":r[t[1]]=(e.match(Ge(t[0]))||[])[1];break;case"bool":r[t[1]]=(e.match(Ge(t[0]))||[])[1]==="true";break;case"raw":var n=e.match(new RegExp("<"+t[0]+"[^>]*>([\\s\\S]*?)"));if(n&&n.length>0)a[t[1]]=n[1];break;}});if(a.HeadingPairs&&a.TitlesOfParts){var n=Ze(a.HeadingPairs,t);var i=Ze(a.TitlesOfParts,t).map(function(e){return e.v});var s=0,l=0;if(i.length>0)for(var f=0;f!==n.length;f+=2){l=+n[f+1].v;switch(n[f].v){case"Worksheets":;case"工作表":;case"Листы":;case"أوراق العمل":;case"ワークシート":;case"גליונות עבודה":;case"Arbeitsblätter":;case"Çalışma Sayfaları":;case"Feuilles de calcul":;case"Fogli di lavoro":;case"Folhas de cálculo":;case"Planilhas":;case"Regneark":;case"Werkbladen":r.Worksheets=l;r.SheetNames=i.slice(s,s+l);break;case"Named Ranges":;case"名前付き一覧":;case"Benannte Bereiche":;case"Navngivne områder":r.NamedRanges=l;r.DefinedNames=i.slice(s,s+l);break;case"Charts":;case"Diagramme":r.Chartsheets=l;r.ChartNames=i.slice(s,s+l);break;}s+=l}}return r}var Ka=er("Properties",null,{xmlns:ar.EXT_PROPS,"xmlns:vt":ar.vt});function Ya(e){var r=[],t=er;if(!e)e={};e.Application="SheetJS";r[r.length]=ke;r[r.length]=Ka;Ga.forEach(function(a){if(e[a[1]]===undefined)return;var n;switch(a[2]){case"string":n=String(e[a[1]]);break;case"bool":n=e[a[1]]?"true":"false";break;}if(n!==undefined)r[r.length]=t(a[0],n)});r[r.length]=t("HeadingPairs",t("vt:vector",t("vt:variant","Worksheets")+t("vt:variant",t("vt:i4",String(e.Worksheets))),{size:2,baseType:"variant"}));r[r.length]=t("TitlesOfParts",t("vt:vector",e.SheetNames.map(function(e){return""+De(e)+""}).join(""),{size:e.Worksheets,baseType:"lpstr"}));if(r.length>2){r[r.length]="";r[1]=r[1].replace("/>",">")}return r.join("")}ar.CUST_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties";Ta.CUST_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties";var $a=/<[^>]+>[^<]*/g;function Za(e,r){var t={},a="";var n=e.match($a);if(n)for(var i=0;i!=n.length;++i){var s=n[i],l=Be(s);switch(l[0]){case"":a=null;break;default:if(s.indexOf("");var o=f[0].slice(4),c=f[1];switch(o){case"lpstr":;case"bstr":;case"lpwstr":t[a]=Ae(c);break;case"bool":t[a]=Ue(c);break;case"i1":;case"i2":;case"i4":;case"i8":;case"int":;case"uint":t[a]=parseInt(c,10);break;case"r4":;case"r8":;case"decimal":t[a]=parseFloat(c);break;case"filetime":;case"date":t[a]=te(c);break;case"cy":;case"error":t[a]=Ae(c);break;default:if(o.slice(-1)=="/")break;if(r.WTF&&typeof console!=="undefined")console.warn("Unexpected",s,o,f);}}else if(s.slice(0,2)==="2){r[r.length]="";r[1]=r[1].replace("/>",">")}return r.join("")}var qa={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"};var en=G(qa);function rn(e,r,t){r=en[r]||r;e[r]=t}function tn(e,r){var t=[];z(qa).map(function(e){for(var r=0;r'+n.join("")+""}function nn(e){var r=e._R(4),t=e._R(4);return new Date((t/1e7*Math.pow(2,32)+r/1e7-11644473600)*1e3).toISOString().replace(/\.000/,"")}function sn(e,r,t){var a=e.l;var n=e._R(0,"lpstr-cp");if(t)while(e.l-a&3)++e.l;return n}function ln(e,r,t){var a=e._R(0,"lpwstr");if(t)e.l+=4-(a.length+1&3)&3;return a}function fn(e,r,t){if(r===31)return ln(e);return sn(e,r,t)}function on(e,r,t){return fn(e,r,t===false?0:4)}function cn(e,r){if(!r)throw new Error("VtUnalignedString must have positive length");return fn(e,r,0)}function un(e){var r=e._R(4);var t=[];for(var a=0;a!=r;++a)t[a]=e._R(0,"lpstr-cp").replace(x,"");return t}function hn(e){return un(e)}function dn(e){var r=En(e,oa);var t=En(e,qt);return[r,t]}function vn(e){var r=e._R(4);var t=[];for(var a=0;a!=r/2;++a)t.push(dn(e));return t}function pn(e){return vn(e)}function mn(e,r){var t=e._R(4);var a={};for(var n=0;n!=t;++n){var i=e._R(4);var s=e._R(4);a[i]=e._R(s,r===1200?"utf16le":"utf8").replace(x,"").replace(y,"!")}if(e.l&3)e.l=e.l>>2+1<<2;return a}function bn(e){var r=e._R(4);var t=e.slice(e.l,e.l+r);e.l+=r;if((r&3)>0)e.l+=4-(r&3)&3;return t}function gn(e){var r={};r.Size=e._R(4);e.l+=r.Size+3-(r.Size-1)%4;return r}function En(e,r,t){var a=e._R(2),n,i=t||{};e.l+=2;if(r!==ra)if(a!==r&&ca.indexOf(r)===-1)throw new Error("Expected type "+r+" saw "+a);switch(r===ra?a:r){case 2:n=e._R(2,"i");if(!i.raw)e.l+=2;return n;case 3:n=e._R(4,"i");return n;case 11:return e._R(4)!==0;case 19:n=e._R(4);return n;case 30:return sn(e,a,4).replace(x,"");case 31:return ln(e);case 64:return nn(e);case 65:return bn(e);case 71:return gn(e);case 80:return on(e,a,!i.raw).replace(x,"");case 81:return cn(e,a).replace(x,"");case 4108:return pn(e);case 4126:return hn(e);default:throw new Error("TypedPropertyValue unrecognized type "+r+" "+a);}}function kn(e,r){var t=e.l;var a=e._R(4);var n=e._R(4);var i=[],s=0;var l=0;var f=-1,c={};for(s=0;s!=n;++s){var u=e._R(4);var h=e._R(4);i[s]=[u,h+t]}i.sort(function(e,r){return e[1]-r[1]});var d={};for(s=0;s!=n;++s){if(e.l!==i[s][1]){var v=true;if(s>0&&r)switch(r[i[s-1][0]].t){case 2:if(e.l+2===i[s][1]){e.l+=2;v=false}break;case 80:if(e.l<=i[s][1]){e.l=i[s][1];v=false}break;case 4108:if(e.l<=i[s][1]){e.l=i[s][1];v=false}break;}if((!r||s==0)&&e.l<=i[s][1]){v=false;e.l=i[s][1]}if(v)throw new Error("Read Error: Expected address "+i[s][1]+" at "+e.l+" :"+s)}if(r){var p=r[i[s][0]];d[p.n]=En(e,p.t,{raw:true});if(p.p==="version")d[p.n]=String(d[p.n]>>16)+"."+String(d[p.n]&65535);if(p.n=="CodePage")switch(d[p.n]){case 0:d[p.n]=1252;case 874:;case 932:;case 936:;case 949:;case 950:;case 1250:;case 1251:;case 1253:;case 1254:;case 1255:;case 1256:;case 1257:;case 1258:;case 1e4:;case 1200:;case 1201:;case 1252:;case 65e3:;case-536:;case 65001:;case-535:o(l=d[p.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+d[p.n]);}}else{if(i[s][0]===1){l=d.CodePage=En(e,Jt);o(l);if(f!==-1){var m=e.l;e.l=i[f][1];c=mn(e,l);e.l=m}}else if(i[s][0]===0){if(l===0){f=s;e.l=i[s+1][1];continue}c=mn(e,l)}else{var b=c[i[s][0]];var g;switch(e[e.l]){case 65:e.l+=4;g=bn(e);break;case 30:e.l+=4;g=on(e,e[e.l-4]);break;case 31:e.l+=4;g=on(e,e[e.l-4]);break;case 3:e.l+=4;g=e._R(4,"i");break;case 19:e.l+=4;g=e._R(4);break;case 5:e.l+=4;g=e._R(8,"f");break;case 11:e.l+=4;g=Bn(e,4);break;case 64:e.l+=4;g=te(nn(e));break;default:throw new Error("unparsed value: "+e[e.l]);}d[b]=g}}}e.l=t+a;return d}function wn(e,r,t){var a=e.content;if(!a)return{};Hr(a,0);var n,i,s,l,f=0;a.chk("feff","Byte Order: ");a._R(2);var o=a._R(4);var c=a._R(16);if(c!==L.utils.consts.HEADER_CLSID&&c!==t)throw new Error("Bad PropertySet CLSID "+c);n=a._R(4);if(n!==1&&n!==2)throw new Error("Unrecognized #Sets: "+n);i=a._R(16);l=a._R(4);if(n===1&&l!==a.l)throw new Error("Length mismatch: "+l+" !== "+a.l);else if(n===2){s=a._R(16);f=a._R(4)}var u=kn(a,r);var h={SystemIdentifier:o};for(var d in u)h[d]=u[d];h.FMTID=i;if(n===1)return h;if(f-a.l==2)a.l+=2;if(a.l!==f)throw new Error("Length mismatch 2: "+a.l+" !== "+f);var v;try{v=kn(a,null)}catch(p){}for(d in v)h[d]=v[d];h.FMTID=[i,s];return h}function Sn(e,r){e._R(r);return null}function _n(e,r){if(!r)r=Vr(e);for(var t=0;t=12?2:1);var i="sbcs-cont";var s=t;if(a&&a.biff>=8)t=1200;if(!a||a.biff==8){var l=e._R(1);if(l){i="dbcs-cont"}}else if(a.biff==12){i="wstr"}if(a.biff>=2&&a.biff<=5)i="cpstr";var f=n?e._R(n,i):"";t=s;return f}function Fn(e){var r=t;t=1200;var a=e._R(2),n=e._R(1);var i=n&4,s=n&8;var l=1+(n&1);var f=0,o;var c={};if(s)f=e._R(2);if(i)o=e._R(4);var u=l==2?"dbcs-cont":"sbcs-cont";var h=a===0?"":e._R(a,u);if(s)e.l+=4*f;if(i)e.l+=o;c.t=h;if(!s){c.raw=""+c.t+"";c.r=c.t}t=r;return c}function On(e,r,t){var a;if(t){if(t.biff>=2&&t.biff<=5)return e._R(r,"cpstr");if(t.biff>=12)return e._R(r,"dbcs-cont")}var n=e._R(1);if(n===0){a=e._R(r,"sbcs-cont")}else{a=e._R(r,"dbcs-cont")}return a}function Pn(e,r,t){var a=e._R(t&&t.biff==2?1:2);if(a===0){e.l++;return""}return On(e,a,t)}function Nn(e,r,t){if(t.biff>5)return Pn(e,r,t);var a=e._R(1);if(a===0){e.l++;return""}return e._R(a,t.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function Ln(e,r,t){if(!t)t=Vr(3+2*e.length);t._W(2,e.length);t._W(1,1);t._W(31,e,"utf16le");return t}function Mn(e){var r=e._R(1);e.l++;var t=e._R(2);e.l+=2;return[r,t]}function Un(e){var r=e._R(4),t=e.l;var a=false;if(r>24){e.l+=r-24;if(e._R(16)==="795881f43b1d7f48af2c825dc4852763")a=true;e.l=t}var n=e._R((a?r-24:r)>>1,"utf16le").replace(x,"");if(a)e.l+=24;return n}function Hn(e){e.l+=2;var r=e._R(0,"lpstr-ansi");e.l+=2;if(e._R(2)!=57005)throw new Error("Bad FileMoniker");var t=e._R(4);if(t===0)return r.replace(/\\/g,"/");var a=e._R(4);if(e._R(2)!=3)throw new Error("Bad FileMoniker");var n=e._R(a>>1,"utf16le").replace(x,"");return n}function Wn(e,r){var t=e._R(16);r-=16;switch(t){case"e0c9ea79f9bace118c8200aa004ba90b":return Un(e,r);case"0303000000000000c000000000000046":return Hn(e,r);default:throw new Error("Unsupported Moniker "+t);}}function Vn(e){var r=e._R(4);var t=r>0?e._R(r,"utf16le").replace(x,""):"";return t}function zn(e,r){var t=e.l+r;var a=e._R(4);if(a!==2)throw new Error("Unrecognized streamVersion: "+a);var n=e._R(2);e.l+=2;var i,s,l,f,o="",c,u;if(n&16)i=Vn(e,t-e.l);if(n&128)s=Vn(e,t-e.l);if((n&257)===257)l=Vn(e,t-e.l);if((n&257)===1)f=Wn(e,t-e.l);if(n&8)o=Vn(e,t-e.l);if(n&32)c=e._R(16);if(n&64)u=nn(e);e.l=t;var h=s||l||f||"";if(h&&o)h+="#"+o;if(!h)h="#"+o;var d={Target:h};if(c)d.guid=c;if(u)d.time=u;if(i)d.Tooltip=i;return d}function Xn(e){var r=Vr(512),t=0;var a=e.Target;var n=a.indexOf("#")>-1?31:23;switch(a.charAt(0)){case"#":n=28;break;case".":n&=~2;break;}r._W(4,2);r._W(4,n);var i=[8,6815827,6619237,4849780,83];for(t=0;t8?4:2;var n=e._R(a),i=e._R(a,"i"),s=e._R(a,"i");return[n,i,s]}function Jn(e){var r=e._R(2);var t=Pt(e);return[r,t]}function qn(e,r,t){e.l+=4;r-=4;var a=e.l+r;var n=Dn(e,r,t);var i=e._R(2);a-=e.l;if(i!==a)throw new Error("Malformed AddinUdf: padding = "+a+" != "+i);e.l+=i;return n}function ei(e){var r=e._R(2);var t=e._R(2);var a=e._R(2);var n=e._R(2);return{s:{c:a,r:r},e:{c:n,r:t}}}function ri(e,r){if(!r)r=Vr(8);r._W(2,e.s.r);r._W(2,e.e.r);r._W(2,e.s.c);r._W(2,e.e.c);return r}function ti(e){var r=e._R(2);var t=e._R(2);var a=e._R(1);var n=e._R(1);return{s:{c:a,r:r},e:{c:n,r:t}}}var ai=ti;function ni(e){e.l+=4;var r=e._R(2);var t=e._R(2);var a=e._R(2);e.l+=12;return[t,r,a]}function ii(e){var r={};e.l+=4;e.l+=16;r.fSharedNote=e._R(2);e.l+=4;return r}function si(e){var r={};e.l+=4;e.cf=e._R(2);return r}function li(e){e.l+=2;e.l+=e._R(2)}var fi={0:li,4:li,5:li,6:li,7:si,8:li,9:li,10:li,11:li,12:li,13:ii,14:li,15:li,16:li,17:li,18:li,19:li,20:li,21:ni};function oi(e,r){var t=e.l+r;var a=[];while(e.l=2){t.dt=e._R(2);e.l-=2}switch(t.BIFFVer){case 1536:;case 1280:;case 1024:;case 768:;case 512:;case 2:;case 7:break;default:if(r>6)throw new Error("Unexpected BIFF Ver "+t.BIFFVer);}e._R(r);return t}function ui(e,r,t){var a=1536,n=16;switch(t.bookType){case"biff8":break;case"biff5":a=1280;n=8;break;case"biff4":a=4;n=6;break;case"biff3":a=3;n=6;break;case"biff2":a=2;n=4;break;case"xla":break;default:throw new Error("unsupported BIFF version");}var i=Vr(n);i._W(2,a);i._W(2,r);if(n>4)i._W(2,29282);if(n>6)i._W(2,1997);if(n>8){i._W(2,49161);i._W(2,1);i._W(2,1798);i._W(2,0)}return i}function hi(e,r){if(r===0)return 1200;if(e._R(2)!==1200){}return 1200}function di(e,r,t){if(t.enc){e.l+=r;return""}var a=e.l;var n=Nn(e,0,t);e._R(r+a-e.l);return n}function vi(e,r){var t=!r||r.biff==8;var a=Vr(t?112:54);a._W(r.biff==8?2:1,7);if(t)a._W(1,0);a._W(4,859007059);a._W(4,5458548|(t?0:536870912));while(a.l=8?2:1;var a=Vr(8+t*e.name.length);a._W(4,e.pos);a._W(1,e.hs||0);a._W(1,e.dt);a._W(1,e.name.length);if(r.biff>=8)a._W(1,1);a._W(t*e.name.length,e.name,r.biff<8?"sbcs":"utf16le");var n=a.slice(0,a.l);n.l=a.l;return n}function gi(e,r){var t=e.l+r;var a=e._R(4);var n=e._R(4);var i=[];for(var s=0;s!=n&&e.l>15);n&=32767}var i={Unsynced:a&1,DyZero:(a&2)>>1,ExAsc:(a&4)>>2,ExDsc:(a&8)>>3};return[i,n]}function Ci(e){var r=e._R(2),t=e._R(2),a=e._R(2),n=e._R(2);var i=e._R(2),s=e._R(2),l=e._R(2);var f=e._R(2),o=e._R(2);return{Pos:[r,t],Dim:[a,n],Flags:i,CurTab:s,FirstTab:l,Selected:f,TabRatio:o}}function Bi(){var e=Vr(18);e._W(2,0);e._W(2,0);e._W(2,29280);e._W(2,17600);e._W(2,56);e._W(2,0);e._W(2,0);e._W(2,1);e._W(2,500);return e}function Ti(e,r,t){if(t&&t.biff>=2&&t.biff<8)return{};var a=e._R(2);return{RTL:a&64}}function xi(e){var r=Vr(18),t=1718;if(e&&e.RTL)t|=64;r._W(2,t);r._W(4,0);r._W(4,64);r._W(4,0);r._W(4,0);return r}function yi(e,r,t){var a={dyHeight:e._R(2),fl:e._R(2)};switch(t&&t.biff||8){case 2:break;case 3:;case 4:e.l+=2;break;default:e.l+=10;break;}a.name=Dn(e,0,t);return a}function Ai(e,r){var t=e.name||"Arial";var a=r&&r.biff==5,n=a?15+t.length:16+2*t.length;var i=Vr(n);i._W(2,(e.sz||12)*20);i._W(4,0);i._W(2,400);i._W(4,0);i._W(2,0);i._W(1,t.length);if(!a)i._W(1,1);i._W((a?1:2)*t.length,t,a?"sbcs":"utf16le");return i}function Ii(e){var r=Kn(e);r.isst=e._R(4);return r}function Ri(e,r,t){var a=e.l+r;var n=Kn(e,6);if(t.biff==2)e.l++;var i=Pn(e,a-e.l,t);n.val=i;return n}function Di(e,r,t,a,n){var i=!n||n.biff==8;var s=Vr(6+2+ +i+(1+i)*t.length);Yn(e,r,a,s);s._W(2,t.length);if(i)s._W(1,1);s._W((1+i)*t.length,t,i?"utf16le":"sbcs");return s}function Fi(e,r,t){var a=e._R(2);var n=Nn(e,0,t);return[a,n]}function Oi(e,r,t,a){var n=t&&t.biff==5;if(!a)a=Vr(n?3+r.length:5+2*r.length);a._W(2,e);a._W(n?1:2,r.length);if(!n)a._W(1,1);a._W((n?1:2)*r.length,r,n?"sbcs":"utf16le");var i=a.length>a.l?a.slice(0,a.l):a;if(i.l==null)i.l=i.length;return i}var Pi=Nn;function Ni(e,r,t){var a=e.l+r;var n=t.biff==8||!t.biff?4:2;var i=e._R(n),s=e._R(n);var l=e._R(2),f=e._R(2);e.l=a;return{s:{r:i,c:l},e:{r:s,c:f}}}function Li(e,r){var t=r.biff==8||!r.biff?4:2;var a=Vr(2*t+6);a._W(t,e.s.r);a._W(t,e.e.r+1);a._W(2,e.s.c);a._W(2,e.e.c+1);a._W(2,0);return a}function Mi(e){var r=e._R(2),t=e._R(2);var a=Jn(e);return{r:r,c:t,ixfe:a[0],rknum:a[1]}}function Ui(e,r){var t=e.l+r-2;var a=e._R(2),n=e._R(2);var i=[];while(e.l>26];if(!a.cellStyles)return n;n.alc=i&7;n.fWrap=i>>3&1;n.alcV=i>>4&7;n.fJustLast=i>>7&1;n.trot=i>>8&255;n.cIndent=i>>16&15;n.fShrinkToFit=i>>20&1;n.iReadOrder=i>>22&2;n.fAtrNum=i>>26&1;n.fAtrFnt=i>>27&1;n.fAtrAlc=i>>28&1;n.fAtrBdr=i>>29&1;n.fAtrPat=i>>30&1;n.fAtrProt=i>>31&1;n.dgLeft=s&15;n.dgRight=s>>4&15;n.dgTop=s>>8&15;n.dgBottom=s>>12&15;n.icvLeft=s>>16&127;n.icvRight=s>>23&127;n.grbitDiag=s>>30&3;n.icvTop=l&127;n.icvBottom=l>>7&127;n.icvDiag=l>>14&127;n.dgDiag=l>>21&15;n.icvFore=f&127;n.icvBack=f>>7&127;n.fsxButton=f>>14&1;return n}function Vi(e,r,t){var a={};a.ifnt=e._R(2);a.numFmtId=e._R(2);a.flags=e._R(2);a.fStyle=a.flags>>2&1;r-=6;a.data=Wi(e,r,a.fStyle,t);return a}function zi(e,r,t,a){var n=t&&t.biff==5;if(!a)a=Vr(n?16:20);a._W(2,0);if(e.style){a._W(2,e.numFmtId||0);a._W(2,65524)}else{a._W(2,e.numFmtId||0);a._W(2,r<<4)}a._W(4,0);a._W(4,0);if(!n)a._W(4,0);a._W(2,0);return a}function Xi(e){e.l+=4;var r=[e._R(2),e._R(2)];if(r[0]!==0)r[0]--;if(r[1]!==0)r[1]--;if(r[0]>7||r[1]>7)throw new Error("Bad Gutters: "+r.join("|"));return r}function Gi(e){var r=Vr(8);r._W(4,0);r._W(2,e[0]?e[0]+1:0);r._W(2,e[1]?e[1]+1:0);return r}function ji(e,r,t){var a=Kn(e,6);if(t.biff==2)++e.l;var n=In(e,2);a.val=n;a.t=n===true||n===false?"b":"e";return a}function Ki(e,r,t,a,n,i){var s=Vr(8);Yn(e,r,a,s);Rn(t,i,s);return s}function Yi(e){var r=Kn(e,6);var t=Wt(e,8);r.val=t;return r}function $i(e,r,t,a){var n=Vr(14);Yn(e,r,a,n);Vt(t,n);return n}var Zi=Zn;function Qi(e,r,t){var a=e.l+r;var n=e._R(2);var i=e._R(2);t.sbcch=i;if(i==1025||i==14849)return[i,n];if(i<1||i>255)throw new Error("Unexpected SupBook type: "+i);var s=On(e,i);var l=[];while(a>e.l)l.push(Pn(e));return[i,n,s,l]}function Ji(e,r,t){var a=e._R(2);var n;var i={fBuiltIn:a&1,fWantAdvise:a>>>1&1,fWantPict:a>>>2&1,fOle:a>>>3&1,fOleLink:a>>>4&1,cf:a>>>5&1023,fIcon:a>>>15&1};if(t.sbcch===14849)n=qn(e,r-2,t);i.body=n||e._R(r-2);if(typeof n==="string")i.Name=n;return i}var qi=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function es(e,r,t){var a=e.l+r;var n=e._R(2);var i=e._R(1);var s=e._R(1);var l=e._R(t&&t.biff==2?1:2);var f=0;if(!t||t.biff>=5){if(t.biff!=5)e.l+=2;f=e._R(2);if(t.biff==5)e.l+=2;e.l+=4}var o=On(e,s,t);if(n&32)o=qi[o.charCodeAt(0)];var c=a-e.l;if(t&&t.biff==2)--c;var u=a==e.l||l===0?[]:pu(e,c,t,l);return{chKey:i,Name:o,itab:f,rgce:u}}function rs(e,r,t){ -if(t.biff<8)return ts(e,r,t);var a=[],n=e.l+r,i=e._R(t.biff>8?4:2);while(i--!==0)a.push(Qn(e,t.biff>8?12:6,t));if(e.l!=n)throw new Error("Bad ExternSheet: "+e.l+" != "+n);return a}function ts(e,r,t){if(e[e.l+1]==3)e[e.l]++;var a=Dn(e,r,t);return a.charCodeAt(0)==3?a.slice(1):a}function as(e,r,t){if(t.biff<8){e.l+=r;return}var a=e._R(2);var n=e._R(2);var i=On(e,a,t);var s=On(e,n,t);return[i,s]}function ns(e,r,t){var a=ti(e,6);e.l++;var n=e._R(1);r-=8;return[mu(e,r,t),n,a]}function is(e,r,t){var a=ai(e,6);switch(t.biff){case 2:e.l++;r-=7;break;case 3:;case 4:e.l+=2;r-=8;break;default:e.l+=6;r-=12;}return[a,du(e,r,t,a)]}function ss(e){var r=e._R(4)!==0;var t=e._R(4)!==0;var a=e._R(4);return[r,t,a]}function ls(e,r,t){if(t.biff<8)return;var a=e._R(2),n=e._R(2);var i=e._R(2),s=e._R(2);var l=Nn(e,0,t);if(t.biff<8)e._R(1);return[{r:a,c:n},l,s,i]}function fs(e,r,t){return ls(e,r,t)}function os(e,r){var t=[];var a=e._R(2);while(a--)t.push(ei(e,r));return t}function cs(e){var r=Vr(2+e.length*8);r._W(2,e.length);for(var t=0;t=(c?l:2*l))break}if(n.length!==l&&n.length!==l*2){throw new Error("cchText: "+l+" != "+n.length)}e.l=a+r;return{t:n}}catch(h){e.l=a+r;return{t:n}}}function ps(e,r){var t=ei(e,8);e.l+=16;var a=zn(e,r-24);return[t,a]}function ms(e){var r=Vr(24);var t=lt(e[0]);r._W(2,t.r);r._W(2,t.r);r._W(2,t.c);r._W(2,t.c);var a="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" ");for(var n=0;n<16;++n)r._W(1,parseInt(a[n],16));return T([r,Xn(e[1])])}function bs(e,r){e._R(2);var t=ei(e,8);var a=e._R((r-10)/2,"dbcs-cont");a=a.replace(x,"");return[t,a]}function gs(e){var r=e[1].Tooltip;var t=Vr(10+2*(r.length+1));t._W(2,2048);var a=lt(e[0]);t._W(2,a.r);t._W(2,a.r);t._W(2,a.c);t._W(2,a.c);for(var n=0;n0)t.push(jn(e,8));return t}function Ss(e){var r=e._R(2);var t=[];while(r-- >0)t.push(jn(e,8));return t}function _s(e){e.l+=2;var r={cxfs:0,crc:0};r.cxfs=e._R(2);r.crc=e._R(4);return r}function Cs(e,r,t){if(!t.cellStyles)return Wr(e,r);var a=t&&t.biff>=12?4:2;var n=e._R(a);var i=e._R(a);var s=e._R(a);var l=e._R(a);var f=e._R(2);if(a==2)e.l+=2;return{s:n,e:i,w:s,ixfe:l,flags:f}}function Bs(e,r){var t={};if(r<32)return t;e.l+=16;t.header=Wt(e,8);t.footer=Wt(e,8);e.l+=2;return t}function Ts(e,r,t){var a={area:false};if(t.biff!=5){e.l+=r;return a}var n=e._R(1);e.l+=3;if(n&16)a.area=true;return a}function xs(e){var r=Vr(2*e);for(var t=0;t0){if(n[n.l]===42){n.l+=u;continue}++n.l;a[++b]=[];E=0;for(E=0;E!=d.length;++E){var S=n.slice(n.l,n.l+d[E].len);n.l+=d[E].len;Hr(S,0);var _=cptable.utils.decode(h,S);switch(d[E].type){case"C":a[b][E]=cptable.utils.decode(h,S);a[b][E]=a[b][E].trim();break;case"D":if(_.length===8)a[b][E]=new Date(+_.slice(0,4),+_.slice(4,6)-1,+_.slice(6,8));else a[b][E]=_;break;case"F":a[b][E]=parseFloat(_.trim());break;case"+":;case"I":a[b][E]=f?S._R(-4,"i")^2147483648:S._R(4,"i");break;case"L":switch(_.toUpperCase()){case"Y":;case"T":a[b][E]=true;break;case"N":;case"F":a[b][E]=false;break;case" ":;case"?":a[b][E]=false;break;default:throw new Error("DBF Unrecognized L:|"+_+"|");}break;case"M":if(!s)throw new Error("DBF Unexpected MEMO for type "+i.toString(16));a[b][E]="##MEMO##"+(f?parseInt(_.trim(),10):S._R(4));break;case"N":a[b][E]=+_.replace(/\u0000/g,"").trim();break;case"@":a[b][E]=new Date(S._R(-8,"f")-621356832e5);break;case"T":a[b][E]=new Date((S._R(4)-2440588)*864e5+S._R(4));break;case"Y":a[b][E]=S._R(4,"i")/1e4;break;case"O":a[b][E]=-S._R(-8,"f");break;case"B":if(l&&d[E].len==8){a[b][E]=S._R(8,"f");break};case"G":;case"P":S.l+=d[E].len;break;case"0":if(d[E].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+d[E].type);}}}if(i!=2)if(n.l0)switch(g){case"ID":break;case"E":break;case"B":break;case"O":break;case"P":if(b[1].charAt(0)=="P")f.push(m.slice(3).replace(/;;/g,";"));break;case"C":for(s=1;s0){u[a].hpt=v;u[a].hpx=Ql(v)}else if(v===0)u[a].hidden=true;break;default:if(r&&r.WTF)throw new Error("SYLK bad record "+m);}if(w<1)o=null;break;default:if(r&&r.WTF)throw new Error("SYLK bad record "+m);}}if(u.length>0)c["!rows"]=u;if(h.length>0)c["!cols"]=h;return[l,c]}function t(r,t){var a=e(r,t);var n=a[0],i=a[1];var s=mt(n,t);z(i).forEach(function(e){s[e]=i[e]});return s}function a(e,r){return vt(t(e,r),r)}function n(e,r,t,a){var n="C;Y"+(t+1)+";X"+(a+1)+";K";switch(e.t){case"n":n+=e.v||0;if(e.f&&!e.F)n+=";E"+Fo(e.f,{r:t,c:a});break;case"b":n+=e.v?"TRUE":"FALSE";break;case"e":n+=e.w||e.v;break;case"d":n+='"'+(e.w||e.v)+'"';break;case"s":n+='"'+e.v.replace(/"/g,"")+'"';break;}return n}function i(e,r){r.forEach(function(r,t){var a="F;W"+(t+1)+" "+(t+1)+" ";if(r.hidden)a+="0";else{if(typeof r.width=="number")r.wpx=Vl(r.width);if(typeof r.wpx=="number")r.wch=zl(r.wpx);if(typeof r.wch=="number")a+=Math.round(r.wch)}if(a.charAt(a.length-1)!=" ")e.push(a)})}function s(e,r){r.forEach(function(r,t){var a="F;";if(r.hidden)a+="M0;";else if(r.hpt)a+="M"+20*r.hpt+";";else if(r.hpx)a+="M"+20*Zl(r.hpx)+";";if(a.length>2)e.push(a+"R"+(t+1))})}function l(e,r){var t=["ID;PWXL;N;E"],a=[];var l=ut(e["!ref"]),f;var o=Array.isArray(e);var c="\r\n";t.push("P;PGeneral");t.push("F;P0;DG0G8;M255");if(e["!cols"])i(t,e["!cols"]);if(e["!rows"])s(t,e["!rows"]);t.push("B;Y"+(l.e.r-l.s.r+1)+";X"+(l.e.c-l.s.c+1)+";D"+[l.s.c,l.s.r,l.e.c,l.e.r].join(" "));for(var u=l.s.r;u<=l.e.r;++u){for(var h=l.s.c;h<=l.e.c;++h){var d=ft({r:u,c:h});f=o?(e[u]||[])[h]:e[d];if(!f||f.v==null&&(!f.f||f.F))continue;a.push(n(f,e,u,h,r))}}return t.join(c)+c+a.join(c)+c+"E"+c}return{to_workbook:a,to_sheet:t,from_sheet:l}}();var Vs=function(){function e(e,t){switch(t.type){case"base64":return r(g.decode(e),t);case"binary":return r(e,t);case"buffer":return r(e.toString("binary"),t);case"array":return r(ae(e),t);}throw new Error("Unrecognized type "+t.type)}function r(e){var r=e.split("\n"),t=-1,a=-1,n=0,i=[];for(;n!==r.length;++n){if(r[n].trim()==="BOT"){i[++t]=[];a=0;continue}if(t<0)continue;var s=r[n].trim().split(",");var l=s[0],f=s[1];++n;var o=r[n].trim();switch(+l){case-1:if(o==="BOT"){i[++t]=[];a=0;continue}else if(o!=="EOD")throw new Error("Unrecognized DIF special command "+o);break;case 0:if(o==="TRUE")i[t][a]=true;else if(o==="FALSE")i[t][a]=false;else if(!isNaN(se(f)))i[t][a]=se(f);else if(!isNaN(le(f).getDate()))i[t][a]=te(f);else i[t][a]=f;++a;break;case 1:o=o.slice(1,o.length-1);i[t][a++]=o!==""?o:null;break;}if(o==="EOD")break}return i}function t(r,t){return mt(e(r,t),t)}function a(e,r){return vt(t(e,r),r)}var n=function(){var e=function t(e,r,a,n,i){e.push(r);e.push(a+","+n);e.push('"'+i.replace(/"/g,'""')+'"')};var r=function a(e,r,t,n){e.push(r+","+t);e.push(r==1?'"'+n.replace(/"/g,'""')+'"':n)};return function n(t){var a=[];var n=ut(t["!ref"]),i;var s=Array.isArray(t);e(a,"TABLE",0,1,"sheetjs");e(a,"VECTORS",0,n.e.r-n.s.r+1,"");e(a,"TUPLES",0,n.e.c-n.s.c+1,"");e(a,"DATA",0,0,"");for(var l=n.s.r;l<=n.e.r;++l){r(a,-1,0,"BOT");for(var f=n.s.c;f<=n.e.c;++f){var o=ft({r:l,c:f});i=s?(t[l]||[])[f]:t[o];if(!i){r(a,1,0,"");continue}switch(i.t){case"n":var c=b?i.w:i.v;if(!c&&i.v!=null)c=i.v;if(c==null){if(b&&i.f&&!i.F)r(a,1,0,"="+i.f);else r(a,1,0,"")}else r(a,0,c,"V");break;case"b":r(a,0,i.v?1:0,i.v?"TRUE":"FALSE");break;case"s":r(a,1,0,!b||isNaN(i.v)?i.v:'="'+i.v+'"');break;case"d":if(!i.w)i.w=A.format(i.z||A._table[14],Q(te(i.v)));if(b)r(a,0,i.w,"V");else r(a,1,0,i.w);break;default:r(a,1,0,"");}}}r(a,-1,0,"EOD");var u="\r\n";var h=a.join(u);return h}}();return{to_workbook:a,to_sheet:t,from_sheet:n}}();var zs=function(){function e(e){return e.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,"\n")}function r(e){return e.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function t(r){var t=r.split("\n"),a=-1,n=-1,i=0,s=[];for(;i!==t.length;++i){var l=t[i].trim().split(":");if(l[0]!=="cell")continue;var f=lt(l[1]);if(s.length<=f.r)for(a=s.length;a<=f.r;++a)if(!s[a])s[a]=[];a=f.r;n=f.c;switch(l[2]){case"t":s[a][n]=e(l[3]);break;case"v":s[a][n]=+l[3];break;case"vtf":var o=l[l.length-1];case"vtc":switch(l[3]){case"nl":s[a][n]=+l[4]?true:false;break;default:s[a][n]=+l[4];break;}if(l[2]=="vtf")s[a][n]=[s[a][n],o];}}return s}function a(e,r){return mt(t(e,r),r)}function n(e,r){return vt(a(e,r),r)}var i=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join("\n");var s=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join("\n")+"\n";var l=["# SocialCalc Spreadsheet Control Save","part:sheet"].join("\n");var f="--SocialCalcSpreadsheetControlSave--";function o(e){if(!e||!e["!ref"])return"";var t=[],a=[],n,i="";var s=ot(e["!ref"]);var l=Array.isArray(e);for(var f=s.s.r;f<=s.e.r;++f){for(var o=s.s.c;o<=s.e.c;++o){i=ft({r:f,c:o});n=l?(e[f]||[])[o]:e[i];if(!n||n.v==null||n.t==="z")continue;a=["cell",i,"t"];switch(n.t){case"s":;case"str":a.push(r(n.v));break;case"n":if(!n.f){a[2]="v";a[3]=n.v}else{a[2]="vtf";a[3]="n";a[4]=n.v;a[5]=r(n.f)}break;case"b":a[2]="vt"+(n.f?"f":"c");a[3]="nl";a[4]=n.v?"1":"0";a[5]=r(n.f||(n.v?"TRUE":"FALSE"));break;case"d":var c=Q(te(n.v));a[2]="vtc";a[3]="nd";a[4]=""+c;a[5]=n.w||A.format(n.z||A._table[14],c);break;case"e":continue;}t.push(a.join(":"))}}t.push("sheet:c:"+(s.e.c-s.s.c+1)+":r:"+(s.e.r-s.s.r+1)+":tvf:1");t.push("valueformat:1:text-wiki");return t.join("\n")}function c(e){return[i,s,l,s,o(e),f].join("\n")}return{to_workbook:n,to_sheet:a,from_sheet:c}}();var Xs=function(){function e(e,r,t,a,n){if(n.raw)r[t][a]=e;else if(e==="TRUE")r[t][a]=true;else if(e==="FALSE")r[t][a]=false;else if(e===""){}else if(!isNaN(se(e)))r[t][a]=se(e);else if(!isNaN(le(e).getDate()))r[t][a]=te(e);else r[t][a]=e}function r(r,t){var a=t||{};var n=[];if(!r||r.length===0)return n;var i=r.split(/[\r\n]/);var s=i.length-1;while(s>=0&&i[s].length===0)--s;var l=10,f=0;var o=0;for(;o<=s;++o){f=i[o].indexOf(" ");if(f==-1)f=i[o].length;else f++;l=Math.max(l,f)}for(o=0;o<=s;++o){n[o]=[];var c=0;e(i[o].slice(0,l).trim(),n,o,c,a);for(c=1;c<=(i[o].length-l)/10+1;++c)e(i[o].slice(l+(c-1)*10,l+c*10).trim(),n,o,c,a)}return n}var t={44:",",9:"\t",59:";"};var a={44:3,9:2,59:1};function n(e){var r={},n=false,i=0,s=0;for(;i0)b();i["!ref"]=ct(s);return i}function s(e,t){if(e.slice(0,4)=="sep=")return i(e,t);if(e.indexOf("\t")>=0||e.indexOf(",")>=0||e.indexOf(";")>=0)return i(e,t);return mt(r(e,t),t)}function l(e,r){var t="",a=r.type=="string"?[0,0,0,0]:Gp(e,r);switch(r.type){case"base64":t=g.decode(e);break;case"binary":t=e;break;case"buffer":t=e.toString("binary");break;case"array":t=ae(e);break;case"string":t=e;break;default:throw new Error("Unrecognized type "+r.type);}if(a[0]==239&&a[1]==187&&a[2]==191)t=He(t.slice(3));else if((r.type=="binary"||r.type=="buffer")&&typeof cptable!=="undefined"&&r.codepage)t=cptable.utils.decode(r.codepage,cptable.utils.encode(1252,t));if(t.slice(0,19)=="socialcalc:version:")return zs.to_sheet(r.type=="string"?t:He(t),r);return s(t,r)}function f(e,r){return vt(l(e,r),r)}function o(e){var r=[];var t=ut(e["!ref"]),a;var n=Array.isArray(e);for(var i=t.s.r;i<=t.e.r;++i){var s=[];for(var l=t.s.c;l<=t.e.c;++l){var f=ft({r:i,c:l});a=n?(e[i]||[])[l]:e[f];if(!a||a.v==null){s.push(" ");continue}var o=(a.w||(dt(a),a.w)||"").slice(0,10);while(o.length<10)o+=" ";s.push(o+(l===0?" ":""))}r.push(s.join(""))}return r.join("\n")}return{to_workbook:f,to_sheet:l,from_sheet:o}}();function Gs(e,r){var t=r||{},a=!!t.WTF;t.WTF=true;try{var n=Ws.to_workbook(e,t);t.WTF=a;return n}catch(i){t.WTF=a;if(!i.message.match(/SYLK bad record ID/)&&a)throw i;return Xs.to_workbook(e,r)}}var js=function(){function e(e,r,t){if(!e)return;Hr(e,e.l||0);var a=t.Enum||E;while(e.l=4096)a.qpro=true;break;case 6:o=e;break;case 15:if(!a.qpro)e[1].v=e[1].v.slice(1);case 13:;case 14:;case 16:;case 51:if(c==14&&(e[2]&112)==112&&(e[2]&15)>1&&(e[2]&15)<15){e[1].z=a.dateNF||A._table[14];if(a.cellDates){e[1].t="d";e[1].v=J(e[1].v)}}if(a.dense){if(!n[e[0].r])n[e[0].r]=[];n[e[0].r][e[0].c]=e[1]}else n[ft(e[0])]=e[1];break;}else switch(c){case 22:e[1].v=e[1].v.slice(1);case 23:;case 24:;case 25:;case 37:;case 39:;case 40:if(e[3]>s){n["!ref"]=ct(o);l[i]=n;n=a.dense?[]:{};o={s:{r:0,c:0},e:{r:0,c:0}};s=e[3];i="Sheet"+(s+1);f.push(i)}if(a.dense){if(!n[e[0].r])n[e[0].r]=[];n[e[0].r][e[0].c]=e[1]}else n[ft(e[0])]=e[1];if(o.e.c>1;if(t[1].v&1){switch(a&7){case 1:a=(a>>3)*500;break;case 2:a=(a>>3)/20;break;case 4:a=(a>>3)/2e3;break;case 6:a=(a>>3)/16;break;case 7:a=(a>>3)/64;break;default:throw"unknown NUMBER_18 encoding "+(a&7);}}t[1].v=a;return t}function h(e,r){var t=o(e,r);var a=e._R(4);var n=e._R(4);var i=e._R(2);if(i==65535){t[1].v=0;return t}var s=i&32768;i=(i&32767)-16446;t[1].v=(s*2-1)*((i>0?n<>>-i)+(i>-32?a<>>-(i+32)));return t}function d(e,r){var t=h(e,14);e.l+=r-14;return t}function v(e,r){var t=o(e,r);var a=e._R(4);t[1].v=a>>6;return t}function p(e,r){var t=o(e,r);var a=e._R(8,"f");t[1].v=a;return t}function b(e,r){var t=p(e,14);e.l+=r-10;return t}var E={0:{n:"BOF",f:xn},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:a},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:s},14:{n:"NUMBER",f:l},15:{n:"LABEL",f:i},16:{n:"FORMULA",f:f},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:i},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},255:{n:"",f:Wr}};var k={0:{n:"BOF"},1:{n:"EOF"},3:{n:"??"},4:{n:"??"},5:{n:"??"},6:{n:"??"},7:{n:"??"},9:{n:"??"},10:{n:"??"},11:{n:"??"},12:{n:"??"},14:{n:"??"},15:{n:"??"},16:{n:"??"},17:{n:"??"},18:{n:"??"},19:{n:"??"},21:{n:"??"},22:{n:"LABEL16",f:c},23:{n:"NUMBER17",f:h},24:{n:"NUMBER18",f:u},25:{n:"FORMULA19",f:d},26:{n:"??"},27:{n:"??"},28:{n:"??"},29:{n:"??"},30:{n:"??"},31:{n:"??"},33:{n:"??"},37:{n:"NUMBER25",f:v},39:{n:"NUMBER27",f:p},40:{n:"FORMULA28",f:b},255:{n:"",f:Wr}};return{to_workbook:r}}();var Ks=function Lm(){var e=Ge("t"),r=Ge("rPr"),t=/<(?:\w+:)?r>/g,a=/<\/(?:\w+:)?r>/,n=/\r\n/g;var i=function f(e,r,t){var a={},n=65001,i="";var l=e.match(Se),f=0;if(l)for(;f!=l.length;++f){var o=Be(l[f]);switch(o[0].replace(/\w*:/g,"")){case"":;case"":a.shadow=1;break;case"":break;case"":;case"":a.outline=1;break;case"":break;case"":;case"":a.strike=1;break;case"":break;case"":;case"":a.u=1;break;case"":break;case"":;case"":a.b=1;break;case"":break;case"":;case"":a.i=1;break;case"":break;case"');if(a.b){r.push("");t.push("")}if(a.i){r.push("");t.push("")}if(a.strike){r.push("");t.push("")}if(i=="superscript")i="sup";else if(i=="subscript")i="sub";if(i!=""){r.push("<"+i+">");t.push("")}t.push("");return n};function l(t){var a=[[],"",[]];var s=t.match(e);if(!s)return"";a[1]=s[1];var l=t.match(r);if(l)i(l[1],a[0],a[2]);return a[0].join("")+a[1].replace(n,"
                      ")+a[2].join("")}return function o(e){return e.replace(t,"").split(a).map(l).join("")}}();var Ys=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,$s=/<(?:\w+:)?r>/;var Zs=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function Qs(e,r){var t=r?r.cellHTML:true;var a={};if(!e)return null;if(e.match(/^\s*<(?:\w+:)?t[^>]*>/)){a.t=Ae(He(e.slice(e.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||""));a.r=He(e);if(t)a.h=Pe(a.t)}else if(e.match($s)){a.r=He(e);a.t=Ae(He((e.replace(Zs,"").match(Ys)||[]).join("").replace(Se,"")));if(t)a.h=Ks(a.r)}return a}var Js=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/;var qs=/<(?:\w+:)?(?:si|sstItem)>/g;var el=/<\/(?:\w+:)?(?:si|sstItem)>/;function rl(e,r){var t=[],a="";if(!e)return t;var n=e.match(Js);if(n){a=n[2].replace(qs,"").split(el);for(var i=0;i!=a.length;++i){var s=Qs(a[i].trim(),r);if(s!=null)t[t.length]=s}n=Be(n[1]);t.Count=n.count;t.Unique=n.uniqueCount}return t}Ta.SST="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings";var tl=/^\s|\s$|[\t\n\r]/;function al(e,r){if(!r.bookSST)return"";var t=[ke];t[t.length]=er("sst",null,{xmlns:ar.main[0],count:e.Count,uniqueCount:e.Unique});for(var a=0;a!=e.length;++a){if(e[a]==null)continue;var n=e[a];var i="";if(n.r)i+=n.r;else{i+=""}i+="";t[t.length]=i}if(t.length>2){t[t.length]="";t[1]=t[1].replace("/>",">")}return t.join("")}function nl(e){return[e._R(4),e._R(4)]}function il(e,r){var t=[];var a=false;zr(e,function n(e,i,s){switch(s){case 159:t.Count=e[0];t.Unique=e[1];break;case 19:t.push(e);break;case 160:return true;case 35:a=true;break;case 36:a=false;break;default:if(i.indexOf("Begin")>0){}else if(i.indexOf("End")>0){}if(!a||r.WTF)throw new Error("Unexpected record "+s+" "+i);}});return t}function sl(e,r){if(!r)r=Vr(8);r._W(4,e.Count);r._W(4,e.Unique);return r}var ll=_t;function fl(e){var r=Xr();Gr(r,"BrtBeginSst",sl(e));for(var t=0;t=4)e.l+=r-4;return t}function ul(e){var r={};r.id=e._R(0,"lpp4");r.R=cl(e,4);r.U=cl(e,4);r.W=cl(e,4);return r}function hl(e){var r=e._R(4);var t=e.l+r-4;var a={};var n=e._R(4);var i=[];while(n-- >0)i.push({t:e._R(4),v:e._R(0,"lpp4")});a.name=e._R(0,"lpp4");a.comps=i;if(e.l!=t)throw new Error("Bad DataSpaceMapEntry: "+e.l+" != "+t);return a}function dl(e){var r=[];e.l+=4;var t=e._R(4);while(t-- >0)r.push(hl(e));return r}function vl(e){var r=[];e.l+=4;var t=e._R(4);while(t-- >0)r.push(e._R(0,"lpp4"));return r}function pl(e){var r={};e._R(4);e.l+=4;r.id=e._R(0,"lpp4");r.name=e._R(0,"lpp4");r.R=cl(e,4);r.U=cl(e,4);r.W=cl(e,4);return r}function ml(e){var r=pl(e);r.ename=e._R(0,"8lpp4");r.blksz=e._R(4);r.cmode=e._R(4);if(e._R(4)!=4)throw new Error("Bad !Primary record"); -return r}function bl(e,r){var t=e.l+r;var a={};a.Flags=e._R(4)&63;e.l+=4;a.AlgID=e._R(4);var n=false;switch(a.AlgID){case 26126:;case 26127:;case 26128:n=a.Flags==36;break;case 26625:n=a.Flags==4;break;case 0:n=a.Flags==16||a.Flags==4||a.Flags==36;break;default:throw"Unrecognized encryption algorithm: "+a.AlgID;}if(!n)throw new Error("Encryption Flags/AlgID mismatch");a.AlgIDHash=e._R(4);a.KeySize=e._R(4);a.ProviderType=e._R(4);e.l+=8;a.CSPName=e._R(t-e.l>>1,"utf16le");e.l=t;return a}function gl(e,r){var t={},a=e.l+r;e.l+=4;t.Salt=e.slice(e.l,e.l+16);e.l+=16;t.Verifier=e.slice(e.l,e.l+16);e.l+=16;e._R(4);t.VerifierHash=e.slice(e.l,a);e.l=a;return t}function El(e){var r=cl(e);switch(r.Minor){case 2:return[r.Minor,kl(e,r)];case 3:return[r.Minor,wl(e,r)];case 4:return[r.Minor,Sl(e,r)];}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+r.Minor)}function kl(e){var r=e._R(4);if((r&63)!=36)throw new Error("EncryptionInfo mismatch");var t=e._R(4);var a=bl(e,t);var n=gl(e,e.length-e.l);return{t:"Std",h:a,v:n}}function wl(){throw new Error("File is password-protected: ECMA-376 Extensible")}function Sl(e){var r=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];e.l+=4;var t=e._R(e.length-e.l,"utf8");var a={};t.replace(Se,function n(e){var t=Be(e);switch(Te(t[0])){case"":break;case"":;case"":break;case"":break;case"4||a.Major<2)throw new Error("unrecognized major version code: "+a.Major);t.Flags=e._R(4);r-=4;var n=e._R(4);r-=4;t.EncryptionHeader=bl(e,n);r-=n;t.EncryptionVerifier=gl(e,r);return t}function Cl(e){var r={};var t=r.EncryptionVersionInfo=cl(e,4);if(t.Major!=1||t.Minor!=1)throw"unrecognized version code "+t.Major+" : "+t.Minor;r.Salt=e._R(16);r.EncryptedVerifier=e._R(16);r.EncryptedVerifierHash=e._R(16);return r}function Bl(e){var r=0,t;var a=ol(e);var n=a.length+1,i,s;var l,f,o;t=k(n);t[0]=a.length;for(i=1;i!=n;++i)t[i]=a[i-1];for(i=n-1;i>=0;--i){s=t[i];l=(r&16384)===0?0:1;f=r<<1&32767;o=l|f;r=o^s}return r^52811}var Tl=function(){var e=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0];var r=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163];var t=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628];var a=function(e){return(e/2|e*128)&255};var n=function(e,r){return a(e^r)};var i=function(e){var a=r[e.length-1];var n=104;for(var i=e.length-1;i>=0;--i){var s=e[i];for(var l=0;l!=7;++l){if(s&64)a^=t[n];s*=2;--n}}return a};return function(r){var t=ol(r);var a=i(t);var s=t.length;var l=k(16);for(var f=0;f!=16;++f)l[f]=0;var o,c,u;if((s&1)===1){o=a>>8;l[s]=n(e[0],o);--s;o=a&255;c=t[t.length-1];l[s]=n(c,o)}while(s>0){--s;o=a>>8;l[s]=n(t[s],o);--s;o=a&255;l[s]=n(t[s],o)}s=15;u=15-t.length;while(u>0){o=a>>8;l[s]=n(e[u],o);--s;--u;o=a&255;l[s]=n(t[s],o);--s;--u}return l}}();var xl=function(e,r,t,a,n){if(!n)n=r;if(!a)a=Tl(e);var i,s;for(i=0;i!=r.length;++i){s=r[i];s^=a[t];s=(s>>5|s<<3)&255;n[i]=s;++t}return[n,t,a]};var yl=function(e){var r=0,t=Tl(e);return function(e){var a=xl("",e,r,t);r=a[1];return a[0]}};function Al(e,r,t,a){var n={key:xn(e),verificationBytes:xn(e)};if(t.password)n.verifier=Bl(t.password);a.valid=n.verificationBytes===n.verifier;if(a.valid)a.insitu=yl(t.password);return n}function Il(e,r,t){var a=t||{};a.Info=e._R(2);e.l-=2;if(a.Info===1)a.Data=Cl(e,r);else a.Data=_l(e,r);return a}function Rl(e,r,t){var a={Type:t.biff>=8?e._R(2):0};if(a.Type)Il(e,r-2,a);else Al(e,t.biff>=8?r:r-2,t,a);return a}var Dl=function(){function e(e,t){switch(t.type){case"base64":return r(g.decode(e),t);case"binary":return r(e,t);case"buffer":return r(e.toString("binary"),t);case"array":return r(ae(e),t);}throw new Error("Unrecognized type "+t.type)}function r(e,r){var t=r||{};var a=t.dense?[]:{};var n={s:{c:0,r:0},e:{c:0,r:0}};if(!e.match(/\\trowd/))throw new Error("RTF missing table");a["!ref"]=ct(n);return a}function t(r,t){return vt(e(r,t),t)}function a(e){var r=["{\\rtf1\\ansi"];var t=ut(e["!ref"]),a;var n=Array.isArray(e);for(var i=t.s.r;i<=t.e.r;++i){r.push("\\trowd\\trautofit1");for(var s=t.s.c;s<=t.e.c;++s)r.push("\\cellx"+(s+1));r.push("\\pard\\intbl");for(s=t.s.c;s<=t.e.c;++s){var l=ft({r:i,c:s});a=n?(e[i]||[])[s]:e[l];if(!a||a.v==null&&(!a.f||a.F))continue;r.push(" "+(a.w||(dt(a),a.w)));r.push("\\cell")}r.push("\\pard\\intbl\\row")}return r.join("")+"}"}return{to_workbook:t,to_sheet:e,from_sheet:a}}();function Fl(e){var r=e.slice(e[0]==="#"?1:0).slice(0,6);return[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)]}function Ol(e){for(var r=0,t=1;r!=3;++r)t=t*256+(e[r]>255?255:e[r]<0?0:e[r]);return t.toString(16).toUpperCase().slice(1)}function Pl(e){var r=e[0]/255,t=e[1]/255,a=e[2]/255;var n=Math.max(r,t,a),i=Math.min(r,t,a),s=n-i;if(s===0)return[0,0,r];var l=0,f=0,o=n+i;f=s/(o>1?2-o:o);switch(n){case r:l=((t-a)/s+6)%6;break;case t:l=(a-r)/s+2;break;case a:l=(r-t)/s+4;break;}return[l/6,f,o/2]}function Nl(e){var r=e[0],t=e[1],a=e[2];var n=t*2*(a<.5?a:1-a),i=a-n/2;var s=[i,i,i],l=6*r;var f;if(t!==0)switch(l|0){case 0:;case 6:f=n*l;s[0]+=n;s[1]+=f;break;case 1:f=n*(2-l);s[0]+=f;s[1]+=n;break;case 2:f=n*(l-2);s[1]+=n;s[2]+=f;break;case 3:f=n*(4-l);s[1]+=f;s[2]+=n;break;case 4:f=n*(l-4);s[2]+=n;s[0]+=f;break;case 5:f=n*(6-l);s[2]+=f;s[0]+=n;break;}for(var o=0;o!=3;++o)s[o]=Math.round(s[o]*255);return s}function Ll(e,r){if(r===0)return e;var t=Pl(Fl(e));if(r<0)t[2]=t[2]*(1+r);else t[2]=1-(1-t[2])*(1-r);return Ol(Nl(t))}var Ml=6,Ul=15,Hl=1,Wl=Ml;function Vl(e){return Math.floor((e+Math.round(128/Wl)/256)*Wl)}function zl(e){return Math.floor((e-5)/Wl*100+.5)/100}function Xl(e){return Math.round((e*Wl+5)/Wl*256)/256}function Gl(e){return Xl(zl(Vl(e)))}function jl(e){var r=Math.abs(e-Gl(e)),t=Wl;if(r>.005)for(Wl=Hl;Wl":;case"":break;case"":;case"":n={};if(t.diagonalUp){n.diagonalUp=t.diagonalUp}if(t.diagonalDown){n.diagonalDown=t.diagonalDown}r.Borders.push(n);break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":;case"":break;case"":break;case"":;case"":break;case"":break;case"":;case"":break;case"":break;case"":;case"":break;case"":break;case"":;case"":break;case"":break;case"":break;case"":;case"":break;default:if(a&&a.WTF)throw new Error("unrecognized "+t[0]+" in borders");}})}function ef(e,r,t,a){r.Fills=[];var n={};e[0].match(Se).forEach(function(e){var t=Be(e);switch(t[0]){case"":;case"":break;case"":;case"":n={};r.Fills.push(n);break;case"":break;case"":break;case"":r.Fills.push(n);n={};break;case"":if(t.patternType)n.patternType=t.patternType;break;case"":;case"":break;case"":;case"":break;case"":;case"":break;case"":break;case"":break;case"":break;case"":break;default:if(a&&a.WTF)throw new Error("unrecognized "+t[0]+" in fills");}})}function rf(e,r,t,a){r.Fonts=[];var n={};e[0].match(Se).forEach(function(e){var i=Be(e);switch(i[0]){case"":;case"":break;case"":break;case"":;case"":r.Fonts.push(n);n={};break;case"":;case"
                      ":break;case"":n.bold=1;break;case"":n.italic=1;break;case"":n.underline=1;break;case"":n.strike=1;break;case"":n.outline=1;break;case"":n.shadow=1;break;case"":n.condense=1;break;case"":n.extend=1;break;case"":;case"":break;case"":;case"":break;case"":;case"":break;case"":;case"":break;case"":;case"":break;default:if(a&&a.WTF)throw new Error("unrecognized "+i[0]+" in fonts");}})}function tf(e,r,t){r.NumberFmt=[];var a=z(A._table);for(var n=0;n":;case"":;case"":break;case"0){if(f>392){for(f=392;f>60;--f)if(r.NumberFmt[f]==null)break;r.NumberFmt[f]=l}A.load(l,f)}}break;case"":break;default:if(t.WTF)throw new Error("unrecognized "+s[0]+" in numFmts");}}}function af(e){var r=[""];[[5,8],[23,26],[41,44],[50,392]].forEach(function(t){for(var a=t[0];a<=t[1];++a)if(e[a]!=null)r[r.length]=er("numFmt",null,{numFmtId:a,formatCode:De(e[a])})});if(r.length===1)return"";r[r.length]="";r[0]=er("numFmts",null,{count:r.length-2}).replace("/>",">");return r.join("")}var nf=["numFmtId","fillId","fontId","borderId","xfId"];var sf=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function lf(e,r,t){r.CellXf=[];var a;e[0].match(Se).forEach(function(e){var n=Be(e),i=0;switch(n[0]){case"":;case"":;case"":break;case"":a=n;delete a[0];for(i=0;i392){for(i=392;i>60;--i)if(r.NumberFmt[a.numFmtId]==r.NumberFmt[i]){a.numFmtId=i;break}}r.CellXf.push(a);break;case"":break;case"":var s={};if(n.vertical)s.vertical=n.vertical;if(n.horizontal)s.horizontal=n.horizontal;if(n.textRotation!=null)s.textRotation=n.textRotation;if(n.indent)s.indent=n.indent;if(n.wrapText)s.wrapText=n.wrapText;a.alignment=s;break;case"":break;case"":;case"":break;case"":break;case"";if(r.length===2)return"";r[0]=er("cellXfs",null,{count:r.length-2}).replace("/>",">");return r.join("")}var of=function Mm(){var e=/]*)>[\S\s]*?<\/numFmts>/;var r=/]*)>[\S\s]*?<\/cellXfs>/;var t=/]*)>[\S\s]*?<\/fills>/;var a=/]*)>[\S\s]*?<\/fonts>/;var n=/]*)>[\S\s]*?<\/borders>/;return function i(s,l,f){var o={};if(!s)return o;s=s.replace(//gm,"").replace(//gm,"");var c;if(c=s.match(e))tf(c,o,f);if(c=s.match(a))rf(c,o,l,f);if(c=s.match(t))ef(c,o,l,f);if(c=s.match(n))ql(c,o,l,f);if(c=s.match(r))lf(c,o,f);return o}}();var cf=er("styleSheet",null,{xmlns:ar.main[0],"xmlns:vt":ar.vt});Ta.STY="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";function uf(e,r){var t=[ke,cf],a;if(e.SSF&&(a=af(e.SSF))!=null)t[t.length]=a;t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';if(a=ff(r.cellXfs))t[t.length]=a;t[t.length]='';t[t.length]='';t[t.length]='';if(t.length>2){t[t.length]="";t[1]=t[1].replace("/>",">")}return t.join("")}function hf(e,r){var t=e._R(2);var a=gt(e,r-2);return[t,a]}function df(e,r,t){if(!t)t=Vr(6+4*r.length);t._W(2,e);Et(r,t);var a=t.length>t.l?t.slice(0,t.l):t;if(t.l==null)t.l=t.length;return a}function vf(e,r,t){var a={};a.sz=e._R(2)/20;var n=Kt(e,2,t);if(n.fCondense)a.condense=1;if(n.fExtend)a.extend=1;if(n.fShadow)a.shadow=1;if(n.fOutline)a.outline=1;if(n.fStrikeout)a.strike=1;if(n.fItalic)a.italic=1;var i=e._R(2);if(i===700)a.bold=1;switch(e._R(2)){case 1:a.vertAlign="superscript";break;case 2:a.vertAlign="subscript";break;}var s=e._R(1);if(s!=0)a.underline=s;var l=e._R(1);if(l>0)a.family=l;var f=e._R(1);if(f>0)a.charset=f;e.l++;a.color=Gt(e,8);switch(e._R(1)){case 1:a.scheme="major";break;case 2:a.scheme="minor";break;}a.name=gt(e,r-21);return a}function pf(e,r){if(!r)r=Vr(25+4*32);r._W(2,e.sz*20);Yt(e,r);r._W(2,e.bold?700:400);var t=0;if(e.vertAlign=="superscript")t=1;else if(e.vertAlign=="subscript")t=2;r._W(2,t);r._W(1,e.underline||0);r._W(1,e.family||0);r._W(1,e.charset||0);r._W(1,0);jt(e.color,r);var a=0;if(e.scheme=="major")a=1;if(e.scheme=="minor")a=2;r._W(1,a);Et(e.name,r);return r.length>r.l?r.slice(0,r.l):r}var mf=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];var bf=G(mf);var gf=Wr;function Ef(e,r){if(!r)r=Vr(4*3+8*7+16*1);var t=bf[e.patternType];if(t==null)t=40;r._W(4,t);var a=0;if(t!=40){jt({auto:1},r);jt({auto:1},r);for(;a<12;++a)r._W(4,0)}else{for(;a<4;++a)r._W(4,0);for(;a<12;++a)r._W(4,0)}return r.length>r.l?r.slice(0,r.l):r}function kf(e,r){var t=e.l+r;var a=e._R(2);var n=e._R(2);e.l=t;return{ixfe:a,numFmtId:n}}function wf(e,r,t){if(!t)t=Vr(16);t._W(2,r||0);t._W(2,e.numFmtId||0);t._W(2,0);t._W(2,0);t._W(2,0);t._W(1,0);t._W(1,0);t._W(1,0);t._W(1,0);t._W(1,0);t._W(1,0);return t}function Sf(e,r){if(!r)r=Vr(10);r._W(1,0);r._W(1,0);r._W(4,0);r._W(4,0);return r}var _f=Wr;function Cf(e,r){if(!r)r=Vr(51);r._W(1,0);Sf(null,r);Sf(null,r);Sf(null,r);Sf(null,r);Sf(null,r);return r.length>r.l?r.slice(0,r.l):r}function Bf(e,r){if(!r)r=Vr(12+4*10);r._W(4,e.xfId);r._W(2,1);r._W(1,+e.builtinId);r._W(1,0);Rt(e.name||"",r);return r.length>r.l?r.slice(0,r.l):r}function Tf(e,r,t){var a=Vr(4+256*2*4);a._W(4,e);Rt(r,a);Rt(t,a);return a.length>a.l?a.slice(0,a.l):a}function xf(e,r,t){var a={};a.NumberFmt=[];for(var n in A._table)a.NumberFmt[n]=A._table[n];a.CellXf=[];a.Fonts=[];var i=[];var s=false;zr(e,function l(e,n,f){switch(f){case 44:a.NumberFmt[e[0]]=e[1];A.load(e[1],e[0]);break;case 43:a.Fonts.push(e);if(e.color.theme!=null&&r&&r.themeElements&&r.themeElements.clrScheme){e.color.rgb=Ll(r.themeElements.clrScheme[e.color.theme].rgb,e.color.tint||0)}break;case 1025:break;case 45:break;case 46:break;case 47:if(i[i.length-1]=="BrtBeginCellXFs"){a.CellXf.push(e)}break;case 48:;case 507:;case 572:;case 475:break;case 1171:;case 2102:;case 1130:;case 512:;case 2095:break;case 35:s=true;break;case 36:s=false;break;case 37:i.push(n);break;case 38:i.pop();break;default:if((n||"").indexOf("Begin")>0)i.push(n);else if((n||"").indexOf("End")>0)i.pop();else if(!s||t.WTF)throw new Error("Unexpected record "+f+" "+n);}});return a}function yf(e,r){if(!r)return;var t=0;[[5,8],[23,26],[41,44],[50,392]].forEach(function(e){for(var a=e[0];a<=e[1];++a)if(r[a]!=null)++t});if(t==0)return;Gr(e,"BrtBeginFmts",bt(t));[[5,8],[23,26],[41,44],[50,392]].forEach(function(t){for(var a=t[0];a<=t[1];++a)if(r[a]!=null)Gr(e,"BrtFmt",df(a,r[a]))});Gr(e,"BrtEndFmts")}function Af(e){var r=1;if(r==0)return;Gr(e,"BrtBeginFonts",bt(r));Gr(e,"BrtFont",pf({sz:12,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}));Gr(e,"BrtEndFonts")}function If(e){var r=2;if(r==0)return;Gr(e,"BrtBeginFills",bt(r));Gr(e,"BrtFill",Ef({patternType:"none"}));Gr(e,"BrtFill",Ef({patternType:"gray125"}));Gr(e,"BrtEndFills")}function Rf(e){var r=1;if(r==0)return;Gr(e,"BrtBeginBorders",bt(r));Gr(e,"BrtBorder",Cf({}));Gr(e,"BrtEndBorders")}function Df(e){var r=1;Gr(e,"BrtBeginCellStyleXFs",bt(r));Gr(e,"BrtXF",wf({numFmtId:0,fontId:0,fillId:0,borderId:0},65535));Gr(e,"BrtEndCellStyleXFs")}function Ff(e,r){Gr(e,"BrtBeginCellXFs",bt(r.length));r.forEach(function(r){Gr(e,"BrtXF",wf(r,0))});Gr(e,"BrtEndCellXFs")}function Of(e){var r=1;Gr(e,"BrtBeginStyles",bt(r));Gr(e,"BrtStyle",Bf({xfId:0,builtinId:0,name:"Normal"}));Gr(e,"BrtEndStyles")}function Pf(e){var r=0;Gr(e,"BrtBeginDXFs",bt(r));Gr(e,"BrtEndDXFs")}function Nf(e){var r=0;Gr(e,"BrtBeginTableStyles",Tf(r,"TableStyleMedium9","PivotStyleMedium4"));Gr(e,"BrtEndTableStyles")}function Lf(){return}function Mf(e,r){var t=Xr();Gr(t,"BrtBeginStyleSheet");yf(t,e.SSF);Af(t,e);If(t,e);Rf(t,e);Df(t,e);Ff(t,r.cellXfs);Of(t,e);Pf(t,e);Nf(t,e);Lf(t,e);Gr(t,"BrtEndStyleSheet");return t.end()}Ta.THEME="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";function Uf(e,r,t){r.themeElements.clrScheme=[];var a={};(e[0].match(Se)||[]).forEach(function(e){var n=Be(e);switch(n[0]){case"":break;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":if(n[0].charAt(1)==="/"){r.themeElements.clrScheme.push(a);a={}}else{a.name=n[0].slice(3,n[0].length-1)}break;default:if(t&&t.WTF)throw new Error("Unrecognized "+n[0]+" in clrScheme");}})}function Hf(){}function Wf(){}var Vf=/]*)>[\s\S]*<\/a:clrScheme>/;var zf=/]*)>[\s\S]*<\/a:fontScheme>/;var Xf=/]*)>[\s\S]*<\/a:fmtScheme>/;function Gf(e,r,t){r.themeElements={};var a;[["clrScheme",Vf,Uf],["fontScheme",zf,Hf],["fmtScheme",Xf,Wf]].forEach(function(n){if(!(a=e.match(n[1])))throw new Error(n[0]+" not found in themeElements");n[2](a,r,t)})}var jf=/]*)>[\s\S]*<\/a:themeElements>/;function Kf(e,r){if(!e||e.length===0)return Kf(Yf());var t;var a={};if(!(t=e.match(jf)))throw new Error("themeElements not found in theme");Gf(t[0],a,r);return a}function Yf(e,r){if(r&&r.themeXLSX)return r.themeXLSX;var t=[ke];t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]=""; -t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";return t.join("")}function $f(e,r,t){var a=e.l+r;var n=e._R(4);if(n===124226)return;if(!t.cellStyles||!ge){e.l=a;return}var i=e.slice(e.l);e.l=a;var s;try{s=new ge(i)}catch(l){return}var f=me(s,"theme/theme/theme1.xml",true);if(!f)return;return Kf(f,t)}function Zf(e){return e._R(4)}function Qf(e){var r={};r.xclrType=e._R(2);r.nTintShade=e._R(2);switch(r.xclrType){case 0:e.l+=4;break;case 1:r.xclrValue=Jf(e,4);break;case 2:r.xclrValue=Gn(e,4);break;case 3:r.xclrValue=Zf(e,4);break;case 4:e.l+=4;break;}e.l+=8;return r}function Jf(e,r){return Wr(e,r)}function qf(e,r){return Wr(e,r)}function eo(e){var r=e._R(2);var t=e._R(2)-4;var a=[r];switch(r){case 4:;case 5:;case 7:;case 8:;case 9:;case 10:;case 11:;case 13:a[1]=Qf(e,t);break;case 6:a[1]=qf(e,t);break;case 14:;case 15:a[1]=e._R(t===1?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+r+" "+t);}return a}function ro(e,r){var t=e.l+r;e.l+=2;var a=e._R(2);e.l+=2;var n=e._R(2);var i=[];while(n-- >0)i.push(eo(e,t-e.l));return{ixfe:a,ext:i}}function to(e,r){r.forEach(function(e){switch(e[0]){case 4:break;case 5:break;case 6:break;case 7:break;case 8:break;case 9:break;case 10:break;case 11:break;case 13:break;case 14:break;case 15:break;}})}function ao(e){var r=[];if(!e)return r;var t=1;(e.match(Se)||[]).forEach(function(e){var a=Be(e);switch(a[0]){case"":;case"":break;case"0){}else if((r||"").indexOf("End")>0){}else if(!n||t.WTF)throw new Error("Unexpected record "+s+" "+r);}});return a}function so(){}function lo(e,r,t){if(!e)return e;var a=t||{};var n=false,i=false;zr(e,function s(e,r,t){if(i)return;switch(t){case 359:;case 363:;case 364:;case 366:;case 367:;case 368:;case 369:;case 370:;case 371:;case 472:;case 577:;case 578:;case 579:;case 580:;case 581:;case 582:;case 583:;case 584:;case 585:;case 586:;case 587:break;case 35:n=true;break;case 36:n=false;break;default:if((r||"").indexOf("Begin")>0){}else if((r||"").indexOf("End")>0){}else if(!n||a.WTF)throw new Error("Unexpected record "+t.toString(16)+" "+r);}},a)}Ta.IMG="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";Ta.DRAW="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing";function fo(e,r){if(!e)return"??";var t=(e.match(/]*r:id="([^"]*)"/)||["",""])[1];return r["!id"][t].Target}var oo=1024;function co(e,r){var t=[21600,21600];var a=["m0,0l0",t[1],t[0],t[1],t[0],"0xe"].join(",");var n=[er("xml",null,{"xmlns:v":nr.v,"xmlns:o":nr.o,"xmlns:x":nr.x,"xmlns:mv":nr.mv}).replace(/\/>/,">"),er("o:shapelayout",er("o:idmap",null,{"v:ext":"edit",data:e}),{"v:ext":"edit"}),er("v:shapetype",[er("v:stroke",null,{joinstyle:"miter"}),er("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:t.join(","),path:a})];while(oo",er("v:fill",er("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}),{color2:"#BEFF82",angle:"-180",type:"gradient"}),er("v:shadow",null,{on:"t",obscured:"t"}),er("v:path",null,{"o:connecttype":"none"}),'
                      ','',"","",Je("x:Anchor",[r.c,0,r.r,0,r.c+3,100,r.r+5,100].join(",")),Je("x:AutoFill","False"),Je("x:Row",String(r.r)),Je("x:Column",String(r.c)),"","",""])});n.push("");return n.join("")}Ta.CMNT="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";function uo(e,r,t,a,n){for(var i=0;i!=r.length;++i){var s=r[i];var l=av(pe(e,s.replace(/^\//,""),true),s,n);if(!l||!l.length)continue;var f=z(t);for(var o=0;o!=f.length;++o){var c=f[o];var u=a[c];if(u){var h=u[s];if(h)ho(c,t[c],l)}}}}function ho(e,r,t){var a=Array.isArray(r);var n,i;t.forEach(function(e){if(a){i=lt(e.ref);if(!r[i.r])r[i.r]=[];n=r[i.r][i.c]}else n=r[e.ref];if(!n){n={};if(a)r[i.r][i.c]=n;else r[e.ref]=n;var t=ut(r["!ref"]||"BDWGO1000001:A1");var s=lt(e.ref);if(t.s.r>s.r)t.s.r=s.r;if(t.e.rs.c)t.s.c=s.c;if(t.e.c/))return[];var t=[];var a=[];var n=e.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);if(n&&n[1])n[1].split(/<\/\w*:?author>/).forEach(function(e){if(e===""||e.trim()==="")return;var r=e.match(/<(?:\w+:)?author[^>]*>(.*)/);if(r)t.push(r[1])});var i=e.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);if(i&&i[1])i[1].split(/<\/\w*:?comment>/).forEach(function(e){if(e===""||e.trim()==="")return;var n=e.match(/<(?:\w+:)?comment[^>]*>/);if(!n)return;var i=Be(n[0]);var s={author:i.authorId&&t[i.authorId]||"sheetjsghost",ref:i.ref,guid:i.guid};var l=lt(i.ref);if(r.sheetRows&&r.sheetRows<=l.r)return;var f=e.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/);var o=!!f&&!!f[1]&&Qs(f[1])||{r:"",t:"",h:""};s.r=o.r;if(o.r=="")o.t=o.h="";s.t=o.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(r.cellHTML)s.h=o.h;a.push(s)});return a}var po=er("comments",null,{xmlns:ar.main[0]});function mo(e){var r=[ke,po];var t=[];r.push("");e.forEach(function(e){e[1].forEach(function(e){var a=De(e.a);if(t.indexOf(a)>-1)return;t.push(a);r.push(""+a+"")})});r.push("");r.push("");e.forEach(function(e){e[1].forEach(function(a){r.push('');r.push(Je("t",a.t==null?"":a.t));r.push("")})});r.push("");if(r.length>2){r[r.length]="";r[1]=r[1].replace("/>",">")}return r.join("")}function bo(e){var r={};r.iauthor=e._R(4);var t=Ut(e,16);r.rfx=t.s;r.ref=ft(t.s);e.l+=16;return r}function go(e,r){if(r==null)r=Vr(36);r._W(4,e[1].iauthor);Ht(e[0],r);r._W(4,0);r._W(4,0);r._W(4,0);r._W(4,0);return r}var Eo=gt;function ko(e){return Et(e.slice(0,54))}function wo(e,r){var t=[];var a=[];var n={};var i=false;zr(e,function s(e,l,f){switch(f){case 632:a.push(e);break;case 635:n=e;break;case 637:n.t=e.t;n.h=e.h;n.r=e.r;break;case 636:n.author=a[n.iauthor];delete n.iauthor;if(r.sheetRows&&r.sheetRows<=n.rfx.r)break;if(!n.t)n.t="";delete n.rfx;t.push(n);break;case 35:i=true;break;case 36:i=false;break;case 37:break;case 38:break;default:if((l||"").indexOf("Begin")>0){}else if((l||"").indexOf("End")>0){}else if(!i||r.WTF)throw new Error("Unexpected record "+f+" "+l);}});return t}function So(e){var r=Xr();var t=[];Gr(r,"BrtBeginComments");Gr(r,"BrtBeginCommentAuthors");e.forEach(function(e){e[1].forEach(function(e){if(t.indexOf(e.a)>-1)return;t.push(e.a.slice(0,54));Gr(r,"BrtCommentAuthor",ko(e.a))})});Gr(r,"BrtEndCommentAuthors");Gr(r,"BrtBeginCommentList");e.forEach(function(e){e[1].forEach(function(a){a.iauthor=t.indexOf(a.a);var n={s:lt(e[0]),e:lt(e[0])};Gr(r,"BrtBeginComment",go([n,a]));if(a.t&&a.t.length>0)Gr(r,"BrtCommentText",Bt(a));Gr(r,"BrtEndComment");delete a.iauthor})});Gr(r,"BrtEndCommentList");Gr(r,"BrtEndComments");return r.end()}var _o="application/vnd.ms-office.vbaProject";function Co(e){var r=L.utils.cfb_new({root:"R"});e.FullPaths.forEach(function(t,a){if(t.slice(-1)==="/"||!t.match(/_VBA_PROJECT_CUR/))return;var n=t.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");L.utils.cfb_add(r,n,e.FileIndex[a].content)});return L.write(r)}function Bo(e,r){r.FullPaths.forEach(function(t,a){if(a==0)return;var n=t.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");if(n.slice(-1)!=="/")L.utils.cfb_add(e,n,r.FileIndex[a].content)})}var To=["xlsb","xlsm","xlam","biff8","xla"];Ta.DS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet";Ta.MS="http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet";function xo(){return{"!type":"dialog"}}function yo(){return{"!type":"dialog"}}function Ao(){return{"!type":"macro"}}function Io(){return{"!type":"macro"}}var Ro=function(){var e=/(^|[^A-Za-z])R(\[?)(-?\d+|)\]?C(\[?)(-?\d+|)\]?/g;var r={r:0,c:0};function t(e,t,a,n,i,s){var l=n.length>0?parseInt(n,10)|0:0,f=s.length>0?parseInt(s,10)|0:0;if(f<0&&i.length===0)f=0;var o=false,c=false;if(i.length>0||s.length==0)o=true;if(o)f+=r.c;else--f;if(a.length>0||n.length==0)c=true;if(c)l+=r.r;else--l;return t+(o?"":"$")+at(f)+(c?"":"$")+qr(l)}return function a(n,i){r=i;return n.replace(e,t)}}();var Do=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)([1-9]\d{0,5}|10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6])(?![_.\(A-Za-z0-9])/g;var Fo=function(){return function e(r,t){return r.replace(Do,function(e,r,a,n,i,s){var l=tt(n)-(a?0:t.c);var f=Jr(s)-(i?0:t.r);var o=f==0?"":!i?"["+f+"]":f+1;var c=l==0?"":!a?"["+l+"]":l+1;return r+"R"+o+"C"+c})}}();function Oo(e,r){return e.replace(Do,function(e,t,a,n,i,s){return t+(a=="$"?a+n:at(tt(n)+r.c))+(i=="$"?i+s:qr(Jr(s)+r.r))})}function Po(e,r,t){var a=ot(r),n=a.s,i=lt(t);var s={r:i.r-n.r,c:i.c-n.c};return Oo(e,s)}function No(e){if(e.length==1)return false;return true}function Lo(e){return e.replace(/_xlfn\./g,"")}function Mo(e){e.l+=1;return}function Uo(e,r){var t=e._R(r==1?1:2);return[t&16383,t>>14&1,t>>15&1]}function Ho(e,r,t){var a=2;if(t){if(t.biff>=2&&t.biff<=5)return Wo(e,r,t);else if(t.biff==12)a=4}var n=e._R(a),i=e._R(a);var s=Uo(e,2);var l=Uo(e,2);return{s:{r:n,c:s[0],cRel:s[1],rRel:s[2]},e:{r:i,c:l[0],cRel:l[1],rRel:l[2]}}}function Wo(e){var r=Uo(e,2),t=Uo(e,2);var a=e._R(1);var n=e._R(1);return{s:{r:r[0],c:a,cRel:r[1],rRel:r[2]},e:{r:t[0],c:n,cRel:t[1],rRel:t[2]}}}function Vo(e,r,t){if(t.biff<8)return Wo(e,r,t);var a=e._R(t.biff==12?4:2),n=e._R(t.biff==12?4:2);var i=Uo(e,2);var s=Uo(e,2);return{s:{r:a,c:i[0],cRel:i[1],rRel:i[2]},e:{r:n,c:s[0],cRel:s[1],rRel:s[2]}}}function zo(e,r,t){if(t&&t.biff>=2&&t.biff<=5)return Xo(e,r,t);var a=e._R(t&&t.biff==12?4:2);var n=Uo(e,2);return{r:a,c:n[0],cRel:n[1],rRel:n[2]}}function Xo(e){var r=Uo(e,2);var t=e._R(1);return{r:r[0],c:t,cRel:r[1],rRel:r[2]}}function Go(e){var r=e._R(2);var t=e._R(2);return{r:r,c:t&255,fQuoted:!!(t&16384),cRel:t>>15,rRel:t>>15}}function jo(e,r,t){var a=t&&t.biff?t.biff:8;if(a>=2&&a<=5)return Ko(e,r,t);var n=e._R(a>=12?4:2);var i=e._R(2);var s=(i&16384)>>14,l=(i&32768)>>15;i&=16383;if(l==1)while(n>524287)n-=1048576;if(s==1)while(i>8191)i=i-16384;return{r:n,c:i,cRel:s,rRel:l}}function Ko(e){var r=e._R(2);var t=e._R(1);var a=(r&32768)>>15,n=(r&16384)>>14;r&=16383;if(a==1&&r>=8192)r=r-16384;if(n==1&&t>=128)t=t-256;return{r:r,c:t,cRel:n,rRel:a}}function Yo(e,r,t){var a=(e[e.l++]&96)>>5;var n=Ho(e,t.biff>=2&&t.biff<=5?6:8,t);return[a,n]}function $o(e,r,t){var a=(e[e.l++]&96)>>5;var n=e._R(2,"i");var i=8;if(t)switch(t.biff){case 5:e.l+=12;i=6;break;case 12:i=12;break;}var s=Ho(e,i,t);return[a,n,s]}function Zo(e,r,t){var a=(e[e.l++]&96)>>5;e.l+=t&&t.biff>8?12:t.biff<8?6:8;return[a]}function Qo(e,r,t){var a=(e[e.l++]&96)>>5;var n=e._R(2);var i=8;if(t)switch(t.biff){case 5:e.l+=12;i=6;break;case 12:i=12;break;}e.l+=i;return[a,n]}function Jo(e,r,t){var a=(e[e.l++]&96)>>5;var n=Vo(e,r-1,t);return[a,n]}function qo(e,r,t){var a=(e[e.l++]&96)>>5;e.l+=t.biff==2?6:t.biff==12?14:7;return[a]}function ec(e){var r=e[e.l+1]&1;var t=1;e.l+=4;return[r,t]}function rc(e,r,t){e.l+=2;var a=e._R(t&&t.biff==2?1:2);var n=[];for(var i=0;i<=a;++i)n.push(e._R(t&&t.biff==2?1:2));return n}function tc(e,r,t){var a=e[e.l+1]&255?1:0;e.l+=2;return[a,e._R(t&&t.biff==2?1:2)]}function ac(e,r,t){var a=e[e.l+1]&255?1:0;e.l+=2;return[a,e._R(t&&t.biff==2?1:2)]}function nc(e){var r=e[e.l+1]&255?1:0;e.l+=2;return[r,e._R(2)]}function ic(e,r,t){var a=e[e.l+1]&255?1:0;e.l+=t&&t.biff==2?3:4;return[a]}function sc(e){var r=e._R(1),t=e._R(1);return[r,t]}function lc(e){e._R(2);return sc(e,2)}function fc(e){e._R(2);return sc(e,2)}function oc(e,r,t){var a=(e[e.l]&96)>>5;e.l+=1;var n=zo(e,0,t);return[a,n]}function cc(e,r,t){var a=(e[e.l]&96)>>5;e.l+=1;var n=jo(e,0,t);return[a,n]}function uc(e,r,t){var a=(e[e.l]&96)>>5;e.l+=1;var n=e._R(2);if(t&&t.biff==5)e.l+=12;var i=zo(e,0,t);return[a,n,i]}function hc(e,r,t){var a=(e[e.l]&96)>>5;e.l+=1;var n=e._R(t&&t.biff<=3?1:2);return[Tu[n],Bu[n],a]}function dc(e,r,t){var a=e[e.l++];var n=e._R(1),i=t&&t.biff<=3?[a==88?-1:0,e._R(1)]:vc(e);return[n,(i[0]===0?Bu:Cu)[i[1]]]}function vc(e){return[e[e.l+1]>>7,e._R(2)&32767]}function pc(e,r,t){e.l+=t&&t.biff==2?3:4;return}function mc(e,r,t){e.l++;if(t&&t.biff==12)return[e._R(4,"i"),0];var a=e._R(2);var n=e._R(t&&t.biff==2?1:2);return[a,n]}function bc(e){e.l++;return zt[e._R(1)]}function gc(e){e.l++;return e._R(2)}function Ec(e){e.l++;return e._R(1)!==0}function kc(e){e.l++;return Wt(e,8)}function wc(e,r,t){e.l++;return Dn(e,r-1,t)}function Sc(e,r){var t=[e._R(1)];if(r==12)switch(t[0]){case 2:t[0]=4;break;case 4:t[0]=16;break;case 0:t[0]=1;break;case 1:t[0]=2;break;}switch(t[0]){case 4:t[1]=Bn(e,1)?"TRUE":"FALSE";if(r!=12)e.l+=7;break;case 16:t[1]=zt[e[e.l]];e.l+=r==12?4:8;break;case 0:e.l+=8;break;case 1:t[1]=Wt(e,8);break;case 2:t[1]=Nn(e,0,{biff:r>0&&r<8?2:r});break;default:throw"Bad SerAr: "+t[0];}return t}function _c(e,r,t){var a=e._R(t.biff==12?4:2);var n=[];for(var i=0;i!=a;++i)n.push((t.biff==12?Ut:ei)(e,8));return n}function Cc(e,r,t){var a=0,n=0;if(t.biff==12){a=e._R(4);n=e._R(4)}else{n=1+e._R(1);a=1+e._R(2)}if(t.biff>=2&&t.biff<8){--a;if(--n==0)n=256}for(var i=0,s=[];i!=a&&(s[i]=[]);++i)for(var l=0;l!=n;++l)s[i][l]=Sc(e,t.biff);return s}function Bc(e,r,t){var a=e._R(1)>>>5&3;var n=!t||t.biff>=8?4:2;var i=e._R(n);switch(t.biff){case 2:e.l+=5;break;case 3:;case 4:e.l+=8;break;case 5:e.l+=12;break;}return[a,0,i]}function Tc(e,r,t){if(t.biff==5)return xc(e,r,t);var a=e._R(1)>>>5&3;var n=e._R(2);var i=e._R(4);return[a,n,i]}function xc(e){var r=e._R(1)>>>5&3;var t=e._R(2,"i");e.l+=8;var a=e._R(2);e.l+=12;return[r,t,a]}function yc(e,r,t){var a=e._R(1)>>>5&3;e.l+=t&&t.biff==2?3:4;var n=e._R(t&&t.biff==2?1:2);return[a,n]}function Ac(e,r,t){var a=e._R(1)>>>5&3;var n=e._R(t&&t.biff==2?1:2);return[a,n]}function Ic(e,r,t){var a=e._R(1)>>>5&3;e.l+=4;if(t.biff<8)e.l--;if(t.biff==12)e.l+=2;return[a]}function Rc(e,r,t){var a=(e[e.l++]&96)>>5;var n=e._R(2);var i=4;if(t)switch(t.biff){case 5:i=15;break;case 12:i=6;break;}e.l+=i;return[a,n]}var Dc=Wr;var Fc=Wr;var Oc=Wr;function Pc(e,r,t){e.l+=2;return[Go(e,4,t)]}function Nc(e){e.l+=6;return[]}var Lc=Pc;var Mc=Nc;var Uc=Nc;var Hc=Pc;function Wc(e){e.l+=2;return[xn(e),e._R(2)&1]}var Vc=Pc;var zc=Wc;var Xc=Nc;var Gc=Pc;var jc=Pc;var Kc=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function Yc(e){e.l+=2;var r=e._R(2);var t=e._R(2);var a=e._R(4);var n=e._R(2);var i=e._R(2);var s=Kc[t>>2&31];return{ixti:r,coltype:t&3,rt:s,idx:a,c:n,C:i}}function $c(e){e.l+=2;return[e._R(4)]}function Zc(e,r,t){e.l+=5;e.l+=2;e.l+=t.biff==2?1:4;return["PTGSHEET"]}function Qc(e,r,t){e.l+=t.biff==2?4:5;return["PTGENDSHEET"]}function Jc(e){var r=e._R(1)>>>5&3;var t=e._R(2);return[r,t]}function qc(e){var r=e._R(1)>>>5&3;var t=e._R(2);return[r,t]}function eu(e){e.l+=4;return[0,0]}var ru={1:{n:"PtgExp",f:mc},2:{n:"PtgTbl",f:Oc},3:{n:"PtgAdd",f:Mo},4:{n:"PtgSub",f:Mo},5:{n:"PtgMul",f:Mo},6:{n:"PtgDiv",f:Mo},7:{n:"PtgPower",f:Mo},8:{n:"PtgConcat",f:Mo},9:{n:"PtgLt",f:Mo},10:{n:"PtgLe",f:Mo},11:{n:"PtgEq",f:Mo},12:{n:"PtgGe",f:Mo},13:{n:"PtgGt",f:Mo},14:{n:"PtgNe",f:Mo},15:{n:"PtgIsect",f:Mo},16:{n:"PtgUnion",f:Mo},17:{n:"PtgRange",f:Mo},18:{n:"PtgUplus",f:Mo},19:{n:"PtgUminus",f:Mo},20:{n:"PtgPercent",f:Mo},21:{n:"PtgParen",f:Mo},22:{n:"PtgMissArg",f:Mo},23:{n:"PtgStr",f:wc},26:{n:"PtgSheet",f:Zc},27:{n:"PtgEndSheet",f:Qc},28:{n:"PtgErr",f:bc},29:{n:"PtgBool",f:Ec},30:{n:"PtgInt",f:gc},31:{n:"PtgNum",f:kc},32:{n:"PtgArray",f:qo},33:{n:"PtgFunc",f:hc},34:{n:"PtgFuncVar",f:dc},35:{n:"PtgName",f:Bc},36:{n:"PtgRef",f:oc},37:{n:"PtgArea",f:Yo},38:{n:"PtgMemArea",f:yc},39:{n:"PtgMemErr",f:Dc},40:{n:"PtgMemNoMem",f:Fc},41:{n:"PtgMemFunc",f:Ac},42:{n:"PtgRefErr",f:Ic},43:{n:"PtgAreaErr",f:Zo},44:{n:"PtgRefN",f:cc},45:{n:"PtgAreaN",f:Jo},46:{n:"PtgMemAreaN",f:Jc},47:{n:"PtgMemNoMemN",f:qc},57:{n:"PtgNameX",f:Tc},58:{n:"PtgRef3d",f:uc},59:{n:"PtgArea3d",f:$o},60:{n:"PtgRefErr3d",f:Rc},61:{n:"PtgAreaErr3d",f:Qo},255:{}};var tu={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61};(function(){for(var e in tu)ru[e]=ru[tu[e]]})();var au={1:{n:"PtgElfLel",f:Wc},2:{n:"PtgElfRw",f:Gc},3:{n:"PtgElfCol",f:Lc},6:{n:"PtgElfRwV",f:jc},7:{n:"PtgElfColV",f:Hc},10:{n:"PtgElfRadical",f:Vc},11:{n:"PtgElfRadicalS",f:Xc},13:{n:"PtgElfColS",f:Mc},15:{n:"PtgElfColSV",f:Uc},16:{n:"PtgElfRadicalLel",f:zc},25:{n:"PtgList",f:Yc},29:{n:"PtgSxName",f:$c},255:{}};var nu={0:{n:"PtgAttrNoop",f:eu},1:{n:"PtgAttrSemi",f:ic},2:{n:"PtgAttrIf",f:ac},4:{n:"PtgAttrChoose",f:rc},8:{n:"PtgAttrGoto",f:tc},16:{n:"PtgAttrSum",f:pc},32:{n:"PtgAttrBaxcel",f:ec},64:{n:"PtgAttrSpace",f:lc},65:{n:"PtgAttrSpaceSemi",f:fc},128:{n:"PtgAttrIfError",f:nc},255:{}};nu[33]=nu[32];function iu(e,r,t,a){if(a.biff<8)return Wr(e,r);var n=e.l+r;var i=[];for(var s=0;s!==t.length;++s){switch(t[s][0]){case"PtgArray":t[s][1]=Cc(e,0,a);i.push(t[s][1]);break;case"PtgMemArea":t[s][2]=_c(e,t[s][1],a);i.push(t[s][2]);break;case"PtgExp":if(a&&a.biff==12){t[s][1][1]=e._R(4);i.push(t[s][1])}break;case"PtgList":;case"PtgElfRadicalS":;case"PtgElfColS":;case"PtgElfColSV":throw"Unsupported "+t[s][0];default:break;}}r=n-e.l;if(r!==0)i.push(Wr(e,r));return i}function su(e,r,t){var a=e.l+r;var n,i,s=[];while(a!=e.l){r=a-e.l;i=e[e.l];n=ru[i];if(i===24||i===25)n=(i===24?au:nu)[e[e.l+1]];if(!n||!n.f){Wr(e,r)}else{s.push([n.n,n.f(e,r,t)])}}return s}function lu(e){var r=[];for(var t=0;t=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function ou(e,r){if(!e&&!(r&&r.biff<=5&&r.biff>=2))throw new Error("empty sheet name");if(e.indexOf(" ")>-1)return"'"+e+"'";return e}function cu(e,r,t){if(!e)return"SH33TJSERR0";if(!e.XTI)return"SH33TJSERR6";var a=e.XTI[r];if(t.biff>8&&!e.XTI[r])return e.SheetNames[r];if(t.biff<8){if(r>1e4)r-=65536;if(r<0)r=-r;return r==0?"":e.XTI[r-1]}if(!a)return"SH33TJSERR1";var n="";if(t.biff>8)switch(e[a[0]][0]){case 357:n=a[1]==-1?"#REF":e.SheetNames[a[1]];return a[1]==a[2]?n:n+":"+e.SheetNames[a[2]];case 358:if(t.SID!=null)return e.SheetNames[t.SID];return"SH33TJSSAME"+e[a[0]][0];case 355:;default:return"SH33TJSSRC"+e[a[0]][0];}switch(e[a[0]][0][0]){case 1025:n=a[1]==-1?"#REF":e.SheetNames[a[1]]||"SH33TJSERR3";return a[1]==a[2]?n:n+":"+e.SheetNames[a[2]];case 14849:return"SH33TJSERR8";default:if(!e[a[0]][0][3])return"SH33TJSERR2";n=a[1]==-1?"#REF":e[a[0]][0][3][a[1]]||"SH33TJSERR4";return a[1]==a[2]?n:n+":"+e[a[0]][0][3][a[2]];}}function uu(e,r,t){return ou(cu(e,r,t),t)}function hu(e,r,t,a,n){var i=n&&n.biff||8;var s={s:{c:0,r:0},e:{c:0,r:0}};var l=[],f,o,c,u=0,h=0,d,v="";if(!e[0]||!e[0][0])return"";var p=-1,m="";for(var b=0,g=e[0].length;b=0){switch(e[0][p][1][0]){case 0:m=ie(" ",e[0][p][1][1]);break;case 1:m=ie("\r",e[0][p][1][1]);break;default:m="";if(n.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][p][1][0]);}o=o+m;p=-1}l.push(o+fu[E[0]]+f);break;case"PtgIsect":f=l.pop();o=l.pop();l.push(o+" "+f);break;case"PtgUnion":f=l.pop();o=l.pop();l.push(o+","+f);break;case"PtgRange":f=l.pop();o=l.pop();l.push(o+":"+f);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":c=jr(E[1][1],s,n);l.push(Yr(c,i));break;case"PtgRefN":c=t?jr(E[1][1],t,n):E[1][1];l.push(Yr(c,i));break;case"PtgRef3d":u=E[1][1];c=jr(E[1][2],s,n);v=uu(a,u,n);var k=v;l.push(v+"!"+Yr(c,i));break;case"PtgFunc":;case"PtgFuncVar":var w=E[1][0],S=E[1][1];if(!w)w=0;w&=127;var _=w==0?[]:l.slice(-w);l.length-=w;if(S==="User")S=_.shift();l.push(S+"("+_.join(",")+")");break;case"PtgBool":l.push(E[1]?"TRUE":"FALSE");break;case"PtgInt":l.push(E[1]);break;case"PtgNum":l.push(String(E[1]));break;case"PtgStr":l.push('"'+E[1]+'"');break;case"PtgErr":l.push(E[1]);break;case"PtgAreaN":d=Kr(E[1][1],t?{s:t}:s,n);l.push($r(d,n));break;case"PtgArea":d=Kr(E[1][1],s,n);l.push($r(d,n));break;case"PtgArea3d":u=E[1][1];d=E[1][2];v=uu(a,u,n);l.push(v+"!"+$r(d,n));break;case"PtgAttrSum":l.push("SUM("+l.pop()+")");break;case"PtgAttrBaxcel":;case"PtgAttrSemi":break;case"PtgName":h=E[1][2];var C=(a.names||[])[h-1]||(a[0]||[])[h];var B=C?C.Name:"SH33TJSNAME"+String(h);if(B in xu)B=xu[B];l.push(B);break;case"PtgNameX":var T=E[1][1];h=E[1][2];var x;if(n.biff<=5){if(T<0)T=-T;if(a[T])x=a[T][h]}else{var y="";if(((a[T]||[])[0]||[])[0]==14849){}else if(((a[T]||[])[0]||[])[0]==1025){if(a[T][h]&&a[T][h].itab>0){y=a.SheetNames[a[T][h].itab-1]+"!"}}else y=a.SheetNames[h-1]+"!";if(a[T]&&a[T][h])y+=a[T][h].Name;else if(a[0]&&a[0][h])y+=a[0][h].Name;else y+="SH33TJSERRX";l.push(y);break}if(!x)x={Name:"SH33TJSERRY"};l.push(x.Name);break;case"PtgParen":var A="(",I=")";if(p>=0){m="";switch(e[0][p][1][0]){case 2:A=ie(" ",e[0][p][1][1])+A;break;case 3:A=ie("\r",e[0][p][1][1])+A;break;case 4:I=ie(" ",e[0][p][1][1])+I;break;case 5:I=ie("\r",e[0][p][1][1])+I;break;default:if(n.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][p][1][0]);}p=-1}l.push(A+l.pop()+I);break;case"PtgRefErr":l.push("#REF!");break;case"PtgRefErr3d":l.push("#REF!");break;case"PtgExp":c={c:E[1][1],r:E[1][0]};var R={c:t.c,r:t.r};if(a.sharedf[ft(c)]){var D=a.sharedf[ft(c)];l.push(hu(D,s,R,a,n))}else{var F=false;for(f=0;f!=a.arrayf.length;++f){o=a.arrayf[f];if(c.co[0].e.c)continue;if(c.ro[0].e.r)continue;l.push(hu(o[1],s,R,a,n));F=true;break}if(!F)l.push(E[1])}break;case"PtgArray":l.push("{"+lu(E[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":;case"PtgAttrSpaceSemi":p=b;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":l.push("");break;case"PtgAreaErr":l.push("#REF!");break;case"PtgAreaErr3d":l.push("#REF!");break;case"PtgList":l.push("Table"+E[1].idx+"[#"+E[1].rt+"]");break;case"PtgMemAreaN":;case"PtgMemNoMemN":;case"PtgAttrNoop":;case"PtgSheet":;case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":;case"PtgElfColS":;case"PtgElfColSV":;case"PtgElfColV":;case"PtgElfLel":;case"PtgElfRadical":;case"PtgElfRadicalLel":;case"PtgElfRadicalS":;case"PtgElfRw":;case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(E));default:throw new Error("Unrecognized Formula Token: "+String(E));}var O=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(n.biff!=3)if(p>=0&&O.indexOf(e[0][b][0])==-1){E=e[0][p];var P=true;switch(E[1][0]){case 4:P=false;case 0:m=ie(" ",E[1][1]);break;case 5:P=false;case 1:m=ie("\r",E[1][1]);break;default:m="";if(n.WTF)throw new Error("Unexpected PtgAttrSpaceType "+E[1][0]);}l.push((P?m:"")+l.pop()+(P?"":m));p=-1}}if(l.length>1&&n.WTF)throw new Error("bad formula stack");return l[0]}function du(e,r,t){var a=e.l+r,n=t.biff==2?1:2;var i,s=e._R(n);if(s==65535)return[[],Wr(e,r-2)];var l=su(e,s,t);if(r!==s+n)i=iu(e,r-s-n,l,t);e.l=a;return[l,i]}function vu(e,r,t){var a=e.l+r,n=t.biff==2?1:2;var i,s=e._R(n);if(s==65535)return[[],Wr(e,r-2)];var l=su(e,s,t);if(r!==s+n)i=iu(e,r-s-n,l,t);e.l=a;return[l,i]}function pu(e,r,t,a){var n=e.l+r;var i=su(e,a,t);var s;if(n!==e.l)s=iu(e,n-e.l,i,t);return[i,s]}function mu(e,r,t){var a=e.l+r;var n,i=e._R(2);var s=su(e,i,t);if(i==65535)return[[],Wr(e,r-2)];if(r!==i+2)n=iu(e,a-i-2,s,t);return[s,n]}function bu(e){var r;if(Ar(e,e.l+6)!==65535)return[Wt(e),"n"];switch(e[e.l]){case 0:e.l+=8;return["String","s"];case 1:r=e[e.l+2]===1;e.l+=8;return[r,"b"];case 2:r=e[e.l+2];e.l+=8;return[r,"e"];case 3:e.l+=8;return["","s"];}return[]}function gu(e,r,t){var a=e.l+r;var n=Kn(e,6);if(t.biff==2)++e.l;var i=bu(e,8);var s=e._R(1);if(t.biff!=2){e._R(1);if(t.biff>=5){e._R(4)}}var l=vu(e,a-e.l,t);return{cell:n,val:i[0],formula:l,shared:s>>3&1,tt:i[1]}}function Eu(e,r,t){var a=e._R(4);var n=su(e,a,t);var i=e._R(4);var s=i>0?iu(e,i,n,t):null;return[n,s]}var ku=Eu;var wu=Eu;var Su=Eu;var _u=Eu;var Cu={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY", -376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"};var Bu={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"};var Tu={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};var xu={"_xlfn.ACOT":"ACOT","_xlfn.ACOTH":"ACOTH","_xlfn.AGGREGATE":"AGGREGATE","_xlfn.ARABIC":"ARABIC","_xlfn.AVERAGEIF":"AVERAGEIF","_xlfn.AVERAGEIFS":"AVERAGEIFS","_xlfn.BASE":"BASE","_xlfn.BETA.DIST":"BETA.DIST","_xlfn.BETA.INV":"BETA.INV","_xlfn.BINOM.DIST":"BINOM.DIST","_xlfn.BINOM.DIST.RANGE":"BINOM.DIST.RANGE","_xlfn.BINOM.INV":"BINOM.INV","_xlfn.BITAND":"BITAND","_xlfn.BITLSHIFT":"BITLSHIFT","_xlfn.BITOR":"BITOR","_xlfn.BITRSHIFT":"BITRSHIFT","_xlfn.BITXOR":"BITXOR","_xlfn.CEILING.MATH":"CEILING.MATH","_xlfn.CEILING.PRECISE":"CEILING.PRECISE","_xlfn.CHISQ.DIST":"CHISQ.DIST","_xlfn.CHISQ.DIST.RT":"CHISQ.DIST.RT","_xlfn.CHISQ.INV":"CHISQ.INV","_xlfn.CHISQ.INV.RT":"CHISQ.INV.RT","_xlfn.CHISQ.TEST":"CHISQ.TEST","_xlfn.COMBINA":"COMBINA","_xlfn.CONCAT":"CONCAT","_xlfn.CONFIDENCE.NORM":"CONFIDENCE.NORM","_xlfn.CONFIDENCE.T":"CONFIDENCE.T","_xlfn.COT":"COT","_xlfn.COTH":"COTH","_xlfn.COUNTIFS":"COUNTIFS","_xlfn.COVARIANCE.P":"COVARIANCE.P","_xlfn.COVARIANCE.S":"COVARIANCE.S","_xlfn.CSC":"CSC","_xlfn.CSCH":"CSCH","_xlfn.DAYS":"DAYS","_xlfn.DECIMAL":"DECIMAL","_xlfn.ECMA.CEILING":"ECMA.CEILING","_xlfn.ERF.PRECISE":"ERF.PRECISE","_xlfn.ERFC.PRECISE":"ERFC.PRECISE","_xlfn.EXPON.DIST":"EXPON.DIST","_xlfn.F.DIST":"F.DIST","_xlfn.F.DIST.RT":"F.DIST.RT","_xlfn.F.INV":"F.INV","_xlfn.F.INV.RT":"F.INV.RT","_xlfn.F.TEST":"F.TEST","_xlfn.FILTERXML":"FILTERXML","_xlfn.FLOOR.MATH":"FLOOR.MATH","_xlfn.FLOOR.PRECISE":"FLOOR.PRECISE","_xlfn.FORECAST.ETS":"FORECAST.ETS","_xlfn.FORECAST.ETS.CONFINT":"FORECAST.ETS.CONFINT","_xlfn.FORECAST.ETS.SEASONALITY":"FORECAST.ETS.SEASONALITY","_xlfn.FORECAST.ETS.STAT":"FORECAST.ETS.STAT","_xlfn.FORECAST.LINEAR":"FORECAST.LINEAR","_xlfn.FORMULATEXT":"FORMULATEXT","_xlfn.GAMMA":"GAMMA","_xlfn.GAMMA.DIST":"GAMMA.DIST","_xlfn.GAMMA.INV":"GAMMA.INV","_xlfn.GAMMALN.PRECISE":"GAMMALN.PRECISE","_xlfn.GAUSS":"GAUSS","_xlfn.HYPGEOM.DIST":"HYPGEOM.DIST","_xlfn.IFERROR":"IFERROR","_xlfn.IFNA":"IFNA","_xlfn.IFS":"IFS","_xlfn.IMCOSH":"IMCOSH","_xlfn.IMCOT":"IMCOT","_xlfn.IMCSC":"IMCSC","_xlfn.IMCSCH":"IMCSCH","_xlfn.IMSEC":"IMSEC","_xlfn.IMSECH":"IMSECH","_xlfn.IMSINH":"IMSINH","_xlfn.IMTAN":"IMTAN","_xlfn.ISFORMULA":"ISFORMULA","_xlfn.ISO.CEILING":"ISO.CEILING","_xlfn.ISOWEEKNUM":"ISOWEEKNUM","_xlfn.LOGNORM.DIST":"LOGNORM.DIST","_xlfn.LOGNORM.INV":"LOGNORM.INV","_xlfn.MAXIFS":"MAXIFS","_xlfn.MINIFS":"MINIFS","_xlfn.MODE.MULT":"MODE.MULT","_xlfn.MODE.SNGL":"MODE.SNGL","_xlfn.MUNIT":"MUNIT","_xlfn.NEGBINOM.DIST":"NEGBINOM.DIST","_xlfn.NETWORKDAYS.INTL":"NETWORKDAYS.INTL","_xlfn.NIGBINOM":"NIGBINOM","_xlfn.NORM.DIST":"NORM.DIST","_xlfn.NORM.INV":"NORM.INV","_xlfn.NORM.S.DIST":"NORM.S.DIST","_xlfn.NORM.S.INV":"NORM.S.INV","_xlfn.NUMBERVALUE":"NUMBERVALUE","_xlfn.PDURATION":"PDURATION","_xlfn.PERCENTILE.EXC":"PERCENTILE.EXC","_xlfn.PERCENTILE.INC":"PERCENTILE.INC","_xlfn.PERCENTRANK.EXC":"PERCENTRANK.EXC","_xlfn.PERCENTRANK.INC":"PERCENTRANK.INC","_xlfn.PERMUTATIONA":"PERMUTATIONA","_xlfn.PHI":"PHI","_xlfn.POISSON.DIST":"POISSON.DIST","_xlfn.QUARTILE.EXC":"QUARTILE.EXC","_xlfn.QUARTILE.INC":"QUARTILE.INC","_xlfn.QUERYSTRING":"QUERYSTRING","_xlfn.RANK.AVG":"RANK.AVG","_xlfn.RANK.EQ":"RANK.EQ","_xlfn.RRI":"RRI","_xlfn.SEC":"SEC","_xlfn.SECH":"SECH","_xlfn.SHEET":"SHEET","_xlfn.SHEETS":"SHEETS","_xlfn.SKEW.P":"SKEW.P","_xlfn.STDEV.P":"STDEV.P","_xlfn.STDEV.S":"STDEV.S","_xlfn.SUMIFS":"SUMIFS","_xlfn.SWITCH":"SWITCH","_xlfn.T.DIST":"T.DIST","_xlfn.T.DIST.2T":"T.DIST.2T","_xlfn.T.DIST.RT":"T.DIST.RT","_xlfn.T.INV":"T.INV","_xlfn.T.INV.2T":"T.INV.2T","_xlfn.T.TEST":"T.TEST","_xlfn.TEXTJOIN":"TEXTJOIN","_xlfn.UNICHAR":"UNICHAR","_xlfn.UNICODE":"UNICODE","_xlfn.VAR.P":"VAR.P","_xlfn.VAR.S":"VAR.S","_xlfn.WEBSERVICE":"WEBSERVICE","_xlfn.WEIBULL.DIST":"WEIBULL.DIST","_xlfn.WORKDAY.INTL":"WORKDAY.INTL","_xlfn.XOR":"XOR","_xlfn.Z.TEST":"Z.TEST"};function yu(e){if(e.slice(0,3)=="of:")e=e.slice(3);if(e.charCodeAt(0)==61){e=e.slice(1);if(e.charCodeAt(0)==61)e=e.slice(1)}e=e.replace(/COM\.MICROSOFT\./g,"");e=e.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(e,r){return r.replace(/\./g,"")});e=e.replace(/\[.(#[A-Z]*[?!])\]/g,"$1");return e.replace(/[;~]/g,",").replace(/\|/g,";")}function Au(e){var r="of:="+e.replace(Do,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return r.replace(/;/g,"|").replace(/,/g,";")}function Iu(e){var r=e.split(":");var t=r[0].split(".")[0];return[t,r[0].split(".")[1]+(r.length>1?":"+(r[1].split(".")[1]||r[1].split(".")[0]):"")]}function Ru(e){return e.replace(/\./,"!")}var Du={};var Fu={};Ta.WS=["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"];function Ou(e,r){for(var t=0,a=e.length;t-1){t.width=Xl(a);t.customWidth=1}else if(r.width!=null)t.width=r.width;if(r.hidden)t.hidden=true;return t}function Nu(e,r){if(!e)return;var t=[.7,.7,.75,.75,.3,.3];if(r=="xlml")t=[1,1,1,1,.5,.5];if(e.left==null)e.left=t[0];if(e.right==null)e.right=t[1];if(e.top==null)e.top=t[2];if(e.bottom==null)e.bottom=t[3];if(e.header==null)e.header=t[4];if(e.footer==null)e.footer=t[5]}function Lu(e,r,t){var a=t.revssf[r.z!=null?r.z:"General"];var n=60,i=e.length;if(a==null&&t.ssf){for(;n<392;++n)if(t.ssf[n]==null){A.load(r.z,n);t.ssf[n]=r.z;t.revssf[r.z]=a=n;break}}for(n=0;n!=i;++n)if(e[n].numFmtId===a)return n;e[i]={numFmtId:a,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1};return i}function Mu(e,r,t,a,n,i){if(e.t==="z")return;if(e.t==="d"&&typeof e.v==="string")e.v=te(e.v);try{if(a.cellNF)e.z=A._table[r]}catch(s){if(a.WTF)throw s}if(!a||a.cellText!==false)try{if(A._table[r]==null)A.load(D[r]||"General",r);if(e.t==="e")e.w=e.w||zt[e.v];else if(r===0){if(e.t==="n"){if((e.v|0)===e.v)e.w=A._general_int(e.v);else e.w=A._general_num(e.v)}else if(e.t==="d"){var l=Q(e.v);if((l|0)===l)e.w=A._general_int(l);else e.w=A._general_num(l)}else if(e.v===undefined)return"";else e.w=A._general(e.v,Fu)}else if(e.t==="d")e.w=A.format(r,Q(e.v),Fu);else e.w=A.format(r,e.v,Fu)}catch(s){if(a.WTF)throw s}if(!a.cellStyles)return;if(t!=null)try{e.s=i.Fills[t];if(e.s.fgColor&&e.s.fgColor.theme&&!e.s.fgColor.rgb){e.s.fgColor.rgb=Ll(n.themeElements.clrScheme[e.s.fgColor.theme].rgb,e.s.fgColor.tint||0);if(a.WTF)e.s.fgColor.raw_rgb=n.themeElements.clrScheme[e.s.fgColor.theme].rgb}if(e.s.bgColor&&e.s.bgColor.theme){e.s.bgColor.rgb=Ll(n.themeElements.clrScheme[e.s.bgColor.theme].rgb,e.s.bgColor.tint||0);if(a.WTF)e.s.bgColor.raw_rgb=n.themeElements.clrScheme[e.s.bgColor.theme].rgb}}catch(s){if(a.WTF&&i.Fills)throw s}}function Uu(e,r){var t=ut(r);if(t.s.r<=t.e.r&&t.s.c<=t.e.c&&t.s.r>=0&&t.s.c>=0)e["!ref"]=ct(t)}var Hu=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g;var Wu=/<(?:\w+:)?sheetData>([\s\S]*)<\/(?:\w+:)?sheetData>/;var Vu=/<(?:\w:)?hyperlink [^>]*>/gm;var zu=/"(\w*:\w*)"/;var Xu=/<(?:\w:)?col[^>]*[\/]?>/g;var Gu=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g;var ju=/<(?:\w:)?pageMargins[^>]*\/>/g;var Ku=/<(?:\w:)?sheetPr(?:[^>a-z][^>]*)?\/>/;var Yu=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function $u(e,r,t,a,n,i,s){if(!e)return e;if(m!=null&&r.dense==null)r.dense=m;var l=r.dense?[]:{};var f={s:{r:2e6,c:2e6},e:{r:0,c:0}};var o="",c="";var u=e.match(Wu);if(u){o=e.slice(0,u.index);c=e.slice(u.index+u[0].length)}else o=c=e;var h=o.match(Ku);if(h)Qu(h[0],l,n,t);var d=(o.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(d>0){var v=o.slice(d,d+50).match(zu);if(v)Uu(l,v[1])}var p=o.match(Yu);if(p&&p[1])lh(p[1],n);var b=[];if(r.cellStyles){var g=o.match(Xu);if(g)th(b,g)}if(u)ch(u[1],l,r,f,i,s);var E=c.match(Gu);if(E)l["!autofilter"]=nh(E[0]);var k=[];var w=c.match(Hu);if(w)for(d=0;d!=w.length;++d)k[d]=ut(w[d].slice(w[d].indexOf('"')+1));var S=c.match(Vu);if(S)qu(l,S,a);var _=c.match(ju);if(_)l["!margins"]=eh(Be(_[0]));if(!l["!ref"]&&f.e.c>=f.s.c&&f.e.r>=f.s.r)l["!ref"]=ct(f);if(r.sheetRows>0&&l["!ref"]){var C=ut(l["!ref"]);if(r.sheetRows<+C.e.r){C.e.r=r.sheetRows-1;if(C.e.r>f.e.r)C.e.r=f.e.r;if(C.e.rf.e.c)C.e.c=f.e.c;if(C.e.c0)l["!cols"]=b;if(k.length>0)l["!merges"]=k;return l}function Zu(e){if(e.length===0)return"";var r='';for(var t=0;t!=e.length;++t)r+='';return r+""}function Qu(e,r,t,a){var n=Be(e);if(!t.Sheets[a])t.Sheets[a]={};if(n.codeName)t.Sheets[a].CodeName=n.codeName}function Ju(e){var r={sheet:1};var t=["objects","scenarios","selectLockedCells","selectUnlockedCells"];var a=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];t.forEach(function(t){if(e[t]!=null&&e[t])r[t]="1"});a.forEach(function(t){if(e[t]!=null&&!e[t])r[t]="0"});if(e.password)r.password=Bl(e.password).toString(16).toUpperCase();return er("sheetProtection",null,r)}function qu(e,r,t){var a=Array.isArray(e);for(var n=0;n!=r.length;++n){var i=Be(He(r[n]),true);if(!i.ref)return;var s=((t||{})["!id"]||[])[i.id];if(s){i.Target=s.Target;if(i.location)i.Target+="#"+i.location}else{i.Target="#"+i.location;s={Target:i.Target,TargetMode:"Internal"}}i.Rel=s;if(i.tooltip){i.Tooltip=i.tooltip;delete i.tooltip}var l=ut(i.ref);for(var f=l.s.r;f<=l.e.r;++f)for(var o=l.s.c;o<=l.e.c;++o){var c=ft({c:o,r:f});if(a){if(!e[f])e[f]=[];if(!e[f][o])e[f][o]={t:"z",v:undefined};e[f][o].l=i}else{if(!e[c])e[c]={t:"z",v:undefined};e[c].l=i}}}}function eh(e){var r={};["left","right","top","bottom","header","footer"].forEach(function(t){if(e[t])r[t]=parseFloat(e[t])});return r}function rh(e){Nu(e);return er("pageMargins",null,e)}function th(e,r){var t=false;for(var a=0;a!=r.length;++a){var n=Be(r[a],true);if(n.hidden)n.hidden=Ue(n.hidden);var i=parseInt(n.min,10)-1,s=parseInt(n.max,10)-1;delete n.min;delete n.max;n.width=+n.width;if(!t&&n.width){t=true;jl(n.width)}Kl(n);while(i<=s)e[i++]=ne(n)}}function ah(e,r){var t=[""],a;for(var n=0;n!=r.length;++n){if(!(a=r[n]))continue;t[t.length]=er("col",null,Pu(n,a))}t[t.length]="";return t.join("")}function nh(e){var r={ref:(e.match(/ref="([^"]*)"/)||[])[1]};return r}function ih(e){return er("autoFilter",null,{ref:e.ref})}var sh=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/>/;function lh(e,r){(e.match(sh)||[]).forEach(function(e){var t=Be(e);if(Ue(t.rightToLeft)){if(!r.Views)r.Views=[{}];if(!r.Views[0])r.Views[0]={};r.Views[0].RTL=true}})}function fh(e,r,t,a){var n={workbookViewId:"0"};if((((a||{}).Workbook||{}).Views||[])[0])n.rightToLeft=a.Workbook.Views[0].RTL?"1":"0";return er("sheetViews",er("sheetView",null,n),{})}function oh(e,r,t,a){if(e.v===undefined&&e.f===undefined||e.t==="z")return"";var n="";var i=e.t,s=e.v;switch(e.t){case"b":n=e.v?"1":"0";break;case"n":n=""+e.v;break;case"e":n=zt[e.v];break;case"d":if(a.cellDates)n=te(e.v,-1).toISOString();else{e=ne(e);e.t="n";n=""+(e.v=Q(te(e.v)))}if(typeof e.z==="undefined")e.z=A._table[14];break;default:n=e.v;break;}var l=Je("v",De(n)),f={r:r};var o=Lu(a.cellXfs,e,a);if(o!==0)f.s=o;switch(e.t){case"n":break;case"d":f.t="d";break;case"b":f.t="b";break;case"e":f.t="e";break;default:if(e.v==null){delete e.t;break}if(a.bookSST){l=Je("v",""+Ou(a.Strings,e.v));f.t="s";break}f.t="str";break;}if(e.t!=i){e.t=i;e.v=s}if(e.f){var c=e.F&&e.F.slice(0,r.length)==r?{t:"array",ref:e.F}:null;l=er("f",De(e.f),c)+(e.v!=null?l:"")}if(e.l)t["!links"].push([r,e.l]);if(e.c)t["!comments"].push([r,e.c]);return er("c",l,f)}var ch=function(){var e=/<(?:\w+:)?c[ >]/,r=/<\/(?:\w+:)?row>/;var t=/r=["']([^"']*)["']/,a=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/;var n=/ref=["']([^"']*)["']/;var i=Ge("v"),s=Ge("f");return function l(f,o,c,u,h,d){var v=0,p="",m=[],b=[],g=0,E=0,k=0,w="",S;var _,C=0,B=0;var T,x;var y=0,I=0;var R=Array.isArray(d.CellXf),D;var F=[];var O=[];var P=Array.isArray(o);var N=[],L={},M=false;for(var U=f.split(r),H=0,W=U.length;H!=W;++H){p=U[H].trim();var V=p.length;if(V===0)continue;for(v=0;vC-1)u.s.r=C-1;if(u.e.r":"")+p;if(b!=null&&b.length===2){g=0;w=b[1];for(E=0;E!=w.length;++E){if((k=w.charCodeAt(E)-64)<1||k>26)break;g=26*g+k}--g;B=g}else++B;for(E=0;E!=p.length;++E)if(p.charCodeAt(E)===62)break;++E;_=Be(p.slice(0,E),true);if(!_.r)_.r=ft({r:C-1,c:B});w=p.slice(E);S={t:""};if((b=w.match(i))!=null&&b[1]!=="")S.v=Ae(b[1]);if(c.cellFormula){if((b=w.match(s))!=null&&b[1]!==""){S.f=Lo(Ae(He(b[1])));if(b[0].indexOf('t="array"')>-1){S.F=(w.match(n)||[])[1];if(S.F.indexOf(":")>-1)F.push([ut(S.F),S.F])}else if(b[0].indexOf('t="shared"')>-1){x=Be(b[0]);O[parseInt(x.si,10)]=[x,Lo(Ae(He(b[1])))]}}else if(b=w.match(/]*\/>/)){x=Be(b[0]);if(O[x.si])S.f=Po(O[x.si][1],O[x.si][0].ref,_.r)}var z=lt(_.r);for(E=0;E=F[E][0].s.r&&z.r<=F[E][0].e.r)if(z.c>=F[E][0].s.c&&z.c<=F[E][0].e.c)S.F=F[E][1]}if(_.t==null&&S.v===undefined){if(S.f||S.F){S.v=0;S.t="n"}else if(!c.sheetStubs)continue;else S.t="z"}else S.t=_.t||"n";if(u.s.c>g)u.s.c=g;if(u.e.c0)o["!rows"]=N}}();function uh(e,r,t,a){var n=[],i=[],s=ut(e["!ref"]),l="",f,o="",c=[],u=0,h=0,d=e["!rows"];var v=Array.isArray(e);var p={r:o},m,b=-1;for(h=s.s.c;h<=s.e.c;++h)c[h]=at(h);for(u=s.s.r;u<=s.e.r;++u){i=[];o=qr(u);for(h=s.s.c;h<=s.e.c;++h){f=c[h]+o;var g=v?(e[u]||[])[h]:e[f];if(g===undefined)continue;if((l=oh(g,f,e,r,t,a))!=null)i.push(l)}if(i.length>0||d&&d[u]){p={r:o};if(d&&d[u]){m=d[u];if(m.hidden)p.hidden=1;b=-1;if(m.hpx)b=Zl(m.hpx);else if(m.hpt)b=m.hpt;if(b>-1){p.ht=b;p.customHeight=1}if(m.level){p.outlineLevel=m.level}}n[n.length]=er("row",i.join(""),p)}}if(d)for(;u-1){p.ht=b;p.customHeight=1}if(m.level){p.outlineLevel=m.level}n[n.length]=er("row","",p)}}return n.join("")}var hh=er("worksheet",null,{xmlns:ar.main[0],"xmlns:r":ar.r});function dh(e,r,t,a){var n=[ke,hh];var i=t.SheetNames[e],s=0,l="";var f=t.Sheets[i];if(f==null)f={};var o=f["!ref"];if(o==null)o="A1";if(!a)a={};f["!comments"]=[];f["!drawing"]=[];if(r.bookType!=="xlsx"&&t.vbaraw){var c=t.SheetNames[e];try{if(t.Workbook)c=t.Workbook.Sheets[e].CodeName||c}catch(u){}n[n.length]=er("sheetPr",null,{codeName:De(c)})}n[n.length]=er("dimension",null,{ref:o});n[n.length]=fh(f,r,e,t);if(r.sheetFormat)n[n.length]=er("sheetFormatPr",null,{defaultRowHeight:r.sheetFormat.defaultRowHeight||"16",baseColWidth:r.sheetFormat.baseColWidth||"10",outlineLevelRow:r.sheetFormat.outlineLevelRow||"7"});if(f["!cols"]!=null&&f["!cols"].length>0)n[n.length]=ah(f,f["!cols"]);n[s=n.length]="";f["!links"]=[];if(f["!ref"]!=null){l=uh(f,r,e,t,a);if(l.length>0)n[n.length]=l}if(n.length>s+1){n[n.length]="";n[s]=n[s].replace("/>",">")}if(f["!protect"]!=null)n[n.length]=Ju(f["!protect"]);if(f["!autofilter"]!=null)n[n.length]=ih(f["!autofilter"]);if(f["!merges"]!=null&&f["!merges"].length>0)n[n.length]=Zu(f["!merges"]);var h=-1,d,v=-1;if(f["!links"].length>0){n[n.length]="";f["!links"].forEach(function(e){if(!e[1].Target)return;d={ref:e[0]};if(e[1].Target.charAt(0)!="#"){v=Ra(a,-1,De(e[1].Target).replace(/#.*$/,""),Ta.HLINK);d["r:id"]="rId"+v}if((h=e[1].Target.indexOf("#"))>-1)d.location=De(e[1].Target.slice(h+1));if(e[1].Tooltip)d.tooltip=De(e[1].Tooltip);n[n.length]=er("hyperlink",null,d)});n[n.length]=""}delete f["!links"];if(f["!margins"]!=null)n[n.length]=rh(f["!margins"]);n[n.length]="";n[n.length]=Je("ignoredErrors",er("ignoredError",null,{numberStoredAsText:1,sqref:o}));if(f["!drawing"].length>0){v=Ra(a,-1,"../drawings/drawing"+(e+1)+".xml",Ta.DRAW);n[n.length]=er("drawing",null,{"r:id":"rId"+v})}else delete f["!drawing"];if(f["!comments"].length>0){v=Ra(a,-1,"../drawings/vmlDrawing"+(e+1)+".vml",Ta.VML);n[n.length]=er("legacyDrawing",null,{"r:id":"rId"+v});f["!legacy"]=v}if(n.length>2){n[n.length]="";n[1]=n[1].replace("/>",">")}return n.join("")}function vh(e,r){var t={};var a=e.l+r;t.r=e._R(4);e.l+=4;var n=e._R(2);e.l+=1;var i=e._R(1);e.l=a;if(i&7)t.level=i&7;if(i&16)t.hidden=true;if(i&32)t.hpt=n/20;return t}function ph(e,r,t){var a=Vr(17+8*16);var n=(t["!rows"]||[])[e]||{};a._W(4,e);a._W(4,0);var i=320;if(n.hpx)i=Zl(n.hpx)*20;else if(n.hpt)i=n.hpt*20;a._W(2,i);a._W(1,0);var s=0;if(n.level)s|=n.level;if(n.hidden)s|=16;if(n.hpx||n.hpt)s|=32;a._W(1,s);a._W(1,0);var l=0,f=a.l;a.l+=4;var o={r:e,c:0};for(var c=0;c<16;++c){if(r.s.c>c+1<<10||r.e.ca.l?a.slice(0,a.l):a}function mh(e,r,t,a){var n=ph(a,t,r);if(n.length>17||(r["!rows"]||[])[a])Gr(e,"BrtRowHdr",n)}var bh=Ut;var gh=Ht;function Eh(){}function kh(e,r){var t={};e.l+=19;t.name=yt(e,r-19);return t}function wh(e,r){if(r==null)r=Vr(84+4*e.length);for(var t=0;t<3;++t)r._W(1,0);jt({auto:1},r);r._W(-4,-1);r._W(-4,-1);At(e,r);return r.slice(0,r.l)}function Sh(e){var r=Tt(e);return[r]}function _h(e,r,t){if(t==null)t=Vr(8);return xt(r,t)}function Ch(e){var r=Tt(e);var t=e._R(1);return[r,t,"b"]}function Bh(e,r,t){if(t==null)t=Vr(9);xt(r,t);t._W(1,e.v?1:0);return t}function Th(e){var r=Tt(e);var t=e._R(1);return[r,t,"e"]}function xh(e){var r=Tt(e);var t=e._R(4);return[r,t,"s"]}function yh(e,r,t){if(t==null)t=Vr(12);xt(r,t);t._W(4,r.v);return t}function Ah(e){var r=Tt(e);var t=Wt(e);return[r,t,"n"]}function Ih(e,r,t){if(t==null)t=Vr(16);xt(r,t);Vt(e.v,t);return t}function Rh(e){var r=Tt(e);var t=Pt(e);return[r,t,"n"]}function Dh(e,r,t){if(t==null)t=Vr(12);xt(r,t);Nt(e.v,t);return t}function Fh(e){var r=Tt(e);var t=gt(e);return[r,t,"str"]}function Oh(e,r,t){if(t==null)t=Vr(12+4*e.v.length);xt(r,t);Et(e.v,t);return t.length>t.l?t.slice(0,t.l):t}function Ph(e,r,t){var a=e.l+r;var n=Tt(e);n.r=t["!row"];var i=e._R(1);var s=[n,i,"b"];if(t.cellFormula){e.l+=2;var l=wu(e,a-e.l,t);s[3]=hu(l,null,n,t.supbooks,t)}else e.l=a;return s}function Nh(e,r,t){var a=e.l+r;var n=Tt(e);n.r=t["!row"];var i=e._R(1);var s=[n,i,"e"];if(t.cellFormula){e.l+=2;var l=wu(e,a-e.l,t);s[3]=hu(l,null,n,t.supbooks,t)}else e.l=a;return s}function Lh(e,r,t){var a=e.l+r;var n=Tt(e);n.r=t["!row"];var i=Wt(e);var s=[n,i,"n"];if(t.cellFormula){e.l+=2;var l=wu(e,a-e.l,t);s[3]=hu(l,null,n,t.supbooks,t)}else e.l=a;return s}function Mh(e,r,t){var a=e.l+r;var n=Tt(e);n.r=t["!row"];var i=gt(e);var s=[n,i,"str"];if(t.cellFormula){e.l+=2;var l=wu(e,a-e.l,t);s[3]=hu(l,null,n,t.supbooks,t)}else e.l=a;return s}var Uh=Ut;var Hh=Ht;function Wh(e,r){if(r==null)r=Vr(4);r._W(4,e);return r}function Vh(e,r){var t=e.l+r;var a=Ut(e,16);var n=It(e);var i=gt(e);var s=gt(e);var l=gt(e);e.l=t;var f={rfx:a,relId:n,loc:i,display:l};if(s)f.Tooltip=s;return f}function zh(e,r){var t=Vr(50+4*(e[1].Target.length+(e[1].Tooltip||"").length));Ht({s:lt(e[0]),e:lt(e[0])},t);Ot("rId"+r,t);var a=e[1].Target.indexOf("#");var n=a==-1?"":e[1].Target.slice(a+1);Et(n||"",t);Et(e[1].Tooltip||"",t);Et("",t);return t.slice(0,t.l)}function Xh(e,r,t){var a=e.l+r;var n=Lt(e,16);var i=e._R(1);var s=[n];s[2]=i;if(t.cellFormula){var l=ku(e,a-e.l,t);s[1]=l}else e.l=a;return s}function Gh(e,r,t){var a=e.l+r;var n=Ut(e,16);var i=[n];if(t.cellFormula){var s=_u(e,a-e.l,t);i[1]=s;e.l=a}else e.l=a;return i}function jh(e,r,t){if(t==null)t=Vr(18);var a=Pu(e,r);t._W(-4,e);t._W(-4,e);t._W(4,(a.width||10)*256);t._W(4,0);var n=0;if(r.hidden)n|=1;if(typeof a.width=="number")n|=2;t._W(1,n);t._W(1,0);return t}var Kh=["left","right","top","bottom","header","footer"];function Yh(e){var r={};Kh.forEach(function(t){r[t]=Wt(e,8)});return r}function $h(e,r){if(r==null)r=Vr(6*8);Nu(e);Kh.forEach(function(t){Vt(e[t],r)});return r}function Zh(e){var r=e._R(2);e.l+=28;return{ -RTL:r&32}}function Qh(e,r,t){if(t==null)t=Vr(30);var a=924;if((((r||{}).Views||[])[0]||{}).RTL)a|=32;t._W(2,a);t._W(4,0);t._W(4,0);t._W(4,0);t._W(1,0);t._W(1,0);t._W(2,0);t._W(2,100);t._W(2,0);t._W(2,0);t._W(2,0);t._W(4,0);return t}function Jh(e){var r=Vr(24);r._W(4,4);r._W(4,1);Ht(e,r);return r}function qh(e,r){if(r==null)r=Vr(16*4+2);r._W(2,e.password?Bl(e.password):0);r._W(4,1);[["objects",false],["scenarios",false],["formatCells",true],["formatColumns",true],["formatRows",true],["insertColumns",true],["insertRows",true],["insertHyperlinks",true],["deleteColumns",true],["deleteRows",true],["selectLockedCells",false],["sort",true],["autoFilter",true],["pivotTables",true],["selectUnlockedCells",false]].forEach(function(t){if(t[1])r._W(4,e[t[0]]!=null&&!e[t[0]]?1:0);else r._W(4,e[t[0]]!=null&&e[t[0]]?0:1)});return r}function ed(e,r,t,a,n,i,s){if(!e)return e;var l=r||{};if(!a)a={"!id":{}};if(m!=null&&l.dense==null)l.dense=m;var f=l.dense?[]:{};var o;var c={s:{r:2e6,c:2e6},e:{r:0,c:0}};var u=false,h=false;var d,v,p,b,g,E,k,w,S;var _=[];l.biff=12;l["!row"]=0;var C=0,B=false;var T=[];var x={};var y=l.supbooks||[[]];y.sharedf=x;y.arrayf=T;y.SheetNames=n.SheetNames||n.Sheets.map(function(e){return e.name});if(!l.supbooks){l.supbooks=y;if(n.Names)for(var I=0;I=I[0].s.r&&d.r<=I[0].e.r)if(g>=I[0].s.c&&g<=I[0].e.c){v.F=ct(I[0]);B=true}}if(!B&&e.length>3)v.f=e[3]}if(c.s.r>d.r)c.s.r=d.r;if(c.s.c>g)c.s.c=g;if(c.e.rd.r)c.s.r=d.r;if(c.s.c>g)c.s.c=g;if(c.e.r=e.s){R[e.e--]={width:e.w/256,hidden:!!(e.flags&1)};if(!F){F=true;jl(e.w/256)}Kl(R[e.e+1])}break;case 161:f["!autofilter"]={ref:ct(e)};break;case 476:f["!margins"]=e;break;case 147:if(!n.Sheets[t])n.Sheets[t]={};if(e.name)n.Sheets[t].CodeName=e.name;break;case 137:if(!n.Views)n.Views=[{}];if(!n.Views[0])n.Views[0]={};if(e.RTL)n.Views[0].RTL=true;break;case 485:break;case 175:;case 644:;case 625:;case 562:;case 396:;case 1112:;case 1146:;case 471:;case 1050:;case 649:;case 1105:;case 49:;case 589:;case 607:;case 564:;case 1055:;case 168:;case 174:;case 1180:;case 499:;case 64:;case 1053:;case 550:;case 171:;case 167:;case 1177:;case 169:;case 1181:;case 551:;case 552:;case 661:;case 639:;case 478:;case 151:;case 537:;case 477:;case 536:;case 1103:;case 680:;case 1104:;case 1024:;case 152:;case 663:;case 535:;case 678:;case 504:;case 1043:;case 428:;case 170:;case 50:;case 2070:;case 1045:break;case 35:u=true;break;case 36:u=false;break;case 37:break;case 38:break;default:if((r||"").indexOf("Begin")>0){}else if((r||"").indexOf("End")>0){}else if(!u||l.WTF)throw new Error("Unexpected record "+m+" "+r);}},l);delete l.supbooks;delete l["!row"];if(!f["!ref"]&&(c.s.r<2e6||o&&(o.e.r>0||o.e.c>0||o.s.r>0||o.s.c>0)))f["!ref"]=ct(o||c);if(l.sheetRows&&f["!ref"]){var O=ut(f["!ref"]);if(l.sheetRows<+O.e.r){O.e.r=l.sheetRows-1;if(O.e.r>c.e.r)O.e.r=c.e.r;if(O.e.rc.e.c)O.e.c=c.e.c;if(O.e.c0)f["!merges"]=_;if(R.length>0)f["!cols"]=R;if(D.length>0)f["!rows"]=D;return f}function rd(e,r,t,a,n,i){if(r.v===undefined)return"";var s="";switch(r.t){case"b":s=r.v?"1":"0";break;case"d":r=ne(r);r.z=r.z||A._table[14];r.v=Q(te(r.v));r.t="n";break;case"n":;case"e":s=""+r.v;break;default:s=r.v;break;}var l={r:t,c:a};l.s=Lu(n.cellXfs,r,n);if(r.l)i["!links"].push([ft(l),r.l]);if(r.c)i["!comments"].push([ft(l),r.c]);switch(r.t){case"s":;case"str":if(n.bookSST){s=Ou(n.Strings,r.v);l.t="s";l.v=s;Gr(e,"BrtCellIsst",yh(r,l))}else{l.t="str";Gr(e,"BrtCellSt",Oh(r,l))}return;case"n":if(r.v==(r.v|0)&&r.v>-1e3&&r.v<1e3)Gr(e,"BrtCellRk",Dh(r,l));else Gr(e,"BrtCellReal",Ih(r,l));return;case"b":l.t="b";Gr(e,"BrtCellBool",Bh(r,l));return;case"e":l.t="e";break;}Gr(e,"BrtCellBlank",_h(r,l))}function td(e,r,t,a){var n=ut(r["!ref"]||"A1"),i,s="",l=[];Gr(e,"BrtBeginSheetData");var f=Array.isArray(r);var o=n.e.r;if(r["!rows"])o=Math.max(n.e.r,r["!rows"].length-1);for(var c=n.s.r;c<=o;++c){s=qr(c);mh(e,r,n,c);if(c<=n.e.r)for(var u=n.s.c;u<=n.e.c;++u){if(c===n.s.r)l[u]=at(u);i=l[u]+s;var h=f?(r[c]||[])[u]:r[i];if(!h)continue;rd(e,h,c,u,a,r)}}Gr(e,"BrtEndSheetData")}function ad(e,r){if(!r||!r["!merges"])return;Gr(e,"BrtBeginMergeCells",Wh(r["!merges"].length));r["!merges"].forEach(function(r){Gr(e,"BrtMergeCell",Hh(r))});Gr(e,"BrtEndMergeCells")}function nd(e,r){if(!r||!r["!cols"])return;Gr(e,"BrtBeginColInfos");r["!cols"].forEach(function(r,t){if(r)Gr(e,"BrtColInfo",jh(t,r))});Gr(e,"BrtEndColInfos")}function id(e,r){if(!r||!r["!ref"])return;Gr(e,"BrtBeginCellIgnoreECs");Gr(e,"BrtCellIgnoreEC",Jh(ut(r["!ref"])));Gr(e,"BrtEndCellIgnoreECs")}function sd(e,r,t){r["!links"].forEach(function(r){if(!r[1].Target)return;var a=Ra(t,-1,r[1].Target.replace(/#.*$/,""),Ta.HLINK);Gr(e,"BrtHLink",zh(r,a))});delete r["!links"]}function ld(e,r,t,a){if(r["!comments"].length>0){var n=Ra(a,-1,"../drawings/vmlDrawing"+(t+1)+".vml",Ta.VML);Gr(e,"BrtLegacyDrawing",Ot("rId"+n));r["!legacy"]=n}}function fd(e,r){if(!r["!autofilter"])return;Gr(e,"BrtBeginAFilter",Ht(ut(r["!autofilter"].ref)));Gr(e,"BrtEndAFilter")}function od(e,r,t){Gr(e,"BrtBeginWsViews");{Gr(e,"BrtBeginWsView",Qh(r,t));Gr(e,"BrtEndWsView")}Gr(e,"BrtEndWsViews")}function cd(){}function ud(e,r){if(!r["!protect"])return;Gr(e,"BrtSheetProtection",qh(r["!protect"]))}function hd(e,r,t,a){var n=Xr();var i=t.SheetNames[e],s=t.Sheets[i]||{};var l=i;try{if(t&&t.Workbook)l=t.Workbook.Sheets[e].CodeName||l}catch(f){}var o=ut(s["!ref"]||"A1");s["!links"]=[];s["!comments"]=[];Gr(n,"BrtBeginSheet");if(t.vbaraw)Gr(n,"BrtWsProp",wh(l));Gr(n,"BrtWsDim",gh(o));od(n,s,t.Workbook);cd(n,s);nd(n,s,e,r,t);td(n,s,e,r,t);ud(n,s);fd(n,s);ad(n,s);sd(n,s,a);if(s["!margins"])Gr(n,"BrtMargins",$h(s["!margins"]));id(n,s);ld(n,s,e,a);Gr(n,"BrtEndSheet");return n.end()}function dd(e){var r=[];(e.match(/(.*?)<\/c:pt>/gm)||[]).forEach(function(e){var t=e.match(/(.*)<\/c:v><\/c:pt>/);if(!t)return;r[+t[1]]=+t[2]});var t=Ae((e.match(/([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return[r,t]}function vd(e,r,t,a,n,i){var s=i||{"!type":"chart"};if(!e)return i;var l=0,f=0,o="A";var c={s:{r:2e6,c:2e6},e:{r:0,c:0}};(e.match(/[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(e){var r=dd(e);c.s.r=c.s.c=0;c.e.c=l;o=at(l);r[0].forEach(function(e,t){s[o+qr(t)]={t:"n",v:e,z:r[1]};f=t});if(c.e.r0)s["!ref"]=ct(c);return s}Ta.CS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet";var pd=er("chartsheet",null,{xmlns:ar.main[0],"xmlns:r":ar.r});function md(e,r,t,a,n){if(!e)return e;if(!a)a={"!id":{}};var i={"!type":"chart","!chart":null,"!rel":""};var s;var l=e.match(Ku);if(l)Qu(l[0],i,n,t);if(s=e.match(/drawing r:id="(.*?)"/))i["!rel"]=s[1];if(a["!id"][i["!rel"]])i["!chart"]=a["!id"][i["!rel"]];return i}function bd(e,r,t,a){var n=[ke,pd];n[n.length]=er("drawing",null,{"r:id":"rId1"});Ra(a,-1,"../drawings/drawing"+(e+1)+".xml",Ta.DRAW);if(n.length>2){n[n.length]="";n[1]=n[1].replace("/>",">")}return n.join("")}function gd(e,r){e.l+=10;var t=gt(e,r-10);return{name:t}}function Ed(e,r,t,a,n){if(!e)return e;if(!a)a={"!id":{}};var i={"!type":"chart","!chart":null,"!rel":""};var s=[];var l=false;zr(e,function f(e,a,o){switch(o){case 550:i["!rel"]=e;break;case 651:if(!n.Sheets[t])n.Sheets[t]={};if(e.name)n.Sheets[t].CodeName=e.name;break;case 562:;case 652:;case 669:;case 679:;case 551:;case 552:;case 476:break;case 35:l=true;break;case 36:l=false;break;case 37:s.push(a);break;case 38:s.pop();break;default:if((a||"").indexOf("Begin")>0)s.push(a);else if((a||"").indexOf("End")>0)s.pop();else if(!l||r.WTF)throw new Error("Unexpected record "+o+" "+a);}},r);if(a["!id"][i["!rel"]])i["!chart"]=a["!id"][i["!rel"]];return i}function kd(){var e=Xr();Gr(e,"BrtBeginSheet");Gr(e,"BrtEndSheet");return e.end()}var wd=[["allowRefreshQuery",false,"bool"],["autoCompressPictures",true,"bool"],["backupFile",false,"bool"],["checkCompatibility",false,"bool"],["CodeName",""],["date1904",false,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",false,"bool"],["hidePivotFieldList",false,"bool"],["promptedSolutions",false,"bool"],["publishItems",false,"bool"],["refreshAllConnections",false,"bool"],["saveExternalLinkValues",true,"bool"],["showBorderUnselectedTables",true,"bool"],["showInkAnnotation",true,"bool"],["showObjects","all"],["showPivotChartFilter",false,"bool"],["updateLinks","userSet"]];var Sd=[["activeTab",0,"int"],["autoFilterDateGrouping",true,"bool"],["firstSheet",0,"int"],["minimized",false,"bool"],["showHorizontalScroll",true,"bool"],["showSheetTabs",true,"bool"],["showVerticalScroll",true,"bool"],["tabRatio",600,"int"],["visibility","visible"]];var _d=[];var Cd=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function Bd(e,r){for(var t=0;t!=e.length;++t){var a=e[t];for(var n=0;n!=r.length;++n){var i=r[n];if(a[i[0]]==null)a[i[0]]=i[1];else switch(i[2]){case"bool":if(typeof a[i[0]]=="string")a[i[0]]=Ue(a[i[0]]);break;case"int":if(typeof a[i[0]]=="string")a[i[0]]=parseInt(a[i[0]],10);break;}}}}function Td(e,r){for(var t=0;t!=r.length;++t){var a=r[t];if(e[a[0]]==null)e[a[0]]=a[1];else switch(a[2]){case"bool":if(typeof e[a[0]]=="string")e[a[0]]=Ue(e[a[0]]);break;case"int":if(typeof e[a[0]]=="string")e[a[0]]=parseInt(e[a[0]],10);break;}}}function xd(e){Td(e.WBProps,wd);Td(e.CalcPr,Cd);Bd(e.WBView,Sd);Bd(e.Sheets,_d);Fu.date1904=Ue(e.WBProps.date1904)}function yd(e){if(!e.Workbook)return"false";if(!e.Workbook.WBProps)return"false";return Ue(e.Workbook.WBProps.date1904)?"true":"false"}var Ad="][*?/\\".split("");function Id(e,r){if(e.length>31){if(r)return false;throw new Error("Sheet names cannot exceed 31 chars")}var t=true;Ad.forEach(function(a){if(e.indexOf(a)==-1)return;if(!r)throw new Error("Sheet name cannot contain : \\ / ? * [ ]");t=false});return t}function Rd(e,r,t){e.forEach(function(a,n){Id(a);for(var i=0;i22)throw new Error("Bad Code Name: Worksheet"+s)}})}function Dd(e){if(!e||!e.SheetNames||!e.Sheets)throw new Error("Invalid Workbook");if(!e.SheetNames.length)throw new Error("Workbook is empty");var r=e.Workbook&&e.Workbook.Sheets||[];Rd(e.SheetNames,r,!!e.vbaraw)}var Fd=/<\w+:workbook/;function Od(e,r){if(!e)throw new Error("Could not find file");var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""};var a=false,n="xmlns";var i={},s=0;e.replace(Se,function l(f,o){var c=Be(f);switch(Te(c[0])){case"":break;case"":;case"":break;case"":break;case"":wd.forEach(function(e){if(c[e[0]]==null)return;switch(e[2]){case"bool":t.WBProps[e[0]]=Ue(c[e[0]]);break;case"int":t.WBProps[e[0]]=parseInt(c[e[0]],10);break;default:t.WBProps[e[0]]=c[e[0]];}});if(c.codeName)t.WBProps.CodeName=c.codeName;break;case"":break;case"":break;case"":;case"":break;case"":break;case"":;case"":break;case"":break;case"":break;case"":;case"":break;case"":break;case"":;case"":a=false;break;case"":{i.Ref=e.slice(s,o);t.Names.push(i)}break;case"":break;case"":delete c[0];t.CalcPr=c;break;case"":break;case"":;case"":;case"":break;case"":;case"":;case"":break;case"":;case"":break;case"":break;case"":break;case"":;case"":break;case"":;case"":;case"":break;case"":a=false;break;case"":a=true;break;case"":a=false;break;case"0;var a={codeName:"ThisWorkbook"};if(e.Workbook&&e.Workbook.WBProps){wd.forEach(function(r){if(e.Workbook.WBProps[r[0]]==null)return;if(e.Workbook.WBProps[r[0]]==r[1])return;a[r[0]]=e.Workbook.WBProps[r[0]]});if(e.Workbook.WBProps.CodeName){a.codeName=e.Workbook.WBProps.CodeName;delete a.CodeName}}r[r.length]=er("workbookPr",null,a);r[r.length]="";var n=e.Workbook&&e.Workbook.Sheets||[];for(var i=0;i!=e.SheetNames.length;++i){var s={name:De(e.SheetNames[i].slice(0,31))};s.sheetId=""+(i+1);s["r:id"]="rId"+(i+1);if(n[i])switch(n[i].Hidden){case 1:s.state="hidden";break;case 2:s.state="veryHidden";break;}r[r.length]=er("sheet",null,s)}r[r.length]="";if(t){r[r.length]="";if(e.Workbook&&e.Workbook.Names)e.Workbook.Names.forEach(function(e){var t={name:e.Name};if(e.Comment)t.comment=e.Comment;if(e.Sheet!=null)t.localSheetId=""+e.Sheet;if(!e.Ref)return;r[r.length]=er("definedName",String(e.Ref),t)});r[r.length]=""}if(r.length>2){r[r.length]="";r[1]=r[1].replace("/>",">")}return r.join("")}function Ld(e,r){var t={};t.Hidden=e._R(4);t.iTabID=e._R(4);t.strRelID=Ft(e,r-8);t.name=gt(e);return t}function Md(e,r){if(!r)r=Vr(127);r._W(4,e.Hidden);r._W(4,e.iTabID);Ot(e.strRelID,r);Et(e.name.slice(0,31),r);return r.length>r.l?r.slice(0,r.l):r}function Ud(e,r){var t={};var a=e._R(4);t.defaultThemeVersion=e._R(4);var n=r>8?gt(e):"";if(n.length>0)t.CodeName=n;t.autoCompressPictures=!!(a&65536);t.backupFile=!!(a&64);t.checkCompatibility=!!(a&4096);t.date1904=!!(a&1);t.filterPrivacy=!!(a&8);t.hidePivotFieldList=!!(a&1024);t.promptedSolutions=!!(a&16);t.publishItems=!!(a&2048);t.refreshAllConnections=!!(a&262144);t.saveExternalLinkValues=!!(a&128);t.showBorderUnselectedTables=!!(a&4);t.showInkAnnotation=!!(a&32);t.showObjects=["all","placeholders","none"][a>>13&3];t.showPivotChartFilter=!!(a&32768);t.updateLinks=["userSet","never","always"][a>>8&3];return t}function Hd(e,r){if(!r)r=Vr(72);var t=0;if(e){if(e.filterPrivacy)t|=8}r._W(4,t);r._W(4,0);At(e&&e.CodeName||"ThisWorkbook",r);return r.slice(0,r.l)}function Wd(e,r){var t={};e._R(4);t.ArchID=e._R(4);e.l+=r-8;return t}function Vd(e,r,t){var a=e.l+r;e.l+=4;e.l+=1;var n=e._R(4);var i=Dt(e);var s=Su(e,0,t);var l=It(e);e.l=a;var f={Name:i,Ptg:s};if(n<268435455)f.Sheet=n;if(l)f.Comment=l;return f}function zd(e,r){var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""};var a=false;if(!r)r={};r.biff=12;var n=[];var i=[[]];i.SheetNames=[];i.XTI=[];zr(e,function s(e,l,f){switch(f){case 156:i.SheetNames.push(e.name);t.Sheets.push(e);break;case 153:t.WBProps=e;break;case 39:if(e.Sheet!=null)r.SID=e.Sheet;e.Ref=hu(e.Ptg,null,null,i,r);delete r.SID;delete e.Ptg;n.push(e);break;case 1036:break;case 357:;case 358:;case 355:;case 667:if(!i[0].length)i[0]=[f,e];else i.push([f,e]);i[i.length-1].XTI=[];break;case 362:if(i.length===0){i[0]=[];i[0].XTI=[]}i[i.length-1].XTI=i[i.length-1].XTI.concat(e);i.XTI=i.XTI.concat(e);break;case 361:break;case 2071:;case 534:;case 677:;case 158:;case 157:;case 610:;case 2050:;case 155:;case 548:;case 676:;case 128:;case 665:;case 2128:;case 2125:;case 549:;case 2053:;case 596:;case 2076:;case 2075:;case 2082:;case 397:;case 154:;case 1117:;case 553:;case 2091:break;case 35:a=true;break;case 36:a=false;break;case 37:break;case 38:break;case 16:break;default:if((l||"").indexOf("Begin")>0){}else if((l||"").indexOf("End")>0){}else if(!a||r.WTF)throw new Error("Unexpected record "+f+" "+l);}},r);xd(t);t.Names=n;t.supbooks=i;return t}function Xd(e,r){Gr(e,"BrtBeginBundleShs");for(var t=0;t!=r.SheetNames.length;++t){var a=r.Workbook&&r.Workbook.Sheets&&r.Workbook.Sheets[t]&&r.Workbook.Sheets[t].Hidden||0;var n={Hidden:a,iTabID:t+1,strRelID:"rId"+(t+1),name:r.SheetNames[t]};Gr(e,"BrtBundleSh",Md(n))}Gr(e,"BrtEndBundleShs")}function Gd(e,t){if(!t)t=Vr(127);for(var a=0;a!=4;++a)t._W(4,0);Et("SheetJS",t);Et(r.version,t);Et(r.version,t);Et("7262",t);t.length=t.l;return t.length>t.l?t.slice(0,t.l):t}function jd(e,r){if(!r)r=Vr(29);r._W(-4,0);r._W(-4,460);r._W(4,28800);r._W(4,17600);r._W(4,500);r._W(4,e);r._W(4,e);var t=120;r._W(1,t);return r.length>r.l?r.slice(0,r.l):r}function Kd(e,r){if(!r.Workbook||!r.Workbook.Sheets)return;var t=r.Workbook.Sheets;var a=0,n=-1,i=-1;for(;an)return;Gr(e,"BrtBeginBookViews");Gr(e,"BrtBookView",jd(n));Gr(e,"BrtEndBookViews")}function Yd(e,r){var t=Xr();Gr(t,"BrtBeginBook");Gr(t,"BrtFileVersion",Gd());Gr(t,"BrtWbProp",Hd(e.Workbook&&e.Workbook.WBProps||null));Kd(t,e,r);Xd(t,e,r);Gr(t,"BrtEndBook");return t.end()}function $d(e,r,t){if(r.slice(-4)===".bin")return zd(e,t);return Od(e,t)}function Zd(e,r,t,a,n,i,s,l){if(r.slice(-4)===".bin")return ed(e,a,t,n,i,s,l);return $u(e,a,t,n,i,s,l)}function Qd(e,r,t,a,n,i,s,l){if(r.slice(-4)===".bin")return Ed(e,a,t,n,i,s,l);return md(e,a,t,n,i,s,l)}function Jd(e,r,t,a,n,i,s,l){if(r.slice(-4)===".bin")return Ao(e,a,t,n,i,s,l);return Io(e,a,t,n,i,s,l)}function qd(e,r,t,a,n,i,s,l){if(r.slice(-4)===".bin")return xo(e,a,t,n,i,s,l);return yo(e,a,t,n,i,s,l)}function ev(e,r,t,a){if(r.slice(-4)===".bin")return xf(e,t,a);return of(e,t,a)}function rv(e,r,t){return Kf(e,t)}function tv(e,r,t){if(r.slice(-4)===".bin")return il(e,t);return rl(e,t)}function av(e,r,t){if(r.slice(-4)===".bin")return wo(e,t);return vo(e,t)}function nv(e,r,t){if(r.slice(-4)===".bin")return io(e,r,t);return ao(e,r,t)}function iv(e,r,t){if(r.slice(-4)===".bin")return lo(e,r,t);return so(e,r,t)}function sv(e,r,t){return(r.slice(-4)===".bin"?Yd:Nd)(e,t)}function lv(e,r,t,a,n){return(r.slice(-4)===".bin"?hd:dh)(e,t,a,n)}function fv(e,r,t,a,n){return(r.slice(-4)===".bin"?kd:bd)(e,t,a,n)}function ov(e,r,t){return(r.slice(-4)===".bin"?Mf:uf)(e,t)}function cv(e,r,t){return(r.slice(-4)===".bin"?fl:al)(e,t)}function uv(e,r,t){return(r.slice(-4)===".bin"?So:mo)(e,t)}var hv=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g;var dv=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;var vv=function(e){return String.fromCharCode(e)};function pv(e,r){var t=e.split(/\s+/);var a=[];if(!r)a[0]=t[0];if(t.length===1)return a;var n=e.match(hv),i,s,l,f;if(n)for(f=0;f!=n.length;++f){i=n[f].match(dv);if((s=i[1].indexOf(":"))===-1)a[i[1]]=i[2].slice(1,i[2].length-1);else{if(i[1].slice(0,6)==="xmlns:")l="xmlns"+i[1].slice(6);else l=i[1].slice(s+1);a[l]=i[2].slice(1,i[2].length-1)}}return a}function mv(e){var r=e.split(/\s+/);var t={};if(r.length===1)return t;var a=e.match(hv),n,i,s,l;if(a)for(l=0;l!=a.length;++l){n=a[l].match(dv);if((i=n[1].indexOf(":"))===-1)t[n[1]]=n[2].slice(1,n[2].length-1);else{if(n[1].slice(0,6)==="xmlns:")s="xmlns"+n[1].slice(6);else s=n[1].slice(i+1);t[s]=n[2].slice(1,n[2].length-1)}}return t}function bv(e,r){var t=R[e]||Ae(e);if(t==="General")return A._general(r);return A.format(t,r)}function gv(e,r,t,a){var n=a;switch((t[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":n=Ue(a);break;case"i2":;case"int":n=parseInt(a,10);break;case"r4":;case"float":n=parseFloat(a);break;case"date":;case"dateTime.tz":n=te(a);break;case"i8":;case"string":;case"fixed":;case"uuid":;case"bin.base64":break;default:throw new Error("bad custprop:"+t[0]);}e[Ae(r)]=n}function Ev(e,r,t){if(e.t==="z")return;if(!t||t.cellText!==false)try{if(e.t==="e"){e.w=e.w||zt[e.v]}else if(r==="General"){if(e.t==="n"){if((e.v|0)===e.v)e.w=A._general_int(e.v);else e.w=A._general_num(e.v)}else e.w=A._general(e.v)}else e.w=bv(r||"General",e.v)}catch(a){if(t.WTF)throw a}try{var n=R[r]||r||"General";if(t.cellNF)e.z=n;if(t.cellDates&&e.t=="n"&&A.is_date(n)){var i=A.parse_date_code(e.v);if(i){e.t="d";e.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u)}}}catch(a){if(t.WTF)throw a}}function kv(e,r,t){if(t.cellStyles){if(r.Interior){var a=r.Interior;if(a.Pattern)a.patternType=Jl[a.Pattern]||a.Pattern}}e[r.ID]=r}function wv(e,r,t,a,n,i,s,l,f,o){var c="General",u=a.StyleID,h={};o=o||{};var d=[];var v=0;if(u===undefined&&l)u=l.StyleID;if(u===undefined&&s)u=s.StyleID;while(i[u]!==undefined){if(i[u].nf)c=i[u].nf;if(i[u].Interior)d.push(i[u].Interior);if(!i[u].Parent)break;u=i[u].Parent}switch(t.Type){case"Boolean":a.t="b";a.v=Ue(e);break;case"String":a.t="s";a.r=Le(Ae(e));a.v=e.indexOf("<")>-1?Ae(r):a.r;break;case"DateTime":if(e.slice(-1)!="Z")e+="Z";a.v=(te(e)-new Date(Date.UTC(1899,11,30)))/(24*60*60*1e3);if(a.v!==a.v)a.v=Ae(e);else if(a.v<60)a.v=a.v-1;if(!c||c=="General")c="yyyy-mm-dd";case"Number":if(a.v===undefined)a.v=+e;if(!a.t)a.t="n";break;case"Error":a.t="e";a.v=Xt[e];if(o.cellText!==false)a.w=e;break;default:a.t="s";a.v=Le(r||e);break;}Ev(a,c,o);if(o.cellFormula!==false){if(a.Formula){var p=Ae(a.Formula);if(p.charCodeAt(0)==61)p=p.slice(1);a.f=Ro(p,n);delete a.Formula;if(a.ArrayRange=="RC")a.F=Ro("RC:RC",n);else if(a.ArrayRange){a.F=Ro(a.ArrayRange,n);f.push([ut(a.F),a.F])}}else{for(v=0;v=f[v][0].s.r&&n.r<=f[v][0].e.r)if(n.c>=f[v][0].s.c&&n.c<=f[v][0].e.c)a.F=f[v][1]}}if(o.cellStyles){d.forEach(function(e){if(!h.patternType&&e.patternType)h.patternType=e.patternType});a.s=h}if(a.StyleID!==undefined)a.ixfe=a.StyleID}function Sv(e){e.t=e.v||"";e.t=e.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n");e.v=e.w=e.ixfe=undefined}function _v(e){if(E&&Buffer.isBuffer(e))return e.toString("utf8");if(typeof e==="string")return e;if(typeof Uint8Array!=="undefined"&&e instanceof Uint8Array)return He(_(B(e)));throw new Error("Bad input format: expected Buffer or string")}var Cv=/<(\/?)([^\s?>!\/:]*:|)([^\s?>:\/]+)[^>]*>/gm;function Bv(e,r){var t=r||{};I(A);var a=v(_v(e));if(t.type=="binary"||t.type=="array"||t.type=="base64"){if(typeof cptable!=="undefined")a=cptable.utils.decode(65001,u(a));else a=He(a)}var n=a.slice(0,1024).toLowerCase(),i=false;if(n.indexOf("=0)i=true});if(i)return pp.to_workbook(a,t);var s;var l=[],f;if(m!=null&&t.dense==null)t.dense=m;var o={},c=[],h=t.dense?[]:{},d="";var p={},b={},g={};var E=pv(''),k=0;var w=0,S=0;var _={s:{r:2e6,c:2e6},e:{r:0,c:0}};var C={},B={};var T="",x=0;var y=[];var D={},F={},O=0,P=[];var N=[],L={};var M=[],U,H=false;var W=[];var V=[],z={},X=0,G=0;var j={Sheets:[],WBProps:{date1904:false}},K={};Cv.lastIndex=0;a=a.replace(//gm,"");while(s=Cv.exec(a))switch(s[3]){case"Data":if(l[l.length-1][1])break;if(s[1]==="/")wv(a.slice(k,s.index),T,E,l[l.length-1][0]=="Comment"?L:b,{c:w,r:S},C,M[w],g,W,t);else{T="";E=pv(s[0]);k=s.index+s[0].length}break;case"Cell":if(s[1]==="/"){if(N.length>0)b.c=N;if((!t.sheetRows||t.sheetRows>S)&&b.v!==undefined){if(t.dense){if(!h[S])h[S]=[];h[S][w]=b}else h[at(w)+qr(S)]=b}if(b.HRef){b.l={Target:b.HRef};if(b.HRefScreenTip)b.l.Tooltip=b.HRefScreenTip;delete b.HRef;delete b.HRefScreenTip}if(b.MergeAcross||b.MergeDown){X=w+(parseInt(b.MergeAcross,10)|0);G=S+(parseInt(b.MergeDown,10)|0);y.push({s:{c:w,r:S},e:{c:X,r:G}})}if(!t.sheetStubs){if(b.MergeAcross)w=X+1;else++w}else if(b.MergeAcross||b.MergeDown){for(var Y=w;Y<=X;++Y){for(var $=S;$<=G;++$){if(Y>w||$>S){if(t.dense){if(!h[$])h[$]=[];h[$][Y]={t:"z"}}else h[at(Y)+qr($)]={t:"z"}}}}w=X+1}else++w}else{b=mv(s[0]);if(b.Index)w=+b.Index-1;if(w<_.s.c)_.s.c=w;if(w>_.e.c)_.e.c=w;if(s[0].slice(-2)==="/>")++w;N=[]}break;case"Row":if(s[1]==="/"||s[0].slice(-2)==="/>"){if(S<_.s.r)_.s.r=S;if(S>_.e.r)_.e.r=S;if(s[0].slice(-2)==="/>"){g=pv(s[0]);if(g.Index)S=+g.Index-1}w=0;++S}else{g=pv(s[0]);if(g.Index)S=+g.Index-1;z={};if(g.AutoFitHeight=="0"||g.Height){z.hpx=parseInt(g.Height,10);z.hpt=Zl(z.hpx);V[S]=z}if(g.Hidden=="1"){z.hidden=true;V[S]=z}}break;case"Worksheet":if(s[1]==="/"){if((f=l.pop())[0]!==s[3])throw new Error("Bad state: "+f.join("|"));c.push(d);if(_.s.r<=_.e.r&&_.s.c<=_.e.c)h["!ref"]=ct(_);if(y.length)h["!merges"]=y;if(M.length>0)h["!cols"]=M;if(V.length>0)h["!rows"]=V;o[d]=h}else{_={s:{r:2e6,c:2e6},e:{r:0,c:0}};S=w=0;l.push([s[3],false]);f=pv(s[0]);d=Ae(f.Name);h=t.dense?[]:{};y=[];W=[];V=[];K={name:d,Hidden:0};j.Sheets.push(K)}break;case"Table":if(s[1]==="/"){if((f=l.pop())[0]!==s[3])throw new Error("Bad state: "+f.join("|"))}else if(s[0].slice(-2)=="/>")break;else{p=pv(s[0]);l.push([s[3],false]);M=[];H=false}break;case"Style":if(s[1]==="/")kv(C,B,t);else B=pv(s[0]);break;case"NumberFormat":B.nf=Ae(pv(s[0]).Format||"General");if(R[B.nf])B.nf=R[B.nf];for(var Z=0;Z!=392;++Z)if(A._table[Z]==B.nf)break;if(Z==392)for(Z=57;Z!=392;++Z)if(A._table[Z]==null){A.load(B.nf,Z);break}break;case"Column":if(l[l.length-1][0]!=="Table")break;U=pv(s[0]);if(U.Hidden){U.hidden=true;delete U.Hidden}if(U.Width)U.wpx=parseInt(U.Width,10);if(!H&&U.wpx>10){H=true;Wl=Ml;for(var Q=0;Q0)ee.Sheet=j.Sheets.length-1;j.Names.push(ee);break;case"NamedCell":break;case"B":break;case"I":break;case"U":break;case"S":break;case"Sub":break;case"Sup":break;case"Span":break;case"Border":break;case"Alignment":break;case"Borders":break;case"Font":if(s[0].slice(-2)==="/>")break;else if(s[1]==="/")T+=a.slice(x,s.index);else x=s.index+s[0].length;break;case"Interior":if(!t.cellStyles)break;B.Interior=pv(s[0]);break;case"Protection":break;case"Author":;case"Title":;case"Description":;case"Created":;case"Keywords":;case"Subject":;case"Category":;case"Company":;case"LastAuthor":;case"LastSaved":;case"LastPrinted":;case"Version":;case"Revision":;case"TotalTime":;case"HyperlinkBase":;case"Manager":;case"ContentStatus":;case"Identifier":;case"Language":;case"AppName":if(s[0].slice(-2)==="/>")break;else if(s[1]==="/")rn(D,s[3],a.slice(O,s.index));else O=s.index+s[0].length;break;case"Paragraphs":break;case"Styles":;case"Workbook":if(s[1]==="/"){if((f=l.pop())[0]!==s[3])throw new Error("Bad state: "+f.join("|"))}else l.push([s[3],false]);break;case"Comment":if(s[1]==="/"){if((f=l.pop())[0]!==s[3])throw new Error("Bad state: "+f.join("|"));Sv(L);N.push(L)}else{l.push([s[3],false]);f=pv(s[0]);L={a:f.Author}}break;case"AutoFilter":if(s[1]==="/"){if((f=l.pop())[0]!==s[3])throw new Error("Bad state: "+f.join("|"))}else if(s[0].charAt(s[0].length-2)!=="/"){var re=pv(s[0]);h["!autofilter"]={ref:Ro(re.Range).replace(/\$/g,"")};l.push([s[3],true])}break;case"Name":break;case"ComponentOptions":;case"DocumentProperties":;case"CustomDocumentProperties":;case"OfficeDocumentSettings":;case"PivotTable":;case"PivotCache":;case"Names":;case"MapInfo":;case"PageBreaks":;case"QueryTable":;case"DataValidation":;case"Sorting":;case"Schema":;case"data":;case"ConditionalFormatting":;case"SmartTagType":;case"SmartTags":;case"ExcelWorkbook":;case"WorkbookOptions":;case"WorksheetOptions":if(s[1]==="/"){if((f=l.pop())[0]!==s[3])throw new Error("Bad state: "+f.join("|"))}else if(s[0].charAt(s[0].length-2)!=="/")l.push([s[3],true]);break;default:if(l.length==0&&s[3]=="document")return kp(a,t);if(l.length==0&&s[3]=="UOF")return kp(a,t);var te=true;switch(l[l.length-1][0]){case"OfficeDocumentSettings":switch(s[3]){case"AllowPNG":break;case"RemovePersonalInformation":break;case"DownloadComponents":break;case"LocationOfComponents":break;case"Colors":break;case"Color":break;case"Index":break;case"RGB":break;case"PixelsPerInch":break;case"TargetScreenSize":break;case"ReadOnlyRecommended":break;default:te=false;}break;case"ComponentOptions":switch(s[3]){case"Toolbar":break;case"HideOfficeLogo":break;case"SpreadsheetAutoFit":break;case"Label":break;case"Caption":break;case"MaxHeight":break;case"MaxWidth":break;case"NextSheetNumber":break;default:te=false;}break;case"ExcelWorkbook":switch(s[3]){case"Date1904":j.WBProps.date1904=true;break;case"WindowHeight":break;case"WindowWidth":break;case"WindowTopX":break;case"WindowTopY":break;case"TabRatio":break;case"ProtectStructure":break;case"ProtectWindows":break;case"ActiveSheet":break;case"DisplayInkNotes":break;case"FirstVisibleSheet":break;case"SupBook":break;case"SheetName":break;case"SheetIndex":break;case"SheetIndexFirst":break;case"SheetIndexLast":break;case"Dll":break;case"AcceptLabelsInFormulas":break;case"DoNotSaveLinkValues":break;case"Iteration":break;case"MaxIterations": -break;case"MaxChange":break;case"Path":break;case"Xct":break;case"Count":break;case"SelectedSheets":break;case"Calculation":break;case"Uncalced":break;case"StartupPrompt":break;case"Crn":break;case"ExternName":break;case"Formula":break;case"ColFirst":break;case"ColLast":break;case"WantAdvise":break;case"Boolean":break;case"Error":break;case"Text":break;case"OLE":break;case"NoAutoRecover":break;case"PublishObjects":break;case"DoNotCalculateBeforeSave":break;case"Number":break;case"RefModeR1C1":break;case"EmbedSaveSmartTags":break;default:te=false;}break;case"WorkbookOptions":switch(s[3]){case"OWCVersion":break;case"Height":break;case"Width":break;default:te=false;}break;case"WorksheetOptions":switch(s[3]){case"Visible":if(s[0].slice(-2)==="/>"){}else if(s[1]==="/")switch(a.slice(O,s.index)){case"SheetHidden":K.Hidden=1;break;case"SheetVeryHidden":K.Hidden=2;break;}else O=s.index+s[0].length;break;case"Header":if(!h["!margins"])Nu(h["!margins"]={},"xlml");h["!margins"].header=Be(s[0]).Margin;break;case"Footer":if(!h["!margins"])Nu(h["!margins"]={},"xlml");h["!margins"].footer=Be(s[0]).Margin;break;case"PageMargins":var ae=Be(s[0]);if(!h["!margins"])Nu(h["!margins"]={},"xlml");if(ae.Top)h["!margins"].top=ae.Top;if(ae.Left)h["!margins"].left=ae.Left;if(ae.Right)h["!margins"].right=ae.Right;if(ae.Bottom)h["!margins"].bottom=ae.Bottom;break;case"DisplayRightToLeft":if(!j.Views)j.Views=[];if(!j.Views[0])j.Views[0]={};j.Views[0].RTL=true;break;case"Unsynced":break;case"Print":break;case"Panes":break;case"Scale":break;case"Pane":break;case"Number":break;case"Layout":break;case"PageSetup":break;case"Selected":break;case"ProtectObjects":break;case"EnableSelection":break;case"ProtectScenarios":break;case"ValidPrinterInfo":break;case"HorizontalResolution":break;case"VerticalResolution":break;case"NumberofCopies":break;case"ActiveRow":break;case"ActiveCol":break;case"ActivePane":break;case"TopRowVisible":break;case"TopRowBottomPane":break;case"LeftColumnVisible":break;case"LeftColumnRightPane":break;case"FitToPage":break;case"RangeSelection":break;case"PaperSizeIndex":break;case"PageLayoutZoom":break;case"PageBreakZoom":break;case"FilterOn":break;case"DoNotDisplayGridlines":break;case"SplitHorizontal":break;case"SplitVertical":break;case"FreezePanes":break;case"FrozenNoSplit":break;case"FitWidth":break;case"FitHeight":break;case"CommentsLayout":break;case"Zoom":break;case"LeftToRight":break;case"Gridlines":break;case"AllowSort":break;case"AllowFilter":break;case"AllowInsertRows":break;case"AllowDeleteRows":break;case"AllowInsertCols":break;case"AllowDeleteCols":break;case"AllowInsertHyperlinks":break;case"AllowFormatCells":break;case"AllowSizeCols":break;case"AllowSizeRows":break;case"NoSummaryRowsBelowDetail":break;case"TabColorIndex":break;case"DoNotDisplayHeadings":break;case"ShowPageLayoutZoom":break;case"NoSummaryColumnsRightDetail":break;case"BlackAndWhite":break;case"DoNotDisplayZeros":break;case"DisplayPageBreak":break;case"RowColHeadings":break;case"DoNotDisplayOutline":break;case"NoOrientation":break;case"AllowUsePivotTables":break;case"ZeroHeight":break;case"ViewableRange":break;case"Selection":break;case"ProtectContents":break;default:te=false;}break;case"PivotTable":;case"PivotCache":switch(s[3]){case"ImmediateItemsOnDrop":break;case"ShowPageMultipleItemLabel":break;case"CompactRowIndent":break;case"Location":break;case"PivotField":break;case"Orientation":break;case"LayoutForm":break;case"LayoutSubtotalLocation":break;case"LayoutCompactRow":break;case"Position":break;case"PivotItem":break;case"DataType":break;case"DataField":break;case"SourceName":break;case"ParentField":break;case"PTLineItems":break;case"PTLineItem":break;case"CountOfSameItems":break;case"Item":break;case"ItemType":break;case"PTSource":break;case"CacheIndex":break;case"ConsolidationReference":break;case"FileName":break;case"Reference":break;case"NoColumnGrand":break;case"NoRowGrand":break;case"BlankLineAfterItems":break;case"Hidden":break;case"Subtotal":break;case"BaseField":break;case"MapChildItems":break;case"Function":break;case"RefreshOnFileOpen":break;case"PrintSetTitles":break;case"MergeLabels":break;case"DefaultVersion":break;case"RefreshName":break;case"RefreshDate":break;case"RefreshDateCopy":break;case"VersionLastRefresh":break;case"VersionLastUpdate":break;case"VersionUpdateableMin":break;case"VersionRefreshableMin":break;case"Calculation":break;default:te=false;}break;case"PageBreaks":switch(s[3]){case"ColBreaks":break;case"ColBreak":break;case"RowBreaks":break;case"RowBreak":break;case"ColStart":break;case"ColEnd":break;case"RowEnd":break;default:te=false;}break;case"AutoFilter":switch(s[3]){case"AutoFilterColumn":break;case"AutoFilterCondition":break;case"AutoFilterAnd":break;case"AutoFilterOr":break;default:te=false;}break;case"QueryTable":switch(s[3]){case"Id":break;case"AutoFormatFont":break;case"AutoFormatPattern":break;case"QuerySource":break;case"QueryType":break;case"EnableRedirections":break;case"RefreshedInXl9":break;case"URLString":break;case"HTMLTables":break;case"Connection":break;case"CommandText":break;case"RefreshInfo":break;case"NoTitles":break;case"NextId":break;case"ColumnInfo":break;case"OverwriteCells":break;case"DoNotPromptForFile":break;case"TextWizardSettings":break;case"Source":break;case"Number":break;case"Decimal":break;case"ThousandSeparator":break;case"TrailingMinusNumbers":break;case"FormatSettings":break;case"FieldType":break;case"Delimiters":break;case"Tab":break;case"Comma":break;case"AutoFormatName":break;case"VersionLastEdit":break;case"VersionLastRefresh":break;default:te=false;}break;case"Sorting":;case"ConditionalFormatting":;case"DataValidation":switch(s[3]){case"Range":break;case"Type":break;case"Min":break;case"Max":break;case"Sort":break;case"Descending":break;case"Order":break;case"CaseSensitive":break;case"Value":break;case"ErrorStyle":break;case"ErrorMessage":break;case"ErrorTitle":break;case"CellRangeList":break;case"InputMessage":break;case"InputTitle":break;case"ComboHide":break;case"InputHide":break;case"Condition":break;case"Qualifier":break;case"UseBlank":break;case"Value1":break;case"Value2":break;case"Format":break;default:te=false;}break;case"MapInfo":;case"Schema":;case"data":switch(s[3]){case"Map":break;case"Entry":break;case"Range":break;case"XPath":break;case"Field":break;case"XSDType":break;case"FilterOn":break;case"Aggregate":break;case"ElementType":break;case"AttributeType":break;case"schema":;case"element":;case"complexType":;case"datatype":;case"all":;case"attribute":;case"extends":break;case"row":break;default:te=false;}break;case"SmartTags":break;default:te=false;break;}if(te)break;if(!l[l.length-1][1])throw"Unrecognized tag: "+s[3]+"|"+l.join("|");if(l[l.length-1][0]==="CustomDocumentProperties"){if(s[0].slice(-2)==="/>")break;else if(s[1]==="/")gv(F,s[3],P,a.slice(O,s.index));else{P=s;O=s.index+s[0].length}break}if(t.WTF)throw"Unrecognized tag: "+s[3]+"|"+l.join("|");}var ie={};if(!t.bookSheets&&!t.bookProps)ie.Sheets=o;ie.SheetNames=c;ie.Workbook=j;ie.SSF=A.get_table();ie.Props=D;ie.Custprops=F;return ie}function Tv(e,r){Np(r=r||{});switch(r.type||"base64"){case"base64":return Bv(g.decode(e),r);case"binary":;case"buffer":;case"file":return Bv(e,r);case"array":return Bv(_(e),r);}}function xv(e,r){var t=[];if(e.Props)t.push(tn(e.Props,r));if(e.Custprops)t.push(an(e.Props,e.Custprops,r));return t.join("")}function yv(){return""}function Av(e,r){var t=[''];r.cellXfs.forEach(function(e,r){var a=[];a.push(er("NumberFormat",null,{"ss:Format":De(A._table[e.numFmtId])}));t.push(er("Style",a.join(""),{"ss:ID":"s"+(21+r)}))});return er("Styles",t.join(""))}function Iv(e){return er("NamedRange",null,{"ss:Name":e.Name,"ss:RefersTo":"="+Fo(e.Ref,{r:0,c:0})})}function Rv(e){if(!((e||{}).Workbook||{}).Names)return"";var r=e.Workbook.Names;var t=[];for(var a=0;a");if(e["!margins"].header)n.push(er("Header",null,{"x:Margin":e["!margins"].header}));if(e["!margins"].footer)n.push(er("Footer",null,{"x:Margin":e["!margins"].footer}));n.push(er("PageMargins",null,{"x:Bottom":e["!margins"].bottom||"0.75","x:Left":e["!margins"].left||"0.7","x:Right":e["!margins"].right||"0.7","x:Top":e["!margins"].top||"0.75"}));n.push("")}if(a&&a.Workbook&&a.Workbook.Sheets&&a.Workbook.Sheets[t]){if(a.Workbook.Sheets[t].Hidden)n.push(er("Visible",a.Workbook.Sheets[t].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var i=0;i")}}if(((((a||{}).Workbook||{}).Views||[])[0]||{}).RTL)n.push("");if(e["!protect"]){n.push(Je("ProtectContents","True"));if(e["!protect"].objects)n.push(Je("ProtectObjects","True"));if(e["!protect"].scenarios)n.push(Je("ProtectScenarios","True"));if(e["!protect"].selectLockedCells!=null&&!e["!protect"].selectLockedCells)n.push(Je("EnableSelection","NoSelection"));else if(e["!protect"].selectUnlockedCells!=null&&!e["!protect"].selectUnlockedCells)n.push(Je("EnableSelection","UnlockedCells"));[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(r){if(e["!protect"][r[0]])n.push("<"+r[1]+"/>")})}if(n.length==0)return"";return er("WorksheetOptions",n.join(""),{xmlns:nr.x})}function Ov(e){return e.map(function(e){var r=Me(e.t||"");var t=er("ss:Data",r,{xmlns:"http://www.w3.org/TR/REC-html40"});return er("Comment",t,{"ss:Author":e.a})}).join("")}function Pv(e,r,t,a,n,i,s){if(!e||e.v==undefined&&e.f==undefined)return"";var l={};if(e.f)l["ss:Formula"]="="+De(Fo(e.f,s));if(e.F&&e.F.slice(0,r.length)==r){var f=lt(e.F.slice(r.length+1));l["ss:ArrayRange"]="RC:R"+(f.r==s.r?"":"["+(f.r-s.r)+"]")+"C"+(f.c==s.c?"":"["+(f.c-s.c)+"]")}if(e.l&&e.l.Target){l["ss:HRef"]=De(e.l.Target);if(e.l.Tooltip)l["x:HRefScreenTip"]=De(e.l.Tooltip)}if(t["!merges"]){var o=t["!merges"];for(var c=0;c!=o.length;++c){if(o[c].s.c!=s.c||o[c].s.r!=s.r)continue;if(o[c].e.c>o[c].s.c)l["ss:MergeAcross"]=o[c].e.c-o[c].s.c;if(o[c].e.r>o[c].s.r)l["ss:MergeDown"]=o[c].e.r-o[c].s.r}}var u="",h="";switch(e.t){case"z":return"";case"n":u="Number";h=String(e.v);break;case"b":u="Boolean";h=e.v?"1":"0";break;case"e":u="Error";h=zt[e.v];break;case"d":u="DateTime";h=new Date(e.v).toISOString();if(e.z==null)e.z=e.z||A._table[14];break;case"s":u="String";h=Ne(e.v||"");break;}var d=Lu(a.cellXfs,e,a);l["ss:StyleID"]="s"+(21+d);l["ss:Index"]=s.c+1;var v=e.v!=null?h:"";var p=''+v+"";if((e.c||[]).length>0)p+=Ov(e.c);return er("Cell",p,l)}function Nv(e,r){var t='"}function Lv(e,r,t,a){if(!e["!ref"])return"";var n=ut(e["!ref"]);var i=e["!merges"]||[],s=0;var l=[];if(e["!cols"])e["!cols"].forEach(function(e,r){Kl(e);var t=!!e.width;var a=Pu(r,e);var n={"ss:Index":r+1};if(t)n["ss:Width"]=Vl(a.width);if(e.hidden)n["ss:Hidden"]="1";l.push(er("Column",null,n))});var f=Array.isArray(e);for(var o=n.s.r;o<=n.e.r;++o){var c=[Nv(o,(e["!rows"]||[])[o])];for(var u=n.s.c;u<=n.e.c;++u){var h=false;for(s=0;s!=i.length;++s){if(i[s].s.c>u)continue;if(i[s].s.r>o)continue;if(i[s].e.c");if(c.length>2)l.push(c.join(""))}return l.join("")}function Mv(e,r,t){var a=[];var n=t.SheetNames[e];var i=t.Sheets[n];var s=i?Dv(i,r,e,t):"";if(s.length>0)a.push(""+s+"");s=i?Lv(i,r,e,t):"";if(s.length>0)a.push(""+s+"
                      ");a.push(Fv(i,r,e,t));return a.join("")}function Uv(e,r){if(!r)r={};if(!e.SSF)e.SSF=A.get_table();if(e.SSF){I(A);A.load_table(e.SSF);r.revssf=j(e.SSF);r.revssf[e.SSF[65535]]=0;r.ssf=e.SSF;r.cellXfs=[];Lu(r.cellXfs,{},{revssf:{General:0}})}var t=[];t.push(xv(e,r));t.push(yv(e,r));t.push("");t.push("");for(var a=0;a40)return r;t.l-=4;r.Reserved1=t._R(0,"lpstr-ansi");if(t.length-t.l<=4)return r;a=t._R(4);if(a!==1907505652)return r;r.UnicodeClipboardFormat=Qt(t);a=t._R(4);if(a==0||a>40)return r;t.l-=4;r.Reserved2=t._R(0,"lpwstr")}function Wv(e,r,t,a){var n=t;var i=[];var s=r.slice(r.l,r.l+n);if(a&&a.enc&&a.enc.insitu)switch(e.n){case"BOF":;case"FilePass":;case"FileLock":;case"InterfaceHdr":;case"RRDInfo":;case"RRDHead":;case"UsrExcl":break;default:if(s.length===0)break;a.enc.insitu(s);}i.push(s);r.l+=n;var l=Zv[Ar(r,r.l)];var f=0;while(l!=null&&l.n.slice(0,8)==="Continue"){n=Ar(r,r.l+2);f=r.l+4;if(l.n=="ContinueFrt")f+=4;else if(l.n.slice(0,11)=="ContinueFrt")f+=12;i.push(r.slice(f,r.l+4+n));r.l+=4+n;l=Zv[Ar(r,r.l)]}var o=T(i);Hr(o,0);var c=0;o.lens=[];for(var u=0;u1)return;if(!_)return;if(t.cellStyles&&r.XF&&r.XF.data)I(e,r,t);delete r.ixfe;delete r.XF;h=e;d=ft(e);if(s.s){if(e.rs.e.r)s.e.r=e.r+1;if(e.c+1>s.e.c)s.e.c=e.c+1}if(t.cellFormula&&r.f){for(var a=0;ae.c||k[a][0].s.r>e.r)continue;if(k[a][0].e.c=t.sheetRows)_=false;else{if(t.dense){if(!n[e.r])n[e.r]=[];n[e.r][e.c]=r}else n[d]=r}};var D={enc:false,sbcch:0,snames:[],sharedf:E,arrayf:k,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!r&&!!r.cellStyles,WTF:!!r&&!!r.wtf};if(r.password)D.password=r.password;var F;var O=[];var P=[];var N=[],L=[];var M=0,U=0;var H=false;var W=[];W.SheetNames=D.snames;W.sharedf=D.sharedf;W.arrayf=D.arrayf;W.names=[];W.XTI=[];var V="";var X=0;var G=0,j=[];var K=[];var Y;D.codepage=1200;o(1200);var $=false;while(e.l>8)!==Q)throw new Error("rt mismatch: "+ee+"!="+Q);if(q.r==12){e.l+=10;J-=10}}var re;if(q.n==="EOF")re=q.f(e,J,D);else re=Wv(q,e,J,D);var te=q.n;if(X==0&&te!="BOF")continue;switch(te){case"Date1904":t.opts.Date1904=T.WBProps.date1904=re;break;case"WriteProtect":t.opts.WriteProtect=true;break;case"FilePass":if(!D.enc)e.l=0;D.enc=re;if(!r.password)throw new Error("File is password-protected");if(re.valid==null)throw new Error("Encryption scheme unsupported");if(!re.valid)throw new Error("Password is incorrect");break;case"WriteAccess":D.lastuser=re;break;case"FileSharing":break;case"CodePage":switch(re){case 21010:re=1200;break;case 32768:re=1e4;break;case 32769:re=1252;break;}o(D.codepage=re);$=true;break;case"RRTabId":D.rrtabid=re;break;case"WinProtect":D.winlocked=re;break;case"Template":break;case"BookBool":break;case"UsesELFs":break;case"MTRSettings":break;case"RefreshAll":;case"CalcCount":;case"CalcDelta":;case"CalcIter":;case"CalcMode":;case"CalcPrecision":;case"CalcSaveRecalc":t.opts[te]=re;break;case"CalcRefMode":D.CalcRefMode=re;break;case"Uncalced":break;case"ForceFullCalculation":t.opts.FullCalc=re;break;case"WsBool":if(re.fDialog)n["!type"]="dialog";break;case"XF":C.push(re);break;case"ExtSST":break;case"BookExt":break;case"RichTextStream":break;case"BkHim":break;case"SupBook":W.push([re]);W[W.length-1].XTI=[];break;case"ExternName":W[W.length-1].push(re);break;case"Index":break;case"Lbl":Y={Name:re.Name,Ref:hu(re.rgce,s,null,W,D)};if(re.itab>0)Y.Sheet=re.itab-1;W.names.push(Y);if(!W[0]){W[0]=[];W[0].XTI=[]}W[W.length-1].push(re);if(re.Name=="_xlnm._FilterDatabase"&&re.itab>0)if(re.rgce&&re.rgce[0]&&re.rgce[0][0]&&re.rgce[0][0][0]=="PtgArea3d")K[re.itab-1]={ref:ct(re.rgce[0][0][1][2])};break;case"ExternCount":D.ExternCount=re;break;case"ExternSheet":if(W.length==0){W[0]=[];W[0].XTI=[]}W[W.length-1].XTI=W[W.length-1].XTI.concat(re);W.XTI=W.XTI.concat(re);break;case"NameCmt":if(D.biff<8)break;if(Y!=null)Y.Comment=re[1];break;case"Protect":n["!protect"]=re;break;case"Password":if(re!==0&&D.WTF)console.error("Password verifier: "+re);break;case"Prot4Rev":;case"Prot4RevPass":break;case"BoundSheet8":{i[re.pos]=re;D.snames.push(re.name)}break;case"EOF":{if(--X)break;if(s.e){if(s.e.r>0&&s.e.c>0){s.e.r--;s.e.c--;n["!ref"]=ct(s);s.e.r++;s.e.c++}if(O.length>0)n["!merges"]=O;if(P.length>0)n["!objects"]=P;if(N.length>0)n["!cols"]=N;if(L.length>0)n["!rows"]=L;T.Sheets.push(x)}if(c==="")u=n;else a[c]=n;n=r.dense?[]:{}}break;case"BOF":{if(D.biff===8)D.biff={9:2,521:3,1033:4}[Q]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[re.BIFFVer]||8;if(X++)break;_=true;n=r.dense?[]:{};if(D.biff<8&&!$){$=true;o(D.codepage=r.codepage||1252)}if(D.biff<5){if(c==="")c="Sheet1";s={s:{r:0,c:0},e:{r:0,c:0}};var ae={pos:e.l-J,name:c};i[ae.pos]=ae;D.snames.push(c)}else c=(i[Z]||{name:""}).name;if(re.dt==32)n["!type"]="chart";if(re.dt==64)n["!type"]="macro";O=[];P=[];D.arrayf=k=[];N=[];L=[];M=U=0;H=false;x={Hidden:(i[Z]||{hs:0}).hs,name:c}}break;case"Number":;case"BIFF2NUM":;case"BIFF2INT":{if(n["!type"]=="chart")if(r.dense?(n[re.r]||[])[re.c]:n[ft({c:re.c,r:re.r})])++re.c;w={ixfe:re.ixfe,XF:C[re.ixfe]||{},v:re.val,t:"n"};if(G>0)w.z=j[w.ixfe>>8&31];Vv(w,r,t.opts.Date1904);R({c:re.c,r:re.r},w,r)}break;case"BoolErr":{w={ixfe:re.ixfe,XF:C[re.ixfe],v:re.val,t:re.t};if(G>0)w.z=j[w.ixfe>>8&31];Vv(w,r,t.opts.Date1904);R({c:re.c,r:re.r},w,r)}break;case"RK":{w={ixfe:re.ixfe,XF:C[re.ixfe],v:re.rknum,t:"n"};if(G>0)w.z=j[w.ixfe>>8&31];Vv(w,r,t.opts.Date1904);R({c:re.c,r:re.r},w,r)}break;case"MulRk":{for(var ne=re.c;ne<=re.C;++ne){var ie=re.rkrec[ne-re.c][0];w={ixfe:ie,XF:C[ie],v:re.rkrec[ne-re.c][1],t:"n"};if(G>0)w.z=j[w.ixfe>>8&31];Vv(w,r,t.opts.Date1904);R({c:ne,r:re.r},w,r)}}break;case"Formula":{if(re.val=="String"){l=re;break}w=zv(re.val,re.cell.ixfe,re.tt);w.XF=C[w.ixfe];if(r.cellFormula){var se=re.formula;if(se&&se[0]&&se[0][0]&&se[0][0][0]=="PtgExp"){var le=se[0][0][1][0],fe=se[0][0][1][1];var oe=ft({r:le,c:fe});if(E[oe])w.f=""+hu(re.formula,s,re.cell,W,D);else w.F=((r.dense?(n[le]||[])[fe]:n[oe])||{}).F}else w.f=""+hu(re.formula,s,re.cell,W,D)}if(G>0)w.z=j[w.ixfe>>8&31];Vv(w,r,t.opts.Date1904);R(re.cell,w,r);l=re}break;case"String":{if(l){l.val=re;w=zv(re,l.cell.ixfe,"s");w.XF=C[w.ixfe];if(r.cellFormula){w.f=""+hu(l.formula,s,l.cell,W,D)}if(G>0)w.z=j[w.ixfe>>8&31];Vv(w,r,t.opts.Date1904);R(l.cell,w,r);l=null}else throw new Error("String record expects Formula")}break;case"Array":{k.push(re);var ce=ft(re[0].s);v=r.dense?(n[re[0].s.r]||[])[re[0].s.c]:n[ce];if(r.cellFormula&&v){if(!l)break;if(!ce||!v)break;v.f=""+hu(re[1],s,re[0],W,D);v.F=ct(re[0])}}break;case"ShrFmla":{if(!_)break;if(!r.cellFormula)break;if(d){if(!l)break;E[ft(l.cell)]=re[0];v=r.dense?(n[l.cell.r]||[])[l.cell.c]:n[ft(l.cell)];(v||{}).f=""+hu(re[0],s,h,W,D)}}break;case"LabelSst":w=zv(f[re.isst].t,re.ixfe,"s");w.XF=C[w.ixfe];if(G>0)w.z=j[w.ixfe>>8&31];Vv(w,r,t.opts.Date1904);R({c:re.c,r:re.r},w,r);break;case"Blank":if(r.sheetStubs){w={ixfe:re.ixfe,XF:C[re.ixfe],t:"z"};if(G>0)w.z=j[w.ixfe>>8&31];Vv(w,r,t.opts.Date1904);R({c:re.c,r:re.r},w,r)}break;case"MulBlank":if(r.sheetStubs){for(var ue=re.c;ue<=re.C;++ue){var he=re.ixfe[ue-re.c];w={ixfe:he,XF:C[he],t:"z"};if(G>0)w.z=j[w.ixfe>>8&31];Vv(w,r,t.opts.Date1904);R({c:ue,r:re.r},w,r)}}break;case"RString":;case"Label":;case"BIFF2STR":w=zv(re.val,re.ixfe,"s");w.XF=C[w.ixfe];if(G>0)w.z=j[w.ixfe>>8&31];Vv(w,r,t.opts.Date1904);R({c:re.c,r:re.r},w,r);break;case"Dimensions":{if(X===1)s=re}break;case"SST":{f=re}break;case"Format":{if(D.biff==4){j[G++]=re[1];for(var de=0;de=163)A.load(re[1],G+163)}else A.load(re[1],re[0])}break;case"BIFF2FORMAT":{j[G++]=re;for(var ve=0;ve=163)A.load(re,G+163)}break;case"MergeCells":O=O.concat(re);break;case"Obj":P[re.cmo[0]]=D.lastobj=re;break;case"TxO":D.lastobj.TxO=re;break;case"ImData":D.lastobj.ImData=re;break;case"HLink":{for(g=re[0].s.r;g<=re[0].e.r;++g)for(b=re[0].s.c;b<=re[0].e.c;++b){v=r.dense?(n[g]||[])[b]:n[ft({c:b,r:g})];if(v)v.l=re[1]}}break;case"HLinkTooltip":{for(g=re[0].s.r;g<=re[0].e.r;++g)for(b=re[0].s.c;b<=re[0].e.c;++b){v=r.dense?(n[g]||[])[b]:n[ft({c:b,r:g})];if(v&&v.l)v.l.Tooltip=re[1]}}break;case"Note":{if(D.biff<=5&&D.biff>=2)break;v=r.dense?(n[re[0].r]||[])[re[0].c]:n[ft(re[0])];var pe=P[re[2]];if(!v)break;if(!v.c)v.c=[];p={a:re[1],t:pe.TxO.t};v.c.push(p)}break;default:switch(q.n){case"ClrtClient":break;case"XFExt":to(C[re.ixfe],re.ext);break;case"DefColWidth":M=re;break;case"DefaultRowHeight":U=re[1];break;case"ColInfo":{if(!D.cellStyles)break;while(re.e>=re.s){N[re.e--]={width:re.w/256};if(!H){H=true;jl(re.w/256)}Kl(N[re.e+1])}}break;case"Row":{var me={};if(re.level!=null){L[re.r]=me;me.level=re.level}if(re.hidden){L[re.r]=me;me.hidden=true}if(re.hpt){L[re.r]=me;me.hpt=re.hpt;me.hpx=Ql(re.hpt)}}break;case"LeftMargin":;case"RightMargin":;case"TopMargin":;case"BottomMargin":if(!n["!margins"])Nu(n["!margins"]={});n["!margins"][te.slice(0,-6).toLowerCase()]=re;break;case"Setup":if(!n["!margins"])Nu(n["!margins"]={});n["!margins"].header=re.header;n["!margins"].footer=re.footer;break;case"Window2":if(re.RTL)T.Views[0].RTL=true;break;case"Header":break;case"Footer":break;case"HCenter":break;case"VCenter":break;case"Pls":break;case"GCW":break;case"LHRecord":break;case"DBCell":break;case"EntExU2":break;case"SxView":break;case"Sxvd":break;case"SXVI":break;case"SXVDEx":break;case"SxIvd":break;case"SXString":break;case"Sync":break;case"Addin":break;case"SXDI":break;case"SXLI":break;case"SXEx":break;case"QsiSXTag":break;case"Selection":break;case"Feat":break;case"FeatHdr":;case"FeatHdr11":break;case"Feature11":;case"Feature12":;case"List12":break;case"Country":S=re;break;case"RecalcId":break;case"DxGCol":break;case"Fbi":;case"Fbi2":;case"GelFrame":break;case"Font":break;case"XFCRC":break;case"Style":break;case"StyleExt":break;case"Palette":B=re;break;case"Theme":F=re;break;case"ScenarioProtect":break;case"ObjProtect":break;case"CondFmt12":break;case"Table":break;case"TableStyles":break;case"TableStyle":break;case"TableStyleElement":break;case"SXStreamID":break;case"SXVS":break;case"DConRef":break;case"SXAddl":break;case"DConBin":break;case"DConName":break;case"SXPI":break;case"SxFormat":break;case"SxSelect":break;case"SxRule":break;case"SxFilt":break;case"SxItm":break;case"SxDXF":break;case"ScenMan":break;case"DCon":break;case"CellWatch":break;case"PrintRowCol":break;case"PrintGrid":break;case"PrintSize":break;case"XCT":break;case"CRN":break;case"Scl":{}break;case"SheetExt":{}break;case"SheetExtOptional":{}break;case"ObNoMacros":{}break;case"ObProj":{}break;case"CodeName":{if(!c)T.WBProps.CodeName=re||"ThisWorkbook";else x.CodeName=re||x.name}break;case"GUIDTypeLib":{}break;case"WOpt":break;case"PhoneticInfo":break;case"OleObjectSize":break;case"DXF":;case"DXFN":;case"DXFN12":;case"DXFN12List":;case"DXFN12NoCB":break;case"Dv":;case"DVal":break;case"BRAI":;case"Series":;case"SeriesText":break;case"DConn":break;case"DbOrParamQry":break;case"DBQueryExt":break;case"OleDbConn":break;case"ExtString":break;case"IFmtRecord":break;case"CondFmt":;case"CF":;case"CF12":;case"CFEx":break;case"Excel9File":break;case"Units":break;case"InterfaceHdr":;case"Mms":;case"InterfaceEnd":;case"DSF":break;case"BuiltInFnGroupCount":break;case"Window1":;case"HideObj":;case"GridSet":;case"Guts":;case"UserBView":;case"UserSViewBegin":;case"UserSViewEnd":;case"Pane":break;default:switch(q.n){case"Dat":;case"Begin":;case"End":;case"StartBlock":;case"EndBlock":;case"Frame":;case"Area":;case"Axis":;case"AxisLine":;case"Tick":break;case"AxesUsed":;case"CrtLayout12":;case"CrtLayout12A":;case"CrtLink":;case"CrtLine":;case"CrtMlFrt":;case"CrtMlFrtContinue":break;case"LineFormat":;case"AreaFormat":;case"Chart":;case"Chart3d":;case"Chart3DBarShape":;case"ChartFormat":;case"ChartFrtInfo":break;case"PlotArea":;case"PlotGrowth":break;case"SeriesList":;case"SerParent":;case"SerAuxTrend":break;case"DataFormat":;case"SerToCrt":;case"FontX":break;case"CatSerRange":;case"AxcExt":;case"SerFmt":break;case"ShtProps":break;case"DefaultText":;case"Text":;case"CatLab":break;case"DataLabExtContents":break;case"Legend":;case"LegendException":break;case"Pie":;case"Scatter":break;case"PieFormat":;case"MarkerFormat":break;case"StartObject":;case"EndObject":break;case"AlRuns":;case"ObjectLink":break;case"SIIndex":break;case"AttachedLabel":;case"YMult":break;case"Line":;case"Bar":break;case"Surf":break;case"AxisParent":break;case"Pos":break;case"ValueRange":break;case"SXViewEx9":break;case"SXViewLink":break;case"PivotChartBits":break;case"SBaseRef":break;case"TextPropsStream":break;case"LnExt":break;case"MkrExt":break;case"CrtCoopt":break;case"Qsi":;case"Qsif":;case"Qsir":;case"QsiSXTag":break;case"TxtQry":break;case"FilterMode":break;case"AutoFilter":;case"AutoFilterInfo":break;case"AutoFilter12":break;case"DropDownObjIds":break;case"Sort":break;case"SortData":break;case"ShapePropsStream":break;case"MsoDrawing":;case"MsoDrawingGroup":;case"MsoDrawingSelection":break;case"WebPub":;case"AutoWebPub":break;case"HeaderFooter":;case"HFPicture":;case"PLV":;case"HorizontalPageBreaks":;case"VerticalPageBreaks":break;case"Backup":;case"CompressPictures":;case"Compat12":break;case"Continue":;case"ContinueFrt12":break;case"FrtFontList":;case"FrtWrapper":break;default:switch(q.n){case"TabIdConf":;case"Radar":;case"RadarArea":;case"DropBar":;case"Intl":;case"CoordList":;case"SerAuxErrBar":break;case"BIFF2FONTCLR":;case"BIFF2FMTCNT":;case"BIFF2FONTXTRA":break;case"BIFF2XF":;case"BIFF3XF":;case"BIFF4XF":break;case"BIFF4FMTCNT":;case"BIFF2ROW":;case"BIFF2WINDOW2":break;case"SCENARIO":;case"DConBin":;case"PicF":;case"DataLabExt":;case"Lel":;case"BopPop":;case"BopPopCustom":;case"RealTimeData":;case"Name":break;case"LHNGraph":;case"FnGroupName":;case"AddMenu":;case"LPr":break;case"ListObj":;case"ListField":break;case"RRSort":break;case"BigName":break;case"ToolbarHdr":;case"ToolbarEnd":break;case"DDEObjName":break;case"FRTArchId$":break;default:if(r.WTF)throw"Unrecognized Record "+q.n;};};};}}else e.l+=J}t.SheetNames=z(i).sort(function(e,r){return Number(e)-Number(r)}).map(function(e){return i[e].name});if(!r.bookSheets)t.Sheets=a;if(t.Sheets)K.forEach(function(e,r){t.Sheets[t.SheetNames[r]]["!autofilter"]=e});t.Preamble=u;t.Strings=f;t.SSF=A.get_table();if(D.enc)t.Encryption=D.enc;if(F)t.Themes=F;t.Metadata={};if(S!==undefined)t.Metadata.Country=S;if(W.names.length>0)T.Names=W.names;t.Workbook=T;return t}function Gv(e,r,t){var a=L.find(e,"!DocumentSummaryInformation");if(a&&a.size>0)try{var n=wn(a,ua,"02d5cdd59c2e1b10939708002b2cf9ae");for(var i in n)r[i]=n[i]}catch(s){if(t.WTF)throw s}var l=L.find(e,"!SummaryInformation");if(l&&l.size>0)try{var f=wn(l,ha,"e0859ff2f94f6810ab9108002b27b3d9");for(var o in f)if(r[o]==null)r[o]=f[o]}catch(s){if(t.WTF)throw s}}function jv(e,r){if(!r)r={};Np(r);c();if(r.codepage)l(r.codepage);var t,a;if(e.FullPaths){if(L.find(e,"/encryption"))throw new Error("File is password-protected");t=L.find(e,"!CompObj");a=L.find(e,"/Workbook")||L.find(e,"/Book")}else{switch(r.type){case"base64":e=w(g.decode(e));break;case"binary":e=w(e);break;case"buffer":break;case"array":if(!Array.isArray(e))e=Array.prototype.slice.call(e);break;}Hr(e,0);a={content:e}}var n;var i;if(t)Hv(t);if(r.bookProps&&!r.bookSheets)n={};else{var s=E?"buffer":"array";if(a&&a.content)n=Xv(a.content,r);else if((i=L.find(e,"PerfectOffice_MAIN"))&&i.content)n=js.to_workbook(i.content,(r.type=s,r));else if((i=L.find(e,"NativeContent_MAIN"))&&i.content)n=js.to_workbook(i.content,(r.type=s,r));else throw new Error("Cannot find Workbook stream");if(r.bookVBA&&e.FullPaths&&L.find(e,"/_VBA_PROJECT_CUR/VBA/dir"))n.vbaraw=Co(e)}var f={};if(e.FullPaths)Gv(e,f,r);n.Props=n.Custprops=f;if(r.bookFiles)n.cfb=e;return n}function Kv(e,r){var t=r||{};var a=L.utils.cfb_new({root:"R"});var n="/Workbook";switch(t.bookType||"xls"){case"xls":t.bookType="biff8";case"xla":if(!t.bookType)t.bookType="xla";case"biff8":n="/Workbook";t.biff=8;break;case"biff5":n="/Book";t.biff=5;break;default:throw new Error("invalid type "+t.bookType+" for XLS CFB");}L.utils.cfb_add(a,n,vp(e,t));if(t.biff==8&&e.vbaraw)Bo(a,L.read(e.vbaraw,{type:typeof e.vbaraw=="string"?"binary":"buffer"}));return a}var Yv={0:{n:"BrtRowHdr",f:vh},1:{n:"BrtCellBlank",f:Sh},2:{n:"BrtCellRk",f:Rh},3:{n:"BrtCellError",f:Th},4:{n:"BrtCellBool",f:Ch},5:{n:"BrtCellReal",f:Ah},6:{n:"BrtCellSt",f:Fh},7:{n:"BrtCellIsst",f:xh},8:{n:"BrtFmlaString",f:Mh},9:{n:"BrtFmlaNum",f:Lh},10:{n:"BrtFmlaBool",f:Ph},11:{n:"BrtFmlaError",f:Nh},16:{n:"BrtFRTArchID$",f:Wd},19:{n:"BrtSSTItem",f:St},20:{n:"BrtPCDIMissing"},21:{n:"BrtPCDINumber"},22:{n:"BrtPCDIBoolean"},23:{n:"BrtPCDIError"},24:{n:"BrtPCDIString"},25:{n:"BrtPCDIDatetime"},26:{n:"BrtPCDIIndex"},27:{n:"BrtPCDIAMissing"},28:{n:"BrtPCDIANumber"},29:{n:"BrtPCDIABoolean"},30:{n:"BrtPCDIAError"},31:{n:"BrtPCDIAString"},32:{n:"BrtPCDIADatetime"},33:{n:"BrtPCRRecord"},34:{n:"BrtPCRRecordDt"},35:{n:"BrtFRTBegin"},36:{n:"BrtFRTEnd"},37:{n:"BrtACBegin"},38:{n:"BrtACEnd"},39:{n:"BrtName",f:Vd},40:{n:"BrtIndexRowBlock"},42:{n:"BrtIndexBlock"},43:{n:"BrtFont",f:vf},44:{n:"BrtFmt",f:hf},45:{n:"BrtFill",f:gf},46:{n:"BrtBorder",f:_f},47:{n:"BrtXF",f:kf},48:{n:"BrtStyle"},49:{n:"BrtCellMeta"},50:{n:"BrtValueMeta"},51:{n:"BrtMdb"},52:{n:"BrtBeginFmd"},53:{n:"BrtEndFmd"},54:{n:"BrtBeginMdx"},55:{n:"BrtEndMdx"},56:{n:"BrtBeginMdxTuple"},57:{n:"BrtEndMdxTuple" -},58:{n:"BrtMdxMbrIstr"},59:{n:"BrtStr"},60:{n:"BrtColInfo",f:Cs},62:{n:"BrtCellRString"},63:{n:"BrtCalcChainItem$",f:no},64:{n:"BrtDVal"},65:{n:"BrtSxvcellNum"},66:{n:"BrtSxvcellStr"},67:{n:"BrtSxvcellBool"},68:{n:"BrtSxvcellErr"},69:{n:"BrtSxvcellDate"},70:{n:"BrtSxvcellNil"},128:{n:"BrtFileVersion"},129:{n:"BrtBeginSheet"},130:{n:"BrtEndSheet"},131:{n:"BrtBeginBook",f:Wr,p:0},132:{n:"BrtEndBook"},133:{n:"BrtBeginWsViews"},134:{n:"BrtEndWsViews"},135:{n:"BrtBeginBookViews"},136:{n:"BrtEndBookViews"},137:{n:"BrtBeginWsView",f:Zh},138:{n:"BrtEndWsView"},139:{n:"BrtBeginCsViews"},140:{n:"BrtEndCsViews"},141:{n:"BrtBeginCsView"},142:{n:"BrtEndCsView"},143:{n:"BrtBeginBundleShs"},144:{n:"BrtEndBundleShs"},145:{n:"BrtBeginSheetData"},146:{n:"BrtEndSheetData"},147:{n:"BrtWsProp",f:kh},148:{n:"BrtWsDim",f:bh,p:16},151:{n:"BrtPane"},152:{n:"BrtSel"},153:{n:"BrtWbProp",f:Ud},154:{n:"BrtWbFactoid"},155:{n:"BrtFileRecover"},156:{n:"BrtBundleSh",f:Ld},157:{n:"BrtCalcProp"},158:{n:"BrtBookView"},159:{n:"BrtBeginSst",f:nl},160:{n:"BrtEndSst"},161:{n:"BrtBeginAFilter",f:Ut},162:{n:"BrtEndAFilter"},163:{n:"BrtBeginFilterColumn"},164:{n:"BrtEndFilterColumn"},165:{n:"BrtBeginFilters"},166:{n:"BrtEndFilters"},167:{n:"BrtFilter"},168:{n:"BrtColorFilter"},169:{n:"BrtIconFilter"},170:{n:"BrtTop10Filter"},171:{n:"BrtDynamicFilter"},172:{n:"BrtBeginCustomFilters"},173:{n:"BrtEndCustomFilters"},174:{n:"BrtCustomFilter"},175:{n:"BrtAFilterDateGroupItem"},176:{n:"BrtMergeCell",f:Uh},177:{n:"BrtBeginMergeCells"},178:{n:"BrtEndMergeCells"},179:{n:"BrtBeginPivotCacheDef"},180:{n:"BrtEndPivotCacheDef"},181:{n:"BrtBeginPCDFields"},182:{n:"BrtEndPCDFields"},183:{n:"BrtBeginPCDField"},184:{n:"BrtEndPCDField"},185:{n:"BrtBeginPCDSource"},186:{n:"BrtEndPCDSource"},187:{n:"BrtBeginPCDSRange"},188:{n:"BrtEndPCDSRange"},189:{n:"BrtBeginPCDFAtbl"},190:{n:"BrtEndPCDFAtbl"},191:{n:"BrtBeginPCDIRun"},192:{n:"BrtEndPCDIRun"},193:{n:"BrtBeginPivotCacheRecords"},194:{n:"BrtEndPivotCacheRecords"},195:{n:"BrtBeginPCDHierarchies"},196:{n:"BrtEndPCDHierarchies"},197:{n:"BrtBeginPCDHierarchy"},198:{n:"BrtEndPCDHierarchy"},199:{n:"BrtBeginPCDHFieldsUsage"},200:{n:"BrtEndPCDHFieldsUsage"},201:{n:"BrtBeginExtConnection"},202:{n:"BrtEndExtConnection"},203:{n:"BrtBeginECDbProps"},204:{n:"BrtEndECDbProps"},205:{n:"BrtBeginECOlapProps"},206:{n:"BrtEndECOlapProps"},207:{n:"BrtBeginPCDSConsol"},208:{n:"BrtEndPCDSConsol"},209:{n:"BrtBeginPCDSCPages"},210:{n:"BrtEndPCDSCPages"},211:{n:"BrtBeginPCDSCPage"},212:{n:"BrtEndPCDSCPage"},213:{n:"BrtBeginPCDSCPItem"},214:{n:"BrtEndPCDSCPItem"},215:{n:"BrtBeginPCDSCSets"},216:{n:"BrtEndPCDSCSets"},217:{n:"BrtBeginPCDSCSet"},218:{n:"BrtEndPCDSCSet"},219:{n:"BrtBeginPCDFGroup"},220:{n:"BrtEndPCDFGroup"},221:{n:"BrtBeginPCDFGItems"},222:{n:"BrtEndPCDFGItems"},223:{n:"BrtBeginPCDFGRange"},224:{n:"BrtEndPCDFGRange"},225:{n:"BrtBeginPCDFGDiscrete"},226:{n:"BrtEndPCDFGDiscrete"},227:{n:"BrtBeginPCDSDTupleCache"},228:{n:"BrtEndPCDSDTupleCache"},229:{n:"BrtBeginPCDSDTCEntries"},230:{n:"BrtEndPCDSDTCEntries"},231:{n:"BrtBeginPCDSDTCEMembers"},232:{n:"BrtEndPCDSDTCEMembers"},233:{n:"BrtBeginPCDSDTCEMember"},234:{n:"BrtEndPCDSDTCEMember"},235:{n:"BrtBeginPCDSDTCQueries"},236:{n:"BrtEndPCDSDTCQueries"},237:{n:"BrtBeginPCDSDTCQuery"},238:{n:"BrtEndPCDSDTCQuery"},239:{n:"BrtBeginPCDSDTCSets"},240:{n:"BrtEndPCDSDTCSets"},241:{n:"BrtBeginPCDSDTCSet"},242:{n:"BrtEndPCDSDTCSet"},243:{n:"BrtBeginPCDCalcItems"},244:{n:"BrtEndPCDCalcItems"},245:{n:"BrtBeginPCDCalcItem"},246:{n:"BrtEndPCDCalcItem"},247:{n:"BrtBeginPRule"},248:{n:"BrtEndPRule"},249:{n:"BrtBeginPRFilters"},250:{n:"BrtEndPRFilters"},251:{n:"BrtBeginPRFilter"},252:{n:"BrtEndPRFilter"},253:{n:"BrtBeginPNames"},254:{n:"BrtEndPNames"},255:{n:"BrtBeginPName"},256:{n:"BrtEndPName"},257:{n:"BrtBeginPNPairs"},258:{n:"BrtEndPNPairs"},259:{n:"BrtBeginPNPair"},260:{n:"BrtEndPNPair"},261:{n:"BrtBeginECWebProps"},262:{n:"BrtEndECWebProps"},263:{n:"BrtBeginEcWpTables"},264:{n:"BrtEndECWPTables"},265:{n:"BrtBeginECParams"},266:{n:"BrtEndECParams"},267:{n:"BrtBeginECParam"},268:{n:"BrtEndECParam"},269:{n:"BrtBeginPCDKPIs"},270:{n:"BrtEndPCDKPIs"},271:{n:"BrtBeginPCDKPI"},272:{n:"BrtEndPCDKPI"},273:{n:"BrtBeginDims"},274:{n:"BrtEndDims"},275:{n:"BrtBeginDim"},276:{n:"BrtEndDim"},277:{n:"BrtIndexPartEnd"},278:{n:"BrtBeginStyleSheet"},279:{n:"BrtEndStyleSheet"},280:{n:"BrtBeginSXView"},281:{n:"BrtEndSXVI"},282:{n:"BrtBeginSXVI"},283:{n:"BrtBeginSXVIs"},284:{n:"BrtEndSXVIs"},285:{n:"BrtBeginSXVD"},286:{n:"BrtEndSXVD"},287:{n:"BrtBeginSXVDs"},288:{n:"BrtEndSXVDs"},289:{n:"BrtBeginSXPI"},290:{n:"BrtEndSXPI"},291:{n:"BrtBeginSXPIs"},292:{n:"BrtEndSXPIs"},293:{n:"BrtBeginSXDI"},294:{n:"BrtEndSXDI"},295:{n:"BrtBeginSXDIs"},296:{n:"BrtEndSXDIs"},297:{n:"BrtBeginSXLI"},298:{n:"BrtEndSXLI"},299:{n:"BrtBeginSXLIRws"},300:{n:"BrtEndSXLIRws"},301:{n:"BrtBeginSXLICols"},302:{n:"BrtEndSXLICols"},303:{n:"BrtBeginSXFormat"},304:{n:"BrtEndSXFormat"},305:{n:"BrtBeginSXFormats"},306:{n:"BrtEndSxFormats"},307:{n:"BrtBeginSxSelect"},308:{n:"BrtEndSxSelect"},309:{n:"BrtBeginISXVDRws"},310:{n:"BrtEndISXVDRws"},311:{n:"BrtBeginISXVDCols"},312:{n:"BrtEndISXVDCols"},313:{n:"BrtEndSXLocation"},314:{n:"BrtBeginSXLocation"},315:{n:"BrtEndSXView"},316:{n:"BrtBeginSXTHs"},317:{n:"BrtEndSXTHs"},318:{n:"BrtBeginSXTH"},319:{n:"BrtEndSXTH"},320:{n:"BrtBeginISXTHRws"},321:{n:"BrtEndISXTHRws"},322:{n:"BrtBeginISXTHCols"},323:{n:"BrtEndISXTHCols"},324:{n:"BrtBeginSXTDMPS"},325:{n:"BrtEndSXTDMPs"},326:{n:"BrtBeginSXTDMP"},327:{n:"BrtEndSXTDMP"},328:{n:"BrtBeginSXTHItems"},329:{n:"BrtEndSXTHItems"},330:{n:"BrtBeginSXTHItem"},331:{n:"BrtEndSXTHItem"},332:{n:"BrtBeginMetadata"},333:{n:"BrtEndMetadata"},334:{n:"BrtBeginEsmdtinfo"},335:{n:"BrtMdtinfo"},336:{n:"BrtEndEsmdtinfo"},337:{n:"BrtBeginEsmdb"},338:{n:"BrtEndEsmdb"},339:{n:"BrtBeginEsfmd"},340:{n:"BrtEndEsfmd"},341:{n:"BrtBeginSingleCells"},342:{n:"BrtEndSingleCells"},343:{n:"BrtBeginList"},344:{n:"BrtEndList"},345:{n:"BrtBeginListCols"},346:{n:"BrtEndListCols"},347:{n:"BrtBeginListCol"},348:{n:"BrtEndListCol"},349:{n:"BrtBeginListXmlCPr"},350:{n:"BrtEndListXmlCPr"},351:{n:"BrtListCCFmla"},352:{n:"BrtListTrFmla"},353:{n:"BrtBeginExternals"},354:{n:"BrtEndExternals"},355:{n:"BrtSupBookSrc",f:Ft},357:{n:"BrtSupSelf"},358:{n:"BrtSupSame"},359:{n:"BrtSupTabs"},360:{n:"BrtBeginSupBook"},361:{n:"BrtPlaceholderName"},362:{n:"BrtExternSheet",f:rs},363:{n:"BrtExternTableStart"},364:{n:"BrtExternTableEnd"},366:{n:"BrtExternRowHdr"},367:{n:"BrtExternCellBlank"},368:{n:"BrtExternCellReal"},369:{n:"BrtExternCellBool"},370:{n:"BrtExternCellError"},371:{n:"BrtExternCellString"},372:{n:"BrtBeginEsmdx"},373:{n:"BrtEndEsmdx"},374:{n:"BrtBeginMdxSet"},375:{n:"BrtEndMdxSet"},376:{n:"BrtBeginMdxMbrProp"},377:{n:"BrtEndMdxMbrProp"},378:{n:"BrtBeginMdxKPI"},379:{n:"BrtEndMdxKPI"},380:{n:"BrtBeginEsstr"},381:{n:"BrtEndEsstr"},382:{n:"BrtBeginPRFItem"},383:{n:"BrtEndPRFItem"},384:{n:"BrtBeginPivotCacheIDs"},385:{n:"BrtEndPivotCacheIDs"},386:{n:"BrtBeginPivotCacheID"},387:{n:"BrtEndPivotCacheID"},388:{n:"BrtBeginISXVIs"},389:{n:"BrtEndISXVIs"},390:{n:"BrtBeginColInfos"},391:{n:"BrtEndColInfos"},392:{n:"BrtBeginRwBrk"},393:{n:"BrtEndRwBrk"},394:{n:"BrtBeginColBrk"},395:{n:"BrtEndColBrk"},396:{n:"BrtBrk"},397:{n:"BrtUserBookView"},398:{n:"BrtInfo"},399:{n:"BrtCUsr"},400:{n:"BrtUsr"},401:{n:"BrtBeginUsers"},403:{n:"BrtEOF"},404:{n:"BrtUCR"},405:{n:"BrtRRInsDel"},406:{n:"BrtRREndInsDel"},407:{n:"BrtRRMove"},408:{n:"BrtRREndMove"},409:{n:"BrtRRChgCell"},410:{n:"BrtRREndChgCell"},411:{n:"BrtRRHeader"},412:{n:"BrtRRUserView"},413:{n:"BrtRRRenSheet"},414:{n:"BrtRRInsertSh"},415:{n:"BrtRRDefName"},416:{n:"BrtRRNote"},417:{n:"BrtRRConflict"},418:{n:"BrtRRTQSIF"},419:{n:"BrtRRFormat"},420:{n:"BrtRREndFormat"},421:{n:"BrtRRAutoFmt"},422:{n:"BrtBeginUserShViews"},423:{n:"BrtBeginUserShView"},424:{n:"BrtEndUserShView"},425:{n:"BrtEndUserShViews"},426:{n:"BrtArrFmla",f:Xh},427:{n:"BrtShrFmla",f:Gh},428:{n:"BrtTable"},429:{n:"BrtBeginExtConnections"},430:{n:"BrtEndExtConnections"},431:{n:"BrtBeginPCDCalcMems"},432:{n:"BrtEndPCDCalcMems"},433:{n:"BrtBeginPCDCalcMem"},434:{n:"BrtEndPCDCalcMem"},435:{n:"BrtBeginPCDHGLevels"},436:{n:"BrtEndPCDHGLevels"},437:{n:"BrtBeginPCDHGLevel"},438:{n:"BrtEndPCDHGLevel"},439:{n:"BrtBeginPCDHGLGroups"},440:{n:"BrtEndPCDHGLGroups"},441:{n:"BrtBeginPCDHGLGroup"},442:{n:"BrtEndPCDHGLGroup"},443:{n:"BrtBeginPCDHGLGMembers"},444:{n:"BrtEndPCDHGLGMembers"},445:{n:"BrtBeginPCDHGLGMember"},446:{n:"BrtEndPCDHGLGMember"},447:{n:"BrtBeginQSI"},448:{n:"BrtEndQSI"},449:{n:"BrtBeginQSIR"},450:{n:"BrtEndQSIR"},451:{n:"BrtBeginDeletedNames"},452:{n:"BrtEndDeletedNames"},453:{n:"BrtBeginDeletedName"},454:{n:"BrtEndDeletedName"},455:{n:"BrtBeginQSIFs"},456:{n:"BrtEndQSIFs"},457:{n:"BrtBeginQSIF"},458:{n:"BrtEndQSIF"},459:{n:"BrtBeginAutoSortScope"},460:{n:"BrtEndAutoSortScope"},461:{n:"BrtBeginConditionalFormatting"},462:{n:"BrtEndConditionalFormatting"},463:{n:"BrtBeginCFRule"},464:{n:"BrtEndCFRule"},465:{n:"BrtBeginIconSet"},466:{n:"BrtEndIconSet"},467:{n:"BrtBeginDatabar"},468:{n:"BrtEndDatabar"},469:{n:"BrtBeginColorScale"},470:{n:"BrtEndColorScale"},471:{n:"BrtCFVO"},472:{n:"BrtExternValueMeta"},473:{n:"BrtBeginColorPalette"},474:{n:"BrtEndColorPalette"},475:{n:"BrtIndexedColor"},476:{n:"BrtMargins",f:Yh},477:{n:"BrtPrintOptions"},478:{n:"BrtPageSetup"},479:{n:"BrtBeginHeaderFooter"},480:{n:"BrtEndHeaderFooter"},481:{n:"BrtBeginSXCrtFormat"},482:{n:"BrtEndSXCrtFormat"},483:{n:"BrtBeginSXCrtFormats"},484:{n:"BrtEndSXCrtFormats"},485:{n:"BrtWsFmtInfo",f:Eh},486:{n:"BrtBeginMgs"},487:{n:"BrtEndMGs"},488:{n:"BrtBeginMGMaps"},489:{n:"BrtEndMGMaps"},490:{n:"BrtBeginMG"},491:{n:"BrtEndMG"},492:{n:"BrtBeginMap"},493:{n:"BrtEndMap"},494:{n:"BrtHLink",f:Vh},495:{n:"BrtBeginDCon"},496:{n:"BrtEndDCon"},497:{n:"BrtBeginDRefs"},498:{n:"BrtEndDRefs"},499:{n:"BrtDRef"},500:{n:"BrtBeginScenMan"},501:{n:"BrtEndScenMan"},502:{n:"BrtBeginSct"},503:{n:"BrtEndSct"},504:{n:"BrtSlc"},505:{n:"BrtBeginDXFs"},506:{n:"BrtEndDXFs"},507:{n:"BrtDXF"},508:{n:"BrtBeginTableStyles"},509:{n:"BrtEndTableStyles"},510:{n:"BrtBeginTableStyle"},511:{n:"BrtEndTableStyle"},512:{n:"BrtTableStyleElement"},513:{n:"BrtTableStyleClient"},514:{n:"BrtBeginVolDeps"},515:{n:"BrtEndVolDeps"},516:{n:"BrtBeginVolType"},517:{n:"BrtEndVolType"},518:{n:"BrtBeginVolMain"},519:{n:"BrtEndVolMain"},520:{n:"BrtBeginVolTopic"},521:{n:"BrtEndVolTopic"},522:{n:"BrtVolSubtopic"},523:{n:"BrtVolRef"},524:{n:"BrtVolNum"},525:{n:"BrtVolErr"},526:{n:"BrtVolStr"},527:{n:"BrtVolBool"},528:{n:"BrtBeginCalcChain$"},529:{n:"BrtEndCalcChain$"},530:{n:"BrtBeginSortState"},531:{n:"BrtEndSortState"},532:{n:"BrtBeginSortCond"},533:{n:"BrtEndSortCond"},534:{n:"BrtBookProtection"},535:{n:"BrtSheetProtection"},536:{n:"BrtRangeProtection"},537:{n:"BrtPhoneticInfo"},538:{n:"BrtBeginECTxtWiz"},539:{n:"BrtEndECTxtWiz"},540:{n:"BrtBeginECTWFldInfoLst"},541:{n:"BrtEndECTWFldInfoLst"},542:{n:"BrtBeginECTwFldInfo"},548:{n:"BrtFileSharing"},549:{n:"BrtOleSize"},550:{n:"BrtDrawing",f:Ft},551:{n:"BrtLegacyDrawing"},552:{n:"BrtLegacyDrawingHF"},553:{n:"BrtWebOpt"},554:{n:"BrtBeginWebPubItems"},555:{n:"BrtEndWebPubItems"},556:{n:"BrtBeginWebPubItem"},557:{n:"BrtEndWebPubItem"},558:{n:"BrtBeginSXCondFmt"},559:{n:"BrtEndSXCondFmt"},560:{n:"BrtBeginSXCondFmts"},561:{n:"BrtEndSXCondFmts"},562:{n:"BrtBkHim"},564:{n:"BrtColor"},565:{n:"BrtBeginIndexedColors"},566:{n:"BrtEndIndexedColors"},569:{n:"BrtBeginMRUColors"},570:{n:"BrtEndMRUColors"},572:{n:"BrtMRUColor"},573:{n:"BrtBeginDVals"},574:{n:"BrtEndDVals"},577:{n:"BrtSupNameStart"},578:{n:"BrtSupNameValueStart"},579:{n:"BrtSupNameValueEnd"},580:{n:"BrtSupNameNum"},581:{n:"BrtSupNameErr"},582:{n:"BrtSupNameSt"},583:{n:"BrtSupNameNil"},584:{n:"BrtSupNameBool"},585:{n:"BrtSupNameFmla"},586:{n:"BrtSupNameBits"},587:{n:"BrtSupNameEnd"},588:{n:"BrtEndSupBook"},589:{n:"BrtCellSmartTagProperty"},590:{n:"BrtBeginCellSmartTag"},591:{n:"BrtEndCellSmartTag"},592:{n:"BrtBeginCellSmartTags"},593:{n:"BrtEndCellSmartTags"},594:{n:"BrtBeginSmartTags"},595:{n:"BrtEndSmartTags"},596:{n:"BrtSmartTagType"},597:{n:"BrtBeginSmartTagTypes"},598:{n:"BrtEndSmartTagTypes"},599:{n:"BrtBeginSXFilters"},600:{n:"BrtEndSXFilters"},601:{n:"BrtBeginSXFILTER"},602:{n:"BrtEndSXFilter"},603:{n:"BrtBeginFills"},604:{n:"BrtEndFills"},605:{n:"BrtBeginCellWatches"},606:{n:"BrtEndCellWatches"},607:{n:"BrtCellWatch"},608:{n:"BrtBeginCRErrs"},609:{n:"BrtEndCRErrs"},610:{n:"BrtCrashRecErr"},611:{n:"BrtBeginFonts"},612:{n:"BrtEndFonts"},613:{n:"BrtBeginBorders"},614:{n:"BrtEndBorders"},615:{n:"BrtBeginFmts"},616:{n:"BrtEndFmts"},617:{n:"BrtBeginCellXFs"},618:{n:"BrtEndCellXFs"},619:{n:"BrtBeginStyles"},620:{n:"BrtEndStyles"},625:{n:"BrtBigName"},626:{n:"BrtBeginCellStyleXFs"},627:{n:"BrtEndCellStyleXFs"},628:{n:"BrtBeginComments"},629:{n:"BrtEndComments"},630:{n:"BrtBeginCommentAuthors"},631:{n:"BrtEndCommentAuthors"},632:{n:"BrtCommentAuthor",f:Eo},633:{n:"BrtBeginCommentList"},634:{n:"BrtEndCommentList"},635:{n:"BrtBeginComment",f:bo},636:{n:"BrtEndComment"},637:{n:"BrtCommentText",f:Ct},638:{n:"BrtBeginOleObjects"},639:{n:"BrtOleObject"},640:{n:"BrtEndOleObjects"},641:{n:"BrtBeginSxrules"},642:{n:"BrtEndSxRules"},643:{n:"BrtBeginActiveXControls"},644:{n:"BrtActiveX"},645:{n:"BrtEndActiveXControls"},646:{n:"BrtBeginPCDSDTCEMembersSortBy"},648:{n:"BrtBeginCellIgnoreECs"},649:{n:"BrtCellIgnoreEC"},650:{n:"BrtEndCellIgnoreECs"},651:{n:"BrtCsProp",f:gd},652:{n:"BrtCsPageSetup"},653:{n:"BrtBeginUserCsViews"},654:{n:"BrtEndUserCsViews"},655:{n:"BrtBeginUserCsView"},656:{n:"BrtEndUserCsView"},657:{n:"BrtBeginPcdSFCIEntries"},658:{n:"BrtEndPCDSFCIEntries"},659:{n:"BrtPCDSFCIEntry"},660:{n:"BrtBeginListParts"},661:{n:"BrtListPart"},662:{n:"BrtEndListParts"},663:{n:"BrtSheetCalcProp"},664:{n:"BrtBeginFnGroup"},665:{n:"BrtFnGroup"},666:{n:"BrtEndFnGroup"},667:{n:"BrtSupAddin"},668:{n:"BrtSXTDMPOrder"},669:{n:"BrtCsProtection"},671:{n:"BrtBeginWsSortMap"},672:{n:"BrtEndWsSortMap"},673:{n:"BrtBeginRRSort"},674:{n:"BrtEndRRSort"},675:{n:"BrtRRSortItem"},676:{n:"BrtFileSharingIso"},677:{n:"BrtBookProtectionIso"},678:{n:"BrtSheetProtectionIso"},679:{n:"BrtCsProtectionIso"},680:{n:"BrtRangeProtectionIso"},1024:{n:"BrtRwDescent"},1025:{n:"BrtKnownFonts"},1026:{n:"BrtBeginSXTupleSet"},1027:{n:"BrtEndSXTupleSet"},1028:{n:"BrtBeginSXTupleSetHeader"},1029:{n:"BrtEndSXTupleSetHeader"},1030:{n:"BrtSXTupleSetHeaderItem"},1031:{n:"BrtBeginSXTupleSetData"},1032:{n:"BrtEndSXTupleSetData"},1033:{n:"BrtBeginSXTupleSetRow"},1034:{n:"BrtEndSXTupleSetRow"},1035:{n:"BrtSXTupleSetRowItem"},1036:{n:"BrtNameExt"},1037:{n:"BrtPCDH14"},1038:{n:"BrtBeginPCDCalcMem14"},1039:{n:"BrtEndPCDCalcMem14"},1040:{n:"BrtSXTH14"},1041:{n:"BrtBeginSparklineGroup"},1042:{n:"BrtEndSparklineGroup"},1043:{n:"BrtSparkline"},1044:{n:"BrtSXDI14"},1045:{n:"BrtWsFmtInfoEx14"},1046:{n:"BrtBeginConditionalFormatting14"},1047:{n:"BrtEndConditionalFormatting14"},1048:{n:"BrtBeginCFRule14"},1049:{n:"BrtEndCFRule14"},1050:{n:"BrtCFVO14"},1051:{n:"BrtBeginDatabar14"},1052:{n:"BrtBeginIconSet14"},1053:{n:"BrtDVal14"},1054:{n:"BrtBeginDVals14"},1055:{n:"BrtColor14"},1056:{n:"BrtBeginSparklines"},1057:{n:"BrtEndSparklines"},1058:{n:"BrtBeginSparklineGroups"},1059:{n:"BrtEndSparklineGroups"},1061:{n:"BrtSXVD14"},1062:{n:"BrtBeginSXView14"},1063:{n:"BrtEndSXView14"},1064:{n:"BrtBeginSXView16"},1065:{n:"BrtEndSXView16"},1066:{n:"BrtBeginPCD14"},1067:{n:"BrtEndPCD14"},1068:{n:"BrtBeginExtConn14"},1069:{n:"BrtEndExtConn14"},1070:{n:"BrtBeginSlicerCacheIDs"},1071:{n:"BrtEndSlicerCacheIDs"},1072:{n:"BrtBeginSlicerCacheID"},1073:{n:"BrtEndSlicerCacheID"},1075:{n:"BrtBeginSlicerCache"},1076:{n:"BrtEndSlicerCache"},1077:{n:"BrtBeginSlicerCacheDef"},1078:{n:"BrtEndSlicerCacheDef"},1079:{n:"BrtBeginSlicersEx"},1080:{n:"BrtEndSlicersEx"},1081:{n:"BrtBeginSlicerEx"},1082:{n:"BrtEndSlicerEx"},1083:{n:"BrtBeginSlicer"},1084:{n:"BrtEndSlicer"},1085:{n:"BrtSlicerCachePivotTables"},1086:{n:"BrtBeginSlicerCacheOlapImpl"},1087:{n:"BrtEndSlicerCacheOlapImpl"},1088:{n:"BrtBeginSlicerCacheLevelsData"},1089:{n:"BrtEndSlicerCacheLevelsData"},1090:{n:"BrtBeginSlicerCacheLevelData"},1091:{n:"BrtEndSlicerCacheLevelData"},1092:{n:"BrtBeginSlicerCacheSiRanges"},1093:{n:"BrtEndSlicerCacheSiRanges"},1094:{n:"BrtBeginSlicerCacheSiRange"},1095:{n:"BrtEndSlicerCacheSiRange"},1096:{n:"BrtSlicerCacheOlapItem"},1097:{n:"BrtBeginSlicerCacheSelections"},1098:{n:"BrtSlicerCacheSelection"},1099:{n:"BrtEndSlicerCacheSelections"},1100:{n:"BrtBeginSlicerCacheNative"},1101:{n:"BrtEndSlicerCacheNative"},1102:{n:"BrtSlicerCacheNativeItem"},1103:{n:"BrtRangeProtection14"},1104:{n:"BrtRangeProtectionIso14"},1105:{n:"BrtCellIgnoreEC14"},1111:{n:"BrtList14"},1112:{n:"BrtCFIcon"},1113:{n:"BrtBeginSlicerCachesPivotCacheIDs"},1114:{n:"BrtEndSlicerCachesPivotCacheIDs"},1115:{n:"BrtBeginSlicers"},1116:{n:"BrtEndSlicers"},1117:{n:"BrtWbProp14"},1118:{n:"BrtBeginSXEdit"},1119:{n:"BrtEndSXEdit"},1120:{n:"BrtBeginSXEdits"},1121:{n:"BrtEndSXEdits"},1122:{n:"BrtBeginSXChange"},1123:{n:"BrtEndSXChange"},1124:{n:"BrtBeginSXChanges"},1125:{n:"BrtEndSXChanges"},1126:{n:"BrtSXTupleItems"},1128:{n:"BrtBeginSlicerStyle"},1129:{n:"BrtEndSlicerStyle"},1130:{n:"BrtSlicerStyleElement"},1131:{n:"BrtBeginStyleSheetExt14"},1132:{n:"BrtEndStyleSheetExt14"},1133:{n:"BrtBeginSlicerCachesPivotCacheID"},1134:{n:"BrtEndSlicerCachesPivotCacheID"},1135:{n:"BrtBeginConditionalFormattings"},1136:{n:"BrtEndConditionalFormattings"},1137:{n:"BrtBeginPCDCalcMemExt"},1138:{n:"BrtEndPCDCalcMemExt"},1139:{n:"BrtBeginPCDCalcMemsExt"},1140:{n:"BrtEndPCDCalcMemsExt"},1141:{n:"BrtPCDField14"},1142:{n:"BrtBeginSlicerStyles"},1143:{n:"BrtEndSlicerStyles"},1144:{n:"BrtBeginSlicerStyleElements"},1145:{n:"BrtEndSlicerStyleElements"},1146:{n:"BrtCFRuleExt"},1147:{n:"BrtBeginSXCondFmt14"},1148:{n:"BrtEndSXCondFmt14"},1149:{n:"BrtBeginSXCondFmts14"},1150:{n:"BrtEndSXCondFmts14"},1152:{n:"BrtBeginSortCond14"},1153:{n:"BrtEndSortCond14"},1154:{n:"BrtEndDVals14"},1155:{n:"BrtEndIconSet14"},1156:{n:"BrtEndDatabar14"},1157:{n:"BrtBeginColorScale14"},1158:{n:"BrtEndColorScale14"},1159:{n:"BrtBeginSxrules14"},1160:{n:"BrtEndSxrules14"},1161:{n:"BrtBeginPRule14"},1162:{n:"BrtEndPRule14"},1163:{n:"BrtBeginPRFilters14"},1164:{n:"BrtEndPRFilters14"},1165:{n:"BrtBeginPRFilter14"},1166:{n:"BrtEndPRFilter14"},1167:{n:"BrtBeginPRFItem14"},1168:{n:"BrtEndPRFItem14"},1169:{n:"BrtBeginCellIgnoreECs14"},1170:{n:"BrtEndCellIgnoreECs14"},1171:{n:"BrtDxf14"},1172:{n:"BrtBeginDxF14s"},1173:{n:"BrtEndDxf14s"},1177:{n:"BrtFilter14"},1178:{n:"BrtBeginCustomFilters14"},1180:{n:"BrtCustomFilter14"},1181:{n:"BrtIconFilter14"},1182:{n:"BrtPivotCacheConnectionName"},2048:{n:"BrtBeginDecoupledPivotCacheIDs"},2049:{n:"BrtEndDecoupledPivotCacheIDs"},2050:{n:"BrtDecoupledPivotCacheID"},2051:{n:"BrtBeginPivotTableRefs"},2052:{n:"BrtEndPivotTableRefs"},2053:{n:"BrtPivotTableRef"},2054:{n:"BrtSlicerCacheBookPivotTables"},2055:{n:"BrtBeginSxvcells"},2056:{n:"BrtEndSxvcells"},2057:{n:"BrtBeginSxRow"},2058:{n:"BrtEndSxRow"},2060:{n:"BrtPcdCalcMem15"},2067:{n:"BrtQsi15"},2068:{n:"BrtBeginWebExtensions"},2069:{n:"BrtEndWebExtensions"},2070:{n:"BrtWebExtension"},2071:{n:"BrtAbsPath15"},2072:{n:"BrtBeginPivotTableUISettings"},2073:{n:"BrtEndPivotTableUISettings"},2075:{n:"BrtTableSlicerCacheIDs"},2076:{n:"BrtTableSlicerCacheID"},2077:{n:"BrtBeginTableSlicerCache"},2078:{n:"BrtEndTableSlicerCache"},2079:{n:"BrtSxFilter15"},2080:{n:"BrtBeginTimelineCachePivotCacheIDs"},2081:{n:"BrtEndTimelineCachePivotCacheIDs"},2082:{n:"BrtTimelineCachePivotCacheID"},2083:{n:"BrtBeginTimelineCacheIDs"},2084:{n:"BrtEndTimelineCacheIDs"},2085:{n:"BrtBeginTimelineCacheID"},2086:{n:"BrtEndTimelineCacheID"},2087:{n:"BrtBeginTimelinesEx"},2088:{n:"BrtEndTimelinesEx"},2089:{n:"BrtBeginTimelineEx"},2090:{n:"BrtEndTimelineEx"},2091:{n:"BrtWorkBookPr15"},2092:{n:"BrtPCDH15"},2093:{n:"BrtBeginTimelineStyle"},2094:{n:"BrtEndTimelineStyle"},2095:{n:"BrtTimelineStyleElement"},2096:{n:"BrtBeginTimelineStylesheetExt15"},2097:{n:"BrtEndTimelineStylesheetExt15"},2098:{n:"BrtBeginTimelineStyles"},2099:{n:"BrtEndTimelineStyles"},2100:{n:"BrtBeginTimelineStyleElements"},2101:{n:"BrtEndTimelineStyleElements"},2102:{n:"BrtDxf15"},2103:{n:"BrtBeginDxfs15"},2104:{n:"brtEndDxfs15"},2105:{n:"BrtSlicerCacheHideItemsWithNoData"},2106:{n:"BrtBeginItemUniqueNames"},2107:{n:"BrtEndItemUniqueNames"},2108:{n:"BrtItemUniqueName"},2109:{n:"BrtBeginExtConn15"},2110:{n:"BrtEndExtConn15"},2111:{n:"BrtBeginOledbPr15"},2112:{n:"BrtEndOledbPr15"},2113:{n:"BrtBeginDataFeedPr15"},2114:{n:"BrtEndDataFeedPr15"},2115:{n:"BrtTextPr15"},2116:{n:"BrtRangePr15"},2117:{n:"BrtDbCommand15"},2118:{n:"BrtBeginDbTables15"},2119:{n:"BrtEndDbTables15"},2120:{n:"BrtDbTable15"},2121:{n:"BrtBeginDataModel"},2122:{n:"BrtEndDataModel"},2123:{n:"BrtBeginModelTables"},2124:{n:"BrtEndModelTables"},2125:{n:"BrtModelTable"},2126:{n:"BrtBeginModelRelationships"},2127:{n:"BrtEndModelRelationships"},2128:{n:"BrtModelRelationship"},2129:{n:"BrtBeginECTxtWiz15"},2130:{n:"BrtEndECTxtWiz15"},2131:{n:"BrtBeginECTWFldInfoLst15"},2132:{n:"BrtEndECTWFldInfoLst15"},2133:{n:"BrtBeginECTWFldInfo15"},2134:{n:"BrtFieldListActiveItem"},2135:{n:"BrtPivotCacheIdVersion"},2136:{n:"BrtSXDI15"},2137:{n:"BrtBeginModelTimeGroupings"},2138:{n:"BrtEndModelTimeGroupings"},2139:{n:"BrtBeginModelTimeGrouping"},2140:{n:"BrtEndModelTimeGrouping"},2141:{n:"BrtModelTimeGroupingCalcCol"},3073:{n:"BrtRevisionPtr"},65535:{n:""}};var $v=X(Yv,"n");var Zv={3:{n:"BIFF2NUM",f:Fs},4:{n:"BIFF2STR",f:Ds},6:{n:"Formula",f:gu},9:{n:"BOF",f:ci},10:{n:"EOF",f:Sn},12:{n:"CalcCount",f:xn},13:{n:"CalcMode",f:xn},14:{n:"CalcPrecision",f:Bn},15:{n:"CalcRefMode",f:Bn},16:{n:"CalcDelta",f:Wt},17:{n:"CalcIter",f:Bn},18:{n:"Protect",f:Bn},19:{n:"Password",f:xn},20:{n:"Header",f:Zi},21:{n:"Footer",f:Zi},23:{n:"ExternSheet",f:rs},24:{n:"Lbl",f:es},25:{n:"WinProtect",f:Bn},26:{n:"VerticalPageBreaks"},27:{n:"HorizontalPageBreaks"},28:{n:"Note",f:fs},29:{n:"Selection"},34:{n:"Date1904",f:Bn},35:{n:"ExternName",f:Ji},38:{n:"LeftMargin",f:Wt},39:{n:"RightMargin",f:Wt},40:{n:"TopMargin",f:Wt},41:{n:"BottomMargin",f:Wt},42:{n:"PrintRowCol",f:Bn},43:{n:"PrintGrid",f:Bn},47:{n:"FilePass",f:Rl},49:{n:"Font",f:yi},51:{n:"PrintSize",f:xn},60:{n:"Continue"},61:{n:"Window1",f:Ci},64:{n:"Backup",f:Bn},65:{n:"Pane"},66:{n:"CodePage",f:xn},77:{n:"Pls"},80:{n:"DCon"},81:{n:"DConRef"},82:{n:"DConName"},85:{n:"DefColWidth",f:xn},89:{n:"XCT"},90:{n:"CRN"},91:{n:"FileSharing"},92:{n:"WriteAccess",f:di},93:{n:"Obj",f:us},94:{n:"Uncalced"},95:{n:"CalcSaveRecalc",f:Bn},96:{n:"Template"},97:{n:"Intl"},99:{n:"ObjProtect",f:Bn},125:{n:"ColInfo",f:Cs},128:{n:"Guts",f:Xi},129:{n:"WsBool",f:pi},130:{n:"GridSet",f:xn},131:{n:"HCenter",f:Bn},132:{n:"VCenter",f:Bn},133:{n:"BoundSheet8",f:mi},134:{n:"WriteProtect"},140:{n:"Country",f:Es},141:{n:"HideObj",f:xn},144:{n:"Sort"},146:{n:"Palette",f:Ss},151:{n:"Sync"},152:{n:"LPr"},153:{n:"DxGCol"},154:{n:"FnGroupName"},155:{n:"FilterMode"},156:{n:"BuiltInFnGroupCount",f:xn},157:{n:"AutoFilterInfo"},158:{n:"AutoFilter"},160:{n:"Scl",f:As},161:{n:"Setup",f:Bs},174:{n:"ScenMan"},175:{n:"SCENARIO"},176:{n:"SxView"},177:{n:"Sxvd"},178:{n:"SXVI"},180:{n:"SxIvd"},181:{n:"SXLI"},182:{n:"SXPI"},184:{n:"DocRoute"},185:{n:"RecipName"},189:{n:"MulRk",f:Ui},190:{n:"MulBlank",f:Hi},193:{n:"Mms",f:Sn},197:{n:"SXDI"},198:{n:"SXDB"},199:{n:"SXFDB"},200:{n:"SXDBB"},201:{n:"SXNum"},202:{n:"SxBool",f:Bn},203:{n:"SxErr"},204:{n:"SXInt"},205:{n:"SXString"},206:{n:"SXDtr"},207:{n:"SxNil"},208:{n:"SXTbl"},209:{n:"SXTBRGIITM"},210:{n:"SxTbpg"},211:{n:"ObProj"},213:{n:"SXStreamID"},215:{n:"DBCell"},216:{n:"SXRng"},217:{n:"SxIsxoper"},218:{n:"BookBool",f:xn},220:{n:"DbOrParamQry"},221:{n:"ScenarioProtect",f:Bn},222:{n:"OleObjectSize"},224:{n:"XF",f:Vi},225:{n:"InterfaceHdr",f:hi},226:{n:"InterfaceEnd",f:Sn},227:{n:"SXVS"},229:{n:"MergeCells",f:os},233:{n:"BkHim"},235:{n:"MsoDrawingGroup"},236:{n:"MsoDrawing"},237:{n:"MsoDrawingSelection"},239:{n:"PhoneticInfo"},240:{n:"SxRule"},241:{n:"SXEx"},242:{n:"SxFilt"},244:{n:"SxDXF"},245:{n:"SxItm"},246:{n:"SxName"},247:{n:"SxSelect"},248:{n:"SXPair"},249:{n:"SxFmla"},251:{n:"SxFormat"},252:{n:"SST",f:gi},253:{n:"LabelSst",f:Ii},255:{n:"ExtSST",f:Ei},256:{n:"SXVDEx"},259:{n:"SXFormula"},290:{n:"SXDBEx"},311:{n:"RRDInsDel"},312:{n:"RRDHead"},315:{n:"RRDChgCell"},317:{n:"RRTabId",f:An},318:{n:"RRDRenSheet"},319:{n:"RRSort"},320:{n:"RRDMove"},330:{n:"RRFormat"},331:{n:"RRAutoFmt"},333:{n:"RRInsertSh"},334:{n:"RRDMoveBegin"},335:{n:"RRDMoveEnd"},336:{n:"RRDInsDelBegin"},337:{n:"RRDInsDelEnd"},338:{n:"RRDConflict"},339:{n:"RRDDefName"},340:{n:"RRDRstEtxp"},351:{n:"LRng"},352:{n:"UsesELFs",f:Bn},353:{n:"DSF",f:Sn},401:{n:"CUsr"},402:{n:"CbUsr"},403:{n:"UsrInfo"},404:{n:"UsrExcl"},405:{n:"FileLock"},406:{n:"RRDInfo"},407:{n:"BCUsrs"},408:{n:"UsrChk"},425:{n:"UserBView"},426:{n:"UserSViewBegin"},427:{n:"UserSViewEnd"},428:{n:"RRDUserView"},429:{n:"Qsi"},430:{n:"SupBook",f:Qi},431:{n:"Prot4Rev",f:Bn},432:{n:"CondFmt"},433:{n:"CF"},434:{n:"DVal"},437:{n:"DConBin"},438:{n:"TxO",f:vs},439:{n:"RefreshAll",f:Bn},440:{n:"HLink",f:ps},441:{n:"Lel"},442:{n:"CodeName",f:Pn},443:{n:"SXFDBType"},444:{n:"Prot4RevPass",f:xn},445:{n:"ObNoMacros"},446:{n:"Dv"},448:{n:"Excel9File",f:Sn},449:{n:"RecalcId",f:Si,r:2},450:{n:"EntExU2",f:Sn},512:{n:"Dimensions",f:Ni},513:{n:"Blank",f:ys},515:{n:"Number",f:Yi},516:{n:"Label",f:Ri},517:{n:"BoolErr",f:ji},518:{n:"Formula",f:gu},519:{n:"String",f:Is},520:{n:"Row",f:ki},523:{n:"Index"},545:{n:"Array",f:is},549:{n:"DefaultRowHeight",f:_i},566:{n:"Table"},574:{n:"Window2",f:Ti},638:{n:"RK",f:Mi},659:{n:"Style"},1030:{n:"Formula",f:gu},1048:{n:"BigName"},1054:{n:"Format",f:Fi},1084:{n:"ContinueBigName"},1212:{n:"ShrFmla",f:ns},2048:{n:"HLinkTooltip",f:bs},2049:{n:"WebPub"},2050:{n:"QsiSXTag"},2051:{n:"DBQueryExt"},2052:{n:"ExtString"},2053:{n:"TxtQry"},2054:{n:"Qsir"},2055:{n:"Qsif"},2056:{n:"RRDTQSIF"},2057:{n:"BOF",f:ci},2058:{n:"OleDbConn"},2059:{n:"WOpt"},2060:{n:"SXViewEx"},2061:{n:"SXTH"},2062:{n:"SXPIEx"},2063:{n:"SXVDTEx"},2064:{n:"SXViewEx9"},2066:{n:"ContinueFrt"},2067:{n:"RealTimeData"},2128:{n:"ChartFrtInfo"},2129:{n:"FrtWrapper"},2130:{n:"StartBlock"},2131:{n:"EndBlock"},2132:{n:"StartObject"},2133:{n:"EndObject"},2134:{n:"CatLab"},2135:{n:"YMult"},2136:{n:"SXViewLink"},2137:{n:"PivotChartBits"},2138:{n:"FrtFontList"},2146:{n:"SheetExt"},2147:{n:"BookExt",r:12},2148:{n:"SXAddl"},2149:{n:"CrErr"},2150:{n:"HFPicture"},2151:{n:"FeatHdr",f:Sn},2152:{n:"Feat"},2154:{n:"DataLabExt"},2155:{n:"DataLabExtContents"},2156:{n:"CellWatch"},2161:{n:"FeatHdr11"},2162:{n:"Feature11"},2164:{n:"DropDownObjIds"},2165:{n:"ContinueFrt11"},2166:{n:"DConn"},2167:{n:"List12"},2168:{n:"Feature12"},2169:{n:"CondFmt12"},2170:{n:"CF12"},2171:{n:"CFEx"},2172:{n:"XFCRC",f:_s,r:12},2173:{n:"XFExt",f:ro,r:12},2174:{n:"AutoFilter12"},2175:{n:"ContinueFrt12"},2180:{n:"MDTInfo"},2181:{n:"MDXStr"},2182:{n:"MDXTuple"},2183:{n:"MDXSet"},2184:{n:"MDXProp"},2185:{n:"MDXKPI"},2186:{n:"MDB"},2187:{n:"PLV"},2188:{n:"Compat12",f:Bn,r:12},2189:{n:"DXF"},2190:{n:"TableStyles",r:12},2191:{n:"TableStyle"},2192:{n:"TableStyleElement"},2194:{n:"StyleExt"},2195:{n:"NamePublish"},2196:{n:"NameCmt",f:as,r:12},2197:{n:"SortData"},2198:{n:"Theme",f:$f,r:12},2199:{n:"GUIDTypeLib"},2200:{n:"FnGrp12"},2201:{n:"NameFnGrp12"},2202:{n:"MTRSettings",f:ss,r:12},2203:{n:"CompressPictures",f:Sn},2204:{n:"HeaderFooter"},2205:{n:"CrtLayout12"},2206:{n:"CrtMlFrt"},2207:{n:"CrtMlFrtContinue"},2211:{n:"ForceFullCalculation",f:wi},2212:{n:"ShapePropsStream"},2213:{n:"TextPropsStream"},2214:{n:"RichTextStream"},2215:{n:"CrtLayout12A"},4097:{n:"Units"},4098:{n:"Chart"},4099:{n:"Series"},4102:{n:"DataFormat"},4103:{n:"LineFormat"},4105:{n:"MarkerFormat"},4106:{n:"AreaFormat"},4107:{n:"PieFormat"},4108:{n:"AttachedLabel"},4109:{n:"SeriesText"},4116:{n:"ChartFormat"},4117:{n:"Legend"},4118:{n:"SeriesList"},4119:{n:"Bar"},4120:{n:"Line"},4121:{n:"Pie"},4122:{n:"Area"},4123:{n:"Scatter"},4124:{n:"CrtLine"},4125:{n:"Axis"},4126:{n:"Tick"},4127:{n:"ValueRange"},4128:{n:"CatSerRange"},4129:{n:"AxisLine"},4130:{n:"CrtLink"},4132:{n:"DefaultText"},4133:{n:"Text"},4134:{n:"FontX",f:xn},4135:{n:"ObjectLink"},4146:{n:"Frame"},4147:{n:"Begin"},4148:{n:"End"},4149:{n:"PlotArea"},4154:{n:"Chart3d"},4156:{n:"PicF"},4157:{n:"DropBar"},4158:{n:"Radar"},4159:{n:"Surf"},4160:{n:"RadarArea"},4161:{n:"AxisParent"},4163:{n:"LegendException"},4164:{n:"ShtProps",f:Ts},4165:{n:"SerToCrt"},4166:{n:"AxesUsed"},4168:{n:"SBaseRef"},4170:{n:"SerParent"},4171:{n:"SerAuxTrend"},4174:{n:"IFmtRecord"},4175:{n:"Pos"},4176:{n:"AlRuns"},4177:{n:"BRAI"},4187:{n:"SerAuxErrBar"},4188:{n:"ClrtClient",f:ws},4189:{n:"SerFmt"},4191:{n:"Chart3DBarShape"},4192:{n:"Fbi"},4193:{n:"BopPop"},4194:{n:"AxcExt"},4195:{n:"Dat"},4196:{n:"PlotGrowth"},4197:{n:"SIIndex"},4198:{n:"GelFrame"},4199:{n:"BopPopCustom"},4200:{n:"Fbi2"},0:{n:"Dimensions",f:Ni},2:{n:"BIFF2INT",f:Ps},5:{n:"BoolErr",f:ji},7:{n:"String",f:Ls},8:{n:"BIFF2ROW"},11:{n:"Index"},22:{n:"ExternCount",f:xn},30:{n:"BIFF2FORMAT",f:Pi},31:{n:"BIFF2FMTCNT"},32:{n:"BIFF2COLINFO"},33:{n:"Array",f:is},37:{n:"DefaultRowHeight",f:_i},50:{n:"BIFF2FONTXTRA",f:Ms},52:{n:"DDEObjName"},62:{n:"BIFF2WINDOW2"},67:{n:"BIFF2XF"},69:{n:"BIFF2FONTCLR"},86:{n:"BIFF4FMTCNT"},126:{n:"RK"},127:{n:"ImData",f:Rs},135:{n:"Addin"},136:{n:"Edg"},137:{n:"Pub"},145:{n:"Sub"},148:{n:"LHRecord"},149:{n:"LHNGraph"},150:{n:"Sound"},169:{n:"CoordList"},171:{n:"GCW"},188:{n:"ShrFmla"},191:{n:"ToolbarHdr"},192:{n:"ToolbarEnd"},194:{n:"AddMenu"},195:{n:"DelMenu"},214:{n:"RString",f:Us},223:{n:"UDDesc"},234:{n:"TabIdConf"},354:{n:"XL5Modify"},421:{n:"FileSharing2"},521:{n:"BOF",f:ci},536:{n:"Lbl",f:es},547:{n:"ExternName",f:Ji},561:{n:"Font"},579:{n:"BIFF3XF"},1033:{n:"BOF",f:ci},1091:{n:"BIFF4XF"},2157:{n:"FeatInfo"},2163:{n:"FeatInfo11"},2177:{n:"SXAddl12"},2240:{n:"AutoWebPub"},2241:{n:"ListObj"},2242:{n:"ListField"},2243:{n:"ListDV"},2244:{n:"ListCondFmt"},2245:{n:"ListCF"},2246:{n:"FMQry"},2247:{n:"FMSQry"},2248:{n:"PLV"},2249:{n:"LnExt"},2250:{n:"MkrExt"},2251:{n:"CrtCoopt"},2262:{n:"FRTArchId$",r:12},29282:{}};var Qv=X(Zv,"n");function Jv(e,r,t,a){var n=+r||+Qv[r];if(isNaN(n))return;var i=a||(t||[]).length||0;var s=e.next(4);s._W(2,n);s._W(2,i);if(i>0&&xr(t))e.push(t)}function qv(e,r,t){if(!e)e=Vr(7);e._W(2,r);e._W(2,t);e._W(2,0);e._W(1,0);return e}function ep(e,r,t,a){var n=Vr(9);qv(n,e,r);if(a=="e"){n._W(1,t);n._W(1,1)}else{n._W(1,t?1:0);n._W(1,0)}return n}function rp(e,r,t){var a=Vr(8+2*t.length);qv(a,e,r);a._W(1,t.length);a._W(t.length,t,"sbcs");return a.l=0&&n<65536)Jv(e,2,Ns(t,a,n));else Jv(e,3,Os(t,a,n));return;case"b":;case"e":Jv(e,5,ep(t,a,r.v,r.t));return;case"s":;case"str":Jv(e,4,rp(t,a,r.v));return;}Jv(e,1,qv(null,t,a))}function ap(e,r,t,a){var n=Array.isArray(r);var i=ut(r["!ref"]||"A1"),s,l="",f=[];for(var o=i.s.r;o<=i.e.r;++o){l=qr(o);for(var c=i.s.c;c<=i.e.c;++c){if(o===i.s.r)f[c]=at(c);s=f[c]+l;var u=n?(r[o]||[])[c]:r[s];if(!u)continue;tp(e,u,o,c,a)}}}function np(e,r){var t=r||{};if(m!=null&&t.dense==null)t.dense=m;var a=Xr();var n=0;for(var i=0;i");var i=e.match(/<\/table/i);var s=n.index,l=i&&i.index||e.length;var f=oe(e.slice(s,l),/(:?]*>)/i,"");var o=-1,c=0,u=0,h=0;var d={s:{r:1e7,c:1e7},e:{r:0,c:0}};var v=[];for(s=0;s/i);for(l=0;l"))>-1)k=k.slice(w+1);var S=Be(E.slice(0,E.indexOf(">")));h=S.colspan?+S.colspan:1;if((u=+S.rowspan)>0||h>1)v.push({s:{r:o,c:c},e:{r:o+(u||1)-1,c:c+h-1}});var _=S.t||"";if(!k.length){c+=h;continue}k=je(Ae(k));if(d.s.r>o)d.s.r=o;if(d.e.rc)d.s.c=c;if(d.e.c':"")+"";for(var l=r.s.c;l<=r.e.c;++l){var f=0,o=0;for(var c=0;ct||n[c].s.c>l)continue;if(n[c].e.r1)v.rowspan=f;if(o>1)v.colspan=o;v.t=h.t;if(a.editable)d=''+d+"";v.id="sjs-"+u;i.push(er("td",d,v))}var p="";return p+i.join("")+""}function a(e,r,t){var a=[];return a.join("")+""}var n='SheetJS Table Export';var i="";function s(e,r){var s=r||{};var l=s.header!=null?s.header:n;var f=s.footer!=null?s.footer:i;var o=[l];var c=ot(e["!ref"]);s.dense=Array.isArray(e);o.push(a(e,c,s));for(var u=c.s.r;u<=c.e.r;++u)o.push(t(e,c,u,s));o.push(""+f);return o.join("")}return{to_workbook:r,to_sheet:e,_row:t,BEGIN:n,END:i,_preamble:a,from_sheet:s}}();function mp(e,r){var t=r||{};if(m!=null)t.dense=m;var a=t.dense?[]:{};var n=e.getElementsByTagName("tr");var i={s:{r:0,c:0},e:{r:n.length-1,c:0}};var s=[],l=0;var f=0,o=0,c=0,u=0,h=0;for(;f0||h>1)s.push({s:{r:f,c:c},e:{r:f+(u||1)-1,c:c+h-1}});var E={t:"s",v:b};var k=p.getAttribute("t")||"";if(b!=null){if(b.length==0)E.t=k||"z";else if(t.raw||b.trim().length==0||k=="s"){}else if(b==="TRUE")E={t:"b",v:true};else if(b==="FALSE")E={t:"b",v:false};else if(!isNaN(se(b)))E={t:"n",v:se(b)};else if(!isNaN(le(b).getDate())){E={t:"d",v:te(b)};if(!t.cellDates)E={t:"n",v:Q(E.v)};E.z=t.dateNF||A._table[14]}}if(t.dense){if(!a[f])a[f]=[];a[f][c]=E}else a[ft({c:c,r:f})]=E;if(i.e.c/g," ").replace(//g,function(e,r){return Array(parseInt(r,10)+1).join(" ")}).replace(/]*\/>/g,"\t").replace(//g,"\n").replace(/<[^>]*>/g,""))};var r={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};return function t(a,n){var i=n||{};if(m!=null&&i.dense==null)i.dense=m;var s=_v(a);var l=[],f;var o;var c={name:""},u="",h=0;var d;var v;var p={},b=[];var g=i.dense?[]:{};var E,k;var w={value:""};var S="",_=0,C;var B=-1,T=-1,x={s:{r:1e6,c:1e7},e:{r:0,c:0}};var y=0;var A={};var I=[],R={},D=0,F=0;var O=[],P=1,N=1;var L=[];var M={Names:[]};var U={};var H=["",""];var W=[],V={};var z="",X=0;var G=false,j=false;var K=0;Cv.lastIndex=0;s=s.replace(//gm,"").replace(//gm,"");while(E=Cv.exec(s))switch(E[3]=E[3].replace(/_.*$/,"")){case"table":;case"工作表":if(E[1]==="/"){if(x.e.c>=x.s.c&&x.e.r>=x.s.r)g["!ref"]=ct(x);if(I.length)g["!merges"]=I;if(O.length)g["!rows"]=O;d.name=He(d["名称"]||d.name);if(typeof JSON!=="undefined")JSON.stringify(d);b.push(d.name);p[d.name]=g;j=false}else if(E[0].charAt(E[0].length-2)!=="/"){d=Be(E[0],false);B=T=-1;x.s.r=x.s.c=1e7;x.e.r=x.e.c=0;g=i.dense?[]:{};I=[];O=[];j=true}break;case"table-row-group":if(E[1]==="/")--y;else++y;break;case"table-row":;case"行":if(E[1]==="/"){B+=P;P=1;break}v=Be(E[0],false);if(v["行号"])B=v["行号"]-1;else if(B==-1)B=0;P=+v["number-rows-repeated"]||1;if(P<10)for(K=0;K0)O[B+K]={level:y};T=-1;break;case"covered-table-cell":++T;if(i.sheetStubs){if(i.dense){if(!g[B])g[B]=[];g[B][T]={t:"z"}}else g[ft({r:B,c:T})]={t:"z"}}break;case"table-cell":;case"数据":if(E[0].charAt(E[0].length-2)==="/"){++T;w=Be(E[0],false);N=parseInt(w["number-columns-repeated"]||"1",10);k={t:"z",v:null};if(w.formula&&i.cellFormula!=false)k.f=yu(Ae(w.formula));if((w["数据类型"]||w["value-type"])=="string"){k.t="s";k.v=Ae(w["string-value"]||"");if(i.dense){if(!g[B])g[B]=[];g[B][T]=k}else{g[ft({r:B,c:T})]=k}}T+=N-1}else if(E[1]!=="/"){++T;N=1;var Y=P?B+P-1:B;if(T>x.e.c)x.e.c=T;if(Tx.e.r)x.e.r=Y;w=Be(E[0],false);W=[];V={};k={t:w["数据类型"]||w["value-type"],v:null};if(i.cellFormula){if(w.formula)w.formula=Ae(w.formula);if(w["number-matrix-columns-spanned"]&&w["number-matrix-rows-spanned"]){D=parseInt(w["number-matrix-rows-spanned"],10)||0;F=parseInt(w["number-matrix-columns-spanned"],10)||0;R={s:{r:B,c:T},e:{r:B+D-1,c:T+F-1}};k.F=ct(R);L.push([R,k.F])}if(w.formula)k.f=yu(w.formula);else for(K=0;K=L[K][0].s.r&&B<=L[K][0].e.r)if(T>=L[K][0].s.c&&T<=L[K][0].e.c)k.F=L[K][1]}if(w["number-columns-spanned"]||w["number-rows-spanned"]){D=parseInt(w["number-rows-spanned"],10)||0;F=parseInt(w["number-columns-spanned"],10)||0;R={s:{r:B,c:T},e:{r:B+D-1,c:T+F-1}};I.push(R)}if(w["number-columns-repeated"])N=parseInt(w["number-columns-repeated"],10);switch(k.t){case"boolean":k.t="b";k.v=Ue(w["boolean-value"]);break;case"float":k.t="n";k.v=parseFloat(w.value);break;case"percentage":k.t="n";k.v=parseFloat(w.value);break;case"currency":k.t="n";k.v=parseFloat(w.value);break;case"date":k.t="d";k.v=te(w["date-value"]);if(!i.cellDates){k.t="n";k.v=Q(k.v)}k.z="m/d/yy";break;case"time":k.t="n";k.v=q(w["time-value"])/86400;break;case"number":k.t="n";k.v=parseFloat(w["数据数值"]);break;default:if(k.t==="string"||k.t==="text"||!k.t){k.t="s";if(w["string-value"]!=null)S=Ae(w["string-value"])}else throw new Error("Unsupported value type "+k.t);}}else{G=false;if(k.t==="s"){k.v=S||"";G=_==0}if(U.Target)k.l=U;if(W.length>0){k.c=W;W=[]}if(S&&i.cellText!==false)k.w=S;if(!G||i.sheetStubs){if(!(i.sheetRows&&i.sheetRows0)g[B+$][T+N]=ne(k)}else{g[ft({r:B+$,c:T})]=k;while(--N>0)g[ft({r:B+$,c:T+N})]=ne(k)}if(x.e.c<=T)x.e.c=T}}}N=parseInt(w["number-columns-repeated"]||"1",10);T+=N-1;N=0;k={};S=""}U={};break;case"document":;case"document-content":;case"电子表格文档":;case"spreadsheet":;case"主体":;case"scripts":;case"styles":;case"font-face-decls":if(E[1]==="/"){if((f=l.pop())[0]!==E[3])throw"Bad state: "+f}else if(E[0].charAt(E[0].length-2)!=="/")l.push([E[3],true]);break;case"annotation":if(E[1]==="/"){if((f=l.pop())[0]!==E[3])throw"Bad state: "+f;V.t=S;V.a=z;W.push(V)}else if(E[0].charAt(E[0].length-2)!=="/"){l.push([E[3],false])}z="";X=0;S="";_=0;break;case"creator":if(E[1]==="/"){z=s.slice(X,E.index)}else X=E.index+E[0].length;break;case"meta":;case"元数据":;case"settings":;case"config-item-set":;case"config-item-map-indexed":;case"config-item-map-entry":;case"config-item-map-named":;case"shapes":;case"frame":;case"text-box":;case"image":;case"data-pilot-tables":;case"list-style":;case"form":;case"dde-links":;case"event-listeners":;case"chart":if(E[1]==="/"){if((f=l.pop())[0]!==E[3])throw"Bad state: "+f}else if(E[0].charAt(E[0].length-2)!=="/")l.push([E[3],false]);S="";_=0;break;case"scientific-number":break;case"currency-symbol":break;case"currency-style":break;case"number-style":;case"percentage-style":;case"date-style":;case"time-style":if(E[1]==="/"){A[c.name]=u;if((f=l.pop())[0]!==E[3])throw"Bad state: "+f}else if(E[0].charAt(E[0].length-2)!=="/"){u="";c=Be(E[0],false);l.push([E[3],true])}break;case"script":break;case"libraries":break;case"automatic-styles":break;case"master-styles":break;case"default-style":;case"page-layout":break;case"style":break;case"map":break;case"font-face":break;case"paragraph-properties":break;case"table-properties":break;case"table-column-properties":break;case"table-row-properties":break;case"table-cell-properties":break;case"number":switch(l[l.length-1][0]){case"time-style":;case"date-style":o=Be(E[0],false);u+=r[E[3]][o.style==="long"?1:0];break;}break;case"fraction":break;case"day":;case"month":;case"year":;case"era":;case"day-of-week":;case"week-of-year":;case"quarter":;case"hours":;case"minutes":;case"seconds":;case"am-pm":switch(l[l.length-1][0]){case"time-style":;case"date-style":o=Be(E[0],false);u+=r[E[3]][o.style==="long"?1:0];break;}break;case"boolean-style":break;case"boolean":break;case"text-style":break;case"text":if(E[0].slice(-2)==="/>")break;else if(E[1]==="/")switch(l[l.length-1][0]){case"number-style":;case"date-style":;case"time-style":u+=s.slice(h,E.index);break;}else h=E.index+E[0].length;break;case"named-range":o=Be(E[0],false);H=Iu(o["cell-range-address"]);var Z={Name:o.name,Ref:H[0]+"!"+H[1]};if(j)Z.Sheet=b.length;M.Names.push(Z);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":;case"电子表格":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":;case"文本串":if(E[1]==="/"&&(!w||!w["string-value"]))S=(S.length>0?S+"\n":"")+e(s.slice(_,E.index),C);else{C=Be(E[0],false);_=E.index+E[0].length}break;case"s":break;case"database-range":if(E[1]==="/")break;try{H=Iu(Be(E[0])["target-range-address"]);p[H[0]]["!autofilter"]={ref:H[1]}}catch(J){}break;case"date":break;case"object":break;case"title":;case"标题":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":;case"sender-lastname":;case"sender-initials":;case"sender-title":;case"sender-position":;case"sender-email":;case"sender-phone-private":;case"sender-fax":;case"sender-company":;case"sender-phone-work":;case"sender-street":;case"sender-city":;case"sender-postal-code":;case"sender-country":;case"sender-state-or-province":;case"author-name":;case"author-initials":;case"chapter":;case"file-name":;case"template-name":;case"sheet-name":break;case"event-listener":break;case"initial-creator":;case"creation-date":;case"print-date":;case"generator":;case"document-statistic":;case"user-defined":;case"editing-duration":;case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":;case"source-cell-range":;case"source-service":;case"data-pilot-field":;case"data-pilot-level":;case"data-pilot-subtotals":;case"data-pilot-subtotal":;case"data-pilot-members":;case"data-pilot-member":;case"data-pilot-display-info":;case"data-pilot-sort-info":;case"data-pilot-layout-info":;case"data-pilot-field-reference":;case"data-pilot-groups":;case"data-pilot-group":;case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":;case"dde-connection-decl":;case"dde-link":;case"dde-source":break;case"properties":break;case"property":break;case"a":if(E[1]!=="/"){U=Be(E[0],false);if(!U.href)break;U.Target=U.href;delete U.href;if(U.Target.charAt(0)=="#"&&U.Target.indexOf(".")>-1){H=Iu(U.Target.slice(1));U.Target="#"+H[0]+"!"+H[1]}}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":break;default:switch(E[2]){case"dc:":;case"calcext:":;case"loext:":;case"ooo:":;case"chartooo:":;case"draw:":;case"style:":;case"chart:":;case"form:":;case"uof:":;case"表:":;case"字:":break;default:if(i.WTF)throw new Error(E);};}var ee={Sheets:p,SheetNames:b,Workbook:M};if(i.bookSheets)delete ee.Sheets;return ee}}();function Ep(e,r){r=r||{};var t=!!de(e,"objectdata");if(t)Fa(pe(e,"META-INF/manifest.xml"),r);var a=me(e,"content.xml");if(!a)throw new Error("Missing content.xml in "+(t?"ODS":"UOF")+" file");var n=gp(t?a:He(a),r);if(de(e,"meta.xml"))n.Props=Wa(pe(e,"meta.xml"));return n}function kp(e,r){return gp(e,r)}var wp=function(){var e="";return function r(){return ke+e}}();var Sp=function(){var e=function(e){return De(e).replace(/ +/g,function(e){return''}).replace(/\t/g,"").replace(/\n/g,"").replace(/^ /,"").replace(/ $/,"")};var r=" \n";var t=" \n";var a=function(a,n,i){var s=[];s.push(' \n');var l=0,f=0,o=ot(a["!ref"]);var c=a["!merges"]||[],u=0;var h=Array.isArray(a);for(l=0;l\n");for(;l<=o.e.r;++l){s.push(" \n");for(f=0;ff)continue;if(c[u].s.r>l)continue;if(c[u].e.c\n")}s.push(" \n");return s.join("")};var n=function(e){e.push(" \n");e.push(' \n');e.push(' \n');e.push(" /\n");e.push(' \n');e.push(" /\n");e.push(" \n");e.push(" \n");e.push(' \n');e.push(" \n")};return function i(e,r){var t=[ke];var i=qe({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"});var s=qe({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});if(r.bookType=="fods")t.push("\n");else t.push("\n");n(t);t.push(" \n");t.push(" \n");for(var l=0;l!=e.SheetNames.length;++l)t.push(a(e.Sheets[e.SheetNames[l]],e,l,r));t.push(" \n");t.push(" \n");if(r.bookType=="fods")t.push("");else t.push("");return t.join("")}}();function _p(e,r){if(r.bookType=="fods")return Sp(e,r);var t=new ge;var a="";var n=[];var i=[];a="mimetype";t.file(a,"application/vnd.oasis.opendocument.spreadsheet");a="content.xml";t.file(a,Sp(e,r));n.push([a,"text/xml"]);i.push([a,"ContentFile"]);a="styles.xml";t.file(a,wp(e,r));n.push([a,"text/xml"]);i.push([a,"StylesFile"]);a="meta.xml";t.file(a,Ma());n.push([a,"text/xml"]);i.push([a,"MetadataFile"]);a="manifest.rdf";t.file(a,La(i));n.push([a,"application/rdf+xml"]);a="META-INF/manifest.xml";t.file(a,Oa(n));return t}function Cp(e,r){if(!r)return 0;var t=e.SheetNames.indexOf(r);if(t==-1)throw new Error("Sheet not found: "+r);return t}function Bp(e){return function r(t,a){var n=Cp(t,a.sheet);return e.from_sheet(t.Sheets[t.SheetNames[n]],a,t)}}var Tp=Bp(pp);var xp=Bp({from_sheet:dm});var yp=Bp(Ws);var Ap=Bp(Vs);var Ip=Bp(Xs);var Rp=Bp(Dl);var Dp=Bp({from_sheet:vm});var Fp=Bp(Hs);var Op=Bp(zs);function Pp(e){return function r(t){for(var a=0;a!=e.length;++a){var n=e[a];if(t[n[0]]===undefined)t[n[0]]=n[1];if(n[2]==="n")t[n[0]]=Number(t[n[0]])}}}var Np=Pp([["cellNF",false],["cellHTML",true],["cellFormula",true],["cellStyles",false],["cellText",true],["cellDates",false],["sheetStubs",false],["sheetRows",0,"n"],["bookDeps",false],["bookSheets",false],["bookProps",false],["bookFiles",false],["bookVBA",false],["password",""],["WTF",false]]);var Lp=Pp([["cellDates",false],["bookSST",false],["bookType","xlsx"],["compression",false],["WTF",false]]);function Mp(e){if(Ta.WS.indexOf(e)>-1)return"sheet";if(Ta.CS&&e==Ta.CS)return"chart";if(Ta.DS&&e==Ta.DS)return"dialog";if(Ta.MS&&e==Ta.MS)return"macro";return e&&e.length?e:"sheet"}function Up(e,r){if(!e)return 0;try{e=r.map(function a(r){if(!r.id)r.id=r.strRelID;return[r.name,e["!id"][r.id].Target,Mp(e["!id"][r.id].Type)]})}catch(t){return null}return!e||e.length===0?null:e}function Hp(e,r,t,a,n,i,s,l,f,o,c,u){try{i[a]=ya(me(e,t,true),r);var h=pe(e,r);switch(l){case"sheet":s[a]=Zd(h,r,n,f,i[a],o,c,u);break;case"chart":var d=Qd(h,r,n,f,i[a],o,c,u);s[a]=d;if(!d||!d["!chart"])break;var v=Ee(d["!chart"].Target,r);var p=xa(v);var m=fo(me(e,v,true),ya(me(e,p,true),v));var b=Ee(m,v);var g=xa(b);d=vd(me(e,b,true),b,f,ya(me(e,g,true),b),o,d);break;case"macro":s[a]=Jd(h,r,n,f,i[a],o,c,u);break;case"dialog":s[a]=qd(h,r,n,f,i[a],o,c,u);break;}}catch(E){if(f.WTF)throw E}}function Wp(e){return e.charAt(0)=="/"?e.slice(1):e}function Vp(e,r){I(A);r=r||{};Np(r);if(de(e,"META-INF/manifest.xml"))return Ep(e,r);if(de(e,"objectdata.xml"))return Ep(e,r);if(de(e,"Index/Document.iwa"))throw new Error("Unsupported NUMBERS file");var t=be(e);var a=Sa(me(e,"[Content_Types].xml"));var n=false;var i,s;if(a.workbooks.length===0){s="xl/workbook.xml";if(pe(e,s,true))a.workbooks.push(s)}if(a.workbooks.length===0){s="xl/workbook.bin";if(!pe(e,s,true))throw new Error("Could not find workbook");a.workbooks.push(s);n=true}if(a.workbooks[0].slice(-3)=="bin")n=true;var l={};var f={};if(!r.bookSheets&&!r.bookProps){Du=[];if(a.sst)Du=tv(pe(e,Wp(a.sst)),a.sst,r);if(r.cellStyles&&a.themes.length)l=rv(me(e,a.themes[0].replace(/^\//,""),true)||"",a.themes[0],r);if(a.style)f=ev(pe(e,Wp(a.style)),a.style,l,r)}a.links.map(function(t){return iv(pe(e,Wp(t)),t,r)});var o=$d(pe(e,Wp(a.workbooks[0])),a.workbooks[0],r);var c={},u="";if(a.coreprops.length){u=pe(e,Wp(a.coreprops[0]),true);if(u)c=Wa(u);if(a.extprops.length!==0){u=pe(e,Wp(a.extprops[0]),true);if(u)ja(u,c,r)}}var h={};if(!r.bookSheets||r.bookProps){if(a.custprops.length!==0){u=me(e,Wp(a.custprops[0]),true);if(u)h=Za(u,r)}}var d={};if(r.bookSheets||r.bookProps){if(o.Sheets)i=o.Sheets.map(function T(e){return e.name});else if(c.Worksheets&&c.SheetNames.length>0)i=c.SheetNames;if(r.bookProps){d.Props=c;d.Custprops=h}if(r.bookSheets&&typeof i!=="undefined")d.SheetNames=i;if(r.bookSheets?d.SheetNames:r.bookProps)return d}i={};var v={};if(r.bookDeps&&a.calcchain)v=nv(pe(e,Wp(a.calcchain)),a.calcchain,r);var p=0;var m={};var b,g;{var E=o.Sheets;c.Worksheets=E.length;c.SheetNames=[];for(var k=0;k!=E.length;++k){c.SheetNames[k]=E[k].name}}var w=n?"bin":"xml";var S="xl/_rels/workbook."+w+".rels";var _=ya(me(e,S,true),S);if(_)_=Up(_,o.Sheets);var C=pe(e,"xl/worksheets/sheet.xml",true)?1:0;for(p=0;p!=c.Worksheets;++p){var B="sheet";if(_&&_[p]){b="xl/"+_[p][1].replace(/[\/]?xl\//,"");B=_[p][2]}else{b="xl/worksheets/sheet"+(p+1-C)+"."+w;b=b.replace(/sheet0\./,"sheet.")}g=b.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels");Hp(e,b,g,c.SheetNames[p],p,m,i,B,r,o,l,f)}if(a.comments)uo(e,a.comments,i,m,r);d={Directory:a,Workbook:o,Props:c,Custprops:h,Deps:v,Sheets:i,SheetNames:c.SheetNames,Strings:Du,Styles:f,Themes:l,SSF:A.get_table()};if(r.bookFiles){d.keys=t;d.files=e.files}if(r.bookVBA){if(a.vba.length>0)d.vbaraw=pe(e,Wp(a.vba[0]),true);else if(a.defaults&&a.defaults.bin===_o)d.vbaraw=pe(e,"xl/vbaProject.bin",true)}return d}function zp(e,r){var t=r||{};var a="/!DataSpaces/Version";var n=L.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);ul(n.content);a="/!DataSpaces/DataSpaceMap";n=L.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var i=dl(n.content);if(i.length!==1||i[0].comps.length!==1||i[0].comps[0].t!==0||i[0].name!=="StrongEncryptionDataSpace"||i[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+a);a="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace";n=L.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var s=vl(n.content);if(s.length!=1||s[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+a);a="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary";n=L.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);ml(n.content);a="/EncryptionInfo";n=L.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var l=El(n.content);a="/EncryptedPackage";n=L.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);if(l[0]==4&&typeof decrypt_agile!=="undefined")return decrypt_agile(l[1],n.content,t.password||"",t);if(l[0]==2&&typeof decrypt_std76!=="undefined")return decrypt_std76(l[1],n.content,t.password||"",t);throw new Error("File is password-protected")}function Xp(e,r){oo=1024;if(r.bookType=="ods")return _p(e,r);if(e&&!e.SSF){e.SSF=A.get_table()}if(e&&e.SSF){I(A);A.load_table(e.SSF);r.revssf=j(e.SSF);r.revssf[e.SSF[65535]]=0;r.ssf=e.SSF}r.rels={};r.wbrels={};r.Strings=[];r.Strings.Count=0;r.Strings.Unique=0;var t=r.bookType=="xlsb"?"bin":"xml";var a=To.indexOf(r.bookType)>-1;var n=wa();Lp(r=r||{});var i=new ge;var s="",l=0;r.cellXfs=[];Lu(r.cellXfs,{},{revssf:{General:0}});if(!e.Props)e.Props={};s="docProps/core.xml";i.file(s,Xa(e.Props,r));n.coreprops.push(s);Ra(r.rels,2,s,Ta.CORE_PROPS);s="docProps/app.xml";if(e.Props&&e.Props.SheetNames){}else if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{var f=[];for(var o=0;o0){s="docProps/custom.xml";i.file(s,Ja(e.Custprops,r));n.custprops.push(s);Ra(r.rels,4,s,Ta.CUST_PROPS)}s="xl/workbook."+t;i.file(s,sv(e,s,r));n.workbooks.push(s);Ra(r.rels,1,s,Ta.WB);for(l=1;l<=e.SheetNames.length;++l){var c={"!id":{}};var u=e.Sheets[e.SheetNames[l-1]];var h=(u||{})["!type"]||"sheet";switch(h){case"chart":;default:s="xl/worksheets/sheet"+l+"."+t;i.file(s,lv(l-1,s,r,e,c));n.sheets.push(s);Ra(r.wbrels,-1,"worksheets/sheet"+l+"."+t,Ta.WS[0]);}if(u){var d=u["!comments"];if(d&&d.length>0){var v="xl/comments"+l+"."+t;i.file(v,uv(d,v,r));n.comments.push(v);Ra(c,-1,"../comments"+l+"."+t,Ta.CMNT)}if(u["!legacy"]){i.file("xl/drawings/vmlDrawing"+l+".vml",co(l,u["!comments"])); -}delete u["!comments"];delete u["!legacy"]}if(c["!id"].rId1)i.file(xa(s),Ia(c))}if(r.Strings!=null&&r.Strings.length>0){s="xl/sharedStrings."+t;i.file(s,cv(r.Strings,s,r));n.strs.push(s);Ra(r.wbrels,-1,"sharedStrings."+t,Ta.SST)}s="xl/theme/theme1.xml";i.file(s,Yf(e.Themes,r));n.themes.push(s);Ra(r.wbrels,-1,"theme/theme1.xml",Ta.THEME);s="xl/styles."+t;i.file(s,ov(e,s,r));n.styles.push(s);Ra(r.wbrels,-1,"styles."+t,Ta.STY);if(e.vbaraw&&a){s="xl/vbaProject.bin";i.file(s,e.vbaraw);n.vba.push(s);Ra(r.wbrels,-1,"vbaProject.bin",Ta.VBA)}i.file("[Content_Types].xml",Ba(n,r));i.file("_rels/.rels",Ia(r.rels));i.file("xl/_rels/workbook."+t+".rels",Ia(r.wbrels));delete r.revssf;delete r.ssf;return i}function Gp(e,r){var t="";switch((r||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3]];case"base64":t=g.decode(e.slice(0,24));break;case"binary":t=e;break;case"array":return[e[0],e[1],e[2],e[3]];default:throw new Error("Unrecognized type "+(r&&r.type||"undefined"));}return[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]}function jp(e,r){if(L.find(e,"EncryptedPackage"))return zp(e,r);return jv(e,r)}function Kp(e,r){var t,a=e;var n=r||{};if(!n.type)n.type=E&&Buffer.isBuffer(e)?"buffer":"base64";switch(n.type){case"base64":t=new ge(a,{base64:true});break;case"binary":;case"array":t=new ge(a,{base64:false});break;case"buffer":t=new ge(a);break;default:throw new Error("Unrecognized type "+n.type);}return Vp(t,n)}function Yp(e,r){var t=0;e:while(t=2&&a[3]===0)return js.to_workbook(t,i);break;case 3:;case 131:;case 139:;case 140:return Hs.to_workbook(t,i);case 123:if(a[1]===92&&a[2]===114&&a[3]===116)return Dl.to_workbook(t,i);break;case 10:;case 13:;case 32:return $p(t,i);}if(a[2]<=12&&a[3]<=31)return Hs.to_workbook(t,i);return Jp(e,t,i,n)}function em(e,r){var t=r||{};t.type="file";return qp(e,t)}function rm(e,r){var t=r||{};var a=Xp(e,t);var n={};if(t.compression)n.compression="DEFLATE";switch(t.type){case"base64":n.type="base64";break;case"binary":n.type="string";break;case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");case"buffer":;case"file":n.type=E?"nodebuffer":"string";break;default:throw new Error("Unrecognized type "+t.type);}if(t.type==="file")return W(t.file,a.generate(n));var i=a.generate(n);return t.type=="string"?He(i):i}function tm(e,r){var t=r||{};var a=Kv(e,t);switch(t.type){case"base64":;case"binary":break;case"buffer":;case"array":t.type="";break;case"file":return W(t.file,L.write(a,{type:E?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");default:throw new Error("Unrecognized type "+t.type);}return L.write(a,t)}function am(e,r,t){if(!t)t="";var a=t+e;switch(r.type){case"base64":return g.encode(We(a));case"binary":return We(a);case"string":return e;case"file":return W(r.file,a,"utf8");case"buffer":{if(E)return new Buffer(a,"utf8");else return am(a,{type:"binary"}).split("").map(function(e){return e.charCodeAt(0)})};}throw new Error("Unrecognized type "+r.type)}function nm(e,r){switch(r.type){case"base64":return g.encode(e);case"binary":return e;case"string":return e;case"file":return W(r.file,e,"binary");case"buffer":{if(E)return new Buffer(e,"binary");else return e.split("").map(function(e){return e.charCodeAt(0)})};}throw new Error("Unrecognized type "+r.type)}function im(e,r){switch(r.type){case"string":;case"base64":;case"binary":var t="";for(var a=0;a0)n=0;var v=qr(o.s.r);var p=[];var m=[];var b=0,g=0;var E=Array.isArray(e);var k=o.s.r,w=0,S=0;if(E&&!e[k])e[k]=[];for(w=o.s.c;w<=o.e.c;++w){p[w]=at(w);t=E?e[k][w]:e[p[w]+v];switch(a){case 1:i[w]=w-o.s.c;break;case 2:i[w]=p[w];break;case 3:i[w]=c.header[w-o.s.c];break;default:if(t==null)t={w:"__EMPTY",t:"s"};f=l=dt(t,null,c);g=0;for(S=0;S=0)c='"'+c.replace(um,'""')+'"'}else c="";o.push(c)}if(l.blankrows===false&&f)return null;return o.join(s)}function dm(e,r){var t=[];var a=r==null?{}:r;if(e==null||e["!ref"]==null)return"";var n=ut(e["!ref"]);var i=a.FS!==undefined?a.FS:",",s=i.charCodeAt(0);var l=a.RS!==undefined?a.RS:"\n",f=l.charCodeAt(0);var o=new RegExp((i=="|"?"\\|":i)+"+$");var c="",u=[];a.dense=Array.isArray(e);var h=a.skipHidden&&e["!cols"]||[];var d=a.skipHidden&&e["!rows"]||[];for(var v=n.s.c;v<=n.e.c;++v)if(!(h[v]||{}).hidden)u[v]=at(v);for(var p=n.s.r;p<=n.e.r;++p){if((d[p]||{}).hidden)continue;c=hm(e,n,p,u,s,f,i,a);if(c==null){continue}if(a.strip)c=c.replace(o,"");t.push(c+l)}delete a.dense;return t.join("")}function vm(e,r){if(!r)r={};r.FS="\t";r.RS="\n";var t=dm(e,r);if(typeof cptable=="undefined"||r.type=="string")return t;var a=cptable.utils.encode(1200,t,"str");return String.fromCharCode(255)+String.fromCharCode(254)+a}function pm(e){var r="",t,a="";if(e==null||e["!ref"]==null)return[];var n=ut(e["!ref"]),i="",s=[],l;var f=[];var o=Array.isArray(e);for(l=n.s.c;l<=n.e.c;++l)s[l]=at(l);for(var c=n.s.r;c<=n.e.r;++c){i=qr(c);for(l=n.s.c;l<=n.e.c;++l){r=s[l]+i;t=o?(e[c]||[])[l]:e[r];a="";if(t===undefined)continue;else if(t.F!=null){r=t.F;if(!t.f)continue;a=t.f;if(r.indexOf(":")==-1)r=r+":"+r}if(t.f!=null)a=t.f;else if(t.t=="z")continue;else if(t.t=="n"&&t.v!=null)a=""+t.v;else if(t.t=="b")a=t.v?"TRUE":"FALSE";else if(t.w!==undefined)a="'"+t.w;else if(t.v===undefined)continue;else if(t.t=="s")a="'"+t.v;else a=""+t.v;f[f.length]=r+"="+a}}return f}function mm(e,r,t){var a=t||{};var n=+!a.skipHeader;var i=e||{};var s=0,l=0;if(i&&a.origin!=null){if(typeof a.origin=="number")s=a.origin;else{var f=typeof a.origin=="string"?lt(a.origin):a.origin;s=f.r;l=f.c}}var o;var c={s:{c:0,r:0},e:{c:l,r:s+r.length-1+n}};if(i["!ref"]){var u=ut(i["!ref"]);c.e.c=Math.max(c.e.c,u.e.c);c.e.r=Math.max(c.e.r,u.e.r);if(s==-1){s=c.e.r+1;c.e.r=s+r.length-1+n}}var h=a.header||[],d=0;r.forEach(function(e,r){z(e).forEach(function(t){if((d=h.indexOf(t))==-1)h[d=h.length]=t;var f=e[t];var c="z";var u="";if(typeof f=="number")c="n";else if(typeof f=="boolean")c="b";else if(typeof f=="string")c="s";else if(f instanceof Date){c="d";if(!a.cellDates){c="n";f=Q(f)}u=a.dateNF||A._table[14]}i[ft({c:l+d,r:s+r+n})]=o={t:c,v:f};if(u)o.z=u})});c.e.c=Math.max(c.e.c,l+h.length-1);var v=qr(s);if(n)for(d=0;d=0&&e.SheetNames.length>r)return r;throw new Error("Cannot find sheet # "+r)}else if(typeof r=="string"){var t=e.SheetNames.indexOf(r);if(t>-1)return t;throw new Error("Cannot find sheet name |"+r+"|")}else throw new Error("Cannot find sheet |"+r+"|")}e.book_new=function(){return{SheetNames:[],Sheets:{}}};e.book_append_sheet=function(e,r,t){if(!t)for(var a=1;a<=65535;++a)if(e.SheetNames.indexOf(t="Sheet"+a)==-1)break;if(!t)throw new Error("Too many worksheets");Id(t);if(e.SheetNames.indexOf(t)>=0)throw new Error("Worksheet with name |"+t+"| already exists!");e.SheetNames.push(t);e.Sheets[t]=r};e.book_set_sheet_visibility=function(e,r,a){t(e,"Workbook",{});t(e.Workbook,"Sheets",[]);var i=n(e,r);t(e.Workbook.Sheets,i,{});switch(a){case 0:;case 1:;case 2:break;default:throw new Error("Bad sheet visibility setting "+a);}e.Workbook.Sheets[i].Hidden=a};r([["SHEET_VISIBLE",0],["SHEET_HIDDEN",1],["SHEET_VERY_HIDDEN",2]]);e.cell_set_number_format=function(e,r){e.z=r;return e};e.cell_set_hyperlink=function(e,r,t){if(!r){delete e.l}else{e.l={Target:r};if(t)e.l.Tooltip=t}return e};e.cell_set_internal_link=function(r,t,a){return e.cell_set_hyperlink(r,"#"+t,a)};e.cell_add_comment=function(e,r,t){if(!e.c)e.c=[];e.c.push({t:r,a:t||"SheetJS"})};e.sheet_set_array_formula=function(e,r,t){var n=typeof r!="string"?r:ut(r);var i=typeof r=="string"?r:ct(r);for(var s=n.s.r;s<=n.e.r;++s)for(var l=n.s.c;l<=n.e.c;++l){var f=a(e,s,l);f.t="n";f.F=i;delete f.v;if(s==n.s.r&&l==n.s.c)f.f=t}return e};return e})(gm);if(E&&typeof require!="undefined")(function(){var e={}.Readable;var t=function(r,t){var a=e();var n=t==null?{}:t;if(r==null||r["!ref"]==null){a.push(null);return a}var i=ut(r["!ref"]);var s=n.FS!==undefined?n.FS:",",l=s.charCodeAt(0);var f=n.RS!==undefined?n.RS:"\n",o=f.charCodeAt(0);var c=new RegExp((s=="|"?"\\|":s)+"+$");var u="",h=[];n.dense=Array.isArray(r);var d=n.skipHidden&&r["!cols"]||[];var v=n.skipHidden&&r["!rows"]||[];for(var p=i.s.c;p<=i.e.c;++p)if(!(d[p]||{}).hidden)h[p]=at(p);var m=i.s.r;var b=false;a._read=function(){if(!b){b=true;return a.push("\ufeff")}if(m>i.e.r)return a.push(null);while(m<=i.e.r){++m;if((v[m-1]||{}).hidden)continue;u=hm(r,i,m-1,h,l,o,s,n);if(u!=null){if(n.strip)u=u.replace(c,"");a.push(u+f);break}}};return a};var a=function(r,t){var a=e();var n=t||{};var i=n.header!=null?n.header:pp.BEGIN;var s=n.footer!=null?n.footer:pp.END;a.push(i);var l=ot(r["!ref"]);n.dense=Array.isArray(r);a.push(pp._preamble(r,l,n));var f=l.s.r;var o=false;a._read=function(){if(f>l.e.r){if(!o){o=true;a.push(""+s)}return a.push(null)}while(f<=l.e.r){a.push(pp._row(r,l,f,n));++f;break}};return a};r.stream={to_html:a,to_csv:t}})();r.parse_xlscfb=jv;r.parse_ods=Ep;r.parse_fods=kp;r.write_ods=_p;r.parse_zip=Vp;r.read=qp;r.readFile=em;r.readFileSync=em;r.write=sm;r.writeFile=fm;r.writeFileSync=fm;r.writeFileAsync=om;r.utils=gm;r.SSF=A;r.CFB=L})(typeof exports!=="undefined"?exports:XLSX);var XLS=XLSX,ODS=XLSX; diff --git a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/jsPDF-AutoTable/LICENSE.txt b/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/jsPDF-AutoTable/LICENSE.txt deleted file mode 100644 index 2d5ec87f38a3046e9b698b74cf16991ac2e2d1c8..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/jsPDF-AutoTable/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2014 Simon Bengtsson, https://github.com/someatoms/jspdf-autotable - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/jsPDF-AutoTable/jspdf.plugin.autotable.js b/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/jsPDF-AutoTable/jspdf.plugin.autotable.js deleted file mode 100644 index 39d60e1fd5e642f07f03df60d85ae7ab5461aacc..0000000000000000000000000000000000000000 --- a/api/src/main/resources/static/plug-in/tableExport.jquery.plugin/libs/jsPDF-AutoTable/jspdf.plugin.autotable.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * jsPDF AutoTable plugin v2.0.14 - * Copyright (c) 2014 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license - * - * @preserve - */ -"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}(function(API){"use strict";var FONT_ROW_RATIO=1.15;var doc,cursor,settings,pageCount,table;var defaultStyles={cellPadding:5,fontSize:10,font:"helvetica",lineColor:200,lineWidth:.1,fontStyle:"normal",overflow:"ellipsize",fillColor:255,textColor:20,halign:"left",valign:"top",fillStyle:"F",rowHeight:20,columnWidth:"auto"};var themes={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal",fillStyle:"F"},header:{textColor:255,fillColor:[41,128,185],rowHeight:23,fontStyle:"bold"},body:{},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1,fillStyle:"DF"},header:{textColor:255,fillColor:[26,188,156],rowHeight:23,fillStyle:"F",fontStyle:"bold"},body:{},alternateRow:{}},plain:{header:{fontStyle:"bold"}}};var defaultOptions=function defaultOptions(){return{theme:"striped",styles:{},headerStyles:{},bodyStyles:{},alternateRowStyles:{},columnStyles:{},startY:false,margin:40,pageBreak:"auto",tableWidth:"auto",createdHeaderCell:function createdHeaderCell(cell,data){},createdCell:function createdCell(cell,data){},drawHeaderRow:function drawHeaderRow(row,data){},drawRow:function drawRow(row,data){},drawHeaderCell:function drawHeaderCell(cell,data){},drawCell:function drawCell(cell,data){},beforePageContent:function beforePageContent(data){},afterPageContent:function afterPageContent(data){}}};API.autoTable=function(headers,data,options){doc=this;settings=initOptions(options||{});pageCount=1;cursor={y:settings.startY===false?settings.margin.top:settings.startY};var userStyles={textColor:30,fontSize:doc.internal.getFontSize(),fontStyle:doc.internal.getFont().fontStyle};createModels(headers,data);calculateWidths();var firstRowHeight=table.rows[0]&&settings.pageBreak==="auto"?table.rows[0].height:0;var minTableBottomPos=settings.startY+settings.margin.bottom+table.headerRow.height+firstRowHeight;if(settings.pageBreak==="avoid"){minTableBottomPos+=table.height}if(settings.pageBreak==="always"&&settings.startY!==false||settings.startY!==false&&minTableBottomPos>doc.internal.pageSize.height){doc.addPage();cursor.y=settings.margin.top}applyStyles(userStyles);settings.beforePageContent(hooksData());if(settings.drawHeaderRow(table.headerRow,hooksData({row:table.headerRow}))!==false){printRow(table.headerRow,settings.drawHeaderCell)}applyStyles(userStyles);printRows();settings.afterPageContent(hooksData());applyStyles(userStyles);return this};API.autoTableEndPosY=function(){if(typeof cursor==="undefined"||typeof cursor.y==="undefined"){return 0}return cursor.y};API.autoTableHtmlToJson=function(table){var data=[],headers=[],header=table.rows[0],tableRow,rowData,i,j;for(i=0;i=1){for(var iLine=0;iLinecolumn.contentWidth){column.contentWidth=cellWidth}});column.width=column.contentWidth;tableContentWidth+=column.contentWidth});table.contentWidth=tableContentWidth;var maxTableWidth=doc.internal.pageSize.width-settings.margin.left-settings.margin.right;var preferredTableWidth=maxTableWidth;if(typeof settings.tableWidth==="number"){preferredTableWidth=settings.tableWidth}else if(settings.tableWidth==="wrap"){preferredTableWidth=table.contentWidth}table.width=preferredTableWidthtable.width){column.width=column.contentWidth}else{dynamicColumns.push(column);dynamicColumnsContentWidth+=column.contentWidth;column.width=0}}staticWidth+=column.width});distributeWidth(dynamicColumns,staticWidth,dynamicColumnsContentWidth,fairWidth);table.height=0;var all=table.rows.concat(table.headerRow);all.forEach(function(row,i){var lineBreakCount=0;var cursorX=table.x;table.columns.forEach(function(col){var cell=row.cells[col.dataKey];col.x=cursorX;applyStyles(cell.styles);var textSpace=col.width-cell.styles.cellPadding*2;if(cell.styles.overflow==="linebreak"){cell.text=doc.splitTextToSize(cell.text,textSpace+1,{fontSize:cell.styles.fontSize})}else if(cell.styles.overflow==="ellipsize"){cell.text=ellipsize(cell.text,textSpace,cell.styles)}else if(cell.styles.overflow==="visible"){}else if(cell.styles.overflow==="hidden"){cell.text=ellipsize(cell.text,textSpace,cell.styles,"")}else if(typeof cell.styles.overflow==="function"){cell.text=cell.styles.overflow(cell.text,textSpace)}else{console.error("Unrecognized overflow type: "+cell.styles.overflow)}var count=Array.isArray(cell.text)?cell.text.length-1:0;if(count>lineBreakCount){lineBreakCount=count}cursorX+=col.width});row.heightStyle=row.styles.rowHeight;row.height=row.heightStyle+lineBreakCount*row.styles.fontSize*FONT_ROW_RATIO;table.height+=row.height})}function distributeWidth(dynamicColumns,staticWidth,dynamicColumnsContentWidth,fairWidth){var extraWidth=table.width-staticWidth-dynamicColumnsContentWidth;for(var i=0;i=doc.internal.pageSize.height}function printRow(row,hookHandler){for(var i=0;i=getStringWidth(text,styles)){return text}while(width>"),G("endobj"),n=R[t].join("\n"),J(),k){for(i=[],o=n.length;o--;)i[o]=n.charCodeAt(o);c=l.from(n),s=new a(6),s.append(new Uint8Array(i)),n=s.flush(),i=new Uint8Array(n.length+6),i.set(new Uint8Array([120,156])),i.set(n,2),i.set(new Uint8Array([255&c,c>>8&255,c>>16&255,c>>24&255]),n.length+2),n=String.fromCharCode.apply(null,i),G("<>")}else G("<>");Z(n),G("endobj")}I[1]=M,G("1 0 obj"),G("<>"),G("endobj"),W.publish("postPutPages")},et=function(t){t.objectNumber=J(),G("<>"),G("endobj")},nt=function(){for(var t in E)E.hasOwnProperty(t)&&et(E[t])},rt=function(){W.publish("putXobjectDict")},it=function(){G("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),G("/Font <<");for(var t in E)E.hasOwnProperty(t)&&G("/"+t+" "+E[t].objectNumber+" 0 R");G(">>"),G("/XObject <<"),rt(),G(">>")},ot=function(){nt(),W.publish("putResources"),I[2]=M,G("2 0 obj"),G("<<"),it(),G(">>"),G("endobj"),W.publish("postPutResources")},at=function(){W.publish("putAdditionalObjects");for(var t=0;t>8&&(c=!0);t=s.join("")}for(n=t.length;void 0===c&&0!==n;)t.charCodeAt(n-1)>>8&&(c=!0),n--;if(!c)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;n>8,u>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(u),s.push(l-(u<<8))}return String.fromCharCode.apply(void 0,s)},ft=function(t,e){return ht(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},dt=function(){G("/Producer (jsPDF "+r.version+")");for(var t in U)U.hasOwnProperty(t)&&U[t]&&G("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+ft(U[t])+")");var e=new Date,n=e.getTimezoneOffset(),i=n<0?"+":"-",o=Math.floor(Math.abs(n/60)),a=Math.abs(n%60),s=[i,Y(o),"'",Y(a),"'"].join("");G(["/CreationDate (D:",e.getFullYear(),Y(e.getMonth()+1),Y(e.getDate()),Y(e.getHours()),Y(e.getMinutes()),Y(e.getSeconds()),s,")"].join(""))},pt=function(){switch(G("/Type /Catalog"),G("/Pages 1 0 R"),b||(b="fullwidth"),b){case"fullwidth":G("/OpenAction [3 0 R /FitH null]");break;case"fullheight":G("/OpenAction [3 0 R /FitV null]");break;case"fullpage":G("/OpenAction [3 0 R /Fit]");break;case"original":G("/OpenAction [3 0 R /XYZ null null 1]");break;default:var t=""+b;"%"===t.substr(t.length-1)&&(b=parseInt(b)/100),"number"==typeof b&&G("/OpenAction [3 0 R /XYZ null null "+X(b)+"]")}switch(x||(x="continuous"),x){case"continuous":G("/PageLayout /OneColumn");break;case"single":G("/PageLayout /SinglePage");break;case"two":case"twoleft":G("/PageLayout /TwoColumnLeft");break;case"tworight":G("/PageLayout /TwoColumnRight")}v&&G("/PageMode /"+v),W.publish("putCatalog")},gt=function(){G("/Size "+(T+1)),G("/Root "+T+" 0 R"),G("/Info "+(T-1)+" 0 R")},mt=function(t,e){var n="string"==typeof e&&e.toLowerCase();if("string"==typeof t){var r=t.toLowerCase();s.hasOwnProperty(r)&&(t=s[r][0]/p,e=s[r][1]/p)}if(Array.isArray(t)&&(e=t[1],t=t[0]),n){switch(n.substr(0,1)){case"l":e>t&&(n="s");break;case"p":t>e&&(n="s")}"s"===n&&(g=t,t=e,e=g)}P=!0,R[++F]=[],D[F]={width:Number(t)||w,height:Number(e)||y},B[F]={},vt(F)},wt=function(){mt.apply(this,arguments),G(X(q*p)+" w"),G(C),0!==N&&G(N+" J"),0!==L&&G(L+" j"),W.publish("addPage",{pageNumber:F})},yt=function(t){t>0&&t<=F&&(R.splice(t,1),D.splice(t,1),F--,m>F&&(m=F),this.setPage(m))},vt=function(t){t>0&&t<=F&&(m=t,w=D[t].width,y=D[t].height)},bt=function(t,e){var n;switch(t=void 0!==t?t:E[d].fontName,e=void 0!==e?e:E[d].fontStyle,void 0!==t&&(t=t.toLowerCase()),t){case"sans-serif":case"verdana":case"arial":case"helvetica":t="helvetica";break;case"fixed":case"monospace":case"terminal":case"courier":t="courier";break;case"serif":case"cursive":case"fantasy":default:t="times"}try{n=O[t][e]}catch(t){}return n||(n=O.times[e],null==n&&(n=O.times.normal)),n},xt=function(){P=!1,T=2,M=0,j=[],I=[],z=[],W.publish("buildDocument"),G("%PDF-"+o),tt(),at(),ot(),J(),G("<<"),dt(),G(">>"),G("endobj"),J(),G("<<"),pt(),G(">>"),G("endobj");var t,e=M,n="0000000000";for(G("xref"),G("0 "+(T+1)),G(n+" 65535 f "),t=1;t<=T;t++){var r=I[t];G("function"==typeof r?(n+I[t]()).slice(-10)+" 00000 n ":(n+I[t]).slice(-10)+" 00000 n ")}return G("trailer"),G("<<"),gt(),G(">>"),G("startxref"),G(""+e),G("%%EOF"),P=!0,j.join("\n")},kt=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e},_t=function(){for(var t=xt(),e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},Ct=function(){return new Blob([_t()],{type:"application/pdf"})},At=ut(function(t,n){var r="dataur"===(""+t).substr(0,6)?"data:application/pdf;base64,"+btoa(xt()):0;switch(t){case void 0:return xt();case"save":if(navigator.getUserMedia&&(void 0===e.URL||void 0===e.URL.createObjectURL))return H.output("dataurlnewwindow");i(Ct(),n),"function"==typeof i.unload&&e.setTimeout&&setTimeout(i.unload,911);break;case"arraybuffer":return _t();case"blob":return Ct();case"bloburi":case"bloburl":return e.URL&&e.URL.createObjectURL(Ct())||void 0;case"datauristring":case"dataurlstring":return r;case"dataurlnewwindow":var o=e.open(r);if(o||"undefined"==typeof safari)return o;case"datauri":case"dataurl":return e.document.location.href=r;default:throw new Error('Output type "'+t+'" is not supported.')}});switch(l){case"pt":p=1;break;case"mm":p=72/25.4000508;break;case"cm":p=72/2.54000508;break;case"in":p=72;break;case"px":p=96/72;break;case"pc":p=12;break;case"em":p=12;break;case"ex":p=6;break;default:throw"Invalid unit: "+l}H.internal={pdfEscape:ft,getStyle:kt,getFont:function(){return E[bt.apply(H,arguments)]},getFontSize:function(){return A},getLineHeight:function(){return A*S},write:function(t){G(1===arguments.length?t:Array.prototype.join.call(arguments," "))},getCoordinateString:function(t){return X(t*p)},getVerticalCoordinateString:function(t){return X((y-t)*p)},collections:{},newObject:J,newAdditionalObject:Q,newObjectDeferred:K,newObjectDeferredBegin:$,putStream:Z,events:W,scaleFactor:p,pageSize:{get width(){return w},get height(){return y}},output:function(t,e){return At(t,e)},getNumberOfPages:function(){return R.length-1},pages:R,out:G,f2:X,getPageInfo:function(t){var e=2*(t-1)+3;return{objId:e,pageNumber:t,pageContext:B[t]}},getCurrentPageInfo:function(){var t=2*(m-1)+3;return{objId:t,pageNumber:m,pageContext:B[m]}},getPDFVersion:function(){return o}},H.addPage=function(){return wt.apply(this,arguments),this},H.setPage=function(){return vt.apply(this,arguments),this},H.insertPage=function(t){return this.addPage(),this.movePage(m,t),this},H.movePage=function(t,e){if(t>e){for(var n=R[t],r=D[t],i=B[t],o=t;o>e;o--)R[o]=R[o-1],D[o]=D[o-1],B[o]=B[o-1];R[e]=n,D[e]=r,B[e]=i,this.setPage(e)}else if(t>16&255,e=r>>8&255,n=255&r}return _=0===t&&0===e&&0===n||"undefined"==typeof e?V(t/255)+" g":[V(t/255),V(e/255),V(n/255),"rg"].join(" "),this},H.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},H.setLineCap=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return N=e,G(e+" J"),this},H.setLineJoin=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return L=e,G(e+" j"),this},H.output=At,H.save=function(t){H.output("save",t)};for(var St in r.API)r.API.hasOwnProperty(St)&&("events"===St&&r.API.events.length?!function(t,e){var n,r,i;for(i=e.length-1;i!==-1;i--)n=e[i][0],r=e[i][1],t.subscribe.apply(t,[n].concat("function"==typeof r?[r]:r))}(W,r.API.events):H[St]=r.API[St]);return lt(),d="F1",wt(u,c),W.publish("initialized"),H}var o="1.3",s={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};return r.API={events:[]},r.version="1.x-master","function"==typeof define&&define.amd?define("jsPDF",function(){return r}):"undefined"!=typeof module&&module.exports?module.exports=r:e.jsPDF=r,r}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0));/** - * jsPDF AcroForm Plugin - * Copyright (c) 2016 Alexander Weidt, https://github.com/BiggA94 - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license - */ -(window.AcroForm=function(t){var n=window.AcroForm;n.scale=function(t){return t*(r.internal.scaleFactor/1)},n.antiScale=function(t){return 1/r.internal.scaleFactor*t};var r={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null};e.API.acroformPlugin=r;var i=function(){for(var t in this.acroformPlugin.acroFormDictionaryRoot.Fields){var e=this.acroformPlugin.acroFormDictionaryRoot.Fields[t];e.hasAnnotation&&a.call(this,e)}},o=function(){if(this.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");this.acroformPlugin.acroFormDictionaryRoot=new n.AcroFormDictionary,this.acroformPlugin.internal=this.internal,this.acroformPlugin.acroFormDictionaryRoot._eventID=this.internal.events.subscribe("postPutResources",l),this.internal.events.subscribe("buildDocument",i),this.internal.events.subscribe("putCatalog",c),this.internal.events.subscribe("postPutPages",u)},a=function(t){var n={type:"reference",object:t};e.API.annotationPlugin.annotations[this.internal.getPageInfo(t.page).pageNumber].push(n)},s=function(t){this.acroformPlugin.printedOut&&(this.acroformPlugin.printedOut=!1,this.acroformPlugin.acroFormDictionaryRoot=null),this.acroformPlugin.acroFormDictionaryRoot||o.call(this),this.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)},c=function(){"undefined"!=typeof this.acroformPlugin.acroFormDictionaryRoot?this.internal.write("/AcroForm "+this.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R"):console.log("Root missing...")},l=function(){this.internal.events.unsubscribe(this.acroformPlugin.acroFormDictionaryRoot._eventID),delete this.acroformPlugin.acroFormDictionaryRoot._eventID,this.acroformPlugin.printedOut=!0},u=function(t){var e=!t;t||(this.internal.newObjectDeferredBegin(this.acroformPlugin.acroFormDictionaryRoot.objId),this.internal.out(this.acroformPlugin.acroFormDictionaryRoot.getString()));var t=t||this.acroformPlugin.acroFormDictionaryRoot.Kids;for(var r in t){var i=t[r],o=i.Rect;i.Rect&&(i.Rect=n.internal.calculateCoordinates.call(this,i.Rect)),this.internal.newObjectDeferredBegin(i.objId);var a="";if(a+=i.objId+" 0 obj\n",a+="<<\n"+i.getContent(),i.Rect=o,i.hasAppearanceStream&&!i.appearanceStreamContent){var s=n.internal.calculateAppearanceStream.call(this,i);a+="/AP << /N "+s+" >>\n",this.acroformPlugin.xForms.push(s)}if(i.appearanceStreamContent){a+="/AP << ";for(var c in i.appearanceStreamContent){var l=i.appearanceStreamContent[c];if(a+="/"+c+" ",a+="<< ",Object.keys(l).length>=1||Array.isArray(l))for(var r in l){var u=l[r];"function"==typeof u&&(u=u.call(this,i)),a+="/"+r+" "+u+" ",this.acroformPlugin.xForms.indexOf(u)>=0||this.acroformPlugin.xForms.push(u)}else{var u=l;"function"==typeof u&&(u=u.call(this,i)),a+="/"+r+" "+u+" \n",this.acroformPlugin.xForms.indexOf(u)>=0||this.acroformPlugin.xForms.push(u)}a+=" >>\n"}a+=">>\n"}a+=">>\nendobj\n",this.internal.out(a)}e&&h.call(this,this.acroformPlugin.xForms)},h=function(t){for(var e in t){var n=e,r=t[e];this.internal.newObjectDeferredBegin(r&&r.objId);var i="";i+=r?r.getString():"",this.internal.out(i),delete t[n]}};t.addField=function(t){return t instanceof n.TextField?d.call(this,t):t instanceof n.ChoiceField?p.call(this,t):t instanceof n.Button?f.call(this,t):t instanceof n.ChildClass?s.call(this,t):t&&s.call(this,t),t.page=this.acroformPlugin.internal.getCurrentPageInfo().pageNumber,this};var f=function(t){var t=t||new n.Field;t.FT="/Btn";var e=t.Ff||0;t.pushbutton&&(e=n.internal.setBitPosition(e,17),delete t.pushbutton),t.radio&&(e=n.internal.setBitPosition(e,16),delete t.radio),t.noToggleToOff&&(e=n.internal.setBitPosition(e,15)),t.Ff=e,s.call(this,t)},d=function(t){var t=t||new n.Field;t.FT="/Tx";var e=t.Ff||0;t.multiline&&(e=4096|e),t.password&&(e=8192|e),t.fileSelect&&(e|=1<<20),t.doNotSpellCheck&&(e|=1<<22),t.doNotScroll&&(e|=1<<23),t.Ff=t.Ff||e,s.call(this,t)},p=function(t){var e=t||new n.Field;e.FT="/Ch";var r=e.Ff||0;e.combo&&(r=n.internal.setBitPosition(r,18),delete e.combo),e.edit&&(r=n.internal.setBitPosition(r,19),delete e.edit),e.sort&&(r=n.internal.setBitPosition(r,20),delete e.sort),e.multiSelect&&this.internal.getPDFVersion()>=1.4&&(r=n.internal.setBitPosition(r,22),delete e.multiSelect),e.doNotSpellCheck&&this.internal.getPDFVersion()>=1.4&&(r=n.internal.setBitPosition(r,23),delete e.doNotSpellCheck),e.Ff=r,s.call(this,e)}})(e.API);var n=window.AcroForm;n.internal={},n.createFormXObject=function(t){var e=new n.FormXObject,r=n.Appearance.internal.getHeight(t)||0,i=n.Appearance.internal.getWidth(t)||0;return e.BBox=[0,0,i,r],e},n.Appearance={CheckBox:{createAppearanceStream:function(){var t={N:{On:n.Appearance.CheckBox.YesNormal},D:{On:n.Appearance.CheckBox.YesPushDown,Off:n.Appearance.CheckBox.OffPushDown}};return t},createMK:function(){return"<< /CA (3)>>"},YesPushDown:function(t){var e=n.createFormXObject(t),r="";t.Q=1;var i=n.internal.calculateX(t,"3","ZapfDingbats",50);return r+="0.749023 g\n 0 0 "+n.Appearance.internal.getWidth(t)+" "+n.Appearance.internal.getHeight(t)+" re\n f\n BMC\n q\n 0 0 1 rg\n /F13 "+i.fontSize+" Tf 0 g\n BT\n",r+=i.text,r+="ET\n Q\n EMC\n",e.stream=r,e},YesNormal:function(t){var e=n.createFormXObject(t),r="";t.Q=1;var i=n.internal.calculateX(t,"3","ZapfDingbats",.9*n.Appearance.internal.getHeight(t));return r+="1 g\n0 0 "+n.Appearance.internal.getWidth(t)+" "+n.Appearance.internal.getHeight(t)+" re\nf\nq\n0 0 1 rg\n0 0 "+(n.Appearance.internal.getWidth(t)-1)+" "+(n.Appearance.internal.getHeight(t)-1)+" re\nW\nn\n0 g\nBT\n/F13 "+i.fontSize+" Tf 0 g\n",r+=i.text,r+="ET\n Q\n",e.stream=r,e},OffPushDown:function(t){var e=n.createFormXObject(t),r="";return r+="0.749023 g\n 0 0 "+n.Appearance.internal.getWidth(t)+" "+n.Appearance.internal.getHeight(t)+" re\n f\n",e.stream=r,e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:n.Appearance.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=n.Appearance.RadioButton.Circle.YesNormal,e.D[t]=n.Appearance.RadioButton.Circle.YesPushDown,e},createMK:function(){return"<< /CA (l)>>"},YesNormal:function(t){var e=n.createFormXObject(t),r="",i=n.Appearance.internal.getWidth(t)<=n.Appearance.internal.getHeight(t)?n.Appearance.internal.getWidth(t)/4:n.Appearance.internal.getHeight(t)/4;i*=.9;var o=n.Appearance.internal.Bezier_C;return r+="q\n1 0 0 1 "+n.Appearance.internal.getWidth(t)/2+" "+n.Appearance.internal.getHeight(t)/2+" cm\n"+i+" 0 m\n"+i+" "+i*o+" "+i*o+" "+i+" 0 "+i+" c\n-"+i*o+" "+i+" -"+i+" "+i*o+" -"+i+" 0 c\n-"+i+" -"+i*o+" -"+i*o+" -"+i+" 0 -"+i+" c\n"+i*o+" -"+i+" "+i+" -"+i*o+" "+i+" 0 c\nf\nQ\n",e.stream=r,e},YesPushDown:function(t){var e=n.createFormXObject(t),r="",i=n.Appearance.internal.getWidth(t)<=n.Appearance.internal.getHeight(t)?n.Appearance.internal.getWidth(t)/4:n.Appearance.internal.getHeight(t)/4;i*=.9;var o=2*i,a=o*n.Appearance.internal.Bezier_C,s=i*n.Appearance.internal.Bezier_C;return r+="0.749023 g\n q\n 1 0 0 1 "+n.Appearance.internal.getWidth(t)/2+" "+n.Appearance.internal.getHeight(t)/2+" cm\n"+o+" 0 m\n"+o+" "+a+" "+a+" "+o+" 0 "+o+" c\n-"+a+" "+o+" -"+o+" "+a+" -"+o+" 0 c\n-"+o+" -"+a+" -"+a+" -"+o+" 0 -"+o+" c\n"+a+" -"+o+" "+o+" -"+a+" "+o+" 0 c\n f\n Q\n 0 g\n q\n 1 0 0 1 "+n.Appearance.internal.getWidth(t)/2+" "+n.Appearance.internal.getHeight(t)/2+" cm\n"+i+" 0 m\n"+i+" "+s+" "+s+" "+i+" 0 "+i+" c\n-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c\n-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c\n"+s+" -"+i+" "+i+" -"+s+" "+i+" 0 c\n f\n Q\n",e.stream=r,e},OffPushDown:function(t){var e=n.createFormXObject(t),r="",i=n.Appearance.internal.getWidth(t)<=n.Appearance.internal.getHeight(t)?n.Appearance.internal.getWidth(t)/4:n.Appearance.internal.getHeight(t)/4;i*=.9;var o=2*i,a=o*n.Appearance.internal.Bezier_C;return r+="0.749023 g\n q\n 1 0 0 1 "+n.Appearance.internal.getWidth(t)/2+" "+n.Appearance.internal.getHeight(t)/2+" cm\n"+o+" 0 m\n"+o+" "+a+" "+a+" "+o+" 0 "+o+" c\n-"+a+" "+o+" -"+o+" "+a+" -"+o+" 0 c\n-"+o+" -"+a+" -"+a+" -"+o+" 0 -"+o+" c\n"+a+" -"+o+" "+o+" -"+a+" "+o+" 0 c\n f\n Q\n",e.stream=r,e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:n.Appearance.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=n.Appearance.RadioButton.Cross.YesNormal,e.D[t]=n.Appearance.RadioButton.Cross.YesPushDown,e},createMK:function(){return"<< /CA (8)>>"},YesNormal:function(t){var e=n.createFormXObject(t),r="",i=n.Appearance.internal.calculateCross(t);return r+="q\n 1 1 "+(n.Appearance.internal.getWidth(t)-2)+" "+(n.Appearance.internal.getHeight(t)-2)+" re\n W\n n\n "+i.x1.x+" "+i.x1.y+" m\n "+i.x2.x+" "+i.x2.y+" l\n "+i.x4.x+" "+i.x4.y+" m\n "+i.x3.x+" "+i.x3.y+" l\n s\n Q\n",e.stream=r,e},YesPushDown:function(t){var e=n.createFormXObject(t),r=n.Appearance.internal.calculateCross(t),i="";return i+="0.749023 g\n 0 0 "+n.Appearance.internal.getWidth(t)+" "+n.Appearance.internal.getHeight(t)+" re\n f\n q\n 1 1 "+(n.Appearance.internal.getWidth(t)-2)+" "+(n.Appearance.internal.getHeight(t)-2)+" re\n W\n n\n "+r.x1.x+" "+r.x1.y+" m\n "+r.x2.x+" "+r.x2.y+" l\n "+r.x4.x+" "+r.x4.y+" m\n "+r.x3.x+" "+r.x3.y+" l\n s\n Q\n",e.stream=i,e},OffPushDown:function(t){var e=n.createFormXObject(t),r="";return r+="0.749023 g\n 0 0 "+n.Appearance.internal.getWidth(t)+" "+n.Appearance.internal.getHeight(t)+" re\n f\n",e.stream=r,e}}},createDefaultAppearanceStream:function(t){var e="";return e+="/Helv 0 Tf 0 g"}},n.Appearance.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=function(t,e){return t>e?e:t},r=n.Appearance.internal.getWidth(t),i=n.Appearance.internal.getHeight(t),o=e(r,i),a={x1:{x:(r-o)/2,y:(i-o)/2+o},x2:{x:(r-o)/2+o,y:(i-o)/2},x3:{x:(r-o)/2,y:(i-o)/2},x4:{x:(r-o)/2+o,y:(i-o)/2+o}};return a}},n.Appearance.internal.getWidth=function(t){return t.Rect[2]},n.Appearance.internal.getHeight=function(t){return t.Rect[3]},n.internal.inherit=function(t,e){Object.create||function(t){var e=function(){};return e.prototype=t,new e};t.prototype=Object.create(e.prototype),t.prototype.constructor=t},n.internal.arrayToPdfArray=function(t){if(Array.isArray(t)){var e=" [";for(var n in t){var r=t[n].toString();e+=r,e+=n>\n",this.stream&&(t+="stream\n",t+=this.stream,t+="endstream\n"),t+="endobj\n"},n.PDFObject.prototype.getContent=function(){var t=function(t){var e="",r=Object.keys(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var i in r){var o=r[i],a=t[o];a&&(e+=Array.isArray(a)?"/"+o+" "+n.internal.arrayToPdfArray(a)+"\n":a instanceof n.PDFObject?"/"+o+" "+a.objId+" 0 R\n":"/"+o+" "+a+"\n")}return e},e="";return e+=t(this)},n.FormXObject=function(){n.PDFObject.call(this),this.Type="/XObject",this.Subtype="/Form",this.FormType=1,this.BBox,this.Matrix,this.Resources="2 0 R",this.PieceInfo;var t;Object.defineProperty(this,"Length",{enumerable:!0,get:function(){return void 0!==t?t.length:0}}),Object.defineProperty(this,"stream",{enumerable:!1,set:function(e){t=e},get:function(){return t?t:null}})},n.internal.inherit(n.FormXObject,n.PDFObject),n.AcroFormDictionary=function(){n.PDFObject.call(this);var t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!0,configurable:!0,get:function(){return t}}),this.DA},n.internal.inherit(n.AcroFormDictionary,n.PDFObject),n.Field=function(){n.PDFObject.call(this);var t;Object.defineProperty(this,"Rect",{enumerable:!0,configurable:!1,get:function(){if(t){var e=t;return e}},set:function(e){t=e}});var e="";Object.defineProperty(this,"FT",{enumerable:!0,set:function(t){e=t},get:function(){return e}});var r;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,set:function(t){r=t},get:function(){if(!r||r.length<1){if(this instanceof n.ChildClass)return;return"(FieldObject"+n.Field.FieldNum++ +")"}return"("==r.substring(0,1)&&r.substring(r.length-1)?r:"("+r+")"}});var i;Object.defineProperty(this,"DA",{enumerable:!0,get:function(){if(i)return"("+i+")"},set:function(t){i=t}});var o;Object.defineProperty(this,"DV",{enumerable:!0,configurable:!0,get:function(){if(o)return o},set:function(t){o=t}}),Object.defineProperty(this,"Type",{enumerable:!0,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,get:function(){return this.hasAnnotation?"/Widget":null}}),this.BG,Object.defineProperty(this,"hasAnnotation",{enumerable:!1,get:function(){return!!(this.Rect||this.BC||this.BG)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(this,"page",{enumerable:!1,configurable:!0,writable:!0})},n.Field.FieldNum=0,n.internal.inherit(n.Field,n.PDFObject),n.ChoiceField=function(){n.Field.call(this),this.FT="/Ch",this.Opt=[],this.V="()",this.TI=0,this.combo=!1,Object.defineProperty(this,"edit",{enumerable:!0,set:function(t){1==t?(this._edit=!0,this.combo=!0):this._edit=!1},get:function(){return!!this._edit&&this._edit},configurable:!1}),this.hasAppearanceStream=!0,Object.defineProperty(this,"V",{get:function(){n.internal.toPdfString()}})},n.internal.inherit(n.ChoiceField,n.Field),window.ChoiceField=n.ChoiceField,n.ListBox=function(){n.ChoiceField.call(this)},n.internal.inherit(n.ListBox,n.ChoiceField),window.ListBox=n.ListBox,n.ComboBox=function(){n.ListBox.call(this),this.combo=!0},n.internal.inherit(n.ComboBox,n.ListBox),window.ComboBox=n.ComboBox,n.EditBox=function(){n.ComboBox.call(this),this.edit=!0},n.internal.inherit(n.EditBox,n.ComboBox),window.EditBox=n.EditBox,n.Button=function(){n.Field.call(this),this.FT="/Btn"},n.internal.inherit(n.Button,n.Field),window.Button=n.Button,n.PushButton=function(){n.Button.call(this),this.pushbutton=!0},n.internal.inherit(n.PushButton,n.Button),window.PushButton=n.PushButton,n.RadioButton=function(){n.Button.call(this),this.radio=!0;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,get:function(){if(t.length>0)return t}}),Object.defineProperty(this,"__Kids",{get:function(){return t}});var e;Object.defineProperty(this,"noToggleToOff",{enumerable:!1,get:function(){return e},set:function(t){e=t}})},n.internal.inherit(n.RadioButton,n.Button),window.RadioButton=n.RadioButton,n.ChildClass=function(t,e){n.Field.call(this),this.Parent=t,this._AppearanceType=n.Appearance.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(e),this.F=n.internal.setBitPosition(this.F,3,1),this.MK=this._AppearanceType.createMK(),this.AS="/Off",this._Name=e},n.internal.inherit(n.ChildClass,n.Field),n.RadioButton.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t&&"createMK"in t))return void console.log("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.__Kids){var n=this.__Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n._Name),n.MK=t.createMK()}},n.RadioButton.prototype.createOption=function(t){var r=this,i=(this.__Kids.length,new n.ChildClass(r,t));return this.__Kids.push(i),e.API.addField(i),i},n.CheckBox=function(){Button.call(this),this.appearanceStreamContent=n.Appearance.CheckBox.createAppearanceStream(),this.MK=n.Appearance.CheckBox.createMK(),this.AS="/On",this.V="/On"},n.internal.inherit(n.CheckBox,n.Button),window.CheckBox=n.CheckBox,n.TextField=function(){n.Field.call(this),this.DA=n.Appearance.createDefaultAppearanceStream(),this.F=4;var t;Object.defineProperty(this,"V",{get:function(){return t?"("+t+")":t},enumerable:!0,set:function(e){t=e}});var e;Object.defineProperty(this,"DV",{get:function(){return e?"("+e+")":e},enumerable:!0,set:function(t){e=t}});var r=!1;Object.defineProperty(this,"multiline",{enumerable:!1,get:function(){return r},set:function(t){r=t}});var i=!1;Object.defineProperty(this,"MaxLen",{enumerable:!0,get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!1,get:function(){return this.V||this.DV}})},n.internal.inherit(n.TextField,n.Field),window.TextField=n.TextField,n.PasswordField=function(){TextField.call(this),Object.defineProperty(this,"password",{value:!0,enumerable:!1,configurable:!1,writable:!1})},n.internal.inherit(n.PasswordField,n.TextField),window.PasswordField=n.PasswordField,n.internal.calculateFontSpace=function(t,e,r){var r=r||"helvetica",i=n.internal.calculateFontSpace.canvas||(n.internal.calculateFontSpace.canvas=document.createElement("canvas")),o=i.getContext("2d");o.save();var a=e+" "+r;o.font=a;var s=o.measureText(t);o.fontcolor="black";var o=i.getContext("2d");s.height=1.5*o.measureText("3").width,o.restore();s.width;return s},n.internal.calculateX=function(t,e,r,i){var i=i||12,r=r||"helvetica",o={text:"",fontSize:""};e="("==e.substr(0,1)?e.substr(1):e,e=")"==e.substr(e.length-1)?e.substr(0,e.length-1):e;var a=e.split(" "),s=i,c=2,l=2,u=n.Appearance.internal.getHeight(t)||0;u=u<0?-u:u;var h=n.Appearance.internal.getWidth(t)||0;h=h<0?-h:h;var f=function(t,e,i){if(t+1=a.length-1;if(!A||S){if(A||S){if(S)v=C;else if(t.multiline&&(d+c)*(k+2)+c>u)continue t}else{if(!t.multiline)continue t;if((d+c)*(k+2)+c>u)continue t;v=C}for(var q="",T=y;T<=v;T++)q+=a[T]+" ";switch(q=" "==q.substr(q.length-1)?q.substr(0,q.length-1):q,b=n.internal.calculateFontSpace(q,s+"px",r).width,t.Q){case 2:g=h-b-l;break;case 1:g=(h-b)/2;break;case 0:default:g=l}e+=g+" "+w+" Td\n",e+="("+q+") Tj\n",e+=-g+" 0 Td\n",w=-(s+c),m=g,b=0,y=v+1,k++,x=""}else x+=" "}break}return o.text=e,o.fontSize=s,o},n.internal.calculateAppearanceStream=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e="",r=t.V||t.DV,i=n.internal.calculateX(t,r);e+="/Tx BMC\nq\n/F1 "+i.fontSize+" Tf\n1 0 0 1 0 0 Tm\n",e+="BT\n",e+=i.text,e+="ET\n",e+="Q\nEMC\n";var o=new n.createFormXObject(t);o.stream=e;return o}},n.internal.calculateCoordinates=function(t,e,r,i){var o={};if(this.internal){var a=function(t){return t*this.internal.scaleFactor};Array.isArray(t)?(t[0]=n.scale(t[0]),t[1]=n.scale(t[1]),t[2]=n.scale(t[2]),t[3]=n.scale(t[3]),o.lowerLeft_X=t[0]||0,o.lowerLeft_Y=a.call(this,this.internal.pageSize.height)-t[3]-t[1]||0,o.upperRight_X=t[0]+t[2]||0,o.upperRight_Y=a.call(this,this.internal.pageSize.height)-t[1]||0):(t=n.scale(t),e=n.scale(e),r=n.scale(r),i=n.scale(i),o.lowerLeft_X=t||0,o.lowerLeft_Y=this.internal.pageSize.height-e||0,o.upperRight_X=t+r||0,o.upperRight_Y=this.internal.pageSize.height-e+i||0)}else Array.isArray(t)?(o.lowerLeft_X=t[0]||0,o.lowerLeft_Y=t[1]||0,o.upperRight_X=t[0]+t[2]||0,o.upperRight_Y=t[1]+t[3]||0):(o.lowerLeft_X=t||0,o.lowerLeft_Y=e||0,o.upperRight_X=t+r||0,o.upperRight_Y=e+i||0);return[o.lowerLeft_X,o.lowerLeft_Y,o.upperRight_X,o.upperRight_Y]},n.internal.calculateColor=function(t,e,n){var r=new Array(3);return r.r=0|t,r.g=0|e,r.b=0|n,r},n.internal.getBitPosition=function(t,e){t=t||0;var n=1;return n<<=e-1,t|n},n.internal.setBitPosition=function(t,e,n){t=t||0,n=n||1;var r=1;if(r<<=e-1,1==n)var t=t|r;else var t=t&~r;return t},/** - * jsPDF addHTML PlugIn - * Copyright (c) 2014 Diego Casorran - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license - */ -function(t){t.addHTML=function(t,e,n,r,i){if("undefined"==typeof html2canvas&&"undefined"==typeof rasterizeHTML)throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js");"number"!=typeof e&&(r=e,i=n),"function"==typeof r&&(i=r,r=null);var o=this.internal,a=o.scaleFactor,s=o.pageSize.width,c=o.pageSize.height;if(r=r||{},r.onrendered=function(t){e=parseInt(e)||0,n=parseInt(n)||0;var o=r.dim||{},l=o.h||0,u=o.w||Math.min(s,t.width/a)-e,h="JPEG";if(r.format&&(h=r.format),t.height>c&&r.pagesplit){var f=function(){for(var r=0;;){var o=document.createElement("canvas");o.width=Math.min(s*a,t.width),o.height=Math.min(c*a,t.height-r);var l=o.getContext("2d");l.drawImage(t,0,r,t.width,o.height,0,0,o.width,o.height);var f=[o,e,r?0:n,o.width/a,o.height/a,h,null,"SLOW"];if(this.addImage.apply(this,f),r+=o.height,r>=t.height)break;this.addPage()}i(u,r,null,f)}.bind(this);if("CANVAS"===t.nodeName){var d=new Image;d.onload=f,d.src=t.toDataURL("image/png"),t=d}else f()}else{var p=Math.random().toString(35),g=[t,e,n,u,l,h,p,"SLOW"];this.addImage.apply(this,g),i(u,l,p,g)}}.bind(this),"undefined"!=typeof html2canvas&&!r.rstz)return html2canvas(t,r);if("undefined"!=typeof rasterizeHTML){var l="drawDocument";return"string"==typeof t&&(l=/^http/.test(t)?"drawURL":"drawHTML"),r.width=r.width||s*a,rasterizeHTML[l](t,void 0,r).then(function(t){r.onrendered(t.image)},function(t){i(null,t)})}return null}}(e.API),/** @preserve - * jsPDF addImage plugin - * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/ - * 2013 Chris Dowling, https://github.com/gingerchris - * 2013 Trinh Ho, https://github.com/ineedfat - * 2013 Edwin Alejandro Perez, https://github.com/eaparango - * 2013 Norah Smith, https://github.com/burnburnrocket - * 2014 Diego Casorran, https://github.com/diegocr - * 2014 James Robb, https://github.com/jamesbrobb - * - * - */ -function(e){var n="addImage_",r=["jpeg","jpg","png"],i=function t(e){var n=this.internal.newObject(),r=this.internal.write,i=this.internal.putStream;if(e.n=n,r("<>"),"trns"in e&&e.trns.constructor==Array){for(var o="",a=0,s=e.trns.length;a>"),i(e.data),r("endobj"),"smask"in e){var c="/Predictor "+e.p+" /Colors 1 /BitsPerComponent "+e.bpc+" /Columns "+e.w,l={w:e.w,h:e.h,cs:"DeviceGray",bpc:e.bpc,dp:c,data:e.smask};"f"in e&&(l.f=e.f),t.call(this,l)}e.cs===this.color_spaces.INDEXED&&(this.internal.newObject(),r("<< /Length "+e.pal.length+">>"),i(this.arrayBufferToBinaryString(new Uint8Array(e.pal))),r("endobj"))},o=function(){var t=this.internal.collections[n+"images"];for(var e in t)i.call(this,t[e])},a=function(){var t,e=this.internal.collections[n+"images"],r=this.internal.write;for(var i in e)t=e[i],r("/I"+t.i,t.n,"0","R")},s=function(t){return t&&"string"==typeof t&&(t=t.toUpperCase()),t in e.image_compression?t:e.image_compression.NONE},c=function(){var t=this.internal.collections[n+"images"];return t||(this.internal.collections[n+"images"]=t={},this.internal.events.subscribe("putResources",o),this.internal.events.subscribe("putXobjectDict",a)),t},l=function(t){var e=0;return t&&(e=Object.keys?Object.keys(t).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(t)),e},u=function(t){return"undefined"==typeof t||null===t},h=function(t){return"string"==typeof t&&e.sHashCode(t)},f=function(t){return r.indexOf(t)===-1},d=function(t){return"function"!=typeof e["process"+t.toUpperCase()]},p=function(e){return"object"===("undefined"==typeof e?"undefined":t(e))&&1===e.nodeType},g=function(e,n,r){if("IMG"===e.nodeName&&e.hasAttribute("src")){var i=""+e.getAttribute("src");if(!r&&0===i.indexOf("data:image/"))return i;!n&&/\.png(?:[?#].*)?$/i.test(i)&&(n="png")}if("CANVAS"===e.nodeName)var o=e;else{var o=document.createElement("canvas");o.width=e.clientWidth||e.width,o.height=e.clientHeight||e.height;var a=o.getContext("2d");if(!a)throw"addImage requires canvas to be supported by browser.";if(r){var s,c,l,u,h,f,d,p,g=Math.PI/180;"object"===("undefined"==typeof r?"undefined":t(r))&&(s=r.x,c=r.y,l=r.bg,r=r.angle),p=r*g,u=Math.abs(Math.cos(p)),h=Math.abs(Math.sin(p)),f=o.width,d=o.height,o.width=d*h+f*u,o.height=d*u+f*h,isNaN(s)&&(s=o.width/2),isNaN(c)&&(c=o.height/2),a.clearRect(0,0,o.width,o.height),a.fillStyle=l||"white",a.fillRect(0,0,o.width,o.height),a.save(),a.translate(s,c),a.rotate(p),a.drawImage(e,-(f/2),-(d/2)),a.rotate(-p),a.translate(-s,-c),a.restore()}else a.drawImage(e,0,0,o.width,o.height)}return o.toDataURL("png"==(""+n).toLowerCase()?"image/png":"image/jpeg")},m=function(t,e){var n;if(e)for(var r in e)if(t===e[r].alias){n=e[r];break}return n},w=function(t,e,n){return t||e||(t=-96,e=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]},y=function(t,e,n,r,i,o,a){var s=w.call(this,n,r,i),c=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString;n=s[0],r=s[1],a[o]=i,this.internal.write("q",c(n),"0 0",c(r),c(t),l(e+r),"cm /I"+i.i,"Do Q")};e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"},e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"},e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},e.sHashCode=function(t){return Array.prototype.reduce&&t.split("").reduce(function(t,e){return t=(t<<5)-t+e.charCodeAt(0),t&t},0)},e.isString=function(t){return"string"==typeof t},e.extractInfoFromBase64DataURI=function(t){return/^data:([\w]+?\/([\w]+?));base64,(.+?)$/g.exec(t)},e.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},e.isArrayBuffer=function(t){return!!this.supportsArrayBuffer()&&t instanceof ArrayBuffer},e.isArrayBufferView=function(t){return!!this.supportsArrayBuffer()&&("undefined"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array))},e.binaryStringToUint8Array=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r>18,n=(258048&o)>>12,r=(4032&o)>>6,i=63&o,a+=s[e]+s[n]+s[r]+s[i];return 1==u?(o=c[h],e=(252&o)>>2,n=(3&o)<<4,a+=s[e]+s[n]+"=="):2==u&&(o=c[h]<<8|c[h+1],e=(64512&o)>>10,n=(1008&o)>>4,r=(15&o)<<2,a+=s[e]+s[n]+s[r]+"="),a},e.createImageInfo=function(t,e,n,r,i,o,a,s,c,l,u,h,f){var d={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(d.f=o),c&&(d.dp=c),l&&(d.trns=l),u&&(d.pal=u),h&&(d.smask=h),f&&(d.p=f),d},e.addImage=function(e,n,i,o,a,w,v,b,x){if("string"!=typeof n){var k=w;w=a,a=o,o=i,i=n,n=k}if("object"===("undefined"==typeof e?"undefined":t(e))&&!p(e)&&"imageData"in e){var _=e;e=_.imageData,n=_.format||n,i=_.x||i||0,o=_.y||o||0,a=_.w||a,w=_.h||w,v=_.alias||v,b=_.compression||b,x=_.rotation||_.angle||x}if(isNaN(i)||isNaN(o))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var C,A=c.call(this);if(!(C=m(e,A))){var S;if(p(e)&&(e=g(e,n,x)),u(v)&&(v=h(e)),!(C=m(v,A))){if(this.isString(e)){var q=this.extractInfoFromBase64DataURI(e);q?(n=q[2],e=atob(q[3])):137===e.charCodeAt(0)&&80===e.charCodeAt(1)&&78===e.charCodeAt(2)&&71===e.charCodeAt(3)&&(n="png")}if(n=(n||"JPEG").toLowerCase(),f(n))throw new Error("addImage currently only supports formats "+r+", not '"+n+"'");if(d(n))throw new Error("please ensure that the plugin for '"+n+"' support is added");if(this.supportsArrayBuffer()&&(e instanceof Uint8Array||(S=e,e=this.binaryStringToUint8Array(e))),C=this["process"+n.toUpperCase()](e,l(A),v,s(b),S),!C)throw new Error("An unkwown error occurred whilst processing the image")}}return y.call(this,i,o,a,w,C,C.i,A),this};var v=function(t){var e,n,r;if(255===!t.charCodeAt(0)||216===!t.charCodeAt(1)||255===!t.charCodeAt(2)||224===!t.charCodeAt(3)||!t.charCodeAt(6)==="J".charCodeAt(0)||!t.charCodeAt(7)==="F".charCodeAt(0)||!t.charCodeAt(8)==="I".charCodeAt(0)||!t.charCodeAt(9)==="F".charCodeAt(0)||0===!t.charCodeAt(10))throw new Error("getJpegSize requires a binary string jpeg file");for(var i=256*t.charCodeAt(4)+t.charCodeAt(5),o=4,a=t.length;o7)return n=x(t,c+5),r=(n[2]<<8)+n[3],i=(n[0]<<8)+n[1],o=n[4],{width:r,height:i,numcomponents:o};c+=2}throw new Error("getJpegSizeFromBytes could not find the size of the image")},x=function(t,e){return t.subarray(e,e+5)};e.processJPEG=function(t,e,n,r,i){var o,a=this.color_spaces.DEVICE_RGB,s=this.decode.DCT_DECODE,c=8;return this.isString(t)?(o=v(t),this.createImageInfo(t,o[0],o[1],1==o[3]?this.color_spaces.DEVICE_GRAY:a,c,s,e,n)):(this.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.isArrayBufferView(t)?(o=b(t),t=i||this.arrayBufferToBinaryString(t),this.createImageInfo(t,o.width,o.height,1==o.numcomponents?this.color_spaces.DEVICE_GRAY:a,c,s,e,n)):null)},e.processJPG=function(){return this.processJPEG.apply(this,arguments)}}(e.API),/** - * jsPDF Annotations PlugIn - * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license - */ -function(t){var n={annotations:[],f2:function(t){return t.toFixed(2)},notEmpty:function(t){if("undefined"!=typeof t&&""!=t)return!0}};return e.API.annotationPlugin=n,e.API.events.push(["addPage",function(t){this.annotationPlugin.annotations[t.pageNumber]=[]}]),t.events.push(["putPage",function(t){for(var e=this.annotationPlugin.annotations[t.pageNumber],r=!1,i=0;i>",u.content=y;var p=u.objId+" 0 R",g=30,d="/Rect ["+a((o.bounds.x+g)*s)+" "+a(c-(o.bounds.y+o.bounds.h)*s)+" "+a((o.bounds.x+o.bounds.w+g)*s)+" "+a((c-o.bounds.y)*s)+"] ";y="<>";else if(o.options.pageNumber){var t=this.internal.getPageInfo(o.options.pageNumber);switch(y="<>",this.internal.write(y))}}this.internal.write("]")}}]),t.createAnnotation=function(t){switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(t)}},t.link=function(t,e,n,r,i){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.link=function(t,e,n,r,i){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight();return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize(),n=this.getStringUnitWidth(t)*e/this.internal.scaleFactor;return n},t.getLineHeight=function(){return this.internal.getLineHeight()},this}(e.API),function(t){t.autoPrint=function(){var t;return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.write("<< /S/Named /Type/Action /N/Print >>","endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.write("/OpenAction "+t+" 0 R")}),this}}(e.API),/** - * jsPDF Canvas PlugIn - * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license - */ -function(t){return t.events.push(["initialized",function(){this.canvas.pdf=this}]),t.canvas={getContext:function(t){return this.pdf.context2d._canvas=this,this.pdf.context2d},style:{}},Object.defineProperty(t.canvas,"width",{get:function(){return this._width},set:function(t){this._width=t,this.getContext("2d").pageWrapX=t+1}}),Object.defineProperty(t.canvas,"height",{get:function(){return this._height},set:function(t){this._height=t,this.getContext("2d").pageWrapY=t+1}}),this}(e.API),/** ==================================================================== - * jsPDF Cell plugin - * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com - * 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br - * 2013 Lee Driscoll, https://github.com/lsdriscoll - * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria - * 2014 James Hall, james@parall.ax - * 2014 Diego Casorran, https://github.com/diegocr - * - * - * ==================================================================== - */ -function(t){var e,n,r,i,o=3,a=13,s={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},c=1,l=function(t,e,n,r,i){s={x:t,y:e,w:n,h:r,ln:i}},u=function(){return s},h={left:0,top:0,bottom:0};t.setHeaderFunction=function(t){i=t},t.getTextDimensions=function(t){e=this.internal.getFont().fontName,n=this.table_font_size||this.internal.getFontSize(),r=this.internal.getFont().fontStyle;var i,o,a=19.049976/25.4;o=document.createElement("font"),o.id="jsPDFCell";try{o.style.fontStyle=r}catch(t){o.style.fontWeight=r}o.style.fontName=e,o.style.fontSize=n+"pt";try{o.textContent=t}catch(e){o.innerText=t}return document.body.appendChild(o),i={w:(o.offsetWidth+1)*a,h:(o.offsetHeight+1)*a},document.body.removeChild(o),i},t.cellAddPage=function(){var t=this.margins||h;this.addPage(),l(t.left,t.top,void 0,void 0),c+=1},t.cellInitialize=function(){s={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},c=1},t.cell=function(t,e,n,r,i,s,c){var f=u(),d=!1;if(void 0!==f.ln)if(f.ln===s)t=f.x+f.w,e=f.y;else{var p=this.margins||h;f.y+f.h+r+a>=this.internal.pageSize.height-p.bottom&&(this.cellAddPage(),d=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(s,!0)),e=u().y+u().h,d&&(e=a+10)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===c){i instanceof Array||(i=[i]);for(var g=0;go&&(o=i);return o},t.table=function(e,n,r,i,o){if(!r)throw"No data for PDF table";var a,l,u,f,d,p,g,m,w,y,v=[],b=[],x={},k={},_=[],C=[],A=!1,S=!0,q=12,T=h;if(T.width=this.internal.pageSize.width,o&&(o.autoSize===!0&&(A=!0),o.printHeaders===!1&&(S=!1),o.fontSize&&(q=o.fontSize),o.css&&"undefined"!=typeof o.css["font-size"]&&(q=16*o.css["font-size"]),o.margins&&(T=o.margins)),this.lnMod=0,s={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},c=1,this.printHeaders=S,this.margins=T,this.setFontSize(q),this.table_font_size=q,void 0===i||null===i)v=Object.keys(r[0]);else if(i[0]&&"string"!=typeof i[0]){var P=19.049976/25.4;for(l=0,u=i.length;li&&(i=s)}return i},t.setTableHeaderRow=function(t){this.tableHeaderRow=t},t.printHeaderRow=function(t,e){if(!this.tableHeaderRow)throw"Property tableHeaderRow does not exist.";var n,r,o,s;if(this.printingHeaderRow=!0,void 0!==i){var u=i(this,c);l(u[0],u[1],u[2],u[3],-1)}this.setFontStyle("bold");var h=[];for(o=0,s=this.tableHeaderRow.length;o0&&this.setTableHeaderRow(h),this.setFontStyle("normal"),this.printingHeaderRow=!1}}(e.API),/** - * jsPDF Context2D PlugIn Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv - * - * Licensed under the MIT License. http://opensource.org/licenses/mit-license - */ -function(t){function e(){this._isStrokeTransparent=!1,this._strokeOpacity=1,this.strokeStyle="#000000",this.fillStyle="#000000",this._isFillTransparent=!1,this._fillOpacity=1,this.font="12pt times",this.textBaseline="alphabetic",this.textAlign="start",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this._transform=[1,0,0,1,0,0],this.globalCompositeOperation="normal",this.globalAlpha=1,this._clip_path=[],this.ignoreClearRect=!1,this.copy=function(t){this._isStrokeTransparent=t._isStrokeTransparent,this._strokeOpacity=t._strokeOpacity,this.strokeStyle=t.strokeStyle,this._isFillTransparent=t._isFillTransparent,this._fillOpacity=t._fillOpacity,this.fillStyle=t.fillStyle,this.font=t.font,this.lineWidth=t.lineWidth,this.lineJoin=t.lineJoin,this.lineCap=t.lineCap,this.textBaseline=t.textBaseline,this.textAlign=t.textAlign,this._fontSize=t._fontSize,this._transform=t._transform.slice(0),this.globalCompositeOperation=t.globalCompositeOperation,this.globalAlpha=t.globalAlpha,this._clip_path=t._clip_path.slice(0),this.ignoreClearRect=t.ignoreClearRect}}t.events.push(["initialized",function(){this.context2d.pdf=this,this.context2d.internal.pdf=this,this.context2d.ctx=new e,this.context2d.ctxStack=[],this.context2d.path=[]}]),t.context2d={pageWrapXEnabled:!1,pageWrapYEnabled:!1,pageWrapX:9999999,pageWrapY:9999999,ctx:new e,f2:function(t){return t.toFixed(2)},fillRect:function(t,e,n,r){if(!this._isFillTransparent()){t=this._wrapX(t),e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.pdf.rect(i.x,i.y,i.w,i.h,"f")}},strokeRect:function(t,e,n,r){if(!this._isStrokeTransparent()){t=this._wrapX(t),e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.pdf.rect(i.x,i.y,i.w,i.h,"s")}},clearRect:function(t,e,n,r){if(!this.ctx.ignoreClearRect){t=this._wrapX(t),e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.save(),this.setFillStyle("#ffffff"),this.pdf.rect(i.x,i.y,i.w,i.h,"f"),this.restore()}},save:function(){this.ctx._fontSize=this.pdf.internal.getFontSize();var t=new e;t.copy(this.ctx),this.ctxStack.push(this.ctx),this.ctx=t},restore:function(){this.ctx=this.ctxStack.pop(),this.setFillStyle(this.ctx.fillStyle),this.setStrokeStyle(this.ctx.strokeStyle),this.setFont(this.ctx.font),this.pdf.setFontSize(this.ctx._fontSize),this.setLineCap(this.ctx.lineCap),this.setLineWidth(this.ctx.lineWidth),this.setLineJoin(this.ctx.lineJoin)},rect:function(t,e,n,r){this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.closePath()},beginPath:function(){this.path=[]},closePath:function(){this.path.push({type:"close"})},_getRgba:function(t){var e={};if(this.internal.rxTransparent.test(t))e.r=0,e.g=0,e.b=0,e.a=0;else{var n=this.internal.rxRgb.exec(t);null!=n?(e.r=parseInt(n[1]),e.g=parseInt(n[2]),e.b=parseInt(n[3]),e.a=1):(n=this.internal.rxRgba.exec(t),null!=n?(e.r=parseInt(n[1]),e.g=parseInt(n[2]),e.b=parseInt(n[3]),e.a=parseFloat(n[4])):(e.a=1,"#"!=t.charAt(0)&&(t=o.colorNameToHex(t),t||(t="#000000")),4===t.length?(e.r=t.substring(1,2),e.r+=r,e.g=t.substring(2,3),e.g+=g,e.b=t.substring(3,4),e.b+=b):(e.r=t.substring(1,3),e.g=t.substring(3,5),e.b=t.substring(5,7)),e.r=parseInt(e.r,16),e.g=parseInt(e.g,16),e.b=parseInt(e.b,16)))}return e.style=t,e},setFillStyle:function(t){var e,n,r,i;if(this.internal.rxTransparent.test(t))e=0,n=0,r=0,i=0;else{var a=this.internal.rxRgb.exec(t);null!=a?(e=parseInt(a[1]),n=parseInt(a[2]),r=parseInt(a[3]),i=1):(a=this.internal.rxRgba.exec(t),null!=a?(e=parseInt(a[1]),n=parseInt(a[2]),r=parseInt(a[3]),i=parseFloat(a[4])):(i=1,"#"!=t.charAt(0)&&(t=o.colorNameToHex(t),t||(t="#000000")),4===t.length?(e=t.substring(1,2),e+=e,n=t.substring(2,3),n+=n,r=t.substring(3,4),r+=r):(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7)),e=parseInt(e,16),n=parseInt(n,16),r=parseInt(r,16)))}this.ctx.fillStyle=t,this.ctx._isFillTransparent=0==i,this.ctx._fillOpacity=i,this.pdf.setFillColor(e,n,r,{a:i}),this.pdf.setTextColor(e,n,r,{a:i})},setStrokeStyle:function(t){var e=this._getRgba(t);this.ctx.strokeStyle=e.style,this.ctx._isStrokeTransparent=0==e.a,this.ctx._strokeOpacity=e.a,0===e.a?this.pdf.setDrawColor(255,255,255):1===e.a?this.pdf.setDrawColor(e.r,e.g,e.b):this.pdf.setDrawColor(e.r,e.g,e.b)},fillText:function(t,e,n,r){if(!this._isFillTransparent()){e=this._wrapX(e),n=this._wrapY(n);var i=this._matrix_map_point(this.ctx._transform,[e,n]);e=i[0],n=i[1];var o=this._matrix_rotation(this.ctx._transform),a=57.2958*o;if(this.ctx._clip_path.length>0){var s;s=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage(),s.push("q");var c=this.path;this.path=this.ctx._clip_path,this.ctx._clip_path=[],this._fill(null,!0),this.ctx._clip_path=this.path,this.path=c}var l;if(l=this.pdf.hotfix&&this.pdf.hotfix.scale_text?this._getTransform()[0]:1,l<.01)this.pdf.text(t,e,this._getBaseline(n),null,a);else{var u=this.pdf.internal.getFontSize();this.pdf.setFontSize(u*l),this.pdf.text(t,e,this._getBaseline(n),null,a),this.pdf.setFontSize(u)}this.ctx._clip_path.length>0&&s.push("Q")}},strokeText:function(t,e,n,r){if(!this._isStrokeTransparent()){e=this._wrapX(e),n=this._wrapY(n);var i=this._matrix_map_point(this.ctx._transform,[e,n]);e=i[0],n=i[1];var o=this._matrix_rotation(this.ctx._transform),a=57.2958*o;if(this.ctx._clip_path.length>0){var s;s=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage(),s.push("q");var c=this.path;this.path=this.ctx._clip_path,this.ctx._clip_path=[],this._fill(null,!0),this.ctx._clip_path=this.path,this.path=c}var l;if(l=this.pdf.hotfix&&this.pdf.hotfix.scale_text?this._getTransform()[0]:1,1===l)this.pdf.text(t,e,this._getBaseline(n),{stroke:!0},a);else{var u=this.pdf.internal.getFontSize();this.pdf.setFontSize(u*l),this.pdf.text(t,e,this._getBaseline(n),{stroke:!0},a),this.pdf.setFontSize(u)}this.ctx._clip_path.length>0&&s.push("Q")}},setFont:function(t){this.ctx.font=t;var e=/\s*(\w+)\s+(\w+)\s+(\w+)\s+([\d\.]+)(px|pt|em)\s+(.*)?/;if(h=e.exec(t),null!=h){var n=h[1],r=(h[2],h[3]),i=h[4],o=h[5],a=h[6];i="px"===o?Math.floor(parseFloat(i)):"em"===o?Math.floor(parseFloat(i)*this.pdf.getFontSize()):Math.floor(parseFloat(i)),this.pdf.setFontSize(i),"bold"===r||"700"===r?this.pdf.setFontStyle("bold"):"italic"===n?this.pdf.setFontStyle("italic"):this.pdf.setFontStyle("normal");var s,c=a,l=c.toLowerCase().split(/\s*,\s*/);s=l.indexOf("arial")!=-1?"Arial":l.indexOf("verdana")!=-1?"Verdana":l.indexOf("helvetica")!=-1?"Helvetica":l.indexOf("sans-serif")!=-1?"sans-serif":l.indexOf("fixed")!=-1?"Fixed":l.indexOf("monospace")!=-1?"Monospace":l.indexOf("terminal")!=-1?"Terminal":l.indexOf("courier")!=-1?"Courier":l.indexOf("times")!=-1?"Times":l.indexOf("cursive")!=-1?"Cursive":l.indexOf("fantasy")!=-1?"Fantasy":(l.indexOf("serif")!=-1,"Serif");var u;u="bold"===r?"bold":"normal",this.pdf.setFont(s,u)}else{var e=/(\d+)(pt|px|em)\s+(\w+)\s*(\w+)?/,h=e.exec(t);if(null!=h){var f=h[1],c=(h[2],h[3]),u=h[4];u||(u="normal"),f="em"===o?Math.floor(parseFloat(i)*this.pdf.getFontSize()):Math.floor(parseFloat(f)),this.pdf.setFontSize(f),this.pdf.setFont(c,u)}}},setTextBaseline:function(t){this.ctx.textBaseline=t},getTextBaseline:function(){return this.ctx.textBaseline},setTextAlign:function(t){this.ctx.textAlign=t},getTextAlign:function(){return this.ctx.textAlign},setLineWidth:function(t){this.ctx.lineWidth=t,this.pdf.setLineWidth(t)},setLineCap:function(t){this.ctx.lineCap=t,this.pdf.setLineCap(t)},setLineJoin:function(t){this.ctx.lineJoin=t,this.pdf.setLineJoin(t)},moveTo:function(t,e){t=this._wrapX(t),e=this._wrapY(e);var n=this._matrix_map_point(this.ctx._transform,[t,e]);t=n[0],e=n[1];var r={type:"mt",x:t,y:e};this.path.push(r)},_wrapX:function(t){return this.pageWrapXEnabled?t%this.pageWrapX:t},_wrapY:function(t){return this.pageWrapYEnabled?(this._gotoPage(this._page(t)),(t-this.lastBreak)%this.pageWrapY):t},transform:function(t,e,n,r,i,o){this.ctx._transform=[t,e,n,r,i,o]},setTransform:function(t,e,n,r,i,o){this.ctx._transform=[t,e,n,r,i,o]},_getTransform:function(){return this.ctx._transform},lastBreak:0,pageBreaks:[],_page:function(t){if(this.pageWrapYEnabled){this.lastBreak=0;for(var e=0,n=0,r=0;r=this.pageBreaks[r]){e++,0===this.lastBreak&&n++;var i=this.pageBreaks[r]-this.lastBreak;this.lastBreak=this.pageBreaks[r];var o=Math.floor(i/this.pageWrapY);n+=o}if(0===this.lastBreak){var o=Math.floor(t/this.pageWrapY)+1;n+=o}return n+e}return this.pdf.internal.getCurrentPageInfo().pageNumber},_gotoPage:function(t){},lineTo:function(t,e){t=this._wrapX(t),e=this._wrapY(e);var n=this._matrix_map_point(this.ctx._transform,[t,e]);t=n[0],e=n[1];var r={type:"lt",x:t,y:e};this.path.push(r)},bezierCurveTo:function(t,e,n,r,i,o){t=this._wrapX(t),e=this._wrapY(e),n=this._wrapX(n),r=this._wrapY(r),i=this._wrapX(i),o=this._wrapY(o);var a;a=this._matrix_map_point(this.ctx._transform,[i,o]),i=a[0],o=a[1],a=this._matrix_map_point(this.ctx._transform,[t,e]),t=a[0],e=a[1],a=this._matrix_map_point(this.ctx._transform,[n,r]),n=a[0],r=a[1];var s={type:"bct",x1:t,y1:e,x2:n,y2:r,x:i,y:o};this.path.push(s)},quadraticCurveTo:function(t,e,n,r){t=this._wrapX(t),e=this._wrapY(e),n=this._wrapX(n),r=this._wrapY(r);var i;i=this._matrix_map_point(this.ctx._transform,[n,r]),n=i[0],r=i[1],i=this._matrix_map_point(this.ctx._transform,[t,e]),t=i[0],e=i[1];var o={type:"qct",x1:t,y1:e,x:n,y:r};this.path.push(o)},arc:function(t,e,n,r,i,o){if(t=this._wrapX(t),e=this._wrapY(e),!this._matrix_is_identity(this.ctx._transform)){var a=this._matrix_map_point(this.ctx._transform,[t,e]);t=a[0],e=a[1];var s=this._matrix_map_point(this.ctx._transform,[0,0]),c=this._matrix_map_point(this.ctx._transform,[0,n]);n=Math.sqrt(Math.pow(c[0]-s[0],2)+Math.pow(c[1]-s[1],2))}var l={type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,anticlockwise:o};this.path.push(l)},drawImage:function(t,e,n,r,i,o,a,s,c){void 0!==o&&(e=o,n=a,r=s,i=c),e=this._wrapX(e),n=this._wrapY(n);var l,u=this._matrix_map_rect(this.ctx._transform,{x:e,y:n,w:r,h:i}),h=(this._matrix_map_rect(this.ctx._transform,{x:o,y:a,w:s,h:c}),/data:image\/(\w+).*/i),f=h.exec(t);l=null!=f?f[1]:"png",this.pdf.addImage(t,l,u.x,u.y,u.w,u.h)},_matrix_multiply:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=n*t[0]+r*t[2],l=i*t[0]+o*t[2],u=a*t[0]+s*t[2]+t[4];return r=n*t[1]+r*t[3],o=i*t[1]+o*t[3],s=a*t[1]+s*t[3]+t[5],n=c,i=l,a=u,[n,r,i,o,a,s]},_matrix_rotation:function(t){return Math.atan2(t[2],t[0])},_matrix_decompose:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=Math.sqrt(e*e+n*n);e/=o,n/=o;var a=e*r+n*i;r-=e*a,i-=n*a;var s=Math.sqrt(r*r+i*i);return r/=s,i/=s,a/=s,e*i0){var t;t=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage(),t.push("q");var e=this.path;this.path=this.ctx._clip_path,this.ctx._clip_path=[],this._stroke(!0),this.ctx._clip_path=this.path,this.path=e,this._stroke(!1),t.push("Q")}else this._stroke(!1)},_stroke:function(t){if(t||!this._isStrokeTransparent()){for(var e=[],n=!1,r=this.path,i=0;i0){var e;e=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage(),e.push("q");var n=this.path;this.path=this.ctx._clip_path,this.ctx._clip_path=[],this._fill(t,!0),this.ctx._clip_path=this.path,this.path=n,this._fill(t,!1),e.push("Q")}else this._fill(t,!1)},_fill:function(t,e){if(!this._isFillTransparent()){var r,i="function"==typeof this.pdf.internal.newObject2;r=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage();var o=[],a=window.outIntercept;if(i)switch(this.ctx.globalCompositeOperation){case"normal":case"source-over":break;case"destination-in":case"destination-out":var s=this.pdf.internal.newStreamObject(),c=this.pdf.internal.newObject2();c.push("<>"),c.push(">>");var l="MASK"+c.objId;this.pdf.internal.addGraphicsState(l,c.objId);var u="/"+l+" gs";r.splice(0,0,"q"),r.splice(1,0,u),r.push("Q"),window.outIntercept=s;break;default:var h="/"+this.pdf.internal.blendModeMap[this.ctx.globalCompositeOperation.toUpperCase()];h&&this.pdf.internal.out(h+" gs")}var f=this.ctx.globalAlpha;if(this.ctx._fillOpacity<1&&(f=this.ctx._fillOpacity),i){var d=this.pdf.internal.newObject2();d.push("<>");var l="GS_O_"+d.objId;this.pdf.internal.addGraphicsState(l,d.objId),this.pdf.internal.out("/"+l+" gs")}for(var p=this.path,g=0;g>"),n.push(">>");var r="MASK"+n.objId;this.pdf.internal.addGraphicsState(r,n.objId);var i="/"+r+" gs";this.pdf.internal.out(i)},clip:function(){if(this.ctx._clip_path.length>0)for(var t=0;to)&&(s%=o),s<0&&(s=o+s);e>n;)e-=o;var c=Math.abs(n-e);ci;){var f=u*Math.min(c,a),d=h+f;l.push(this.createSmallArc(t,h,d)),c-=Math.abs(d-h),h=d}return l},n.internal.getCurrentPage=function(){return this.pdf.internal.pages[this.pdf.internal.getCurrentPageInfo().pageNumber]},n.internal.createSmallArc=function(t,e,n){var r=(n-e)/2,i=t*Math.cos(r),o=t*Math.sin(r),a=i,s=-o,c=a*a+s*s,l=c+a*i+s*o,u=4/3*(Math.sqrt(2*c*l)-l)/(a*o-s*i),h=a-u*s,f=s+u*a,d=h,p=-f,g=r+e,m=Math.cos(g),w=Math.sin(g);return{x1:t*Math.cos(e),y1:t*Math.sin(e),x2:h*m-f*w,y2:h*w+f*m,x3:d*m-p*w,y3:d*w+p*m,x4:t*Math.cos(n),y4:t*Math.sin(n)}},this}(e.API),/** @preserve - * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser - * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com - * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria - * 2014 Diego Casorran, https://github.com/diegocr - * 2014 Daniel Husar, https://github.com/danielhusar - * 2014 Wolfgang Gassler, https://github.com/woolfg - * 2014 Steven Spungin, https://github.com/flamenco - * - * - * ==================================================================== - */ -function(e){var n,r,i,a,s,c,l,u,h,f,d,p,g,m,w,y,v,b,x,k;n=function(){function t(){}return function(e){return t.prototype=e,new t}}(),f=function(t){var e,n,r,i,o,a,s;for(n=0,r=t.length,e=void 0,i=!1,a=!1;!i&&n!==r;)e=t[n]=t[n].trimLeft(),e&&(i=!0),n++;for(n=r-1;r&&!a&&n!==-1;)e=t[n]=t[n].trimRight(),e&&(a=!0),n--;for(o=/\s+$/g,s=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),s&&(e=e.trimLeft()),e&&(s=o.test(e)),t[n]=e),n++;return t},d=function(t,e,n,r){return this.pdf=t,this.x=e,this.y=n,this.settings=r,this.watchFunctions=[],this.init(),this},p=function(t){var e,n,r;for(e=void 0,r=t.split(","),n=r.shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},g=function(t){t="auto"===t?"0px":t,t.indexOf("em")>-1&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),t.indexOf("pt")>-1&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px");var e,n,r;return n=void 0,e=16,(r=m[t])?r:(r={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[{css_line_height_string:t}],r!==n?m[t]=r/e:(r=parseFloat(t))?m[t]=r/e:(r=t.match(/([\d\.]+)(px)/),3===r.length?m[t]=parseFloat(r[1])/e:m[t]=1))},h=function(t){var e,n,r;return r=function(t){var e;return e=function(t){return document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(t,null):t.currentStyle?t.currentStyle:t.style}(t),function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}),e[t]}}(t),e={},n=void 0,e["font-family"]=p(r("font-family"))||"times",e["font-style"]=a[r("font-style")]||"normal",e["text-align"]=s[r("text-align")]||"left",n=c[r("font-weight")]||"normal","bold"===n&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]),e["font-size"]=g(r("font-size"))||1,e["line-height"]=g(r("line-height"))||1,e.display="inline"===r("display")?"inline":"block",n="block"===e.display,e["margin-top"]=n&&g(r("margin-top"))||0,e["margin-bottom"]=n&&g(r("margin-bottom"))||0,e["padding-top"]=n&&g(r("padding-top"))||0,e["padding-bottom"]=n&&g(r("padding-bottom"))||0,e["margin-left"]=n&&g(r("margin-left"))||0,e["margin-right"]=n&&g(r("margin-right"))||0,e["padding-left"]=n&&g(r("padding-left"))||0,e["padding-right"]=n&&g(r("padding-right"))||0,e["page-break-before"]=r("page-break-before")||"auto",e.float=l[r("cssFloat")]||"none",e.clear=u[r("clear")]||"none",e.color=r("color"),e},w=function(t,e,n){var r,i,o,a,s;if(o=!1,i=void 0,a=void 0,s=void 0,r=n["#"+t.id])if("function"==typeof r)o=r(t,e);else for(i=0,a=r.length;!o&&i!==a;)o=r[i](t,e),i++;if(r=n[t.nodeName],!o&&r)if("function"==typeof r)o=r(t,e);else for(i=0,a=r.length;!o&&i!==a;)o=r[i](t,e),i++;return o},k=function(t,e){var n,r,i,o,a,s,c,l,u,h;for(n=[],r=[],i=0,h=t.rows[0].cells.length,l=t.clientWidth;ii.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(a));var I=h(a),E=i.x,O=12/i.pdf.internal.scaleFactor,F=(I["margin-left"]+I["padding-left"])*O,R=(I["margin-right"]+I["padding-right"])*O,B=(I["margin-top"]+I["padding-top"])*O,D=(I["margin-bottom"]+I["padding-bottom"])*O;E+=void 0!==I.float&&"right"===I.float?i.settings.width-a.width-R:F,i.pdf.addImage(T,E,i.y+B,a.width,a.height),T=void 0,"right"===I.float||"left"===I.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!_[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,"left"===I.float?-a.width-F-R:0,i.y+a.height+B+D,a.width)),i.watchFunctions.push(function(t,e,n){return!(i.y0){i=i[0];var o=e.pdf.internal.write,a=e.y;e.pdf.internal.write=function(){},r(i,e,n);var s=Math.ceil(e.y-a)+5;e.y=a,e.pdf.internal.write=o,e.pdf.margins_doc.bottom+=s;for(var c=function(t){var o=void 0!==t?t.pageNumber:1,a=e.y;e.y=e.pdf.internal.pageSize.height-e.pdf.margins_doc.bottom,e.pdf.margins_doc.bottom-=s;for(var c=i.getElementsByTagName("span"),l=0;l-1&&(c[l].innerHTML=o),(" "+c[l].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&(c[l].innerHTML="###jsPDFVarTotalPages###");r(i,e,n),e.pdf.margins_doc.bottom+=s,e.y=a},l=i.getElementsByTagName("span"),u=0;u-1&&e.pdf.internal.events.subscribe("htmlRenderingFinished",e.pdf.putTotalPages.bind(e.pdf,"###jsPDFVarTotalPages###"),!0);e.pdf.internal.events.subscribe("addPage",c,!1),c(),_.FOOTER=1}},x=function(t,e,n,i,o,a){if(!e)return!1;"string"==typeof e||e.parentNode||(e=""+e.innerHTML),"string"==typeof e&&(e=function(t){var e,n,r,i;return r="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),i="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",n=document.createElement("div"),n.style.cssText=i,n.innerHTML='