commit 05f12f41875aadeca51dfbde033b5d665730579d Author: 编码猿 Date: Fri Sep 27 00:54:11 2024 +0800 first commit diff --git a/.babelrc b/.babelrc new file mode 100755 index 0000000..b5d936f --- /dev/null +++ b/.babelrc @@ -0,0 +1,12 @@ +{ + "presets": [ + [ + "latest", { + "es2015": { + "modules": false, + } + } + ] + ], + "plugins": ["@babel/plugin-transform-runtime"] +} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..996fd03 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +node_modules/ +package-lock.json +yarn.lock +yarn-error.log +.vscode/ +.DS_Store +.cache/ +src/resources/view/admin/node_modules/ +src/resources/view/admin/.cache/ +src/resources/view/admin/dist/ + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr diff --git a/.pydio b/.pydio new file mode 100644 index 0000000..cf05675 --- /dev/null +++ b/.pydio @@ -0,0 +1 @@ +6bf60131-3afe-4864-b82e-73e3793c1e3b \ No newline at end of file diff --git a/README.md b/README.md new file mode 100755 index 0000000..093069a --- /dev/null +++ b/README.md @@ -0,0 +1,233 @@ +## 1:项目说明 + +这是一套基于`Nodejs` + `koa2` + `Typescript` + `Routing-controllers` 纯手工搭建的项目基本框架,可以直接用在`传统网站`+`管理后台`的项目开发中。 + +就算你不会`php`,不会`java`也能够让前端的你无缝的对接和使用,独立开发网站不再是梦... + +本项目中已经集成了: + +- 1:`koa-log4`实现系统日志(程序日志access,运行日志application),日志放在`logs`文件夹中,当然你也可以在`/src/config`中指定日志输入路径。 + +- 2:基于`ApiDoc`实现接口帮助文档,可在方法上使用注释的方式生成接口文档,运行命令:`npm run doc` 生成文档。 + +- 3:接口测试,主要在`rest/`文件夹中,使用`*.http`进行接口调试。 + +- 4:实现`k-init cli`可以直接通过命令创建各种文件。 + +- 5:`Pm2` 实现负载均衡,上线部署使用命令:`npm run online`。 + +- 6:`七牛云` 实现资源文件的上传和存储,案例请看:[前端demo.vue](https://gitee.com/bmycode/VRofficialWebsite/blob/master/src/resources/view/admin/src/view/template/demo.vue),后端:[AdminController.ts](https://gitee.com/bmycode/VRofficialWebsite/blob/master/src/controller/admin/AdminController.ts)。 + +- 7:~~集成`支付宝支付`功能,可以直接配置然后使用(PS:支付涉及很多核心参数配置,所以该功能被删除,如需要请QQ私聊)~~。 + +- 8:基于`Java`开发的思想,设计`service层`,`dao层`,`entity层`,`model层`等,当然在`Node.js`中使用略有差异,不影响。 + +- 9:基于还未正式发布的`Vue-next` + `Element` 实现管理后台页面,管理后台已实现登录权限控制等。 + +- 10:`PC`端的前端主要使用`require.js`实现`js`模块化,`less`+`jade`实现`Css`样式和`Html`。 + +- 11:数据库基于`Mysql`,数据库操作使用`Node ORM`:`typeorm`,如果不熟悉`Mysql`又不想去学习,那么可以自己集成第三方后端云数据库,减少数据库相关的学习和开发成本。 + +- 12:~~基于新的打包工具`parcel`对管理后台的`vue`页面进行打包,后面会重新改造为`Vue3`作为项目管理后台~~ + +- 13:基于`gulp`完成对`PC`前端`less`的编译和静态资源的复制等。 + + + +## 2:技术栈 + +--- + +- 1: TypeScript +- 2: Koa2.js(全家桶) +- 3: jade + less +- 4: GraphQL +- 5: TypeOrm +- 6: TypeDi +- 7: class-validator +- 8: Gulp +- 9: Routing-controllers +- 10: Require.js +- 11: Vue.js(全家桶) & TypeScript +- 12: Node.js +- 13: Parcel +- 14:Nginx 负载均衡 +- 15: Docker +- 16: Mysql,主从读写分离 +- 17: Bmob 在线后端云 +- 18: 七牛视频云存储方案 +- 19: 阿里云免费 https 证书 +- 21: SpringBoot 微服务全家桶技术 +- ... 此处省略一万字 + + +## 3:k-init cli 使用帮助 + +参考`PHP`的框架`Laravel`提供的命令`artisan`实现终端创建项目中各种文件的功能,解决新增页面需要手工创建一大堆文件的麻烦!! + +命令: + +```bash +$ ./bin/kinit -h + +Usage: kinit [options] + +Options: + -t, --file-type 文件类型: [controller,dao,entity,model,service,impl,jade,less,js] + -n, --file-name 被创建的文件名称 + -p, --file-path 为 -t 参数指定 controller 文件夹名 + -i, --is-create 是否为 -t 参数自动创建相关文件类型 (default: false) + -v, --version 显示当前的版本 + -h, --help display help for command +``` + +### 例子 1: + +比如现在需要在`src/controller/api`下单独创建接口,那么可以使用命令: + +```bash +$ ./bin/kinit -t controller -p api -n Test +``` + +参数说明: + +- `-t controller`:表示创建的文件类型为`controller` +- `-p api`:表示需要在`src/controller/`文件夹的`api/`文件夹下创建文件,因为`controller`里面有三个文件夹,所以需要指定文件夹名称 +- `-n Test`:表示创建的文件名称是`Test` + +### 例子 2: + +现在我需要新增一个`PC`官网前台页面,比如**详情页(Info)**,那么按照先前传统的过程我们需要手工去创建:`controller`,`dao`,`entity`,`model`,`service`,`impl`,`jade`,`less`,`js`等一堆文件!真的很烦,而且还要在这么多的文件中写入测试代码,更烦!! + +这种需求很常见,但是现在不必忍受,因为你可以使用命令来自动化创建所有文件,文件中包含实例代码: + +```bash +$ ./bin/kinit -t controller -p home -n Info -i true +``` + +参数说明(其他参数和上面一样): + +- `-i true`:表示是否需要为`Info`自动创建其他更多的各种文件,需要:`true`,不需要:`false` 或者 不写参数`-i`即可。 + +### 例子 3: + +创建其他类型的文件,命令都一样。例如: + +```bash +$ ./bin/kinit -t entity -n Test # 创建 TestEntity 数据库实体 +$ ./bin/kinit -t model -n Test # 创建 TestModel 这里主要做数据校验的功能 +$ ./bin/kinit -t dao -n Test # 创建 TestDao 数据库操作层 +$ ./bin/kinit -t service -n Test # 创建 TestService Service层 +$ ./bin/kinit -t impl -n Test # 创建 TestServiceImpl Service实现层 +$ ./bin/kinit -t jade -n Test # 创建 Test.jade 静态页面View层 +$ ./bin/kinit -t js -n Test # 创建 Test.js 静态页面的js逻辑 +$ ./bin/kinit -t less -n Test # 创建 Test.less 静态页面的css样式 +``` + +## 4:插件 routing-controllers 的坑 + +- Bug: 使用注解 `@Render` 渲染模板后,第二次访问其他页面但是展示效果还是上次的页面,页面不进行渲染 + +- 路径:`node_modules/routing-controllers/driver/koa/KoaDriver.js` +- 行数:`250`行 + +解决: 删除下面代码: + +```js +// 保留,不要修改 +var renderOptions_1 = result && result instanceof Object ? result : {}; + +// 开始 - 下面的都删除 +this.koa.use(function (ctx, next) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ctx.render(action.renderedTemplate, renderOptions_1)]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +}); +// 结束 - 上面的都删除 +```` + +删除后,使用使用下面代码替换: + + ```js + return options.response.render(action.renderedTemplate, renderOptions_1); + ``` + +最后改好的的样子如下: + +```js +var renderOptions_1 = result && result instanceof Object ? result : {}; +return options.response.render(action.renderedTemplate, renderOptions_1); +``` + +- Github 问题反馈地址:[https://github.com/../434](https://github.com/typestack/routing-controllers/pull/434) + +- Github 修复分支记录:[https://github.com/types..](https://github.com/typestack/routing-controllers/pull/434/files/001b45a416e3f1dbde33e7e91fadb09111d4061d) + + + +├── README.md 项目帮助文档 +├── apidoc.json 插件apidoc的配置文件 +├── bin 自己实现的终端命令行,用于生成各种文件 +├── dist 正式环境下打包上线部署用的 +├── doc 基于apidoc自动扫包生成的接口帮助文档 +├── gulpfile.js gulp自动化的代码 +├── logs 程序日志文件 +├── md apidoc文档的公共部分页面 +├── package.json 项目核心依赖配置文件 +├── rest 接口 *.http 测试文件 +├── src 存放项目核心源码 +│ ├── config 站点配置文件,分为开发阶段配置文件,和 正式环境配置文件 +│ ├── controller 网站的核心控制器 +│ │ ├── admin 管理后台控制器 +│ │ ├── api 接口控制器 +│ │ └── home 官网前端控制器 +│ ├── dao 操作实体entity前的orm封装 +│ ├── entity 数据库实体,和mysql中具体的表建立关联,实现查询 +│ ├── index.ts 项目核心入口文件 +│ ├── middleware 项目中间件,主要放在装饰在controller上做一些登录检查,json数据格式化日志记录等等 +│ ├── model 主要用来自动校验api接口的参数是否符合model中的要求,比如ajax参数缺失,类型不对等! +│ ├── plugins 第三方插件,例如七牛云,阿里云,支付宝,微信支付等,需要在这里重写第三方sdk实现封装 +│ ├── resources 存放页面字体图标等静态资源 +│ │ ├── static +│ │ │ ├── css gulp编译less文件夹源码,自动生成的文件夹,存放这编译后的官网前端,管理后台的css +│ │ │ ├── fonts 分别存放官网前端,管理后台的fonts +│ │ │ ├── img 分别存放官网前端,管理后台的img +│ │ │ ├── js 存放官网前端的js,使用require.js 实现模块化 +│ │ │ ├── less css的真正源码 +│ │ │ └── plugins 第三方插件 +│ │ └── view 网站的页面视图层 +│ │ ├── admin 基于vue ClassApi 语法的管理后台,主要Typescript实现 +│ │ │ ├── dist 管理后台打包后用于上线的,这个文件会被gulp自动复制到/dist/中 +│ │ │ ├── index.html 管理后台的根html +│ │ │ ├── src 管理后台的源码 +│ │ │ │ ├── App.vue 核心根组件 +│ │ │ │ ├── api axios api接口的封装 +│ │ │ │ ├── assets 静态资源 +│ │ │ │ ├── config 站点配置 +│ │ │ │ ├── index.ts 启动文件 +│ │ │ │ ├── public 公共资源,不会被parcel打包的 +│ │ │ │ ├── run 核心启动文件,主要实例化vue和装载各种插件 +│ │ │ │ ├── store vuex全局状态管理 +│ │ │ │ ├── utils 公共方法 +│ │ │ │ ├── view 存放管理后台的*.vue文件 +│ │ │ └── tsconfig.json typescript 配置文件 +│ │ └── home 官网前端页面 +│ │ ├── layout.jade 公共父布局页面 +│ │ ├── page 官网前端具体的每个页面 +│ │ └── public 官网前端公共模板 +│ ├── run 整个项目的核心启动文件 +│ │ ├── app.ts 继承ini.ts,负责启动init.ts配置好的koa对象 +│ │ └── init.ts 装配koa对象,实现各种配置,看源码 +│ ├── service 接口请求的service层,主要依赖注入后调用dao层 +│ │ ├── UserService.ts 实现impl中的接口,实现具体逻辑 +│ │ └── impl 规范service代码的接口 +│ └── utils +├── test 项目一些实验性demo的测试文件,比如测试支付宝支付 +├── tsconfig.json 整个项目的typescript配置文件 \ No newline at end of file diff --git a/apidoc.json b/apidoc.json new file mode 100755 index 0000000..45c7aa6 --- /dev/null +++ b/apidoc.json @@ -0,0 +1,15 @@ +{ + "name": "怪客课堂", + "version": "1.1.0", + "description": "怪客课堂,基于Nodejs + Koa2 + TypeScript 构建的网站", + "title": "怪客课堂", + "url" : "http://www. geekhelp.cn/bmy/api", + "header": { + "title": "My own header title", + "filename": "./md/header.md" + }, + "footer": { + "title": "My own footer title", + "filename": "./md/footer.md" + } +} \ No newline at end of file diff --git a/bin/.pydio b/bin/.pydio new file mode 100644 index 0000000..478bed4 --- /dev/null +++ b/bin/.pydio @@ -0,0 +1 @@ +a295b73d-da90-4c93-9a60-86b6ef15a2b9 \ No newline at end of file diff --git a/bin/FileTpl/.pydio b/bin/FileTpl/.pydio new file mode 100644 index 0000000..cf2a999 --- /dev/null +++ b/bin/FileTpl/.pydio @@ -0,0 +1 @@ +aaea7bf8-ca33-4943-982b-b06379a36042 \ No newline at end of file diff --git a/bin/FileTpl/conterller.txt b/bin/FileTpl/conterller.txt new file mode 100644 index 0000000..a6144f7 --- /dev/null +++ b/bin/FileTpl/conterller.txt @@ -0,0 +1,9 @@ +import {Controller, Render, Get, UseBefore, Session} from "routing-controllers"; +import { utils } from "../../utils/utils"; +import { Service, Inject } from "typedi"; + +@Service() +@Controller() +export class ControllerName { + +} \ No newline at end of file diff --git a/bin/FileTpl/dao.txt b/bin/FileTpl/dao.txt new file mode 100644 index 0000000..67e9658 --- /dev/null +++ b/bin/FileTpl/dao.txt @@ -0,0 +1,7 @@ +import { Service , Inject } from "typedi"; +import { getRepository } from "typeorm"; + +@Service() +export class DaoName { + +} \ No newline at end of file diff --git a/bin/FileTpl/entity.txt b/bin/FileTpl/entity.txt new file mode 100644 index 0000000..b82d417 --- /dev/null +++ b/bin/FileTpl/entity.txt @@ -0,0 +1,9 @@ +import {Entity, PrimaryGeneratedColumn, Column} from "typeorm"; + +@Entity("user") +export class EntityName { + + @PrimaryGeneratedColumn() + user_id: number; + +} \ No newline at end of file diff --git a/bin/FileTpl/impl.txt b/bin/FileTpl/impl.txt new file mode 100644 index 0000000..b7e4706 --- /dev/null +++ b/bin/FileTpl/impl.txt @@ -0,0 +1,14 @@ +import { UserService } from "../UserService"; +import { Service, Inject } from "typedi"; +import { UserDao } from "../../dao/UserDao"; + +@Service() +export class ImplName implements ServiceName { + + @Inject() + private userDao: UserDao; + + public async getAllUserService(): Promise { + return await this.userDao.AllUser(); + } +} \ No newline at end of file diff --git a/bin/FileTpl/jade.txt b/bin/FileTpl/jade.txt new file mode 100644 index 0000000..0b7e158 --- /dev/null +++ b/bin/FileTpl/jade.txt @@ -0,0 +1,10 @@ +extends ./../layout + +block title + + meta(name="description" content="关于我们,企业联系,课程咨询,问题答疑") + meta(name="keywords" content="编码猿,关于我们,怪客学堂") + +block content + .about(class="pages JadeName" data-module="JadeName") + .container 测试 \ No newline at end of file diff --git a/bin/FileTpl/js.txt b/bin/FileTpl/js.txt new file mode 100644 index 0000000..77a5a23 --- /dev/null +++ b/bin/FileTpl/js.txt @@ -0,0 +1,12 @@ +define(['jquery','utils'],function ($,utils) { + function JsName() { + + } + + JsName.prototype = { + init () { + } + }; + + return new JsName(); +}); \ No newline at end of file diff --git a/bin/FileTpl/less.txt b/bin/FileTpl/less.txt new file mode 100644 index 0000000..f585359 --- /dev/null +++ b/bin/FileTpl/less.txt @@ -0,0 +1,3 @@ +.ClassName { + color: red; +} \ No newline at end of file diff --git a/bin/FileTpl/model.txt b/bin/FileTpl/model.txt new file mode 100644 index 0000000..131c9c4 --- /dev/null +++ b/bin/FileTpl/model.txt @@ -0,0 +1,8 @@ +import { MinLength,IsInt, MaxLength,Allow,Validate } from 'class-validator'; + +export class ModelName { + @MinLength(1,{ + message: 'id参数必须有' + }) + id: string; +} \ No newline at end of file diff --git a/bin/FileTpl/service.txt b/bin/FileTpl/service.txt new file mode 100644 index 0000000..6cdf12c --- /dev/null +++ b/bin/FileTpl/service.txt @@ -0,0 +1,3 @@ +export interface ServiceName { + getOneUserService(id: string) : Promise; +} \ No newline at end of file diff --git a/bin/kinit b/bin/kinit new file mode 100755 index 0000000..3dc7430 --- /dev/null +++ b/bin/kinit @@ -0,0 +1,177 @@ +#!/usr/bin/env node +const { program } = require('commander'); +const package = require("../package"); +const fs = require("fs"); +const path = require('path'); + +program +.requiredOption('-t, --file-type ', '文件类型: [controller,dao,entity,model,service,impl,jade,less,js]') +.option('-n, --file-name ', '被创建的文件名称') +.option('-p, --file-path ', '为 -t 参数指定 controller 文件夹名') +.option('-i, --is-create ', '是否为 -t 参数自动创建相关文件类型', false); +program.version(package.version, '-v, --version', '显示当前的版本'); + +program.parse(process.argv); + +// 存储终端的参数 +const programOptions = program.opts(); + +/** + * TODO 如果在Api或者Admnin文件夹下创建controller,那么也可以为他们关联创建更多的文件类型 + * @type {string} + */ + +// 各个文件路径 +let DaoPath = pathJoin(`../src/dao/${programOptions.fileName}Dao.ts`); +let EntityPath = pathJoin(`../src/entity/${programOptions.fileName}Entity.ts`); +let ModelPath = pathJoin(`../src/model/${programOptions.fileName}Model.ts`); +let ServicePath = pathJoin(`../src/service/${programOptions.fileName}Service.ts`); +let ServiceImplPath = pathJoin(`../src/service/impl/${programOptions.fileName}ServiceImpl.ts`); +let JadePath = pathJoin(`../src/resources/view/home/page/${programOptions.fileName}.jade`); +let LessPath = pathJoin(`../src/resources/static/less/home/${programOptions.fileName}.less`); +let JsPath = pathJoin(`../src/resources/static/js/app/${programOptions.fileName}.js`); +let ControllerPath = ""; + +// 判断是否创建 controller 并且 路径文件夹名是否不为空 +if (programOptions.fileType == 'controller' && (programOptions.filePath == 'home' || programOptions.filePath == 'api' || programOptions.filePath == 'admin') ) { + + // 存储controller路径 + ControllerPath = path.join(__dirname, `../src/controller/${programOptions.filePath}/${programOptions.fileName}Controller${UpperCase(programOptions.filePath)}.ts`); + + // 是否需要为 controller 联合创建所有文件 + if (programOptions.isCreate) { + + switch (programOptions.filePath) { + // 创建所有文件 + case 'home': + let FileList = ['controller','dao','entity','model','service','impl','jade','less','js']; + FileList.forEach(val => replaceTplText(val)); + console.log("成功创建所有文件..."); + break; + + // 只创建ts文件 + case 'api': + ['controller','dao','entity','model','service','impl'].forEach(val => replaceTplText(val)); + console.log("成功创建所有文件..."); + break; + + // 只创建ts文件 + case 'admin': + ['controller','dao','entity','model','service','impl'].forEach(val => replaceTplText(val)); + console.log("成功创建所有文件..."); + break; + + default: + + break + } + // 只创建 controller + } else { + + // 生成并写入模板内容 + replaceTplText('controller'); + console.log("controller创建成功...") + } +} +// 创建 dao +if (programOptions.fileType == 'dao') replaceTplText('dao'); +// 创建 entity +if (programOptions.fileType == 'entity') replaceTplText('entity'); +// 创建 model +if (programOptions.fileType == 'model') replaceTplText('model'); +// 创建 service +if (programOptions.fileType == 'service') replaceTplText('service'); +// 创建 impl +if (programOptions.fileType == 'impl') replaceTplText('impl'); +// 创建 jade +if (programOptions.fileType == 'jade') replaceTplText('jade'); +// 创建 less +if (programOptions.fileType == 'less') replaceTplText('less'); +// 创建 js +if (programOptions.fileType == 'js') replaceTplText('js'); + + +/** + * 替换模板的内容,并将内容写入文件。 + */ +function replaceTplText (action) { + switch (action) { + case 'controller': + let text = GetFileText('./FileTpl/conterller.txt').replace(/ControllerName/g, `${programOptions.fileName}Controller${UpperCase(programOptions.filePath)}`); + fs.writeFileSync(ControllerPath, text); + break; + + case 'dao': + let dao = GetFileText('./FileTpl/dao.txt').replace(/DaoName/g, `${UpperCase(programOptions.fileName)}Dao`); + fs.writeFileSync(DaoPath, dao); + break; + + case 'entity': + let entity = GetFileText('./FileTpl/entity.txt').replace(/EntityName/g, `${UpperCase(programOptions.fileName)}Entity`); + fs.writeFileSync(EntityPath, entity); + break; + + case 'model': + let model = GetFileText('./FileTpl/model.txt').replace(/ModelName/g, `${UpperCase(programOptions.fileName)}Model`); + fs.writeFileSync(ModelPath, model); + break; + + case 'service': + let service = GetFileText('./FileTpl/service.txt').replace(/ServiceName/g, `${UpperCase(programOptions.fileName)}Service`); + fs.writeFileSync(ServicePath, service); + break; + + case 'impl': + let impl = GetFileText('./FileTpl/impl.txt').replace(/ImplName/g, `${UpperCase(programOptions.fileName)}ServiceImpl`); + impl = impl.replace(/ServiceName/g, `${UpperCase(programOptions.fileName)}Service`); + fs.writeFileSync(ServiceImplPath, impl); + break; + + case 'jade': + let jade = GetFileText('./FileTpl/jade.txt').replace(/JadeName/g, programOptions.fileName); + fs.writeFileSync(JadePath, jade); + break; + + case 'less': + let less = GetFileText('./FileTpl/less.txt').replace(/ClassName/g, programOptions.fileName); + fs.writeFileSync(LessPath, less); + break; + + case 'js': + let js = GetFileText('./FileTpl/js.txt').replace(/JsName/g, programOptions.fileName); + fs.writeFileSync(JsPath, js); + break; + + default: + break + } +} + +/** + * 单词首字母大写 + * @param str + * @returns {void | string | *} + * @constructor + */ +function UpperCase (str) { + return str.replace(str[0],str[0].toUpperCase()) +} + +/** + * 读取文件内容 + * @param path + * @returns {*} + * @constructor + */ +function GetFileText (path) { + return (fs.readFileSync( pathJoin(path), 'utf-8' )).toString(); +} + +/** + * 拼接路径 + * @param paths + * @returns {string} + */ +function pathJoin (paths) { + return path.join(__dirname, paths) +} \ No newline at end of file diff --git a/dist/.pydio b/dist/.pydio new file mode 100644 index 0000000..40eb2e4 --- /dev/null +++ b/dist/.pydio @@ -0,0 +1 @@ +e9969a45-ca59-42c6-9172-d5bf34a034e3 \ No newline at end of file diff --git a/dist/config/.pydio b/dist/config/.pydio new file mode 100644 index 0000000..d757931 --- /dev/null +++ b/dist/config/.pydio @@ -0,0 +1 @@ +1fc79af0-ea3e-49ca-afaa-ba4de792022d \ No newline at end of file diff --git a/dist/config/dev.js b/dist/config/dev.js new file mode 100644 index 0000000..984a7cf --- /dev/null +++ b/dist/config/dev.js @@ -0,0 +1,104 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const path_1 = __importDefault(require("path")); +/** + * 开发阶段环境配置 + */ +exports.dev = { + // 程序默认运行端口 + port: 80, + // 绑定的域名 + host: "www.geekhelp.cn", + // api接口基地址,如果改这个了,请改管理后台的axios基地址配置 + apiurl: '/bmy/api', + // 初始化 koa2 插件需要的一些配置 + initPlugins: { + SessionKey: '4WM7mSy5S5kkxcE1I3', + staticPath: '../resources/static', + viewsPath: '../resources/view' // 页面视图存放路径 + }, + // 终端的欢迎信息 + banner: { + welcome: () => { + return ` + 👏 VR 产品介绍网站 👏 + + 👉 1:PC官网: http://${exports.dev.host}:${exports.dev.port}/ + 👉 2:Admin后台: http://${exports.dev.host}:3030/#/course/all + `; + } + }, + logConfig: { + appenders: { + //系统日志 + access: { + type: 'dateFile', + pattern: '_yyyy-MM-dd.log', + alwaysIncludePattern: true, + encoding: "utf-8", + category: "access", + filename: path_1.default.join(__dirname, '../../logs/access') + }, + // 应用日志 + application: { + type: 'dateFile', + pattern: '_yyyy-MM-dd.log', + alwaysIncludePattern: true, + encoding: "utf-8", + category: "application", + filename: path_1.default.join(__dirname, '../../logs/application') + }, + out: { + type: 'console' + } + }, + categories: { + default: { appenders: ['out'], level: 'info' }, + access: { appenders: ['access'], level: 'info' }, + application: { appenders: ['application'], level: 'WARN' } + } + }, + // 七牛的核心配置,不熟悉七牛请勿修改 + qiniu: { + // 七牛秘钥,七牛云管理后台获得,可以改成自己的 + accessKey: '0MGmT_rkMiaOeXY09B4EhBnXuDcIYyKlGumQ-zUt', + secretKey: '59dfmEi9Q50rMlz9sxTBCvYDhM7biERAjflBXALb', + // 视频切片的配置 + HLSconfig: { + // 被切片后视频存放的基路径,如果需要修改域名,请到域名管理后台 CNAME 泛解析域到七牛云 + // 然后再到七牛配置 泛子域名 将二级域名绑定到指定空间,这里 video.* 被绑定到 m3u8video 空间 + VideoBaseUrl: 'http://vsassets.geekhelp.cn/', + // 需要被切片的源视频所在七牛云的空间名 + FromBucket: 'vrcource', + // 视频被切片后存放的空间名 + ToBucket: 'm3u8video', + // 视频切片规则,参考七牛云官网文档来配置,或者在 多媒体队列 中复制切片参数 + VideoHlsParams: 'avthumb/m3u8/segtime/10/ab/128k/ar/44100/acodec/libfaac/r/30/vb/1000k/vcodec/libx264/stripmeta/0/noDomain/1|saveas/' + } + }, + // 网站浏览器标签卡的基础标题 + title: ' | 怪客课堂', + // 本地Mysql数据库配置 + typeorm: { + type: 'mysql', + host: "localhost", + charset: "utf8_general_ci", + port: 3306, + username: "root", + password: "lb714500", + database: "shop", + logging: "all", + synchronize: false, + logger: "advanced-console", + cache: { + duration: 30000 + }, + maxQueryExecutionTime: 1000, + entities: [ + `${path_1.default.join(__dirname, '../entity/*{.js,.ts}')}` + ] + } +}; diff --git a/dist/config/index.js b/dist/config/index.js new file mode 100644 index 0000000..f63fc7f --- /dev/null +++ b/dist/config/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// 开发环境配置 +const dev_1 = require("./dev"); +// 上线环境配置 +const prod_1 = require("./prod"); +exports.config = process.env.NODE_ENV == "dev" ? dev_1.dev : prod_1.prod; diff --git a/dist/config/prod.js b/dist/config/prod.js new file mode 100644 index 0000000..55ce234 --- /dev/null +++ b/dist/config/prod.js @@ -0,0 +1,87 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const path_1 = __importDefault(require("path")); +/** + * 上线阶段的环境配置 + */ +exports.prod = { + port: 9090, + host: "127.0.0.1", + apiurl: '/bmy/api', + uploadPath: '../resources/static/upload/', + initPlugins: { + SessionKey: '4WM7mSy5S5kkxcE1I3', + staticPath: '../resources/static', + viewsPath: '../resources/view' + }, + banner: { + welcome: () => { + return ` + 👏 VR 产品介绍网站 👏 + + 👉 1:PC官网: http://${exports.prod.host}:${exports.prod.port}/ + 👉 2:Admin后台: http://${exports.prod.host}:3030/#/course/all + `; + } + }, + logConfig: { + appenders: { + access: { + type: 'console', + pattern: '-yyyy-MM-dd.log', + alwaysIncludePattern: true, + encoding: "utf-8", + filename: path_1.default.join(__dirname, '../../logs/access.log') //生成文件路径和文件名 + }, + //系统日志 + application: { + type: 'console', + pattern: '-yyyy-MM-dd.log', + alwaysIncludePattern: true, + encoding: "utf-8", + filename: path_1.default.join(__dirname, '../../logs/application.log') //生成文件路径和文件名 + }, + out: { + type: 'console' + } + }, + categories: { + default: { appenders: ['out'], level: 'info' }, + access: { appenders: ['access'], level: 'info' }, + application: { appenders: ['application'], level: 'WARN' } + } + }, + qiniu: { + accessKey: '0MGmT_rkMiaOeXY09B4EhBnXuDcIYyKlGumQ-zUt', + secretKey: '59dfmEi9Q50rMlz9sxTBCvYDhM7biERAjflBXALb', + HLSconfig: { + VideoBaseUrl: 'http://video.geekhelp.cn/', + FromBucket: 'guaikevideo', + ToBucket: 'm3u8video', + VideoHlsParams: 'avthumb/m3u8/segtime/10/ab/128k/ar/44100/acodec/libfaac/r/30/vb/640k/vcodec/libx264/stripmeta/0/noDomain/1|saveas/' + } + }, + title: ' | 怪客课堂', + typeorm: { + type: 'mysql', + host: "localhost", + charset: "utf8_general_ci", + port: 3306, + username: "root", + password: "lb714500", + database: "shop", + logging: "error", + logger: "file", + synchronize: false, + maxQueryExecutionTime: 1000, + cache: { + duration: 30000 + }, + entities: [ + `${path_1.default.join(__dirname, '../entity/*{.js,.ts}')}` + ] + } +}; diff --git a/dist/controller/.pydio b/dist/controller/.pydio new file mode 100644 index 0000000..400bc47 --- /dev/null +++ b/dist/controller/.pydio @@ -0,0 +1 @@ +b8aa34c8-175a-43ce-91ad-e766884dc2a0 \ No newline at end of file diff --git a/dist/controller/admin/.pydio b/dist/controller/admin/.pydio new file mode 100644 index 0000000..643b1c0 --- /dev/null +++ b/dist/controller/admin/.pydio @@ -0,0 +1 @@ +2cb09cb8-309b-4514-b520-44d2e79021dd \ No newline at end of file diff --git a/dist/controller/admin/AdminController.js b/dist/controller/admin/AdminController.js new file mode 100644 index 0000000..0c3e0fb --- /dev/null +++ b/dist/controller/admin/AdminController.js @@ -0,0 +1,59 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const routing_controllers_1 = require("routing-controllers"); +const JsonResponseMiddlewares_1 = require("../../middleware/JsonResponseMiddlewares"); +const typedi_1 = require("typedi"); +const config_1 = require("../../config"); +const utils_1 = require("../../utils/utils"); +const qiniu_1 = require("../../plugins/qiniu"); +let AdminController = class AdminController { + /** + * 获取上传token,服务于图片,视频的上传 + * http://www.geekhelp.cn/bmy/api/admin/token + * @param params + * @constructor + */ + Token() { + return __awaiter(this, void 0, void 0, function* () { + return { qn_token: this.qiniu.GenerateToken() }; + }); + } +}; +__decorate([ + typedi_1.Inject(), + __metadata("design:type", utils_1.utils) +], AdminController.prototype, "utils", void 0); +__decorate([ + typedi_1.Inject(), + __metadata("design:type", qiniu_1.QiNiu) +], AdminController.prototype, "qiniu", void 0); +__decorate([ + routing_controllers_1.Post("/token"), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], AdminController.prototype, "Token", null); +AdminController = __decorate([ + typedi_1.Service(), + routing_controllers_1.JsonController(`${config_1.config.apiurl}/admin`), + routing_controllers_1.UseInterceptor(JsonResponseMiddlewares_1.JsonResponseInterceptor) +], AdminController); +exports.AdminController = AdminController; diff --git a/dist/controller/api/.pydio b/dist/controller/api/.pydio new file mode 100644 index 0000000..68a58e8 --- /dev/null +++ b/dist/controller/api/.pydio @@ -0,0 +1 @@ +098941e8-0c40-4428-8a75-a93cb6d7ab4c \ No newline at end of file diff --git a/dist/controller/api/TestController.js b/dist/controller/api/TestController.js new file mode 100644 index 0000000..ffc4c79 --- /dev/null +++ b/dist/controller/api/TestController.js @@ -0,0 +1,17 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const routing_controllers_1 = require("routing-controllers"); +const typedi_1 = require("typedi"); +let TestControllerApi = class TestControllerApi { +}; +TestControllerApi = __decorate([ + typedi_1.Service(), + routing_controllers_1.Controller() +], TestControllerApi); +exports.TestControllerApi = TestControllerApi; diff --git a/dist/controller/api/TestControllerApi.js b/dist/controller/api/TestControllerApi.js new file mode 100644 index 0000000..ffc4c79 --- /dev/null +++ b/dist/controller/api/TestControllerApi.js @@ -0,0 +1,17 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const routing_controllers_1 = require("routing-controllers"); +const typedi_1 = require("typedi"); +let TestControllerApi = class TestControllerApi { +}; +TestControllerApi = __decorate([ + typedi_1.Service(), + routing_controllers_1.Controller() +], TestControllerApi); +exports.TestControllerApi = TestControllerApi; diff --git a/dist/controller/api/UserControllerApi.js b/dist/controller/api/UserControllerApi.js new file mode 100644 index 0000000..d4e3714 --- /dev/null +++ b/dist/controller/api/UserControllerApi.js @@ -0,0 +1,110 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const routing_controllers_1 = require("routing-controllers"); +const config_1 = require("../../config"); +const JsonResponseMiddlewares_1 = require("../../middleware/JsonResponseMiddlewares"); +const typedi_1 = require("typedi"); +const UserServiceImpl_1 = require("../../service/impl/UserServiceImpl"); +const UserModel_1 = require("../../model/UserModel"); +const LogsMiddlewares_1 = require("../../middleware/LogsMiddlewares"); +let UserControllerApi = class UserControllerApi { + /** + * @api {get} /user/oneUser oneUser + * @apiVersion 1.1.0 + * @apiDescription 获取一条用户记录 + * @apiName oneUser + * @apiGroup user + * @apiParam {string} id 用户id + * @apiSuccessExample {json} 请求成功的返回: + * { + * "status" : 200, + * "result" : { + * } + * } + * @apiErrorExample {json} 请求失败的返回 + * { + * "status":200, + * "result":{ + * } + * } + * @apiSampleRequest http://www.geekhelp.cn/bmy/api/user/oneUser + * @apiVersion 1.0.0 + */ + oneUser(query) { + return __awaiter(this, void 0, void 0, function* () { + return yield this.userServiceImpl.getOneUserService(query.id); + }); + } + /** + * @api {get} /user/allUser allUser + * @apiVersion 1.1.0 + * @apiDescription 获取所有用户信息 + * @apiName allUser + * @apiGroup user + * @apiSuccessExample {json} 请求成功的返回: + * { + * "status" : 200, + * "result" : { + * } + * } + * @apiErrorExample {json} 请求失败的返回 + * { + * "status":200, + * "result":{ + * } + * } + * @apiSampleRequest http://www.geekhelp.cn/bmy/api/user/allUser + * @apiVersion 1.0.0 + */ + allUser() { + return __awaiter(this, void 0, void 0, function* () { + return yield this.userServiceImpl.getAllUserService(); + }); + } +}; +__decorate([ + typedi_1.Inject(), + __metadata("design:type", UserServiceImpl_1.UserServiceImpl) +], UserControllerApi.prototype, "userServiceImpl", void 0); +__decorate([ + routing_controllers_1.Get("/oneUser"), + routing_controllers_1.UseBefore(LogsMiddlewares_1.LogsMiddlewares), + __param(0, routing_controllers_1.QueryParams()), + __metadata("design:type", Function), + __metadata("design:paramtypes", [UserModel_1.UserModel]), + __metadata("design:returntype", Promise) +], UserControllerApi.prototype, "oneUser", null); +__decorate([ + routing_controllers_1.Get("/allUser"), + routing_controllers_1.UseBefore(LogsMiddlewares_1.LogsMiddlewares), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], UserControllerApi.prototype, "allUser", null); +UserControllerApi = __decorate([ + typedi_1.Service(), + routing_controllers_1.JsonController(`${config_1.config.apiurl}/user`), + routing_controllers_1.UseInterceptor(JsonResponseMiddlewares_1.JsonResponseInterceptor) +], UserControllerApi); +exports.UserControllerApi = UserControllerApi; diff --git a/dist/controller/api/homeControllerApi.js b/dist/controller/api/homeControllerApi.js new file mode 100644 index 0000000..14b863c --- /dev/null +++ b/dist/controller/api/homeControllerApi.js @@ -0,0 +1,17 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const routing_controllers_1 = require("routing-controllers"); +const typedi_1 = require("typedi"); +let homeControllerApi = class homeControllerApi { +}; +homeControllerApi = __decorate([ + typedi_1.Service(), + routing_controllers_1.Controller() +], homeControllerApi); +exports.homeControllerApi = homeControllerApi; diff --git a/dist/controller/home/.pydio b/dist/controller/home/.pydio new file mode 100644 index 0000000..905a0e0 --- /dev/null +++ b/dist/controller/home/.pydio @@ -0,0 +1 @@ +7187985f-096d-45fa-b2af-836bc0200513 \ No newline at end of file diff --git a/dist/controller/home/AboutControllerHome.js b/dist/controller/home/AboutControllerHome.js new file mode 100644 index 0000000..44c17b8 --- /dev/null +++ b/dist/controller/home/AboutControllerHome.js @@ -0,0 +1,44 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const routing_controllers_1 = require("routing-controllers"); +const utils_1 = require("../../utils/utils"); +let AboutControllerHome = class AboutControllerHome { + About(session) { + return { + title: utils_1.utils.titleName("关于"), + isShowAction: { + header: true, + footer: true + }, + banner: { + bannerTitle: '关于怪客', + bannerUrl: '/img/banner_5.jpg', + }, + login: session.user ? session.user : false + }; + } +}; +__decorate([ + routing_controllers_1.Get("/about"), + routing_controllers_1.Render("home/page/about"), + __param(0, routing_controllers_1.Session()), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", void 0) +], AboutControllerHome.prototype, "About", null); +AboutControllerHome = __decorate([ + routing_controllers_1.Controller() +], AboutControllerHome); +exports.AboutControllerHome = AboutControllerHome; diff --git a/dist/controller/home/ErrorControllerHome.js b/dist/controller/home/ErrorControllerHome.js new file mode 100644 index 0000000..da1d1ed --- /dev/null +++ b/dist/controller/home/ErrorControllerHome.js @@ -0,0 +1,35 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const routing_controllers_1 = require("routing-controllers"); +const utils_1 = require("../../utils/utils"); +let ErrorControllerHome = class ErrorControllerHome { + Error() { + return { + title: utils_1.utils.titleName("404..."), + isShowAction: { + header: false, + footer: false + } + }; + } +}; +__decorate([ + routing_controllers_1.Get("/error"), + routing_controllers_1.Render("home/page/error"), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", void 0) +], ErrorControllerHome.prototype, "Error", null); +ErrorControllerHome = __decorate([ + routing_controllers_1.Controller() +], ErrorControllerHome); +exports.ErrorControllerHome = ErrorControllerHome; diff --git a/dist/controller/home/IndexControllerHome.js b/dist/controller/home/IndexControllerHome.js new file mode 100644 index 0000000..a7436b8 --- /dev/null +++ b/dist/controller/home/IndexControllerHome.js @@ -0,0 +1,53 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const routing_controllers_1 = require("routing-controllers"); +const utils_1 = require("../../utils/utils"); +const typedi_1 = require("typedi"); +let IndexControllerHome = class IndexControllerHome { + Index(session) { + return __awaiter(this, void 0, void 0, function* () { + return { + title: utils_1.utils.titleName("首页"), + isShowAction: { + header: true, + footer: true + }, + login: session.user ? session.user : false + }; + }); + } +}; +__decorate([ + routing_controllers_1.Get("/"), + routing_controllers_1.Render("home/page/index"), + __param(0, routing_controllers_1.Session()), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], IndexControllerHome.prototype, "Index", null); +IndexControllerHome = __decorate([ + typedi_1.Service(), + routing_controllers_1.Controller() +], IndexControllerHome); +exports.IndexControllerHome = IndexControllerHome; diff --git a/dist/controller/home/TestControllerHome.js b/dist/controller/home/TestControllerHome.js new file mode 100644 index 0000000..cce0397 --- /dev/null +++ b/dist/controller/home/TestControllerHome.js @@ -0,0 +1,17 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const routing_controllers_1 = require("routing-controllers"); +const typedi_1 = require("typedi"); +let TestControllerHome = class TestControllerHome { +}; +TestControllerHome = __decorate([ + typedi_1.Service(), + routing_controllers_1.Controller() +], TestControllerHome); +exports.TestControllerHome = TestControllerHome; diff --git a/dist/controller/home/UserActionController.js b/dist/controller/home/UserActionController.js new file mode 100644 index 0000000..4b9d482 --- /dev/null +++ b/dist/controller/home/UserActionController.js @@ -0,0 +1,56 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const routing_controllers_1 = require("routing-controllers"); +const utils_1 = require("../../utils/utils"); +let UserActionController = class UserActionController { + reg(session, res) { + return __awaiter(this, void 0, void 0, function* () { + if (!session || !session.user) { + return { + title: utils_1.utils.titleName("注册"), + isShowAction: { + header: false, + footer: false + } + }; + } + else { + res.redirect('/error'); + return res; + } + }); + } +}; +__decorate([ + routing_controllers_1.Get("/register"), + routing_controllers_1.Render("home/page/register"), + __param(0, routing_controllers_1.Session()), __param(1, routing_controllers_1.Res()), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object, Object]), + __metadata("design:returntype", Promise) +], UserActionController.prototype, "reg", null); +UserActionController = __decorate([ + routing_controllers_1.Controller() +], UserActionController); +exports.UserActionController = UserActionController; diff --git a/dist/controller/home/UserOperation.js b/dist/controller/home/UserOperation.js new file mode 100644 index 0000000..cbb3670 --- /dev/null +++ b/dist/controller/home/UserOperation.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class UserOperation { +} +exports.UserOperation = UserOperation; diff --git a/dist/dao/.pydio b/dist/dao/.pydio new file mode 100644 index 0000000..1c3be35 --- /dev/null +++ b/dist/dao/.pydio @@ -0,0 +1 @@ +57ab335b-1140-4a98-977d-5aca05301cac \ No newline at end of file diff --git a/dist/dao/UserDao.js b/dist/dao/UserDao.js new file mode 100644 index 0000000..6ce64d8 --- /dev/null +++ b/dist/dao/UserDao.js @@ -0,0 +1,42 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const typedi_1 = require("typedi"); +const UserEntity_1 = require("../entity/UserEntity"); +const typeorm_1 = require("typeorm"); +let UserDao = class UserDao { + /** + * 查询用户具体信息 + * @param id + */ + getOneUserDao(id) { + return __awaiter(this, void 0, void 0, function* () { + return yield typeorm_1.getRepository(UserEntity_1.UserEntity) + .findOne({ where: { user_id: id } }); + }); + } + AllUser() { + return __awaiter(this, void 0, void 0, function* () { + return yield typeorm_1.getRepository(UserEntity_1.UserEntity) + .find(); + }); + } +}; +UserDao = __decorate([ + typedi_1.Service() +], UserDao); +exports.UserDao = UserDao; diff --git a/dist/dao/testDao.js b/dist/dao/testDao.js new file mode 100644 index 0000000..09bd8c0 --- /dev/null +++ b/dist/dao/testDao.js @@ -0,0 +1,15 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const typedi_1 = require("typedi"); +let TestDao = class TestDao { +}; +TestDao = __decorate([ + typedi_1.Service() +], TestDao); +exports.TestDao = TestDao; diff --git a/dist/entity/.pydio b/dist/entity/.pydio new file mode 100644 index 0000000..2a29703 --- /dev/null +++ b/dist/entity/.pydio @@ -0,0 +1 @@ +56ca8436-62b3-4234-a965-e67b67bfdc2a \ No newline at end of file diff --git a/dist/entity/TestEntity.js b/dist/entity/TestEntity.js new file mode 100644 index 0000000..14c39e5 --- /dev/null +++ b/dist/entity/TestEntity.js @@ -0,0 +1,22 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const typeorm_1 = require("typeorm"); +let TestEntity = class TestEntity { +}; +__decorate([ + typeorm_1.PrimaryGeneratedColumn(), + __metadata("design:type", Number) +], TestEntity.prototype, "user_id", void 0); +TestEntity = __decorate([ + typeorm_1.Entity("user") +], TestEntity); +exports.TestEntity = TestEntity; diff --git a/dist/entity/UserEntity.js b/dist/entity/UserEntity.js new file mode 100644 index 0000000..ccd5449 --- /dev/null +++ b/dist/entity/UserEntity.js @@ -0,0 +1,50 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const typeorm_1 = require("typeorm"); +let UserEntity = class UserEntity { +}; +__decorate([ + typeorm_1.PrimaryGeneratedColumn(), + __metadata("design:type", Number) +], UserEntity.prototype, "user_id", void 0); +__decorate([ + typeorm_1.Column(), + __metadata("design:type", String) +], UserEntity.prototype, "user_name", void 0); +__decorate([ + typeorm_1.Column(), + __metadata("design:type", String) +], UserEntity.prototype, "user_pwd", void 0); +__decorate([ + typeorm_1.Column(), + __metadata("design:type", String) +], UserEntity.prototype, "user_time", void 0); +__decorate([ + typeorm_1.Column(), + __metadata("design:type", String) +], UserEntity.prototype, "user_money", void 0); +__decorate([ + typeorm_1.Column(), + __metadata("design:type", String) +], UserEntity.prototype, "user_pic", void 0); +__decorate([ + typeorm_1.Column(), + __metadata("design:type", String) +], UserEntity.prototype, "user_address", void 0); +__decorate([ + typeorm_1.Column(), + __metadata("design:type", String) +], UserEntity.prototype, "user_phone", void 0); +UserEntity = __decorate([ + typeorm_1.Entity("user") +], UserEntity); +exports.UserEntity = UserEntity; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..e4d9584 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * 启动文件入口 + */ +const app_1 = require("./run/app"); +new app_1.App(); diff --git a/dist/middleware/.pydio b/dist/middleware/.pydio new file mode 100644 index 0000000..f1efc69 --- /dev/null +++ b/dist/middleware/.pydio @@ -0,0 +1 @@ +05e72bdf-a9fa-4a35-b7f3-07070a0c3f9b \ No newline at end of file diff --git a/dist/middleware/CheckLoginMiddleware.js b/dist/middleware/CheckLoginMiddleware.js new file mode 100644 index 0000000..3f80fbe --- /dev/null +++ b/dist/middleware/CheckLoginMiddleware.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * 判断用户是否登录,如果登录则继续访问,没有去登录 + */ +class CheckLoginMiddleware { + use(context, next) { + if (!context.session || !context.session.user) { + context.redirect(`/reg?from=${context.request.url}`); + } + else { + return next(); + } + } +} +exports.CheckLoginMiddleware = CheckLoginMiddleware; diff --git a/dist/middleware/JsonResponseMiddlewares.js b/dist/middleware/JsonResponseMiddlewares.js new file mode 100644 index 0000000..1ddc52c --- /dev/null +++ b/dist/middleware/JsonResponseMiddlewares.js @@ -0,0 +1,34 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ResultDataMiddlewares_1 = require("./ResultDataMiddlewares"); +const typedi_1 = require("typedi"); +const logs_1 = require("../utils/logs"); +// 拦截controller在数据响应给前端,按照标准格式输出数据,同时session存储用户 +let JsonResponseInterceptor = class JsonResponseInterceptor { + intercept(action, content) { + if (content == undefined || content.length == 0) { + logs_1.Logs.ApplicationLogger().error(action); + return this.resultDataMiddlewares.error(action, "没有数据"); + } + else if (content.length != 0) { + return this.resultDataMiddlewares.success(content); + } + } +}; +__decorate([ + typedi_1.Inject(), + __metadata("design:type", ResultDataMiddlewares_1.ResultDataMiddlewares) +], JsonResponseInterceptor.prototype, "resultDataMiddlewares", void 0); +JsonResponseInterceptor = __decorate([ + typedi_1.Service() +], JsonResponseInterceptor); +exports.JsonResponseInterceptor = JsonResponseInterceptor; diff --git a/dist/middleware/LogsMiddlewares.js b/dist/middleware/LogsMiddlewares.js new file mode 100644 index 0000000..a67df99 --- /dev/null +++ b/dist/middleware/LogsMiddlewares.js @@ -0,0 +1,33 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const typedi_1 = require("typedi"); +const logs_1 = require("../utils/logs"); +const moment_1 = __importDefault(require("moment")); +/** + * controller 拦截器 + * 拦截 controller 被访问前,进行访问的日志记录 + */ +let LogsMiddlewares = class LogsMiddlewares { + use(context, next) { + if (context.request.method == "GET") { + logs_1.Logs.ApplicationLogger().warn(`${moment_1.default().format('YYYY-MM-DD HH:mm:ss')} ${context.request.ip} ${context.request.method} ${context.request.url} ${JSON.stringify(context.request.querystring)} ${JSON.stringify(context.request.header)} \n`); + } + else { + logs_1.Logs.ApplicationLogger().warn(`${moment_1.default().format('YYYY-MM-DD HH:mm:ss')} ${context.request.ip} ${context.request.method} ${context.request.url} ${JSON.stringify(context.request.body)} ${JSON.stringify(context.request.header)} \n`); + } + return next(); + } +}; +LogsMiddlewares = __decorate([ + typedi_1.Service() +], LogsMiddlewares); +exports.LogsMiddlewares = LogsMiddlewares; diff --git a/dist/middleware/ResultDataMiddlewares.js b/dist/middleware/ResultDataMiddlewares.js new file mode 100644 index 0000000..73efacd --- /dev/null +++ b/dist/middleware/ResultDataMiddlewares.js @@ -0,0 +1,68 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const typedi_1 = require("typedi"); +let ResultDataMiddlewares = class ResultDataMiddlewares { + get status() { + return this._status; + } + set status(value) { + this._status = value; + } + get data() { + return this._data; + } + set data(value) { + this._data = value; + } + get methods() { + return this._methods; + } + set methods(value) { + this._methods = value; + } + get url() { + return this._url; + } + set url(value) { + this._url = value; + } + /** + * 数据请求成功 + * @param _data 需要返回给前端的数据 + */ + success(_data) { + this.status = 200; + this.data = _data; + return JSON.stringify({ + status: this.status, + time: new Date(), + result: this.data + }); + } + /** + * 数据请求失败 + * @param action 请求对象 + */ + error(action, message) { + this.status = action.response.status; // 状态码 + this.data = message; // 错误信息 + this.methods = action.request.method; // 请求方式 + this.url = action.request.url; // 请求地址 + return JSON.stringify({ + methods: this.methods, + status: this.status, + result: this.data, + url: this.url + }); + } +}; +ResultDataMiddlewares = __decorate([ + typedi_1.Service() +], ResultDataMiddlewares); +exports.ResultDataMiddlewares = ResultDataMiddlewares; diff --git a/dist/model/.pydio b/dist/model/.pydio new file mode 100644 index 0000000..b3ea7be --- /dev/null +++ b/dist/model/.pydio @@ -0,0 +1 @@ +62509948-3cb9-4cfd-b16c-6b716f2f10a7 \ No newline at end of file diff --git a/dist/model/TestModel.js b/dist/model/TestModel.js new file mode 100644 index 0000000..0cfe761 --- /dev/null +++ b/dist/model/TestModel.js @@ -0,0 +1,21 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const class_validator_1 = require("class-validator"); +class TestModel { +} +__decorate([ + class_validator_1.MinLength(1, { + message: 'id参数必须有' + }), + __metadata("design:type", String) +], TestModel.prototype, "id", void 0); +exports.TestModel = TestModel; diff --git a/dist/model/UserModel.js b/dist/model/UserModel.js new file mode 100644 index 0000000..3202f3c --- /dev/null +++ b/dist/model/UserModel.js @@ -0,0 +1,21 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const class_validator_1 = require("class-validator"); +class UserModel { +} +__decorate([ + class_validator_1.MinLength(1, { + message: 'id参数必须有' + }), + __metadata("design:type", String) +], UserModel.prototype, "id", void 0); +exports.UserModel = UserModel; diff --git a/dist/plugins/.pydio b/dist/plugins/.pydio new file mode 100644 index 0000000..a63c45b --- /dev/null +++ b/dist/plugins/.pydio @@ -0,0 +1 @@ +e1d9fe15-2a0a-4008-8e49-4708275b0431 \ No newline at end of file diff --git a/dist/plugins/qiniu.js b/dist/plugins/qiniu.js new file mode 100644 index 0000000..01fb811 --- /dev/null +++ b/dist/plugins/qiniu.js @@ -0,0 +1,67 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const qiniu_1 = __importDefault(require("qiniu")); +const typedi_1 = require("typedi"); +const index_1 = require("../config/index"); +let QiNiu = class QiNiu { + constructor() { + this.FromBucket = index_1.config.qiniu.HLSconfig.FromBucket; + this.ToBucket = index_1.config.qiniu.HLSconfig.ToBucket; + this.VideoHlsParams = index_1.config.qiniu.HLSconfig.VideoHlsParams; + this.accessKey = index_1.config.qiniu.accessKey; + this.secretKey = index_1.config.qiniu.secretKey; + this.mac = new qiniu_1.default.auth.digest.Mac(this.accessKey, this.secretKey); + } + /** + * + * @param BucketName + * @constructor + */ + GenerateToken(BucketName = "vrcource") { + let putPolicy = new qiniu_1.default.rs.PutPolicy({ + scope: BucketName, + expires: 7200 + }); + return putPolicy.uploadToken(this.mac); + } + /** + * 根据前端传递的 filename 文件名,对需要的视频进行切片配置, + * 返回给前端 token,前端拿到 token 后通过form data将视频和 + * token 传递给七牛,七牛会根据token开始切片任务。这里不需要 + * 配置七牛切片成功后的回调通知,因为已经可以通过基地址+m3u8文件名拿到 + * 切片后的地址 + * @param params + * @constructor + */ + GenerateHlsToken(params) { + let M3u8FileName = new Date().getTime(); + let saveHlsEntry = qiniu_1.default.util.urlsafeBase64Encode(`${this.ToBucket}:${M3u8FileName}`); + const options = { + scope: `${this.FromBucket}:${params['filename']}`, + persistentOps: `${this.VideoHlsParams}${saveHlsEntry}`, + persistentPipeline: 'guaikem3u8', + }; + let putPolicy = new qiniu_1.default.rs.PutPolicy(options); + return { + filePath: `${index_1.config.qiniu.HLSconfig.VideoBaseUrl}${M3u8FileName}`, + token: putPolicy.uploadToken(this.mac) + }; + } +}; +QiNiu = __decorate([ + typedi_1.Service(), + __metadata("design:paramtypes", []) +], QiNiu); +exports.QiNiu = QiNiu; diff --git a/dist/resources/.pydio b/dist/resources/.pydio new file mode 100644 index 0000000..bff53d1 --- /dev/null +++ b/dist/resources/.pydio @@ -0,0 +1 @@ +38915049-bd60-4d85-b3cc-1ae2601f8b2b \ No newline at end of file diff --git a/dist/resources/static/.pydio b/dist/resources/static/.pydio new file mode 100644 index 0000000..8d221d4 --- /dev/null +++ b/dist/resources/static/.pydio @@ -0,0 +1 @@ +365311b5-32c3-4360-939e-37b708a867d8 \ No newline at end of file diff --git a/dist/resources/static/css/.pydio b/dist/resources/static/css/.pydio new file mode 100644 index 0000000..de217ad --- /dev/null +++ b/dist/resources/static/css/.pydio @@ -0,0 +1 @@ +170d6805-a0da-431b-a81c-9e6340f10c51 \ No newline at end of file diff --git a/dist/resources/static/css/base.css b/dist/resources/static/css/base.css new file mode 100755 index 0000000..e69de29 diff --git a/dist/resources/static/css/home/.pydio b/dist/resources/static/css/home/.pydio new file mode 100644 index 0000000..d9df1ee --- /dev/null +++ b/dist/resources/static/css/home/.pydio @@ -0,0 +1 @@ +b2b8dbcc-6779-4432-9b90-614361ec29bd \ No newline at end of file diff --git a/dist/resources/static/css/home/about.css b/dist/resources/static/css/home/about.css new file mode 100644 index 0000000..7ce602c --- /dev/null +++ b/dist/resources/static/css/home/about.css @@ -0,0 +1,3 @@ +.about { + color: red; +} diff --git a/dist/resources/static/css/home/error.css b/dist/resources/static/css/home/error.css new file mode 100644 index 0000000..ad602e5 --- /dev/null +++ b/dist/resources/static/css/home/error.css @@ -0,0 +1,38 @@ +.error { + display: flex; + align-items: center; + justify-content: center; + flex-direction: row; +} +.error img { + width: 270px; + margin-bottom: 20px; +} +.error .i-message { + margin-left: 19px; +} +.error .i-message .action { + margin-top: 10px; +} +.error .i-message .action a[href="/"] { + margin-right: 15px; +} +.error .i-message ul { + padding-left: 20px; + margin-top: 8px; +} +.error .i-message h3 { + font-size: 17px; + margin-bottom: 10px; + line-height: 27px; + font-weight: 500; + letter-spacing: 2px; +} +.error .i-message a { + color: #8d8d8d; +} +body, +html, +.error { + height: 100%; +} diff --git a/dist/resources/static/css/home/index.css b/dist/resources/static/css/home/index.css new file mode 100755 index 0000000..e69de29 diff --git a/dist/resources/static/css/home/register.css b/dist/resources/static/css/home/register.css new file mode 100644 index 0000000..22836a8 --- /dev/null +++ b/dist/resources/static/css/home/register.css @@ -0,0 +1,4 @@ +.register { + font-size: 30px; + color: green; +} diff --git a/dist/resources/static/css/home/test.css b/dist/resources/static/css/home/test.css new file mode 100644 index 0000000..2c85bdd --- /dev/null +++ b/dist/resources/static/css/home/test.css @@ -0,0 +1,3 @@ +.Test { + color: red; +} diff --git a/dist/resources/static/css/tpl/.pydio b/dist/resources/static/css/tpl/.pydio new file mode 100644 index 0000000..321d86b --- /dev/null +++ b/dist/resources/static/css/tpl/.pydio @@ -0,0 +1 @@ +01ac1c31-34b6-4927-9ea5-ac59aba566af \ No newline at end of file diff --git a/dist/resources/static/css/tpl/colors.css b/dist/resources/static/css/tpl/colors.css new file mode 100755 index 0000000..e69de29 diff --git a/dist/resources/static/css/tpl/mixins.css b/dist/resources/static/css/tpl/mixins.css new file mode 100755 index 0000000..e69de29 diff --git a/dist/resources/static/fonts/.pydio b/dist/resources/static/fonts/.pydio new file mode 100644 index 0000000..792be53 --- /dev/null +++ b/dist/resources/static/fonts/.pydio @@ -0,0 +1 @@ +59158044-dfca-4e36-8cb9-881640318e07 \ No newline at end of file diff --git a/dist/resources/static/img/.pydio b/dist/resources/static/img/.pydio new file mode 100644 index 0000000..79112cc --- /dev/null +++ b/dist/resources/static/img/.pydio @@ -0,0 +1 @@ +27366949-82a2-4b1e-996e-69b53b999cbd \ No newline at end of file diff --git a/dist/resources/static/img/banner.png b/dist/resources/static/img/banner.png new file mode 100755 index 0000000..2e7b920 Binary files /dev/null and b/dist/resources/static/img/banner.png differ diff --git a/dist/resources/static/img/banner_1.png b/dist/resources/static/img/banner_1.png new file mode 100755 index 0000000..3feac26 Binary files /dev/null and b/dist/resources/static/img/banner_1.png differ diff --git a/dist/resources/static/img/banner_2.png b/dist/resources/static/img/banner_2.png new file mode 100755 index 0000000..de04f0c Binary files /dev/null and b/dist/resources/static/img/banner_2.png differ diff --git a/dist/resources/static/img/banner_3.png b/dist/resources/static/img/banner_3.png new file mode 100755 index 0000000..de04f0c Binary files /dev/null and b/dist/resources/static/img/banner_3.png differ diff --git a/dist/resources/static/img/banner_4.jpg b/dist/resources/static/img/banner_4.jpg new file mode 100755 index 0000000..ca713a9 Binary files /dev/null and b/dist/resources/static/img/banner_4.jpg differ diff --git a/dist/resources/static/img/banner_5.jpg b/dist/resources/static/img/banner_5.jpg new file mode 100755 index 0000000..09eeb76 Binary files /dev/null and b/dist/resources/static/img/banner_5.jpg differ diff --git a/dist/resources/static/img/banner_6.jpg b/dist/resources/static/img/banner_6.jpg new file mode 100755 index 0000000..ccc675f Binary files /dev/null and b/dist/resources/static/img/banner_6.jpg differ diff --git a/dist/resources/static/img/banner_7.png b/dist/resources/static/img/banner_7.png new file mode 100755 index 0000000..9e6869a Binary files /dev/null and b/dist/resources/static/img/banner_7.png differ diff --git a/dist/resources/static/img/bgError.png b/dist/resources/static/img/bgError.png new file mode 100755 index 0000000..1c3d4fd Binary files /dev/null and b/dist/resources/static/img/bgError.png differ diff --git a/dist/resources/static/img/discountbanner.png b/dist/resources/static/img/discountbanner.png new file mode 100755 index 0000000..d8370cc Binary files /dev/null and b/dist/resources/static/img/discountbanner.png differ diff --git a/dist/resources/static/img/favicon.ico b/dist/resources/static/img/favicon.ico new file mode 100755 index 0000000..1041510 Binary files /dev/null and b/dist/resources/static/img/favicon.ico differ diff --git a/dist/resources/static/img/getbg.png b/dist/resources/static/img/getbg.png new file mode 100755 index 0000000..87648c9 Binary files /dev/null and b/dist/resources/static/img/getbg.png differ diff --git a/dist/resources/static/img/spjcdet_img1.png b/dist/resources/static/img/spjcdet_img1.png new file mode 100755 index 0000000..3854f19 Binary files /dev/null and b/dist/resources/static/img/spjcdet_img1.png differ diff --git a/dist/resources/static/img/spjcdet_img2.jpg b/dist/resources/static/img/spjcdet_img2.jpg new file mode 100755 index 0000000..582008c Binary files /dev/null and b/dist/resources/static/img/spjcdet_img2.jpg differ diff --git a/dist/resources/static/img/spjcdet_img3.png b/dist/resources/static/img/spjcdet_img3.png new file mode 100755 index 0000000..5a1dcb3 Binary files /dev/null and b/dist/resources/static/img/spjcdet_img3.png differ diff --git a/dist/resources/static/img/spjcdet_img4.png b/dist/resources/static/img/spjcdet_img4.png new file mode 100755 index 0000000..9fc4f5a Binary files /dev/null and b/dist/resources/static/img/spjcdet_img4.png differ diff --git a/dist/resources/static/img/wx.png b/dist/resources/static/img/wx.png new file mode 100755 index 0000000..00fd6b1 Binary files /dev/null and b/dist/resources/static/img/wx.png differ diff --git a/dist/resources/static/img/youh.png b/dist/resources/static/img/youh.png new file mode 100755 index 0000000..dbc4f55 Binary files /dev/null and b/dist/resources/static/img/youh.png differ diff --git a/dist/resources/static/js/.pydio b/dist/resources/static/js/.pydio new file mode 100644 index 0000000..6049671 --- /dev/null +++ b/dist/resources/static/js/.pydio @@ -0,0 +1 @@ +02011504-1fc5-4c66-9f5d-410cc1527d8f \ No newline at end of file diff --git a/dist/resources/static/js/app.js b/dist/resources/static/js/app.js new file mode 100755 index 0000000..c5e28e6 --- /dev/null +++ b/dist/resources/static/js/app.js @@ -0,0 +1,32 @@ +requirejs.config({ require.js + baseUrl: '/js', + waitSeconds: 0, + paths: { + app: 'app', + jquery: 'lib/jquery.min', + swiper: 'lib/swiper/swiper.min', + zui: 'lib/zui/js/zui.min', + utils: 'utils/index', + config: 'config/index' + }, + map: { + '*': { + 'css': 'lib/css' + } + }, + shim : { // 按需加载css + 'app/index': { deps: ['css!/css/home/index.css','css!/js/lib/swiper/swiper.min.css'] }, + 'app/about': { deps: ['css!/css/home/about.css'] }, + 'app/register': { deps: ['css!/css/home/register.css'] } + } +}); + +// 读取每个页面自定义属性data-module获取js文件名,然后自动加载并调用非对应页面的js文件中的 init 方法 +requirejs(["jquery"],function ($) { + var module = $('.pages').attr('data-module'); + if(module != undefined){ + requirejs([ `app/${ module }` ], function (module) { + module.init(); + }) + } +}); diff --git a/dist/resources/static/js/app/.pydio b/dist/resources/static/js/app/.pydio new file mode 100644 index 0000000..fa67360 --- /dev/null +++ b/dist/resources/static/js/app/.pydio @@ -0,0 +1 @@ +1db48167-07c0-46b2-a84c-beea2247a27e \ No newline at end of file diff --git a/dist/resources/static/js/app/about.js b/dist/resources/static/js/app/about.js new file mode 100755 index 0000000..90a5f65 --- /dev/null +++ b/dist/resources/static/js/app/about.js @@ -0,0 +1,12 @@ +define(['jquery','utils'],function ($,utils) { + function about() { + + } + + about.prototype = { + init () { + } + }; + + return new about(); +}); \ No newline at end of file diff --git a/dist/resources/static/js/app/index.js b/dist/resources/static/js/app/index.js new file mode 100755 index 0000000..ea48dd5 --- /dev/null +++ b/dist/resources/static/js/app/index.js @@ -0,0 +1,31 @@ +define(['jquery','swiper','utils', 'zui'],function ($,swiper,utils) { + function Index() { + + } + + Index.prototype = { + init () { + new $.zui.Messager('zui弹窗。', { + icon: 'heart', + placement: 'center' + }).show(); + }, + + + //初始化 swiper 轮播图 + newSwiper () { + // new swiper ('.swiper-container', { + // direction: 'horizontal', + // loop: true, + // autoplay: true, + // pagination: { + // el: '.swiper-pagination', + // clickable :true, + // } + // }); + }, + + } + + return new Index(); +}) diff --git a/dist/resources/static/js/app/register.js b/dist/resources/static/js/app/register.js new file mode 100644 index 0000000..96227b1 --- /dev/null +++ b/dist/resources/static/js/app/register.js @@ -0,0 +1,14 @@ +define(['jquery','swiper','utils'],function ($,swiper,utils) { + function Register() { + + } + + Register.prototype = { + init () { + console.log("用户注册") + }, + + }; + + return new Register(); +}); \ No newline at end of file diff --git a/dist/resources/static/js/app/test.js b/dist/resources/static/js/app/test.js new file mode 100644 index 0000000..007d643 --- /dev/null +++ b/dist/resources/static/js/app/test.js @@ -0,0 +1,12 @@ +define(['jquery','utils'],function ($,utils) { + function test() { + + } + + test.prototype = { + init () { + } + }; + + return new test(); +}); diff --git a/dist/resources/static/js/config/.pydio b/dist/resources/static/js/config/.pydio new file mode 100644 index 0000000..7d47977 --- /dev/null +++ b/dist/resources/static/js/config/.pydio @@ -0,0 +1 @@ +ca35505f-8930-4df3-a682-0fd0d46d8672 \ No newline at end of file diff --git a/dist/resources/static/js/config/index.js b/dist/resources/static/js/config/index.js new file mode 100755 index 0000000..9549b88 --- /dev/null +++ b/dist/resources/static/js/config/index.js @@ -0,0 +1,10 @@ +/** + * 网站前端的 config 配置文件 + */ +define([], function () { + return { + + // 请求基地址 + baseURL: 'http://www.geekhelp.cn/bmy/api' + } +}) \ No newline at end of file diff --git a/dist/resources/static/js/lib/.pydio b/dist/resources/static/js/lib/.pydio new file mode 100644 index 0000000..0147a0a --- /dev/null +++ b/dist/resources/static/js/lib/.pydio @@ -0,0 +1 @@ +4a41c117-dab4-467b-ac47-10e619694a1b \ No newline at end of file diff --git a/dist/resources/static/js/lib/css.js b/dist/resources/static/js/lib/css.js new file mode 100755 index 0000000..df4a337 --- /dev/null +++ b/dist/resources/static/js/lib/css.js @@ -0,0 +1,169 @@ +/* + * Require-CSS RequireJS css! loader plugin + * 0.1.10 + * Guy Bedford 2014 + * MIT + */ + +/* + * + * Usage: + * require(['css!./mycssFile']); + * + * Tested and working in (up to latest versions as of March 2013): + * Android + * iOS 6 + * IE 6 - 10 + * Chrome 3 - 26 + * Firefox 3.5 - 19 + * Opera 10 - 12 + * + * browserling.com used for virtual testing environment + * + * Credit to B Cavalier & J Hann for the IE 6 - 9 method, + * refined with help from Martin Cermak + * + * Sources that helped along the way: + * - https://developer.mozilla.org/en-US/docs/Browser_detection_using_the_user_agent + * - http://www.phpied.com/when-is-a-stylesheet-really-loaded/ + * - https://github.com/cujojs/curl/blob/master/src/curl/plugin/css.js + * + */ + +define(function() { +//>>excludeStart('excludeRequireCss', pragmas.excludeRequireCss) + if (typeof window == 'undefined') + return { load: function(n, r, load){ load() } }; + + var head = document.getElementsByTagName('head')[0]; + + var engine = window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/) || 0; + + // use "; +c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| +"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f); +if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d #mq-test-1 { width: 42px; }',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b .canvas { + position: relative; + min-width: 50px; + max-width: 100%; + margin: 0 auto; + } +.img-cutter > .canvas > .cover { + position: absolute; + top: 0; + left: 0; + z-index: 1; + width: 100%; + height: 100%; + -webkit-transition: all .4s cubic-bezier(.175, .885, .32, 1); + -o-transition: all .4s cubic-bezier(.175, .885, .32, 1); + transition: all .4s cubic-bezier(.175, .885, .32, 1); + } +.img-cutter > .canvas > img { + -webkit-transition: all .4s cubic-bezier(.175, .885, .32, 1); + -o-transition: all .4s cubic-bezier(.175, .885, .32, 1); + transition: all .4s cubic-bezier(.175, .885, .32, 1); + } +.img-cutter > .canvas > .controller { + position: absolute; + top: 5%; + left: 5%; + z-index: 5; + width: 100px; + height: 100px; + cursor: move; + background: none; + border: 1px dashed #fff; + border-color: rgba(255, 255, 255, .7); + -webkit-transition: opacity .4s cubic-bezier(.175, .885, .32, 1); + -o-transition: opacity .4s cubic-bezier(.175, .885, .32, 1); + transition: opacity .4s cubic-bezier(.175, .885, .32, 1); + } +.img-cutter > .canvas > .controller > .control { + position: absolute; + width: 6px; + height: 6px; + background: #000; + background: rgba(0, 0, 0, .6); + border: 1px solid #fff; + border-color: rgba(255, 255, 255, .6); + } +.img-cutter > .canvas > .controller > .control[data-direction='left'] { + top: 50%; + left: -4px; + margin-top: -3px; + cursor: w-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='top'] { + top: -4px; + left: 50%; + margin-left: -3px; + cursor: n-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='right'] { + top: 50%; + right: -4px; + margin-top: -3px; + cursor: e-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='bottom'] { + bottom: -4px; + left: 50%; + margin-left: -3px; + cursor: s-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='top-left'] { + top: -4px; + left: -4px; + cursor: nw-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='top-right'] { + top: -4px; + right: -4px; + cursor: ne-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='bottom-left'] { + bottom: -4px; + left: -4px; + cursor: sw-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='bottom-right'] { + right: -4px; + bottom: -4px; + cursor: se-resize; + } +.img-cutter > .canvas > .cliper { + position: absolute; + top: 0; + left: 0; + z-index: 2; + width: 100%; + height: 100%; + clip: rect(0px, 50px, 50px, 0); + } +.img-cutter.hover > .canvas > img, +.img-cutter.hover > .canvas > .controller > .cover { + filter: alpha(opacity=0); + opacity: 0; + } +.img-cutter.hover > .canvas > .controller { + display: none; + } diff --git a/dist/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.js b/dist/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.js new file mode 100644 index 0000000..479ea00 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.js @@ -0,0 +1,280 @@ +/*! + * ZUI: 图片裁剪工具 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/* ======================================================================== + * ZUI: img-cutter.js + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + +(function($, Math, undefined) { + 'use strict'; + + if(!$.fn.draggable) console.error('img-cutter requires draggable.js'); + if(!$.zui.imgReady) console.error('img-cutter requires image.ready.js'); + + var NAME = 'zui.imgCutter'; + + var ImgCutter = function(element, options) { + this.$ = $(element); + this.initOptions(options); + this.init(); + }; + + ImgCutter.DEFAULTS = { + coverColor: '#000', + coverOpacity: 0.6, + // fixedRatio: false, + defaultWidth: 128, + defaultHeight: 128, + minWidth: 48, + minHeight: 48 + }; // default options + + ImgCutter.prototype.callEvent = function(name, params) { + var result = this.$.callEvent(name + '.' + NAME, params, this); + return !(result.result !== undefined && (!result.result)); + }; + + ImgCutter.prototype.initOptions = function(options) { + this.options = $.extend({}, ImgCutter.DEFAULTS, this.$.data(), options); + this.options.coverOpacityIE = this.options.coverOpacity * 100; + this.clipWidth = this.options.defaultWidth; + this.clipHeight = this.options.defaultHeight; + }; + + ImgCutter.prototype.init = function() { + this.initDom(); + this.initSize(); + this.bindEvents(); + }; + + ImgCutter.prototype.initDom = function() { + this.$canvas = this.$.children('.canvas'); + this.$img = this.$canvas.children('img'); + this.$actions = this.$.children('.actions'); + this.$btn = this.$.find('.img-cutter-submit'); + this.$preview = this.$.find('.img-cutter-preview'); + + this.options.img = this.$img.attr('src'); + + this.$canvas.append('
'.format(this.options)); + + this.$cover = this.$canvas.children('.cover'); + this.$controller = this.$canvas.children('.controller'); + this.$cliper = this.$canvas.children('.cliper'); + this.$chipImg = this.$cliper.children('img'); + + if(this.options.fixedRatio) { + this.$.addClass('fixed-ratio'); + } + }; + + ImgCutter.prototype.resetImage = function(img) { + var that = this; + that.options.img = img; + that.$img.attr('src', img); + that.$chipImg.attr('src', img); + that.imgWidth = undefined; + that.left = undefined; + that.initSize(); + }; + + ImgCutter.prototype.initSize = function() { + var that = this; + if(!that.imgWidth) { + $.zui.imgReady(that.options.img, function() { + that.imgWidth = this.width; + that.imgHeight = this.height; + that.callEvent('ready'); + }); + } + + + var waitImgWidth = setInterval(function() { + if(that.imgWidth) { + clearInterval(waitImgWidth); + + that.width = Math.min(that.imgWidth, that.$.width()); + that.$canvas.css('width', this.width); + that.$cliper.css('width', this.width); + that.height = that.$canvas.height(); + + if(that.left === undefined) { + that.left = Math.floor((that.width - that.$controller.width()) / 2); + that.top = Math.floor((that.height - that.$controller.height()) / 2); + } + + that.refreshSize(); + } + }, 0); + }; + + ImgCutter.prototype.refreshSize = function(ratioSide) { + var options = this.options; + + this.clipWidth = Math.max(options.minWidth, Math.min(this.width, this.clipWidth)); + this.clipHeight = Math.max(options.minHeight, Math.min(this.height, this.clipHeight)); + + if(options.fixedRatio) { + if(ratioSide && ratioSide === 'height') { + this.clipWidth = Math.max(options.minWidth, Math.min(this.width, this.clipHeight * options.defaultWidth / options.defaultHeight)); + this.clipHeight = this.clipWidth * options.defaultHeight / options.defaultWidth; + } else { + this.clipHeight = Math.max(options.minHeight, Math.min(this.height, this.clipWidth * options.defaultHeight / options.defaultWidth)); + this.clipWidth = this.clipHeight * options.defaultWidth / options.defaultHeight; + } + } + + this.left = Math.min(this.width - this.clipWidth, Math.max(0, this.left)); + this.top = Math.min(this.height - this.clipHeight, Math.max(0, this.top)); + this.right = this.left + this.clipWidth; + this.bottom = this.top + this.clipHeight; + + this.$controller.css({ + left: this.left, + top: this.top, + width: this.clipWidth, + height: this.clipHeight + }); + this.$cliper.css('clip', 'rect({0}px {1}px {2}px {3}px'.format(this.top, this.left + this.clipWidth, this.top + this.clipHeight, this.left)); + + + this.callEvent('change', { + top: this.top, + left: this.left, + bottom: this.bottom, + right: this.right, + width: this.clipWidth, + height: this.clipHeight + }); + }; + + ImgCutter.prototype.getData = function() { + var that = this; + that.data = { + originWidth: that.imgWidth, + originHeight: that.imgHeight, + scaleWidth: that.width, + scaleHeight: that.height, + width: that.right - that.left, + height: that.bottom - that.top, + left: that.left, + top: that.top, + right: that.right, + bottom: that.bottom, + scaled: that.imgWidth != that.width || that.imgHeight != that.height + }; + return that.data; + }; + + ImgCutter.prototype.bindEvents = function() { + var that = this, + options = this.options; + this.$.resize($.proxy(this.initSize, this)); + this.$btn.hover(function() { + that.$.toggleClass('hover'); + }).click(function() { + var data = that.getData(); + + if(!that.callEvent('before', data)) return; + + var url = options.post || options.get || options.url || null; + if(url !== null) { + $.ajax({ + type: options.post ? 'POST' : 'GET', + url: url, + data: data + }) + .done(function(e) { + that.callEvent('done', e); + }).fail(function(e) { + that.callEvent('fail', e); + }).always(function(e) { + that.callEvent('always', e); + }); + } + }); + + this.$controller.draggable({ + move: false, + container: this.$canvas, + drag: function(e) { + that.left += e.smallOffset.x; + that.top += e.smallOffset.y; + that.refreshSize(); + } + }); + + this.$controller.children('.control').draggable({ + move: false, + container: this.$canvas, + stopPropagation: true, + drag: function(e) { + var dr = e.element.data('direction'); + var offset = e.smallOffset; + var ratioSide = false; + + switch(dr) { + case 'left': + case 'top-left': + case 'bottom-left': + that.left += offset.x; + that.left = Math.min(that.right - options.minWidth, Math.max(0, that.left)); + that.clipWidth = that.right - that.left; + break; + case 'right': + case 'top-right': + case 'bottom-right': + that.clipWidth += offset.x; + that.clipWidth = Math.min(that.width - that.left, Math.max(options.minWidth, that.clipWidth)); + break; + } + switch(dr) { + case 'top': + case 'top-left': + case 'top-right': + that.top += offset.y; + that.top = Math.min(that.bottom - options.minHeight, Math.max(0, that.top)); + that.clipHeight = that.bottom - that.top; + ratioSide = true; + break; + case 'bottom': + case 'bottom-left': + case 'bottom-right': + that.clipHeight += offset.y; + that.clipHeight = Math.min(that.height - that.top, Math.max(options.minHeight, that.clipHeight)); + ratioSide = true; + break; + } + + that.refreshSize(ratioSide); + } + }); + }; + + $.fn.imgCutter = function(option) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new ImgCutter(this, options))); + + if(typeof option == 'string') data[option](); + }); + }; + + $.fn.imgCutter.Constructor = ImgCutter; + + $(function() { + $('[data-toggle="imgCutter"]').imgCutter(); + }); +}(jQuery, Math, undefined)); + diff --git a/dist/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.css b/dist/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.css new file mode 100644 index 0000000..eb267e7 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.css @@ -0,0 +1,6 @@ +/*! + * ZUI: 图片裁剪工具 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */.img-cutter{padding:10px;margin-bottom:20px;background:#e5e5e5;border:1px solid #ddd}.img-cutter>.canvas{position:relative;min-width:50px;max-width:100%;margin:0 auto}.img-cutter>.canvas>.cover{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;-webkit-transition:all .4s cubic-bezier(.175,.885,.32,1);-o-transition:all .4s cubic-bezier(.175,.885,.32,1);transition:all .4s cubic-bezier(.175,.885,.32,1)}.img-cutter>.canvas>img{-webkit-transition:all .4s cubic-bezier(.175,.885,.32,1);-o-transition:all .4s cubic-bezier(.175,.885,.32,1);transition:all .4s cubic-bezier(.175,.885,.32,1)}.img-cutter>.canvas>.controller{position:absolute;top:5%;left:5%;z-index:5;width:100px;height:100px;cursor:move;background:0 0;border:1px dashed #fff;border-color:rgba(255,255,255,.7);-webkit-transition:opacity .4s cubic-bezier(.175,.885,.32,1);-o-transition:opacity .4s cubic-bezier(.175,.885,.32,1);transition:opacity .4s cubic-bezier(.175,.885,.32,1)}.img-cutter>.canvas>.controller>.control{position:absolute;width:6px;height:6px;background:#000;background:rgba(0,0,0,.6);border:1px solid #fff;border-color:rgba(255,255,255,.6)}.img-cutter>.canvas>.controller>.control[data-direction=left]{top:50%;left:-4px;margin-top:-3px;cursor:w-resize}.img-cutter>.canvas>.controller>.control[data-direction=top]{top:-4px;left:50%;margin-left:-3px;cursor:n-resize}.img-cutter>.canvas>.controller>.control[data-direction=right]{top:50%;right:-4px;margin-top:-3px;cursor:e-resize}.img-cutter>.canvas>.controller>.control[data-direction=bottom]{bottom:-4px;left:50%;margin-left:-3px;cursor:s-resize}.img-cutter>.canvas>.controller>.control[data-direction=top-left]{top:-4px;left:-4px;cursor:nw-resize}.img-cutter>.canvas>.controller>.control[data-direction=top-right]{top:-4px;right:-4px;cursor:ne-resize}.img-cutter>.canvas>.controller>.control[data-direction=bottom-left]{bottom:-4px;left:-4px;cursor:sw-resize}.img-cutter>.canvas>.controller>.control[data-direction=bottom-right]{right:-4px;bottom:-4px;cursor:se-resize}.img-cutter>.canvas>.cliper{position:absolute;top:0;left:0;z-index:2;width:100%;height:100%;clip:rect(0,50px,50px,0)}.img-cutter.hover>.canvas>.controller>.cover,.img-cutter.hover>.canvas>img{filter:alpha(opacity=0);opacity:0}.img-cutter.hover>.canvas>.controller{display:none} \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.js b/dist/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.js new file mode 100644 index 0000000..97216db --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: 图片裁剪工具 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +!function(t,i,e){"use strict";t.fn.draggable||console.error("img-cutter requires draggable.js"),t.zui.imgReady||console.error("img-cutter requires image.ready.js");var h="zui.imgCutter",o=function(i,e){this.$=t(i),this.initOptions(e),this.init()};o.DEFAULTS={coverColor:"#000",coverOpacity:.6,defaultWidth:128,defaultHeight:128,minWidth:48,minHeight:48},o.prototype.callEvent=function(t,i){var o=this.$.callEvent(t+"."+h,i,this);return!(o.result!==e&&!o.result)},o.prototype.initOptions=function(i){this.options=t.extend({},o.DEFAULTS,this.$.data(),i),this.options.coverOpacityIE=100*this.options.coverOpacity,this.clipWidth=this.options.defaultWidth,this.clipHeight=this.options.defaultHeight},o.prototype.init=function(){this.initDom(),this.initSize(),this.bindEvents()},o.prototype.initDom=function(){this.$canvas=this.$.children(".canvas"),this.$img=this.$canvas.children("img"),this.$actions=this.$.children(".actions"),this.$btn=this.$.find(".img-cutter-submit"),this.$preview=this.$.find(".img-cutter-preview"),this.options.img=this.$img.attr("src"),this.$canvas.append('
'.format(this.options)),this.$cover=this.$canvas.children(".cover"),this.$controller=this.$canvas.children(".controller"),this.$cliper=this.$canvas.children(".cliper"),this.$chipImg=this.$cliper.children("img"),this.options.fixedRatio&&this.$.addClass("fixed-ratio")},o.prototype.resetImage=function(t){var i=this;i.options.img=t,i.$img.attr("src",t),i.$chipImg.attr("src",t),i.imgWidth=e,i.left=e,i.initSize()},o.prototype.initSize=function(){var h=this;h.imgWidth||t.zui.imgReady(h.options.img,function(){h.imgWidth=this.width,h.imgHeight=this.height,h.callEvent("ready")});var o=setInterval(function(){h.imgWidth&&(clearInterval(o),h.width=i.min(h.imgWidth,h.$.width()),h.$canvas.css("width",this.width),h.$cliper.css("width",this.width),h.height=h.$canvas.height(),h.left===e&&(h.left=i.floor((h.width-h.$controller.width())/2),h.top=i.floor((h.height-h.$controller.height())/2)),h.refreshSize())},0)},o.prototype.refreshSize=function(t){var e=this.options;this.clipWidth=i.max(e.minWidth,i.min(this.width,this.clipWidth)),this.clipHeight=i.max(e.minHeight,i.min(this.height,this.clipHeight)),e.fixedRatio&&(t&&"height"===t?(this.clipWidth=i.max(e.minWidth,i.min(this.width,this.clipHeight*e.defaultWidth/e.defaultHeight)),this.clipHeight=this.clipWidth*e.defaultHeight/e.defaultWidth):(this.clipHeight=i.max(e.minHeight,i.min(this.height,this.clipWidth*e.defaultHeight/e.defaultWidth)),this.clipWidth=this.clipHeight*e.defaultWidth/e.defaultHeight)),this.left=i.min(this.width-this.clipWidth,i.max(0,this.left)),this.top=i.min(this.height-this.clipHeight,i.max(0,this.top)),this.right=this.left+this.clipWidth,this.bottom=this.top+this.clipHeight,this.$controller.css({left:this.left,top:this.top,width:this.clipWidth,height:this.clipHeight}),this.$cliper.css("clip","rect({0}px {1}px {2}px {3}px".format(this.top,this.left+this.clipWidth,this.top+this.clipHeight,this.left)),this.callEvent("change",{top:this.top,left:this.left,bottom:this.bottom,right:this.right,width:this.clipWidth,height:this.clipHeight})},o.prototype.getData=function(){var t=this;return t.data={originWidth:t.imgWidth,originHeight:t.imgHeight,scaleWidth:t.width,scaleHeight:t.height,width:t.right-t.left,height:t.bottom-t.top,left:t.left,top:t.top,right:t.right,bottom:t.bottom,scaled:t.imgWidth!=t.width||t.imgHeight!=t.height},t.data},o.prototype.bindEvents=function(){var e=this,h=this.options;this.$.resize(t.proxy(this.initSize,this)),this.$btn.hover(function(){e.$.toggleClass("hover")}).click(function(){var i=e.getData();if(e.callEvent("before",i)){var o=h.post||h.get||h.url||null;null!==o&&t.ajax({type:h.post?"POST":"GET",url:o,data:i}).done(function(t){e.callEvent("done",t)}).fail(function(t){e.callEvent("fail",t)}).always(function(t){e.callEvent("always",t)})}}),this.$controller.draggable({move:!1,container:this.$canvas,drag:function(t){e.left+=t.smallOffset.x,e.top+=t.smallOffset.y,e.refreshSize()}}),this.$controller.children(".control").draggable({move:!1,container:this.$canvas,stopPropagation:!0,drag:function(t){var o=t.element.data("direction"),s=t.smallOffset,a=!1;switch(o){case"left":case"top-left":case"bottom-left":e.left+=s.x,e.left=i.min(e.right-h.minWidth,i.max(0,e.left)),e.clipWidth=e.right-e.left;break;case"right":case"top-right":case"bottom-right":e.clipWidth+=s.x,e.clipWidth=i.min(e.width-e.left,i.max(h.minWidth,e.clipWidth))}switch(o){case"top":case"top-left":case"top-right":e.top+=s.y,e.top=i.min(e.bottom-h.minHeight,i.max(0,e.top)),e.clipHeight=e.bottom-e.top,a=!0;break;case"bottom":case"bottom-left":case"bottom-right":e.clipHeight+=s.y,e.clipHeight=i.min(e.height-e.top,i.max(h.minHeight,e.clipHeight)),a=!0}e.refreshSize(a)}})},t.fn.imgCutter=function(i){return this.each(function(){var e=t(this),s=e.data(h),a="object"==typeof i&&i;s||e.data(h,s=new o(this,a)),"string"==typeof i&&s[i]()})},t.fn.imgCutter.Constructor=o,t(function(){t('[data-toggle="imgCutter"]').imgCutter()})}(jQuery,Math,void 0); \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/imgready/.pydio b/dist/resources/static/js/lib/zui/lib/imgready/.pydio new file mode 100644 index 0000000..bd2e5e6 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/imgready/.pydio @@ -0,0 +1 @@ +966b8cfa-f75d-4ea9-8edf-75242a2791b6 \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/imgready/imgready.js b/dist/resources/static/js/lib/zui/lib/imgready/imgready.js new file mode 100644 index 0000000..9661f85 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/imgready/imgready.js @@ -0,0 +1,105 @@ +/* ======================================================================== + * TangBin: image.ready.js + * http://www.planeart.cn/?p=1121 + * + * ZUI: The file has been changed in ZUI. It will not keep update with the + * original version in the future. + * http://zui.sexy + * ======================================================================== + * @version 2011.05.27 + * @author TangBin + * ======================================================================== */ + + +/*! TangBin: image.ready.js http://www.planeart.cn/?p=1121 */ + +(function($) { + 'use strict'; + + /** + * Image ready + * @param {String} image url + * @param {Function} callback on image ready + * @param {Function} callback on image load + * @param {Function} callback on error + * @example imgReady('image.png', function () { + alert('size ready: width=' + this.width + '; height=' + this.height); + }); + */ + $.zui.imgReady = (function() { + var list = [], + intervalId = null, + + // 用来执行队列 + tick = function() { + var i = 0; + for(; i < list.length; i++) { + list[i].end ? list.splice(i--, 1) : list[i](); + }!list.length && stop(); + }, + + // 停止所有定时器队列 + stop = function() { + clearInterval(intervalId); + intervalId = null; + }; + + return function(url, ready, load, error) { + var onready, width, height, newWidth, newHeight, + img = new Image(); + + img.src = url; + + // 如果图片被缓存,则直接返回缓存数据 + if(img.complete) { + ready.call(img); + load && load.call(img); + return; + } + + width = img.width; + height = img.height; + + // 加载错误后的事件 + img.onerror = function() { + error && error.call(img); + onready.end = true; + img = img.onload = img.onerror = null; + }; + + // 图片尺寸就绪 + onready = function() { + newWidth = img.width; + newHeight = img.height; + if(newWidth !== width || newHeight !== height || + // 如果图片已经在其他地方加载可使用面积检测 + newWidth * newHeight > 1024 + ) { + ready.call(img); + onready.end = true; + } + }; + onready(); + + // 完全加载完毕的事件 + img.onload = function() { + // onload在定时器时间差范围内可能比onready快 + // 这里进行检查并保证onready优先执行 + !onready.end && onready(); + + load && load.call(img); + + // IE gif动画会循环执行onload,置空onload即可 + img = img.onload = img.onerror = null; + }; + + // 加入队列中定期执行 + if(!onready.end) { + list.push(onready); + // 无论何时只允许出现一个定时器,减少浏览器性能损耗 + if(intervalId === null) intervalId = setInterval(tick, 40); + } + }; + })(); +}(jQuery)); + diff --git a/dist/resources/static/js/lib/zui/lib/imgready/imgready.min.js b/dist/resources/static/js/lib/zui/lib/imgready/imgready.min.js new file mode 100644 index 0000000..1f15f04 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/imgready/imgready.min.js @@ -0,0 +1,2 @@ +/*! TangBin: image.ready.js http://www.planeart.cn/?p=1121 */ +!function(n){"use strict";n.zui.imgReady=function(){var n=[],l=null,e=function(){for(var l=0;l1024)&&(r.call(h),c.end=!0)},c(),h.onload=function(){!c.end&&c(),t&&t.call(h),h=h.onload=h.onerror=null},void(c.end||(n.push(c),null===l&&(l=setInterval(e,40)))))}}()}(jQuery); \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/jquery/.pydio b/dist/resources/static/js/lib/zui/lib/jquery/.pydio new file mode 100644 index 0000000..319cdde --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/jquery/.pydio @@ -0,0 +1 @@ +bd965a50-ce34-471a-87f0-00736a1ded6b \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/jquery/jquery.js b/dist/resources/static/js/lib/zui/lib/jquery/jquery.js new file mode 100644 index 0000000..73f33fb --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/jquery/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v1.11.0 | (c) 2005, 2014 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="".trim,l={},m="1.11.0",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!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));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||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},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:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}: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){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[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&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),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=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="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=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)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(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 mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(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 typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.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},z=b?function(a,b){if(a===b)return j=!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===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.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=db.selectors={cacheLength:50,createPseudo:fb,match:V,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(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===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]||db.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]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(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(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.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+" ").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(),t=!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&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&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]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)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&&(t&&((l[s]||(l[s]={}))[a]=[u,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()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(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),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?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===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.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 X.test(a.nodeName)},input:function(a){return W.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:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;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=[u,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[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(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 sb(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 tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(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?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(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 n.inArray(a,b)>=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=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},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=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.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:z,!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}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,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))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];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,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))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?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):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 E(a,b){do a=a[b];while(a&&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 E(a,"nextSibling")},prev:function(a){return E(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 n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document: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&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(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&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};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 I;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){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(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){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f +}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),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=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(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 n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;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},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML="
a",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.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=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=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(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.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=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(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,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!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(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/\s*$/g,sb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:l.htmlSerialize?[0,"",""]:[1,"X
","
"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(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 yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?""!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(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=xb(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=xb(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(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(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(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}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 W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(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(vb(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,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.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(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}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=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("').css('width', '100%'); + self.textarea = K('').css('width', '100%'); + self.tabIndex = isNaN(parseInt(options.tabIndex, 10)) ? self.srcElement.attr('tabindex') : parseInt(options.tabIndex, 10); + self.iframe.attr('tabindex', self.tabIndex); + self.textarea.attr('tabindex', self.tabIndex); + if(self.width) { + self.setWidth(self.width); + } + if(self.height) { + self.setHeight(self.height); + } + if(self.designMode) { + self.textarea.hide(); + } else { + self.iframe.hide(); + } + + function ready() { + var doc = _iframeDoc(self.iframe); + doc.open(); + if(isDocumentDomain) { + doc.domain = document.domain; + } + doc.write(_getInitHtml(themesPath, bodyClass, cssPath, cssData)); + doc.close(); + self.win = self.iframe[0].contentWindow; + self.doc = doc; + var cmd = _cmd(doc); + self.afterChange(function(e) { + cmd.selection(); + }); + if(_WEBKIT) { + K(doc).click(function(e) { + if(K(e.target).name === 'img') { + cmd.selection(true); + cmd.range.selectNode(e.target); + cmd.select(); + } + }); + } + if(_IE) { + self._mousedownHandler = function() { + var newRange = cmd.range.cloneRange(); + newRange.shrink(); + if(newRange.isControl()) { + self.blur(); + } + }; + K(document).mousedown(self._mousedownHandler); + K(doc).keydown(function(e) { + if(e.which == 8) { + cmd.selection(); + var rng = cmd.range; + if(rng.isControl()) { + rng.collapse(true); + K(rng.startContainer.childNodes[rng.startOffset]).remove(); + e.preventDefault(); + } + } + }); + } + self.cmd = cmd; + self.html(_elementVal(self.srcElement)); + if(_IE) { + doc.body.disabled = true; + doc.body.contentEditable = true; + doc.body.removeAttribute('disabled'); + } else { + doc.designMode = 'on'; + } + if(options.afterCreate) { + options.afterCreate.call(self); + } + } + if(isDocumentDomain) { + self.iframe.bind('load', function(e) { + self.iframe.unbind('load'); + if(_IE) { + ready(); + } else { + setTimeout(ready, 0); + } + }); + } + self.div.append(self.iframe); + self.div.append(self.textarea); + self.srcElement.hide(); + !isDocumentDomain && ready(); + }, + setWidth: function(val) { + this.div.css('width', _addUnit(val)); + return this; + }, + setHeight: function(val) { + var self = this; + val = _addUnit(val); + self.div.css('height', val); + self.iframe.css('height', val); + if((_IE && _V < 8) || _QUIRKS) { + val = _addUnit(_removeUnit(val) - 2); + } + self.textarea.css('height', val); + return self; + }, + remove: function() { + var self = this, + doc = self.doc; + K(doc.body).unbind(); + K(doc).unbind(); + K(self.win).unbind(); + if(self._mousedownHandler) { + K(document).unbind('mousedown', self._mousedownHandler); + } + _elementVal(self.srcElement, self.html()); + self.srcElement.show(); + doc.write(''); + self.iframe.unbind(); + self.textarea.unbind(); + KEdit.parent.remove.call(self); + }, + html: function(val, isFull) { + var self = this, + doc = self.doc; + if(self.designMode) { + var body = doc.body; + if(val === undefined) { + if(isFull) { + val = '' + body.parentNode.innerHTML + ''; + } else { + val = body.innerHTML; + } + if(self.beforeGetHtml) { + val = self.beforeGetHtml(val); + } + if(_GECKO && val == '
') { + val = ''; + } + return val; + } + if(self.beforeSetHtml) { + val = self.beforeSetHtml(val); + } + if(_IE && _V >= 9) { + val = val.replace(/(<.*?checked=")checked(".*>)/ig, '$1$2'); + } + K(body).html(val); + if(self.afterSetHtml) { + self.afterSetHtml(); + } + return self; + } + if(val === undefined) { + return self.textarea.val(); + } + self.textarea.val(val); + return self; + }, + design: function(bool) { + var self = this, + val; + if(bool === undefined ? !self.designMode : bool) { + if(!self.designMode) { + val = self.html(); + self.designMode = true; + self.html(val); + self.textarea.hide(); + self.iframe.show(); + } + } else { + if(self.designMode) { + val = self.html(); + self.designMode = false; + self.html(val); + self.iframe.hide(); + self.textarea.show(); + } + } + return self.focus(); + }, + focus: function() { + var self = this; + self.designMode ? self.win.focus() : self.textarea[0].focus(); + return self; + }, + blur: function() { + var self = this; + if(_IE) { + var input = K('', self.div); + self.div.append(input); + input[0].focus(); + input.remove(); + } else { + self.designMode ? self.win.blur() : self.textarea[0].blur(); + } + return self; + }, + afterChange: function(fn) { + var self = this, + doc = self.doc, + body = doc.body; + K(doc).keyup(function(e) { + if(!e.ctrlKey && !e.altKey && _CHANGE_KEY_MAP[e.which]) { + fn(e); + } + }); + K(doc).mouseup(fn).contextmenu(fn); + K(self.win).blur(fn); + + function timeoutHandler(e) { + setTimeout(function() { + fn(e); + }, 1); + } + K(body).bind('paste', timeoutHandler); + K(body).bind('cut', timeoutHandler); + return self; + } + }); + + function _edit(options) { + return new KEdit(options); + } + K.EditClass = KEdit; + K.edit = _edit; + K.iframeDoc = _iframeDoc; + + function _selectToolbar(name, fn) { + var self = this, + knode = self.get(name); + if(knode) { + if(knode.hasClass('ke-disabled')) { + return; + } + fn(knode); + } + } + + function KToolbar(options) { + this.init(options); + } + _extend(KToolbar, KWidget, { + init: function(options) { + var self = this; + KToolbar.parent.init.call(self, options); + self.disableMode = _undef(options.disableMode, false); + self.noDisableItemMap = _toMap(_undef(options.noDisableItems, [])); + self._itemMap = {}; + self.div.addClass('ke-toolbar').bind('contextmenu,mousedown,mousemove', function(e) { + e.preventDefault(); + }).attr('unselectable', 'on'); + + function find(target) { + var knode = K(target); + if(knode.hasClass('ke-outline')) { + return knode; + } + if(knode.hasClass('ke-toolbar-icon')) { + return knode.parent(); + } + } + + function hover(e, method) { + var knode = find(e.target); + if(knode) { + if(knode.hasClass('ke-disabled')) { + return; + } + if(knode.hasClass('ke-selected')) { + return; + } + knode[method]('ke-on'); + } + } + self.div.mouseover(function(e) { + hover(e, 'addClass'); + }) + .mouseout(function(e) { + hover(e, 'removeClass'); + }) + .click(function(e) { + var knode = find(e.target); + if(knode) { + if(knode.hasClass('ke-disabled')) { + return; + } + self.options.click.call(this, e, knode.attr('data-name')); + } + }); + }, + get: function(name) { + if(this._itemMap[name]) { + return this._itemMap[name]; + } + return(this._itemMap[name] = K('span.ke-icon-' + name, this.div).parent()); + }, + select: function(name) { + _selectToolbar.call(this, name, function(knode) { + knode.addClass('ke-selected'); + }); + return self; + }, + unselect: function(name) { + _selectToolbar.call(this, name, function(knode) { + knode.removeClass('ke-selected').removeClass('ke-on'); + }); + return self; + }, + enable: function(name) { + var self = this, + knode = name.get ? name : self.get(name); + if(knode) { + knode.removeClass('ke-disabled'); + knode.opacity(1); + } + return self; + }, + disable: function(name) { + var self = this, + knode = name.get ? name : self.get(name); + if(knode) { + knode.removeClass('ke-selected').addClass('ke-disabled'); + knode.opacity(0.5); + } + return self; + }, + disableAll: function(bool, noDisableItems) { + var self = this, + map = self.noDisableItemMap, + item; + if(noDisableItems) { + map = _toMap(noDisableItems); + } + if(bool === undefined ? !self.disableMode : bool) { + K('span.ke-outline', self.div).each(function() { + var knode = K(this), + name = knode[0].getAttribute('data-name', 2); + if(!map[name]) { + self.disable(knode); + } + }); + self.disableMode = true; + } else { + K('span.ke-outline', self.div).each(function() { + var knode = K(this), + name = knode[0].getAttribute('data-name', 2); + if(!map[name]) { + self.enable(knode); + } + }); + self.disableMode = false; + } + return self; + } + }); + + function _toolbar(options) { + return new KToolbar(options); + } + K.ToolbarClass = KToolbar; + K.toolbar = _toolbar; + + function KMenu(options) { + this.init(options); + } + _extend(KMenu, KWidget, { + init: function(options) { + var self = this; + options.z = options.z || 811213; + KMenu.parent.init.call(self, options); + self.centerLineMode = _undef(options.centerLineMode, true); + self.div.addClass('ke-menu').bind('click,mousedown', function(e) { + e.stopPropagation(); + }).attr('unselectable', 'on'); + }, + addItem: function(item) { + var self = this; + if(item.title === '-') { + self.div.append(K('
')); + return; + } + var itemDiv = K('
'), + leftDiv = K('
'), + rightDiv = K('
'), + height = _addUnit(item.height), + iconClass = _undef(item.iconClass, ''); + self.div.append(itemDiv); + if(height) { + itemDiv.css('height', height); + rightDiv.css('line-height', height); + } + var centerDiv; + if(self.centerLineMode) { + centerDiv = K('
'); + if(height) { + centerDiv.css('height', height); + } + } + itemDiv.mouseover(function(e) { + K(this).addClass('ke-menu-item-on'); + if(centerDiv) { + centerDiv.addClass('ke-menu-item-center-on'); + } + }) + .mouseout(function(e) { + K(this).removeClass('ke-menu-item-on'); + if(centerDiv) { + centerDiv.removeClass('ke-menu-item-center-on'); + } + }) + .click(function(e) { + item.click.call(K(this)); + e.stopPropagation(); + }) + .append(leftDiv); + if(centerDiv) { + itemDiv.append(centerDiv); + } + itemDiv.append(rightDiv); + if(item.checked) { + iconClass = 'ke-icon-checked'; + } + if(iconClass !== '') { + leftDiv.html(''); + } + rightDiv.html(item.title); + return self; + }, + remove: function() { + var self = this; + if(self.options.beforeRemove) { + self.options.beforeRemove.call(self); + } + K('.ke-menu-item', self.div[0]).unbind(); + KMenu.parent.remove.call(self); + return self; + } + }); + + function _menu(options) { + return new KMenu(options); + } + K.MenuClass = KMenu; + K.menu = _menu; + + function KColorPicker(options) { + this.init(options); + } + _extend(KColorPicker, KWidget, { + init: function(options) { + var self = this; + options.z = options.z || 811213; + KColorPicker.parent.init.call(self, options); + var colors = options.colors || [ + ['#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'], + ['#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'], + ['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'], + ['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000'] + ]; + self.selectedColor = (options.selectedColor || '').toLowerCase(); + self._cells = []; + self.div.addClass('ke-colorpicker').bind('click,mousedown', function(e) { + e.stopPropagation(); + }).attr('unselectable', 'on'); + var table = self.doc.createElement('table'); + self.div.append(table); + table.className = 'ke-colorpicker-table'; + table.cellPadding = 0; + table.cellSpacing = 0; + table.border = 0; + var row = table.insertRow(0), + cell = row.insertCell(0); + cell.colSpan = colors[0].length; + self._addAttr(cell, '', 'ke-colorpicker-cell-top'); + for(var i = 0; i < colors.length; i++) { + row = table.insertRow(i + 1); + for(var j = 0; j < colors[i].length; j++) { + cell = row.insertCell(j); + self._addAttr(cell, colors[i][j], 'ke-colorpicker-cell'); + } + } + }, + _addAttr: function(cell, color, cls) { + var self = this; + cell = K(cell).addClass(cls); + if(self.selectedColor === color.toLowerCase()) { + cell.addClass('ke-colorpicker-cell-selected'); + } + cell.attr('title', color || self.options.noColor); + cell.mouseover(function(e) { + K(this).addClass('ke-colorpicker-cell-on'); + }); + cell.mouseout(function(e) { + K(this).removeClass('ke-colorpicker-cell-on'); + }); + cell.click(function(e) { + e.stop(); + self.options.click.call(K(this), color); + }); + if(color) { + cell.append(K('
').css('background-color', color)); + } else { + cell.html(self.options.noColor); + } + K(cell).attr('unselectable', 'on'); + self._cells.push(cell); + }, + remove: function() { + var self = this; + _each(self._cells, function() { + this.unbind(); + }); + KColorPicker.parent.remove.call(self); + return self; + } + }); + + function _colorpicker(options) { + return new KColorPicker(options); + } + K.ColorPickerClass = KColorPicker; + K.colorpicker = _colorpicker; + + function KUploadButton(options) { + this.init(options); + } + _extend(KUploadButton, { + init: function(options) { + var self = this, + button = K(options.button), + fieldName = options.fieldName || 'file', + url = options.url || '', + title = button.val(), + extraParams = options.extraParams || {}, + cls = button[0].className || '', + target = options.target || 'kindeditor_upload_iframe_' + new Date().getTime(); + options.afterError = options.afterError || function(str) { + alert(str); + }; + var hiddenElements = []; + for(var k in extraParams) { + hiddenElements.push(''); + } + var html = [ + '
', (options.target ? '' : ''), (options.form ? '
' : '
'), + '', + hiddenElements.join(''), + '', + '', + '', (options.form ? '
' : ''), + '
' + ].join(''); + var div = K(html, button.doc); + button.hide(); + button.before(div); + self.div = div; + self.button = button; + self.iframe = options.target ? K('iframe[name="' + target + '"]') : K('iframe', div); + self.form = options.form ? K(options.form) : K('form', div); + self.fileBox = K('.ke-upload-file', div); + self.options = options; + }, + submit: function() { + var self = this, + iframe = self.iframe; + iframe.bind('load', function() { + iframe.unbind(); + var tempForm = document.createElement('form'); + self.fileBox.before(tempForm); + K(tempForm).append(self.fileBox); + tempForm.reset(); + K(tempForm).remove(true); + var doc = K.iframeDoc(iframe), + pre = doc.getElementsByTagName('pre')[0], + str = '', + data; + if(pre) { + str = pre.innerHTML; + } else { + str = doc.body.innerHTML; + } + str = _unescape(str); + iframe[0].src = 'javascript:false'; + try { + data = K.json(str); + } catch(e) { + self.options.afterError.call(self, '' + doc.body.parentNode.innerHTML + ''); + } + if(data) { + self.options.afterUpload.call(self, data); + } + }); + self.form[0].submit(); + return self; + }, + remove: function() { + var self = this; + if(self.fileBox) { + self.fileBox.unbind(); + } + self.iframe.remove(); + self.div.remove(); + self.button.show(); + return self; + } + }); + + function _uploadbutton(options) { + return new KUploadButton(options); + } + K.UploadButtonClass = KUploadButton; + K.uploadbutton = _uploadbutton; + + function _createButton(arg) { + arg = arg || {}; + var name = arg.name || '', + span = K(''), + btn = K(''); + if(arg.click) { + btn.click(arg.click); + } + span.append(btn); + return span; + } + + function KDialog(options) { + this.init(options); + } + _extend(KDialog, KWidget, { + init: function(options) { + var self = this; + var shadowMode = _undef(options.shadowMode, true); + options.z = options.z || 811213; + options.shadowMode = false; + options.autoScroll = _undef(options.autoScroll, true); + KDialog.parent.init.call(self, options); + var title = options.title, + body = K(options.body, self.doc), + previewBtn = options.previewBtn, + yesBtn = options.yesBtn, + noBtn = options.noBtn, + closeBtn = options.closeBtn, + showMask = _undef(options.showMask, true); + self.div.addClass('ke-dialog').bind('click,mousedown', function(e) { + e.stopPropagation(); + }); + var contentDiv = K('
').appendTo(self.div); + if(_IE && _V < 7) { + self.iframeMask = K('').appendTo(self.div); + } else if(shadowMode) { + K('
').appendTo(self.div); + } + var headerDiv = K('
'); + contentDiv.append(headerDiv); + headerDiv.html(title); + self.closeIcon = K('').click(closeBtn.click); + headerDiv.append(self.closeIcon); + self.draggable({ + clickEl: headerDiv, + beforeDrag: options.beforeDrag + }); + var bodyDiv = K('
'); + contentDiv.append(bodyDiv); + bodyDiv.append(body); + var footerDiv = K(''); + if(previewBtn || yesBtn || noBtn) { + contentDiv.append(footerDiv); + } + _each([{ + btn: previewBtn, + name: 'preview' + }, { + btn: yesBtn, + name: 'yes' + }, { + btn: noBtn, + name: 'no' + }], function() { + if(this.btn) { + var button = _createButton(this.btn); + button.addClass('ke-dialog-' + this.name); + footerDiv.append(button); + } + }); + if(self.height) { + bodyDiv.height(_removeUnit(self.height) - headerDiv.height() - footerDiv.height()); + } + self.div.width(self.div.width()); + self.div.height(self.div.height()); + self.mask = null; + if(showMask) { + var docEl = _docElement(self.doc), + docWidth = Math.max(docEl.scrollWidth, docEl.clientWidth), + docHeight = Math.max(docEl.scrollHeight, docEl.clientHeight); + self.mask = _widget({ + x: 0, + y: 0, + z: self.z - 1, + cls: 'ke-dialog-mask', + width: docWidth, + height: docHeight + }); + } + self.autoPos(self.div.width(), self.div.height()); + self.footerDiv = footerDiv; + self.bodyDiv = bodyDiv; + self.headerDiv = headerDiv; + self.isLoading = false; + }, + setMaskIndex: function(z) { + var self = this; + self.mask.div.css('z-index', z); + }, + showLoading: function(msg) { + msg = _undef(msg, ''); + var self = this, + body = self.bodyDiv; + self.loading = K('
' + msg + '
') + .width(body.width()).height(body.height()) + .css('top', self.headerDiv.height() + 'px'); + body.css('visibility', 'hidden').after(self.loading); + self.isLoading = true; + return self; + }, + hideLoading: function() { + this.loading && this.loading.remove(); + this.bodyDiv.css('visibility', 'visible'); + this.isLoading = false; + return this; + }, + remove: function() { + var self = this; + if(self.options.beforeRemove) { + self.options.beforeRemove.call(self); + } + self.mask && self.mask.remove(); + self.iframeMask && self.iframeMask.remove(); + self.closeIcon.unbind(); + K('input', self.div).unbind(); + K('button', self.div).unbind(); + self.footerDiv.unbind(); + self.bodyDiv.unbind(); + self.headerDiv.unbind(); + K('iframe', self.div).each(function() { + K(this).remove(); + }); + KDialog.parent.remove.call(self); + return self; + } + }); + + function _dialog(options) { + return new KDialog(options); + } + K.DialogClass = KDialog; + K.dialog = _dialog; + + function _tabs(options) { + var self = _widget(options), + remove = self.remove, + afterSelect = options.afterSelect, + div = self.div, + liList = []; + div.addClass('ke-tabs') + .bind('contextmenu,mousedown,mousemove', function(e) { + e.preventDefault(); + }); + var ul = K('
    '); + div.append(ul); + self.add = function(tab) { + var li = K('
  • ' + tab.title + '
  • '); + li.data('tab', tab); + liList.push(li); + ul.append(li); + }; + self.selectedIndex = 0; + self.select = function(index) { + self.selectedIndex = index; + _each(liList, function(i, li) { + li.unbind(); + if(i === index) { + li.addClass('ke-tabs-li-selected'); + K(li.data('tab').panel).show(''); + } else { + li.removeClass('ke-tabs-li-selected').removeClass('ke-tabs-li-on') + .mouseover(function() { + K(this).addClass('ke-tabs-li-on'); + }) + .mouseout(function() { + K(this).removeClass('ke-tabs-li-on'); + }) + .click(function() { + self.select(i); + }); + K(li.data('tab').panel).hide(); + } + }); + if(afterSelect) { + afterSelect.call(self, index); + } + }; + self.remove = function() { + _each(liList, function() { + this.remove(); + }); + ul.remove(); + remove.call(self); + }; + return self; + } + K.tabs = _tabs; + + function _loadScript(url, fn) { + var head = document.getElementsByTagName('head')[0] || (_QUIRKS ? document.body : document.documentElement), + script = document.createElement('script'); + head.appendChild(script); + script.src = url; + script.charset = 'utf-8'; + script.onload = script.onreadystatechange = function() { + if(!this.readyState || this.readyState === 'loaded') { + if(fn) { + fn(); + } + script.onload = script.onreadystatechange = null; + head.removeChild(script); + } + }; + } + + function _chopQuery(url) { + var index = url.indexOf('?'); + return index > 0 ? url.substr(0, index) : url; + } + + function _loadStyle(url) { + var head = document.getElementsByTagName('head')[0] || (_QUIRKS ? document.body : document.documentElement), + link = document.createElement('link'), + absoluteUrl = _chopQuery(_formatUrl(url, 'absolute')); + var links = K('link[rel="stylesheet"]', head); + for(var i = 0, len = links.length; i < len; i++) { + if(_chopQuery(_formatUrl(links[i].href, 'absolute')) === absoluteUrl) { + return; + } + } + head.appendChild(link); + link.href = url; + link.rel = 'stylesheet'; + } + + function _ajax(url, fn, method, param, dataType) { + method = method || 'GET'; + dataType = dataType || 'json'; + var xhr = window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); + xhr.open(method, url, true); + xhr.onreadystatechange = function() { + if(xhr.readyState == 4 && xhr.status == 200) { + if(fn) { + var data = _trim(xhr.responseText); + if(dataType == 'json') { + data = _json(data); + } + fn(data); + } + } + }; + if(method == 'POST') { + var params = []; + _each(param, function(key, val) { + params.push(encodeURIComponent(key) + '=' + encodeURIComponent(val)); + }); + try { + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + } catch(e) {} + xhr.send(params.join('&')); + } else { + xhr.send(null); + } + } + K.loadScript = _loadScript; + K.loadStyle = _loadStyle; + K.ajax = _ajax; + var _plugins = {}; + + function _plugin(name, fn) { + if(name === undefined) { + return _plugins; + } + if(!fn) { + return _plugins[name]; + } + _plugins[name] = fn; + } + var _language = {}; + + function _parseLangKey(key) { + var match, ns = 'core'; + if((match = /^(\w+)\.(\w+)$/.exec(key))) { + ns = match[1]; + key = match[2]; + } + return { + ns: ns, + key: key + }; + } + + function _lang(mixed, langType) { + langType = langType === undefined ? K.options.langType : langType; + if(typeof mixed === 'string') { + if(!_language[langType]) { + return 'no language'; + } + var pos = mixed.length - 1; + if(mixed.substr(pos) === '.') { + return _language[langType][mixed.substr(0, pos)]; + } + var obj = _parseLangKey(mixed); + return _language[langType][obj.ns][obj.key]; + } + _each(mixed, function(key, val) { + var obj = _parseLangKey(key); + if(!_language[langType]) { + _language[langType] = {}; + } + if(!_language[langType][obj.ns]) { + _language[langType][obj.ns] = {}; + } + _language[langType][obj.ns][obj.key] = val; + }); + } + + function _getImageFromRange(range, fn) { + if(range.collapsed) { + return; + } + range = range.cloneRange().up(); + var sc = range.startContainer, + so = range.startOffset; + if(!_WEBKIT && !range.isControl()) { + return; + } + var img = K(sc.childNodes[so]); + if(!img || img.name != 'img') { + return; + } + if(fn(img)) { + return img; + } + } + + function _bindContextmenuEvent() { + var self = this, + doc = self.edit.doc; + K(doc).contextmenu(function(e) { + if(self.menu) { + self.hideMenu(); + } + if(!self.useContextmenu) { + e.preventDefault(); + return; + } + if(self._contextmenus.length === 0) { + return; + } + var maxWidth = 0, + items = []; + _each(self._contextmenus, function() { + if(this.title == '-') { + items.push(this); + return; + } + if(this.cond && this.cond()) { + items.push(this); + if(this.width && this.width > maxWidth) { + maxWidth = this.width; + } + } + }); + while(items.length > 0 && items[0].title == '-') { + items.shift(); + } + while(items.length > 0 && items[items.length - 1].title == '-') { + items.pop(); + } + var prevItem = null; + _each(items, function(i) { + if(this.title == '-' && prevItem.title == '-') { + delete items[i]; + } + prevItem = this; + }); + if(items.length > 0) { + e.preventDefault(); + var pos = K(self.edit.iframe).pos(), + menu = _menu({ + x: pos.x + e.clientX, + y: pos.y + e.clientY, + width: maxWidth, + css: { + visibility: 'hidden' + }, + shadowMode: self.shadowMode + }); + _each(items, function() { + if(this.title) { + menu.addItem(this); + } + }); + var docEl = _docElement(menu.doc), + menuHeight = menu.div.height(); + if(e.clientY + menuHeight >= docEl.clientHeight - 100) { + menu.pos(menu.x, _removeUnit(menu.y) - menuHeight); + } + menu.div.css('visibility', 'visible'); + self.menu = menu; + } + }); + } + + function _bindNewlineEvent() { + var self = this, + doc = self.edit.doc, + newlineTag = self.newlineTag; + if(_IE && newlineTag !== 'br') { + return; + } + if(_GECKO && _V < 3 && newlineTag !== 'p') { + return; + } + if(_OPERA && _V < 9) { + return; + } + var brSkipTagMap = _toMap('h1,h2,h3,h4,h5,h6,pre,li'), + pSkipTagMap = _toMap('p,h1,h2,h3,h4,h5,h6,pre,li,blockquote'); + + function getAncestorTagName(range) { + var ancestor = K(range.commonAncestor()); + while(ancestor) { + if(ancestor.type == 1 && !ancestor.isStyle()) { + break; + } + ancestor = ancestor.parent(); + } + return ancestor.name; + } + K(doc).keydown(function(e) { + if(e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) { + return; + } + self.cmd.selection(); + var tagName = getAncestorTagName(self.cmd.range); + if(tagName == 'marquee' || tagName == 'select') { + return; + } + if(newlineTag === 'br' && !brSkipTagMap[tagName]) { + e.preventDefault(); + self.insertHtml('
    ' + (_IE && _V < 9 ? '' : '\u200B')); + return; + } + if(!pSkipTagMap[tagName]) { + _nativeCommand(doc, 'formatblock', '

    '); + } + }); + K(doc).keyup(function(e) { + if(e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) { + return; + } + if(newlineTag == 'br') { + return; + } + if(_GECKO) { + var root = self.cmd.commonAncestor('p'); + var a = self.cmd.commonAncestor('a'); + if(a && a.text() == '') { + a.remove(true); + self.cmd.range.selectNodeContents(root[0]).collapse(true); + self.cmd.select(); + } + return; + } + self.cmd.selection(); + var tagName = getAncestorTagName(self.cmd.range); + if(tagName == 'marquee' || tagName == 'select') { + return; + } + if(!pSkipTagMap[tagName]) { + _nativeCommand(doc, 'formatblock', '

    '); + } + + // see fix: [Chrome] 在 Chrome 上添加标题之后换行 JS 报错 https://github.com/kindsoft/kindeditor/commit/6e2d34e740e76c597cc56f99706d5dc706ed6e6a + // var div = self.cmd.commonAncestor('div'); + // if(div) { + // var p = K('

    '), + // child = div[0].firstChild; + // while(child) { + // var next = child.nextSibling; + // p.append(child); + // child = next; + // } + // div.before(p); + // div.remove(); + // self.cmd.range.selectNodeContents(p[0]); + // self.cmd.select(); + // } + }); + } + + function _bindTabEvent() { + var self = this, + doc = self.edit.doc; + K(doc).keydown(function(e) { + if(e.which == 9) { + e.preventDefault(); + if(self.afterTab) { + var tabResult = self.afterTab.call(self, e); + // 如果 afterTab 回调函数返回值为 true,则视为已经处理 tab 键操作,否则继续执行原始 tab 操作 + if (tabResult === true) return; + } + var cmd = self.cmd, + range = cmd.range; + range.shrink(); + if(range.collapsed && range.startContainer.nodeType == 1) { + range.insertNode(K('@ ', doc)[0]); + cmd.select(); + } + self.insertHtml('    '); + } + }); + } + + function _bindFocusEvent() { + var self = this; + K(self.edit.textarea[0], self.edit.win).focus(function(e) { + if(self.afterFocus) { + self.afterFocus.call(self, e); + } + }).blur(function(e) { + if(self.afterBlur) { + self.afterBlur.call(self, e); + } + }); + } + + function _removeBookmarkTag(html) { + return _trim(html.replace(/]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/ig, '')); + } + + function _removeTempTag(html) { + return html.replace(/]+class="?__kindeditor_paste__"?[^>]*>[\s\S]*?<\/div>/ig, ''); + } + + function _addBookmarkToStack(stack, bookmark) { + if(stack.length === 0) { + stack.push(bookmark); + return; + } + var prev = stack[stack.length - 1]; + if(_removeBookmarkTag(bookmark.html) !== _removeBookmarkTag(prev.html)) { + stack.push(bookmark); + } + } + + function _undoToRedo(fromStack, toStack) { + var self = this, + edit = self.edit, + body = edit.doc.body, + range, bookmark; + if(fromStack.length === 0) { + return self; + } + if(edit.designMode) { + range = self.cmd.range; + bookmark = range.createBookmark(true); + bookmark.html = body.innerHTML; + } else { + bookmark = { + html: body.innerHTML + }; + } + _addBookmarkToStack(toStack, bookmark); + var prev = fromStack.pop(); + if(_removeBookmarkTag(bookmark.html) === _removeBookmarkTag(prev.html) && fromStack.length > 0) { + prev = fromStack.pop(); + } + if(edit.designMode) { + edit.html(prev.html); + if(prev.start) { + range.moveToBookmark(prev); + self.select(); + } + } else { + K(body).html(_removeBookmarkTag(prev.html)); + } + return self; + } + + function KEditor(options) { + var self = this; + self.options = {}; + + function setOption(key, val) { + if(KEditor.prototype[key] === undefined) { + self[key] = val; + } + self.options[key] = val; + } + _each(options, function(key, val) { + setOption(key, options[key]); + }); + _each(K.options, function(key, val) { + if(self[key] === undefined) { + setOption(key, val); + } + }); + var se = K(self.srcElement || '', + '' + ].join(''), + dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var type = K('.ke-code-type', dialog.div).val(), + code = textarea.val(), + cls = type === '' ? '' : ' lang-' + type, + html = '
    \n' + K.escape(code) + '
    '; + if(K.trim(code) === '') { + alert(lang.pleaseInput); + textarea[0].focus(); + return; + } + self.insertHtml(html).hideDialog().focus(); + } + } + }), + textarea = K('textarea', dialog.div); + textarea[0].focus(); + }); +}); +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('emoticons', function(K) { + var self = this, + name = 'emoticons', + path = (self.emoticonsPath || self.pluginsPath + 'emoticons/images/'), + allowPreview = self.allowPreviewEmoticons === undefined ? true : self.allowPreviewEmoticons, + currentPageNum = 1; + self.clickToolbar(name, function() { + var rows = 5, + cols = 9, + total = 135, + startNum = 0, + cells = rows * cols, + pages = Math.ceil(total / cells), + colsHalf = Math.floor(cols / 2), + wrapperDiv = K('
    '), + elements = [], + menu = self.createMenu({ + name: name, + beforeRemove: function() { + removeEvent(); + } + }); + menu.div.append(wrapperDiv); + var previewDiv, previewImg; + if(allowPreview) { + previewDiv = K('
    ').css('right', 0); + previewImg = K(''); + wrapperDiv.append(previewDiv); + previewDiv.append(previewImg); + } + + function bindCellEvent(cell, j, num) { + if(previewDiv) { + cell.mouseover(function() { + if(j > colsHalf) { + previewDiv.css('left', 0); + previewDiv.css('right', ''); + } else { + previewDiv.css('left', ''); + previewDiv.css('right', 0); + } + previewImg.attr('src', path + num + '.gif'); + K(this).addClass('ke-on'); + }); + } else { + cell.mouseover(function() { + K(this).addClass('ke-on'); + }); + } + cell.mouseout(function() { + K(this).removeClass('ke-on'); + }); + cell.click(function(e) { + self.insertHtml('').hideMenu().focus(); + e.stop(); + }); + } + + function createEmoticonsTable(pageNum, parentDiv) { + var table = document.createElement('table'); + parentDiv.append(table); + if(previewDiv) { + K(table).mouseover(function() { + previewDiv.show('block'); + }); + K(table).mouseout(function() { + previewDiv.hide(); + }); + elements.push(K(table)); + } + table.className = 'ke-table'; + table.cellPadding = 0; + table.cellSpacing = 0; + table.border = 0; + var num = (pageNum - 1) * cells + startNum; + for(var i = 0; i < rows; i++) { + var row = table.insertRow(i); + for(var j = 0; j < cols; j++) { + var cell = K(row.insertCell(j)); + cell.addClass('ke-cell'); + bindCellEvent(cell, j, num); + var span = K('') + .css('background-position', '-' + (24 * num) + 'px 0px') + .css('background-image', 'url(' + path + 'static.gif)'); + cell.append(span); + elements.push(cell); + num++; + } + } + return table; + } + var table = createEmoticonsTable(currentPageNum, wrapperDiv); + + function removeEvent() { + K.each(elements, function() { + this.unbind(); + }); + } + var pageDiv; + + function bindPageEvent(el, pageNum) { + el.click(function(e) { + removeEvent(); + table.parentNode.removeChild(table); + pageDiv.remove(); + table = createEmoticonsTable(pageNum, wrapperDiv); + createPageTable(pageNum); + currentPageNum = pageNum; + e.stop(); + }); + } + + function createPageTable(currentPageNum) { + pageDiv = K('
    '); + wrapperDiv.append(pageDiv); + for(var pageNum = 1; pageNum <= pages; pageNum++) { + if(currentPageNum !== pageNum) { + var a = K('[' + pageNum + ']'); + bindPageEvent(a, pageNum); + pageDiv.append(a); + elements.push(a); + } else { + pageDiv.append(K('@[' + pageNum + ']')); + } + pageDiv.append(K('@ ')); + } + } + createPageTable(currentPageNum); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('filemanager', function(K) { + var self = this, + name = 'filemanager', + fileManagerJson = K.undef(self.fileManagerJson, self.basePath + 'php/file_manager_json.php'), + imgPath = self.pluginsPath + name + '/images/', + lang = self.lang(name + '.'); + + function makeFileTitle(filename, filesize, datetime) { + return filename + ' (' + Math.ceil(filesize / 1024) + 'KB, ' + datetime + ')'; + } + + function bindTitle(el, data) { + if(data.is_dir) { + el.attr('title', data.filename); + } else { + el.attr('title', makeFileTitle(data.filename, data.filesize, data.datetime)); + } + } + self.plugin.filemanagerDialog = function(options) { + var width = K.undef(options.width, 650), + height = K.undef(options.height, 510), + dirName = K.undef(options.dirName, ''), + viewType = K.undef(options.viewType, 'VIEW').toUpperCase(), // "LIST" or "VIEW" + clickFn = options.clickFn; + var html = [ + '
    ', + // header start + '
    ', + // left start + '
    ', + ' ', + '' + lang.moveup + '', + '
    ', + // right start + '
    ', + lang.viewType + ' ', + lang.orderType + ' ', + '
    ', + '
    ', + '
    ', + // body start + '
    ', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: width, + height: height, + title: self.lang(name), + body: html + }), + div = dialog.div, + bodyDiv = K('.ke-plugin-filemanager-body', div), + moveupImg = K('[name="moveupImg"]', div), + moveupLink = K('[name="moveupLink"]', div), + viewServerBtn = K('[name="viewServer"]', div), + viewTypeBox = K('[name="viewType"]', div), + orderTypeBox = K('[name="orderType"]', div); + + function reloadPage(path, order, func) { + var param = 'path=' + path + '&order=' + order + '&dir=' + dirName; + dialog.showLoading(self.lang('ajaxLoading')); + K.ajax(K.addParam(fileManagerJson, param + '&' + new Date().getTime()), function(data) { + dialog.hideLoading(); + func(data); + }); + } + var elList = []; + + function bindEvent(el, result, data, createFunc) { + var fileUrl = K.formatUrl(result.current_url + data.filename, 'absolute'), + dirPath = encodeURIComponent(result.current_dir_path + data.filename + '/'); + if(data.is_dir) { + el.click(function(e) { + reloadPage(dirPath, orderTypeBox.val(), createFunc); + }); + } else if(data.is_photo) { + el.click(function(e) { + clickFn.call(this, fileUrl, data.filename); + }); + } else { + el.click(function(e) { + clickFn.call(this, fileUrl, data.filename); + }); + } + elList.push(el); + } + + function createCommon(result, createFunc) { + // remove events + K.each(elList, function() { + this.unbind(); + }); + moveupLink.unbind(); + viewTypeBox.unbind(); + orderTypeBox.unbind(); + // add events + if(result.current_dir_path) { + moveupLink.click(function(e) { + reloadPage(result.moveup_dir_path, orderTypeBox.val(), createFunc); + }); + } + + function changeFunc() { + if(viewTypeBox.val() == 'VIEW') { + reloadPage(result.current_dir_path, orderTypeBox.val(), createView); + } else { + reloadPage(result.current_dir_path, orderTypeBox.val(), createList); + } + } + viewTypeBox.change(changeFunc); + orderTypeBox.change(changeFunc); + bodyDiv.html(''); + } + + function createList(result) { + createCommon(result, createList); + var table = document.createElement('table'); + table.className = 'ke-table'; + table.cellPadding = 0; + table.cellSpacing = 0; + table.border = 0; + bodyDiv.append(table); + var fileList = result.file_list; + for(var i = 0, len = fileList.length; i < len; i++) { + var data = fileList[i], + row = K(table.insertRow(i)); + row.mouseover(function(e) { + K(this).addClass('ke-on'); + }) + .mouseout(function(e) { + K(this).removeClass('ke-on'); + }); + var iconUrl = imgPath + (data.is_dir ? 'folder-16.gif' : 'file-16.gif'), + img = K('' + data.filename + ''), + cell0 = K(row[0].insertCell(0)).addClass('ke-cell ke-name').append(img).append(document.createTextNode(' ' + data.filename)); + if(!data.is_dir || data.has_file) { + row.css('cursor', 'pointer'); + cell0.attr('title', data.filename); + bindEvent(cell0, result, data, createList); + } else { + cell0.attr('title', lang.emptyFolder); + } + K(row[0].insertCell(1)).addClass('ke-cell ke-size').html(data.is_dir ? '-' : Math.ceil(data.filesize / 1024) + 'KB'); + K(row[0].insertCell(2)).addClass('ke-cell ke-datetime').html(data.datetime); + } + } + + function createView(result) { + createCommon(result, createView); + var fileList = result.file_list; + for(var i = 0, len = fileList.length; i < len; i++) { + var data = fileList[i], + div = K('
    '); + bodyDiv.append(div); + var photoDiv = K('
    ') + .mouseover(function(e) { + K(this).addClass('ke-on'); + }) + .mouseout(function(e) { + K(this).removeClass('ke-on'); + }); + div.append(photoDiv); + var fileUrl = result.current_url + data.filename, + iconUrl = data.is_dir ? imgPath + 'folder-64.gif' : (data.is_photo ? fileUrl : imgPath + 'file-64.gif'); + var img = K('' + data.filename + ''); + if(!data.is_dir || data.has_file) { + photoDiv.css('cursor', 'pointer'); + bindTitle(photoDiv, data); + bindEvent(photoDiv, result, data, createView); + } else { + photoDiv.attr('title', lang.emptyFolder); + } + photoDiv.append(img); + div.append('
    ' + data.filename + '
    '); + } + } + viewTypeBox.val(viewType); + reloadPage('', orderTypeBox.val(), viewType == 'VIEW' ? createView : createList); + return dialog; + } + +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('flash', function(K) { + var self = this, + name = 'flash', + lang = self.lang(name + '.'), + allowFlashUpload = K.undef(self.allowFlashUpload, true), + allowFileManager = K.undef(self.allowFileManager, false), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'); + self.plugin.flash = { + edit: function() { + var html = [ + '
    ', + //url + '
    ', + '', + '  ', + '  ', + '', + '', + '', + '
    ', + //width + '
    ', + '', + ' ', + '
    ', + //height + '
    ', + '', + ' ', + '
    ', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var url = K.trim(urlBox.val()), + width = widthBox.val(), + height = heightBox.val(); + if(url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if(!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if(!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + var html = K.mediaImg(self.themesPath + 'common/blank.gif', { + src: url, + type: K.mediaType('.swf'), + width: width, + height: height, + quality: 'high' + }); + self.insertHtml(html).hideDialog().focus(); + } + } + }), + div = dialog.div, + urlBox = K('[name="url"]', div), + viewServerBtn = K('[name="viewServer"]', div), + widthBox = K('[name="width"]', div), + heightBox = K('[name="height"]', div); + urlBox.val('http://'); + + if(allowFlashUpload) { + var uploadbutton = K.uploadbutton({ + button: K('.ke-upload-button', div)[0], + fieldName: filePostName, + extraParams: extraParams, + url: K.addParam(uploadJson, 'dir=flash'), + afterUpload: function(data) { + dialog.hideLoading(); + if(data.error === 0) { + var url = data.url; + if(formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + urlBox.val(url); + if(self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + alert(self.lang('uploadSuccess')); + } else { + alert(data.message); + } + }, + afterError: function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + }); + } else { + K('.ke-upload-button', div).hide(); + } + + if(allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType: 'LIST', + dirName: 'flash', + clickFn: function(url, title) { + if(self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if(self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + + var img = self.plugin.getSelectedFlash(); + if(img) { + var attrs = K.mediaAttrs(img.attr('data-ke-tag')); + urlBox.val(attrs.src); + widthBox.val(K.removeUnit(img.css('width')) || attrs.width || 0); + heightBox.val(K.removeUnit(img.css('height')) || attrs.height || 0); + } + urlBox[0].focus(); + urlBox[0].select(); + }, + 'delete': function() { + self.plugin.getSelectedFlash().remove(); + // [IE] 删除图片后立即点击图片按钮出错 + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.flash.edit); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('image', function(K) { + var self = this, + name = 'image', + allowImageUpload = K.undef(self.allowImageUpload, true), + allowImageRemote = K.undef(self.allowImageRemote, true), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + allowFileManager = K.undef(self.allowFileManager, false), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'), + imageTabIndex = K.undef(self.imageTabIndex, 0), + imgPath = self.pluginsPath + 'image/images/', + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + fillDescAfterUploadImage = K.undef(self.fillDescAfterUploadImage, false), + lang = self.lang(name + '.'); + + self.plugin.imageDialog = function(options) { + var imageUrl = options.imageUrl, + imageWidth = K.undef(options.imageWidth, ''), + imageHeight = K.undef(options.imageHeight, ''), + imageTitle = K.undef(options.imageTitle, ''), + imageAlign = K.undef(options.imageAlign, ''), + showRemote = K.undef(options.showRemote, true), + showLocal = K.undef(options.showLocal, true), + tabIndex = K.undef(options.tabIndex, 0), + clickFn = options.clickFn; + var target = 'kindeditor_upload_iframe_' + new Date().getTime(); + var hiddenElements = []; + for(var k in extraParams) { + hiddenElements.push(''); + } + var html = [ + '
    ', + //tabs + '
    ', + //remote image - start + '', + //remote image - end + //local upload - start + '', + //local upload - end + '
    ' + ].join(''); + var dialogWidth = showLocal || allowFileManager ? 450 : 400, + dialogHeight = showLocal && showRemote ? 300 : 250; + var dialog = self.createDialog({ + name: name, + width: dialogWidth, + height: dialogHeight, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + // Bugfix: http://code.google.com/p/kindeditor/issues/detail?id=319 + if(dialog.isLoading) { + return; + } + // insert local image + if(showLocal && showRemote && tabs && tabs.selectedIndex === 1 || !showRemote) { + if(uploadbutton.fileBox.val() == '') { + alert(self.lang('pleaseSelectFile')); + return; + } + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + localUrlBox.val(''); + return; + } + // insert remote image + var url = K.trim(urlBox.val()), + width = widthBox.val(), + height = heightBox.val(), + title = titleBox.val(), + align = ''; + alignBox.each(function() { + if(this.checked) { + align = this.value; + return false; + } + }); + if(url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if(!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if(!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + clickFn.call(self, url, title, width, height, 0, align); + } + }, + beforeRemove: function() { + viewServerBtn.unbind(); + widthBox.unbind(); + heightBox.unbind(); + refreshBtn.unbind(); + } + }), + div = dialog.div; + + var urlBox = K('[name="url"]', div), + localUrlBox = K('[name="localUrl"]', div), + viewServerBtn = K('[name="viewServer"]', div), + widthBox = K('.tab1 [name="width"]', div), + heightBox = K('.tab1 [name="height"]', div), + refreshBtn = K('.ke-refresh-btn', div), + titleBox = K('.tab1 [name="title"]', div), + alignBox = K('.tab1 [name="align"]', div); + + var tabs; + if(showRemote && showLocal) { + tabs = K.tabs({ + src: K('.tabs', div), + afterSelect: function(i) {} + }); + tabs.add({ + title: lang.remoteImage, + panel: K('.tab1', div) + }); + tabs.add({ + title: lang.localImage, + panel: K('.tab2', div) + }); + tabs.select(tabIndex); + } else if(showRemote) { + K('.tab1', div).show(); + } else if(showLocal) { + K('.tab2', div).show(); + } + + var uploadbutton = K.uploadbutton({ + button: K('.ke-upload-button', div)[0], + fieldName: filePostName, + form: K('.ke-form', div), + target: target, + width: 70, + afterUpload: function(data) { + dialog.hideLoading(); + if(data.error === 0) { + var url = data.url; + if(formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + if(self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + if(!fillDescAfterUploadImage) { + clickFn.call(self, url, data.title, data.width, data.height, data.border, data.align); + } else { + K(".ke-dialog-row #remoteUrl", div).val(url); + K(".ke-tabs-li", div)[0].click(); + K(".ke-refresh-btn", div).click(); + } + } else { + alert(data.message); + } + }, + afterError: function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + localUrlBox.val(uploadbutton.fileBox.val()); + }); + if(allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType: 'VIEW', + dirName: 'image', + clickFn: function(url, title) { + if(self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if(self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + var originalWidth = 0, + originalHeight = 0; + + function setSize(width, height) { + widthBox.val(width); + heightBox.val(height); + originalWidth = width; + originalHeight = height; + } + refreshBtn.click(function(e) { + var tempImg = K('', document).css({ + position: 'absolute', + visibility: 'hidden', + top: 0, + left: '-1000px' + }); + tempImg.bind('load', function() { + setSize(tempImg.width(), tempImg.height()); + tempImg.remove(); + }); + K(document.body).append(tempImg); + }); + widthBox.change(function(e) { + if(originalWidth > 0) { + heightBox.val(Math.round(originalHeight / originalWidth * parseInt(this.value, 10))); + } + }); + heightBox.change(function(e) { + if(originalHeight > 0) { + widthBox.val(Math.round(originalWidth / originalHeight * parseInt(this.value, 10))); + } + }); + urlBox.val(options.imageUrl); + setSize(options.imageWidth, options.imageHeight); + titleBox.val(options.imageTitle); + alignBox.each(function() { + if(this.value === options.imageAlign) { + this.checked = true; + return false; + } + }); + if(showRemote && tabIndex === 0) { + urlBox[0].focus(); + urlBox[0].select(); + } + return dialog; + }; + self.plugin.image = { + edit: function() { + var img = self.plugin.getSelectedImage(); + self.plugin.imageDialog({ + imageUrl: img ? img.attr('data-ke-src') : 'http://', + imageWidth: img ? img.width() : '', + imageHeight: img ? img.height() : '', + imageTitle: img ? img.attr('title') : '', + imageAlign: img ? img.attr('align') : '', + showRemote: allowImageRemote, + showLocal: allowImageUpload, + tabIndex: img ? 0 : imageTabIndex, + clickFn: function(url, title, width, height, border, align) { + if(img) { + img.attr('src', url); + img.attr('data-ke-src', url); + img.attr('width', width); + img.attr('height', height); + img.attr('title', title); + img.attr('align', align); + img.attr('alt', title); + } else { + self.exec('insertimage', url, title, width, height, border, align); + } + // Bugfix: [Firefox] 上传图片后,总是出现正在加载的样式,需要延迟执行hideDialog + setTimeout(function() { + self.hideDialog().focus(); + }, 0); + } + }); + }, + 'delete': function() { + var target = self.plugin.getSelectedImage(); + if(target.parent().name == 'a') { + target = target.parent(); + } + target.remove(); + // [IE] 删除图片后立即点击图片按钮出错 + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.image.edit); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('insertfile', function(K) { + var self = this, + name = 'insertfile', + allowFileUpload = K.undef(self.allowFileUpload, true), + allowFileManager = K.undef(self.allowFileManager, false), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'), + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + lang = self.lang(name + '.'); + self.plugin.fileDialog = function(options) { + var fileUrl = K.undef(options.fileUrl, 'http://'), + fileTitle = K.undef(options.fileTitle, ''), + clickFn = options.clickFn; + var html = [ + '
    ', + '
    ', + '', + '  ', + '  ', + '', + '', + '', + '
    ', + //title + '
    ', + '', + '
    ', + '
    ', + //form end + '', + '' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var url = K.trim(urlBox.val()), + title = titleBox.val(); + if(url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if(K.trim(title) === '') { + title = url; + } + clickFn.call(self, url, title); + } + } + }), + div = dialog.div; + + var urlBox = K('[name="url"]', div), + viewServerBtn = K('[name="viewServer"]', div), + titleBox = K('[name="title"]', div); + + if(allowFileUpload) { + var uploadbutton = K.uploadbutton({ + button: K('.ke-upload-button', div)[0], + fieldName: filePostName, + url: K.addParam(uploadJson, 'dir=file'), + extraParams: extraParams, + afterUpload: function(data) { + dialog.hideLoading(); + if(data.error === 0) { + var url = data.url; + if(formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + urlBox.val(url); + if(self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + alert(self.lang('uploadSuccess')); + } else { + alert(data.message); + } + }, + afterError: function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + }); + } else { + K('.ke-upload-button', div).hide(); + } + if(allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType: 'LIST', + dirName: 'file', + clickFn: function(url, title) { + if(self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if(self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + urlBox.val(fileUrl); + titleBox.val(fileTitle); + urlBox[0].focus(); + urlBox[0].select(); + }; + self.clickToolbar(name, function() { + self.plugin.fileDialog({ + clickFn: function(url, title) { + var html = '' + title + ''; + self.insertHtml(html).hideDialog().focus(); + } + }); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('lineheight', function(K) { + var self = this, + name = 'lineheight', + lang = self.lang(name + '.'); + self.clickToolbar(name, function() { + var curVal = '', + commonNode = self.cmd.commonNode({ + '*': '.line-height' + }); + if(commonNode) { + curVal = commonNode.css('line-height'); + } + var menu = self.createMenu({ + name: name, + width: 150 + }); + K.each(lang.lineHeight, function(i, row) { + K.each(row, function(key, val) { + menu.addItem({ + title: val, + checked: curVal === key, + click: function() { + self.cmd.toggle('', { + span: '.line-height=' + key + }); + self.updateState(); + self.addBookmark(); + self.hideMenu(); + } + }); + }); + }); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('link', function(K) { + var self = this, + name = 'link'; + self.plugin.link = { + edit: function() { + var lang = self.lang(name + '.'), + html = '
    ' + + //url + '
    ' + + '' + + '
    ' + + //type + '
    ' + + '' + + '' + + '
    ' + + '
    ', + dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var url = K.trim(urlBox.val()); + if(url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + self.exec('createlink', url, typeBox.val()).hideDialog().focus(); + } + } + }), + div = dialog.div, + urlBox = K('input[name="url"]', div), + typeBox = K('select[name="type"]', div); + urlBox.val('http://'); + typeBox[0].options[0] = new Option(lang.newWindow, '_blank'); + typeBox[0].options[1] = new Option(lang.selfWindow, ''); + self.cmd.selection(); + var a = self.plugin.getSelectedLink(); + if(a) { + self.cmd.range.selectNode(a[0]); + self.cmd.select(); + urlBox.val(a.attr('data-ke-src')); + typeBox.val(a.attr('target')); + } + urlBox[0].focus(); + urlBox[0].select(); + }, + 'delete': function() { + self.exec('unlink', null); + } + }; + self.clickToolbar(name, self.plugin.link.edit); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +// Google Maps: http://code.google.com/apis/maps/index.html + +KindEditor.plugin('map', function(K) { + var self = this, + name = 'map', + lang = self.lang(name + '.'); + self.clickToolbar(name, function() { + var html = ['
    ', + '
    ', + lang.address + ' ', + '', + '', + '', + '
    ', + '
    ', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: 600, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var geocoder = win.geocoder, + map = win.map, + center = map.getCenter().lat() + ',' + map.getCenter().lng(), + zoom = map.getZoom(), + maptype = map.getMapTypeId(), + url = 'http://maps.googleapis.com/maps/api/staticmap'; + url += '?center=' + encodeURIComponent(center); + url += '&zoom=' + encodeURIComponent(zoom); + url += '&size=558x360'; + url += '&maptype=' + encodeURIComponent(maptype); + url += '&markers=' + encodeURIComponent(center); + url += '&language=' + self.langType; + url += '&sensor=false'; + self.exec('insertimage', url).hideDialog().focus(); + } + }, + beforeRemove: function() { + searchBtn.remove(); + if(doc) { + doc.write(''); + } + iframe.remove(); + } + }); + var div = dialog.div, + addressBox = K('[name="address"]', div), + searchBtn = K('[name="searchBtn"]', div), + win, doc; + var iframeHtml = ['', + '', + '', + '', + '', + '', + '', + '
    ', + '' + ].join('\n'); + // TODO:用doc.write(iframeHtml)方式加载时,在IE6上第一次加载报错,暂时使用src方式 + var iframe = K(''); + + function ready() { + win = iframe[0].contentWindow; + doc = K.iframeDoc(iframe); + //doc.open(); + //doc.write(iframeHtml); + //doc.close(); + } + iframe.bind('load', function() { + iframe.unbind('load'); + if(K.IE) { + ready(); + } else { + setTimeout(ready, 0); + } + }); + K('.ke-map', div).replaceWith(iframe); + // search map + searchBtn.click(function() { + win.search(addressBox.val()); + }); + }); +}); +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('media', function(K) { + var self = this, + name = 'media', + lang = self.lang(name + '.'), + allowMediaUpload = K.undef(self.allowMediaUpload, true), + allowFileManager = K.undef(self.allowFileManager, false), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'); + self.plugin.media = { + edit: function() { + var html = [ + '
    ', + //url + '
    ', + '', + '  ', + '  ', + '', + '', + '', + '
    ', + //width + '
    ', + '', + '', + '
    ', + //height + '
    ', + '', + '', + '
    ', + //autostart + '
    ', + '', + ' ', + '
    ', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: 450, + height: 230, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var url = K.trim(urlBox.val()), + width = widthBox.val(), + height = heightBox.val(); + if(url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if(!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if(!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + var html = K.mediaImg(self.themesPath + 'common/blank.gif', { + src: url, + type: K.mediaType(url), + width: width, + height: height, + autostart: autostartBox[0].checked ? 'true' : 'false', + loop: 'true' + }); + self.insertHtml(html).hideDialog().focus(); + } + } + }), + div = dialog.div, + urlBox = K('[name="url"]', div), + viewServerBtn = K('[name="viewServer"]', div), + widthBox = K('[name="width"]', div), + heightBox = K('[name="height"]', div), + autostartBox = K('[name="autostart"]', div); + urlBox.val('http://'); + + if(allowMediaUpload) { + var uploadbutton = K.uploadbutton({ + button: K('.ke-upload-button', div)[0], + fieldName: filePostName, + extraParams: extraParams, + url: K.addParam(uploadJson, 'dir=media'), + afterUpload: function(data) { + dialog.hideLoading(); + if(data.error === 0) { + var url = data.url; + if(formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + urlBox.val(url); + if(self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + alert(self.lang('uploadSuccess')); + } else { + alert(data.message); + } + }, + afterError: function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + }); + } else { + K('.ke-upload-button', div).hide(); + } + + if(allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType: 'LIST', + dirName: 'media', + clickFn: function(url, title) { + if(self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if(self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + + var img = self.plugin.getSelectedMedia(); + if(img) { + var attrs = K.mediaAttrs(img.attr('data-ke-tag')); + urlBox.val(attrs.src); + widthBox.val(K.removeUnit(img.css('width')) || attrs.width || 0); + heightBox.val(K.removeUnit(img.css('height')) || attrs.height || 0); + autostartBox[0].checked = (attrs.autostart === 'true'); + } + urlBox[0].focus(); + urlBox[0].select(); + }, + 'delete': function() { + self.plugin.getSelectedMedia().remove(); + // [IE] 删除图片后立即点击图片按钮出错 + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.media.edit); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + + +(function(K) { + + function KSWFUpload(options) { + this.init(options); + } + K.extend(KSWFUpload, { + init : function(options) { + var self = this; + options.afterError = options.afterError || function(str) { + alert(str); + }; + self.options = options; + self.progressbars = {}; + // template + self.div = K(options.container).html([ + '
    ', + '
    ', + '
    ', + '', + '
    ', + '
    ' + options.uploadDesc + '
    ', + '', + '', + '', + '
    ', + '
    ', + '
    ' + ].join('')); + self.bodyDiv = K('.ke-swfupload-body', self.div); + + function showError(itemDiv, msg) { + K('.ke-status > div', itemDiv).hide(); + K('.ke-message', itemDiv).addClass('ke-error').show().html(K.escape(msg)); + } + + var settings = { + debug : false, + upload_url : options.uploadUrl, + flash_url : options.flashUrl, + file_post_name : options.filePostName, + button_placeholder : K('.ke-swfupload-button > input', self.div)[0], + button_image_url: options.buttonImageUrl, + button_width: options.buttonWidth, + button_height: options.buttonHeight, + button_cursor : SWFUpload.CURSOR.HAND, + file_types : options.fileTypes, + file_types_description : options.fileTypesDesc, + file_upload_limit : options.fileUploadLimit, + file_size_limit : options.fileSizeLimit, + post_params : options.postParams, + file_queued_handler : function(file) { + file.url = self.options.fileIconUrl; + self.appendFile(file); + }, + file_queue_error_handler : function(file, errorCode, message) { + var errorName = ''; + switch (errorCode) { + case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED: + errorName = options.queueLimitExceeded; + break; + case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: + errorName = options.fileExceedsSizeLimit; + break; + case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE: + errorName = options.zeroByteFile; + break; + case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE: + errorName = options.invalidFiletype; + break; + default: + errorName = options.unknownError; + break; + } + K.DEBUG && alert(errorName); + }, + upload_start_handler : function(file) { + var self = this; + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv); + K('.ke-status > div', itemDiv).hide(); + K('.ke-progressbar', itemDiv).show(); + }, + upload_progress_handler : function(file, bytesLoaded, bytesTotal) { + var percent = Math.round(bytesLoaded * 100 / bytesTotal); + var progressbar = self.progressbars[file.id]; + progressbar.bar.css('width', Math.round(percent * 80 / 100) + 'px'); + progressbar.percent.html(percent + '%'); + }, + upload_error_handler : function(file, errorCode, message) { + if (file && file.filestatus == SWFUpload.FILE_STATUS.ERROR) { + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv).eq(0); + showError(itemDiv, self.options.errorMessage); + } + }, + upload_success_handler : function(file, serverData) { + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv).eq(0); + var data = {}; + try { + data = K.json(serverData); + } catch (e) { + self.options.afterError.call(this, '' + serverData + ''); + } + if (data.error !== 0) { + showError(itemDiv, K.DEBUG ? data.message : self.options.errorMessage); + return; + } + file.url = data.url; + K('.ke-img', itemDiv).attr('src', file.url).attr('data-status', file.filestatus).data('data', data); + K('.ke-status > div', itemDiv).hide(); + } + }; + self.swfu = new SWFUpload(settings); + + K('.ke-swfupload-startupload input', self.div).click(function() { + self.swfu.startUpload(); + }); + }, + getUrlList : function() { + var list = []; + K('.ke-img', self.bodyDiv).each(function() { + var img = K(this); + var status = img.attr('data-status'); + if (status == SWFUpload.FILE_STATUS.COMPLETE) { + list.push(img.data('data')); + } + }); + return list; + }, + removeFile : function(fileId) { + var self = this; + self.swfu.cancelUpload(fileId); + var itemDiv = K('div[data-id="' + fileId + '"]', self.bodyDiv); + K('.ke-photo', itemDiv).unbind(); + K('.ke-delete', itemDiv).unbind(); + itemDiv.remove(); + }, + removeFiles : function() { + var self = this; + K('.ke-item', self.bodyDiv).each(function() { + self.removeFile(K(this).attr('data-id')); + }); + }, + appendFile : function(file) { + var self = this; + var itemDiv = K('
    '); + self.bodyDiv.append(itemDiv); + var photoDiv = K('
    ') + .mouseover(function(e) { + K(this).addClass('ke-on'); + }) + .mouseout(function(e) { + K(this).removeClass('ke-on'); + }); + itemDiv.append(photoDiv); + + var img = K('' + file.name + ''); + photoDiv.append(img); + K('').appendTo(photoDiv).click(function() { + self.removeFile(file.id); + }); + var statusDiv = K('
    ').appendTo(photoDiv); + // progressbar + K(['
    ', + '
    ', + '
    0%
    '].join('')).hide().appendTo(statusDiv); + // message + K('
    ' + self.options.pendingMessage + '
    ').appendTo(statusDiv); + + itemDiv.append('
    ' + file.name + '
    '); + + self.progressbars[file.id] = { + bar : K('.ke-progressbar-bar-inner', photoDiv), + percent : K('.ke-progressbar-percent', photoDiv) + }; + }, + remove : function() { + this.removeFiles(); + this.swfu.destroy(); + this.div.html(''); + } + }); + + K.swfupload = function(element, options) { + return new KSWFUpload(element, options); + }; + + })(KindEditor); + + KindEditor.plugin('multiimage', function(K) { + var self = this, name = 'multiimage', + formatUploadUrl = K.undef(self.formatUploadUrl, true), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'), + imgPath = self.pluginsPath + 'multiimage/images/', + imageSizeLimit = K.undef(self.imageSizeLimit, '1MB'), + imageFileTypes = K.undef(self.imageFileTypes, '*.jpg;*.gif;*.png'), + imageUploadLimit = K.undef(self.imageUploadLimit, 20), + filePostName = K.undef(self.filePostName, 'imgFile'), + lang = self.lang(name + '.'); + + self.plugin.multiImageDialog = function(options) { + var clickFn = options.clickFn, + uploadDesc = K.tmpl(lang.uploadDesc, {uploadLimit : imageUploadLimit, sizeLimit : imageSizeLimit}); + var html = [ + '
    ', + '
    ', + '
    ', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name : name, + width : 650, + height : 510, + title : self.lang(name), + body : html, + previewBtn : { + name : lang.insertAll, + click : function(e) { + clickFn.call(self, swfupload.getUrlList()); + } + }, + yesBtn : { + name : lang.clearAll, + click : function(e) { + swfupload.removeFiles(); + } + }, + beforeRemove : function() { + // IE9 bugfix: https://github.com/kindsoft/kindeditor/issues/72 + if (!K.IE || K.V <= 8) { + swfupload.remove(); + } + } + }), + div = dialog.div; + + var swfupload = K.swfupload({ + container : K('.swfupload', div), + buttonImageUrl : imgPath + (self.langType == 'zh-CN' ? 'select-files-zh-CN.png' : 'select-files-en.png'), + buttonWidth : self.langType == 'zh-CN' ? 72 : 88, + buttonHeight : 23, + fileIconUrl : imgPath + 'image.png', + uploadDesc : uploadDesc, + startButtonValue : lang.startUpload, + uploadUrl : K.addParam(uploadJson, 'dir=image'), + flashUrl : imgPath + 'swfupload.swf', + filePostName : filePostName, + fileTypes : '*.jpg;*.jpeg;*.gif;*.png;*.bmp', + fileTypesDesc : 'Image Files', + fileUploadLimit : imageUploadLimit, + fileSizeLimit : imageSizeLimit, + postParams : K.undef(self.extraFileUploadParams, {}), + queueLimitExceeded : lang.queueLimitExceeded, + fileExceedsSizeLimit : lang.fileExceedsSizeLimit, + zeroByteFile : lang.zeroByteFile, + invalidFiletype : lang.invalidFiletype, + unknownError : lang.unknownError, + pendingMessage : lang.pending, + errorMessage : lang.uploadError, + afterError : function(html) { + self.errorDialog(html); + } + }); + + return dialog; + }; + self.clickToolbar(name, function() { + self.plugin.multiImageDialog({ + clickFn : function (urlList) { + if (urlList.length === 0) { + return; + } + K.each(urlList, function(i, data) { + if (self.afterUpload) { + self.afterUpload.call(self, data.url, data, 'multiimage'); + } + self.exec('insertimage', data.url, data.title, data.width, data.height, data.border, data.align); + }); + // Bugfix: [Firefox] 上传图片后,总是出现正在加载的样式,需要延迟执行hideDialog + setTimeout(function() { + self.hideDialog().focus(); + }, 0); + } + }); + }); + }); + + + /** + * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com + * + * mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/ + * + * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilz閚 and Mammon Media and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + */ + + + /* ******************* */ + /* Constructor & Init */ + /* ******************* */ + + (function() { + + window.SWFUpload = function (settings) { + this.initSWFUpload(settings); + }; + + SWFUpload.prototype.initSWFUpload = function (settings) { + try { + this.customSettings = {}; // A container where developers can place their own settings associated with this instance. + this.settings = settings; + this.eventQueue = []; + this.movieName = "KindEditor_SWFUpload_" + SWFUpload.movieCount++; + this.movieElement = null; + + + // Setup global control tracking + SWFUpload.instances[this.movieName] = this; + + // Load the settings. Load the Flash movie. + this.initSettings(); + this.loadFlash(); + this.displayDebugInfo(); + } catch (ex) { + delete SWFUpload.instances[this.movieName]; + throw ex; + } + }; + + /* *************** */ + /* Static Members */ + /* *************** */ + SWFUpload.instances = {}; + SWFUpload.movieCount = 0; + SWFUpload.version = "2.2.0 2009-03-25"; + SWFUpload.QUEUE_ERROR = { + QUEUE_LIMIT_EXCEEDED : -100, + FILE_EXCEEDS_SIZE_LIMIT : -110, + ZERO_BYTE_FILE : -120, + INVALID_FILETYPE : -130 + }; + SWFUpload.UPLOAD_ERROR = { + HTTP_ERROR : -200, + MISSING_UPLOAD_URL : -210, + IO_ERROR : -220, + SECURITY_ERROR : -230, + UPLOAD_LIMIT_EXCEEDED : -240, + UPLOAD_FAILED : -250, + SPECIFIED_FILE_ID_NOT_FOUND : -260, + FILE_VALIDATION_FAILED : -270, + FILE_CANCELLED : -280, + UPLOAD_STOPPED : -290 + }; + SWFUpload.FILE_STATUS = { + QUEUED : -1, + IN_PROGRESS : -2, + ERROR : -3, + COMPLETE : -4, + CANCELLED : -5 + }; + SWFUpload.BUTTON_ACTION = { + SELECT_FILE : -100, + SELECT_FILES : -110, + START_UPLOAD : -120 + }; + SWFUpload.CURSOR = { + ARROW : -1, + HAND : -2 + }; + SWFUpload.WINDOW_MODE = { + WINDOW : "window", + TRANSPARENT : "transparent", + OPAQUE : "opaque" + }; + + // Private: takes a URL, determines if it is relative and converts to an absolute URL + // using the current site. Only processes the URL if it can, otherwise returns the URL untouched + SWFUpload.completeURL = function(url) { + if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) { + return url; + } + + var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : ""); + + var indexSlash = window.location.pathname.lastIndexOf("/"); + if (indexSlash <= 0) { + path = "/"; + } else { + path = window.location.pathname.substr(0, indexSlash) + "/"; + } + + return /*currentURL +*/ path + url; + + }; + + + /* ******************** */ + /* Instance Members */ + /* ******************** */ + + // Private: initSettings ensures that all the + // settings are set, getting a default value if one was not assigned. + SWFUpload.prototype.initSettings = function () { + this.ensureDefault = function (settingName, defaultValue) { + this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName]; + }; + + // Upload backend settings + this.ensureDefault("upload_url", ""); + this.ensureDefault("preserve_relative_urls", false); + this.ensureDefault("file_post_name", "Filedata"); + this.ensureDefault("post_params", {}); + this.ensureDefault("use_query_string", false); + this.ensureDefault("requeue_on_error", false); + this.ensureDefault("http_success", []); + this.ensureDefault("assume_success_timeout", 0); + + // File Settings + this.ensureDefault("file_types", "*.*"); + this.ensureDefault("file_types_description", "All Files"); + this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited" + this.ensureDefault("file_upload_limit", 0); + this.ensureDefault("file_queue_limit", 0); + + // Flash Settings + this.ensureDefault("flash_url", "swfupload.swf"); + this.ensureDefault("prevent_swf_caching", true); + + // Button Settings + this.ensureDefault("button_image_url", ""); + this.ensureDefault("button_width", 1); + this.ensureDefault("button_height", 1); + this.ensureDefault("button_text", ""); + this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;"); + this.ensureDefault("button_text_top_padding", 0); + this.ensureDefault("button_text_left_padding", 0); + this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES); + this.ensureDefault("button_disabled", false); + this.ensureDefault("button_placeholder_id", ""); + this.ensureDefault("button_placeholder", null); + this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW); + this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW); + + // Debug Settings + this.ensureDefault("debug", false); + this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API + + // Event Handlers + this.settings.return_upload_start_handler = this.returnUploadStart; + this.ensureDefault("swfupload_loaded_handler", null); + this.ensureDefault("file_dialog_start_handler", null); + this.ensureDefault("file_queued_handler", null); + this.ensureDefault("file_queue_error_handler", null); + this.ensureDefault("file_dialog_complete_handler", null); + + this.ensureDefault("upload_start_handler", null); + this.ensureDefault("upload_progress_handler", null); + this.ensureDefault("upload_error_handler", null); + this.ensureDefault("upload_success_handler", null); + this.ensureDefault("upload_complete_handler", null); + + this.ensureDefault("debug_handler", this.debugMessage); + + this.ensureDefault("custom_settings", {}); + + // Other settings + this.customSettings = this.settings.custom_settings; + + // Update the flash url if needed + if (!!this.settings.prevent_swf_caching) { + this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime(); + } + + if (!this.settings.preserve_relative_urls) { + //this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url); // Don't need to do this one since flash doesn't look at it + this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url); + this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url); + } + + delete this.ensureDefault; + }; + + // Private: loadFlash replaces the button_placeholder element with the flash movie. + SWFUpload.prototype.loadFlash = function () { + var targetElement, tempParent; + + // Make sure an element with the ID we are going to use doesn't already exist + if (document.getElementById(this.movieName) !== null) { + throw "ID " + this.movieName + " is already in use. The Flash Object could not be added"; + } + + // Get the element where we will be placing the flash movie + targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder; + + if (targetElement == undefined) { + throw "Could not find the placeholder element: " + this.settings.button_placeholder_id; + } + + // Append the container and load the flash + tempParent = document.createElement("div"); + tempParent.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers) + targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement); + + // Fix IE Flash/Form bug + if (window[this.movieName] == undefined) { + window[this.movieName] = this.getMovieElement(); + } + + }; + + // Private: getFlashHTML generates the object tag needed to embed the flash in to the document + SWFUpload.prototype.getFlashHTML = function () { + // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay + // Fix bug for IE9 + // http://www.kindsoft.net/view.php?bbsid=7&postid=5825&pagenum=1 + var classid = ''; + if (KindEditor.IE && KindEditor.V > 8) { + classid = ' classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'; + } + return ['', + '', + '', + '', + '', + '', + '', + ''].join(""); + }; + + // Private: getFlashVars builds the parameter string that will be passed + // to flash in the flashvars param. + SWFUpload.prototype.getFlashVars = function () { + // Build a string from the post param object + var paramString = this.buildParamString(); + var httpSuccessString = this.settings.http_success.join(","); + + // Build the parameter string + return ["movieName=", encodeURIComponent(this.movieName), + "&uploadURL=", encodeURIComponent(this.settings.upload_url), + "&useQueryString=", encodeURIComponent(this.settings.use_query_string), + "&requeueOnError=", encodeURIComponent(this.settings.requeue_on_error), + "&httpSuccess=", encodeURIComponent(httpSuccessString), + "&assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout), + "&params=", encodeURIComponent(paramString), + "&filePostName=", encodeURIComponent(this.settings.file_post_name), + "&fileTypes=", encodeURIComponent(this.settings.file_types), + "&fileTypesDescription=", encodeURIComponent(this.settings.file_types_description), + "&fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit), + "&fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit), + "&fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit), + "&debugEnabled=", encodeURIComponent(this.settings.debug_enabled), + "&buttonImageURL=", encodeURIComponent(this.settings.button_image_url), + "&buttonWidth=", encodeURIComponent(this.settings.button_width), + "&buttonHeight=", encodeURIComponent(this.settings.button_height), + "&buttonText=", encodeURIComponent(this.settings.button_text), + "&buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding), + "&buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding), + "&buttonTextStyle=", encodeURIComponent(this.settings.button_text_style), + "&buttonAction=", encodeURIComponent(this.settings.button_action), + "&buttonDisabled=", encodeURIComponent(this.settings.button_disabled), + "&buttonCursor=", encodeURIComponent(this.settings.button_cursor) + ].join(""); + }; + + // Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload + // The element is cached after the first lookup + SWFUpload.prototype.getMovieElement = function () { + if (this.movieElement == undefined) { + this.movieElement = document.getElementById(this.movieName); + } + + if (this.movieElement === null) { + throw "Could not find Flash element"; + } + + return this.movieElement; + }; + + // Private: buildParamString takes the name/value pairs in the post_params setting object + // and joins them up in to a string formatted "name=value&name=value" + SWFUpload.prototype.buildParamString = function () { + var postParams = this.settings.post_params; + var paramStringPairs = []; + + if (typeof(postParams) === "object") { + for (var name in postParams) { + if (postParams.hasOwnProperty(name)) { + paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString())); + } + } + } + + return paramStringPairs.join("&"); + }; + + // Public: Used to remove a SWFUpload instance from the page. This method strives to remove + // all references to the SWF, and other objects so memory is properly freed. + // Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state. + // Credits: Major improvements provided by steffen + SWFUpload.prototype.destroy = function () { + try { + // Make sure Flash is done before we try to remove it + this.cancelUpload(null, false); + + + // Remove the SWFUpload DOM nodes + var movieElement = null; + movieElement = this.getMovieElement(); + + if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE + // Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround) + for (var i in movieElement) { + try { + if (typeof(movieElement[i]) === "function") { + movieElement[i] = null; + } + } catch (ex1) {} + } + + // Remove the Movie Element from the page + try { + movieElement.parentNode.removeChild(movieElement); + } catch (ex) {} + } + + // Remove IE form fix reference + window[this.movieName] = null; + + // Destroy other references + SWFUpload.instances[this.movieName] = null; + delete SWFUpload.instances[this.movieName]; + + this.movieElement = null; + this.settings = null; + this.customSettings = null; + this.eventQueue = null; + this.movieName = null; + + + return true; + } catch (ex2) { + return false; + } + }; + + + // Public: displayDebugInfo prints out settings and configuration + // information about this SWFUpload instance. + // This function (and any references to it) can be deleted when placing + // SWFUpload in production. + SWFUpload.prototype.displayDebugInfo = function () { + this.debug( + [ + "---SWFUpload Instance Info---\n", + "Version: ", SWFUpload.version, "\n", + "Movie Name: ", this.movieName, "\n", + "Settings:\n", + "\t", "upload_url: ", this.settings.upload_url, "\n", + "\t", "flash_url: ", this.settings.flash_url, "\n", + "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n", + "\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n", + "\t", "http_success: ", this.settings.http_success.join(", "), "\n", + "\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n", + "\t", "file_post_name: ", this.settings.file_post_name, "\n", + "\t", "post_params: ", this.settings.post_params.toString(), "\n", + "\t", "file_types: ", this.settings.file_types, "\n", + "\t", "file_types_description: ", this.settings.file_types_description, "\n", + "\t", "file_size_limit: ", this.settings.file_size_limit, "\n", + "\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n", + "\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n", + "\t", "debug: ", this.settings.debug.toString(), "\n", + + "\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n", + + "\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n", + "\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n", + "\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n", + "\t", "button_width: ", this.settings.button_width.toString(), "\n", + "\t", "button_height: ", this.settings.button_height.toString(), "\n", + "\t", "button_text: ", this.settings.button_text.toString(), "\n", + "\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n", + "\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n", + "\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n", + "\t", "button_action: ", this.settings.button_action.toString(), "\n", + "\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n", + + "\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n", + "Event Handlers:\n", + "\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n", + "\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n", + "\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n", + "\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n", + "\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n", + "\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n", + "\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n", + "\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n", + "\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n", + "\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n" + ].join("") + ); + }; + + /* Note: addSetting and getSetting are no longer used by SWFUpload but are included + the maintain v2 API compatibility + */ + // Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used. + SWFUpload.prototype.addSetting = function (name, value, default_value) { + if (value == undefined) { + return (this.settings[name] = default_value); + } else { + return (this.settings[name] = value); + } + }; + + // Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found. + SWFUpload.prototype.getSetting = function (name) { + if (this.settings[name] != undefined) { + return this.settings[name]; + } + + return ""; + }; + + + + // Private: callFlash handles function calls made to the Flash element. + // Calls are made with a setTimeout for some functions to work around + // bugs in the ExternalInterface library. + SWFUpload.prototype.callFlash = function (functionName, argumentArray) { + argumentArray = argumentArray || []; + + var movieElement = this.getMovieElement(); + var returnValue, returnString; + + // Flash's method if calling ExternalInterface methods (code adapted from MooTools). + try { + returnString = movieElement.CallFunction('' + __flash__argumentsToXML(argumentArray, 0) + ''); + returnValue = eval(returnString); + } catch (ex) { + throw "Call to " + functionName + " failed"; + } + + // Unescape file post param values + if (returnValue != undefined && typeof returnValue.post === "object") { + returnValue = this.unescapeFilePostParams(returnValue); + } + + return returnValue; + }; + + /* ***************************** + -- Flash control methods -- + Your UI should use these + to operate SWFUpload + ***************************** */ + + // WARNING: this function does not work in Flash Player 10 + // Public: selectFile causes a File Selection Dialog window to appear. This + // dialog only allows 1 file to be selected. + SWFUpload.prototype.selectFile = function () { + this.callFlash("SelectFile"); + }; + + // WARNING: this function does not work in Flash Player 10 + // Public: selectFiles causes a File Selection Dialog window to appear/ This + // dialog allows the user to select any number of files + // Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names. + // If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around + // for this bug. + SWFUpload.prototype.selectFiles = function () { + this.callFlash("SelectFiles"); + }; + + + // Public: startUpload starts uploading the first file in the queue unless + // the optional parameter 'fileID' specifies the ID + SWFUpload.prototype.startUpload = function (fileID) { + this.callFlash("StartUpload", [fileID]); + }; + + // Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index. + // If you do not specify a fileID the current uploading file or first file in the queue is cancelled. + // If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter. + SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) { + if (triggerErrorEvent !== false) { + triggerErrorEvent = true; + } + this.callFlash("CancelUpload", [fileID, triggerErrorEvent]); + }; + + // Public: stopUpload stops the current upload and requeues the file at the beginning of the queue. + // If nothing is currently uploading then nothing happens. + SWFUpload.prototype.stopUpload = function () { + this.callFlash("StopUpload"); + }; + + /* ************************ + * Settings methods + * These methods change the SWFUpload settings. + * SWFUpload settings should not be changed directly on the settings object + * since many of the settings need to be passed to Flash in order to take + * effect. + * *********************** */ + + // Public: getStats gets the file statistics object. + SWFUpload.prototype.getStats = function () { + return this.callFlash("GetStats"); + }; + + // Public: setStats changes the SWFUpload statistics. You shouldn't need to + // change the statistics but you can. Changing the statistics does not + // affect SWFUpload accept for the successful_uploads count which is used + // by the upload_limit setting to determine how many files the user may upload. + SWFUpload.prototype.setStats = function (statsObject) { + this.callFlash("SetStats", [statsObject]); + }; + + // Public: getFile retrieves a File object by ID or Index. If the file is + // not found then 'null' is returned. + SWFUpload.prototype.getFile = function (fileID) { + if (typeof(fileID) === "number") { + return this.callFlash("GetFileByIndex", [fileID]); + } else { + return this.callFlash("GetFile", [fileID]); + } + }; + + // Public: addFileParam sets a name/value pair that will be posted with the + // file specified by the Files ID. If the name already exists then the + // exiting value will be overwritten. + SWFUpload.prototype.addFileParam = function (fileID, name, value) { + return this.callFlash("AddFileParam", [fileID, name, value]); + }; + + // Public: removeFileParam removes a previously set (by addFileParam) name/value + // pair from the specified file. + SWFUpload.prototype.removeFileParam = function (fileID, name) { + this.callFlash("RemoveFileParam", [fileID, name]); + }; + + // Public: setUploadUrl changes the upload_url setting. + SWFUpload.prototype.setUploadURL = function (url) { + this.settings.upload_url = url.toString(); + this.callFlash("SetUploadURL", [url]); + }; + + // Public: setPostParams changes the post_params setting + SWFUpload.prototype.setPostParams = function (paramsObject) { + this.settings.post_params = paramsObject; + this.callFlash("SetPostParams", [paramsObject]); + }; + + // Public: addPostParam adds post name/value pair. Each name can have only one value. + SWFUpload.prototype.addPostParam = function (name, value) { + this.settings.post_params[name] = value; + this.callFlash("SetPostParams", [this.settings.post_params]); + }; + + // Public: removePostParam deletes post name/value pair. + SWFUpload.prototype.removePostParam = function (name) { + delete this.settings.post_params[name]; + this.callFlash("SetPostParams", [this.settings.post_params]); + }; + + // Public: setFileTypes changes the file_types setting and the file_types_description setting + SWFUpload.prototype.setFileTypes = function (types, description) { + this.settings.file_types = types; + this.settings.file_types_description = description; + this.callFlash("SetFileTypes", [types, description]); + }; + + // Public: setFileSizeLimit changes the file_size_limit setting + SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) { + this.settings.file_size_limit = fileSizeLimit; + this.callFlash("SetFileSizeLimit", [fileSizeLimit]); + }; + + // Public: setFileUploadLimit changes the file_upload_limit setting + SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) { + this.settings.file_upload_limit = fileUploadLimit; + this.callFlash("SetFileUploadLimit", [fileUploadLimit]); + }; + + // Public: setFileQueueLimit changes the file_queue_limit setting + SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) { + this.settings.file_queue_limit = fileQueueLimit; + this.callFlash("SetFileQueueLimit", [fileQueueLimit]); + }; + + // Public: setFilePostName changes the file_post_name setting + SWFUpload.prototype.setFilePostName = function (filePostName) { + this.settings.file_post_name = filePostName; + this.callFlash("SetFilePostName", [filePostName]); + }; + + // Public: setUseQueryString changes the use_query_string setting + SWFUpload.prototype.setUseQueryString = function (useQueryString) { + this.settings.use_query_string = useQueryString; + this.callFlash("SetUseQueryString", [useQueryString]); + }; + + // Public: setRequeueOnError changes the requeue_on_error setting + SWFUpload.prototype.setRequeueOnError = function (requeueOnError) { + this.settings.requeue_on_error = requeueOnError; + this.callFlash("SetRequeueOnError", [requeueOnError]); + }; + + // Public: setHTTPSuccess changes the http_success setting + SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) { + if (typeof http_status_codes === "string") { + http_status_codes = http_status_codes.replace(" ", "").split(","); + } + + this.settings.http_success = http_status_codes; + this.callFlash("SetHTTPSuccess", [http_status_codes]); + }; + + // Public: setHTTPSuccess changes the http_success setting + SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) { + this.settings.assume_success_timeout = timeout_seconds; + this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]); + }; + + // Public: setDebugEnabled changes the debug_enabled setting + SWFUpload.prototype.setDebugEnabled = function (debugEnabled) { + this.settings.debug_enabled = debugEnabled; + this.callFlash("SetDebugEnabled", [debugEnabled]); + }; + + // Public: setButtonImageURL loads a button image sprite + SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) { + if (buttonImageURL == undefined) { + buttonImageURL = ""; + } + + this.settings.button_image_url = buttonImageURL; + this.callFlash("SetButtonImageURL", [buttonImageURL]); + }; + + // Public: setButtonDimensions resizes the Flash Movie and button + SWFUpload.prototype.setButtonDimensions = function (width, height) { + this.settings.button_width = width; + this.settings.button_height = height; + + var movie = this.getMovieElement(); + if (movie != undefined) { + movie.style.width = width + "px"; + movie.style.height = height + "px"; + } + + this.callFlash("SetButtonDimensions", [width, height]); + }; + // Public: setButtonText Changes the text overlaid on the button + SWFUpload.prototype.setButtonText = function (html) { + this.settings.button_text = html; + this.callFlash("SetButtonText", [html]); + }; + // Public: setButtonTextPadding changes the top and left padding of the text overlay + SWFUpload.prototype.setButtonTextPadding = function (left, top) { + this.settings.button_text_top_padding = top; + this.settings.button_text_left_padding = left; + this.callFlash("SetButtonTextPadding", [left, top]); + }; + + // Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button + SWFUpload.prototype.setButtonTextStyle = function (css) { + this.settings.button_text_style = css; + this.callFlash("SetButtonTextStyle", [css]); + }; + // Public: setButtonDisabled disables/enables the button + SWFUpload.prototype.setButtonDisabled = function (isDisabled) { + this.settings.button_disabled = isDisabled; + this.callFlash("SetButtonDisabled", [isDisabled]); + }; + // Public: setButtonAction sets the action that occurs when the button is clicked + SWFUpload.prototype.setButtonAction = function (buttonAction) { + this.settings.button_action = buttonAction; + this.callFlash("SetButtonAction", [buttonAction]); + }; + + // Public: setButtonCursor changes the mouse cursor displayed when hovering over the button + SWFUpload.prototype.setButtonCursor = function (cursor) { + this.settings.button_cursor = cursor; + this.callFlash("SetButtonCursor", [cursor]); + }; + + /* ******************************* + Flash Event Interfaces + These functions are used by Flash to trigger the various + events. + + All these functions a Private. + + Because the ExternalInterface library is buggy the event calls + are added to a queue and the queue then executed by a setTimeout. + This ensures that events are executed in a determinate order and that + the ExternalInterface bugs are avoided. + ******************************* */ + + SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) { + // Warning: Don't call this.debug inside here or you'll create an infinite loop + + if (argumentArray == undefined) { + argumentArray = []; + } else if (!(argumentArray instanceof Array)) { + argumentArray = [argumentArray]; + } + + var self = this; + if (typeof this.settings[handlerName] === "function") { + // Queue the event + this.eventQueue.push(function () { + this.settings[handlerName].apply(this, argumentArray); + }); + + // Execute the next queued event + setTimeout(function () { + self.executeNextEvent(); + }, 0); + + } else if (this.settings[handlerName] !== null) { + throw "Event handler " + handlerName + " is unknown or is not a function"; + } + }; + + // Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout + // we must queue them in order to garentee that they are executed in order. + SWFUpload.prototype.executeNextEvent = function () { + // Warning: Don't call this.debug inside here or you'll create an infinite loop + + var f = this.eventQueue ? this.eventQueue.shift() : null; + if (typeof(f) === "function") { + f.apply(this); + } + }; + + // Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have + // properties that contain characters that are not valid for JavaScript identifiers. To work around this + // the Flash Component escapes the parameter names and we must unescape again before passing them along. + SWFUpload.prototype.unescapeFilePostParams = function (file) { + var reg = /[$]([0-9a-f]{4})/i; + var unescapedPost = {}; + var uk; + + if (file != undefined) { + for (var k in file.post) { + if (file.post.hasOwnProperty(k)) { + uk = k; + var match; + while ((match = reg.exec(uk)) !== null) { + uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16))); + } + unescapedPost[uk] = file.post[k]; + } + } + + file.post = unescapedPost; + } + + return file; + }; + + // Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working) + SWFUpload.prototype.testExternalInterface = function () { + try { + return this.callFlash("TestExternalInterface"); + } catch (ex) { + return false; + } + }; + + // Private: This event is called by Flash when it has finished loading. Don't modify this. + // Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded. + SWFUpload.prototype.flashReady = function () { + // Check that the movie element is loaded correctly with its ExternalInterface methods defined + var movieElement = this.getMovieElement(); + + if (!movieElement) { + this.debug("Flash called back ready but the flash movie can't be found."); + return; + } + + this.cleanUp(movieElement); + + this.queueEvent("swfupload_loaded_handler"); + }; + + // Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE. + // This function is called by Flash each time the ExternalInterface functions are created. + SWFUpload.prototype.cleanUp = function (movieElement) { + // Pro-actively unhook all the Flash functions + try { + if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE + this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)"); + for (var key in movieElement) { + try { + if (typeof(movieElement[key]) === "function") { + movieElement[key] = null; + } + } catch (ex) { + } + } + } + } catch (ex1) { + + } + + // Fix Flashes own cleanup code so if the SWFMovie was removed from the page + // it doesn't display errors. + window["__flash__removeCallback"] = function (instance, name) { + try { + if (instance) { + instance[name] = null; + } + } catch (flashEx) { + + } + }; + + }; + + + /* This is a chance to do something before the browse window opens */ + SWFUpload.prototype.fileDialogStart = function () { + this.queueEvent("file_dialog_start_handler"); + }; + + + /* Called when a file is successfully added to the queue. */ + SWFUpload.prototype.fileQueued = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("file_queued_handler", file); + }; + + + /* Handle errors that occur when an attempt to queue a file fails. */ + SWFUpload.prototype.fileQueueError = function (file, errorCode, message) { + file = this.unescapeFilePostParams(file); + this.queueEvent("file_queue_error_handler", [file, errorCode, message]); + }; + + /* Called after the file dialog has closed and the selected files have been queued. + You could call startUpload here if you want the queued files to begin uploading immediately. */ + SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) { + this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]); + }; + + SWFUpload.prototype.uploadStart = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("return_upload_start_handler", file); + }; + + SWFUpload.prototype.returnUploadStart = function (file) { + var returnValue; + if (typeof this.settings.upload_start_handler === "function") { + file = this.unescapeFilePostParams(file); + returnValue = this.settings.upload_start_handler.call(this, file); + } else if (this.settings.upload_start_handler != undefined) { + throw "upload_start_handler must be a function"; + } + + // Convert undefined to true so if nothing is returned from the upload_start_handler it is + // interpretted as 'true'. + if (returnValue === undefined) { + returnValue = true; + } + + returnValue = !!returnValue; + + this.callFlash("ReturnUploadStart", [returnValue]); + }; + + + + SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]); + }; + + SWFUpload.prototype.uploadError = function (file, errorCode, message) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_error_handler", [file, errorCode, message]); + }; + + SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_success_handler", [file, serverData, responseReceived]); + }; + + SWFUpload.prototype.uploadComplete = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_complete_handler", file); + }; + + /* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the + internal debug console. You can override this event and have messages written where you want. */ + SWFUpload.prototype.debug = function (message) { + this.queueEvent("debug_handler", message); + }; + + + /* ********************************** + Debug Console + The debug console is a self contained, in page location + for debug message to be sent. The Debug Console adds + itself to the body if necessary. + + The console is automatically scrolled as messages appear. + + If you are using your own debug handler or when you deploy to production and + have debug disabled you can remove these functions to reduce the file size + and complexity. + ********************************** */ + + // Private: debugMessage is the default debug_handler. If you want to print debug messages + // call the debug() function. When overriding the function your own function should + // check to see if the debug setting is true before outputting debug information. + SWFUpload.prototype.debugMessage = function (message) { + if (this.settings.debug) { + var exceptionMessage, exceptionValues = []; + + // Check for an exception object and print it nicely + if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") { + for (var key in message) { + if (message.hasOwnProperty(key)) { + exceptionValues.push(key + ": " + message[key]); + } + } + exceptionMessage = exceptionValues.join("\n") || ""; + exceptionValues = exceptionMessage.split("\n"); + exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: "); + SWFUpload.Console.writeLine(exceptionMessage); + } else { + SWFUpload.Console.writeLine(message); + } + } + }; + + SWFUpload.Console = {}; + SWFUpload.Console.writeLine = function (message) { + var console, documentForm; + + try { + console = document.getElementById("SWFUpload_Console"); + + if (!console) { + documentForm = document.createElement("form"); + document.getElementsByTagName("body")[0].appendChild(documentForm); + + console = document.createElement("textarea"); + console.id = "SWFUpload_Console"; + console.style.fontFamily = "monospace"; + console.setAttribute("wrap", "off"); + console.wrap = "off"; + console.style.overflow = "auto"; + console.style.width = "700px"; + console.style.height = "350px"; + console.style.margin = "5px"; + documentForm.appendChild(console); + } + + console.value += message + "\n"; + + console.scrollTop = console.scrollHeight - console.clientHeight; + } catch (ex) { + alert("Exception: " + ex.name + " Message: " + ex.message); + } + }; + + })(); + + (function() { + /* + Queue Plug-in + + Features: + *Adds a cancelQueue() method for cancelling the entire queue. + *All queued files are uploaded when startUpload() is called. + *If false is returned from uploadComplete then the queue upload is stopped. + If false is not returned (strict comparison) then the queue upload is continued. + *Adds a QueueComplete event that is fired when all the queued files have finished uploading. + Set the event handler with the queue_complete_handler setting. + + */ + + if (typeof(SWFUpload) === "function") { + SWFUpload.queue = {}; + + SWFUpload.prototype.initSettings = (function (oldInitSettings) { + return function () { + if (typeof(oldInitSettings) === "function") { + oldInitSettings.call(this); + } + + this.queueSettings = {}; + + this.queueSettings.queue_cancelled_flag = false; + this.queueSettings.queue_upload_count = 0; + + this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler; + this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler; + this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler; + this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler; + + this.settings.queue_complete_handler = this.settings.queue_complete_handler || null; + }; + })(SWFUpload.prototype.initSettings); + + SWFUpload.prototype.startUpload = function (fileID) { + this.queueSettings.queue_cancelled_flag = false; + this.callFlash("StartUpload", [fileID]); + }; + + SWFUpload.prototype.cancelQueue = function () { + this.queueSettings.queue_cancelled_flag = true; + this.stopUpload(); + + var stats = this.getStats(); + while (stats.files_queued > 0) { + this.cancelUpload(); + stats = this.getStats(); + } + }; + + SWFUpload.queue.uploadStartHandler = function (file) { + var returnValue; + if (typeof(this.queueSettings.user_upload_start_handler) === "function") { + returnValue = this.queueSettings.user_upload_start_handler.call(this, file); + } + + // To prevent upload a real "FALSE" value must be returned, otherwise default to a real "TRUE" value. + returnValue = (returnValue === false) ? false : true; + + this.queueSettings.queue_cancelled_flag = !returnValue; + + return returnValue; + }; + + SWFUpload.queue.uploadCompleteHandler = function (file) { + var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler; + var continueUpload; + + if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) { + this.queueSettings.queue_upload_count++; + } + + if (typeof(user_upload_complete_handler) === "function") { + continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true; + } else if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) { + // If the file was stopped and re-queued don't restart the upload + continueUpload = false; + } else { + continueUpload = true; + } + + if (continueUpload) { + var stats = this.getStats(); + if (stats.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) { + this.startUpload(); + } else if (this.queueSettings.queue_cancelled_flag === false) { + this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]); + this.queueSettings.queue_upload_count = 0; + } else { + this.queueSettings.queue_cancelled_flag = false; + this.queueSettings.queue_upload_count = 0; + } + } + }; + } + + })(); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('pagebreak', function(K) { + var self = this; + var name = 'pagebreak'; + var pagebreakHtml = K.undef(self.pagebreakHtml, '
    '); + + self.clickToolbar(name, function() { + var cmd = self.cmd, + range = cmd.range; + self.focus(); + var tail = self.newlineTag == 'br' || K.WEBKIT ? '' : ''; + self.insertHtml(pagebreakHtml + tail); + if(tail !== '') { + var p = K('#__kindeditor_tail_tag__', self.edit.doc); + range.selectNodeContents(p[0]); + p.removeAttr('id'); + cmd.select(); + } + }); +}); +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('plainpaste', function(K) { + var self = this, + name = 'plainpaste'; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '
    ' + + '
    ' + lang.comment + '
    ' + + '' + + '
    ', + dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var html = textarea.val(); + html = K.escape(html); + html = html.replace(/ {2}/g, '  '); + if(self.newlineTag == 'p') { + html = html.replace(/^/, '

    ').replace(/$/, '

    ').replace(/\n/g, '

    '); + } else { + html = html.replace(/\n/g, '
    $&'); + } + self.insertHtml(html).hideDialog().focus(); + } + } + }), + textarea = K('textarea', dialog.div); + textarea[0].focus(); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('preview', function(K) { + var self = this, + name = 'preview'; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '

    ' + + '' + + '
    ', + dialog = self.createDialog({ + name: name, + width: 750, + title: self.lang(name), + body: html + }), + iframe = K('iframe', dialog.div), + doc = K.iframeDoc(iframe); + doc.open(); + doc.write(self.fullHtml()); + doc.write(''); + var cssData = self.options.cssData; + var cssPath = self.options.cssPath; + var bodyClass = self.options.bodyClass; + if(!K.isArray(cssPath)) { + cssPath = [cssPath]; + } + K.each(cssPath, function(i, path) { + if(path) { + doc.write(''); + } + }); + if(cssData) { + doc.write(''); + } + doc.close(); + var body = K(doc.body).css('background-color', '#FFF'); + if (bodyClass) { + body.addClass(bodyClass); + } + iframe[0].contentWindow.focus(); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('quickformat', function(K) { + var self = this, + name = 'quickformat', + blockMap = K.toMap('blockquote,center,div,h1,h2,h3,h4,h5,h6,p'); + + function getFirstChild(knode) { + var child = knode.first(); + while(child && child.first()) { + child = child.first(); + } + return child; + } + self.clickToolbar(name, function() { + self.focus(); + var doc = self.edit.doc, + range = self.cmd.range, + child = K(doc.body).first(), + next, + nodeList = [], + subList = [], + bookmark = range.createBookmark(true); + while(child) { + next = child.next(); + var firstChild = getFirstChild(child); + if(!firstChild || firstChild.name != 'img') { + if(blockMap[child.name]) { + child.html(child.html().replace(/^(\s| | )+/ig, '')); + child.css('text-indent', '2em'); + } else { + subList.push(child); + } + if(!next || (blockMap[next.name] || blockMap[child.name] && !blockMap[next.name])) { + if(subList.length > 0) { + nodeList.push(subList); + } + subList = []; + } + } + child = next; + } + K.each(nodeList, function(i, subList) { + var wrapper = K('

    ', doc); + subList[0].before(wrapper); + K.each(subList, function(i, knode) { + wrapper.append(knode); + }); + }); + range.moveToBookmark(bookmark); + self.addBookmark(); + }); +}); + +/** +-------------------------- +abcd
    +1234
    + +to + +

    + abcd
    + 1234
    +

    + +-------------------------- + +  abcd1233 +

    1234

    + +to + +

    abcd1233

    +

    1234

    + +-------------------------- +*/ +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('template', function(K) { + var self = this, + name = 'template', + lang = self.lang(name + '.'), + htmlPath = self.pluginsPath + name + '/html/'; + + function getFilePath(fileName) { + return htmlPath + fileName + '?ver=' + encodeURIComponent(K.DEBUG ? K.TIME : K.VERSION); + } + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + arr = ['
    ', + '
    ', + // left start + '
    ', + lang.selectTemplate + '
    ', + // right start + '
    ', + ' ', + '
    ', + '
    ', + '
    ', + '', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: 500, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var doc = K.iframeDoc(iframe); + self[checkbox[0].checked ? 'html' : 'insertHtml'](doc.body.innerHTML).hideDialog().focus(); + } + } + }); + var selectBox = K('select', dialog.div), + checkbox = K('[name="replaceFlag"]', dialog.div), + iframe = K('iframe', dialog.div); + checkbox[0].checked = true; + iframe.attr('src', getFilePath(selectBox.val())); + selectBox.change(function() { + iframe.attr('src', getFilePath(this.value)); + }); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('wordpaste', function(K) { + var self = this, + name = 'wordpaste'; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '
    ' + + '
    ' + lang.comment + '
    ' + + '' + + '
    ', + dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var str = doc.body.innerHTML; + str = K.clearMsWord(str, self.filterMode ? self.htmlTags : K.options.htmlTags); + self.insertHtml(str).hideDialog().focus(); + } + } + }), + div = dialog.div, + iframe = K('iframe', div), + doc = K.iframeDoc(iframe); + if(!K.IE) { + doc.designMode = 'on'; + } + doc.open(); + doc.write('WordPaste'); + doc.write(''); + if(!K.IE) { + doc.write('
    '); + } + doc.write(''); + doc.close(); + if(K.IE) { + doc.body.contentEditable = 'true'; + } + iframe[0].contentWindow.focus(); + }); +}); + + +/* ======================================================================== + * ZUI: Kindeditor plugin - zui + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2019-2019 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + $.each(['afterBlur', 'afterFocus', 'afterChange', 'afterTab'], function(_index, name) { + KindEditor.EditorClass.prototype[name] = function(fn) { + return this.handler(name, fn); + }; +}); + +KindEditor.plugin('zui', function(K) { + var self = this; + var options = self.options; + self.uuid = $.zui.uuid(); + + self.afterBlur(function() { + if (options.syncAfterBlur) { + self.sync(); + } + self.container.removeClass('focus'); + }); + + self.afterFocus(function() { + self.container.addClass('focus'); + }); + + self.afterChange(function() { + self.edit.srcElement.change().hide(); + }); + + self.afterCreate(function() { + $(self.edit.srcElement[0]).data('keditor', self); + + var spellcheck = options.spellcheck; + if (spellcheck !== undefined) { + self.edit.doc.documentElement.setAttribute('spellcheck', spellcheck); + } + }); + + if (options.transferTab !== false) { + var nextFormControl = 'input:not([type="hidden"]), textarea:not(.ke-edit-textarea), button[type="submit"], select'; + self.afterTab(function() { + var $editor = $(self.edit.srcElement[0]); + var $next = $editor.next(nextFormControl); + if(!$next.length) $next = $editor.parent().next().find(nextFormControl); + if(!$next.length) $next = $editor.parent().parent().next().find(nextFormControl); + $next = $next.first(); + if ($next.length) { + var keditor = $next.data('keditor'); + if(keditor) { + keditor.focus(); + } else { + $next.focus(); + } + return true; + } + return true; + }); + } +}); +/* ======================================================================== + * ZUI: Kindeditor plugin - placeholder + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2019-2019 cnezsoft.com; Licensed MIT + * ======================================================================== */ + +KindEditor.EditorClass.prototype.setPlaceholder = function(placeholder, asHtml) { + var self = this; + var options = self.options; + var edit = self.edit; + var $doc = $(edit.doc); + var $placeholder = $doc.find('.kindeditor-ph'); + if (!$placeholder.length) { + $placeholder = $('
    '); + if (options.placeholderStyle) { + $placeholder.css(options.placeholderStyle); + } + $doc.find('body').after($placeholder); + } + if (self.plugin.hasContent()) { + $placeholder.hide(); + } + $placeholder[asHtml ? 'html' : 'text'](placeholder); +}; + +KindEditor.EditorClass.prototype.getPlaceholder = function(asHtml) { + return $(this.edit.doc).find('.kindeditor-ph')[asHtml ? 'html' : 'text'](); +}; + +KindEditor.plugin('placeholder', function(K) { + var self = this; + + self.plugin.hasContent = function() { + return self.html().replace(/\s|\n|\r|\t/g, '').replace(//g, '').replace(/

    <\/p>/g, '') !== ''; + }; + + self.afterBlur(function() { + if (!self.plugin.hasContent()) { + $(self.edit.doc).find('.kindeditor-ph').show(); + } + }); + + self.afterFocus(function() { + $(self.edit.doc).find('.kindeditor-ph').hide(); + }); + + self.afterCreate(function() { + var options = self.options; + if (options.placeholderHtml) { + self.setPlaceholder(options.placeholderHtml, true); + } else if (options.placeholder) { + self.setPlaceholder(options.placeholder); + } + }); +}); +/* ======================================================================== + * ZUI: Kindeditor plugin - paste-image + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2019-2019 cnezsoft.com; Licensed MIT + * ======================================================================== */ + +KindEditor.plugin('pasteimage', function(K) { + var self = this; + var allLangs = { + zh_cn: { + notSupportMsg: '您的浏览器不支持粘贴图片!', + placeholder: '可以在编辑器直接贴图。', + failMsg: '贴图失败,请稍后重试。', + uploadingHint: '正在上传图片,请稍后...', + }, + zh_tw: { + notSupportMsg: '您的瀏覽器不支持粘貼圖片!', + placeholder: '可以在編輯器直接貼圖。', + failMsg: '貼圖失敗,請稍後重試。', + uploadingHint: '正在上傳圖片,請稍後...', + }, + en: { + notSupportMsg: 'Image is not allowed to paste in your browser!', + placeholder: 'Paste images here.', + failMsg: 'Pasting image failed. Try again later.', + uploadingHint: 'Uploading...', + } + }; + var lang = $.extend({}, allLangs[($.clientLang || $.zui.clientLang)()]); + self.afterCreate(function() { + var edit = self.edit; + var doc = edit.doc; + var uuid = self.uuid; + var options = self.options.pasteImage; + if (!options) { + return; + } + if (typeof options === 'string') { + options = {postUrl: options}; + } + $.extend({ + placeholder: placeholder + }, options); + if(!K.WEBKIT && !K.GECKO) + { + $(doc.body).on('keyup.ke' + uuid, function(ev) + { + if(ev.keyCode == 86 && ev.ctrlKey) alert(lang.notSupportMsg); + }); + } + + if(self.setPlaceholder) + { + var placeholder = options.placeholder; + if (placeholder === true) placeholder = lang.placeholder; + if (placeholder) { + var oldPlaceholder = self.getPlaceholder(); + if (!oldPlaceholder) oldPlaceholder = placeholder; + else if (oldPlaceholder.indexOf(placeholder) < 0) placeholder = oldPlaceholder + '\n' + placeholder; + self.setPlaceholder(placeholder); + } + } + + var pasteBegin = function() { + // if ($.enableForm) { + // $.enableForm(false, 0, 1); + // $('body').one('click.ke' + uuid, function(){$.enableForm(true);}); + // } + if (options.beforePaste) { + options.beforePaste(); + } + var imageLoadingEle = '

    ' + lang.uploadingHint + '
    '; + edit.cmd.inserthtml(imageLoadingEle); + self.readonly(true); + }; + + var pasteEnd = function(error) { + if(error) { + if (options.onError) { + options.onError(error); + } else { + if(error === true) error = lang.failMsg; + if ($.zui && $.zui.messager) { + $.zui.messager.danger(error, {placement: 'center'}); + } + } + } + // if ($.enableForm) { + // $.enableForm(true, 0, 1); + // } + // $('body').off('.ke' + uuid); + if (options.afterPaste) { + options.afterPaste(); + } + $(doc.body).find('.image-loading-ele').remove(); + self.readonly(false); + }; + + var pasteUrl = options.postUrl; + $(doc.body).on('paste.ke' + uuid, function(ev) { + if (K.WEBKIT) { + /* Paste in chrome.*/ + /* Code reference from http://www.foliotek.com/devblog/copy-images-from-clipboard-in-javascript/. */ + var original = ev.originalEvent; + var clipboardItems = original.clipboardData && original.clipboardData.items; + var clipboardItem = null; + if(clipboardItems) { + var IMAGE_MIME_REGEX = /^image\/(p?jpeg|gif|png)$/i; + for (var i = 0; i < clipboardItems.length; i++) + { + if (IMAGE_MIME_REGEX.test(clipboardItems[i].type)) + { + clipboardItem = clipboardItems[i]; + break; + } + } + } + var file = clipboardItem && clipboardItem.getAsFile(); + if (!file) return; + original.preventDefault(); + pasteBegin(); + + var reader = new FileReader(); + reader.onload = function(evt) { + var result = evt.target.result; + // var arr = result.split(","); + // var data = arr[1]; // raw base64 + // var contentType = arr[0].split(";")[0].split(":")[1]; + + var html = ''; + $.post(pasteUrl, {editor: html}, function(data) + { + if (data) { + edit.cmd.inserthtml(data); + } else { + edit.cmd.inserthtml(html); + } + pasteEnd(); + }).error(function() + { + pasteEnd(true); + }); + }; + reader.readAsDataURL(file); + } else { + /* Paste in firefox and other browsers. */ + setTimeout(function() { + var html = K(doc.body).html(); + if(html.search(/ +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('table', function (K) { + var self = this; + var name = 'table'; + var allLangs = { + zh_cn: { + name: '表格', + xRxC: '{0}行 × {1}列', + headerRow: '标题行', + headerCol: '标题列', + tableStyle: '表格样式', + addHeaderRow: '添加表格标题行', + stripedRows: '隔行变色效果', + hoverRows: '鼠标悬停效果', + autoChangeTableWidth: '自动调整表格尺寸', + tableWidthFixed: '按表格文字自适应', + tableWidthFull: '按页面宽度自适应', + tableBorder: '表格边框', + tableHead: '标题', + tableContent: '内容', + mergeCells: '合并单元格', + defaultColor: '默认颜色', + color: '颜色', + forecolor: '文字颜色', + backcolor: '背景颜色', + invalidBoderWidth: '邊框大小必須為數字。' + }, + zh_tw: { + name: '表格', + xRxC: '{0}行×{1}列', + headerRow: '標題行', + headerCol: '標題列', + tableStyle: '表格樣式', + addHeaderRow: '添加表格標題行', + stripedRows: '隔行變色效果', + hoverRows: '鼠標懸停效果', + autoChangeTableWidth: '自動調整表格尺寸', + tableWidthFixed: '按表格文字自適應', + tableWidthFull: '按頁面寬度自適應', + tableBorder: '表格邊框', + tableHead: '標題', + tableContent: '內容', + mergeCells: '合併單元格', + defaultColor: '默認顏色', + color: '顏色', + forecolor: '文字顏色', + backcolor: '背景顏色', + invalidBoderWidth: '边框大小必须为数字。' + }, + en: { + name: 'Table', + xRxC: '{0} Rows × {1} Columns', + headerRow: 'Header Row', + headerCol: 'Header Column', + tableStyle: 'Table style', + addHeaderRow: 'Add header row', + stripedRows: 'Striped effection', + hoverRows: 'Mouse hover effection', + autoChangeTableWidth: 'Automatically adjust table size', + tableWidthFixed: 'Adaptive by form text', + tableWidthFull: 'Page width adaptive', + tableBorder: 'Table border', + tableHead: 'Title', + tableContent: 'Text', + mergeCells: 'Merge Cells', + defaultColor: 'Default color', + color: 'Color', + forecolor: 'Text Color', + backcolor: 'Back Color', + invalidBoderWidth: 'Border width value must be number' + } + }; + var $elements = []; + var lang = $.extend({}, self.lang('table.'), allLangs[($.clientLang || $.zui.clientLang)()]); + var defaultTableBorderColor = self.options.tableBorderColor || '#ddd'; + + self.tableIdIndex = 0; + + // 设置颜色 + function _setColor(box, color) { + color = color.toUpperCase(); + box.css('background-color', color); + if (color) { + if ($ && $.zui && $.zui.Color) { + box.css('color', new $.zui.Color(color).contrast().toCssStr()); + } else { + box.css('color', (color === '#FFF' || color === '#FFFFFF') ? '#000' : '#FFF'); + } + } + box.name === 'input' ? box.val(color) : box.html(color); + } + // 初始化取色器 + var pickerList = []; + function _initColorPicker(dialogDiv, colorBox, onSetColor) { + colorBox.bind('click,mousedown', function (e) { + e.stopPropagation(); + }); + function removePicker() { + K.each(pickerList, function () { + this.remove(); + }); + pickerList = []; + K(document).unbind('click,mousedown', removePicker); + dialogDiv.unbind('click,mousedown', removePicker); + } + colorBox.click(function (e) { + removePicker(); + var box = K(this), + pos = box.pos(); + var picker = K.colorpicker({ + x: pos.x, + y: pos.y + box.height(), + z: 811214, + selectedColor: K(this).val(), + colors: self.colorTable, + noColor: lang['defaultColor'], + shadowMode: self.shadowMode, + click: function (color) { + _setColor(box, color); + removePicker(); + onSetColor && onSetColor(color); + } + }); + pickerList.push(picker); + K(document).bind('click,mousedown', removePicker); + dialogDiv.bind('click,mousedown', removePicker); + }); + } + // 取得下一行cell的index + function _getCellIndex(table, row, cell) { + var rowSpanCount = 0; + for (var i = 0, len = row.cells.length; i < len; i++) { + if (row.cells[i] == cell) { + break; + } + rowSpanCount += row.cells[i].rowSpan - 1; + } + return cell.cellIndex - rowSpanCount; + } + + function removeEvent() { + K.each($elements, function () { + this.off('.kTable'); + }); + } + + function updateTable(setting, $table, onUpdateSetting) { + if (!$table) { + var table = self.plugin.getSelectedTable(); + $table = $(table[0]); + } + if (!$table || !$table.length) return; + if (!setting) { + setting = $.extend({ + borderColor: defaultTableBorderColor + }, self.tableSetting, setting); + if (setting.autoWidth === undefined) { + setting.autoWidth = $table[0].style.width === 'auto'; + } + if (setting.stripedRows === undefined) { + var $rows = $table.find('tbody>tr'); + var coloredRowsLength = $rows.filter(function () { + return !!this.style.backgroundColor; + }).length; + setting.stripedRows = coloredRowsLength >= Math.floor($rows / 2); + } + } + self.tableSetting = setting; + if (setting.header !== undefined) { + if ($table.is('.ke-plugin-table-example')) { + $table.find('thead').toggleClass('hidden', !setting.header); + } else { + var $thead = $table.find('thead'); + if (setting.header) { + if (!$thead.length) { + var theadHtml = ['
    ']; + var $firstRow = $table.find('tbody>tr:first').children(); + var colsCount = 0; + $firstRow.each(function () { + var $cell = $(this); + var cellSpan = $cell.attr('colspan'); + colsCount += cellSpan ? parseInt(cellSpan) : 1; + }); + for (var i = 0; i < colsCount; ++i) { + theadHtml.push(''); + } + theadHtml.push(''); + $thead = $(theadHtml.join('')); + $table.prepend($thead); + } + } else { + $thead.remove(); + } + } + onUpdateSetting && onUpdateSetting('header', setting.header); + } + if (setting.stripedRows !== undefined) { + var $rows = $table.find('tbody>tr'); + $rows.each(function (index) { + $(this).css('background-color', (setting.stripedRows && (index % 2 === 0)) ? '#f9f9f9' : 'none'); + }); + onUpdateSetting && onUpdateSetting('stripedRows', setting.stripedRows); + } + // if (setting.hoverRows !== undefined) { + // $table.toggleClass('table-hover', !!setting.hoverRows); + // onUpdateSetting && onUpdateSetting('hoverRows', setting.hoverRows); + // } + if (setting.autoWidth !== undefined) { + $table.css(setting.autoWidth ? { + width: 'auto', + maxWidth: '100%' + } : { + width: '100%', + }); + onUpdateSetting && onUpdateSetting('autoWidth', setting.autoWidth); + } + if (setting.borderColor !== undefined) { + $table.find('td,th').css('border-color', setting.borderColor); + onUpdateSetting && onUpdateSetting('borderColor', setting.borderColor); + } + } + + function insertTable(row, col, headerRow, headerCol) { + if (!(row * col)) { + return; + } + var tableID = 'ke-table-' + (self.tableIdIndex++); + var $table = $('
    ' + (K.IE ? ' ' : '
    ') + '
    '); + var $body = $(''); + for (var r = 0; r < row; r++) { + var $row = $(''); + for (var c = 0; c < col; c++) { + var $cell = $('' + (K.IE ? ' ' : '
    ') + ''); + $row.append($cell); + } + $body.append($row); + } + $table.append($body); + var html = $('
    ').append($table).html(); + if (!K.IE) { + html += '
    '; + } + self.insertHtml(html); + var $table = $(self.edit.doc).find('#' + tableID); + $table.attr('id', null); + self.cmd.range.selectNodeContents($table.find('th,td').first()[0]).collapse(true); + self.cmd.select(); + self.addBookmark(); + return $table; + } + + function modifyTable(table) { + var $table = $(table[0]); + var theadHtml = ['']; + var tbodyHtml = ['']; + for (var i = 0; i < 6; ++i) { + theadHtml.push('{tableHead}'); + tbodyHtml.push(''); + for (var j = 0; j < 6; ++j) { + tbodyHtml.push('{tableContent}'); + } + tbodyHtml.push(''); + } + theadHtml.push(''); + tbodyHtml.push(''); + var dialogHtml = [ + '
    ', + '
    ', + '
    ', + '
    ', + '', + '
    ', + '
    ', + // '
    ', + '
    ', + '
    ', + '', + '
    ', + '
    ', + '
    ', + '
    ', + '', + '
    ', + '{borderColor}', + '', + '
    ', + '
    ', + '
    ', + '
    ', + '', + theadHtml.join(''), + tbodyHtml.join(''), + '
    ', + '', + '', + '' + ].join('').format(lang); + var $dialog = $(dialogHtml); + var $exampleTable = $dialog.find('.ke-plugin-table-example'); + var bookmark = self.cmd.range.createBookmark(); + var $colorBox = $dialog.find('.ke-plugin-table-input-color'); + var colorBox = K($colorBox[0]); + $dialog.on('change.kTable', 'input[name]', function () { + var $input = $(this); + var updateSetting = {}; + updateSetting[$input.attr('name')] = $input.is('[type="checkbox"]') ? $input.is(':checked') : $input.val(); + updateTable(updateSetting, $exampleTable); + }); + + var dialog = self.createDialog({ + name: name + 'Dialog', + width: 550, + title: self.lang(name), + body: $dialog[0], + beforeRemove: function () { + $dialog.off('.kTable'); + }, + yesBtn: { + name: self.lang('yes'), + click: function (e) { + updateTable({ + borderColor: $dialog.find('[name="borderColor"]').val(), + header: $dialog.find('[name="header"]').is(':checked'), + stripedRows: $dialog.find('[name="stripedRows"]').is(':checked'), + hoverRows: $dialog.find('[name="hoverRows"]').is(':checked'), + autoWidth: $dialog.find('[name="autoWidth"]:checked').val(), + }, $table); + self.hideDialog().focus(); + self.cmd.range.moveToBookmark(bookmark); + self.cmd.select(); + self.addBookmark(); + } + } + }); + _initColorPicker(dialog.div, colorBox, function (color) { + updateTable({ borderColor: color }, $exampleTable); + }); + + updateTable(self.tableSetting, $exampleTable, function (name, value) { + switch (name) { + case 'borderColor': + _setColor(colorBox, value || defaultTableBorderColor); + break; + case 'header': + $dialog.find('[name="header"]').prop('checked', !!value); + break; + case 'stripedRows': + $dialog.find('[name="stripedRows"]').prop('checked', !!value); + break; + case 'hoverRows': + $dialog.find('[name="hoverRows"]').prop('checked', !!value); + break; + case 'autoWidth': + $dialog.find('[name="autoWidth"][value="' + (value ? 'auto' : '') + '"]').prop('checked', true); + break; + } + }); + } + + if (!self.plugin.table) { + self.plugin.table = { + // modify table + prop: function () { + var table = self.plugin.getSelectedTable(); + if (table && table.length) { + modifyTable(table); + } + }, + //modify cell + cellprop: function () { + var html = [ + '
    ', + //width, height + '
    ', + '', + '
    ', + '
    ', + '' + lang.width + '', + '', + '', + '', + '
    ', + '
    ', + '
    ', + '
    ', + '' + lang.height + '', + '', + '', + '', + '
    ', + '
    ', + '
    ', + //align + '
    ', + '', + '
    ', + '
    ', + '' + lang.textAlign + '', + '', + '
    ', + '
    ', + '
    ', + '
    ', + '' + lang.verticalAlign + '', + '', + '
    ', + '
    ', + '
    ', + //border + '
    ', + '', + '
    ', + '
    ', + '' + lang.borderColor + '', + '', + '
    ', + '
    ', + '
    ', + '
    ', + '' + lang.size + '', + '', + 'px', + '
    ', + '
    ', + '
    ', + //background color + '
    ', + '', + '
    ', + '
    ', + '' + lang.forecolor + '', + '', + '
    ', + '
    ', + '
    ', + '
    ', + '' + lang.backcolor + '', + '', + '
    ', + '
    ', + '
    ', + '
    ', + ].join(''); + var bookmark = self.cmd.range.createBookmark(); + var div, widthBox, heightBox, widthTypeBox, widthTypeBox, textAlignBox, verticalAlignBox, colorBox, borderWidthBox; + var dialog = self.createDialog({ + name: name, + width: 500, + title: self.lang('tablecell'), + body: html, + beforeRemove: function () { + colorBox.unbind(); + }, + yesBtn: { + name: self.lang('yes'), + click: function (e) { + var width = widthBox.val(), + height = heightBox.val(), + widthType = widthTypeBox.val(), + heightType = heightTypeBox.val(), + textAlign = textAlignBox.val(), + verticalAlign = verticalAlignBox.val(), + borderWidth = borderWidthBox.val() + 'px', + borderColor = K(colorBox[0]).val() || '', + textColor = K(colorBox[1]).val() || '', + bgColor = K(colorBox[2]).val() || ''; + if (!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if (!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + if (!/^\d*$/.test(borderWidth)) { + alert(lang.invalidBoderWidth); + borderWidthBox[0].focus(); + return; + } + var cells = self.plugin.getAllSelectedCells(); + var style = { + width: width !== '' ? (width + widthType) : '', + height: height !== '' ? (height + heightType) : '', + 'background-color': bgColor, + 'text-align': textAlign, + 'border-width': borderWidth, + 'vertical-align': verticalAlign, + 'border-color': borderColor, + color: textColor + }; + for(var i = 0; i < cells.length; ++i) { + cells.eq(i).css(style); + } + self.hideDialog().focus(); + self.cmd.range.moveToBookmark(bookmark); + self.cmd.select(); + self.addBookmark(); + } + } + }); + div = dialog.div, + widthBox = K('[name="width"]', div).val(100), + heightBox = K('[name="height"]', div), + widthTypeBox = K('[name="widthType"]', div), + heightTypeBox = K('[name="heightType"]', div), + textAlignBox = K('[name="textAlign"]', div), + verticalAlignBox = K('[name="verticalAlign"]', div), + borderWidthBox = K('[name="borderWidth"]', div), + colorBox = K('.ke-plugin-table-input-color', div); + _initColorPicker(div, colorBox.eq(0)); + _initColorPicker(div, colorBox.eq(1)); + _initColorPicker(div, colorBox.eq(2)); + _setColor(colorBox.eq(0), '#000000'); + _setColor(colorBox.eq(1), ''); + _setColor(colorBox.eq(2), ''); + // foucs and select + widthBox[0].focus(); + widthBox[0].select(); + // get selected cell + var cell = self.plugin.getSelectedCell(); + var match, + cellWidth = cell[0].style.width || cell[0].width || '', + cellHeight = cell[0].style.height || cell[0].height || ''; + if ((match = /^(\d+)((?:px|%)*)$/.exec(cellWidth))) { + widthBox.val(match[1]); + widthTypeBox.val(match[2]); + } else { + widthBox.val(''); + } + if ((match = /^(\d+)((?:px|%)*)$/.exec(cellHeight))) { + heightBox.val(match[1]); + heightTypeBox.val(match[2]); + } + var borderWidth = cell[0].style.borderWidth || ''; + if ((match = /^(\d+)((?:px)*)$/.exec(borderWidth))) { + borderWidthBox.val(match[1]); + } + textAlignBox.val(cell[0].style.textAlign || ''); + verticalAlignBox.val(cell[0].style.verticalAlign || ''); + _setColor(colorBox.eq(0), K.toHex(cell[0].style.borderColor || '')); + _setColor(colorBox.eq(1), K.toHex(cell[0].style.color || '')); + _setColor(colorBox.eq(2), K.toHex(cell[0].style.backgroundColor || '')); + widthBox[0].focus(); + widthBox[0].select(); + }, + insert: function () { + console.warn('Table insert not available.'); + }, + 'delete': function () { + var table = self.plugin.getSelectedTable(); + self.cmd.range.setStartBefore(table[0]).collapse(true); + self.cmd.select(); + table.remove(); + self.addBookmark(); + }, + colinsert: function (offset) { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + index = cell.cellIndex + offset; + // 取得第一行的index + index += table.rows[0].cells.length - row.cells.length; + + for (var i = 0, len = table.rows.length; i < len; i++) { + var newRow = table.rows[i], + newCell = newRow.insertCell(index), + isThead = newRow.parentNode.tagName === 'THEAD'; + newCell.outerHTML = '<' + (isThead ? 'th' : 'td') + (newCell.rowSpan > 1 ? ' rowspan="' + newCell.rowSpan + '"' : '') + (newCell.colSpan > 1 ? ' colspan="' + newCell.colSpan + '"' : '') + ' style="' + (isThead ? 'background-color: #f1f1f1;' : '') + 'border: 1px solid ' + ((self.tableSetting && self.tableSetting.borderColor) || defaultTableBorderColor) + '">' + (K.IE ? ' ' : '
    ') + ''; + // 调整下一行的单元格index + index = _getCellIndex(table, newRow, newCell); + } + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colinsertleft: function () { + this.colinsert(0); + }, + colinsertright: function () { + this.colinsert(1); + }, + rowinsert: function (offset) { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0]; + var rowIndex = row.rowIndex; + if (offset === 1) { + rowIndex = row.rowIndex + (cell.rowSpan - 1) + offset; + } + var newRow = table.insertRow(rowIndex); + var isThead = newRow.parentNode.tagName === 'THEAD'; + + for (var i = 0, len = row.cells.length; i < len; i++) { + // 调整cell个数 + if (row.cells[i].rowSpan > 1) { + len -= row.cells[i].rowSpan - 1; + } + var newCell = newRow.insertCell(i); + // copy colspan + if (offset === 1 && row.cells[i].colSpan > 1) { + newCell.colSpan = row.cells[i].colSpan; + } + newCell.outerHTML = '<' + (isThead ? 'th' : 'td') + (newCell.rowSpan > 1 ? ' rowspan="' + newCell.rowSpan + '"' : '') + (newCell.colSpan > 1 ? ' colspan="' + newCell.colSpan + '"' : '') + ' style="' + (isThead ? 'background-color: #f1f1f1;' : '') + 'border: 1px solid ' + ((self.tableSetting && self.tableSetting.borderColor) || defaultTableBorderColor) + '">' + (K.IE ? ' ' : '
    ') + ''; + + } + // 调整rowspan + for (var j = rowIndex; j >= 0; j--) { + var cells = table.rows[j].cells; + if (cells.length > i) { + for (var k = cell.cellIndex; k >= 0; k--) { + if (cells[k].rowSpan > 1) { + cells[k].rowSpan += 1; + } + } + break; + } + } + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + rowinsertabove: function () { + this.rowinsert(0); + }, + rowinsertbelow: function () { + this.rowinsert(1); + }, + rowmerge: function () { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex, // 当前行的index + nextRowIndex = rowIndex + cell.rowSpan, // 下一行的index + nextRow = table.rows[nextRowIndex]; // 下一行 + // 最后一行不能合并 + if (table.rows.length <= nextRowIndex) { + return; + } + var cellIndex = cell.cellIndex; // 下一行单元格的index + if (nextRow.cells.length <= cellIndex) { + return; + } + var nextCell = nextRow.cells[cellIndex]; // 下一行单元格 + // 上下行的colspan不一致时不能合并 + if (cell.colSpan !== nextCell.colSpan) { + return; + } + cell.rowSpan += nextCell.rowSpan; + nextRow.deleteCell(cellIndex); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colmerge: function () { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex, // 当前行的index + cellIndex = cell.cellIndex, + nextCellIndex = cellIndex + 1; + // 最后一列不能合并 + if (row.cells.length <= nextCellIndex) { + return; + } + var nextCell = row.cells[nextCellIndex]; + // 左右列的rowspan不一致时不能合并 + if (cell.rowSpan !== nextCell.rowSpan) { + return; + } + cell.colSpan += nextCell.colSpan; + row.deleteCell(nextCellIndex); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + mergeCells: function () { + var tableSelectionRange = self.tableSelectionRange; + if (!tableSelectionRange) return; + var table = self.plugin.getSelectedTable()[0]; + var $table = $(table); + var top = tableSelectionRange.top; + var left = tableSelectionRange.left; + var right = tableSelectionRange.right; + var bottom = tableSelectionRange.bottom; + var $firstCell; + $table.children('thead,tbody,tfoot').children('tr').each(function () { + $(this).children('td,th').each(function () { + var $cell = $(this); + var pos = $cell.cellPos(); + if (pos.left === left && pos.top === top) { + $firstCell = $cell; + } else if (pos.right >= left && pos.left <= right && pos.bottom >= top && pos.top <= bottom) { + $cell.addClass('ke-cell-removed'); + } + }); + }); + if ($firstCell) { + $firstCell.attr({ + rowspan: bottom - top + 1, + colspan: right - left + 1, + }); + $table.find('.ke-cell-removed').remove(); + self.cmd.range.selectNodeContents($firstCell[0]).collapse(true); + self.cmd.select(); + self.addBookmark(); + } + }, + rowsplit: function () { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex; + // 不是可分割单元格 + if (cell.rowSpan === 1) { + return; + } + var cellIndex = _getCellIndex(table, row, cell); + for (var i = 1, len = cell.rowSpan; i < len; i++) { + var newRow = table.rows[rowIndex + i], + newCell = newRow.insertCell(cellIndex); + var isThead = newRow.parentNode.tagName === 'THEAD'; + var colSpan = cell.colSpan > 1 ? cell.colSpan : newCell.colSpan; + newCell.outerHTML = '<' + (isThead ? 'th' : 'td') + (newCell.rowSpan > 1 ? ' rowspan="' + newCell.rowSpan + '"' : '') + (colSpan > 1 ? ' colspan="' + colSpan + '"' : '') + ' style="' + (isThead ? 'background-color: #f1f1f1;' : '') + 'border: 1px solid ' + ((self.tableSetting && self.tableSetting.borderColor) || defaultTableBorderColor) + '">' + (K.IE ? ' ' : '
    ') + ''; + if (cell.colSpan > 1) { + newCell.colSpan = cell.colSpan; + } + // 调整下一行的单元格index + cellIndex = _getCellIndex(table, newRow, newCell); + } + K(cell).removeAttr('rowSpan'); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colsplit: function () { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + cellIndex = cell.cellIndex; + // 不是可分割单元格 + if (cell.colSpan === 1) { + return; + } + var isThead = row.parentNode.tagName === 'THEAD'; + for (var i = 1, len = cell.colSpan; i < len; i++) { + var newCell = row.insertCell(cellIndex + i); + var rowSpan = cell.rowSpan > 1 ? cell.rowSpan : newCell.rowSpan; + var colSpan = newCell.colSpan; + newCell.outerHTML = '<' + (isThead ? 'th' : 'td') + (rowSpan > 1 ? ' rowspan="' + rowSpan + '"' : '') + (colSpan > 1 ? ' colspan="' + colSpan + '"' : '') + ' style="' + (isThead ? 'background-color: #f1f1f1;' : '') + 'border: 1px solid ' + ((self.tableSetting && self.tableSetting.borderColor) || defaultTableBorderColor) + '">' + (K.IE ? ' ' : '
    ') + ''; + } + K(cell).removeAttr('colSpan'); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + coldelete: function () { + var table = self.plugin.getSelectedTable()[0]; + var cells = self.plugin.getAllSelectedCells(); + if (!cells.length) return; + for (var j = 0; j < cells.length; ++j) { + var cell = cells.get(j); + var row = cell.parentNode; + if (!row || !row.parentNode) continue; + var index = cell.cellIndex; + for (var i = 0, len = table.rows.length; i < len; i++) { + var newRow = table.rows[i], + newCell = newRow.cells[index]; + if (newCell.colSpan > 1) { + newCell.colSpan -= 1; + if (newCell.colSpan === 1) { + K(newCell).removeAttr('colSpan'); + } + } else { + newRow.deleteCell(index); + } + // 跳过不需要删除的行 + if (newCell.rowSpan > 1) { + i += newCell.rowSpan - 1; + } + } + if (row.cells.length === 0) { + self.cmd.range.setStartBefore(table).collapse(true); + self.cmd.select(); + K(table).remove(); + break; + } + } + if (table.parentNode) { + self.cmd.selection(true); + } + self.addBookmark(); + }, + rowdelete: function () { + var table = self.plugin.getSelectedTable()[0]; + var cells = self.plugin.getAllSelectedCells(); + if (!cells.length) return; + for (var j = 0; j < cells.length; ++j) { + var cell = cells.get(j); + var row = cell.parentNode; + if (!row || !row.parentNode) continue; + // 从下到上删除 + for (var i = cell.rowSpan - 1; i >= 0; i--) { + table.deleteRow(row.rowIndex + i); + } + } + if (table.rows.length === 0) { + self.cmd.range.setStartBefore(table).collapse(true); + self.cmd.select(); + K(table).remove(); + } else { + self.cmd.selection(true); + } + self.addBookmark(); + } + }; + + self.plugin.getSelectedTable = function () { + return K($(self.cmd.range.startContainer).closest('table')[0]); + }; + // 获取选中的行 + self.plugin.getSelectedRow = function () { + return K($(self.cmd.range.startContainer).closest('tr')[0]); + }; + // 获取光标所在的单元格 + self.plugin.getSelectedCell = function () { + return K($(self.cmd.range.startContainer).closest('td,th')[0]); + }; + // 获取用户拖选的单元格 + self.plugin.getSelectedCells = function () { + var table = self.plugin.getSelectedTable(); + if (table && table.length) { + var cells = K('.ke-select-cell', table.get(0)); + if (cells && cells.length > 1) { + return cells; + } + } + }; + // 当用户没有拖选多个单元格时,获取光标所在的单元格 + self.plugin.getSingleSelectedCell = function () { + var selectedCells = self.plugin.getSelectedCells(); + if (selectedCells && selectedCells.length > 1) { + return; + } + return self.plugin.getSelectedCell(); + }; + // 获取用户拖选或光标所在位置的单元格 + self.plugin.getAllSelectedCells = function () { + var selectedCells = self.plugin.getSelectedCells(); + if (selectedCells && selectedCells.length) { + return selectedCells; + } + return self.plugin.getSelectedCell(); + }; + + var contextMenuIconClass = { + mergeCells: 'ke-icon-tablecolmerge' + }; + K.each(('prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,mergeCells,rowmerge,colmerge,rowsplit,colsplit,coldelete,rowdelete,delete').split(','), function (i, val) { + var cond; + if (val === 'prop' || val === 'delete') { + cond = self.plugin.getSelectedTable; + } else if (val === 'mergeCells') { + cond = self.plugin.getSelectedCells; + }else if (val === 'rowmerge') { + cond = function() { + var cell = self.plugin.getSingleSelectedCell(); + if (cell && cell.length) { + if($(cell.get(0)).parent().next('tr').length) { + return cell; + } + } + }; + } else if (val === 'colmerge') { + cond = function() { + var cell = self.plugin.getSingleSelectedCell(); + if (cell && cell.length) { + if($(cell.get(0)).next('th,td').length) { + return cell; + } + } + }; + } else if (val === 'rowsplit') { + cond = function() { + var cell = self.plugin.getSingleSelectedCell(); + if (cell && cell.get(0).rowSpan > 1) { + return cell; + } + }; + } else if (val === 'colsplit') { + cond = function() { + var cell = self.plugin.getSingleSelectedCell(); + if (cell && cell.get(0).colSpan > 1) { + return cell; + } + }; + } else if (K.inArray(val, ['colinsertleft', 'colinsertright', 'rowinsertabove', 'rowinsertbelow']) > -1) { + cond = self.plugin.getSingleSelectedCell; + } else { + cond = self.plugin.getSelectedCell; + } + self.addContextmenu({ + title: lang[val] || self.lang('table' + val), + click: function () { + self.loadPlugin('table', function () { + self.plugin.table[val](); + self.hideMenu(); + }); + }, + cond: cond, + width: 170, + iconClass: contextMenuIconClass[val] || ('ke-icon-table' + val) + }); + }); + } + + self.clickToolbar(name, function () { + if (self.menu) return; + + var menu = self.createMenu({ + name: name, + beforeRemove: function () { + removeEvent(); + } + }); + + var $wrapperDiv = $('
    '); + var $header = $('
    ' + lang.xRxC.format(0, 0) + '
    '); + $wrapperDiv.append($header); + var $grid = $('
    '); + $grid.on('mouseenter.kTable', '.ke-plugin-table-grid-cell', function () { + var $cell = $(this); + var row = $cell.data('row'); + var col = $cell.data('col'); + $header.text(lang.xRxC.format(row, col)); + var $cells = $grid.find('.ke-plugin-table-grid-cell'); + $cells.each(function () { + var $c = $(this); + var r = $c.data('row'); + var c = $c.data('col'); + if (r <= row && c <= col) { + $c.css({ + border: '1px solid #2286d2', + background: '#eff7ff' + }); + } else { + $c.css({ + border: '1px solid #ddd', + background: '#f1f1f1' + }); + } + }); + }).on('click.kTable', '.ke-plugin-table-grid-cell', function (e) { + var $cell = $(this); + var row = $cell.data('row'); + var col = $cell.data('col'); + insertTable(row, col); + self.hideMenu().focus(); + self.addBookmark(); + e.stopPropagation(); + }); + for (var r = 1; r < 11; r++) { + for (var c = 1; c < 11; c++) { + $grid.append('
    '); + } + } + $elements.push($grid); + $wrapperDiv.append($grid); + menu.div.append($wrapperDiv[0]); + }); + + // https://zui.5upm.com/task-view-2.html + self.afterTab(function (result) { + var selectedCell = self.plugin.getSelectedCell(); + if (selectedCell && selectedCell.length) { + var selectNextCell = function ($currentCell) { + if ($currentCell.length) { + var $nextCell = $currentCell.next(); + if (!$nextCell.is('td,th')) { + $nextCell = $currentCell.parent().next('tr').children('th,td').first(); + } + if (!$nextCell.is('td,th')) { + $nextCell = $currentCell.closest('tbody,tfoot,thead').next().children('tr').first().children('th,td').first(); + } + if ($nextCell.length) { + self.cmd.range.selectNodeContents($nextCell[0]).collapse(true); + self.cmd.select(); + return true; + } + } + return false; + }; + var $selectedCell = $(selectedCell.get(0)); + if ($selectedCell.length) { + if (!selectNextCell($selectedCell)) { + self.plugin.table.rowinsertbelow(); + selectNextCell($selectedCell); + } + return true; + } + } + return result; + }); + + var selectCellsRange = function ($table, startPos, endPos) { + var top = endPos ? Math.min(startPos.top, endPos.top) : startPos.top; + var left = endPos ? Math.min(startPos.left, endPos.left) : startPos.left; + var bottom = endPos ? Math.max(startPos.bottom, endPos.bottom) : startPos.bottom; + var right = endPos ? Math.max(startPos.right, endPos.right) : startPos.right; + if (top === bottom && left === right) { + return false; + } + var hasCellSelected = false; + var hasNewCellSelect = false; + var $rows = $table.children('thead,tbody,tfoot').children('tr').each(function () { + $(this).children('td,th').each(function () { + var $cell = $(this); + var pos = $cell.cellPos(); + if (pos.right >= left && pos.left <= right && pos.bottom >= top && pos.top <= bottom) { + top = Math.min(top, pos.top); + left = Math.min(left, pos.left); + bottom = Math.max(bottom, pos.bottom); + right = Math.max(right, pos.right); + $cell.addClass('ke-select-cell'); + hasCellSelected = true; + hasNewCellSelect = true; + } + }); + }); + while(hasNewCellSelect) { + hasNewCellSelect = false; + $rows.each(function () { + $(this).children('td,th').each(function () { + var $cell = $(this); + if ($cell.hasClass('ke-select-cell')) return; + var pos = $cell.cellPos(); + if (pos.right >= left && pos.left <= right && pos.bottom >= top && pos.top <= bottom) { + top = Math.min(top, pos.top); + left = Math.min(left, pos.left); + bottom = Math.max(bottom, pos.bottom); + right = Math.max(right, pos.right); + $cell.addClass('ke-select-cell'); + hasNewCellSelect = true; + } + }); + }); + } + var $selectedCells = $table.find('.ke-select-cell'); + if ($selectedCells.length === 1) { + $selectedCells.removeClass('ke-select-cell'); + hasCellSelected = false; + } + if (hasCellSelected) { + self.tableSelectionRange = { + top: top, + left: left, + bottom: bottom, + right: right, + }; + } else { + self.tableSelectionRange = null; + } + return hasCellSelected; + }; + + var selectRow = function ($table, rowIndex) { + return selectCellsRange($table, { + left: 0, + right: $table.data('tableSize').width - 1, + top: rowIndex, + bottom: rowIndex, + }); + }; + + var selectCol = function ($table, cellIndex) { + return selectCellsRange($table, { + left: cellIndex, + right: cellIndex, + top: 0, + bottom: $table.data('tableSize').height - 1, + }); + }; + + self.afterCreate(function () { + var isMouseDown = false; + var $mouseDownTable = null; + var $mouseMoveTable = null; + var mouseDownCellPos = null; + var mouseMoveCellPos = null; + + var handleMouseUp = function () { + isMouseDown = false; + $mouseDownTable = null; + mouseMoveCellPos = null; + }; + + $(self.edit.doc.body).on('mousedown.ke' + self.uuid, function (e) { + var $cell = $(e.target).closest('td,th'); + var $table = $cell.closest('table'); + var rightClickOnTable = false; + if ($cell.length && $table.length) { + $mouseDownTable = $table; + isMouseDown = true; + mouseDownCellPos = $cell.cellPos(true); + rightClickOnTable = e.which === 3; + $table.removeClass('ke-select-cells'); + } + if (!rightClickOnTable) { + $(self.edit.doc).find('.ke-select-cell').removeClass('ke-select-cell'); + self.tableSelectionRange = null; + } + }).on('mousemove.ke' + self.uuid, function (e) { + var $cell = $(e.target).closest('td,th'); + if (!$cell.length) return isMouseDown ? e.preventDefault() : null; + var $table = $cell.closest('table'); + if (!$table.length) return isMouseDown ? e.preventDefault() : null; + $table.removeClass('ke-select-row ke-select-col ke-select-cells'); + mouseMoveCellPos = $cell.cellPos(); + if (isMouseDown) { + if ($table[0] !== $mouseDownTable[0]) return e.preventDefault(); + $(self.edit.doc).find('table').find('.ke-select-cell').removeClass('ke-select-cell'); + if (selectCellsRange($table, mouseDownCellPos, mouseMoveCellPos)) { + $table.addClass('ke-select-cells'); + e.preventDefault(); + } + } else { + $mouseMoveTable = $table; + var tableOffset = $table.offset(); + var pageX = e.pageX; + var pageY = e.pageY; + var moveX = pageX - tableOffset.left; + var moveY = pageY - tableOffset.top; + if (moveX < 8) { + $table.addClass('ke-select-row'); + mouseMoveCellPos.selectRow = mouseMoveCellPos.top; + delete mouseMoveCellPos.selectCol; + e.preventDefault(); + e.stopPropagation(); + } else if (moveY < 8) { + $table.addClass('ke-select-col'); + mouseMoveCellPos.selectCol = mouseMoveCellPos.left; + delete mouseMoveCellPos.selectRow; + e.preventDefault(); + e.stopPropagation(); + } + } + }).on('mouseup.ke' + self.uuid, function (e) { + var $target = $(e.target); + var $cell = $target.closest('td,th'); + if ($cell.length) { + if (mouseMoveCellPos && mouseMoveCellPos.selectRow !== undefined) { + selectRow($mouseMoveTable, mouseMoveCellPos.selectRow); + e.stopPropagation(); + } else if (mouseMoveCellPos && mouseMoveCellPos.selectCol !== undefined) { + selectCol($mouseMoveTable, mouseMoveCellPos.selectCol); + e.stopPropagation(); + } + } + handleMouseUp(); + }).on('paste.ke' + self.uuid + ' keydown.ke' + self.uuid, function () { + $(self.edit.doc).find('table').removeClass('ke-select-row ke-select-col').find('.ke-select-cell').removeClass('ke-select-cell'); + }); + $(document).on('mouseup.ke' + self.uuid, function () { + handleMouseUp(); + }); + + $(self.edit.doc.head).append([ + '', + ].join('')); + + var cmdToggleBack = self.cmd.toggle; + var cmdToggle = function (wrapper, map, flag) { + var self = this; + if (flag === undefined || flag === null) { + flag = self.commonNode(map); + } + if (flag) { + self.remove(map); + } else { + self.wrap(wrapper); + } + return self.select(); + }; + + var eachSelectCells = function (eachCallback, beforeCallback, afterCallback) { + var range = self.cmd.range; + if (range && range.endContainer) { + var $cell = $(range.endContainer).closest('th,td'); + if (!$cell.length) return; + var $table = $cell.closest('table'); + if (!$table.length) return; + var $selectCells = $table.children('thead,tbody,tfoot').children('tr').children('.ke-select-cell'); + if ($selectCells.length) { + if (beforeCallback) beforeCallback($cell, $table); + $selectCells.each(eachCallback); + if (afterCallback) afterCallback($cell, $table); + + range.selectNodeContents($cell[0]); + // range.collapse(); + self.cmd.select(); + self.focus(); + return true; + } + } + }; + + self.cmd.toggle = function (wrapper, map) { + var flag; + if (eachSelectCells(function () { + self.cmd.range.selectNodeContents(this); + self.cmd.select(); + cmdToggle.call(self.cmd, wrapper, map, flag); + }, function ($cell) { + self.cmd.range.selectNodeContents($cell[0]); + self.cmd.select(); + flag = !!self.cmd.commonNode(map); + })) { + return; + } + return cmdToggleBack.call(self.cmd, wrapper, map); + }; + + var commands = ',justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,'; + var clickToolbarBack = self.clickToolbar; + self.clickToolbar = function (name, fn) { + if (fn === undefined && commands.indexOf(',' + name + ',') > -1) { + if (eachSelectCells(function () { + self.cmd.range.selectNode(this); + self.cmd.select(); + clickToolbarBack.call(self, name, fn); + })) { + return; + } + } + return clickToolbarBack.call(self, name, fn); + } + }); + + self.beforeRemove(function () { + $(self.edit.doc.body).off('.ke' + self.uuid); + $(document).off('.ke' + self.uuid); + }); +}); + +KindEditor.lang({ + table: KindEditor.lang('table') +}); \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.css b/dist/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.css new file mode 100644 index 0000000..74fe1ef --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.css @@ -0,0 +1 @@ +/*! KindEditor Copyright (C) kindsoft.net, Licence: http://kindeditor.net/license.php */.ke-inline-block{display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;*display:inline}.ke-clearfix{zoom:1}.ke-clearfix:after{display:block;height:0;clear:both;font-size:0;line-height:0;visibility:hidden;content:"."}.ke-shadow{-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}[class*=" ke-icon-"],[class^=ke-icon-]{width:16px;height:16px}.ke-icon-source{background-position:0 0}.ke-icon-preview{background-position:0 -16px}.ke-icon-print{background-position:0 -32px}.ke-icon-undo{background-position:0 -48px}.ke-icon-redo{background-position:0 -64px}.ke-icon-cut{background-position:0 -80px}.ke-icon-copy{background-position:0 -96px}.ke-icon-paste{background-position:0 -112px}.ke-icon-selectall{background-position:0 -128px}.ke-icon-justifyleft{background-position:0 -144px}.ke-icon-justifycenter{background-position:0 -160px}.ke-icon-justifyright{background-position:0 -176px}.ke-icon-justifyfull{background-position:0 -192px}.ke-icon-insertorderedlist{background-position:0 -208px}.ke-icon-insertunorderedlist{background-position:0 -224px}.ke-icon-indent{background-position:0 -240px}.ke-icon-outdent{background-position:0 -256px}.ke-icon-subscript{background-position:0 -272px}.ke-icon-superscript{background-position:0 -288px}.ke-icon-date{width:25px;background-position:0 -304px}.ke-icon-time{width:25px;background-position:0 -320px}.ke-icon-formatblock{width:25px;background-position:0 -336px}.ke-icon-fontname{width:21px;background-position:0 -352px}.ke-icon-fontsize{width:23px;background-position:0 -368px}.ke-icon-forecolor{width:20px;background-position:0 -384px}.ke-icon-hilitecolor{width:23px;background-position:0 -400px}.ke-icon-bold{background-position:0 -416px}.ke-icon-italic{background-position:0 -432px}.ke-icon-underline{background-position:0 -448px}.ke-icon-strikethrough{background-position:0 -464px}.ke-icon-removeformat{background-position:0 -480px}.ke-icon-image{background-position:0 -496px}.ke-icon-flash{background-position:0 -512px}.ke-icon-media{background-position:0 -528px}.ke-icon-div{background-position:0 -544px}.ke-icon-formula{background-position:0 -576px}.ke-icon-hr{background-position:0 -592px}.ke-icon-emoticons{background-position:0 -608px}.ke-icon-link{background-position:0 -624px}.ke-icon-unlink{background-position:0 -640px}.ke-icon-fullscreen{background-position:0 -656px}.ke-icon-about{background-position:0 -672px}.ke-icon-plainpaste{background-position:0 -704px}.ke-icon-wordpaste{background-position:0 -720px}.ke-icon-table{background-position:0 -784px}.ke-icon-tablemenu{background-position:0 -768px}.ke-icon-tableinsert{background-position:0 -784px}.ke-icon-tabledelete{background-position:0 -800px}.ke-icon-tablecolinsertleft{background-position:0 -816px}.ke-icon-tablecolinsertright{background-position:0 -832px}.ke-icon-tablerowinsertabove{background-position:0 -848px}.ke-icon-tablerowinsertbelow{background-position:0 -864px}.ke-icon-tablecoldelete{background-position:0 -880px}.ke-icon-tablerowdelete{background-position:0 -896px}.ke-icon-tablecellprop{background-position:0 -912px}.ke-icon-tableprop{background-position:0 -928px}.ke-icon-checked{background-position:0 -944px}.ke-icon-code{background-position:0 -960px}.ke-icon-map{background-position:0 -976px}.ke-icon-baidumap{background-position:0 -976px}.ke-icon-lineheight{background-position:0 -992px}.ke-icon-clearhtml{background-position:0 -1008px}.ke-icon-pagebreak{background-position:0 -1024px}.ke-icon-insertfile{background-position:0 -1040px}.ke-icon-quickformat{background-position:0 -1056px}.ke-icon-template{background-position:0 -1072px}.ke-icon-tablecellsplit{background-position:0 -1088px}.ke-icon-tablerowmerge{background-position:0 -1104px}.ke-icon-tablerowsplit{background-position:0 -1120px}.ke-icon-tablecolmerge{background-position:0 -1136px}.ke-icon-tablecolsplit{background-position:0 -1152px}.ke-icon-anchor{background-position:0 -1168px}.ke-icon-search{background-position:0 -1184px}.ke-icon-new{background-position:0 -1200px}.ke-icon-specialchar{background-position:0 -1216px}.ke-icon-multiimage{background-position:0 -1232px}.ke-container{position:relative;display:block;padding:0;margin:0;overflow:hidden;background-color:#fff;border:1px solid #ccc;border-radius:4px}.ke-container.focus{border-color:#145ccd;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6)}.ke-container.ke-loading+textarea.kindeditor,.ke-container.ke-loading>.ke-edit,.ke-container.ke-loading>.ke-statusbar,.ke-container.ke-loading>.ke-toolbar{display:none}.ke-toolbar{padding:2px 5px;overflow:hidden;text-align:left;zoom:1;background-color:#fff;border-bottom:1px solid #ccc}.ke-toolbar-icon{display:block;overflow:hidden;font-size:0;line-height:0;background-repeat:no-repeat}.ke-menu .ke-toolbar-icon{display:inline-block}.ke-toolbar-icon-url{background-image:url(themes/default/default.png)}.ke-toolbar .ke-outline{display:block;float:left;padding:1px 2px;margin:1px;overflow:hidden;font-size:0;line-height:0;cursor:pointer;filter:alpha(opacity=80);border:1px solid #fff;border-radius:4px;opacity:.8}.ke-toolbar .ke-on,.ke-toolbar .ke-selected{filter:alpha(opacity=100);border-color:#ddd;opacity:1}.ke-toolbar .ke-selected{background-color:#f1f1f1}.ke-toolbar .ke-disabled{cursor:default}.ke-toolbar .ke-separator{display:block;float:left;width:0;height:16px;margin:2px 3px;overflow:hidden;font-size:0;line-height:0;border-top:0;border-bottom:0;border-left:1px dotted #ddd}.ke-toolbar .ke-hr{height:1px;overflow:hidden;clear:both}.ke-edit{padding:0}.ke-edit-iframe,.ke-edit-textarea{padding:0;margin:0;overflow:auto;border:0}.ke-edit-textarea{overflow:auto;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#353535;resize:none;background-color:#fff}.ke-edit-textarea:focus{outline:0}.ke-statusbar{position:absolute;right:0;bottom:0;width:14px;height:14px;overflow:hidden;font-size:0;line-height:0;text-align:center;cursor:s-resize;background-color:#fff;filter:alpha(opacity=0);border-top:1px solid #ccc;border-left:1px solid #ccc;opacity:0;-webkit-transition:opacity .2s;-o-transition:opacity .2s;transition:opacity .2s}.ke-statusbar .ke-statusbar-resize-icon{position:relative}.ke-statusbar .ke-statusbar-resize-icon:after,.ke-statusbar .ke-statusbar-resize-icon:before{position:absolute;top:2px;left:-4px;display:block;width:0;height:0;content:' ';border-color:transparent transparent grey transparent;border-style:solid;border-width:0 4px 4px 4px}.ke-statusbar .ke-statusbar-resize-icon:after{top:7px;border-color:grey transparent transparent transparent;border-width:4px 4px 0 4px}.ke-container:hover .ke-statusbar,.ke-statusbar.ke-dragging{filter:alpha(opacity=100);opacity:1}.ke-menu{padding:5px 0;overflow:hidden;font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Source Han Serif','Hiragino Sans GB','WenQuanYi Micro Hei','Microsoft YaHei',sans-serif;font-size:12px;text-align:left;background-color:#fff;border:1px solid #cbcbcb;border:1px solid rgba(0,0,0,.15);border-radius:4px}.ke-menu-item{height:24px;overflow:hidden;cursor:pointer}.ke-menu-item-on{color:#fff;text-decoration:none;background-color:#3280fc;outline:0}.ke-menu-item-left{width:27px;overflow:hidden;text-align:center}.ke-menu-item-center{width:0;height:24px;border-top:0;border-right:1px solid #fff;border-bottom:0;border-left:1px solid #e3e3e3}.ke-menu-item-center-on{border-right:1px solid #e9eff6;border-left:1px solid #e9eff6}.ke-menu-item-right{padding:0 0 0 5px;overflow:hidden;line-height:24px;text-align:left;border:0}.ke-menu-separator{height:0;margin:2px 0;overflow:hidden;border-top:1px solid #ccc;border-right:0;border-bottom:1px solid #fff;border-left:0}.ke-colorpicker{background-color:#fff;border:1px solid #cbcbcb;border:1px solid rgba(0,0,0,.15);border-radius:4px}.ke-colorpicker-table{padding:0;margin:0;border-collapse:separate;border:0}.ke-colorpicker-cell{padding:0;font-size:0;line-height:0;cursor:pointer;border:none}.ke-colorpicker-cell-color{width:25px;height:25px;padding:0;border:0}.ke-colorpicker-cell-top{padding:0;margin:0;font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Source Han Serif','Hiragino Sans GB','WenQuanYi Micro Hei','Microsoft YaHei',sans-serif;font-size:12px;line-height:25px;text-align:center;cursor:pointer}.ke-colorpicker-cell-on{color:#fff;background-color:#3280fc}.ke-colorpicker-cell-on .ke-colorpicker-cell-color{border:2px solid #353535}.ke-colorpicker-cell-selected .ke-colorpicker-cell-color{border:2px solid #353535}.ke-dialog{position:absolute;padding:0;margin:0}.ke-dialog .ke-header{width:100%;margin-bottom:10px}.ke-dialog .ke-header .ke-left{float:left}.ke-dialog .ke-header .ke-right{float:right}.ke-dialog .ke-header label{display:inline;margin-right:0;font-weight:400;vertical-align:top;cursor:pointer}.ke-dialog-content{width:100%;height:100%;overflow:hidden;background-color:#fff;border-radius:4px}.ke-dialog-shadow{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;background-color:#f0f0ee;border-radius:4px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.ke-dialog-header{min-height:16.54px;padding:7.5px 15px;margin:0;font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Source Han Serif','Hiragino Sans GB','WenQuanYi Micro Hei','Microsoft YaHei',sans-serif;font-size:13px;font-weight:700;text-align:left;cursor:move;background:#f1f1f1;border:0;border-bottom:1px solid #e5e5e5}.ke-dialog-icon-close{position:absolute;top:10px;right:8px;display:block;width:16px;height:16px;cursor:pointer;background:url(themes/default/default.png) no-repeat scroll 0 -688px;filter:alpha(opacity=60);opacity:.6}.ke-dialog-icon-close:hover{filter:alpha(opacity=100);opacity:1}.ke-dialog-body{width:100%;overflow:hidden;font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Source Han Serif','Hiragino Sans GB','WenQuanYi Micro Hei','Microsoft YaHei',sans-serif;font-size:12px;text-align:left}.ke-dialog-body textarea{display:block;padding:0;overflow:auto;resize:none}.ke-dialog-body input:focus,.ke-dialog-body select:focus,.ke-dialog-body textarea:focus{outline:0}.ke-dialog-body label{display:-moz-inline-stack;display:inline-block;margin-right:10px;vertical-align:middle;cursor:pointer;zoom:1;*display:inline}.ke-dialog-body img{display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;*display:inline}.ke-dialog-body select{display:-moz-inline-stack;display:inline-block;width:auto;vertical-align:middle;zoom:1;*display:inline}.ke-dialog-body .ke-textarea{display:block;width:408px;height:260px;background-color:#fff;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,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;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,-webkit-box-shadow ease-in-out .15s}.ke-dialog-body .ke-form{padding:0;margin:0}.ke-dialog-loading{position:absolute;top:0;left:1px;z-index:1;text-align:center}.ke-dialog-loading-content{height:31px;padding-left:36px;font-size:14px;font-weight:700;line-height:31px;color:#666;background:url(../common/loading.gif) no-repeat}.ke-dialog-row{margin-bottom:10px}.ke-dialog-footer{width:100%;padding:5px;text-align:right;border-top:1px solid #e5e5e5}.ke-dialog-preview,.ke-dialog-yes{margin:5px}.ke-dialog-no{margin:5px 10px 5px 5px}.ke-dialog-mask{background-color:#000;filter:alpha(opacity=50);opacity:.5}.ke-button-common{display:inline-block;height:23px;overflow:visible;line-height:21px;vertical-align:middle;cursor:pointer}.ke-button-outer{position:relative;display:-moz-inline-stack;display:inline-block;padding:0;vertical-align:middle;zoom:1;*display:inline}.ke-button{left:2px;padding:0 12px;margin:0;font-size:12px;color:#353535;text-decoration:none;background-color:#f2f2f2;border:1px solid #bfbfbf;border-color:#bfbfbf;border-radius:4px}.ke-button.active,.ke-button:active,.ke-button:focus,.ke-button:hover,.open .dropdown-toggle.ke-button{color:#353535;background-color:#dedede;border-color:#a1a1a1;-webkit-box-shadow:0 2px 1px rgba(0,0,0,.1);box-shadow:0 2px 1px rgba(0,0,0,.1)}.ke-button.active,.ke-button:active,.open .dropdown-toggle.ke-button{background-color:#ccc;background-image:none;border-color:#a6a6a6;-webkit-box-shadow:inset 0 4px 6px rgba(0,0,0,.15);box-shadow:inset 0 4px 6px rgba(0,0,0,.15)}.ke-button.disabled,.ke-button.disabled.active,.ke-button.disabled:active,.ke-button.disabled:focus,.ke-button.disabled:hover,.ke-button[disabled],.ke-button[disabled].active,.ke-button[disabled]:active,.ke-button[disabled]:focus,.ke-button[disabled]:hover,fieldset[disabled] .ke-button,fieldset[disabled] .ke-button.active,fieldset[disabled] .ke-button:active,fieldset[disabled] .ke-button:focus,fieldset[disabled] .ke-button:hover{background-color:#f2f2f2;border-color:#bfbfbf}.ke-input-text{display:-moz-inline-stack;display:inline-block;height:20px;padding:0 4px;font-family:"sans serif",tahoma,verdana,helvetica;font-size:12px;line-height:20px;vertical-align:middle;zoom:1;background-color:#fff;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,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;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,-webkit-box-shadow ease-in-out .15s;*display:inline}.ke-input-text.focus,.ke-input-text:focus{border-color:#145ccd;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6)}.ke-input-text[disabled]{background:#eee}.ke-input-number{width:50px}.ke-input-color,ke-dialog-content select{display:-moz-inline-stack;display:inline-block;width:60px;height:20px;padding-left:5px;overflow:hidden;font-size:12px;line-height:20px;vertical-align:middle;cursor:pointer;zoom:1;background-color:#fff;border:1px solid #ccc;*display:inline}.ke-upload-button{position:relative}.ke-upload-area{position:relative;padding:0;margin:0;overflow:hidden}.ke-upload-area .ke-upload-file{position:absolute;top:0;right:0;z-index:811212;padding:0;margin:0;font-size:60px;filter:alpha(opacity=0);border:0 none;opacity:0}.ke-tabs{padding-left:5px;margin-bottom:20px;font:12px/1 "sans serif",tahoma,verdana,helvetica;border-bottom:1px solid #a0a0a0}.ke-tabs-ul{padding:0;margin:0;list-style-position:outside;list-style-type:none;list-style-image:none}.ke-tabs-li{position:relative;float:left;padding:0 20px;margin:0 2px -1px 0;line-height:25px;color:#555;text-align:center;cursor:pointer;background-color:#f0f0ee;border:1px solid #a0a0a0}.ke-tabs-li-selected{color:#000;cursor:default;background-color:#fff;border-bottom:1px solid #fff}.ke-tabs-li-on{color:#000;background-color:#fff}.ke-progressbar{position:relative;padding:0;margin:0}.ke-progressbar-bar{width:80px;height:5px;padding:0;margin:10px 10px 0 10px;border:1px solid #6fa5db}.ke-progressbar-bar-inner{width:0;height:5px;padding:0;margin:0;overflow:hidden;background-color:#6fa5db}.ke-progressbar-percent{position:absolute;top:0;left:40%;display:none}.ke-swfupload-top{position:relative;margin-bottom:10px;_width:608px}.ke-swfupload-button{height:23px;line-height:23px}.ke-swfupload-desc{height:23px;padding:0 10px;line-height:23px}.ke-swfupload-startupload{position:absolute;top:0;right:0}.ke-swfupload-body{width:auto;height:370px;padding:5px;overflow:scroll;background-color:#fff;border:1px solid #ccc}.ke-swfupload-body .ke-item{width:100px;margin:5px}.ke-swfupload-body .ke-photo{position:relative;padding:10px;background-color:#fff;border:1px solid #ddd}.ke-swfupload-body .ke-delete{position:absolute;top:0;right:0;display:block;width:16px;height:16px;cursor:pointer;background:url(themes/default/default.png) no-repeat scroll 0 -688px}.ke-swfupload-body .ke-status{position:absolute;bottom:5px;left:0;width:100px;height:17px}.ke-swfupload-body .ke-message{width:100px;height:17px;overflow:hidden;text-align:center}.ke-swfupload-body .ke-error{color:red}.ke-swfupload-body .ke-name{width:100px;height:16px;overflow:hidden;text-align:center}.ke-swfupload-body .ke-on{background-color:#e9eff6;border:1px solid #5690d2}.ke-plugin-emoticons{position:relative}.ke-plugin-emoticons .ke-preview{position:absolute;top:0;display:none;padding:10px;margin:2px;text-align:center;background-color:#fff;border:1px solid #a0a0a0}.ke-plugin-emoticons .ke-preview-img{padding:0;margin:0;border:0}.ke-plugin-emoticons .ke-table{padding:0;margin:0;border-collapse:separate;border:0}.ke-plugin-emoticons .ke-cell{padding:1px;margin:0;cursor:pointer;border:1px solid #f0f0ee}.ke-plugin-emoticons .ke-on{background-color:#e9eff6;border:1px solid #5690d2}.ke-plugin-emoticons .ke-img{display:block;width:24px;height:24px;padding:0;margin:2px;margin:0;overflow:hidden;background-repeat:no-repeat;border:0}.ke-plugin-emoticons .ke-page{padding:0;margin:5px;font:12px/1 "sans serif",tahoma,verdana,helvetica;color:#333;text-align:right;text-decoration:none;border:0}.ke-plugin-plainpaste-textarea,.ke-plugin-wordpaste-iframe{display:block;width:408px;height:260px;font-family:"sans serif",tahoma,verdana,helvetica;font-size:12px;border:1px solid #ccc}.ke-plugin-filemanager-header{width:100%;margin-bottom:10px}.ke-plugin-filemanager-header .ke-left{float:left}.ke-plugin-filemanager-header .ke-right{float:right}.ke-plugin-filemanager-body{width:auto;height:370px;padding:5px;overflow:scroll;background-color:#fff;border:1px solid #ccc}.ke-plugin-filemanager-body .ke-item{width:100px;margin:5px}.ke-plugin-filemanager-body .ke-photo{padding:10px;background-color:#fff;border:1px solid #ddd}.ke-plugin-filemanager-body .ke-name{width:100px;height:16px;overflow:hidden;text-align:center}.ke-plugin-filemanager-body .ke-on{background-color:#e9eff6;border:1px solid #5690d2}.ke-plugin-filemanager-body .ke-table{width:95%;padding:0;margin:0;border-collapse:separate;border:0}.ke-plugin-filemanager-body .ke-table .ke-cell{padding:0;margin:0;border:0}.ke-plugin-filemanager-body .ke-table .ke-name{width:55%;text-align:left}.ke-plugin-filemanager-body .ke-table .ke-size{width:15%;text-align:left}.ke-plugin-filemanager-body .ke-table .ke-datetime{width:30%;text-align:center}.ke-dialog input[type=number]::-webkit-inner-spin-button,.ke-dialog input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.ke-dialog input[type=number]{-moz-appearance:textfield} \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.js b/dist/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.js new file mode 100644 index 0000000..646b4e8 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.js @@ -0,0 +1,7 @@ +!function(window,undefined){function _isArray(e){return!!e&&"[object Array]"===Object.prototype.toString.call(e)}function _isFunction(e){return!!e&&"[object Function]"===Object.prototype.toString.call(e)}function _inArray(e,t){for(var n=0,i=t.length;n=0}function _addUnit(e,t){return t=t||"px",e&&/^\d+$/.test(e)?e+t:e}function _removeUnit(e){var t;return e&&(t=/(\d+)/.exec(e))?parseInt(t[1],10):0}function _escape(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function _unescape(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function _toCamel(e){var t=e.split("-");return e="",_each(t,function(t,n){e+=t>0?n.charAt(0).toUpperCase()+n.substr(1):n}),e}function _toHex(e){function t(e){var t=parseInt(e,10).toString(16).toUpperCase();return t.length>1?t:"0"+t}return e.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/gi,function(e,n,i,a){return"#"+t(n)+t(i)+t(a)})}function _toMap(e,t){t=t===undefined?",":t;var n,i={},a=_isArray(e)?e:e.split(t);return _each(a,function(e,t){if(n=/^(\d+)\.\.(\d+)$/.exec(t))for(var a=parseInt(n[1],10);a<=parseInt(n[2],10);a++)i[a.toString()]=!0;else i[t]=!0}),i}function _toArray(e,t){return Array.prototype.slice.call(e,t||0)}function _undef(e,t){return e===undefined?t:e}function _invalidUrl(e){return!e||/[<>"]/.test(e)}function _addParam(e,t){return e.indexOf("?")>=0?e+"&"+t:e+"?"+t}function _extend(e,t,n){n||(n=t,t=null);var i;if(t){var a=function(){};a.prototype=t.prototype,i=new a,_each(n,function(e,t){i[e]=t})}else i=n;i.constructor=e,e.prototype=i,e.parent=t?t.prototype:null}function _json(text){var match;(match=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(text))&&(text=match[0]);var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return eval("("+text+")");throw"JSON parse error"}function _getBasePath(){for(var e,t=document.getElementsByTagName("script"),n=0,i=t.length;n=0)return void _each(t.split(","),function(){_bind(e,this,n)});var i=_getId(e);i||(i=_setId(e)),_eventData[i]===undefined&&(_eventData[i]={});var a=_eventData[i][t];a&&a.length>0?_unbindEvent(e,t,a[0]):(_eventData[i][t]=[],_eventData[i].el=e),a=_eventData[i][t],0===a.length&&(a[0]=function(t){var n=t?new KEvent(e,t):undefined;_each(a,function(t,i){t>0&&i&&i.call(e,n)})}),_inArray(n,a)<0&&a.push(n),_bindEvent(e,t,a[0])}function _unbind(e,t,n){if(t&&t.indexOf(",")>=0)return void _each(t.split(","),function(){_unbind(e,this,n)});var i=_getId(e);if(i){if(t===undefined)return void(i in _eventData&&(_each(_eventData[i],function(t,n){"el"!=t&&n.length>0&&_unbindEvent(e,t,n[0])}),delete _eventData[i],_removeId(e)));if(_eventData[i]){var a=_eventData[i][t];if(a&&a.length>0){n===undefined?(_unbindEvent(e,t,a[0]),delete _eventData[i][t]):(_each(a,function(e,t){e>0&&t===n&&a.splice(e,1)}),1==a.length&&(_unbindEvent(e,t,a[0]),delete _eventData[i][t]));var o=0;_each(_eventData[i],function(){o++}),o<2&&(delete _eventData[i],_removeId(e))}}}}function _fire(e,t){if(t.indexOf(",")>=0)return void _each(t.split(","),function(){_fire(e,this)});var n=_getId(e);if(n){var i=_eventData[n][t];_eventData[n]&&i&&i.length>0&&i[0]()}}function _ctrl(e,t,n){t=/^\d{2,}$/.test(t)?t:t.toUpperCase().charCodeAt(0),_bind(e,"keydown",function(i){!i.ctrlKey||i.which!=t||i.shiftKey||i.altKey||(n.call(e),i.stop())})}function _ready(e){function t(){a||(a=!0,e(KindEditor),_readyFinished=!0)}function n(){if(!a){try{document.documentElement.doScroll("left")}catch(e){return void setTimeout(n,100)}t()}}function i(){"complete"===document.readyState&&t()}if(_readyFinished)return void e(KindEditor);var a=!1;if(document.addEventListener)_bind(document,"DOMContentLoaded",t);else if(document.attachEvent){_bind(document,"readystatechange",i);var o=!1;try{o=null==window.frameElement}catch(r){}document.documentElement.doScroll&&o&&n()}_bind(window,"load",t)}function _getCssList(e){for(var t,n={},i=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g;t=i.exec(e);){var a=_trim(t[1].toLowerCase()),o=_trim(_toHex(t[2]));n[a]=o}return n}function _getAttrList(e){for(var t,n={},i=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g;t=i.exec(e);){var a=(t[1]||t[2]||t[4]||t[6]).toLowerCase(),o=(t[2]?t[3]:t[4]?t[5]:t[7])||"";n[a]=o}return n}function _addClassToTag(e,t){return e=/\s+class\s*=/.test(e)?e.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(e,n,i,a){return(" "+i+" ").indexOf(" "+t+" ")<0?""===i?n+t+a:n+i+" "+t+a:e}):e.substr(0,e.length-1)+' class="'+t+'">'}function _formatCss(e){var t="";return _each(_getCssList(e),function(e,n){t+=e+":"+n+";"}),t}function _formatUrl(e,t,n,i){function a(e){for(var t=e.split("/"),n=[],i=0,a=t.length;i0&&n.pop():""!==o&&"."!=o&&n.push(o)}return"/"+n.join("/")}function o(t,n){if(e.substr(0,t.length)===t){for(var a=[],r=0;r0&&(s+="/"+a.join("/")),"/"==i&&(s+="/"),s+e.substr(t.length)}if(l=/^(.*)\//.exec(t))return o(l[1],++n)}if(t=_undef(t,"").toLowerCase(),"data:"!=e.substr(0,5)&&(e=e.replace(/([^:])\/\//g,"$1/")),_inArray(t,["absolute","relative","domain"])<0)return e;if(n=n||location.protocol+"//"+location.host,i===undefined){var r=location.pathname.match(/^(\/.*)\//);i=r?r[1]:""}var l;if(l=/^(\w+:\/\/[^\/]*)/.exec(e)){if(l[1]!==n)return e}else if(/^\w+:/.test(e))return e;return/^\//.test(e)?e=n+a(e.substr(1)):/^\w+:\/\//.test(e)||(e=n+a(i+"/"+e)),"relative"===t?e=o(n+i,0).substr(2):"absolute"===t&&e.substr(0,n.length)===n&&(e=e.substr(n.length)),e}function _formatHtml(e,t,n,i,a,o){null==e&&(e=""),n=n||"",i=_undef(i,!1),a=_undef(a,"\t");var r="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");e=e.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/gi,function(e,t,n,i){return t+n.replace(/<(?:br|br\s[^>]*)>/gi,"\n")+i}),e=e.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/gi,"

    "),e=e.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/gi,"$1
    $2"),e=e.replace(/\u200B/g,""),e=e.replace(/\u00A9/g,"©"),e=e.replace(/<[^>]+>/g,function(e){return e.replace(/\s+/g," ")});var l={};t&&(_each(t,function(e,t){for(var n=e.split(","),i=0,a=n.length;i]*)>)([\s\S]*?)(<\/script>)/gi,"")),l.style||(e=e.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/gi,"")));var s=/(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g,d=[],c=null;return e=e.replace(s,function(e,s,u,p,h,f,m){var g=e,v=s||"",_=u||"",b=p.toLowerCase(),y=h||"",k=f?" "+f:"",w=m||"";if(t&&!l[b])return"";if(""===k&&_SINGLE_TAG_MAP[b]&&(k=" /"),_INLINE_TAG_MAP[b]&&(v&&(v=" "),w&&(w=" ")),_PRE_TAG_MAP[b]&&(_?w="\n":v="\n"),!i||"br"!=b&&"hr"!==b||o&&c!==!0||(w="\n"),_BLOCK_TAG_MAP[b]&&!_PRE_TAG_MAP[b])if(i){var C=!!(_&&d.length>0&&d[d.length-1]===b);if(C?(d.pop(),o&&(v="",w="\n")):(d.push(b),o&&(v="\n",w="")),o||(v="\n",w="\n"),!o||c===!1&&!C||c===!0)for(var S=0,x=_?d.length:d.length-1;S=0&&(E[e]=_formatUrl(i,n)),(t&&"style"!==e&&!l[b]["*"]&&!l[b][e]||"body"===b&&"contenteditable"===e||/^kindeditor_\d+$/.test(e))&&delete E[e],"style"===e&&""!==i){var a=_getCssList(i);_each(a,function(e,n){!t||l[b].style||l[b]["."+e]||delete a[e]});var o="";_each(a,function(e,t){o+=e+":"+t+";"}),E.style=o}}),y="",_each(E,function(e,t){"style"===e&&""===t||(t=t.replace(/"/g,"""),y+=" "+e+'="'+t+'"')})}return"font"===b&&(b="span"),v+"<"+_+b+y+k+">"+w}),e=e.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/gi,function(e,t,n,i){return t+n.replace(/\n/g,'\n')+i}),e=e.replace(/\n\s*\n/g,"\n"),e=e.replace(/\n/g,"\n"),_trim(e)}function _clearMsWord(e,t){return e=e.replace(//gi,"").replace(//gi,"").replace(/]*>[\s\S]*?<\/style>/gi,"").replace(/]*>[\s\S]*?<\/script>/gi,"").replace(/]+>[\s\S]*?<\/w:[^>]+>/gi,"").replace(/]+>[\s\S]*?<\/o:[^>]+>/gi,"").replace(/[\s\S]*?<\/xml>/gi,"").replace(/<(?:table|td)[^>]*>/gi,function(e){return e.replace(/border-bottom:([#\w\s]+)/gi,"border:$1")}),_formatHtml(e,t)}function _mediaType(e){return/\.(rm|rmvb)(\?|$)/i.test(e)?"audio/x-pn-realaudio-plugin":/\.(swf|flv)(\?|$)/i.test(e)?"application/x-shockwave-flash":"video/x-ms-asf-plugin"}function _mediaClass(e){return/realaudio/i.test(e)?"ke-rm":/flash/i.test(e)?"ke-flash":"ke-media"}function _mediaAttrs(e){return _getAttrList(unescape(e))}function _mediaEmbed(e){var t="0&&(r+="width:"+n+"px;"),/\D/.test(i)?r+="height:"+i+";":i>0&&(r+="height:"+i+"px;");var l=''}function _tmpl(e,t){var n=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+e.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return t?n(t):n}function _contains(e,t){if(9==e.nodeType&&9!=t.nodeType)return!0;for(;t=t.parentNode;)if(t==e)return!0;return!1}function _getAttr(e,t){t=t.toLowerCase();var n=null;if(_GET_SET_ATTRIBUTE||"script"==e.nodeName.toLowerCase())try{n=e.getAttribute(t,2)}catch(i){n=e.getAttribute(t,1)}else{var a=e.ownerDocument.createElement("div");a.appendChild(e.cloneNode(!1));var o=_getAttrList(_unescape(a.innerHTML));t in o&&(n=o[t])}return"style"===t&&null!==n&&(n=_formatCss(n)),n}function _queryAll(e,t){function n(e){return"string"!=typeof e?e:e.replace(/([^\w\-])/g,"\\$1")}function i(e){return e.replace(/\\/g,"")}function a(e,t){return"*"===e||e.toLowerCase()===n(t.toLowerCase())}function o(e,t,n){var o=[],r=n.ownerDocument||n,l=r.getElementById(i(e));return l&&a(t,l.nodeName)&&_contains(n,l)&&o.push(l),o}function r(e,t,n){var o,r,l,s,d=n.ownerDocument||n,c=[];if(n.getElementsByClassName)for(o=n.getElementsByClassName(i(e)),r=0,l=o.length;r-1&&c.push(s)}return c}function l(e,t,n){for(var o,r=[],l=n.ownerDocument||n,s=l.getElementsByName(i(e)),d=0,c=s.length;d])+)/.exec(e);var a=n?n[1]:"*";if(n=/#((?:[\w\-]|\\.)+)$/.exec(e))i=o(n[1],a,t);else if(n=/\.((?:[\w\-]|\\.)+)$/.exec(e))i=r(n[1],a,t);else if(n=/\[((?:[\w\-]|\\.)+)\]/.exec(e))i=s(n[1].toLowerCase(),null,a,t);else if(n=/\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(e)){var d=n[1].toLowerCase(),c=n[2];i="id"===d?o(c,a,t):"class"===d?r(c,a,t):"name"===d?l(c,a,t):s(d,c,a,t)}else for(var u,p=t.getElementsByTagName(a),h=0,f=p.length;h1){var u=[];return _each(c,function(){_each(_queryAll(this,t),function(){_inArray(this,u)<0&&u.push(this)})}),u}t=t||document;for(var p,h=[],f=/((?:\\.|[^\s>])+|[\s>])/g;p=f.exec(e);)" "!==p[1]&&h.push(p[1]);var m=[];if(1==h.length)return d(h[0],t);var g,v,_,b,y,k,w,C,S,x,E=!1;for(k=0,lenth=h.length;k"!==g){if(k>0){for(v=[],w=0,S=m.length;w0?n[0]:null}function _get(e){return K(e)[0]}function _getDoc(e){return e?e.ownerDocument||e.document||e:document}function _getWin(e){if(!e)return window;var t=_getDoc(e);return t.parentWindow||t.defaultView}function _setHtml(e,t){if(1==e.nodeType){var n=_getDoc(e);try{e.innerHTML=''+t;var i=n.getElementById("__kindeditor_temp_tag__");i.parentNode.removeChild(i)}catch(a){K(e).empty(),K("@"+t,n).each(function(){e.appendChild(this)})}}}function _hasClass(e,t){return _inString(t,e.className," ")}function _setAttr(e,t,n){_IE&&_V<8&&"class"==t.toLowerCase()&&(t="className"),e.setAttribute(t,""+n)}function _removeAttr(e,t){_IE&&_V<8&&"class"==t.toLowerCase()&&(t="className"),_setAttr(e,t,""),e.removeAttribute(t)}function _getNodeName(e){return e&&e.nodeName?e.nodeName.toLowerCase():""}function _computedCss(e,t){var n=_getWin(e),i=_toCamel(t),a="";if(n.getComputedStyle){var o=n.getComputedStyle(e,null);a=o[i]||o.getPropertyValue(t)||e.style[i]}else e.currentStyle&&(a=e.currentStyle[i]||e.style[i]);return a}function _hasVal(e){return!!_VALUE_TAG_MAP[_getNodeName(e)]}function _docElement(e){return e=e||document,_QUIRKS?e.body:e.documentElement}function _docHeight(e){var t=_docElement(e);return Math.max(t.scrollHeight,t.clientHeight)}function _docWidth(e){var t=_docElement(e);return Math.max(t.scrollWidth,t.clientWidth)}function _getScrollPos(e){e=e||document;var t,n;return _IE||_NEWIE||_OPERA?(t=_docElement(e).scrollLeft,n=_docElement(e).scrollTop):(t=_getWin(e).scrollX,n=_getWin(e).scrollY),{x:t,y:n}}function KNode(e){this.init(e)}function _updateCollapsed(e){return e.collapsed=e.startContainer===e.endContainer&&e.startOffset===e.endOffset,e}function _copyAndDelete(e,t,n){function i(i,a,o){var r,s=i.nodeValue.length;if(t){var d=i.cloneNode(!0);r=a>0?d.splitText(a):d,o0&&(c=i.splitText(a),e.setStart(i,a)),o=0&&c<=0&&(c=g.compareBoundaryPoints(_START_TO_START,e)),c>=0&&u<=0&&(u=g.compareBoundaryPoints(_END_TO_END,e)),u>=0&&p<=0&&(p=g.compareBoundaryPoints(_END_TO_START,e)),p>=0)return!1;if(f=m.nextSibling,d>0)if(1==m.nodeType)if(c>=0&&u<=0)t&&h.appendChild(m.cloneNode(!0)),n&&l.push(m);else{var v;if(t&&(v=m.cloneNode(!1),h.appendChild(v)),o(m,v)===!1)return!1}else if(3==m.nodeType){var _;if(_=m==s.startContainer?i(m,s.startOffset,m.nodeValue.length):m==s.endContainer?i(m,0,s.endOffset):i(m,0,m.nodeValue.length),t)try{h.appendChild(_)}catch(b){}}m=f}}var r=e.doc,l=[],s=e.cloneRange().down(),d=-1,c=-1,u=-1,p=-1,h=e.commonAncestor(),f=r.createDocumentFragment();if(3==h.nodeType){var m=i(h,e.startOffset,e.endOffset);return t&&f.appendChild(m),a(),t?f:e}o(h,f),n&&e.up().collapse(!0);for(var g=0,v=l.length;g0?l+=f.text.replace(/\r\n|\n|\r/g,"").length:l=0,h&&K(h).remove()}else 3==p.nodeType&&(d.moveStart("character",p.nodeValue.length),l+=p.nodeValue.length);s<0&&(r=p)}if(s<0&&1==r.nodeType)return{node:a,offset:K(a.lastChild).index()+1};if(s>0)for(;r.nextSibling&&1==r.nodeType;)r=r.nextSibling;if(d=e.duplicate(),_moveToElementText(d,a),d.setEndPoint("StartToEnd",i),l-=d.text.replace(/\r\n|\n|\r/g,"").length,s>0&&3==r.nodeType)for(var v=r.previousSibling;v&&3==v.nodeType;)l-=v.nodeValue.length,v=v.previousSibling;return{node:r,offset:l}}function _getEndRange(e,t){var n=e.ownerDocument||e,i=n.body.createTextRange();if(n==e)return i.collapse(!0),i;if(1==e.nodeType&&e.childNodes.length>0){var a,o,r=e.childNodes;if(0===t?(o=r[0],a=!0):(o=r[t-1],a=!1),!o)return i;if("head"===K(o).name)return 1===t&&(a=!0),2===t&&(a=!1),i.collapse(a),i;if(1==o.nodeType){var l,s=K(o);return s.isControl()&&(l=n.createElement("span"),a?s.before(l):s.after(l),o=l),_moveToElementText(i,o),i.collapse(a),l&&K(l).remove(),i}e=o,t=a?0:o.nodeValue.length}var d=n.createElement("span");return K(e).before(d),_moveToElementText(i,d),i.moveStart("character",t),K(d).remove(),i}function _toRange(e){function t(e){"tr"==K(e.node).name&&(e.node=e.node.cells[e.offset],e.offset=0)}var n,i;if(_IERANGE){if(e.item)return n=_getDoc(e.item(0)),i=new KRange(n),i.selectNode(e.item(0)),i;n=e.parentElement().ownerDocument;var a=_getStartEnd(e,!0),o=_getStartEnd(e,!1);return t(a),t(o),i=new KRange(n),i.setStart(a.node,a.offset),i.setEnd(o.node,o.offset),i}var r=e.startContainer;return n=r.ownerDocument||r,i=new KRange(n),i.setStart(r,e.startOffset),i.setEnd(e.endContainer,e.endOffset),i}function KRange(e){this.init(e)}function _range(e){return e.nodeName?new KRange(e):e.constructor===KRange?e:_toRange(e)}function _nativeCommand(e,t,n){try{e.execCommand(t,!1,n)}catch(i){}}function _nativeCommandValue(e,t){var n="";try{n=e.queryCommandValue(t)}catch(i){}return"string"!=typeof n&&(n=""),n}function _getSel(e){var t=_getWin(e);return _IERANGE?e.selection:t.getSelection()}function _getRng(e){var t,n=_getSel(e);try{t=n.rangeCount>0?n.getRangeAt(0):n.createRange()}catch(i){}return!_IERANGE||t&&(t.item||t.parentElement().ownerDocument===e)?t:null}function _singleKeyMap(e){var t,n,i={};return _each(e,function(e,a){t=e.split(",");for(var o=0,r=t.length;o]+>/g,"")}function _mergeWrapper(e,t){e=e.clone(!0);for(var n=_getInnerNode(e),i=e,a=!1;t;){for(;i;)i.name===t.name&&(_mergeAttrs(i,t.attr(),t.css()),a=!0),i=i.first();a||n.append(t.clone(!1)),a=!1,t=t.first()}return e}function _wrapNode(e,t){if(t=t.clone(!0),3==e.type)return _getInnerNode(t).append(e.clone(!1)),e.replaceWith(t),t;for(var n,i=e;(n=e.first())&&1==n.children().length;)e=n;n=e.first();for(var a=e.doc.createDocumentFragment();n;)a.appendChild(n[0]),n=n.next();return t=_mergeWrapper(i,t),a.firstChild&&_getInnerNode(t).append(a),i.replaceWith(t),t}function _mergeAttrs(e,t,n){_each(t,function(t,n){"style"!==t&&e.attr(t,n)}),_each(n,function(t,n){e.css(t,n)})}function _inPreElement(e){for(;e&&"body"!=e.name;){if(_PRE_TAG_MAP[e.name]||"div"==e.name&&e.hasClass("ke-script"))return!0;e=e.parent()}return!1}function KCmd(e){this.init(e)}function _cmd(e){if(e.nodeName){var t=_getDoc(e);e=_range(t).selectNodeContents(t.body).collapse(!1)}return new KCmd(e)}function _drag(e){var t=e.moveEl,n=e.moveFn,i=e.clickEl||t,a=e.beforeDrag,o=e.iframeFix===undefined||e.iframeFix,r=[document];o&&K("iframe").each(function(){var e=_formatUrl(this.src||"","absolute");if(!/^https?:\/\//.test(e)){var t;try{t=_iframeDoc(this)}catch(n){}if(t){var i=K(this).pos();K(t).data("pos-x",i.x),K(t).data("pos-y",i.y),r.push(t)}}}),i.mousedown(function(e){function o(e){e.preventDefault();var t=K(_getDoc(e.target)),a=_round((t.data("pos-x")||0)+e.pageX-f),o=_round((t.data("pos-y")||0)+e.pageY-m);n.call(i,c,u,p,h,a,o)}function l(e){e.preventDefault()}function s(e){e.preventDefault(),K(r).unbind("mousemove",o).unbind("mouseup",s).unbind("selectstart",l),d.releaseCapture&&d.releaseCapture(),K(d).removeClass("ke-dragging")}e.stopPropagation();var d=i.get(),c=_removeUnit(t.css("left")),u=_removeUnit(t.css("top")),p=t.width(),h=t.height(),f=e.pageX,m=e.pageY;K(d).addClass("ke-dragging"),a&&a(),K(r).mousemove(o).mouseup(s).bind("selectstart",l),d.setCapture&&d.setCapture()})}function KWidget(e){this.init(e)}function _widget(e){return new KWidget(e)}function _iframeDoc(e){return e=_get(e),e.contentDocument||e.contentWindow.document}function _getInitHtml(e,t,n,i){var a=[""===_direction?"":'','',""];return _isArray(n)||(n=[n]),_each(n,function(e,t){t&&a.push('')}),i&&a.push(""),a.push(""),a.join("\n")}function _elementVal(e,t){if(e.hasVal()){if(t===undefined){var n=e.val();return n=n.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/gi,"")}return e.val(t)}return e.html(t)}function KEdit(e){this.init(e)}function _edit(e){return new KEdit(e)}function _selectToolbar(e,t){var n=this,i=n.get(e);if(i){if(i.hasClass("ke-disabled"))return;t(i)}}function KToolbar(e){this.init(e)}function _toolbar(e){return new KToolbar(e)}function KMenu(e){this.init(e)}function _menu(e){return new KMenu(e)}function KColorPicker(e){this.init(e)}function _colorpicker(e){return new KColorPicker(e)}function KUploadButton(e){this.init(e)}function _uploadbutton(e){return new KUploadButton(e)}function _createButton(e){e=e||{};var t=e.name||"",n=K(''),i=K('');return e.click&&i.click(e.click),n.append(i),n}function KDialog(e){this.init(e)}function _dialog(e){return new KDialog(e)}function _tabs(e){var t=_widget(e),n=t.remove,i=e.afterSelect,a=t.div,o=[];a.addClass("ke-tabs").bind("contextmenu,mousedown,mousemove",function(e){e.preventDefault()});var r=K('
      ');return a.append(r),t.add=function(e){var t=K('
    • '+e.title+"
    • ");t.data("tab",e),o.push(t),r.append(t)},t.selectedIndex=0,t.select=function(e){t.selectedIndex=e,_each(o,function(n,i){i.unbind(),n===e?(i.addClass("ke-tabs-li-selected"),K(i.data("tab").panel).show("")):(i.removeClass("ke-tabs-li-selected").removeClass("ke-tabs-li-on").mouseover(function(){K(this).addClass("ke-tabs-li-on")}).mouseout(function(){K(this).removeClass("ke-tabs-li-on")}).click(function(){t.select(n)}),K(i.data("tab").panel).hide())}),i&&i.call(t,e)},t.remove=function(){_each(o,function(){this.remove()}),r.remove(),n.call(t)},t}function _loadScript(e,t){var n=document.getElementsByTagName("head")[0]||(_QUIRKS?document.body:document.documentElement),i=document.createElement("script");n.appendChild(i),i.src=e,i.charset="utf-8",i.onload=i.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState||(t&&t(),i.onload=i.onreadystatechange=null,n.removeChild(i))}}function _chopQuery(e){var t=e.indexOf("?");return t>0?e.substr(0,t):e}function _loadStyle(e){for(var t=document.getElementsByTagName("head")[0]||(_QUIRKS?document.body:document.documentElement),n=document.createElement("link"),i=_chopQuery(_formatUrl(e,"absolute")),a=K('link[rel="stylesheet"]',t),o=0,r=a.length;on&&(n=this.width)))});i.length>0&&"-"==i[0].title;)i.shift();for(;i.length>0&&"-"==i[i.length-1].title;)i.pop();var a=null;if(_each(i,function(e){"-"==this.title&&"-"==a.title&&delete i[e],a=this}),i.length>0){t.preventDefault();var o=K(e.edit.iframe).pos(),r=_menu({x:o.x+t.clientX,y:o.y+t.clientY,width:n,css:{visibility:"hidden"},shadowMode:e.shadowMode});_each(i,function(){this.title&&r.addItem(this)});var l=_docElement(r.doc),s=r.div.height();t.clientY+s>=l.clientHeight-100&&r.pos(r.x,_removeUnit(r.y)-s),r.div.css("visibility","visible"),e.menu=r}}})}function _bindNewlineEvent(){function e(e){for(var t=K(e.commonAncestor());t&&(1!=t.type||t.isStyle());)t=t.parent();return t.name}var t=this,n=t.edit.doc,i=t.newlineTag;if(!(_IE&&"br"!==i||_GECKO&&_V<3&&"p"!==i||_OPERA&&_V<9)){var a=_toMap("h1,h2,h3,h4,h5,h6,pre,li"),o=_toMap("p,h1,h2,h3,h4,h5,h6,pre,li,blockquote");K(n).keydown(function(r){if(!(13!=r.which||r.shiftKey||r.ctrlKey||r.altKey)){t.cmd.selection();var l=e(t.cmd.range);if("marquee"!=l&&"select"!=l)return"br"!==i||a[l]?void(o[l]||_nativeCommand(n,"formatblock","

      ")):(r.preventDefault(),void t.insertHtml("
      "+(_IE&&_V<9?"":"​")))}}),K(n).keyup(function(a){if(!(13!=a.which||a.shiftKey||a.ctrlKey||a.altKey)&&"br"!=i){if(_GECKO){var r=t.cmd.commonAncestor("p"),l=t.cmd.commonAncestor("a");return void(l&&""==l.text()&&(l.remove(!0),t.cmd.range.selectNodeContents(r[0]).collapse(!0),t.cmd.select()))}t.cmd.selection();var s=e(t.cmd.range);"marquee"!=s&&"select"!=s&&(o[s]||_nativeCommand(n,"formatblock","

      "))}})}}function _bindTabEvent(){var e=this,t=e.edit.doc;K(t).keydown(function(n){if(9==n.which){if(n.preventDefault(),e.afterTab){var i=e.afterTab.call(e,n);if(i===!0)return}var a=e.cmd,o=a.range;o.shrink(),o.collapsed&&1==o.startContainer.nodeType&&(o.insertNode(K("@ ",t)[0]),a.select()),e.insertHtml("    ")}})}function _bindFocusEvent(){var e=this;K(e.edit.textarea[0],e.edit.win).focus(function(t){e.afterFocus&&e.afterFocus.call(e,t)}).blur(function(t){e.afterBlur&&e.afterBlur.call(e,t)})}function _removeBookmarkTag(e){return _trim(e.replace(/]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/gi,""))}function _removeTempTag(e){return e.replace(/]+class="?__kindeditor_paste__"?[^>]*>[\s\S]*?<\/div>/gi,"")}function _addBookmarkToStack(e,t){if(0===e.length)return void e.push(t);var n=e[e.length-1];_removeBookmarkTag(t.html)!==_removeBookmarkTag(n.html)&&e.push(t)}function _undoToRedo(e,t){var n,i,a=this,o=a.edit,r=o.doc.body;if(0===e.length)return a;o.designMode?(n=a.cmd.range,i=n.createBookmark(!0),i.html=r.innerHTML):i={html:r.innerHTML},_addBookmarkToStack(t,i);var l=e.pop();return _removeBookmarkTag(i.html)===_removeBookmarkTag(l.html)&&e.length>0&&(l=e.pop()), +o.designMode?(o.html(l.html),l.start&&(n.moveToBookmark(l),a.select())):K(r).html(_removeBookmarkTag(l.html)),a}function KEditor(e){function t(e,t){KEditor.prototype[e]===undefined&&(n[e]=t),n.options[e]=t}var n=this;n.options={},_each(e,function(n,i){t(n,e[n])}),_each(K.options,function(e,i){n[e]===undefined&&t(e,i)});var i=K(n.srcElement||"').css("width","100%"),n.tabIndex=isNaN(parseInt(e.tabIndex,10))?n.srcElement.attr("tabindex"):parseInt(e.tabIndex,10),n.iframe.attr("tabindex",n.tabIndex),n.textarea.attr("tabindex",n.tabIndex),n.width&&n.setWidth(n.width),n.height&&n.setHeight(n.height),n.designMode?n.textarea.hide():n.iframe.hide(),l&&n.iframe.bind("load",function(e){n.iframe.unbind("load"),_IE?t():setTimeout(t,0)}),n.div.append(n.iframe),n.div.append(n.textarea),n.srcElement.hide(),!l&&t()},setWidth:function(e){return this.div.css("width",_addUnit(e)),this},setHeight:function(e){var t=this;return e=_addUnit(e),t.div.css("height",e),t.iframe.css("height",e),(_IE&&_V<8||_QUIRKS)&&(e=_addUnit(_removeUnit(e)-2)),t.textarea.css("height",e),t},remove:function(){var e=this,t=e.doc;K(t.body).unbind(),K(t).unbind(),K(e.win).unbind(),e._mousedownHandler&&K(document).unbind("mousedown",e._mousedownHandler),_elementVal(e.srcElement,e.html()),e.srcElement.show(),t.write(""),e.iframe.unbind(),e.textarea.unbind(),KEdit.parent.remove.call(e)},html:function(e,t){var n=this,i=n.doc;if(n.designMode){var a=i.body;return e===undefined?(e=t?""+a.parentNode.innerHTML+"":a.innerHTML,n.beforeGetHtml&&(e=n.beforeGetHtml(e)),_GECKO&&"
      "==e&&(e=""),e):(n.beforeSetHtml&&(e=n.beforeSetHtml(e)),_IE&&_V>=9&&(e=e.replace(/(<.*?checked=")checked(".*>)/gi,"$1$2")),K(a).html(e),n.afterSetHtml&&n.afterSetHtml(),n)}return e===undefined?n.textarea.val():(n.textarea.val(e),n)},design:function(e){var t,n=this;return(e===undefined?!n.designMode:e)?n.designMode||(t=n.html(),n.designMode=!0,n.html(t),n.textarea.hide(),n.iframe.show()):n.designMode&&(t=n.html(),n.designMode=!1,n.html(t),n.iframe.hide(),n.textarea.show()),n.focus()},focus:function(){var e=this;return e.designMode?e.win.focus():e.textarea[0].focus(),e},blur:function(){var e=this;if(_IE){var t=K('',e.div);e.div.append(t),t[0].focus(),t.remove()}else e.designMode?e.win.blur():e.textarea[0].blur();return e},afterChange:function(e){function t(t){setTimeout(function(){e(t)},1)}var n=this,i=n.doc,a=i.body;return K(i).keyup(function(t){t.ctrlKey||t.altKey||!_CHANGE_KEY_MAP[t.which]||e(t)}),K(i).mouseup(e).contextmenu(e),K(n.win).blur(e),K(a).bind("paste",t),K(a).bind("cut",t),n}}),K.EditClass=KEdit,K.edit=_edit,K.iframeDoc=_iframeDoc,_extend(KToolbar,KWidget,{init:function(e){function t(e){var t=K(e);return t.hasClass("ke-outline")?t:t.hasClass("ke-toolbar-icon")?t.parent():void 0}function n(e,n){var i=t(e.target);if(i){if(i.hasClass("ke-disabled"))return;if(i.hasClass("ke-selected"))return;i[n]("ke-on")}}var i=this;KToolbar.parent.init.call(i,e),i.disableMode=_undef(e.disableMode,!1),i.noDisableItemMap=_toMap(_undef(e.noDisableItems,[])),i._itemMap={},i.div.addClass("ke-toolbar").bind("contextmenu,mousedown,mousemove",function(e){e.preventDefault()}).attr("unselectable","on"),i.div.mouseover(function(e){n(e,"addClass")}).mouseout(function(e){n(e,"removeClass")}).click(function(e){var n=t(e.target);if(n){if(n.hasClass("ke-disabled"))return;i.options.click.call(this,e,n.attr("data-name"))}})},get:function(e){return this._itemMap[e]?this._itemMap[e]:this._itemMap[e]=K("span.ke-icon-"+e,this.div).parent()},select:function(e){return _selectToolbar.call(this,e,function(e){e.addClass("ke-selected")}),self},unselect:function(e){return _selectToolbar.call(this,e,function(e){e.removeClass("ke-selected").removeClass("ke-on")}),self},enable:function(e){var t=this,n=e.get?e:t.get(e);return n&&(n.removeClass("ke-disabled"),n.opacity(1)),t},disable:function(e){var t=this,n=e.get?e:t.get(e);return n&&(n.removeClass("ke-selected").addClass("ke-disabled"),n.opacity(.5)),t},disableAll:function(e,t){var n=this,i=n.noDisableItemMap;return t&&(i=_toMap(t)),(e===undefined?!n.disableMode:e)?(K("span.ke-outline",n.div).each(function(){var e=K(this),t=e[0].getAttribute("data-name",2);i[t]||n.disable(e)}),n.disableMode=!0):(K("span.ke-outline",n.div).each(function(){var e=K(this),t=e[0].getAttribute("data-name",2);i[t]||n.enable(e)}),n.disableMode=!1),n}}),K.ToolbarClass=KToolbar,K.toolbar=_toolbar,_extend(KMenu,KWidget,{init:function(e){var t=this;e.z=e.z||811213,KMenu.parent.init.call(t,e),t.centerLineMode=_undef(e.centerLineMode,!0),t.div.addClass("ke-menu").bind("click,mousedown",function(e){e.stopPropagation()}).attr("unselectable","on")},addItem:function(e){var t=this;if("-"===e.title)return void t.div.append(K('

      '));var n=K('
      '),i=K('
      '),a=K('
      '),o=_addUnit(e.height),r=_undef(e.iconClass,"");t.div.append(n),o&&(n.css("height",o),a.css("line-height",o));var l;return t.centerLineMode&&(l=K('
      '),o&&l.css("height",o)),n.mouseover(function(e){K(this).addClass("ke-menu-item-on"),l&&l.addClass("ke-menu-item-center-on")}).mouseout(function(e){K(this).removeClass("ke-menu-item-on"),l&&l.removeClass("ke-menu-item-center-on")}).click(function(t){e.click.call(K(this)),t.stopPropagation()}).append(i),l&&n.append(l),n.append(a),e.checked&&(r="ke-icon-checked"),""!==r&&i.html(''),a.html(e.title),t},remove:function(){var e=this;return e.options.beforeRemove&&e.options.beforeRemove.call(e),K(".ke-menu-item",e.div[0]).unbind(),KMenu.parent.remove.call(e),e}}),K.MenuClass=KMenu,K.menu=_menu,_extend(KColorPicker,KWidget,{init:function(e){var t=this;e.z=e.z||811213,KColorPicker.parent.init.call(t,e);var n=e.colors||[["#E53333","#E56600","#FF9900","#64451D","#DFC5A4","#FFE500"],["#009900","#006600","#99BB00","#B8D100","#60D978","#00D5FF"],["#337FE5","#003399","#4C33E5","#9933E5","#CC33E5","#EE33EE"],["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000"]];t.selectedColor=(e.selectedColor||"").toLowerCase(),t._cells=[],t.div.addClass("ke-colorpicker").bind("click,mousedown",function(e){e.stopPropagation()}).attr("unselectable","on");var i=t.doc.createElement("table");t.div.append(i),i.className="ke-colorpicker-table",i.cellPadding=0,i.cellSpacing=0,i.border=0;var a=i.insertRow(0),o=a.insertCell(0);o.colSpan=n[0].length,t._addAttr(o,"","ke-colorpicker-cell-top");for(var r=0;r').css("background-color",t)):e.html(i.options.noColor),K(e).attr("unselectable","on"),i._cells.push(e)},remove:function(){var e=this;return _each(e._cells,function(){this.unbind()}),KColorPicker.parent.remove.call(e),e}}),K.ColorPickerClass=KColorPicker,K.colorpicker=_colorpicker,_extend(KUploadButton,{init:function(e){var t=this,n=K(e.button),i=e.fieldName||"file",a=e.url||"",o=n.val(),r=e.extraParams||{},l=n[0].className||"",s=e.target||"kindeditor_upload_iframe_"+(new Date).getTime();e.afterError=e.afterError||function(e){alert(e)};var d=[];for(var c in r)d.push('');var u=['
      ',e.target?"":'',e.form?'
      ':'
      ','',d.join(""),'',"",'',e.form?"
      ":"","
      "].join(""),p=K(u,n.doc);n.hide(),n.before(p),t.div=p,t.button=n,t.iframe=e.target?K('iframe[name="'+s+'"]'):K("iframe",p),t.form=e.form?K(e.form):K("form",p),t.fileBox=K(".ke-upload-file",p),t.options=e},submit:function(){var e=this,t=e.iframe;return t.bind("load",function(){t.unbind();var n=document.createElement("form");e.fileBox.before(n),K(n).append(e.fileBox),n.reset(),K(n).remove(!0);var i,a=K.iframeDoc(t),o=a.getElementsByTagName("pre")[0],r="";r=o?o.innerHTML:a.body.innerHTML,r=_unescape(r),t[0].src="javascript:false";try{i=K.json(r)}catch(l){e.options.afterError.call(e,""+a.body.parentNode.innerHTML+"")}i&&e.options.afterUpload.call(e,i)}),e.form[0].submit(),e},remove:function(){var e=this;return e.fileBox&&e.fileBox.unbind(),e.iframe.remove(),e.div.remove(),e.button.show(),e}}),K.UploadButtonClass=KUploadButton,K.uploadbutton=_uploadbutton,_extend(KDialog,KWidget,{init:function(e){var t=this,n=_undef(e.shadowMode,!0);e.z=e.z||811213,e.shadowMode=!1,e.autoScroll=_undef(e.autoScroll,!0),KDialog.parent.init.call(t,e);var i=e.title,a=K(e.body,t.doc),o=e.previewBtn,r=e.yesBtn,l=e.noBtn,s=e.closeBtn,d=_undef(e.showMask,!0);t.div.addClass("ke-dialog").bind("click,mousedown",function(e){e.stopPropagation()});var c=K('
      ').appendTo(t.div);_IE&&_V<7?t.iframeMask=K('').appendTo(t.div):n&&K('
      ').appendTo(t.div);var u=K('
      ');c.append(u),u.html(i),t.closeIcon=K('').click(s.click),u.append(t.closeIcon),t.draggable({clickEl:u,beforeDrag:e.beforeDrag});var p=K('
      ');c.append(p),p.append(a);var h=K('');if((o||r||l)&&c.append(h),_each([{btn:o,name:"preview"},{btn:r,name:"yes"},{btn:l,name:"no"}],function(){if(this.btn){var e=_createButton(this.btn);e.addClass("ke-dialog-"+this.name),h.append(e)}}),t.height&&p.height(_removeUnit(t.height)-u.height()-h.height()),t.div.width(t.div.width()),t.div.height(t.div.height()),t.mask=null,d){var f=_docElement(t.doc),m=Math.max(f.scrollWidth,f.clientWidth),g=Math.max(f.scrollHeight,f.clientHeight);t.mask=_widget({x:0,y:0,z:t.z-1,cls:"ke-dialog-mask",width:m,height:g})}t.autoPos(t.div.width(),t.div.height()),t.footerDiv=h,t.bodyDiv=p,t.headerDiv=u,t.isLoading=!1},setMaskIndex:function(e){var t=this;t.mask.div.css("z-index",e)},showLoading:function(e){e=_undef(e,"");var t=this,n=t.bodyDiv;return t.loading=K('
      '+e+"
      ").width(n.width()).height(n.height()).css("top",t.headerDiv.height()+"px"),n.css("visibility","hidden").after(t.loading),t.isLoading=!0,t},hideLoading:function(){return this.loading&&this.loading.remove(),this.bodyDiv.css("visibility","visible"),this.isLoading=!1,this},remove:function(){var e=this;return e.options.beforeRemove&&e.options.beforeRemove.call(e),e.mask&&e.mask.remove(),e.iframeMask&&e.iframeMask.remove(),e.closeIcon.unbind(),K("input",e.div).unbind(),K("button",e.div).unbind(),e.footerDiv.unbind(),e.bodyDiv.unbind(),e.headerDiv.unbind(),K("iframe",e.div).each(function(){K(this).remove()}),KDialog.parent.remove.call(e),e}}),K.DialogClass=KDialog,K.dialog=_dialog,K.tabs=_tabs,K.loadScript=_loadScript,K.loadStyle=_loadStyle,K.ajax=_ajax;var _plugins={},_language={};KEditor.prototype={lang:function(e){return _lang(e,this.langType)},loadPlugin:function(e,t){var n=this;return _plugins[e]?_isFunction(_plugins[e])?(_plugins[e].call(n,KindEditor),t&&t.call(n),n):(setTimeout(function(){n.loadPlugin(e,t)},100),n):(_plugins[e]="loading",_loadScript(n.pluginsPath+e+"/"+e+".js?ver="+encodeURIComponent(K.DEBUG?_TIME:_VERSION),function(){setTimeout(function(){_plugins[e]&&n.loadPlugin(e,t)},0)}),n)},handler:function(e,t){var n=this;return n._handlers[e]||(n._handlers[e]=[]),_isFunction(t)?(n._handlers[e].push(t),n):(_each(n._handlers[e],function(){t=this.call(n,t)}),t)},clickToolbar:function(e,t){var n=this,i="clickToolbar"+e;return t===undefined?n._handlers[i]?n.handler(i):(n.loadPlugin(e,function(){n.handler(i)}),n):n.handler(i,t)},updateState:function(){var e=this;return _each("justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,subscript,superscript,bold,italic,underline,strikethrough".split(","),function(t,n){e.cmd.state(n)?e.toolbar.select(n):e.toolbar.unselect(n)}),e},addContextmenu:function(e){return this._contextmenus.push(e),this},afterCreate:function(e){return this.handler("afterCreate",e)},beforeRemove:function(e){return this.handler("beforeRemove",e)},beforeGetHtml:function(e){return this.handler("beforeGetHtml",e)},beforeSetHtml:function(e){return this.handler("beforeSetHtml",e)},afterSetHtml:function(e){return this.handler("afterSetHtml",e)},create:function(){function e(){return 0===s.height()?void setTimeout(e,100):void t.resize(i,a,!1)}var t=this,n=t.fullscreenMode;if(t.isCreated)return t;if(t.srcElement.data("kindeditor"))return t;t.srcElement.data("kindeditor","true"),n?_docElement().style.overflow="hidden":_docElement().style.overflow="";var i=n?_docElement().clientWidth+"px":t.width,a=n?_docElement().clientHeight+"px":t.height;(_IE&&_V<8||_QUIRKS)&&(a=_addUnit(_removeUnit(a)+2));var o=t.container=K(t.layout);n?K(document.body).append(o):t.srcElement.before(o);var r=K(".toolbar",o),l=K(".edit",o),s=t.statusbar=K(".statusbar",o);o.removeClass("container").addClass("ke-container ke-container-"+t.themeType).css("width",i),n?(o.css({position:"absolute",left:0,top:0,"z-index":811211}),_GECKO||(t._scrollPos=_getScrollPos()),window.scrollTo(0,0),K(document.body).css({height:"1px",overflow:"hidden"}),K(document.body.parentNode).css("overflow","hidden"),t._fullscreenExecuted=!0):(t._fullscreenExecuted&&(K(document.body).css({height:"",overflow:""}),K(document.body.parentNode).css("overflow","")),t._scrollPos&&window.scrollTo(t._scrollPos.x,t._scrollPos.y));var d=[];K.each(t.items,function(e,n){"|"==n?d.push(''):"/"==n?d.push('
      '):(d.push(''),d.push(''))});var c=t.toolbar=_toolbar({src:r,html:d.join(""),noDisableItems:t.noDisableItems,click:function(e,n){if(e.stop(),t.menu){var i=t.menu.name;if(t.hideMenu(),i===n)return}t.clickToolbar(n)}}),u=_removeUnit(a)-c.div.height(),p=t.edit=_edit({height:u>0&&_removeUnit(a)>t.minHeight?u:t.minHeight,src:l,srcElement:t.srcElement,designMode:t.designMode,themesPath:t.themesPath,bodyClass:t.bodyClass,cssPath:t.cssPath,cssData:t.cssData,beforeGetHtml:function(e){return e=t.beforeGetHtml(e),e=_removeBookmarkTag(_removeTempTag(e)),_formatHtml(e,t.filterMode?t.htmlTags:null,t.urlType,t.wellFormatMode,t.indentChar,t.simpleWrap)},beforeSetHtml:function(e){return e=_formatHtml(e,t.filterMode?t.htmlTags:null,"",!1),t.beforeSetHtml(e)},afterSetHtml:function(){t.edit=p=this,t.afterSetHtml()},afterCreate:function(){if(t.edit=p=this,t.cmd=p.cmd,t._docMousedownFn=function(e){t.menu&&t.hideMenu()},K(p.doc,document).mousedown(t._docMousedownFn),_bindContextmenuEvent.call(t),_bindNewlineEvent.call(t),_bindTabEvent.call(t),_bindFocusEvent.call(t),p.afterChange(function(e){p.designMode&&(t.updateState(),t.addBookmark(),t.options.afterChange&&t.options.afterChange.call(t))}),p.textarea.keyup(function(e){e.ctrlKey||e.altKey||!_INPUT_KEY_MAP[e.which]||t.options.afterChange&&t.options.afterChange.call(t)}),t.readonlyMode&&t.readonly(),t.isCreated=!0,""===t.initContent&&(t.initContent=t.html()),t._undoStack.length>0){var e=t._undoStack.pop();e.start&&(t.html(e.html),p.cmd.range.moveToBookmark(e),t.select())}t.afterCreate(),t.options.afterCreate&&t.options.afterCreate.call(t),t.container.removeClass("ke-loading")}});return s.removeClass("statusbar").addClass("ke-statusbar").append(''),t._fullscreenResizeHandler&&(K(window).unbind("resize",t._fullscreenResizeHandler),t._fullscreenResizeHandler=null),e(),n?(t._fullscreenResizeHandler=function(e){t.isCreated&&t.resize(_docElement().clientWidth,_docElement().clientHeight,!1)},K(window).bind("resize",t._fullscreenResizeHandler),c.select("fullscreen")):(_GECKO&&K(window).bind("scroll",function(e){t._scrollPos=_getScrollPos()}),t.resizeType>0&&_drag({moveEl:o,clickEl:s,moveFn:function(e,n,i,a,o,r){a+=r,t.resize(null,a)}}),2===t.resizeType&&_drag({moveEl:o,clickEl:s.last(),moveFn:function(e,n,i,a,o,r){i+=o,a+=r,t.resize(i,a)}})),t},remove:function(){var e=this;return e.isCreated?(e.beforeRemove(),e.srcElement.data("kindeditor",""),e.menu&&e.hideMenu(),_each(e.dialogs,function(){e.hideDialog()}),K(document).unbind("mousedown",e._docMousedownFn),e.toolbar.remove(),e.edit.remove(),e.statusbar.last().unbind(),e.statusbar.unbind(),e.container.remove(),e.container=e.toolbar=e.edit=e.menu=null,e.dialogs=[],e.isCreated=!1,e):e},resize:function(e,t,n){var i=this;return n=_undef(n,!0),e&&(/%/.test(e)||(e=_removeUnit(e),e=e/gi,"").replace(/ /gi," ")):t.html(_escape(e))},isEmpty:function(){return""===_trim(this.text().replace(/\r\n|\n|\r/,""))},isDirty:function(){return _trim(this.initContent.replace(/\r\n|\n|\r|t/g,""))!==_trim(this.html().replace(/\r\n|\n|\r|t/g,""))},selectedHtml:function(){var e=this.isCreated?this.cmd.range.html():"";return e=_removeBookmarkTag(_removeTempTag(e))},count:function(e){var t=this;return e=(e||"html").toLowerCase(),"html"===e?t.html().length:"text"===e?t.text().replace(/<(?:img|embed).*?>/gi,"K").replace(/\r\n|\n|\r/g,"").length:0},exec:function(e){e=e.toLowerCase();var t=this,n=t.cmd,i=_inArray(e,"selectall,copy,paste,print".split(","))<0;return i&&t.addBookmark(!1),n[e].apply(n,_toArray(arguments,1)),i&&(t.updateState(),t.addBookmark(!1),t.options.afterChange&&t.options.afterChange.call(t)),t},insertHtml:function(e,t){return this.isCreated?(e=this.beforeSetHtml(e),this.exec("inserthtml",e,t),this):this},appendHtml:function(e){if(this.html(this.html()+e),this.isCreated){var t=this.cmd;t.range.selectNodeContents(t.doc.body).collapse(!1),t.select()}return this},sync:function(){return _elementVal(this.srcElement,this.html()),this},focus:function(){return this.isCreated?this.edit.focus():this.srcElement[0].focus(),this},blur:function(){return this.isCreated?this.edit.blur():this.srcElement[0].blur(),this},addBookmark:function(e){e=_undef(e,!0);var t,n=this,i=n.edit,a=i.doc.body,o=_removeTempTag(a.innerHTML);if(e&&n._undoStack.length>0){var r=n._undoStack[n._undoStack.length-1];if(Math.abs(o.length-_removeBookmarkTag(r.html).length)0){var n=t.dialogs[0],i=t.dialogs[t.dialogs.length-1];n.setMaskIndex(i.z+2),e.z=i.z+3,e.showMask=!1}var a=_dialog(e);return t.dialogs.push(a),a},hideDialog:function(){var e=this;if(e.dialogs.length>0&&e.dialogs.pop().remove(),e.dialogs.length>0){var t=e.dialogs[0],n=e.dialogs[e.dialogs.length-1];t.setMaskIndex(n.z-1)}return e},errorDialog:function(e){var t=this,n=t.createDialog({width:750,title:t.lang("uploadError"),body:'
      '}),i=K("iframe",n.div),a=K.iframeDoc(i);return a.open(),a.write(e),a.close(),K(a.body).css("background-color","#FFF"),i[0].contentWindow.focus(),t}},_instances=[],K.remove=function(e){_eachEditor(e,function(e){this.remove(),_instances.splice(e,1)})},K.sync=function(e){_eachEditor(e,function(){this.sync()})},K.html=function(e,t){_eachEditor(e,function(){this.html(t)})},K.insertHtml=function(e,t){_eachEditor(e,function(){this.insertHtml(t)})},K.appendHtml=function(e,t){_eachEditor(e,function(){this.appendHtml(t)})},_IE&&_V<7&&_nativeCommand(document,"BackgroundImageCache",!0),K.EditorClass=KEditor,K.editor=_editor,K.create=_create,K.instances=_instances,K.plugin=_plugin,K.lang=_lang,_plugin("core",function(e){var t=this,n={undo:"Z",redo:"Y",bold:"B",italic:"I",underline:"U",print:"P",selectall:"A"};if(t.afterSetHtml(function(){t.options.afterChange&&t.options.afterChange.call(t)}),t.afterCreate(function(){if("form"==t.syncType){for(var n=e(t.srcElement),i=!1;n=n.parent();)if("form"==n.name){i=!0;break}if(i){n.bind("submit",function(n){t.sync(),e(window).bind("unload",function(){t.edit.textarea.remove()})});var a=e('[type="reset"]',n);a.click(function(){t.html(t.initContent),t.cmd.selection()}),t.beforeRemove(function(){n.unbind(),a.unbind()})}}}),t.clickToolbar("source",function(){t.edit.designMode?(t.toolbar.disableAll(!0),t.edit.design(!1),t.toolbar.select("source")):(t.toolbar.disableAll(!1),t.edit.design(!0),t.toolbar.unselect("source"),_GECKO?setTimeout(function(){t.cmd.selection()},0):t.cmd.selection()),t.designMode=t.edit.designMode}),t.afterCreate(function(){t.designMode||t.toolbar.disableAll(!0).select("source")}),t.clickToolbar("fullscreen",function(){t.fullscreen()}),t.fullscreenShortcut){var i=!1;t.afterCreate(function(){if(e(t.edit.doc,t.edit.textarea).keyup(function(e){27==e.which&&setTimeout(function(){t.fullscreen()},0)}),i){if(_IE&&!t.designMode)return;t.focus()}i||(i=!0)})}_each("undo,redo".split(","),function(e,i){n[i]&&t.afterCreate(function(){_ctrl(this.edit.doc,n[i],function(){t.clickToolbar(i)})}),t.clickToolbar(i,function(){t[i]()})}),t.clickToolbar("formatblock",function(){var e=t.lang("formatblock.formatBlock"),n={h1:28,h2:24,h3:18,H4:14,p:12},i=t.cmd.val("formatblock"),a=t.createMenu({name:"formatblock",width:"en"==t.langType?200:150});_each(e,function(e,o){var r="font-size:"+n[e]+"px;";"h"===e.charAt(0)&&(r+="font-weight:bold;"),a.addItem({title:''+o+"",height:n[e]+12,checked:i===e||i===o,click:function(){t.select().exec("formatblock","<"+e+">").hideMenu()}})})}),t.clickToolbar("fontname",function(){var e=t.cmd.val("fontname"),n=t.createMenu({name:"fontname",width:150});_each(t.lang("fontname.fontName"),function(i,a){n.addItem({title:''+a+"",checked:e===i.toLowerCase()||e===a.toLowerCase(),click:function(){t.exec("fontname",i).hideMenu()}})})}),t.clickToolbar("fontsize",function(){var e=t.cmd.val("fontsize"),n=t.createMenu({name:"fontsize",width:150});_each(t.fontSizeTable,function(i,a){n.addItem({title:''+a+"",height:_removeUnit(a)+12,checked:e===a,click:function(){t.exec("fontsize",a).hideMenu()}})})}),_each("forecolor,hilitecolor".split(","),function(e,n){t.clickToolbar(n,function(){t.createMenu({name:n,selectedColor:t.cmd.val(n)||"default",colors:t.colorTable,click:function(e){t.exec(n,e).hideMenu()}})})}),_each("cut,copy,paste".split(","),function(e,n){t.clickToolbar(n,function(){t.focus();try{t.exec(n,null)}catch(e){alert(t.lang(n+"Error"))}})}),t.clickToolbar("about",function(){var e='
      KindEditor '+_VERSION+'
      Copyright © kindsoft.net All rights reserved.
      ';t.createDialog({name:"about",width:350,title:t.lang("about"),body:e})}),t.plugin.getSelectedLink=function(){return t.cmd.commonAncestor("a")},t.plugin.getSelectedImage=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return!/^ke-\w+$/i.test(e[0].className)})},t.plugin.getSelectedFlash=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return"ke-flash"==e[0].className})},t.plugin.getSelectedMedia=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return"ke-media"==e[0].className||"ke-rm"==e[0].className})},t.plugin.getSelectedAnchor=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return"ke-anchor"==e[0].className})},_each("link,image,flash,media,anchor".split(","),function(e,n){var i=n.charAt(0).toUpperCase()+n.substr(1);_each("edit,delete".split(","),function(e,a){t.addContextmenu({title:t.lang(a+i),click:function(){t.loadPlugin(n,function(){t.plugin[n][a](),t.hideMenu()})},cond:t.plugin["getSelected"+i],width:150,iconClass:"edit"==a?"ke-icon-"+n:undefined})}),t.addContextmenu({title:"-"})}),t.addContextmenu({title:"-"}),_each("selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript,hr,print,bold,italic,underline,strikethrough,removeformat,unlink".split(","),function(e,i){n[i]&&t.afterCreate(function(){_ctrl(this.edit.doc,n[i],function(){t.cmd.selection(),t.clickToolbar(i)})}), +t.clickToolbar(i,function(){t.focus().exec(i,null)})}),t.afterCreate(function(){function n(){i.range.moveToBookmark(a),i.select(),_WEBKIT&&(e("div."+l,o).each(function(){e(this).after("
      ").remove(!0)}),e("span.Apple-style-span",o).remove(!0),e("span.Apple-tab-span",o).remove(!0),e("span[style]",o).each(function(){"nowrap"==e(this).css("white-space")&&e(this).remove(!0)}),e("meta",o).remove());var n=o[0].innerHTML;o.remove(),""!==n&&(_WEBKIT&&(n=n.replace(/(
      )\1/gi,"$1")),2===t.pasteType&&(n=n.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/gi,""),/schemas-microsoft-com|worddocument|mso-\w+/i.test(n)?n=_clearMsWord(n,t.filterMode?t.htmlTags:e.options.htmlTags):(n=_formatHtml(n,t.filterMode?t.htmlTags:null),n=t.beforeSetHtml(n))),1===t.pasteType&&(n=n.replace(/ /gi," "),n=n.replace(/\n\s*\n/g,"\n"),n=n.replace(/]*>/gi,"\n"),n=n.replace(/<\/p>]*>/gi,"\n"),n=n.replace(/<[^>]+>/g,""),n=n.replace(/ {2}/g,"  "),"p"==t.newlineTag?/\n/.test(n)&&(n=n.replace(/^/,"

      ").replace(/$/,"

      ").replace(/\n/g,"

      ")):n=n.replace(/\n/g,"
      $&")),t.insertHtml(n,!0))}var i,a,o,r=t.edit.doc,l="__kindeditor_paste__",s=!1;e(r.body).bind("paste",function(d){if(0===t.pasteType)return void d.stop();if(!s){if(s=!0,e("div."+l,r).remove(),i=t.cmd.selection(),a=i.range.createBookmark(),o=e('

      ',r).css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",left:"-1981px",top:e(a.start).pos().y+"px","white-space":"nowrap"}),e(r.body).append(o),_IE){var c=i.range.get(!0);c.moveToElementText(o[0]),c.select(),c.execCommand("paste"),d.preventDefault()}else i.range.selectNodeContents(o[0]),i.select(),o[0].tabIndex=-1,o[0].focus();setTimeout(function(){n(),s=!1},0)}})}),t.beforeGetHtml(function(e){return _IE&&_V<=8&&(e=e.replace(/]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(e,t){return unescape(t)}),e=e.replace(/(]*)?>)/gi,function(e,t,n){return/\s+type="[^"]+"/i.test(e)?e:t+' type="text"'+n})),e.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/gi,function(e,t,n,i){return t+_unescape(n).replace(/\s+/g," ")+i}).replace(/]*class="?ke-(flash|rm|media)"?[^>]*>/gi,function(e){var t=_getAttrList(e),n=_getCssList(t.style||""),i=_mediaAttrs(t["data-ke-tag"]),a=_undef(n.width,""),o=_undef(n.height,"");return/px/i.test(a)&&(a=_removeUnit(a)),/px/i.test(o)&&(o=_removeUnit(o)),i.width=_undef(t.width,a),i.height=_undef(t.height,o),_mediaEmbed(i)}).replace(/]*class="?ke-anchor"?[^>]*>/gi,function(e){var t=_getAttrList(e);return''}).replace(/]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(e,t,n){return""+unescape(n)+""}).replace(/]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(e,t,n){return""+unescape(n)+""}).replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/gi,function(e,t,n,i){return e=e.replace(/(\s+(?:href|src)=")[^"]*(")/i,function(e,t,i){return t+_unescape(n)+i}),e=e.replace(/\s+data-ke-src="[^"]*"/i,"")}).replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/gi,function(e,t,n){return t+n})}),t.beforeSetHtml(function(e){return _IE&&_V<=8&&(e=e.replace(/]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/gi,function(e){var t=_getAttrList(e),n=_getCssList(t.style||"");return"none"==n.display?'
      ':e})),e.replace(/]*type="([^"]+)"[^>]*>(?:<\/embed>)?/gi,function(e){var n=_getAttrList(e);return n.src=_undef(n.src,""),n.width=_undef(n.width,0),n.height=_undef(n.height,0),_mediaImg(t.themesPath+"common/blank.gif",n)}).replace(/]*name="([^"]+)"[^>]*>(?:<\/a>)?/gi,function(e){var n=_getAttrList(e);return n.href!==undefined?e:''}).replace(/]*)>([\s\S]*?)<\/script>/gi,function(e,t,n){return'
      '+escape(n)+"
      "}).replace(/]*)>([\s\S]*?)<\/noscript>/gi,function(e,t,n){return'
      '+escape(n)+"
      "}).replace(/(<[^>]*)(href|src)="([^"]*)"([^>]*>)/gi,function(e,t,n,i,a){return e.match(/\sdata-ke-src="[^"]*"/i)?e:e=t+n+'="'+i+'" data-ke-src="'+_escape(i)+'"'+a}).replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/gi,function(e,t,n){return t+"data-ke-"+n}).replace(/]*\s+border="0"[^>]*>/gi,function(e){return e.indexOf("ke-zeroborder")>=0?e:_addClassToTag(e,"ke-zeroborder")})})})}}(window),KindEditor.lang({source:"HTML代码",preview:"预览",undo:"后退(Ctrl+Z)",redo:"前进(Ctrl+Y)",cut:"剪切(Ctrl+X)",copy:"复制(Ctrl+C)",paste:"粘贴(Ctrl+V)",plainpaste:"粘贴为无格式文本",wordpaste:"从Word粘贴",selectall:"全选(Ctrl+A)",justifyleft:"左对齐",justifycenter:"居中",justifyright:"右对齐",justifyfull:"两端对齐",insertorderedlist:"编号",insertunorderedlist:"项目符号",indent:"增加缩进",outdent:"减少缩进",subscript:"下标",superscript:"上标",formatblock:"段落",fontname:"字体",fontsize:"文字大小",forecolor:"文字颜色",hilitecolor:"文字背景",bold:"粗体(Ctrl+B)",italic:"斜体(Ctrl+I)",underline:"下划线(Ctrl+U)",strikethrough:"删除线",removeformat:"删除格式",image:"图片",multiimage:"批量图片上传",flash:"Flash",media:"视音频",table:"表格",tablecell:"单元格",hr:"插入横线",emoticons:"插入表情",link:"超级链接",unlink:"取消超级链接",fullscreen:"全屏显示",about:"关于",print:"打印(Ctrl+P)",filemanager:"文件空间",code:"插入程序代码",map:"Google地图",baidumap:"百度地图",lineheight:"行距",clearhtml:"清理HTML代码",pagebreak:"插入分页符",quickformat:"一键排版",insertfile:"插入文件",template:"插入模板",anchor:"锚点",yes:"确定",no:"取消",close:"关闭",editImage:"图片属性",deleteImage:"删除图片",editFlash:"Flash属性",deleteFlash:"删除Flash",editMedia:"视音频属性",deleteMedia:"删除视音频",editLink:"超级链接属性",deleteLink:"取消超级链接",editAnchor:"锚点属性",deleteAnchor:"删除锚点",tableprop:"表格属性",tablecellprop:"单元格属性",tableinsert:"插入表格",tabledelete:"删除表格",tablecolinsertleft:"左侧插入列",tablecolinsertright:"右侧插入列",tablerowinsertabove:"上方插入行",tablerowinsertbelow:"下方插入行",tablerowmerge:"向下合并单元格",tablecolmerge:"向右合并单元格",tablerowsplit:"拆分行",tablecolsplit:"拆分列",tablecoldelete:"删除列",tablerowdelete:"删除行",noColor:"无颜色",pleaseSelectFile:"请选择文件。",invalidImg:"请输入有效的URL地址。\n只允许jpg,gif,bmp,png格式。",invalidMedia:"请输入有效的URL地址。\n只允许swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb格式。",invalidWidth:"宽度必须为数字。",invalidHeight:"高度必须为数字。",invalidBorder:"边框必须为数字。",invalidUrl:"请输入有效的URL地址。",invalidRows:"行数为必选项,只允许输入大于0的数字。",invalidCols:"列数为必选项,只允许输入大于0的数字。",invalidPadding:"边距必须为数字。",invalidSpacing:"间距必须为数字。",invalidJson:"服务器发生故障。",uploadSuccess:"上传成功。",cutError:"您的浏览器安全设置不允许使用剪切操作,请使用快捷键(Ctrl+X)来完成。",copyError:"您的浏览器安全设置不允许使用复制操作,请使用快捷键(Ctrl+C)来完成。",pasteError:"您的浏览器安全设置不允许使用粘贴操作,请使用快捷键(Ctrl+V)来完成。",ajaxLoading:"加载中,请稍候 ...",uploadLoading:"上传中,请稍候 ...",uploadError:"上传错误","plainpaste.comment":"请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。","wordpaste.comment":"请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。","code.pleaseInput":"请输入程序代码。","link.url":"URL","link.linkType":"打开类型","link.newWindow":"新窗口","link.selfWindow":"当前窗口","flash.url":"URL","flash.width":"宽度","flash.height":"高度","flash.upload":"上传","flash.viewServer":"文件空间","media.url":"URL","media.width":"宽度","media.height":"高度","media.autostart":"自动播放","media.upload":"上传","media.viewServer":"文件空间","image.remoteImage":"网络图片","image.localImage":"本地上传","image.remoteUrl":"图片地址","image.localUrl":"上传文件","image.size":"图片大小","image.width":"宽","image.height":"高","image.resetSize":"重置大小","image.align":"对齐方式","image.defaultAlign":"默认方式","image.leftAlign":"左对齐","image.rightAlign":"右对齐","image.imgTitle":"图片说明","image.upload":"浏览...","image.viewServer":"图片空间","multiimage.uploadDesc":"允许用户同时上传<%=uploadLimit%>张图片,单张图片容量不超过<%=sizeLimit%>","multiimage.startUpload":"开始上传","multiimage.clearAll":"全部清空","multiimage.insertAll":"全部插入","multiimage.queueLimitExceeded":"文件数量超过限制。","multiimage.fileExceedsSizeLimit":"文件大小超过限制。","multiimage.zeroByteFile":"无法上传空文件。","multiimage.invalidFiletype":"文件类型不正确。","multiimage.unknownError":"发生异常,无法上传。","multiimage.pending":"等待上传","multiimage.uploadError":"上传失败","filemanager.emptyFolder":"空文件夹","filemanager.moveup":"移到上一级文件夹","filemanager.viewType":"显示方式:","filemanager.viewImage":"缩略图","filemanager.listImage":"详细信息","filemanager.orderType":"排序方式:","filemanager.fileName":"名称","filemanager.fileSize":"大小","filemanager.fileType":"类型","insertfile.url":"URL","insertfile.title":"文件说明","insertfile.upload":"上传","insertfile.viewServer":"文件空间","table.cells":"单元格数","table.rows":"行数","table.cols":"列数","table.size":"大小","table.width":"宽度","table.height":"高度","table.percent":"%","table.px":"px","table.space":"边距间距","table.padding":"边距","table.spacing":"间距","table.align":"对齐方式","table.textAlign":"水平对齐","table.verticalAlign":"垂直对齐","table.alignDefault":"默认","table.alignLeft":"左对齐","table.alignCenter":"居中","table.alignRight":"右对齐","table.alignTop":"顶部","table.alignMiddle":"中部","table.alignBottom":"底部","table.alignBaseline":"基线","table.border":"边框","table.borderWidth":"边框","table.borderColor":"颜色","table.backgroundColor":"背景颜色","map.address":"地址: ","map.search":"搜索","baidumap.address":"地址: ","baidumap.search":"搜索","baidumap.insertDynamicMap":"插入动态地图","anchor.name":"锚点名称","formatblock.formatBlock":{h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",p:"正 文"},"fontname.fontName":{SimSun:"宋体",NSimSun:"新宋体",FangSong_GB2312:"仿宋_GB2312",KaiTi_GB2312:"楷体_GB2312",SimHei:"黑体","Source Han Sans":"思源黑体","Source Han Serif":"思源宋体","Microsoft YaHei":"微软雅黑",Arial:"Arial","Arial Black":"Arial Black","Times New Roman":"Times New Roman","Courier New":"Courier New",Tahoma:"Tahoma",Verdana:"Verdana"},"lineheight.lineHeight":[{1:"单倍行距"},{1.5:"1.5倍行距"},{2:"2倍行距"},{2.5:"2.5倍行距"},{3:"3倍行距"}],"template.selectTemplate":"可选模板","template.replaceContent":"替换当前内容","template.fileList":{"1.html":"图片和文字","2.html":"表格","3.html":"项目编号"}},"zh_CN"),KindEditor.plugin("anchor",function(e){var t=this,n="anchor",i=t.lang(n+".");t.plugin.anchor={edit:function(){var a=['
      ','
      ','",'',"
      ","
      "].join(""),o=t.createDialog({name:n,width:300,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(e){t.insertHtml('').hideDialog().focus()}}}),r=o.div,l=e('input[name="name"]',r),s=t.plugin.getSelectedAnchor();s&&l.val(unescape(s.attr("data-ke-name"))),l[0].focus(),l[0].select()},"delete":function(){t.plugin.getSelectedAnchor().remove()}},t.clickToolbar(n,t.plugin.anchor.edit)}),KindEditor.plugin("autoheight",function(e){function t(){i.iframe.height(o),n.resize(null,Math.max((e.IE?a.scrollHeight:a.offsetHeight)+76,o))}var n=this;if(n.autoHeightMode){var i=n.edit,a=i.doc.body,o=e.removeUnit(n.height);i.iframe[0].scroll="no",a.style.overflowY="hidden",i.afterChange(t),n.isCreated?t():n.afterCreate(t)}}),KindEditor.plugin("baidumap",function(e){var t=this,n="baidumap",i=t.lang(n+"."),a=e.undef(t.mapWidth,558),o=e.undef(t.mapHeight,360);t.clickToolbar(n,function(){function r(){l=m[0].contentWindow,s=e.iframeDoc(m)}var l,s,d=['
      ','
      ','
      ',i.address+' ','','',"","
      ",'
      ',' ","
      ",'
      ',"
      ",'
      ',"
      "].join(""),c=t.createDialog({name:n,width:a+42,title:t.lang(n),body:d,yesBtn:{name:t.lang("yes"),click:function(e){var n=l.map,i=n.getCenter(),r=i.lng+","+i.lat,s=n.getZoom(),d=[f[0].checked?t.pluginsPath+"baidumap/index.html":"http://api.map.baidu.com/staticimage","?center="+encodeURIComponent(r),"&zoom="+encodeURIComponent(s),"&width="+a,"&height="+o,"&markers="+encodeURIComponent(r),"&markerStyles="+encodeURIComponent("l,A")].join("");f[0].checked?t.insertHtml(''):t.exec("insertimage",d),t.hideDialog().focus()}},beforeRemove:function(){h.remove(),s&&s.write(""),m.remove()}}),u=c.div,p=e('[name="address"]',u),h=e('[name="searchBtn"]',u),f=e('[name="insertDynamicMap"]',c.div),m=e('');m.bind("load",function(){m.unbind("load"),e.IE?r():setTimeout(r,0)}),e(".ke-map",u).replaceWith(m),h.click(function(){l.search(p.val())})})}),KindEditor.plugin("clearhtml",function(e){var t=this,n="clearhtml";t.clickToolbar(n,function(){t.focus();var n=t.html();n=n.replace(/(]*>)([\s\S]*?)(<\/script>)/gi,""),n=n.replace(/(]*>)([\s\S]*?)(<\/style>)/gi,""),n=e.formatHtml(n,{a:["href","target"],embed:["src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess"],img:["src","width","height","border","alt","title",".width",".height"],table:["border"],"td,th":["rowspan","colspan"],"div,hr,br,tbody,tr,p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":[]}),t.html(n),t.cmd.selection(!0),t.addBookmark()})}),KindEditor.plugin("code",function(e){var t=this,n="code";t.clickToolbar(n,function(){var i=t.lang(n+"."),a=['
      ','
      ','","
      ",'',"
      "].join(""),o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var a=e(".ke-code-type",o.div).val(),l=r.val(),s=""===a?"":" lang-"+a,d='
      \n'+e.escape(l)+"
      ";return""===e.trim(l)?(alert(i.pleaseInput),void r[0].focus()):void t.insertHtml(d).hideDialog().focus()}}}),r=e("textarea",o.div);r[0].focus()})}),KindEditor.plugin("emoticons",function(e){var t=this,n="emoticons",i=t.emoticonsPath||t.pluginsPath+"emoticons/images/",a=void 0===t.allowPreviewEmoticons||t.allowPreviewEmoticons,o=1;t.clickToolbar(n,function(){function r(n,a,o){k?n.mouseover(function(){a>v?(k.css("left",0),k.css("right","")):(k.css("left",""),k.css("right",0)),w.attr("src",i+o+".gif"),e(this).addClass("ke-on")}):n.mouseover(function(){e(this).addClass("ke-on")}),n.mouseout(function(){e(this).removeClass("ke-on")}),n.click(function(e){t.insertHtml('').hideMenu().focus(),e.stop()})}function l(t,n){var a=document.createElement("table");n.append(a),k&&(e(a).mouseover(function(){k.show("block")}),e(a).mouseout(function(){k.hide()}),b.push(e(a))),a.className="ke-table",a.cellPadding=0,a.cellSpacing=0,a.border=0;for(var o=(t-1)*m+f,l=0;l
      ').css("background-position","-"+24*o+"px 0px").css("background-image","url("+i+"static.gif)");c.append(h),b.push(c),o++}return a}function s(){e.each(b,function(){this.unbind()})}function d(e,t){e.click(function(e){s(),S.parentNode.removeChild(S),C.remove(),S=l(t,_),c(t),o=t,e.stop()})}function c(t){C=e('
      '),_.append(C);for(var n=1;n<=g;n++){if(t!==n){var i=e('
      ['+n+"]");d(i,n),C.append(i),b.push(i)}else C.append(e("@["+n+"]"));C.append(e("@ "))}}var u=5,p=9,h=135,f=0,m=u*p,g=Math.ceil(h/m),v=Math.floor(p/2),_=e('
      '),b=[],y=t.createMenu({name:n,beforeRemove:function(){s()}});y.div.append(_);var k,w;a&&(k=e('
      ').css("right",0),w=e(''),_.append(k),k.append(w));var C,S=l(o,_);c(o)})}),KindEditor.plugin("filemanager",function(e){function t(e,t,n){return e+" ("+Math.ceil(t/1024)+"KB, "+n+")"}function n(e,n){n.is_dir?e.attr("title",n.filename):e.attr("title",t(n.filename,n.filesize,n.datetime))}var i=this,a="filemanager",o=e.undef(i.fileManagerJson,i.basePath+"php/file_manager_json.php"),r=i.pluginsPath+a+"/images/",l=i.lang(a+".");i.plugin.filemanagerDialog=function(t){function s(t,n,a){var r="path="+t+"&order="+n+"&dir="+m;b.showLoading(i.lang("ajaxLoading")),e.ajax(e.addParam(o,r+"&"+(new Date).getTime()),function(e){b.hideLoading(),a(e)})}function d(t,n,i,a){var o=e.formatUrl(n.current_url+i.filename,"absolute"),r=encodeURIComponent(n.current_dir_path+i.filename+"/");i.is_dir?t.click(function(e){s(r,S.val(),a)}):i.is_photo?t.click(function(e){v.call(this,o,i.filename)}):t.click(function(e){v.call(this,o,i.filename)}),x.push(t)}function c(t,n){function i(){"VIEW"==C.val()?s(t.current_dir_path,S.val(),p):s(t.current_dir_path,S.val(),u)}e.each(x,function(){this.unbind()}),w.unbind(),C.unbind(),S.unbind(),t.current_dir_path&&w.click(function(e){s(t.moveup_dir_path,S.val(),n)}),C.change(i),S.change(i),k.html("")}function u(t){c(t,u);var n=document.createElement("table");n.className="ke-table",n.cellPadding=0,n.cellSpacing=0,n.border=0,k.append(n);for(var i=t.file_list,a=0,o=i.length;a'),m=e(p[0].insertCell(0)).addClass("ke-cell ke-name").append(f).append(document.createTextNode(" "+s.filename));!s.is_dir||s.has_file?(p.css("cursor","pointer"),m.attr("title",s.filename),d(m,t,s,u)):m.attr("title",l.emptyFolder),e(p[0].insertCell(1)).addClass("ke-cell ke-size").html(s.is_dir?"-":Math.ceil(s.filesize/1024)+"KB"),e(p[0].insertCell(2)).addClass("ke-cell ke-datetime").html(s.datetime)}}function p(t){c(t,p);for(var i=t.file_list,a=0,o=i.length;a');k.append(u);var h=e('
      ').mouseover(function(t){e(this).addClass("ke-on")}).mouseout(function(t){e(this).removeClass("ke-on")});u.append(h);var f=t.current_url+s.filename,m=s.is_dir?r+"folder-64.gif":s.is_photo?f:r+"file-64.gif",g=e(''+s.filename+'');!s.is_dir||s.has_file?(h.css("cursor","pointer"),n(h,s),d(h,t,s,p)):h.attr("title",l.emptyFolder),h.append(g),u.append('
      '+s.filename+"
      ")}}var h=e.undef(t.width,650),f=e.undef(t.height,510),m=e.undef(t.dirName,""),g=e.undef(t.viewType,"VIEW").toUpperCase(),v=t.clickFn,_=['
      ','
      ','
      ',' ',''+l.moveup+"","
      ",'
      ',l.viewType+' ",l.orderType+' ","
      ",'
      ',"
      ",'
      ',"
      "].join(""),b=i.createDialog({name:a,width:h,height:f,title:i.lang(a),body:_}),y=b.div,k=e(".ke-plugin-filemanager-body",y),w=(e('[name="moveupImg"]',y),e('[name="moveupLink"]',y)),C=(e('[name="viewServer"]',y),e('[name="viewType"]',y)),S=e('[name="orderType"]',y),x=[];return C.val(g),s("",S.val(),"VIEW"==g?p:u),b}}),KindEditor.plugin("flash",function(e){var t=this,n="flash",i=t.lang(n+"."),a=e.undef(t.allowFlashUpload,!0),o=e.undef(t.allowFileManager,!1),r=e.undef(t.formatUploadUrl,!0),l=e.undef(t.extraFileUploadParams,{}),s=e.undef(t.filePostName,"imgFile"),d=e.undef(t.uploadJson,t.basePath+"php/upload_json.php");t.plugin.flash={edit:function(){var c=['
      ','
      ','",'  ','  ','','',"","
      ",'
      ','",' ',"
      ",'
      ','",' ',"
      ","
      "].join(""),u=t.createDialog({name:n,width:450,title:t.lang(n),body:c,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(h.val()),a=m.val(),o=g.val();if("http://"==i||e.invalidUrl(i))return alert(t.lang("invalidUrl")),void h[0].focus();if(!/^\d*$/.test(a))return alert(t.lang("invalidWidth")),void m[0].focus();if(!/^\d*$/.test(o))return alert(t.lang("invalidHeight")),void g[0].focus();var r=e.mediaImg(t.themesPath+"common/blank.gif",{src:i,type:e.mediaType(".swf"),width:a,height:o,quality:"high"});t.insertHtml(r).hideDialog().focus()}}}),p=u.div,h=e('[name="url"]',p),f=e('[name="viewServer"]',p),m=e('[name="width"]',p),g=e('[name="height"]',p);if(h.val("http://"),a){var v=e.uploadbutton({button:e(".ke-upload-button",p)[0],fieldName:s,extraParams:l,url:e.addParam(d,"dir=flash"),afterUpload:function(i){if(u.hideLoading(),0===i.error){var a=i.url;r&&(a=e.formatUrl(a,"absolute")),h.val(a),t.afterUpload&&t.afterUpload.call(t,a,i,n),alert(t.lang("uploadSuccess"))}else alert(i.message)},afterError:function(e){u.hideLoading(),t.errorDialog(e)}});v.fileBox.change(function(e){u.showLoading(t.lang("uploadLoading")),v.submit()})}else e(".ke-upload-button",p).hide();o?f.click(function(n){t.loadPlugin("filemanager",function(){t.plugin.filemanagerDialog({viewType:"LIST",dirName:"flash",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',p).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})})}):f.hide();var _=t.plugin.getSelectedFlash();if(_){var b=e.mediaAttrs(_.attr("data-ke-tag"));h.val(b.src),m.val(e.removeUnit(_.css("width"))||b.width||0),g.val(e.removeUnit(_.css("height"))||b.height||0)}h[0].focus(),h[0].select()},"delete":function(){t.plugin.getSelectedFlash().remove(),t.addBookmark()}},t.clickToolbar(n,t.plugin.flash.edit)}),KindEditor.plugin("image",function(e){var t=this,n="image",i=e.undef(t.allowImageUpload,!0),a=e.undef(t.allowImageRemote,!0),o=e.undef(t.formatUploadUrl,!0),r=e.undef(t.allowFileManager,!1),l=e.undef(t.uploadJson,t.basePath+"php/upload_json.php"),s=e.undef(t.imageTabIndex,0),d=t.pluginsPath+"image/images/",c=e.undef(t.extraFileUploadParams,{}),u=e.undef(t.filePostName,"imgFile"),p=e.undef(t.fillDescAfterUploadImage,!1),h=t.lang(n+".");t.plugin.imageDialog=function(i){function a(e,t){K.val(e),U.val(t),R=e,M=t}var s=(i.imageUrl,e.undef(i.imageWidth,""),e.undef(i.imageHeight,""),e.undef(i.imageTitle,""),e.undef(i.imageAlign,""),e.undef(i.showRemote,!0)),f=e.undef(i.showLocal,!0),m=e.undef(i.tabIndex,0),g=i.clickFn,v="kindeditor_upload_iframe_"+(new Date).getTime(),_=[];for(var b in c)_.push('');var y,k=['
      ','
      ','",'","
      "].join(""),w=f||r?450:400,C=f&&s?300:250,S=t.createDialog({name:n,width:w,height:C,title:t.lang(n),body:k,yesBtn:{name:t.lang("yes"),click:function(n){if(!S.isLoading){if(f&&s&&y&&1===y.selectedIndex||!s)return""==D.fileBox.val()?void alert(t.lang("pleaseSelectFile")):(S.showLoading(t.lang("uploadLoading")),D.submit(),void T.val(""));var i=e.trim(E.val()),a=K.val(),o=U.val(),r=F.val(),l="";return I.each(function(){if(this.checked)return l=this.value,!1}),"http://"==i||e.invalidUrl(i)?(alert(t.lang("invalidUrl")),void E[0].focus()):/^\d*$/.test(a)?/^\d*$/.test(o)?void g.call(t,i,r,a,o,0,l):(alert(t.lang("invalidHeight")),void U[0].focus()):(alert(t.lang("invalidWidth")),void K[0].focus())}}},beforeRemove:function(){A.unbind(),K.unbind(),U.unbind(),N.unbind()}}),x=S.div,E=e('[name="url"]',x),T=e('[name="localUrl"]',x),A=e('[name="viewServer"]',x),K=e('.tab1 [name="width"]',x),U=e('.tab1 [name="height"]',x),N=e(".ke-refresh-btn",x),F=e('.tab1 [name="title"]',x),I=e('.tab1 [name="align"]',x);s&&f?(y=e.tabs({src:e(".tabs",x),afterSelect:function(e){}}),y.add({title:h.remoteImage,panel:e(".tab1",x)}),y.add({title:h.localImage,panel:e(".tab2",x)}),y.select(m)):s?e(".tab1",x).show():f&&e(".tab2",x).show();var D=e.uploadbutton({button:e(".ke-upload-button",x)[0],fieldName:u,form:e(".ke-form",x),target:v,width:70,afterUpload:function(i){if(S.hideLoading(),0===i.error){var a=i.url;o&&(a=e.formatUrl(a,"absolute")),t.afterUpload&&t.afterUpload.call(t,a,i,n),p?(e(".ke-dialog-row #remoteUrl",x).val(a),e(".ke-tabs-li",x)[0].click(),e(".ke-refresh-btn",x).click()):g.call(t,a,i.title,i.width,i.height,i.border,i.align)}else alert(i.message)},afterError:function(e){S.hideLoading(),t.errorDialog(e)}});D.fileBox.change(function(e){T.val(D.fileBox.val())}),r?A.click(function(n){t.loadPlugin("filemanager",function(){t.plugin.filemanagerDialog({viewType:"VIEW",dirName:"image",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',x).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})})}):A.hide();var R=0,M=0;return N.click(function(t){var n=e('',document).css({position:"absolute",visibility:"hidden",top:0,left:"-1000px"});n.bind("load",function(){a(n.width(),n.height()),n.remove()}),e(document.body).append(n)}),K.change(function(e){R>0&&U.val(Math.round(M/R*parseInt(this.value,10)))}),U.change(function(e){M>0&&K.val(Math.round(R/M*parseInt(this.value,10)))}),E.val(i.imageUrl),a(i.imageWidth,i.imageHeight),F.val(i.imageTitle),I.each(function(){if(this.value===i.imageAlign)return this.checked=!0,!1}),s&&0===m&&(E[0].focus(),E[0].select()),S},t.plugin.image={edit:function(){var e=t.plugin.getSelectedImage();t.plugin.imageDialog({imageUrl:e?e.attr("data-ke-src"):"http://",imageWidth:e?e.width():"",imageHeight:e?e.height():"",imageTitle:e?e.attr("title"):"",imageAlign:e?e.attr("align"):"",showRemote:a,showLocal:i,tabIndex:e?0:s,clickFn:function(n,i,a,o,r,l){e?(e.attr("src",n),e.attr("data-ke-src",n),e.attr("width",a),e.attr("height",o),e.attr("title",i),e.attr("align",l),e.attr("alt",i)):t.exec("insertimage",n,i,a,o,r,l),setTimeout(function(){t.hideDialog().focus()},0)}})},"delete":function(){var e=t.plugin.getSelectedImage();"a"==e.parent().name&&(e=e.parent()),e.remove(),t.addBookmark()}},t.clickToolbar(n,t.plugin.image.edit)}),KindEditor.plugin("insertfile",function(e){var t=this,n="insertfile",i=e.undef(t.allowFileUpload,!0),a=e.undef(t.allowFileManager,!1),o=e.undef(t.formatUploadUrl,!0),r=e.undef(t.uploadJson,t.basePath+"php/upload_json.php"),l=e.undef(t.extraFileUploadParams,{}),s=e.undef(t.filePostName,"imgFile"),d=t.lang(n+".");t.plugin.fileDialog=function(c){var u=e.undef(c.fileUrl,"http://"),p=e.undef(c.fileTitle,""),h=c.clickFn,f=['
      ','
      ','",'  ','  ','','',"","
      ",'
      ','",'
      ',"
      ","",""].join(""),m=t.createDialog({name:n,width:450,title:t.lang(n),body:f,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(v.val()),a=b.val();return"http://"==i||e.invalidUrl(i)?(alert(t.lang("invalidUrl")),void v[0].focus()):(""===e.trim(a)&&(a=i),void h.call(t,i,a))}}}),g=m.div,v=e('[name="url"]',g),_=e('[name="viewServer"]',g),b=e('[name="title"]',g);if(i){var y=e.uploadbutton({button:e(".ke-upload-button",g)[0],fieldName:s,url:e.addParam(r,"dir=file"),extraParams:l,afterUpload:function(i){if(m.hideLoading(),0===i.error){var a=i.url;o&&(a=e.formatUrl(a,"absolute")),v.val(a),t.afterUpload&&t.afterUpload.call(t,a,i,n),alert(t.lang("uploadSuccess"))}else alert(i.message)},afterError:function(e){m.hideLoading(),t.errorDialog(e)}});y.fileBox.change(function(e){m.showLoading(t.lang("uploadLoading")),y.submit()})}else e(".ke-upload-button",g).hide();a?_.click(function(n){t.loadPlugin("filemanager",function(){ +t.plugin.filemanagerDialog({viewType:"LIST",dirName:"file",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',g).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})})}):_.hide(),v.val(u),b.val(p),v[0].focus(),v[0].select()},t.clickToolbar(n,function(){t.plugin.fileDialog({clickFn:function(e,n){var i=''+n+"";t.insertHtml(i).hideDialog().focus()}})})}),KindEditor.plugin("lineheight",function(e){var t=this,n="lineheight",i=t.lang(n+".");t.clickToolbar(n,function(){var a="",o=t.cmd.commonNode({"*":".line-height"});o&&(a=o.css("line-height"));var r=t.createMenu({name:n,width:150});e.each(i.lineHeight,function(n,i){e.each(i,function(e,n){r.addItem({title:n,checked:a===e,click:function(){t.cmd.toggle('',{span:".line-height="+e}),t.updateState(),t.addBookmark(),t.hideMenu()}})})})})}),KindEditor.plugin("link",function(e){var t=this,n="link";t.plugin.link={edit:function(){var i=t.lang(n+"."),a='
      ',o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(l.val());return"http://"==i||e.invalidUrl(i)?(alert(t.lang("invalidUrl")),void l[0].focus()):void t.exec("createlink",i,s.val()).hideDialog().focus()}}}),r=o.div,l=e('input[name="url"]',r),s=e('select[name="type"]',r);l.val("http://"),s[0].options[0]=new Option(i.newWindow,"_blank"),s[0].options[1]=new Option(i.selfWindow,""),t.cmd.selection();var d=t.plugin.getSelectedLink();d&&(t.cmd.range.selectNode(d[0]),t.cmd.select(),l.val(d.attr("data-ke-src")),s.val(d.attr("target"))),l[0].focus(),l[0].select()},"delete":function(){t.exec("unlink",null)}},t.clickToolbar(n,t.plugin.link.edit)}),KindEditor.plugin("map",function(e){var t=this,n="map",i=t.lang(n+".");t.clickToolbar(n,function(){function a(){o=p[0].contentWindow,r=e.iframeDoc(p)}var o,r,l=['
      ','
      ',i.address+' ','','',"","
      ",'
      ',"
      "].join(""),s=t.createDialog({name:n,width:600,title:t.lang(n),body:l,yesBtn:{name:t.lang("yes"),click:function(e){var n=(o.geocoder,o.map),i=n.getCenter().lat()+","+n.getCenter().lng(),a=n.getZoom(),r=n.getMapTypeId(),l="http://maps.googleapis.com/maps/api/staticmap";l+="?center="+encodeURIComponent(i),l+="&zoom="+encodeURIComponent(a),l+="&size=558x360",l+="&maptype="+encodeURIComponent(r),l+="&markers="+encodeURIComponent(i),l+="&language="+t.langType,l+="&sensor=false",t.exec("insertimage",l).hideDialog().focus()}},beforeRemove:function(){u.remove(),r&&r.write(""),p.remove()}}),d=s.div,c=e('[name="address"]',d),u=e('[name="searchBtn"]',d),p=(["",'',"",'',"","",'','
      ',""].join("\n"),e(''));p.bind("load",function(){p.unbind("load"),e.IE?a():setTimeout(a,0)}),e(".ke-map",d).replaceWith(p),u.click(function(){o.search(c.val())})})}),KindEditor.plugin("media",function(e){var t=this,n="media",i=t.lang(n+"."),a=e.undef(t.allowMediaUpload,!0),o=e.undef(t.allowFileManager,!1),r=e.undef(t.formatUploadUrl,!0),l=e.undef(t.extraFileUploadParams,{}),s=e.undef(t.filePostName,"imgFile"),d=e.undef(t.uploadJson,t.basePath+"php/upload_json.php");t.plugin.media={edit:function(){var c=['
      ','
      ','",'  ','  ','','',"","
      ",'
      ','",'',"
      ",'
      ','",'',"
      ",'
      ','",' ',"
      ","
      "].join(""),u=t.createDialog({name:n,width:450,height:230,title:t.lang(n),body:c,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(h.val()),a=m.val(),o=g.val();if("http://"==i||e.invalidUrl(i))return alert(t.lang("invalidUrl")),void h[0].focus();if(!/^\d*$/.test(a))return alert(t.lang("invalidWidth")),void m[0].focus();if(!/^\d*$/.test(o))return alert(t.lang("invalidHeight")),void g[0].focus();var r=e.mediaImg(t.themesPath+"common/blank.gif",{src:i,type:e.mediaType(i),width:a,height:o,autostart:v[0].checked?"true":"false",loop:"true"});t.insertHtml(r).hideDialog().focus()}}}),p=u.div,h=e('[name="url"]',p),f=e('[name="viewServer"]',p),m=e('[name="width"]',p),g=e('[name="height"]',p),v=e('[name="autostart"]',p);if(h.val("http://"),a){var _=e.uploadbutton({button:e(".ke-upload-button",p)[0],fieldName:s,extraParams:l,url:e.addParam(d,"dir=media"),afterUpload:function(i){if(u.hideLoading(),0===i.error){var a=i.url;r&&(a=e.formatUrl(a,"absolute")),h.val(a),t.afterUpload&&t.afterUpload.call(t,a,i,n),alert(t.lang("uploadSuccess"))}else alert(i.message)},afterError:function(e){u.hideLoading(),t.errorDialog(e)}});_.fileBox.change(function(e){u.showLoading(t.lang("uploadLoading")),_.submit()})}else e(".ke-upload-button",p).hide();o?f.click(function(n){t.loadPlugin("filemanager",function(){t.plugin.filemanagerDialog({viewType:"LIST",dirName:"media",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',p).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})})}):f.hide();var b=t.plugin.getSelectedMedia();if(b){var y=e.mediaAttrs(b.attr("data-ke-tag"));h.val(y.src),m.val(e.removeUnit(b.css("width"))||y.width||0),g.val(e.removeUnit(b.css("height"))||y.height||0),v[0].checked="true"===y.autostart}h[0].focus(),h[0].select()},"delete":function(){t.plugin.getSelectedMedia().remove(),t.addBookmark()}},t.clickToolbar(n,t.plugin.media.edit)}),function(e){function t(e){this.init(e)}e.extend(t,{init:function(t){function n(t,n){e(".ke-status > div",t).hide(),e(".ke-message",t).addClass("ke-error").show().html(e.escape(n))}var i=this;t.afterError=t.afterError||function(e){alert(e)},i.options=t,i.progressbars={},i.div=e(t.container).html(['
      ','
      ','
      ','',"
      ",'
      '+t.uploadDesc+"
      ",'','',"","
      ",'
      ',"
      "].join("")),i.bodyDiv=e(".ke-swfupload-body",i.div);var a={debug:!1,upload_url:t.uploadUrl,flash_url:t.flashUrl,file_post_name:t.filePostName,button_placeholder:e(".ke-swfupload-button > input",i.div)[0],button_image_url:t.buttonImageUrl,button_width:t.buttonWidth,button_height:t.buttonHeight,button_cursor:SWFUpload.CURSOR.HAND,file_types:t.fileTypes,file_types_description:t.fileTypesDesc,file_upload_limit:t.fileUploadLimit,file_size_limit:t.fileSizeLimit,post_params:t.postParams,file_queued_handler:function(e){e.url=i.options.fileIconUrl,i.appendFile(e)},file_queue_error_handler:function(n,i,a){var o="";switch(i){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:o=t.queueLimitExceeded;break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:o=t.fileExceedsSizeLimit;break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:o=t.zeroByteFile;break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:o=t.invalidFiletype;break;default:o=t.unknownError}e.DEBUG&&alert(o)},upload_start_handler:function(t){var n=this,i=e('div[data-id="'+t.id+'"]',n.bodyDiv);e(".ke-status > div",i).hide(),e(".ke-progressbar",i).show()},upload_progress_handler:function(e,t,n){var a=Math.round(100*t/n),o=i.progressbars[e.id];o.bar.css("width",Math.round(80*a/100)+"px"),o.percent.html(a+"%")},upload_error_handler:function(t,a,o){if(t&&t.filestatus==SWFUpload.FILE_STATUS.ERROR){var r=e('div[data-id="'+t.id+'"]',i.bodyDiv).eq(0);n(r,i.options.errorMessage)}},upload_success_handler:function(t,a){var o=e('div[data-id="'+t.id+'"]',i.bodyDiv).eq(0),r={};try{r=e.json(a)}catch(l){i.options.afterError.call(this,""+a+"")}return 0!==r.error?void n(o,e.DEBUG?r.message:i.options.errorMessage):(t.url=r.url,e(".ke-img",o).attr("src",t.url).attr("data-status",t.filestatus).data("data",r),void e(".ke-status > div",o).hide())}};i.swfu=new SWFUpload(a),e(".ke-swfupload-startupload input",i.div).click(function(){i.swfu.startUpload()})},getUrlList:function(){var t=[];return e(".ke-img",self.bodyDiv).each(function(){var n=e(this),i=n.attr("data-status");i==SWFUpload.FILE_STATUS.COMPLETE&&t.push(n.data("data"))}),t},removeFile:function(t){var n=this;n.swfu.cancelUpload(t);var i=e('div[data-id="'+t+'"]',n.bodyDiv);e(".ke-photo",i).unbind(),e(".ke-delete",i).unbind(),i.remove()},removeFiles:function(){var t=this;e(".ke-item",t.bodyDiv).each(function(){t.removeFile(e(this).attr("data-id"))})},appendFile:function(t){var n=this,i=e('
      ');n.bodyDiv.append(i);var a=e('
      ').mouseover(function(t){e(this).addClass("ke-on")}).mouseout(function(t){e(this).removeClass("ke-on")});i.append(a);var o=e(''+t.name+'');a.append(o),e('').appendTo(a).click(function(){n.removeFile(t.id)});var r=e('
      ').appendTo(a);e(['
      ','
      ','
      0%
      '].join("")).hide().appendTo(r),e('
      '+n.options.pendingMessage+"
      ").appendTo(r),i.append('
      '+t.name+"
      "),n.progressbars[t.id]={bar:e(".ke-progressbar-bar-inner",a),percent:e(".ke-progressbar-percent",a)}},remove:function(){this.removeFiles(),this.swfu.destroy(),this.div.html("")}}),e.swfupload=function(e,n){return new t(e,n)}}(KindEditor),KindEditor.plugin("multiimage",function(e){var t=this,n="multiimage",i=(e.undef(t.formatUploadUrl,!0),e.undef(t.uploadJson,t.basePath+"php/upload_json.php")),a=t.pluginsPath+"multiimage/images/",o=e.undef(t.imageSizeLimit,"1MB"),r=(e.undef(t.imageFileTypes,"*.jpg;*.gif;*.png"),e.undef(t.imageUploadLimit,20)),l=e.undef(t.filePostName,"imgFile"),s=t.lang(n+".");t.plugin.multiImageDialog=function(d){var c=d.clickFn,u=e.tmpl(s.uploadDesc,{uploadLimit:r,sizeLimit:o}),p=['
      ','
      ',"
      ","
      "].join(""),h=t.createDialog({name:n,width:650,height:510,title:t.lang(n),body:p,previewBtn:{name:s.insertAll,click:function(e){c.call(t,m.getUrlList())}},yesBtn:{name:s.clearAll,click:function(e){m.removeFiles()}},beforeRemove:function(){(!e.IE||e.V<=8)&&m.remove()}}),f=h.div,m=e.swfupload({container:e(".swfupload",f),buttonImageUrl:a+("zh-CN"==t.langType?"select-files-zh-CN.png":"select-files-en.png"),buttonWidth:"zh-CN"==t.langType?72:88,buttonHeight:23,fileIconUrl:a+"image.png",uploadDesc:u,startButtonValue:s.startUpload,uploadUrl:e.addParam(i,"dir=image"),flashUrl:a+"swfupload.swf",filePostName:l,fileTypes:"*.jpg;*.jpeg;*.gif;*.png;*.bmp",fileTypesDesc:"Image Files",fileUploadLimit:r,fileSizeLimit:o,postParams:e.undef(t.extraFileUploadParams,{}),queueLimitExceeded:s.queueLimitExceeded,fileExceedsSizeLimit:s.fileExceedsSizeLimit,zeroByteFile:s.zeroByteFile,invalidFiletype:s.invalidFiletype,unknownError:s.unknownError,pendingMessage:s.pending,errorMessage:s.uploadError,afterError:function(e){t.errorDialog(e)}});return h},t.clickToolbar(n,function(){t.plugin.multiImageDialog({clickFn:function(n){0!==n.length&&(e.each(n,function(e,n){t.afterUpload&&t.afterUpload.call(t,n.url,n,"multiimage"),t.exec("insertimage",n.url,n.title,n.width,n.height,n.border,n.align)}),setTimeout(function(){t.hideDialog().focus()},0))}})})}),function(){window.SWFUpload=function(e){this.initSWFUpload(e)},SWFUpload.prototype.initSWFUpload=function(e){try{this.customSettings={},this.settings=e,this.eventQueue=[],this.movieName="KindEditor_SWFUpload_"+SWFUpload.movieCount++,this.movieElement=null,SWFUpload.instances[this.movieName]=this,this.initSettings(),this.loadFlash(),this.displayDebugInfo()}catch(t){throw delete SWFUpload.instances[this.movieName],t}},SWFUpload.instances={},SWFUpload.movieCount=0,SWFUpload.version="2.2.0 2009-03-25",SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130},SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290},SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5},SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120},SWFUpload.CURSOR={ARROW:-1,HAND:-2},SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"},SWFUpload.completeURL=function(e){if("string"!=typeof e||e.match(/^https?:\/\//i)||e.match(/^\//))return e;var t=(window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),window.location.pathname.lastIndexOf("/"));return t<=0?path="/":path=window.location.pathname.substr(0,t)+"/",path+e},SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(e,t){this.settings[e]=void 0==this.settings[e]?t:this.settings[e]},this.ensureDefault("upload_url",""),this.ensureDefault("preserve_relative_urls",!1),this.ensureDefault("file_post_name","Filedata"),this.ensureDefault("post_params",{}),this.ensureDefault("use_query_string",!1),this.ensureDefault("requeue_on_error",!1),this.ensureDefault("http_success",[]),this.ensureDefault("assume_success_timeout",0),this.ensureDefault("file_types","*.*"),this.ensureDefault("file_types_description","All Files"),this.ensureDefault("file_size_limit",0),this.ensureDefault("file_upload_limit",0),this.ensureDefault("file_queue_limit",0),this.ensureDefault("flash_url","swfupload.swf"),this.ensureDefault("prevent_swf_caching",!0),this.ensureDefault("button_image_url",""),this.ensureDefault("button_width",1),this.ensureDefault("button_height",1),this.ensureDefault("button_text",""),this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;"),this.ensureDefault("button_text_top_padding",0),this.ensureDefault("button_text_left_padding",0),this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES),this.ensureDefault("button_disabled",!1),this.ensureDefault("button_placeholder_id",""),this.ensureDefault("button_placeholder",null),this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW),this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW),this.ensureDefault("debug",!1),this.settings.debug_enabled=this.settings.debug,this.settings.return_upload_start_handler=this.returnUploadStart,this.ensureDefault("swfupload_loaded_handler",null),this.ensureDefault("file_dialog_start_handler",null),this.ensureDefault("file_queued_handler",null),this.ensureDefault("file_queue_error_handler",null),this.ensureDefault("file_dialog_complete_handler",null),this.ensureDefault("upload_start_handler",null),this.ensureDefault("upload_progress_handler",null),this.ensureDefault("upload_error_handler",null),this.ensureDefault("upload_success_handler",null),this.ensureDefault("upload_complete_handler",null),this.ensureDefault("debug_handler",this.debugMessage),this.ensureDefault("custom_settings",{}),this.customSettings=this.settings.custom_settings,this.settings.prevent_swf_caching&&(this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+(new Date).getTime()),this.settings.preserve_relative_urls||(this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url),this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)),delete this.ensureDefault},SWFUpload.prototype.loadFlash=function(){var e,t;if(null!==document.getElementById(this.movieName))throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";if(e=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder,void 0==e)throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;t=document.createElement("div"),t.innerHTML=this.getFlashHTML(),e.parentNode.replaceChild(t.firstChild,e),void 0==window[this.movieName]&&(window[this.movieName]=this.getMovieElement())},SWFUpload.prototype.getFlashHTML=function(){var e="";return KindEditor.IE&&KindEditor.V>8&&(e=' classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'),['','','','','','','',""].join("")},SWFUpload.prototype.getFlashVars=function(){var e=this.buildParamString(),t=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&uploadURL=",encodeURIComponent(this.settings.upload_url),"&useQueryString=",encodeURIComponent(this.settings.use_query_string),"&requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&httpSuccess=",encodeURIComponent(t),"&assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&params=",encodeURIComponent(e),"&filePostName=",encodeURIComponent(this.settings.file_post_name),"&fileTypes=",encodeURIComponent(this.settings.file_types),"&fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&buttonWidth=",encodeURIComponent(this.settings.button_width),"&buttonHeight=",encodeURIComponent(this.settings.button_height),"&buttonText=",encodeURIComponent(this.settings.button_text),"&buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&buttonAction=",encodeURIComponent(this.settings.button_action),"&buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")},SWFUpload.prototype.getMovieElement=function(){if(void 0==this.movieElement&&(this.movieElement=document.getElementById(this.movieName)),null===this.movieElement)throw"Could not find Flash element";return this.movieElement},SWFUpload.prototype.buildParamString=function(){var e=this.settings.post_params,t=[];if("object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n.toString())+"="+encodeURIComponent(e[n].toString()));return t.join("&")},SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,!1);var e=null;if(e=this.getMovieElement(),e&&"unknown"==typeof e.CallFunction){for(var t in e)try{"function"==typeof e[t]&&(e[t]=null)}catch(n){}try{e.parentNode.removeChild(e)}catch(i){}}return window[this.movieName]=null,SWFUpload.instances[this.movieName]=null,delete SWFUpload.instances[this.movieName],this.movieElement=null,this.settings=null,this.customSettings=null,this.eventQueue=null,this.movieName=null,!0}catch(a){return!1}},SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url: ",this.settings.upload_url,"\n","\t","flash_url: ",this.settings.flash_url,"\n","\t","use_query_string: ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error: ",this.settings.requeue_on_error.toString(),"\n","\t","http_success: ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout: ",this.settings.assume_success_timeout,"\n","\t","file_post_name: ",this.settings.file_post_name,"\n","\t","post_params: ",this.settings.post_params.toString(),"\n","\t","file_types: ",this.settings.file_types,"\n","\t","file_types_description: ",this.settings.file_types_description,"\n","\t","file_size_limit: ",this.settings.file_size_limit,"\n","\t","file_upload_limit: ",this.settings.file_upload_limit,"\n","\t","file_queue_limit: ",this.settings.file_queue_limit,"\n","\t","debug: ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching: ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id: ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder: ",this.settings.button_placeholder?"Set":"Not Set","\n","\t","button_image_url: ",this.settings.button_image_url.toString(),"\n","\t","button_width: ",this.settings.button_width.toString(),"\n","\t","button_height: ",this.settings.button_height.toString(),"\n","\t","button_text: ",this.settings.button_text.toString(),"\n","\t","button_text_style: ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding: ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action: ",this.settings.button_action.toString(),"\n","\t","button_disabled: ",this.settings.button_disabled.toString(),"\n","\t","custom_settings: ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned: ",("function"==typeof this.settings.swfupload_loaded_handler).toString(),"\n","\t","file_dialog_start_handler assigned: ",("function"==typeof this.settings.file_dialog_start_handler).toString(),"\n","\t","file_queued_handler assigned: ",("function"==typeof this.settings.file_queued_handler).toString(),"\n","\t","file_queue_error_handler assigned: ",("function"==typeof this.settings.file_queue_error_handler).toString(),"\n","\t","upload_start_handler assigned: ",("function"==typeof this.settings.upload_start_handler).toString(),"\n","\t","upload_progress_handler assigned: ",("function"==typeof this.settings.upload_progress_handler).toString(),"\n","\t","upload_error_handler assigned: ",("function"==typeof this.settings.upload_error_handler).toString(),"\n","\t","upload_success_handler assigned: ",("function"==typeof this.settings.upload_success_handler).toString(),"\n","\t","upload_complete_handler assigned: ",("function"==typeof this.settings.upload_complete_handler).toString(),"\n","\t","debug_handler assigned: ",("function"==typeof this.settings.debug_handler).toString(),"\n"].join(""))},SWFUpload.prototype.addSetting=function(e,t,n){return void 0==t?this.settings[e]=n:this.settings[e]=t},SWFUpload.prototype.getSetting=function(e){return void 0!=this.settings[e]?this.settings[e]:""},SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement(),returnValue,returnString;try{returnString=movieElement.CallFunction(''+__flash__argumentsToXML(argumentArray,0)+""),returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}return void 0!=returnValue&&"object"==typeof returnValue.post&&(returnValue=this.unescapeFilePostParams(returnValue)),returnValue},SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")},SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")},SWFUpload.prototype.startUpload=function(e){this.callFlash("StartUpload",[e])},SWFUpload.prototype.cancelUpload=function(e,t){t!==!1&&(t=!0),this.callFlash("CancelUpload",[e,t])},SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")},SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")},SWFUpload.prototype.setStats=function(e){this.callFlash("SetStats",[e])},SWFUpload.prototype.getFile=function(e){return"number"==typeof e?this.callFlash("GetFileByIndex",[e]):this.callFlash("GetFile",[e])},SWFUpload.prototype.addFileParam=function(e,t,n){return this.callFlash("AddFileParam",[e,t,n])},SWFUpload.prototype.removeFileParam=function(e,t){this.callFlash("RemoveFileParam",[e,t])},SWFUpload.prototype.setUploadURL=function(e){this.settings.upload_url=e.toString(),this.callFlash("SetUploadURL",[e])},SWFUpload.prototype.setPostParams=function(e){this.settings.post_params=e,this.callFlash("SetPostParams",[e])},SWFUpload.prototype.addPostParam=function(e,t){this.settings.post_params[e]=t,this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.removePostParam=function(e){delete this.settings.post_params[e],this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.setFileTypes=function(e,t){this.settings.file_types=e,this.settings.file_types_description=t,this.callFlash("SetFileTypes",[e,t])},SWFUpload.prototype.setFileSizeLimit=function(e){this.settings.file_size_limit=e,this.callFlash("SetFileSizeLimit",[e])},SWFUpload.prototype.setFileUploadLimit=function(e){this.settings.file_upload_limit=e,this.callFlash("SetFileUploadLimit",[e])},SWFUpload.prototype.setFileQueueLimit=function(e){this.settings.file_queue_limit=e,this.callFlash("SetFileQueueLimit",[e])},SWFUpload.prototype.setFilePostName=function(e){this.settings.file_post_name=e,this.callFlash("SetFilePostName",[e])},SWFUpload.prototype.setUseQueryString=function(e){this.settings.use_query_string=e,this.callFlash("SetUseQueryString",[e])},SWFUpload.prototype.setRequeueOnError=function(e){this.settings.requeue_on_error=e,this.callFlash("SetRequeueOnError",[e])},SWFUpload.prototype.setHTTPSuccess=function(e){"string"==typeof e&&(e=e.replace(" ","").split(",")),this.settings.http_success=e,this.callFlash("SetHTTPSuccess",[e])},SWFUpload.prototype.setAssumeSuccessTimeout=function(e){this.settings.assume_success_timeout=e,this.callFlash("SetAssumeSuccessTimeout",[e])},SWFUpload.prototype.setDebugEnabled=function(e){this.settings.debug_enabled=e,this.callFlash("SetDebugEnabled",[e])},SWFUpload.prototype.setButtonImageURL=function(e){void 0==e&&(e=""),this.settings.button_image_url=e,this.callFlash("SetButtonImageURL",[e])},SWFUpload.prototype.setButtonDimensions=function(e,t){this.settings.button_width=e,this.settings.button_height=t;var n=this.getMovieElement();void 0!=n&&(n.style.width=e+"px",n.style.height=t+"px"),this.callFlash("SetButtonDimensions",[e,t])},SWFUpload.prototype.setButtonText=function(e){this.settings.button_text=e,this.callFlash("SetButtonText",[e])},SWFUpload.prototype.setButtonTextPadding=function(e,t){this.settings.button_text_top_padding=t,this.settings.button_text_left_padding=e,this.callFlash("SetButtonTextPadding",[e,t])},SWFUpload.prototype.setButtonTextStyle=function(e){this.settings.button_text_style=e,this.callFlash("SetButtonTextStyle",[e])},SWFUpload.prototype.setButtonDisabled=function(e){this.settings.button_disabled=e,this.callFlash("SetButtonDisabled",[e])},SWFUpload.prototype.setButtonAction=function(e){this.settings.button_action=e,this.callFlash("SetButtonAction",[e])},SWFUpload.prototype.setButtonCursor=function(e){this.settings.button_cursor=e,this.callFlash("SetButtonCursor",[e])},SWFUpload.prototype.queueEvent=function(e,t){void 0==t?t=[]:t instanceof Array||(t=[t]);var n=this;if("function"==typeof this.settings[e])this.eventQueue.push(function(){this.settings[e].apply(this,t)}),setTimeout(function(){n.executeNextEvent()},0);else if(null!==this.settings[e])throw"Event handler "+e+" is unknown or is not a function"},SWFUpload.prototype.executeNextEvent=function(){var e=this.eventQueue?this.eventQueue.shift():null;"function"==typeof e&&e.apply(this)},SWFUpload.prototype.unescapeFilePostParams=function(e){var t,n=/[$]([0-9a-f]{4})/i,i={};if(void 0!=e){for(var a in e.post)if(e.post.hasOwnProperty(a)){t=a;for(var o;null!==(o=n.exec(t));)t=t.replace(o[0],String.fromCharCode(parseInt("0x"+o[1],16)));i[t]=e.post[a]}e.post=i}return e},SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(e){return!1}},SWFUpload.prototype.flashReady=function(){ +var e=this.getMovieElement();return e?(this.cleanUp(e),void this.queueEvent("swfupload_loaded_handler")):void this.debug("Flash called back ready but the flash movie can't be found.")},SWFUpload.prototype.cleanUp=function(e){try{if(this.movieElement&&"unknown"==typeof e.CallFunction){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var t in e)try{"function"==typeof e[t]&&(e[t]=null)}catch(n){}}}catch(i){}window.__flash__removeCallback=function(e,t){try{e&&(e[t]=null)}catch(n){}}},SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")},SWFUpload.prototype.fileQueued=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("file_queued_handler",e)},SWFUpload.prototype.fileQueueError=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("file_queue_error_handler",[e,t,n])},SWFUpload.prototype.fileDialogComplete=function(e,t,n){this.queueEvent("file_dialog_complete_handler",[e,t,n])},SWFUpload.prototype.uploadStart=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("return_upload_start_handler",e)},SWFUpload.prototype.returnUploadStart=function(e){var t;if("function"==typeof this.settings.upload_start_handler)e=this.unescapeFilePostParams(e),t=this.settings.upload_start_handler.call(this,e);else if(void 0!=this.settings.upload_start_handler)throw"upload_start_handler must be a function";void 0===t&&(t=!0),t=!!t,this.callFlash("ReturnUploadStart",[t])},SWFUpload.prototype.uploadProgress=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_progress_handler",[e,t,n])},SWFUpload.prototype.uploadError=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_error_handler",[e,t,n])},SWFUpload.prototype.uploadSuccess=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_success_handler",[e,t,n])},SWFUpload.prototype.uploadComplete=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("upload_complete_handler",e)},SWFUpload.prototype.debug=function(e){this.queueEvent("debug_handler",e)},SWFUpload.prototype.debugMessage=function(e){if(this.settings.debug){var t,n=[];if("object"==typeof e&&"string"==typeof e.name&&"string"==typeof e.message){for(var i in e)e.hasOwnProperty(i)&&n.push(i+": "+e[i]);t=n.join("\n")||"",n=t.split("\n"),t="EXCEPTION: "+n.join("\nEXCEPTION: "),SWFUpload.Console.writeLine(t)}else SWFUpload.Console.writeLine(e)}},SWFUpload.Console={},SWFUpload.Console.writeLine=function(e){var t,n;try{t=document.getElementById("SWFUpload_Console"),t||(n=document.createElement("form"),document.getElementsByTagName("body")[0].appendChild(n),t=document.createElement("textarea"),t.id="SWFUpload_Console",t.style.fontFamily="monospace",t.setAttribute("wrap","off"),t.wrap="off",t.style.overflow="auto",t.style.width="700px",t.style.height="350px",t.style.margin="5px",n.appendChild(t)),t.value+=e+"\n",t.scrollTop=t.scrollHeight-t.clientHeight}catch(i){alert("Exception: "+i.name+" Message: "+i.message)}}}(),function(){"function"==typeof SWFUpload&&(SWFUpload.queue={},SWFUpload.prototype.initSettings=function(e){return function(){"function"==typeof e&&e.call(this),this.queueSettings={},this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0,this.queueSettings.user_upload_complete_handler=this.settings.upload_complete_handler,this.queueSettings.user_upload_start_handler=this.settings.upload_start_handler,this.settings.upload_complete_handler=SWFUpload.queue.uploadCompleteHandler,this.settings.upload_start_handler=SWFUpload.queue.uploadStartHandler,this.settings.queue_complete_handler=this.settings.queue_complete_handler||null}}(SWFUpload.prototype.initSettings),SWFUpload.prototype.startUpload=function(e){this.queueSettings.queue_cancelled_flag=!1,this.callFlash("StartUpload",[e])},SWFUpload.prototype.cancelQueue=function(){this.queueSettings.queue_cancelled_flag=!0,this.stopUpload();for(var e=this.getStats();e.files_queued>0;)this.cancelUpload(),e=this.getStats()},SWFUpload.queue.uploadStartHandler=function(e){var t;return"function"==typeof this.queueSettings.user_upload_start_handler&&(t=this.queueSettings.user_upload_start_handler.call(this,e)),t=t!==!1,this.queueSettings.queue_cancelled_flag=!t,t},SWFUpload.queue.uploadCompleteHandler=function(e){var t,n=this.queueSettings.user_upload_complete_handler;if(e.filestatus===SWFUpload.FILE_STATUS.COMPLETE&&this.queueSettings.queue_upload_count++,t="function"==typeof n?n.call(this,e)!==!1:e.filestatus!==SWFUpload.FILE_STATUS.QUEUED){var i=this.getStats();i.files_queued>0&&this.queueSettings.queue_cancelled_flag===!1?this.startUpload():this.queueSettings.queue_cancelled_flag===!1?(this.queueEvent("queue_complete_handler",[this.queueSettings.queue_upload_count]),this.queueSettings.queue_upload_count=0):(this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0)}})}(),KindEditor.plugin("pagebreak",function(e){var t=this,n="pagebreak",i=e.undef(t.pagebreakHtml,'
      ');t.clickToolbar(n,function(){var n=t.cmd,a=n.range;t.focus();var o="br"==t.newlineTag||e.WEBKIT?"":'';if(t.insertHtml(i+o),""!==o){var r=e("#__kindeditor_tail_tag__",t.edit.doc);a.selectNodeContents(r[0]),r.removeAttr("id"),n.select()}})}),KindEditor.plugin("plainpaste",function(e){var t=this,n="plainpaste";t.clickToolbar(n,function(){var i=t.lang(n+"."),a='
      '+i.comment+'
      ',o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var i=r.val();i=e.escape(i),i=i.replace(/ {2}/g,"  "),i="p"==t.newlineTag?i.replace(/^/,"

      ").replace(/$/,"

      ").replace(/\n/g,"

      "):i.replace(/\n/g,"
      $&"),t.insertHtml(i).hideDialog().focus()}}}),r=e("textarea",o.div);r[0].focus()})}),KindEditor.plugin("preview",function(e){var t=this,n="preview";t.clickToolbar(n,function(){var i=(t.lang(n+"."),'

      '),a=t.createDialog({name:n,width:750,title:t.lang(n),body:i}),o=e("iframe",a.div),r=e.iframeDoc(o);r.open(),r.write(t.fullHtml()),r.write("");var l=t.options.cssData,s=t.options.cssPath,d=t.options.bodyClass;e.isArray(s)||(s=[s]),e.each(s,function(e,t){t&&r.write('')}),l&&r.write(""),r.close();var c=e(r.body).css("background-color","#FFF");d&&c.addClass(d),o[0].contentWindow.focus()})}),KindEditor.plugin("quickformat",function(e){function t(e){for(var t=e.first();t&&t.first();)t=t.first();return t}var n=this,i="quickformat",a=e.toMap("blockquote,center,div,h1,h2,h3,h4,h5,h6,p");n.clickToolbar(i,function(){n.focus();for(var i,o=n.edit.doc,r=n.cmd.range,l=e(o.body).first(),s=[],d=[],c=r.createBookmark(!0);l;){i=l.next();var u=t(l);u&&"img"==u.name||(a[l.name]?(l.html(l.html().replace(/^(\s| | )+/gi,"")),l.css("text-indent","2em")):d.push(l),(!i||a[i.name]||a[l.name]&&!a[i.name])&&(d.length>0&&s.push(d),d=[])),l=i}e.each(s,function(t,n){var i=e('

      ',o);n[0].before(i),e.each(n,function(e,t){i.append(t)})}),r.moveToBookmark(c),n.addBookmark()})}),KindEditor.plugin("template",function(e){function t(t){return a+t+"?ver="+encodeURIComponent(e.DEBUG?e.TIME:e.VERSION)}var n=this,i="template",a=(n.lang(i+"."),n.pluginsPath+i+"/html/");n.clickToolbar(i,function(){var a=n.lang(i+"."),o=['
      ','
      ','
      ',a.selectTemplate+"
      ",'
      ',' ","
      ",'
      ',"
      ",'',"
      "].join("");var r=n.createDialog({name:i,width:500,title:n.lang(i),body:html,yesBtn:{name:n.lang("yes"),click:function(t){var i=e.iframeDoc(d);n[s[0].checked?"html":"insertHtml"](i.body.innerHTML).hideDialog().focus()}}}),l=e("select",r.div),s=e('[name="replaceFlag"]',r.div),d=e("iframe",r.div);s[0].checked=!0,d.attr("src",t(l.val())),l.change(function(){d.attr("src",t(this.value))})})}),KindEditor.plugin("wordpaste",function(e){var t=this,n="wordpaste";t.clickToolbar(n,function(){var i=t.lang(n+"."),a='
      '+i.comment+'
      ',o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var i=s.body.innerHTML;i=e.clearMsWord(i,t.filterMode?t.htmlTags:e.options.htmlTags),t.insertHtml(i).hideDialog().focus()}}}),r=o.div,l=e("iframe",r),s=e.iframeDoc(l);e.IE||(s.designMode="on"),s.open(),s.write("WordPaste"),s.write(''),e.IE||s.write("
      "),s.write(""),s.close(),e.IE&&(s.body.contentEditable="true"),l[0].contentWindow.focus()})}),$.each(["afterBlur","afterFocus","afterChange","afterTab"],function(e,t){KindEditor.EditorClass.prototype[t]=function(e){return this.handler(t,e)}}),KindEditor.plugin("zui",function(e){var t=this,n=t.options;if(t.uuid=$.zui.uuid(),t.afterBlur(function(){n.syncAfterBlur&&t.sync(),t.container.removeClass("focus")}),t.afterFocus(function(){t.container.addClass("focus")}),t.afterChange(function(){t.edit.srcElement.change().hide()}),t.afterCreate(function(){$(t.edit.srcElement[0]).data("keditor",t);var e=n.spellcheck;void 0!==e&&t.edit.doc.documentElement.setAttribute("spellcheck",e)}),n.transferTab!==!1){var i='input:not([type="hidden"]), textarea:not(.ke-edit-textarea), button[type="submit"], select';t.afterTab(function(){var e=$(t.edit.srcElement[0]),n=e.next(i);if(n.length||(n=e.parent().next().find(i)),n.length||(n=e.parent().parent().next().find(i)),n=n.first(),n.length){var a=n.data("keditor");return a?a.focus():n.focus(),!0}return!0})}}),KindEditor.EditorClass.prototype.setPlaceholder=function(e,t){var n=this,i=n.options,a=n.edit,o=$(a.doc),r=o.find(".kindeditor-ph");r.length||(r=$('
      '),i.placeholderStyle&&r.css(i.placeholderStyle),o.find("body").after(r)),n.plugin.hasContent()&&r.hide(),r[t?"html":"text"](e)},KindEditor.EditorClass.prototype.getPlaceholder=function(e){return $(this.edit.doc).find(".kindeditor-ph")[e?"html":"text"]()},KindEditor.plugin("placeholder",function(e){var t=this;t.plugin.hasContent=function(){return""!==t.html().replace(/\s|\n|\r|\t/g,"").replace(//g,"").replace(/

      <\/p>/g,"")},t.afterBlur(function(){t.plugin.hasContent()||$(t.edit.doc).find(".kindeditor-ph").show()}),t.afterFocus(function(){$(t.edit.doc).find(".kindeditor-ph").hide()}),t.afterCreate(function(){var e=t.options;e.placeholderHtml?t.setPlaceholder(e.placeholderHtml,!0):e.placeholder&&t.setPlaceholder(e.placeholder)})}),KindEditor.plugin("pasteimage",function(e){var t=this,n={zh_cn:{notSupportMsg:"您的浏览器不支持粘贴图片!",placeholder:"可以在编辑器直接贴图。",failMsg:"贴图失败,请稍后重试。",uploadingHint:"正在上传图片,请稍后..."},zh_tw:{notSupportMsg:"您的瀏覽器不支持粘貼圖片!",placeholder:"可以在編輯器直接貼圖。",failMsg:"貼圖失敗,請稍後重試。",uploadingHint:"正在上傳圖片,請稍後..."},en:{notSupportMsg:"Image is not allowed to paste in your browser!",placeholder:"Paste images here.",failMsg:"Pasting image failed. Try again later.",uploadingHint:"Uploading..."}},i=$.extend({},n[($.clientLang||$.zui.clientLang)()]);t.afterCreate(function(){var n=t.edit,a=n.doc,o=t.uuid,r=t.options.pasteImage;if(r){if("string"==typeof r&&(r={postUrl:r}),$.extend({placeholder:l},r),e.WEBKIT||e.GECKO||$(a.body).on("keyup.ke"+o,function(e){86==e.keyCode&&e.ctrlKey&&alert(i.notSupportMsg)}),t.setPlaceholder){var l=r.placeholder;if(l===!0&&(l=i.placeholder),l){var s=t.getPlaceholder();s?s.indexOf(l)<0&&(l=s+"\n"+l):s=l,t.setPlaceholder(l)}}var d=function(){r.beforePaste&&r.beforePaste();var e='

      '+i.uploadingHint+"
      ";n.cmd.inserthtml(e),t.readonly(!0)},c=function(e){e&&(r.onError?r.onError(e):(e===!0&&(e=i.failMsg),$.zui&&$.zui.messager&&$.zui.messager.danger(e,{placement:"center"}))),r.afterPaste&&r.afterPaste(),$(a.body).find(".image-loading-ele").remove(),t.readonly(!1)},u=r.postUrl;$(a.body).on("paste.ke"+o,function(t){if(e.WEBKIT){var i=t.originalEvent,o=i.clipboardData&&i.clipboardData.items,r=null;if(o)for(var l=/^image\/(p?jpeg|gif|png)$/i,s=0;s';$.post(u,{editor:i},function(e){e?n.cmd.inserthtml(e):n.cmd.inserthtml(i),c()}).error(function(){c(!0)})},h.readAsDataURL(p)}else setTimeout(function(){var t=e(a.body).html();t.search(/"),n.html(e),c()}).error(function(){c(!0)}))},80)}),t.beforeRemove(function(){$(a.body).off(".ke"+o)})}})}),function(e){function t(t){var n=[],i=0,a=0;t.children("thead,tbody,tfoot").children("tr").each(function(t,o){e(o).children("td,th").each(function(o,r){var l,s,d=e(r),c=0|d.attr("colspan"),u=0|d.attr("rowspan");for(c=c?c:1,u=u?u:1;n[t]&&n[t][o];++o);for(l=o;ltr"),r=o.filter(function(){return!!this.style.backgroundColor}).length;t.stripedRows=r>=Math.floor(o/2)}if(s.tableSetting=t,void 0!==t.header){if(n.is(".ke-plugin-table-example"))n.find("thead").toggleClass("hidden",!t.header);else{var l=n.find("thead");if(t.header){if(!l.length){var d=["
      "],c=n.find("tbody>tr:first").children(),u=0;c.each(function(){var e=$(this),t=e.attr("colspan");u+=t?parseInt(t):1});for(var p=0;p'+(e.IE?" ":"
      ")+"");d.push("
      "),l=$(d.join("")),n.prepend(l)}}else l.remove()}i&&i("header",t.header)}if(void 0!==t.stripedRows){var o=n.find("tbody>tr");o.each(function(e){$(this).css("background-color",t.stripedRows&&e%2===0?"#f9f9f9":"none")}),i&&i("stripedRows",t.stripedRows)}void 0!==t.autoWidth&&(n.css(t.autoWidth?{width:"auto",maxWidth:"100%"}:{width:"100%"}),i&&i("autoWidth",t.autoWidth)),void 0!==t.borderColor&&(n.find("td,th").css("border-color",t.borderColor),i&&i("borderColor",t.borderColor))}}function r(t,n,i,a){if(t*n){for(var o="ke-table-"+s.tableIdIndex++,r=$('
      '),l=$(""),d=0;d"),u=0;u'+(e.IE?" ":"
      ")+"");c.append(p)}l.append(c)}r.append(l);var f=$("
      ").append(r).html();e.IE||(f+="
      "),s.insertHtml(f);var r=$(s.edit.doc).find("#"+o);return r.attr("id",null),s.cmd.range.selectNodeContents(r.find("th,td").first()[0]).collapse(!0),s.cmd.select(),s.addBookmark(),r}}function l(i){for(var a=$(i[0]),r=[""],l=[""],c=0;c<6;++c){r.push('{tableHead}'),l.push("");for(var u=0;u<6;++u)l.push('{tableContent}');l.push("")}r.push(""),l.push("");var f=['
      ','
      ','
      ','
      ',"",'
      ','
      ',"
      ",'
      ',"",'
      ','
      ',"
      ",'
      ',"",'
      ','{borderColor}','',"
      ","
      ","
      ",'
      ','',r.join(""),l.join(""),"
      ","","",""].join("").format(p),m=$(f),g=m.find(".ke-plugin-table-example"),v=s.cmd.range.createBookmark(),_=m.find(".ke-plugin-table-input-color"),b=e(_[0]);m.on("change.kTable","input[name]",function(){var e=$(this),t={};t[e.attr("name")]=e.is('[type="checkbox"]')?e.is(":checked"):e.val(),o(t,g)});var y=s.createDialog({name:d+"Dialog",width:550,title:s.lang(d),body:m[0],beforeRemove:function(){m.off(".kTable")},yesBtn:{name:s.lang("yes"),click:function(e){o({borderColor:m.find('[name="borderColor"]').val(),header:m.find('[name="header"]').is(":checked"),stripedRows:m.find('[name="stripedRows"]').is(":checked"),hoverRows:m.find('[name="hoverRows"]').is(":checked"),autoWidth:m.find('[name="autoWidth"]:checked').val()},a),s.hideDialog().focus(),s.cmd.range.moveToBookmark(v),s.cmd.select(),s.addBookmark()}}});n(y.div,b,function(e){o({borderColor:e},g)}),o(s.tableSetting,g,function(e,n){switch(e){case"borderColor":t(b,n||h);break;case"header":m.find('[name="header"]').prop("checked",!!n);break;case"stripedRows":m.find('[name="stripedRows"]').prop("checked",!!n);break;case"hoverRows":m.find('[name="hoverRows"]').prop("checked",!!n);break;case"autoWidth":m.find('[name="autoWidth"][value="'+(n?"auto":"")+'"]').prop("checked",!0)}})}var s=this,d="table",c={zh_cn:{name:"表格",xRxC:"{0}行 × {1}列",headerRow:"标题行",headerCol:"标题列",tableStyle:"表格样式",addHeaderRow:"添加表格标题行",stripedRows:"隔行变色效果",hoverRows:"鼠标悬停效果",autoChangeTableWidth:"自动调整表格尺寸",tableWidthFixed:"按表格文字自适应",tableWidthFull:"按页面宽度自适应",tableBorder:"表格边框",tableHead:"标题",tableContent:"内容",mergeCells:"合并单元格",defaultColor:"默认颜色",color:"颜色",forecolor:"文字颜色",backcolor:"背景颜色",invalidBoderWidth:"邊框大小必須為數字。"},zh_tw:{name:"表格",xRxC:"{0}行×{1}列",headerRow:"標題行",headerCol:"標題列",tableStyle:"表格樣式",addHeaderRow:"添加表格標題行",stripedRows:"隔行變色效果",hoverRows:"鼠標懸停效果",autoChangeTableWidth:"自動調整表格尺寸",tableWidthFixed:"按表格文字自適應",tableWidthFull:"按頁面寬度自適應",tableBorder:"表格邊框",tableHead:"標題",tableContent:"內容",mergeCells:"合併單元格",defaultColor:"默認顏色",color:"顏色",forecolor:"文字顏色",backcolor:"背景顏色",invalidBoderWidth:"边框大小必须为数字。"},en:{name:"Table",xRxC:"{0} Rows × {1} Columns",headerRow:"Header Row",headerCol:"Header Column",tableStyle:"Table style",addHeaderRow:"Add header row",stripedRows:"Striped effection",hoverRows:"Mouse hover effection",autoChangeTableWidth:"Automatically adjust table size",tableWidthFixed:"Adaptive by form text",tableWidthFull:"Page width adaptive",tableBorder:"Table border",tableHead:"Title",tableContent:"Text",mergeCells:"Merge Cells",defaultColor:"Default color",color:"Color",forecolor:"Text Color",backcolor:"Back Color",invalidBoderWidth:"Border width value must be number"}},u=[],p=$.extend({},s.lang("table."),c[($.clientLang||$.zui.clientLang)()]),h=s.options.tableBorderColor||"#ddd";s.tableIdIndex=0;var f=[];if(!s.plugin.table){s.plugin.table={prop:function(){var e=s.plugin.getSelectedTable();e&&e.length&&l(e)},cellprop:function(){var i,a,o,r,r,l,c,u,f,m=['
      ','
      ','",'
      ','
      ',''+p.width+"",'','','","
      ","
      ",'
      ','
      ',''+p.height+"",'','','","
      ","
      ","
      ",'
      ','",'
      ','
      ',''+p.textAlign+"",'","
      ","
      ",'
      ','
      ',''+p.verticalAlign+"",'","
      ","
      ","
      ",'
      ','",'
      ','
      ',''+p.borderColor+"",'',"
      ","
      ",'
      ','
      ',''+p.size+"",'','px',"
      ","
      ","
      ",'
      ','",'
      ','
      ',''+p.forecolor+"",'',"
      ","
      ",'
      ','
      ',''+p.backcolor+"",'',"
      ","
      ","
      ","
      "].join(""),g=s.cmd.range.createBookmark(),v=s.createDialog({name:d,width:500,title:s.lang("tablecell"),body:m,beforeRemove:function(){u.unbind()},yesBtn:{name:s.lang("yes"),click:function(t){var n=a.val(),i=o.val(),d=r.val(),h=heightTypeBox.val(),m=l.val(),v=c.val(),_=f.val()+"px",b=e(u[0]).val()||"",y=e(u[1]).val()||"",k=e(u[2]).val()||"";if(!/^\d*$/.test(n))return alert(s.lang("invalidWidth")),void a[0].focus();if(!/^\d*$/.test(i))return alert(s.lang("invalidHeight")),void o[0].focus();if(!/^\d*$/.test(_))return alert(p.invalidBoderWidth),void f[0].focus();for(var w=s.plugin.getAllSelectedCells(),C={width:""!==n?n+d:"",height:""!==i?i+h:"","background-color":k,"text-align":m,"border-width":_,"vertical-align":v,"border-color":b,color:y},S=0;S1?' rowspan="'+u.rowSpan+'"':"")+(u.colSpan>1?' colspan="'+u.colSpan+'"':"")+' style="'+(p?"background-color: #f1f1f1;":"")+"border: 1px solid "+(s.tableSetting&&s.tableSetting.borderColor||h)+'">'+(e.IE?" ":"
      ")+"",r=i(n,c,u)}s.cmd.range.selectNodeContents(o).collapse(!0),s.cmd.select(),s.addBookmark()},colinsertleft:function(){this.colinsert(0)},colinsertright:function(){this.colinsert(1)},rowinsert:function(t){var n=s.plugin.getSelectedTable()[0],i=s.plugin.getSelectedRow()[0],a=s.plugin.getSelectedCell()[0],o=i.rowIndex;1===t&&(o=i.rowIndex+(a.rowSpan-1)+t);for(var r=n.insertRow(o),l="THEAD"===r.parentNode.tagName,d=0,c=i.cells.length;d1&&(c-=i.cells[d].rowSpan-1);var u=r.insertCell(d);1===t&&i.cells[d].colSpan>1&&(u.colSpan=i.cells[d].colSpan),u.outerHTML="<"+(l?"th":"td")+(u.rowSpan>1?' rowspan="'+u.rowSpan+'"':"")+(u.colSpan>1?' colspan="'+u.colSpan+'"':"")+' style="'+(l?"background-color: #f1f1f1;":"")+"border: 1px solid "+(s.tableSetting&&s.tableSetting.borderColor||h)+'">'+(e.IE?" ":"
      ")+""}for(var p=o;p>=0;p--){var f=n.rows[p].cells;if(f.length>d){for(var m=a.cellIndex;m>=0;m--)f[m].rowSpan>1&&(f[m].rowSpan+=1);break}}s.cmd.range.selectNodeContents(a).collapse(!0),s.cmd.select(),s.addBookmark()},rowinsertabove:function(){this.rowinsert(0)},rowinsertbelow:function(){this.rowinsert(1)},rowmerge:function(){var e=s.plugin.getSelectedTable()[0],t=s.plugin.getSelectedRow()[0],n=s.plugin.getSelectedCell()[0],i=t.rowIndex,a=i+n.rowSpan,o=e.rows[a];if(!(e.rows.length<=a)){var r=n.cellIndex;if(!(o.cells.length<=r)){var l=o.cells[r];n.colSpan===l.colSpan&&(n.rowSpan+=l.rowSpan,o.deleteCell(r),s.cmd.range.selectNodeContents(n).collapse(!0),s.cmd.select(),s.addBookmark())}}},colmerge:function(){var e=(s.plugin.getSelectedTable()[0],s.plugin.getSelectedRow()[0]),t=s.plugin.getSelectedCell()[0],n=(e.rowIndex,t.cellIndex),i=n+1;if(!(e.cells.length<=i)){var a=e.cells[i];t.rowSpan===a.rowSpan&&(t.colSpan+=a.colSpan,e.deleteCell(i),s.cmd.range.selectNodeContents(t).collapse(!0),s.cmd.select(),s.addBookmark())}},mergeCells:function(){var e=s.tableSelectionRange;if(e){var t,n=s.plugin.getSelectedTable()[0],i=$(n),a=e.top,o=e.left,r=e.right,l=e.bottom;i.children("thead,tbody,tfoot").children("tr").each(function(){$(this).children("td,th").each(function(){var e=$(this),n=e.cellPos();n.left===o&&n.top===a?t=e:n.right>=o&&n.left<=r&&n.bottom>=a&&n.top<=l&&e.addClass("ke-cell-removed")})}),t&&(t.attr({rowspan:l-a+1,colspan:r-o+1}),i.find(".ke-cell-removed").remove(),s.cmd.range.selectNodeContents(t[0]).collapse(!0),s.cmd.select(),s.addBookmark())}},rowsplit:function(){var t=s.plugin.getSelectedTable()[0],n=s.plugin.getSelectedRow()[0],a=s.plugin.getSelectedCell()[0],o=n.rowIndex;if(1!==a.rowSpan){for(var r=i(t,n,a),l=1,d=a.rowSpan;l1?a.colSpan:u.colSpan;u.outerHTML="<"+(p?"th":"td")+(u.rowSpan>1?' rowspan="'+u.rowSpan+'"':"")+(f>1?' colspan="'+f+'"':"")+' style="'+(p?"background-color: #f1f1f1;":"")+"border: 1px solid "+(s.tableSetting&&s.tableSetting.borderColor||h)+'">'+(e.IE?" ":"
      ")+"",a.colSpan>1&&(u.colSpan=a.colSpan),r=i(t,c,u)}e(a).removeAttr("rowSpan"),s.cmd.range.selectNodeContents(a).collapse(!0),s.cmd.select(),s.addBookmark()}},colsplit:function(){var t=(s.plugin.getSelectedTable()[0],s.plugin.getSelectedRow()[0]),n=s.plugin.getSelectedCell()[0],i=n.cellIndex;if(1!==n.colSpan){for(var a="THEAD"===t.parentNode.tagName,o=1,r=n.colSpan;o1?n.rowSpan:l.rowSpan,c=l.colSpan;l.outerHTML="<"+(a?"th":"td")+(d>1?' rowspan="'+d+'"':"")+(c>1?' colspan="'+c+'"':"")+' style="'+(a?"background-color: #f1f1f1;":"")+"border: 1px solid "+(s.tableSetting&&s.tableSetting.borderColor||h)+'">'+(e.IE?" ":"
      ")+""}e(n).removeAttr("colSpan"),s.cmd.range.selectNodeContents(n).collapse(!0),s.cmd.select(),s.addBookmark()}},coldelete:function(){var t=s.plugin.getSelectedTable()[0],n=s.plugin.getAllSelectedCells();if(n.length){for(var i=0;i1?(u.colSpan-=1,1===u.colSpan&&e(u).removeAttr("colSpan")):c.deleteCell(r),u.rowSpan>1&&(l+=u.rowSpan-1)}if(0===o.cells.length){s.cmd.range.setStartBefore(t).collapse(!0),s.cmd.select(), +e(t).remove();break}}}t.parentNode&&s.cmd.selection(!0),s.addBookmark()}},rowdelete:function(){var t=s.plugin.getSelectedTable()[0],n=s.plugin.getAllSelectedCells();if(n.length){for(var i=0;i=0;r--)t.deleteRow(o.rowIndex+r)}0===t.rows.length?(s.cmd.range.setStartBefore(t).collapse(!0),s.cmd.select(),e(t).remove()):s.cmd.selection(!0),s.addBookmark()}}},s.plugin.getSelectedTable=function(){return e($(s.cmd.range.startContainer).closest("table")[0])},s.plugin.getSelectedRow=function(){return e($(s.cmd.range.startContainer).closest("tr")[0])},s.plugin.getSelectedCell=function(){return e($(s.cmd.range.startContainer).closest("td,th")[0])},s.plugin.getSelectedCells=function(){var t=s.plugin.getSelectedTable();if(t&&t.length){var n=e(".ke-select-cell",t.get(0));if(n&&n.length>1)return n}},s.plugin.getSingleSelectedCell=function(){var e=s.plugin.getSelectedCells();if(!(e&&e.length>1))return s.plugin.getSelectedCell()},s.plugin.getAllSelectedCells=function(){var e=s.plugin.getSelectedCells();return e&&e.length?e:s.plugin.getSelectedCell()};var m={mergeCells:"ke-icon-tablecolmerge"};e.each("prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,mergeCells,rowmerge,colmerge,rowsplit,colsplit,coldelete,rowdelete,delete".split(","),function(t,n){var i;i="prop"===n||"delete"===n?s.plugin.getSelectedTable:"mergeCells"===n?s.plugin.getSelectedCells:"rowmerge"===n?function(){var e=s.plugin.getSingleSelectedCell();if(e&&e.length&&$(e.get(0)).parent().next("tr").length)return e}:"colmerge"===n?function(){var e=s.plugin.getSingleSelectedCell();if(e&&e.length&&$(e.get(0)).next("th,td").length)return e}:"rowsplit"===n?function(){var e=s.plugin.getSingleSelectedCell();if(e&&e.get(0).rowSpan>1)return e}:"colsplit"===n?function(){var e=s.plugin.getSingleSelectedCell();if(e&&e.get(0).colSpan>1)return e}:e.inArray(n,["colinsertleft","colinsertright","rowinsertabove","rowinsertbelow"])>-1?s.plugin.getSingleSelectedCell:s.plugin.getSelectedCell,s.addContextmenu({title:p[n]||s.lang("table"+n),click:function(){s.loadPlugin("table",function(){s.plugin.table[n](),s.hideMenu()})},cond:i,width:170,iconClass:m[n]||"ke-icon-table"+n})})}s.clickToolbar(d,function(){if(!s.menu){var e=s.createMenu({name:d,beforeRemove:function(){a()}}),t=$('
      '),n=$('
      '+p.xRxC.format(0,0)+"
      ");t.append(n);var i=$('
      ');i.on("mouseenter.kTable",".ke-plugin-table-grid-cell",function(){var e=$(this),t=e.data("row"),a=e.data("col");n.text(p.xRxC.format(t,a));var o=i.find(".ke-plugin-table-grid-cell");o.each(function(){var e=$(this),n=e.data("row"),i=e.data("col");n<=t&&i<=a?e.css({border:"1px solid #2286d2",background:"#eff7ff"}):e.css({border:"1px solid #ddd",background:"#f1f1f1"})})}).on("click.kTable",".ke-plugin-table-grid-cell",function(e){var t=$(this),n=t.data("row"),i=t.data("col");r(n,i),s.hideMenu().focus(),s.addBookmark(),e.stopPropagation()});for(var o=1;o<11;o++)for(var l=1;l<11;l++)i.append('
      ');u.push(i),t.append(i),e.div.append(t[0])}}),s.afterTab(function(e){var t=s.plugin.getSelectedCell();if(t&&t.length){var n=function(e){if(e.length){var t=e.next();if(t.is("td,th")||(t=e.parent().next("tr").children("th,td").first()),t.is("td,th")||(t=e.closest("tbody,tfoot,thead").next().children("tr").first().children("th,td").first()),t.length)return s.cmd.range.selectNodeContents(t[0]).collapse(!0),s.cmd.select(),!0}return!1},i=$(t.get(0));if(i.length)return n(i)||(s.plugin.table.rowinsertbelow(),n(i)),!0}return e});var g=function(e,t,n){var i=n?Math.min(t.top,n.top):t.top,a=n?Math.min(t.left,n.left):t.left,o=n?Math.max(t.bottom,n.bottom):t.bottom,r=n?Math.max(t.right,n.right):t.right;if(i===o&&a===r)return!1;for(var l=!1,d=!1,c=e.children("thead,tbody,tfoot").children("tr").each(function(){$(this).children("td,th").each(function(){var e=$(this),t=e.cellPos();t.right>=a&&t.left<=r&&t.bottom>=i&&t.top<=o&&(i=Math.min(i,t.top),a=Math.min(a,t.left),o=Math.max(o,t.bottom),r=Math.max(r,t.right),e.addClass("ke-select-cell"),l=!0,d=!0)})});d;)d=!1,c.each(function(){$(this).children("td,th").each(function(){var e=$(this);if(!e.hasClass("ke-select-cell")){var t=e.cellPos();t.right>=a&&t.left<=r&&t.bottom>=i&&t.top<=o&&(i=Math.min(i,t.top),a=Math.min(a,t.left),o=Math.max(o,t.bottom),r=Math.max(r,t.right),e.addClass("ke-select-cell"),d=!0)}})});var u=e.find(".ke-select-cell");return 1===u.length&&(u.removeClass("ke-select-cell"),l=!1),l?s.tableSelectionRange={top:i,left:a,bottom:o,right:r}:s.tableSelectionRange=null,l},v=function(e,t){return g(e,{left:0,right:e.data("tableSize").width-1,top:t,bottom:t})},_=function(e,t){return g(e,{left:t,right:t,top:0,bottom:e.data("tableSize").height-1})};s.afterCreate(function(){var e=!1,t=null,n=null,i=null,a=null,o=function(){e=!1,t=null,a=null};$(s.edit.doc.body).on("mousedown.ke"+s.uuid,function(n){var a=$(n.target).closest("td,th"),o=a.closest("table"),r=!1;a.length&&o.length&&(t=o,e=!0,i=a.cellPos(!0),r=3===n.which,o.removeClass("ke-select-cells")),r||($(s.edit.doc).find(".ke-select-cell").removeClass("ke-select-cell"),s.tableSelectionRange=null)}).on("mousemove.ke"+s.uuid,function(o){var r=$(o.target).closest("td,th");if(!r.length)return e?o.preventDefault():null;var l=r.closest("table");if(!l.length)return e?o.preventDefault():null;if(l.removeClass("ke-select-row ke-select-col ke-select-cells"),a=r.cellPos(),e){if(l[0]!==t[0])return o.preventDefault();$(s.edit.doc).find("table").find(".ke-select-cell").removeClass("ke-select-cell"),g(l,i,a)&&(l.addClass("ke-select-cells"),o.preventDefault())}else{n=l;var d=l.offset(),c=o.pageX,u=o.pageY,p=c-d.left,h=u-d.top;p<8?(l.addClass("ke-select-row"),a.selectRow=a.top,delete a.selectCol,o.preventDefault(),o.stopPropagation()):h<8&&(l.addClass("ke-select-col"),a.selectCol=a.left,delete a.selectRow,o.preventDefault(),o.stopPropagation())}}).on("mouseup.ke"+s.uuid,function(e){var t=$(e.target),i=t.closest("td,th");i.length&&(a&&void 0!==a.selectRow?(v(n,a.selectRow),e.stopPropagation()):a&&void 0!==a.selectCol&&(_(n,a.selectCol),e.stopPropagation())),o()}).on("paste.ke"+s.uuid+" keydown.ke"+s.uuid,function(){$(s.edit.doc).find("table").removeClass("ke-select-row ke-select-col").find(".ke-select-cell").removeClass("ke-select-cell")}),$(document).on("mouseup.ke"+s.uuid,function(){o()}),$(s.edit.doc.head).append([""].join(""));var r=s.cmd.toggle,l=function(e,t,n){var i=this;return void 0!==n&&null!==n||(n=i.commonNode(t)),n?i.remove(t):i.wrap(e),i.select()},d=function(e,t,n){var i=s.cmd.range;if(i&&i.endContainer){var a=$(i.endContainer).closest("th,td");if(!a.length)return;var o=a.closest("table");if(!o.length)return;var r=o.children("thead,tbody,tfoot").children("tr").children(".ke-select-cell");if(r.length)return t&&t(a,o),r.each(e),n&&n(a,o),i.selectNodeContents(a[0]),s.cmd.select(),s.focus(),!0}};s.cmd.toggle=function(e,t){var n;if(!d(function(){s.cmd.range.selectNodeContents(this),s.cmd.select(),l.call(s.cmd,e,t,n)},function(e){s.cmd.range.selectNodeContents(e[0]),s.cmd.select(),n=!!s.cmd.commonNode(t)}))return r.call(s.cmd,e,t)};var c=",justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,",u=s.clickToolbar;s.clickToolbar=function(e,t){if(!(void 0===t&&c.indexOf(","+e+",")>-1&&d(function(){s.cmd.range.selectNode(this),s.cmd.select(),u.call(s,e,t)})))return u.call(s,e,t)}}),s.beforeRemove(function(){$(s.edit.doc.body).off(".ke"+s.uuid),$(document).off(".ke"+s.uuid)})}),KindEditor.lang({table:KindEditor.lang("table")}); \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/kindeditor/lang/.pydio b/dist/resources/static/js/lib/zui/lib/kindeditor/lang/.pydio new file mode 100644 index 0000000..0eed341 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/kindeditor/lang/.pydio @@ -0,0 +1 @@ +5e6572ed-1255-42d1-953a-87c5826e2359 \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/kindeditor/lang/en.js b/dist/resources/static/js/lib/zui/lib/kindeditor/lang/en.js new file mode 100644 index 0000000..39ce909 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/kindeditor/lang/en.js @@ -0,0 +1,232 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.lang({ + source : 'Source', + preview : 'Preview', + undo : 'Undo(Ctrl+Z)', + redo : 'Redo(Ctrl+Y)', + cut : 'Cut(Ctrl+X)', + copy : 'Copy(Ctrl+C)', + paste : 'Paste(Ctrl+V)', + plainpaste : 'Paste as plain text', + wordpaste : 'Paste from Word', + selectall : 'Select all', + justifyleft : 'Align left', + justifycenter : 'Align center', + justifyright : 'Align right', + justifyfull : 'Align full', + insertorderedlist : 'Ordered list', + insertunorderedlist : 'Unordered list', + indent : 'Increase indent', + outdent : 'Decrease indent', + subscript : 'Subscript', + superscript : 'Superscript', + formatblock : 'Paragraph format', + fontname : 'Font family', + fontsize : 'Font size', + forecolor : 'Text color', + hilitecolor : 'Highlight color', + bold : 'Bold(Ctrl+B)', + italic : 'Italic(Ctrl+I)', + underline : 'Underline(Ctrl+U)', + strikethrough : 'Strikethrough', + removeformat : 'Remove format', + image : 'Image', + multiimage : 'Multi image', + flash : 'Flash', + media : 'Embeded media', + table : 'Table', + tablecell : 'Cell', + hr : 'Insert horizontal line', + emoticons : 'Insert emoticon', + link : 'Link', + unlink : 'Unlink', + fullscreen : 'Toggle fullscreen mode', + about : 'About', + print : 'Print', + filemanager : 'File Manager', + code : 'Insert code', + map : 'Google Maps', + baidumap : 'Baidu Maps', + lineheight : 'Line height', + clearhtml : 'Clear HTML code', + pagebreak : 'Insert Page Break', + quickformat : 'Quick Format', + insertfile : 'Insert file', + template : 'Insert Template', + anchor : 'Anchor', + yes : 'OK', + no : 'Cancel', + close : 'Close', + editImage : 'Image properties', + deleteImage : 'Delete image', + editFlash : 'Flash properties', + deleteFlash : 'Delete flash', + editMedia : 'Media properties', + deleteMedia : 'Delete media', + editLink : 'Link properties', + deleteLink : 'Unlink', + tableprop : 'Table properties', + tablecellprop : 'Cell properties', + tableinsert : 'Insert table', + tabledelete : 'Delete table', + tablecolinsertleft : 'Insert column left', + tablecolinsertright : 'Insert column right', + tablerowinsertabove : 'Insert row above', + tablerowinsertbelow : 'Insert row below', + tablerowmerge : 'Merge down', + tablecolmerge : 'Merge right', + tablerowsplit : 'Split row', + tablecolsplit : 'Split column', + tablecoldelete : 'Delete column', + tablerowdelete : 'Delete row', + noColor : 'Default', + pleaseSelectFile : 'Please select file.', + invalidImg : "Please type valid URL.\nAllowed file extension: jpg,gif,bmp,png", + invalidMedia : "Please type valid URL.\nAllowed file extension: swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb", + invalidWidth : "The width must be number.", + invalidHeight : "The height must be number.", + invalidBorder : "The border must be number.", + invalidUrl : "Please type valid URL.", + invalidRows : 'Invalid rows.', + invalidCols : 'Invalid columns.', + invalidPadding : 'The padding must be number.', + invalidSpacing : 'The spacing must be number.', + invalidJson : 'Invalid JSON string.', + uploadSuccess : 'Upload success.', + cutError : 'Currently not supported by your browser, use keyboard shortcut(Ctrl+X) instead.', + copyError : 'Currently not supported by your browser, use keyboard shortcut(Ctrl+C) instead.', + pasteError : 'Currently not supported by your browser, use keyboard shortcut(Ctrl+V) instead.', + ajaxLoading : 'Loading ...', + uploadLoading : 'Uploading ...', + uploadError : 'Upload Error', + 'plainpaste.comment' : 'Use keyboard shortcut(Ctrl+V) to paste the text into the window.', + 'wordpaste.comment' : 'Use keyboard shortcut(Ctrl+V) to paste the text into the window.', + 'code.pleaseInput' : 'Please input code.', + 'link.url' : 'URL', + 'link.linkType' : 'Target', + 'link.newWindow' : 'New window', + 'link.selfWindow' : 'Same window', + 'flash.url' : 'URL', + 'flash.width' : 'Width', + 'flash.height' : 'Height', + 'flash.upload' : 'Upload', + 'flash.viewServer' : 'Browse', + 'media.url' : 'URL', + 'media.width' : 'Width', + 'media.height' : 'Height', + 'media.autostart' : 'Auto start', + 'media.upload' : 'Upload', + 'media.viewServer' : 'Browse', + 'image.remoteImage' : 'Insert URL', + 'image.localImage' : 'Upload', + 'image.remoteUrl' : 'URL', + 'image.localUrl' : 'File', + 'image.size' : 'Size', + 'image.width' : 'Width', + 'image.height' : 'Height', + 'image.resetSize' : 'Reset dimensions', + 'image.align' : 'Align', + 'image.defaultAlign' : 'Default', + 'image.leftAlign' : 'Left', + 'image.rightAlign' : 'Right', + 'image.imgTitle' : 'Title', + 'image.upload' : 'Browse', + 'image.viewServer' : 'Browse', + 'multiimage.uploadDesc' : 'Allows users to upload <%=uploadLimit%> images, single image size not exceeding <%=sizeLimit%>', + 'multiimage.startUpload' : 'Start upload', + 'multiimage.clearAll' : 'Clear all', + 'multiimage.insertAll' : 'Insert all', + 'multiimage.queueLimitExceeded' : 'Queue limit exceeded.', + 'multiimage.fileExceedsSizeLimit' : 'File exceeds size limit.', + 'multiimage.zeroByteFile' : 'Zero byte file.', + 'multiimage.invalidFiletype' : 'Invalid file type.', + 'multiimage.unknownError' : 'Unknown upload error.', + 'multiimage.pending' : 'Pending ...', + 'multiimage.uploadError' : 'Upload error', + 'filemanager.emptyFolder' : 'Blank', + 'filemanager.moveup' : 'Parent folder', + 'filemanager.viewType' : 'Display: ', + 'filemanager.viewImage' : 'Thumbnails', + 'filemanager.listImage' : 'List', + 'filemanager.orderType' : 'Sorting: ', + 'filemanager.fileName' : 'By name', + 'filemanager.fileSize' : 'By size', + 'filemanager.fileType' : 'By type', + 'insertfile.url' : 'URL', + 'insertfile.title' : 'Title', + 'insertfile.upload' : 'Upload', + 'insertfile.viewServer' : 'Browse', + 'table.cells' : 'Cells', + 'table.rows' : 'Rows', + 'table.cols' : 'Columns', + 'table.size' : 'Dimensions', + 'table.width' : 'Width', + 'table.height' : 'Height', + 'table.percent' : '%', + 'table.px' : 'px', + 'table.space' : 'Space', + 'table.padding' : 'Padding', + 'table.spacing' : 'Spacing', + 'table.align' : 'Align', + 'table.textAlign' : 'Horizontal', + 'table.verticalAlign' : 'Vertical', + 'table.alignDefault' : 'Default', + 'table.alignLeft' : 'Left', + 'table.alignCenter' : 'Center', + 'table.alignRight' : 'Right', + 'table.alignTop' : 'Top', + 'table.alignMiddle' : 'Middle', + 'table.alignBottom' : 'Bottom', + 'table.alignBaseline' : 'Baseline', + 'table.border' : 'Border', + 'table.borderWidth' : 'Width', + 'table.borderColor' : 'Color', + 'table.backgroundColor' : 'Background', + 'map.address' : 'Address: ', + 'map.search' : 'Search', + 'baidumap.address' : 'Address: ', + 'baidumap.search' : 'Search', + 'baidumap.insertDynamicMap' : 'Dynamic Map', + 'anchor.name' : 'Anchor name', + 'formatblock.formatBlock' : { + h1 : 'Heading 1', + h2 : 'Heading 2', + h3 : 'Heading 3', + h4 : 'Heading 4', + p : 'Normal' + }, + 'fontname.fontName' : { + 'Arial' : 'Arial', + 'Arial Black' : 'Arial Black', + 'Comic Sans MS' : 'Comic Sans MS', + 'Courier New' : 'Courier New', + 'Garamond' : 'Garamond', + 'Georgia' : 'Georgia', + 'Tahoma' : 'Tahoma', + 'Times New Roman' : 'Times New Roman', + 'Trebuchet MS' : 'Trebuchet MS', + 'Verdana' : 'Verdana' + }, + 'lineheight.lineHeight' : [ + {'1' : 'Line height 1'}, + {'1.5' : 'Line height 1.5'}, + {'2' : 'Line height 2'}, + {'2.5' : 'Line height 2.5'}, + {'3' : 'Line height 3'} + ], + 'template.selectTemplate' : 'Template', + 'template.replaceContent' : 'Replace current content', + 'template.fileList' : { + '1.html' : 'Image and Text', + '2.html' : 'Table', + '3.html' : 'List' + } +}, 'en'); diff --git a/dist/resources/static/js/lib/zui/lib/kindeditor/lang/zh_CN.js b/dist/resources/static/js/lib/zui/lib/kindeditor/lang/zh_CN.js new file mode 100644 index 0000000..c159965 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/kindeditor/lang/zh_CN.js @@ -0,0 +1,238 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.lang({ + source : 'HTML代码', + preview : '预览', + undo : '后退(Ctrl+Z)', + redo : '前进(Ctrl+Y)', + cut : '剪切(Ctrl+X)', + copy : '复制(Ctrl+C)', + paste : '粘贴(Ctrl+V)', + plainpaste : '粘贴为无格式文本', + wordpaste : '从Word粘贴', + selectall : '全选(Ctrl+A)', + justifyleft : '左对齐', + justifycenter : '居中', + justifyright : '右对齐', + justifyfull : '两端对齐', + insertorderedlist : '编号', + insertunorderedlist : '项目符号', + indent : '增加缩进', + outdent : '减少缩进', + subscript : '下标', + superscript : '上标', + formatblock : '段落', + fontname : '字体', + fontsize : '文字大小', + forecolor : '文字颜色', + hilitecolor : '文字背景', + bold : '粗体(Ctrl+B)', + italic : '斜体(Ctrl+I)', + underline : '下划线(Ctrl+U)', + strikethrough : '删除线', + removeformat : '删除格式', + image : '图片', + multiimage : '批量图片上传', + flash : 'Flash', + media : '视音频', + table : '表格', + tablecell : '单元格', + hr : '插入横线', + emoticons : '插入表情', + link : '超级链接', + unlink : '取消超级链接', + fullscreen : '全屏显示', + about : '关于', + print : '打印(Ctrl+P)', + filemanager : '文件空间', + code : '插入程序代码', + map : 'Google地图', + baidumap : '百度地图', + lineheight : '行距', + clearhtml : '清理HTML代码', + pagebreak : '插入分页符', + quickformat : '一键排版', + insertfile : '插入文件', + template : '插入模板', + anchor : '锚点', + yes : '确定', + no : '取消', + close : '关闭', + editImage : '图片属性', + deleteImage : '删除图片', + editFlash : 'Flash属性', + deleteFlash : '删除Flash', + editMedia : '视音频属性', + deleteMedia : '删除视音频', + editLink : '超级链接属性', + deleteLink : '取消超级链接', + editAnchor : '锚点属性', + deleteAnchor : '删除锚点', + tableprop : '表格属性', + tablecellprop : '单元格属性', + tableinsert : '插入表格', + tabledelete : '删除表格', + tablecolinsertleft : '左侧插入列', + tablecolinsertright : '右侧插入列', + tablerowinsertabove : '上方插入行', + tablerowinsertbelow : '下方插入行', + tablerowmerge : '向下合并单元格', + tablecolmerge : '向右合并单元格', + tablerowsplit : '拆分行', + tablecolsplit : '拆分列', + tablecoldelete : '删除列', + tablerowdelete : '删除行', + noColor : '无颜色', + pleaseSelectFile : '请选择文件。', + invalidImg : "请输入有效的URL地址。\n只允许jpg,gif,bmp,png格式。", + invalidMedia : "请输入有效的URL地址。\n只允许swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb格式。", + invalidWidth : "宽度必须为数字。", + invalidHeight : "高度必须为数字。", + invalidBorder : "边框必须为数字。", + invalidUrl : "请输入有效的URL地址。", + invalidRows : '行数为必选项,只允许输入大于0的数字。', + invalidCols : '列数为必选项,只允许输入大于0的数字。', + invalidPadding : '边距必须为数字。', + invalidSpacing : '间距必须为数字。', + invalidJson : '服务器发生故障。', + uploadSuccess : '上传成功。', + cutError : '您的浏览器安全设置不允许使用剪切操作,请使用快捷键(Ctrl+X)来完成。', + copyError : '您的浏览器安全设置不允许使用复制操作,请使用快捷键(Ctrl+C)来完成。', + pasteError : '您的浏览器安全设置不允许使用粘贴操作,请使用快捷键(Ctrl+V)来完成。', + ajaxLoading : '加载中,请稍候 ...', + uploadLoading : '上传中,请稍候 ...', + uploadError : '上传错误', + 'plainpaste.comment' : '请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。', + 'wordpaste.comment' : '请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。', + 'code.pleaseInput' : '请输入程序代码。', + 'link.url' : 'URL', + 'link.linkType' : '打开类型', + 'link.newWindow' : '新窗口', + 'link.selfWindow' : '当前窗口', + 'flash.url' : 'URL', + 'flash.width' : '宽度', + 'flash.height' : '高度', + 'flash.upload' : '上传', + 'flash.viewServer' : '文件空间', + 'media.url' : 'URL', + 'media.width' : '宽度', + 'media.height' : '高度', + 'media.autostart' : '自动播放', + 'media.upload' : '上传', + 'media.viewServer' : '文件空间', + 'image.remoteImage' : '网络图片', + 'image.localImage' : '本地上传', + 'image.remoteUrl' : '图片地址', + 'image.localUrl' : '上传文件', + 'image.size' : '图片大小', + 'image.width' : '宽', + 'image.height' : '高', + 'image.resetSize' : '重置大小', + 'image.align' : '对齐方式', + 'image.defaultAlign' : '默认方式', + 'image.leftAlign' : '左对齐', + 'image.rightAlign' : '右对齐', + 'image.imgTitle' : '图片说明', + 'image.upload' : '浏览...', + 'image.viewServer' : '图片空间', + 'multiimage.uploadDesc' : '允许用户同时上传<%=uploadLimit%>张图片,单张图片容量不超过<%=sizeLimit%>', + 'multiimage.startUpload' : '开始上传', + 'multiimage.clearAll' : '全部清空', + 'multiimage.insertAll' : '全部插入', + 'multiimage.queueLimitExceeded' : '文件数量超过限制。', + 'multiimage.fileExceedsSizeLimit' : '文件大小超过限制。', + 'multiimage.zeroByteFile' : '无法上传空文件。', + 'multiimage.invalidFiletype' : '文件类型不正确。', + 'multiimage.unknownError' : '发生异常,无法上传。', + 'multiimage.pending' : '等待上传', + 'multiimage.uploadError' : '上传失败', + 'filemanager.emptyFolder' : '空文件夹', + 'filemanager.moveup' : '移到上一级文件夹', + 'filemanager.viewType' : '显示方式:', + 'filemanager.viewImage' : '缩略图', + 'filemanager.listImage' : '详细信息', + 'filemanager.orderType' : '排序方式:', + 'filemanager.fileName' : '名称', + 'filemanager.fileSize' : '大小', + 'filemanager.fileType' : '类型', + 'insertfile.url' : 'URL', + 'insertfile.title' : '文件说明', + 'insertfile.upload' : '上传', + 'insertfile.viewServer' : '文件空间', + 'table.cells' : '单元格数', + 'table.rows' : '行数', + 'table.cols' : '列数', + 'table.size' : '大小', + 'table.width' : '宽度', + 'table.height' : '高度', + 'table.percent' : '%', + 'table.px' : 'px', + 'table.space' : '边距间距', + 'table.padding' : '边距', + 'table.spacing' : '间距', + 'table.align' : '对齐方式', + 'table.textAlign' : '水平对齐', + 'table.verticalAlign' : '垂直对齐', + 'table.alignDefault' : '默认', + 'table.alignLeft' : '左对齐', + 'table.alignCenter' : '居中', + 'table.alignRight' : '右对齐', + 'table.alignTop' : '顶部', + 'table.alignMiddle' : '中部', + 'table.alignBottom' : '底部', + 'table.alignBaseline' : '基线', + 'table.border' : '边框', + 'table.borderWidth' : '边框', + 'table.borderColor' : '颜色', + 'table.backgroundColor' : '背景颜色', + 'map.address' : '地址: ', + 'map.search' : '搜索', + 'baidumap.address' : '地址: ', + 'baidumap.search' : '搜索', + 'baidumap.insertDynamicMap' : '插入动态地图', + 'anchor.name' : '锚点名称', + 'formatblock.formatBlock' : { + h1 : '标题 1', + h2 : '标题 2', + h3 : '标题 3', + h4 : '标题 4', + p : '正 文' + }, + 'fontname.fontName' : { + 'SimSun' : '宋体', + 'NSimSun' : '新宋体', + 'FangSong_GB2312' : '仿宋_GB2312', + 'KaiTi_GB2312' : '楷体_GB2312', + 'SimHei' : '黑体', + 'Source Han Sans': '思源黑体', + 'Source Han Serif': '思源宋体', + 'Microsoft YaHei' : '微软雅黑', + 'Arial' : 'Arial', + 'Arial Black' : 'Arial Black', + 'Times New Roman' : 'Times New Roman', + 'Courier New' : 'Courier New', + 'Tahoma' : 'Tahoma', + 'Verdana' : 'Verdana' + }, + 'lineheight.lineHeight' : [ + {'1' : '单倍行距'}, + {'1.5' : '1.5倍行距'}, + {'2' : '2倍行距'}, + {'2.5' : '2.5倍行距'}, + {'3' : '3倍行距'} + ], + 'template.selectTemplate' : '可选模板', + 'template.replaceContent' : '替换当前内容', + 'template.fileList' : { + '1.html' : '图片和文字', + '2.html' : '表格', + '3.html' : '项目编号' + } +}, 'zh_CN'); diff --git a/dist/resources/static/js/lib/zui/lib/kindeditor/lang/zh_TW.js b/dist/resources/static/js/lib/zui/lib/kindeditor/lang/zh_TW.js new file mode 100644 index 0000000..ceac2af --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/kindeditor/lang/zh_TW.js @@ -0,0 +1,235 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.lang({ + source : '原始碼', + preview : '預覽', + undo : '復原(Ctrl+Z)', + redo : '重複(Ctrl+Y)', + cut : '剪下(Ctrl+X)', + copy : '複製(Ctrl+C)', + paste : '貼上(Ctrl+V)', + plainpaste : '貼為純文字格式', + wordpaste : '自Word貼上', + selectall : '全選(Ctrl+A)', + justifyleft : '靠左對齊', + justifycenter : '置中', + justifyright : '靠右對齊', + justifyfull : '左右對齊', + insertorderedlist : '編號清單', + insertunorderedlist : '項目清單', + indent : '增加縮排', + outdent : '減少縮排', + subscript : '下標', + superscript : '上標', + formatblock : '標題', + fontname : '字體', + fontsize : '文字大小', + forecolor : '文字顏色', + hilitecolor : '背景顏色', + bold : '粗體(Ctrl+B)', + italic : '斜體(Ctrl+I)', + underline : '底線(Ctrl+U)', + strikethrough : '刪除線', + removeformat : '清除格式', + image : '影像', + multiimage : '批量影像上傳', + flash : 'Flash', + media : '多媒體', + table : '表格', + hr : '插入水平線', + emoticons : '插入表情', + link : '超連結', + unlink : '移除超連結', + fullscreen : '最大化', + about : '關於', + print : '列印(Ctrl+P)', + fileManager : '瀏覽伺服器', + code : '插入程式代碼', + map : 'Google地圖', + baidumap : 'Baidu地圖', + lineheight : '行距', + clearhtml : '清理HTML代碼', + pagebreak : '插入分頁符號', + quickformat : '快速排版', + insertfile : '插入文件', + template : '插入樣板', + anchor : '錨點', + yes : '確定', + no : '取消', + close : '關閉', + editImage : '影像屬性', + deleteImage : '刪除影像', + editFlash : 'Flash屬性', + deleteFlash : '删除Flash', + editMedia : '多媒體屬性', + deleteMedia : '删除多媒體', + editLink : '超連結屬性', + deleteLink : '移除超連結', + tableprop : '表格屬性', + tablecellprop : '儲存格屬性', + tableinsert : '插入表格', + tabledelete : '刪除表格', + tablecolinsertleft : '向左插入列', + tablecolinsertright : '向右插入列', + tablerowinsertabove : '向上插入欄', + tablerowinsertbelow : '下方插入欄', + tablerowmerge : '向下合併單元格', + tablecolmerge : '向右合併單元格', + tablerowsplit : '分割欄', + tablecolsplit : '分割列', + tablecoldelete : '删除列', + tablerowdelete : '删除欄', + noColor : '自動', + pleaseSelectFile : '請選擇文件。', + invalidImg : "請輸入有效的URL。\n只允許jpg,gif,bmp,png格式。", + invalidMedia : "請輸入有效的URL。\n只允許swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb格式。", + invalidWidth : "寬度必須是數字。", + invalidHeight : "高度必須是數字。", + invalidBorder : "邊框必須是數字。", + invalidUrl : "請輸入有效的URL。", + invalidRows : '欄數是必須輸入項目,只允許輸入大於0的數字。', + invalidCols : '列數是必須輸入項目,只允許輸入大於0的數字。', + invalidPadding : '內距必須是數字。', + invalidSpacing : '間距必須是數字。', + invalidBorder : '边框必须为数字。', + pleaseInput : "請輸入內容。", + invalidJson : '伺服器發生故障。', + uploadSuccess : '上傳成功。', + cutError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+X)完成。', + copyError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+C)完成。', + pasteError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+V)完成。', + ajaxLoading : '加載中,請稍候 ...', + uploadLoading : '上傳中,請稍候 ...', + uploadError : '上傳錯誤', + 'plainpaste.comment' : '請使用快捷鍵(Ctrl+V)把內容貼到下方區域裡。', + 'wordpaste.comment' : '請使用快捷鍵(Ctrl+V)把內容貼到下方區域裡。', + 'code.pleaseInput' : 'Please input code.', + 'link.url' : 'URL', + 'link.linkType' : '打開類型', + 'link.newWindow' : '新窗口', + 'link.selfWindow' : '本頁窗口', + 'flash.url' : 'URL', + 'flash.width' : '寬度', + 'flash.height' : '高度', + 'flash.upload' : '上傳', + 'flash.viewServer' : '瀏覽', + 'media.url' : 'URL', + 'media.width' : '寬度', + 'media.height' : '高度', + 'media.autostart' : '自動播放', + 'media.upload' : '上傳', + 'media.viewServer' : '瀏覽', + 'image.remoteImage' : '網絡影像', + 'image.localImage' : '上傳影像', + 'image.remoteUrl' : '影像URL', + 'image.localUrl' : '影像URL', + 'image.size' : '影像大小', + 'image.width' : '寬度', + 'image.height' : '高度', + 'image.resetSize' : '原始大小', + 'image.align' : '對齊方式', + 'image.defaultAlign' : '未設定', + 'image.leftAlign' : '向左對齊', + 'image.rightAlign' : '向右對齊', + 'image.imgTitle' : '影像說明', + 'image.upload' : '瀏覽...', + 'image.viewServer' : '瀏覽...', + 'multiimage.uploadDesc' : 'Allows users to upload <%=uploadLimit%> images, single image size not exceeding <%=sizeLimit%>', + 'multiimage.startUpload' : 'Start upload', + 'multiimage.clearAll' : 'Clear all', + 'multiimage.insertAll' : 'Insert all', + 'multiimage.queueLimitExceeded' : 'Queue limit exceeded.', + 'multiimage.fileExceedsSizeLimit' : 'File exceeds size limit.', + 'multiimage.zeroByteFile' : 'Zero byte file.', + 'multiimage.invalidFiletype' : 'Invalid file type.', + 'multiimage.unknownError' : 'Unknown upload error.', + 'multiimage.pending' : 'Pending ...', + 'multiimage.uploadError' : 'Upload error', + 'filemanager.emptyFolder' : '空文件夾', + 'filemanager.moveup' : '至上一級文件夾', + 'filemanager.viewType' : '顯示方式:', + 'filemanager.viewImage' : '縮略圖', + 'filemanager.listImage' : '詳細信息', + 'filemanager.orderType' : '排序方式:', + 'filemanager.fileName' : '名稱', + 'filemanager.fileSize' : '大小', + 'filemanager.fileType' : '類型', + 'insertfile.url' : 'URL', + 'insertfile.title' : '文件說明', + 'insertfile.upload' : '上傳', + 'insertfile.viewServer' : '瀏覽', + 'table.cells' : '儲存格數', + 'table.rows' : '欄數', + 'table.cols' : '列數', + 'table.size' : '表格大小', + 'table.width' : '寬度', + 'table.height' : '高度', + 'table.percent' : '%', + 'table.px' : 'px', + 'table.space' : '內距間距', + 'table.padding' : '內距', + 'table.spacing' : '間距', + 'table.align' : '對齊方式', + 'table.textAlign' : '水平對齊', + 'table.verticalAlign' : '垂直對齊', + 'table.alignDefault' : '未設定', + 'table.alignLeft' : '向左對齊', + 'table.alignCenter' : '置中', + 'table.alignRight' : '向右對齊', + 'table.alignTop' : '靠上', + 'table.alignMiddle' : '置中', + 'table.alignBottom' : '靠下', + 'table.alignBaseline' : '基線', + 'table.border' : '表格邊框', + 'table.borderWidth' : '邊框', + 'table.borderColor' : '顏色', + 'table.backgroundColor' : '背景顏色', + 'map.address' : '住所: ', + 'map.search' : '尋找', + 'baidumap.address' : '住所: ', + 'baidumap.search' : '尋找', + 'baidumap.insertDynamicMap' : '插入動態地圖', + 'anchor.name' : '錨點名稱', + 'formatblock.formatBlock' : { + h1 : '標題 1', + h2 : '標題 2', + h3 : '標題 3', + h4 : '標題 4', + p : '一般' + }, + 'fontname.fontName' : { + 'MingLiU' : '細明體', + 'PMingLiU' : '新細明體', + 'DFKai-SB' : '標楷體', + 'SimSun' : '宋體', + 'NSimSun' : '新宋體', + 'FangSong' : '仿宋體', + 'Arial' : 'Arial', + 'Arial Black' : 'Arial Black', + 'Times New Roman' : 'Times New Roman', + 'Courier New' : 'Courier New', + 'Tahoma' : 'Tahoma', + 'Verdana' : 'Verdana' + }, + 'lineheight.lineHeight' : [ + {'1' : '单倍行距'}, + {'1.5' : '1.5倍行距'}, + {'2' : '2倍行距'}, + {'2.5' : '2.5倍行距'}, + {'3' : '3倍行距'} + ], + 'template.selectTemplate' : '可選樣板', + 'template.replaceContent' : '取代當前內容', + 'template.fileList' : { + '1.html' : '影像和文字', + '2.html' : '表格', + '3.html' : '项目清單' + } +}, 'zh_TW'); diff --git a/dist/resources/static/js/lib/zui/lib/kindeditor/plugins.zip b/dist/resources/static/js/lib/zui/lib/kindeditor/plugins.zip new file mode 100644 index 0000000..c7073f1 Binary files /dev/null and b/dist/resources/static/js/lib/zui/lib/kindeditor/plugins.zip differ diff --git a/dist/resources/static/js/lib/zui/lib/kindeditor/themes/.pydio b/dist/resources/static/js/lib/zui/lib/kindeditor/themes/.pydio new file mode 100644 index 0000000..18f524e --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/kindeditor/themes/.pydio @@ -0,0 +1 @@ +52d1afad-e43d-4560-b50c-42ff824f2aeb \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/kindeditor/themes/default/.pydio b/dist/resources/static/js/lib/zui/lib/kindeditor/themes/default/.pydio new file mode 100644 index 0000000..d77fcd7 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/kindeditor/themes/default/.pydio @@ -0,0 +1 @@ +0df4bd0f-6c55-473e-b913-cd31b063d812 \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/kindeditor/themes/default/default.png b/dist/resources/static/js/lib/zui/lib/kindeditor/themes/default/default.png new file mode 100644 index 0000000..3e40ec3 Binary files /dev/null and b/dist/resources/static/js/lib/zui/lib/kindeditor/themes/default/default.png differ diff --git a/dist/resources/static/js/lib/zui/lib/markdoc/.pydio b/dist/resources/static/js/lib/zui/lib/markdoc/.pydio new file mode 100644 index 0000000..a22382a --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/markdoc/.pydio @@ -0,0 +1 @@ +8625d1a5-9cd8-4ccc-ac74-10bc6c12d5a0 \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.js b/dist/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.js new file mode 100644 index 0000000..5620c8c --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.js @@ -0,0 +1,1427 @@ +/*! + * ZUI: Markdown 文档生成器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/** + * marked - a markdown parser + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + */ + +;(function() { + +/** + * Block-Level Grammar + */ + +var block = { + newline: /^\n+/, + code: /^( {4}[^\n]+\n*)+/, + fences: noop, + hr: /^( *[-*_]){3,} *(?:\n+|$)/, + heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, + nptable: noop, + lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, + blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, + list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, + def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, + table: noop, + paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, + text: /^[^\n]+/ +}; + +block.bullet = /(?:[*+-]|\d+\.)/; +block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; +block.item = replace(block.item, 'gm') + (/bull/g, block.bullet) + (); + +block.list = replace(block.list) + (/bull/g, block.bullet) + ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') + ('def', '\\n+(?=' + block.def.source + ')') + (); + +block.blockquote = replace(block.blockquote) + ('def', block.def) + (); + +block._tag = '(?!(?:' + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; + +block.html = replace(block.html) + ('comment', //) + ('closed', /<(tag)[\s\S]+?<\/\1>/) + ('closing', /])*?>/) + (/tag/g, block._tag) + (); + +block.paragraph = replace(block.paragraph) + ('hr', block.hr) + ('heading', block.heading) + ('lheading', block.lheading) + ('blockquote', block.blockquote) + ('tag', '<' + block._tag) + ('def', block.def) + (); + +/** + * Normal Block Grammar + */ + +block.normal = merge({}, block); + +/** + * GFM Block Grammar + */ + +block.gfm = merge({}, block.normal, { + fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/, + paragraph: /^/, + heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ +}); + +block.gfm.paragraph = replace(block.paragraph) + ('(?!', '(?!' + + block.gfm.fences.source.replace('\\1', '\\2') + '|' + + block.list.source.replace('\\1', '\\3') + '|') + (); + +/** + * GFM + Tables Block Grammar + */ + +block.tables = merge({}, block.gfm, { + nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, + table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ +}); + +/** + * Block Lexer + */ + +function Lexer(options) { + this.tokens = []; + this.tokens.links = {}; + this.options = options || marked.defaults; + this.rules = block.normal; + + if (this.options.gfm) { + if (this.options.tables) { + this.rules = block.tables; + } else { + this.rules = block.gfm; + } + } +} + +/** + * Expose Block Rules + */ + +Lexer.rules = block; + +/** + * Static Lex Method + */ + +Lexer.lex = function(src, options) { + var lexer = new Lexer(options); + return lexer.lex(src); +}; + +/** + * Preprocessing + */ + +Lexer.prototype.lex = function(src) { + src = src + .replace(/\r\n|\r/g, '\n') + .replace(/\t/g, ' ') + .replace(/\u00a0/g, ' ') + .replace(/\u2424/g, '\n'); + + return this.token(src, true); +}; + +/** + * Lexing + */ + +Lexer.prototype.token = function(src, top, bq) { + var src = src.replace(/^ +$/gm, '') + , next + , loose + , cap + , bull + , b + , item + , space + , i + , l; + + while (src) { + // newline + if (cap = this.rules.newline.exec(src)) { + src = src.substring(cap[0].length); + if (cap[0].length > 1) { + this.tokens.push({ + type: 'space' + }); + } + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + cap = cap[0].replace(/^ {4}/gm, ''); + this.tokens.push({ + type: 'code', + text: !this.options.pedantic + ? cap.replace(/\n+$/, '') + : cap + }); + continue; + } + + // fences (gfm) + if (cap = this.rules.fences.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'code', + lang: cap[2], + text: cap[3] || '' + }); + continue; + } + + // heading + if (cap = this.rules.heading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[1].length, + text: cap[2] + }); + continue; + } + + // table no leading pipe (gfm) + if (top && (cap = this.rules.nptable.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i].split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + + // lheading + if (cap = this.rules.lheading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[2] === '=' ? 1 : 2, + text: cap[1] + }); + continue; + } + + // hr + if (cap = this.rules.hr.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'hr' + }); + continue; + } + + // blockquote + if (cap = this.rules.blockquote.exec(src)) { + src = src.substring(cap[0].length); + + this.tokens.push({ + type: 'blockquote_start' + }); + + cap = cap[0].replace(/^ *> ?/gm, ''); + + // Pass `top` to keep the current + // "toplevel" state. This is exactly + // how markdown.pl works. + this.token(cap, top, true); + + this.tokens.push({ + type: 'blockquote_end' + }); + + continue; + } + + // list + if (cap = this.rules.list.exec(src)) { + src = src.substring(cap[0].length); + bull = cap[2]; + + this.tokens.push({ + type: 'list_start', + ordered: bull.length > 1 + }); + + // Get each top-level item. + cap = cap[0].match(this.rules.item); + + next = false; + l = cap.length; + i = 0; + + for (; i < l; i++) { + item = cap[i]; + + // Remove the list item's bullet + // so it is seen as the next token. + space = item.length; + item = item.replace(/^ *([*+-]|\d+\.) +/, ''); + + // Outdent whatever the + // list item contains. Hacky. + if (~item.indexOf('\n ')) { + space -= item.length; + item = !this.options.pedantic + ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') + : item.replace(/^ {1,4}/gm, ''); + } + + // Determine whether the next list item belongs here. + // Backpedal if it does not belong in this list. + if (this.options.smartLists && i !== l - 1) { + b = block.bullet.exec(cap[i + 1])[0]; + if (bull !== b && !(bull.length > 1 && b.length > 1)) { + src = cap.slice(i + 1).join('\n') + src; + i = l - 1; + } + } + + // Determine whether item is loose or not. + // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ + // for discount behavior. + loose = next || /\n\n(?!\s*$)/.test(item); + if (i !== l - 1) { + next = item.charAt(item.length - 1) === '\n'; + if (!loose) loose = next; + } + + this.tokens.push({ + type: loose + ? 'loose_item_start' + : 'list_item_start' + }); + + // Recurse. + this.token(item, false, bq); + + this.tokens.push({ + type: 'list_item_end' + }); + } + + this.tokens.push({ + type: 'list_end' + }); + + continue; + } + + // html + if (cap = this.rules.html.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: this.options.sanitize + ? 'paragraph' + : 'html', + pre: !this.options.sanitizer + && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), + text: cap[0] + }); + continue; + } + + // def + if ((!bq && top) && (cap = this.rules.def.exec(src))) { + src = src.substring(cap[0].length); + this.tokens.links[cap[1].toLowerCase()] = { + href: cap[2], + title: cap[3] + }; + continue; + } + + // table (gfm) + if (top && (cap = this.rules.table.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i] + .replace(/^ *\| *| *\| *$/g, '') + .split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + + // top-level paragraph + if (top && (cap = this.rules.paragraph.exec(src))) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'paragraph', + text: cap[1].charAt(cap[1].length - 1) === '\n' + ? cap[1].slice(0, -1) + : cap[1] + }); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + // Top-level should never reach here. + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'text', + text: cap[0] + }); + continue; + } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return this.tokens; +}; + +/** + * Inline-Level Grammar + */ + +var inline = { + escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, + autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, + url: noop, + tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, + link: /^!?\[(inside)\]\(href\)/, + reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, + nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, + strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, + em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, + code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, + br: /^ {2,}\n(?!\s*$)/, + del: noop, + text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; + +inline.link = replace(inline.link) + ('inside', inline._inside) + ('href', inline._href) + (); + +inline.reflink = replace(inline.reflink) + ('inside', inline._inside) + (); + +/** + * Normal Inline Grammar + */ + +inline.normal = merge({}, inline); + +/** + * Pedantic Inline Grammar + */ + +inline.pedantic = merge({}, inline.normal, { + strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, + em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ +}); + +/** + * GFM Inline Grammar + */ + +inline.gfm = merge({}, inline.normal, { + escape: replace(inline.escape)('])', '~|])')(), + url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, + del: /^~~(?=\S)([\s\S]*?\S)~~/, + text: replace(inline.text) + (']|', '~]|') + ('|', '|https?://|') + () +}); + +/** + * GFM + Line Breaks Inline Grammar + */ + +inline.breaks = merge({}, inline.gfm, { + br: replace(inline.br)('{2,}', '*')(), + text: replace(inline.gfm.text)('{2,}', '*')() +}); + +/** + * Inline Lexer & Compiler + */ + +function InlineLexer(links, options) { + this.options = options || marked.defaults; + this.links = links; + this.rules = inline.normal; + this.renderer = this.options.renderer || new Renderer; + this.renderer.options = this.options; + + if (!this.links) { + throw new + Error('Tokens array requires a `links` property.'); + } + + if (this.options.gfm) { + if (this.options.breaks) { + this.rules = inline.breaks; + } else { + this.rules = inline.gfm; + } + } else if (this.options.pedantic) { + this.rules = inline.pedantic; + } +} + +/** + * Expose Inline Rules + */ + +InlineLexer.rules = inline; + +/** + * Static Lexing/Compiling Method + */ + +InlineLexer.output = function(src, links, options) { + var inline = new InlineLexer(links, options); + return inline.output(src); +}; + +/** + * Lexing/Compiling + */ + +InlineLexer.prototype.output = function(src) { + var out = '' + , link + , text + , href + , cap; + + while (src) { + // escape + if (cap = this.rules.escape.exec(src)) { + src = src.substring(cap[0].length); + out += cap[1]; + continue; + } + + // autolink + if (cap = this.rules.autolink.exec(src)) { + src = src.substring(cap[0].length); + if (cap[2] === '@') { + text = cap[1].charAt(6) === ':' + ? this.mangle(cap[1].substring(7)) + : this.mangle(cap[1]); + href = this.mangle('mailto:') + text; + } else { + text = escape(cap[1]); + href = text; + } + out += this.renderer.link(href, null, text); + continue; + } + + // url (gfm) + if (!this.inLink && (cap = this.rules.url.exec(src))) { + src = src.substring(cap[0].length); + text = escape(cap[1]); + href = text; + out += this.renderer.link(href, null, text); + continue; + } + + // tag + if (cap = this.rules.tag.exec(src)) { + if (!this.inLink && /^/i.test(cap[0])) { + this.inLink = false; + } + src = src.substring(cap[0].length); + out += this.options.sanitize + ? this.options.sanitizer + ? this.options.sanitizer(cap[0]) + : escape(cap[0]) + : cap[0] + continue; + } + + // link + if (cap = this.rules.link.exec(src)) { + src = src.substring(cap[0].length); + this.inLink = true; + out += this.outputLink(cap, { + href: cap[2], + title: cap[3] + }); + this.inLink = false; + continue; + } + + // reflink, nolink + if ((cap = this.rules.reflink.exec(src)) + || (cap = this.rules.nolink.exec(src))) { + src = src.substring(cap[0].length); + link = (cap[2] || cap[1]).replace(/\s+/g, ' '); + link = this.links[link.toLowerCase()]; + if (!link || !link.href) { + out += cap[0].charAt(0); + src = cap[0].substring(1) + src; + continue; + } + this.inLink = true; + out += this.outputLink(cap, link); + this.inLink = false; + continue; + } + + // strong + if (cap = this.rules.strong.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.strong(this.output(cap[2] || cap[1])); + continue; + } + + // em + if (cap = this.rules.em.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.em(this.output(cap[2] || cap[1])); + continue; + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.codespan(escape(cap[2], true)); + continue; + } + + // br + if (cap = this.rules.br.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.br(); + continue; + } + + // del (gfm) + if (cap = this.rules.del.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.del(this.output(cap[1])); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.text(escape(this.smartypants(cap[0]))); + continue; + } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return out; +}; + +/** + * Compile Link + */ + +InlineLexer.prototype.outputLink = function(cap, link) { + var href = escape(link.href) + , title = link.title ? escape(link.title) : null; + + return cap[0].charAt(0) !== '!' + ? this.renderer.link(href, title, this.output(cap[1])) + : this.renderer.image(href, title, escape(cap[1])); +}; + +/** + * Smartypants Transformations + */ + +InlineLexer.prototype.smartypants = function(text) { + if (!this.options.smartypants) return text; + return text + // em-dashes + .replace(/---/g, '\u2014') + // en-dashes + .replace(/--/g, '\u2013') + // opening singles + .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + // closing singles & apostrophes + .replace(/'/g, '\u2019') + // opening doubles + .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + // closing doubles + .replace(/"/g, '\u201d') + // ellipses + .replace(/\.{3}/g, '\u2026'); +}; + +/** + * Mangle Links + */ + +InlineLexer.prototype.mangle = function(text) { + if (!this.options.mangle) return text; + var out = '' + , l = text.length + , i = 0 + , ch; + + for (; i < l; i++) { + ch = text.charCodeAt(i); + if (Math.random() > 0.5) { + ch = 'x' + ch.toString(16); + } + out += '&#' + ch + ';'; + } + + return out; +}; + +/** + * Renderer + */ + +function Renderer(options) { + this.options = options || {}; +} + +Renderer.prototype.code = function(code, lang, escaped) { + if (this.options.highlight) { + var out = this.options.highlight(code, lang); + if (out != null && out !== code) { + escaped = true; + code = out; + } + } + + if (!lang) { + return '
      '
      +      + (escaped ? code : escape(code, true))
      +      + '\n
      '; + } + + return '
      '
      +    + (escaped ? code : escape(code, true))
      +    + '\n
      \n'; +}; + +Renderer.prototype.blockquote = function(quote) { + return '
      \n' + quote + '
      \n'; +}; + +Renderer.prototype.html = function(html) { + return html; +}; + +Renderer.prototype.heading = function(text, level, raw) { + return '' + + text + + '\n'; +}; + +Renderer.prototype.hr = function() { + return this.options.xhtml ? '
      \n' : '
      \n'; +}; + +Renderer.prototype.list = function(body, ordered) { + var type = ordered ? 'ol' : 'ul'; + return '<' + type + '>\n' + body + '\n'; +}; + +Renderer.prototype.listitem = function(text) { + return '
    • ' + text + '
    • \n'; +}; + +Renderer.prototype.paragraph = function(text) { + return '

      ' + text + '

      \n'; +}; + +Renderer.prototype.table = function(header, body) { + return '
      \n' + + '\n' + + header + + '\n' + + '\n' + + body + + '\n' + + '
      \n'; +}; + +Renderer.prototype.tablerow = function(content) { + return '\n' + content + '\n'; +}; + +Renderer.prototype.tablecell = function(content, flags) { + var type = flags.header ? 'th' : 'td'; + var tag = flags.align + ? '<' + type + ' style="text-align:' + flags.align + '">' + : '<' + type + '>'; + return tag + content + '\n'; +}; + +// span level renderer +Renderer.prototype.strong = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.em = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.codespan = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.br = function() { + return this.options.xhtml ? '
      ' : '
      '; +}; + +Renderer.prototype.del = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.link = function(href, title, text) { + if (this.options.sanitize) { + try { + var prot = decodeURIComponent(unescape(href)) + .replace(/[^\w:]/g, '') + .toLowerCase(); + } catch (e) { + return ''; + } + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) { + return ''; + } + } + var out = '
      '; + return out; +}; + +Renderer.prototype.image = function(href, title, text) { + var out = '' + text + '' : '>'; + return out; +}; + +Renderer.prototype.text = function(text) { + return text; +}; + +/** + * Parsing & Compiling + */ + +function Parser(options) { + this.tokens = []; + this.token = null; + this.options = options || marked.defaults; + this.options.renderer = this.options.renderer || new Renderer; + this.renderer = this.options.renderer; + this.renderer.options = this.options; +} + +/** + * Static Parse Method + */ + +Parser.parse = function(src, options, renderer) { + var parser = new Parser(options, renderer); + return parser.parse(src); +}; + +/** + * Parse Loop + */ + +Parser.prototype.parse = function(src) { + this.inline = new InlineLexer(src.links, this.options, this.renderer); + this.tokens = src.reverse(); + + var out = ''; + while (this.next()) { + out += this.tok(); + } + + return out; +}; + +/** + * Next Token + */ + +Parser.prototype.next = function() { + return this.token = this.tokens.pop(); +}; + +/** + * Preview Next Token + */ + +Parser.prototype.peek = function() { + return this.tokens[this.tokens.length - 1] || 0; +}; + +/** + * Parse Text Tokens + */ + +Parser.prototype.parseText = function() { + var body = this.token.text; + + while (this.peek().type === 'text') { + body += '\n' + this.next().text; + } + + return this.inline.output(body); +}; + +/** + * Parse Current Token + */ + +Parser.prototype.tok = function() { + switch (this.token.type) { + case 'space': { + return ''; + } + case 'hr': { + return this.renderer.hr(); + } + case 'heading': { + return this.renderer.heading( + this.inline.output(this.token.text), + this.token.depth, + this.token.text); + } + case 'code': { + return this.renderer.code(this.token.text, + this.token.lang, + this.token.escaped); + } + case 'table': { + var header = '' + , body = '' + , i + , row + , cell + , flags + , j; + + // header + cell = ''; + for (i = 0; i < this.token.header.length; i++) { + flags = { header: true, align: this.token.align[i] }; + cell += this.renderer.tablecell( + this.inline.output(this.token.header[i]), + { header: true, align: this.token.align[i] } + ); + } + header += this.renderer.tablerow(cell); + + for (i = 0; i < this.token.cells.length; i++) { + row = this.token.cells[i]; + + cell = ''; + for (j = 0; j < row.length; j++) { + cell += this.renderer.tablecell( + this.inline.output(row[j]), + { header: false, align: this.token.align[j] } + ); + } + + body += this.renderer.tablerow(cell); + } + return this.renderer.table(header, body); + } + case 'blockquote_start': { + var body = ''; + + while (this.next().type !== 'blockquote_end') { + body += this.tok(); + } + + return this.renderer.blockquote(body); + } + case 'list_start': { + var body = '' + , ordered = this.token.ordered; + + while (this.next().type !== 'list_end') { + body += this.tok(); + } + + return this.renderer.list(body, ordered); + } + case 'list_item_start': { + var body = ''; + + while (this.next().type !== 'list_item_end') { + body += this.token.type === 'text' + ? this.parseText() + : this.tok(); + } + + return this.renderer.listitem(body); + } + case 'loose_item_start': { + var body = ''; + + while (this.next().type !== 'list_item_end') { + body += this.tok(); + } + + return this.renderer.listitem(body); + } + case 'html': { + var html = !this.token.pre && !this.options.pedantic + ? this.inline.output(this.token.text) + : this.token.text; + return this.renderer.html(html); + } + case 'paragraph': { + return this.renderer.paragraph(this.inline.output(this.token.text)); + } + case 'text': { + return this.renderer.paragraph(this.parseText()); + } + } +}; + +/** + * Helpers + */ + +function escape(html, encode) { + return html + .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} + +function unescape(html) { + // explicitly match decimal, hex, and named HTML entities + return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) { + n = n.toLowerCase(); + if (n === 'colon') return ':'; + if (n.charAt(0) === '#') { + return n.charAt(1) === 'x' + ? String.fromCharCode(parseInt(n.substring(2), 16)) + : String.fromCharCode(+n.substring(1)); + } + return ''; + }); +} + +function replace(regex, opt) { + regex = regex.source; + opt = opt || ''; + return function self(name, val) { + if (!name) return new RegExp(regex, opt); + val = val.source || val; + val = val.replace(/(^|[^\[])\^/g, '$1'); + regex = regex.replace(name, val); + return self; + }; +} + +function noop() {} +noop.exec = noop; + +function merge(obj) { + var i = 1 + , target + , key; + + for (; i < arguments.length; i++) { + target = arguments[i]; + for (key in target) { + if (Object.prototype.hasOwnProperty.call(target, key)) { + obj[key] = target[key]; + } + } + } + + return obj; +} + + +/** + * Marked + */ + +function marked(src, opt, callback) { + if (callback || typeof opt === 'function') { + if (!callback) { + callback = opt; + opt = null; + } + + opt = merge({}, marked.defaults, opt || {}); + + var highlight = opt.highlight + , tokens + , pending + , i = 0; + + try { + tokens = Lexer.lex(src, opt) + } catch (e) { + return callback(e); + } + + pending = tokens.length; + + var done = function(err) { + if (err) { + opt.highlight = highlight; + return callback(err); + } + + var out; + + try { + out = Parser.parse(tokens, opt); + } catch (e) { + err = e; + } + + opt.highlight = highlight; + + return err + ? callback(err) + : callback(null, out); + }; + + if (!highlight || highlight.length < 3) { + return done(); + } + + delete opt.highlight; + + if (!pending) return done(); + + for (; i < tokens.length; i++) { + (function(token) { + if (token.type !== 'code') { + return --pending || done(); + } + return highlight(token.text, token.lang, function(err, code) { + if (err) return done(err); + if (code == null || code === token.text) { + return --pending || done(); + } + token.text = code; + token.escaped = true; + --pending || done(); + }); + })(tokens[i]); + } + + return; + } + try { + if (opt) opt = merge({}, marked.defaults, opt); + return Parser.parse(Lexer.lex(src, opt), opt); + } catch (e) { + e.message += '\nPlease report this to https://github.com/chjj/marked.'; + if ((opt || marked.defaults).silent) { + return '

      An error occured:

      '
      +        + escape(e.message + '', true)
      +        + '
      '; + } + throw e; + } +} + +/** + * Options + */ + +marked.options = +marked.setOptions = function(opt) { + merge(marked.defaults, opt); + return marked; +}; + +marked.defaults = { + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: false, + sanitizer: null, + mangle: true, + smartLists: false, + silent: false, + highlight: null, + langPrefix: 'lang-', + smartypants: false, + headerPrefix: '', + renderer: new Renderer, + xhtml: false +}; + +/** + * Expose + */ + +marked.Parser = Parser; +marked.parser = Parser.parse; + +marked.Renderer = Renderer; + +marked.Lexer = Lexer; +marked.lexer = Lexer.lex; + +marked.InlineLexer = InlineLexer; +marked.inlineLexer = InlineLexer.output; + +marked.parse = marked; + +if (typeof module !== 'undefined' && typeof exports === 'object') { + module.exports = marked; +} else if (typeof define === 'function' && define.amd) { + define(function() { return marked; }); +} else { + this.marked = marked; +} + +}).call(function() { + return this || (typeof window !== 'undefined' ? window : global); +}()); + +/* ======================================================================== + * ZUI: markdoc.js + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2017-2018 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + +(function($) { + 'use strict'; + + $.zui.marked = window.marked; + + var NAME = 'zui.markdoc'; // model name + + // The markdoc model class + var MarkDoc = function(element, options) { + var that = this; + that.name = NAME; + that.$ = $(element); + + that.options = $.extend({}, MarkDoc.DEFAULTS, this.$.data(), options); + that.$.data('originContent', that.$.text()); + that.render(); + }; + + MarkDoc.prototype.render = function(extraOptions) { + var that = this; + if (extraOptions && typeof extraOptions !== 'object') { + extraOptions = {content: extraOptions}; + } + var options = $.extend({}, that.options, extraOptions); + var $ele = that.$; + if ($ele.hasClass('load-indicator')) { + $ele.addClass('loading'); + } + if (that.remoteRequest) { + that.remoteRequest.abort(); + } + that.getContent(function(content) { + $ele.empty(); + if (content) { + var htmlContent = options.markdown(content); + if (options.contentConverter) { + htmlContent = options.contentConverter(htmlContent); + } + $ele.append(htmlContent); + if(window.prettyPrint) { + $ele.find('pre').addClass('prettyprint'); + window.prettyPrint(); + } + } + $ele.removeClass('loading'); + }, options); + }; + + MarkDoc.prototype.getContent = function(callback, options) { + var that = this; + options = options || that.options;; + var content = options.content; + if (content) { + callback($.isFunction(content) ? content(that) : content); + } else if (options.remote) { + var ajaxOptions = $.isPlainObject(options.remote) ? options.remote : {url: options.remote}; + that.remoteRequest = $.ajax($.extend({}, ajaxOptions, { + success: function(data) { + callback(data); + }, + error: function(data) { + callback(null); + }, + complete: function() { + that.remoteRequest = null; + } + })); + } else if (options.source) { + var $source = $.isFunction(options.source) ? options.source(that) : $(options.source); + if ($source.is('textarea,input')) { + callback($source.val()); + } else { + callback($source.text()); + } + } else { + callback(this.$.data('originContent')); + } + }; + + // default options + MarkDoc.DEFAULTS = { + markdown: $.zui.marked + }; + + // Extense jquery element + $.fn.markdoc = function(option, param) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new MarkDoc(this, options))); + + if(typeof option == 'string') data[option](param); + }); + }; + + MarkDoc.NAME = NAME; + + $.fn.markdoc.Constructor = MarkDoc; + + // Auto call markdoc after document load complete + $(function() { + $('[data-render="markdoc"]').markdoc(); + }); + + $(document).on('click', '[data-toggle="markdoc"]', function(e) { + var $this = $(this); + var options = $this.data(); + var $target = $(options.target); + if (!$target.length) { + return; + } + if (!$target.data(NAME)) { + $target.markdoc(); + } + $target.markdoc('render', $.extend(options, { + remote: $this.attr('href') + })); + if($this.is('a')) { + e.preventDefault(); + } + }); +}(jQuery)); + diff --git a/dist/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.min.js b/dist/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.min.js new file mode 100644 index 0000000..20f5492 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: Markdown 文档生成器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +(function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||h.defaults,this.rules=u.normal,this.options.gfm&&(this.options.tables?this.rules=u.tables:this.rules=u.gfm)}function t(e,t){if(this.options=t||h.defaults,this.links=e,this.rules=p.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=p.breaks:this.rules=p.gfm:this.options.pedantic&&(this.rules=p.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||h.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function o(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function l(){}function a(e){for(var t,n,r=1;rAn error occured:

      "+s(c.message+"",!0)+"
      ";throw c}}var u={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:l,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:l,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:l,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};u.bullet=/(?:[*+-]|\d+\.)/,u.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,u.item=o(u.item,"gm")(/bull/g,u.bullet)(),u.list=o(u.list)(/bull/g,u.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+u.def.source+")")(),u.blockquote=o(u.blockquote)("def",u.def)(),u._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",u.html=o(u.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,u._tag)(),u.paragraph=o(u.paragraph)("hr",u.hr)("heading",u.heading)("lheading",u.lheading)("blockquote",u.blockquote)("tag","<"+u._tag)("def",u.def)(),u.normal=a({},u),u.gfm=a({},u.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),u.gfm.paragraph=o(u.paragraph)("(?!","(?!"+u.gfm.fences.source.replace("\\1","\\2")+"|"+u.list.source.replace("\\1","\\3")+"|")(),u.tables=a({},u.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=u,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,o,l,a,h,p,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),o=i[2],this.tokens.push({type:"list_start",ordered:o.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,p=0;p1&&l.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:l,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:l,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,p.link=o(p.link)("inside",p._inside)("href",p._href)(),p.reflink=o(p.reflink)("inside",p._inside)(),p.normal=a({},p),p.pedantic=a({},p.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),p.gfm=a({},p.normal,{escape:o(p.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:o(p.text)("]|","~]|")("|","|https?://|")()}),p.breaks=a({},p.gfm,{br:o(p.br)("{2,}","*")(),text:o(p.gfm.text)("{2,}","*")()}),t.rules=p,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^
      /i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(s(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,o+=this.renderer.link(r,null,n);return o},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
      '+(n?e:s(e,!0))+"\n
      \n":"
      "+(n?e:s(e,!0))+"\n
      "},n.prototype.blockquote=function(e){return"
      \n"+e+"
      \n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
      \n":"
      \n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
    • "+e+"
    • \n"},n.prototype.paragraph=function(e){return"

      "+e+"

      \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
      \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
      ":"
      "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var o='
      "},n.prototype.image=function(e,t,n){var r=''+n+'":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",o="";for(n="",e=0;e)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}\b/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-dart.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-dart.js new file mode 100644 index 0000000..eefccc9 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-dart.js @@ -0,0 +1,3 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!.*/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/.*/],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], +["typ",/^\b(?:bool|double|dynamic|int|num|object|string|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?'''[\S\s]*?[^\\]'''/],["str",/^r?"""[\S\s]*?[^\\]"""/],["str",/^r?'('|[^\n\f\r]*?[^\\]')/],["str",/^r?"("|[^\n\f\r]*?[^\\]")/],["pln",/^[$_a-z]\w*/i],["pun",/^[!%&*+/:<-?^|~-]/],["lit",/^\b0x[\da-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit",/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(),.;[\]{}]/]]), +["dart"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-erlang.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-erlang.js new file mode 100644 index 0000000..27214a5 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-erlang.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["lit",/^[a-z]\w*/],["lit",/^'(?:[^\n\f\r'\\]|\\[^&])+'?/,null,"'"],["lit",/^\?[^\t\n ({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], +["kwd",/^-[_a-z]+/],["typ",/^[A-Z_]\w*/],["pun",/^[,.;]/]]),["erlang","erl"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-go.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-go.js new file mode 100644 index 0000000..1caca23 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-go.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-hs.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-hs.js new file mode 100644 index 0000000..ff3729b --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-hs.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, +null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-lisp.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-lisp.js new file mode 100644 index 0000000..9c8cfa5 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-lisp.js @@ -0,0 +1,3 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], +["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","lsp","scm","ss","rkt"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-llvm.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-llvm.js new file mode 100644 index 0000000..16fade2 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-llvm.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^!?"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["com",/^;[^\n\r]*/,null,";"]],[["pln",/^[!%@](?:[$\-.A-Z_a-z][\w$\-.]*|\d+)/],["kwd",/^[^\W\d]\w*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[Xx][\dA-Fa-f]+)/],["pun",/^[(-*,:<->[\]{}]|\.\.\.$/]]),["llvm","ll"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-lua.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-lua.js new file mode 100644 index 0000000..7e44cca --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-lua.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], +["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-matlab.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-matlab.js new file mode 100644 index 0000000..d0d3516 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-matlab.js @@ -0,0 +1,6 @@ +var a=null,b=window.PR,c=[[b.PR_PLAIN,/^[\t-\r \xa0]+/,a," \t\r\n\u000b\u000c\u00a0"],[b.PR_COMMENT,/^%{[^%]*%+(?:[^%}][^%]*%+)*}/,a],[b.PR_COMMENT,/^%[^\n\r]*/,a,"%"],["syscmd",/^![^\n\r]*/,a,"!"]],d=[["linecont",/^\.\.\.\s*[\n\r]/,a],["err",/^\?\?\? [^\n\r]*/,a],["wrn",/^Warning: [^\n\r]*/,a],["codeoutput",/^>>\s+/,a],["codeoutput",/^octave:\d+>\s+/,a],["lang-matlab-operators",/^((?:[A-Za-z]\w*(?:\.[A-Za-z]\w*)*|[).\]}])')/,a],["lang-matlab-identifiers",/^([A-Za-z]\w*(?:\.[A-Za-z]\w*)*)(?!')/,a], +[b.PR_STRING,/^'(?:[^']|'')*'/,a],[b.PR_LITERAL,/^[+-]?\.?\d+(?:\.\d*)?(?:[Ee][+-]?\d+)?[ij]?/,a],[b.PR_TAG,/^[()[\]{}]/,a],[b.PR_PUNCTUATION,/^[!&*-/:->@\\^|~]/,a]],e=[["lang-matlab-identifiers",/^([A-Za-z]\w*(?:\.[A-Za-z]\w*)*)/,a],[b.PR_TAG,/^[()[\]{}]/,a],[b.PR_PUNCTUATION,/^[!&*-/:->@\\^|~]/,a],["transpose",/^'/,a]]; +b.registerLangHandler(b.createSimpleLexer([],[[b.PR_KEYWORD,/^\b(?:break|case|catch|classdef|continue|else|elseif|end|for|function|global|if|otherwise|parfor|persistent|return|spmd|switch|try|while)\b/,a],["const",/^\b(?:true|false|inf|Inf|nan|NaN|eps|pi|ans|nargin|nargout|varargin|varargout)\b/,a],[b.PR_TYPE,/^\b(?:cell|struct|char|double|single|logical|u?int(?:8|16|32|64)|sparse)\b/,a],["fun",/^\b(?:abs|accumarray|acos(?:d|h)?|acot(?:d|h)?|acsc(?:d|h)?|actxcontrol(?:list|select)?|actxGetRunningServer|actxserver|addlistener|addpath|addpref|addtodate|airy|align|alim|all|allchild|alpha|alphamap|amd|ancestor|and|angle|annotation|any|area|arrayfun|asec(?:d|h)?|asin(?:d|h)?|assert|assignin|atan[2dh]?|audiodevinfo|audioplayer|audiorecorder|aufinfo|auread|autumn|auwrite|avifile|aviinfo|aviread|axes|axis|balance|bar(?:3|3h|h)?|base2dec|beep|BeginInvoke|bench|bessel[h-ky]|beta|betainc|betaincinv|betaln|bicg|bicgstab|bicgstabl|bin2dec|bitand|bitcmp|bitget|bitmax|bitnot|bitor|bitset|bitshift|bitxor|blanks|blkdiag|bone|box|brighten|brush|bsxfun|builddocsearchdb|builtin|bvp4c|bvp5c|bvpget|bvpinit|bvpset|bvpxtend|calendar|calllib|callSoapService|camdolly|cameratoolbar|camlight|camlookat|camorbit|campan|campos|camproj|camroll|camtarget|camup|camva|camzoom|cart2pol|cart2sph|cast|cat|caxis|cd|cdf2rdf|cdfepoch|cdfinfo|cdflib(?:.(?:close|closeVar|computeEpoch|computeEpoch16|create|createAttr|createVar|delete|deleteAttr|deleteAttrEntry|deleteAttrgEntry|deleteVar|deleteVarRecords|epoch16Breakdown|epochBreakdown|getAttrEntry|getAttrgEntry|getAttrMaxEntry|getAttrMaxgEntry|getAttrName|getAttrNum|getAttrScope|getCacheSize|getChecksum|getCompression|getCompressionCacheSize|getConstantNames|getConstantValue|getCopyright|getFileBackward|getFormat|getLibraryCopyright|getLibraryVersion|getMajority|getName|getNumAttrEntries|getNumAttrgEntries|getNumAttributes|getNumgAttributes|getReadOnlyMode|getStageCacheSize|getValidate|getVarAllocRecords|getVarBlockingFactor|getVarCacheSize|getVarCompression|getVarData|getVarMaxAllocRecNum|getVarMaxWrittenRecNum|getVarName|getVarNum|getVarNumRecsWritten|getVarPadValue|getVarRecordData|getVarReservePercent|getVarsMaxWrittenRecNum|getVarSparseRecords|getVersion|hyperGetVarData|hyperPutVarData|inquire|inquireAttr|inquireAttrEntry|inquireAttrgEntry|inquireVar|open|putAttrEntry|putAttrgEntry|putVarData|putVarRecordData|renameAttr|renameVar|setCacheSize|setChecksum|setCompression|setCompressionCacheSize|setFileBackward|setFormat|setMajority|setReadOnlyMode|setStageCacheSize|setValidate|setVarAllocBlockRecords|setVarBlockingFactor|setVarCacheSize|setVarCompression|setVarInitialRecs|setVarPadValue|SetVarReservePercent|setVarsCacheSize|setVarSparseRecords))?|cdfread|cdfwrite|ceil|cell2mat|cell2struct|celldisp|cellfun|cellplot|cellstr|cgs|checkcode|checkin|checkout|chol|cholinc|cholupdate|circshift|cla|clabel|class|clc|clear|clearvars|clf|clipboard|clock|close|closereq|cmopts|cmpermute|cmunique|colamd|colon|colorbar|colordef|colormap|colormapeditor|colperm|Combine|comet|comet3|commandhistory|commandwindow|compan|compass|complex|computer|cond|condeig|condest|coneplot|conj|containers.Map|contour(?:[3cf]|slice)?|contrast|conv|conv2|convhull|convhulln|convn|cool|copper|copyfile|copyobj|corrcoef|cos(?:d|h)?|cot(?:d|h)?|cov|cplxpair|cputime|createClassFromWsdl|createSoapMessage|cross|csc(?:d|h)?|csvread|csvwrite|ctranspose|cumprod|cumsum|cumtrapz|curl|customverctrl|cylinder|daqread|daspect|datacursormode|datatipinfo|date|datenum|datestr|datetick|datevec|dbclear|dbcont|dbdown|dblquad|dbmex|dbquit|dbstack|dbstatus|dbstep|dbstop|dbtype|dbup|dde23|ddeget|ddesd|ddeset|deal|deblank|dec2base|dec2bin|dec2hex|decic|deconv|del2|delaunay|delaunay3|delaunayn|DelaunayTri|delete|demo|depdir|depfun|det|detrend|deval|diag|dialog|diary|diff|diffuse|dir|disp|display|dither|divergence|dlmread|dlmwrite|dmperm|doc|docsearch|dos|dot|dragrect|drawnow|dsearch|dsearchn|dynamicprops|echo|echodemo|edit|eig|eigs|ellipj|ellipke|ellipsoid|empty|enableNETfromNetworkDrive|enableservice|EndInvoke|enumeration|eomday|eq|erf|erfc|erfcinv|erfcx|erfinv|error|errorbar|errordlg|etime|etree|etreeplot|eval|evalc|evalin|event.(?:EventData|listener|PropertyEvent|proplistener)|exifread|exist|exit|exp|expint|expm|expm1|export2wsdlg|eye|ezcontour|ezcontourf|ezmesh|ezmeshc|ezplot|ezplot3|ezpolar|ezsurf|ezsurfc|factor|factorial|fclose|feather|feature|feof|ferror|feval|fft|fft2|fftn|fftshift|fftw|fgetl|fgets|fieldnames|figure|figurepalette|fileattrib|filebrowser|filemarker|fileparts|fileread|filesep|fill|fill3|filter|filter2|find|findall|findfigs|findobj|findstr|finish|fitsdisp|fitsinfo|fitsread|fitswrite|fix|flag|flipdim|fliplr|flipud|floor|flow|fminbnd|fminsearch|fopen|format|fplot|fprintf|frame2im|fread|freqspace|frewind|fscanf|fseek|ftell|FTP|full|fullfile|func2str|functions|funm|fwrite|fzero|gallery|gamma|gammainc|gammaincinv|gammaln|gca|gcbf|gcbo|gcd|gcf|gco|ge|genpath|genvarname|get|getappdata|getenv|getfield|getframe|getpixelposition|getpref|ginput|gmres|gplot|grabcode|gradient|gray|graymon|grid|griddata(?:3|n)?|griddedInterpolant|gsvd|gt|gtext|guidata|guide|guihandles|gunzip|gzip|h5create|h5disp|h5info|h5read|h5readatt|h5write|h5writeatt|hadamard|handle|hankel|hdf|hdf5|hdf5info|hdf5read|hdf5write|hdfinfo|hdfread|hdftool|help|helpbrowser|helpdesk|helpdlg|helpwin|hess|hex2dec|hex2num|hgexport|hggroup|hgload|hgsave|hgsetget|hgtransform|hidden|hilb|hist|histc|hold|home|horzcat|hostid|hot|hsv|hsv2rgb|hypot|ichol|idivide|ifft|ifft2|ifftn|ifftshift|ilu|im2frame|im2java|imag|image|imagesc|imapprox|imfinfo|imformats|import|importdata|imread|imwrite|ind2rgb|ind2sub|inferiorto|info|inline|inmem|inpolygon|input|inputdlg|inputname|inputParser|inspect|instrcallback|instrfind|instrfindall|int2str|integral(?:2|3)?|interp(?:1|1q|2|3|ft|n)|interpstreamspeed|intersect|intmax|intmin|inv|invhilb|ipermute|isa|isappdata|iscell|iscellstr|ischar|iscolumn|isdir|isempty|isequal|isequaln|isequalwithequalnans|isfield|isfinite|isfloat|isglobal|ishandle|ishghandle|ishold|isinf|isinteger|isjava|iskeyword|isletter|islogical|ismac|ismatrix|ismember|ismethod|isnan|isnumeric|isobject|isocaps|isocolors|isonormals|isosurface|ispc|ispref|isprime|isprop|isreal|isrow|isscalar|issorted|isspace|issparse|isstr|isstrprop|isstruct|isstudent|isunix|isvarname|isvector|javaaddpath|javaArray|javachk|javaclasspath|javacomponent|javaMethod|javaMethodEDT|javaObject|javaObjectEDT|javarmpath|jet|keyboard|kron|lasterr|lasterror|lastwarn|lcm|ldivide|ldl|le|legend|legendre|length|libfunctions|libfunctionsview|libisloaded|libpointer|libstruct|license|light|lightangle|lighting|lin2mu|line|lines|linkaxes|linkdata|linkprop|linsolve|linspace|listdlg|listfonts|load|loadlibrary|loadobj|log|log10|log1p|log2|loglog|logm|logspace|lookfor|lower|ls|lscov|lsqnonneg|lsqr|lt|lu|luinc|magic|makehgtform|mat2cell|mat2str|material|matfile|matlab.io.MatFile|matlab.mixin.(?:Copyable|Heterogeneous(?:.getDefaultScalarElement)?)|matlabrc|matlabroot|max|maxNumCompThreads|mean|median|membrane|memmapfile|memory|menu|mesh|meshc|meshgrid|meshz|meta.(?:class(?:.fromName)?|DynamicProperty|EnumeratedValue|event|MetaData|method|package(?:.(?:fromName|getAllPackages))?|property)|metaclass|methods|methodsview|mex(?:.getCompilerConfigurations)?|MException|mexext|mfilename|min|minres|minus|mislocked|mkdir|mkpp|mldivide|mlint|mlintrpt|mlock|mmfileinfo|mmreader|mod|mode|more|move|movefile|movegui|movie|movie2avi|mpower|mrdivide|msgbox|mtimes|mu2lin|multibandread|multibandwrite|munlock|namelengthmax|nargchk|narginchk|nargoutchk|native2unicode|nccreate|ncdisp|nchoosek|ncinfo|ncread|ncreadatt|ncwrite|ncwriteatt|ncwriteschema|ndgrid|ndims|ne|NET(?:.(?:addAssembly|Assembly|convertArray|createArray|createGeneric|disableAutoRelease|enableAutoRelease|GenericClass|invokeGenericMethod|NetException|setStaticProperty))?|netcdf.(?:abort|close|copyAtt|create|defDim|defGrp|defVar|defVarChunking|defVarDeflate|defVarFill|defVarFletcher32|delAtt|endDef|getAtt|getChunkCache|getConstant|getConstantNames|getVar|inq|inqAtt|inqAttID|inqAttName|inqDim|inqDimID|inqDimIDs|inqFormat|inqGrpName|inqGrpNameFull|inqGrpParent|inqGrps|inqLibVers|inqNcid|inqUnlimDims|inqVar|inqVarChunking|inqVarDeflate|inqVarFill|inqVarFletcher32|inqVarID|inqVarIDs|open|putAtt|putVar|reDef|renameAtt|renameDim|renameVar|setChunkCache|setDefaultFormat|setFill|sync)|newplot|nextpow2|nnz|noanimate|nonzeros|norm|normest|not|notebook|now|nthroot|null|num2cell|num2hex|num2str|numel|nzmax|ode(?:113|15i|15s|23|23s|23t|23tb|45)|odeget|odeset|odextend|onCleanup|ones|open|openfig|opengl|openvar|optimget|optimset|or|ordeig|orderfields|ordqz|ordschur|orient|orth|pack|padecoef|pagesetupdlg|pan|pareto|parseSoapResponse|pascal|patch|path|path2rc|pathsep|pathtool|pause|pbaspect|pcg|pchip|pcode|pcolor|pdepe|pdeval|peaks|perl|perms|permute|pie|pink|pinv|planerot|playshow|plot|plot3|plotbrowser|plotedit|plotmatrix|plottools|plotyy|plus|pol2cart|polar|poly|polyarea|polyder|polyeig|polyfit|polyint|polyval|polyvalm|pow2|power|ppval|prefdir|preferences|primes|print|printdlg|printopt|printpreview|prod|profile|profsave|propedit|propertyeditor|psi|publish|PutCharArray|PutFullMatrix|PutWorkspaceData|pwd|qhull|qmr|qr|qrdelete|qrinsert|qrupdate|quad|quad2d|quadgk|quadl|quadv|questdlg|quit|quiver|quiver3|qz|rand|randi|randn|randperm|RandStream(?:.(?:create|getDefaultStream|getGlobalStream|list|setDefaultStream|setGlobalStream))?|rank|rat|rats|rbbox|rcond|rdivide|readasync|real|reallog|realmax|realmin|realpow|realsqrt|record|rectangle|rectint|recycle|reducepatch|reducevolume|refresh|refreshdata|regexp|regexpi|regexprep|regexptranslate|rehash|rem|Remove|RemoveAll|repmat|reset|reshape|residue|restoredefaultpath|rethrow|rgb2hsv|rgb2ind|rgbplot|ribbon|rmappdata|rmdir|rmfield|rmpath|rmpref|rng|roots|rose|rosser|rot90|rotate|rotate3d|round|rref|rsf2csf|run|save|saveas|saveobj|savepath|scatter|scatter3|schur|sec|secd|sech|selectmoveresize|semilogx|semilogy|sendmail|serial|set|setappdata|setdiff|setenv|setfield|setpixelposition|setpref|setstr|setxor|shading|shg|shiftdim|showplottool|shrinkfaces|sign|sin(?:d|h)?|size|slice|smooth3|snapnow|sort|sortrows|sound|soundsc|spalloc|spaugment|spconvert|spdiags|specular|speye|spfun|sph2cart|sphere|spinmap|spline|spones|spparms|sprand|sprandn|sprandsym|sprank|spring|sprintf|spy|sqrt|sqrtm|squeeze|ss2tf|sscanf|stairs|startup|std|stem|stem3|stopasync|str2double|str2func|str2mat|str2num|strcat|strcmp|strcmpi|stream2|stream3|streamline|streamparticles|streamribbon|streamslice|streamtube|strfind|strjust|strmatch|strncmp|strncmpi|strread|strrep|strtok|strtrim|struct2cell|structfun|strvcat|sub2ind|subplot|subsasgn|subsindex|subspace|subsref|substruct|subvolume|sum|summer|superclasses|superiorto|support|surf|surf2patch|surface|surfc|surfl|surfnorm|svd|svds|swapbytes|symamd|symbfact|symmlq|symrcm|symvar|system|tan(?:d|h)?|tar|tempdir|tempname|tetramesh|texlabel|text|textread|textscan|textwrap|tfqmr|throw|tic|Tiff(?:.(?:getTagNames|getVersion))?|timer|timerfind|timerfindall|times|timeseries|title|toc|todatenum|toeplitz|toolboxdir|trace|transpose|trapz|treelayout|treeplot|tril|trimesh|triplequad|triplot|TriRep|TriScatteredInterp|trisurf|triu|tscollection|tsearch|tsearchn|tstool|type|typecast|uibuttongroup|uicontextmenu|uicontrol|uigetdir|uigetfile|uigetpref|uiimport|uimenu|uiopen|uipanel|uipushtool|uiputfile|uiresume|uisave|uisetcolor|uisetfont|uisetpref|uistack|uitable|uitoggletool|uitoolbar|uiwait|uminus|undocheckout|unicode2native|union|unique|unix|unloadlibrary|unmesh|unmkpp|untar|unwrap|unzip|uplus|upper|urlread|urlwrite|usejava|userpath|validateattributes|validatestring|vander|var|vectorize|ver|verctrl|verLessThan|version|vertcat|VideoReader(?:.isPlatformSupported)?|VideoWriter(?:.getProfiles)?|view|viewmtx|visdiff|volumebounds|voronoi|voronoin|wait|waitbar|waitfor|waitforbuttonpress|warndlg|warning|waterfall|wavfinfo|wavplay|wavread|wavrecord|wavwrite|web|weekday|what|whatsnew|which|whitebg|who|whos|wilkinson|winopen|winqueryreg|winter|wk1finfo|wk1read|wk1write|workspace|xlabel|xlim|xlsfinfo|xlsread|xlswrite|xmlread|xmlwrite|xor|xslt|ylabel|ylim|zeros|zip|zlabel|zlim|zoom)\b/, +a],["fun_tbx",/^\b(?:addedvarplot|andrewsplot|anova[12n]|ansaribradley|aoctool|barttest|bbdesign|beta(?:cdf|fit|inv|like|pdf|rnd|stat)|bino(?:cdf|fit|inv|pdf|rnd|stat)|biplot|bootci|bootstrp|boxplot|candexch|candgen|canoncorr|capability|capaplot|caseread|casewrite|categorical|ccdesign|cdfplot|chi2(?:cdf|gof|inv|pdf|rnd|stat)|cholcov|Classification(?:BaggedEnsemble|Discriminant(?:.(?:fit|make|template))?|Ensemble|KNN(?:.(?:fit|template))?|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|template))?)|classify|classregtree|cluster|clusterdata|cmdscale|combnk|Compact(?:Classification(?:Discriminant|Ensemble|Tree)|Regression(?:Ensemble|Tree)|TreeBagger)|confusionmat|controlchart|controlrules|cophenet|copula(?:cdf|fit|param|pdf|rnd|stat)|cordexch|corr|corrcov|coxphfit|createns|crosstab|crossval|cvpartition|datasample|dataset|daugment|dcovary|dendrogram|dfittool|disttool|dummyvar|dwtest|ecdf|ecdfhist|ev(?:cdf|fit|inv|like|pdf|rnd|stat)|ExhaustiveSearcher|exp(?:cdf|fit|inv|like|pdf|rnd|stat)|factoran|fcdf|ff2n|finv|fitdist|fitensemble|fpdf|fracfact|fracfactgen|friedman|frnd|fstat|fsurfht|fullfact|gagerr|gam(?:cdf|fit|inv|like|pdf|rnd|stat)|GeneralizedLinearModel(?:.fit)?|geo(?:cdf|inv|mean|pdf|rnd|stat)|gev(?:cdf|fit|inv|like|pdf|rnd|stat)|gline|glmfit|glmval|glyphplot|gmdistribution(?:.fit)?|gname|gp(?:cdf|fit|inv|like|pdf|rnd|stat)|gplotmatrix|grp2idx|grpstats|gscatter|haltonset|harmmean|hist3|histfit|hmm(?:decode|estimate|generate|train|viterbi)|hougen|hyge(?:cdf|inv|pdf|rnd|stat)|icdf|inconsistent|interactionplot|invpred|iqr|iwishrnd|jackknife|jbtest|johnsrnd|KDTreeSearcher|kmeans|knnsearch|kruskalwallis|ksdensity|kstest|kstest2|kurtosis|lasso|lassoglm|lassoPlot|leverage|lhsdesign|lhsnorm|lillietest|LinearModel(?:.fit)?|linhyptest|linkage|logn(?:cdf|fit|inv|like|pdf|rnd|stat)|lsline|mad|mahal|maineffectsplot|manova1|manovacluster|mdscale|mhsample|mle|mlecov|mnpdf|mnrfit|mnrnd|mnrval|moment|multcompare|multivarichart|mvn(?:cdf|pdf|rnd)|mvregress|mvregresslike|mvt(?:cdf|pdf|rnd)|NaiveBayes(?:.fit)?|nan(?:cov|max|mean|median|min|std|sum|var)|nbin(?:cdf|fit|inv|pdf|rnd|stat)|ncf(?:cdf|inv|pdf|rnd|stat)|nct(?:cdf|inv|pdf|rnd|stat)|ncx2(?:cdf|inv|pdf|rnd|stat)|NeighborSearcher|nlinfit|nlintool|nlmefit|nlmefitsa|nlparci|nlpredci|nnmf|nominal|NonLinearModel(?:.fit)?|norm(?:cdf|fit|inv|like|pdf|rnd|stat)|normplot|normspec|ordinal|outlierMeasure|parallelcoords|paretotails|partialcorr|pcacov|pcares|pdf|pdist|pdist2|pearsrnd|perfcurve|perms|piecewisedistribution|plsregress|poiss(?:cdf|fit|inv|pdf|rnd|tat)|polyconf|polytool|prctile|princomp|ProbDist(?:Kernel|Parametric|UnivKernel|UnivParam)?|probplot|procrustes|qqplot|qrandset|qrandstream|quantile|randg|random|randsample|randtool|range|rangesearch|ranksum|rayl(?:cdf|fit|inv|pdf|rnd|stat)|rcoplot|refcurve|refline|regress|Regression(?:BaggedEnsemble|Ensemble|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|template))?)|regstats|relieff|ridge|robustdemo|robustfit|rotatefactors|rowexch|rsmdemo|rstool|runstest|sampsizepwr|scatterhist|sequentialfs|signrank|signtest|silhouette|skewness|slicesample|sobolset|squareform|statget|statset|stepwise|stepwisefit|surfht|tabulate|tblread|tblwrite|tcdf|tdfread|tiedrank|tinv|tpdf|TreeBagger|treedisp|treefit|treeprune|treetest|treeval|trimmean|trnd|tstat|ttest|ttest2|unid(?:cdf|inv|pdf|rnd|stat)|unif(?:cdf|inv|it|pdf|rnd|stat)|vartest(?:2|n)?|wbl(?:cdf|fit|inv|like|pdf|rnd|stat)|wblplot|wishrnd|x2fx|xptread|zscore|ztest)\b/, +a],["fun_tbx",/^\b(?:adapthisteq|analyze75info|analyze75read|applycform|applylut|axes2pix|bestblk|blockproc|bwarea|bwareaopen|bwboundaries|bwconncomp|bwconvhull|bwdist|bwdistgeodesic|bweuler|bwhitmiss|bwlabel|bwlabeln|bwmorph|bwpack|bwperim|bwselect|bwtraceboundary|bwulterode|bwunpack|checkerboard|col2im|colfilt|conndef|convmtx2|corner|cornermetric|corr2|cp2tform|cpcorr|cpselect|cpstruct2pairs|dct2|dctmtx|deconvblind|deconvlucy|deconvreg|deconvwnr|decorrstretch|demosaic|dicom(?:anon|dict|info|lookup|read|uid|write)|edge|edgetaper|entropy|entropyfilt|fan2para|fanbeam|findbounds|fliptform|freqz2|fsamp2|fspecial|ftrans2|fwind1|fwind2|getheight|getimage|getimagemodel|getline|getneighbors|getnhood|getpts|getrangefromclass|getrect|getsequence|gray2ind|graycomatrix|graycoprops|graydist|grayslice|graythresh|hdrread|hdrwrite|histeq|hough|houghlines|houghpeaks|iccfind|iccread|iccroot|iccwrite|idct2|ifanbeam|im2bw|im2col|im2double|im2int16|im2java2d|im2single|im2uint16|im2uint8|imabsdiff|imadd|imadjust|ImageAdapter|imageinfo|imagemodel|imapplymatrix|imattributes|imbothat|imclearborder|imclose|imcolormaptool|imcomplement|imcontour|imcontrast|imcrop|imdilate|imdisplayrange|imdistline|imdivide|imellipse|imerode|imextendedmax|imextendedmin|imfill|imfilter|imfindcircles|imfreehand|imfuse|imgca|imgcf|imgetfile|imhandles|imhist|imhmax|imhmin|imimposemin|imlincomb|imline|immagbox|immovie|immultiply|imnoise|imopen|imoverview|imoverviewpanel|impixel|impixelinfo|impixelinfoval|impixelregion|impixelregionpanel|implay|impoint|impoly|impositionrect|improfile|imputfile|impyramid|imreconstruct|imrect|imregconfig|imregionalmax|imregionalmin|imregister|imresize|imroi|imrotate|imsave|imscrollpanel|imshow|imshowpair|imsubtract|imtool|imtophat|imtransform|imview|ind2gray|ind2rgb|interfileinfo|interfileread|intlut|ippl|iptaddcallback|iptcheckconn|iptcheckhandle|iptcheckinput|iptcheckmap|iptchecknargin|iptcheckstrs|iptdemos|iptgetapi|iptGetPointerBehavior|iptgetpref|ipticondir|iptnum2ordinal|iptPointerManager|iptprefs|iptremovecallback|iptSetPointerBehavior|iptsetpref|iptwindowalign|iradon|isbw|isflat|isgray|isicc|isind|isnitf|isrgb|isrset|lab2double|lab2uint16|lab2uint8|label2rgb|labelmatrix|makecform|makeConstrainToRectFcn|makehdr|makelut|makeresampler|maketform|mat2gray|mean2|medfilt2|montage|nitfinfo|nitfread|nlfilter|normxcorr2|ntsc2rgb|openrset|ordfilt2|otf2psf|padarray|para2fan|phantom|poly2mask|psf2otf|qtdecomp|qtgetblk|qtsetblk|radon|rangefilt|reflect|regionprops|registration.metric.(?:MattesMutualInformation|MeanSquares)|registration.optimizer.(?:OnePlusOneEvolutionary|RegularStepGradientDescent)|rgb2gray|rgb2ntsc|rgb2ycbcr|roicolor|roifill|roifilt2|roipoly|rsetwrite|std2|stdfilt|strel|stretchlim|subimage|tformarray|tformfwd|tforminv|tonemap|translate|truesize|uintlut|viscircles|warp|watershed|whitepoint|wiener2|xyz2double|xyz2uint16|ycbcr2rgb)\b/, +a],["fun_tbx",/^\b(?:bintprog|color|fgoalattain|fminbnd|fmincon|fminimax|fminsearch|fminunc|fseminf|fsolve|fzero|fzmult|gangstr|ktrlink|linprog|lsqcurvefit|lsqlin|lsqnonlin|lsqnonneg|optimget|optimset|optimtool|quadprog)\b/,a],["ident",/^[A-Za-z]\w*(?:\.[A-Za-z]\w*)*/,a]]),["matlab-identifiers"]);b.registerLangHandler(b.createSimpleLexer([],e),["matlab-operators"]);b.registerLangHandler(b.createSimpleLexer(c,d),["matlab"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-ml.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-ml.js new file mode 100644 index 0000000..8ed2b0c --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-ml.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], +["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-mumps.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-mumps.js new file mode 100644 index 0000000..8a6b3fd --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-mumps.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"]|\\.)*"/,null,'"']],[["com",/^;[^\n\r]*/,null,";"],["dec",/^\$(?:d|device|ec|ecode|es|estack|et|etrap|h|horolog|i|io|j|job|k|key|p|principal|q|quit|st|stack|s|storage|sy|system|t|test|tl|tlevel|tr|trestart|x|y|z[a-z]*|a|ascii|c|char|d|data|e|extract|f|find|fn|fnumber|g|get|j|justify|l|length|na|name|o|order|p|piece|ql|qlength|qs|qsubscript|q|query|r|random|re|reverse|s|select|st|stack|t|text|tr|translate|nan)\b/i, +null],["kwd",/^(?:[^$]b|break|c|close|d|do|e|else|f|for|g|goto|h|halt|h|hang|i|if|j|job|k|kill|l|lock|m|merge|n|new|o|open|q|quit|r|read|s|set|tc|tcommit|tre|trestart|tro|trollback|ts|tstart|u|use|v|view|w|write|x|xecute)\b/i,null],["lit",/^[+-]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?/i],["pln",/^[a-z][^\W_]*/i],["pun",/^[^\w\t\n\r"$%;^\xa0]|_/]]),["mumps"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-n.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-n.js new file mode 100644 index 0000000..27812a5 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-n.js @@ -0,0 +1,4 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, +a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, +a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-pascal.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-pascal.js new file mode 100644 index 0000000..8435fad --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-pascal.js @@ -0,0 +1,3 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["str",/^'(?:[^\n\r'\\]|\\.)*(?:'|$)/,a,"'"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^\(\*[\S\s]*?(?:\*\)|$)|^{[\S\s]*?(?:}|$)/,a],["kwd",/^(?:absolute|and|array|asm|assembler|begin|case|const|constructor|destructor|div|do|downto|else|end|external|for|forward|function|goto|if|implementation|in|inline|interface|interrupt|label|mod|not|object|of|or|packed|procedure|program|record|repeat|set|shl|shr|then|to|type|unit|until|uses|var|virtual|while|with|xor)\b/i,a], +["lit",/^(?:true|false|self|nil)/i,a],["pln",/^[a-z][^\W_]*/i,a],["lit",/^(?:\$[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)/i,a,"0123456789"],["pun",/^.[^\s\w$'./@]*/,a]]),["pascal"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-proto.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-proto.js new file mode 100644 index 0000000..f006ad8 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-proto.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-r.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-r.js new file mode 100644 index 0000000..99af8f8 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-r.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^'\\]|\\[\S\s])*(?:'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![\w.])/],["lit",/^0[Xx][\dA-Fa-f]+([Pp]\d+)?[Li]?/],["lit",/^[+-]?(\d+(\.\d+)?|\.\d+)([Ee][+-]?\d+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|\d+))(?![\w.])/], +["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|[!*+/^]|%.*?%|[$=@~]|:{1,3}|[(),;?[\]{}])/],["pln",/^(?:[A-Za-z]+[\w.]*|\.[^\W\d][\w.]*)(?![\w.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-rd.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-rd.js new file mode 100644 index 0000000..7a7e43f --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-rd.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[@-Za-z]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[()[\]{}]+/]]),["Rd","rd"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-scala.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-scala.js new file mode 100644 index 0000000..3f97dba --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-scala.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], +["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-sql.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-sql.js new file mode 100644 index 0000000..8ec4280 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-sql.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|apply|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|connect|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|following|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|matched|merge|natural|national|nocheck|nonclustered|nocycle|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|partition|percent|pivot|plan|preceding|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rows?|rule|save|schema|select|session_user|set|setuser|shutdown|some|start|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|unbounded|union|unique|unpivot|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|within|writetext|xml)(?=[^\w-]|$)/i, +null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-tcl.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-tcl.js new file mode 100644 index 0000000..490f562 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-tcl.js @@ -0,0 +1,3 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^{+/,a,"{"],["clo",/^}+/,a,"}"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,a],["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit", +/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["tcl"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-tex.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-tex.js new file mode 100644 index 0000000..dcfdadd --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-tex.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-vb.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-vb.js new file mode 100644 index 0000000..ddde464 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-vb.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"\u201c\u201d'],["com",/^['\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\n\r_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, +null],["com",/^rem\b.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[!#%&@]+])?|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-vhdl.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-vhdl.js new file mode 100644 index 0000000..51f3017 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-vhdl.js @@ -0,0 +1,3 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, +null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], +["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-wiki.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-wiki.js new file mode 100644 index 0000000..96c1e34 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-wiki.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); +PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-xq.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-xq.js new file mode 100644 index 0000000..e323ae3 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-xq.js @@ -0,0 +1,3 @@ +PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[\w-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^@[\w-]+/],["tag",/^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["com",/^\(:[\S\s]*?:\)/],["pln",/^[(),/;[\]{}]$/],["str",/^(?:"(?:[^"\\{]|\\[\S\s])*(?:"|$)|'(?:[^'\\{]|\\[\S\s])*(?:'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], +["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], +["pln",/^[\w:-]+/],["pln",/^[\t\n\r \xa0]+/]]),["xq","xquery"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/lang-yaml.js b/dist/resources/static/js/lib/zui/lib/prettify/lang-yaml.js new file mode 100644 index 0000000..c38729b --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/lang-yaml.js @@ -0,0 +1,2 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); diff --git a/dist/resources/static/js/lib/zui/lib/prettify/prettify.css b/dist/resources/static/js/lib/zui/lib/prettify/prettify.css new file mode 100644 index 0000000..0007f7f --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/prettify.css @@ -0,0 +1,2 @@ +/*! Apache License 2.0 https://github.com/google/code-prettify*/ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/dist/resources/static/js/lib/zui/lib/prettify/prettify.js b/dist/resources/static/js/lib/zui/lib/prettify/prettify.js new file mode 100644 index 0000000..6aa972c --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/prettify/prettify.js @@ -0,0 +1,31 @@ +/*! Apache License 2.0 https://github.com/google/code-prettify*/ +!function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a= +b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;ah[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com", +/^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+ +s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/, +q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d= +c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], +O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, +V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", +/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], +["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}), +["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q, +hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); +p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="
      "+a+"
      ";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1}); +return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i=0;){var M=A[m],T=M.src.match(/^[^#?]*\/run_prettify\.js(\?[^#]*)?(?:#.*)?$/);if(T){z=T[1]||"";M.parentNode.removeChild(M);break}}var S=!0,D= +[],N=[],K=[];z.replace(/[&?]([^&=]+)=([^&]+)/g,function(e,j,w){w=decodeURIComponent(w);j=decodeURIComponent(j);j=="autorun"?S=!/^[0fn]/i.test(w):j=="lang"?D.push(w):j=="skin"?N.push(w):j=="callback"&&K.push(w)});m=0;for(z=D.length;m122||(o<65||k>90||f.push([Math.max(65,k)|32,Math.min(o,90)|32]),o<97||k>122||f.push([Math.max(97,k)&-33,Math.min(o,122)&-33]))}}f.sort(function(f,a){return f[0]- +a[0]||a[1]-f[1]});b=[];g=[];for(a=0;ak[0]&&(k[1]+1>k[0]&&c.push("-"),c.push(h(k[1])));c.push("]");return c.join("")}function e(f){for(var a=f.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],g=0,k=0;g=2&&f==="["?a[g]=b(o):f!=="\\"&&(a[g]=o.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var j=0,F=!1,l=!1,I=0,c=a.length;I=5&&"lang-"===y.substring(0,5))&&!(u&&typeof u[1]==="string"))g=!1,y="src";g||(m[B]=y)}k=c;c+=B.length;if(g){g=u[1];var o=B.indexOf(g),H=o+g.length;u[2]&&(H=B.length-u[2].length,o=H-g.length);y=y.substring(5);n(l+k,B.substring(0,o),h,j);n(l+k+o,g,A(y, +g),j);n(l+k+H,B.substring(H),h,j)}else j.push(l+k,y)}a.g=j}var b={},e;(function(){for(var h=a.concat(d),l=[],i={},c=0,p=h.length;c=0;)b[q.charAt(f)]=m;m=m[1];q=""+m;i.hasOwnProperty(q)||(l.push(m),i[q]=r)}l.push(/[\S\s]/);e=j(l)})();var i=d.length;return h}function t(a){var d=[],h=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/, +r,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,r,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,r,"\"'"]);a.verbatimStrings&&h.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,r]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,r,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/, +r,"#"]),h.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,r])):d.push(["com",/^#[^\n\r]*/,r,"#"]));a.cStyleComments&&(h.push(["com",/^\/\/[^\n\r]*/,r]),h.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,r]));if(b=a.regexLiterals){var e=(b=b>1?"":"\n\r")?".":"[\\S\\s]";h.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+ +("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+e+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+e+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&h.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&h.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),r]);d.push(["pln",/^\s+/,r," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");h.push(["lit",/^@[$_a-z][\w$@]*/i,r],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,r],["pln",/^[$_a-z][\w$@]*/i,r],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i, +r,"0123456789"],["pln",/^\\[\S\s]?/,r],["pun",RegExp(b),r]);return C(d,h)}function z(a,d,h){function b(a){var c=a.nodeType;if(c==1&&!j.test(a.className))if("br"===a.nodeName)e(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&h){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),e(a),c||a.parentNode.removeChild(a)}} +function e(a){function b(a,c){var d=c?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),h=a.nextSibling;f.appendChild(d);for(var e=h;e;e=h)h=e.nextSibling,f.appendChild(e)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var j=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,l=a.ownerDocument,i=l.createElement("li");a.firstChild;)i.appendChild(a.firstChild);for(var c=[i],p=0;p=0;){var b=d[h];U.hasOwnProperty(b)?V.console&&console.warn("cannot override language handler %s",b):U[b]=a}}function A(a,d){if(!a||!U.hasOwnProperty(a))a=/^\s*=o&&(b+=2);h>=H&&(t+=2)}}finally{if(g)g.style.display=k}}catch(v){V.console&&console.log(v&&v.stack||v)}}var V=window,G=["break,continue,do,else,for,if,return,while"],O=[[G,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],J=[O,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],K=[O,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], +L=[K,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],O=[O,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],M=[G,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +N=[G,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],R=[G,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],G=[G,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Q=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, +S=/\S/,T=t({keywords:[J,L,O,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",M,N,G],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),U={};i(T,["default-code"]);i(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", +/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);i(C([["pln",/^\s+/,r," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,r,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], +["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);i(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);i(t({keywords:J,hashComments:!0,cStyleComments:!0,types:Q}),["c","cc","cpp","cxx","cyc","m"]);i(t({keywords:"null,true,false"}),["json"]);i(t({keywords:L,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Q}), +["cs"]);i(t({keywords:K,cStyleComments:!0}),["java"]);i(t({keywords:G,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);i(t({keywords:M,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);i(t({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);i(t({keywords:N, +hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);i(t({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);i(t({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);i(t({keywords:R,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); +i(C([],[["str",/^[\S\s]+/]]),["regex"]);var X=V.PR={createSimpleLexer:C,registerLangHandler:i,sourceDecorator:t,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,e){var b=document.createElement("div");b.innerHTML="
      "+a+"
      ";b=b.firstChild;e&&z(b,e,!0);D({h:d,j:e,c:b,i:1});return b.innerHTML}, +prettyPrint:e=e=function(a,d){function e(){for(var b=V.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p= a.left && x <= (a.left + a.width) && y >= a.top && y <= (a.top + a.height); + }; + + var isIntersectArea = function(a, b) { + var x1 = Math.max(a.left, b.left), + y1 = Math.max(a.top, b.top), + x2 = Math.min(a.left + a.width, b.left + b.width), + y2 = Math.min(a.top + a.height, b.top + b.height); + + return isPointInner(x1, y1, a) && isPointInner(x2, y2, a) && isPointInner(x1, y1, b) && isPointInner(x2, y2, b); + }; + + // default options + Selectable.DEFAULTS = { + selector: 'li,tr,div', + trigger: '', + selectClass: 'active', + rangeStyle: { + border: '1px solid ' + ($.zui.colorset ? $.zui.colorset.primary : '#3280fc'), + backgroundColor: $.zui.colorset ? (new $.zui.Color($.zui.colorset.primary).fade(20).toCssStr()) : 'rgba(50, 128, 252, 0.2)' + }, + clickBehavior: 'toggle', + ignoreVal: 3, + listenClick: true + // mouseButton: -1 // 0, 1, 2, -1, all, left, right, middle + }; + + // Get and init options + Selectable.prototype.getOptions = function(options) { + this.options = $.extend({}, Selectable.DEFAULTS, this.$.data(), options); + }; + + Selectable.prototype.select = function(elementOrid) { + this.toggle(elementOrid, true); + }; + + Selectable.prototype.unselect = function(elementOrid) { + this.toggle(elementOrid, false); + }; + + Selectable.prototype.toggle = function(elementOrid, isSelect, handle) { + var $element, id, selector = this.options.selector, that = this; + if(elementOrid === undefined) { + this.$.find(selector).each(function() { + that.toggle(this, isSelect); + }); + return; + } else if(typeof elementOrid === 'object') { + $element = $(elementOrid).closest(selector); + id = $element.data('id'); + } else { + id = elementOrid; + $element = that.$.find('.slectable-item[data-id="' + id + '"]'); + } + if($element && $element.length) { + if(!id) { + id = $.zui.uuid(); + $element.attr('data-id', id); + } + if(isSelect === undefined || isSelect === null) { + isSelect = !that.selections[id]; + } + if(!!isSelect !== !!that.selections[id]) { + var handleResult; + if($.isFunction(handle)) { + handleResult = handle(isSelect); + } + if(handleResult !== true) { + that.selections[id] = isSelect ? that.selectOrder++ : false; + that.callEvent(isSelect ? 'select' : 'unselect', {id: id, selections: that.selections, target: $element, selected: that.getSelectedArray()}, that); + } + } + if (that.options.selectClass) { + $element.toggleClass(that.options.selectClass, isSelect); + } + } + }; + + Selectable.prototype.getSelectedArray = function() { + var selected = []; + $.each(this.selections, function(thisId, thisIsSelected) { + if(thisIsSelected) selected.push(thisId); + }); + return selected; + }; + + Selectable.prototype.syncSelectionsFromClass = function() { + var that = this; + var $children = that.$children = that.$.find(that.options.selector); + that.selections = {}; + that.$children.each(function() { + var $item = $(this); + that.selections[$item.data('id')] = $item.hasClass(that.options.selectClass); + }); + }; + + Selectable.prototype._init = function() { + var options = this.options, that = this; + var ignoreVal = options.ignoreVal; + var isIgnoreMove = true; + var eventNamespace = '.' + this.name + '.' + this.id; + var startX, startY, $range, range, x, y, checkRangeCall; + var checkFunc = $.isFunction(options.checkFunc) ? options.checkFunc : null; + var rangeFunc = $.isFunction(options.rangeFunc) ? options.rangeFunc : null; + var isMouseDown = false; + var mouseDownBackEventCall = null; + var mouseDownEventName = 'mousedown' + eventNamespace; + + var checkRange = function() { + if(!range) return; + that.$children.each(function() { + var $item = $(this); + var offset = $item.offset(); + offset.width = $item.outerWidth(); + offset.height = $item.outerHeight(); + var isIntersect = rangeFunc ? rangeFunc.call(this, range, offset) : isIntersectArea(range, offset); + if(checkFunc) { + var result = checkFunc.call(that, { + intersect: isIntersect, + target: $item, + range: range, + targetRange: offset + }); + if(result === true) { + that.select($item); + } else if(result === false) { + that.unselect($item); + } + } else { + if(isIntersect) { + that.select($item); + } else if(!that.multiKey) { + that.unselect($item); + } + } + }); + }; + + var mousemove = function(e) { + if(!isMouseDown) return; + x = e.pageX; + y = e.pageY; + range = { + width: Math.abs(x - startX), + height: Math.abs(y - startY), + left: x > startX ? startX : x, + top: y > startY ? startY : y + }; + + if(isIgnoreMove && range.width < ignoreVal && range.height < ignoreVal) return; + if(!$range) { + $range = $('.selectable-range[data-id="' + that.id + '"]'); + if(!$range.length) { + $range = $('
      ') + .css($.extend({ + zIndex: 1060, + position: 'absolute', + top: startX, + left: startY, + pointerEvents: 'none', + }, that.options.rangeStyle)) + .appendTo($('body')); + } + } + $range.css(range); + clearTimeout(checkRangeCall); + checkRangeCall = setTimeout(checkRange, 10); + isIgnoreMove = false; + }; + + var mouseup = function(e) { + $(document).off(eventNamespace); + clearTimeout(mouseDownBackEventCall); + if(!isMouseDown) return; + isMouseDown = false; + if($range) $range.remove(); + if(!isIgnoreMove) + { + if(range) { + clearTimeout(checkRangeCall); + checkRange(); + range = null; + } + } + that.callEvent('finish', {selections: that.selections, selected: that.getSelectedArray()}); + e.preventDefault(); + }; + + var mousedown = function(e) { + if(isMouseDown) { + return mouseup(e); + } + + var mouseButton = $.zui.getMouseButtonCode(options.mouseButton); + if(mouseButton > -1 && e.button !== mouseButton) { + return; + } + + if(that.altKey || e.which === 3 || that.callEvent('start', e) === false) { + return; + } + + var $children = that.$children = that.$.find(options.selector); + $children.addClass('slectable-item'); + + var clickBehavior = that.multiKey ? 'multi' : options.clickBehavior; + if(clickBehavior === 'single') { + that.unselect(); + } + if (options.listenClick) { + if(clickBehavior === 'multi') { + that.toggle(e.target); + } else if(clickBehavior === 'single') { + that.select(e.target); + } else if(clickBehavior === 'toggle') { + that.toggle(e.target, null, function(isSelect) { + that.unselect(); + }); + } + } + + if(that.callEvent('startDrag', e) === false) { + that.callEvent('finish', {selections: that.selections, selected: that.getSelectedArray()}); + return; + } + + startX = e.pageX; + startY = e.pageY; + + $range = null; + isIgnoreMove = true; + isMouseDown = true; + + $(document).on('mousemove' + eventNamespace, mousemove).on('mouseup' + eventNamespace, mouseup); + mouseDownBackEventCall = setTimeout(function() { + $(document).on(mouseDownEventName, mouseup); + }, 10); + e.preventDefault(); + }; + + var $container = options.container && options.container !== 'default' ? $(options.container) : this.$; + if(options.trigger) { + $container.on(mouseDownEventName, options.trigger, mousedown); + } else { + $container.on(mouseDownEventName, mousedown); + } + + $(document).on('keydown', function(e) { + var code = e.keyCode; + if(code === 17 || code == 91) that.multiKey = code; + else if(code === 18) that.altKey = true; + }).on('keyup', function(e) { + that.multiKey = false; + that.altKey = false; + }); + }; + + // Call event helper + Selectable.prototype.callEvent = function(name, params) { + var event = $.Event(name + '.' + this.name); + this.$.trigger(event, params); + var result = event.result; + var callback = this.options[name]; + if($.isFunction(callback)) { + result = callback.apply(this, $.isArray(params) ? params : [params]); + } + return result; + }; + + // Extense jquery element + $.fn.selectable = function(option) { + return this.each(function() { + var $this = $(this); + var data = $this.data(name); + var options = typeof option == 'object' && option; + + if(!data) $this.data(name, (data = new Selectable(this, options))); + + if(typeof option == 'string') data[option](); + }); + }; + + $.fn.selectable.Constructor = Selectable; + + // Auto call selectable after document load complete + $(function() { + $('[data-ride="selectable"]').selectable(); + }); +}(jQuery)); + diff --git a/dist/resources/static/js/lib/zui/lib/selectable/zui.selectable.min.js b/dist/resources/static/js/lib/zui/lib/selectable/zui.selectable.min.js new file mode 100644 index 0000000..cd49678 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/selectable/zui.selectable.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: 拖拽选择 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +!function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),s=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(s,l,t)&&n(i,o,e)&&n(s,l,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,s,l=this.options.selector,c=this;if(void 0===e)return void this.$.find(l).each(function(){c.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(l),s=o.data("id")):(s=e,o=c.$.find('.slectable-item[data-id="'+s+'"]')),o&&o.length){if(s||(s=t.zui.uuid(),o.attr("data-id",s)),void 0!==i&&null!==i||(i=!c.selections[s]),!!i!=!!c.selections[s]){var a;t.isFunction(n)&&(a=n(i)),a!==!0&&(c.selections[s]=!!i&&c.selectOrder++,c.callEvent(i?"select":"unselect",{id:s,selections:c.selections,target:o,selected:c.getSelectedArray()},c))}c.options.selectClass&&o.toggleClass(c.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this;e.$children=e.$.find(e.options.selector);e.selections={},e.$children.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,s,l,c,a,r=this.options,u=this,h=r.ignoreVal,d=!0,g="."+this.name+"."+this.id,f=t.isFunction(r.checkFunc)?r.checkFunc:null,p=t.isFunction(r.rangeFunc)?r.rangeFunc:null,v=!1,y=null,m="mousedown"+g,b=function(){s&&u.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=p?p.call(this,s,i):o(s,i);if(f){var l=f.call(u,{intersect:n,target:e,range:s,targetRange:i});l===!0?u.select(e):l===!1&&u.unselect(e)}else n?u.select(e):u.multiKey||u.unselect(e)})},C=function(o){v&&(l=o.pageX,c=o.pageY,s={width:Math.abs(l-e),height:Math.abs(c-i),left:l>e?e:l,top:c>i?i:c},d&&s.width
      ').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},u.options.rangeStyle)).appendTo(t("body")))),n.css(s),clearTimeout(a),a=setTimeout(b,10),d=!1))},$=function(e){t(document).off(g),clearTimeout(y),v&&(v=!1,n&&n.remove(),d||s&&(clearTimeout(a),b(),s=null),u.callEvent("finish",{selections:u.selections,selected:u.getSelectedArray()}),e.preventDefault())},w=function(o){if(v)return $(o);var s=t.zui.getMouseButtonCode(r.mouseButton);if(!(s>-1&&o.button!==s||u.altKey||3===o.which||u.callEvent("start",o)===!1)){var l=u.$children=u.$.find(r.selector);l.addClass("slectable-item");var c=u.multiKey?"multi":r.clickBehavior;if("single"===c&&u.unselect(),r.listenClick&&("multi"===c?u.toggle(o.target):"single"===c?u.select(o.target):"toggle"===c&&u.toggle(o.target,null,function(t){u.unselect()})),u.callEvent("startDrag",o)===!1)return void u.callEvent("finish",{selections:u.selections,selected:u.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,d=!0,v=!0,t(document).on("mousemove"+g,C).on("mouseup"+g,$),y=setTimeout(function(){t(document).on(m,$)},10),o.preventDefault()}},F=r.container&&"default"!==r.container?t(r.container):this.$;r.trigger?F.on(m,r.trigger,w):F.on(m,w),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?u.multiKey=e:18===e&&(u.altKey=!0)}).on("keyup",function(t){u.multiKey=!1,u.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,s=this.options[e];return t.isFunction(s)&&(o=s.apply(this,t.isArray(i)?i:[i])),o},t.fn.selectable=function(n){return this.each(function(){var o=t(this),s=o.data(e),l="object"==typeof n&&n;s||o.data(e,s=new i(this,l)),"string"==typeof n&&s[n]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery); \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/sortable/.pydio b/dist/resources/static/js/lib/zui/lib/sortable/.pydio new file mode 100644 index 0000000..4552a1c --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/sortable/.pydio @@ -0,0 +1 @@ +6fb8b8a6-e803-4fcc-8769-23db63242c12 \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/sortable/zui.sortable.js b/dist/resources/static/js/lib/zui/lib/sortable/zui.sortable.js new file mode 100644 index 0000000..798b252 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/sortable/zui.sortable.js @@ -0,0 +1,178 @@ +/*! + * ZUI: 排序 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/* ======================================================================== + * ZUI: sortable.js + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + ++ function($, window, document) { + 'use strict'; + + if(!$.fn.droppable) { + console.error('Sortable requires droppable.js'); + return; + } + + var NAME = 'zui.sortable', + DEFAULTS = { + selector : 'li,div', + dragCssClass : 'invisible', + sortingClass : 'sortable-sorting' + }, + STR_ORDER = 'order'; + + var Sortable = function(element, options) { + var that = this; + that.$ = $(element); + that.options = $.extend({}, DEFAULTS, that.$.data(), options); + that.init(); + }; + + Sortable.DEFAULTS = DEFAULTS; + Sortable.NAME = NAME; + + Sortable.prototype.init = function() { + var that = this, + $root = that.$, + options = that.options, + selector = options.selector, + containerSelector = options.containerSelector, + sortingClass = options.sortingClass, + dragCssClass = options.dragCssClass, + targetSelector = options.targetSelector, + isReverse = options.reverse, + orderChanged; + + var markOrders = function($items) { + $items = $items || that.getItems(1); + var itemsCount = $items.length; + if (itemsCount) { + $items.each(function(itemIndex) { + var itemOrder = isReverse ? itemsCount - itemIndex : itemIndex; + $(this).attr('data-' + STR_ORDER, itemOrder).data(STR_ORDER, itemOrder); + }); + } + }; + + markOrders(); + + $root.droppable({ + handle : options.trigger, + target : targetSelector ? targetSelector : (containerSelector ? (selector + ',' + containerSelector) : selector), + selector : selector, + container : $root, + always : options.always, + flex : true, + lazy : options.lazy, + canMoveHere : options.canMoveHere, + dropToClass : options.dropToClass, + before : options.before, + nested : !!containerSelector, + mouseButton : options.mouseButton, + stopPropagation : options.stopPropagation, + start: function(e) { + if(dragCssClass) e.element.addClass(dragCssClass); + orderChanged = false; + that.trigger('start', e); + }, + drag: function(e) { + $root.addClass(sortingClass); + if(e.isIn) { + var $ele = e.element, + $target = e.target, + isContainer = containerSelector && $target.is(containerSelector); + + if (isContainer) { + if (!$target.children(selector).filter('.dragging').length) { + $target.append($ele); + var $items = that.getItems(1); + markOrders($items); + that.trigger(STR_ORDER, { + list: $items, + element: $ele + }); + } + return; + } + + var eleOrder = $ele.data(STR_ORDER), + targetOrder = $target.data(STR_ORDER); + if(eleOrder === targetOrder) return markOrders($items); + else if(eleOrder > targetOrder) { + $target[isReverse ? 'after' : 'before']($ele); + } else { + $target[isReverse ? 'before' : 'after']($ele); + } + orderChanged = true; + var $items = that.getItems(1); + markOrders($items); + that.trigger(STR_ORDER, { + list: $items, + element: $ele + }); + } + }, + finish: function(e) { + if(dragCssClass && e.element) e.element.removeClass(dragCssClass); + $root.removeClass(sortingClass); + that.trigger('finish', { + list: that.getItems(), + element: e.element, + changed: orderChanged + }); + } + }); + }; + + Sortable.prototype.destroy = function() { + this.$.droppable('destroy'); + this.$.data(NAME, null); + }; + + Sortable.prototype.reset = function() { + this.destroy(); + this.init(); + }; + + Sortable.prototype.getItems = function(onlyElements) { + var $items = this.$.find(this.options.selector).not('.drag-shadow'); + if(!onlyElements) { + return $items.map(function() { + var $item = $(this); + return { + item: $item, + order: $item.data('order') + }; + }); + } + return $items; + }; + + Sortable.prototype.trigger = function(name, params) { + return $.zui.callEvent(this.options[name], params, this); + }; + + $.fn.sortable = function(option) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new Sortable(this, options))); + else if(typeof option == 'object') data.reset(); + + if(typeof option == 'string') data[option](); + }); + }; + + $.fn.sortable.Constructor = Sortable; +}(jQuery, window, document); + diff --git a/dist/resources/static/js/lib/zui/lib/sortable/zui.sortable.min.js b/dist/resources/static/js/lib/zui/lib/sortable/zui.sortable.min.js new file mode 100644 index 0000000..a1e95b1 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/sortable/zui.sortable.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: 排序 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ ++function(t,e,r){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var o="zui.sortable",n={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},s="order",a=function(e,r){var o=this;o.$=t(e),o.options=t.extend({},n,o.$.data(),r),o.init()};a.DEFAULTS=n,a.NAME=o,a.prototype.init=function(){var e,r=this,o=r.$,n=r.options,a=n.selector,i=n.containerSelector,l=n.sortingClass,d=n.dragCssClass,f=n.targetSelector,c=n.reverse,g=function(e){e=e||r.getItems(1);var o=e.length;o&&e.each(function(e){var r=c?o-e:e;t(this).attr("data-"+s,r).data(s,r)})};g(),o.droppable({handle:n.trigger,target:f?f:i?a+","+i:a,selector:a,container:o,always:n.always,flex:!0,lazy:n.lazy,canMoveHere:n.canMoveHere,dropToClass:n.dropToClass,before:n.before,nested:!!i,mouseButton:n.mouseButton,stopPropagation:n.stopPropagation,start:function(t){d&&t.element.addClass(d),e=!1,r.trigger("start",t)},drag:function(t){if(o.addClass(l),t.isIn){var n=t.element,d=t.target,f=i&&d.is(i);if(f){if(!d.children(a).filter(".dragging").length){d.append(n);var p=r.getItems(1);g(p),r.trigger(s,{list:p,element:n})}return}var u=n.data(s),h=d.data(s);if(u===h)return g(p);u>h?d[c?"after":"before"](n):d[c?"before":"after"](n),e=!0;var p=r.getItems(1);g(p),r.trigger(s,{list:p,element:n})}},finish:function(t){d&&t.element&&t.element.removeClass(d),o.removeClass(l),r.trigger("finish",{list:r.getItems(),element:t.element,changed:e})}})},a.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(o,null)},a.prototype.reset=function(){this.destroy(),this.init()},a.prototype.getItems=function(e){var r=this.$.find(this.options.selector).not(".drag-shadow");return e?r:r.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},a.prototype.trigger=function(e,r){return t.zui.callEvent(this.options[e],r,this)},t.fn.sortable=function(e){return this.each(function(){var r=t(this),n=r.data(o),s="object"==typeof e&&e;n?"object"==typeof e&&n.reset():r.data(o,n=new a(this,s)),"string"==typeof e&&n[e]()})},t.fn.sortable.Constructor=a}(jQuery,window,document); \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/tabs/.pydio b/dist/resources/static/js/lib/zui/lib/tabs/.pydio new file mode 100644 index 0000000..d4f200e --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/tabs/.pydio @@ -0,0 +1 @@ +46adcce8-fa51-457e-ab28-f9c463df65cb \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.css b/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.css new file mode 100644 index 0000000..b867823 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.css @@ -0,0 +1,146 @@ +/*! + * ZUI: 标签页管理器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +.tabs { + position: relative; + min-height: 400px; + } +.tabs-navbar { + padding: 4px 4px 0 4px; + } +.tabs-nav { + height: 30px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border-bottom: none; + border-bottom: 1px solid #ddd; + } +.tab-nav-item { + width: 160px; + min-width: 0; + max-width: 160px; + padding-right: 2px; + margin-bottom: 0; + border: none; + } +.tab-nav-item:hover { + min-width: 95px; + } +.tab-nav-link { + position: relative; + height: 30px; + margin: 0; + overflow: hidden; + background-color: rgba(255, 255, 255, .65); + background-color: #e5e5e5; + border-color: #ddd; + border-bottom: none; + border-radius: 2px 2px 0 0; + } +.tab-nav-link > .title { + position: absolute; + top: 5px; + right: 5px; + left: 30px; + display: block; + overflow: hidden; + font-size: 14px; + line-height: 20px; + text-overflow: ellipsis; + white-space: nowrap; + } +.tab-nav-link > .icon { + position: absolute; + top: 5px; + left: 5px; + display: block; + width: 20px; + height: 20px; + line-height: 20px; + text-align: center; + opacity: .8; + } +.tab-nav-item.loading .tab-nav-link > .icon:before { + content: '\e97b'; + -webkit-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; + } +.tab-nav-link > .close { + position: absolute; + top: 5px; + right: 5px; + width: 20px; + height: 20px; + font-weight: 200; + line-height: 16px; + text-align: center; + text-shadow: none; + visibility: hidden; + border-radius: 4px; + opacity: 0; + -webkit-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; + } +.tab-nav-link > .close:hover { + color: #fff; + background-color: #ea644a; + } +.tab-nav-link:hover > .title { + right: 25px; + } +.tab-nav-link:hover > .close { + visibility: visible; + opacity: 1; + } +.tab-nav-link.not-closable > .close { + display: none; + } +.nav-tabs.tabs-nav > li > a, +.nav-tabs.tabs-nav > li > a:hover, +.nav-tabs.tabs-nav > li > a:focus { + border-color: #ddd #ddd transparent #ddd; + } +.tab-nav-condensed .tab-nav-link > .title { + left: 5px; + text-overflow: initial; + } +.tab-nav-condensed .tab-nav-link > .icon { + display: none; + } +.tabs-container { + position: absolute; + top: 34px; + right: 0; + bottom: 0; + left: 0; + } +.tabs-container > .tab-pane { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + display: none; + } +.tabs-container > .tab-pane.active { + display: block; + } +.tab-iframe-cover { + display: none; + } +.tabs-show-contextmenu .tab-iframe-cover { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + display: block; + } diff --git a/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.js b/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.js new file mode 100644 index 0000000..b0fd0c8 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.js @@ -0,0 +1,488 @@ +/*! + * ZUI: 标签页管理器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/* ======================================================================== + * ZUI: tabs.js + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2017-2018 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + +(function($) { + 'use strict'; + + /** + * Tab object + * @param {Object | String} tab + */ + var Tab = function(tab) { + var that = this; + if(typeof tab === 'string') { + that.url = tab; + } else if($.isPlainObject(tab)) { + $.extend(that, tab); + } + if(!that.id) { + that.id = $.zui.uuid(); + } + if(!that.type) { + if(that.iframe) { + that.type = 'iframe'; + that.url = that.url || that.iframe; + } else if(that.ajax) { + that.type = 'ajax'; + that.url = that.url || ($.isPlainObject(that.ajax) ? that.ajax.url : that.ajax); + } else if(that.url) { + that.type = tab.ajax ? 'ajax' : 'iframe'; + } else { + that.type = 'custom'; + } + } + that.createTime = new Date().getTime(); + that.openTime = 0; + that.onCreate && that.onCreate.call(that); + }; + + Tab.prototype.open = function() { + var that = this; + that.openTime = new Date().getTime(); + that.onOpen && that.onOpen.call(that); + }; + + Tab.prototype.close = function() { + var that = this; + that.openTime = 0; + that.onClose && that.onClose.call(that); + }; + + Tab.create = function(data) { + if (data instanceof Tab) { + return data; + } + return new Tab(data); + }; + + var NAME = 'zui.tabs'; // model name + var DEFAULTS = { + tabs: [], + defaultTabIcon: 'icon-window', + contextMenu: true, + errorTemplate: '
      {0}
      ', + // messagerOptions: null, + showMessage: true, + navTemplate: '', + containerTemplate: '
      ' + }; + + var LANG = { + zh_cn: { + reload: '重新加载', + close: '关闭', + closeOthers: '关闭其他标签页', + closeRight: '关闭右侧标签页', + reopenLast: '恢复上次关闭的标签页', + errorCannotFetchFromRemote: '无法从远程服务器({0})获取内容。' + }, + zh_tw: { + reload: '重新加載', + close: '關閉', + closeOthers: '關閉其他標籤頁', + closeRight: '關閉右側標籤頁', + reopenLast: '恢復上次關閉的標籤頁', + errorCannotFetchFromRemote: '無法從遠程服務器({0})獲取內容。' + }, + en: { + reload: 'Reload', + close: 'Close', + closeOthers: 'Close others', + closeRight: 'Close right', + reopenLast: 'Reopen last', + errorCannotFetchFromRemote: 'Cannot fetch data from remote server {0}.' + } + }; + + // The tabs model class + var Tabs = function(element, options) { + var that = this; + that.name = NAME; + that.$ = $(element); + + options = that.options = $.extend({}, DEFAULTS, this.$.data(), options); + var lang = options.lang || 'zh_cn'; + that.lang = $.isPlainObject(lang) ? ($.extend(true, {}, LANG[lang.lang || $.zui.clientLang()], lang)) : LANG[lang]; + + // Initialize here + var $navbar = that.$.find('.tabs-navbar'); + if (!$navbar.length) { + $navbar = $(options.navTemplate).appendTo(that.$); + } + that.$navbar = $navbar; + + var $nav = $navbar.find('.tabs-nav'); + if (!$nav.length) { + $nav = $('').appendTo($navbar); + } + that.$nav = $nav; + + var $tabs = that.$.find('.tabs-container'); + if (!$tabs.length) { + $tabs = $(options.containerTemplate).appendTo(that.$); + } + that.$tabs = $tabs; + + that.activeTabId = options.defaultTab; + var tabs = options.tabs || []; + that.tabs = {}; + $.each(tabs, function(index, item) { + var tab = Tab.create(item); + that.tabs[tab.id] = tab; + + if (!that.activeTabId) { + that.activeTabId = tab.id; + } + + that.renderTab(tab); + }); + that.closedTabs = []; + + that.open(that.getActiveTab()); + + $nav.on('click.' + NAME, '.tab-nav-link', function () { + that.open(that.getTab($(this).data('id'))); + }).on('click.' + NAME, '.tab-nav-close', function (e) { + that.close($(this).closest('.tab-nav-link').data('id')); + e.stopPropagation(); + }).on('resize.' + NAME, function () { + that.adjustNavs(); + }); + + if (options.contextMenu) { + $nav.contextmenu({ + selector: '.tab-nav-link', + itemsCreator: function (e) { + return that.createMenuItems(that.getTab($(this).data('id'))); + }, + onShow: function () { + that.$.addClass('tabs-show-contextmenu'); + }, + onHide: function () { + that.$.removeClass('tabs-show-contextmenu'); + } + }); + } + }; + + Tabs.prototype.createMenuItems = function (tab) { + var that = this; + var lang = that.lang; + return [{ + label: lang.reload, + onClick: function () { + that.open(tab, true); + } + }, '-', { + label: lang.close, + disabled: tab.forbidClose, + onClick: function () { + that.close(tab.id); + } + }, { + label: lang.closeOthers, + disabled: that.$nav.find('.tab-nav-item:not(.hidden)').length <= 1, + onClick: function () { + that.closeOthers(tab.id); + } + }, { + label: lang.closeRight, + disabled: !$('#tab-nav-item-' + tab.id).next('.tab-nav-item:not(.hidden)').length, + onClick: function () { + that.closeRight(tab.id); + } + }, '-', { + label: lang.reopenLast, + disabled: !that.closedTabs.length, + onClick: function () { + that.reopen(); + } + }]; + }; + + Tabs.prototype.adjustNavs = function (immediately) { + var that = this; + if (!immediately) { + if (that.adjustNavsTimer) { + clearTimeout(that.adjustNavsTimer); + } + that.adjustNavsTimer = setTimeout(function() { + that.adjustNavs(true); + }, 50); + return; + } + if (that.adjustNavsTimer) { + that.adjustNavsTimer = null; + } + var $nav = that.$nav; + var $navItems = $nav.find('.tab-nav-item:not(.hidden)'); + var totalWidth = $nav.width(); + var totalCount = $navItems.length; + var maxWidth = Math.floor(totalWidth/totalCount); + if(maxWidth < 96) { + maxWidth = Math.floor((totalWidth-96)/(totalCount-1)) + } + $nav.toggleClass('tab-nav-condensed', maxWidth <= 50); + $navItems.css('max-width', maxWidth); + }; + + Tabs.prototype.renderTab = function(tab, beforeTabId) { + var that = this; + var $nav = that.$nav; + var $tabNav = $('#tab-nav-item-' + tab.id); + if (!$tabNav.length) { + var $a = $('
      ×').attr({ + href: '#tabs-item-' + tab.id, + 'data-id': tab.id + }); + $tabNav = $('
    • ').append($a).appendTo(that.$nav); + if (beforeTabId) { + var $before$nav = $('#tab-nav-item-' + beforeTabId); + if ($before$nav.length) { + $tabNav.insertAfter($before$nav); + } + } + that.adjustNavs(); + } + var $a = $tabNav.find('a').attr('title', tab.desc).toggleClass('not-closable', !!tab.forbidClose); + $a.find('.icon').attr('class', 'icon ' + (tab.icon || that.options.defaultTabIcon)); + $a.find('.title').text(tab.title || tab.defaultTitle || ''); + return $tabNav; + }; + + Tabs.prototype.getActiveTab = function() { + var that = this; + return that.activeTabId ? that.tabs[that.activeTabId] : null; + }; + + Tabs.prototype.getTab = function(tabId) { + var that = this; + if (!tabId) { + return that.getActiveTab(); + } + if (typeof tabId === 'object') { + tabId = tabId.id; + } + return that.tabs[tabId]; + }; + + Tabs.prototype.close = function(tabId, forceClose) { + var that = this; + var tab = that.getTab(tabId); + if (tab && (forceClose || !tab.forbidClose)) { + $('#tab-nav-item-' + tab.id).remove(); + $('#tab-' + tab.id).remove(); + tab.close(); + delete that.tabs[tab.id]; + that.closedTabs.push(tab); + that.$.callComEvent(that, 'onClose', tab); + + var lastTab; + $.each(that.tabs, function (tabId, tab) { + if (!lastTab || lastTab.openTime < tab.openTime) { + lastTab = tab; + } + }); + lastTab && that.open(lastTab); + } + }; + + Tabs.prototype.open = function(tab, forceReload) { + var that = this; + + if (!(tab instanceof Tab)) { + tab = Tab.create(tab); + } + + var $tabNav = that.renderTab(tab); + that.$nav.find('.tab-nav-item.active').removeClass('active'); + $tabNav.addClass('active'); + + var $tabPane = $('#tab-' + tab.id); + if (!$tabPane.length) { + $tabPane = $('
      ').appendTo(that.$tabs); + } + that.$tabs.find('.tab-pane.active').removeClass('active'); + $tabPane.addClass('active'); + + tab.open(); + that.activeTabId = tab.id; + that.tabs[tab.id] = tab; + + if (forceReload || !tab.loaded) { + that.reload(tab); + } + + that.$.callComEvent(that, 'onOpen', tab); + }; + + Tabs.prototype.showMessage = function (message, type) { + $.zui.messager.show(message, $.extend({ + placement: 'center' + }, this.options.messagerOptions, { + type: type + })); + }; + + Tabs.prototype.reload = function(tab) { + var that = this; + + if (typeof tab === 'string') { + tab = that.getTab(tab); + } else if (!tab) { + tab = that.getActiveTab(); + } + + if (!tab) { + return; + } + + if (!tab.openTime) { + return that.open(tab); + } + + var $tabNav = $('#tab-nav-item-' + tab.id).addClass('loading').removeClass('has-error'); + var $tabPane = $('#tab-' + tab.id).addClass('loading').removeClass('has-error'); + var afterRefresh = function (content, error) { + if (!tab.openTime) { + return; + } + $tabNav.removeClass('loading'); + $tabPane.removeClass('loading'); + that.$.callComEvent(that, 'onLoad', tab); + if(typeof content === 'string' || content instanceof $) { + if (tab.contentConverter) { + content = tab.contentConverter(content, tab); + } + $tabPane.empty().append(content); + if (!tab.title) { + content = $tabPane.text().replace(/\n/g, ''); + tab.title = content.length > 10 ? content.substr(0, 10) : content; + that.renderTab(tab); + } + } + if (error) { + $tabNav.addClass('has-error'); + $tabPane.addClass('has-error'); + var showMessage = that.options.showMessage; + if (showMessage) { + if ($.isFunction(showMessage)) { + error = showMessage(error); + } + that.showMessage(error, 'danger'); + } + if (!content) { + $tabPane.html(that.options.errorTemplate.format(error)); + } + } + tab.loaded = new Date().getTime(); + }; + if (tab.type === 'ajax') { + var ajaxOption = { + type: 'get', + url: tab.url, + error: function(jqXHR, textStatus, errorThrown) { + afterRefresh(false, that.lang.errorCannotFetchFromRemote.format(tab.url)); + }, + success: function(data) { + afterRefresh(data); + } + }; + if($.isPlainObject(tab.ajax)) { + ajaxOption = $.extend(ajaxOption, tab.ajax); + } + $.ajax(ajaxOption); + } else if (tab.type === 'iframe') { + try { + var iframeName = 'tab-iframe-' + tab.id; + var $iframe = $(''); + $iframe.appendTo($tabPane.empty()); + $('
      ').appendTo($tabPane); + var frame = document.getElementById(iframeName); + frame.onload = frame.onreadystatechange = function() { + if(this.readyState && this.readyState != 'complete') return; + afterRefresh(); + var contentDocument = frame.contentDocument; + if (contentDocument && !tab.title) { + tab.title = contentDocument.title; + that.renderTab(tab); + } + }; + } catch (e) { + afterRefresh(); + } + } else { + var content = tab.content || tab.custom; + if (typeof content === 'function') { + content = content(tab, afterRefresh, that); + if (content !== true) { + afterRefresh(content); + } + } else { + afterRefresh(content); + } + } + }; + + Tabs.prototype.closeOthers = function(tabId) { + var that = this; + that.$nav.find('.tab-nav-link:not(.hidden)').each(function() { + var thisTabId = $(this).data('id'); + if (thisTabId !== tabId) { + that.close(thisTabId); + } + }); + }; + + Tabs.prototype.closeRight = function(tabId) { + var $tabNav = $('#tab-nav-item-' + tabId); + var $rightNav = $tabNav.next('.tab-nav-item:not(.hidden)'); + while ($rightNav.length) { + this.close($rightNav.data('id')); + $rightNav = $tabNav.next('.tab-nav-item:not(.hidden)'); + } + }; + + Tabs.prototype.closeAll = function() { + var that = this; + that.$nav.find('.tab-nav-link:not(.hidden)').each(function() { + that.close($(this).data('id')); + }); + }; + + Tabs.prototype.reopen = function() { + var that = this; + if(that.closedTabs.length) { + that.open(that.closedTabs.pop(), true); + } + }; + + // Extense jquery element + $.fn.tabs = function(option) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new Tabs(this, options))); + + if(typeof option == 'string') data[option](); + }); + }; + + Tabs.NAME = NAME; + $.fn.tabs.Constructor = Tabs; +}(jQuery)); + diff --git a/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.css b/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.css new file mode 100644 index 0000000..7a81ed5 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.css @@ -0,0 +1,6 @@ +/*! + * ZUI: 标签页管理器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */.tabs{position:relative;min-height:400px}.tabs-navbar{padding:4px 4px 0 4px}.tabs-nav{height:30px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-bottom:none;border-bottom:1px solid #ddd}.tab-nav-item{width:160px;min-width:0;max-width:160px;padding-right:2px;margin-bottom:0;border:none}.tab-nav-item:hover{min-width:95px}.tab-nav-link{position:relative;height:30px;margin:0;overflow:hidden;background-color:rgba(255,255,255,.65);background-color:#e5e5e5;border-color:#ddd;border-bottom:none;border-radius:2px 2px 0 0}.tab-nav-link>.title{position:absolute;top:5px;right:5px;left:30px;display:block;overflow:hidden;font-size:14px;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.tab-nav-link>.icon{position:absolute;top:5px;left:5px;display:block;width:20px;height:20px;line-height:20px;text-align:center;opacity:.8}.tab-nav-item.loading .tab-nav-link>.icon:before{content:'\e97b';-webkit-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}.tab-nav-link>.close{position:absolute;top:5px;right:5px;width:20px;height:20px;font-weight:200;line-height:16px;text-align:center;text-shadow:none;visibility:hidden;border-radius:4px;opacity:0;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s}.tab-nav-link>.close:hover{color:#fff;background-color:#ea644a}.tab-nav-link:hover>.title{right:25px}.tab-nav-link:hover>.close{visibility:visible;opacity:1}.tab-nav-link.not-closable>.close{display:none}.nav-tabs.tabs-nav>li>a,.nav-tabs.tabs-nav>li>a:focus,.nav-tabs.tabs-nav>li>a:hover{border-color:#ddd #ddd transparent #ddd}.tab-nav-condensed .tab-nav-link>.title{left:5px;text-overflow:initial}.tab-nav-condensed .tab-nav-link>.icon{display:none}.tabs-container{position:absolute;top:34px;right:0;bottom:0;left:0}.tabs-container>.tab-pane{position:absolute;top:0;right:0;bottom:0;left:0;display:none}.tabs-container>.tab-pane.active{display:block}.tab-iframe-cover{display:none}.tabs-show-contextmenu .tab-iframe-cover{position:absolute;top:0;right:0;bottom:0;left:0;display:block} \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.js b/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.js new file mode 100644 index 0000000..fbd6029 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: 标签页管理器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +!function(e){"use strict";var t=function(t){var a=this;"string"==typeof t?a.url=t:e.isPlainObject(t)&&e.extend(a,t),a.id||(a.id=e.zui.uuid()),a.type||(a.iframe?(a.type="iframe",a.url=a.url||a.iframe):a.ajax?(a.type="ajax",a.url=a.url||(e.isPlainObject(a.ajax)?a.ajax.url:a.ajax)):a.url?a.type=t.ajax?"ajax":"iframe":a.type="custom"),a.createTime=(new Date).getTime(),a.openTime=0,a.onCreate&&a.onCreate.call(a)};t.prototype.open=function(){var e=this;e.openTime=(new Date).getTime(),e.onOpen&&e.onOpen.call(e)},t.prototype.close=function(){var e=this;e.openTime=0,e.onClose&&e.onClose.call(e)},t.create=function(e){return e instanceof t?e:new t(e)};var a="zui.tabs",n={tabs:[],defaultTabIcon:"icon-window",contextMenu:!0,errorTemplate:'
      {0}
      ',showMessage:!0,navTemplate:'',containerTemplate:'
      '},o={zh_cn:{reload:"重新加载",close:"关闭",closeOthers:"关闭其他标签页",closeRight:"关闭右侧标签页",reopenLast:"恢复上次关闭的标签页",errorCannotFetchFromRemote:"无法从远程服务器({0})获取内容。"},zh_tw:{reload:"重新加載",close:"關閉",closeOthers:"關閉其他標籤頁",closeRight:"關閉右側標籤頁",reopenLast:"恢復上次關閉的標籤頁",errorCannotFetchFromRemote:"無法從遠程服務器({0})獲取內容。"},en:{reload:"Reload",close:"Close",closeOthers:"Close others",closeRight:"Close right",reopenLast:"Reopen last",errorCannotFetchFromRemote:"Cannot fetch data from remote server {0}."}},i=function(i,s){var r=this;r.name=a,r.$=e(i),s=r.options=e.extend({},n,this.$.data(),s);var l=s.lang||"zh_cn";r.lang=e.isPlainObject(l)?e.extend(!0,{},o[l.lang||e.zui.clientLang()],l):o[l];var c=r.$.find(".tabs-navbar");c.length||(c=e(s.navTemplate).appendTo(r.$)),r.$navbar=c;var d=c.find(".tabs-nav");d.length||(d=e('').appendTo(c)),r.$nav=d;var v=r.$.find(".tabs-container");v.length||(v=e(s.containerTemplate).appendTo(r.$)),r.$tabs=v,r.activeTabId=s.defaultTab;var p=s.tabs||[];r.tabs={},e.each(p,function(e,a){var n=t.create(a);r.tabs[n.id]=n,r.activeTabId||(r.activeTabId=n.id),r.renderTab(n)}),r.closedTabs=[],r.open(r.getActiveTab()),d.on("click."+a,".tab-nav-link",function(){r.open(r.getTab(e(this).data("id")))}).on("click."+a,".tab-nav-close",function(t){r.close(e(this).closest(".tab-nav-link").data("id")),t.stopPropagation()}).on("resize."+a,function(){r.adjustNavs()}),s.contextMenu&&d.contextmenu({selector:".tab-nav-link",itemsCreator:function(t){return r.createMenuItems(r.getTab(e(this).data("id")))},onShow:function(){r.$.addClass("tabs-show-contextmenu")},onHide:function(){r.$.removeClass("tabs-show-contextmenu")}})};i.prototype.createMenuItems=function(t){var a=this,n=a.lang;return[{label:n.reload,onClick:function(){a.open(t,!0)}},"-",{label:n.close,disabled:t.forbidClose,onClick:function(){a.close(t.id)}},{label:n.closeOthers,disabled:a.$nav.find(".tab-nav-item:not(.hidden)").length<=1,onClick:function(){a.closeOthers(t.id)}},{label:n.closeRight,disabled:!e("#tab-nav-item-"+t.id).next(".tab-nav-item:not(.hidden)").length,onClick:function(){a.closeRight(t.id)}},"-",{label:n.reopenLast,disabled:!a.closedTabs.length,onClick:function(){a.reopen()}}]},i.prototype.adjustNavs=function(e){var t=this;if(!e)return t.adjustNavsTimer&&clearTimeout(t.adjustNavsTimer),void(t.adjustNavsTimer=setTimeout(function(){t.adjustNavs(!0)},50));t.adjustNavsTimer&&(t.adjustNavsTimer=null);var a=t.$nav,n=a.find(".tab-nav-item:not(.hidden)"),o=a.width(),i=n.length,s=Math.floor(o/i);s<96&&(s=Math.floor((o-96)/(i-1))),a.toggleClass("tab-nav-condensed",s<=50),n.css("max-width",s)},i.prototype.renderTab=function(t,a){var n=this,o=(n.$nav,e("#tab-nav-item-"+t.id));if(!o.length){var i=e('×').attr({href:"#tabs-item-"+t.id,"data-id":t.id});if(o=e('
    • ').append(i).appendTo(n.$nav),a){var s=e("#tab-nav-item-"+a);s.length&&o.insertAfter(s)}n.adjustNavs()}var i=o.find("a").attr("title",t.desc).toggleClass("not-closable",!!t.forbidClose);return i.find(".icon").attr("class","icon "+(t.icon||n.options.defaultTabIcon)),i.find(".title").text(t.title||t.defaultTitle||""),o},i.prototype.getActiveTab=function(){var e=this;return e.activeTabId?e.tabs[e.activeTabId]:null},i.prototype.getTab=function(e){var t=this;return e?("object"==typeof e&&(e=e.id),t.tabs[e]):t.getActiveTab()},i.prototype.close=function(t,a){var n=this,o=n.getTab(t);if(o&&(a||!o.forbidClose)){e("#tab-nav-item-"+o.id).remove(),e("#tab-"+o.id).remove(),o.close(),delete n.tabs[o.id],n.closedTabs.push(o),n.$.callComEvent(n,"onClose",o);var i;e.each(n.tabs,function(e,t){(!i||i.openTime').appendTo(o.$tabs)),o.$tabs.find(".tab-pane.active").removeClass("active"),s.addClass("active"),a.open(),o.activeTabId=a.id,o.tabs[a.id]=a,!n&&a.loaded||o.reload(a),o.$.callComEvent(o,"onOpen",a)},i.prototype.showMessage=function(t,a){e.zui.messager.show(t,e.extend({placement:"center"},this.options.messagerOptions,{type:a}))},i.prototype.reload=function(t){var a=this;if("string"==typeof t?t=a.getTab(t):t||(t=a.getActiveTab()),t){if(!t.openTime)return a.open(t);var n=e("#tab-nav-item-"+t.id).addClass("loading").removeClass("has-error"),o=e("#tab-"+t.id).addClass("loading").removeClass("has-error"),i=function(i,s){if(t.openTime){if(n.removeClass("loading"),o.removeClass("loading"),a.$.callComEvent(a,"onLoad",t),("string"==typeof i||i instanceof e)&&(t.contentConverter&&(i=t.contentConverter(i,t)),o.empty().append(i),t.title||(i=o.text().replace(/\n/g,""),t.title=i.length>10?i.substr(0,10):i,a.renderTab(t))),s){n.addClass("has-error"),o.addClass("has-error");var r=a.options.showMessage;r&&(e.isFunction(r)&&(s=r(s)),a.showMessage(s,"danger")),i||o.html(a.options.errorTemplate.format(s))}t.loaded=(new Date).getTime()}};if("ajax"===t.type){var s={type:"get",url:t.url,error:function(e,n,o){i(!1,a.lang.errorCannotFetchFromRemote.format(t.url))},success:function(e){i(e)}};e.isPlainObject(t.ajax)&&(s=e.extend(s,t.ajax)),e.ajax(s)}else if("iframe"===t.type)try{var r="tab-iframe-"+t.id,l=e('');l.appendTo(o.empty()),e('
      ').appendTo(o);var c=document.getElementById(r);c.onload=c.onreadystatechange=function(){if(!this.readyState||"complete"==this.readyState){i();var e=c.contentDocument;e&&!t.title&&(t.title=e.title,a.renderTab(t))}}}catch(d){i()}else{var v=t.content||t.custom;"function"==typeof v?(v=v(t,i,a),v!==!0&&i(v)):i(v)}}},i.prototype.closeOthers=function(t){var a=this;a.$nav.find(".tab-nav-link:not(.hidden)").each(function(){var n=e(this).data("id");n!==t&&a.close(n)})},i.prototype.closeRight=function(t){for(var a=e("#tab-nav-item-"+t),n=a.next(".tab-nav-item:not(.hidden)");n.length;)this.close(n.data("id")),n=a.next(".tab-nav-item:not(.hidden)")},i.prototype.closeAll=function(){var t=this;t.$nav.find(".tab-nav-link:not(.hidden)").each(function(){t.close(e(this).data("id"))})},i.prototype.reopen=function(){var e=this;e.closedTabs.length&&e.open(e.closedTabs.pop(),!0)},e.fn.tabs=function(t){return this.each(function(){var n=e(this),o=n.data(a),s="object"==typeof t&&t;o||n.data(a,o=new i(this,s)),"string"==typeof t&&o[t]()})},i.NAME=a,e.fn.tabs.Constructor=i}(jQuery); \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/treemap/.pydio b/dist/resources/static/js/lib/zui/lib/treemap/.pydio new file mode 100644 index 0000000..7d9da35 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/treemap/.pydio @@ -0,0 +1 @@ +b4105d9b-0267-4418-bcc5-74ff7808092a \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.css b/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.css new file mode 100644 index 0000000..dccc4eb --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.css @@ -0,0 +1,120 @@ +/*! + * ZUI: 树形图 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +.treemap-data { + text-align: left; + } +.treemap-nodes { + position: relative; + display: table; + padding: 10px; + margin-right: auto; + margin-left: auto; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + } +.treemap-node { + display: table-cell; + vertical-align: top; + } +.treemap-node-wrapper { + position: relative; + z-index: 5; + display: inline-block; + padding: 5px 10px; + border: 1px solid #808080; + border-radius: 1px; + } +a.treemap-node-wrapper { + color: #353535; + cursor: pointer; + } +a.treemap-node-wrapper:active, +a.treemap-node-wrapper:focus, +a.treemap-node-wrapper:hover { + color: #3280fc; + text-decoration: none; + background-color: #ebf2f9; + border-color: #3280fc; + } +.treemap-node-root > .treemap-node-wrapper { + background-color: rgba(0, 0, 0, .1); + } +.treemap-node-children { + display: table; + margin-top: 20px auto 0; + } +.treemap-line-top, +.treemap-line-bottom { + position: absolute; + top: 100%; + left: 50%; + margin-left: -1px; + border-right: none!important; + border-bottom: none!important; + } +.treemap-line-top { + top: 0; + } +.treemap-node > .treemap-line { + position: absolute; + right: 0; + left: 0; + z-index: 1; + border-right: none!important; + border-bottom: none!important; + } +.treemap-node-fold-icon { + position: absolute; + top: -6px; + left: -5px; + z-index: 10; + display: block!important; + width: 10px; + height: 10px; + line-height: 10px; + color: #808080; + background-color: #fff; + border-radius: 5px; + opacity: 0; + -webkit-transition: opacity .2s, -webkit-transform .1s; + -o-transition: opacity .2s, -o-transform .1s; + transition: opacity .2s, -webkit-transform .1s; + transition: opacity .2s, transform .1s; + transition: opacity .2s, transform .1s, -webkit-transform .1s, -o-transform .1s; + } +.treemap-node-fold-icon:before { + min-width: 10px; + content: '\e6f2'; + } +.treemap-node-wrapper:hover .treemap-node-fold-icon { + opacity: 1; + } +.treemap-node.collapsed > .treemap-line, +.treemap-node.collapsed .treemap-line-bottom { + border-color: transparent!important; + } +.treemap-node.collapsed > .treemap-node-children { + display: none; + } +.treemap-node.collapsed .treemap-node-fold-icon { + top: -6px; + color: #808080; + opacity: 1; + -webkit-transform: none!important; + -ms-transform: none!important; + -o-transform: none!important; + transform: none!important; + } +.treemap-node.collapsed .treemap-node-fold-icon:before { + content: '\e6f1'; + } +.treemap-node.tree-node-collapsing > .treemap-line, +.treemap-node.tree-node-collapsing > .treemap-node-children { + visibility: hidden; + } diff --git a/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.js b/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.js new file mode 100644 index 0000000..bbbd58e --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.js @@ -0,0 +1,415 @@ +/*! + * ZUI: 树形图 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/* ======================================================================== + * ZUI: treemap.js + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + +// Tree map data format +// { +// text: main text, +// html: main text as html format +// style: node style, +// textColor: text color, +// color: background color +// border: border style, +// cableWidth: 2, +// cableColor: '#808080' +// cableStyle: 'solid' +// } + + +(function($, window, document, Math, undefined) { + 'use strict'; + + var NAME = 'zui.treemap', + DEFAULTS = { + data: [], + // direction: 'bottom', // or 'top', 'left', 'right' + cableWidth: 1, + cableColor: '#808080', + cableStyle: 'solid', + rowSpace: 30, + nodeSpace: 20, + listenNodeResize: true, + nodeTemplate: '
      ', + foldable: true, + clickNodeToFold: true, + // sort: false, // Boolean or function + // tooltip: null, + // nodeStyle: null, + }; + // var DEFAULT_NODE = { + // id: uuid(), // uuid + // text: '', // main text, + // html: '', // main text as html format + // style: null, // node element style + // textColor: '', // text color + // color: '', // background color + // border: '', // border style, + // tooltip: '' // node caption + // attrs: null // attrs + // title: '' // node title + // tooltip: '' // node tooltip + // }; + + var getDataFromUlList = function($list) { + return $list.children('li,.treemap-data-item').map(function() { + var $item = $(this), + item = $item.data(), + $text = $item.children('.text'), + $html = $item.children('.content'), + $children = $item.children('ul,.treemap-data-list'); + if($text.length) item.text = $text.text(); + if($html.length) item.html = $html.html(); + if($children.length) { + item.children = getDataFromUlList($children); + } + if(!item.text && !item.html) { + var $content = $item.children(':not(ul,.treemap-data-list)'); + var $itemClone = $item.clone(); + $itemClone.find('ul,.treemap-data-list').remove(); + if(!$content.length) { + item.text = $itemClone.text(); + } else { + item.html = $itemClone.html(); + } + } + return item; + }).get(); + }; + + var Treemap = function(element, options) { + var $element = $(element); + if($.isArray(options)) { + options = {data: options}; + } + options = $.extend({}, DEFAULTS, $element.data(), options); + + var data = options.data || []; + if(!data.length) { + var $dataList = $element.children('.treemap-data'); + if($dataList.length) { + data = getDataFromUlList($dataList.hide()); + } + } + + var $nodes = $element.children('.treemap-nodes'); + if(!$nodes.length) { + $nodes = $('
      ').appendTo($element); + } + + var that = this; + that.$ = $element; + that.$nodes = $nodes; + that.data = $.isArray(data) ? data : [data]; + that.options = options; + that.offsetX = 0; + that.offsetY = 0; + that.scale = options.scale || 1; + + // Bind events + + that.render(); + + $nodes.on('resize', '.treemap-node-wrapper', function() { + that.delayDrawLines(); + }); + if(options.foldable) { + $nodes.on('click', options.clickNodeToFold ? '.treemap-node-wrapper' : '.treemap-node-fold-icon', function() { + that.toggle($(this).closest('.treemap-node')); + }); + } + + $nodes.on('click', '.treemap-node-wrapper', function() { + var $node = $(this).closest('.treemap-node'); + that.callEvent('onNodeClick', $node.data('node')); + }); + }; + + Treemap.prototype.toggle = function($node, toggle, ignoreAnimation) { + var that = this; + if(typeof $node === 'boolean') { + toggle = $node; + $node = null; + } + if(!$node) { + $node = that.$nodes.children('.treemap-node').first(); + } + if($node) + { + if($node.data('node').foldable === false) { + return; + } + if(toggle === undefined) { + toggle = $node.hasClass('collapsed'); + } + $node.toggleClass('collapsed', !toggle).find('[data-toggle="tooltip"]').tooltip('hide'); + if (!ignoreAnimation) { + $node.addClass('tree-node-collapsing') + } + that.$nodes.find('.tooltip').remove(); + that.drawLines(); + if (!ignoreAnimation) { + $node.removeClass('tree-node-collapsing'); + } else { + clearTimeout(that.toggleTimeTask); + that.toggleTimeTask = setTimeout(function() { + $node.removeClass('tree-node-collapsing'); + }, 200); + } + } + }; + + Treemap.prototype.showLevel = function(level) { + var that = this; + that.$nodes.find('.treemap-node').each(function() { + var $node = $(this); + that.toggle($node, $node.data('level') < level, true); + }); + }; + + Treemap.prototype.render = function(data) { + var that = this; + that.data = data ? ($.isArray(data) ? data : [data]) : that.data; + + if(that.data) { + that.createNodes(); + that.drawLines(); + that.delayDrawLines(500); + } + + that.callEvent('afterRender'); + }; + + Treemap.prototype.createNodes = function(nodes, parent, callback) { + var that = this, + options = that.options, + rowSpace = options.rowSpace, + $nodes = that.$nodes; + if(!parent) { + $nodes.find('.treemap-node-wrapper').off('resize.' + NAME); + $nodes.empty(); + } + if(options.sort) { + nodes.sort($.isFunction(options.sort) ? options.sort : function(nodeX, nodeY) { + return (nodeX.order || 0) - (nodeY.order); + }); + } + var lastNode = null; + nodes = nodes || that.data; + if (!parent) { + that.maxLevel = 1; + } + $.each(nodes, function(idx, node) { + if(typeof node === 'string') { + node = {html: node}; + nodes[idx] = node; + } + + if(!node.id) node.id = $.zui.uuid(); + node.level = parent ? (parent.level + 1) : 1; + that.maxLevel = Math.max(that.maxLevel, node.level); + + // Create node element + var isCustomNodeTemplate = $.isFunction(options.nodeTemplate); + var $node = isCustomNodeTemplate ? options.nodeTemplate(node, that) : $(options.nodeTemplate); + + // Create node wrapper element + var $wrapper = $node.find('.treemap-node-wrapper'); + if(!$wrapper.length) { + $wrapper = $('
      ').appendTo($node); + } + + var children = node.children; + var hasChild = children && children.length; + node.isOnlyOneChild = hasChild === 1; + + // Set node data attributes + node.idx = idx; + var row = parent ? (parent.row + 1) : 0; + $node.toggleClass('treemap-node-has-child', !!hasChild) + .toggleClass('treemap-node-has-parent', !!parent) + .toggleClass('treemap-node-one-child', hasChild === 1) + .toggleClass('collapsed', !!node.collapsed && node.collapsed !== 'false') + .toggleClass('treemap-node-root', !row) + .attr({'data-id': node.id, 'data-level': node.level}).data('node', node); + if(node.className) { + $node.addClass(node.className); + } + node.row = row; + + // Set node element attributes and sytle + var style = $.extend({}, options.nodeStyle, node.style); + if(node.textColor) style.color = node.textColor; + if(node.color) style.backgroundColor = node.color; + if(node.border) style.border = node.border; + var attrs = $.extend({}, node.attrs, { + title: node.caption + }); + if(node.tooltip) { + attrs['data-toggle'] = 'tooltip'; + attrs.title = node.tooltip; + } + $wrapper.attr(attrs).css(style); + if(lastNode) { + $node.css('padding-left', options.nodeSpace); + } + if(!isCustomNodeTemplate) { + if(node.html) $wrapper.append(node.html); + else if(node.text) $wrapper.text(node.text); + } + + // append node element to ducument + $node.appendTo(parent ? parent.$children : $nodes); + + // Save sizes + // node.bounds = { + // width : $wrapper.outerWidth(), + // height : $wrapper.outerHeight() + // }; + + if(lastNode) { + lastNode.next = node; + } + node.prev = lastNode; + node.parent = parent; + node.$ = $node; + node.$wrapper = $wrapper; + + // Create children + if(hasChild) { + var $children = $node.find('.treemap-node-children'); + if(!$children.length) { + $children = $('
      ').appendTo($node); + } + $children.css('margin-top', rowSpace); + node.$children = $children; + that.createNodes(children, node); + } + + if(options.listenNodeResize) { + $wrapper.on('resize.' + NAME, function() { + // node.bounds.width = $wrapper.outerWidth(); + // node.bounds.height = $wrapper.outerHeight(); + that.delayDrawLines(); + }); + } + + lastNode = node; + callback && callback($node, node); + }); + + if(!parent) { + // Init tooltip + $nodes.find('[data-toggle="tooltip"]').tooltip(options.tooltip); + } + }; + + Treemap.prototype.delayDrawLines = function(delay) { + var that = this; + clearTimeout(that.delayDrawLinesTask); + that.delayDrawLinesTask = setTimeout(function() { + that.drawLines(); + }, delay || 10); + }; + + Treemap.prototype.drawLines = function(nodes, parent) { + var that = this, + options = that.options, + rowSpace = options.rowSpace; + var cableStyle = {}; + if(options.cableWidth) cableStyle.borderWidth = options.cableWidth; + if(options.cableStyle) cableStyle.borderStyle = options.cableStyle; + if(options.cableColor) cableStyle.borderColor = options.cableColor; + var rowSpaceHalf = Math.round(rowSpace/2); + var nodesOffsetLeft = that.$nodes.offset().left; + $.each(nodes || that.data, function(idx, node) { + var $wrapper = node.$wrapper; + var children = node.children; + var nodeCableStyle = $.extend({ + height: rowSpaceHalf, + top: -rowSpaceHalf - 1, + left: Math.round(($wrapper.outerWidth() - cableStyle.borderWidth)/2), + color: cableStyle.borderColor + }, cableStyle); + if(parent && !parent.isOnlyOneChild) { + var $topLine = $wrapper.find('.treemap-line-top'); + if(!$topLine.length) { + $topLine = $('
      ').appendTo($wrapper); + } + $topLine.css(nodeCableStyle); + } + if(children && children.length) { + nodeCableStyle.top = $wrapper.outerHeight() - 1; + if(node.isOnlyOneChild) { + nodeCableStyle.height = rowSpace; + } + var $bottomLine = $wrapper.find('.treemap-line-bottom'); + if(!$bottomLine.length) { + $bottomLine = $('
      ').appendTo($wrapper); + if(options.foldable) { + $bottomLine.append(''); + } + } + $bottomLine.css(nodeCableStyle); + that.drawLines(children, node); + if(children.length > 1) { + var firstChild = children[0], + lastChild = children[children.length - 1]; + + var $centerLine = node.$.children('.treemap-line'); + if(!$centerLine.length) { + $centerLine = $('
      ').insertAfter($wrapper); + } + var lineLeft = Math.round(firstChild.$wrapper.offset().left - nodesOffsetLeft + firstChild.$wrapper.outerWidth()/2); + $centerLine.css($.extend({ + marginTop: rowSpaceHalf, + left: lineLeft, + width: lastChild.$wrapper.offset().left - nodesOffsetLeft -lineLeft + lastChild.$wrapper.outerWidth()/2 + }, cableStyle)); + } + } + }); + + if(!parent) { + that.callEvent('afterDrawLines'); + } + }; + + // Call event + Treemap.prototype.callEvent = function(name, params) { + var that = this; + if(!$.isArray(params)) params = [params]; + that.$.trigger(name, params); + if($.isFunction(that.options[name])) { + return that.options[name].apply(that, params); + } + }; + + Treemap.DEFAULTS = DEFAULTS; + Treemap.NAME = NAME; + + $.fn.treemap = function(option, param1, parma2) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new Treemap(this, options))); + + if(typeof option == 'string') data[option](param1, parma2); + }); + }; + + $.fn.treemap.Constructor = Treemap; +}(jQuery, window, document, Math, undefined)); + diff --git a/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.css b/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.css new file mode 100644 index 0000000..8922f48 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.css @@ -0,0 +1,6 @@ +/*! + * ZUI: 树形图 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */.treemap-data{text-align:left}.treemap-nodes{position:relative;display:table;padding:10px;margin-right:auto;margin-left:auto;text-align:center;-webkit-user-select:none;-moz-user-select:none}.treemap-node{display:table-cell;vertical-align:top}.treemap-node-wrapper{position:relative;z-index:5;display:inline-block;padding:5px 10px;border:1px solid grey;border-radius:1px}a.treemap-node-wrapper{color:#353535;cursor:pointer}a.treemap-node-wrapper:active,a.treemap-node-wrapper:focus,a.treemap-node-wrapper:hover{color:#3280fc;text-decoration:none;background-color:#ebf2f9;border-color:#3280fc}.treemap-node-root>.treemap-node-wrapper{background-color:rgba(0,0,0,.1)}.treemap-node-children{display:table;margin-top:20px auto 0}.treemap-line-bottom,.treemap-line-top{position:absolute;top:100%;left:50%;margin-left:-1px;border-right:none!important;border-bottom:none!important}.treemap-line-top{top:0}.treemap-node>.treemap-line{position:absolute;right:0;left:0;z-index:1;border-right:none!important;border-bottom:none!important}.treemap-node-fold-icon{position:absolute;top:-6px;left:-5px;z-index:10;display:block!important;width:10px;height:10px;line-height:10px;color:grey;background-color:#fff;border-radius:5px;opacity:0;-webkit-transition:opacity .2s,-webkit-transform .1s;-o-transition:opacity .2s,-o-transform .1s;transition:opacity .2s,-webkit-transform .1s;transition:opacity .2s,transform .1s;transition:opacity .2s,transform .1s,-webkit-transform .1s,-o-transform .1s}.treemap-node-fold-icon:before{min-width:10px;content:'\e6f2'}.treemap-node-wrapper:hover .treemap-node-fold-icon{opacity:1}.treemap-node.collapsed .treemap-line-bottom,.treemap-node.collapsed>.treemap-line{border-color:transparent!important}.treemap-node.collapsed>.treemap-node-children{display:none}.treemap-node.collapsed .treemap-node-fold-icon{top:-6px;color:grey;opacity:1;-webkit-transform:none!important;-ms-transform:none!important;-o-transform:none!important;transform:none!important}.treemap-node.collapsed .treemap-node-fold-icon:before{content:'\e6f1'}.treemap-node.tree-node-collapsing>.treemap-line,.treemap-node.tree-node-collapsing>.treemap-node-children{visibility:hidden} \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.js b/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.js new file mode 100644 index 0000000..7005805 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: 树形图 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +!function(e,t,a,o,r){"use strict";var n="zui.treemap",l={data:[],cableWidth:1,cableColor:"#808080",cableStyle:"solid",rowSpace:30,nodeSpace:20,listenNodeResize:!0,nodeTemplate:'
      ',foldable:!0,clickNodeToFold:!0},i=function(t){return t.children("li,.treemap-data-item").map(function(){var t=e(this),a=t.data(),o=t.children(".text"),r=t.children(".content"),n=t.children("ul,.treemap-data-list");if(o.length&&(a.text=o.text()),r.length&&(a.html=r.html()),n.length&&(a.children=i(n)),!a.text&&!a.html){var l=t.children(":not(ul,.treemap-data-list)"),d=t.clone();d.find("ul,.treemap-data-list").remove(),l.length?a.html=d.html():a.text=d.text()}return a}).get()},d=function(t,a){var o=e(t);e.isArray(a)&&(a={data:a}),a=e.extend({},l,o.data(),a);var r=a.data||[];if(!r.length){var n=o.children(".treemap-data");n.length&&(r=i(n.hide()))}var d=o.children(".treemap-nodes");d.length||(d=e('
      ').appendTo(o));var s=this;s.$=o,s.$nodes=d,s.data=e.isArray(r)?r:[r],s.options=a,s.offsetX=0,s.offsetY=0,s.scale=a.scale||1,s.render(),d.on("resize",".treemap-node-wrapper",function(){s.delayDrawLines()}),a.foldable&&d.on("click",a.clickNodeToFold?".treemap-node-wrapper":".treemap-node-fold-icon",function(){s.toggle(e(this).closest(".treemap-node"))}),d.on("click",".treemap-node-wrapper",function(){var t=e(this).closest(".treemap-node");s.callEvent("onNodeClick",t.data("node"))})};d.prototype.toggle=function(e,t,a){var o=this;if("boolean"==typeof e&&(t=e,e=null),e||(e=o.$nodes.children(".treemap-node").first()),e){if(e.data("node").foldable===!1)return;t===r&&(t=e.hasClass("collapsed")),e.toggleClass("collapsed",!t).find('[data-toggle="tooltip"]').tooltip("hide"),a||e.addClass("tree-node-collapsing"),o.$nodes.find(".tooltip").remove(),o.drawLines(),a?(clearTimeout(o.toggleTimeTask),o.toggleTimeTask=setTimeout(function(){e.removeClass("tree-node-collapsing")},200)):e.removeClass("tree-node-collapsing")}},d.prototype.showLevel=function(t){var a=this;a.$nodes.find(".treemap-node").each(function(){var o=e(this);a.toggle(o,o.data("level")').appendTo(m));var v=h.children,u=v&&v.length;h.isOnlyOneChild=1===u,h.idx=c;var w=a?a.row+1:0;m.toggleClass("treemap-node-has-child",!!u).toggleClass("treemap-node-has-parent",!!a).toggleClass("treemap-node-one-child",1===u).toggleClass("collapsed",!!h.collapsed&&"false"!==h.collapsed).toggleClass("treemap-node-root",!w).attr({"data-id":h.id,"data-level":h.level}).data("node",h),h.className&&m.addClass(h.className),h.row=w;var y=e.extend({},i.nodeStyle,h.style);h.textColor&&(y.color=h.textColor),h.color&&(y.backgroundColor=h.color),h.border&&(y.border=h.border);var b=e.extend({},h.attrs,{title:h.caption});if(h.tooltip&&(b["data-toggle"]="tooltip",b.title=h.tooltip),g.attr(b).css(y),p&&m.css("padding-left",i.nodeSpace),f||(h.html?g.append(h.html):h.text&&g.text(h.text)),m.appendTo(a?a.$children:s),p&&(p.next=h),h.prev=p,h.parent=a,h.$=m,h.$wrapper=g,u){var x=m.find(".treemap-node-children");x.length||(x=e('
      ').appendTo(m)),x.css("margin-top",d),h.$children=x,l.createNodes(v,h)}i.listenNodeResize&&g.on("resize."+n,function(){l.delayDrawLines()}),p=h,r&&r(m,h)}),a||s.find('[data-toggle="tooltip"]').tooltip(i.tooltip)},d.prototype.delayDrawLines=function(e){var t=this;clearTimeout(t.delayDrawLinesTask),t.delayDrawLinesTask=setTimeout(function(){t.drawLines()},e||10)},d.prototype.drawLines=function(t,a){var r=this,n=r.options,l=n.rowSpace,i={};n.cableWidth&&(i.borderWidth=n.cableWidth),n.cableStyle&&(i.borderStyle=n.cableStyle),n.cableColor&&(i.borderColor=n.cableColor);var d=o.round(l/2),s=r.$nodes.offset().left;e.each(t||r.data,function(t,p){var c=p.$wrapper,h=p.children,f=e.extend({height:d,top:-d-1,left:o.round((c.outerWidth()-i.borderWidth)/2),color:i.borderColor},i);if(a&&!a.isOnlyOneChild){var m=c.find(".treemap-line-top");m.length||(m=e('
      ').appendTo(c)),m.css(f)}if(h&&h.length){f.top=c.outerHeight()-1,p.isOnlyOneChild&&(f.height=l);var g=c.find(".treemap-line-bottom");if(g.length||(g=e('
      ').appendTo(c),n.foldable&&g.append('')),g.css(f),r.drawLines(h,p),h.length>1){var v=h[0],u=h[h.length-1],w=p.$.children(".treemap-line");w.length||(w=e('
      ').insertAfter(c));var y=o.round(v.$wrapper.offset().left-s+v.$wrapper.outerWidth()/2);w.css(e.extend({marginTop:d,left:y,width:u.$wrapper.offset().left-s-y+u.$wrapper.outerWidth()/2},i))}}}),a||r.callEvent("afterDrawLines")},d.prototype.callEvent=function(t,a){var o=this;if(e.isArray(a)||(a=[a]),o.$.trigger(t,a),e.isFunction(o.options[t]))return o.options[t].apply(o,a)},d.DEFAULTS=l,d.NAME=n,e.fn.treemap=function(t,a,o){return this.each(function(){var r=e(this),l=r.data(n),i="object"==typeof t&&t;l||r.data(n,l=new d(this,i)),"string"==typeof t&&l[t](a,o)})},e.fn.treemap.Constructor=d}(jQuery,window,document,Math,void 0); \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/ueditor/.pydio b/dist/resources/static/js/lib/zui/lib/ueditor/.pydio new file mode 100644 index 0000000..a2b4ffd --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/ueditor/.pydio @@ -0,0 +1 @@ +b007cf38-8719-40c7-a180-fcca8681ca14 \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/ueditor/ueditor.css b/dist/resources/static/js/lib/zui/lib/ueditor/ueditor.css new file mode 100644 index 0000000..07eb88a --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/ueditor/ueditor.css @@ -0,0 +1,1604 @@ +/*基础UI构建 +*/ +/* common layer */ +.edui-default .edui-box { + padding: 0; + margin: 0; + overflow: hidden; + border: none; + } +.edui-default a.edui-box { + display: block; + color: black; + text-decoration: none; + } +.edui-default a.edui-box:hover { + text-decoration: none; + } +.edui-default a.edui-box:active { + text-decoration: none; + } +.edui-default table.edui-box { + border-collapse: collapse; + } +.edui-default ul.edui-box { + list-style-type: none; + } +div.edui-box { + position: relative; + display: inline-block !important; + vertical-align: top; + } +.edui-default .edui-clearfix { + zoom: 1; + } +.edui-default .edui-clearfix:after { + display: block; + clear: both; + content: '\20'; + } +* html div.edui-box { + display: inline !important; + } +*:first-child + html div.edui-box { + display: inline !important; + } +/* control layout */ +.edui-default .edui-button-body, +.edui-splitbutton-body, +.edui-menubutton-body, +.edui-combox-body { + position: relative; + } +.edui-default .edui-popup { + position: absolute; + -webkit-user-select: none; + -moz-user-select: none; + } +.edui-default .edui-popup .edui-shadow { + position: absolute; + z-index: -1; + } +.edui-default .edui-popup .edui-bordereraser { + position: absolute; + overflow: hidden; + } +.edui-default .edui-tablepicker .edui-canvas { + position: relative; + } +.edui-default .edui-tablepicker .edui-canvas .edui-overlay { + position: absolute; + } +.edui-default .edui-dialog-modalmask, +.edui-dialog-dragmask { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } +.edui-default .edui-toolbar { + position: relative; + } +/* + * default theme + */ +.edui-default .edui-label { + cursor: default; + } +.edui-default span.edui-clickable { + color: blue; + text-decoration: underline; + cursor: pointer; + } +.edui-default span.edui-unclickable { + color: gray; + cursor: default; + } +/* 工具栏 */ +.edui-default .edui-toolbar { + width: auto; + height: auto; + padding: 1px; + overflow: hidden; + cursor: default; + /*全屏下单独一行不占位*/ + zoom: 1; + -webkit-user-select: none; + -moz-user-select: none; + } +.edui-default .edui-toolbar .edui-button, +.edui-default .edui-toolbar .edui-splitbutton, +.edui-default .edui-toolbar .edui-menubutton, +.edui-default .edui-toolbar .edui-combox { + margin: 1px; + } +/*UI工具栏、编辑区域、底部*/ +.edui-default .edui-editor { + position: relative; + overflow: visible; + background-color: white; + border: 1px solid #d4d4d4; + border-radius: 4px; + } +.edui-editor div { + width: auto; + height: auto; + } +.edui-default .edui-editor-toolbarbox { + position: relative; + zoom: 1; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + } +.edui-default .edui-editor-toolbarboxouter { + background-color: #fafafa; + background-repeat: repeat-x; + border-bottom: 1px solid #d4d4d4; + + *zoom: 1; + } +.edui-default .edui-editor-toolbarboxinner { + padding: 2px; + } +.edui-default .edui-editor-iframeholder { + position: relative; + } +.edui-default .edui-editor-bottomContainer { + overflow: hidden; + } +.edui-default .edui-editor-bottomContainer table { + width: 100%; + height: 0; + overflow: hidden; + border-spacing: 0; + } +.edui-default .edui-editor-bottomContainer td { + font-family: Arial, Helvetica, Tahoma, Verdana, Sans-Serif; + font-size: 12px; + line-height: 20px; + white-space: nowrap; + border-top: 1px solid #ccc; + } +.edui-default .edui-editor-wordcount { + margin-right: 5px; + color: #aaa; + text-align: right; + } +.edui-default .edui-editor-scale { + width: 12px; + } +.edui-default .edui-editor-scale .edui-editor-icon { + float: right; + width: 100%; + height: 12px; + margin-top: 10px; + cursor: se-resize; + background: url(../images/scale.png) no-repeat; + } +.edui-default .edui-editor-breadcrumb { + margin: 2px 0 0 3px; + } +.edui-default .edui-editor-breadcrumb span { + color: blue; + text-decoration: underline; + cursor: pointer; + } +.edui-default .edui-toolbar .edui-for-fullscreen { + float: right; + } +.edui-default .edui-bubble .edui-popup-content { + padding: 5px; + font-family: "宋体"; + font-size: 10pt; + background-color: #fff6d9; + border: 1px solid #dcac6c; + } +.edui-default .edui-editor-toolbarmsg { + position: absolute; + bottom: -25px; + left: 0; + z-index: 1009; + width: 99.9%; + background-color: #fff6d9; + border-bottom: 1px solid #ccc; + } +.edui-default .edui-editor-toolbarmsg-upload { + position: absolute; + top: 5px; + left: 350px; + width: 100px; + height: 16px; + font-size: 14px; + line-height: 16px; + color: blue; + cursor: pointer; + } +.edui-default .edui-editor-toolbarmsg-label { + padding: 4px; + font-size: 12px; + line-height: 16px; + } +.edui-default .edui-editor-toolbarmsg-close { + float: right; + width: 20px; + height: 16px; + line-height: 16px; + color: red; + cursor: pointer; + } +.edui-default .edui-list .edui-bordereraser { + display: none; + } +.edui-default .edui-listitem { + padding: 1px; + white-space: nowrap; + } +.edui-default .edui-list .edui-state-hover { + position: relative; + padding: 0; + background-color: #fff5d4; + border: 1px solid #dcac6c; + } +.edui-default .edui-for-fontfamily .edui-listitem-label { + min-width: 130px; + height: 22px; + padding-left: 5px; + font-size: 12px; + line-height: 22px; + + _width: 120px; + } +.edui-default .edui-for-insertcode .edui-listitem-label { + min-width: 120px; + height: 22px; + padding-left: 5px; + font-size: 12px; + line-height: 22px; + + _width: 120px; + } +.edui-default .edui-for-underline .edui-listitem-label { + min-width: 120px; + padding: 3px 5px; + font-size: 12px; + + _width: 120px; + } +.edui-default .edui-for-fontsize .edui-listitem-label { + min-width: 120px; + padding: 3px 5px; + + _width: 120px; + } +.edui-default .edui-for-paragraph .edui-listitem-label { + min-width: 200px; + padding: 2px 5px; + + _width: 200px; + } +.edui-default .edui-for-rowspacingtop .edui-listitem-label, +.edui-default .edui-for-rowspacingbottom .edui-listitem-label { + min-width: 53px; + padding: 2px 5px; + + _width: 53px; + } +.edui-default .edui-for-lineheight .edui-listitem-label { + min-width: 53px; + padding: 2px 5px; + + _width: 53px; + } +.edui-default .edui-for-customstyle .edui-listitem-label { + width: 200px !important; + min-width: 200px; + padding: 2px 5px; + + _width: 200px; + } +/* 可选中按钮弹出菜单*/ +.edui-default .edui-menu { + z-index: 3000; + } +.edui-default .edui-menu .edui-popup-content { + padding: 3px; + } +.edui-default .edui-menu-body { + min-width: 170px; + background: url("../images/sparator_v.png") repeat-y 25px; + + _width: 150px; + } +.edui-default .edui-menuitem { + height: 20px; + vertical-align: top; + cursor: default; + } +.edui-default .edui-menuitem .edui-icon { + width: 20px !important; + height: 20px !important; + background: url(../images/icons.png) 0 -4000px; + background: url(../images/icons.gif) 0 -4000px\9; + } +.edui-default .edui-menuitem .edui-label { + height: 20px; + padding-left: 10px; + font-size: 12px; + line-height: 20px; + } +.edui-default .edui-state-checked .edui-menuitem-body { + background: url("../images/icons-all.gif") no-repeat 6px -205px; + } +.edui-default .edui-state-disabled .edui-menuitem-label { + color: gray; + } +/*不可选中菜单按钮 */ +.edui-default .edui-toolbar .edui-combox-body .edui-button-body { + width: 60px; + height: 20px; + padding-left: 5px; + margin: 0 3px 0 0; + font-size: 12px; + line-height: 20px; + white-space: nowrap; + } +.edui-default .edui-toolbar .edui-combox-body .edui-arrow { + width: 9px; + height: 20px; + background: url(../images/icons.png) -741px 0; + + _background: url(../images/icons.gif) -741px 0; + } +.edui-default .edui-toolbar .edui-combox .edui-combox-body { + background-color: white; + border: 1px solid #ccc; + border-radius: 2px; + + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + } +.edui-default .edui-toolbar .edui-combox-body .edui-splitborder { + display: none; + } +.edui-default .edui-toolbar .edui-combox-body .edui-arrow { + border-left: 1px solid #ccc; + } +.edui-default .edui-toolbar .edui-state-hover .edui-combox-body { + background-color: #fff5d4; + border: 1px solid #dcac6c; + } +.edui-default .edui-toolbar .edui-state-hover .edui-combox-body .edui-arrow { + border-left: 1px solid #dcac6c; + } +.edui-default .edui-toolbar .edui-state-checked .edui-combox-body { + background-color: #ffe69f; + border: 1px solid #dcac6c; + } +.edui-toolbar .edui-state-checked .edui-combox-body .edui-arrow { + border-left: 1px solid #dcac6c; + } +.edui-toolbar .edui-state-disabled .edui-combox-body { + background-color: #f0f0ee; + filter: alpha(opacity=30); + opacity: .3; + } +.edui-toolbar .edui-state-opened .edui-combox-body { + background-color: white; + border: 1px solid gray; + } +/*普通按钮样式及状态*/ +.edui-default .edui-toolbar .edui-button .edui-icon, +.edui-default .edui-toolbar .edui-menubutton .edui-icon, +.edui-default .edui-toolbar .edui-splitbutton .edui-icon { + width: 20px !important; + height: 20px !important; + background-image: url(../images/icons.png); + background-image: url(../images/icons.gif) \9; + } +.edui-default .edui-toolbar .edui-button .edui-button-wrap { + position: relative; + padding: 1px; + } +.edui-default .edui-toolbar .edui-button .edui-state-hover .edui-button-wrap { + padding: 0; + background-color: #fff5d4; + border: 1px solid #dcac6c; + } +.edui-default .edui-toolbar .edui-button .edui-state-checked .edui-button-wrap { + padding: 0; + background-color: #ffe69f; + border: 1px solid #dcac6c; + border-radius: 2px; + + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + } +.edui-default .edui-toolbar .edui-button .edui-state-active .edui-button-wrap { + padding: 0; + background-color: #fff; + border: 1px solid gray; + } +.edui-default .edui-toolbar .edui-state-disabled .edui-label { + color: #ccc; + } +.edui-default .edui-toolbar .edui-state-disabled .edui-icon { + filter: alpha(opacity=30); + opacity: .3; + } +/* toolbar icons */ +.edui-default .edui-for-undo .edui-icon { + background-position: -160px 0; + } +.edui-default .edui-for-redo .edui-icon { + background-position: -100px 0; + } +.edui-default .edui-for-bold .edui-icon { + background-position: 0 0; + } +.edui-default .edui-for-italic .edui-icon { + background-position: -60px 0; + } +.edui-default .edui-for-fontborder .edui-icon { + background-position: -160px -40px; + } +.edui-default .edui-for-underline .edui-icon { + background-position: -140px 0; + } +.edui-default .edui-for-strikethrough .edui-icon { + background-position: -120px 0; + } +.edui-default .edui-for-subscript .edui-icon { + background-position: -600px 0; + } +.edui-default .edui-for-superscript .edui-icon { + background-position: -620px 0; + } +.edui-default .edui-for-blockquote .edui-icon { + background-position: -220px 0; + } +.edui-default .edui-for-forecolor .edui-icon { + background-position: -720px 0; + } +.edui-default .edui-for-backcolor .edui-icon { + background-position: -760px 0; + } +.edui-default .edui-for-inserttable .edui-icon { + background-position: -580px -20px; + } +.edui-default .edui-for-autotypeset .edui-icon { + background-position: -640px -40px; + } +.edui-default .edui-for-justifyleft .edui-icon { + background-position: -460px 0; + } +.edui-default .edui-for-justifycenter .edui-icon { + background-position: -420px 0; + } +.edui-default .edui-for-justifyright .edui-icon { + background-position: -480px 0; + } +.edui-default .edui-for-justifyjustify .edui-icon { + background-position: -440px 0; + } +.edui-default .edui-for-insertorderedlist .edui-icon { + background-position: -80px 0; + } +.edui-default .edui-for-insertunorderedlist .edui-icon { + background-position: -20px 0; + } +.edui-default .edui-for-lineheight .edui-icon { + background-position: -725px -40px; + } +.edui-default .edui-for-rowspacingbottom .edui-icon { + background-position: -745px -40px; + } +.edui-default .edui-for-rowspacingtop .edui-icon { + background-position: -765px -40px; + } +.edui-default .edui-for-horizontal .edui-icon { + background-position: -360px 0; + } +.edui-default .edui-for-link .edui-icon { + background-position: -500px 0; + } +.edui-default .edui-for-code .edui-icon { + background-position: -440px -40px; + } +.edui-default .edui-for-insertimage .edui-icon { + background-position: -726px -77px; + } +.edui-default .edui-for-insertframe .edui-icon { + background-position: -240px -40px; + } +.edui-default .edui-for-emoticon .edui-icon { + background-position: -60px -20px; + } +.edui-default .edui-for-spechars .edui-icon { + background-position: -240px 0; + } +.edui-default .edui-for-help .edui-icon { + background-position: -340px 0; + } +.edui-default .edui-for-print .edui-icon { + background-position: -440px -20px; + } +.edui-default .edui-for-preview .edui-icon { + background-position: -420px -20px; + } +.edui-default .edui-for-selectall .edui-icon { + background-position: -400px -20px; + } +.edui-default .edui-for-searchreplace .edui-icon { + background-position: -520px -20px; + } +.edui-default .edui-for-map .edui-icon { + background-position: -40px -40px; + } +.edui-default .edui-for-gmap .edui-icon { + background-position: -260px -40px; + } +.edui-default .edui-for-insertvideo .edui-icon { + background-position: -320px -20px; + } +.edui-default .edui-for-time .edui-icon { + background-position: -160px -20px; + } +.edui-default .edui-for-date .edui-icon { + background-position: -140px -20px; + } +.edui-default .edui-for-cut .edui-icon { + background-position: -680px 0; + } +.edui-default .edui-for-copy .edui-icon { + background-position: -700px 0; + } +.edui-default .edui-for-paste .edui-icon { + background-position: -560px 0; + } +.edui-default .edui-for-formatmatch .edui-icon { + background-position: -40px 0; + } +.edui-default .edui-for-pasteplain .edui-icon { + background-position: -360px -20px; + } +.edui-default .edui-for-directionalityltr .edui-icon { + background-position: -20px -20px; + } +.edui-default .edui-for-directionalityrtl .edui-icon { + background-position: -40px -20px; + } +.edui-default .edui-for-source .edui-icon { + background-position: -261px 0; + } +.edui-default .edui-for-removeformat .edui-icon { + background-position: -580px 0; + } +.edui-default .edui-for-unlink .edui-icon { + background-position: -640px 0; + } +.edui-default .edui-for-touppercase .edui-icon { + background-position: -786px 0; + } +.edui-default .edui-for-tolowercase .edui-icon { + background-position: -806px 0; + } +.edui-default .edui-for-insertrow .edui-icon { + background-position: -478px -76px; + } +.edui-default .edui-for-insertrownext .edui-icon { + background-position: -498px -76px; + } +.edui-default .edui-for-insertcol .edui-icon { + background-position: -455px -76px; + } +.edui-default .edui-for-insertcolnext .edui-icon { + background-position: -429px -76px; + } +.edui-default .edui-for-mergeright .edui-icon { + background-position: -60px -40px; + } +.edui-default .edui-for-mergedown .edui-icon { + background-position: -80px -40px; + } +.edui-default .edui-for-splittorows .edui-icon { + background-position: -100px -40px; + } +.edui-default .edui-for-splittocols .edui-icon { + background-position: -120px -40px; + } +.edui-default .edui-for-insertparagraphbeforetable .edui-icon { + background-position: -140px -40px; + } +.edui-default .edui-for-deleterow .edui-icon { + background-position: -660px -20px; + } +.edui-default .edui-for-deletecol .edui-icon { + background-position: -640px -20px; + } +.edui-default .edui-for-splittocells .edui-icon { + background-position: -800px -20px; + } +.edui-default .edui-for-mergecells .edui-icon { + background-position: -760px -20px; + } +.edui-default .edui-for-deletetable .edui-icon { + background-position: -620px -20px; + } +.edui-default .edui-for-cleardoc .edui-icon { + background-position: -520px 0; + } +.edui-default .edui-for-fullscreen .edui-icon { + background-position: -100px -20px; + } +.edui-default .edui-for-anchor .edui-icon { + background-position: -200px 0; + } +.edui-default .edui-for-pagebreak .edui-icon { + background-position: -460px -40px; + } +.edui-default .edui-for-imagenone .edui-icon { + background-position: -480px -40px; + } +.edui-default .edui-for-imageleft .edui-icon { + background-position: -500px -40px; + } +.edui-default .edui-for-wordimage .edui-icon { + background-position: -660px -40px; + } +.edui-default .edui-for-imageright .edui-icon { + background-position: -520px -40px; + } +.edui-default .edui-for-imagecenter .edui-icon { + background-position: -540px -40px; + } +.edui-default .edui-for-indent .edui-icon { + background-position: -400px 0; + } +.edui-default .edui-for-outdent .edui-icon { + background-position: -540px 0; + } +.edui-default .edui-for-webapp .edui-icon { + background-position: -601px -40px; + } +.edui-default .edui-for-table .edui-icon { + background-position: -580px -20px; + } +.edui-default .edui-for-edittable .edui-icon { + background-position: -420px -40px; + } +.edui-default .edui-for-template .edui-icon { + background-position: -339px -40px; + } +.edui-default .edui-for-delete .edui-icon { + background-position: -360px -40px; + } +.edui-default .edui-for-attachment .edui-icon { + background-position: -620px -40px; + } +.edui-default .edui-for-edittd .edui-icon { + background-position: -700px -40px; + } +.edui-default .edui-for-snapscreen .edui-icon { + background-position: -581px -40px; + } +.edui-default .edui-for-scrawl .edui-icon { + background-position: -801px -41px; + } +.edui-default .edui-for-background .edui-icon { + background-position: -680px -40px; + } +.edui-default .edui-for-music .edui-icon { + background-position: -18px -40px; + } +.edui-default .edui-for-formula .edui-icon { + background-position: -200px -40px; + } +.edui-default .edui-for-aligntd .edui-icon { + background-position: -236px -76px; + } +.edui-default .edui-for-insertparagraphtrue .edui-icon { + background-position: -625px -76px; + } +.edui-default .edui-for-insertparagraph .edui-icon { + background-position: -602px -76px; + } +.edui-default .edui-for-insertcaption .edui-icon { + background-position: -336px -76px; + } +.edui-default .edui-for-deletecaption .edui-icon { + background-position: -362px -76px; + } +.edui-default .edui-for-inserttitle .edui-icon { + background-position: -286px -76px; + } +.edui-default .edui-for-deletetitle .edui-icon { + background-position: -311px -76px; + } +.edui-default .edui-for-aligntable .edui-icon { + background-position: -440px 0; + } +.edui-default .edui-for-tablealignment-left .edui-icon { + background-position: -460px 0; + } +.edui-default .edui-for-tablealignment-center .edui-icon { + background-position: -420px 0; + } +.edui-default .edui-for-tablealignment-right .edui-icon { + background-position: -480px 0; + } +.edui-default .edui-for-drafts .edui-icon { + background-position: -560px 0; + } +.edui-default .edui-for-charts .edui-icon { + background: url(../images/charts.png ) no-repeat 2px 3px !important; + } +.edui-default .edui-for-inserttitlecol .edui-icon { + background-position: -673px -76px; + } +.edui-default .edui-for-deletetitlecol .edui-icon { + background-position: -698px -76px; + } +.edui-default .edui-for-simpleupload .edui-icon { + background-position: -380px 0; + } +/*splitbutton*/ +.edui-default .edui-toolbar .edui-splitbutton-body .edui-arrow, +.edui-default .edui-toolbar .edui-menubutton-body .edui-arrow { + width: 9px; + height: 20px; + background: url(../images/icons.png) -741px 0; + + _background: url(../images/icons.gif) -741px 0; + } +.edui-default .edui-toolbar .edui-splitbutton .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-menubutton-body { + padding: 1px; + } +.edui-default .edui-toolbar .edui-splitborder { + width: 1px; + height: 20px; + } +.edui-default .edui-toolbar .edui-state-hover .edui-splitborder { + width: 1px; + border-left: 0 solid #dcac6c; + } +.edui-default .edui-toolbar .edui-state-active .edui-splitborder { + width: 0; + border-left: 1px solid gray; + } +.edui-default .edui-toolbar .edui-state-opened .edui-splitborder { + width: 1px; + border: 0; + } +.edui-default .edui-toolbar .edui-splitbutton .edui-state-hover .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-hover .edui-menubutton-body { + padding: 0; + background-color: #fff5d4; + border: 1px solid #dcac6c; + } +.edui-default .edui-toolbar .edui-splitbutton .edui-state-checked .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-checked .edui-menubutton-body { + padding: 0; + background-color: #ffe69f; + border: 1px solid #dcac6c; + } +.edui-default .edui-toolbar .edui-splitbutton .edui-state-active .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-active .edui-menubutton-body { + padding: 0; + background-color: #fff; + border: 1px solid gray; + } +.edui-default .edui-state-disabled .edui-arrow { + filter: alpha(opacity=30); + opacity: .3; + } +.edui-default .edui-toolbar .edui-splitbutton .edui-state-opened .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-opened .edui-menubutton-body { + padding: 0; + background-color: white; + border: 1px solid gray; + } +.edui-default .edui-for-insertorderedlist .edui-bordereraser, +.edui-default .edui-for-lineheight .edui-bordereraser, +.edui-default .edui-for-rowspacingtop .edui-bordereraser, +.edui-default .edui-for-rowspacingbottom .edui-bordereraser, +.edui-default .edui-for-insertunorderedlist .edui-bordereraser { + background-color: white; + } +/* 解决嵌套导致的图标问题 */ +.edui-default .edui-for-insertorderedlist .edui-popup-body .edui-icon, +.edui-default .edui-for-lineheight .edui-popup-body .edui-icon, +.edui-default .edui-for-rowspacingtop .edui-popup-body .edui-icon, +.edui-default .edui-for-rowspacingbottom .edui-popup-body .edui-icon, +.edui-default .edui-for-insertunorderedlist .edui-popup-body .edui-icon { + /*background-position: 0 -40px;*/ + background-image: none ; + } +/* 弹出菜单 */ +.edui-default .edui-popup { + z-index: 3000; + width: auto; + height: auto; + background-color: #fff; + } +.edui-default .edui-popup .edui-shadow { + top: 0; + left: 0; + width: 100%; + height: 100%; + } +.edui-default .edui-popup-content { + padding: 5px; + background: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); + box-shadow: 0 6px 12px rgba(0, 0, 0, .175); + + *border-right-width: 2px; + *border-bottom-width: 2px; + } +.edui-default .edui-popup .edui-bordereraser { + height: 3px; + background-color: white; + } +.edui-default .edui-menu .edui-bordereraser { + height: 3px; + } +.edui-default .edui-anchor-topleft .edui-bordereraser { + top: -2px; + left: 1px; + } +.edui-default .edui-anchor-topright .edui-bordereraser { + top: -2px; + right: 1px; + } +.edui-default .edui-anchor-bottomleft .edui-bordereraser { + bottom: -6px; + left: 0; + height: 7px; + border-right: 1px solid gray; + border-left: 1px solid gray; + } +.edui-default .edui-anchor-bottomright .edui-bordereraser { + right: 0; + bottom: -6px; + height: 7px; + border-right: 1px solid gray; + border-left: 1px solid gray; + } +.edui-popup div { + width: auto; + height: auto; + } +.edui-default .edui-editor-messageholder { + position: absolute; + top: 28px; + right: 3px; + display: block; + width: 150px; + height: auto; + padding: 0; + margin: 0; + border: 0; + } +.edui-default .edui-message { + position: relative; + min-height: 10px; + padding: 0; + margin-bottom: 3px; + text-shadow: 0 1px 0 rgba(255, 255, 255, .5); + } +.edui-default .edui-message-body { + padding: 8px 15px 8px 8px; + color: #c09853; + background-color: #fcf8e3; + border: 1px solid #fbeed5; + border-radius: 4px; + } +.edui-default .edui-message-type-info { + color: #3a87ad; + background-color: #d9edf7; + border-color: #bce8f1; + } +.edui-default .edui-message-type-success { + color: #468847; + background-color: #dff0d8; + border-color: #d6e9c6; + } +.edui-default .edui-message-type-danger, +.edui-default .edui-message-type-error { + color: #b94a48; + background-color: #f2dede; + border-color: #eed3d7; + } +.edui-default .edui-message .edui-message-closer { + position: absolute; + top: 0; + right: 0; + display: block; + float: right; + width: 16px; + height: 16px; + padding: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 20px; + font-weight: bold; + line-height: 16px; + color: #999; + text-shadow: 0 1px 0 #fff; + cursor: pointer; + background: transparent; + border: 0; + } +.edui-default .edui-message .edui-message-content { + font-size: 10pt; + word-break: normal; + word-wrap: break-word; + } +/* 弹出对话框按钮和对话框大小 */ +.edui-default .edui-dialog { + position: absolute; + z-index: 2000; + } +.edui-dialog div { + width: auto; + } +.edui-default .edui-dialog-wrap { + margin-right: 6px; + margin-bottom: 6px; + } +.edui-default .edui-dialog-fullscreen-flag { + margin-right: 0; + margin-bottom: 0; + } +.edui-default .edui-dialog-body { + position: relative; + padding: 2px 0 0 2px; + + _zoom: 1; + } +.edui-default .edui-dialog-fullscreen-flag .edui-dialog-body { + padding: 0; + } +.edui-default .edui-dialog-shadow { + position: absolute; + top: 0; + left: 0; + z-index: -1; + width: 100%; + height: 100%; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); + box-shadow: 0 3px 9px rgba(0, 0, 0, .5); + + *border-right-width: 2px; + *border-bottom-width: 2px; + } +.edui-default .edui-dialog-foot { + background-color: white; + } +.edui-default .edui-dialog-titlebar { + position: relative; + min-height: 24px; + padding: 8px 10px; + line-height: 24px; + cursor: move; + border-bottom: 1px solid #e5e5e5; + } +.edui-default .edui-dialog-caption { + padding-left: 5px; + font-size: 12px; + font-weight: bold; + line-height: 26px; + } +.edui-default .edui-dialog-draghandle { + height: 26px; + } +.edui-default .edui-dialog-closebutton { + position: absolute !important; + top: 4px; + right: 3px; + } +.edui-default .edui-dialog-closebutton .edui-button-body { + width: 30px; + height: 30px; + font-size: 19.5px; + font-weight: 700; + line-height: 30px; + color: #000; + text-align: center; + text-shadow: 0 1px 0 #fff; + cursor: pointer; + filter: alpha(opacity=20); + opacity: .2; + } +.edui-default .edui-dialog-closebutton .edui-button-body:before { + content: '×'; + } +.edui-default .edui-dialog-closebutton .edui-button-body:hover { + filter: alpha(opacity=70); + opacity: .7; + } +.edui-default .edui-dialog-foot { + height: 40px; + } +.edui-default .edui-dialog-buttons { + position: absolute; + right: 0; + } +.edui-default .edui-dialog-buttons .edui-button { + margin-right: 10px; + } +.edui-default .edui-dialog-buttons .edui-button .edui-button-body { + width: 96px; + height: 24px; + font-size: 12px; + line-height: 24px; + text-align: center; + cursor: default; + background-color: #f2f2f2; + border: 1px solid #bfbfbf; + border-radius: 4px; + } +.edui-default .edui-dialog-buttons .edui-button .edui-state-hover .edui-button-body { + background-color: #dedede; + border-color: #a1a1a1; + -webkit-box-shadow: 0 2px 1px rgba(0, 0, 0, .1); + box-shadow: 0 2px 1px rgba(0, 0, 0, .1); + } +.edui-default .edui-dialog iframe { + padding: 0; + margin: 0; + vertical-align: top; + border: 0; + } +.edui-default .edui-dialog-modalmask { + position: absolute; + background-color: #ccc; + filter: alpha(opacity=30); + opacity: .3; + /*z-index: 1999;*/ + } +.edui-default .edui-dialog-dragmask { + position: absolute; + cursor: move; + /*z-index: 2001;*/ + background-color: transparent; + } +.edui-default .edui-dialog-content { + position: relative; + } +.edui-default .dialogcontmask { + position: absolute; + display: block; + width: 100%; + height: 100%; + cursor: move; + visibility: hidden; + filter: alpha(opacity=0); + opacity: 0; + } +/*link-dialog*/ +.edui-default .edui-for-link .edui-dialog-content { + width: 420px; + height: 200px; + overflow: hidden; + } +/*background-dialog*/ +.edui-default .edui-for-background .edui-dialog-content { + width: 440px; + height: 280px; + overflow: hidden; + } +/*template-dialog*/ +.edui-default .edui-for-template .edui-dialog-content { + width: 630px; + height: 390px; + overflow: hidden; + } +/*scrawl-dialog*/ +.edui-default .edui-for-scrawl .edui-dialog-content { + width: 515px; + height: 360px; + + *width: 506px; + } +/*spechars-dialog*/ +.edui-default .edui-for-spechars .edui-dialog-content { + width: 620px; + height: 500px; + + *width: 630px; + *height: 570px; + } +/*image-dialog*/ +.edui-default .edui-for-insertimage .edui-dialog-content { + width: 650px; + height: 400px; + overflow: hidden; + } +/*webapp-dialog*/ +.edui-default .edui-for-webapp .edui-dialog-content { + width: 560px; + height: 450px; + overflow: hidden; + + _width: 565px; + } +/*image-insertframe*/ +.edui-default .edui-for-insertframe .edui-dialog-content { + width: 350px; + height: 200px; + overflow: hidden; + } +/*wordImage-dialog*/ +.edui-default .edui-for-wordimage .edui-dialog-content { + width: 620px; + height: 380px; + overflow: hidden; + } +/*attachment-dialog*/ +.edui-default .edui-for-attachment .edui-dialog-content { + width: 650px; + height: 400px; + overflow: hidden; + } +/*map-dialog*/ +.edui-default .edui-for-map .edui-dialog-content { + width: 550px; + height: 400px; + } +/*gmap-dialog*/ +.edui-default .edui-for-gmap .edui-dialog-content { + width: 550px; + height: 400px; + } +/*video-dialog*/ +.edui-default .edui-for-insertvideo .edui-dialog-content { + width: 590px; + height: 390px; + } +/*anchor-dialog*/ +.edui-default .edui-for-anchor .edui-dialog-content { + width: 320px; + height: 60px; + overflow: hidden; + } +/*searchreplace-dialog*/ +.edui-default .edui-for-searchreplace .edui-dialog-content { + width: 400px; + height: 220px; + } +/*help-dialog*/ +.edui-default .edui-for-help .edui-dialog-content { + width: 400px; + height: 420px; + } +/*edittable-dialog*/ +.edui-default .edui-for-edittable .edui-dialog-content { + width: 540px; + height: 335px; + + _width: 590px; + } +/*edittip-dialog*/ +.edui-default .edui-for-edittip .edui-dialog-content { + width: 225px; + height: 60px; + } +/*edittd-dialog*/ +.edui-default .edui-for-edittd .edui-dialog-content { + width: 240px; + height: 50px; + } +/*snapscreen-dialog*/ +.edui-default .edui-for-snapscreen .edui-dialog-content { + width: 400px; + height: 220px; + } +/*music-dialog*/ +.edui-default .edui-for-music .edui-dialog-content { + width: 515px; + height: 360px; + } +/*段落弹出菜单*/ +.edui-default .edui-for-paragraph .edui-listitem-label { + font-family: Tahoma, Verdana, Arial, Helvetica; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-p { + font-size: 22px; + line-height: 27px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h1 { + font-size: 32px; + font-weight: bolder; + line-height: 36px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h2 { + font-size: 27px; + font-weight: bolder; + line-height: 29px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h3 { + font-size: 19px; + font-weight: bolder; + line-height: 23px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h4 { + font-size: 16px; + font-weight: bolder; + line-height: 19px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h5 { + font-size: 13px; + font-weight: bolder; + line-height: 16px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h6 { + font-size: 12px; + font-weight: bolder; + line-height: 14px; + } +/* 表格弹出菜单 */ +.edui-default .edui-for-inserttable .edui-splitborder { + display: none; + } +.edui-default .edui-for-inserttable .edui-splitbutton-body .edui-arrow { + width: 0; + } +.edui-default .edui-toolbar .edui-for-inserttable .edui-state-active .edui-splitborder { + border-left: 1px solid transparent; + } +.edui-default .edui-tablepicker .edui-infoarea { + width: 220px; + height: 14px; + margin-bottom: 3px; + clear: both; + font-size: 12px; + line-height: 14px; + } +.edui-default .edui-tablepicker .edui-infoarea .edui-label { + float: left; + } +.edui-default .edui-dialog-buttons .edui-label { + line-height: 24px; + } +.edui-default .edui-tablepicker .edui-infoarea .edui-clickable { + float: right; + } +.edui-default .edui-tablepicker .edui-pickarea { + width: 220px; + height: 220px; + background: url("../images/unhighlighted.gif") repeat; + } +.edui-default .edui-tablepicker .edui-pickarea .edui-overlay { + background: url("../images/highlighted.gif") repeat; + } +/* 颜色弹出菜单 */ +.edui-default .edui-colorpicker-topbar { + width: 200px; + height: 27px; + /*border-bottom: 1px gray dashed;*/ + } +.edui-default .edui-colorpicker-preview { + float: left; + width: 128px; + height: 20px; + margin-left: 1px; + border: 1px inset black; + } +.edui-default .edui-colorpicker-nocolor { + float: right; + height: 14px; + padding: 3px 5px; + margin-right: 1px; + font-size: 12px; + line-height: 14px; + cursor: pointer; + border: 1px solid #333; + } +.edui-default .edui-colorpicker-tablefirstrow { + height: 30px; + } +.edui-default .edui-colorpicker-colorcell { + display: block; + width: 14px; + height: 14px; + margin: 0; + cursor: pointer; + } +.edui-default .edui-colorpicker-colorcell:hover { + width: 14px; + height: 14px; + margin: 0; + } +.edui-default .edui-colorpicker-advbtn { + display: block; + height: 20px; + text-align: center; + cursor: pointer; + } +.arrow_down { + background: white url('../images/arrow_down.png') no-repeat center; + } +.arrow_up { + background: white url('../images/arrow_up.png') no-repeat center; + } +/*高级的样式*/ +.edui-colorpicker-adv { + position: relative; + display: none; + height: 180px; + overflow: hidden; + } +.edui-colorpicker-plant, +.edui-colorpicker-hue { + border: solid 1px #666; + } +.edui-colorpicker-pad { + position: absolute; + top: 13px; + left: 14px; + width: 150px; + height: 150px; + overflow: hidden; + cursor: crosshair; + background: red; + } +.edui-colorpicker-cover { + position: absolute; + top: 0; + left: 0; + width: 150px; + height: 150px; + background: url("../images/tangram-colorpicker.png") -160px -200px; + } +.edui-colorpicker-padDot { + position: absolute; + top: 0; + left: 0; + z-index: 1000; + width: 11px; + height: 11px; + overflow: hidden; + background: url(../images/tangram-colorpicker.png) 0 -200px repeat-x; + } +.edui-colorpicker-sliderMain { + position: absolute; + top: 13px; + left: 171px; + width: 19px; + height: 152px; + background: url(../images/tangram-colorpicker.png) -179px -12px no-repeat; + } +.edui-colorpicker-slider { + width: 100%; + height: 100%; + cursor: pointer; + } +.edui-colorpicker-thumb { + position: absolute; + top: 0; + right: -1px; + left: -1px; + height: 3px; + cursor: pointer; + background: white; + border: 1px solid black; + opacity: .8; + } +/*自动排版弹出菜单*/ +.edui-default .edui-autotypesetpicker .edui-autotypesetpicker-body { + margin-bottom: 3px; + clear: both; + font-size: 12px; + } +.edui-default .edui-autotypesetpicker-body table { + border-spacing: 2px; + border-collapse: separate; + } +.edui-default .edui-autotypesetpicker-body td { + font-size: 12px; + word-wrap: break-word; + } +.edui-default .edui-autotypesetpicker-body td input { + margin: 3px 3px 3px 4px; + + *margin: 1px 0 0 0; + } +/*自动排版弹出菜单*/ +.edui-default .edui-cellalignpicker .edui-cellalignpicker-body { + width: 70px; + font-size: 12px; + cursor: default; + } +.edui-default .edui-cellalignpicker-body table { + border-spacing: 0; + border-collapse: separate; + } +.edui-default .edui-cellalignpicker-body td { + padding: 1px; + } +.edui-default .edui-cellalignpicker-body .edui-icon { + width: 20px; + height: 20px; + padding: 1px; + background-image: url(../images/table-cell-align.png); + } +.edui-default .edui-cellalignpicker-body .edui-left { + background-position: 0 0; + } +.edui-default .edui-cellalignpicker-body .edui-center { + background-position: -25px 0; + } +.edui-default .edui-cellalignpicker-body .edui-right { + background-position: -51px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-left { + background-position: -73px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-center { + background-position: -98px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-right { + background-position: -124px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-left { + background-color: #f1f4f5; + background-position: -146px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-center { + background-position: -245px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-right { + background-position: -271px 0; + } +/*分隔线*/ +.edui-default .edui-toolbar .edui-separator { + width: 2px; + height: 20px; + margin: 2px 4px 2px 3px; + background: url(../images/icons.png) -181px 0; + background: url(../images/icons.gif) -181px 0 \9; + } +/*颜色按钮 */ +.edui-default .edui-toolbar .edui-colorbutton .edui-colorlump { + position: absolute; + bottom: 1px; + left: 1px; + width: 18px; + height: 4px; + overflow: hidden; + } +/*表情按钮及弹出菜单*/ +/*去除了表情的下拉箭头*/ +.edui-default .edui-for-emotion .edui-icon { + background-position: -60px -20px; + } +.edui-default .edui-for-emotion .edui-popup-content iframe { + width: 514px; + height: 380px; + overflow: hidden; + } +.edui-default .edui-for-emotion .edui-popup-content { + position: relative; + z-index: 555; + } +.edui-default .edui-for-emotion .edui-splitborder { + display: none; + } +.edui-default .edui-for-emotion .edui-splitbutton-body .edui-arrow { + width: 0; + } +.edui-default .edui-toolbar .edui-for-emotion .edui-state-active .edui-splitborder { + border-left: 1px solid transparent; + } +/*contextmenu*/ +.edui-default .edui-hassubmenu .edui-arrow { + float: right; + width: 20px; + height: 20px; + background: url("../images/icons-all.gif") no-repeat 10px -233px; + } +.edui-default .edui-menu-body .edui-menuitem { + padding: 1px; + } +.edui-default .edui-menuseparator { + height: 1px; + margin: 2px 0; + overflow: hidden; + } +.edui-default .edui-menuseparator-inner { + margin-right: 1px; + margin-left: 29px; + border-bottom: 1px solid #e2e3e3; + } +.edui-default .edui-menu-body .edui-state-hover { + padding: 0 !important; + background-color: #fff5d4; + border: 1px solid #dcac6c; + } +/*弹出菜单*/ +.edui-default .edui-shortcutmenu { + width: 190px; + height: 50px; + padding: 2px; + background-color: #fff; + border: 1px solid #ccc; + border-radius: 4px; + } +/*粘贴弹出菜单*/ +.edui-default .edui-wordpastepop .edui-popup-content { + width: 54px; + height: 21px; + padding: 0; + border: none; + } +.edui-default .edui-pasteicon { + width: 100%; + height: 100%; + background-image: url('../images/wordpaste.png'); + background-position: 0 0; + } +.edui-default .edui-pasteicon.edui-state-opened { + background-position: 0 -34px; + } +.edui-default .edui-pastecontainer { + position: relative; + width: 97px; + visibility: hidden; + background: #fff; + border: 1px solid #ccc; + } +.edui-default .edui-pastecontainer .edui-title { + height: 25px; + padding-left: 5px; + font-size: 12px; + font-weight: bold; + line-height: 25px; + background: #f8f8ff; + } +.edui-default .edui-pastecontainer .edui-button { + margin: 3px 0; + overflow: hidden; + } +.edui-default .edui-pastecontainer .edui-button .edui-richtxticon, +.edui-default .edui-pastecontainer .edui-button .edui-tagicon, +.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon { + float: left; + width: 29px; + height: 29px; + margin-left: 5px; + cursor: pointer; + background-image: url('../images/wordpaste.png'); + background-repeat: no-repeat; + } +.edui-default .edui-pastecontainer .edui-button .edui-richtxticon { + margin-left: 0; + background-position: -109px 0; + } +.edui-default .edui-pastecontainer .edui-button .edui-tagicon { + background-position: -148px 1px; + } +.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon { + background-position: -72px 0; + } +.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-richtxticon { + background-position: -109px -34px; + } +.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-tagicon { + background-position: -148px -34px; + } +.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-plaintxticon { + background-position: -72px -34px; + } diff --git a/dist/resources/static/js/lib/zui/lib/ueditor/ueditor.min.css b/dist/resources/static/js/lib/zui/lib/ueditor/ueditor.min.css new file mode 100644 index 0000000..0900926 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/ueditor/ueditor.min.css @@ -0,0 +1 @@ +.edui-default .edui-box{padding:0;margin:0;overflow:hidden;border:none}.edui-default a.edui-box{display:block;color:#000;text-decoration:none}.edui-default a.edui-box:hover{text-decoration:none}.edui-default a.edui-box:active{text-decoration:none}.edui-default table.edui-box{border-collapse:collapse}.edui-default ul.edui-box{list-style-type:none}div.edui-box{position:relative;display:inline-block!important;vertical-align:top}.edui-default .edui-clearfix{zoom:1}.edui-default .edui-clearfix:after{display:block;clear:both;content:'\20'}* html div.edui-box{display:inline!important}.edui-combox-body,.edui-default .edui-button-body,.edui-menubutton-body,.edui-splitbutton-body{position:relative}.edui-default .edui-popup{position:absolute;-webkit-user-select:none;-moz-user-select:none}.edui-default .edui-popup .edui-shadow{position:absolute;z-index:-1}.edui-default .edui-popup .edui-bordereraser{position:absolute;overflow:hidden}.edui-default .edui-tablepicker .edui-canvas{position:relative}.edui-default .edui-tablepicker .edui-canvas .edui-overlay{position:absolute}.edui-default .edui-dialog-modalmask,.edui-dialog-dragmask{position:absolute;top:0;left:0;width:100%;height:100%}.edui-default .edui-toolbar{position:relative}.edui-default .edui-label{cursor:default}.edui-default span.edui-clickable{color:#00f;text-decoration:underline;cursor:pointer}.edui-default span.edui-unclickable{color:gray;cursor:default}.edui-default .edui-toolbar{width:auto;height:auto;padding:1px;overflow:hidden;cursor:default;zoom:1;-webkit-user-select:none;-moz-user-select:none}.edui-default .edui-toolbar .edui-button,.edui-default .edui-toolbar .edui-combox,.edui-default .edui-toolbar .edui-menubutton,.edui-default .edui-toolbar .edui-splitbutton{margin:1px}.edui-default .edui-editor{position:relative;overflow:visible;background-color:#fff;border:1px solid #d4d4d4;border-radius:4px}.edui-editor div{width:auto;height:auto}.edui-default .edui-editor-toolbarbox{position:relative;zoom:1;border-top-left-radius:4px;border-top-right-radius:4px}.edui-default .edui-editor-toolbarboxouter{background-color:#fafafa;background-repeat:repeat-x;border-bottom:1px solid #d4d4d4;*zoom:1}.edui-default .edui-editor-toolbarboxinner{padding:2px}.edui-default .edui-editor-iframeholder{position:relative}.edui-default .edui-editor-bottomContainer{overflow:hidden}.edui-default .edui-editor-bottomContainer table{width:100%;height:0;overflow:hidden;border-spacing:0}.edui-default .edui-editor-bottomContainer td{font-family:Arial,Helvetica,Tahoma,Verdana,Sans-Serif;font-size:12px;line-height:20px;white-space:nowrap;border-top:1px solid #ccc}.edui-default .edui-editor-wordcount{margin-right:5px;color:#aaa;text-align:right}.edui-default .edui-editor-scale{width:12px}.edui-default .edui-editor-scale .edui-editor-icon{float:right;width:100%;height:12px;margin-top:10px;cursor:se-resize;background:url(../images/scale.png) no-repeat}.edui-default .edui-editor-breadcrumb{margin:2px 0 0 3px}.edui-default .edui-editor-breadcrumb span{color:#00f;text-decoration:underline;cursor:pointer}.edui-default .edui-toolbar .edui-for-fullscreen{float:right}.edui-default .edui-bubble .edui-popup-content{padding:5px;font-family:"宋体";font-size:10pt;background-color:#fff6d9;border:1px solid #dcac6c}.edui-default .edui-editor-toolbarmsg{position:absolute;bottom:-25px;left:0;z-index:1009;width:99.9%;background-color:#fff6d9;border-bottom:1px solid #ccc}.edui-default .edui-editor-toolbarmsg-upload{position:absolute;top:5px;left:350px;width:100px;height:16px;font-size:14px;line-height:16px;color:#00f;cursor:pointer}.edui-default .edui-editor-toolbarmsg-label{padding:4px;font-size:12px;line-height:16px}.edui-default .edui-editor-toolbarmsg-close{float:right;width:20px;height:16px;line-height:16px;color:red;cursor:pointer}.edui-default .edui-list .edui-bordereraser{display:none}.edui-default .edui-listitem{padding:1px;white-space:nowrap}.edui-default .edui-list .edui-state-hover{position:relative;padding:0;background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-for-fontfamily .edui-listitem-label{min-width:130px;height:22px;padding-left:5px;font-size:12px;line-height:22px;_width:120px}.edui-default .edui-for-insertcode .edui-listitem-label{min-width:120px;height:22px;padding-left:5px;font-size:12px;line-height:22px;_width:120px}.edui-default .edui-for-underline .edui-listitem-label{min-width:120px;padding:3px 5px;font-size:12px;_width:120px}.edui-default .edui-for-fontsize .edui-listitem-label{min-width:120px;padding:3px 5px;_width:120px}.edui-default .edui-for-paragraph .edui-listitem-label{min-width:200px;padding:2px 5px;_width:200px}.edui-default .edui-for-rowspacingbottom .edui-listitem-label,.edui-default .edui-for-rowspacingtop .edui-listitem-label{min-width:53px;padding:2px 5px;_width:53px}.edui-default .edui-for-lineheight .edui-listitem-label{min-width:53px;padding:2px 5px;_width:53px}.edui-default .edui-for-customstyle .edui-listitem-label{width:200px!important;min-width:200px;padding:2px 5px;_width:200px}.edui-default .edui-menu{z-index:3000}.edui-default .edui-menu .edui-popup-content{padding:3px}.edui-default .edui-menu-body{min-width:170px;background:url(../images/sparator_v.png) repeat-y 25px;_width:150px}.edui-default .edui-menuitem{height:20px;vertical-align:top;cursor:default}.edui-default .edui-menuitem .edui-icon{width:20px!important;height:20px!important;background:url(../images/icons.png) 0 -4000px;background:url(../images/icons.gif) 0 -4000px\9}.edui-default .edui-menuitem .edui-label{height:20px;padding-left:10px;font-size:12px;line-height:20px}.edui-default .edui-state-checked .edui-menuitem-body{background:url(../images/icons-all.gif) no-repeat 6px -205px}.edui-default .edui-state-disabled .edui-menuitem-label{color:gray}.edui-default .edui-toolbar .edui-combox-body .edui-button-body{width:60px;height:20px;padding-left:5px;margin:0 3px 0 0;font-size:12px;line-height:20px;white-space:nowrap}.edui-default .edui-toolbar .edui-combox-body .edui-arrow{width:9px;height:20px;background:url(../images/icons.png) -741px 0;_background:url(../images/icons.gif) -741px 0}.edui-default .edui-toolbar .edui-combox .edui-combox-body{background-color:#fff;border:1px solid #ccc;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.edui-default .edui-toolbar .edui-combox-body .edui-splitborder{display:none}.edui-default .edui-toolbar .edui-combox-body .edui-arrow{border-left:1px solid #ccc}.edui-default .edui-toolbar .edui-state-hover .edui-combox-body{background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-toolbar .edui-state-hover .edui-combox-body .edui-arrow{border-left:1px solid #dcac6c}.edui-default .edui-toolbar .edui-state-checked .edui-combox-body{background-color:#ffe69f;border:1px solid #dcac6c}.edui-toolbar .edui-state-checked .edui-combox-body .edui-arrow{border-left:1px solid #dcac6c}.edui-toolbar .edui-state-disabled .edui-combox-body{background-color:#f0f0ee;filter:alpha(opacity=30);opacity:.3}.edui-toolbar .edui-state-opened .edui-combox-body{background-color:#fff;border:1px solid gray}.edui-default .edui-toolbar .edui-button .edui-icon,.edui-default .edui-toolbar .edui-menubutton .edui-icon,.edui-default .edui-toolbar .edui-splitbutton .edui-icon{width:20px!important;height:20px!important;background-image:url(../images/icons.png);background-image:url(../images/icons.gif)\9}.edui-default .edui-toolbar .edui-button .edui-button-wrap{position:relative;padding:1px}.edui-default .edui-toolbar .edui-button .edui-state-hover .edui-button-wrap{padding:0;background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-toolbar .edui-button .edui-state-checked .edui-button-wrap{padding:0;background-color:#ffe69f;border:1px solid #dcac6c;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.edui-default .edui-toolbar .edui-button .edui-state-active .edui-button-wrap{padding:0;background-color:#fff;border:1px solid gray}.edui-default .edui-toolbar .edui-state-disabled .edui-label{color:#ccc}.edui-default .edui-toolbar .edui-state-disabled .edui-icon{filter:alpha(opacity=30);opacity:.3}.edui-default .edui-for-undo .edui-icon{background-position:-160px 0}.edui-default .edui-for-redo .edui-icon{background-position:-100px 0}.edui-default .edui-for-bold .edui-icon{background-position:0 0}.edui-default .edui-for-italic .edui-icon{background-position:-60px 0}.edui-default .edui-for-fontborder .edui-icon{background-position:-160px -40px}.edui-default .edui-for-underline .edui-icon{background-position:-140px 0}.edui-default .edui-for-strikethrough .edui-icon{background-position:-120px 0}.edui-default .edui-for-subscript .edui-icon{background-position:-600px 0}.edui-default .edui-for-superscript .edui-icon{background-position:-620px 0}.edui-default .edui-for-blockquote .edui-icon{background-position:-220px 0}.edui-default .edui-for-forecolor .edui-icon{background-position:-720px 0}.edui-default .edui-for-backcolor .edui-icon{background-position:-760px 0}.edui-default .edui-for-inserttable .edui-icon{background-position:-580px -20px}.edui-default .edui-for-autotypeset .edui-icon{background-position:-640px -40px}.edui-default .edui-for-justifyleft .edui-icon{background-position:-460px 0}.edui-default .edui-for-justifycenter .edui-icon{background-position:-420px 0}.edui-default .edui-for-justifyright .edui-icon{background-position:-480px 0}.edui-default .edui-for-justifyjustify .edui-icon{background-position:-440px 0}.edui-default .edui-for-insertorderedlist .edui-icon{background-position:-80px 0}.edui-default .edui-for-insertunorderedlist .edui-icon{background-position:-20px 0}.edui-default .edui-for-lineheight .edui-icon{background-position:-725px -40px}.edui-default .edui-for-rowspacingbottom .edui-icon{background-position:-745px -40px}.edui-default .edui-for-rowspacingtop .edui-icon{background-position:-765px -40px}.edui-default .edui-for-horizontal .edui-icon{background-position:-360px 0}.edui-default .edui-for-link .edui-icon{background-position:-500px 0}.edui-default .edui-for-code .edui-icon{background-position:-440px -40px}.edui-default .edui-for-insertimage .edui-icon{background-position:-726px -77px}.edui-default .edui-for-insertframe .edui-icon{background-position:-240px -40px}.edui-default .edui-for-emoticon .edui-icon{background-position:-60px -20px}.edui-default .edui-for-spechars .edui-icon{background-position:-240px 0}.edui-default .edui-for-help .edui-icon{background-position:-340px 0}.edui-default .edui-for-print .edui-icon{background-position:-440px -20px}.edui-default .edui-for-preview .edui-icon{background-position:-420px -20px}.edui-default .edui-for-selectall .edui-icon{background-position:-400px -20px}.edui-default .edui-for-searchreplace .edui-icon{background-position:-520px -20px}.edui-default .edui-for-map .edui-icon{background-position:-40px -40px}.edui-default .edui-for-gmap .edui-icon{background-position:-260px -40px}.edui-default .edui-for-insertvideo .edui-icon{background-position:-320px -20px}.edui-default .edui-for-time .edui-icon{background-position:-160px -20px}.edui-default .edui-for-date .edui-icon{background-position:-140px -20px}.edui-default .edui-for-cut .edui-icon{background-position:-680px 0}.edui-default .edui-for-copy .edui-icon{background-position:-700px 0}.edui-default .edui-for-paste .edui-icon{background-position:-560px 0}.edui-default .edui-for-formatmatch .edui-icon{background-position:-40px 0}.edui-default .edui-for-pasteplain .edui-icon{background-position:-360px -20px}.edui-default .edui-for-directionalityltr .edui-icon{background-position:-20px -20px}.edui-default .edui-for-directionalityrtl .edui-icon{background-position:-40px -20px}.edui-default .edui-for-source .edui-icon{background-position:-261px 0}.edui-default .edui-for-removeformat .edui-icon{background-position:-580px 0}.edui-default .edui-for-unlink .edui-icon{background-position:-640px 0}.edui-default .edui-for-touppercase .edui-icon{background-position:-786px 0}.edui-default .edui-for-tolowercase .edui-icon{background-position:-806px 0}.edui-default .edui-for-insertrow .edui-icon{background-position:-478px -76px}.edui-default .edui-for-insertrownext .edui-icon{background-position:-498px -76px}.edui-default .edui-for-insertcol .edui-icon{background-position:-455px -76px}.edui-default .edui-for-insertcolnext .edui-icon{background-position:-429px -76px}.edui-default .edui-for-mergeright .edui-icon{background-position:-60px -40px}.edui-default .edui-for-mergedown .edui-icon{background-position:-80px -40px}.edui-default .edui-for-splittorows .edui-icon{background-position:-100px -40px}.edui-default .edui-for-splittocols .edui-icon{background-position:-120px -40px}.edui-default .edui-for-insertparagraphbeforetable .edui-icon{background-position:-140px -40px}.edui-default .edui-for-deleterow .edui-icon{background-position:-660px -20px}.edui-default .edui-for-deletecol .edui-icon{background-position:-640px -20px}.edui-default .edui-for-splittocells .edui-icon{background-position:-800px -20px}.edui-default .edui-for-mergecells .edui-icon{background-position:-760px -20px}.edui-default .edui-for-deletetable .edui-icon{background-position:-620px -20px}.edui-default .edui-for-cleardoc .edui-icon{background-position:-520px 0}.edui-default .edui-for-fullscreen .edui-icon{background-position:-100px -20px}.edui-default .edui-for-anchor .edui-icon{background-position:-200px 0}.edui-default .edui-for-pagebreak .edui-icon{background-position:-460px -40px}.edui-default .edui-for-imagenone .edui-icon{background-position:-480px -40px}.edui-default .edui-for-imageleft .edui-icon{background-position:-500px -40px}.edui-default .edui-for-wordimage .edui-icon{background-position:-660px -40px}.edui-default .edui-for-imageright .edui-icon{background-position:-520px -40px}.edui-default .edui-for-imagecenter .edui-icon{background-position:-540px -40px}.edui-default .edui-for-indent .edui-icon{background-position:-400px 0}.edui-default .edui-for-outdent .edui-icon{background-position:-540px 0}.edui-default .edui-for-webapp .edui-icon{background-position:-601px -40px}.edui-default .edui-for-table .edui-icon{background-position:-580px -20px}.edui-default .edui-for-edittable .edui-icon{background-position:-420px -40px}.edui-default .edui-for-template .edui-icon{background-position:-339px -40px}.edui-default .edui-for-delete .edui-icon{background-position:-360px -40px}.edui-default .edui-for-attachment .edui-icon{background-position:-620px -40px}.edui-default .edui-for-edittd .edui-icon{background-position:-700px -40px}.edui-default .edui-for-snapscreen .edui-icon{background-position:-581px -40px}.edui-default .edui-for-scrawl .edui-icon{background-position:-801px -41px}.edui-default .edui-for-background .edui-icon{background-position:-680px -40px}.edui-default .edui-for-music .edui-icon{background-position:-18px -40px}.edui-default .edui-for-formula .edui-icon{background-position:-200px -40px}.edui-default .edui-for-aligntd .edui-icon{background-position:-236px -76px}.edui-default .edui-for-insertparagraphtrue .edui-icon{background-position:-625px -76px}.edui-default .edui-for-insertparagraph .edui-icon{background-position:-602px -76px}.edui-default .edui-for-insertcaption .edui-icon{background-position:-336px -76px}.edui-default .edui-for-deletecaption .edui-icon{background-position:-362px -76px}.edui-default .edui-for-inserttitle .edui-icon{background-position:-286px -76px}.edui-default .edui-for-deletetitle .edui-icon{background-position:-311px -76px}.edui-default .edui-for-aligntable .edui-icon{background-position:-440px 0}.edui-default .edui-for-tablealignment-left .edui-icon{background-position:-460px 0}.edui-default .edui-for-tablealignment-center .edui-icon{background-position:-420px 0}.edui-default .edui-for-tablealignment-right .edui-icon{background-position:-480px 0}.edui-default .edui-for-drafts .edui-icon{background-position:-560px 0}.edui-default .edui-for-charts .edui-icon{background:url(../images/charts.png) no-repeat 2px 3px!important}.edui-default .edui-for-inserttitlecol .edui-icon{background-position:-673px -76px}.edui-default .edui-for-deletetitlecol .edui-icon{background-position:-698px -76px}.edui-default .edui-for-simpleupload .edui-icon{background-position:-380px 0}.edui-default .edui-toolbar .edui-menubutton-body .edui-arrow,.edui-default .edui-toolbar .edui-splitbutton-body .edui-arrow{width:9px;height:20px;background:url(../images/icons.png) -741px 0;_background:url(../images/icons.gif) -741px 0}.edui-default .edui-toolbar .edui-menubutton .edui-menubutton-body,.edui-default .edui-toolbar .edui-splitbutton .edui-splitbutton-body{padding:1px}.edui-default .edui-toolbar .edui-splitborder{width:1px;height:20px}.edui-default .edui-toolbar .edui-state-hover .edui-splitborder{width:1px;border-left:0 solid #dcac6c}.edui-default .edui-toolbar .edui-state-active .edui-splitborder{width:0;border-left:1px solid gray}.edui-default .edui-toolbar .edui-state-opened .edui-splitborder{width:1px;border:0}.edui-default .edui-toolbar .edui-menubutton .edui-state-hover .edui-menubutton-body,.edui-default .edui-toolbar .edui-splitbutton .edui-state-hover .edui-splitbutton-body{padding:0;background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-toolbar .edui-menubutton .edui-state-checked .edui-menubutton-body,.edui-default .edui-toolbar .edui-splitbutton .edui-state-checked .edui-splitbutton-body{padding:0;background-color:#ffe69f;border:1px solid #dcac6c}.edui-default .edui-toolbar .edui-menubutton .edui-state-active .edui-menubutton-body,.edui-default .edui-toolbar .edui-splitbutton .edui-state-active .edui-splitbutton-body{padding:0;background-color:#fff;border:1px solid gray}.edui-default .edui-state-disabled .edui-arrow{filter:alpha(opacity=30);opacity:.3}.edui-default .edui-toolbar .edui-menubutton .edui-state-opened .edui-menubutton-body,.edui-default .edui-toolbar .edui-splitbutton .edui-state-opened .edui-splitbutton-body{padding:0;background-color:#fff;border:1px solid gray}.edui-default .edui-for-insertorderedlist .edui-bordereraser,.edui-default .edui-for-insertunorderedlist .edui-bordereraser,.edui-default .edui-for-lineheight .edui-bordereraser,.edui-default .edui-for-rowspacingbottom .edui-bordereraser,.edui-default .edui-for-rowspacingtop .edui-bordereraser{background-color:#fff}.edui-default .edui-for-insertorderedlist .edui-popup-body .edui-icon,.edui-default .edui-for-insertunorderedlist .edui-popup-body .edui-icon,.edui-default .edui-for-lineheight .edui-popup-body .edui-icon,.edui-default .edui-for-rowspacingbottom .edui-popup-body .edui-icon,.edui-default .edui-for-rowspacingtop .edui-popup-body .edui-icon{background-image:none}.edui-default .edui-popup{z-index:3000;width:auto;height:auto;background-color:#fff}.edui-default .edui-popup .edui-shadow{top:0;left:0;width:100%;height:100%}.edui-default .edui-popup-content{padding:5px;background:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);*border-right-width:2px;*border-bottom-width:2px}.edui-default .edui-popup .edui-bordereraser{height:3px;background-color:#fff}.edui-default .edui-menu .edui-bordereraser{height:3px}.edui-default .edui-anchor-topleft .edui-bordereraser{top:-2px;left:1px}.edui-default .edui-anchor-topright .edui-bordereraser{top:-2px;right:1px}.edui-default .edui-anchor-bottomleft .edui-bordereraser{bottom:-6px;left:0;height:7px;border-right:1px solid gray;border-left:1px solid gray}.edui-default .edui-anchor-bottomright .edui-bordereraser{right:0;bottom:-6px;height:7px;border-right:1px solid gray;border-left:1px solid gray}.edui-popup div{width:auto;height:auto}.edui-default .edui-editor-messageholder{position:absolute;top:28px;right:3px;display:block;width:150px;height:auto;padding:0;margin:0;border:0}.edui-default .edui-message{position:relative;min-height:10px;padding:0;margin-bottom:3px;text-shadow:0 1px 0 rgba(255,255,255,.5)}.edui-default .edui-message-body{padding:8px 15px 8px 8px;color:#c09853;background-color:#fcf8e3;border:1px solid #fbeed5;border-radius:4px}.edui-default .edui-message-type-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.edui-default .edui-message-type-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.edui-default .edui-message-type-danger,.edui-default .edui-message-type-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.edui-default .edui-message .edui-message-closer{position:absolute;top:0;right:0;display:block;float:right;width:16px;height:16px;padding:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:20px;font-weight:700;line-height:16px;color:#999;text-shadow:0 1px 0 #fff;cursor:pointer;background:0 0;border:0}.edui-default .edui-message .edui-message-content{font-size:10pt;word-break:normal;word-wrap:break-word}.edui-default .edui-dialog{position:absolute;z-index:2000}.edui-dialog div{width:auto}.edui-default .edui-dialog-wrap{margin-right:6px;margin-bottom:6px}.edui-default .edui-dialog-fullscreen-flag{margin-right:0;margin-bottom:0}.edui-default .edui-dialog-body{position:relative;padding:2px 0 0 2px;_zoom:1}.edui-default .edui-dialog-fullscreen-flag .edui-dialog-body{padding:0}.edui-default .edui-dialog-shadow{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);*border-right-width:2px;*border-bottom-width:2px}.edui-default .edui-dialog-foot{background-color:#fff}.edui-default .edui-dialog-titlebar{position:relative;min-height:24px;padding:8px 10px;line-height:24px;cursor:move;border-bottom:1px solid #e5e5e5}.edui-default .edui-dialog-caption{padding-left:5px;font-size:12px;font-weight:700;line-height:26px}.edui-default .edui-dialog-draghandle{height:26px}.edui-default .edui-dialog-closebutton{position:absolute!important;top:4px;right:3px}.edui-default .edui-dialog-closebutton .edui-button-body{width:30px;height:30px;font-size:19.5px;font-weight:700;line-height:30px;color:#000;text-align:center;text-shadow:0 1px 0 #fff;cursor:pointer;filter:alpha(opacity=20);opacity:.2}.edui-default .edui-dialog-closebutton .edui-button-body:before{content:'×'}.edui-default .edui-dialog-closebutton .edui-button-body:hover{filter:alpha(opacity=70);opacity:.7}.edui-default .edui-dialog-foot{height:40px}.edui-default .edui-dialog-buttons{position:absolute;right:0}.edui-default .edui-dialog-buttons .edui-button{margin-right:10px}.edui-default .edui-dialog-buttons .edui-button .edui-button-body{width:96px;height:24px;font-size:12px;line-height:24px;text-align:center;cursor:default;background-color:#f2f2f2;border:1px solid #bfbfbf;border-radius:4px}.edui-default .edui-dialog-buttons .edui-button .edui-state-hover .edui-button-body{background-color:#dedede;border-color:#a1a1a1;-webkit-box-shadow:0 2px 1px rgba(0,0,0,.1);box-shadow:0 2px 1px rgba(0,0,0,.1)}.edui-default .edui-dialog iframe{padding:0;margin:0;vertical-align:top;border:0}.edui-default .edui-dialog-modalmask{position:absolute;background-color:#ccc;filter:alpha(opacity=30);opacity:.3}.edui-default .edui-dialog-dragmask{position:absolute;cursor:move;background-color:transparent}.edui-default .edui-dialog-content{position:relative}.edui-default .dialogcontmask{position:absolute;display:block;width:100%;height:100%;cursor:move;visibility:hidden;filter:alpha(opacity=0);opacity:0}.edui-default .edui-for-link .edui-dialog-content{width:420px;height:200px;overflow:hidden}.edui-default .edui-for-background .edui-dialog-content{width:440px;height:280px;overflow:hidden}.edui-default .edui-for-template .edui-dialog-content{width:630px;height:390px;overflow:hidden}.edui-default .edui-for-scrawl .edui-dialog-content{width:515px;height:360px;*width:506px}.edui-default .edui-for-spechars .edui-dialog-content{width:620px;height:500px;*width:630px;*height:570px}.edui-default .edui-for-insertimage .edui-dialog-content{width:650px;height:400px;overflow:hidden}.edui-default .edui-for-webapp .edui-dialog-content{width:560px;height:450px;overflow:hidden;_width:565px}.edui-default .edui-for-insertframe .edui-dialog-content{width:350px;height:200px;overflow:hidden}.edui-default .edui-for-wordimage .edui-dialog-content{width:620px;height:380px;overflow:hidden}.edui-default .edui-for-attachment .edui-dialog-content{width:650px;height:400px;overflow:hidden}.edui-default .edui-for-map .edui-dialog-content{width:550px;height:400px}.edui-default .edui-for-gmap .edui-dialog-content{width:550px;height:400px}.edui-default .edui-for-insertvideo .edui-dialog-content{width:590px;height:390px}.edui-default .edui-for-anchor .edui-dialog-content{width:320px;height:60px;overflow:hidden}.edui-default .edui-for-searchreplace .edui-dialog-content{width:400px;height:220px}.edui-default .edui-for-help .edui-dialog-content{width:400px;height:420px}.edui-default .edui-for-edittable .edui-dialog-content{width:540px;height:335px;_width:590px}.edui-default .edui-for-edittip .edui-dialog-content{width:225px;height:60px}.edui-default .edui-for-edittd .edui-dialog-content{width:240px;height:50px}.edui-default .edui-for-snapscreen .edui-dialog-content{width:400px;height:220px}.edui-default .edui-for-music .edui-dialog-content{width:515px;height:360px}.edui-default .edui-for-paragraph .edui-listitem-label{font-family:Tahoma,Verdana,Arial,Helvetica}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-p{font-size:22px;line-height:27px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h1{font-size:32px;font-weight:bolder;line-height:36px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h2{font-size:27px;font-weight:bolder;line-height:29px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h3{font-size:19px;font-weight:bolder;line-height:23px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h4{font-size:16px;font-weight:bolder;line-height:19px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h5{font-size:13px;font-weight:bolder;line-height:16px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h6{font-size:12px;font-weight:bolder;line-height:14px}.edui-default .edui-for-inserttable .edui-splitborder{display:none}.edui-default .edui-for-inserttable .edui-splitbutton-body .edui-arrow{width:0}.edui-default .edui-toolbar .edui-for-inserttable .edui-state-active .edui-splitborder{border-left:1px solid transparent}.edui-default .edui-tablepicker .edui-infoarea{width:220px;height:14px;margin-bottom:3px;clear:both;font-size:12px;line-height:14px}.edui-default .edui-tablepicker .edui-infoarea .edui-label{float:left}.edui-default .edui-dialog-buttons .edui-label{line-height:24px}.edui-default .edui-tablepicker .edui-infoarea .edui-clickable{float:right}.edui-default .edui-tablepicker .edui-pickarea{width:220px;height:220px;background:url(../images/unhighlighted.gif) repeat}.edui-default .edui-tablepicker .edui-pickarea .edui-overlay{background:url(../images/highlighted.gif) repeat}.edui-default .edui-colorpicker-topbar{width:200px;height:27px}.edui-default .edui-colorpicker-preview{float:left;width:128px;height:20px;margin-left:1px;border:1px inset #000}.edui-default .edui-colorpicker-nocolor{float:right;height:14px;padding:3px 5px;margin-right:1px;font-size:12px;line-height:14px;cursor:pointer;border:1px solid #333}.edui-default .edui-colorpicker-tablefirstrow{height:30px}.edui-default .edui-colorpicker-colorcell{display:block;width:14px;height:14px;margin:0;cursor:pointer}.edui-default .edui-colorpicker-colorcell:hover{width:14px;height:14px;margin:0}.edui-default .edui-colorpicker-advbtn{display:block;height:20px;text-align:center;cursor:pointer}.arrow_down{background:#fff url(../images/arrow_down.png) no-repeat center}.arrow_up{background:#fff url(../images/arrow_up.png) no-repeat center}.edui-colorpicker-adv{position:relative;display:none;height:180px;overflow:hidden}.edui-colorpicker-hue,.edui-colorpicker-plant{border:solid 1px #666}.edui-colorpicker-pad{position:absolute;top:13px;left:14px;width:150px;height:150px;overflow:hidden;cursor:crosshair;background:red}.edui-colorpicker-cover{position:absolute;top:0;left:0;width:150px;height:150px;background:url(../images/tangram-colorpicker.png) -160px -200px}.edui-colorpicker-padDot{position:absolute;top:0;left:0;z-index:1000;width:11px;height:11px;overflow:hidden;background:url(../images/tangram-colorpicker.png) 0 -200px repeat-x}.edui-colorpicker-sliderMain{position:absolute;top:13px;left:171px;width:19px;height:152px;background:url(../images/tangram-colorpicker.png) -179px -12px no-repeat}.edui-colorpicker-slider{width:100%;height:100%;cursor:pointer}.edui-colorpicker-thumb{position:absolute;top:0;right:-1px;left:-1px;height:3px;cursor:pointer;background:#fff;border:1px solid #000;opacity:.8}.edui-default .edui-autotypesetpicker .edui-autotypesetpicker-body{margin-bottom:3px;clear:both;font-size:12px}.edui-default .edui-autotypesetpicker-body table{border-spacing:2px;border-collapse:separate}.edui-default .edui-autotypesetpicker-body td{font-size:12px;word-wrap:break-word}.edui-default .edui-autotypesetpicker-body td input{margin:3px 3px 3px 4px;*margin:1px 0 0 0}.edui-default .edui-cellalignpicker .edui-cellalignpicker-body{width:70px;font-size:12px;cursor:default}.edui-default .edui-cellalignpicker-body table{border-spacing:0;border-collapse:separate}.edui-default .edui-cellalignpicker-body td{padding:1px}.edui-default .edui-cellalignpicker-body .edui-icon{width:20px;height:20px;padding:1px;background-image:url(../images/table-cell-align.png)}.edui-default .edui-cellalignpicker-body .edui-left{background-position:0 0}.edui-default .edui-cellalignpicker-body .edui-center{background-position:-25px 0}.edui-default .edui-cellalignpicker-body .edui-right{background-position:-51px 0}.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-left{background-position:-73px 0}.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-center{background-position:-98px 0}.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-right{background-position:-124px 0}.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-left{background-color:#f1f4f5;background-position:-146px 0}.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-center{background-position:-245px 0}.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-right{background-position:-271px 0}.edui-default .edui-toolbar .edui-separator{width:2px;height:20px;margin:2px 4px 2px 3px;background:url(../images/icons.png) -181px 0;background:url(../images/icons.gif) -181px 0\9}.edui-default .edui-toolbar .edui-colorbutton .edui-colorlump{position:absolute;bottom:1px;left:1px;width:18px;height:4px;overflow:hidden}.edui-default .edui-for-emotion .edui-icon{background-position:-60px -20px}.edui-default .edui-for-emotion .edui-popup-content iframe{width:514px;height:380px;overflow:hidden}.edui-default .edui-for-emotion .edui-popup-content{position:relative;z-index:555}.edui-default .edui-for-emotion .edui-splitborder{display:none}.edui-default .edui-for-emotion .edui-splitbutton-body .edui-arrow{width:0}.edui-default .edui-toolbar .edui-for-emotion .edui-state-active .edui-splitborder{border-left:1px solid transparent}.edui-default .edui-hassubmenu .edui-arrow{float:right;width:20px;height:20px;background:url(../images/icons-all.gif) no-repeat 10px -233px}.edui-default .edui-menu-body .edui-menuitem{padding:1px}.edui-default .edui-menuseparator{height:1px;margin:2px 0;overflow:hidden}.edui-default .edui-menuseparator-inner{margin-right:1px;margin-left:29px;border-bottom:1px solid #e2e3e3}.edui-default .edui-menu-body .edui-state-hover{padding:0!important;background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-shortcutmenu{width:190px;height:50px;padding:2px;background-color:#fff;border:1px solid #ccc;border-radius:4px}.edui-default .edui-wordpastepop .edui-popup-content{width:54px;height:21px;padding:0;border:none}.edui-default .edui-pasteicon{width:100%;height:100%;background-image:url(../images/wordpaste.png);background-position:0 0}.edui-default .edui-pasteicon.edui-state-opened{background-position:0 -34px}.edui-default .edui-pastecontainer{position:relative;width:97px;visibility:hidden;background:#fff;border:1px solid #ccc}.edui-default .edui-pastecontainer .edui-title{height:25px;padding-left:5px;font-size:12px;font-weight:700;line-height:25px;background:#f8f8ff}.edui-default .edui-pastecontainer .edui-button{margin:3px 0;overflow:hidden}.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon,.edui-default .edui-pastecontainer .edui-button .edui-richtxticon,.edui-default .edui-pastecontainer .edui-button .edui-tagicon{float:left;width:29px;height:29px;margin-left:5px;cursor:pointer;background-image:url(../images/wordpaste.png);background-repeat:no-repeat}.edui-default .edui-pastecontainer .edui-button .edui-richtxticon{margin-left:0;background-position:-109px 0}.edui-default .edui-pastecontainer .edui-button .edui-tagicon{background-position:-148px 1px}.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon{background-position:-72px 0}.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-richtxticon{background-position:-109px -34px}.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-tagicon{background-position:-148px -34px}.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-plaintxticon{background-position:-72px -34px} \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/uploader/.pydio b/dist/resources/static/js/lib/zui/lib/uploader/.pydio new file mode 100644 index 0000000..808d425 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/uploader/.pydio @@ -0,0 +1 @@ +832da66e-005c-4c7d-8464-851db0bdac1e \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/uploader/Moxie.swf b/dist/resources/static/js/lib/zui/lib/uploader/Moxie.swf new file mode 100644 index 0000000..ca29775 Binary files /dev/null and b/dist/resources/static/js/lib/zui/lib/uploader/Moxie.swf differ diff --git a/dist/resources/static/js/lib/zui/lib/uploader/Moxie.xap b/dist/resources/static/js/lib/zui/lib/uploader/Moxie.xap new file mode 100644 index 0000000..70ef069 Binary files /dev/null and b/dist/resources/static/js/lib/zui/lib/uploader/Moxie.xap differ diff --git a/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.css b/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.css new file mode 100644 index 0000000..f5a49ef --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.css @@ -0,0 +1,613 @@ +/*! + * ZUI: 文件上传 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +.uploader { + position: relative; + margin-bottom: 20px; + } +.uploader-btn-hidden { + position: absolute; + top: -1px; + left: -1px; + width: 1px; + height: 1px; + opacity: 0; + } +.file-dragable { + position: relative; + } +[data-drop-placeholder]:before { + position: absolute; + top: 0; + left: 0; + z-index: 10; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + width: 100%; + height: 100%; + font-size: 16px; + text-align: center; + pointer-events: none; + content: attr(data-drop-placeholder); + background-color: rgba(255, 240, 213, .5); + filter: alpha(opacity=0); + border: 2px dashed #f1a325; + opacity: 0; + -webkit-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; + -webkit-transform: scale(.95); + -ms-transform: scale(.95); + -o-transform: scale(.95); + transform: scale(.95); + + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + } +.ie [data-drop-placeholder]:before { + display: none !important; + } +.file-dragable[data-drop-placeholder]:before { + filter: alpha(opacity=100); + opacity: 1; + -webkit-transform: scale(1); + -ms-transform: scale(1); + -o-transform: scale(1); + transform: scale(1); + } +.file-drag-enter[data-drop-placeholder]:before { + background-color: #fff0d5; + border-style: solid; + } +.uploader-files, +.file-list { + position: relative; + min-height: 32px; + margin-bottom: 10px; + border: 1px solid #ddd; + } +.uploader-files[data-drag-placeholder]:before, +.file-list[data-drag-placeholder]:before { + position: absolute; + top: 50%; + right: 0; + left: 0; + display: block; + margin-top: -15px; + line-height: 32px; + color: #ddd; + text-align: center; + pointer-events: none; + content: attr(data-drag-placeholder); + -webkit-transition: all .4s; + -o-transition: all .4s; + transition: all .4s; + } +.uploader-files[data-drag-placeholder]:hover:before, +.file-list[data-drag-placeholder]:hover:before { + color: #808080; + } +.uploader-files .file-icon, +.file-list .file-icon { + position: relative; + width: 32px; + height: 32px; + line-height: 32px; + text-align: center; + filter: alpha(opacity=70); + opacity: .7; + -webkit-transition: opacity .4s; + -o-transition: opacity .4s; + transition: opacity .4s; + } +.uploader-files .file-icon-image, +.file-list .file-icon-image { + position: absolute; + top: 5px; + right: 5px; + bottom: 5px; + left: 5px; + background-color: #fff; + background-repeat: no-repeat; + background-position: center; + -webkit-background-size: cover; + background-size: cover; + border: 1px solid #ddd; + } +.uploader-files .file-name, +.file-list .file-name { + text-decoration: none; + -webkit-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; + } +.uploader-files .file-name[contenteditable], +.file-list .file-name[contenteditable] { + padding: 0 5px; + background-color: #fff; + outline: 1px solid #3280fc; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #97befd; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #97befd; + } +.uploader-files .file-name, +.file-list .file-name, +.uploader-files .file-size, +.file-list .file-size { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +.uploader-files .file-renaming .file-name[contenteditable], +.file-list .file-renaming .file-name[contenteditable] { + text-overflow: initial; + } +.uploader-files .file:hover .file-name, +.file-list .file:hover .file-name { + color: #3280fc; + } +.uploader-files .file:hover .file-icon, +.file-list .file:hover .file-icon { + opacity: 1; + } +.uploader-files .file-status, +.file-list .file-status { + display: inline-block; + line-height: 20px; + text-align: right; + } +.uploader-files .file-status:hover, +.file-list .file-status:hover { + background-color: rgba(0, 0, 0, .07); + } +.uploader-files .file-status > .icon, +.file-list .file-status > .icon { + line-height: 20px; + vertical-align: middle; + opacity: 1; + -webkit-transition: all .8s; + -o-transition: all .8s; + transition: all .8s; + -webkit-transform: scale(1); + -ms-transform: scale(1); + -o-transform: scale(1); + transform: scale(1); + } +.uploader-files .file-status > .icon:before, +.file-list .file-status > .icon:before { + content: '\e653'; + } +.uploader-files .file-status > .text, +.file-list .file-status > .text { + display: inline-block; + padding: 0 6px; + font-size: 12px; + line-height: 20px; + } +.uploader-files .file-status > .text:empty, +.file-list .file-status > .text:empty { + display: none; + } +.uploader-files .file[data-status="uploading"] .file-status > .icon, +.file-list .file[data-status="uploading"] .file-status > .icon { + filter: alpha(opacity=0); + opacity: 0; + -webkit-transform: scale(0); + -ms-transform: scale(0); + -o-transform: scale(0); + transform: scale(0); + } +.uploader-files .file[data-status="uploading"] .file-status > .text, +.file-list .file[data-status="uploading"] .file-status > .text { + color: #fff; + background-color: #3280fc; + border-radius: 10px; + } +.uploader-files .file[data-status="queue"] .file-status, +.file-list .file[data-status="queue"] .file-status { + color: #f1a325; + } +.uploader-files .file[data-status="queue"] .file-status > .icon:before, +.file-list .file[data-status="queue"] .file-status > .icon:before { + content: '\e6cd'; + } +.uploader-files .file[data-status="failed"] .file-status, +.file-list .file[data-status="failed"] .file-status { + color: #ea644a; + } +.uploader-files .file[data-status="failed"] .file-status > .icon:before, +.file-list .file[data-status="failed"] .file-status > .icon:before { + content: '\e66a'; + } +.uploader-files .file[data-status="done"] .file-status, +.file-list .file[data-status="done"] .file-status { + color: #38b03f; + } +.uploader-files .file .actions > .btn-reset-file, +.file-list .file .actions > .btn-reset-file, +.uploader-files .file .actions > .btn-download-file, +.file-list .file .actions > .btn-download-file, +.uploader-files .file[data-status="failed"] .actions > .btn-rename-file, +.file-list .file[data-status="failed"] .actions > .btn-rename-file, +.uploader-files .file[data-status="uploading"] .actions > .btn, +.file-list .file[data-status="uploading"] .actions > .btn, +.uploader-files .file[data-status="done"] .actions > .btn, +.file-list .file[data-status="done"] .actions > .btn { + display: none; + } +.uploader-files .file[data-status="done"] .actions > .btn-download-file[href], +.file-list .file[data-status="done"] .actions > .btn-download-file[href], +.uploader-files.file-show-rename-action-on-done .file[data-status="done"] .actions > .btn-rename-file, +.file-list.file-show-rename-action-on-done .file[data-status="done"] .actions > .btn-rename-file, +.uploader-files.file-show-delete-action-on-done .file[data-status="done"] .actions > .btn-delete-file, +.file-list.file-show-delete-action-on-done .file[data-status="done"] .actions > .btn-delete-file, +.uploader-files .file[data-status="failed"] .actions > .btn-reset-file, +.file-list .file[data-status="failed"] .actions > .btn-reset-file { + display: inline-block; + } +.uploader-files.file-rename-by-click [data-status="queue"] .file-name:hover, +.file-list.file-rename-by-click [data-status="queue"] .file-name:hover { + background-color: rgba(255, 255, 255, .5); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #97befd; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #97befd; + } +.uploader-files .file-progress-bar, +.file-list .file-progress-bar { + position: absolute; + top: 0; + bottom: 0; + left: 0; + z-index: 10; + pointer-events: none; + background-color: rgba(50, 128, 252, .1); + filter: alpha(opacity=0); + -webkit-box-shadow: inset 0 -2px #3280fc; + box-shadow: inset 0 -2px #3280fc; + opacity: 0; + -webkit-transition: width .6s ease, opacity .4s; + -o-transition: width .6s ease, opacity .4s; + transition: width .6s ease, opacity .4s; + } +.uploader-files .file[data-status="uploading"] .file-progress-bar, +.file-list .file[data-status="uploading"] .file-progress-bar { + filter: alpha(opacity=100); + opacity: 1; + } +.uploader-files .file[data-status="queue"], +.file-list .file[data-status="queue"] { + background-color: #fff0d5; + } +.uploader-files .file[data-status="failed"], +.file-list .file[data-status="failed"] { + background-color: #ffe5e0; + } +.uploader-files .file[data-status="done"], +.file-list .file[data-status="done"] { + background-color: #fff; + } +.uploader-actions { + background-color: #f1f1f1; + } +.file-list + .uploader-actions { + margin-top: -10px; + border: 1px solid #ddd; + border-top: none; + } +.uploader-actions .uploader-status { + padding: 5px 10px; + line-height: 20px; + } +.uploader-message { + position: absolute; + top: 0; + right: 0; + left: 0; + z-index: 1; + display: none; + padding: 5px 10px; + color: #fff; + background: #3280fc; + filter: alpha(opacity=95); + opacity: .95; + } +.uploader-message > .close { + position: absolute; + top: 3px; + right: 10px; + color: inherit; + text-shadow: none; + opacity: .4; + } +.uploader-message > .close:hover { + opacity: 1; + } +.uploader-message[data-type="danger"] { + background: #ea644a; + } +.uploader-message[data-type="warning"] { + background: #f1a325; + } +.uploader-message[data-type="info"] { + background: #03b8cf; + } +.uploader-message[data-type="success"] { + background: #38b03f; + } +.file-list .file { + position: relative; + z-index: 0; + background-color: #fff; + -webkit-transition: background .4s; + -o-transition: background .4s; + transition: background .4s; + } +.file-list .file + .file { + border-top: 1px solid #ddd; + } +.file-list .file-wrapper { + position: relative; + z-index: 2; + display: table; + width: 100%; + table-layout: fixed; + -webkit-transition: background .4s; + -o-transition: background .4s; + transition: background .4s; + } +.file-list .file-wrapper:hover { + background-color: rgba(0, 0, 0, .05); + } +.file-list .file-wrapper > .file-icon, +.file-list .file-wrapper > .content, +.file-list .file-wrapper > .actions { + display: table-cell; + vertical-align: middle; + } +.file-list .file-wrapper > .actions { + width: 150px; + text-align: right; + } +.file-list .file-wrapper > .actions > .btn { + padding: 5px 8px; + } +.file-list .file-wrapper > .actions > .btn:hover { + background-color: rgba(0, 0, 0, .07); + } +.file-list .file-name { + display: block; + } +.file-list .file-wrapper > .content > .file-name { + float: left; + } +.file-list .file-wrapper > .content > .file-size { + float: right; + margin-top: 2px; + } +.file-list .file-wrapper > .actions > .btn { + border-radius: 0; + } +.file-list .file-status { + padding: 5px; + } +.file-list-lg .file { + min-height: 50px; + } +.file-list-lg .file-icon { + width: 50px; + line-height: 50px; + } +.file-list-lg .file-icon .icon { + position: relative; + display: block; + width: 50px; + font-size: 28px; + line-height: 50px; + text-align: center; + } +.file-list-lg .file-icon .icon-file-o { + position: relative; + left: -2px; + } +.file-list-lg .file-status { + line-height: 40px; + } +.file-list-lg .file-status > .icon { + font-size: 20px; + } +.file-list-lg .file[data-status="done"] .file-status { + padding: 5px 12px; + } +.file-list-lg .file-wrapper > .content > .file-name { + float: none; + line-height: 20px; + } +.file-list-lg .file-wrapper > .content > .file-size { + float: none; + line-height: 14px; + } +.file-list-lg .file-wrapper > .actions > .btn { + padding: 14px 8px; + } +.file-list-lg .file-renaming .file-name[contenteditable] { + font-size: 14px; + line-height: 34px; + } +.file-list-lg .file-renaming .file-wrapper > .content > .file-size { + display: none; + } +.file-list-grid { + margin-right: -8px; + margin-left: -8px; + border: none; + } +.file-list-grid:before, +.file-list-grid:after { + display: table; + content: " "; + } +.file-list-grid:after { + clear: both; + } +.file-list-grid .file { + display: block; + float: left; + width: 120px; + height: 120px; + margin: 8px 8px 35px 8px; + border: 1px solid #ddd; + border-radius: 4px; + } +.file-list-grid .file .file-icon { + display: block; + width: 118px; + height: 118px; + overflow: hidden; + } +.file-list-grid .file-icon > .icon { + font-size: 70px; + line-height: 118px; + } +.file-list-grid .file-icon-image { + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; + border: none; + } +.file-list-grid .file-wrapper { + position: absolute; + top: 0; + right: 0; + left: 0; + display: block; + width: auto; + } +.file-list-grid .file-wrapper > .content { + position: absolute; + right: -1px; + bottom: -24px; + left: -1px; + display: block; + text-align: center; + -webkit-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; + } +.file-list-grid .file-wrapper > .content > .file-name { + position: relative; + z-index: 5; + float: none; + padding: 4px 0; + line-height: 16px; + border: 1px solid transparent; + } +.file-list-grid .file-wrapper > .content > .file-size { + position: absolute; + top: -24px; + left: 4px; + display: block; + padding: 0 5px; + line-height: 18px; + color: #fff; + background-color: #808080; + background-color: rgba(0, 0, 0, .5); + filter: alpha(opacity=0); + border-radius: 9px; + opacity: 0; + -webkit-transition: opacity .4s; + -o-transition: opacity .4s; + transition: opacity .4s; + } +.file-list-grid .file-renaming .file-wrapper > .content > .file-name, +.file-list-grid .file-wrapper > .content:hover > .file-name { + text-overflow: initial; + word-break: break-all; + white-space: normal; + background-color: #fff; + border-color: #ddd; + -webkit-box-shadow: none; + box-shadow: none; + } +.file-list-grid .file-renaming .file-wrapper > .content > .file-name { + padding: 4px; + text-align: left; + } +.file-list-grid .file[data-status="uploading"] .file-wrapper > .content > .file-size, +.file-list-grid .file:hover .file-wrapper > .content > .file-size { + filter: alpha(opacity=100); + opacity: 1; + } +.file-list-grid .file-wrapper > .actions { + position: absolute; + top: 0; + right: 0; + left: 0; + display: block; + width: 118px; + } +.file-list-grid .file-wrapper:hover > .actions { + background: rgba(255, 255, 255, .85); + } +.file-list-grid .file-wrapper > .actions > .file-status { + position: absolute; + top: 0; + left: 0; + height: 28px; + padding: 4px 5px; + } +.file-list-grid .file-wrapper > .actions > .file-status > .icon { + position: relative; + top: -1px; + display: inline-block; + font-size: 21px; + text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; + } +.file-list-grid .file-wrapper > .actions > .file-status > .text { + padding: 0; + } +.file-list-grid .file[data-status="failed"] .file-wrapper > .actions > .file-status > .icon { + font-size: 14px; + text-shadow: none; + } +.file-list-grid .file[data-status="uploading"] .file-wrapper > .actions > .file-status > .text { + position: absolute; + top: 4px; + left: 4px; + padding: 0 8px; + } +.file-list-grid .file[data-status="failed"] .file-wrapper > .actions > .file-status { + top: 4px; + left: 4px; + height: 20px; + padding: 0 8px; + color: #fff; + background-color: #ea644a; + border-radius: 10px; + } +.file-list-grid .file-wrapper > .actions > .btn { + padding: 3px 6px; + filter: alpha(opacity=0); + opacity: 0; + } +.file-list-grid .file-wrapper:hover > .actions > .btn { + filter: alpha(opacity=100); + opacity: 1; + } +.file-list-grid .file-progress-bar { + -webkit-box-shadow: inset 0 -4px #3280fc; + box-shadow: inset 0 -4px #3280fc; + } +.file-list-grid + .uploader-actions { + border: none; + } diff --git a/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.js b/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.js new file mode 100644 index 0000000..2cfdfec --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.js @@ -0,0 +1,939 @@ +/*! + * ZUI: 文件上传 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/** + * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill + * v1.5.7 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2017-11-03 + */ +!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r0&&c(n,function(n,u){var c=-1!==h(e(n),["array","object"]);return n===r||t&&o[u]===r?!0:(c&&i&&(n=a(n)),e(o[u])===e(n)&&c?s(t,i,[o[u],n]):o[u]=n,void 0)})}),o}function u(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.parent=t.prototype,e}function c(e,t){var i,n,r,o;if(e){try{i=e.length}catch(a){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function l(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function d(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++ri;i++)if(t[i]===e)return i}return-1}function f(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===h(t[r],i)&&n.push(t[r]);return n.length?n:!1}function p(e,t){var i=[];return c(e,function(e){-1!==h(e,t)&&i.push(e)}),i.length?i:null}function g(e){var t,i=[];for(t=0;ti;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:E,typeOf:e,extend:t,extendIf:i,extendImmutable:n,extendImmutableIf:r,clone:o,inherit:u,each:c,isEmptyObj:l,inSeries:d,inParallel:m,inArray:h,arrayDiff:f,arrayIntersect:p,toArray:g,trim:x,sprintf:w,parseSizeStr:v,delay:y}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},i=function(e,i){if("function"==typeof window.atob)return i?t(window.atob(e)):window.atob(e);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!e)return e;e+="";do a=d.indexOf(e.charAt(m++)),s=d.indexOf(e.charAt(m++)),u=d.indexOf(e.charAt(m++)),c=d.indexOf(e.charAt(m++)),l=a<<18|s<<12|u<<6|c,n=255&l>>16,r=255&l>>8,o=255&l,p[h++]=64==u?String.fromCharCode(n):64==c?String.fromCharCode(n,r):String.fromCharCode(n,r,o);while(m>18,s=63&l>>12,u=63&l>>6,c=63&l,p[h++]=d.charAt(a)+d.charAt(s)+d.charAt(u)+d.charAt(c);while(mn;n++)if(e[n]!=t[n]){if(e[n]=u(e[n]),t[n]=u(t[n]),e[n]t[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",i="?",n="function",r="undefined",o="object",a="name",s="version",u={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},c={rgx:function(){for(var t,i,a,s,u,c,l,d=0,m=arguments;d0?2==u.length?t[u[0]]=typeof u[1]==n?u[1].call(this,l):u[1]:3==u.length?t[u[0]]=typeof u[1]!==n||u[1].exec&&u[1].test?l?l.replace(u[1],u[2]):e:l?u[1].call(this,l,u[2]):e:4==u.length&&(t[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):e):t[u]=l?l:e;break}if(c)break}return t},str:function(t,n){for(var r in n)if(typeof n[r]===o&&n[r].length>0){for(var a=0;a=")),i.use_blob_uri},use_data_uri:function(){var e=new Image;return e.onload=function(){i.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return i.use_data_uri&&("IE"!==a.browser||a.version>=9)},use_data_uri_of:function(e){return i.use_data_uri&&33e3>e||i.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),i.use_fileinput=!e.disabled},use_webgl:function(){var e,n=document.createElement("canvas"),r=null;try{r=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(o){}return r||(r=null),e=!!r,i.use_webgl=e,n=t,e}};return function(t){var n=[].slice.call(arguments);return n.shift(),"function"===e.typeOf(i[t])?i[t].apply(this,n):!!i[t]}}(),o=(new n).getResult(),a={can:r,uaParser:n,browser:o.browser.name,version:o.browser.version,os:o.os.name,osVersion:o.os.version,verComp:i,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return a.OS=a.os,a}),n("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:function(){function i(e,i){this.code=e,this.name=t(n,e),this.message=this.name+(i||": RuntimeError "+this.code)}var n={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(i,n),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": ImageError "+this.code}var n={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(i,n),i.prototype=Error.prototype,i}(),FileException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": FileException "+this.code}var n={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(i,n),i.prototype=Error.prototype,i}(),DOMException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": DOMException "+this.code}var n={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(i,n),i.prototype=Error.prototype,i}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),n("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){if(!e.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)},n=function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,i){function n(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===c.compatMode?c.documentElement:c.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}var r,o,a,s=0,u=0,c=document;if(t=t,i=i||c.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!c.documentMode||c.documentMode<8))return o=n(t),a=n(i),{x:o.x-a.x,y:o.y-a.y};for(r=t;r&&r!=i&&r.nodeType;)s+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)s-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;return{x:s,y:u}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:i,addClass:n,removeClass:r,getStyle:o,getPos:a,getSize:s}}),n("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(e,t,i){function n(){this.uid=i.guid()}var r={};return i.extend(n.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(e,t,n,o){var a,s=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),e=i.trim(e),/\s/.test(e)?(i.each(e.split(/\s+/),function(e){s.addEventListener(e,t,n,o)}),void 0):(e=e.toLowerCase(),n=parseInt(n,10)||0,a=r[this.uid]&&r[this.uid][e]||[],a.push({fn:t,priority:n,scope:o||this}),r[this.uid]||(r[this.uid]={}),r[this.uid][e]=a,void 0)},hasEventListener:function(e){var t;return e?(e=e.toLowerCase(),t=r[this.uid]&&r[this.uid][e]):t=r[this.uid],t?t:!1},removeEventListener:function(e,t){var n,o,a=this;if(e=e.toLowerCase(),/\s/.test(e))return i.each(e.split(/\s+/),function(e){a.removeEventListener(e,t)}),void 0;if(n=r[this.uid]&&r[this.uid][e]){if(t){for(o=n.length-1;o>=0;o--)if(n[o].fn===t){n.splice(o,1);break}}else n=[];n.length||(delete r[this.uid][e],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(e){var n,o,a,s,u,c={},l=!0;if("string"!==i.typeOf(e)){if(s=e,"string"!==i.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=s.type,s.total!==u&&s.loaded!==u&&(c.total=s.total,c.loaded=s.loaded),c.async=s.async||!1}if(-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),c.type=e,a.unshift(c);var d=[];i.each(o,function(e){a[0].target=e.scope,c.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&i.inSeries(d,function(e){l=!e})}return l},bindOnce:function(e,t,i,n){var r=this;r.bind.call(this,e,function o(){return r.unbind(e,o),t.apply(this,arguments)},i,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)}),i.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===i.typeOf(t[e])&&(t[e]=null)})}}),n.instance=new n,n}),n("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(e,t,i,n){function r(e,n,o,s,u){var c,l=this,d=t.guid(n+"_"),m=u||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(m=r.getMode(s,e.preferred_caps,m)),c=function(){var e={};return{exec:function(t,i,n,r){return c[i]&&(e[t]||(e[t]={context:this,instance:new c[i]}),e[t].instance[n])?e[t].instance[n].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var i=this;t.each(e,function(e,n){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(n)})}}}(),t.extend(this,{initialized:!1,uid:d,type:n,mode:r.getMode(s,e.required_caps,m),shimid:d+"_container",clients:0,options:e,can:function(e,i){var n=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(i)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],n))return!1;return!0}return"function"===t.typeOf(n[e])?n[e].call(this,i):i===n[e]},getShimContainer:function(){var e,n=i.get(this.shimid);return n||(e=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(n),e=null),n},getShim:function(){return c},shimExec:function(e,t){var i=[].slice.call(arguments,2);return l.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return l[e]&&l[e][t]?l[e][t].apply(this,i):l.shimExec.apply(this,arguments)},destroy:function(){if(l){var e=i.get(this.shimid);e&&e.parentNode.removeChild(e),c&&c.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=l=c=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return a[e]?a[e]:!1},r.addConstructor=function(e,t){t.prototype=n.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var i={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){i[e]=!0}),i)},r.can=function(e,t){var i,n,o=r.getConstructor(e);return o?(i=new o({required_caps:t}),n=i.mode,i.destroy(),!!n):!1},r.thatCan=function(e,t){var i=(t||r.order).split(/\s*,\s*/);for(var n in i)if(r.can(i[n],e))return i[n];return null},r.getMode=function(e,i,n){var r=null;if("undefined"===t.typeOf(n)&&(n="browser"),i&&!t.isEmptyObj(e)){if(t.each(i,function(i,n){if(e.hasOwnProperty(n)){var o=e[n](i);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(n,r)?n:r[0];if(r===!1)return!1}return n},r.getGlobalEventTarget=function(){if(/^moxie\./.test(e.global_event_dispatcher)&&!e.can("access_global_ns")){var i=t.guid("moxie_event_target_");window[i]=function(e,t){n.instance.dispatchEvent(e,t)},e.global_event_dispatcher=i}return e.global_event_dispatcher},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),n("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(e,t,i,n){return function(){var e;i.extend(this,{connectRuntime:function(r){function o(i){var a,u;return i.length?(a=i.shift().toLowerCase(),(u=n.getConstructor(a))?(e=new u(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,s.ruid=e.uid,s.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(i)}),e.bind("Exception",function(e,i){var n=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,n))}),e.mode?(e.init(),void 0):(e.trigger("Error"),void 0)):(o(i),void 0)):(s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),e=null,void 0)}var a,s=this;if("string"===i.typeOf(r)?a=r:"string"===i.typeOf(r.ruid)&&(a=r.ruid),a){if(e=n.getRuntime(a))return s.ruid=a,e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null},can:function(t){return e?e.can(t):!1}})}}),n("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(e,t,i){function n(o,a){function s(t,i,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new n(null,{type:o,size:i-t}),a.detach(s.substr(t,a.size)),a):null}i.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,i){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var i=e.indexOf(";base64,");this.type=e.substring(5,i),e=t.atob(e.substring(i+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return n}),n("moxie/core/I18n",["moxie/core/utils/Basic"],function(e){var t={};return{addI18n:function(i){return e.extend(t,i)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),n("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(e,t){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb xlt xla,application/vnd.ms-powerpoint,ppt pps pot ppa,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",n={},r={},o=function(e){var t,i,o,a=e.split(/,/);for(t=0;ta;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):n.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(i){t.each(n,function(e){i(e.value,e.name)}),e&&i(e.value,e.name)},destroy:function(){e=null,n=[]}})}return n}),n("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u,c,l,d){function m(){this.uid=e.guid("uid_")}function h(){function i(e,t){return I.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?I[e]:A[e]:(l.can("define_property")?I[e]=t:A[e]=t,void 0):void 0}function u(t){function n(){_&&(_.destroy(),_=null),s.dispatchEvent("loadend"),s=null}function r(r){_.bind("LoadStart",function(e){i("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),L&&s.upload.dispatchEvent(e)}),_.bind("Progress",function(e){i("readyState")!==h.LOADING&&(i("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),_.bind("UploadProgress",function(e){L&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),_.bind("Load",function(t){i("readyState",h.DONE),i("status",Number(r.exec.call(_,"XMLHttpRequest","getStatus")||0)),i("statusText",f[i("status")]||""),i("response",r.exec.call(_,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),U=r.exec.call(_,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),i("status")>0?(L&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(F=!0,s.dispatchEvent("error")),n()}),_.bind("Abort",function(e){s.dispatchEvent(e),n()}),_.bind("Error",function(e){F=!0,i("readyState",h.DONE),s.dispatchEvent("readystatechange"),M=!0,s.dispatchEvent(e),n()}),r.exec.call(_,"XMLHttpRequest","send",{url:x,method:v,async:T,user:w,password:y,headers:S,mimeType:D,encoding:O,responseType:s.responseType,withCredentials:s.withCredentials,options:k},t)}var s=this;E=(new Date).getTime(),_=new a,"string"==typeof k.required_caps&&(k.required_caps=o.parseCaps(k.required_caps)),k.required_caps=e.extend({},k.required_caps,{return_response_type:s.responseType}),t instanceof c&&(k.required_caps.send_multipart=!0),e.isEmptyObj(S)||(k.required_caps.send_custom_headers=!0),B||(k.required_caps.do_cors=!0),k.ruid?r(_.connectRuntime(k)):(_.bind("RuntimeInit",function(e,t){r(t)}),_.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),_.connectRuntime(k))}function g(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),E=b=null}var x,v,w,y,E,b,_,R,A=this,I={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,S={},O=null,D=null,N=!1,C=!1,L=!1,M=!1,F=!1,B=!1,P=null,H=null,k={},U="";e.extend(this,I,{uid:e.guid("uid_"),upload:new m,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||n.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(v=o.toUpperCase()),~e.inArray(v,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=n.utf8_encode(a),l=r.parseUrl(a),B=r.hasSameOrigin(l),x=r.resolveUrl(a),(u||c)&&!B)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(w=u||l.user,y=c||l.pass,T=s||!0,T===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);N=!T,C=!1,S={},g.call(this),i("readyState",h.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(i("readyState")!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||n.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(S[r]?S[r]+=", "+o:S[r]=o,!0)},hasRequestHeader:function(e){return e&&S[e.toLowerCase()]||!1},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),F||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(R||(R={},e.each(U.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=e.trim(i[0]),R[i[0].toLowerCase()]={header:i[0],value:e.trim(i[1])})})),R.hasOwnProperty(t))?R[t].header+": "+R[t].value:null},overrideMimeType:function(n){var r,o;if(~e.inArray(i("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n=e.trim(n.toLowerCase()),/;/.test(n)&&(r=n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(n=r[1],r[2]&&(o=r[2])),!d.mimes[n])throw new t.DOMException(t.DOMException.SYNTAX_ERR);P=n,H=o},send:function(i,r){if(k="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof s)k.ruid=i.ruid,D=i.type||"application/octet-stream";else if(i instanceof c){if(i.hasBlob()){var o=i.getBlob();k.ruid=o.ruid,D=o.type||"application/octet-stream"}}else"string"==typeof i&&(O="UTF-8",D="text/plain;charset=UTF-8",i=n.utf8_encode(i));this.withCredentials||(this.withCredentials=k.required_caps&&k.required_caps.send_browser_cookies&&!B),L=!N&&this.upload.hasEventListener(),F=!1,M=!i,N||(C=!0),u.call(this,i)},abort:function(){if(F=!0,N=!1,~e.inArray(i("readyState"),[h.UNSENT,h.OPENED,h.DONE]))i("readyState",h.UNSENT);else{if(i("readyState",h.DONE),C=!1,!_)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);_.getRuntime().exec.call(_,"XMLHttpRequest","abort",M),M=!0}},destroy:function(){_&&("function"===e.typeOf(_.destroy)&&_.destroy(),_=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(p.concat(["readystatechange"])),this.upload.handleEventProps(p)}var f={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};m.prototype=i.instance;var p=["loadstart","progress","abort","error","load","timeout","loadend"];return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=i.instance,h}),n("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i,n){function r(){function n(){l=d=0,c=this.result=null}function o(t,i){var n=this;u=i,n.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(n.state,[r.IDLE,r.DONE])&&a.call(n)},999),n.bind("TransportingComplete",function(){d=l,n.state=r.DONE,c=null,n.result=u.exec.call(n,"Transporter","getAsBlob",t||"")},999),n.state=r.BUSY,n.trigger("TransportingStarted"),a.call(n)}function a(){var e,i=this,n=l-d;m>n&&(m=n),e=t.btoa(c.substr(d,m)),u.exec.call(i,"Transporter","receive",e,l)}var s,u,c,l,d,m;i.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,i,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),m=r.chunk_size,n.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,i,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,i,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),n.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),n.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=n.instance,r}),n("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(e,t,i,n,r,o,a,s,u,c,l,d,m){function h(){function n(e){try{return e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name),!0}catch(t){return this.trigger("error",t.code),!1}}function c(t){var n=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);p.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===n)"data:"===t.substr(0,5)?c.call(this,new l(null,{data:t}),arguments[1]):x.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function p(t,i){var n=this.connectRuntime(t.ruid);this.ruid=n.uid,n.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(i)?!0:i)}function g(t,i){function n(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=o.parseCaps(i.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):n(this.connectRuntime(t.ruid))}function x(e,t){var i,n=this;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){c.apply(this,arguments)},resize:function(t){var n,r,o=this,a={x:0,y:0,width:o.width,height:o.height},s=e.extendIf({width:o.width,height:o.height,type:o.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t);try{if(!o.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(o.width>h.MAX_RESIZE_WIDTH||o.height>h.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if(n=o.meta&&o.meta.tiff&&o.meta.tiff.Orientation||1,-1!==e.inArray(n,[5,6,7,8])){var u=s.width;s.width=s.height,s.height=u}if(s.crop){switch(r=Math.max(s.width/o.width,s.height/o.height),t.fit?(a.width=Math.min(Math.ceil(s.width/r),o.width),a.height=Math.min(Math.ceil(s.height/r),o.height),r=s.width/a.width):(a.width=Math.min(s.width,o.width),a.height=Math.min(s.height,o.height),r=1),"boolean"==typeof s.crop&&(s.crop="cc"),s.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":a.x=o.width-a.width,a.y=o.height-a.height;break;case"cb":case"center-bottom":a.x=Math.floor((o.width-a.width)/2),a.y=o.height-a.height;break;case"lb":case"left-bottom":a.x=0,a.y=o.height-a.height;break;case"lt":case"left-top":a.x=0,a.y=0;break;case"ct":case"center-top":a.x=Math.floor((o.width-a.width)/2),a.y=0;break;case"rt":case"right-top":a.x=o.width-a.width,a.y=0;break;case"rc":case"right-center":case"right-middle":a.x=o.width-a.width,a.y=Math.floor((o.height-a.height)/2);break;case"lc":case"left-center":case"left-middle":a.x=0,a.y=Math.floor((o.height-a.height)/2);break;case"cc":case"center-center":case"center-middle":default:a.x=Math.floor((o.width-a.width)/2),a.y=Math.floor((o.height-a.height)/2)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0)}else r=Math.min(s.width/o.width,s.height/o.height),r>1&&!s.fit&&(r=1);this.exec("Image","resize",a,r,s)}catch(c){o.trigger("error",c.code)}},downsize:function(t){var i,n={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,fit:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?e.extend(n,t):e.extend(n,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]}),this.resize(i)},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return this.exec("Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return m.atob(i.substring(i.indexOf("base64,")+7))},embed:function(n,r){function o(t,r){var o=this;if(u.can("create_canvas")){var l=o.getAsCanvas();if(l)return n.appendChild(l),l=null,o.destroy(),c.trigger("embedded"),void 0}var d=o.getAsDataURL(t,r);if(!d)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",d.length))n.innerHTML='',o.destroy(),c.trigger("embedded");else{var h=new s;h.bind("TransportingComplete",function(){a=c.connectRuntime(this.result.ruid),c.bind("Embedded",function(){e.extend(a.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),a=null},999),a.exec.call(c,"ImageView","display",this.result.uid,width,height),o.destroy()}),h.transport(m.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:n})}}var a,c=this,l=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,fit:!0,resample:"nearest"},r);try{if(!(n=t.get(n)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT;var d=new h;return d.bind("Resize",function(){o.call(this,l.type,l.quality)}),d.bind("Load",function(){this.downsize(l)}),this.meta.thumb&&this.meta.thumb.width>=l.width&&this.meta.thumb.height>=l.height?d.load(this.meta.thumb.data):d.clone(this,!1),d}catch(f){this.trigger("error",f.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.meta&&this.meta.thumb&&this.meta.thumb.data.destroy(),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){return n.call(this)},999)}var f=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=8192,h.MAX_RESIZE_HEIGHT=8192,h.prototype=c.instance,h}),n("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue,l=e.extend({access_binary:u(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!s.Image},display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:u(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:u(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==n.browser||n.verComp(n.version,9,">"))}()),filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),return_response_headers:c,return_response_type:function(e){return"json"===e&&window.JSON?!0:n.can("return_response_type",e)},return_status_code:c,report_upload_progress:u(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&n.can("create_canvas")},select_file:function(){return n.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===n.browser&&n.verComp(n.version,21,">=")||"Firefox"===n.browser&&n.verComp(n.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===n.browser&&"Windows"===n.os||"iOS"===n.os&&n.verComp(n.osVersion,"7.0.0",">")&&n.verComp(n.osVersion,"8.0.0","<"))},send_binary_string:u(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:u(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:u(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:c,use_http_method:c},arguments[2]);i.call(this,t,arguments[1]||a,l),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(e,t,i){var n;if(!window.File.prototype.slice)return(n=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?n.call(e,t,i):null;try{return e.slice(),e.slice(t,i)}catch(r){return e.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))},this.destroy=function(){this.getRuntime().getShim().removeInstance(this.uid)}}return e.Blob=i}),n("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(e){function t(){this.returnValue=!1}function i(){this.cancelBubble=!0}var n={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=i,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),n.hasOwnProperty(o[r])||(n[o[r]]={}),l=n[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,i,o){var a,s;if(i=i.toLowerCase(),t[r]&&n[t[r]]&&n[t[r]][i]){a=n[t[r]][i];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(i,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+i,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete n[t[r]][i],e.isEmptyObj(n[t[r]])){delete n[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,i){t&&t[r]&&e.each(n[t[r]],function(e,n){a(t,n,i)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),n("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){var e,s;i.extend(this,{init:function(u){var c,l,d,m,h,f,p=this,g=p.getRuntime();e=u,d=o.extList2mimes(e.accept,g.can("filter_by_extension")),l=g.getShimContainer(),l.innerHTML='",c=n.get(g.uid),i.extend(c.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=n.get(e.browse_button),s=n.getStyle(m,"z-index")||"auto",g.can("summon_file_dialog")&&("static"===n.getStyle(m,"position")&&(m.style.position="relative"),r.addEvent(m,"click",function(e){var t=n.get(g.uid);t&&!t.disabled&&t.click(),e.preventDefault()},p.uid),p.bind("Refresh",function(){h=parseInt(s,10)||1,n.get(e.browse_button).style.zIndex=h,this.getRuntime().getShimContainer().style.zIndex=h-1})),f=g.can("summon_file_dialog")?m:l,r.addEvent(f,"mouseover",function(){p.trigger("mouseenter")},p.uid),r.addEvent(f,"mouseout",function(){p.trigger("mouseleave")},p.uid),r.addEvent(f,"mousedown",function(){p.trigger("mousedown")},p.uid),r.addEvent(n.get(e.container),"mouseup",function(){p.trigger("mouseup")},p.uid),(g.can("summon_file_dialog")?c:m).setAttribute("tabindex",-1),c.onchange=function x(){if(p.files=[],i.each(this.files,function(i){var n="";return e.directory&&"."==i.name?!0:(i.webkitRelativePath&&(n="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(g.uid,i),i.relativePath=n,p.files.push(i),void 0)}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=x}p.files.length&&p.trigger("change")},p.trigger({type:"ready",async:!0}),l=null},setOption:function(e,t){var i=this.getRuntime(),r=n.get(i.uid);switch(e){case"accept":if(t){var a=t.mimes||o.extList2mimes(t,i.can("filter_by_extension"));r.setAttribute("accept",a.join(","))}else r.removeAttribute("accept");break;case"directory":t&&i.can("select_folder")?(r.setAttribute("directory",""),r.setAttribute("webkitdirectory","")):(r.removeAttribute("directory"),r.removeAttribute("webkitdirectory"));break;case"multiple":t&&i.can("select_multiple")?r.setAttribute("multiple",""):r.removeAttribute("multiple")}},disable:function(e){var t,i=this.getRuntime();(t=n.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var t=this.getRuntime(),i=t.getShim(),o=t.getShimContainer(),a=e&&n.get(e.container),u=e&&n.get(e.browse_button);a&&r.removeAllEvents(a,this.uid),u&&(r.removeAllEvents(u,this.uid),u.style.zIndex=s),o&&(r.removeAllEvents(o,this.uid),o.innerHTML=""),i.removeInstance(this.uid),e=o=a=u=i=null}})}return e.FileInput=s}),n("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,t,i,n,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=i.toArray(e.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function a(e,i){if(u(e)){var n=new t(f,e);n.relativePath=i||"",p.push(n)}}function s(e){for(var t=[],n=0;n=")&&u.verComp(u.version,7,"<"),f="Android Browser"===u.browser,p=!1;if(h=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),m=c(),m.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(p=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),p=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return e.call(s,i,r),void 0;if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}m.upload?(i.withCredentials&&(m.withCredentials=!0),m.addEventListener("load",function(e){s.trigger(e)}),m.addEventListener("error",function(e){s.trigger(e)}),m.addEventListener("progress",function(e){s.trigger(e)}),m.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):m.onreadystatechange=function(){switch(m.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=m.getResponseHeader("Content-Length")||0),m.responseText&&(t=m.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:m.onreadystatechange=function(){};try{if(m.status>=200&&m.status<400){s.trigger("load");break}}catch(r){}s.trigger("error")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){m.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in m&&(m.responseType="json"!==i.responseType||u.can("return_response_type","json")?i.responseType:"text"),p?m.sendAsBinary?m.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;i>r;r++)n[r]=this[e](t+r);return n}}),t}),n("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,t){return function i(n){var r,o,a,s=[],u=0;if(r=new e(n),65496!==r.SHORT(0))throw r.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(o=2;o<=r.length();)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;u=r.SHORT(o+2)+2,a>=65505&&65519>=a&&s.push({hex:a,name:"APP"+(15&a),start:o,length:u,segment:r.SEGMENT(o,u)}),o+=u}return r.clear(),{headers:s,restore:function(t){var i,n,r;for(r=new e(t),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,i=s.length;i>n;n++)r.SEGMENT(o,0,s[n].segment),o+=s[n].length;return t=r.SEGMENT(),r.clear(),t},strip:function(t){var n,r,o,a;for(o=new i(t),r=o.headers,o.purge(),n=new e(t),a=r.length;a--;)n.SEGMENT(r[a].start,r[a].length,"");return t=n.SEGMENT(),n.clear(),t},get:function(e){for(var t=[],i=0,n=s.length;n>i;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;r>i&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),n("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,i,n){function r(o){function a(i,r){var o,a,s,u,c,m,h,f,p=this,g=[],x={},v={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},w={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(o=p.SHORT(i),a=0;o>a;a++)if(g=[],h=i+2+12*a,s=r[p.SHORT(h)],s!==t){if(u=v[p.SHORT(h+=2)],c=p.LONG(h+=2),m=w[u],!m)throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(h+=4,m*c>4&&(h=p.LONG(h)+d.tiffHeader),h+m*c>=this.length())throw new n.ImageError(n.ImageError.INVALID_META_ERR);"ASCII"!==u?(g=p.asArray(u,h,c),f=1==c?g[0]:g,x[s]=l.hasOwnProperty(s)&&"object"!=typeof f?l[s][f]:f):x[s]=e.trim(p.STRING(h,c).replace(/\0$/,""))}return x}function s(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=c[e.toLowerCase()];for(var u in s)if(s[u]===t){t=u;break}}n=d[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var l=0;r>l;l++)if(o=n+12*l+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(m){return!1}return!0}var u,c,l,d,m,h;if(i.call(this,o),c={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},m=d.tiffHeader,u={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return h||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,c.exif)}catch(i){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n=65472&&65475>=t)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}function s(){var e,t,i=d.thumb();return i&&(e=new n(i),t=a(e),e.clear(),t)?(t.data=i,t):null}function u(){d&&l&&c&&(d.clear(),l.purge(),c.clear(),m=l=d=c=null)}var c,l,d,m;if(c=new n(o),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new i(o);try{d=new r(l.get("app1")[0])}catch(h){}m=a.call(this),e.extend(this,{type:"image/jpeg",size:c.length(),width:m&&m.width||0,height:m&&m.height||0,setExif:function(t,i){return d?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,i),l.set("app1",d.SEGMENT()),void 0):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):l.restore(o)},stripHeaders:function(e){return l.strip(e)},purge:function(){u.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),n("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(e,t,i){function n(n){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),n=l=u=c=s=null)}function a(e){var t,i,n,r;return t=s.LONG(e),i=s.STRING(e+=4,4),n=e+=4,r=s.LONG(e+t),{length:t,type:i,start:n,CRC:r}}var s,u,c,l;s=new i(n),function(){var t=0,i=0,n=[35152,20039,3338,6666];for(i=0;ii.height?"width":"height",a=Math.round(i[o]*n),s=!1;"nearest"!==r&&(.5>n||n>2)&&(n=.5>n?.5:2,s=!0);var u=t(i,n);return s?e(u,a/u[o],r):u}function t(e,t){var i=e.width,n=e.height,r=Math.round(i*t),o=Math.round(n*t),a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),e=null,a}return{scale:e}}),n("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(){if(!v&&!g)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return v||g}function c(){var t=e();return"canvas"==t.nodeName.toLowerCase()?t:(v=document.createElement("canvas"),v.width=t.width,v.height=t.height,v.getContext("2d").drawImage(t,0,0),v)}function l(e){return n.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+n.btoa(e)}function m(e){var t=this;g=new Image,g.onerror=function(){p.call(this),t.trigger("error",i.ImageError.WRONG_FORMAT)},g.onload=function(){t.trigger("load")},g.src="data:"==e.substr(0,5)?e:d(e,y.type)}function h(e,t){var n,r=this;return window.FileReader?(n=new FileReader,n.onload=function(){t.call(r,this.result)},n.onerror=function(){r.trigger("error",i.ImageError.WRONG_FORMAT)},n.readAsDataURL(e),void 0):t.call(this,e.getAsDataURL())}function f(e,i){var n=Math.PI/180,r=document.createElement("canvas"),o=r.getContext("2d"),a=e.width,s=e.height;switch(t.inArray(i,[5,6,7,8])>-1?(r.width=s,r.height=a):(r.width=a,r.height=s),i){case 2:o.translate(a,0),o.scale(-1,1);break;case 3:o.translate(a,s),o.rotate(180*n);break;case 4:o.translate(0,s),o.scale(1,-1);break;case 5:o.rotate(90*n),o.scale(1,-1);break;case 6:o.rotate(90*n),o.translate(0,-s);break;case 7:o.rotate(90*n),o.translate(a,-s),o.scale(-1,1);break;case 8:o.rotate(-90*n),o.translate(-a,0)}return o.drawImage(e,0,0,a,s),r}function p(){x&&(x.purge(),x=null),w=g=v=y=null,b=!1}var g,x,v,w,y,E=this,b=!1,_=!0;t.extend(this,{loadFromBlob:function(e){var t=this.getRuntime(),n=arguments.length>1?arguments[1]:!0;if(!t.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return y=e,e.isDetached()?(w=e.getSource(),m.call(this,w),void 0):(h.call(this,e.getSource(),function(e){n&&(w=l(e)),m.call(this,e)}),void 0)},loadFromImage:function(e,t){this.meta=e.meta,y=new o(null,{name:e.name,size:e.size,type:e.type}),m.call(this,t?w=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t,i=this.getRuntime();return!x&&w&&i.can("access_image_binary")&&(x=new a(w)),t={width:e().width||0,height:e().height||0,type:y.type||u.getFileMime(y.name),size:w&&w.length||y.size||0,name:y.name||"",meta:null},_&&(t.meta=x&&x.meta||this.meta||{},!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof r||(t.meta.thumb.data=new r(null,{type:"image/jpeg",data:t.meta.thumb.data}))),t},resize:function(t,i,n){var r=document.createElement("canvas");if(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(e(),t.x,t.y,t.width,t.height,0,0,r.width,r.height),v=s.scale(r,i),_=n.preserveHeaders,!_){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;v=f(v,o)}this.width=v.width,this.height=v.height,b=!0,this.trigger("Resize")},getAsCanvas:function(){return v||(v=c()),v.id=this.uid+"_canvas",v},getAsBlob:function(e,t){return e!==this.type?(b=!0,new o(null,{name:y.name||"",type:e,data:E.getAsDataURL(e,t)})):new o(null,{name:y.name||"",type:e,data:E.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return g.src;if(c(),"image/jpeg"!==e)return v.toDataURL("image/png");try{return v.toDataURL("image/jpeg",t/100)}catch(i){return v.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return w||(w=l(E.getAsDataURL(e,t))),w;if("image/jpeg"!==e)w=l(E.getAsDataURL(e,t));else{var i;t||(t=90),c();try{i=v.toDataURL("image/jpeg",t/100)}catch(n){i=v.toDataURL("image/jpeg")}w=l(i),x&&(w=x.stripHeaders(w),_&&(x.meta&&x.meta.exif&&x.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),w=x.writeHeaders(w)),x.purge(),x=null)}return b=!1,w},destroy:function(){E=null,p.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),n("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function s(e){var n=i.get(e);n&&"OBJECT"==n.nodeName&&("IE"===t.browser?(n.style.display="none",function r(){4==n.readyState?u(e):setTimeout(r,10)}()):n.parentNode.removeChild(n))}function u(e){var t=i.get(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function c(u){var c,m=this;u=e.extend({swf_url:t.swf_url},u),o.call(this,u,l,{access_binary:function(e){return e&&"browser"===m.mode},access_image_binary:function(e){return e&&"browser"===m.mode},display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===m.mode},resize_image:o.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===m.mode},return_status_code:function(t){return"browser"===m.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:function(e){return e&&"browser"===m.mode},send_browser_cookies:function(e){return e&&"browser"===m.mode},send_custom_headers:function(e){return e&&"browser"===m.mode},send_multipart:o.capTrue,slice_blob:function(e){return e&&"browser"===m.mode},stream_upload:function(e){return e&&"browser"===m.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===m.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),a()<11.3&&(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return m.getShim().exec(this.uid,e,t,i)},init:function(){var i,r,a;a=this.getShimContainer(),e.extend(a.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),i=''+''+''+''+"","IE"===t.browser?(r=document.createElement("div"),a.appendChild(r),r.outerHTML=i,r=a=null):a.innerHTML=i,c=setTimeout(function(){m&&!m.initialized&&m.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){s(m.uid),e.call(m),clearTimeout(c),u=c=e=m=null}}(this.destroy)},d)}var l="flash",d={};return o.addConstructor(l,c),d}),n("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={slice:function(e,i,n,r){var o=this.getRuntime();return 0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),e=o.shimExec.call(this,"Blob","slice",i,n,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=i}),n("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){var r={init:function(e){var r=this,o=this.getRuntime(),a=i.get(e.browse_button);a&&(a.setAttribute("tabindex",-1),a=null),this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],n.each(e,function(e){r.files.push(new t(o.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=r}),n("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n=this;return n.result="","readAsDataURL"===e&&(n.result="data:"+(t.type||"")+";base64,"),n.bind("Progress",function(t,r){r&&(n.result+=i(r,e))},999),n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=n}),n("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n,r=this.getRuntime();return(n=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(n="data:"+(t.type||"")+";base64,"+n),i(n,e,t.type)):null}};return e.FileReaderSync=n}),n("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={getAsBlob:function(e){var i=this.getRuntime(),n=i.shimExec.call(this,"Transporter","getAsBlob",e);return n?new t(i.uid,n):null}};return e.Transporter=i}),n("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,t,i,n,r,o,a,s){var u={send:function(e,n){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,n)}function o(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),n=null,r()}function u(e,t){var i=new s;i.bind("TransportingComplete",function(){t(this.result)}),i.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),n instanceof a){var d;if(n.each(function(e,t){e instanceof i?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),n.hasBlob()){var m=n.getBlob();m.isDetached()?u(m,function(e){m.destroy(),o(d,e)}):o(d,m)}else n=null,r()}else n instanceof i?n.isDetached()?u(n,function(e){n.destroy(),n=e.uid,r()}):(n=n.uid,r()):r()},getResponse:function(e){var i,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new n(a.uid,o),"blob"===e)return o;try{if(i=new r,~t.inArray(e,["","text"]))return i.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(i.readAsText(o))}finally{o.destroy()}}return null},abort:function(){var e=this.getRuntime();e.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=u}),n("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,i,n,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(n,"Image","loadFromBlob",e.uid),n=r=null}var n=this,r=n.getRuntime();if(e.isDetached()){var o=new i;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return t.meta&&t.meta.thumb&&t.meta.thumb.data&&!(e.meta.thumb.data instanceof n)&&(t.meta.thumb.data=new n(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var i=this.getRuntime(),r=i.shimExec.call(this,"Image","getAsBlob",e,t);return r?new n(i.uid,r):null},getAsDataURL:function(){var e,t=this.getRuntime(),i=t.Image.getAsBlob.apply(this,arguments);return i?(e=new r,e.readAsDataURL(i)):null}};return e.Image=o}),n("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(e){var t,i,n,r,o,a=!1,s=null,u=0;try{try{s=new ActiveXObject("AgControl.AgControl"),s.IsVersionSupported(e)&&(a=!0),s=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(t=l.description,"1.0.30226.2"===t&&(t="2.0.30226.2"),i=t.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(n=e.split(".");n.length>4;)n.pop();do r=parseInt(n[u],10),o=parseInt(i[u],10),u++;while(u=r&&!isNaN(r)&&(a=!0)}}}catch(d){a=!1}return a}function s(s){var l,d=this;s=e.extend({xap_url:t.xap_url},s),o.call(this,s,u,{access_binary:o.capTrue,access_image_binary:o.capTrue,display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:o.capTrue,resize_image:o.capTrue,return_response_headers:function(e){return e&&"client"===d.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===d.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:o.capTrue,send_browser_cookies:function(e){return e&&"browser"===d.mode},send_custom_headers:function(e){return e&&"client"===d.mode},send_multipart:o.capTrue,slice_blob:o.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:o.capTrue,use_http_method:function(t){return"client"===d.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),a("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(e,t){var i=[].slice.call(arguments,2);return d.getShim().exec(this.uid,e,t,i)},init:function(){var e;e=this.getShimContainer(),e.innerHTML=''+''+''+''+''+''+"",l=setTimeout(function(){d&&!d.initialized&&d.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(d),clearTimeout(l),s=l=e=d=null}}(this.destroy)},c)}var u="silverlight",c={};return o.addConstructor(u,s),c}),n("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){return e.Blob=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){function r(e){for(var t="",i=0;ii;i++)t=s.keys[i],a=s[t],a&&(/^(\d|[1-9]\d+)$/.test(a)?a=parseInt(a,10):/^\d*\.\d+$/.test(a)&&(a=parseFloat(a)),r.meta[e][t]=a)}),r.meta&&r.meta.thumb&&r.meta.thumb.data&&!(e.meta.thumb.data instanceof i)&&(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue;i.call(this,t,a,{access_binary:u(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return s.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:c,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html4",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){function e(){var o,c,d,m,h,f,p=this,g=p.getRuntime();f=i.guid("uid_"),o=g.getShimContainer(),s&&(d=n.get(s+"_form"),d&&(i.extend(d.style,{top:"100%"}),d.firstChild.setAttribute("tabindex",-1))),m=document.createElement("form"),m.setAttribute("id",f+"_form"),m.setAttribute("method","post"),m.setAttribute("enctype","multipart/form-data"),m.setAttribute("encoding","multipart/form-data"),i.extend(m.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=document.createElement("input"),h.setAttribute("id",f),h.setAttribute("type","file"),h.setAttribute("accept",l.join(",")),g.can("summon_file_dialog")&&h.setAttribute("tabindex",-1),i.extend(h.style,{fontSize:"999px",opacity:0}),m.appendChild(h),o.appendChild(m),i.extend(h.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&i.extend(h.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),h.onchange=function(){var i;this.value&&(i=this.files?this.files[0]:{name:this.value},i=new t(g.uid,i),this.onchange=function(){},e.call(p),p.files=[i],h.setAttribute("id",i.uid),m.setAttribute("id",i.uid+"_form"),p.trigger("change"),h=m=null)},g.can("summon_file_dialog")&&(c=n.get(u.browse_button),r.removeEvent(c,"click",p.uid),r.addEvent(c,"click",function(e){h&&!h.disabled&&h.click(),e.preventDefault()},p.uid)),s=f,o=d=c=null}var s,u,c,l=[];i.extend(this,{init:function(t){var i,a=this,s=a.getRuntime();u=t,l=o.extList2mimes(t.accept,s.can("filter_by_extension")),i=s.getShimContainer(),function(){var e,o,l;e=n.get(t.browse_button),c=n.getStyle(e,"z-index")||"auto",s.can("summon_file_dialog")?("static"===n.getStyle(e,"position")&&(e.style.position="relative"),a.bind("Refresh",function(){o=parseInt(c,10)||1,n.get(u.browse_button).style.zIndex=o,this.getRuntime().getShimContainer().style.zIndex=o-1})):e.setAttribute("tabindex",-1),l=s.can("summon_file_dialog")?e:i,r.addEvent(l,"mouseover",function(){a.trigger("mouseenter")},a.uid),r.addEvent(l,"mouseout",function(){a.trigger("mouseleave")},a.uid),r.addEvent(l,"mousedown",function(){a.trigger("mousedown")},a.uid),r.addEvent(n.get(t.container),"mouseup",function(){a.trigger("mouseup")},a.uid),e=null}(),e.call(this),i=null,a.trigger({type:"ready",async:!0})},setOption:function(e,t){var i,r=this.getRuntime();"accept"==e&&(l=t.mimes||o.extList2mimes(t,r.can("filter_by_extension"))),i=n.get(s),i&&i.setAttribute("accept",l.join(","))},disable:function(e){var t;(t=n.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),o=u&&n.get(u.container),a=u&&n.get(u.browse_button);o&&r.removeAllEvents(o,this.uid),a&&(r.removeAllEvents(a,this.uid),a.style.zIndex=c),i&&(r.removeAllEvents(i,this.uid),i.innerHTML=""),t.removeInstance(this.uid),s=l=u=i=o=a=t=null}})}return e.FileInput=s}),n("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),n("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,t,i,n,r,o,a,s){function u(){function e(e){var t,n,r,a,s=this,u=!1;if(l){if(t=l.id.replace(/_iframe$/,""),n=i.get(t+"_form")){for(r=n.getElementsByTagName("input"),a=r.length;a--;)switch(r[a].getAttribute("type")){case"hidden":r[a].parentNode.removeChild(r[a]);break;case"file":u=!0}r=[],u||n.parentNode.removeChild(n),n=null}setTimeout(function(){o.removeEvent(l,"load",s.uid),l.parentNode&&l.parentNode.removeChild(l);var t=s.getRuntime().getShimContainer();t.children.length||t.parentNode.removeChild(t),t=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,m){function h(){var i=w.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='',l=r.firstChild,i.appendChild(l),o.addEvent(l,"load",function(){var i;try{i=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?u=i.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(i.body.innerHTML),v.trigger({type:"progress",loaded:c.length,total:c.length}),x&&v.trigger({type:"uploadprogress",loaded:x.size||1025,total:x.size||1025}))}catch(r){if(!n.hasSameOrigin(d.url))return e.call(v,function(){v.trigger("error")}),void 0;u=404}e.call(v,function(){v.trigger("load")})},v.uid)}var f,p,g,x,v=this,w=v.getRuntime();if(u=c=null,m instanceof s&&m.hasBlob()){if(x=m.getBlob(),f=x.uid,g=i.get(f),p=i.get(f+"_form"),!p)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else f=t.guid("uid_"),p=document.createElement("form"),p.setAttribute("id",f+"_form"),p.setAttribute("method",d.method),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),w.getShimContainer().appendChild(p);p.setAttribute("target",f+"_iframe"),m instanceof s&&m.each(function(e,i){if(e instanceof a)g&&g.setAttribute("name",i);else{var n=document.createElement("input");t.extend(n,{type:"hidden",name:i,value:e}),g?p.insertBefore(n,g):p.appendChild(n)}}),p.setAttribute("action",d.url),h(),p.submit(),v.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})},destroy:function(){this.getRuntime().getShim().removeInstance(this.uid)}})}return e.XMLHttpRequest=u}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)}); +/** + * Plupload - multi-runtime File Uploader + * v2.3.6 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2017-11-03 + */ +!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.plupload};"function"==typeof define&&define.amd?define("plupload",["./moxie"],i):"object"==typeof module&&module.exports?module.exports=i(require("./moxie")):e.plupload=i(e.moxie)}(this||window,function(e){!function(e,t,i){function n(e){function t(e,t,i){var r={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};r[e]?n[r[e]]=t:i||(n[e]=t)}var i=e.required_features,n={};return"string"==typeof i?l.each(i.split(/\s*,\s*/),function(e){t(e,!0)}):"object"==typeof i?l.each(i,function(e,i){t(i,e)}):i===!0&&(e.chunk_size&&e.chunk_size>0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart!==!1||(n.send_binary_string=!0),e.http_method&&(n.use_http_method=e.http_method),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,s={},a=t.core.utils,o=t.runtime.Runtime,l={VERSION:"2.3.6",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,moxie:t,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=o.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){s[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),i(!1),void 0;i(!0)}),l.addFileFilter("prevent_empty",function(e,t,n){e&&!t.size&&t.size!==i?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),n(!1)):n(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t0?Math.ceil(100*(e.loaded/e.size)):100,d()}function d(){var e,t,n,r=0;for(I.reset(),e=0;eS)&&(r+=n),I.loaded+=n):I.size=i,t.status==l.DONE?I.uploaded++:t.status==l.FAILED?I.failed++:I.queued++;I.size===i?I.percent=D.length>0?Math.ceil(100*(I.uploaded/D.length)):0:(I.bytesPerSec=Math.ceil(r/((+new Date-S||1)/1e3)),I.percent=I.size>0?Math.ceil(100*(I.loaded/I.size)):0)}function c(){var e=F[0]||P[0];return e?e.getRuntime().uid:!1}function f(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",b),this.bind("BeforeUpload",m),this.bind("UploadFile",_),this.bind("UploadProgress",E),this.bind("StateChanged",v),this.bind("QueueChanged",d),this.bind("Error",R),this.bind("FileUploaded",y),this.bind("Destroy",z)}function p(e,i){var n=this,r=0,s=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:x,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){s.push(function(s){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,F.push(this),s()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){U||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,s()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){s.push(function(i){var s=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));s.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,P.push(this),i()},s.ondrop=function(){n.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,i()}),s.init()})}),l.inSeries(s,function(){"function"==typeof i&&i(r)})}function g(e,n,r,s){var a=new t.image.Image;try{a.onload=function(){n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),s(e)):a.downsize(n.width,n.height,n.crop,n.preserve_headers)},a.onresize=function(){var t=this.getAsBlob(e.type,n.quality);this.destroy(),s(t)},a.bind("error runtimeerror",function(){this.destroy(),s(e)}),a.load(e,r)}catch(o){s(e)}}function h(e,i,r){function s(e,i,n){var r=O[e];switch(e){case"max_file_size":"max_file_size"===e&&(O.max_file_size=O.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(O[e]=i,O.send_file_name=!0);break;case"multipart":O[e]=i,i||(O.send_file_name=!0);break;case"http_method":O[e]="PUT"===i.toUpperCase()?"PUT":"POST";break;case"unique_names":O[e]=i,i&&(O.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(O.filters,i):O.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),O.filters.mime_types=i.mime_types);break;case"resize":O.resize=i?l.extend({preserve_headers:!0,crop:!1},i):!1;break;case"prevent_duplicates":O.prevent_duplicates=O.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":O[e]=i,n||(u=!0);break;default:O[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){s(t,e,r)}):s(e,i,r),r?(O.required_features=n(l.extend({},O)),x=n(l.extend({},O,{required_features:!0}))):u&&(a.trigger("Destroy"),p.call(a,O,function(e){e?(a.runtime=o.getInfo(c()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function m(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function _(e,i){function n(){c-->0?r(s,1e3):(i.loaded=p,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()}))}function s(){var t,n,r={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(r.name=i.target_name||i.name),d&&f.chunks&&o.size>d?(n=Math.min(d,o.size-p),t=o.slice(p,p+n)):(n=o.size,t=o),d&&f.chunks&&(e.settings.send_chunk_number?(r.chunk=Math.ceil(p/d),r.chunks=Math.ceil(o.size/d)):(r.offset=p,r.total=o.size)),e.trigger("BeforeChunkUpload",i,r,t,p)&&a(r,t,n))}function a(a,d,g){var m;T=new t.xhr.XMLHttpRequest,T.upload&&(T.upload.onprogress=function(t){i.loaded=Math.min(i.size,p+t.loaded),e.trigger("UploadProgress",i)}),T.onload=function(){return T.status<200||T.status>=400?(n(),void 0):(c=e.settings.max_retries,g=o.size?(i.size!=i.origSize&&(o.destroy(),o=null),e.trigger("UploadProgress",i),i.status=l.DONE,i.completeTimestamp=+new Date,e.trigger("FileUploaded",i,{response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()})):r(s,1),void 0)},T.onerror=function(){n()},T.onloadend=function(){this.destroy()},e.settings.multipart&&f.multipart?(T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),m=new t.xhr.FormData,l.each(l.extend(a,e.settings.multipart_params),function(e,t){m.append(t,e)}),m.append(e.settings.file_data_name,d),T.send(m,h)):(u=l.buildUrl(e.settings.url,l.extend(a,e.settings.multipart_params)),T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),T.hasRequestHeader("Content-Type")||T.setRequestHeader("Content-Type","application/octet-stream"),T.send(d,h))}var o,u=e.settings.url,d=e.settings.chunk_size,c=e.settings.max_retries,f=e.features,p=0,h={runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:x,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url};i.loaded&&(p=i.loaded=d?d*Math.floor(i.loaded/d):0),o=i.getSource(),l.isEmptyObj(e.settings.resize)||-1===l.inArray(o.type,["image/jpeg","image/png"])?s():g(o,e.settings.resize,h,function(e){o=e,i.size=e.size,s()})}function E(e,t){u(t)}function v(e){if(e.state==l.STARTED)S=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,d())}function b(){T&&T.abort()}function y(e){d(),r(function(){a.call(e)},1)}function R(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,t.file.completeTimestamp=+new Date,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function z(e){e.stop(),l.each(D,function(e){e.destroy()}),D=[],F.length&&(l.each(F,function(e){e.destroy()}),F=[]),P.length&&(l.each(P,function(e){e.destroy()}),P=[]),x={},U=!1,S=T=null,I.reset()}var O,S,I,T,w=l.guid(),D=[],x={},F=[],P=[],U=!1;O={chunk_size:0,file_data_name:"file",filters:{mime_types:[],max_file_size:0,prevent_duplicates:!1,prevent_empty:!0},flash_swf_url:"js/Moxie.swf",http_method:"POST",max_retries:0,multipart:!0,multi_selection:!0,resize:!1,runtimes:o.order,send_file_name:!0,send_chunk_number:!0,silverlight_xap_url:"js/Moxie.xap"},h.call(this,e,null,!0),I=new l.QueueProgress,l.extend(this,{id:w,uid:w,state:l.STOPPED,features:{},runtime:null,files:D,settings:O,total:I,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),f.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):O.browse_button||O.drop_element?(p.call(i,O,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=o.getInfo(c()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}),void 0):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){h.call(this,e,t,!this.runtime)},getOption:function(e){return e?O[e]:O},refresh:function(){F.length&&l.each(F,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){U=arguments[0]!==i?arguments[0]:!0,F.length&&l.each(F,function(e){e.disable(U)}),this.trigger("DisableBrowse",U)},getFile:function(e){var t;for(t=D.length-1;t>=0;t--)if(D[t].id===e)return D[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){s[n]&&i.push(function(i){s[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var s=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!o)return!1;e.ruid=o,e.connectRuntime(o)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),d.push(function(t){n(e,function(i){i||(D.push(e),f.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(s,["file","blob"])?a(new t.file.File(null,e)):"node"===s&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===s&&(i=null,l.each(e,a))}var o,u=this,d=[],f=[];o=c(),a(e),d.length&&l.inSeries(d,function(){f.length&&u.trigger("FilesAdded",f)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=D.length-1;i>=0;i--)if(D[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=D.splice(e===i?0:e,t===i?D.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n.file-list', '#myFileList', '
      ' + // fileTemplate: '', + // fileFormater: null, + // fileIconCreator: null, + // staticFiles: null, + rename: true, + // renameExtension: false, + renameByClick: true, + // autoUpload: false, + // browseByClickList: false, + dropPlaceholder: true, + // messageCreator: null, // NOT SUPPORT + previewImageIcon: true, + sendFileName: true, + sendFileId: true, + responseHandler: true, + // limitFilesCount: false, + // deleteConfirm: false, + // removeUploaded: false, + // statusCreator: null, // Function + // previewImageSize: {width: 200, height: 200}, + uploadedMessage: true, + // deleteActionOnDone: false, // false, true or function + // renameActionOnDone: false, // false, true or function, + // autoResetFails: false, // if true auto reupload failed files + + // plupload options + drop_element: 'self', // 'self', 'fileList', String or jQuery object, + browse_button: 'hidden', // String or jQuery object + // url: '', // String + filters: {prevent_duplicates: true}, // {mime_types, max_file_size, prevent_duplicates} + // headers: null, // Object + // multipart: true, // true, false + // multipart_params: null, // Object + chunk_size: '1mb', // Number, String + max_retries: 3, + // resize: {}, // {width, height, crop, quality, preserve_headers}, + // multi_selection: true, // true, false, + // required_features: null, // String + // unique_names: false, // true, false + // runtimes: 'html5,flash,silverlight,html4', // String + // file_data_name: 'file', // String + flash_swf_url: 'lib/uploader/Moxie.swf', // String + silverlight_xap_url: 'lib/uploader/Moxie.xap' // String + }; + + var STATUS = { + QUEUED : Plupload.QUEUED, + UPLOADING : Plupload.UPLOADING, + FAILED : Plupload.FAILED, + DONE : Plupload.DONE, + STOPPED : Plupload.STOPPED, + STARTED : Plupload.STARTED + }; + STATUS[Plupload.QUEUED] = 'queue'; + STATUS[Plupload.UPLOADING] = 'uploading'; + STATUS[Plupload.FAILED] = 'failed'; + STATUS[Plupload.DONE] = 'done'; + + var ERRORS = { + GENERIC_ERROR : Plupload.GENERIC_ERROR, + HTTP_ERROR : Plupload.HTTP_ERROR, + IO_ERROR : Plupload.IO_ERROR, + SECURITY_ERROR : Plupload.SECURITY_ERROR, + INIT_ERROR : Plupload.INIT_ERROR, + FILE_SIZE_ERROR : Plupload.FILE_SIZE_ERROR, + FILE_EXTENSION_ERROR : Plupload.FILE_EXTENSION_ERROR, + FILE_DUPLICATE_ERROR : Plupload.FILE_DUPLICATE_ERROR, + IMAGE_FORMAT_ERROR : Plupload.IMAGE_FORMAT_ERROR, + IMAGE_MEMORY_ERROR : Plupload.IMAGE_MEMORY_ERROR, + IMAGE_DIMENSIONS_ERROR: Plupload.IMAGE_DIMENSIONS_ERROR + }; + + // The uploader modal class + var Uploader = function(element, options) { + var that = this; + that.name = NAME; + that.$ = $(element).addClass('uploader'); + options = that.getOptions(options); + + // Init lang + var lang = $.isPlainObject(options.lang) ? ($.extend(true, {}, Uploader.LANG[lang.lang || $.zui.clientLang()], options.lang)) : Uploader.LANG[options.lang]; + that.lang = lang; + + // Init file list element + var $this = that.$; + var fileList = options.fileList; + var $list; + if(!fileList || fileList == 'large' || fileList == 'grid') { + $list = $this.find('.file-list,.uploader-files'); + } else if(fileList.indexOf('>') === 0) $list = $this.find(fileList.substr(1)); + else $list = $(fileList); + if(!$list || !$list.length) $list = $('
      '); + if(!$list.parent().length) $this.append($list); + if(fileList == 'large') $list.addClass('file-list-lg'); + else if(fileList == 'grid') $list.addClass('file-list-grid'); + $list.children('.file').addClass('file-static'); + that.$list = $list; + + if(options.browseByClickList || $list.hasClass('uploader-btn-browse')) { + $list.addClass('uploader-btn-browse').on('click', '.file-wrapper > .actions,.file-renaming .file-name', function(e) { + e.stopPropagation(); + }); + } + + // Init file template + var template = options.fileTemplate; + if(!template) { + var $template = $list.find('.template'); + if($template.length) { + template = $template.first().clone().removeClass('template'); + $template.remove(); + } + if(!template) template = FILE_TEMPLATE; + } + if(typeof template === 'string') { + template = $(template); + if(template.parent()) template = template.clone().removeClass('template'); + } + that.template = template; + + // Init browse button element + var browseBtn = options.browse_button; + var $btn = null; + if(browseBtn) { + if(browseBtn.indexOf('>') === 0) $btn = $this.find(browseBtn.substr(1)); + else if(browseBtn !== 'hidden') $btn = $(browseBtn); + } + if(!$btn || !$btn.length) { + $btn = $('
      ').appendTo($this); + } + that.$button = $btn.first(); + + // Init drop element + var dropElement = options.drop_element; + var $dropElement = (dropElement == 'fileList' ? that.$list : (dropElement == 'self' ? that.$ : $(dropElement))).first().addClass('file-drag-area'); + if (!notSupportDnd) { + var dropPlaceholder = options.dropPlaceholder; + if(dropPlaceholder === true) dropPlaceholder = lang.dropPlaceholder; + if(dropPlaceholder) $dropElement.attr('data-drop-placeholder', dropPlaceholder); + } else { + $dropElement.attr('data-drop-placeholder', ''); + } + that.$dropElement = $dropElement; + + // Init message + that.$message = $this.find('.uploader-message').on('click', '.close', function() { + that.hideMessage(); + }); + that.$status = $this.find('.uploader-status'); + + // Init actions + $this.toggleClass('uploader-rename', !!options.rename); + + // Init plupload + that.initPlupload(); + + // Bind events + $this.on('click.' + NAME, '.uploader-btn-start', function(e) { + that.start(); + }).on('click.' + NAME, '.uploader-btn-browse', function(e) { + if($(this).is(that.$button)) return; + that.$button.trigger('click'); + }).on('click.' + NAME, '.uploader-btn-stop', function(e) { + that.stop(); + }); + + $('body').on('dragleave.' + NAME + ' drop.' + NAME, function(e) { + $this.removeClass('file-dragable'); + + // Below two lines for firefox, open a new tab after drop file + e.preventDefault(); + e.stopPropagation(); + }).on('dragover.' + NAME + ' dragenter.' + NAME, function(e) { + $this.addClass('file-dragable'); + }); + $dropElement.on('dragleave.' + NAME + ' drop.' + NAME, function(e) { + $this.removeClass('file-drag-enter'); + }).on('dragover.' + NAME + ' dragenter.' + NAME, function(e) { + $this.addClass('file-drag-enter'); + }); + + $list.on('click.' + NAME, '.btn-delete-file', function() { + var $file = $(this).closest('.file'); + var file = $file.data('file'); + var deleteActionOnDoneOption = options.deleteActionOnDone; + var doneActionAble = file.status === Plupload.DONE && $.isFunction(deleteActionOnDoneOption); + if(file.status === Plupload.QUEUED || file.status === Plupload.FAILED || doneActionAble) { + var doRemoveFile = function() { + that.removeFile(file); + }; + var removeFile = function() { + if(doneActionAble) { + var result = deleteActionOnDoneOption.call(that, file, doRemoveFile); + if(result === true) { + doRemoveFile(); + } + } else { + doRemoveFile(); + } + }; + var deleteConfirmOption = options.deleteConfirm; + if(deleteConfirmOption) { + var confirmMessage = $.isFunction(deleteConfirmOption) ? deleteConfirmOption(file) : (deleteConfirmOption === true ? lang.deleteConfirm : deleteConfirmOption); + confirmMessage = confirmMessage.format(file); + if(window.bootbox) { + window.bootbox.confirm(confirmMessage, function(result) { + if(result) removeFile(); + }); + } else { + if(window.confirm(confirmMessage)) removeFile(); + } + } else { + removeFile(); + } + } + }).on('click.' + NAME, '.btn-reset-file', function() { + var $file = $(this).closest('.file'); + var file = that.plupload.getFile($file.data('id')) || $file.data('file'); + if(file.status === Plupload.FAILED) { + file.status = Plupload.QUEUED; + that.showFile(file); + if(options.autoUpload) that.start(); + } + }); + if(options.rename) { + $list.toggleClass('file-rename-by-click', !!options.renameByClick) + .toggleClass('file-show-rename-action-on-done', !!options.renameActionOnDone); + $list.on('click.' + NAME, '.btn-rename-file' + (options.renameByClick ? ',.file-name' : ''), function() { + var $file = $(this).closest('.file'); + if($file.hasClass('file-renaming')) return; + var file = that.plupload.getFile($file.data('id')) || $file.data('file'); + var renameActionOnDoneOption = options.renameActionOnDone; + var renameActionAble = file.status === Plupload.DONE && $.isFunction(renameActionOnDoneOption); + if(renameActionAble || file.status === Plupload.QUEUED) { + var $filename = $file.find('.file-name').first(); + $file.addClass('file-renaming'); + that.showFile(file); + if(!options.renameExtension && file.ext) { + $filename.text(file.name.substr(0, file.name.length - file.ext.length - 1)); + } + $filename.attr('contenteditable', 'true').one('blur', function() { + var filename = $.trim($filename.text()); + var renameFile = function() { + if(filename !== undefined && filename !== null && filename !== '') { + var ext = file.ext; + if(ext.length && !options.renameExtension && filename.lastIndexOf('.' + ext) !== (filename.length - ext.length - 1)) { + filename += '.' + ext; + } + file.name = filename; + } + that.showFile(file); + }; + if(renameActionAble) { + var result = renameActionOnDoneOption.call(that, file, filename, renameFile); + if(result === true) { + renameFile(); + } else if(result === false) { + that.showFile(file); + } + } else { + renameFile(); + } + $file.removeClass('file-renaming'); + $filename.off('keydown.' + NAME).attr('contenteditable', null); + }).on('keydown.' + NAME, function(e) { + if(e.keyCode === 13) { + $filename.blur(); + e.preventDefault(); + } + }).focus(); + } + }); + } + + $list.toggleClass('file-show-delete-action-on-done', !!options.deleteActionOnDone); + + // Init static files + that.staticFilesSize = 0; + that.staticFilesCount = 0; + if(options.staticFiles) { + $.each(options.staticFiles, function(idx, file) { + file = $.extend({status: Plupload.DONE}, file); + file.static = true; + if(!file.id) file.id = $.zui.uuid(); + that.showFile(file); + if (file.size) { + that.staticFilesSize += file.size; + that.staticFilesCount++; + } + }); + } + + that.callEvent('onInit'); + }; + + // default options + Uploader.DEFAULTS = DEFAULTS; + + Uploader.prototype.showMessage = function(message, type, time) { + var that = this; + var $msg = that.$message; + if(!message) that.hideMessage(); + else clearTimeout(that.lastDismissMessage); + type = type || 'danger'; + if(time === undefined) time = type === 'danger' ? 10 : 6; + if(time < 20) time *= 1000; + var $content = $msg.find('.content'); + if($content.length) $content.empty().append(message); + else $msg.empty().append(message); + $msg.attr('data-type', type).slideDown('fast'); + if(time) { + that.lastDismissMessage = setTimeout(function() { + that.hideMessage(); + }, time); + } + }; + + Uploader.prototype.hideMessage = function() { + clearTimeout(this.lastDismissMessage); + this.$message.slideUp('fast'); + }; + + Uploader.prototype.start = function() { + if (this.options.autoResetFails) { + $.each(this.getFiles(), function(index, file) { + if(file.status === Plupload.FAILED) { + file.status = Plupload.QUEUED; + } + }); + } + return this.plupload.start(); + }; + + Uploader.prototype.stop = function() { + return this.plupload.stop(); + }; + + Uploader.prototype.getState = function() { + return this.plupload.state; + }; + + Uploader.prototype.isStarted = function() { + return this.getState() === Plupload.STARTED; + }; + + Uploader.prototype.isStopped = function() { + return this.getState() === Plupload.STOPPED; + }; + + Uploader.prototype.getFiles = function() { + return this.plupload.files; + }; + + Uploader.prototype.getTotal = function() { + return this.plupload.total; + }; + + Uploader.prototype.disableBrowse = function(disable) { + this.$.find('.uploader-btn-browse').attr('disable', disable ? 'disable' : null).toggle('disable', !!disable); + return this.plupload.disableBrowse(); + }; + + Uploader.prototype.getFile = function(id) { + return this.plupload.getFile(id); + }; + + Uploader.prototype.destroy = function() { + var that = this; + var eventNamespace = '.' + NAME; + that.$.off(eventNamespace).data(NAME, null); + that.$list.off(eventNamespace); + that.$dropElement.off(eventNamespace); + $('body').off(eventNamespace); + that.plupload.destroy(); + }; + + // see https://github.com/moxiecode/moxie/wiki/API + Uploader.prototype.previewImageSrc = function(file, callback) { + if(!file || !file.getSource || !/image\//.test(file.type)) return; + var size = $.extend({width: 200, height: 200}, this.options.previewImageSize); + if(file.type == 'image/gif') { + //mOxie.Image only support jpg and png + var fr = new Moxie.file.FileReader(); + fr.onload = function() { + callback(fr.result); + fr.destroy(); + fr = null; + }; + fr.readAsDataURL(file.getSource()); + } else { + var preloader = new Moxie.image.Image(); + preloader.onload = function() { + // compressImage + preloader.downsize(size.width, size.height); + var imgsrc = preloader.type == 'image/jpeg' ? preloader.getAsDataURL('image/jpeg', 80) : preloader.getAsDataURL(); // return base64 data + callback(imgsrc); + preloader.destroy(); + preloader = null; + }; + preloader.load(file.getSource()); + } + }; + + Uploader.prototype.createFileIcon = function(file) { + var fileType = file.type; + var ext = file.ext; + var icon = 'file-o'; + var types = fileType ? fileType.split('/') : null; + var type = (types && types.length) ? types[0] : '', subType = (types && types.length) > 1 ? types[1] : ''; + if(type == 'image') icon = 'file-image'; + else if(ext == 'doc' || ext == 'docx' || ext == 'pages') icon = 'file-word'; + else if(ext == 'ppt' || ext == 'pptx' || ext == 'key') icon = 'file-powerpoint'; + else if(ext == 'xls' || ext == 'xlsx' || ext == 'numbers') icon = 'file-excel'; + else if(ext == 'html' || ext == 'htm') icon = 'globe'; + else if(ext == 'js' || ext == 'php' || ext == 'cs' || ext == 'jsx' || ext == 'css' || ext == 'less' || ext == 'json' || ext == 'java' || ext == 'lua' || ext == 'py' || ext == 'c' || ext == 'cpp' || ext == 'swift' || ext == 'h' || ext == 'sh' || ext == 'rb' || ext == 'yml' || ext == 'ini' || ext == 'sql' || ext == 'xml') icon = 'file-code'; + else if(ext == 'apk') icon = 'android'; + else if(ext == 'exe') icon = 'windows'; + else if(ext == 'pkg' || ext == 'msi' || ext == 'dmg') icon = 'cube'; + else if(ext == 'epub') icon = 'book'; + else if(ext == 'sketch') icon = 'diamond'; + else if(subType == 'zip' || subType == 'x-rar' || subType == 'x-7z-compressed') icon = 'file-archive'; + else if(subType == 'pdf') icon = 'file-pdf'; + else if(type == 'video') icon = 'file-movie'; + else if(type == 'audio') icon = 'file-audio'; + else if(type == 'text') icon = 'file-text-o'; + return ''; + }; + + Uploader.prototype.getFileItem = function(file) { + var that = this; + if(typeof file == 'string') { + file = that.plupload.getFile(file); + } + + if(!file) return null; + + var filename = file.name; + if(filename && file.ext === undefined) { + var ext = filename.lastIndexOf('.'); + if(ext > -1) ext = filename.substr(ext + 1); + else ext = ''; + file.ext = ext; + + if(file.type && /image\//.test(file.type)) { + file.isImage = file.ext; + } + } + + var $file = $('#file-' + file.id); + if(!$file.length) { + if($.isFunction(that.template)) { + $file = $(that.template(file, that)); + } else { + $file = $(that.template).clone(); + $file.find('.btn-rename-file').attr('title', that.lang.rename); + $file.find('.btn-delete-file').attr('title', that.lang.remove); + $file.find('.btn-reset-file').attr('title', that.lang.repeat); + $file.find('.btn-download-file').attr('title', that.lang.download).attr('download', file.name); + } + $file.data('id', file.id) + .toggleClass('file-static', !!file.static) + .attr('id', 'file-' + file.id) + .appendTo(that.$list); + if($.fn.tooltip) $file.find('[data-toggle="tooltip"]').tooltip(); + } + return $file; + }; + + Uploader.prototype.showFile = function(file, responseObject) { + var that = this; + if($.isArray(file)) { + $.each(file, function(idx, f) { + that.showFile(f, responseObject); + }); + return; + } + + if(typeof file == 'string') { + file = that.plupload.getFile(file); + } + + if(!file) return; + + var $file = that.getFileItem(file); + if(!$file || !$file.length) { + return; + } + + var options = that.options; + var status = STATUS[file.status]; + if(options.fileFormater) { + options.fileFormater.call(that, $file, file, status); + } else { + var downloadUrl = (status == 'done' && file.url) ? file.url : null; + $file.find('.file-name').text(file.name); + $file.find('.file-size').text((status == 'uploading' ? (Plupload.formatSize(Math.floor(file.size*file.percent/100)).toUpperCase() + '/') : '') + Plupload.formatSize(file.size).toUpperCase()); + $file.find('.file-icon').html(options.fileIconCreator ? options.fileIconCreator(file.type, file, that) : that.createFileIcon(file)).css('color', 'hsl(' + $.zui.strCode(file.type || file.ext) + ', 70%, 40%)'); + $file.find('.file-progress-bar').css('width', file.percent + '%'); + var $status = $file.find('.file-status').attr('title', that.lang[status]); + $status.find('.text').text(status == 'uploading' ? (file.percent + '%') : ((status == 'failed') ? that.lang[status] : '')); + if($.fn.tooltip) $file.find('[data-toggle="tooltip"]').tooltip('fixTitle'); + $file.find('a.btn-download-file, a.file-name').attr('href', downloadUrl); + } + + if(options.previewImageIcon && file.isImage) { + var setPreviewImage = function() { + $file.find('.file-icon').html('
      '); + }; + if(file.previewImage) { + setPreviewImage(); + } else { + that.previewImageSrc(file, function(src) { + file.previewImage = src; + setPreviewImage(); + }); + } + } + + $file.attr('data-status', status).data('file', file); + }; + + Uploader.prototype.showStatus = function() { + var that = this; + var plupload = that.plupload; + var $status = that.$status; + var state = plupload.state, + total = plupload.total, + statusText = '', + totalCount = plupload.files.length; + if(that.options.statusCreator) { + statusText = that.options.statusCreator(total, state, that); + } else { + var stateObj = { + uploading: Math.max(0, Math.min(totalCount, total.uploaded + 1)), + total: that.staticFilesCount + totalCount, + size: Plupload.formatSize(total.size + that.staticFilesSize).toUpperCase(), + queue: total.queued, + failed: total.failed, + uploaded: total.uploaded, + uploadedSize: Plupload.formatSize(total.loaded).toUpperCase(), + percent: total.percent, + speed: Plupload.formatSize(total.bytesPerSec).toUpperCase() + '/S' + }; + if(state == Plupload.STARTED) { + statusText = that.lang.startedStatusText.format(stateObj); + } else { + if(totalCount < 1) { + statusText = that.lang.initStatusText; + } else { + statusText = that.lang.stoppedStatusText.format(stateObj); + } + } + } + $status.html(statusText); + if(total.uploaded < 1) $status.find('.uploader-status-uploaded').remove(); + if(total.failed < 1) $status.find('.uploader-status-failed').remove(); + if(total.queued < 1) $status.find('.uploader-status-queue').remove(); + if($.fn.tooltip) $status.find('[data-toggle="tooltip"]').tooltip(); + }; + + Uploader.prototype.delayShowStatus = function(delay) { + var that = this; + if(that.delayStatusTask) return; + that.delayStatusTask = true; + if(delay === undefined) delay = 500; + that.delayStatusTask = setTimeout(function() { + that.showStatus(); + that.delayStatusTask = false; + }, delay); + }; + + Uploader.prototype.removeFile = function(file, onlyRemoveElement) { + var that = this; + if(typeof file == 'string') { + file = that.plupload.getFile(file); + } + if(onlyRemoveElement || file.static) { + var $file = $('#file-' + file.id); + if($.fn.tooltip) { + $file.find('[data-toggle="tooltip"]').tooltip('destroy'); + $('.tooltip').remove(); + } + $file.fadeOut(function() { + $(this).remove(); + }); + } else { + that.plupload.removeFile(file); + } + }; + + Uploader.prototype.initPlupload = function() { + var that = this; + var options = that.options; + var plOptions = $.extend({}, options, { + browse_button: that.$button[0], + container: that.$[0], + drop_element: that.$dropElement[0], + multipart_params: null + }); + var eventHandlers = { + FilesAdded: function(uploader, files) { + var limitFilesCount = options.limitFilesCount; + if(limitFilesCount) { + if(limitFilesCount === true) limitFilesCount = 1; + var existCount = that.$list.children('.file').length; + if((existCount + files.length) > limitFilesCount) { + that.showMessage(that.lang.limitFilesCountMessage.format({count: limitFilesCount}), 'warning'); + var newFiles = []; + for(var i = 0; i < files.length; ++i) { + if((existCount + i + 1) <= limitFilesCount) { + newFiles.push(files[i]); + } else { + uploader.removeFile(files[i]); + } + } + if(!newFiles.length) return; + files = newFiles; + } + } + that.showFile(files); + if(options.autoUpload) that.start(); + that.showStatus(); + that.callEvent('onFilesAdded', [files]); + }, + UploadProgress: function(uploader, file) { + that.showFile(file); + that.delayShowStatus(); + that.callEvent('onUploadProgress', file); + }, + FileUploaded: function(uploader, file, responseObject) { + if(responseObject) { + var responseData = typeof responseObject === 'object' ? responseObject.response : responseObject; + try {file.remoteData = $.parseJSON(responseData);} + catch(e) {} + } + if(that.qiniuEnable && file.remoteData) { + file.url = uploader.settings.domain + file.remoteData.key; + } + var responseHandlerOption = options.responseHandler; + if(responseHandlerOption) { + var error = null; + if($.isFunction(responseHandlerOption)) { + error = responseHandlerOption.call(that, responseObject, file); + } else if(responseObject.response) { + var json = file.remoteData; + if($.isPlainObject(json)) { + var result = json.status || json.result; + result = result === 'ok' || result === 'success' || result === 200; + if (result) { + if(json.id !== undefined) file.remoteId = json.id; + if(json.url !== undefined) file.url = json.url; + if(json.name !== undefined) file.name = json.name; + } else { + error = {message: json.message, data: json}; + } + } + } + if(error) { + error = $.isPlainObject(error) ? error : {message: error}; + file.status = Plupload.FAILED; + if(error.code === undefined) error.code = Plupload.GENERIC_ERROR; + error.file = file; + error.responseObject = responseObject; + file.errorMessage = error.message; + return; + } + } + + if(file.status === Plupload.DONE) { + that.lastUploadedCount++; + } + that.showFile(file, responseObject); + that.showStatus(); + that.callEvent('onFileUploaded', [file, responseObject]); + + if(file.status === Plupload.DONE) { + var optionRemoveUploaded = options.removeUploaded; + if(optionRemoveUploaded) { + setTimeout(function() { + $('#file-' + file.id).fadeOut(function() { + $(this).remove(); + }); + }, (typeof optionRemoveUploaded) === 'number' ? optionRemoveUploaded : 2000); + } + } + }, + UploadComplete: function(uploader, files) { + that.showFile(files); + that.showStatus(); + var uploadedMessage = options.uploadedMessage; + if(uploadedMessage) { + var uploadedCount = that.lastUploadedCount; + var failedCount = 0; + var failMessages = []; + $.each(files, function(idx, file) { + if(file.status === Plupload.FAILED) { + failedCount++; + if (file.errorMessage) { + failMessages.push(file.errorMessage); + delete file.errorMessage; + } + } + }); + var msg = failMessages && failMessages.length ? ('

      ' + failMessages.join(',') + '

      ') : '', + msgData = { + uploaded: uploadedCount, + failed: failedCount + }; + if(typeof uploadedMessage === 'string') { + msg += uploadedMessage.format(msgData); + } else if($.isFunction(uploadedMessage)) { + msg += uploadedMessage(msgData); + } else { + msg += that.lang[failedCount > 0 ? 'uploadHasFailedMessage' : (uploadedCount > 0 ? 'uploadSuccessMessage' : 'uploadEmptyMessage')].format(msgData); + } + that.showMessage(msg, failedCount > 0 ? 'danger' : (uploadedCount > 0 ? 'success' : 'warning'), 3); + } + that.callEvent('onUploadComplete', [files]); + }, + FilesRemoved: function(uploader, files) { + $.each(files, function(idx, file) { + that.removeFile(file, true); + }); + that.showStatus(); + that.callEvent('onFilesRemoved', files); + }, + ChunkUploaded: function(uploader, file, responseObject) { + that.callEvent('onChunkUploaded', [file, responseObject]); + }, + UploadFile: function(uploader, file) { + that.showStatus(); + that.callEvent('onUploadFile', file); + }, + BeforeUpload: function(uploader, file) { + var oldParams = uploader.getOption('multipart_params'); + var multipartParamsOption = options.multipart_params; + var params = {}; + if (oldParams && oldParams.key) { + params.key = oldParams.key; + } + if (oldParams && oldParams.token) { + params.token = oldParams.token; + } + if(options.sendFileName) params[options.sendFileName === true ? 'name' : options.sendFileName] = file.name; + if(options.sendFileId) params[options.sendFileId === true ? 'uuid' : options.sendFileId] = file.id; + params = $.extend(params, $.isFunction(multipartParamsOption) ? multipartParamsOption(file, params) : multipartParamsOption); + uploader.setOption('multipart_params', params); + that.callEvent('onBeforeUpload', file); + }, + Refresh: function(uploader) { + that.showStatus(); + that.callEvent('onRefresh'); + }, + StateChanged: function(uploader) { + if(uploader.state === Plupload.STARTED) { + that.lastUploadedCount = 0; + } + that.$.toggleClass('uploader-started', Plupload.STARTED === uploader.state); + that.hideMessage(); + that.showStatus(); + that.callEvent('onStateChanged', uploader.state); + }, + QueueChanged: function(uploader) { + that.showStatus(); + that.callEvent('onQueueChanged'); + }, + Error: function(uploader, error) { + var type = 'danger'; + if(error.code === Plupload.FILE_SIZE_ERROR || error.code === Plupload.FILE_SIZE_ERROR || error.code === Plupload.FILE_EXTENSION_ERROR || error.code === Plupload.FILE_DUPLICATE_ERROR || error.code === Plupload.MAGE_FORMAT_ERROR) type = 'warning'; + that.showMessage(error.message, type); + that.callEvent('onError', error); + } + }; + + Plupload.addI18n(that.lang.i18n); + + that.qiniuEnable = $.isPlainObject(options.qiniu) && window.Qiniu; + if(that.qiniuEnable) { + var qiniuOptions = options.qiniu; + var qiniuKeyFunc = qiniuOptions.key; + delete plOptions.qiniu; + if(qiniuKeyFunc) { + delete qiniuOptions.key; + if($.isFunction(qiniuKeyFunc)) { + eventHandlers.Key = qiniuKeyFunc; + } + } else { + eventHandlers.Key = function(uploader, file) { + return file.name; + }; + } + qiniuOptions.init = eventHandlers; + plOptions = $.extend(plOptions, qiniuOptions); + var qiniuSKD = new QiniuJsSDK(); + var plupload = qiniuSKD.uploader(plOptions); + that.plupload = plupload; + } else { + var plupload = new Plupload.Uploader(plOptions); + plupload.init(); + that.plOptions = plOptions; + that.plupload = plupload; + $.each(eventHandlers, function(eventName, eventHandler) { + plupload.bind(eventName, eventHandler); + }); + } + }; + + // Get and init options + Uploader.prototype.getOptions = function(options) { + this.options = $.extend({ + lang: $.zui.clientLang() + }, DEFAULTS, this.$.data(), options); + return this.options; + }; + + // Call event helper + Uploader.prototype.callEvent = function(name, params) { + var that = this; + if(!$.isArray(params)) params = [params]; + that.$.trigger(name, params); + if($.isFunction(that.options[name])) { + return that.options[name].apply(that, params); + } + }; + + // Extense jquery element + $.fn.uploader = function(option, params) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new Uploader(this, options))); + + if(typeof option == 'string') data[option](params); + }); + }; + + Uploader.NAME = NAME; + Uploader.STATUS = STATUS; + Uploader.ERRORS = ERRORS; + Uploader.NAME = NAME; + Uploader.LANG = { + zh_cn: {"limitFilesCountMessage": "所有文件数目不能超过 {count} 个,如果要上传此文件请先从列表移除文件。", "uploadEmptyMessage": "没有文件等待上传。", "uploadSuccessMessage": "已上传 {uploaded} 个文件。", "uploadHasFailedMessage": "已上传 {uploaded} 个文件,{failed} 个文件上传失败。", "startedStatusText": "正在上传第 {uploading} 个文件,共 {total} 个文件,已上传 {uploaded} 个文件,{failed} 个上传失败,进度 {percent}%,平均速度 {speed}。", "initStatusText": "添加文件或拖放文件来上传。", "stoppedStatusText": "共 {total} 个文件{queue} 个文件等待上传,已上传 {uploaded} 个文件{failed} 个上传失败,平均速度 {speed}。", "deleteConfirm": "确定移除文件【{name}】?", "download": "下载", "rename": "重命名", "repeat": "重新上传", "remove": "移除", "dropPlaceholder": "将文件拖放至在此处。", "queue": "待上传", "uploading": "正在上传", "failed": "失败", "done": "已上传", "i18n": {"Stop Upload":"停止上传","Upload URL might be wrong or doesn't exist.":"上传的URL可能是错误的或不存在。","tb":"tb","Size":"大小","Close":"关闭","You must specify either browse_button or drop_element.":"您必须指定 browse_button 或者 drop_element。","Init error.":"初始化错误。","Add files to the upload queue and click the start button.":"将文件添加到上传队列,然后点击”开始上传“按钮。","List":"列表","Filename":"文件名","%s specified, but cannot be found.":"%s 已指定,但是没有找到。","Image format either wrong or not supported.":"图片格式错误或者不支持。","Status":"状态","HTTP Error.":"HTTP 错误。","Start Upload":"开始上传","Error: File too large:":"错误: 文件太大:","kb":"kb","Duplicate file error.":"无法添加重复文件。","File size error.":"文件大小错误。","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"错误:无效的文件扩展名:","Select files":"选择文件","%s already present in the queue.":"%s 已经在当前队列里。","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"超限。%s 支持最大 %wx%hpx 的图片。","File: %s":"文件: %s","b":"b","Uploaded %d/%d files":"已上传 %d/%d 个文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只接受同时上传 %d 个文件,多余的文件将会被删除。","%d files queued":"%d 个文件加入到队列","File: %s, size: %d, max file size: %d":"文件: %s, 大小: %d, 最大文件大小: %d","Thumbnails":"缩略图","Drag files here.":"把文件拖到这里。","Runtime ran out of available memory.":"运行时已消耗所有可用内存。","File count error.":"文件数量错误。","File extension error.":"文件扩展名错误。","mb":"mb","Add Files":"增加文件"}}, + zh_tw: {"limitFilesCountMessage": "所有文件數目不能超過 {count} 個。","uploadEmptyMessage": "没有文件等待上傳。", "uploadSuccessMessage": "已上傳 {uploaded} 个文件。", "uploadHasFailedMessage": "文件上傳完成,已上傳 {uploaded} 個文件,{failed} 個文件上傳失败。", "startedStatusText": "正在上傳第{uploading} 個文件,共{total} 個文件,已上傳{uploaded} 個文件,{failed} 個上傳失敗,進度{percent}%,平均速度{speed}。", "initStatusText": "添加文件或拖放文件來上傳。", "stoppedStatusText": "共{total} 個文件{queue} 個文件等待上傳,已上傳{uploaded} 個文件{failed} 個上傳失敗,平均速度{speed}< /strong>。", "deleteConfirm": "確定移除文件【{name}】?", "download": "下载", "rename": "重命名", "repeat": "重新上傳", "remove": "移除", "dropPlaceholder": "將文件拖放至在此處。", "queue": "待上傳", "uploading": "正在上傳", "failed": "失敗", "done": "已上傳", "i18n": {"Stop Upload":"停止上傳","Upload URL might be wrong or doesn't exist.":"檔案URL可能有誤或者不存在。","tb":"tb","Size":"大小","Close":"關閉","You must specify either browse_button or drop_element.":"您必須指定 browse_button 或 drop_element。","Init error.":"初始化錯誤。","Add files to the upload queue and click the start button.":"將檔案加入上傳序列,然後點選”開始上傳“按鈕。","List":"清單","Filename":"檔案名稱","%s specified, but cannot be found.":"找不到已選擇的 %s。","Image format either wrong or not supported.":"圖片格式錯誤或者不支援。","Status":"狀態","HTTP Error.":"HTTP 錯誤。","Start Upload":"開始上傳","Error: File too large:":"錯誤: 檔案大小太大:","kb":"kb","Duplicate file error.":"錯誤:檔案重複。","File size error.":"錯誤:檔案大小超過限制。","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"錯誤:不接受的檔案格式:","Select files":"選擇檔案","%s already present in the queue.":"%s 已經存在目前的檔案序列。","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"圖片解析度超出範圍! %s 最高只支援到 %wx%hpx。","File: %s":"檔案: %s","b":"b","Uploaded %d/%d files":"已上傳 %d/%d 個文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只能上傳 %d 個檔案,超過限制數量的檔案將被忽略。","%d files queued":"%d 個檔案加入到序列","File: %s, size: %d, max file size: %d":"檔案: %s, 大小: %d, 檔案大小上限: %d","Thumbnails":"縮圖","Drag files here.":"把檔案拖曳到這裡。","Runtime ran out of available memory.":"執行時耗盡了所有可用的記憶體。","File count error.":"檔案數量錯誤。","File extension error.":"檔案副檔名錯誤。","mb":"mb","Add Files":"增加檔案"}}, + en: {"limitFilesCountMessage": "All files count can not over {count}.","uploadEmptyMessage": "No file in queue to upload", "uploadSuccessMessage": "Uploaded {uploaded} files。", "uploadHasFailedMessage": "Uploaded complete, {uploaded} success, {failed} failed.", "startedStatusText": "Uploading NO.{uploading} file, total {total} files, Uploaded {uploaded} files, {failed} failed, progress {percent}%, average spped {speed}。", "initStatusText": "Append or drag file here.", "stoppedStatusText": "Total {total} files, {queue} files in queue, uploaded {uploaded} files, {failed} failed, average spped {speed}。", "deleteConfirm": "Remove file \"{name}\" form upload queue?", "rename": "Rename", "download": "Download", "repeat": "Repeat", "remove": "Remove", "dropPlaceholder": "Drop file here.", "queue": "Wait", "uploading": "Uploading", "failed": "Failed", "done": "Done", "i18n": {"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"tb","Size":"Size","Close":"Close","You must specify either browse_button or drop_element.":"You must specify either browse_button or drop_element.","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Add files to the upload queue and click the start button.","List":"List","Filename":"Filename","%s specified, but cannot be found.":"%s specified, but cannot be found.","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","Error: File too large:":"Error: File too large:","kb":"kb","Duplicate file error.":"Duplicate file error.","File size error.":"File size error.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Select files","%s already present in the queue.":"%s already present in the queue.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.","File: %s":"File: %s","b":"b","Uploaded %d/%d files":"Uploaded %d/%d files","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"File: %s, size: %d, max file size: %d","Thumbnails":"Thumbnails","Drag files here.":"Drag files here.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","mb":"mb","Add Files":"Add Files"}} + }; + + $.zui.plupload = Plupload; + $.zui.moxie = Moxie; + $.zui.Uploader = Uploader; + + $.fn.uploader.Constructor = Uploader; + + // For qiniu + if(!window.mOxie) window.mOxie = { + Env: Moxie.core.utils.Env, + XMLHttpRequest: Moxie.xhr.XMLHttpRequest + }; + + // Auto call uploader after document load complete + $(function() { + $('[data-ride="uploader"]').uploader(); + }); +}(jQuery, window, plupload, moxie, undefined)); + diff --git a/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.css b/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.css new file mode 100644 index 0000000..2b15bb1 --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.css @@ -0,0 +1,6 @@ +/*! + * ZUI: 文件上传 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */.uploader{position:relative;margin-bottom:20px}.uploader-btn-hidden{position:absolute;top:-1px;left:-1px;width:1px;height:1px;opacity:0}.file-dragable{position:relative}[data-drop-placeholder]:before{position:absolute;top:0;left:0;z-index:10;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;height:100%;font-size:16px;text-align:center;pointer-events:none;content:attr(data-drop-placeholder);background-color:rgba(255,240,213,.5);filter:alpha(opacity=0);border:2px dashed #f1a325;opacity:0;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s;-webkit-transform:scale(.95);-ms-transform:scale(.95);-o-transform:scale(.95);transform:scale(.95);-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.ie [data-drop-placeholder]:before{display:none!important}.file-dragable[data-drop-placeholder]:before{filter:alpha(opacity=100);opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}.file-drag-enter[data-drop-placeholder]:before{background-color:#fff0d5;border-style:solid}.file-list,.uploader-files{position:relative;min-height:32px;margin-bottom:10px;border:1px solid #ddd}.file-list[data-drag-placeholder]:before,.uploader-files[data-drag-placeholder]:before{position:absolute;top:50%;right:0;left:0;display:block;margin-top:-15px;line-height:32px;color:#ddd;text-align:center;pointer-events:none;content:attr(data-drag-placeholder);-webkit-transition:all .4s;-o-transition:all .4s;transition:all .4s}.file-list[data-drag-placeholder]:hover:before,.uploader-files[data-drag-placeholder]:hover:before{color:grey}.file-list .file-icon,.uploader-files .file-icon{position:relative;width:32px;height:32px;line-height:32px;text-align:center;filter:alpha(opacity=70);opacity:.7;-webkit-transition:opacity .4s;-o-transition:opacity .4s;transition:opacity .4s}.file-list .file-icon-image,.uploader-files .file-icon-image{position:absolute;top:5px;right:5px;bottom:5px;left:5px;background-color:#fff;background-repeat:no-repeat;background-position:center;-webkit-background-size:cover;background-size:cover;border:1px solid #ddd}.file-list .file-name,.uploader-files .file-name{text-decoration:none;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s}.file-list .file-name[contenteditable],.uploader-files .file-name[contenteditable]{padding:0 5px;background-color:#fff;outline:1px solid #3280fc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #97befd;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #97befd}.file-list .file-name,.file-list .file-size,.uploader-files .file-name,.uploader-files .file-size{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-list .file-renaming .file-name[contenteditable],.uploader-files .file-renaming .file-name[contenteditable]{text-overflow:initial}.file-list .file:hover .file-name,.uploader-files .file:hover .file-name{color:#3280fc}.file-list .file:hover .file-icon,.uploader-files .file:hover .file-icon{opacity:1}.file-list .file-status,.uploader-files .file-status{display:inline-block;line-height:20px;text-align:right}.file-list .file-status:hover,.uploader-files .file-status:hover{background-color:rgba(0,0,0,.07)}.file-list .file-status>.icon,.uploader-files .file-status>.icon{line-height:20px;vertical-align:middle;opacity:1;-webkit-transition:all .8s;-o-transition:all .8s;transition:all .8s;-webkit-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}.file-list .file-status>.icon:before,.uploader-files .file-status>.icon:before{content:'\e653'}.file-list .file-status>.text,.uploader-files .file-status>.text{display:inline-block;padding:0 6px;font-size:12px;line-height:20px}.file-list .file-status>.text:empty,.uploader-files .file-status>.text:empty{display:none}.file-list .file[data-status=uploading] .file-status>.icon,.uploader-files .file[data-status=uploading] .file-status>.icon{filter:alpha(opacity=0);opacity:0;-webkit-transform:scale(0);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0)}.file-list .file[data-status=uploading] .file-status>.text,.uploader-files .file[data-status=uploading] .file-status>.text{color:#fff;background-color:#3280fc;border-radius:10px}.file-list .file[data-status=queue] .file-status,.uploader-files .file[data-status=queue] .file-status{color:#f1a325}.file-list .file[data-status=queue] .file-status>.icon:before,.uploader-files .file[data-status=queue] .file-status>.icon:before{content:'\e6cd'}.file-list .file[data-status=failed] .file-status,.uploader-files .file[data-status=failed] .file-status{color:#ea644a}.file-list .file[data-status=failed] .file-status>.icon:before,.uploader-files .file[data-status=failed] .file-status>.icon:before{content:'\e66a'}.file-list .file[data-status=done] .file-status,.uploader-files .file[data-status=done] .file-status{color:#38b03f}.file-list .file .actions>.btn-download-file,.file-list .file .actions>.btn-reset-file,.file-list .file[data-status=uploading] .actions>.btn,.file-list .file[data-status=failed] .actions>.btn-rename-file,.file-list .file[data-status=done] .actions>.btn,.uploader-files .file .actions>.btn-download-file,.uploader-files .file .actions>.btn-reset-file,.uploader-files .file[data-status=uploading] .actions>.btn,.uploader-files .file[data-status=failed] .actions>.btn-rename-file,.uploader-files .file[data-status=done] .actions>.btn{display:none}.file-list .file[data-status=failed] .actions>.btn-reset-file,.file-list .file[data-status=done] .actions>.btn-download-file[href],.file-list.file-show-delete-action-on-done .file[data-status=done] .actions>.btn-delete-file,.file-list.file-show-rename-action-on-done .file[data-status=done] .actions>.btn-rename-file,.uploader-files .file[data-status=failed] .actions>.btn-reset-file,.uploader-files .file[data-status=done] .actions>.btn-download-file[href],.uploader-files.file-show-delete-action-on-done .file[data-status=done] .actions>.btn-delete-file,.uploader-files.file-show-rename-action-on-done .file[data-status=done] .actions>.btn-rename-file{display:inline-block}.file-list.file-rename-by-click [data-status=queue] .file-name:hover,.uploader-files.file-rename-by-click [data-status=queue] .file-name:hover{background-color:rgba(255,255,255,.5);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #97befd;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #97befd}.file-list .file-progress-bar,.uploader-files .file-progress-bar{position:absolute;top:0;bottom:0;left:0;z-index:10;pointer-events:none;background-color:rgba(50,128,252,.1);filter:alpha(opacity=0);-webkit-box-shadow:inset 0 -2px #3280fc;box-shadow:inset 0 -2px #3280fc;opacity:0;-webkit-transition:width .6s ease,opacity .4s;-o-transition:width .6s ease,opacity .4s;transition:width .6s ease,opacity .4s}.file-list .file[data-status=uploading] .file-progress-bar,.uploader-files .file[data-status=uploading] .file-progress-bar{filter:alpha(opacity=100);opacity:1}.file-list .file[data-status=queue],.uploader-files .file[data-status=queue]{background-color:#fff0d5}.file-list .file[data-status=failed],.uploader-files .file[data-status=failed]{background-color:#ffe5e0}.file-list .file[data-status=done],.uploader-files .file[data-status=done]{background-color:#fff}.uploader-actions{background-color:#f1f1f1}.file-list+.uploader-actions{margin-top:-10px;border:1px solid #ddd;border-top:none}.uploader-actions .uploader-status{padding:5px 10px;line-height:20px}.uploader-message{position:absolute;top:0;right:0;left:0;z-index:1;display:none;padding:5px 10px;color:#fff;background:#3280fc;filter:alpha(opacity=95);opacity:.95}.uploader-message>.close{position:absolute;top:3px;right:10px;color:inherit;text-shadow:none;opacity:.4}.uploader-message>.close:hover{opacity:1}.uploader-message[data-type=danger]{background:#ea644a}.uploader-message[data-type=warning]{background:#f1a325}.uploader-message[data-type=info]{background:#03b8cf}.uploader-message[data-type=success]{background:#38b03f}.file-list .file{position:relative;z-index:0;background-color:#fff;-webkit-transition:background .4s;-o-transition:background .4s;transition:background .4s}.file-list .file+.file{border-top:1px solid #ddd}.file-list .file-wrapper{position:relative;z-index:2;display:table;width:100%;table-layout:fixed;-webkit-transition:background .4s;-o-transition:background .4s;transition:background .4s}.file-list .file-wrapper:hover{background-color:rgba(0,0,0,.05)}.file-list .file-wrapper>.actions,.file-list .file-wrapper>.content,.file-list .file-wrapper>.file-icon{display:table-cell;vertical-align:middle}.file-list .file-wrapper>.actions{width:150px;text-align:right}.file-list .file-wrapper>.actions>.btn{padding:5px 8px}.file-list .file-wrapper>.actions>.btn:hover{background-color:rgba(0,0,0,.07)}.file-list .file-name{display:block}.file-list .file-wrapper>.content>.file-name{float:left}.file-list .file-wrapper>.content>.file-size{float:right;margin-top:2px}.file-list .file-wrapper>.actions>.btn{border-radius:0}.file-list .file-status{padding:5px}.file-list-lg .file{min-height:50px}.file-list-lg .file-icon{width:50px;line-height:50px}.file-list-lg .file-icon .icon{position:relative;display:block;width:50px;font-size:28px;line-height:50px;text-align:center}.file-list-lg .file-icon .icon-file-o{position:relative;left:-2px}.file-list-lg .file-status{line-height:40px}.file-list-lg .file-status>.icon{font-size:20px}.file-list-lg .file[data-status=done] .file-status{padding:5px 12px}.file-list-lg .file-wrapper>.content>.file-name{float:none;line-height:20px}.file-list-lg .file-wrapper>.content>.file-size{float:none;line-height:14px}.file-list-lg .file-wrapper>.actions>.btn{padding:14px 8px}.file-list-lg .file-renaming .file-name[contenteditable]{font-size:14px;line-height:34px}.file-list-lg .file-renaming .file-wrapper>.content>.file-size{display:none}.file-list-grid{margin-right:-8px;margin-left:-8px;border:none}.file-list-grid:after,.file-list-grid:before{display:table;content:" "}.file-list-grid:after{clear:both}.file-list-grid .file{display:block;float:left;width:120px;height:120px;margin:8px 8px 35px 8px;border:1px solid #ddd;border-radius:4px}.file-list-grid .file .file-icon{display:block;width:118px;height:118px;overflow:hidden}.file-list-grid .file-icon>.icon{font-size:70px;line-height:118px}.file-list-grid .file-icon-image{top:-1px;right:-1px;bottom:-1px;left:-1px;border:none}.file-list-grid .file-wrapper{position:absolute;top:0;right:0;left:0;display:block;width:auto}.file-list-grid .file-wrapper>.content{position:absolute;right:-1px;bottom:-24px;left:-1px;display:block;text-align:center;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s}.file-list-grid .file-wrapper>.content>.file-name{position:relative;z-index:5;float:none;padding:4px 0;line-height:16px;border:1px solid transparent}.file-list-grid .file-wrapper>.content>.file-size{position:absolute;top:-24px;left:4px;display:block;padding:0 5px;line-height:18px;color:#fff;background-color:grey;background-color:rgba(0,0,0,.5);filter:alpha(opacity=0);border-radius:9px;opacity:0;-webkit-transition:opacity .4s;-o-transition:opacity .4s;transition:opacity .4s}.file-list-grid .file-renaming .file-wrapper>.content>.file-name,.file-list-grid .file-wrapper>.content:hover>.file-name{text-overflow:initial;word-break:break-all;white-space:normal;background-color:#fff;border-color:#ddd;-webkit-box-shadow:none;box-shadow:none}.file-list-grid .file-renaming .file-wrapper>.content>.file-name{padding:4px;text-align:left}.file-list-grid .file:hover .file-wrapper>.content>.file-size,.file-list-grid .file[data-status=uploading] .file-wrapper>.content>.file-size{filter:alpha(opacity=100);opacity:1}.file-list-grid .file-wrapper>.actions{position:absolute;top:0;right:0;left:0;display:block;width:118px}.file-list-grid .file-wrapper:hover>.actions{background:rgba(255,255,255,.85)}.file-list-grid .file-wrapper>.actions>.file-status{position:absolute;top:0;left:0;height:28px;padding:4px 5px}.file-list-grid .file-wrapper>.actions>.file-status>.icon{position:relative;top:-1px;display:inline-block;font-size:21px;text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff}.file-list-grid .file-wrapper>.actions>.file-status>.text{padding:0}.file-list-grid .file[data-status=failed] .file-wrapper>.actions>.file-status>.icon{font-size:14px;text-shadow:none}.file-list-grid .file[data-status=uploading] .file-wrapper>.actions>.file-status>.text{position:absolute;top:4px;left:4px;padding:0 8px}.file-list-grid .file[data-status=failed] .file-wrapper>.actions>.file-status{top:4px;left:4px;height:20px;padding:0 8px;color:#fff;background-color:#ea644a;border-radius:10px}.file-list-grid .file-wrapper>.actions>.btn{padding:3px 6px;filter:alpha(opacity=0);opacity:0}.file-list-grid .file-wrapper:hover>.actions>.btn{filter:alpha(opacity=100);opacity:1}.file-list-grid .file-progress-bar{-webkit-box-shadow:inset 0 -4px #3280fc;box-shadow:inset 0 -4px #3280fc}.file-list-grid+.uploader-actions{border:none} \ No newline at end of file diff --git a/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.js b/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.js new file mode 100644 index 0000000..ae7256b --- /dev/null +++ b/dist/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.js @@ -0,0 +1,11 @@ +/*! + * ZUI: 文件上传 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r0&&u(n,function(n,l){var u=-1!==f(e(n),["array","object"]);return!!(n===r||t&&o[l]===r)||(u&&i&&(n=a(n)),void(e(o[l])===e(n)&&u?s(t,i,[o[l],n]):o[l]=n))})}),o}function l(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.parent=t.prototype,e}function u(e,t){var i,n,r,o;if(e){try{i=e.length}catch(a){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function c(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function d(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++ri;i++)if(t[i]===e)return i}return-1}function m(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===f(t[r],i)&&n.push(t[r]);return!!n.length&&n}function h(e,t){var i=[];return u(e,function(e){-1!==f(e,t)&&i.push(e)}),i.length?i:null}function g(e){var t,i=[];for(t=0;ti;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:b,typeOf:e,extend:t,extendIf:i,extendImmutable:n,extendImmutableIf:r,clone:o,inherit:l,each:u,isEmptyObj:c,inSeries:d,inParallel:p,inArray:f,arrayDiff:m,arrayIntersect:h,toArray:g,trim:v,sprintf:E,parseSizeStr:x,delay:y}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},i=function(e,i){if("function"==typeof window.atob)return i?t(window.atob(e)):window.atob(e);var n,r,o,a,s,l,u,c,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p=0,f=0,m="",h=[];if(!e)return e;e+="";do a=d.indexOf(e.charAt(p++)),s=d.indexOf(e.charAt(p++)),l=d.indexOf(e.charAt(p++)),u=d.indexOf(e.charAt(p++)),c=a<<18|s<<12|l<<6|u,n=255&c>>16,r=255&c>>8,o=255&c,h[f++]=64==l?String.fromCharCode(n):64==u?String.fromCharCode(n,r):String.fromCharCode(n,r,o);while(p>18,s=63&c>>12,l=63&c>>6,u=63&c,h[f++]=d.charAt(a)+d.charAt(s)+d.charAt(l)+d.charAt(u);while(pn;n++)if(e[n]!=t[n]){if(e[n]=l(e[n]),t[n]=l(t[n]),e[n]t[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",i="?",n="function",r="undefined",o="object",a="name",s="version",l={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},u={rgx:function(){for(var t,i,a,s,l,u,c,d=0,p=arguments;d0?2==l.length?t[l[0]]=typeof l[1]==n?l[1].call(this,c):l[1]:3==l.length?t[l[0]]=typeof l[1]!==n||l[1].exec&&l[1].test?c?c.replace(l[1],l[2]):e:c?l[1].call(this,c,l[2]):e:4==l.length&&(t[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):e):t[l]=c?c:e;break}if(u)break}return t},str:function(t,n){for(var r in n)if(typeof n[r]===o&&n[r].length>0){for(var a=0;a=")),i.use_blob_uri},use_data_uri:function(){var e=new Image;return e.onload=function(){i.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return i.use_data_uri&&("IE"!==a.browser||a.version>=9)},use_data_uri_of:function(e){return i.use_data_uri&&33e3>e||i.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),i.use_fileinput=!e.disabled},use_webgl:function(){var e,n=document.createElement("canvas"),r=null;try{r=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(o){}return r||(r=null),e=!!r,i.use_webgl=e,n=t,e}};return function(t){var n=[].slice.call(arguments);return n.shift(),"function"===e.typeOf(i[t])?i[t].apply(this,n):!!i[t]}}(),o=(new n).getResult(),a={can:r,uaParser:n,browser:o.browser.name,version:o.browser.version,os:o.os.name,osVersion:o.os.version,verComp:i,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return a.OS=a.os,a}),n("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:function(){function i(e,i){this.code=e,this.name=t(n,e),this.message=this.name+(i||": RuntimeError "+this.code)}var n={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(i,n),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": ImageError "+this.code}var n={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(i,n),i.prototype=Error.prototype,i}(),FileException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": FileException "+this.code}var n={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(i,n),i.prototype=Error.prototype,i}(),DOMException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": DOMException "+this.code}var n={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(i,n),i.prototype=Error.prototype,i}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),n("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){if(!e.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)},n=function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,i){function n(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===u.compatMode?u.documentElement:u.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}var r,o,a,s=0,l=0,u=document;if(t=t,i=i||u.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!u.documentMode||u.documentMode<8))return o=n(t),a=n(i),{x:o.x-a.x,y:o.y-a.y};for(r=t;r&&r!=i&&r.nodeType;)s+=r.offsetLeft||0,l+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)s-=r.scrollLeft||0,l-=r.scrollTop||0,r=r.parentNode;return{x:s,y:l}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:i,addClass:n,removeClass:r,getStyle:o,getPos:a,getSize:s}}),n("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(e,t,i){function n(){this.uid=i.guid()}var r={};return i.extend(n.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(e,t,n,o){var a,s=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),e=i.trim(e),/\s/.test(e)?void i.each(e.split(/\s+/),function(e){s.addEventListener(e,t,n,o)}):(e=e.toLowerCase(),n=parseInt(n,10)||0,a=r[this.uid]&&r[this.uid][e]||[],a.push({fn:t,priority:n,scope:o||this}),r[this.uid]||(r[this.uid]={}),void(r[this.uid][e]=a))},hasEventListener:function(e){var t;return e?(e=e.toLowerCase(),t=r[this.uid]&&r[this.uid][e]):t=r[this.uid],!!t&&t},removeEventListener:function(e,t){var n,o,a=this;if(e=e.toLowerCase(),/\s/.test(e))return void i.each(e.split(/\s+/),function(e){a.removeEventListener(e,t)});if(n=r[this.uid]&&r[this.uid][e]){if(t){for(o=n.length-1;o>=0;o--)if(n[o].fn===t){n.splice(o,1);break}}else n=[];n.length||(delete r[this.uid][e],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(e){var n,o,a,s,l,u={},c=!0;if("string"!==i.typeOf(e)){if(s=e,"string"!==i.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=s.type,s.total!==l&&s.loaded!==l&&(u.total=s.total,u.loaded=s.loaded),u.async=s.async||!1}if(-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),u.type=e,a.unshift(u);var d=[];i.each(o,function(e){a[0].target=e.scope,u.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&i.inSeries(d,function(e){c=!e})}return c},bindOnce:function(e,t,i,n){var r=this;r.bind.call(this,e,function o(){return r.unbind(e,o),t.apply(this,arguments)},i,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)}),i.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===i.typeOf(t[e])&&(t[e]=null)})}}),n.instance=new n,n}),n("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(e,t,i,n){function r(e,n,o,s,l){var u,c=this,d=t.guid(n+"_"),p=l||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(p=r.getMode(s,e.preferred_caps,p)),u=function(){var e={};return{exec:function(t,i,n,r){return u[i]&&(e[t]||(e[t]={context:this,instance:new u[i]}),e[t].instance[n])?e[t].instance[n].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var i=this;t.each(e,function(e,n){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(n)})}}}(),t.extend(this,{initialized:!1,uid:d,type:n,mode:r.getMode(s,e.required_caps,p),shimid:d+"_container",clients:0,options:e,can:function(e,i){var n=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(i)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],n))return!1;return!0}return"function"===t.typeOf(n[e])?n[e].call(this,i):i===n[e]},getShimContainer:function(){var e,n=i.get(this.shimid);return n||(e=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(n),e=null),n},getShim:function(){return u},shimExec:function(e,t){var i=[].slice.call(arguments,2);return c.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return c[e]&&c[e][t]?c[e][t].apply(this,i):c.shimExec.apply(this,arguments)},destroy:function(){if(c){var e=i.get(this.shimid);e&&e.parentNode.removeChild(e),u&&u.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=c=u=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return!!a[e]&&a[e]},r.addConstructor=function(e,t){t.prototype=n.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var i={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){i[e]=!0}),i)},r.can=function(e,t){var i,n,o=r.getConstructor(e);return!!o&&(i=new o({required_caps:t}),n=i.mode,i.destroy(),!!n)},r.thatCan=function(e,t){var i=(t||r.order).split(/\s*,\s*/);for(var n in i)if(r.can(i[n],e))return i[n];return null},r.getMode=function(e,i,n){var r=null;if("undefined"===t.typeOf(n)&&(n="browser"),i&&!t.isEmptyObj(e)){if(t.each(i,function(i,n){if(e.hasOwnProperty(n)){var o=e[n](i);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(n,r)?n:r[0];if(r===!1)return!1}return n},r.getGlobalEventTarget=function(){if(/^moxie\./.test(e.global_event_dispatcher)&&!e.can("access_global_ns")){var i=t.guid("moxie_event_target_");window[i]=function(e,t){n.instance.dispatchEvent(e,t)},e.global_event_dispatcher=i}return e.global_event_dispatcher},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),n("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(e,t,i,n){return function(){var e;i.extend(this,{connectRuntime:function(r){function o(i){var a,l;return i.length?(a=i.shift().toLowerCase(),(l=n.getConstructor(a))?(e=new l(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,s.ruid=e.uid,s.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(i)}),e.bind("Exception",function(e,i){var n=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,n))}),e.mode?void e.init():void e.trigger("Error")):void o(i)):(s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),void(e=null))}var a,s=this;if("string"===i.typeOf(r)?a=r:"string"===i.typeOf(r.ruid)&&(a=r.ruid),a){if(e=n.getRuntime(a))return s.ruid=a,e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null},can:function(t){return!!e&&e.can(t)}})}}),n("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(e,t,i){function n(o,a){function s(t,i,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new n(null,{type:o,size:i-t}),a.detach(s.substr(t,a.size)),a):null}i.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,i){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var i=e.indexOf(";base64,");this.type=e.substring(5,i),e=t.atob(e.substring(i+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return n}),n("moxie/core/I18n",["moxie/core/utils/Basic"],function(e){var t={};return{addI18n:function(i){return e.extend(t,i)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),n("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(e,t){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb xlt xla,application/vnd.ms-powerpoint,ppt pps pot ppa,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",n={},r={},o=function(e){var t,i,o,a=e.split(/,/);for(t=0;ta;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):n.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(i){t.each(n,function(e){i(e.value,e.name)}),e&&i(e.value,e.name)},destroy:function(){e=null,n=[]}})}return n}),n("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,l,u,c,d){function p(){this.uid=e.guid("uid_")}function f(){function i(e,t){return S.hasOwnProperty(e)?1===arguments.length?c.can("define_property")?S[e]:I[e]:void(c.can("define_property")?S[e]=t:I[e]=t):void 0}function l(t){function n(){_&&(_.destroy(),_=null),s.dispatchEvent("loadend"),s=null}function r(r){_.bind("LoadStart",function(e){i("readyState",f.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),N&&s.upload.dispatchEvent(e)}),_.bind("Progress",function(e){i("readyState")!==f.LOADING&&(i("readyState",f.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),_.bind("UploadProgress",function(e){N&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),_.bind("Load",function(t){i("readyState",f.DONE),i("status",Number(r.exec.call(_,"XMLHttpRequest","getStatus")||0)),i("statusText",m[i("status")]||""),i("response",r.exec.call(_,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),k=r.exec.call(_,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),i("status")>0?(N&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(M=!0,s.dispatchEvent("error")),n()}),_.bind("Abort",function(e){s.dispatchEvent(e),n()}),_.bind("Error",function(e){M=!0,i("readyState",f.DONE),s.dispatchEvent("readystatechange"),L=!0,s.dispatchEvent(e),n()}),r.exec.call(_,"XMLHttpRequest","send",{url:v,method:x,async:T,user:E,password:y,headers:A,mimeType:D,encoding:O,responseType:s.responseType,withCredentials:s.withCredentials,options:B},t)}var s=this;b=(new Date).getTime(),_=new a,"string"==typeof B.required_caps&&(B.required_caps=o.parseCaps(B.required_caps)),B.required_caps=e.extend({},B.required_caps,{return_response_type:s.responseType}),t instanceof u&&(B.required_caps.send_multipart=!0),e.isEmptyObj(A)||(B.required_caps.send_custom_headers=!0),z||(B.required_caps.do_cors=!0),B.ruid?r(_.connectRuntime(B)):(_.bind("RuntimeInit",function(e,t){r(t)}),_.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),_.connectRuntime(B))}function g(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),b=w=null}var v,x,E,y,b,w,_,R,I=this,S={timeout:0,readyState:f.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,A={},O=null,D=null,F=!1,C=!1,N=!1,L=!1,M=!1,z=!1,U=null,P=null,B={},k="";e.extend(this,S,{uid:e.guid("uid_"),upload:new p,open:function(o,a,s,l,u){var c;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||n.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(x=o.toUpperCase()),~e.inArray(x,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=n.utf8_encode(a),c=r.parseUrl(a),z=r.hasSameOrigin(c),v=r.resolveUrl(a),(l||u)&&!z)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(E=l||c.user,y=u||c.pass,T=s||!0,T===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);F=!T,C=!1,A={},g.call(this),i("readyState",f.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(i("readyState")!==f.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||n.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),!~e.inArray(r,a)&&!/^(proxy\-|sec\-)/.test(r)&&(A[r]?A[r]+=", "+o:A[r]=o,!0)},hasRequestHeader:function(e){return e&&A[e.toLowerCase()]||!1},getAllResponseHeaders:function(){return k||""},getResponseHeader:function(t){return t=t.toLowerCase(),M||~e.inArray(t,["set-cookie","set-cookie2"])?null:k&&""!==k&&(R||(R={},e.each(k.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=e.trim(i[0]),R[i[0].toLowerCase()]={header:i[0],value:e.trim(i[1])})})),R.hasOwnProperty(t))?R[t].header+": "+R[t].value:null},overrideMimeType:function(n){var r,o;if(~e.inArray(i("readyState"),[f.LOADING,f.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n=e.trim(n.toLowerCase()),/;/.test(n)&&(r=n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(n=r[1],r[2]&&(o=r[2])),!d.mimes[n])throw new t.DOMException(t.DOMException.SYNTAX_ERR);U=n,P=o},send:function(i,r){if(B="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==f.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof s)B.ruid=i.ruid,D=i.type||"application/octet-stream";else if(i instanceof u){if(i.hasBlob()){var o=i.getBlob();B.ruid=o.ruid,D=o.type||"application/octet-stream"}}else"string"==typeof i&&(O="UTF-8",D="text/plain;charset=UTF-8",i=n.utf8_encode(i));this.withCredentials||(this.withCredentials=B.required_caps&&B.required_caps.send_browser_cookies&&!z),N=!F&&this.upload.hasEventListener(),M=!1,L=!i,F||(C=!0),l.call(this,i)},abort:function(){if(M=!0,F=!1,~e.inArray(i("readyState"),[f.UNSENT,f.OPENED,f.DONE]))i("readyState",f.UNSENT);else{if(i("readyState",f.DONE),C=!1,!_)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);_.getRuntime().exec.call(_,"XMLHttpRequest","abort",L),L=!0}},destroy:function(){_&&("function"===e.typeOf(_.destroy)&&_.destroy(),_=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(h.concat(["readystatechange"])),this.upload.handleEventProps(h)}var m={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};p.prototype=i.instance;var h=["loadstart","progress","abort","error","load","timeout","loadend"];return f.UNSENT=0,f.OPENED=1,f.HEADERS_RECEIVED=2,f.LOADING=3,f.DONE=4,f.prototype=i.instance,f}),n("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i,n){function r(){function n(){c=d=0,u=this.result=null}function o(t,i){var n=this;l=i,n.bind("TransportingProgress",function(t){d=t.loaded,c>d&&-1===e.inArray(n.state,[r.IDLE,r.DONE])&&a.call(n)},999),n.bind("TransportingComplete",function(){d=c,n.state=r.DONE,u=null,n.result=l.exec.call(n,"Transporter","getAsBlob",t||"")},999),n.state=r.BUSY,n.trigger("TransportingStarted"),a.call(n)}function a(){var e,i=this,n=c-d;p>n&&(p=n),e=t.btoa(u.substr(d,p)),l.exec.call(i,"Transporter","receive",e,c)}var s,l,u,c,d,p;i.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,i,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),p=r.chunk_size,n.call(this),u=t,c=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,i,this.connectRuntime(r));else{var l=function(e,t){a.unbind("RuntimeInit",l),o.call(a,i,t)};this.bind("RuntimeInit",l),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,l&&(l.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),n.call(e)},destroy:function(){this.unbindAll(),l=null,this.disconnectRuntime(),n.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=n.instance,r}),n("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(e,t,i,n,r,o,a,s,l,u,c,d,p){function f(){function n(e){try{return e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name),!0}catch(t){return this.trigger("error",t.code),!1}}function u(t){var n=e.typeOf(t);try{if(t instanceof f){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);h.apply(this,arguments)}else if(t instanceof c){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))u.call(this,new d(null,t),arguments[1]);else if("string"===n)"data:"===t.substr(0,5)?u.call(this,new c(null,{data:t}),arguments[1]):v.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);u.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function h(t,i){var n=this.connectRuntime(t.ruid);this.ruid=n.uid,n.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(i)||i)}function g(t,i){function n(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=o.parseCaps(i.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):n(this.connectRuntime(t.ruid))}function v(e,t){var i,n=this;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){u.apply(this,arguments)},resize:function(t){var n,r,o=this,a={x:0,y:0,width:o.width,height:o.height},s=e.extendIf({width:o.width,height:o.height,type:o.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t);try{if(!o.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(o.width>f.MAX_RESIZE_WIDTH||o.height>f.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if(n=o.meta&&o.meta.tiff&&o.meta.tiff.Orientation||1,-1!==e.inArray(n,[5,6,7,8])){var l=s.width;s.width=s.height,s.height=l}if(s.crop){switch(r=Math.max(s.width/o.width,s.height/o.height),t.fit?(a.width=Math.min(Math.ceil(s.width/r),o.width),a.height=Math.min(Math.ceil(s.height/r),o.height),r=s.width/a.width):(a.width=Math.min(s.width,o.width),a.height=Math.min(s.height,o.height),r=1),"boolean"==typeof s.crop&&(s.crop="cc"),s.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":a.x=o.width-a.width,a.y=o.height-a.height;break;case"cb":case"center-bottom":a.x=Math.floor((o.width-a.width)/2),a.y=o.height-a.height;break;case"lb":case"left-bottom":a.x=0,a.y=o.height-a.height;break;case"lt":case"left-top":a.x=0,a.y=0;break;case"ct":case"center-top":a.x=Math.floor((o.width-a.width)/2),a.y=0;break;case"rt":case"right-top":a.x=o.width-a.width,a.y=0;break;case"rc":case"right-center":case"right-middle":a.x=o.width-a.width,a.y=Math.floor((o.height-a.height)/2);break;case"lc":case"left-center":case"left-middle":a.x=0,a.y=Math.floor((o.height-a.height)/2);break;case"cc":case"center-center":case"center-middle":default:a.x=Math.floor((o.width-a.width)/2),a.y=Math.floor((o.height-a.height)/2)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0)}else r=Math.min(s.width/o.width,s.height/o.height),r>1&&!s.fit&&(r=1);this.exec("Image","resize",a,r,s)}catch(u){o.trigger("error",u.code)}},downsize:function(t){var i,n={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,fit:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?e.extend(n,t):e.extend(n,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]}),this.resize(i)},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!l.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return this.exec("Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return p.atob(i.substring(i.indexOf("base64,")+7))},embed:function(n,r){function o(t,r){var o=this;if(l.can("create_canvas")){var c=o.getAsCanvas();if(c)return n.appendChild(c),c=null,o.destroy(),void u.trigger("embedded")}var d=o.getAsDataURL(t,r);if(!d)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(l.can("use_data_uri_of",d.length))n.innerHTML='',o.destroy(),u.trigger("embedded");else{var f=new s;f.bind("TransportingComplete",function(){a=u.connectRuntime(this.result.ruid),u.bind("Embedded",function(){e.extend(a.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),a=null},999),a.exec.call(u,"ImageView","display",this.result.uid,width,height),o.destroy()}),f.transport(p.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:n})}}var a,u=this,c=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,fit:!0,resample:"nearest"},r);try{if(!(n=t.get(n)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);this.width>f.MAX_RESIZE_WIDTH||this.height>f.MAX_RESIZE_HEIGHT;var d=new f;return d.bind("Resize",function(){o.call(this,c.type,c.quality)}),d.bind("Load",function(){this.downsize(c)}),this.meta.thumb&&this.meta.thumb.width>=c.width&&this.meta.thumb.height>=c.height?d.load(this.meta.thumb.data):d.clone(this,!1),d}catch(m){this.trigger("error",m.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.meta&&this.meta.thumb&&this.meta.thumb.data.destroy(),this.unbindAll()}}),this.handleEventProps(m),this.bind("Load Resize",function(){return n.call(this)},999)}var m=["progress","load","error","resize","embedded"];return f.MAX_RESIZE_WIDTH=8192,f.MAX_RESIZE_HEIGHT=8192,f.prototype=u.instance,f}),n("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,l=i.capTest,u=i.capTrue,c=e.extend({access_binary:l(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!s.Image},display_media:l((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:l(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:l(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==n.browser||n.verComp(n.version,9,">"))}()),filter_by_extension:l(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),return_response_headers:u,return_response_type:function(e){return!("json"!==e||!window.JSON)||n.can("return_response_type",e)},return_status_code:u,report_upload_progress:l(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&n.can("create_canvas")},select_file:function(){return n.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===n.browser&&n.verComp(n.version,21,">=")||"Firefox"===n.browser&&n.verComp(n.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===n.browser&&"Windows"===n.os||"iOS"===n.os&&n.verComp(n.osVersion,"7.0.0",">")&&n.verComp(n.osVersion,"8.0.0","<"))},send_binary_string:l(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:l(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:l(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:u,use_http_method:u},arguments[2]);i.call(this,t,arguments[1]||a,c),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(e,t,i){var n;if(!window.File.prototype.slice)return(n=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?n.call(e,t,i):null;try{return e.slice(),e.slice(t,i)}catch(r){return e.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))},this.destroy=function(){this.getRuntime().getShim().removeInstance(this.uid)}}return e.Blob=i}),n("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(e){function t(){this.returnValue=!1}function i(){this.cancelBubble=!0}var n={},r="moxie_"+e.guid(),o=function(o,a,s,l){var u,c;a=a.toLowerCase(),o.addEventListener?(u=s,o.addEventListener(a,u,!1)):o.attachEvent&&(u=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=i,s(e)},o.attachEvent("on"+a,u)),o[r]||(o[r]=e.guid()),n.hasOwnProperty(o[r])||(n[o[r]]={}),c=n[o[r]],c.hasOwnProperty(a)||(c[a]=[]),c[a].push({func:u,orig:s,key:l})},a=function(t,i,o){var a,s;if(i=i.toLowerCase(),t[r]&&n[t[r]]&&n[t[r]][i]){a=n[t[r]][i];for(var l=a.length-1;l>=0&&(a[l].orig!==o&&a[l].key!==o||(t.removeEventListener?t.removeEventListener(i,a[l].func,!1):t.detachEvent&&t.detachEvent("on"+i,a[l].func),a[l].orig=null,a[l].func=null,a.splice(l,1),o===s));l--);if(a.length||delete n[t[r]][i],e.isEmptyObj(n[t[r]])){delete n[t[r]];try{delete t[r]}catch(u){t[r]=s}}}},s=function(t,i){t&&t[r]&&e.each(n[t[r]],function(e,n){a(t,n,i)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),n("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){var e,s;i.extend(this,{init:function(l){var u,c,d,p,f,m,h=this,g=h.getRuntime();e=l,d=o.extList2mimes(e.accept,g.can("filter_by_extension")),c=g.getShimContainer(),c.innerHTML='",u=n.get(g.uid),i.extend(u.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),p=n.get(e.browse_button),s=n.getStyle(p,"z-index")||"auto",g.can("summon_file_dialog")&&("static"===n.getStyle(p,"position")&&(p.style.position="relative"),r.addEvent(p,"click",function(e){var t=n.get(g.uid);t&&!t.disabled&&t.click(),e.preventDefault()},h.uid),h.bind("Refresh",function(){f=parseInt(s,10)||1,n.get(e.browse_button).style.zIndex=f,this.getRuntime().getShimContainer().style.zIndex=f-1})),m=g.can("summon_file_dialog")?p:c,r.addEvent(m,"mouseover",function(){h.trigger("mouseenter")},h.uid),r.addEvent(m,"mouseout",function(){h.trigger("mouseleave")},h.uid),r.addEvent(m,"mousedown",function(){h.trigger("mousedown")},h.uid),r.addEvent(n.get(e.container),"mouseup",function(){h.trigger("mouseup")},h.uid),(g.can("summon_file_dialog")?u:p).setAttribute("tabindex",-1),u.onchange=function v(){if(h.files=[],i.each(this.files,function(i){var n="";return!(!e.directory||"."!=i.name)||(i.webkitRelativePath&&(n="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(g.uid,i),i.relativePath=n,void h.files.push(i))}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=v}h.files.length&&h.trigger("change")},h.trigger({type:"ready",async:!0}),c=null},setOption:function(e,t){var i=this.getRuntime(),r=n.get(i.uid);switch(e){case"accept":if(t){var a=t.mimes||o.extList2mimes(t,i.can("filter_by_extension"));r.setAttribute("accept",a.join(","))}else r.removeAttribute("accept");break;case"directory":t&&i.can("select_folder")?(r.setAttribute("directory",""),r.setAttribute("webkitdirectory","")):(r.removeAttribute("directory"),r.removeAttribute("webkitdirectory"));break;case"multiple":t&&i.can("select_multiple")?r.setAttribute("multiple",""):r.removeAttribute("multiple")}},disable:function(e){var t,i=this.getRuntime();(t=n.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var t=this.getRuntime(),i=t.getShim(),o=t.getShimContainer(),a=e&&n.get(e.container),l=e&&n.get(e.browse_button);a&&r.removeAllEvents(a,this.uid),l&&(r.removeAllEvents(l,this.uid),l.style.zIndex=s),o&&(r.removeAllEvents(o,this.uid),o.innerHTML=""),i.removeInstance(this.uid),e=o=a=l=i=null}})}return e.FileInput=s}),n("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,t,i,n,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=i.toArray(e.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function a(e,i){if(l(e)){var n=new t(m,e);n.relativePath=i||"",h.push(n)}}function s(e){for(var t=[],n=0;n=")&&l.verComp(l.version,7,"<"),m="Android Browser"===l.browser,h=!1;if(f=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),p=u(),p.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(h=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),h=!0;else if((c||m)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return void e.call(s,i,r);if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}p.upload?(i.withCredentials&&(p.withCredentials=!0),p.addEventListener("load",function(e){s.trigger(e)}),p.addEventListener("error",function(e){s.trigger(e)}),p.addEventListener("progress",function(e){s.trigger(e)}),p.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):p.onreadystatechange=function(){switch(p.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=p.getResponseHeader("Content-Length")||0),p.responseText&&(t=p.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:p.onreadystatechange=function(){};try{if(p.status>=200&&p.status<400){s.trigger("load");break}}catch(r){}s.trigger("error")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){p.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in p&&(p.responseType="json"!==i.responseType||l.can("return_response_type","json")?i.responseType:"text"),h?p.sendAsBinary?p.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;i>r;r++)n[r]=this[e](t+r);return n}}),t}),n("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,t){return function i(n){var r,o,a,s=[],l=0;if(r=new e(n),65496!==r.SHORT(0))throw r.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(o=2;o<=r.length();)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;l=r.SHORT(o+2)+2,a>=65505&&65519>=a&&s.push({hex:a,name:"APP"+(15&a),start:o,length:l,segment:r.SEGMENT(o,l)}),o+=l}return r.clear(),{headers:s,restore:function(t){var i,n,r;for(r=new e(t),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,i=s.length;i>n;n++)r.SEGMENT(o,0,s[n].segment),o+=s[n].length;return t=r.SEGMENT(),r.clear(),t},strip:function(t){var n,r,o,a;for(o=new i(t),r=o.headers,o.purge(),n=new e(t),a=r.length;a--;)n.SEGMENT(r[a].start,r[a].length,"");return t=n.SEGMENT(),n.clear(),t},get:function(e){for(var t=[],i=0,n=s.length;n>i;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;r>i&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),n("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,i,n){function r(o){function a(i,r){var o,a,s,l,u,p,f,m,h=this,g=[],v={},x={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},E={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(o=h.SHORT(i),a=0;o>a;a++)if(g=[],f=i+2+12*a,s=r[h.SHORT(f)],s!==t){if(l=x[h.SHORT(f+=2)],u=h.LONG(f+=2),p=E[l],!p)throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(f+=4,p*u>4&&(f=h.LONG(f)+d.tiffHeader),f+p*u>=this.length())throw new n.ImageError(n.ImageError.INVALID_META_ERR);"ASCII"!==l?(g=h.asArray(l,f,u),m=1==u?g[0]:g,v[s]=c.hasOwnProperty(s)&&"object"!=typeof m?c[s][m]:m):v[s]=e.trim(h.STRING(f,u).replace(/\0$/,""))}return v}function s(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=u[e.toLowerCase()];for(var l in s)if(s[l]===t){t=l;break}}n=d[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var c=0;r>c;c++)if(o=n+12*c+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(p){return!1}return!0}var l,u,c,d,p,f;if(i.call(this,o),u={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},c={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},p=d.tiffHeader,l={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return f||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,u.exif)}catch(i){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n=65472&&65475>=t)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}function s(){var e,t,i=d.thumb();return i&&(e=new n(i),t=a(e),e.clear(),t)?(t.data=i,t):null}function l(){d&&c&&u&&(d.clear(),c.purge(),u.clear(),p=c=d=u=null)}var u,c,d,p;if(u=new n(o),65496!==u.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);c=new i(o);try{d=new r(c.get("app1")[0])}catch(f){}p=a.call(this),e.extend(this,{type:"image/jpeg",size:u.length(),width:p&&p.width||0,height:p&&p.height||0,setExif:function(t,i){return!!d&&("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,i),void c.set("app1",d.SEGMENT()))},writeHeaders:function(){return arguments.length?c.restore(arguments[0]):c.restore(o)},stripHeaders:function(e){return c.strip(e)},purge:function(){l.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),n("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(e,t,i){function n(n){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),n=c=l=u=s=null)}function a(e){var t,i,n,r;return t=s.LONG(e),i=s.STRING(e+=4,4),n=e+=4,r=s.LONG(e+t),{length:t,type:i,start:n,CRC:r}}var s,l,u,c;s=new i(n),function(){var t=0,i=0,n=[35152,20039,3338,6666];for(i=0;ii.height?"width":"height",a=Math.round(i[o]*n),s=!1;"nearest"!==r&&(.5>n||n>2)&&(n=.5>n?.5:2,s=!0);var l=t(i,n);return s?e(l,a/l[o],r):l}function t(e,t){var i=e.width,n=e.height,r=Math.round(i*t),o=Math.round(n*t),a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),e=null,a}return{scale:e}}),n("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,l){function u(){function e(){if(!x&&!g)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return x||g}function u(){var t=e();return"canvas"==t.nodeName.toLowerCase()?t:(x=document.createElement("canvas"),x.width=t.width,x.height=t.height,x.getContext("2d").drawImage(t,0,0),x)}function c(e){return n.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+n.btoa(e)}function p(e){var t=this;g=new Image,g.onerror=function(){h.call(this),t.trigger("error",i.ImageError.WRONG_FORMAT)},g.onload=function(){t.trigger("load")},g.src="data:"==e.substr(0,5)?e:d(e,y.type)}function f(e,t){var n,r=this;return window.FileReader?(n=new FileReader,n.onload=function(){t.call(r,this.result)},n.onerror=function(){r.trigger("error",i.ImageError.WRONG_FORMAT)},void n.readAsDataURL(e)):t.call(this,e.getAsDataURL())}function m(e,i){var n=Math.PI/180,r=document.createElement("canvas"),o=r.getContext("2d"),a=e.width,s=e.height;switch(t.inArray(i,[5,6,7,8])>-1?(r.width=s,r.height=a):(r.width=a,r.height=s),i){case 2:o.translate(a,0),o.scale(-1,1);break;case 3:o.translate(a,s),o.rotate(180*n);break;case 4:o.translate(0,s),o.scale(1,-1);break;case 5:o.rotate(90*n),o.scale(1,-1);break;case 6:o.rotate(90*n),o.translate(0,-s);break;case 7:o.rotate(90*n),o.translate(a,-s),o.scale(-1,1);break;case 8:o.rotate(-90*n),o.translate(-a,0)}return o.drawImage(e,0,0,a,s),r}function h(){v&&(v.purge(),v=null),E=g=x=y=null,w=!1}var g,v,x,E,y,b=this,w=!1,_=!0;t.extend(this,{loadFromBlob:function(e){var t=this.getRuntime(),n=!(arguments.length>1)||arguments[1];if(!t.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return y=e,e.isDetached()?(E=e.getSource(),void p.call(this,E)):void f.call(this,e.getSource(),function(e){n&&(E=c(e)),p.call(this,e)})},loadFromImage:function(e,t){this.meta=e.meta,y=new o(null,{name:e.name,size:e.size,type:e.type}),p.call(this,t?E=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t,i=this.getRuntime();return!v&&E&&i.can("access_image_binary")&&(v=new a(E)),t={width:e().width||0,height:e().height||0,type:y.type||l.getFileMime(y.name),size:E&&E.length||y.size||0,name:y.name||"",meta:null},_&&(t.meta=v&&v.meta||this.meta||{},!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof r||(t.meta.thumb.data=new r(null,{type:"image/jpeg",data:t.meta.thumb.data}))),t},resize:function(t,i,n){var r=document.createElement("canvas");if(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(e(),t.x,t.y,t.width,t.height,0,0,r.width,r.height),x=s.scale(r,i),_=n.preserveHeaders,!_){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;x=m(x,o)}this.width=x.width,this.height=x.height,w=!0,this.trigger("Resize")},getAsCanvas:function(){return x||(x=u()),x.id=this.uid+"_canvas",x},getAsBlob:function(e,t){return e!==this.type?(w=!0,new o(null,{name:y.name||"",type:e,data:b.getAsDataURL(e,t)})):new o(null,{name:y.name||"",type:e,data:b.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!w)return g.src;if(u(),"image/jpeg"!==e)return x.toDataURL("image/png");try{return x.toDataURL("image/jpeg",t/100)}catch(i){return x.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!w)return E||(E=c(b.getAsDataURL(e,t))),E;if("image/jpeg"!==e)E=c(b.getAsDataURL(e,t));else{var i;t||(t=90),u();try{i=x.toDataURL("image/jpeg",t/100)}catch(n){i=x.toDataURL("image/jpeg")}E=c(i),v&&(E=v.stripHeaders(E),_&&(v.meta&&v.meta.exif&&v.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),E=v.writeHeaders(E)),v.purge(),v=null)}return w=!1,E},destroy:function(){b=null,h.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=u}),n("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function s(e){var n=i.get(e);n&&"OBJECT"==n.nodeName&&("IE"===t.browser?(n.style.display="none",function r(){4==n.readyState?l(e):setTimeout(r,10)}()):n.parentNode.removeChild(n))}function l(e){var t=i.get(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function u(l){var u,p=this;l=e.extend({swf_url:t.swf_url},l),o.call(this,l,c,{access_binary:function(e){return e&&"browser"===p.mode},access_image_binary:function(e){return e&&"browser"===p.mode},display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===p.mode},resize_image:o.capTrue,return_response_headers:!1,return_response_type:function(t){return!("json"!==t||!window.JSON)||(!e.arrayDiff(t,["","text","document"])||"browser"===p.mode)},return_status_code:function(t){return"browser"===p.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:function(e){return e&&"browser"===p.mode},send_browser_cookies:function(e){return e&&"browser"===p.mode},send_custom_headers:function(e){return e&&"browser"===p.mode},send_multipart:o.capTrue,slice_blob:function(e){return e&&"browser"===p.mode},stream_upload:function(e){return e&&"browser"===p.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===p.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),a()<11.3&&(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return p.getShim().exec(this.uid,e,t,i)},init:function(){var i,r,a;a=this.getShimContainer(),e.extend(a.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),i='',"IE"===t.browser?(r=document.createElement("div"),a.appendChild(r),r.outerHTML=i,r=a=null):a.innerHTML=i,u=setTimeout(function(){p&&!p.initialized&&p.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){s(p.uid),e.call(p),clearTimeout(u),l=u=e=p=null}}(this.destroy)},d)}var c="flash",d={};return o.addConstructor(c,u),d}),n("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={slice:function(e,i,n,r){var o=this.getRuntime();return 0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),e=o.shimExec.call(this,"Blob","slice",i,n,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=i}),n("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){var r={init:function(e){var r=this,o=this.getRuntime(),a=i.get(e.browse_button);a&&(a.setAttribute("tabindex",-1),a=null),this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],n.each(e,function(e){r.files.push(new t(o.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=r}),n("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n=this;return n.result="","readAsDataURL"===e&&(n.result="data:"+(t.type||"")+";base64,"),n.bind("Progress",function(t,r){r&&(n.result+=i(r,e))},999),n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=n}),n("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n,r=this.getRuntime();return(n=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(n="data:"+(t.type||"")+";base64,"+n),i(n,e,t.type)):null}};return e.FileReaderSync=n}),n("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={getAsBlob:function(e){var i=this.getRuntime(),n=i.shimExec.call(this,"Transporter","getAsBlob",e);return n?new t(i.uid,n):null}};return e.Transporter=i}),n("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,t,i,n,r,o,a,s){var l={send:function(e,n){function r(){e.transport=c.mode,c.shimExec.call(u,"XMLHttpRequest","send",e,n)}function o(e,t){c.shimExec.call(u,"XMLHttpRequest","appendBlob",e,t.uid),n=null,r()}function l(e,t){var i=new s;i.bind("TransportingComplete",function(){t(this.result)}),i.transport(e.getSource(),e.type,{ruid:c.uid})}var u=this,c=u.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){c.shimExec.call(u,"XMLHttpRequest","setRequestHeader",t,e.toString())}),n instanceof a){var d;if(n.each(function(e,t){e instanceof i?d=t:c.shimExec.call(u,"XMLHttpRequest","append",t,e)}),n.hasBlob()){var p=n.getBlob();p.isDetached()?l(p,function(e){p.destroy(),o(d,e)}):o(d,p)}else n=null,r()}else n instanceof i?n.isDetached()?l(n,function(e){n.destroy(),n=e.uid,r()}):(n=n.uid,r()):r()},getResponse:function(e){var i,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new n(a.uid,o),"blob"===e)return o;try{if(i=new r,~t.inArray(e,["","text"]))return i.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(i.readAsText(o))}finally{o.destroy()}}return null},abort:function(){var e=this.getRuntime();e.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=l}),n("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,i,n,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(n,"Image","loadFromBlob",e.uid),n=r=null}var n=this,r=n.getRuntime();if(e.isDetached()){var o=new i;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return t.meta&&t.meta.thumb&&t.meta.thumb.data&&!(e.meta.thumb.data instanceof n)&&(t.meta.thumb.data=new n(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var i=this.getRuntime(),r=i.shimExec.call(this,"Image","getAsBlob",e,t);return r?new n(i.uid,r):null},getAsDataURL:function(){var e,t=this.getRuntime(),i=t.Image.getAsBlob.apply(this,arguments);return i?(e=new r,e.readAsDataURL(i)):null}};return e.Image=o}),n("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(e){var t,i,n,r,o,a=!1,s=null,l=0;try{try{s=new ActiveXObject("AgControl.AgControl"),s.IsVersionSupported(e)&&(a=!0),s=null}catch(u){var c=navigator.plugins["Silverlight Plug-In"];if(c){for(t=c.description,"1.0.30226.2"===t&&(t="2.0.30226.2"),i=t.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(n=e.split(".");n.length>4;)n.pop();do r=parseInt(n[l],10),o=parseInt(i[l],10),l++;while(l=r&&!isNaN(r)&&(a=!0)}}}catch(d){a=!1}return a}function s(s){var c,d=this;s=e.extend({xap_url:t.xap_url},s),o.call(this,s,l,{access_binary:o.capTrue,access_image_binary:o.capTrue,display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:o.capTrue,resize_image:o.capTrue,return_response_headers:function(e){return e&&"client"===d.mode},return_response_type:function(e){return"json"!==e||!!window.JSON},return_status_code:function(t){return"client"===d.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:o.capTrue,send_browser_cookies:function(e){return e&&"browser"===d.mode},send_custom_headers:function(e){return e&&"client"===d.mode},send_multipart:o.capTrue,slice_blob:o.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:o.capTrue,use_http_method:function(t){return"client"===d.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),a("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(e,t){var i=[].slice.call(arguments,2);return d.getShim().exec(this.uid,e,t,i)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='',c=setTimeout(function(){d&&!d.initialized&&d.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(d),clearTimeout(c),s=c=e=d=null}}(this.destroy)},u)}var l="silverlight",u={};return o.addConstructor(l,s),u}),n("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){ +return e.Blob=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){function r(e){for(var t="",i=0;ii;i++)t=s.keys[i],a=s[t],a&&(/^(\d|[1-9]\d+)$/.test(a)?a=parseInt(a,10):/^\d*\.\d+$/.test(a)&&(a=parseFloat(a)),r.meta[e][t]=a)}),r.meta&&r.meta.thumb&&r.meta.thumb.data&&!(e.meta.thumb.data instanceof i)&&(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,l=i.capTest,u=i.capTrue;i.call(this,t,a,{access_binary:l(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:l((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:l(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return s.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return!("json"!==t||!window.JSON)||!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:u,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html4",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){function e(){var o,u,d,p,f,m,h=this,g=h.getRuntime();m=i.guid("uid_"),o=g.getShimContainer(),s&&(d=n.get(s+"_form"),d&&(i.extend(d.style,{top:"100%"}),d.firstChild.setAttribute("tabindex",-1))),p=document.createElement("form"),p.setAttribute("id",m+"_form"),p.setAttribute("method","post"),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),i.extend(p.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),f=document.createElement("input"),f.setAttribute("id",m),f.setAttribute("type","file"),f.setAttribute("accept",c.join(",")),g.can("summon_file_dialog")&&f.setAttribute("tabindex",-1),i.extend(f.style,{fontSize:"999px",opacity:0}),p.appendChild(f),o.appendChild(p),i.extend(f.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&i.extend(f.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),f.onchange=function(){var i;this.value&&(i=this.files?this.files[0]:{name:this.value},i=new t(g.uid,i),this.onchange=function(){},e.call(h),h.files=[i],f.setAttribute("id",i.uid),p.setAttribute("id",i.uid+"_form"),h.trigger("change"),f=p=null)},g.can("summon_file_dialog")&&(u=n.get(l.browse_button),r.removeEvent(u,"click",h.uid),r.addEvent(u,"click",function(e){f&&!f.disabled&&f.click(),e.preventDefault()},h.uid)),s=m,o=d=u=null}var s,l,u,c=[];i.extend(this,{init:function(t){var i,a=this,s=a.getRuntime();l=t,c=o.extList2mimes(t.accept,s.can("filter_by_extension")),i=s.getShimContainer(),function(){var e,o,c;e=n.get(t.browse_button),u=n.getStyle(e,"z-index")||"auto",s.can("summon_file_dialog")?("static"===n.getStyle(e,"position")&&(e.style.position="relative"),a.bind("Refresh",function(){o=parseInt(u,10)||1,n.get(l.browse_button).style.zIndex=o,this.getRuntime().getShimContainer().style.zIndex=o-1})):e.setAttribute("tabindex",-1),c=s.can("summon_file_dialog")?e:i,r.addEvent(c,"mouseover",function(){a.trigger("mouseenter")},a.uid),r.addEvent(c,"mouseout",function(){a.trigger("mouseleave")},a.uid),r.addEvent(c,"mousedown",function(){a.trigger("mousedown")},a.uid),r.addEvent(n.get(t.container),"mouseup",function(){a.trigger("mouseup")},a.uid),e=null}(),e.call(this),i=null,a.trigger({type:"ready",async:!0})},setOption:function(e,t){var i,r=this.getRuntime();"accept"==e&&(c=t.mimes||o.extList2mimes(t,r.can("filter_by_extension"))),i=n.get(s),i&&i.setAttribute("accept",c.join(","))},disable:function(e){var t;(t=n.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),o=l&&n.get(l.container),a=l&&n.get(l.browse_button);o&&r.removeAllEvents(o,this.uid),a&&(r.removeAllEvents(a,this.uid),a.style.zIndex=u),i&&(r.removeAllEvents(i,this.uid),i.innerHTML=""),t.removeInstance(this.uid),s=c=l=i=o=a=t=null}})}return e.FileInput=s}),n("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),n("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,t,i,n,r,o,a,s){function l(){function e(e){var t,n,r,a,s=this,l=!1;if(c){if(t=c.id.replace(/_iframe$/,""),n=i.get(t+"_form")){for(r=n.getElementsByTagName("input"),a=r.length;a--;)switch(r[a].getAttribute("type")){case"hidden":r[a].parentNode.removeChild(r[a]);break;case"file":l=!0}r=[],l||n.parentNode.removeChild(n),n=null}setTimeout(function(){o.removeEvent(c,"load",s.uid),c.parentNode&&c.parentNode.removeChild(c);var t=s.getRuntime().getShimContainer();t.children.length||t.parentNode.removeChild(t),t=c=null,e()},1)}}var l,u,c;t.extend(this,{send:function(d,p){function f(){var i=E.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='',c=r.firstChild,i.appendChild(c),o.addEvent(c,"load",function(){var i;try{i=c.contentWindow.document||c.contentDocument||window.frames[c.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?l=i.title.replace(/^(\d+).*$/,"$1"):(l=200,u=t.trim(i.body.innerHTML),x.trigger({type:"progress",loaded:u.length,total:u.length}),v&&x.trigger({type:"uploadprogress",loaded:v.size||1025,total:v.size||1025}))}catch(r){if(!n.hasSameOrigin(d.url))return void e.call(x,function(){x.trigger("error")});l=404}e.call(x,function(){x.trigger("load")})},x.uid)}var m,h,g,v,x=this,E=x.getRuntime();if(l=u=null,p instanceof s&&p.hasBlob()){if(v=p.getBlob(),m=v.uid,g=i.get(m),h=i.get(m+"_form"),!h)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else m=t.guid("uid_"),h=document.createElement("form"),h.setAttribute("id",m+"_form"),h.setAttribute("method",d.method),h.setAttribute("enctype","multipart/form-data"),h.setAttribute("encoding","multipart/form-data"),E.getShimContainer().appendChild(h);h.setAttribute("target",m+"_iframe"),p instanceof s&&p.each(function(e,i){if(e instanceof a)g&&g.setAttribute("name",i);else{var n=document.createElement("input");t.extend(n,{type:"hidden",name:i,value:e}),g?h.insertBefore(n,g):h.appendChild(n)}}),h.setAttribute("action",d.url),f(),h.submit(),x.trigger("loadstart")},getStatus:function(){return l},getResponse:function(e){if("json"===e&&"string"===t.typeOf(u)&&window.JSON)try{return JSON.parse(u.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return u},abort:function(){var t=this;c&&c.contentWindow&&(c.contentWindow.stop?c.contentWindow.stop():c.contentWindow.document.execCommand?c.contentWindow.document.execCommand("Stop"):c.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})},destroy:function(){this.getRuntime().getShim().removeInstance(this.uid)}})}return e.XMLHttpRequest=l}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)}),!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.plupload};"function"==typeof define&&define.amd?define("plupload",["./moxie"],i):"object"==typeof module&&module.exports?module.exports=i(require("./moxie")):e.plupload=i(e.moxie)}(this||window,function(e){!function(e,t,i){function n(e){function t(e,t,i){var r={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};r[e]?n[r[e]]=t:i||(n[e]=t)}var i=e.required_features,n={};return"string"==typeof i?l.each(i.split(/\s*,\s*/),function(e){t(e,!0)}):"object"==typeof i?l.each(i,function(e,i){t(i,e)}):i===!0&&(e.chunk_size&&e.chunk_size>0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart!==!1||(n.send_binary_string=!0),e.http_method&&(n.use_http_method=e.http_method),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,o={},a=t.core.utils,s=t.runtime.Runtime,l={VERSION:"2.3.6",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,moxie:t,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=s.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){o[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),void i(!1);i(!0)}),l.addFileFilter("prevent_empty",function(e,t,n){e&&!t.size&&t.size!==i?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),n(!1)):n(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t0?Math.ceil(100*(e.loaded/e.size)):100,c()}function c(){var e,t,n,r=0;for(S.reset(),e=0;eI)&&(r+=n),S.loaded+=n):S.size=i,t.status==l.DONE?S.uploaded++:t.status==l.FAILED?S.failed++:S.queued++;S.size===i?S.percent=O.length>0?Math.ceil(100*(S.uploaded/O.length)):0:(S.bytesPerSec=Math.ceil(r/((+new Date-I||1)/1e3)),S.percent=S.size>0?Math.ceil(100*(S.loaded/S.size)):0)}function d(){var e=F[0]||C[0];return!!e&&e.getRuntime().uid}function p(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",y),this.bind("BeforeUpload",g),this.bind("UploadFile",v),this.bind("UploadProgress",x),this.bind("StateChanged",E),this.bind("QueueChanged",c),this.bind("Error",w),this.bind("FileUploaded",b),this.bind("Destroy",_)}function f(e,i){var n=this,r=0,o=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:D,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){o.push(function(o){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=s.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,F.push(this),o()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){N||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,o()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){o.push(function(i){var o=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));o.onready=function(){var e=s.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,C.push(this),i()},o.ondrop=function(){n.addFile(this.files)},o.bind("error runtimeerror",function(){o=null,i()}),o.init()})}),l.inSeries(o,function(){"function"==typeof i&&i(r)})}function m(e,n,r,o){var a=new t.image.Image;try{a.onload=function(){n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),o(e)):a.downsize(n.width,n.height,n.crop,n.preserve_headers)},a.onresize=function(){var t=this.getAsBlob(e.type,n.quality);this.destroy(),o(t)},a.bind("error runtimeerror",function(){this.destroy(),o(e)}),a.load(e,r)}catch(s){o(e)}}function h(e,i,r){function o(e,i,n){var r=R[e];switch(e){case"max_file_size":"max_file_size"===e&&(R.max_file_size=R.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(R[e]=i,R.send_file_name=!0);break;case"multipart":R[e]=i,i||(R.send_file_name=!0);break;case"http_method":R[e]="PUT"===i.toUpperCase()?"PUT":"POST";break;case"unique_names":R[e]=i,i&&(R.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(R.filters,i):R.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),R.filters.mime_types=i.mime_types);break;case"resize":R.resize=!!i&&l.extend({preserve_headers:!0,crop:!1},i);break;case"prevent_duplicates":R.prevent_duplicates=R.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":R[e]=i,n||(u=!0);break;default:R[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){o(t,e,r)}):o(e,i,r),r?(R.required_features=n(l.extend({},R)),D=n(l.extend({},R,{required_features:!0}))):u&&(a.trigger("Destroy"),f.call(a,R,function(e){e?(a.runtime=s.getInfo(d()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function g(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function v(e,i){function n(){d-- >0?r(o,1e3):(i.loaded=f,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()}))}function o(){var t,n,r={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(r.name=i.target_name||i.name),c&&p.chunks&&s.size>c?(n=Math.min(c,s.size-f),t=s.slice(f,f+n)):(n=s.size,t=s),c&&p.chunks&&(e.settings.send_chunk_number?(r.chunk=Math.ceil(f/c),r.chunks=Math.ceil(s.size/c)):(r.offset=f,r.total=s.size)),e.trigger("BeforeChunkUpload",i,r,t,f)&&a(r,t,n))}function a(a,c,m){var g;T=new t.xhr.XMLHttpRequest,T.upload&&(T.upload.onprogress=function(t){i.loaded=Math.min(i.size,f+t.loaded),e.trigger("UploadProgress",i)}),T.onload=function(){return T.status<200||T.status>=400?void n():(d=e.settings.max_retries,m=s.size?(i.size!=i.origSize&&(s.destroy(),s=null),e.trigger("UploadProgress",i),i.status=l.DONE,i.completeTimestamp=+new Date,e.trigger("FileUploaded",i,{response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()})):r(o,1)))},T.onerror=function(){n()},T.onloadend=function(){this.destroy()},e.settings.multipart&&p.multipart?(T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),g=new t.xhr.FormData,l.each(l.extend(a,e.settings.multipart_params),function(e,t){g.append(t,e)}),g.append(e.settings.file_data_name,c),T.send(g,h)):(u=l.buildUrl(e.settings.url,l.extend(a,e.settings.multipart_params)),T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),T.hasRequestHeader("Content-Type")||T.setRequestHeader("Content-Type","application/octet-stream"),T.send(c,h))}var s,u=e.settings.url,c=e.settings.chunk_size,d=e.settings.max_retries,p=e.features,f=0,h={runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:D,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url};i.loaded&&(f=i.loaded=c?c*Math.floor(i.loaded/c):0),s=i.getSource(),l.isEmptyObj(e.settings.resize)||-1===l.inArray(s.type,["image/jpeg","image/png"])?o():m(s,e.settings.resize,h,function(e){s=e,i.size=e.size,o()})}function x(e,t){u(t)}function E(e){if(e.state==l.STARTED)I=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,c())}function y(){T&&T.abort()}function b(e){c(),r(function(){a.call(e)},1)}function w(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,t.file.completeTimestamp=+new Date,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function _(e){e.stop(),l.each(O,function(e){e.destroy()}),O=[],F.length&&(l.each(F,function(e){e.destroy()}),F=[]),C.length&&(l.each(C,function(e){e.destroy()}),C=[]),D={},N=!1,I=T=null,S.reset()}var R,I,S,T,A=l.guid(),O=[],D={},F=[],C=[],N=!1;R={chunk_size:0,file_data_name:"file",filters:{mime_types:[],max_file_size:0,prevent_duplicates:!1,prevent_empty:!0},flash_swf_url:"js/Moxie.swf",http_method:"POST",max_retries:0,multipart:!0,multi_selection:!0,resize:!1,runtimes:s.order,send_file_name:!0,send_chunk_number:!0,silverlight_xap_url:"js/Moxie.xap"},h.call(this,e,null,!0),S=new l.QueueProgress,l.extend(this,{id:A,uid:A,state:l.STOPPED,features:{},runtime:null,files:O,settings:R,total:S,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),p.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):R.browse_button||R.drop_element?void f.call(i,R,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=s.getInfo(d()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){h.call(this,e,t,!this.runtime)},getOption:function(e){return e?R[e]:R},refresh:function(){F.length&&l.each(F,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){N=arguments[0]===i||arguments[0],F.length&&l.each(F,function(e){e.disable(N)}),this.trigger("DisableBrowse",N)},getFile:function(e){var t;for(t=O.length-1;t>=0;t--)if(O[t].id===e)return O[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){o[n]&&i.push(function(i){o[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var o=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!s)return!1;e.ruid=s,e.connectRuntime(s)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),c.push(function(t){n(e,function(i){i||(O.push(e),p.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(o,["file","blob"])?a(new t.file.File(null,e)):"node"===o&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===o&&(i=null,l.each(e,a))}var s,u=this,c=[],p=[];s=d(),a(e),c.length&&l.inSeries(c,function(){p.length&&u.trigger("FilesAdded",p)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=O.length-1;i>=0;i--)if(O[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=O.splice(e===i?0:e,t===i?O.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n
      0KB
      ',l={rename:!0,renameByClick:!0,dropPlaceholder:!0,previewImageIcon:!0,sendFileName:!0,sendFileId:!0,responseHandler:!0,uploadedMessage:!0,drop_element:"self",browse_button:"hidden",filters:{prevent_duplicates:!0},chunk_size:"1mb",max_retries:3,flash_swf_url:"lib/uploader/Moxie.swf",silverlight_xap_url:"lib/uploader/Moxie.xap"},u={QUEUED:i.QUEUED,UPLOADING:i.UPLOADING,FAILED:i.FAILED,DONE:i.DONE,STOPPED:i.STOPPED,STARTED:i.STARTED};u[i.QUEUED]="queue",u[i.UPLOADING]="uploading",u[i.FAILED]="failed",u[i.DONE]="done";var c={GENERIC_ERROR:i.GENERIC_ERROR,HTTP_ERROR:i.HTTP_ERROR,IO_ERROR:i.IO_ERROR,SECURITY_ERROR:i.SECURITY_ERROR,INIT_ERROR:i.INIT_ERROR,FILE_SIZE_ERROR:i.FILE_SIZE_ERROR,FILE_EXTENSION_ERROR:i.FILE_EXTENSION_ERROR,FILE_DUPLICATE_ERROR:i.FILE_DUPLICATE_ERROR,IMAGE_FORMAT_ERROR:i.IMAGE_FORMAT_ERROR,IMAGE_MEMORY_ERROR:i.IMAGE_MEMORY_ERROR,IMAGE_DIMENSIONS_ERROR:i.IMAGE_DIMENSIONS_ERROR},d=function(n,l){var u=this;u.name=a,u.$=e(n).addClass("uploader"),l=u.getOptions(l);var c=e.isPlainObject(l.lang)?e.extend(!0,{},d.LANG[c.lang||e.zui.clientLang()],l.lang):d.LANG[l.lang];u.lang=c;var p,f=u.$,m=l.fileList;p=m&&"large"!=m&&"grid"!=m?0===m.indexOf(">")?f.find(m.substr(1)):e(m):f.find(".file-list,.uploader-files"),p&&p.length||(p=e('
      ')),p.parent().length||f.append(p),"large"==m?p.addClass("file-list-lg"):"grid"==m&&p.addClass("file-list-grid"),p.children(".file").addClass("file-static"),u.$list=p,(l.browseByClickList||p.hasClass("uploader-btn-browse"))&&p.addClass("uploader-btn-browse").on("click",".file-wrapper > .actions,.file-renaming .file-name",function(e){e.stopPropagation()});var h=l.fileTemplate;if(!h){var g=p.find(".template");g.length&&(h=g.first().clone().removeClass("template"),g.remove()),h||(h=s)}"string"==typeof h&&(h=e(h),h.parent()&&(h=h.clone().removeClass("template"))),u.template=h;var v=l.browse_button,x=null; +v&&(0===v.indexOf(">")?x=f.find(v.substr(1)):"hidden"!==v&&(x=e(v))),x&&x.length||(x=e('
      ').appendTo(f)),u.$button=x.first();var E=l.drop_element,y=("fileList"==E?u.$list:"self"==E?u.$:e(E)).first().addClass("file-drag-area");if(o)y.attr("data-drop-placeholder","");else{var b=l.dropPlaceholder;b===!0&&(b=c.dropPlaceholder),b&&y.attr("data-drop-placeholder",b)}u.$dropElement=y,u.$message=f.find(".uploader-message").on("click",".close",function(){u.hideMessage()}),u.$status=f.find(".uploader-status"),f.toggleClass("uploader-rename",!!l.rename),u.initPlupload(),f.on("click."+a,".uploader-btn-start",function(e){u.start()}).on("click."+a,".uploader-btn-browse",function(t){e(this).is(u.$button)||u.$button.trigger("click")}).on("click."+a,".uploader-btn-stop",function(e){u.stop()}),e("body").on("dragleave."+a+" drop."+a,function(e){f.removeClass("file-dragable"),e.preventDefault(),e.stopPropagation()}).on("dragover."+a+" dragenter."+a,function(e){f.addClass("file-dragable")}),y.on("dragleave."+a+" drop."+a,function(e){f.removeClass("file-drag-enter")}).on("dragover."+a+" dragenter."+a,function(e){f.addClass("file-drag-enter")}),p.on("click."+a,".btn-delete-file",function(){var n=e(this).closest(".file"),r=n.data("file"),o=l.deleteActionOnDone,a=r.status===i.DONE&&e.isFunction(o);if(r.status===i.QUEUED||r.status===i.FAILED||a){var s=function(){u.removeFile(r)},d=function(){if(a){var e=o.call(u,r,s);e===!0&&s()}else s()},p=l.deleteConfirm;if(p){var f=e.isFunction(p)?p(r):p===!0?c.deleteConfirm:p;f=f.format(r),t.bootbox?t.bootbox.confirm(f,function(e){e&&d()}):t.confirm(f)&&d()}else d()}}).on("click."+a,".btn-reset-file",function(){var t=e(this).closest(".file"),n=u.plupload.getFile(t.data("id"))||t.data("file");n.status===i.FAILED&&(n.status=i.QUEUED,u.showFile(n),l.autoUpload&&u.start())}),l.rename&&(p.toggleClass("file-rename-by-click",!!l.renameByClick).toggleClass("file-show-rename-action-on-done",!!l.renameActionOnDone),p.on("click."+a,".btn-rename-file"+(l.renameByClick?",.file-name":""),function(){var t=e(this).closest(".file");if(!t.hasClass("file-renaming")){var n=u.plupload.getFile(t.data("id"))||t.data("file"),o=l.renameActionOnDone,s=n.status===i.DONE&&e.isFunction(o);if(s||n.status===i.QUEUED){var c=t.find(".file-name").first();t.addClass("file-renaming"),u.showFile(n),!l.renameExtension&&n.ext&&c.text(n.name.substr(0,n.name.length-n.ext.length-1)),c.attr("contenteditable","true").one("blur",function(){var i=e.trim(c.text()),d=function(){if(i!==r&&null!==i&&""!==i){var e=n.ext;e.length&&!l.renameExtension&&i.lastIndexOf("."+e)!==i.length-e.length-1&&(i+="."+e),n.name=i}u.showFile(n)};if(s){var p=o.call(u,n,i,d);p===!0?d():p===!1&&u.showFile(n)}else d();t.removeClass("file-renaming"),c.off("keydown."+a).attr("contenteditable",null)}).on("keydown."+a,function(e){13===e.keyCode&&(c.blur(),e.preventDefault())}).focus()}}})),p.toggleClass("file-show-delete-action-on-done",!!l.deleteActionOnDone),u.staticFilesSize=0,u.staticFilesCount=0,l.staticFiles&&e.each(l.staticFiles,function(t,n){n=e.extend({status:i.DONE},n),n["static"]=!0,n.id||(n.id=e.zui.uuid()),u.showFile(n),n.size&&(u.staticFilesSize+=n.size,u.staticFilesCount++)}),u.callEvent("onInit")};d.DEFAULTS=l,d.prototype.showMessage=function(e,t,i){var n=this,o=n.$message;e?clearTimeout(n.lastDismissMessage):n.hideMessage(),t=t||"danger",i===r&&(i="danger"===t?10:6),i<20&&(i*=1e3);var a=o.find(".content");a.length?a.empty().append(e):o.empty().append(e),o.attr("data-type",t).slideDown("fast"),i&&(n.lastDismissMessage=setTimeout(function(){n.hideMessage()},i))},d.prototype.hideMessage=function(){clearTimeout(this.lastDismissMessage),this.$message.slideUp("fast")},d.prototype.start=function(){return this.options.autoResetFails&&e.each(this.getFiles(),function(e,t){t.status===i.FAILED&&(t.status=i.QUEUED)}),this.plupload.start()},d.prototype.stop=function(){return this.plupload.stop()},d.prototype.getState=function(){return this.plupload.state},d.prototype.isStarted=function(){return this.getState()===i.STARTED},d.prototype.isStopped=function(){return this.getState()===i.STOPPED},d.prototype.getFiles=function(){return this.plupload.files},d.prototype.getTotal=function(){return this.plupload.total},d.prototype.disableBrowse=function(e){return this.$.find(".uploader-btn-browse").attr("disable",e?"disable":null).toggle("disable",!!e),this.plupload.disableBrowse()},d.prototype.getFile=function(e){return this.plupload.getFile(e)},d.prototype.destroy=function(){var t=this,i="."+a;t.$.off(i).data(a,null),t.$list.off(i),t.$dropElement.off(i),e("body").off(i),t.plupload.destroy()},d.prototype.previewImageSrc=function(t,i){if(t&&t.getSource&&/image\//.test(t.type)){var r=e.extend({width:200,height:200},this.options.previewImageSize);if("image/gif"==t.type){var o=new n.file.FileReader;o.onload=function(){i(o.result),o.destroy(),o=null},o.readAsDataURL(t.getSource())}else{var a=new n.image.Image;a.onload=function(){a.downsize(r.width,r.height);var e="image/jpeg"==a.type?a.getAsDataURL("image/jpeg",80):a.getAsDataURL();i(e),a.destroy(),a=null},a.load(t.getSource())}}},d.prototype.createFileIcon=function(e){var t=e.type,i=e.ext,n="file-o",r=t?t.split("/"):null,o=r&&r.length?r[0]:"",a=(r&&r.length)>1?r[1]:"";return"image"==o?n="file-image":"doc"==i||"docx"==i||"pages"==i?n="file-word":"ppt"==i||"pptx"==i||"key"==i?n="file-powerpoint":"xls"==i||"xlsx"==i||"numbers"==i?n="file-excel":"html"==i||"htm"==i?n="globe":"js"==i||"php"==i||"cs"==i||"jsx"==i||"css"==i||"less"==i||"json"==i||"java"==i||"lua"==i||"py"==i||"c"==i||"cpp"==i||"swift"==i||"h"==i||"sh"==i||"rb"==i||"yml"==i||"ini"==i||"sql"==i||"xml"==i?n="file-code":"apk"==i?n="android":"exe"==i?n="windows":"pkg"==i||"msi"==i||"dmg"==i?n="cube":"epub"==i?n="book":"sketch"==i?n="diamond":"zip"==a||"x-rar"==a||"x-7z-compressed"==a?n="file-archive":"pdf"==a?n="file-pdf":"video"==o?n="file-movie":"audio"==o?n="file-audio":"text"==o&&(n="file-text-o"),'"},d.prototype.getFileItem=function(t){var i=this;if("string"==typeof t&&(t=i.plupload.getFile(t)),!t)return null;var n=t.name;if(n&&t.ext===r){var o=n.lastIndexOf(".");o=o>-1?n.substr(o+1):"",t.ext=o,t.type&&/image\//.test(t.type)&&(t.isImage=t.ext)}var a=e("#file-"+t.id);return a.length||(e.isFunction(i.template)?a=e(i.template(t,i)):(a=e(i.template).clone(),a.find(".btn-rename-file").attr("title",i.lang.rename),a.find(".btn-delete-file").attr("title",i.lang.remove),a.find(".btn-reset-file").attr("title",i.lang.repeat),a.find(".btn-download-file").attr("title",i.lang.download).attr("download",t.name)),a.data("id",t.id).toggleClass("file-static",!!t["static"]).attr("id","file-"+t.id).appendTo(i.$list),e.fn.tooltip&&a.find('[data-toggle="tooltip"]').tooltip()),a},d.prototype.showFile=function(t,n){var r=this;if(e.isArray(t))return void e.each(t,function(e,t){r.showFile(t,n)});if("string"==typeof t&&(t=r.plupload.getFile(t)),t){var o=r.getFileItem(t);if(o&&o.length){var a=r.options,s=u[t.status];if(a.fileFormater)a.fileFormater.call(r,o,t,s);else{var l="done"==s&&t.url?t.url:null;o.find(".file-name").text(t.name),o.find(".file-size").text(("uploading"==s?i.formatSize(Math.floor(t.size*t.percent/100)).toUpperCase()+"/":"")+i.formatSize(t.size).toUpperCase()),o.find(".file-icon").html(a.fileIconCreator?a.fileIconCreator(t.type,t,r):r.createFileIcon(t)).css("color","hsl("+e.zui.strCode(t.type||t.ext)+", 70%, 40%)"),o.find(".file-progress-bar").css("width",t.percent+"%");var c=o.find(".file-status").attr("title",r.lang[s]);c.find(".text").text("uploading"==s?t.percent+"%":"failed"==s?r.lang[s]:""),e.fn.tooltip&&o.find('[data-toggle="tooltip"]').tooltip("fixTitle"),o.find("a.btn-download-file, a.file-name").attr("href",l)}if(a.previewImageIcon&&t.isImage){var d=function(){o.find(".file-icon").html('
      ')};t.previewImage?d():r.previewImageSrc(t,function(e){t.previewImage=e,d()})}o.attr("data-status",s).data("file",t)}}},d.prototype.showStatus=function(){var t=this,n=t.plupload,r=t.$status,o=n.state,a=n.total,s="",l=n.files.length;if(t.options.statusCreator)s=t.options.statusCreator(a,o,t);else{var u={uploading:Math.max(0,Math.min(l,a.uploaded+1)),total:t.staticFilesCount+l,size:i.formatSize(a.size+t.staticFilesSize).toUpperCase(),queue:a.queued,failed:a.failed,uploaded:a.uploaded,uploadedSize:i.formatSize(a.loaded).toUpperCase(),percent:a.percent,speed:i.formatSize(a.bytesPerSec).toUpperCase()+"/S"};s=o==i.STARTED?t.lang.startedStatusText.format(u):l<1?t.lang.initStatusText:t.lang.stoppedStatusText.format(u)}r.html(s),a.uploaded<1&&r.find(".uploader-status-uploaded").remove(),a.failed<1&&r.find(".uploader-status-failed").remove(),a.queued<1&&r.find(".uploader-status-queue").remove(),e.fn.tooltip&&r.find('[data-toggle="tooltip"]').tooltip()},d.prototype.delayShowStatus=function(e){var t=this;t.delayStatusTask||(t.delayStatusTask=!0,e===r&&(e=500),t.delayStatusTask=setTimeout(function(){t.showStatus(),t.delayStatusTask=!1},e))},d.prototype.removeFile=function(t,i){var n=this;if("string"==typeof t&&(t=n.plupload.getFile(t)),i||t["static"]){var r=e("#file-"+t.id);e.fn.tooltip&&(r.find('[data-toggle="tooltip"]').tooltip("destroy"),e(".tooltip").remove()),r.fadeOut(function(){e(this).remove()})}else n.plupload.removeFile(t)},d.prototype.initPlupload=function(){var n=this,o=n.options,a=e.extend({},o,{browse_button:n.$button[0],container:n.$[0],drop_element:n.$dropElement[0],multipart_params:null}),s={FilesAdded:function(e,t){var i=o.limitFilesCount;if(i){i===!0&&(i=1);var r=n.$list.children(".file").length;if(r+t.length>i){n.showMessage(n.lang.limitFilesCountMessage.format({count:i}),"warning");for(var a=[],s=0;s"+u.join(",")+"

      ":"",d={uploaded:s,failed:l};c+="string"==typeof a?a.format(d):e.isFunction(a)?a(d):n.lang[l>0?"uploadHasFailedMessage":s>0?"uploadSuccessMessage":"uploadEmptyMessage"].format(d),n.showMessage(c,l>0?"danger":s>0?"success":"warning",3)}n.callEvent("onUploadComplete",[r])},FilesRemoved:function(t,i){e.each(i,function(e,t){n.removeFile(t,!0)}),n.showStatus(),n.callEvent("onFilesRemoved",i)},ChunkUploaded:function(e,t,i){n.callEvent("onChunkUploaded",[t,i])},UploadFile:function(e,t){n.showStatus(),n.callEvent("onUploadFile",t)},BeforeUpload:function(t,i){var r=t.getOption("multipart_params"),a=o.multipart_params,s={};r&&r.key&&(s.key=r.key),r&&r.token&&(s.token=r.token),o.sendFileName&&(s[o.sendFileName===!0?"name":o.sendFileName]=i.name),o.sendFileId&&(s[o.sendFileId===!0?"uuid":o.sendFileId]=i.id),s=e.extend(s,e.isFunction(a)?a(i,s):a),t.setOption("multipart_params",s),n.callEvent("onBeforeUpload",i)},Refresh:function(e){n.showStatus(),n.callEvent("onRefresh")},StateChanged:function(e){e.state===i.STARTED&&(n.lastUploadedCount=0),n.$.toggleClass("uploader-started",i.STARTED===e.state),n.hideMessage(),n.showStatus(),n.callEvent("onStateChanged",e.state)},QueueChanged:function(e){n.showStatus(),n.callEvent("onQueueChanged")},Error:function(e,t){var r="danger";t.code!==i.FILE_SIZE_ERROR&&t.code!==i.FILE_SIZE_ERROR&&t.code!==i.FILE_EXTENSION_ERROR&&t.code!==i.FILE_DUPLICATE_ERROR&&t.code!==i.MAGE_FORMAT_ERROR||(r="warning"),n.showMessage(t.message,r),n.callEvent("onError",t)}};if(i.addI18n(n.lang.i18n),n.qiniuEnable=e.isPlainObject(o.qiniu)&&t.Qiniu,n.qiniuEnable){var l=o.qiniu,u=l.key;delete a.qiniu,u?(delete l.key,e.isFunction(u)&&(s.Key=u)):s.Key=function(e,t){return t.name},l.init=s,a=e.extend(a,l);var c=new QiniuJsSDK,d=c.uploader(a);n.plupload=d}else{var d=new i.Uploader(a);d.init(),n.plOptions=a,n.plupload=d,e.each(s,function(e,t){d.bind(e,t)})}},d.prototype.getOptions=function(t){return this.options=e.extend({lang:e.zui.clientLang()},l,this.$.data(),t),this.options},d.prototype.callEvent=function(t,i){var n=this;if(e.isArray(i)||(i=[i]),n.$.trigger(t,i),e.isFunction(n.options[t]))return n.options[t].apply(n,i)},e.fn.uploader=function(t,i){return this.each(function(){var n=e(this),r=n.data(a),o="object"==typeof t&&t;r||n.data(a,r=new d(this,o)),"string"==typeof t&&r[t](i)})},d.NAME=a,d.STATUS=u,d.ERRORS=c,d.NAME=a,d.LANG={zh_cn:{limitFilesCountMessage:"所有文件数目不能超过 {count} 个,如果要上传此文件请先从列表移除文件。",uploadEmptyMessage:"没有文件等待上传。",uploadSuccessMessage:"已上传 {uploaded} 个文件。",uploadHasFailedMessage:"已上传 {uploaded} 个文件,{failed} 个文件上传失败。",startedStatusText:'正在上传第 {uploading} 个文件,共 {total} 个文件,已上传 {uploaded} 个文件,{failed} 个上传失败,进度 {percent}%,平均速度 {speed}。',initStatusText:"添加文件或拖放文件来上传。",stoppedStatusText:'共 {total} 个文件{queue} 个文件等待上传,已上传 {uploaded} 个文件{failed} 个上传失败,平均速度 {speed}。',deleteConfirm:"确定移除文件【{name}】?",download:"下载",rename:"重命名",repeat:"重新上传",remove:"移除",dropPlaceholder:"将文件拖放至在此处。",queue:"待上传",uploading:"正在上传",failed:"失败",done:"已上传",i18n:{"Stop Upload":"停止上传","Upload URL might be wrong or doesn't exist.":"上传的URL可能是错误的或不存在。",tb:"tb",Size:"大小",Close:"关闭","You must specify either browse_button or drop_element.":"您必须指定 browse_button 或者 drop_element。","Init error.":"初始化错误。","Add files to the upload queue and click the start button.":"将文件添加到上传队列,然后点击”开始上传“按钮。",List:"列表",Filename:"文件名","%s specified, but cannot be found.":"%s 已指定,但是没有找到。","Image format either wrong or not supported.":"图片格式错误或者不支持。",Status:"状态","HTTP Error.":"HTTP 错误。","Start Upload":"开始上传","Error: File too large:":"错误: 文件太大:",kb:"kb","Duplicate file error.":"无法添加重复文件。","File size error.":"文件大小错误。","N/A":"N/A",gb:"gb","Error: Invalid file extension:":"错误:无效的文件扩展名:","Select files":"选择文件","%s already present in the queue.":"%s 已经在当前队列里。","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"超限。%s 支持最大 %wx%hpx 的图片。","File: %s":"文件: %s",b:"b","Uploaded %d/%d files":"已上传 %d/%d 个文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只接受同时上传 %d 个文件,多余的文件将会被删除。","%d files queued":"%d 个文件加入到队列","File: %s, size: %d, max file size: %d":"文件: %s, 大小: %d, 最大文件大小: %d",Thumbnails:"缩略图","Drag files here.":"把文件拖到这里。","Runtime ran out of available memory.":"运行时已消耗所有可用内存。","File count error.":"文件数量错误。","File extension error.":"文件扩展名错误。",mb:"mb","Add Files":"增加文件"}},zh_tw:{limitFilesCountMessage:"所有文件數目不能超過 {count} 個。",uploadEmptyMessage:"没有文件等待上傳。",uploadSuccessMessage:"已上傳 {uploaded} 个文件。",uploadHasFailedMessage:"文件上傳完成,已上傳 {uploaded} 個文件,{failed} 個文件上傳失败。",startedStatusText:'正在上傳第{uploading} 個文件,共{total} 個文件,已上傳{uploaded} 個文件,{failed} 個上傳失敗,進度{percent}%,平均速度{speed}。',initStatusText:"添加文件或拖放文件來上傳。",stoppedStatusText:'共{total} 個文件{queue} 個文件等待上傳,已上傳{uploaded} 個文件{failed} 個上傳失敗,平均速度{speed}< /strong>。',deleteConfirm:"確定移除文件【{name}】?",download:"下载",rename:"重命名",repeat:"重新上傳",remove:"移除",dropPlaceholder:"將文件拖放至在此處。",queue:"待上傳",uploading:"正在上傳",failed:"失敗",done:"已上傳",i18n:{"Stop Upload":"停止上傳","Upload URL might be wrong or doesn't exist.":"檔案URL可能有誤或者不存在。",tb:"tb",Size:"大小",Close:"關閉","You must specify either browse_button or drop_element.":"您必須指定 browse_button 或 drop_element。","Init error.":"初始化錯誤。","Add files to the upload queue and click the start button.":"將檔案加入上傳序列,然後點選”開始上傳“按鈕。",List:"清單",Filename:"檔案名稱","%s specified, but cannot be found.":"找不到已選擇的 %s。","Image format either wrong or not supported.":"圖片格式錯誤或者不支援。",Status:"狀態","HTTP Error.":"HTTP 錯誤。","Start Upload":"開始上傳","Error: File too large:":"錯誤: 檔案大小太大:",kb:"kb","Duplicate file error.":"錯誤:檔案重複。","File size error.":"錯誤:檔案大小超過限制。","N/A":"N/A",gb:"gb","Error: Invalid file extension:":"錯誤:不接受的檔案格式:","Select files":"選擇檔案","%s already present in the queue.":"%s 已經存在目前的檔案序列。","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"圖片解析度超出範圍! %s 最高只支援到 %wx%hpx。","File: %s":"檔案: %s",b:"b","Uploaded %d/%d files":"已上傳 %d/%d 個文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只能上傳 %d 個檔案,超過限制數量的檔案將被忽略。","%d files queued":"%d 個檔案加入到序列","File: %s, size: %d, max file size: %d":"檔案: %s, 大小: %d, 檔案大小上限: %d",Thumbnails:"縮圖","Drag files here.":"把檔案拖曳到這裡。","Runtime ran out of available memory.":"執行時耗盡了所有可用的記憶體。","File count error.":"檔案數量錯誤。","File extension error.":"檔案副檔名錯誤。",mb:"mb","Add Files":"增加檔案"}},en:{limitFilesCountMessage:"All files count can not over {count}.",uploadEmptyMessage:"No file in queue to upload",uploadSuccessMessage:"Uploaded {uploaded} files。",uploadHasFailedMessage:"Uploaded complete, {uploaded} success, {failed} failed.",startedStatusText:'Uploading NO.{uploading} file, total {total} files, Uploaded {uploaded} files, {failed} failed, progress {percent}%, average spped {speed}。',initStatusText:"Append or drag file here.",stoppedStatusText:'Total {total} files, {queue} files in queue, uploaded {uploaded} files, {failed} failed, average spped {speed}。',deleteConfirm:'Remove file "{name}" form upload queue?',rename:"Rename",download:"Download",repeat:"Repeat",remove:"Remove",dropPlaceholder:"Drop file here.",queue:"Wait",uploading:"Uploading",failed:"Failed",done:"Done",i18n:{"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.",tb:"tb",Size:"Size",Close:"Close","You must specify either browse_button or drop_element.":"You must specify either browse_button or drop_element.","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Add files to the upload queue and click the start button.",List:"List",Filename:"Filename","%s specified, but cannot be found.":"%s specified, but cannot be found.","Image format either wrong or not supported.":"Image format either wrong or not supported.",Status:"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","Error: File too large:":"Error: File too large:",kb:"kb","Duplicate file error.":"Duplicate file error.","File size error.":"File size error.","N/A":"N/A",gb:"gb","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Select files","%s already present in the queue.":"%s already present in the queue.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.","File: %s":"File: %s",b:"b","Uploaded %d/%d files":"Uploaded %d/%d files","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"File: %s, size: %d, max file size: %d",Thumbnails:"Thumbnails","Drag files here.":"Drag files here.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.",mb:"mb","Add Files":"Add Files"}}},e.zui.plupload=i,e.zui.moxie=n,e.zui.Uploader=d,e.fn.uploader.Constructor=d,t.mOxie||(t.mOxie={Env:n.core.utils.Env,XMLHttpRequest:n.xhr.XMLHttpRequest}),e(function(){e('[data-ride="uploader"]').uploader()})}(jQuery,window,plupload,moxie,void 0); \ No newline at end of file diff --git a/dist/resources/static/js/utils/.pydio b/dist/resources/static/js/utils/.pydio new file mode 100644 index 0000000..5d90ef2 --- /dev/null +++ b/dist/resources/static/js/utils/.pydio @@ -0,0 +1 @@ +6b765a7a-f397-4ad6-b040-d509aa07c1af \ No newline at end of file diff --git a/dist/resources/static/js/utils/index.js b/dist/resources/static/js/utils/index.js new file mode 100755 index 0000000..7771385 --- /dev/null +++ b/dist/resources/static/js/utils/index.js @@ -0,0 +1,125 @@ +define(['jquery','config','zui'],function ($,config) { + + function utils() { + this.init() + } + + utils.prototype = { + init () { + }, + + // banner高度等于显示器高度 + setBannerHeight () { + if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) { + $("body").css({ "width": $(document).width() }); + } else { + $(".header").css({ "height": $(window).height() }); + $("body").css({ "width": "100%" }); + } + }, + + getUserId () { + if(localStorage.getItem("objectId") != null ) { + return localStorage.getItem("objectId") + } else { + location.href = `/reg?from=${location.pathname}` + } + }, + + /** + * 获取地址栏参数 + * @param name 需要获取的名称 + * @return {string|null} + * @constructor + */ + GetQueryString(name) { + var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); + var r = window.location.search.substr(1).match(reg); + if(r!=null)return unescape(r[2]); return null; + }, + + InfoCourseId () { + return (location.pathname.split("/info/"))[1] + }, + + /** + * + * @param params object 参数 + * { + * url: '请求地址', + * data: '请求参数' + * } + * @param callback function 回调函数 + */ + get (params = {}, callback) { + $.ajax({ + type: 'GET', + url: `${config.baseURL}${params.url}`, + dataType: 'json', + data: params.data, + success: function (res) { + if(res.status = 200) { + callback(res) + } else { + uikit.notification({ + message: `GET 接口报错: ${err.message}`, + status: 'danger', + pos: 'top-right', + timeout: 5000 + }); + } + }, + error: function (err) { + uikit.notification({ + message: `GET 接口报错: ${err.message}`, + status: 'danger', + pos: 'top-right', + timeout: 5000 + }); + throw new Error(`GET 接口报错 ${err.message}`) + } + }) + }, + + /** + * + * @param params object 参数 + * { + * url: '请求地址', + * data: '请求参数' + * } + * @param callback function 回调函数 + */ + post (params = {}, callback) { + $.ajax({ + type: 'POST', + url: `${config.baseURL}${params.url}`, + dataType: 'json', + data: params.data, + success: function (res) { + if(res.status = 200) { + callback(res) + } else { + uikit.notification({ + message: '网络不佳,请稍后重试', + status: 'danger', + pos: 'top-right', + timeout: 5000 + }); + } + }, + error: function (err) { + uikit.notification({ + message: `POST 接口报错: ${err.message}`, + status: 'danger', + pos: 'top-right', + timeout: 5000 + }); + } + }) + } + } + + return new utils(); + +}) \ No newline at end of file diff --git a/dist/resources/static/plugins/.pydio b/dist/resources/static/plugins/.pydio new file mode 100644 index 0000000..4c77b05 --- /dev/null +++ b/dist/resources/static/plugins/.pydio @@ -0,0 +1 @@ +e7b2c96e-7d55-485f-a4bb-5c37be6ddcb5 \ No newline at end of file diff --git a/dist/resources/view/.pydio b/dist/resources/view/.pydio new file mode 100644 index 0000000..e0490c1 --- /dev/null +++ b/dist/resources/view/.pydio @@ -0,0 +1 @@ +27fc7a22-993c-45ce-a9e5-71bd79f9ad46 \ No newline at end of file diff --git a/dist/resources/view/home/.pydio b/dist/resources/view/home/.pydio new file mode 100644 index 0000000..89bdb61 --- /dev/null +++ b/dist/resources/view/home/.pydio @@ -0,0 +1 @@ +34185721-8818-4171-b882-df59fa92eb79 \ No newline at end of file diff --git a/dist/resources/view/home/layout.jade b/dist/resources/view/home/layout.jade new file mode 100755 index 0000000..b55927e --- /dev/null +++ b/dist/resources/view/home/layout.jade @@ -0,0 +1,45 @@ +//- 网站的核心的公共父级组件 +//- 一些全局公共css和js可以在这里被加载 +doctype html +html + head + title=title + meta(charset="utf-8") + meta(http-equiv="X-UA-Compatible" content="IE=edge,chrome=1") + meta(name="viewport" content="width=device-width, initial-scale=1") + meta(name="renderer" content="webkit") + meta(name="author" content="编码猿,2271608011@qq.com") + meta(http-equiv="Cache-Control" content="no-cache") + meta(http-equiv="Expires" content="0") + meta(name="renderer" content="webkit") + meta(http-equiv="Cache-Control" content="no-siteapp") + meta(name="apple-mobile-web-app-status-bar-style" content="black") + meta(name="google" value="notranslate") + meta(name="baidu-site-verification" content="21kEPchCxS") + meta(name="360-site-verification" content="6dbeb22f4f20d07f3492eff44f8b25e3") + meta(baidu-gxt-verify-token="8faebbed25a4b01d5b78eafd57bcd370") + link(rel="shortcut icon" href="/img/favicon.ico") + link(rel="stylesheet" href="/js/lib/zui/css/zui.css") + link(rel="stylesheet" href="/js/lib/zui/css/zui-theme-blue.css") + + + + meta(name="description" content="xxx") + meta(name="keywords" content="xxxxx") + + + +body + + //- 公共网站头部 + - if (isShowAction.header) + include ./public/header + + //- 网站主体内容,从 main/*.jade 被载入 + block content + + //- 公共网站版权 + - if (isShowAction.footer) + include ./public/footer + + script(data-main="/js/app.js" src="/js/lib/require.js" defer) diff --git a/dist/resources/view/home/page/.pydio b/dist/resources/view/home/page/.pydio new file mode 100644 index 0000000..507c4cf --- /dev/null +++ b/dist/resources/view/home/page/.pydio @@ -0,0 +1 @@ +2791366b-a065-4c64-ae01-974b1b1afec7 \ No newline at end of file diff --git a/dist/resources/view/home/page/Test.jade b/dist/resources/view/home/page/Test.jade new file mode 100644 index 0000000..df6ca46 --- /dev/null +++ b/dist/resources/view/home/page/Test.jade @@ -0,0 +1,13 @@ +extends ./../layout + +block title + + meta(name="description" content="xxx") + meta(name="keywords" content="xxxxx") + +//- 网站的主体内容区域 +block content + + .test(class="pages" data-module="test") + .container + h2 测试页面 diff --git a/dist/resources/view/home/page/about.jade b/dist/resources/view/home/page/about.jade new file mode 100755 index 0000000..983623c --- /dev/null +++ b/dist/resources/view/home/page/about.jade @@ -0,0 +1,12 @@ +extends ./../layout + +//- 网站的头部信息这边拆分出来,便于每个页面的SEO配置和配置页面独有的css,js +block title + + meta(name="description" content="关于我们,企业联系,课程咨询,问题答疑") + meta(name="keywords" content="编码猿,关于我们,怪客学堂") + +//- 网站的主体内容区域 +block content + .about(class="pages about" data-module="about") + .container 关于我 \ No newline at end of file diff --git a/dist/resources/view/home/page/error.jade b/dist/resources/view/home/page/error.jade new file mode 100644 index 0000000..145d7a2 --- /dev/null +++ b/dist/resources/view/home/page/error.jade @@ -0,0 +1,28 @@ +extends ./../layout + +//- 网站的头部信息这边拆分出来,便于每个页面的SEO配置和配置页面独有的css,js +block title + + meta(name="description" content="怪客课堂的404错误页面") + meta(name="keywords" content="怪客课堂,编码猿,怪客学堂,错误页面") + link(rel="stylesheet" href="/css/home/error.css") + +//- 网站的主体内容区域 +block content + .error + img(src="/img/bgError.png") + .i-message + h3 + | 哎哟喂~出bug了啊,哈哈... + br + | 页面不存在 + + p 可能的原因: + ul + li 1: 手滑输错地址 + li 2: 估计是程序员小姐姐代码有问题 + li 3: 页面过期失效了 + li 4: 不要干坏事哦 + p.action + a(href="/") 回到首页 + a(onclick="history.back();") 返回上一页 diff --git a/dist/resources/view/home/page/index.jade b/dist/resources/view/home/page/index.jade new file mode 100755 index 0000000..11b43dd --- /dev/null +++ b/dist/resources/view/home/page/index.jade @@ -0,0 +1,14 @@ +extends ./../layout + +block title + + meta(name="description" content="怪客课堂是合肥源学思信息科技有限公司旗下的在线学习品牌,我们专注于通过不断的项目实战和实战经验分享来帮助更多想要进一步提高自身能力的人,同时也为想要从事编程行业的朋友提供一个更加合理快速的通道。在这里你能学习到更多更加有用的实战技能,更多更加干货和有分量的基础视频,我们拒绝废话拒绝啰嗦,在这里一切知识都为了更加符合企业工作需要,提升自我价值实现自我理想。") + meta(name="keywords" content="编码猿,html,css,后端,vue,php,java,node,koa, 在线技术学习") + +//- 网站的主体内容区域 +block content + + .index(class="pages" data-module="index") + .container + | 测试首页 + button(class="btn btn-primary" type="button") 测试按钮 \ No newline at end of file diff --git a/dist/resources/view/home/page/register.jade b/dist/resources/view/home/page/register.jade new file mode 100644 index 0000000..a13bf92 --- /dev/null +++ b/dist/resources/view/home/page/register.jade @@ -0,0 +1,14 @@ +extends ./../layout + +//- 网站的头部信息这边拆分出来,便于每个页面的SEO配置和配置页面独有的css,js +block title + + meta(name="description" content="怪客课堂是合肥源学思信息科技有限公司旗下的在线学习品牌,我们专注于通过不断的项目实战和实战经验分享来帮助更多想要进一步提高自身能力的人,同时也为想要从事编程行业的朋友提供一个更加合理快速的通道。在这里你能学习到更多更加有用的实战技能,更多更加干货和有分量的基础视频,我们拒绝废话拒绝啰嗦,在这里一切知识都为了更加符合企业工作需要,提升自我价值实现自我理想。") + meta(name="keywords" content="编码猿,html,css,后端,vue,php,java,node,koa, 在线技术学习") + +//- 网站的主体内容区域 +block content + + .index(class="pages register" data-module="register") + .container 用户注册 + diff --git a/dist/resources/view/home/public/.pydio b/dist/resources/view/home/public/.pydio new file mode 100644 index 0000000..2737750 --- /dev/null +++ b/dist/resources/view/home/public/.pydio @@ -0,0 +1 @@ +3acbf575-c668-487a-b91f-385a9e1d22bf \ No newline at end of file diff --git a/dist/resources/view/home/public/footer.jade b/dist/resources/view/home/public/footer.jade new file mode 100755 index 0000000..fa93361 --- /dev/null +++ b/dist/resources/view/home/public/footer.jade @@ -0,0 +1 @@ +.footer 底部 \ No newline at end of file diff --git a/dist/resources/view/home/public/header.jade b/dist/resources/view/home/public/header.jade new file mode 100755 index 0000000..ec2a65a --- /dev/null +++ b/dist/resources/view/home/public/header.jade @@ -0,0 +1 @@ +.header 头部 diff --git a/dist/run/.pydio b/dist/run/.pydio new file mode 100644 index 0000000..296ac45 --- /dev/null +++ b/dist/run/.pydio @@ -0,0 +1 @@ +64f29175-1ec6-4921-a6c6-782074cdb111 \ No newline at end of file diff --git a/dist/run/app.js b/dist/run/app.js new file mode 100644 index 0000000..e7f4005 --- /dev/null +++ b/dist/run/app.js @@ -0,0 +1,73 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +require("reflect-metadata"); +const routing_controllers_1 = require("routing-controllers"); +const typedi_1 = require("typedi"); +const config_1 = require("../config"); +const logs_1 = require("../utils/logs"); +const init_1 = require("./init"); +const logger_1 = require("../utils/logger"); +const path_1 = __importDefault(require("path")); +class App extends init_1.initPlugins { + constructor() { + super(); + // typedi 注入到 routing-controllers + routing_controllers_1.useContainer(typedi_1.Container); + this.createKoa(); + } + /** + * 创建 koa 服务 + */ + createKoa() { + this.app = routing_controllers_1.useKoaServer(this.Koa2, { + cors: true, + validation: true, + classTransformer: true, + controllers: [`${path_1.default.join(__dirname, '../controller/**/*{.js,.ts}')}`] + }); + this.run(); + } + // 启动程序 + run() { + try { + this.app.listen(config_1.config.port, () => logger_1.logger.logSymbolsSuccess(config_1.config.banner.welcome())); + } + catch (e) { + logger_1.logger.logSymbolsError(`❌ 启动出错:${e.message}`); + logs_1.Logs.ApplicationLogger().error(e); + } + this.errorCatch(); + // this.Page_404(); + } + // 错误捕捉Unsupported type + errorCatch() { + this.app.on('error', err => { + logger_1.logger.logSymbolsError(`❌ 主程序捕捉到错误:${err.message}`); + logs_1.Logs.ApplicationLogger().error(err); + }); + } + /** + * 捕捉到404的时候跳转到error错误页面 + * @constructor + */ + Page_404() { + this.app.use((ctx) => __awaiter(this, void 0, void 0, function* () { + if (ctx.response.status == 404) { + ctx.redirect('/error'); + } + })); + } +} +exports.App = App; diff --git a/dist/run/init.js b/dist/run/init.js new file mode 100644 index 0000000..e181f85 --- /dev/null +++ b/dist/run/init.js @@ -0,0 +1,77 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const koa_bodyparser_1 = __importDefault(require("koa-bodyparser")); +const koa_static_1 = __importDefault(require("koa-static")); +const koa_views_1 = __importDefault(require("koa-views")); +const koa_session_1 = __importDefault(require("koa-session")); +const path_1 = __importDefault(require("path")); +const koa_1 = __importDefault(require("koa")); +const logger_1 = require("../utils/logger"); +const logs_1 = require("../utils/logs"); +const config_1 = require("../config"); +const typeorm_1 = require("typeorm"); +/** + * 把第三方插件 和 中间件 的配置从主启动类中剥离处理 + * 便于项目后期配置更多的第三方插件&中间件 + */ +class initPlugins { + constructor() { + this.Koa2 = new koa_1.default(); + this.combinationPlugins(); + } + /** + * 组装koa2的中间件为Array + */ + combinationPlugins() { + return __awaiter(this, void 0, void 0, function* () { + // 设置签名的 Cookie 密钥。 + this.Koa2.keys = [config_1.config.initPlugins.SessionKey]; + this.PluginsList = [ + // 记录系统日志,访问级别的,记录用户的所有请求,作为koa的中间件 + logs_1.Logs.AccessLogger(), + // 处理post请求 + koa_bodyparser_1.default(), + // 静态资源配置 + koa_static_1.default(path_1.default.join(__dirname, config_1.config.initPlugins.staticPath), { maxage: 0 }), + // session 配置 + koa_session_1.default({ + key: 'koa:sess', + maxAge: 86400000, + overwrite: true, + httpOnly: true, + signed: true, + rolling: false, + renew: false, + }, this.Koa2), + // 模板引擎配置 + koa_views_1.default(path_1.default.join(__dirname, config_1.config.initPlugins.viewsPath), { + extension: 'jade', + options: { ext: 'jade' } + }) + ]; + try { + this.PluginsList.forEach((v) => this.Koa2.use(v)); + // @ts-ignore + yield typeorm_1.createConnection(config_1.config.typeorm); + } + catch (e) { + // 终端输出 + logger_1.logger.logSymbolsError(`配置插件出错:${e.message}`); + logs_1.Logs.ApplicationLogger().error(e); + } + }); + } +} +exports.initPlugins = initPlugins; diff --git a/dist/service/.pydio b/dist/service/.pydio new file mode 100644 index 0000000..18c7e35 --- /dev/null +++ b/dist/service/.pydio @@ -0,0 +1 @@ +544dc329-578b-4278-b68f-2a04f84d8279 \ No newline at end of file diff --git a/dist/service/TestService.js b/dist/service/TestService.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/dist/service/TestService.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/dist/service/UserService.js b/dist/service/UserService.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/dist/service/UserService.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/dist/service/impl/.pydio b/dist/service/impl/.pydio new file mode 100644 index 0000000..4e3d042 --- /dev/null +++ b/dist/service/impl/.pydio @@ -0,0 +1 @@ +d3c0b3a9-6d79-46b8-9607-d5ee8b4024c7 \ No newline at end of file diff --git a/dist/service/impl/TestServiceImpl.js b/dist/service/impl/TestServiceImpl.js new file mode 100644 index 0000000..5423ae7 --- /dev/null +++ b/dist/service/impl/TestServiceImpl.js @@ -0,0 +1,37 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const typedi_1 = require("typedi"); +const UserDao_1 = require("../../dao/UserDao"); +let TestServiceImpl = class TestServiceImpl { + getAllUserService() { + return __awaiter(this, void 0, void 0, function* () { + return yield this.userDao.AllUser(); + }); + } +}; +__decorate([ + typedi_1.Inject(), + __metadata("design:type", UserDao_1.UserDao) +], TestServiceImpl.prototype, "userDao", void 0); +TestServiceImpl = __decorate([ + typedi_1.Service() +], TestServiceImpl); +exports.TestServiceImpl = TestServiceImpl; diff --git a/dist/service/impl/UserServiceImpl.js b/dist/service/impl/UserServiceImpl.js new file mode 100644 index 0000000..888a6fb --- /dev/null +++ b/dist/service/impl/UserServiceImpl.js @@ -0,0 +1,42 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const typedi_1 = require("typedi"); +const UserDao_1 = require("../../dao/UserDao"); +let UserServiceImpl = class UserServiceImpl { + getOneUserService(id) { + return __awaiter(this, void 0, void 0, function* () { + return yield this.userDao.getOneUserDao(id); + }); + } + getAllUserService() { + return __awaiter(this, void 0, void 0, function* () { + return yield this.userDao.AllUser(); + }); + } +}; +__decorate([ + typedi_1.Inject(), + __metadata("design:type", UserDao_1.UserDao) +], UserServiceImpl.prototype, "userDao", void 0); +UserServiceImpl = __decorate([ + typedi_1.Service() +], UserServiceImpl); +exports.UserServiceImpl = UserServiceImpl; diff --git a/dist/utils/.pydio b/dist/utils/.pydio new file mode 100644 index 0000000..dbe9f50 --- /dev/null +++ b/dist/utils/.pydio @@ -0,0 +1 @@ +72af0c12-9444-49a6-a65f-b9bd573f5519 \ No newline at end of file diff --git a/dist/utils/logger.js b/dist/utils/logger.js new file mode 100644 index 0000000..17e8114 --- /dev/null +++ b/dist/utils/logger.js @@ -0,0 +1,22 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const log_symbols_1 = __importDefault(require("log-symbols")); +const chalk_1 = __importDefault(require("chalk")); +class logger { + static logSymbolsSuccess(message) { + console.log(chalk_1.default.green.bold(log_symbols_1.default.success, message)); + } + static logSymbolsInfo(message) { + console.log(log_symbols_1.default.info, message); + } + static logSymbolsWarning(message) { + console.log(log_symbols_1.default.warning, message); + } + static logSymbolsError(message) { + console.log(chalk_1.default.bold.red(log_symbols_1.default.error, message)); + } +} +exports.logger = logger; diff --git a/dist/utils/logs.js b/dist/utils/logs.js new file mode 100644 index 0000000..864dc86 --- /dev/null +++ b/dist/utils/logs.js @@ -0,0 +1,27 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const koa_log4_1 = __importDefault(require("koa-log4")); +const config_1 = require("../config"); +koa_log4_1.default.configure(config_1.config.logConfig); +class Logs { + /** + * 访问级别的日志 + */ + static AccessLogger() { + return koa_log4_1.default.koaLogger(koa_log4_1.default.getLogger('access'), { level: 'auto' }); + } + /** + * 应用级别的日志 + * @constructor + */ + static ApplicationLogger() { + return koa_log4_1.default.getLogger('application'); + } + static HttpLogger() { + return koa_log4_1.default.getLogger('request'); + } +} +exports.Logs = Logs; diff --git a/dist/utils/utils.js b/dist/utils/utils.js new file mode 100644 index 0000000..0f1c7c0 --- /dev/null +++ b/dist/utils/utils.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../config/index"); +class utils { + /** + * 统一设置网站浏览器的 title 标题内容 + * @param title + */ + static titleName(title) { + return `${title}${index_1.config.title}`; + } + /** + * 将get地址栏参数转换为对象 + * @param url + */ + static parseQueryString(url) { + var reg_url = /^[^\?]+\?([\w\W]+)$/, reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g, arr_url = reg_url.exec(url), ret = {}; + if (arr_url && arr_url[1]) { + var str_para = arr_url[1], result; + while ((result = reg_para.exec(str_para)) != null) { + ret[result[1]] = result[2]; + } + } + return ret; + } +} +exports.utils = utils; diff --git a/doc/.pydio b/doc/.pydio new file mode 100644 index 0000000..db8de2e --- /dev/null +++ b/doc/.pydio @@ -0,0 +1 @@ +66752c81-ba18-47e0-8efc-bb9d977818aa \ No newline at end of file diff --git a/doc/api_data.js b/doc/api_data.js new file mode 100644 index 0000000..265229e --- /dev/null +++ b/doc/api_data.js @@ -0,0 +1 @@ +define({ "api": [ { "type": "get", "url": "/user/allUser", "title": "allUser", "version": "1.0.0", "description": "

      获取所有用户信息

      ", "name": "allUser", "group": "user", "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"result\" : {\n }\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\":200,\n \"result\":{\n }\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://www.geekhelp.cn/bmy/api/user/allUser" } ], "filename": "src/controller/api/UserControllerApi.ts", "groupTitle": "user" }, { "type": "get", "url": "/user/oneUser", "title": "oneUser", "version": "1.0.0", "description": "

      获取一条用户记录

      ", "name": "oneUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "string", "optional": false, "field": "id", "description": "

      用户id

      " } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"result\" : {\n }\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\":200,\n \"result\":{\n }\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://www.geekhelp.cn/bmy/api/user/oneUser" } ], "filename": "src/controller/api/UserControllerApi.ts", "groupTitle": "user" } ] }); diff --git a/doc/api_data.json b/doc/api_data.json new file mode 100644 index 0000000..ef0b56a --- /dev/null +++ b/doc/api_data.json @@ -0,0 +1 @@ +[ { "type": "get", "url": "/user/allUser", "title": "allUser", "version": "1.0.0", "description": "

      获取所有用户信息

      ", "name": "allUser", "group": "user", "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"result\" : {\n }\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\":200,\n \"result\":{\n }\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://www.geekhelp.cn/bmy/api/user/allUser" } ], "filename": "src/controller/api/UserControllerApi.ts", "groupTitle": "user" }, { "type": "get", "url": "/user/oneUser", "title": "oneUser", "version": "1.0.0", "description": "

      获取一条用户记录

      ", "name": "oneUser", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "string", "optional": false, "field": "id", "description": "

      用户id

      " } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"result\" : {\n }\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\":200,\n \"result\":{\n }\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://www.geekhelp.cn/bmy/api/user/oneUser" } ], "filename": "src/controller/api/UserControllerApi.ts", "groupTitle": "user" } ] diff --git a/doc/api_project.js b/doc/api_project.js new file mode 100644 index 0000000..c077bbf --- /dev/null +++ b/doc/api_project.js @@ -0,0 +1 @@ +define({ "name": "怪客课堂", "version": "1.1.0", "description": "怪客课堂,基于Nodejs + Koa2 + TypeScript 构建的网站", "title": "怪客课堂", "url": "http://www. geekhelp.cn/bmy/api", "header": { "title": "My own header title", "content": "

      公共头部

      \n" }, "footer": { "title": "My own footer title", "content": "

      公共底部

      \n" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-06-02T15:46:28.433Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); diff --git a/doc/api_project.json b/doc/api_project.json new file mode 100644 index 0000000..3c2e8f1 --- /dev/null +++ b/doc/api_project.json @@ -0,0 +1 @@ +{ "name": "怪客课堂", "version": "1.1.0", "description": "怪客课堂,基于Nodejs + Koa2 + TypeScript 构建的网站", "title": "怪客课堂", "url": "http://www. geekhelp.cn/bmy/api", "header": { "title": "My own header title", "content": "

      公共头部

      \n" }, "footer": { "title": "My own footer title", "content": "

      公共底部

      \n" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-06-02T15:46:28.433Z", "url": "http://apidocjs.com", "version": "0.19.0" } } diff --git a/doc/css/.pydio b/doc/css/.pydio new file mode 100644 index 0000000..69a5350 --- /dev/null +++ b/doc/css/.pydio @@ -0,0 +1 @@ +f4c138c0-c5a1-475c-a6c9-7c02355ebc09 \ No newline at end of file diff --git a/doc/css/style.css b/doc/css/style.css new file mode 100644 index 0000000..216a21e --- /dev/null +++ b/doc/css/style.css @@ -0,0 +1,568 @@ +/* ------------------------------------------------------------------------------------------ + * Content + * ------------------------------------------------------------------------------------------ */ +body { + max-width: 1280px; +} + +body, p, a, div, th, td { + font-family: "Source Sans Pro", sans-serif; + font-weight: 400; + font-size: 16px; +} + +td.code { + font-size: 14px; + font-family: "Source Code Pro", monospace; + font-style: normal; + font-weight: 400; +} + +#content { + padding-top: 16px; + z-Index: -1; + margin-left: 270px; +} + +p { + color: #808080; +} + +h1 { + font-family: "Source Sans Pro Semibold", sans-serif; + font-weight: normal; + font-size: 44px; + line-height: 50px; + margin: 0 0 10px 0; + padding: 0; +} + +h2 { + font-family: "Source Sans Pro", sans-serif; + font-weight: normal; + font-size: 24px; + line-height: 40px; + margin: 0 0 20px 0; + padding: 0; +} + +section { + border-top: 1px solid #ebebeb; + padding: 30px 0; +} + +section h1 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + font-size: 32px; + line-height: 40px; + padding-bottom: 14px; + margin: 0 0 20px 0; + padding: 0; +} + +article { + padding: 14px 0 30px 0; +} + +article h1 { + font-family: "Source Sans Pro Bold", sans-serif; + font-weight: 600; + font-size: 24px; + line-height: 26px; +} + +article h2 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 18px; + line-height: 24px; + margin: 0 0 10px 0; +} + +article h3 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 16px; + line-height: 18px; + margin: 0 0 10px 0; +} + +article h4 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 14px; + line-height: 16px; + margin: 0 0 8px 0; +} + +table { + border-collapse: collapse; + width: 100%; + margin: 0 0 20px 0; +} + +th { + background-color: #f5f5f5; + text-align: left; + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + padding: 4px 8px; + border: #e0e0e0 1px solid; +} + +td { + vertical-align: top; + padding: 10px 8px 0 8px; + border: #e0e0e0 1px solid; +} + +#generator .content { + color: #b0b0b0; + border-top: 1px solid #ebebeb; + padding: 10px 0; +} + +.label-optional { + float: right; + background-color: grey; + margin-top: 4px; +} + +.open-left { + right: 0; + left: auto; +} + +/* ------------------------------------------------------------------------------------------ + * apidoc - intro + * ------------------------------------------------------------------------------------------ */ + +#apidoc .apidoc { + border-top: 1px solid #ebebeb; + padding: 30px 0; +} + +#apidoc h1 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + font-size: 32px; + line-height: 40px; + padding-bottom: 14px; + margin: 0 0 20px 0; + padding: 0; +} + +#apidoc h2 { + font-family: "Source Sans Pro Bold", sans-serif; + font-weight: 600; + font-size: 22px; + line-height: 26px; + padding-top: 14px; +} + +/* ------------------------------------------------------------------------------------------ + * pre / code + * ------------------------------------------------------------------------------------------ */ +pre { + background-color: #292b36; + color: #ffffff; + padding: 10px; + border-radius: 6px; + position: relative; + margin: 10px 0 20px 0; + overflow-x: auto; +} + +pre.prettyprint { + width: 100%; +} + +code.language-text { + word-wrap: break-word; +} + +pre.language-json { + overflow: auto; +} + +pre.language-html { + margin: 0 0 20px 0; +} + +.type { + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 15px; + display: inline-block; + margin: 0 0 5px 0; + padding: 4px 5px; + border-radius: 6px; + text-transform: uppercase; + background-color: #3387CC; + color: #ffffff; +} + +.type__get { + background-color: green; +} + +.type__put { + background-color: #e5c500; +} + +.type__post { + background-color: #4070ec; +} + +.type__delete { + background-color: #ed0039; +} + +pre.language-api .str { + color: #ffffff; +} + +pre.language-api .pln, +pre.language-api .pun { + color: #65B042; +} + +pre code { + display: block; + font-size: 14px; + font-family: "Source Code Pro", monospace; + font-style: normal; + font-weight: 400; + word-wrap: normal; + white-space: pre; +} + +pre code.sample-request-response-json { + white-space: pre-wrap; + max-height: 500px; + overflow: auto; +} + +/* ------------------------------------------------------------------------------------------ + * Sidenav + * ------------------------------------------------------------------------------------------ */ +.sidenav { + width: 228px; + margin: 0; + padding: 0 20px 20px 20px; + position: fixed; + top: 50px; + left: 0; + bottom: 0; + overflow-x: hidden; + overflow-y: auto; + background-color: #f5f5f5; + z-index: 10; +} + +.sidenav > li > a { + display: block; + width: 192px; + margin: 0; + padding: 2px 11px; + border: 0; + border-left: transparent 4px solid; + border-right: transparent 4px solid; + font-family: "Source Sans Pro", sans-serif; + font-weight: 400; + font-size: 14px; +} + +.sidenav > li.nav-header { + margin-top: 8px; + margin-bottom: 8px; +} + +.sidenav > li.nav-header > a { + padding: 5px 15px; + border: 1px solid #e5e5e5; + width: 190px; + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + font-size: 16px; + background-color: #ffffff; +} + +.sidenav > li.active > a { + position: relative; + z-index: 2; + background-color: #0088cc; + color: #ffffff; +} + +.sidenav > li.has-modifications a { + border-right: #60d060 4px solid; +} + +.sidenav > li.is-new a { + border-left: #e5e5e5 4px solid; +} + +/* ------------------------------------------------------------------------------------------ + * Side nav search + * ------------------------------------------------------------------------------------------ */ +.sidenav-search { + width: 228px; + left: 0px; + position: fixed; + padding: 16px 20px 10px 20px; + background-color: #F5F5F5; + z-index: 11; +} + +.sidenav-search .search { + height: 26px; +} + +.search-reset { + position: absolute; + display: block; + cursor: pointer; + width: 20px; + height: 20px; + text-align: center; + right: 28px; + top: 17px; + background-color: #fff; +} + +/* ------------------------------------------------------------------------------------------ + * Compare + * ------------------------------------------------------------------------------------------ */ + +ins { + background: #60d060; + text-decoration: none; + color: #000000; +} + +del { + background: #f05050; + color: #000000; +} + +.label-ins { + background-color: #60d060; +} + +.label-del { + background-color: #f05050; + text-decoration: line-through; +} + +pre.ins { + background-color: #60d060; +} + +pre.del { + background-color: #f05050; + text-decoration: line-through; +} + +table.ins th, +table.ins td { + background-color: #60d060; +} + +table.del th, +table.del td { + background-color: #f05050; + text-decoration: line-through; +} + +tr.ins td { + background-color: #60d060; +} + +tr.del td { + background-color: #f05050; + text-decoration: line-through; +} + +/* ------------------------------------------------------------------------------------------ + * Spinner + * ------------------------------------------------------------------------------------------ */ + +#loader { + position: absolute; + width: 100%; +} + +#loader p { + padding-top: 80px; + margin-left: -4px; +} + +.spinner { + margin: 200px auto; + width: 60px; + height: 60px; + position: relative; +} + +.container1 > div, .container2 > div, .container3 > div { + width: 14px; + height: 14px; + background-color: #0088cc; + + border-radius: 100%; + position: absolute; + -webkit-animation: bouncedelay 1.2s infinite ease-in-out; + animation: bouncedelay 1.2s infinite ease-in-out; + /* Prevent first frame from flickering when animation starts */ + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} + +.spinner .spinner-container { + position: absolute; + width: 100%; + height: 100%; +} + +.container2 { + -webkit-transform: rotateZ(45deg); + transform: rotateZ(45deg); +} + +.container3 { + -webkit-transform: rotateZ(90deg); + transform: rotateZ(90deg); +} + +.circle1 { top: 0; left: 0; } +.circle2 { top: 0; right: 0; } +.circle3 { right: 0; bottom: 0; } +.circle4 { left: 0; bottom: 0; } + +.container2 .circle1 { + -webkit-animation-delay: -1.1s; + animation-delay: -1.1s; +} + +.container3 .circle1 { + -webkit-animation-delay: -1.0s; + animation-delay: -1.0s; +} + +.container1 .circle2 { + -webkit-animation-delay: -0.9s; + animation-delay: -0.9s; +} + +.container2 .circle2 { + -webkit-animation-delay: -0.8s; + animation-delay: -0.8s; +} + +.container3 .circle2 { + -webkit-animation-delay: -0.7s; + animation-delay: -0.7s; +} + +.container1 .circle3 { + -webkit-animation-delay: -0.6s; + animation-delay: -0.6s; +} + +.container2 .circle3 { + -webkit-animation-delay: -0.5s; + animation-delay: -0.5s; +} + +.container3 .circle3 { + -webkit-animation-delay: -0.4s; + animation-delay: -0.4s; +} + +.container1 .circle4 { + -webkit-animation-delay: -0.3s; + animation-delay: -0.3s; +} + +.container2 .circle4 { + -webkit-animation-delay: -0.2s; + animation-delay: -0.2s; +} + +.container3 .circle4 { + -webkit-animation-delay: -0.1s; + animation-delay: -0.1s; +} + +@-webkit-keyframes bouncedelay { + 0%, 80%, 100% { -webkit-transform: scale(0.0) } + 40% { -webkit-transform: scale(1.0) } +} + +@keyframes bouncedelay { + 0%, 80%, 100% { + transform: scale(0.0); + -webkit-transform: scale(0.0); + } 40% { + transform: scale(1.0); + -webkit-transform: scale(1.0); + } +} + +/* ------------------------------------------------------------------------------------------ + * Tabs + * ------------------------------------------------------------------------------------------ */ +ul.nav-tabs { + margin: 0; +} + +p.deprecated span{ + color: #ff0000; + font-weight: bold; + text-decoration: underline; +} + +/* ------------------------------------------------------------------------------------------ + * Print + * ------------------------------------------------------------------------------------------ */ + +@media print { + + #sidenav, + #version, + #versions, + section .version, + section .versions { + display: none; + } + + #content { + margin-left: 0; + } + + a { + text-decoration: none; + color: inherit; + } + + a:after { + content: " [" attr(href) "] "; + } + + p { + color: #000000 + } + + pre { + background-color: #ffffff; + color: #000000; + padding: 10px; + border: #808080 1px solid; + border-radius: 6px; + position: relative; + margin: 10px 0 20px 0; + } + +} /* /@media print */ diff --git a/doc/fonts/.pydio b/doc/fonts/.pydio new file mode 100644 index 0000000..022c1b9 --- /dev/null +++ b/doc/fonts/.pydio @@ -0,0 +1 @@ +805f3724-6705-494a-a346-271865b4d06d \ No newline at end of file diff --git a/doc/fonts/glyphicons-halflings-regular.eot b/doc/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..b93a495 Binary files /dev/null and b/doc/fonts/glyphicons-halflings-regular.eot differ diff --git a/doc/fonts/glyphicons-halflings-regular.svg b/doc/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..94fb549 --- /dev/null +++ b/doc/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/glyphicons-halflings-regular.ttf b/doc/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..1413fc6 Binary files /dev/null and b/doc/fonts/glyphicons-halflings-regular.ttf differ diff --git a/doc/fonts/glyphicons-halflings-regular.woff b/doc/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..9e61285 Binary files /dev/null and b/doc/fonts/glyphicons-halflings-regular.woff differ diff --git a/doc/fonts/glyphicons-halflings-regular.woff2 b/doc/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 0000000..64539b5 Binary files /dev/null and b/doc/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/doc/img/.pydio b/doc/img/.pydio new file mode 100644 index 0000000..19c245c --- /dev/null +++ b/doc/img/.pydio @@ -0,0 +1 @@ +1e4d8634-309e-4629-a6f3-85f9df8b1b1a \ No newline at end of file diff --git a/doc/img/favicon.ico b/doc/img/favicon.ico new file mode 100644 index 0000000..c307a04 Binary files /dev/null and b/doc/img/favicon.ico differ diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..b32e412 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,687 @@ + + + + + Loading... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      +
      + +
      + +
      +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +

      Loading...

      +
      +
      + + + + diff --git a/doc/locales/.pydio b/doc/locales/.pydio new file mode 100644 index 0000000..ba1974b --- /dev/null +++ b/doc/locales/.pydio @@ -0,0 +1 @@ +1e93cdf8-cd12-4c62-a999-81fd6ee66238 \ No newline at end of file diff --git a/doc/locales/ca.js b/doc/locales/ca.js new file mode 100644 index 0000000..65af5df --- /dev/null +++ b/doc/locales/ca.js @@ -0,0 +1,25 @@ +define({ + ca: { + 'Allowed values:' : 'Valors permesos:', + 'Compare all with predecessor': 'Comparar tot amb versió anterior', + 'compare changes to:' : 'comparar canvis amb:', + 'compared to' : 'comparat amb', + 'Default value:' : 'Valor per defecte:', + 'Description' : 'Descripció', + 'Field' : 'Camp', + 'General' : 'General', + 'Generated with' : 'Generat amb', + 'Name' : 'Nom', + 'No response values.' : 'Sense valors en la resposta.', + 'optional' : 'opcional', + 'Parameter' : 'Paràmetre', + 'Permission:' : 'Permisos:', + 'Response' : 'Resposta', + 'Send' : 'Enviar', + 'Send a Sample Request' : 'Enviar una petició d\'exemple', + 'show up to version:' : 'mostrar versió:', + 'Size range:' : 'Tamany de rang:', + 'Type' : 'Tipus', + 'url' : 'url' + } +}); diff --git a/doc/locales/cs.js b/doc/locales/cs.js new file mode 100644 index 0000000..b7796d8 --- /dev/null +++ b/doc/locales/cs.js @@ -0,0 +1,25 @@ +define({ + cs: { + 'Allowed values:' : 'Povolené hodnoty:', + 'Compare all with predecessor': 'Porovnat vše s předchozími verzemi', + 'compare changes to:' : 'porovnat změny s:', + 'compared to' : 'porovnat s', + 'Default value:' : 'Výchozí hodnota:', + 'Description' : 'Popis', + 'Field' : 'Pole', + 'General' : 'Obecné', + 'Generated with' : 'Vygenerováno pomocí', + 'Name' : 'Název', + 'No response values.' : 'Nebyly vráceny žádné hodnoty.', + 'optional' : 'volitelné', + 'Parameter' : 'Parametr', + 'Permission:' : 'Oprávnění:', + 'Response' : 'Odpověď', + 'Send' : 'Odeslat', + 'Send a Sample Request' : 'Odeslat ukázkový požadavek', + 'show up to version:' : 'zobrazit po verzi:', + 'Size range:' : 'Rozsah velikosti:', + 'Type' : 'Typ', + 'url' : 'url' + } +}); diff --git a/doc/locales/de.js b/doc/locales/de.js new file mode 100644 index 0000000..f66420d --- /dev/null +++ b/doc/locales/de.js @@ -0,0 +1,25 @@ +define({ + de: { + 'Allowed values:' : 'Erlaubte Werte:', + 'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern', + 'compare changes to:' : 'vergleiche Änderungen mit:', + 'compared to' : 'verglichen mit', + 'Default value:' : 'Standardwert:', + 'Description' : 'Beschreibung', + 'Field' : 'Feld', + 'General' : 'Allgemein', + 'Generated with' : 'Erstellt mit', + 'Name' : 'Name', + 'No response values.' : 'Keine Rückgabewerte.', + 'optional' : 'optional', + 'Parameter' : 'Parameter', + 'Permission:' : 'Berechtigung:', + 'Response' : 'Antwort', + 'Send' : 'Senden', + 'Send a Sample Request' : 'Eine Beispielanfrage senden', + 'show up to version:' : 'zeige bis zur Version:', + 'Size range:' : 'Größenbereich:', + 'Type' : 'Typ', + 'url' : 'url' + } +}); diff --git a/doc/locales/es.js b/doc/locales/es.js new file mode 100644 index 0000000..3d47e80 --- /dev/null +++ b/doc/locales/es.js @@ -0,0 +1,25 @@ +define({ + es: { + 'Allowed values:' : 'Valores permitidos:', + 'Compare all with predecessor': 'Comparar todo con versión anterior', + 'compare changes to:' : 'comparar cambios con:', + 'compared to' : 'comparado con', + 'Default value:' : 'Valor por defecto:', + 'Description' : 'Descripción', + 'Field' : 'Campo', + 'General' : 'General', + 'Generated with' : 'Generado con', + 'Name' : 'Nombre', + 'No response values.' : 'Sin valores en la respuesta.', + 'optional' : 'opcional', + 'Parameter' : 'Parámetro', + 'Permission:' : 'Permisos:', + 'Response' : 'Respuesta', + 'Send' : 'Enviar', + 'Send a Sample Request' : 'Enviar una petición de ejemplo', + 'show up to version:' : 'mostrar a versión:', + 'Size range:' : 'Tamaño de rango:', + 'Type' : 'Tipo', + 'url' : 'url' + } +}); diff --git a/doc/locales/fr.js b/doc/locales/fr.js new file mode 100644 index 0000000..100a642 --- /dev/null +++ b/doc/locales/fr.js @@ -0,0 +1,25 @@ +define({ + fr: { + 'Allowed values:' : 'Valeurs autorisées :', + 'Compare all with predecessor': 'Tout comparer avec ...', + 'compare changes to:' : 'comparer les changements à :', + 'compared to' : 'comparer à', + 'Default value:' : 'Valeur par défaut :', + 'Description' : 'Description', + 'Field' : 'Champ', + 'General' : 'Général', + 'Generated with' : 'Généré avec', + 'Name' : 'Nom', + 'No response values.' : 'Aucune valeur de réponse.', + 'optional' : 'optionnel', + 'Parameter' : 'Paramètre', + 'Permission:' : 'Permission :', + 'Response' : 'Réponse', + 'Send' : 'Envoyer', + 'Send a Sample Request' : 'Envoyer une requête représentative', + 'show up to version:' : 'Montrer à partir de la version :', + 'Size range:' : 'Ordre de grandeur :', + 'Type' : 'Type', + 'url' : 'url' + } +}); diff --git a/doc/locales/it.js b/doc/locales/it.js new file mode 100644 index 0000000..8117108 --- /dev/null +++ b/doc/locales/it.js @@ -0,0 +1,25 @@ +define({ + it: { + 'Allowed values:' : 'Valori permessi:', + 'Compare all with predecessor': 'Confronta tutto con versioni precedenti', + 'compare changes to:' : 'confronta modifiche con:', + 'compared to' : 'confrontato con', + 'Default value:' : 'Valore predefinito:', + 'Description' : 'Descrizione', + 'Field' : 'Campo', + 'General' : 'Generale', + 'Generated with' : 'Creato con', + 'Name' : 'Nome', + 'No response values.' : 'Nessun valore di risposta.', + 'optional' : 'opzionale', + 'Parameter' : 'Parametro', + 'Permission:' : 'Permessi:', + 'Response' : 'Risposta', + 'Send' : 'Invia', + 'Send a Sample Request' : 'Invia una richiesta di esempio', + 'show up to version:' : 'mostra alla versione:', + 'Size range:' : 'Intervallo dimensione:', + 'Type' : 'Tipo', + 'url' : 'url' + } +}); diff --git a/doc/locales/locale.js b/doc/locales/locale.js new file mode 100644 index 0000000..3530705 --- /dev/null +++ b/doc/locales/locale.js @@ -0,0 +1,51 @@ +define([ + './locales/ca.js', + './locales/cs.js', + './locales/de.js', + './locales/es.js', + './locales/fr.js', + './locales/it.js', + './locales/nl.js', + './locales/pl.js', + './locales/pt_br.js', + './locales/ro.js', + './locales/ru.js', + './locales/tr.js', + './locales/vi.js', + './locales/zh.js', + './locales/zh_cn.js' +], function() { + var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_'); + var language = langId.substr(0, 2); + var locales = {}; + + for (index in arguments) { + for (property in arguments[index]) + locales[property] = arguments[index][property]; + } + if ( ! locales['en']) + locales['en'] = {}; + + if ( ! locales[langId] && ! locales[language]) + language = 'en'; + + var locale = (locales[langId] ? locales[langId] : locales[language]); + + function __(text) { + var index = locale[text]; + if (index === undefined) + return text; + return index; + }; + + function setLanguage(language) { + locale = locales[language]; + } + + return { + __ : __, + locales : locales, + locale : locale, + setLanguage: setLanguage + }; +}); diff --git a/doc/locales/nl.js b/doc/locales/nl.js new file mode 100644 index 0000000..bddfeeb --- /dev/null +++ b/doc/locales/nl.js @@ -0,0 +1,25 @@ +define({ + nl: { + 'Allowed values:' : 'Toegestane waarden:', + 'Compare all with predecessor': 'Vergelijk alle met voorgaande versie', + 'compare changes to:' : 'vergelijk veranderingen met:', + 'compared to' : 'vergelijk met', + 'Default value:' : 'Standaard waarde:', + 'Description' : 'Omschrijving', + 'Field' : 'Veld', + 'General' : 'Algemeen', + 'Generated with' : 'Gegenereerd met', + 'Name' : 'Naam', + 'No response values.' : 'Geen response waardes.', + 'optional' : 'optioneel', + 'Parameter' : 'Parameter', + 'Permission:' : 'Permissie:', + 'Response' : 'Antwoorden', + 'Send' : 'Sturen', + 'Send a Sample Request' : 'Stuur een sample aanvragen', + 'show up to version:' : 'toon tot en met versie:', + 'Size range:' : 'Maatbereik:', + 'Type' : 'Type', + 'url' : 'url' + } +}); diff --git a/doc/locales/pl.js b/doc/locales/pl.js new file mode 100644 index 0000000..db645ee --- /dev/null +++ b/doc/locales/pl.js @@ -0,0 +1,25 @@ +define({ + pl: { + 'Allowed values:' : 'Dozwolone wartości:', + 'Compare all with predecessor': 'Porównaj z poprzednimi wersjami', + 'compare changes to:' : 'porównaj zmiany do:', + 'compared to' : 'porównaj do:', + 'Default value:' : 'Wartość domyślna:', + 'Description' : 'Opis', + 'Field' : 'Pole', + 'General' : 'Generalnie', + 'Generated with' : 'Wygenerowano z', + 'Name' : 'Nazwa', + 'No response values.' : 'Brak odpowiedzi.', + 'optional' : 'opcjonalny', + 'Parameter' : 'Parametr', + 'Permission:' : 'Uprawnienia:', + 'Response' : 'Odpowiedź', + 'Send' : 'Wyślij', + 'Send a Sample Request' : 'Wyślij przykładowe żądanie', + 'show up to version:' : 'pokaż do wersji:', + 'Size range:' : 'Zakres rozmiaru:', + 'Type' : 'Typ', + 'url' : 'url' + } +}); diff --git a/doc/locales/pt_br.js b/doc/locales/pt_br.js new file mode 100644 index 0000000..2bd78b0 --- /dev/null +++ b/doc/locales/pt_br.js @@ -0,0 +1,25 @@ +define({ + 'pt_br': { + 'Allowed values:' : 'Valores permitidos:', + 'Compare all with predecessor': 'Compare todos com antecessores', + 'compare changes to:' : 'comparar alterações com:', + 'compared to' : 'comparado com', + 'Default value:' : 'Valor padrão:', + 'Description' : 'Descrição', + 'Field' : 'Campo', + 'General' : 'Geral', + 'Generated with' : 'Gerado com', + 'Name' : 'Nome', + 'No response values.' : 'Sem valores de resposta.', + 'optional' : 'opcional', + 'Parameter' : 'Parâmetro', + 'Permission:' : 'Permissão:', + 'Response' : 'Resposta', + 'Send' : 'Enviar', + 'Send a Sample Request' : 'Enviar um Exemplo de Pedido', + 'show up to version:' : 'aparecer para a versão:', + 'Size range:' : 'Faixa de tamanho:', + 'Type' : 'Tipo', + 'url' : 'url' + } +}); diff --git a/doc/locales/ro.js b/doc/locales/ro.js new file mode 100644 index 0000000..8d4e4ed --- /dev/null +++ b/doc/locales/ro.js @@ -0,0 +1,25 @@ +define({ + ro: { + 'Allowed values:' : 'Valori permise:', + 'Compare all with predecessor': 'Compară toate cu versiunea precedentă', + 'compare changes to:' : 'compară cu versiunea:', + 'compared to' : 'comparat cu', + 'Default value:' : 'Valoare implicită:', + 'Description' : 'Descriere', + 'Field' : 'Câmp', + 'General' : 'General', + 'Generated with' : 'Generat cu', + 'Name' : 'Nume', + 'No response values.' : 'Nici o valoare returnată.', + 'optional' : 'opțional', + 'Parameter' : 'Parametru', + 'Permission:' : 'Permisiune:', + 'Response' : 'Răspuns', + 'Send' : 'Trimite', + 'Send a Sample Request' : 'Trimite o cerere de probă', + 'show up to version:' : 'arată până la versiunea:', + 'Size range:' : 'Interval permis:', + 'Type' : 'Tip', + 'url' : 'url' + } +}); diff --git a/doc/locales/ru.js b/doc/locales/ru.js new file mode 100644 index 0000000..c5f3382 --- /dev/null +++ b/doc/locales/ru.js @@ -0,0 +1,25 @@ +define({ + ru: { + 'Allowed values:' : 'Допустимые значения:', + 'Compare all with predecessor': 'Сравнить с предыдущей версией', + 'compare changes to:' : 'сравнить с:', + 'compared to' : 'в сравнении с', + 'Default value:' : 'По умолчанию:', + 'Description' : 'Описание', + 'Field' : 'Название', + 'General' : 'Общая информация', + 'Generated with' : 'Сгенерировано с помощью', + 'Name' : 'Название', + 'No response values.' : 'Нет значений для ответа.', + 'optional' : 'необязательный', + 'Parameter' : 'Параметр', + 'Permission:' : 'Разрешено:', + 'Response' : 'Ответ', + 'Send' : 'Отправить', + 'Send a Sample Request' : 'Отправить тестовый запрос', + 'show up to version:' : 'показать версию:', + 'Size range:' : 'Ограничения:', + 'Type' : 'Тип', + 'url' : 'URL' + } +}); diff --git a/doc/locales/tr.js b/doc/locales/tr.js new file mode 100644 index 0000000..5c64e52 --- /dev/null +++ b/doc/locales/tr.js @@ -0,0 +1,25 @@ +define({ + tr: { + 'Allowed values:' : 'İzin verilen değerler:', + 'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır', + 'compare changes to:' : 'değişiklikleri karşılaştır:', + 'compared to' : 'karşılaştır', + 'Default value:' : 'Varsayılan değer:', + 'Description' : 'Açıklama', + 'Field' : 'Alan', + 'General' : 'Genel', + 'Generated with' : 'Oluşturan', + 'Name' : 'İsim', + 'No response values.' : 'Dönüş verisi yok.', + 'optional' : 'opsiyonel', + 'Parameter' : 'Parametre', + 'Permission:' : 'İzin:', + 'Response' : 'Dönüş', + 'Send' : 'Gönder', + 'Send a Sample Request' : 'Örnek istek gönder', + 'show up to version:' : 'bu versiyona kadar göster:', + 'Size range:' : 'Boyut aralığı:', + 'Type' : 'Tip', + 'url' : 'url' + } +}); diff --git a/doc/locales/vi.js b/doc/locales/vi.js new file mode 100644 index 0000000..7ce7705 --- /dev/null +++ b/doc/locales/vi.js @@ -0,0 +1,25 @@ +define({ + vi: { + 'Allowed values:' : 'Giá trị chấp nhận:', + 'Compare all with predecessor': 'So sánh với tất cả phiên bản trước', + 'compare changes to:' : 'so sánh sự thay đổi với:', + 'compared to' : 'so sánh với', + 'Default value:' : 'Giá trị mặc định:', + 'Description' : 'Chú thích', + 'Field' : 'Trường dữ liệu', + 'General' : 'Tổng quan', + 'Generated with' : 'Được tạo bởi', + 'Name' : 'Tên', + 'No response values.' : 'Không có kết quả trả về.', + 'optional' : 'Tùy chọn', + 'Parameter' : 'Tham số', + 'Permission:' : 'Quyền hạn:', + 'Response' : 'Kết quả', + 'Send' : 'Gửi', + 'Send a Sample Request' : 'Gửi một yêu cầu mẫu', + 'show up to version:' : 'hiển thị phiên bản:', + 'Size range:' : 'Kích cỡ:', + 'Type' : 'Kiểu', + 'url' : 'liên kết' + } +}); diff --git a/doc/locales/zh.js b/doc/locales/zh.js new file mode 100644 index 0000000..ca5042f --- /dev/null +++ b/doc/locales/zh.js @@ -0,0 +1,25 @@ +define({ + zh: { + 'Allowed values​​:' : '允許值:', + 'Compare all with predecessor': '預先比較所有', + 'compare changes to:' : '比較變更:', + 'compared to' : '對比', + 'Default value:' : '預設值:', + 'Description' : '描述', + 'Field' : '欄位', + 'General' : '概括', + 'Generated with' : '生成工具', + 'Name' : '名稱', + 'No response values​​.' : '無對應資料.', + 'optional' : '選填', + 'Parameter' : '參數', + 'Permission:' : '權限:', + 'Response' : '回應', + 'Send' : '發送', + 'Send a Sample Request' : '發送試用需求', + 'show up to version:' : '顯示到版本:', + 'Size range:' : '區間:', + 'Type' : '類型', + 'url' : '網址' + } +}); diff --git a/doc/locales/zh_cn.js b/doc/locales/zh_cn.js new file mode 100644 index 0000000..50913e2 --- /dev/null +++ b/doc/locales/zh_cn.js @@ -0,0 +1,27 @@ +define({ + 'zh_cn': { + 'Allowed values:' : '允许值:', + 'Compare all with predecessor': '与所有较早的比较', + 'compare changes to:' : '将当前版本与指定版本比较:', + 'compared to' : '相比于', + 'Default value:' : '默认值:', + 'Description' : '描述', + 'Field' : '字段', + 'General' : '概要', + 'Generated with' : '基于', + 'Name' : '名称', + 'No response values.' : '无返回值.', + 'optional' : '可选', + 'Parameter' : '参数', + 'Parameters' : '参数', + 'Headers' : '头部参数', + 'Permission:' : '权限:', + 'Response' : '返回', + 'Send' : '发送', + 'Send a Sample Request' : '发送示例请求', + 'show up to version:' : '显示到指定版本:', + 'Size range:' : '取值范围:', + 'Type' : '类型', + 'url' : '网址' + } +}); diff --git a/doc/main.js b/doc/main.js new file mode 100644 index 0000000..8adc385 --- /dev/null +++ b/doc/main.js @@ -0,0 +1,903 @@ +require.config({ + paths: { + bootstrap: './vendor/bootstrap.min', + diffMatchPatch: './vendor/diff_match_patch.min', + handlebars: './vendor/handlebars.min', + handlebarsExtended: './utils/handlebars_helper', + jquery: './vendor/jquery.min', + locales: './locales/locale', + lodash: './vendor/lodash.custom.min', + pathToRegexp: './vendor/path-to-regexp/index', + prettify: './vendor/prettify/prettify', + semver: './vendor/semver.min', + utilsSampleRequest: './utils/send_sample_request', + webfontloader: './vendor/webfontloader', + list: './vendor/list.min' + }, + shim: { + bootstrap: { + deps: ['jquery'] + }, + diffMatchPatch: { + exports: 'diff_match_patch' + }, + handlebars: { + exports: 'Handlebars' + }, + handlebarsExtended: { + deps: ['jquery', 'handlebars'], + exports: 'Handlebars' + }, + prettify: { + exports: 'prettyPrint' + } + }, + urlArgs: 'v=' + (new Date()).getTime(), + waitSeconds: 15 +}); + +require([ + 'jquery', + 'lodash', + 'locales', + 'handlebarsExtended', + './api_project.js', + './api_data.js', + 'prettify', + 'utilsSampleRequest', + 'semver', + 'webfontloader', + 'bootstrap', + 'pathToRegexp', + 'list' +], function($, _, locale, Handlebars, apiProject, apiData, prettyPrint, sampleRequest, semver, WebFont) { + + // load google web fonts + loadGoogleFontCss(); + + var api = apiData.api; + + // + // Templates + // + var templateHeader = Handlebars.compile( $('#template-header').html() ); + var templateFooter = Handlebars.compile( $('#template-footer').html() ); + var templateArticle = Handlebars.compile( $('#template-article').html() ); + var templateCompareArticle = Handlebars.compile( $('#template-compare-article').html() ); + var templateGenerator = Handlebars.compile( $('#template-generator').html() ); + var templateProject = Handlebars.compile( $('#template-project').html() ); + var templateSections = Handlebars.compile( $('#template-sections').html() ); + var templateSidenav = Handlebars.compile( $('#template-sidenav').html() ); + + // + // apiProject defaults + // + if ( ! apiProject.template) + apiProject.template = {}; + + if (apiProject.template.withCompare == null) + apiProject.template.withCompare = true; + + if (apiProject.template.withGenerator == null) + apiProject.template.withGenerator = true; + + if (apiProject.template.forceLanguage) + locale.setLanguage(apiProject.template.forceLanguage); + + if (apiProject.template.aloneDisplay == null) + apiProject.template.aloneDisplay = false; + + // Setup jQuery Ajax + $.ajaxSetup(apiProject.template.jQueryAjaxSetup); + + // + // Data transform + // + // grouped by group + var apiByGroup = _.groupBy(api, function(entry) { + return entry.group; + }); + + // grouped by group and name + var apiByGroupAndName = {}; + $.each(apiByGroup, function(index, entries) { + apiByGroupAndName[index] = _.groupBy(entries, function(entry) { + return entry.name; + }); + }); + + // + // sort api within a group by title ASC and custom order + // + var newList = []; + var umlauts = { 'ä': 'ae', 'ü': 'ue', 'ö': 'oe', 'ß': 'ss' }; // TODO: remove in version 1.0 + $.each (apiByGroupAndName, function(index, groupEntries) { + // get titles from the first entry of group[].name[] (name has versioning) + var titles = []; + $.each (groupEntries, function(titleName, entries) { + var title = entries[0].title; + if(title !== undefined) { + title.toLowerCase().replace(/[äöüß]/g, function($0) { return umlauts[$0]; }); + titles.push(title + '#~#' + titleName); // '#~#' keep reference to titleName after sorting + } + }); + // sort by name ASC + titles.sort(); + + // custom order + if (apiProject.order) + titles = sortByOrder(titles, apiProject.order, '#~#'); + + // add single elements to the new list + titles.forEach(function(name) { + var values = name.split('#~#'); + var key = values[1]; + groupEntries[key].forEach(function(entry) { + newList.push(entry); + }); + }); + }); + // api overwrite with ordered list + api = newList; + + // + // Group- and Versionlists + // + var apiGroups = {}; + var apiGroupTitles = {}; + var apiVersions = {}; + apiVersions[apiProject.version] = 1; + + $.each(api, function(index, entry) { + apiGroups[entry.group] = 1; + apiGroupTitles[entry.group] = entry.groupTitle || entry.group; + apiVersions[entry.version] = 1; + }); + + // sort groups + apiGroups = Object.keys(apiGroups); + apiGroups.sort(); + + // custom order + if (apiProject.order) + apiGroups = sortByOrder(apiGroups, apiProject.order); + + // sort versions DESC + apiVersions = Object.keys(apiVersions); + apiVersions.sort(semver.compare); + apiVersions.reverse(); + + // + // create Navigationlist + // + var nav = []; + apiGroups.forEach(function(group) { + // Mainmenu entry + nav.push({ + group: group, + isHeader: true, + title: apiGroupTitles[group] + }); + + // Submenu + var oldName = ''; + api.forEach(function(entry) { + if (entry.group === group) { + if (oldName !== entry.name) { + nav.push({ + title: entry.title, + group: group, + name: entry.name, + type: entry.type, + version: entry.version, + url: entry.url + }); + } else { + nav.push({ + title: entry.title, + group: group, + hidden: true, + name: entry.name, + type: entry.type, + version: entry.version, + url: entry.url + }); + } + oldName = entry.name; + } + }); + }); + + /** + * Add navigation items by analyzing the HTML content and searching for h1 and h2 tags + * @param nav Object the navigation array + * @param content string the compiled HTML content + * @param index where to insert items + * @return boolean true if any good-looking (i.e. with a group identifier)

      tag was found + */ + function add_nav(nav, content, index) { + var found_level1 = false; + if ( ! content) { + return found_level1; + } + var topics = content.match(/(.+?)<\/h(1|2)>/gi); + if ( topics ) { + topics.forEach(function(entry) { + var level = entry.substring(2,3); + var title = entry.replace(/<.+?>/g, ''); // Remove all HTML tags for the title + var entry_tags = entry.match(/id="api-([^\-]+)(?:-(.+))?"/); // Find the group and name in the id property + var group = (entry_tags ? entry_tags[1] : null); + var name = (entry_tags ? entry_tags[2] : null); + if (level==1 && title && group) { + nav.splice(index, 0, { + group: group, + isHeader: true, + title: title, + isFixed: true + }); + index++; + found_level1 = true; + } + if (level==2 && title && group && name) { + nav.splice(index, 0, { + group: group, + name: name, + isHeader: false, + title: title, + isFixed: false, + version: '1.0' + }); + index++; + } + }); + } + return found_level1; + } + + // Mainmenu Header entry + if (apiProject.header) { + var found_level1 = add_nav(nav, apiProject.header.content, 0); // Add level 1 and 2 titles + if (!found_level1) { // If no Level 1 tags were found, make a title + nav.unshift({ + group: '_', + isHeader: true, + title: (apiProject.header.title == null) ? locale.__('General') : apiProject.header.title, + isFixed: true + }); + } + } + + // Mainmenu Footer entry + if (apiProject.footer) { + var last_nav_index = nav.length; + var found_level1 = add_nav(nav, apiProject.footer.content, nav.length); // Add level 1 and 2 titles + if (!found_level1 && apiProject.footer.title != null) { // If no Level 1 tags were found, make a title + nav.splice(last_nav_index, 0, { + group: '_footer', + isHeader: true, + title: apiProject.footer.title, + isFixed: true + }); + } + } + + // render pagetitle + var title = apiProject.title ? apiProject.title : 'apiDoc: ' + apiProject.name + ' - ' + apiProject.version; + $(document).attr('title', title); + + // remove loader + $('#loader').remove(); + + // render sidenav + var fields = { + nav: nav + }; + $('#sidenav').append( templateSidenav(fields) ); + + // render Generator + $('#generator').append( templateGenerator(apiProject) ); + + // render Project + _.extend(apiProject, { versions: apiVersions}); + $('#project').append( templateProject(apiProject) ); + + // render apiDoc, header/footer documentation + if (apiProject.header) + $('#header').append( templateHeader(apiProject.header) ); + + if (apiProject.footer) + $('#footer').append( templateFooter(apiProject.footer) ); + + // + // Render Sections and Articles + // + var articleVersions = {}; + var content = ''; + apiGroups.forEach(function(groupEntry) { + var articles = []; + var oldName = ''; + var fields = {}; + var title = groupEntry; + var description = ''; + articleVersions[groupEntry] = {}; + + // render all articles of a group + api.forEach(function(entry) { + if(groupEntry === entry.group) { + if (oldName !== entry.name) { + // determine versions + api.forEach(function(versionEntry) { + if (groupEntry === versionEntry.group && entry.name === versionEntry.name) { + if ( ! articleVersions[entry.group].hasOwnProperty(entry.name) ) { + articleVersions[entry.group][entry.name] = []; + } + articleVersions[entry.group][entry.name].push(versionEntry.version); + } + }); + fields = { + article: entry, + versions: articleVersions[entry.group][entry.name] + }; + } else { + fields = { + article: entry, + hidden: true, + versions: articleVersions[entry.group][entry.name] + }; + } + + // add prefix URL for endpoint unless it's already absolute + if (apiProject.url) { + if (fields.article.url.substr(0, 4).toLowerCase() !== 'http') { + fields.article.url = apiProject.url + fields.article.url; + } + } + + addArticleSettings(fields, entry); + + if (entry.groupTitle) + title = entry.groupTitle; + + // TODO: make groupDescription compareable with older versions (not important for the moment) + if (entry.groupDescription) + description = entry.groupDescription; + + articles.push({ + article: templateArticle(fields), + group: entry.group, + name: entry.name, + aloneDisplay: apiProject.template.aloneDisplay + }); + oldName = entry.name; + } + }); + + // render Section with Articles + var fields = { + group: groupEntry, + title: title, + description: description, + articles: articles, + aloneDisplay: apiProject.template.aloneDisplay + }; + content += templateSections(fields); + }); + $('#sections').append( content ); + + // Bootstrap Scrollspy + $(this).scrollspy({ target: '#scrollingNav', offset: 18 }); + + // Content-Scroll on Navigation click. + $('.sidenav').find('a').on('click', function(e) { + e.preventDefault(); + var id = $(this).attr('href'); + if ($(id).length > 0) + $('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 400); + window.location.hash = $(this).attr('href'); + }); + + // Quickjump on Pageload to hash position. + if(window.location.hash) { + var id = window.location.hash; + if ($(id).length > 0) + $('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 0); + } + + /** + * Check if Parameter (sub) List has a type Field. + * Example: @apiSuccess varname1 No type. + * @apiSuccess {String} varname2 With type. + * + * @param {Object} fields + */ + function _hasTypeInFields(fields) { + var result = false; + $.each(fields, function(name) { + result = result || _.some(fields[name], function(item) { return item.type; }); + }); + return result; + } + + /** + * On Template changes, recall plugins. + */ + function initDynamic() { + // Bootstrap popover + $('button[data-toggle="popover"]').popover().click(function(e) { + e.preventDefault(); + }); + + var version = $('#version strong').html(); + $('#sidenav li').removeClass('is-new'); + if (apiProject.template.withCompare) { + $('#sidenav li[data-version=\'' + version + '\']').each(function(){ + var group = $(this).data('group'); + var name = $(this).data('name'); + var length = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').length; + var index = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').index($(this)); + if (length === 1 || index === (length - 1)) + $(this).addClass('is-new'); + }); + } + + // tabs + $('.nav-tabs-examples a').click(function (e) { + e.preventDefault(); + $(this).tab('show'); + }); + $('.nav-tabs-examples').find('a:first').tab('show'); + + // sample header-content-type switch + $('.sample-header-content-type-switch').change(function () { + var paramName = '.' + $(this).attr('name') + '-fields'; + var bodyName = '.' + $(this).attr('name') + '-body'; + var selectName = 'select[name=' + $(this).attr('name') + ']'; + if ($(this).val() == 'body-json') { + $(selectName).val('undefined'); + $(this).val('body-json'); + $(paramName).removeClass('hide'); + $(this).parent().nextAll(paramName).first().addClass('hide'); + $(bodyName).addClass('hide'); + $(this).parent().nextAll(bodyName).first().removeClass('hide'); + } else if ($(this).val() == "body-form-data") { + $(selectName).val('undefined'); + $(this).val('body-form-data'); + $(bodyName).addClass('hide'); + $(paramName).removeClass('hide'); + } else { + $(this).parent().nextAll(paramName).first().removeClass('hide') + $(this).parent().nextAll(bodyName).first().addClass('hide'); + } + $(this).prev('.sample-request-switch').prop('checked', true); + }); + + // sample request switch + $('.sample-request-switch').click(function (e) { + var paramName = '.' + $(this).attr('name') + '-fields'; + var bodyName = '.' + $(this).attr('name') + '-body'; + var select = $(this).next('.' + $(this).attr('name') + '-select').val(); + if($(this).prop("checked")){ + if (select == 'body-json'){ + $(this).parent().nextAll(bodyName).first().removeClass('hide'); + }else { + $(this).parent().nextAll(paramName).first().removeClass('hide'); + } + }else { + if (select == 'body-json'){ + $(this).parent().nextAll(bodyName).first().addClass('hide'); + }else { + $(this).parent().nextAll(paramName).first().addClass('hide'); + } + } + }); + + if (apiProject.template.aloneDisplay){ + //show group + $('.show-group').click(function () { + var apiGroup = '.' + $(this).attr('data-group') + '-group'; + var apiGroupArticle = '.' + $(this).attr('data-group') + '-article'; + $(".show-api-group").addClass('hide'); + $(apiGroup).removeClass('hide'); + $(".show-api-article").addClass('hide'); + $(apiGroupArticle).removeClass('hide'); + }); + + //show api + $('.show-api').click(function () { + var apiName = '.' + $(this).attr('data-name') + '-article'; + var apiGroup = '.' + $(this).attr('data-group') + '-group'; + $(".show-api-group").addClass('hide'); + $(apiGroup).removeClass('hide'); + $(".show-api-article").addClass('hide'); + $(apiName).removeClass('hide'); + }); + } + + // call scrollspy refresh method + $(window).scrollspy('refresh'); + + // init modules + sampleRequest.initDynamic(); + } + initDynamic(); + + if (apiProject.template.aloneDisplay) { + var hashVal = window.location.hash; + if (hashVal != null && hashVal.length !== 0) { + $("." + hashVal.slice(1) + "-init").click(); + } + } + + // Pre- / Code-Format + prettyPrint(); + + // + // HTML-Template specific jQuery-Functions + // + // Change Main Version + $('#versions li.version a').on('click', function(e) { + e.preventDefault(); + + var selectedVersion = $(this).html(); + $('#version strong').html(selectedVersion); + + // hide all + $('article').addClass('hide'); + $('#sidenav li:not(.nav-fixed)').addClass('hide'); + + // show 1st equal or lower Version of each entry + $('article[data-version]').each(function(index) { + var group = $(this).data('group'); + var name = $(this).data('name'); + var version = $(this).data('version'); + + if (semver.lte(version, selectedVersion)) { + if ($('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible').length === 0) { + // enable Article + $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide'); + // enable Navigation + $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide'); + $('#sidenav li.nav-header[data-group=\'' + group + '\']').removeClass('hide'); + } + } + }); + + // show 1st equal or lower Version of each entry + $('article[data-version]').each(function(index) { + var group = $(this).data('group'); + $('section#api-' + group).removeClass('hide'); + if ($('section#api-' + group + ' article:visible').length === 0) { + $('section#api-' + group).addClass('hide'); + } else { + $('section#api-' + group).removeClass('hide'); + } + }); + + initDynamic(); + return; + }); + + // compare all article with their predecessor + $('#compareAllWithPredecessor').on('click', changeAllVersionCompareTo); + + // change version of an article + $('article .versions li.version a').on('click', changeVersionCompareTo); + + // compare url-parameter + $.urlParam = function(name) { + var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); + return (results && results[1]) ? results[1] : null; + }; + + if ($.urlParam('compare')) { + // URL Paramter ?compare=1 is set + $('#compareAllWithPredecessor').trigger('click'); + + if (window.location.hash) { + var id = window.location.hash; + $('html,body').animate({ scrollTop: parseInt($(id).offset().top) - 18 }, 0); + } + } + + /** + * Initialize search + */ + var options = { + valueNames: [ 'nav-list-item','nav-list-url-item'] + }; + var endpointsList = new List('scrollingNav', options); + + /** + * Set initial focus to search input + */ + $('#scrollingNav .sidenav-search input.search').focus(); + + /** + * Detect ESC key to reset search + */ + $(document).keyup(function(e) { + if (e.keyCode === 27) $('span.search-reset').click(); + }); + + /** + * Search reset + */ + $('span.search-reset').on('click', function() { + $('#scrollingNav .sidenav-search input.search') + .val("") + .focus() + ; + endpointsList.search(); + }); + + /** + * Change version of an article to compare it to an other version. + */ + function changeVersionCompareTo(e) { + e.preventDefault(); + + var $root = $(this).parents('article'); + var selectedVersion = $(this).html(); + var $button = $root.find('.version'); + var currentVersion = $button.find('strong').html(); + $button.find('strong').html(selectedVersion); + + var group = $root.data('group'); + var name = $root.data('name'); + var version = $root.data('version'); + + var compareVersion = $root.data('compare-version'); + + if (compareVersion === selectedVersion) + return; + + if ( ! compareVersion && version == selectedVersion) + return; + + if (compareVersion && articleVersions[group][name][0] === selectedVersion || version === selectedVersion) { + // the version of the entry is set to the highest version (reset) + resetArticle(group, name, version); + } else { + var $compareToArticle = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + selectedVersion + '\']'); + + var sourceEntry = {}; + var compareEntry = {}; + $.each(apiByGroupAndName[group][name], function(index, entry) { + if (entry.version === version) + sourceEntry = entry; + if (entry.version === selectedVersion) + compareEntry = entry; + }); + + var fields = { + article: sourceEntry, + compare: compareEntry, + versions: articleVersions[group][name] + }; + + // add unique id + // TODO: replace all group-name-version in template with id. + fields.article.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version; + fields.article.id = fields.article.id.replace(/\./g, '_'); + + fields.compare.id = fields.compare.group + '-' + fields.compare.name + '-' + fields.compare.version; + fields.compare.id = fields.compare.id.replace(/\./g, '_'); + + var entry = sourceEntry; + if (entry.parameter && entry.parameter.fields) + fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); + + if (entry.error && entry.error.fields) + fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields); + + if (entry.success && entry.success.fields) + fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); + + if (entry.info && entry.info.fields) + fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields); + + var entry = compareEntry; + if (fields._hasTypeInParameterFields !== true && entry.parameter && entry.parameter.fields) + fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); + + if (fields._hasTypeInErrorFields !== true && entry.error && entry.error.fields) + fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields); + + if (fields._hasTypeInSuccessFields !== true && entry.success && entry.success.fields) + fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); + + if (fields._hasTypeInInfoFields !== true && entry.info && entry.info.fields) + fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields); + + var content = templateCompareArticle(fields); + $root.after(content); + var $content = $root.next(); + + // Event on.click re-assign + $content.find('.versions li.version a').on('click', changeVersionCompareTo); + + // select navigation + $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + currentVersion + '\']').addClass('has-modifications'); + + $root.remove(); + // TODO: on change main version or select the highest version re-render + } + + initDynamic(); + } + + /** + * Compare all currently selected Versions with their predecessor. + */ + function changeAllVersionCompareTo(e) { + e.preventDefault(); + $('article:visible .versions').each(function(){ + var $root = $(this).parents('article'); + var currentVersion = $root.data('version'); + var $foundElement = null; + $(this).find('li.version a').each(function() { + var selectVersion = $(this).html(); + if (selectVersion < currentVersion && ! $foundElement) + $foundElement = $(this); + }); + + if($foundElement) + $foundElement.trigger('click'); + }); + initDynamic(); + } + + /** + * Sort the fields. + */ + function sortFields(fields_object) { + $.each(fields_object, function (key, fields) { + + var reversed = fields.slice().reverse() + + var max_dot_count = Math.max.apply(null, reversed.map(function (item) { + return item.field.split(".").length - 1; + })) + + for (var dot_count = 1; dot_count <= max_dot_count; dot_count++) { + reversed.forEach(function (item, index) { + var parts = item.field.split("."); + if (parts.length - 1 == dot_count) { + var fields_names = fields.map(function (item) { return item.field; }); + if (parts.slice(1).length >= 1) { + var prefix = parts.slice(0, parts.length - 1).join("."); + var prefix_index = fields_names.indexOf(prefix); + if (prefix_index > -1) { + fields.splice(fields_names.indexOf(item.field), 1); + fields.splice(prefix_index + 1, 0, item); + } + } + } + }); + } + }); + } + + /** + * Add article settings. + */ + function addArticleSettings(fields, entry) { + // add unique id + // TODO: replace all group-name-version in template with id. + fields.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version; + fields.id = fields.id.replace(/\./g, '_'); + + if (entry.header && entry.header.fields) { + sortFields(entry.header.fields); + fields._hasTypeInHeaderFields = _hasTypeInFields(entry.header.fields); + } + + if (entry.parameter && entry.parameter.fields) { + sortFields(entry.parameter.fields); + fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); + } + + if (entry.error && entry.error.fields) { + sortFields(entry.error.fields); + fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields); + } + + if (entry.success && entry.success.fields) { + sortFields(entry.success.fields); + fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); + } + + if (entry.info && entry.info.fields) { + sortFields(entry.info.fields); + fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields); + } + + // add template settings + fields.template = apiProject.template; + } + + /** + * Render Article. + */ + function renderArticle(group, name, version) { + var entry = {}; + $.each(apiByGroupAndName[group][name], function(index, currentEntry) { + if (currentEntry.version === version) + entry = currentEntry; + }); + var fields = { + article: entry, + versions: articleVersions[group][name] + }; + + addArticleSettings(fields, entry); + + return templateArticle(fields); + } + + /** + * Render original Article and remove the current visible Article. + */ + function resetArticle(group, name, version) { + var $root = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible'); + var content = renderArticle(group, name, version); + + $root.after(content); + var $content = $root.next(); + + // Event on.click needs to be reassigned (should actually work with on ... automatically) + $content.find('.versions li.version a').on('click', changeVersionCompareTo); + + $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('has-modifications'); + + $root.remove(); + return; + } + + /** + * Load google fonts. + */ + function loadGoogleFontCss() { + WebFont.load({ + active: function() { + // Update scrollspy + $(window).scrollspy('refresh') + }, + google: { + families: ['Source Code Pro', 'Source Sans Pro:n4,n6,n7'] + } + }); + } + + /** + * Return ordered entries by custom order and append not defined entries to the end. + * @param {String[]} elements + * @param {String[]} order + * @param {String} splitBy + * @return {String[]} Custom ordered list. + */ + function sortByOrder(elements, order, splitBy) { + var results = []; + order.forEach (function(name) { + if (splitBy) + elements.forEach (function(element) { + var parts = element.split(splitBy); + var key = parts[0]; // reference keep for sorting + if (key == name || parts[1] == name) + results.push(element); + }); + else + elements.forEach (function(key) { + if (key == name) + results.push(name); + }); + }); + // Append all other entries that ar not defined in order + elements.forEach(function(element) { + if (results.indexOf(element) === -1) + results.push(element); + }); + return results; + } + +}); diff --git a/doc/utils/.pydio b/doc/utils/.pydio new file mode 100644 index 0000000..962dd36 --- /dev/null +++ b/doc/utils/.pydio @@ -0,0 +1 @@ +5d8622cb-9563-42ab-8df6-e4290643baf3 \ No newline at end of file diff --git a/doc/utils/handlebars_helper.js b/doc/utils/handlebars_helper.js new file mode 100644 index 0000000..a5d5c4f --- /dev/null +++ b/doc/utils/handlebars_helper.js @@ -0,0 +1,357 @@ +define([ + 'locales', + 'handlebars', + 'diffMatchPatch' +], function(locale, Handlebars, DiffMatchPatch) { + + /** + * Return a text as markdown. + * Currently only a little helper to replace apidoc-inline Links (#Group:Name). + * Should be replaced with a full markdown lib. + * @param string text + */ + Handlebars.registerHelper('markdown', function(text) { + if ( ! text ) { + return text; + } + text = text.replace(/((\[(.*?)\])?\(#)((.+?):(.+?))(\))/mg, function(match, p1, p2, p3, p4, p5, p6) { + var link = p3 || p5 + '/' + p6; + return '' + link + ''; + }); + return text; + }); + + /** + * start/stop timer for simple performance check. + */ + var timer; + Handlebars.registerHelper('startTimer', function(text) { + timer = new Date(); + return ''; + }); + + Handlebars.registerHelper('stopTimer', function(text) { + console.log(new Date() - timer); + return ''; + }); + + /** + * Return localized Text. + * @param string text + */ + Handlebars.registerHelper('__', function(text) { + return locale.__(text); + }); + + /** + * Console log. + * @param mixed obj + */ + Handlebars.registerHelper('cl', function(obj) { + console.log(obj); + return ''; + }); + + /** + * Replace underscore with space. + * @param string text + */ + Handlebars.registerHelper('underscoreToSpace', function(text) { + return text.replace(/(_+)/g, ' '); + }); + + /** + * + */ + Handlebars.registerHelper('assign', function(name) { + if(arguments.length > 0) { + var type = typeof(arguments[1]); + var arg = null; + if(type === 'string' || type === 'number' || type === 'boolean') arg = arguments[1]; + Handlebars.registerHelper(name, function() { return arg; }); + } + return ''; + }); + + /** + * + */ + Handlebars.registerHelper('nl2br', function(text) { + return _handlebarsNewlineToBreak(text); + }); + + /** + * + */ + Handlebars.registerHelper('if_eq', function(context, options) { + var compare = context; + // Get length if context is an object + if (context instanceof Object && ! (options.hash.compare instanceof Object)) + compare = Object.keys(context).length; + + if (compare === options.hash.compare) + return options.fn(this); + + return options.inverse(this); + }); + + /** + * + */ + Handlebars.registerHelper('if_gt', function(context, options) { + var compare = context; + // Get length if context is an object + if (context instanceof Object && ! (options.hash.compare instanceof Object)) + compare = Object.keys(context).length; + + if(compare > options.hash.compare) + return options.fn(this); + + return options.inverse(this); + }); + + /** + * + */ + var templateCache = {}; + Handlebars.registerHelper('subTemplate', function(name, sourceContext) { + if ( ! templateCache[name]) + templateCache[name] = Handlebars.compile($('#template-' + name).html()); + + var template = templateCache[name]; + var templateContext = $.extend({}, this, sourceContext.hash); + return new Handlebars.SafeString( template(templateContext) ); + }); + + /** + * + */ + Handlebars.registerHelper('toLowerCase', function(value) { + return (value && typeof value === 'string') ? value.toLowerCase() : ''; + }); + + /** + * + */ + Handlebars.registerHelper('splitFill', function(value, splitChar, fillChar) { + var splits = value.split(splitChar); + return new Array(splits.length).join(fillChar) + splits[splits.length - 1]; + }); + + /** + * Convert Newline to HTML-Break (nl2br). + * + * @param {String} text + * @returns {String} + */ + function _handlebarsNewlineToBreak(text) { + return ('' + text).replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '
      ' + '$2'); + } + + /** + * + */ + Handlebars.registerHelper('each_compare_list_field', function(source, compare, options) { + var fieldName = options.hash.field; + var newSource = []; + if (source) { + source.forEach(function(entry) { + var values = entry; + values['key'] = entry[fieldName]; + newSource.push(values); + }); + } + + var newCompare = []; + if (compare) { + compare.forEach(function(entry) { + var values = entry; + values['key'] = entry[fieldName]; + newCompare.push(values); + }); + } + return _handlebarsEachCompared('key', newSource, newCompare, options); + }); + + /** + * + */ + Handlebars.registerHelper('each_compare_keys', function(source, compare, options) { + var newSource = []; + if (source) { + var sourceFields = Object.keys(source); + sourceFields.forEach(function(name) { + var values = {}; + values['value'] = source[name]; + values['key'] = name; + newSource.push(values); + }); + } + + var newCompare = []; + if (compare) { + var compareFields = Object.keys(compare); + compareFields.forEach(function(name) { + var values = {}; + values['value'] = compare[name]; + values['key'] = name; + newCompare.push(values); + }); + } + return _handlebarsEachCompared('key', newSource, newCompare, options); + }); + + /** + * + */ + Handlebars.registerHelper('each_compare_field', function(source, compare, options) { + return _handlebarsEachCompared('field', source, compare, options); + }); + + /** + * + */ + Handlebars.registerHelper('each_compare_title', function(source, compare, options) { + return _handlebarsEachCompared('title', source, compare, options); + }); + + /** + * + */ + Handlebars.registerHelper('reformat', function(source, type){ + if (type == 'json') + try { + return JSON.stringify(JSON.parse(source.trim()),null, " "); + } catch(e) { + + } + return source + }); + + /** + * + */ + Handlebars.registerHelper('showDiff', function(source, compare, options) { + var ds = ''; + if(source === compare) { + ds = source; + } else { + if( ! source) + return compare; + + if( ! compare) + return source; + + var d = diffMatchPatch.diff_main(compare, source); + diffMatchPatch.diff_cleanupSemantic(d); + ds = diffMatchPatch.diff_prettyHtml(d); + ds = ds.replace(/¶/gm, ''); + } + if(options === 'nl2br') + ds = _handlebarsNewlineToBreak(ds); + + return ds; + }); + + /** + * + */ + function _handlebarsEachCompared(fieldname, source, compare, options) + { + var dataList = []; + var index = 0; + if(source) { + source.forEach(function(sourceEntry) { + var found = false; + if (compare) { + compare.forEach(function(compareEntry) { + if(sourceEntry[fieldname] === compareEntry[fieldname]) { + var data = { + typeSame: true, + source: sourceEntry, + compare: compareEntry, + index: index + }; + dataList.push(data); + found = true; + index++; + } + }); + } + if ( ! found) { + var data = { + typeIns: true, + source: sourceEntry, + index: index + }; + dataList.push(data); + index++; + } + }); + } + + if (compare) { + compare.forEach(function(compareEntry) { + var found = false; + if (source) { + source.forEach(function(sourceEntry) { + if(sourceEntry[fieldname] === compareEntry[fieldname]) + found = true; + }); + } + if ( ! found) { + var data = { + typeDel: true, + compare: compareEntry, + index: index + }; + dataList.push(data); + index++; + } + }); + } + + var ret = ''; + var length = dataList.length; + for (var index in dataList) { + if(index == (length - 1)) + dataList[index]['_last'] = true; + ret = ret + options.fn(dataList[index]); + } + return ret; + } + + var diffMatchPatch = new DiffMatchPatch(); + + /** + * Overwrite Colors + */ + DiffMatchPatch.prototype.diff_prettyHtml = function(diffs) { + var html = []; + var pattern_amp = /&/g; + var pattern_lt = //g; + var pattern_para = /\n/g; + for (var x = 0; x < diffs.length; x++) { + var op = diffs[x][0]; // Operation (insert, delete, equal) + var data = diffs[x][1]; // Text of change. + var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<') + .replace(pattern_gt, '>').replace(pattern_para, '¶
      '); + switch (op) { + case DIFF_INSERT: + html[x] = '' + text + ''; + break; + case DIFF_DELETE: + html[x] = '' + text + ''; + break; + case DIFF_EQUAL: + html[x] = '' + text + ''; + break; + } + } + return html.join(''); + }; + + // Exports + return Handlebars; +}); diff --git a/doc/utils/send_sample_request.js b/doc/utils/send_sample_request.js new file mode 100755 index 0000000..714e6b8 --- /dev/null +++ b/doc/utils/send_sample_request.js @@ -0,0 +1,243 @@ +define([ + 'jquery', + 'lodash' +], function($, _) { + + var initDynamic = function() { + // Button send + $(".sample-request-send").off("click"); + $(".sample-request-send").on("click", function(e) { + e.preventDefault(); + var $root = $(this).parents("article"); + var group = $root.data("group"); + var name = $root.data("name"); + var version = $root.data("version"); + sendSampleRequest(group, name, version, $(this).data("sample-request-type")); + }); + + // Button clear + $(".sample-request-clear").off("click"); + $(".sample-request-clear").on("click", function(e) { + e.preventDefault(); + var $root = $(this).parents("article"); + var group = $root.data("group"); + var name = $root.data("name"); + var version = $root.data("version"); + clearSampleRequest(group, name, version); + }); + }; // initDynamic + + function sendSampleRequest(group, name, version, type) + { + var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]'); + + // Optional header + var header = {}; + $root.find(".sample-request-header:checked").each(function(i, element) { + var group = $(element).data("sample-request-header-group-id"); + $root.find("[data-sample-request-header-group=\"" + group + "\"]").each(function(i, element) { + var key = $(element).data("sample-request-header-name"); + var value = element.value; + if (typeof element.optional === 'undefined') { + element.optional = true; + } + if ( ! element.optional && element.defaultValue !== '') { + value = element.defaultValue; + } + header[key] = value; + }); + }); + + + // create JSON dictionary of parameters + var param = {}; + var paramType = {}; + var bodyFormData = {}; + var bodyFormDataType = {}; + var bodyJson = ''; + $root.find(".sample-request-param:checked").each(function(i, element) { + var group = $(element).data("sample-request-param-group-id"); + var contentType = $(element).nextAll('.sample-header-content-type-switch').first().val(); + if (contentType == "body-json"){ + $root.find("[data-sample-request-body-group=\"" + group + "\"]").not(function(){ + return $(this).val() == "" && $(this).is("[data-sample-request-param-optional='true']"); + }).each(function(i, element) { + if (isJson(element.value)){ + header['Content-Type'] = 'application/json'; + bodyJson = element.value; + } + }); + }else { + $root.find("[data-sample-request-param-group=\"" + group + "\"]").not(function(){ + return $(this).val() == "" && $(this).is("[data-sample-request-param-optional='true']"); + }).each(function(i, element) { + var key = $(element).data("sample-request-param-name"); + var value = element.value; + if ( ! element.optional && element.defaultValue !== '') { + value = element.defaultValue; + } + if (contentType == "body-form-data"){ + header['Content-Type'] = 'multipart/form-data' + bodyFormData[key] = value; + bodyFormDataType[key] = $(element).next().text(); + }else { + param[key] = value; + paramType[key] = $(element).next().text(); + } + }); + } + }); + + // grab user-inputted URL + var url = $root.find(".sample-request-url").val(); + + //Convert {param} form to :param + url = url.replace(/{/,':').replace(/}/,''); + + // Insert url parameter + var pattern = pathToRegexp(url, null); + var matches = pattern.exec(url); + for (var i = 1; i < matches.length; i++) { + var key = matches[i].substr(1); + if (param[key] !== undefined) { + url = url.replace(matches[i], encodeURIComponent(param[key])); + + // remove URL parameters from list + delete param[key]; + } + } // for + + + //add url search parameter + if (header['Content-Type'] == 'application/json' ){ + url = url + encodeSearchParams(param); + param = bodyJson; + }else if (header['Content-Type'] == 'multipart/form-data'){ + url = url + encodeSearchParams(param); + param = bodyFormData; + } + + $root.find(".sample-request-response").fadeTo(250, 1); + $root.find(".sample-request-response-json").html("Loading..."); + refreshScrollSpy(); + + // send AJAX request, catch success or error callback + var ajaxRequest = { + url : url, + headers : header, + data : param, + type : type.toUpperCase(), + success : displaySuccess, + error : displayError + }; + + $.ajax(ajaxRequest); + + + function displaySuccess(data, status, jqXHR) { + var jsonResponse; + try { + jsonResponse = JSON.parse(jqXHR.responseText); + jsonResponse = JSON.stringify(jsonResponse, null, 4); + } catch (e) { + jsonResponse = jqXHR.responseText; + } + $root.find(".sample-request-response-json").text(jsonResponse); + refreshScrollSpy(); + }; + + function displayError(jqXHR, textStatus, error) { + var message = "Error " + jqXHR.status + ": " + error; + var jsonResponse; + try { + jsonResponse = JSON.parse(jqXHR.responseText); + jsonResponse = JSON.stringify(jsonResponse, null, 4); + } catch (e) { + jsonResponse = jqXHR.responseText; + } + + if (jsonResponse) + message += "\n" + jsonResponse; + + // flicker on previous error to make clear that there is a new response + if($root.find(".sample-request-response").is(":visible")) + $root.find(".sample-request-response").fadeTo(1, 0.1); + + $root.find(".sample-request-response").fadeTo(250, 1); + $root.find(".sample-request-response-json").text(message); + refreshScrollSpy(); + }; + } + + function clearSampleRequest(group, name, version) + { + var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]'); + + // hide sample response + $root.find(".sample-request-response-json").html(""); + $root.find(".sample-request-response").hide(); + + // reset value of parameters + $root.find(".sample-request-param").each(function(i, element) { + element.value = ""; + }); + + // restore default URL + var $urlElement = $root.find(".sample-request-url"); + $urlElement.val($urlElement.prop("defaultValue")); + + refreshScrollSpy(); + } + + function refreshScrollSpy() + { + $('[data-spy="scroll"]').each(function () { + $(this).scrollspy("refresh"); + }); + } + + function escapeHtml(str) { + var div = document.createElement("div"); + div.appendChild(document.createTextNode(str)); + return div.innerHTML; + } + + + /** + * is Json + */ + function isJson(str) { + if (typeof str == 'string') { + try { + var obj=JSON.parse(str); + if(typeof obj == 'object' && obj ){ + return true; + }else{ + return false; + } + } catch(e) { + return false; + } + } + } + + /** + * encode Search Params + */ + function encodeSearchParams(obj) { + const params = []; + Object.keys(obj).forEach((key) => { + let value = obj[key]; + params.push([key, encodeURIComponent(value)].join('=')); + }) + return params.length === 0 ? '' : '?' + params.join('&'); + } + + /** + * Exports. + */ + return { + initDynamic: initDynamic + }; + +}); diff --git a/doc/vendor/.pydio b/doc/vendor/.pydio new file mode 100644 index 0000000..092054d --- /dev/null +++ b/doc/vendor/.pydio @@ -0,0 +1 @@ +7c89b5a6-61d5-41a4-bc2c-bd8348f5028c \ No newline at end of file diff --git a/doc/vendor/bootstrap.min.css b/doc/vendor/bootstrap.min.css new file mode 100644 index 0000000..5b96335 --- /dev/null +++ b/doc/vendor/bootstrap.min.css @@ -0,0 +1,6 @@ +/*! + * Bootstrap v3.4.1 (https://getbootstrap.com/) + * Copyright 2011-2019 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;-moz-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:"Glyphicons Halflings";src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format("embedded-opentype"),url(../fonts/glyphicons-halflings-regular.woff2) format("woff2"),url(../fonts/glyphicons-halflings-regular.woff) format("woff"),url(../fonts/glyphicons-halflings-regular.ttf) format("truetype"),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format("svg")}.glyphicon{position:relative;top:1px;display:inline-block;font-family:"Glyphicons Halflings";font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:"\2014 \00A0"}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:""}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:"\00A0 \2014"}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.row-no-gutters{margin-right:0;margin-left:0}.row-no-gutters [class*=col-]{padding-right:0;padding-left:0}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;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;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;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,-webkit-box-shadow ease-in-out .15s}.form-control: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)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],.input-group-sm input[type=time],input[type=date].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm,input[type=time].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],.input-group-lg input[type=time],input[type=date].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg,input[type=time].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);opacity:.65;-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;background-image:none;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;background-image:none;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;background-image:none;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;background-image:none;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;background-image:none;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;background-image:none;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-right:15px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-right:-15px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0%;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out,-o-transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;line-height:1.42857143;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;font-size:12px;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;line-height:1.42857143;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;font-size:14px;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover>.arrow{border-width:11px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out,-o-transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);left:0}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);left:0}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;outline:0;filter:alpha(opacity=90);opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:"\2039"}.carousel-control .icon-next:before{content:"\203a"}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} +/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/doc/vendor/bootstrap.min.js b/doc/vendor/bootstrap.min.js new file mode 100644 index 0000000..eb0a8b4 --- /dev/null +++ b/doc/vendor/bootstrap.min.js @@ -0,0 +1,6 @@ +/*! + * Bootstrap v3.4.1 (https://getbootstrap.com/) + * Copyright 2011-2019 Twitter, Inc. + * Licensed under the MIT license + */ +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(idocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},s.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},s.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth

      ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:t},m.prototype.init=function(t,e,i){if(this.enabled=!0,this.type=t,this.$element=g(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&g(document).find(g.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 o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(t){var e=this.$element.data();for(var i in e)e.hasOwnProperty(i)&&-1!==g.inArray(i,o)&&delete e[i];return(t=g.extend({},this.getDefaults(),e,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=n(t.template,t.whiteList,t.sanitizeFn)),t},m.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&g.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i},m.prototype.enter=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusin"==t.type?"focus":"hover"]=!0),e.tip().hasClass("in")||"in"==e.hoverState)e.hoverState="in";else{if(clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},m.prototype.leave=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusout"==t.type?"focus":"hover"]=!1),!e.isInStateTrue()){if(clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)}},m.prototype.show=function(){var t=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),n=this.getUID(this.type);this.setContent(),o.attr("id",n),this.$element.attr("aria-describedby",n),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,r=a.test(s);r&&(s=s.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(g(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),h=o[0].offsetWidth,d=o[0].offsetHeight;if(r){var p=s,c=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>c.bottom?"top":"top"==s&&l.top-dc.width?"left":"left"==s&&l.left-ha.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;ha.right&&(n.left=a.left+a.width-d)}return n},m.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},m.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=g(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},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(t){var e=this;t&&((e=g(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e))),t?(e.inState.click=!e.inState.click,e.isInStateTrue()?e.enter(e):e.leave(e)):e.tip().hasClass("in")?e.leave(e):e.enter(e)},m.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})},m.prototype.sanitizeHtml=function(t){return n(t,this.options.whiteList,this.options.sanitizeFn)};var e=g.fn.tooltip;g.fn.tooltip=function i(o){return this.each(function(){var t=g(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.tooltip",e=new m(this,i)),"string"==typeof o&&e[o]())})},g.fn.tooltip.Constructor=m,g.fn.tooltip.noConflict=function(){return g.fn.tooltip=e,this}}(jQuery),function(n){"use strict";var s=function(t,e){this.init("popover",t,e)};if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.4.1",s.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),((s.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=s).prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var o=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===o&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===o?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},s.prototype.hasContent=function(){return this.getTitle()||this.getContent()},s.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=n.fn.popover;n.fn.popover=function e(o){return this.each(function(){var t=n(this),e=t.data("bs.popover"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.popover",e=new s(this,i)),"string"==typeof o&&e[o]())})},n.fn.popover.Constructor=s,n.fn.popover.noConflict=function(){return n.fn.popover=t,this}}(jQuery),function(s){"use strict";function n(t,e){this.$body=s(document.body),this.$scrollElement=s(t).is(document.body)?s(window):s(t),this.options=s.extend({},n.DEFAULTS,e),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this)),this.refresh(),this.process()}function e(o){return this.each(function(){var t=s(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new n(this,i)),"string"==typeof o&&e[o]()})}n.VERSION="3.4.1",n.DEFAULTS={offset:10},n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},n.prototype.refresh=function(){var t=this,o="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),s.isWindow(this.$scrollElement[0])||(o="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=s(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&s(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+n,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},n.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e=n[t]&&(n[t+1]===undefined||e .active"),n=i&&r.support.transition&&(o.length&&o.hasClass("fade")||!!e.find("> .fade").length);function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&n?o.one("bsTransitionEnd",s).emulateTransitionEnd(a.TRANSITION_DURATION):s(),o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e,r.fn.tab.Constructor=a,r.fn.tab.noConflict=function(){return r.fn.tab=t,this};var i=function(t){t.preventDefault(),e.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(l){"use strict";var h=function(t,e){this.options=l.extend({},h.DEFAULTS,e);var i=this.options.target===h.DEFAULTS.target?l(this.options.target):l(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this)),this.$element=l(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(o){return this.each(function(){var t=l(this),e=t.data("bs.affix"),i="object"==typeof o&&o;e||t.data("bs.affix",e=new h(this,i)),"string"==typeof o&&e[o]()})}h.VERSION="3.4.1",h.RESET="affix affix-top affix-bottom",h.DEFAULTS={offset:0,target:window},h.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error("Null input. (diff_main)");if(a==b)return a?[[0,a]]:[];"undefined"==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a, +b,e,d);c&&a.unshift([0,c]);g&&a.push([0,g]);this.diff_cleanupMerge(a);return a}; +diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[[1,b]];if(!b)return[[-1,a]];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[[1,e.substring(0,g)],[0,f],[1,e.substring(g+f.length)]],a.length>b.length&&(c[0][0]=c[2][0]=-1),c):1==f.length?[[-1,a],[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e[0],a=e[1],g=e[2],b=e[3],e=e[4],f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([[0,e]],c)):c&&100c);v++){for(var n=-v+r;n<=v-t;n+=2){var l=g+n,m;m=n==-v||n!=v&&j[l-1]d)t+=2;else if(s>e)r+=2;else if(q&&(l=g+k-n,0<=l&&l= +u)return this.diff_bisectSplit_(a,b,m,s,c)}}for(n=-v+p;n<=v-w;n+=2){l=g+n;u=n==-v||n!=v&&i[l-1]d)w+=2;else if(m>e)p+=2;else if(!q&&(l=g+k-n,0<=l&&(l=u)))return this.diff_bisectSplit_(a,b,m,s,c)}}return[[-1,a],[1,b]]}; +diff_match_patch.prototype.diff_bisectSplit_=function(a,b,c,d,e){var f=a.substring(0,c),g=b.substring(0,d);a=a.substring(c);b=b.substring(d);f=this.diff_main(f,g,!1,e);e=this.diff_main(a,b,!1,e);return f.concat(e)}; +diff_match_patch.prototype.diff_linesToChars_=function(a,b){function c(a){for(var b="",c=0,f=-1,g=d.length;fd?a=a.substring(c-d):c=a.length?[h,j,n,l,g]:null}if(0>=this.Diff_Timeout)return null; +var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(4>d.length||2*e.lengthd[4].length?g:d:d:g;var j;a.length>b.length?(g=h[0],d=h[1],e=h[2],j=h[3]):(e=h[0],j=h[1],g=h[2],d=h[3]);h=h[4];return[g,d,e,j,h]}; +diff_match_patch.prototype.diff_cleanupSemantic=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=0,h=0,j=0,i=0;f=e){if(d>=b.length/2||d>=c.length/2)a.splice(f,0,[0,c.substring(0,d)]),a[f-1][1]=b.substring(0,b.length-d),a[f+1][1]=c.substring(d),f++}else if(e>=b.length/2||e>=c.length/2)a.splice(f,0,[0,b.substring(0,e)]),a[f-1][0]=1,a[f-1][1]=c.substring(0,c.length-e),a[f+1][0]=-1,a[f+1][1]=b.substring(e),f++;f++}f++}}; +diff_match_patch.prototype.diff_cleanupSemanticLossless=function(a){function b(a,b){if(!a||!b)return 6;var c=a.charAt(a.length-1),d=b.charAt(0),e=c.match(diff_match_patch.nonAlphaNumericRegex_),f=d.match(diff_match_patch.nonAlphaNumericRegex_),g=e&&c.match(diff_match_patch.whitespaceRegex_),h=f&&d.match(diff_match_patch.whitespaceRegex_),c=g&&c.match(diff_match_patch.linebreakRegex_),d=h&&d.match(diff_match_patch.linebreakRegex_),i=c&&a.match(diff_match_patch.blanklineEndRegex_),j=d&&b.match(diff_match_patch.blanklineStartRegex_); +return i||j?5:c||d?4:e&&!g&&h?3:g||h?2:e||f?1:0}for(var c=1;c=i&&(i=k,g=d,h=e,j=f)}a[c-1][1]!=g&&(g?a[c-1][1]=g:(a.splice(c-1,1),c--),a[c][1]= +h,j?a[c+1][1]=j:(a.splice(c+1,1),c--))}c++}};diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;diff_match_patch.whitespaceRegex_=/\s/;diff_match_patch.linebreakRegex_=/[\r\n]/;diff_match_patch.blanklineEndRegex_=/\n\r?\n$/;diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/; +diff_match_patch.prototype.diff_cleanupEfficiency=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=!1,h=!1,j=!1,i=!1;fb)break;e=c;f=d}return a.length!=g&&-1===a[g][0]?f:f+(b-e)}; +diff_match_patch.prototype.diff_prettyHtml=function(a){for(var b=[],c=/&/g,d=//g,f=/\n/g,g=0;g");switch(h){case 1:b[g]=''+j+"";break;case -1:b[g]=''+j+"";break;case 0:b[g]=""+j+""}}return b.join("")}; +diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;cthis.Match_MaxBits)throw Error("Pattern too long for this browser.");var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<=i;p--){var w=e[a.charAt(p-1)];k[p]=0===t?(k[p+1]<<1|1)&w:(k[p+1]<<1|1)&w|((r[p+1]|r[p])<<1|1)|r[p+1];if(k[p]&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h}; +diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;c=2*this.Patch_Margin&& +e&&(this.patch_addContext_(a,h),c.push(a),a=new diff_match_patch.patch_obj,e=0,h=d,f=g)}1!==i&&(f+=k.length);-1!==i&&(g+=k.length)}e&&(this.patch_addContext_(a,h),c.push(a));return c};diff_match_patch.prototype.patch_deepCopy=function(a){for(var b=[],c=0;cthis.Match_MaxBits){if(j=this.match_main(b,h.substring(0,this.Match_MaxBits),g),-1!=j&&(i=this.match_main(b,h.substring(h.length-this.Match_MaxBits),g+h.length-this.Match_MaxBits),-1==i||j>=i))j=-1}else j=this.match_main(b,h,g); +if(-1==j)e[f]=!1,d-=a[f].length2-a[f].length1;else if(e[f]=!0,d=j-g,g=-1==i?b.substring(j,j+h.length):b.substring(j,i+this.Match_MaxBits),h==g)b=b.substring(0,j)+this.diff_text2(a[f].diffs)+b.substring(j+h.length);else if(g=this.diff_main(h,g,!1),h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)e[f]=!1;else{this.diff_cleanupSemanticLossless(g);for(var h=0,k,i=0;ie[0][1].length){var f=b-e[0][1].length;e[0][1]=c.substring(e[0][1].length)+e[0][1];d.start1-=f;d.start2-=f;d.length1+=f;d.length2+=f}d=a[a.length-1];e=d.diffs;0==e.length||0!=e[e.length-1][0]?(e.push([0, +c]),d.length1+=b,d.length2+=b):b>e[e.length-1][1].length&&(f=b-e[e.length-1][1].length,e[e.length-1][1]+=c.substring(0,f),d.length1+=f,d.length2+=f);return c}; +diff_match_patch.prototype.patch_splitMax=function(a){for(var b=this.Match_MaxBits,c=0;c2*b?(h.length1+=i.length,e+=i.length,j=!1,h.diffs.push([g,i]),d.diffs.shift()):(i=i.substring(0,b-h.length1-this.Patch_Margin),h.length1+=i.length,e+=i.length,0===g?(h.length2+=i.length,f+=i.length):j=!1,h.diffs.push([g,i]),i==d.diffs[0][1]?d.diffs.shift():d.diffs[0][1]=d.diffs[0][1].substring(i.length))}g=this.diff_text2(h.diffs);g=g.substring(g.length-this.Patch_Margin);i=this.diff_text1(d.diffs).substring(0,this.Patch_Margin);""!==i&& +(h.length1+=i.length,h.length2+=i.length,0!==h.diffs.length&&0===h.diffs[h.diffs.length-1][0]?h.diffs[h.diffs.length-1][1]+=i:h.diffs.push([0,i]));j||a.splice(++c,0,h)}}};diff_match_patch.prototype.patch_toText=function(a){for(var b=[],c=0;c= 2.0.0-beta.1",7:">= 4.0.0"};b.REVISION_CHANGES=o;var p="[object Object]";d.prototype={constructor:d,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===p)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]}};var q=l["default"].log;b.log=q,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return k[a]}function d(a){for(var b=1;bc;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return m.test(a)?a.replace(l,c):a}function g(a){return a||0===a?p(a)&&0===a.length?!0:!1:!0}function h(a){var b=d({},a);return b._parent=a,b}function i(a,b){return a.path=b,a}function j(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.createFrame=h,b.blockParams=i,b.appendContextPath=j;var k={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},l=/[&<>"'`=]/g,m=/[&<>"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function(a){return"function"==typeof a};o(/x/)&&(b.isFunction=o=function(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o;var p=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===n.call(a):!1};b.isArray=p},function(a,b){"use strict";function c(a,b){var e=b&&b.loc,f=void 0,g=void 0;e&&(f=e.start.line,g=e.start.column,a+=" - "+f+":"+g);for(var h=Error.prototype.constructor.call(this,a),i=0;i0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,f){j&&(j.key=b,j.index=c,j.first=0===c,j.last=!!f,k&&(j.contextPath=k+b)),i+=d(a[b],{data:j,blockParams:e.blockParams([a[b],b],[k+b,null])})}if(!b)throw new g["default"]("Must pass iterator to #each");var d=b.fn,f=b.inverse,h=0,i="",j=void 0,k=void 0;if(b.data&&b.ids&&(k=e.appendContextPath(b.data.contextPath,b.ids[0])+"."),e.isFunction(a)&&(a=a.call(this)),b.data&&(j=e.createFrame(b.data)),a&&"object"==typeof a)if(e.isArray(a))for(var l=a.length;l>h;h++)h in a&&c(h,h,h===a.length-1);else{var m=void 0;for(var n in a)a.hasOwnProperty(n)&&(void 0!==m&&c(m,h-1),m=n,h++);void 0!==m&&c(m,h-1,!0)}return 0===h&&(i=f(this)),i})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(6),f=d(e);b["default"]=function(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new f["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("if",function(a,b){return d.isFunction(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||d.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("log",function(){for(var b=[void 0],c=arguments[arguments.length-1],d=0;d=0?b:parseInt(a,10)}return a},log:function(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;c>f;f++)d[f-1]=arguments[f];console[b].apply(console,d)}}};b["default"]=e,a.exports=b["default"]},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=r.COMPILER_REVISION;if(b!==c){if(c>b){var d=r.REVISION_CHANGES[c],e=r.REVISION_CHANGES[b];throw new q["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new q["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=o.extend({},d,e.hash),e.ids&&(e.ids[0]=!0)),c=b.VM.resolvePartial.call(this,c,d,e);var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;i>h&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new q["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){function c(b){return""+a.main(e,b,e.helpers,e.partials,g,i,h)}var f=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],g=f.data;d._setup(f),!f.partial&&a.useData&&(g=j(b,g));var h=void 0,i=a.useBlockParams?[]:void 0;return a.useDepths&&(h=f.depths?b!==f.depths[0]?[b].concat(f.depths):f.depths:[b]),(c=k(a.main,c,e,f.depths||[],g,i))(b,f)}if(!b)throw new q["default"]("No environment passed to template");if(!a||!a.main)throw new q["default"]("Unknown template object: "+typeof a);a.main.decorator=a.main_d,b.VM.checkRevision(a.compiler);var e={strict:function(a,b){if(!(b in a))throw new q["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:o.escapeExpression,invokePartial:c,fn:function(b){var c=a[b];return c.decorator=a[b+"_d"],c},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=o.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){c.partial?(e.helpers=c.helpers,e.partials=c.partials,e.decorators=c.decorators):(e.helpers=e.merge(c.helpers,b.helpers),a.usePartial&&(e.partials=e.merge(c.partials,b.partials)),(a.usePartial||a.useDecorators)&&(e.decorators=e.merge(c.decorators,b.decorators)))},d._child=function(b,c,d,g){if(a.useBlockParams&&!d)throw new q["default"]("must pass block params");if(a.useDepths&&!g)throw new q["default"]("must pass parent depths");return f(e,b,a[b],c,0,d,g)},d}function f(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],h=g;return g&&b!==g[0]&&(h=[b].concat(g)),c(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),h)}return h=k(c,h,a,g,d,f),h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a="@partial-block"===c.name?c.data["partial-block"]:c.partials[c.name],a}function h(a,b,c){c.partial=!0,c.ids&&(c.data.contextPath=c.ids[0]||c.data.contextPath);var d=void 0;if(c.fn&&c.fn!==i&&(c.data=r.createFrame(c.data),d=c.data["partial-block"]=c.fn,d.partials&&(c.partials=o.extend({},c.partials,d.partials))),void 0===a&&d&&(a=d),void 0===a)throw new q["default"]("The partial "+c.name+" could not be found");return a instanceof Function?a(b,c):void 0}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?r.createFrame(b):{},b.root=a),b}function k(a,b,c,d,e,f){if(a.decorator){var g={};b=a.decorator(b,g,c,d&&d[0],e,f,d),o.extend(b,g)}return b}var l=c(3)["default"],m=c(1)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var n=c(5),o=l(n),p=c(6),q=m(p),r=c(4)},function(a,b){(function(c){"use strict";b.__esModule=!0,b["default"]=function(a){var b="undefined"!=typeof c?c:window,d=b.Handlebars;a.noConflict=function(){return b.Handlebars===a&&(b.Handlebars=d),a}},a.exports=b["default"]}).call(b,function(){return this}())},function(a,b){"use strict";b.__esModule=!0;var c={helpers:{helperExpression:function(a){return"SubExpression"===a.type||("MustacheStatement"===a.type||"BlockStatement"===a.type)&&!!(a.params&&a.params.length||a.hash)},scopedId:function(a){return/^\.|this\b/.test(a.original)},simpleId:function(a){return 1===a.parts.length&&!c.helpers.scopedId(a)&&!a.depth}}};b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if("Program"===a.type)return a;h["default"].yy=n,n.locInfo=function(a){return new n.SourceLocation(b&&b.srcName,a)};var c=new j["default"](b);return c.accept(h["default"].parse(a))}var e=c(1)["default"],f=c(3)["default"];b.__esModule=!0,b.parse=d;var g=c(23),h=e(g),i=c(24),j=e(i),k=c(26),l=f(k),m=c(5);b.parser=h["default"];var n={};m.extend(n,l)},function(a,b){"use strict";var c=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition_plus0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,1],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 2:this.$=d.prepareProgram(f[h]);break;case 3:this.$=f[h];break;case 4:this.$=f[h];break;case 5:this.$=f[h];break;case 6:this.$=f[h];break;case 7:this.$=f[h];break;case 8:this.$=f[h];break;case 9:this.$={type:"CommentStatement",value:d.stripComment(f[h]),strip:d.stripFlags(f[h],f[h]),loc:d.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:f[h],value:f[h],loc:d.locInfo(this._$)};break;case 11:this.$=d.prepareRawBlock(f[h-2],f[h-1],f[h],this._$);break;case 12:this.$={path:f[h-3],params:f[h-2],hash:f[h-1]};break;case 13:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!1,this._$);break;case 14:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!0,this._$);break;case 15:this.$={open:f[h-5],path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 16:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 17:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 18:this.$={strip:d.stripFlags(f[h-1],f[h-1]),program:f[h]};break;case 19:var i=d.prepareBlock(f[h-2],f[h-1],f[h],f[h],!1,this._$),j=d.prepareProgram([i],f[h-1].loc);j.chained=!0,this.$={strip:f[h-2].strip,program:j,chain:!0};break;case 20:this.$=f[h];break;case 21:this.$={path:f[h-1],strip:d.stripFlags(f[h-2],f[h])};break;case 22:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 23:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 24:this.$={type:"PartialStatement",name:f[h-3],params:f[h-2],hash:f[h-1],indent:"",strip:d.stripFlags(f[h-4],f[h]),loc:d.locInfo(this._$)};break;case 25:this.$=d.preparePartialBlock(f[h-2],f[h-1],f[h],this._$);break;case 26:this.$={path:f[h-3],params:f[h-2],hash:f[h-1],strip:d.stripFlags(f[h-4],f[h])};break;case 27:this.$=f[h];break;case 28:this.$=f[h];break;case 29:this.$={type:"SubExpression",path:f[h-3],params:f[h-2],hash:f[h-1],loc:d.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:f[h],loc:d.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:d.id(f[h-2]),value:f[h],loc:d.locInfo(this._$)};break;case 32:this.$=d.id(f[h-1]);break;case 33:this.$=f[h];break;case 34:this.$=f[h];break;case 35:this.$={type:"StringLiteral",value:f[h],original:f[h],loc:d.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(f[h]),original:Number(f[h]),loc:d.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===f[h],original:"true"===f[h],loc:d.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:d.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:d.locInfo(this._$)};break;case 40:this.$=f[h];break;case 41:this.$=f[h];break;case 42:this.$=d.preparePath(!0,f[h],this._$);break;case 43:this.$=d.preparePath(!1,f[h],this._$);break;case 44:f[h-2].push({part:d.id(f[h]),original:f[h],separator:f[h-1]}),this.$=f[h-2];break;case 45:this.$=[{part:d.id(f[h]),original:f[h]}];break;case 46:this.$=[];break;case 47:f[h-1].push(f[h]);break;case 48:this.$=[f[h]];break;case 49:f[h-1].push(f[h]);break;case 50:this.$=[];break;case 51:f[h-1].push(f[h]);break;case 58:this.$=[];break;case 59:f[h-1].push(f[h]);break;case 64:this.$=[];break;case 65:f[h-1].push(f[h]);break;case 70:this.$=[];break;case 71:f[h-1].push(f[h]);break;case 78:this.$=[];break;case 79:f[h-1].push(f[h]);break;case 82:this.$=[];break;case 83:f[h-1].push(f[h]);break;case 86:this.$=[];break;case 87:f[h-1].push(f[h]);break;case 90:this.$=[];break;case 91:f[h-1].push(f[h]);break;case 94:this.$=[];break;case 95:f[h-1].push(f[h]);break;case 98:this.$=[f[h]];break;case 99:f[h-1].push(f[h]);break;case 100:this.$=[f[h]];break;case 101:f[h-1].push(f[h])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{13:40,15:[1,20],17:39},{20:42,56:41,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:45,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:48,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:42,56:49,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:50,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,51]},{72:[1,35],86:52},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:53,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:54,38:56,39:[1,58],43:57,44:[1,59],45:55,47:[2,54]},{28:60,43:61,44:[1,59],47:[2,56]},{13:63,15:[1,20],18:[1,62]},{15:[2,48],18:[2,48]},{33:[2,86],57:64,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:65,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:66,47:[1,67]},{30:68,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:69,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:70,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:71,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:75,33:[2,80],50:72,63:73,64:76,65:[1,44],69:74,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,80]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,51]},{20:75,53:81,54:[2,84],63:82,64:76,65:[1,44],69:83,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:84,47:[1,67]},{47:[2,55]},{4:85,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:86,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:87,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:88,47:[1,67]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:75,33:[2,88],58:89,63:90,64:76,65:[1,44],69:91,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:92,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:93,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,31:94,33:[2,60],63:95,64:76,65:[1,44],69:96,70:77,71:78,72:[1,79],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,66],36:97,63:98,64:76,65:[1,44],69:99,70:77,71:78,72:[1,79],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,22:100,23:[2,52],63:101,64:76,65:[1,44],69:102,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,92],62:103,63:104,64:76,65:[1,44],69:105,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,106]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:107,72:[1,108],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,109],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,110]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:56,39:[1,58],43:57,44:[1,59],45:112,46:111,47:[2,76]},{33:[2,70],40:113,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,114]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:75,63:116,64:76,65:[1,44],67:115,68:[2,96],69:117,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,118]},{32:119,33:[2,62],74:120,75:[1,121]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:122,74:123,75:[1,121]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,124]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,125]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,109]},{20:75,63:126,64:76,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:75,33:[2,72],41:127,63:128,64:76,65:[1,44],69:129,70:77,71:78,72:[1,79],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,130]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,131]},{33:[2,63]},{72:[1,133],76:132},{33:[1,134]},{33:[2,69]},{15:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:135,74:136,75:[1,121]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,138],77:[1,137]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16], +48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,139]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],55:[2,55],57:[2,20],61:[2,57],74:[2,81],83:[2,85],87:[2,18],91:[2,89],102:[2,53],105:[2,93],111:[2,19],112:[2,77],117:[2,97],120:[2,63],123:[2,69],124:[2,12],136:[2,75],137:[2,32]},parseError:function(a,b){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(b.yytext=b.yytext.substr(5,b.yyleng-9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return b.yytext=e(1,2).replace(/\\"/g,'"'),80;case 32:return b.yytext=e(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return b.yytext=b.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();b.__esModule=!0,b["default"]=c},function(a,b,c){"use strict";function d(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}var i=c(1)["default"];b.__esModule=!0;var j=c(25),k=i(j);d.prototype=new k["default"],d.prototype.Program=function(a){var b=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var d=a.body,i=0,j=d.length;j>i;i++){var k=d[i],l=this.accept(k);if(l){var m=e(d,i,c),n=f(d,i,c),o=l.openStandalone&&m,p=l.closeStandalone&&n,q=l.inlineStandalone&&m&&n;l.close&&g(d,i,!0),l.open&&h(d,i,!0),b&&q&&(g(d,i),h(d,i)&&"PartialStatement"===k.type&&(k.indent=/([ \t]+$)/.exec(d[i-1].original)[1])),b&&o&&(g((k.program||k.inverse).body),h(d,i)),b&&p&&(g(d,i),h((k.inverse||k.program).body))}}return a},d.prototype.BlockStatement=d.prototype.DecoratorBlock=d.prototype.PartialBlockStatement=function(a){this.accept(a.program),this.accept(a.inverse);var b=a.program||a.inverse,c=a.program&&a.inverse,d=c,i=c;if(c&&c.chained)for(d=c.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var j={open:a.openStrip.open,close:a.closeStrip.close,openStandalone:f(b.body),closeStandalone:e((d||b).body)};if(a.openStrip.close&&g(b.body,null,!0),c){var k=a.inverseStrip;k.open&&h(b.body,null,!0),k.close&&g(d.body,null,!0),a.closeStrip.open&&h(i.body,null,!0),!this.options.ignoreStandalone&&e(b.body)&&f(d.body)&&(h(b.body),g(d.body))}else a.closeStrip.open&&h(b.body,null,!0);return j},d.prototype.Decorator=d.prototype.MustacheStatement=function(a){return a.strip},d.prototype.PartialStatement=d.prototype.CommentStatement=function(a){var b=a.strip||{};return{inlineStandalone:!0,open:b.open,close:b.close}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(){this.parents=[]}function e(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function f(a){e.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function g(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}var h=c(1)["default"];b.__esModule=!0;var i=c(6),j=h(i);d.prototype={constructor:d,mutating:!1,acceptKey:function(a,b){var c=this.accept(a[b]);if(this.mutating){if(c&&!d.prototype[c.type])throw new j["default"]('Unexpected node type "'+c.type+'" found when accepting '+b+" on "+a.type);a[b]=c}},acceptRequired:function(a,b){if(this.acceptKey(a,b),!a[b])throw new j["default"](a.type+" requires "+b)},acceptArray:function(a){for(var b=0,c=a.length;c>b;b++)this.acceptKey(a,b),a[b]||(a.splice(b,1),b--,c--)},accept:function(a){if(a){if(!this[a.type])throw new j["default"]("Unknown type: "+a.type,a);this.current&&this.parents.unshift(this.current),this.current=a;var b=this[a.type](a);return this.current=this.parents.shift(),!this.mutating||b?b:b!==!1?a:void 0}},Program:function(a){this.acceptArray(a.body)},MustacheStatement:e,Decorator:e,BlockStatement:f,DecoratorBlock:f,PartialStatement:g,PartialBlockStatement:function(a){g.call(this,a),this.acceptKey(a,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:e,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(a){this.acceptArray(a.pairs)},HashPair:function(a){this.acceptRequired(a,"value")}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if(b=b.path?b.path.original:b,a.path.original!==b){var c={loc:a.path.loc};throw new q["default"](a.path.original+" doesn't match "+b,c)}}function e(a,b){this.source=a,this.start={line:b.first_line,column:b.first_column},this.end={line:b.last_line,column:b.last_column}}function f(a){return/^\[.*\]$/.test(a)?a.substr(1,a.length-2):a}function g(a,b){return{open:"~"===a.charAt(2),close:"~"===b.charAt(b.length-3)}}function h(a){return a.replace(/^\{\{~?\!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function i(a,b,c){c=this.locInfo(c);for(var d=a?"@":"",e=[],f=0,g="",h=0,i=b.length;i>h;h++){var j=b[h].part,k=b[h].original!==j;if(d+=(b[h].separator||"")+j,k||".."!==j&&"."!==j&&"this"!==j)e.push(j);else{if(e.length>0)throw new q["default"]("Invalid path: "+d,{loc:c});".."===j&&(f++,g+="../")}}return{type:"PathExpression",data:a,depth:f,parts:e,original:d,loc:c}}function j(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g,i=/\*/.test(d);return{type:i?"Decorator":"MustacheStatement",path:a,params:b,hash:c,escaped:h,strip:e,loc:this.locInfo(f)}}function k(a,b,c,e){d(a,c),e=this.locInfo(e);var f={type:"Program",body:b,strip:{},loc:e};return{type:"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:e}}function l(a,b,c,e,f,g){e&&e.path&&d(a,e);var h=/\*/.test(a.open);b.blockParams=a.blockParams;var i=void 0,j=void 0;if(c){if(h)throw new q["default"]("Unexpected inverse block on decorator",c);c.chain&&(c.program.body[0].closeStrip=e.strip),j=c.strip,i=c.program}return f&&(f=i,i=b,b=f),{type:h?"DecoratorBlock":"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:b,inverse:i,openStrip:a.strip,inverseStrip:j,closeStrip:e&&e.strip,loc:this.locInfo(g)}}function m(a,b){if(!b&&a.length){var c=a[0].loc,d=a[a.length-1].loc;c&&d&&(b={source:c.source,start:{line:c.start.line,column:c.start.column},end:{line:d.end.line,column:d.end.column}})}return{type:"Program",body:a,strip:{},loc:b}}function n(a,b,c,e){return d(a,c),{type:"PartialBlockStatement",name:a.path,params:a.params,hash:a.hash,program:b,openStrip:a.strip,closeStrip:c&&c.strip,loc:this.locInfo(e)}}var o=c(1)["default"];b.__esModule=!0,b.SourceLocation=e,b.id=f,b.stripFlags=g,b.stripComment=h,b.preparePath=i,b.prepareMustache=j,b.prepareRawBlock=k,b.prepareBlock=l,b.prepareProgram=m,b.preparePartialBlock=n;var p=c(6),q=o(p)},function(a,b,c){"use strict";function d(){}function e(a,b,c){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new k["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a,b),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function f(a,b,c){function d(){var d=c.parse(a,b),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}function e(a,b){return f||(f=d()),f.call(this,a,b)}if(void 0===b&&(b={}),null==a||"string"!=typeof a&&"Program"!==a.type)throw new k["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var f=void 0;return e._setup=function(a){return f||(f=d()),f._setup(a)},e._child=function(a,b,c,e){return f||(f=d()),f._child(a,b,c,e)},e}function g(a,b){if(a===b)return!0;if(l.isArray(a)&&l.isArray(b)&&a.length===b.length){for(var c=0;cc;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!g(d.args,e.args))return!1}b=this.children.length;for(var c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.sourceNode=[],this.opcodes=[],this.children=[],this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds,b.blockParams=b.blockParams||[];var c=b.knownHelpers;if(b.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)d in c&&(b.knownHelpers[d]=c[d]);return this.accept(a)},compileProgram:function(a){var b=new this.compiler,c=b.compile(a,this.options),d=this.guid++;return this.usePartial=this.usePartial||c.usePartial,this.children[d]=c,this.useDepths=this.useDepths||c.useDepths,d},accept:function(a){if(!this[a.type])throw new k["default"]("Unknown type: "+a.type,a);this.sourceNode.unshift(a);var b=this[a.type](a);return this.sourceNode.shift(),b},Program:function(a){this.options.blockParams.unshift(a.blockParams);for(var b=a.body,c=b.length,d=0;c>d;d++)this.accept(b[d]);return this.options.blockParams.shift(),this.isSimple=1===c,this.blockParams=a.blockParams?a.blockParams.length:0,this},BlockStatement:function(a){h(a);var b=a.program,c=a.inverse;b=b&&this.compileProgram(b),c=c&&this.compileProgram(c);var d=this.classifySexpr(a);"helper"===d?this.helperSexpr(a,b,c):"simple"===d?(this.simpleSexpr(a),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("blockValue",a.path.original)):(this.ambiguousSexpr(a,b,c),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(a){var b=a.program&&this.compileProgram(a.program),c=this.setupFullMustacheParams(a,b,void 0),d=a.path;this.useDecorators=!0,this.opcode("registerDecorator",c.length,d.original)},PartialStatement:function(a){this.usePartial=!0;var b=a.program;b&&(b=this.compileProgram(a.program));var c=a.params;if(c.length>1)throw new k["default"]("Unsupported number of partial arguments: "+c.length,a);c.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):c.push({type:"PathExpression",parts:[],depth:0}));var d=a.name.original,e="SubExpression"===a.name.type;e&&this.accept(a.name),this.setupFullMustacheParams(a,b,void 0,!0);var f=a.indent||"";this.options.preventIndent&&f&&(this.opcode("appendContent",f),f=""),this.opcode("invokePartial",e,d,f),this.opcode("append")},PartialBlockStatement:function(a){this.PartialStatement(a)},MustacheStatement:function(a){this.SubExpression(a),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(a){this.DecoratorBlock(a)},ContentStatement:function(a){a.value&&this.opcode("appendContent",a.value)},CommentStatement:function(){},SubExpression:function(a){h(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ambiguousSexpr:function(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),d.strict=!0,this.accept(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.path;b.strict=!0,this.accept(b),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new k["default"]("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.strict=!0,e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,n["default"].helpers.simpleId(e))}},PathExpression:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=n["default"].helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam",d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts,a.strict)):this.opcode("lookupOnContext",a.parts,a.falsy,a.strict,c):this.opcode("pushContext")},StringLiteral:function(a){this.opcode("pushString",a.value)},NumberLiteral:function(a){this.opcode("pushLiteral",a.value)},BooleanLiteral:function(a){this.opcode("pushLiteral",a.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");d>c;c++)this.pushParam(b[c].value);for(;c--;)this.opcode("assignToHash",b[c].key);this.opcode("popHash")},opcode:function(a){this.opcodes.push({opcode:a,args:o.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(a){a&&(this.useDepths=!0)},classifySexpr:function(a){var b=n["default"].helpers.simpleId(a.path),c=b&&!!this.blockParamIndex(a.path.parts[0]),d=!c&&n["default"].helpers.helperExpression(a),e=!c&&(d||b);if(e&&!d){var f=a.path.parts[0],g=this.options;g.knownHelpers[f]?d=!0:g.knownHelpersOnly&&(e=!1)}return d?"helper":e?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){var b=null!=a.value?a.value:a.original||"";if(this.stringParams)b.replace&&(b=b.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",b,a.type),"SubExpression"===a.type&&this.accept(a);else{if(this.trackIds){var c=void 0;if(!a.parts||n["default"].helpers.scopedId(a)||a.depth||(c=this.blockParamIndex(a.parts[0])),c){var d=a.parts.slice(1).join(".");this.opcode("pushId","BlockParam",c,d)}else b=a.original||b,b.replace&&(b=b.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",a.type,b)}this.accept(a)}},setupFullMustacheParams:function(a,b,c,d){var e=a.params;return this.pushParams(e),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.accept(a.hash):this.opcode("emptyHash",d),e},blockParamIndex:function(a){for(var b=0,c=this.options.blockParams.length;c>b;b++){var d=this.options.blockParams[b],e=d&&l.indexOf(d,a);if(d&&e>=0)return[b,e]}}}},function(a,b,c){"use strict";function d(a){this.value=a}function e(){}function f(a,b,c,d){var e=b.popStack(),f=0,g=c.length;for(a&&g--;g>f;f++)e=b.nameLookup(e,c[f],d);return a?[b.aliasable("container.strict"),"(",e,", ",b.quotedString(c[f]),")"]:e}var g=c(1)["default"];b.__esModule=!0;var h=c(4),i=c(6),j=g(i),k=c(5),l=c(29),m=g(l);e.prototype={nameLookup:function(a,b){return e.isValidJavaScriptVariableName(b)?[a,".",b]:[a,"[",JSON.stringify(b),"]"]},depthedLookup:function(a){return[this.aliasable("container.lookup"),'(depths, "',a,'")']},compilerInfo:function(){var a=h.COMPILER_REVISION,b=h.REVISION_CHANGES[a];return[a,b]},appendToBuffer:function(a,b,c){return k.isArray(a)||(a=[a]),a=this.source.wrap(a,b),this.environment.isSimple?["return ",a,";"]:c?["buffer += ",a,";"]:(a.appendToBuffer=!0,a)},initializeBuffer:function(){return this.quotedString("")},compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.useDepths||a.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||a.useBlockParams;var e=a.opcodes,f=void 0,g=void 0,h=void 0,i=void 0;for(h=0,i=e.length;i>h;h++)f=e[h],this.source.currentLocation=f.loc,g=g||f.loc,this[f.opcode].apply(this,f.args);if(this.source.currentLocation=g,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new j["default"]("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend("var decorators = container.decorators;\n"),this.decorators.push("return fn;"),d?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var k=this.createFunctionContext(d);if(this.isChild)return k;var l={compiler:this.compilerInfo(),main:k};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var m=this.context,n=m.programs,o=m.decorators;for(h=0,i=n.length;i>h;h++)n[h]&&(l[h]=n[h],o[h]&&(l[h+"_d"]=o[h],l.useDecorators=!0));return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),d?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),b.srcName?(l=l.toStringWithSourceMap({file:b.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new m["default"](this.options.srcName),this.decorators=new m["default"](this.options.srcName)},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));var d=0;for(var e in this.aliases){var f=this.aliases[e];this.aliases.hasOwnProperty(e)&&f.children&&f.referenceCount>1&&(b+=", alias"+ ++d+"="+e,f.children[0]="alias"+d)}var g=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&g.push("blockParams"),this.useDepths&&g.push("depths");var h=this.mergeSource(b);return a?(g.push(h),Function.apply(this,g)):this.source.wrap(["function(",g.join(","),") {\n ",h,"}"])},mergeSource:function(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend(" + "):f=a,g=a):(f&&(e?f.prepend("buffer += "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()},blockValue:function(a){var b=this.aliasable("helpers.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("helpers.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c,d){var e=0;d||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[e++])),this.resolvePath("context",a,e,b,c)},lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b,c){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,c)},resolvePath:function(a,b,c,d,e){var g=this;if(this.options.strict||this.options.assumeObjects)return void this.push(f(this.options.strict&&e,this,b,a));for(var h=b.length;h>c;c++)this.replaceStack(function(e){var f=g.nameLookup(e,b[c],a);return d?[" && ",f]:[" != null ? ",f," : ",e]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"SubExpression"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(a){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(a.ids)),this.stringParams&&(this.push(this.objectLiteral(a.contexts)),this.push(this.objectLiteral(a.types))),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},registerDecorator:function(a,b){var c=this.nameLookup("decorators",b,"decorator"),d=this.setupHelperArgs(b,a);this.decorators.push(["fn = ",this.decorators.functionCall(c,"",["fn","props","container",d])," || fn;"])},invokeHelper:function(a,b,c){var d=this.popStack(),e=this.setupHelper(a,b),f=c?[e.name," || "]:"",g=["("].concat(f,d);this.options.strict||g.push(" || ",this.aliasable("helpers.helperMissing")),g.push(")"),this.push(this.source.functionCall(g,"call",e.callParams))},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(this.source.functionCall(c.name,"call",c.callParams))},invokeAmbiguous:function(a,b){this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper"),f=["(","(helper = ",e," || ",c,")"];this.options.strict||(f[0]="(helper = ",f.push(" != null ? helper : ",this.aliasable("helpers.helperMissing"))),this.push(["(",f,d.paramsInit?["),(",d.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",d.callParams)," : helper))"])},invokePartial:function(a,b,c){var d=[],e=this.setupParams(b,1,d);a&&(b=this.popStack(),delete e.name),c&&(e.indent=JSON.stringify(c)),e.helpers="helpers",e.partials="partials",e.decorators="container.decorators",a?d.unshift(b):d.unshift(this.nameLookup("partials",b,"partial")),this.options.compat&&(e.depths="depths"),e=this.objectLiteral(e), +d.push(e),this.push(this.source.functionCall("container.invokePartial","",d))},assignToHash:function(a){var b=this.popStack(),c=void 0,d=void 0,e=void 0;this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&(f.contexts[a]=c),d&&(f.types[a]=d),e&&(f.ids[a]=e),f.values[a]=b},pushId:function(a,b,c){"BlockParam"===a?this.pushStackLiteral("blockParams["+b[0]+"].path["+b[1]+"]"+(c?" + "+JSON.stringify("."+c):"")):"PathExpression"===a?this.pushString(b):"SubExpression"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:e,compileChildren:function(a,b){for(var c=a.children,d=void 0,e=void 0,f=0,g=c.length;g>f;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);null==h?(this.context.programs.push(""),h=this.context.programs.length,d.index=h,d.name="program"+h,this.context.programs[h]=e.compile(d,b,this.context,!this.precompile),this.context.decorators[h]=e.decorators,this.context.environments[h]=d,this.useDepths=this.useDepths||e.useDepths,this.useBlockParams=this.useBlockParams||e.useBlockParams):(d.index=h,d.name="program"+h,this.useDepths=this.useDepths||d.useDepths,this.useBlockParams=this.useBlockParams||d.useBlockParams)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],c=[b.index,"data",b.blockParams];return(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths"),"container.program("+c.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof d||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new d(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var b=["("],c=void 0,e=void 0,f=void 0;if(!this.isInline())throw new j["default"]("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof d)c=[g.value],b=["(",c],f=!0;else{e=!0;var h=this.incrStack();b=["((",this.push(h)," = ",g,")"],c=this.topStack()}var i=a.call(this,c);f||this.popStack(),e&&this.stackSlot--,this.push(b.concat(i,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;c>b;b++){var e=a[b];if(e instanceof d)this.compileStack.push(e);else{var f=this.incrStack();this.pushSource([f," = ",e,";"]),this.compileStack.push(f)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof d)return c.value;if(!b){if(!this.stackSlot)throw new j["default"]("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof d?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var b=this.aliases[a];return b?(b.referenceCount++,b):(b=this.aliases[a]=this.source.wrap(a),b.aliasable=!0,b.referenceCount=1,b)},setupHelper:function(a,b,c){var d=[],e=this.setupHelperArgs(b,a,d,c),f=this.nameLookup("helpers",b,"helper"),g=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : {}");return{params:d,paramsInit:e,name:f,callParams:[g].concat(d)}},setupParams:function(a,b,c){var d={},e=[],f=[],g=[],h=!c,i=void 0;h&&(c=[]),d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack());var j=this.popStack(),k=this.popStack();(k||j)&&(d.fn=k||"container.noop",d.inverse=j||"container.noop");for(var l=b;l--;)i=this.popStack(),c[l]=i,this.trackIds&&(g[l]=this.popStack()),this.stringParams&&(f[l]=this.popStack(),e[l]=this.popStack());return h&&(d.args=this.source.generateArray(c)),this.trackIds&&(d.ids=this.source.generateArray(g)),this.stringParams&&(d.types=this.source.generateArray(f),d.contexts=this.source.generateArray(e)),this.options.data&&(d.data="data"),this.useBlockParams&&(d.blockParams="blockParams"),d},setupHelperArgs:function(a,b,c,d){var e=this.setupParams(a,b,c);return e=this.objectLiteral(e),d?(this.useRegister("options"),c.push("options"),["options=",e]):c?(c.push(e),""):e}},function(){for(var a="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),b=e.RESERVED_WORDS={},c=0,d=a.length;d>c;c++)b[a[c]]=!0}(),e.isValidJavaScriptVariableName=function(a){return!e.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b,c){if(f.isArray(a)){for(var d=[],e=0,g=a.length;g>e;e++)d.push(b.wrap(a[e],c));return d}return"boolean"==typeof a||"number"==typeof a?a+"":a}function e(a){this.srcFile=a,this.source=[]}b.__esModule=!0;var f=c(5),g=void 0;try{}catch(h){}g||(g=function(a,b,c,d){this.src="",d&&this.add(d)},g.prototype={add:function(a){f.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){f.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),e.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,b){this.source.unshift(this.wrap(a,b))},push:function(a,b){this.source.push(this.wrap(a,b))},merge:function(){var a=this.empty();return this.each(function(b){a.add([" ",b,"\n"])}),a},each:function(a){for(var b=0,c=this.source.length;c>b;b++)a(this.source[b])},empty:function(){var a=this.currentLocation||{start:{}};return new g(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var b=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return a instanceof g?a:(a=d(a,this,b),new g(b.start.line,b.start.column,this.srcFile,a))},functionCall:function(a,b,c){return c=this.generateList(c),this.wrap([a,b?"."+b+"(":"(",c,")"])},quotedString:function(a){return'"'+(a+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)if(a.hasOwnProperty(c)){var e=d(a[c],this);"undefined"!==e&&b.push([this.quotedString(c),":",e])}var f=this.generateList(b);return f.prepend("{"),f.add("}"),f},generateList:function(a){for(var b=this.empty(),c=0,e=a.length;e>c;c++)c&&b.add(","),b.add(d(a[c],this));return b},generateArray:function(a){var b=this.generateList(a);return b.prepend("["),b.add("]"),b}},b["default"]=e,a.exports=b["default"]}])}); \ No newline at end of file diff --git a/doc/vendor/jquery.min.js b/doc/vendor/jquery.min.js new file mode 100644 index 0000000..a1c07fd --- /dev/null +++ b/doc/vendor/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
      "],col:[2,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
      ",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0r.page,h=new s(a[f],d,e),r.items.push(h),c.push(h)}return r.update(),c}},this.show=function(a,b){return this.i=a,this.page=b,r.update(),r},this.remove=function(a,b,c){for(var d=0,e=0,f=r.items.length;e-1&&c.splice(d,1),r},this.trigger=function(a){for(var b=r.handlers[a].length;b--;)r.handlers[a][b](r);return r},this.reset={filter:function(){for(var a=r.items,b=a.length;b--;)a[b].filtered=!1;return r},search:function(){for(var a=r.items,b=a.length;b--;)a[b].found=!1;return r}},this.update=function(){var a=r.items,b=a.length;r.visibleItems=[],r.matchingItems=[],r.templater.clear();for(var c=0;c=r.i&&r.visibleItems.length0?setTimeout(function(){b(c,d,e)},1):(a.update(),d(e))};return b}},{}],3:[function(a,b,c){b.exports=function(a){return a.handlers.filterStart=a.handlers.filterStart||[],a.handlers.filterComplete=a.handlers.filterComplete||[],function(b){if(a.trigger("filterStart"),a.i=1,a.reset.filter(),void 0===b)a.filtered=!1;else{a.filtered=!0;for(var c=a.items,d=0,e=c.length;d0?setTimeout(function(){f(a,c)},1):(b.update(),b.trigger("parseComplete"))};return b.handlers.parseComplete=b.handlers.parseComplete||[],function(){var a=d(b.list),c=b.valueNames;b.indexAsync?f(a,c):e(a,c)}}},{"./item":4}],6:[function(a,b,c){b.exports=function(a){var b,c,d,e,f={resetList:function(){a.i=1,a.templater.clear(),e=void 0},setOptions:function(a){2==a.length&&a[1]instanceof Array?c=a[1]:2==a.length&&"function"==typeof a[1]?(c=void 0,e=a[1]):3==a.length?(c=a[1],e=a[2]):c=void 0},setColumns:function(){0!==a.items.length&&void 0===c&&(c=void 0===a.searchColumns?f.toArray(a.items[0].values()):a.searchColumns)},setSearchString:function(b){b=a.utils.toString(b).toLowerCase(),b=b.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),d=b},toArray:function(a){var b=[];for(var c in a)b.push(c);return b}},g={list:function(){for(var b=0,c=a.items.length;b-1))},reset:function(){a.reset.search(),a.searched=!1}},h=function(b){return a.trigger("searchStart"),f.resetList(),f.setSearchString(b),f.setOptions(arguments),f.setColumns(),""===d?g.reset():(a.searched=!0,e?e(d,c):g.list()),a.update(),a.trigger("searchComplete"),a.visibleItems};return a.handlers.searchStart=a.handlers.searchStart||[],a.handlers.searchComplete=a.handlers.searchComplete||[],a.utils.events.bind(a.utils.getByClass(a.listContainer,a.searchClass),"keyup",function(b){var c=b.target||b.srcElement,d=""===c.value&&!a.searched;d||h(c.value)}),a.utils.events.bind(a.utils.getByClass(a.listContainer,a.searchClass),"input",function(a){var b=a.target||a.srcElement;""===b.value&&h("")}),h}},{}],7:[function(a,b,c){b.exports=function(a){a.sortFunction=a.sortFunction||function(b,c,d){return d.desc="desc"==d.order,a.utils.naturalSort(b.values()[d.valueName],c.values()[d.valueName],d)};var b={els:void 0,clear:function(){for(var c=0,d=b.els.length;c]/g.exec(b)){var f=document.createElement("tbody");return f.innerHTML=b,f.firstChild}if(b.indexOf("<")!==-1){var g=document.createElement("div");return g.innerHTML=b,g.firstChild}var h=document.getElementById(a.item);if(h)return h}},this.get=function(b,d){c.create(b);for(var e={},f=0,g=d.length;f=1;)a.list.removeChild(a.list.firstChild)},d()};b.exports=function(a){return new d(a)}},{}],9:[function(a,b,c){function d(a){if(!a||!a.nodeType)throw new Error("A DOM element reference is required");this.el=a,this.list=a.classList}var e=a("./index-of"),f=/\s+/,g=Object.prototype.toString;b.exports=function(a){return new d(a)},d.prototype.add=function(a){if(this.list)return this.list.add(a),this;var b=this.array(),c=e(b,a);return~c||b.push(a),this.el.className=b.join(" "),this},d.prototype.remove=function(a){if("[object RegExp]"==g.call(a))return this.removeMatching(a);if(this.list)return this.list.remove(a),this;var b=this.array(),c=e(b,a);return~c&&b.splice(c,1),this.el.className=b.join(" "),this},d.prototype.removeMatching=function(a){for(var b=this.array(),c=0;cs)return 1}for(var u=0,v=p.length,w=q.length,x=Math.max(v,w);ue)return 1}return 0}},{}],16:[function(a,b,c){function d(a){return"[object Array]"===Object.prototype.toString.call(a)}b.exports=function(a){if("undefined"==typeof a)return[];if(null===a)return[null];if(a===window)return[window];if("string"==typeof a)return[a];if(d(a))return a;if("number"!=typeof a.length)return[a];if("function"==typeof a&&a instanceof Function)return[a];for(var b=[],c=0;ca))return false; +if((f=u.get(t))&&u.get(e))return f==e;var f=-1,s=true,l=2&r?new y:Mt;for(u.set(t,e),u.set(e,t);++f=t}function vt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function gt(t){return null!=t&&typeof t=="object"}function dt(t){return typeof t=="symbol"||gt(t)&&"[object Symbol]"==k(t)}function At(t){return null==t?"":C(t)}function wt(t,e,r){return t=null==t?Mt:S(t,e),t===Mt?r:t}function mt(t,e){var r;if(r=null!=t){r=t;var n;n=R(e,r);for(var o=-1,c=n.length,u=false;++ot)&&(t==e.length-1?e.pop():ye.call(e,t,1),--this.size,true)},h.prototype.get=function(t){var e=this.__data__;return t=g(e,t),0>t?Mt:e[t][1]},h.prototype.has=function(t){return-1n?(++this.size,r.push([t,e])):r[n][1]=e,this},p.prototype.clear=function(){this.size=0,this.__data__={hash:new b,map:new(Oe||h),string:new b}},p.prototype.delete=function(t){ +return t=Z(this,t).delete(t),this.size-=t?1:0,t},p.prototype.get=function(t){return Z(this,t).get(t)},p.prototype.has=function(t){return Z(this,t).has(t)},p.prototype.set=function(t,e){var r=Z(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},y.prototype.add=y.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},y.prototype.has=function(t){return this.__data__.has(t)},j.prototype.clear=function(){this.__data__=new h,this.size=0},j.prototype.delete=function(t){ +var e=this.__data__;return t=e.delete(t),this.size=e.size,t},j.prototype.get=function(t){return this.__data__.get(t)},j.prototype.has=function(t){return this.__data__.has(t)},j.prototype.set=function(t,e){var r=this.__data__;if(r instanceof h){var n=r.__data__;if(!Oe||199>n.length)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new p(n)}return r.set(t,e),this.size=r.size,this};var Pe=function(t,e){return function(r,n){if(null==r)return r;if(!yt(r))return t(r,n);for(var o=r.length,c=e?o:-1,u=Object(r);(e?c--:++co?Mt:c,o=1),e=Object(e);++n ["/", "test", "\d+", undefined, "?"] + // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined] + '([\\/.])?(?:\\:(\\w+)(?:\\(((?:\\\\.|[^)])*)\\))?|\\(((?:\\\\.|[^)])*)\\))([+*?])?', + // Match regexp special characters that are always escaped. + '([.+*?=^!:${}()[\\]|\\/])' +].join('|'), 'g'); + +/** + * Escape the capturing group by escaping special characters and meaning. + * + * @param {String} group + * @return {String} + */ +function escapeGroup (group) { + return group.replace(/([=!:$\/()])/g, '\\$1'); +} + +/** + * Attach the keys as a property of the regexp. + * + * @param {RegExp} re + * @param {Array} keys + * @return {RegExp} + */ +function attachKeys (re, keys) { + re.keys = keys; + return re; +} + +/** + * Get the flags for a regexp from the options. + * + * @param {Object} options + * @return {String} + */ +function flags (options) { + return options.sensitive ? '' : 'i'; +} + +/** + * Pull out keys from a regexp. + * + * @param {RegExp} path + * @param {Array} keys + * @return {RegExp} + */ +function regexpToRegexp (path, keys) { + // Use a negative lookahead to match only capturing groups. + var groups = path.source.match(/\((?!\?)/g); + + if (groups) { + for (var i = 0; i < groups.length; i++) { + keys.push({ + name: i, + delimiter: null, + optional: false, + repeat: false + }); + } + } + + return attachKeys(path, keys); +} + +/** + * Transform an array into a regexp. + * + * @param {Array} path + * @param {Array} keys + * @param {Object} options + * @return {RegExp} + */ +function arrayToRegexp (path, keys, options) { + var parts = []; + + for (var i = 0; i < path.length; i++) { + parts.push(pathToRegexp(path[i], keys, options).source); + } + + var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)); + return attachKeys(regexp, keys); +} + +/** + * Replace the specific tags with regexp strings. + * + * @param {String} path + * @param {Array} keys + * @return {String} + */ +function replacePath (path, keys) { + var index = 0; + + function replace (_, escaped, prefix, key, capture, group, suffix, escape) { + if (escaped) { + return escaped; + } + + if (escape) { + return '\\' + escape; + } + + var repeat = suffix === '+' || suffix === '*'; + var optional = suffix === '?' || suffix === '*'; + + keys.push({ + name: key || index++, + delimiter: prefix || '/', + optional: optional, + repeat: repeat + }); + + prefix = prefix ? ('\\' + prefix) : ''; + capture = escapeGroup(capture || group || '[^' + (prefix || '\\/') + ']+?'); + + if (repeat) { + capture = capture + '(?:' + prefix + capture + ')*'; + } + + if (optional) { + return '(?:' + prefix + '(' + capture + '))?'; + } + + // Basic parameter support. + return prefix + '(' + capture + ')'; + } + + return path.replace(PATH_REGEXP, replace); +} + +/** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + * + * @param {(String|RegExp|Array)} path + * @param {Array} [keys] + * @param {Object} [options] + * @return {RegExp} + */ +function pathToRegexp (path, keys, options) { + keys = keys || []; + + if (!isArray(keys)) { + options = keys; + keys = []; + } else if (!options) { + options = {}; + } + + if (path instanceof RegExp) { + return regexpToRegexp(path, keys, options); + } + + if (isArray(path)) { + return arrayToRegexp(path, keys, options); + } + + var strict = options.strict; + var end = options.end !== false; + var route = replacePath(path, keys); + var endsWithSlash = path.charAt(path.length - 1) === '/'; + + // In non-strict mode we allow a slash at the end of match. If the path to + // match already ends with a slash, we remove it for consistency. The slash + // is valid at the end of a path match, not in the middle. This is important + // in non-ending mode, where "/test/" shouldn't match "/test//route". + if (!strict) { + route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?'; + } + + if (end) { + route += '$'; + } else { + // In non-ending mode, we need the capturing groups to match as much as + // possible by using a positive lookahead to the end or next path segment. + route += strict && endsWithSlash ? '' : '(?=\\/|$)'; + } + + return attachKeys(new RegExp('^' + route, flags(options)), keys); +} diff --git a/doc/vendor/polyfill.js b/doc/vendor/polyfill.js new file mode 100644 index 0000000..1d8c61c --- /dev/null +++ b/doc/vendor/polyfill.js @@ -0,0 +1,96 @@ +// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys +if (!Object.keys) { + Object.keys = (function () { + 'use strict'; + var hasOwnProperty = Object.prototype.hasOwnProperty, + hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), + dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ], + dontEnumsLength = dontEnums.length; + + return function (obj) { + if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { + throw new TypeError('Object.keys called on non-object'); + } + + var result = [], prop, i; + + for (prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + result.push(prop); + } + } + + if (hasDontEnumBug) { + for (i = 0; i < dontEnumsLength; i++) { + if (hasOwnProperty.call(obj, dontEnums[i])) { + result.push(dontEnums[i]); + } + } + } + return result; + }; + }()); +} + +//Production steps of ECMA-262, Edition 5, 15.4.4.18 +//Reference: http://es5.github.com/#x15.4.4.18 +if (!Array.prototype.forEach) { + Array.prototype.forEach = function (callback, thisArg) { + var T, k; + + if (this == null) { + throw new TypeError(' this is null or not defined'); + } + + // 1. Let O be the result of calling ToObject passing the |this| value as the argument. + var O = Object(this); + + // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". + // 3. Let len be ToUint32(lenValue). + var len = O.length >>> 0; + + // 4. If IsCallable(callback) is false, throw a TypeError exception. + // See: http://es5.github.com/#x9.11 + if (typeof callback !== "function") { + throw new TypeError(callback + " is not a function"); + } + + // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. + if (arguments.length > 1) { + T = thisArg; + } + + // 6. Let k be 0 + k = 0; + + // 7. Repeat, while k < len + while (k < len) { + var kValue; + + // a. Let Pk be ToString(k). + // This is implicit for LHS operands of the in operator + // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. + // This step can be combined with c + // c. If kPresent is true, then + if (k in O) { + // i. Let kValue be the result of calling the Get internal method of O with argument Pk. + kValue = O[k]; + + // ii. Call the Call internal method of callback with T as the this value and + // argument list containing kValue, k, and O. + callback.call(T, kValue, k, O); + } + // d. Increase k by 1. + k++; + } + // 8. return undefined + }; +} diff --git a/doc/vendor/prettify.css b/doc/vendor/prettify.css new file mode 100644 index 0000000..c54bf6b --- /dev/null +++ b/doc/vendor/prettify.css @@ -0,0 +1,51 @@ +/* Pretty printing styles. Used with prettify.js. */ +/* Vim sunburst theme by David Leibovic */ + +pre .str, code .str { color: #65B042; } /* string - green */ +pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */ +pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */ +pre .typ, code .typ { color: #89bdff; } /* type - light blue */ +pre .lit, code .lit { color: #3387CC; } /* literal - blue */ +pre .pun, code .pun { color: #fff; } /* punctuation - white */ +pre .pln, code .pln { color: #fff; } /* plaintext - white */ +pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */ +pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */ +pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */ +pre .dec, code .dec { color: #3387CC; } /* decimal - blue */ + +pre.prettyprint, code.prettyprint { + background-color: #000; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -o-border-radius: 8px; + -ms-border-radius: 8px; + -khtml-border-radius: 8px; + border-radius: 8px; +} + +pre.prettyprint { + width: 95%; + margin: 1em auto; + padding: 1em; + white-space: pre-wrap; +} + + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */ +li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1,li.L3,li.L5,li.L7,li.L9 { } + +@media print { + pre .str, code .str { color: #060; } + pre .kwd, code .kwd { color: #006; font-weight: bold; } + pre .com, code .com { color: #600; font-style: italic; } + pre .typ, code .typ { color: #404; font-weight: bold; } + pre .lit, code .lit { color: #044; } + pre .pun, code .pun { color: #440; } + pre .pln, code .pln { color: #000; } + pre .tag, code .tag { color: #006; font-weight: bold; } + pre .atn, code .atn { color: #404; } + pre .atv, code .atv { color: #060; } +} diff --git a/doc/vendor/prettify/.pydio b/doc/vendor/prettify/.pydio new file mode 100644 index 0000000..e927b20 --- /dev/null +++ b/doc/vendor/prettify/.pydio @@ -0,0 +1 @@ +d8f8fa23-463c-4b1b-bbc2-e33281ea3efe \ No newline at end of file diff --git a/doc/vendor/prettify/lang-Splus.js b/doc/vendor/prettify/lang-Splus.js new file mode 100644 index 0000000..6ce16e8 --- /dev/null +++ b/doc/vendor/prettify/lang-Splus.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2012 Jeffrey B. Arnold + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], +["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); diff --git a/doc/vendor/prettify/lang-aea.js b/doc/vendor/prettify/lang-aea.js new file mode 100644 index 0000000..784ebb2 --- /dev/null +++ b/doc/vendor/prettify/lang-aea.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2009 Onno Hommes. + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, +null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); diff --git a/doc/vendor/prettify/lang-agc.js b/doc/vendor/prettify/lang-agc.js new file mode 100644 index 0000000..784ebb2 --- /dev/null +++ b/doc/vendor/prettify/lang-agc.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2009 Onno Hommes. + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, +null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); diff --git a/doc/vendor/prettify/lang-apollo.js b/doc/vendor/prettify/lang-apollo.js new file mode 100644 index 0000000..784ebb2 --- /dev/null +++ b/doc/vendor/prettify/lang-apollo.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2009 Onno Hommes. + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, +null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); diff --git a/doc/vendor/prettify/lang-basic.js b/doc/vendor/prettify/lang-basic.js new file mode 100644 index 0000000..2d6151d --- /dev/null +++ b/doc/vendor/prettify/lang-basic.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2013 Peter Kofler + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i, +null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]); diff --git a/doc/vendor/prettify/lang-cbm.js b/doc/vendor/prettify/lang-cbm.js new file mode 100644 index 0000000..2d6151d --- /dev/null +++ b/doc/vendor/prettify/lang-cbm.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2013 Peter Kofler + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i, +null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]); diff --git a/doc/vendor/prettify/lang-cl.js b/doc/vendor/prettify/lang-cl.js new file mode 100644 index 0000000..2f18c96 --- /dev/null +++ b/doc/vendor/prettify/lang-cl.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2008 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, +null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); diff --git a/doc/vendor/prettify/lang-clj.js b/doc/vendor/prettify/lang-clj.js new file mode 100644 index 0000000..d1173b1 --- /dev/null +++ b/doc/vendor/prettify/lang-clj.js @@ -0,0 +1,17 @@ +/* + Copyright (C) 2011 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[\(\{\[]+/,null,"([{"],["clo",/^[\)\}\]]+/,null,")]}"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/, +null],["typ",/^:[0-9a-zA-Z\-]+/]]),["clj"]); diff --git a/doc/vendor/prettify/lang-css.js b/doc/vendor/prettify/lang-css.js new file mode 100644 index 0000000..90d175d --- /dev/null +++ b/doc/vendor/prettify/lang-css.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2009 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[["str",/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],["str",/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']+)\)/i],["kwd",/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//], +["com",/^(?:\x3c!--|--\x3e)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#(?:[0-9a-f]{3}){1,2}\b/i],["pln",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],["pun",/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^\)\"\']+/]]),["css-str"]); diff --git a/doc/vendor/prettify/lang-dart.js b/doc/vendor/prettify/lang-dart.js new file mode 100644 index 0000000..da142a4 --- /dev/null +++ b/doc/vendor/prettify/lang-dart.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2013 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!(?:.*)/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/(?:.*)/],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|async|await|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|sync|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], +["typ",/^\b(?:bool|double|Dynamic|int|num|Object|String|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?[\']{3}[\s|\S]*?[^\\][\']{3}/],["str",/^r?[\"]{3}[\s|\S]*?[^\\][\"]{3}/],["str",/^r?\'(\'|(?:[^\n\r\f])*?[^\\]\')/],["str",/^r?\"(\"|(?:[^\n\r\f])*?[^\\]\")/],["typ",/^[A-Z]\w*/],["pln",/^[a-z_$][a-z0-9_]*/i],["pun",/^[~!%^&*+=|?:<>/-]/],["lit",/^\b0x[0-9a-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit", +/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(){}\[\],.;]/]]),["dart"]); diff --git a/doc/vendor/prettify/lang-el.js b/doc/vendor/prettify/lang-el.js new file mode 100644 index 0000000..2f18c96 --- /dev/null +++ b/doc/vendor/prettify/lang-el.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2008 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, +null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); diff --git a/doc/vendor/prettify/lang-erl.js b/doc/vendor/prettify/lang-erl.js new file mode 100644 index 0000000..e7da9b0 --- /dev/null +++ b/doc/vendor/prettify/lang-erl.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2013 Andrew Allen + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], +["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]); diff --git a/doc/vendor/prettify/lang-erlang.js b/doc/vendor/prettify/lang-erlang.js new file mode 100644 index 0000000..e7da9b0 --- /dev/null +++ b/doc/vendor/prettify/lang-erlang.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2013 Andrew Allen + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], +["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]); diff --git a/doc/vendor/prettify/lang-fs.js b/doc/vendor/prettify/lang-fs.js new file mode 100644 index 0000000..c012a3f --- /dev/null +++ b/doc/vendor/prettify/lang-fs.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2008 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], +["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]); diff --git a/doc/vendor/prettify/lang-go.js b/doc/vendor/prettify/lang-go.js new file mode 100644 index 0000000..1f6934a --- /dev/null +++ b/doc/vendor/prettify/lang-go.js @@ -0,0 +1,17 @@ +/* + + Copyright (C) 2010 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])+(?:\'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\/\*[\s\S]*?\*\/)/],["pln",/^(?:[^\/\"\'`]|\/(?![\/\*]))+/i]]),["go"]); diff --git a/doc/vendor/prettify/lang-hs.js b/doc/vendor/prettify/lang-hs.js new file mode 100644 index 0000000..2002221 --- /dev/null +++ b/doc/vendor/prettify/lang-hs.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2009 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/, +null],["pln",/^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],["pun",/^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]]),["hs"]); diff --git a/doc/vendor/prettify/lang-lasso.js b/doc/vendor/prettify/lang-lasso.js new file mode 100644 index 0000000..415ca67 --- /dev/null +++ b/doc/vendor/prettify/lang-lasso.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2013 Eric Knibbe + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//], +["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i], +["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]); diff --git a/doc/vendor/prettify/lang-lassoscript.js b/doc/vendor/prettify/lang-lassoscript.js new file mode 100644 index 0000000..415ca67 --- /dev/null +++ b/doc/vendor/prettify/lang-lassoscript.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2013 Eric Knibbe + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//], +["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i], +["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]); diff --git a/doc/vendor/prettify/lang-latex.js b/doc/vendor/prettify/lang-latex.js new file mode 100644 index 0000000..efc758c --- /dev/null +++ b/doc/vendor/prettify/lang-latex.js @@ -0,0 +1,17 @@ +/* + + Copyright (C) 2011 Martin S. + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]); diff --git a/doc/vendor/prettify/lang-lgt.js b/doc/vendor/prettify/lang-lgt.js new file mode 100644 index 0000000..2959d75 --- /dev/null +++ b/doc/vendor/prettify/lang-lgt.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2014 Paulo Moura + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/], +["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]); diff --git a/doc/vendor/prettify/lang-lisp.js b/doc/vendor/prettify/lang-lisp.js new file mode 100644 index 0000000..2f18c96 --- /dev/null +++ b/doc/vendor/prettify/lang-lisp.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2008 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, +null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); diff --git a/doc/vendor/prettify/lang-ll.js b/doc/vendor/prettify/lang-ll.js new file mode 100644 index 0000000..7604d96 --- /dev/null +++ b/doc/vendor/prettify/lang-ll.js @@ -0,0 +1,17 @@ +/* + + Copyright (C) 2013 Nikhil Dabas + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]); diff --git a/doc/vendor/prettify/lang-llvm.js b/doc/vendor/prettify/lang-llvm.js new file mode 100644 index 0000000..7604d96 --- /dev/null +++ b/doc/vendor/prettify/lang-llvm.js @@ -0,0 +1,17 @@ +/* + + Copyright (C) 2013 Nikhil Dabas + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]); diff --git a/doc/vendor/prettify/lang-logtalk.js b/doc/vendor/prettify/lang-logtalk.js new file mode 100644 index 0000000..2959d75 --- /dev/null +++ b/doc/vendor/prettify/lang-logtalk.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2014 Paulo Moura + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/], +["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]); diff --git a/doc/vendor/prettify/lang-ls.js b/doc/vendor/prettify/lang-ls.js new file mode 100644 index 0000000..415ca67 --- /dev/null +++ b/doc/vendor/prettify/lang-ls.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2013 Eric Knibbe + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//], +["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i], +["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]); diff --git a/doc/vendor/prettify/lang-lsp.js b/doc/vendor/prettify/lang-lsp.js new file mode 100644 index 0000000..2f18c96 --- /dev/null +++ b/doc/vendor/prettify/lang-lsp.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2008 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, +null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); diff --git a/doc/vendor/prettify/lang-lua.js b/doc/vendor/prettify/lang-lua.js new file mode 100644 index 0000000..afb2901 --- /dev/null +++ b/doc/vendor/prettify/lang-lua.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2008 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],["str",/^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i], +["pln",/^[a-z_]\w*/i],["pun",/^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/]]),["lua"]); diff --git a/doc/vendor/prettify/lang-matlab.js b/doc/vendor/prettify/lang-matlab.js new file mode 100644 index 0000000..a0522a5 --- /dev/null +++ b/doc/vendor/prettify/lang-matlab.js @@ -0,0 +1,29 @@ +/* + + Copyright (c) 2013 by Amro + + 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. +*/ +var a=window.PR,b=[[a.PR_PLAIN,/^[ \t\r\n\v\f\xA0]+/,null," \t\r\n\x0B\f\u00a0"],[a.PR_COMMENT,/^%\{[^%]*%+(?:[^\}%][^%]*%+)*\}/,null],[a.PR_COMMENT,/^%[^\r\n]*/,null,"%"],["syscmd",/^![^\r\n]*/,null,"!"]],c=[["linecont",/^\.\.\.\s*[\r\n]/,null],["err",/^\?\?\? [^\r\n]*/,null],["wrn",/^Warning: [^\r\n]*/,null],["codeoutput",/^>>\s+/,null],["codeoutput",/^octave:\d+>\s+/,null],["lang-matlab-operators",/^((?:[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)*|\)|\]|\}|\.)')/,null],["lang-matlab-identifiers", +/^([a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)*)(?!')/,null],[a.PR_STRING,/^'(?:[^']|'')*'/,null],[a.PR_LITERAL,/^[+\-]?\.?\d+(?:\.\d*)?(?:[Ee][+\-]?\d+)?[ij]?/,null],[a.PR_TAG,/^(?:\{|\}|\(|\)|\[|\])/,null],[a.PR_PUNCTUATION,/^(?:<|>|=|~|@|&|;|,|:|!|\-|\+|\*|\^|\.|\||\\|\/)/,null]],d=[["lang-matlab-identifiers",/^([a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)*)/,null],[a.PR_TAG,/^(?:\{|\}|\(|\)|\[|\])/,null],[a.PR_PUNCTUATION,/^(?:<|>|=|~|@|&|;|,|:|!|\-|\+|\*|\^|\.|\||\\|\/)/,null],["transpose", +/^'/,null]]; +a.registerLangHandler(a.createSimpleLexer([],[[a.PR_KEYWORD,/^\b(?:break|case|catch|classdef|continue|else|elseif|end|for|function|global|if|otherwise|parfor|persistent|return|spmd|switch|try|while)\b/,null],["const",/^\b(?:true|false|inf|Inf|nan|NaN|eps|pi|ans|nargin|nargout|varargin|varargout)\b/,null],[a.PR_TYPE,/^\b(?:cell|struct|char|double|single|logical|u?int(?:8|16|32|64)|sparse)\b/,null],["fun",/^\b(?:abs|accumarray|acos(?:d|h)?|acot(?:d|h)?|acsc(?:d|h)?|actxcontrol(?:list|select)?|actxGetRunningServer|actxserver|addlistener|addpath|addpref|addtodate|airy|align|alim|all|allchild|alpha|alphamap|amd|ancestor|and|angle|annotation|any|area|arrayfun|asec(?:d|h)?|asin(?:d|h)?|assert|assignin|atan(?:2|d|h)?|audiodevinfo|audioplayer|audiorecorder|aufinfo|auread|autumn|auwrite|avifile|aviinfo|aviread|axes|axis|balance|bar(?:3|3h|h)?|base2dec|beep|BeginInvoke|bench|bessel(?:h|i|j|k|y)|beta|betainc|betaincinv|betaln|bicg|bicgstab|bicgstabl|bin2dec|bitand|bitcmp|bitget|bitmax|bitnot|bitor|bitset|bitshift|bitxor|blanks|blkdiag|bone|box|brighten|brush|bsxfun|builddocsearchdb|builtin|bvp4c|bvp5c|bvpget|bvpinit|bvpset|bvpxtend|calendar|calllib|callSoapService|camdolly|cameratoolbar|camlight|camlookat|camorbit|campan|campos|camproj|camroll|camtarget|camup|camva|camzoom|cart2pol|cart2sph|cast|cat|caxis|cd|cdf2rdf|cdfepoch|cdfinfo|cdflib(?:.(?:close|closeVar|computeEpoch|computeEpoch16|create|createAttr|createVar|delete|deleteAttr|deleteAttrEntry|deleteAttrgEntry|deleteVar|deleteVarRecords|epoch16Breakdown|epochBreakdown|getAttrEntry|getAttrgEntry|getAttrMaxEntry|getAttrMaxgEntry|getAttrName|getAttrNum|getAttrScope|getCacheSize|getChecksum|getCompression|getCompressionCacheSize|getConstantNames|getConstantValue|getCopyright|getFileBackward|getFormat|getLibraryCopyright|getLibraryVersion|getMajority|getName|getNumAttrEntries|getNumAttrgEntries|getNumAttributes|getNumgAttributes|getReadOnlyMode|getStageCacheSize|getValidate|getVarAllocRecords|getVarBlockingFactor|getVarCacheSize|getVarCompression|getVarData|getVarMaxAllocRecNum|getVarMaxWrittenRecNum|getVarName|getVarNum|getVarNumRecsWritten|getVarPadValue|getVarRecordData|getVarReservePercent|getVarsMaxWrittenRecNum|getVarSparseRecords|getVersion|hyperGetVarData|hyperPutVarData|inquire|inquireAttr|inquireAttrEntry|inquireAttrgEntry|inquireVar|open|putAttrEntry|putAttrgEntry|putVarData|putVarRecordData|renameAttr|renameVar|setCacheSize|setChecksum|setCompression|setCompressionCacheSize|setFileBackward|setFormat|setMajority|setReadOnlyMode|setStageCacheSize|setValidate|setVarAllocBlockRecords|setVarBlockingFactor|setVarCacheSize|setVarCompression|setVarInitialRecs|setVarPadValue|SetVarReservePercent|setVarsCacheSize|setVarSparseRecords))?|cdfread|cdfwrite|ceil|cell2mat|cell2struct|celldisp|cellfun|cellplot|cellstr|cgs|checkcode|checkin|checkout|chol|cholinc|cholupdate|circshift|cla|clabel|class|clc|clear|clearvars|clf|clipboard|clock|close|closereq|cmopts|cmpermute|cmunique|colamd|colon|colorbar|colordef|colormap|colormapeditor|colperm|Combine|comet|comet3|commandhistory|commandwindow|compan|compass|complex|computer|cond|condeig|condest|coneplot|conj|containers.Map|contour(?:3|c|f|slice)?|contrast|conv|conv2|convhull|convhulln|convn|cool|copper|copyfile|copyobj|corrcoef|cos(?:d|h)?|cot(?:d|h)?|cov|cplxpair|cputime|createClassFromWsdl|createSoapMessage|cross|csc(?:d|h)?|csvread|csvwrite|ctranspose|cumprod|cumsum|cumtrapz|curl|customverctrl|cylinder|daqread|daspect|datacursormode|datatipinfo|date|datenum|datestr|datetick|datevec|dbclear|dbcont|dbdown|dblquad|dbmex|dbquit|dbstack|dbstatus|dbstep|dbstop|dbtype|dbup|dde23|ddeget|ddesd|ddeset|deal|deblank|dec2base|dec2bin|dec2hex|decic|deconv|del2|delaunay|delaunay3|delaunayn|DelaunayTri|delete|demo|depdir|depfun|det|detrend|deval|diag|dialog|diary|diff|diffuse|dir|disp|display|dither|divergence|dlmread|dlmwrite|dmperm|doc|docsearch|dos|dot|dragrect|drawnow|dsearch|dsearchn|dynamicprops|echo|echodemo|edit|eig|eigs|ellipj|ellipke|ellipsoid|empty|enableNETfromNetworkDrive|enableservice|EndInvoke|enumeration|eomday|eq|erf|erfc|erfcinv|erfcx|erfinv|error|errorbar|errordlg|etime|etree|etreeplot|eval|evalc|evalin|event.(?:EventData|listener|PropertyEvent|proplistener)|exifread|exist|exit|exp|expint|expm|expm1|export2wsdlg|eye|ezcontour|ezcontourf|ezmesh|ezmeshc|ezplot|ezplot3|ezpolar|ezsurf|ezsurfc|factor|factorial|fclose|feather|feature|feof|ferror|feval|fft|fft2|fftn|fftshift|fftw|fgetl|fgets|fieldnames|figure|figurepalette|fileattrib|filebrowser|filemarker|fileparts|fileread|filesep|fill|fill3|filter|filter2|find|findall|findfigs|findobj|findstr|finish|fitsdisp|fitsinfo|fitsread|fitswrite|fix|flag|flipdim|fliplr|flipud|floor|flow|fminbnd|fminsearch|fopen|format|fplot|fprintf|frame2im|fread|freqspace|frewind|fscanf|fseek|ftell|FTP|full|fullfile|func2str|functions|funm|fwrite|fzero|gallery|gamma|gammainc|gammaincinv|gammaln|gca|gcbf|gcbo|gcd|gcf|gco|ge|genpath|genvarname|get|getappdata|getenv|getfield|getframe|getpixelposition|getpref|ginput|gmres|gplot|grabcode|gradient|gray|graymon|grid|griddata(?:3|n)?|griddedInterpolant|gsvd|gt|gtext|guidata|guide|guihandles|gunzip|gzip|h5create|h5disp|h5info|h5read|h5readatt|h5write|h5writeatt|hadamard|handle|hankel|hdf|hdf5|hdf5info|hdf5read|hdf5write|hdfinfo|hdfread|hdftool|help|helpbrowser|helpdesk|helpdlg|helpwin|hess|hex2dec|hex2num|hgexport|hggroup|hgload|hgsave|hgsetget|hgtransform|hidden|hilb|hist|histc|hold|home|horzcat|hostid|hot|hsv|hsv2rgb|hypot|ichol|idivide|ifft|ifft2|ifftn|ifftshift|ilu|im2frame|im2java|imag|image|imagesc|imapprox|imfinfo|imformats|import|importdata|imread|imwrite|ind2rgb|ind2sub|inferiorto|info|inline|inmem|inpolygon|input|inputdlg|inputname|inputParser|inspect|instrcallback|instrfind|instrfindall|int2str|integral(?:2|3)?|interp(?:1|1q|2|3|ft|n)|interpstreamspeed|intersect|intmax|intmin|inv|invhilb|ipermute|isa|isappdata|iscell|iscellstr|ischar|iscolumn|isdir|isempty|isequal|isequaln|isequalwithequalnans|isfield|isfinite|isfloat|isglobal|ishandle|ishghandle|ishold|isinf|isinteger|isjava|iskeyword|isletter|islogical|ismac|ismatrix|ismember|ismethod|isnan|isnumeric|isobject|isocaps|isocolors|isonormals|isosurface|ispc|ispref|isprime|isprop|isreal|isrow|isscalar|issorted|isspace|issparse|isstr|isstrprop|isstruct|isstudent|isunix|isvarname|isvector|javaaddpath|javaArray|javachk|javaclasspath|javacomponent|javaMethod|javaMethodEDT|javaObject|javaObjectEDT|javarmpath|jet|keyboard|kron|lasterr|lasterror|lastwarn|lcm|ldivide|ldl|le|legend|legendre|length|libfunctions|libfunctionsview|libisloaded|libpointer|libstruct|license|light|lightangle|lighting|lin2mu|line|lines|linkaxes|linkdata|linkprop|linsolve|linspace|listdlg|listfonts|load|loadlibrary|loadobj|log|log10|log1p|log2|loglog|logm|logspace|lookfor|lower|ls|lscov|lsqnonneg|lsqr|lt|lu|luinc|magic|makehgtform|mat2cell|mat2str|material|matfile|matlab.io.MatFile|matlab.mixin.(?:Copyable|Heterogeneous(?:.getDefaultScalarElement)?)|matlabrc|matlabroot|max|maxNumCompThreads|mean|median|membrane|memmapfile|memory|menu|mesh|meshc|meshgrid|meshz|meta.(?:class(?:.fromName)?|DynamicProperty|EnumeratedValue|event|MetaData|method|package(?:.(?:fromName|getAllPackages))?|property)|metaclass|methods|methodsview|mex(?:.getCompilerConfigurations)?|MException|mexext|mfilename|min|minres|minus|mislocked|mkdir|mkpp|mldivide|mlint|mlintrpt|mlock|mmfileinfo|mmreader|mod|mode|more|move|movefile|movegui|movie|movie2avi|mpower|mrdivide|msgbox|mtimes|mu2lin|multibandread|multibandwrite|munlock|namelengthmax|nargchk|narginchk|nargoutchk|native2unicode|nccreate|ncdisp|nchoosek|ncinfo|ncread|ncreadatt|ncwrite|ncwriteatt|ncwriteschema|ndgrid|ndims|ne|NET(?:.(?:addAssembly|Assembly|convertArray|createArray|createGeneric|disableAutoRelease|enableAutoRelease|GenericClass|invokeGenericMethod|NetException|setStaticProperty))?|netcdf.(?:abort|close|copyAtt|create|defDim|defGrp|defVar|defVarChunking|defVarDeflate|defVarFill|defVarFletcher32|delAtt|endDef|getAtt|getChunkCache|getConstant|getConstantNames|getVar|inq|inqAtt|inqAttID|inqAttName|inqDim|inqDimID|inqDimIDs|inqFormat|inqGrpName|inqGrpNameFull|inqGrpParent|inqGrps|inqLibVers|inqNcid|inqUnlimDims|inqVar|inqVarChunking|inqVarDeflate|inqVarFill|inqVarFletcher32|inqVarID|inqVarIDs|open|putAtt|putVar|reDef|renameAtt|renameDim|renameVar|setChunkCache|setDefaultFormat|setFill|sync)|newplot|nextpow2|nnz|noanimate|nonzeros|norm|normest|not|notebook|now|nthroot|null|num2cell|num2hex|num2str|numel|nzmax|ode(?:113|15i|15s|23|23s|23t|23tb|45)|odeget|odeset|odextend|onCleanup|ones|open|openfig|opengl|openvar|optimget|optimset|or|ordeig|orderfields|ordqz|ordschur|orient|orth|pack|padecoef|pagesetupdlg|pan|pareto|parseSoapResponse|pascal|patch|path|path2rc|pathsep|pathtool|pause|pbaspect|pcg|pchip|pcode|pcolor|pdepe|pdeval|peaks|perl|perms|permute|pie|pink|pinv|planerot|playshow|plot|plot3|plotbrowser|plotedit|plotmatrix|plottools|plotyy|plus|pol2cart|polar|poly|polyarea|polyder|polyeig|polyfit|polyint|polyval|polyvalm|pow2|power|ppval|prefdir|preferences|primes|print|printdlg|printopt|printpreview|prod|profile|profsave|propedit|propertyeditor|psi|publish|PutCharArray|PutFullMatrix|PutWorkspaceData|pwd|qhull|qmr|qr|qrdelete|qrinsert|qrupdate|quad|quad2d|quadgk|quadl|quadv|questdlg|quit|quiver|quiver3|qz|rand|randi|randn|randperm|RandStream(?:.(?:create|getDefaultStream|getGlobalStream|list|setDefaultStream|setGlobalStream))?|rank|rat|rats|rbbox|rcond|rdivide|readasync|real|reallog|realmax|realmin|realpow|realsqrt|record|rectangle|rectint|recycle|reducepatch|reducevolume|refresh|refreshdata|regexp|regexpi|regexprep|regexptranslate|rehash|rem|Remove|RemoveAll|repmat|reset|reshape|residue|restoredefaultpath|rethrow|rgb2hsv|rgb2ind|rgbplot|ribbon|rmappdata|rmdir|rmfield|rmpath|rmpref|rng|roots|rose|rosser|rot90|rotate|rotate3d|round|rref|rsf2csf|run|save|saveas|saveobj|savepath|scatter|scatter3|schur|sec|secd|sech|selectmoveresize|semilogx|semilogy|sendmail|serial|set|setappdata|setdiff|setenv|setfield|setpixelposition|setpref|setstr|setxor|shading|shg|shiftdim|showplottool|shrinkfaces|sign|sin(?:d|h)?|size|slice|smooth3|snapnow|sort|sortrows|sound|soundsc|spalloc|spaugment|spconvert|spdiags|specular|speye|spfun|sph2cart|sphere|spinmap|spline|spones|spparms|sprand|sprandn|sprandsym|sprank|spring|sprintf|spy|sqrt|sqrtm|squeeze|ss2tf|sscanf|stairs|startup|std|stem|stem3|stopasync|str2double|str2func|str2mat|str2num|strcat|strcmp|strcmpi|stream2|stream3|streamline|streamparticles|streamribbon|streamslice|streamtube|strfind|strjust|strmatch|strncmp|strncmpi|strread|strrep|strtok|strtrim|struct2cell|structfun|strvcat|sub2ind|subplot|subsasgn|subsindex|subspace|subsref|substruct|subvolume|sum|summer|superclasses|superiorto|support|surf|surf2patch|surface|surfc|surfl|surfnorm|svd|svds|swapbytes|symamd|symbfact|symmlq|symrcm|symvar|system|tan(?:d|h)?|tar|tempdir|tempname|tetramesh|texlabel|text|textread|textscan|textwrap|tfqmr|throw|tic|Tiff(?:.(?:getTagNames|getVersion))?|timer|timerfind|timerfindall|times|timeseries|title|toc|todatenum|toeplitz|toolboxdir|trace|transpose|trapz|treelayout|treeplot|tril|trimesh|triplequad|triplot|TriRep|TriScatteredInterp|trisurf|triu|tscollection|tsearch|tsearchn|tstool|type|typecast|uibuttongroup|uicontextmenu|uicontrol|uigetdir|uigetfile|uigetpref|uiimport|uimenu|uiopen|uipanel|uipushtool|uiputfile|uiresume|uisave|uisetcolor|uisetfont|uisetpref|uistack|uitable|uitoggletool|uitoolbar|uiwait|uminus|undocheckout|unicode2native|union|unique|unix|unloadlibrary|unmesh|unmkpp|untar|unwrap|unzip|uplus|upper|urlread|urlwrite|usejava|userpath|validateattributes|validatestring|vander|var|vectorize|ver|verctrl|verLessThan|version|vertcat|VideoReader(?:.isPlatformSupported)?|VideoWriter(?:.getProfiles)?|view|viewmtx|visdiff|volumebounds|voronoi|voronoin|wait|waitbar|waitfor|waitforbuttonpress|warndlg|warning|waterfall|wavfinfo|wavplay|wavread|wavrecord|wavwrite|web|weekday|what|whatsnew|which|whitebg|who|whos|wilkinson|winopen|winqueryreg|winter|wk1finfo|wk1read|wk1write|workspace|xlabel|xlim|xlsfinfo|xlsread|xlswrite|xmlread|xmlwrite|xor|xslt|ylabel|ylim|zeros|zip|zlabel|zlim|zoom)\b/,null], +["fun_tbx",/^\b(?:addedvarplot|andrewsplot|anova(?:1|2|n)|ansaribradley|aoctool|barttest|bbdesign|beta(?:cdf|fit|inv|like|pdf|rnd|stat)|bino(?:cdf|fit|inv|pdf|rnd|stat)|biplot|bootci|bootstrp|boxplot|candexch|candgen|canoncorr|capability|capaplot|caseread|casewrite|categorical|ccdesign|cdfplot|chi2(?:cdf|gof|inv|pdf|rnd|stat)|cholcov|Classification(?:BaggedEnsemble|Discriminant(?:.(?:fit|make|template))?|Ensemble|KNN(?:.(?:fit|template))?|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|template))?)|classify|classregtree|cluster|clusterdata|cmdscale|combnk|Compact(?:Classification(?:Discriminant|Ensemble|Tree)|Regression(?:Ensemble|Tree)|TreeBagger)|confusionmat|controlchart|controlrules|cophenet|copula(?:cdf|fit|param|pdf|rnd|stat)|cordexch|corr|corrcov|coxphfit|createns|crosstab|crossval|cvpartition|datasample|dataset|daugment|dcovary|dendrogram|dfittool|disttool|dummyvar|dwtest|ecdf|ecdfhist|ev(?:cdf|fit|inv|like|pdf|rnd|stat)|ExhaustiveSearcher|exp(?:cdf|fit|inv|like|pdf|rnd|stat)|factoran|fcdf|ff2n|finv|fitdist|fitensemble|fpdf|fracfact|fracfactgen|friedman|frnd|fstat|fsurfht|fullfact|gagerr|gam(?:cdf|fit|inv|like|pdf|rnd|stat)|GeneralizedLinearModel(?:.fit)?|geo(?:cdf|inv|mean|pdf|rnd|stat)|gev(?:cdf|fit|inv|like|pdf|rnd|stat)|gline|glmfit|glmval|glyphplot|gmdistribution(?:.fit)?|gname|gp(?:cdf|fit|inv|like|pdf|rnd|stat)|gplotmatrix|grp2idx|grpstats|gscatter|haltonset|harmmean|hist3|histfit|hmm(?:decode|estimate|generate|train|viterbi)|hougen|hyge(?:cdf|inv|pdf|rnd|stat)|icdf|inconsistent|interactionplot|invpred|iqr|iwishrnd|jackknife|jbtest|johnsrnd|KDTreeSearcher|kmeans|knnsearch|kruskalwallis|ksdensity|kstest|kstest2|kurtosis|lasso|lassoglm|lassoPlot|leverage|lhsdesign|lhsnorm|lillietest|LinearModel(?:.fit)?|linhyptest|linkage|logn(?:cdf|fit|inv|like|pdf|rnd|stat)|lsline|mad|mahal|maineffectsplot|manova1|manovacluster|mdscale|mhsample|mle|mlecov|mnpdf|mnrfit|mnrnd|mnrval|moment|multcompare|multivarichart|mvn(?:cdf|pdf|rnd)|mvregress|mvregresslike|mvt(?:cdf|pdf|rnd)|NaiveBayes(?:.fit)?|nan(?:cov|max|mean|median|min|std|sum|var)|nbin(?:cdf|fit|inv|pdf|rnd|stat)|ncf(?:cdf|inv|pdf|rnd|stat)|nct(?:cdf|inv|pdf|rnd|stat)|ncx2(?:cdf|inv|pdf|rnd|stat)|NeighborSearcher|nlinfit|nlintool|nlmefit|nlmefitsa|nlparci|nlpredci|nnmf|nominal|NonLinearModel(?:.fit)?|norm(?:cdf|fit|inv|like|pdf|rnd|stat)|normplot|normspec|ordinal|outlierMeasure|parallelcoords|paretotails|partialcorr|pcacov|pcares|pdf|pdist|pdist2|pearsrnd|perfcurve|perms|piecewisedistribution|plsregress|poiss(?:cdf|fit|inv|pdf|rnd|tat)|polyconf|polytool|prctile|princomp|ProbDist(?:Kernel|Parametric|UnivKernel|UnivParam)?|probplot|procrustes|qqplot|qrandset|qrandstream|quantile|randg|random|randsample|randtool|range|rangesearch|ranksum|rayl(?:cdf|fit|inv|pdf|rnd|stat)|rcoplot|refcurve|refline|regress|Regression(?:BaggedEnsemble|Ensemble|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|template))?)|regstats|relieff|ridge|robustdemo|robustfit|rotatefactors|rowexch|rsmdemo|rstool|runstest|sampsizepwr|scatterhist|sequentialfs|signrank|signtest|silhouette|skewness|slicesample|sobolset|squareform|statget|statset|stepwise|stepwisefit|surfht|tabulate|tblread|tblwrite|tcdf|tdfread|tiedrank|tinv|tpdf|TreeBagger|treedisp|treefit|treeprune|treetest|treeval|trimmean|trnd|tstat|ttest|ttest2|unid(?:cdf|inv|pdf|rnd|stat)|unif(?:cdf|inv|it|pdf|rnd|stat)|vartest(?:2|n)?|wbl(?:cdf|fit|inv|like|pdf|rnd|stat)|wblplot|wishrnd|x2fx|xptread|zscore|ztest)\b/, +null],["fun_tbx",/^\b(?:adapthisteq|analyze75info|analyze75read|applycform|applylut|axes2pix|bestblk|blockproc|bwarea|bwareaopen|bwboundaries|bwconncomp|bwconvhull|bwdist|bwdistgeodesic|bweuler|bwhitmiss|bwlabel|bwlabeln|bwmorph|bwpack|bwperim|bwselect|bwtraceboundary|bwulterode|bwunpack|checkerboard|col2im|colfilt|conndef|convmtx2|corner|cornermetric|corr2|cp2tform|cpcorr|cpselect|cpstruct2pairs|dct2|dctmtx|deconvblind|deconvlucy|deconvreg|deconvwnr|decorrstretch|demosaic|dicom(?:anon|dict|info|lookup|read|uid|write)|edge|edgetaper|entropy|entropyfilt|fan2para|fanbeam|findbounds|fliptform|freqz2|fsamp2|fspecial|ftrans2|fwind1|fwind2|getheight|getimage|getimagemodel|getline|getneighbors|getnhood|getpts|getrangefromclass|getrect|getsequence|gray2ind|graycomatrix|graycoprops|graydist|grayslice|graythresh|hdrread|hdrwrite|histeq|hough|houghlines|houghpeaks|iccfind|iccread|iccroot|iccwrite|idct2|ifanbeam|im2bw|im2col|im2double|im2int16|im2java2d|im2single|im2uint16|im2uint8|imabsdiff|imadd|imadjust|ImageAdapter|imageinfo|imagemodel|imapplymatrix|imattributes|imbothat|imclearborder|imclose|imcolormaptool|imcomplement|imcontour|imcontrast|imcrop|imdilate|imdisplayrange|imdistline|imdivide|imellipse|imerode|imextendedmax|imextendedmin|imfill|imfilter|imfindcircles|imfreehand|imfuse|imgca|imgcf|imgetfile|imhandles|imhist|imhmax|imhmin|imimposemin|imlincomb|imline|immagbox|immovie|immultiply|imnoise|imopen|imoverview|imoverviewpanel|impixel|impixelinfo|impixelinfoval|impixelregion|impixelregionpanel|implay|impoint|impoly|impositionrect|improfile|imputfile|impyramid|imreconstruct|imrect|imregconfig|imregionalmax|imregionalmin|imregister|imresize|imroi|imrotate|imsave|imscrollpanel|imshow|imshowpair|imsubtract|imtool|imtophat|imtransform|imview|ind2gray|ind2rgb|interfileinfo|interfileread|intlut|ippl|iptaddcallback|iptcheckconn|iptcheckhandle|iptcheckinput|iptcheckmap|iptchecknargin|iptcheckstrs|iptdemos|iptgetapi|iptGetPointerBehavior|iptgetpref|ipticondir|iptnum2ordinal|iptPointerManager|iptprefs|iptremovecallback|iptSetPointerBehavior|iptsetpref|iptwindowalign|iradon|isbw|isflat|isgray|isicc|isind|isnitf|isrgb|isrset|lab2double|lab2uint16|lab2uint8|label2rgb|labelmatrix|makecform|makeConstrainToRectFcn|makehdr|makelut|makeresampler|maketform|mat2gray|mean2|medfilt2|montage|nitfinfo|nitfread|nlfilter|normxcorr2|ntsc2rgb|openrset|ordfilt2|otf2psf|padarray|para2fan|phantom|poly2mask|psf2otf|qtdecomp|qtgetblk|qtsetblk|radon|rangefilt|reflect|regionprops|registration.metric.(?:MattesMutualInformation|MeanSquares)|registration.optimizer.(?:OnePlusOneEvolutionary|RegularStepGradientDescent)|rgb2gray|rgb2ntsc|rgb2ycbcr|roicolor|roifill|roifilt2|roipoly|rsetwrite|std2|stdfilt|strel|stretchlim|subimage|tformarray|tformfwd|tforminv|tonemap|translate|truesize|uintlut|viscircles|warp|watershed|whitepoint|wiener2|xyz2double|xyz2uint16|ycbcr2rgb)\b/, +null],["fun_tbx",/^\b(?:bintprog|color|fgoalattain|fminbnd|fmincon|fminimax|fminsearch|fminunc|fseminf|fsolve|fzero|fzmult|gangstr|ktrlink|linprog|lsqcurvefit|lsqlin|lsqnonlin|lsqnonneg|optimget|optimset|optimtool|quadprog)\b/,null],["ident",/^[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z][a-zA-Z0-9_]*)*/,null]]),["matlab-identifiers"]);a.registerLangHandler(a.createSimpleLexer([],d),["matlab-operators"]);a.registerLangHandler(a.createSimpleLexer(b,c),["matlab"]); diff --git a/doc/vendor/prettify/lang-ml.js b/doc/vendor/prettify/lang-ml.js new file mode 100644 index 0000000..c012a3f --- /dev/null +++ b/doc/vendor/prettify/lang-ml.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2008 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], +["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]); diff --git a/doc/vendor/prettify/lang-mumps.js b/doc/vendor/prettify/lang-mumps.js new file mode 100644 index 0000000..6d51258 --- /dev/null +++ b/doc/vendor/prettify/lang-mumps.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2011 Kitware Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"]|\\.)*")/,null,'"']],[["com",/^;[^\r\n]*/,null,";"],["dec",/^(?:\$(?:D|DEVICE|EC|ECODE|ES|ESTACK|ET|ETRAP|H|HOROLOG|I|IO|J|JOB|K|KEY|P|PRINCIPAL|Q|QUIT|ST|STACK|S|STORAGE|SY|SYSTEM|T|TEST|TL|TLEVEL|TR|TRESTART|X|Y|Z[A-Z]*|A|ASCII|C|CHAR|D|DATA|E|EXTRACT|F|FIND|FN|FNUMBER|G|GET|J|JUSTIFY|L|LENGTH|NA|NAME|O|ORDER|P|PIECE|QL|QLENGTH|QS|QSUBSCRIPT|Q|QUERY|R|RANDOM|RE|REVERSE|S|SELECT|ST|STACK|T|TEXT|TR|TRANSLATE|NaN))\b/i, +null],["kwd",/^(?:[^\$]B|BREAK|C|CLOSE|D|DO|E|ELSE|F|FOR|G|GOTO|H|HALT|H|HANG|I|IF|J|JOB|K|KILL|L|LOCK|M|MERGE|N|NEW|O|OPEN|Q|QUIT|R|READ|S|SET|TC|TCOMMIT|TRE|TRESTART|TRO|TROLLBACK|TS|TSTART|U|USE|V|VIEW|W|WRITE|X|XECUTE)\b/i,null],["lit",/^[+-]?(?:(?:\.\d+|\d+(?:\.\d*)?)(?:E[+\-]?\d+)?)/i],["pln",/^[a-z][a-zA-Z0-9]*/i],["pun",/^[^\w\t\n\r\xA0\"\$;%\^]|_/]]),["mumps"]); diff --git a/doc/vendor/prettify/lang-n.js b/doc/vendor/prettify/lang-n.js new file mode 100644 index 0000000..9b3910c --- /dev/null +++ b/doc/vendor/prettify/lang-n.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2011 Zimin A.V. + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*\'|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null],["str",/^<#(?:[^#>])*(?:#>|$)/,null],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null],["com",/^\/\/[^\r\n]*/, +null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, +null],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,null],["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^@[A-Z]+[a-z][A-Za-z_$@0-9]*/,null],["pln",/^'?[A-Za-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\"\`\/\#]*/,null]]),["n","nemerle"]); diff --git a/doc/vendor/prettify/lang-nemerle.js b/doc/vendor/prettify/lang-nemerle.js new file mode 100644 index 0000000..9b3910c --- /dev/null +++ b/doc/vendor/prettify/lang-nemerle.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2011 Zimin A.V. + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*\'|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null],["str",/^<#(?:[^#>])*(?:#>|$)/,null],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null],["com",/^\/\/[^\r\n]*/, +null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, +null],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,null],["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^@[A-Z]+[a-z][A-Za-z_$@0-9]*/,null],["pln",/^'?[A-Za-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\"\`\/\#]*/,null]]),["n","nemerle"]); diff --git a/doc/vendor/prettify/lang-pascal.js b/doc/vendor/prettify/lang-pascal.js new file mode 100644 index 0000000..c76a11c --- /dev/null +++ b/doc/vendor/prettify/lang-pascal.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2013 Peter Kofler + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$))/,null,"'"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^\(\*[\s\S]*?(?:\*\)|$)|^\{[\s\S]*?(?:\}|$)/,null],["kwd",/^(?:ABSOLUTE|AND|ARRAY|ASM|ASSEMBLER|BEGIN|CASE|CONST|CONSTRUCTOR|DESTRUCTOR|DIV|DO|DOWNTO|ELSE|END|EXTERNAL|FOR|FORWARD|FUNCTION|GOTO|IF|IMPLEMENTATION|IN|INLINE|INTERFACE|INTERRUPT|LABEL|MOD|NOT|OBJECT|OF|OR|PACKED|PROCEDURE|PROGRAM|RECORD|REPEAT|SET|SHL|SHR|THEN|TO|TYPE|UNIT|UNTIL|USES|VAR|VIRTUAL|WHILE|WITH|XOR)\b/i, +null],["lit",/^(?:true|false|self|nil)/i,null],["pln",/^[a-z][a-z0-9]*/i,null],["lit",/^(?:\$[a-f0-9]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?)/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\/]*/,null]]),["pascal"]); diff --git a/doc/vendor/prettify/lang-proto.js b/doc/vendor/prettify/lang-proto.js new file mode 100644 index 0000000..3215ff6 --- /dev/null +++ b/doc/vendor/prettify/lang-proto.js @@ -0,0 +1,17 @@ +/* + + Copyright (C) 2006 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); diff --git a/doc/vendor/prettify/lang-r.js b/doc/vendor/prettify/lang-r.js new file mode 100644 index 0000000..6ce16e8 --- /dev/null +++ b/doc/vendor/prettify/lang-r.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2012 Jeffrey B. Arnold + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], +["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); diff --git a/doc/vendor/prettify/lang-rd.js b/doc/vendor/prettify/lang-rd.js new file mode 100644 index 0000000..113141c --- /dev/null +++ b/doc/vendor/prettify/lang-rd.js @@ -0,0 +1,17 @@ +/* + + Copyright (C) 2012 Jeffrey Arnold + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[a-zA-Z@]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[{}()\[\]]+/]]),["Rd","rd"]); diff --git a/doc/vendor/prettify/lang-rkt.js b/doc/vendor/prettify/lang-rkt.js new file mode 100644 index 0000000..2f18c96 --- /dev/null +++ b/doc/vendor/prettify/lang-rkt.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2008 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, +null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); diff --git a/doc/vendor/prettify/lang-rust.js b/doc/vendor/prettify/lang-rust.js new file mode 100644 index 0000000..4385677 --- /dev/null +++ b/doc/vendor/prettify/lang-rust.js @@ -0,0 +1,20 @@ +/* + + Copyright (C) 2015 Chris Morgan + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([],[["pln",/^[\t\n\r \xA0]+/],["com",/^\/\/.*/],["com",/^\/\*[\s\S]*?(?:\*\/|$)/],["str",/^b"(?:[^\\]|\\(?:.|x[\da-fA-F]{2}))*?"/],["str",/^"(?:[^\\]|\\(?:.|x[\da-fA-F]{2}|u\{\[\da-fA-F]{1,6}\}))*?"/],["str",/^b?r(#*)\"[\s\S]*?\"\1/],["str",/^b'([^\\]|\\(.|x[\da-fA-F]{2}))'/],["str",/^'([^\\]|\\(.|x[\da-fA-F]{2}|u\{[\da-fA-F]{1,6}\}))'/],["tag",/^'\w+?\b/],["kwd",/^(?:match|if|else|as|break|box|continue|extern|fn|for|in|if|impl|let|loop|pub|return|super|unsafe|where|while|use|mod|trait|struct|enum|type|move|mut|ref|static|const|crate)\b/], +["kwd",/^(?:alignof|become|do|offsetof|priv|pure|sizeof|typeof|unsized|yield|abstract|virtual|final|override|macro)\b/],["typ",/^(?:[iu](8|16|32|64|size)|char|bool|f32|f64|str|Self)\b/],["typ",/^(?:Copy|Send|Sized|Sync|Drop|Fn|FnMut|FnOnce|Box|ToOwned|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator|Option|Some|None|Result|Ok|Err|SliceConcatExt|String|ToString|Vec)\b/],["lit",/^(self|true|false|null)\b/], +["lit",/^\d[0-9_]*(?:[iu](?:size|8|16|32|64))?/],["lit",/^0x[a-fA-F0-9_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^0o[0-7_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^0b[01_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^\d[0-9_]*\.(?![^\s\d.])/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)(?:[eE][+-]?[0-9_]+)?(?:f32|f64)?/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)?(?:[eE][+-]?[0-9_]+)(?:f32|f64)?/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)?(?:[eE][+-]?[0-9_]+)?(?:f32|f64)/], +["atn",/^[a-z_]\w*!/i],["pln",/^[a-z_]\w*/i],["atv",/^#!?\[[\s\S]*?\]/],["pun",/^[+\-/*=^&|!<>%[\](){}?:.,;]/],["pln",/./]]),["rust"]); diff --git a/doc/vendor/prettify/lang-s.js b/doc/vendor/prettify/lang-s.js new file mode 100644 index 0000000..6ce16e8 --- /dev/null +++ b/doc/vendor/prettify/lang-s.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2012 Jeffrey B. Arnold + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], +["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); diff --git a/doc/vendor/prettify/lang-scala.js b/doc/vendor/prettify/lang-scala.js new file mode 100644 index 0000000..3347dd6 --- /dev/null +++ b/doc/vendor/prettify/lang-scala.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2010 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:(?:""(?:""?(?!")|[^\\"]|\\.)*"{0,3})|(?:[^"\r\n\\]|\\.)*"?))/,null,'"'],["lit",/^`(?:[^\r\n\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&()*+,\-:;<=>?@\[\\\]^{|}~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\r\n\\']|\\(?:'|[^\r\n']+))'/],["lit",/^'[a-zA-Z_$][\w$]*(?!['$\w])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], +["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:(?:0(?:[0-7]+|X[0-9A-F]+))L?|(?:(?:0|[1-9][0-9]*)(?:(?:\.[0-9]+)?(?:E[+\-]?[0-9]+)?F?|L?))|\\.[0-9]+(?:E[+\-]?[0-9]+)?F?)/i],["typ",/^[$_]*[A-Z][_$A-Z0-9]*[a-z][\w$]*/],["pln",/^[$a-zA-Z_][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); diff --git a/doc/vendor/prettify/lang-scm.js b/doc/vendor/prettify/lang-scm.js new file mode 100644 index 0000000..2f18c96 --- /dev/null +++ b/doc/vendor/prettify/lang-scm.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2008 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, +null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); diff --git a/doc/vendor/prettify/lang-sql.js b/doc/vendor/prettify/lang-sql.js new file mode 100644 index 0000000..a7d292c --- /dev/null +++ b/doc/vendor/prettify/lang-sql.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2008 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],["kwd",/^(?:ADD|ALL|ALTER|AND|ANY|APPLY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONNECT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOLLOWING|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|MATCH|MATCHED|MERGE|NATURAL|NATIONAL|NOCHECK|NONCLUSTERED|NOCYCLE|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PARTITION|PERCENT|PIVOT|PLAN|PRECEDING|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|ROWS?|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|START|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNBOUNDED|UNION|UNIQUE|UNPIVOT|UPDATE|UPDATETEXT|USE|USER|USING|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WITHIN|WRITETEXT|XML)(?=[^\w-]|$)/i, +null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^[a-z_][\w-]*/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]]),["sql"]); diff --git a/doc/vendor/prettify/lang-ss.js b/doc/vendor/prettify/lang-ss.js new file mode 100644 index 0000000..2f18c96 --- /dev/null +++ b/doc/vendor/prettify/lang-ss.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2008 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, +null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); diff --git a/doc/vendor/prettify/lang-swift.js b/doc/vendor/prettify/lang-swift.js new file mode 100644 index 0000000..5442fa7 --- /dev/null +++ b/doc/vendor/prettify/lang-swift.js @@ -0,0 +1,16 @@ +/* + + Copyright (C) 2015 Google Inc. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \n\r\t\v\f\0]+/,null," \n\r\t\v\f\x00"],["str",/^"(?:[^"\\]|(?:\\.)|(?:\\\((?:[^"\\)]|\\.)*\)))*"/,null,'"']],[["lit",/^(?:(?:0x[\da-fA-F][\da-fA-F_]*\.[\da-fA-F][\da-fA-F_]*[pP]?)|(?:\d[\d_]*\.\d[\d_]*[eE]?))[+-]?\d[\d_]*/,null],["lit",/^-?(?:(?:0(?:(?:b[01][01_]*)|(?:o[0-7][0-7_]*)|(?:x[\da-fA-F][\da-fA-F_]*)))|(?:\d[\d_]*))/,null],["lit",/^(?:true|false|nil)\b/,null],["kwd",/^\b(?:__COLUMN__|__FILE__|__FUNCTION__|__LINE__|#available|#else|#elseif|#endif|#if|#line|arch|arm|arm64|associativity|as|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|dynamicType|else|enum|fallthrough|final|for|func|get|import|indirect|infix|init|inout|internal|i386|if|in|iOS|iOSApplicationExtension|is|lazy|left|let|mutating|none|nonmutating|operator|optional|OSX|OSXApplicationExtension|override|postfix|precedence|prefix|private|protocol|Protocol|public|required|rethrows|return|right|safe|self|set|static|struct|subscript|super|switch|throw|try|Type|typealias|unowned|unsafe|var|weak|watchOS|while|willSet|x86_64)\b/, +null],["com",/^\/\/.*?[\n\r]/,null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["pun",/^<<=|<=|<<|>>=|>=|>>|===|==|\.\.\.|&&=|\.\.<|!==|!=|&=|~=|~|\(|\)|\[|\]|{|}|@|#|;|\.|,|:|\|\|=|\?\?|\|\||&&|&\*|&\+|&-|&=|\+=|-=|\/=|\*=|\^=|%=|\|=|->|`|==|\+\+|--|\/|\+|!|\*|%|<|>|&|\||\^|\?|=|-|_/,null],["typ",/^\b(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null]]),["swift"]); diff --git a/doc/vendor/prettify/lang-tcl.js b/doc/vendor/prettify/lang-tcl.js new file mode 100644 index 0000000..1d75c3f --- /dev/null +++ b/doc/vendor/prettify/lang-tcl.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2012 Pyrios + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\{+/,null,"{"],["clo",/^\}+/,null,"}"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i], +["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["tcl"]); diff --git a/doc/vendor/prettify/lang-tex.js b/doc/vendor/prettify/lang-tex.js new file mode 100644 index 0000000..efc758c --- /dev/null +++ b/doc/vendor/prettify/lang-tex.js @@ -0,0 +1,17 @@ +/* + + Copyright (C) 2011 Martin S. + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]); diff --git a/doc/vendor/prettify/lang-vb.js b/doc/vendor/prettify/lang-vb.js new file mode 100644 index 0000000..e34086f --- /dev/null +++ b/doc/vendor/prettify/lang-vb.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2009 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i,null,'"\u201c\u201d'],["com",/^[\'\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\r\n_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i, +null],["com",/^REM\b[^\r\n\u2028\u2029]*/i],["lit",/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[%&@!#]+\])?|\[(?:[a-z]|_\w)\w*\])/i],["pun",/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],["pun",/^(?:\[|\])/]]),["vb", +"vbs"]); diff --git a/doc/vendor/prettify/lang-vbs.js b/doc/vendor/prettify/lang-vbs.js new file mode 100644 index 0000000..e34086f --- /dev/null +++ b/doc/vendor/prettify/lang-vbs.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2009 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i,null,'"\u201c\u201d'],["com",/^[\'\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\r\n_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i, +null],["com",/^REM\b[^\r\n\u2028\u2029]*/i],["lit",/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[%&@!#]+\])?|\[(?:[a-z]|_\w)\w*\])/i],["pun",/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],["pun",/^(?:\[|\])/]]),["vb", +"vbs"]); diff --git a/doc/vendor/prettify/lang-vhd.js b/doc/vendor/prettify/lang-vhd.js new file mode 100644 index 0000000..f67a4a3 --- /dev/null +++ b/doc/vendor/prettify/lang-vhd.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2010 benoit@ryder.fr + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[BOX]?"(?:[^\"]|"")*"|'.')/i],["com",/^--[^\r\n]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, +null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^\'(?:ACTIVE|ASCENDING|BASE|DELAYED|DRIVING|DRIVING_VALUE|EVENT|HIGH|IMAGE|INSTANCE_NAME|LAST_ACTIVE|LAST_EVENT|LAST_VALUE|LEFT|LEFTOF|LENGTH|LOW|PATH_NAME|POS|PRED|QUIET|RANGE|REVERSE_RANGE|RIGHT|RIGHTOF|SIMPLE_NAME|STABLE|SUCC|TRANSACTION|VAL|VALUE)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w\\.]+#(?:[+\-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:E[+\-]?\d+(?:_\d+)*)?)/i], +["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0\-\"\']*/]]),["vhdl","vhd"]); diff --git a/doc/vendor/prettify/lang-vhdl.js b/doc/vendor/prettify/lang-vhdl.js new file mode 100644 index 0000000..f67a4a3 --- /dev/null +++ b/doc/vendor/prettify/lang-vhdl.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2010 benoit@ryder.fr + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[BOX]?"(?:[^\"]|"")*"|'.')/i],["com",/^--[^\r\n]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, +null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^\'(?:ACTIVE|ASCENDING|BASE|DELAYED|DRIVING|DRIVING_VALUE|EVENT|HIGH|IMAGE|INSTANCE_NAME|LAST_ACTIVE|LAST_EVENT|LAST_VALUE|LEFT|LEFTOF|LENGTH|LOW|PATH_NAME|POS|PRED|QUIET|RANGE|REVERSE_RANGE|RIGHT|RIGHTOF|SIMPLE_NAME|STABLE|SUCC|TRANSACTION|VAL|VALUE)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w\\.]+#(?:[+\-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:E[+\-]?\d+(?:_\d+)*)?)/i], +["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0\-\"\']*/]]),["vhdl","vhd"]); diff --git a/doc/vendor/prettify/lang-wiki.js b/doc/vendor/prettify/lang-wiki.js new file mode 100644 index 0000000..d03fccd --- /dev/null +++ b/doc/vendor/prettify/lang-wiki.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2009 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t \xA0a-gi-z0-9]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[=*~\^\[\]]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^(?:[A-Z][a-z][a-z0-9]+[A-Z][a-z][a-zA-Z0-9]+)\b/],["lang-",/^\{\{\{([\s\S]+?)\}\}\}/],["lang-",/^`([^\r\n`]+)`/],["str",/^https?:\/\/[^\/?#\s]*(?:\/[^?#\s]*)?(?:\?[^#\s]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\s\S])[^#=*~^A-Zh\{`\[\r\n]*/]]),["wiki"]); +PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); diff --git a/doc/vendor/prettify/lang-xq.js b/doc/vendor/prettify/lang-xq.js new file mode 100644 index 0000000..a6d8537 --- /dev/null +++ b/doc/vendor/prettify/lang-xq.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2011 Patrick Wied + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[A-Za-z0-9_\-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^\@[\w-]+/],["tag",/^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["com",/^\(:[\s\S]*?:\)/],["pln",/^[\/\{\};,\[\]\(\)]$/],["str",/^(?:\"(?:[^\"\\\{]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\\{]|\\[\s\S])*(?:\'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], +["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], +["pln",/^[A-Za-z0-9_\-\:]+/],["pln",/^[\t\n\r \xA0]+/]]),["xq","xquery"]); diff --git a/doc/vendor/prettify/lang-xquery.js b/doc/vendor/prettify/lang-xquery.js new file mode 100644 index 0000000..a6d8537 --- /dev/null +++ b/doc/vendor/prettify/lang-xquery.js @@ -0,0 +1,19 @@ +/* + + Copyright (C) 2011 Patrick Wied + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[A-Za-z0-9_\-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^\@[\w-]+/],["tag",/^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["com",/^\(:[\s\S]*?:\)/],["pln",/^[\/\{\};,\[\]\(\)]$/],["str",/^(?:\"(?:[^\"\\\{]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\\{]|\\[\s\S])*(?:\'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], +["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], +["pln",/^[A-Za-z0-9_\-\:]+/],["pln",/^[\t\n\r \xA0]+/]]),["xq","xquery"]); diff --git a/doc/vendor/prettify/lang-yaml.js b/doc/vendor/prettify/lang-yaml.js new file mode 100644 index 0000000..a2b4b07 --- /dev/null +++ b/doc/vendor/prettify/lang-yaml.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2015 ribrdb @ code.google.com + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:|>?]+/,null,":|>?"],["dec",/^%(?:YAML|TAG)[^#\r\n]+/,null,"%"],["typ",/^[&]\S+/,null,"&"],["typ",/^!\S*/,null,"!"],["str",/^"(?:[^\\"]|\\.)*(?:"|$)/,null,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,null,"'"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^\s+/,null," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\r\n]|$)/],["pun",/^-/],["kwd",/^[\w-]+:[ \r\n]/],["pln", +/^\w+/]]),["yaml","yml"]); diff --git a/doc/vendor/prettify/lang-yml.js b/doc/vendor/prettify/lang-yml.js new file mode 100644 index 0000000..a2b4b07 --- /dev/null +++ b/doc/vendor/prettify/lang-yml.js @@ -0,0 +1,18 @@ +/* + + Copyright (C) 2015 ribrdb @ code.google.com + + 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. +*/ +PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:|>?]+/,null,":|>?"],["dec",/^%(?:YAML|TAG)[^#\r\n]+/,null,"%"],["typ",/^[&]\S+/,null,"&"],["typ",/^!\S*/,null,"!"],["str",/^"(?:[^\\"]|\\.)*(?:"|$)/,null,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,null,"'"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^\s+/,null," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\r\n]|$)/],["pun",/^-/],["kwd",/^[\w-]+:[ \r\n]/],["pln", +/^\w+/]]),["yaml","yml"]); diff --git a/doc/vendor/prettify/prettify.css b/doc/vendor/prettify/prettify.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/doc/vendor/prettify/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/doc/vendor/prettify/prettify.js b/doc/vendor/prettify/prettify.js new file mode 100644 index 0000000..0a2b435 --- /dev/null +++ b/doc/vendor/prettify/prettify.js @@ -0,0 +1,46 @@ +!function(){/* + + Copyright (C) 2006 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function T(a){function d(e){var b=e.charCodeAt(0);if(92!==b)return b;var a=e.charAt(1);return(b=w[a])?b:"0"<=a&&"7">=a?parseInt(e.substring(1),8):"u"===a||"x"===a?parseInt(e.substring(2),16):e.charCodeAt(1)}function f(e){if(32>e)return(16>e?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return"\\"===e||"-"===e||"]"===e||"^"===e?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[0-9A-Fa-f]{4}|\\x[0-9A-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\s\S]|-|[^-\\]/g);e= +[];var a="^"===b[0],c=["["];a&&c.push("^");for(var a=a?1:0,g=b.length;ak||122k||90k||122h[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(f(h[1])));c.push("]");return c.join("")}function v(e){for(var a=e.source.match(/(?:\[(?:[^\x5C\x5D]|\\[\s\S])*\]|\\u[A-Fa-f0-9]{4}|\\x[A-Fa-f0-9]{2}|\\[0-9]+|\\[^ux0-9]|\(\?[:!=]|[\(\)\^]|[^\x5B\x5C\(\)\^]+)/g),c=a.length,d=[],g=0,h=0;g/,null])):d.push(["com",/^#[^\r\n]*/,null,"#"]));a.cStyleComments&&(f.push(["com",/^\/\/[^\r\n]*/,null]),f.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));if(b=a.regexLiterals){var v=(b=1|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+ +("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+v+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+v+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&f.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&f.push(["kwd",new RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),null]);d.push(["pln",/^\s+/,null," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");f.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i, +null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(b),null]);return G(d,f)}function L(a,d,f){function b(a){var c=a.nodeType;if(1==c&&!A.test(a.className))if("br"===a.nodeName)v(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((3==c||4==c)&&f){var d=a.nodeValue,q=d.match(n);q&&(c=d.substring(0,q.index),a.nodeValue=c,(d=d.substring(q.index+q[0].length))&& +a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),v(a),c||a.parentNode.removeChild(a))}}function v(a){function b(a,c){var d=c?a.cloneNode(!1):a,k=a.parentNode;if(k){var k=b(k,1),e=a.nextSibling;k.appendChild(d);for(var f=e;f;f=e)e=f.nextSibling,k.appendChild(f)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;a=b(a.nextSibling,0);for(var d;(d=a.parentNode)&&1===d.nodeType;)a=d;c.push(a)}for(var A=/(?:^|\s)nocode(?:\s|$)/,n=/\r\n?|\n/,l=a.ownerDocument,m=l.createElement("li");a.firstChild;)m.appendChild(a.firstChild); +for(var c=[m],p=0;p=+v[1],d=/\n/g,A=a.a,n=A.length,f=0,l=a.c,m=l.length,b=0,c=a.g,p=c.length,w=0;c[p]=n;var r,e;for(e=r=0;e=h&&(b+=2);f>=k&&(w+=2)}}finally{g&&(g.style.display=a)}}catch(x){E.console&&console.log(x&&x.stack||x)}}var E=window,C=["break,continue,do,else,for,if,return,while"], +F=[[C,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],H=[F,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"], +O=[F,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],P=[F,"abstract,as,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],F=[F,"debugger,eval,export,function,get,instanceof,null,set,undefined,var,with,Infinity,NaN"], +Q=[C,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],R=[C,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],C=[C,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, +W=/\S/,X=y({keywords:[H,P,O,F,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",Q,R,C],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),I={};t(X,["default-code"]);t(G([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", +/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),"default-markup htm html mxml xhtml xml xsl".split(" "));t(G([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/], +["pun",/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);t(G([],[["atv",/^[\s\S]+/]]),["uq.val"]);t(y({keywords:H,hashComments:!0,cStyleComments:!0,types:S}),"c cc cpp cxx cyc m".split(" "));t(y({keywords:"null,true,false"}),["json"]);t(y({keywords:P,hashComments:!0,cStyleComments:!0, +verbatimStrings:!0,types:S}),["cs"]);t(y({keywords:O,cStyleComments:!0}),["java"]);t(y({keywords:C,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);t(y({keywords:Q,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);t(y({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}), +["perl","pl","pm"]);t(y({keywords:R,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);t(y({keywords:F,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);t(y({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);t(G([],[["str",/^[\s\S]+/]]),["regex"]); +var Y=E.PR={createSimpleLexer:G,registerLangHandler:t,sourceDecorator:y,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:E.prettyPrintOne=function(a,d,f){f=f||!1;d=d||null;var b=document.createElement("div");b.innerHTML="
      "+a+"
      ";b=b.firstChild;f&&L(b,f,!0);M({j:d,m:f,h:b,l:1,a:null,i:null,c:null, +g:null});return b.innerHTML},prettyPrint:E.prettyPrint=function(a,d){function f(){for(var b=E.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p=a?parseInt(e.substring(1),8):"u"===a||"x"===a?parseInt(e.substring(2),16):e.charCodeAt(1)}function f(e){if(32>e)return(16>e?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return"\\"===e||"-"=== +e||"]"===e||"^"===e?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[0-9A-Fa-f]{4}|\\x[0-9A-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\s\S]|-|[^-\\]/g);e=[];var a="^"===b[0],c=["["];a&&c.push("^");for(var a=a?1:0,h=b.length;an||122n||90n||122l[0]&&(l[1]+1>l[0]&&c.push("-"),c.push(f(l[1])));c.push("]");return c.join("")}function g(e){for(var a=e.source.match(/(?:\[(?:[^\x5C\x5D]|\\[\s\S])*\]|\\u[A-Fa-f0-9]{4}|\\x[A-Fa-f0-9]{2}|\\[0-9]+|\\[^ux0-9]|\(\?[:!=]|[\(\)\^]|[^\x5B\x5C\(\)\^]+)/g),c=a.length,d=[],h=0,l=0;h/,null])):d.push(["com",/^#[^\r\n]*/,null,"#"]));a.cStyleComments&&(f.push(["com",/^\/\/[^\r\n]*/,null]),f.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));if(b=a.regexLiterals){var g=(b=1|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+ +("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+g+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+g+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&f.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&f.push(["kwd",new RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),null]);d.push(["pln",/^\s+/,null," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");f.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i, +null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(b),null]);return C(d,f)}function B(a,d,f){function b(a){var c=a.nodeType;if(1==c&&!k.test(a.className))if("br"===a.nodeName)g(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((3==c||4==c)&&f){var d=a.nodeValue,p=d.match(q);p&&(c=d.substring(0,p.index),a.nodeValue=c,(d=d.substring(p.index+p[0].length))&& +a.parentNode.insertBefore(m.createTextNode(d),a.nextSibling),g(a),c||a.parentNode.removeChild(a))}}function g(a){function b(a,c){var d=c?a.cloneNode(!1):a,n=a.parentNode;if(n){var n=b(n,1),e=a.nextSibling;n.appendChild(d);for(var f=e;f;f=e)e=f.nextSibling,n.appendChild(f)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;a=b(a.nextSibling,0);for(var d;(d=a.parentNode)&&1===d.nodeType;)a=d;c.push(a)}for(var k=/(?:^|\s)nocode(?:\s|$)/,q=/\r\n?|\n/,m=a.ownerDocument,p=m.createElement("li");a.firstChild;)p.appendChild(a.firstChild); +for(var c=[p],r=0;r=+g[1],d=/\n/g,p=a.a,k=p.length,f=0,m=a.c,t=m.length,b=0,c=a.g,r=c.length,x=0;c[r]=k;var u,e;for(e=u=0;e=l&&(b+=2);f>=n&&(x+=2)}}finally{h&&(h.style.display=a)}}catch(y){R.console&&console.log(y&&y.stack||y)}}var R=window,K=["break,continue,do,else,for,if,return,while"], +L=[[K,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],S=[L,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"], +M=[L,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],N=[L,"abstract,as,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],L=[L,"debugger,eval,export,function,get,instanceof,null,set,undefined,var,with,Infinity,NaN"], +O=[K,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],P=[K,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],K=[K,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Q=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, +T=/\S/,U=x({keywords:[S,N,M,L,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",O,P,K],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),X={};p(U,["default-code"]);p(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", +/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),"default-markup htm html mxml xhtml xml xsl".split(" "));p(C([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/], +["pun",/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\s\S]+/]]),["uq.val"]);p(x({keywords:S,hashComments:!0,cStyleComments:!0,types:Q}),"c cc cpp cxx cyc m".split(" "));p(x({keywords:"null,true,false"}),["json"]);p(x({keywords:N,hashComments:!0,cStyleComments:!0, +verbatimStrings:!0,types:Q}),["cs"]);p(x({keywords:M,cStyleComments:!0}),["java"]);p(x({keywords:K,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(x({keywords:O,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(x({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}), +["perl","pl","pm"]);p(x({keywords:P,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(x({keywords:L,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(x({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(C([],[["str",/^[\s\S]+/]]),["regex"]); +var V=R.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:x,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,f){f=f||!1;d=d||null;var b=document.createElement("div");b.innerHTML="
      "+a+"
      ";b=b.firstChild;f&&B(b,f,!0);H({j:d,m:f,h:b,l:1,a:null,i:null,c:null,g:null});return b.innerHTML}, +prettyPrint:g=g=function(a,d){function f(){for(var b=R.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;rthis.depCount&&!this.defined){if(L(l)){try{f=h.execCb(c,l,b,f)}catch(d){a=d}this.map.isDefine&&void 0===f&&((b=this.module)?f=b.exports: +this.usingExports&&(f=this.exports));if(a){if(this.events.error&&this.map.isDefine||k.onError!==ia)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",B(this.error=a);if("undefined"!==typeof console&&console.error)console.error(a);else k.onError(a)}}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(r[c]=f,k.onResourceLoad)){var e=[];x(this.depMaps,function(a){e.push(a.normalizedMap||a)});k.onResourceLoad(h, +this.map,e)}D(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var a=this.map,b=a.id,d=q(a.prefix);this.depMaps.push(d);v(d,"defined",y(this,function(f){var l,d,e=g(ga,this.map.id),N=this.map.name,p=this.map.parentMap?this.map.parentMap.name:null,r=h.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(N=f.normalize(N,function(a){return c(a, +p,!0)})||""),d=q(a.prefix+"!"+N,this.map.parentMap),v(d,"defined",y(this,function(a){this.map.normalizedMap=d;this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),f=g(t,d.id)){this.depMaps.push(d);if(this.events.error)f.on("error",y(this,function(a){this.emit("error",a)}));f.enable()}}else e?(this.map.url=h.nameToUrl(e),this.load()):(l=y(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=y(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b]; +E(t,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&D(a.map.id)});B(a)}),l.fromText=y(this,function(f,c){var d=a.name,e=q(d),N=T;c&&(f=c);N&&(T=!1);u(e);w(m.config,b)&&(m.config[d]=m.config[b]);try{k.exec(f)}catch(g){return B(G("fromtexteval","fromText eval for "+b+" failed: "+g,g,[b]))}N&&(T=!0);this.depMaps.push(e);h.completeLoad(d);r([d],l)}),f.load(a.name,r,l,m))}));h.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){aa[this.map.id]=this;this.enabling=this.enabled=!0;x(this.depMaps, +y(this,function(a,b){var c,f;if("string"===typeof a){a=q(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=g(S,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;v(a,"defined",y(this,function(a){this.undefed||(this.defineDep(b,a),this.check())}));this.errback?v(a,"error",y(this,this.errback)):this.events.error&&v(a,"error",y(this,function(a){this.emit("error",a)}))}c=a.id;f=t[c];w(S,c)||!f||f.enabled||h.enable(a,this)}));E(this.pluginMaps,y(this,function(a){var b= +g(t,a.id);b&&!b.enabled&&h.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){x(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};h={config:m,contextName:b,registry:t,defined:r,urlFetched:X,defQueue:H,defQueueMap:{},Module:ea,makeModuleMap:q,nextTick:k.nextTick,onError:B,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=m.shim,c={paths:!0, +bundles:!0,config:!0,map:!0};E(a,function(a,b){c[b]?(m[b]||(m[b]={}),Z(m[b],a,!0,!0)):m[b]=a});a.bundles&&E(a.bundles,function(a,b){x(a,function(a){a!==b&&(ga[a]=b)})});a.shim&&(E(a.shim,function(a,c){M(a)&&(a={deps:a});!a.exports&&!a.init||a.exportsFn||(a.exportsFn=h.makeShimExports(a));b[c]=a}),m.shim=b);a.packages&&x(a.packages,function(a){var b;a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(m.paths[b]=a.location);m.pkgs[b]=a.name+"/"+(a.main||"main").replace(na,"").replace(V,"")});E(t, +function(a,b){a.inited||a.map.unnormalized||(a.map=q(b,null,!0))});(a.deps||a.callback)&&h.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ha,arguments));return b||a.exports&&ja(a.exports)}},makeRequire:function(a,n){function e(c,d,g){var m,p;n.enableBuildCallback&&d&&L(d)&&(d.__requireJsBuild=!0);if("string"===typeof c){if(L(d))return B(G("requireargs","Invalid require call"),g);if(a&&w(S,c))return S[c](t[a.id]);if(k.get)return k.get(h, +c,a,e);m=q(c,a,!1,!0);m=m.id;return w(r,m)?r[m]:B(G("notloaded",'Module name "'+m+'" has not been loaded yet for context: '+b+(a?"":". Use require([])")))}Q();h.nextTick(function(){Q();p=u(q(null,a));p.skipMap=n.skipMap;p.init(c,d,g,{enabled:!0});I()});return e}n=n||{};Z(e,{isBrowser:F,toUrl:function(b){var d,e=b.lastIndexOf("."),n=b.split("/")[0];-1!==e&&("."!==n&&".."!==n||1e.attachEvent.toString().indexOf("[native code")||da?(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)):(T=!0,e.attachEvent("onreadystatechange",b.onScriptLoad));e.src=d;Q=e;I?D.insertBefore(e,I):D.appendChild(e);Q=null;return e}if(ka)try{importScripts(d),b.completeLoad(c)}catch(q){b.onError(G("importscripts","importScripts failed for "+ +c+" at "+d,q,[c]))}};F&&!v.skipDataMain&&Y(document.getElementsByTagName("script"),function(b){D||(D=b.parentNode);if(P=b.getAttribute("data-main"))return u=P,v.baseUrl||(J=u.split("/"),u=J.pop(),U=J.length?J.join("/")+"/":"./",v.baseUrl=U),u=u.replace(V,""),k.jsExtRegExp.test(u)&&(u=P),v.deps=v.deps?v.deps.concat(u):[u],!0});define=function(b,c,d){var g,e;"string"!==typeof b&&(d=c,c=b,b=null);M(c)||(d=c,c=null);!c&&L(d)&&(c=[],d.length&&(d.toString().replace(qa,"").replace(ra,function(b,d){c.push(d)}), +c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));T&&(g=Q||pa())&&(b||(b=g.getAttribute("data-requiremodule")),e=K[g.getAttribute("data-requirecontext")]);e?(e.defQueue.push([b,c,d]),e.defQueueMap[b]=!0):W.push([b,c,d])};define.amd={jQuery:!0};k.exec=function(b){return eval(b)};k(v)}})(this); diff --git a/doc/vendor/semver.min.js b/doc/vendor/semver.min.js new file mode 100644 index 0000000..c2b3ff4 --- /dev/null +++ b/doc/vendor/semver.min.js @@ -0,0 +1 @@ +(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=K;e.SEMVER_SPEC_VERSION="2.0.0";var r=256;var t=Number.MAX_SAFE_INTEGER||9007199254740991;var n=e.re=[];var i=e.src=[];var s=0;var o=s++;i[o]="0|[1-9]\\d*";var a=s++;i[a]="[0-9]+";var f=s++;i[f]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[o]+")\\."+"("+i[o]+")\\."+"("+i[o]+")";var l=s++;i[l]="("+i[a]+")\\."+"("+i[a]+")\\."+"("+i[a]+")";var p=s++;i[p]="(?:"+i[o]+"|"+i[f]+")";var h=s++;i[h]="(?:"+i[a]+"|"+i[f]+")";var c=s++;i[c]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var v=s++;i[v]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var m=s++;i[m]="[0-9A-Za-z-]+";var g=s++;i[g]="(?:\\+("+i[m]+"(?:\\."+i[m]+")*))";var w=s++;var y="v?"+i[u]+i[c]+"?"+i[g]+"?";i[w]="^"+y+"$";var d="[v=\\s]*"+i[l]+i[v]+"?"+i[g]+"?";var j=s++;i[j]="^"+d+"$";var b=s++;i[b]="((?:<|>)?=?)";var E=s++;i[E]=i[a]+"|x|X|\\*";var $=s++;i[$]=i[o]+"|x|X|\\*";var k=s++;i[k]="[v=\\s]*("+i[$]+")"+"(?:\\.("+i[$]+")"+"(?:\\.("+i[$]+")"+"(?:"+i[c]+")?"+i[g]+"?"+")?)?";var R=s++;i[R]="[v=\\s]*("+i[E]+")"+"(?:\\.("+i[E]+")"+"(?:\\.("+i[E]+")"+"(?:"+i[v]+")?"+i[g]+"?"+")?)?";var S=s++;i[S]="^"+i[b]+"\\s*"+i[k]+"$";var x=s++;i[x]="^"+i[b]+"\\s*"+i[R]+"$";var I=s++;i[I]="(?:~>?)";var T=s++;i[T]="(\\s*)"+i[I]+"\\s+";n[T]=new RegExp(i[T],"g");var V="$1~";var A=s++;i[A]="^"+i[I]+i[k]+"$";var C=s++;i[C]="^"+i[I]+i[R]+"$";var M=s++;i[M]="(?:\\^)";var N=s++;i[N]="(\\s*)"+i[M]+"\\s+";n[N]=new RegExp(i[N],"g");var _="$1^";var z=s++;i[z]="^"+i[M]+i[k]+"$";var P=s++;i[P]="^"+i[M]+i[R]+"$";var X=s++;i[X]="^"+i[b]+"\\s*("+d+")$|^$";var Z=s++;i[Z]="^"+i[b]+"\\s*("+y+")$|^$";var q=s++;i[q]="(\\s*)"+i[b]+"\\s*("+d+"|"+i[k]+")";n[q]=new RegExp(i[q],"g");var L="$1$2$3";var F=s++;i[F]="^\\s*("+i[k]+")"+"\\s+-\\s+"+"("+i[k]+")"+"\\s*$";var G=s++;i[G]="^\\s*("+i[R]+")"+"\\s+-\\s+"+"("+i[R]+")"+"\\s*$";var O=s++;i[O]="(<|>)?=?\\s*\\*";for(var B=0;Br)return null;var i=t?n[j]:n[w];if(!i.test(e))return null;try{return new K(e,t)}catch(s){return null}}e.valid=H;function H(e,r){var t=D(e,r);return t?t.version:null}e.clean=J;function J(e,r){var t=D(e.trim().replace(/^[=v]+/,""),r);return t?t.version:null}e.SemVer=K;function K(e,i){if(e instanceof K){if(e.loose===i)return e;else e=e.version}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(e.length>r)throw new TypeError("version is longer than "+r+" characters");if(!(this instanceof K))return new K(e,i);this.loose=i;var s=e.trim().match(i?n[j]:n[w]);if(!s)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+s[1];this.minor=+s[2];this.patch=+s[3];if(this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");if(!s[4])this.prerelease=[];else this.prerelease=s[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var r=+e;if(r>=0&&r'};K.prototype.toString=function(){return this.version};K.prototype.compare=function(e){if(!(e instanceof K))e=new K(e,this.loose);return this.compareMain(e)||this.comparePre(e)};K.prototype.compareMain=function(e){if(!(e instanceof K))e=new K(e,this.loose);return Y(this.major,e.major)||Y(this.minor,e.minor)||Y(this.patch,e.patch)};K.prototype.comparePre=function(e){if(!(e instanceof K))e=new K(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Y(t,n)}while(++r)};K.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",r);this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var t=this.prerelease.length;while(--t>=0){if(typeof this.prerelease[t]==="number"){this.prerelease[t]++;t=-2}}if(t===-1)this.prerelease.push(0)}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1]))this.prerelease=[r,0]}else this.prerelease=[r,0]}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=Q;function Q(e,r,t,n){if(typeof t==="string"){n=t;t=undefined}try{return new K(e,t).inc(r,n).version}catch(i){return null}}e.diff=U;function U(e,r){if(pr(e,r)){return null}else{var t=D(e);var n=D(r);if(t.prerelease.length||n.prerelease.length){for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return"pre"+i}}}return"prerelease"}for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return i}}}}}e.compareIdentifiers=Y;var W=/^[0-9]+$/;function Y(e,r){var t=W.test(e);var n=W.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=er;function er(e,r){return Y(r,e)}e.major=rr;function rr(e,r){return new K(e,r).major}e.minor=tr;function tr(e,r){return new K(e,r).minor}e.patch=nr;function nr(e,r){return new K(e,r).patch}e.compare=ir;function ir(e,r,t){return new K(e,t).compare(r)}e.compareLoose=sr;function sr(e,r){return ir(e,r,true)}e.rcompare=or;function or(e,r,t){return ir(r,e,t)}e.sort=ar;function ar(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=fr;function fr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=ur;function ur(e,r,t){return ir(e,r,t)>0}e.lt=lr;function lr(e,r,t){return ir(e,r,t)<0}e.eq=pr;function pr(e,r,t){return ir(e,r,t)===0}e.neq=hr;function hr(e,r,t){return ir(e,r,t)!==0}e.gte=cr;function cr(e,r,t){return ir(e,r,t)>=0}e.lte=vr;function vr(e,r,t){return ir(e,r,t)<=0}e.cmp=mr;function mr(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=pr(e,t,n);break;case"!=":i=hr(e,t,n);break;case">":i=ur(e,t,n);break;case">=":i=cr(e,t,n);break;case"<":i=lr(e,t,n);break;case"<=":i=vr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=gr;function gr(e,r){if(e instanceof gr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof gr))return new gr(e,r);this.loose=r;this.parse(e);if(this.semver===wr)this.value="";else this.value=this.operator+this.semver.version}var wr={};gr.prototype.parse=function(e){var r=this.loose?n[X]:n[Z];var t=e.match(r);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=t[1];if(this.operator==="=")this.operator="";if(!t[2])this.semver=wr;else this.semver=new K(t[2],this.loose)};gr.prototype.inspect=function(){return''};gr.prototype.toString=function(){return this.value};gr.prototype.test=function(e){if(this.semver===wr)return true;if(typeof e==="string")e=new K(e,this.loose);return mr(e,this.operator,this.semver,this.loose)};e.Range=yr;function yr(e,r){if(e instanceof yr&&e.loose===r)return e;if(!(this instanceof yr))return new yr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}yr.prototype.inspect=function(){return''};yr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};yr.prototype.toString=function(){return this.range};yr.prototype.parseRange=function(e){var r=this.loose;e=e.trim();var t=r?n[G]:n[F];e=e.replace(t,Tr);e=e.replace(n[q],L);e=e.replace(n[T],V);e=e.replace(n[N],_);e=e.split(/\s+/).join(" ");var i=r?n[X]:n[Z];var s=e.split(" ").map(function(e){return jr(e,r)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new gr(e,r)});return s};e.toComparators=dr;function dr(e,r){return new yr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function jr(e,r){e=kr(e,r);e=Er(e,r);e=Sr(e,r);e=Ir(e,r);return e}function br(e){return!e||e.toLowerCase()==="x"||e==="*"}function Er(e,r){return e.trim().split(/\s+/).map(function(e){return $r(e,r)}).join(" ")}function $r(e,r){var t=r?n[C]:n[A];return e.replace(t,function(e,r,t,n,i){var s;if(br(r))s="";else if(br(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(br(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function kr(e,r){return e.trim().split(/\s+/).map(function(e){return Rr(e,r)}).join(" ")}function Rr(e,r){var t=r?n[P]:n[z];return e.replace(t,function(e,r,t,n,i){var s;if(br(r))s="";else if(br(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(br(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function Sr(e,r){return e.split(/\s+/).map(function(e){return xr(e,r)}).join(" ")}function xr(e,r){e=e.trim();var t=r?n[x]:n[S];return e.replace(t,function(e,r,t,n,i,s){var o=br(t);var a=o||br(n);var f=a||br(i);var u=f;if(r==="="&&u)r="";if(o){if(r===">"||r==="<"){e="<0.0.0"}else{e="*"}}else if(r&&u){if(a)n=0;if(f)i=0;if(r===">"){r=">=";if(a){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}else if(r==="<="){r="<";if(a)t=+t+1;else n=+n+1}e=r+t+"."+n+"."+i}else if(a){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function Ir(e,r){return e.trim().replace(n[O],"")}function Tr(e,r,t,n,i,s,o,a,f,u,l,p,h){if(br(t))r="";else if(br(n))r=">="+t+".0.0";else if(br(i))r=">="+t+"."+n+".0";else r=">="+r;if(br(f))a="";else if(br(u))a="<"+(+f+1)+".0.0";else if(br(l))a="<"+f+"."+(+u+1)+".0";else if(p)a="<="+f+"."+u+"."+l+"-"+p;else a="<="+a;return(r+" "+a).trim()}yr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new K(e,this.loose);for(var r=0;r0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=Ar;function Ar(e,r,t){try{r=new yr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Cr;function Cr(e,r,t){return e.filter(function(e){return Ar(e,r,t)}).sort(function(e,r){return or(e,r,t)})[0]||null}e.validRange=Mr;function Mr(e,r){try{return new yr(e,r).range||"*"}catch(t){return null}}e.ltr=Nr;function Nr(e,r,t){return zr(e,r,"<",t)}e.gtr=_r;function _r(e,r,t){return zr(e,r,">",t)}e.outside=zr;function zr(e,r,t,n){e=new K(e,n);r=new yr(r,n);var i,s,o,a,f;switch(t){case">":i=ur;s=vr;o=lr;a=">";f=">=";break;case"<":i=lr;s=cr;o=ur;a="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ar(e,r,n)){return false}for(var u=0;u=b.f?e():a.fonts.load(fa(b.a),b.h).then(function(a){1<=a.length?c():setTimeout(k,25)},function(){e()})}k()}),e=new Promise(function(a,c){setTimeout(c,b.f)});Promise.race([e,c]).then(function(){b.g(b.a)},function(){b.j(b.a)})};function R(a,b,d,c,e,f,g){this.v=a;this.B=b;this.c=d;this.a=c;this.s=g||"BESbswy";this.f={};this.w=e||3E3;this.u=f||null;this.o=this.j=this.h=this.g=null;this.g=new N(this.c,this.s);this.h=new N(this.c,this.s);this.j=new N(this.c,this.s);this.o=new N(this.c,this.s);a=new H(this.a.c+",serif",K(this.a));a=P(a);this.g.a.style.cssText=a;a=new H(this.a.c+",sans-serif",K(this.a));a=P(a);this.h.a.style.cssText=a;a=new H("serif",K(this.a));a=P(a);this.j.a.style.cssText=a;a=new H("sans-serif",K(this.a));a= +P(a);this.o.a.style.cssText=a;O(this.g);O(this.h);O(this.j);O(this.o)}var S={D:"serif",C:"sans-serif"},T=null;function U(){if(null===T){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);T=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10))}return T}R.prototype.start=function(){this.f.serif=this.j.a.offsetWidth;this.f["sans-serif"]=this.o.a.offsetWidth;this.A=q();la(this)}; +function ma(a,b,d){for(var c in S)if(S.hasOwnProperty(c)&&b===a.f[S[c]]&&d===a.f[S[c]])return!0;return!1}function la(a){var b=a.g.a.offsetWidth,d=a.h.a.offsetWidth,c;(c=b===a.f.serif&&d===a.f["sans-serif"])||(c=U()&&ma(a,b,d));c?q()-a.A>=a.w?U()&&ma(a,b,d)&&(null===a.u||a.u.hasOwnProperty(a.a.c))?V(a,a.v):V(a,a.B):na(a):V(a,a.v)}function na(a){setTimeout(p(function(){la(this)},a),50)}function V(a,b){setTimeout(p(function(){v(this.g.a);v(this.h.a);v(this.j.a);v(this.o.a);b(this.a)},a),0)};function W(a,b,d){this.c=a;this.a=b;this.f=0;this.o=this.j=!1;this.s=d}var X=null;W.prototype.g=function(a){var b=this.a;b.g&&w(b.f,[b.a.c("wf",a.c,K(a).toString(),"active")],[b.a.c("wf",a.c,K(a).toString(),"loading"),b.a.c("wf",a.c,K(a).toString(),"inactive")]);L(b,"fontactive",a);this.o=!0;oa(this)}; +W.prototype.h=function(a){var b=this.a;if(b.g){var d=y(b.f,b.a.c("wf",a.c,K(a).toString(),"active")),c=[],e=[b.a.c("wf",a.c,K(a).toString(),"loading")];d||c.push(b.a.c("wf",a.c,K(a).toString(),"inactive"));w(b.f,c,e)}L(b,"fontinactive",a);oa(this)};function oa(a){0==--a.f&&a.j&&(a.o?(a=a.a,a.g&&w(a.f,[a.a.c("wf","active")],[a.a.c("wf","loading"),a.a.c("wf","inactive")]),L(a,"active")):M(a.a))};function pa(a){this.j=a;this.a=new ja;this.h=0;this.f=this.g=!0}pa.prototype.load=function(a){this.c=new ca(this.j,a.context||this.j);this.g=!1!==a.events;this.f=!1!==a.classes;qa(this,new ha(this.c,a),a)}; +function ra(a,b,d,c,e){var f=0==--a.h;(a.f||a.g)&&setTimeout(function(){var a=e||null,k=c||null||{};if(0===d.length&&f)M(b.a);else{b.f+=d.length;f&&(b.j=f);var h,m=[];for(h=0;h { + return ` + 👏 VR 产品介绍网站 👏 + + 👉 1:PC官网: http://${dev.host}:${dev.port}/ + 👉 2:Admin后台: http://${dev.host}:3030/#/course/all + ` + } + }, + logConfig: { + appenders: { + //系统日志 + access: { + type: 'dateFile', + pattern: '_yyyy-MM-dd.log', + alwaysIncludePattern: true, + encoding:"utf-8", + category: "access", + filename: path.join(__dirname, '../../logs/access') + }, + // 应用日志 + application: { + type: 'dateFile', + pattern: '_yyyy-MM-dd.log', + alwaysIncludePattern: true, + encoding:"utf-8", + category: "application", + filename: path.join(__dirname, '../../logs/application') + }, + out: { + type: 'console' + } + }, + categories: { + default: { appenders: [ 'out' ], level: 'info' }, + access: { appenders: [ 'access' ], level: 'info' }, + application: { appenders: [ 'application' ], level: 'WARN'} + } + }, + // 七牛的核心配置,不熟悉七牛请勿修改 + qiniu: { + // 七牛秘钥,七牛云管理后台获得,可以改成自己的 + accessKey: '0MGmT_rkMiaOeXY09B4EhBnXuDcIYyKlGumQ-zUt', + secretKey: '59dfmEi9Q50rMlz9sxTBCvYDhM7biERAjflBXALb', + // 视频切片的配置 + HLSconfig: { + // 被切片后视频存放的基路径,如果需要修改域名,请到域名管理后台 CNAME 泛解析域到七牛云 + // 然后再到七牛配置 泛子域名 将二级域名绑定到指定空间,这里 video.* 被绑定到 m3u8video 空间 + VideoBaseUrl: 'http://vsassets.geekhelp.cn/', + // 需要被切片的源视频所在七牛云的空间名 + FromBucket: 'vrcource', + // 视频被切片后存放的空间名 + ToBucket: 'm3u8video', + // 视频切片规则,参考七牛云官网文档来配置,或者在 多媒体队列 中复制切片参数 + VideoHlsParams: 'avthumb/m3u8/segtime/10/ab/128k/ar/44100/acodec/libfaac/r/30/vb/1000k/vcodec/libx264/stripmeta/0/noDomain/1|saveas/' + } + }, + // 网站浏览器标签卡的基础标题 + title: ' | 怪客课堂', + // 本地Mysql数据库配置 + typeorm: { + type: 'mysql', + host: "localhost", + charset: "utf8_general_ci", + port: 3306, + username: "root", + password: "lb714500", + database: "shop", + logging: "all", + synchronize: false, + logger: "advanced-console", + cache: { + duration: 30000 + }, + maxQueryExecutionTime: 1000, + entities: [ + `${path.join(__dirname,'../entity/*{.js,.ts}')}` + ] + } +}; \ No newline at end of file diff --git a/src/config/index.ts b/src/config/index.ts new file mode 100755 index 0000000..56660c5 --- /dev/null +++ b/src/config/index.ts @@ -0,0 +1,6 @@ +// 开发环境配置 +import { dev } from "./dev"; +// 上线环境配置 +import { prod } from "./prod"; + +export const config = process.env.NODE_ENV == "dev" ? dev : prod; \ No newline at end of file diff --git a/src/config/prod.ts b/src/config/prod.ts new file mode 100755 index 0000000..38ac579 --- /dev/null +++ b/src/config/prod.ts @@ -0,0 +1,83 @@ +import path from "path"; + +/** + * 上线阶段的环境配置 + */ +export const prod = { + port: 9090, + host: "127.0.0.1", + apiurl: '/bmy/api', + uploadPath: '../resources/static/upload/', + initPlugins: { + SessionKey: '4WM7mSy5S5kkxcE1I3', + staticPath: '../resources/static', + viewsPath: '../resources/view' + }, + banner: { + welcome: () => { + return ` + 👏 VR 产品介绍网站 👏 + + 👉 1:PC官网: http://${prod.host}:${prod.port}/ + 👉 2:Admin后台: http://${prod.host}:3030/#/course/all + ` + } + }, + logConfig: { + appenders: { + access: { + type: 'console', + pattern: '-yyyy-MM-dd.log', //通过日期来生成文件 + alwaysIncludePattern: true, //文件名始终以日期区分 + encoding:"utf-8", + filename: path.join(__dirname, '../../logs/access.log') //生成文件路径和文件名 + }, + //系统日志 + application: { + type: 'console', + pattern: '-yyyy-MM-dd.log', //通过日期来生成文件 + alwaysIncludePattern: true, //文件名始终以日期区分 + encoding:"utf-8", + filename: path.join(__dirname, '../../logs/application.log') //生成文件路径和文件名 + }, + out: { + type: 'console' + } + }, + categories: { + default: { appenders: [ 'out' ], level: 'info' }, + access: { appenders: [ 'access' ], level: 'info' }, + application: { appenders: [ 'application' ], level: 'WARN'} + } + }, + qiniu: { + accessKey: '0MGmT_rkMiaOeXY09B4EhBnXuDcIYyKlGumQ-zUt', + secretKey: '59dfmEi9Q50rMlz9sxTBCvYDhM7biERAjflBXALb', + HLSconfig: { + VideoBaseUrl: 'http://video.geekhelp.cn/', + FromBucket: 'guaikevideo', + ToBucket: 'm3u8video', + VideoHlsParams: 'avthumb/m3u8/segtime/10/ab/128k/ar/44100/acodec/libfaac/r/30/vb/640k/vcodec/libx264/stripmeta/0/noDomain/1|saveas/' + } + }, + title: ' | 怪客课堂', + typeorm: { + type: 'mysql', + host: "localhost", + charset: "utf8_general_ci", + port: 3306, + username: "root", + password: "lb714500", + database: "shop", + logging: "error", + logger: "file", + synchronize: false, + maxQueryExecutionTime: 1000, + cache: { + duration: 30000 + }, + entities: [ + `${path.join(__dirname,'../entity/*{.js,.ts}')}` + ] + } +}; \ No newline at end of file diff --git a/src/controller/.pydio b/src/controller/.pydio new file mode 100644 index 0000000..31471ec --- /dev/null +++ b/src/controller/.pydio @@ -0,0 +1 @@ +d60c718f-5034-46cb-a972-c29ef3cf43aa \ No newline at end of file diff --git a/src/controller/admin/.pydio b/src/controller/admin/.pydio new file mode 100644 index 0000000..6c29f4a --- /dev/null +++ b/src/controller/admin/.pydio @@ -0,0 +1 @@ +c75c8364-c013-4a3d-808e-9224efbf6b29 \ No newline at end of file diff --git a/src/controller/admin/AdminController.ts b/src/controller/admin/AdminController.ts new file mode 100644 index 0000000..8cb459b --- /dev/null +++ b/src/controller/admin/AdminController.ts @@ -0,0 +1,28 @@ +import { JsonController, Body, Post, UploadedFile,UseInterceptor, Req, Res, Get } from "routing-controllers"; +import { JsonResponseInterceptor } from "../../middleware/JsonResponseMiddlewares"; +import { Service, Inject } from "typedi"; +import { config } from "../../config"; +import { utils } from "../../utils/utils"; +import { QiNiu } from "../../plugins/qiniu" + +@Service() +@JsonController(`${config.apiurl}/admin`) +@UseInterceptor(JsonResponseInterceptor) +export class AdminController { + + @Inject() + private utils: utils; + @Inject() + private qiniu:QiNiu; + /** + * 获取上传token,服务于图片,视频的上传 + * http://www.geekhelp.cn/bmy/api/admin/token + * @param params + * @constructor + */ + @Post("/token") + public async Token (): Promise { + return { qn_token: this.qiniu.GenerateToken() }; + } + +} diff --git a/src/controller/api/.pydio b/src/controller/api/.pydio new file mode 100644 index 0000000..0c52cf5 --- /dev/null +++ b/src/controller/api/.pydio @@ -0,0 +1 @@ +d45629f3-6d2f-4b26-a7e0-0c055bea4c82 \ No newline at end of file diff --git a/src/controller/api/UserControllerApi.ts b/src/controller/api/UserControllerApi.ts new file mode 100755 index 0000000..8038bf7 --- /dev/null +++ b/src/controller/api/UserControllerApi.ts @@ -0,0 +1,72 @@ +import { JsonController, Get, UseBefore, QueryParams, Body, UseInterceptor, Post } from "routing-controllers"; +import { config } from "../../config"; +import { JsonResponseInterceptor } from "../../middleware/JsonResponseMiddlewares"; +import { Service, Inject } from "typedi"; +import { UserServiceImpl } from "../../service/impl/UserServiceImpl"; +import { UserModel } from "../../model/UserModel"; +import { LogsMiddlewares } from "../../middleware/LogsMiddlewares"; + +@Service() +@JsonController(`${config.apiurl}/user`) +@UseInterceptor(JsonResponseInterceptor) +export class UserControllerApi { + + @Inject() + private userServiceImpl: UserServiceImpl; + + /** + * @api {get} /user/oneUser oneUser + * @apiVersion 1.1.0 + * @apiDescription 获取一条用户记录 + * @apiName oneUser + * @apiGroup user + * @apiParam {string} id 用户id + * @apiSuccessExample {json} 请求成功的返回: + * { + * "status" : 200, + * "result" : { + * } + * } + * @apiErrorExample {json} 请求失败的返回 + * { + * "status":200, + * "result":{ + * } + * } + * @apiSampleRequest http://www.geekhelp.cn/bmy/api/user/oneUser + * @apiVersion 1.0.0 + */ + @Get("/oneUser") + @UseBefore(LogsMiddlewares) + public async oneUser (@QueryParams() query: UserModel): Promise { + return await this.userServiceImpl.getOneUserService(query.id); + } + + /** + * @api {get} /user/allUser allUser + * @apiVersion 1.1.0 + * @apiDescription 获取所有用户信息 + * @apiName allUser + * @apiGroup user + * @apiSuccessExample {json} 请求成功的返回: + * { + * "status" : 200, + * "result" : { + * } + * } + * @apiErrorExample {json} 请求失败的返回 + * { + * "status":200, + * "result":{ + * } + * } + * @apiSampleRequest http://www.geekhelp.cn/bmy/api/user/allUser + * @apiVersion 1.0.0 + */ + @Get("/allUser") + @UseBefore(LogsMiddlewares) + public async allUser (): Promise { + return await this.userServiceImpl.getAllUserService(); + } + +} \ No newline at end of file diff --git a/src/controller/home/.pydio b/src/controller/home/.pydio new file mode 100644 index 0000000..9ca2e18 --- /dev/null +++ b/src/controller/home/.pydio @@ -0,0 +1 @@ +0d4eec9b-ee96-46ee-8945-590de50f1b0c \ No newline at end of file diff --git a/src/controller/home/AboutControllerHome.ts b/src/controller/home/AboutControllerHome.ts new file mode 100644 index 0000000..60914ee --- /dev/null +++ b/src/controller/home/AboutControllerHome.ts @@ -0,0 +1,22 @@ +import {Controller, Render, Get, UseBefore, Session} from "routing-controllers"; +import { utils } from "../../utils/utils"; + +@Controller() +export class AboutControllerHome { + @Get("/about") + @Render("home/page/about") + About(@Session() session) { + return { + title: utils.titleName("关于"), + isShowAction: { + header: true, + footer: true + }, + banner: { + bannerTitle: '关于怪客', + bannerUrl: '/img/banner_5.jpg', + }, + login: session.user ? session.user : false + } + } +} \ No newline at end of file diff --git a/src/controller/home/ErrorControllerHome.ts b/src/controller/home/ErrorControllerHome.ts new file mode 100644 index 0000000..177aa08 --- /dev/null +++ b/src/controller/home/ErrorControllerHome.ts @@ -0,0 +1,17 @@ +import {Controller, Render, Get, UseBefore, Session} from "routing-controllers"; +import { utils } from "../../utils/utils"; + +@Controller() +export class ErrorControllerHome { + @Get("/error") + @Render("home/page/error") + public Error() { + return { + title: utils.titleName("404..."), + isShowAction: { + header: false, + footer: false + } + } + } +} \ No newline at end of file diff --git a/src/controller/home/IndexControllerHome.ts b/src/controller/home/IndexControllerHome.ts new file mode 100755 index 0000000..8e69455 --- /dev/null +++ b/src/controller/home/IndexControllerHome.ts @@ -0,0 +1,21 @@ +import {Controller, Render, Get, UseBefore, Session} from "routing-controllers"; +import { utils } from "../../utils/utils"; +import { Service, Inject } from "typedi"; + +@Service() +@Controller() +export class IndexControllerHome { + + @Get("/") + @Render("home/page/index") + public async Index(@Session() session,) { + return { + title: utils.titleName("首页"), + isShowAction: { + header: true, + footer: true + }, + login: session.user ? session.user : false + } + } +} \ No newline at end of file diff --git a/src/dao/.pydio b/src/dao/.pydio new file mode 100644 index 0000000..12816a6 --- /dev/null +++ b/src/dao/.pydio @@ -0,0 +1 @@ +275b7a80-4438-4836-b9cf-618cb907b87e \ No newline at end of file diff --git a/src/dao/UserDao.ts b/src/dao/UserDao.ts new file mode 100755 index 0000000..9f739bc --- /dev/null +++ b/src/dao/UserDao.ts @@ -0,0 +1,22 @@ +import { Service , Inject } from "typedi"; +import { UserEntity } from "../entity/UserEntity"; +import { getRepository } from "typeorm"; + +@Service() +export class UserDao { + + /** + * 查询用户具体信息 + * @param id + */ + public async getOneUserDao(id: string): Promise { + return await getRepository(UserEntity) + .findOne({ where: { user_id: id} }); + } + + public async AllUser(): Promise { + return await getRepository(UserEntity) + .find(); + } + +} \ No newline at end of file diff --git a/src/entity/.pydio b/src/entity/.pydio new file mode 100644 index 0000000..06f8ced --- /dev/null +++ b/src/entity/.pydio @@ -0,0 +1 @@ +74c4a05c-dd75-4d4b-804e-ab4744371488 \ No newline at end of file diff --git a/src/entity/UserEntity.ts b/src/entity/UserEntity.ts new file mode 100644 index 0000000..c8d58d8 --- /dev/null +++ b/src/entity/UserEntity.ts @@ -0,0 +1,30 @@ +import {Entity, PrimaryGeneratedColumn, Column} from "typeorm"; + +@Entity("user") +export class UserEntity { + + @PrimaryGeneratedColumn() + user_id: number; + + @Column() + user_name: string; + + @Column() + user_pwd: string; + + @Column() + user_time: string; + + @Column() + user_money: string; + + @Column() + user_pic: string; + + @Column() + user_address: string; + + @Column() + user_phone: string; + +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100755 index 0000000..356780a --- /dev/null +++ b/src/index.ts @@ -0,0 +1,5 @@ +/** + * 启动文件入口 + */ +import { App } from "./run/app"; +new App(); \ No newline at end of file diff --git a/src/middleware/.pydio b/src/middleware/.pydio new file mode 100644 index 0000000..4fa9a92 --- /dev/null +++ b/src/middleware/.pydio @@ -0,0 +1 @@ +96d2aaaa-e82a-4df8-a343-8461b449dcb6 \ No newline at end of file diff --git a/src/middleware/CheckLoginMiddleware.ts b/src/middleware/CheckLoginMiddleware.ts new file mode 100755 index 0000000..d41e790 --- /dev/null +++ b/src/middleware/CheckLoginMiddleware.ts @@ -0,0 +1,14 @@ +import { KoaMiddlewareInterface } from "routing-controllers"; + +/** + * 判断用户是否登录,如果登录则继续访问,没有去登录 + */ +export class CheckLoginMiddleware implements KoaMiddlewareInterface { + use(context: any, next: (err?: any) => Promise): Promise { + if (!context.session || !context.session.user) { + context.redirect(`/reg?from=${context.request.url}`); + }else { + return next(); + } + } +} \ No newline at end of file diff --git a/src/middleware/JsonResponseMiddlewares.ts b/src/middleware/JsonResponseMiddlewares.ts new file mode 100755 index 0000000..ff091f7 --- /dev/null +++ b/src/middleware/JsonResponseMiddlewares.ts @@ -0,0 +1,21 @@ +import { Interceptor, InterceptorInterface, Action } from "routing-controllers"; +import { ResultDataMiddlewares } from "./ResultDataMiddlewares"; +import { Service,Inject } from "typedi"; +import { Logs } from "../utils/logs"; + +// 拦截controller在数据响应给前端,按照标准格式输出数据,同时session存储用户 +@Service() +export class JsonResponseInterceptor implements InterceptorInterface { + + @Inject() + private resultDataMiddlewares: ResultDataMiddlewares; + + intercept(action: Action, content: any) { + if (content == undefined || content.length == 0) { + Logs.ApplicationLogger().error(action); + return this.resultDataMiddlewares.error(action,"没有数据"); + } else if (content.length != 0 ) { + return this.resultDataMiddlewares.success(content); + } + } +} \ No newline at end of file diff --git a/src/middleware/LogsMiddlewares.ts b/src/middleware/LogsMiddlewares.ts new file mode 100644 index 0000000..701b1b4 --- /dev/null +++ b/src/middleware/LogsMiddlewares.ts @@ -0,0 +1,20 @@ +import { KoaMiddlewareInterface, Action } from "routing-controllers"; +import { Service,Inject } from "typedi"; +import { Logs } from "../utils/logs"; +import moment from "moment"; + +/** + * controller 拦截器 + * 拦截 controller 被访问前,进行访问的日志记录 + */ +@Service() +export class LogsMiddlewares implements KoaMiddlewareInterface { + use(context: any, next: (err?: any) => Promise): Promise { + if (context.request.method == "GET") { + Logs.ApplicationLogger().warn(`${moment().format('YYYY-MM-DD HH:mm:ss')} ${context.request.ip} ${context.request.method} ${context.request.url} ${JSON.stringify(context.request.querystring)} ${JSON.stringify(context.request.header)} \n`); + } else { + Logs.ApplicationLogger().warn(`${moment().format('YYYY-MM-DD HH:mm:ss')} ${context.request.ip} ${context.request.method} ${context.request.url} ${JSON.stringify(context.request.body)} ${JSON.stringify(context.request.header)} \n`); + } + return next() + } +} \ No newline at end of file diff --git a/src/middleware/ResultDataMiddlewares.ts b/src/middleware/ResultDataMiddlewares.ts new file mode 100755 index 0000000..676bd2e --- /dev/null +++ b/src/middleware/ResultDataMiddlewares.ts @@ -0,0 +1,73 @@ +import {Action} from "routing-controllers"; +import { Service } from "typedi"; + +@Service() +export class ResultDataMiddlewares { + private _status : number; + private _data: Object; + private _methods; + private _url; + + get status(): number { + return this._status; + } + + set status(value: number) { + this._status = value; + } + + get data(): Object { + return this._data; + } + + set data(value: Object) { + this._data = value; + } + + get methods() { + return this._methods; + } + + set methods(value) { + this._methods = value; + } + + get url() { + return this._url; + } + + set url(value) { + this._url = value; + } + + /** + * 数据请求成功 + * @param _data 需要返回给前端的数据 + */ + public success (_data:Object): string { + this.status = 200; + this.data = _data; + return JSON.stringify({ + status: this.status, + time: new Date(), + result: this.data + }) + } + + /** + * 数据请求失败 + * @param action 请求对象 + */ + public error (action: Action,message: string): string { + this.status = action.response.status; // 状态码 + this.data = message; // 错误信息 + this.methods = action.request.method; // 请求方式 + this.url = action.request.url; // 请求地址 + return JSON.stringify({ + methods: this.methods, + status: this.status, + result: this.data, + url: this.url + }) + } +} \ No newline at end of file diff --git a/src/model/.pydio b/src/model/.pydio new file mode 100644 index 0000000..d094446 --- /dev/null +++ b/src/model/.pydio @@ -0,0 +1 @@ +e898cbf5-a9e0-4e9b-bda1-046d53eb37bd \ No newline at end of file diff --git a/src/model/UserModel.ts b/src/model/UserModel.ts new file mode 100755 index 0000000..83903df --- /dev/null +++ b/src/model/UserModel.ts @@ -0,0 +1,8 @@ +import { MinLength,IsInt, MaxLength,Allow,Validate } from 'class-validator'; + +export class UserModel { + @MinLength(1,{ + message: 'id参数必须有' + }) + id: string; +} \ No newline at end of file diff --git a/src/plugins/.pydio b/src/plugins/.pydio new file mode 100644 index 0000000..24043bf --- /dev/null +++ b/src/plugins/.pydio @@ -0,0 +1 @@ +5b0cc403-0efc-4c6a-b36e-5e9237caf175 \ No newline at end of file diff --git a/src/plugins/qiniu.ts b/src/plugins/qiniu.ts new file mode 100755 index 0000000..2c6cf58 --- /dev/null +++ b/src/plugins/qiniu.ts @@ -0,0 +1,63 @@ +import qiniu from "qiniu"; +import { Service } from "typedi"; +import { config } from "../config/index"; + +@Service() +export class QiNiu { + public FromBucket:string = config.qiniu.HLSconfig.FromBucket; + public ToBucket:string = config.qiniu.HLSconfig.ToBucket; + public VideoHlsParams:string = config.qiniu.HLSconfig.VideoHlsParams; + + public accessKey:string = config.qiniu.accessKey; + public secretKey:string = config.qiniu.secretKey; + // 鉴权对象mac + public mac:any; + + constructor () { + this.mac = new qiniu.auth.digest.Mac(this.accessKey, this.secretKey) + } + + /** + * + * @param BucketName + * @constructor + */ + public GenerateToken (BucketName:string = "vrcource"): string { + + let putPolicy = new qiniu.rs.PutPolicy({ + scope: BucketName, + expires: 7200 + }); + + return putPolicy.uploadToken(this.mac); + } + + /** + * 根据前端传递的 filename 文件名,对需要的视频进行切片配置, + * 返回给前端 token,前端拿到 token 后通过form data将视频和 + * token 传递给七牛,七牛会根据token开始切片任务。这里不需要 + * 配置七牛切片成功后的回调通知,因为已经可以通过基地址+m3u8文件名拿到 + * 切片后的地址 + * @param params + * @constructor + */ + public GenerateHlsToken (params:Object): Object { + + let M3u8FileName = new Date().getTime(); + let saveHlsEntry = qiniu.util.urlsafeBase64Encode(`${this.ToBucket}:${M3u8FileName}`); + + + const options = { + scope: `${this.FromBucket}:${params['filename']}`, + persistentOps: `${this.VideoHlsParams}${saveHlsEntry}`, + persistentPipeline: 'guaikem3u8', // 多媒体处理队列名称,必填 + }; + + let putPolicy = new qiniu.rs.PutPolicy(options); + return { + filePath: `${config.qiniu.HLSconfig.VideoBaseUrl}${M3u8FileName}`, + token: putPolicy.uploadToken(this.mac) + }; + } + +} \ No newline at end of file diff --git a/src/resources/.pydio b/src/resources/.pydio new file mode 100644 index 0000000..abb0b4e --- /dev/null +++ b/src/resources/.pydio @@ -0,0 +1 @@ +8c26c921-798c-49c6-bc63-4a77438d5dc0 \ No newline at end of file diff --git a/src/resources/static/.pydio b/src/resources/static/.pydio new file mode 100644 index 0000000..1d6bfcb --- /dev/null +++ b/src/resources/static/.pydio @@ -0,0 +1 @@ +9d629bd9-6c8b-47c3-82ce-d15d5ffa4474 \ No newline at end of file diff --git a/src/resources/static/css/.pydio b/src/resources/static/css/.pydio new file mode 100644 index 0000000..1bf5589 --- /dev/null +++ b/src/resources/static/css/.pydio @@ -0,0 +1 @@ +3b52c330-093c-476c-9944-90ff44bd7247 \ No newline at end of file diff --git a/src/resources/static/css/admin/.pydio b/src/resources/static/css/admin/.pydio new file mode 100644 index 0000000..278b8cf --- /dev/null +++ b/src/resources/static/css/admin/.pydio @@ -0,0 +1 @@ +bfec8782-8849-4d94-b108-8285c2348315 \ No newline at end of file diff --git a/src/resources/static/css/admin/index.css b/src/resources/static/css/admin/index.css new file mode 100755 index 0000000..51c9413 --- /dev/null +++ b/src/resources/static/css/admin/index.css @@ -0,0 +1,8 @@ +.index h1 { + color: red; +} +.index h2 { + font-size-adjust: 19px; + color: blue; + font-weight: bold; +} diff --git a/src/resources/static/css/base.css b/src/resources/static/css/base.css new file mode 100755 index 0000000..e69de29 diff --git a/src/resources/static/css/home/.pydio b/src/resources/static/css/home/.pydio new file mode 100644 index 0000000..4b8227f --- /dev/null +++ b/src/resources/static/css/home/.pydio @@ -0,0 +1 @@ +31021fa8-cc19-4e20-ab24-73e513700dfc \ No newline at end of file diff --git a/src/resources/static/css/home/about.css b/src/resources/static/css/home/about.css new file mode 100644 index 0000000..7ce602c --- /dev/null +++ b/src/resources/static/css/home/about.css @@ -0,0 +1,3 @@ +.about { + color: red; +} diff --git a/src/resources/static/css/home/error.css b/src/resources/static/css/home/error.css new file mode 100644 index 0000000..ad602e5 --- /dev/null +++ b/src/resources/static/css/home/error.css @@ -0,0 +1,38 @@ +.error { + display: flex; + align-items: center; + justify-content: center; + flex-direction: row; +} +.error img { + width: 270px; + margin-bottom: 20px; +} +.error .i-message { + margin-left: 19px; +} +.error .i-message .action { + margin-top: 10px; +} +.error .i-message .action a[href="/"] { + margin-right: 15px; +} +.error .i-message ul { + padding-left: 20px; + margin-top: 8px; +} +.error .i-message h3 { + font-size: 17px; + margin-bottom: 10px; + line-height: 27px; + font-weight: 500; + letter-spacing: 2px; +} +.error .i-message a { + color: #8d8d8d; +} +body, +html, +.error { + height: 100%; +} diff --git a/src/resources/static/css/home/index.css b/src/resources/static/css/home/index.css new file mode 100755 index 0000000..e69de29 diff --git a/src/resources/static/css/home/register.css b/src/resources/static/css/home/register.css new file mode 100644 index 0000000..22836a8 --- /dev/null +++ b/src/resources/static/css/home/register.css @@ -0,0 +1,4 @@ +.register { + font-size: 30px; + color: green; +} diff --git a/src/resources/static/css/home/test.css b/src/resources/static/css/home/test.css new file mode 100644 index 0000000..2c85bdd --- /dev/null +++ b/src/resources/static/css/home/test.css @@ -0,0 +1,3 @@ +.Test { + color: red; +} diff --git a/src/resources/static/css/tpl/.pydio b/src/resources/static/css/tpl/.pydio new file mode 100644 index 0000000..d44fab5 --- /dev/null +++ b/src/resources/static/css/tpl/.pydio @@ -0,0 +1 @@ +947ec64e-374d-4bac-96b5-fa2ea743b68b \ No newline at end of file diff --git a/src/resources/static/css/tpl/colors.css b/src/resources/static/css/tpl/colors.css new file mode 100755 index 0000000..e69de29 diff --git a/src/resources/static/css/tpl/mixins.css b/src/resources/static/css/tpl/mixins.css new file mode 100755 index 0000000..e69de29 diff --git a/src/resources/static/fonts/.pydio b/src/resources/static/fonts/.pydio new file mode 100644 index 0000000..b548e78 --- /dev/null +++ b/src/resources/static/fonts/.pydio @@ -0,0 +1 @@ +e10e6959-e1c6-49e7-8b88-b66ff23d57db \ No newline at end of file diff --git a/src/resources/static/img/.pydio b/src/resources/static/img/.pydio new file mode 100644 index 0000000..99aef53 --- /dev/null +++ b/src/resources/static/img/.pydio @@ -0,0 +1 @@ +3e4e8103-4fdc-4ba1-96d6-77580e0e21c6 \ No newline at end of file diff --git a/src/resources/static/img/banner.png b/src/resources/static/img/banner.png new file mode 100755 index 0000000..2e7b920 Binary files /dev/null and b/src/resources/static/img/banner.png differ diff --git a/src/resources/static/img/banner_1.png b/src/resources/static/img/banner_1.png new file mode 100755 index 0000000..3feac26 Binary files /dev/null and b/src/resources/static/img/banner_1.png differ diff --git a/src/resources/static/img/banner_2.png b/src/resources/static/img/banner_2.png new file mode 100755 index 0000000..de04f0c Binary files /dev/null and b/src/resources/static/img/banner_2.png differ diff --git a/src/resources/static/img/banner_3.png b/src/resources/static/img/banner_3.png new file mode 100755 index 0000000..de04f0c Binary files /dev/null and b/src/resources/static/img/banner_3.png differ diff --git a/src/resources/static/img/banner_4.jpg b/src/resources/static/img/banner_4.jpg new file mode 100755 index 0000000..ca713a9 Binary files /dev/null and b/src/resources/static/img/banner_4.jpg differ diff --git a/src/resources/static/img/banner_5.jpg b/src/resources/static/img/banner_5.jpg new file mode 100755 index 0000000..09eeb76 Binary files /dev/null and b/src/resources/static/img/banner_5.jpg differ diff --git a/src/resources/static/img/banner_6.jpg b/src/resources/static/img/banner_6.jpg new file mode 100755 index 0000000..ccc675f Binary files /dev/null and b/src/resources/static/img/banner_6.jpg differ diff --git a/src/resources/static/img/banner_7.png b/src/resources/static/img/banner_7.png new file mode 100755 index 0000000..9e6869a Binary files /dev/null and b/src/resources/static/img/banner_7.png differ diff --git a/src/resources/static/img/bgError.png b/src/resources/static/img/bgError.png new file mode 100755 index 0000000..1c3d4fd Binary files /dev/null and b/src/resources/static/img/bgError.png differ diff --git a/src/resources/static/img/discountbanner.png b/src/resources/static/img/discountbanner.png new file mode 100755 index 0000000..d8370cc Binary files /dev/null and b/src/resources/static/img/discountbanner.png differ diff --git a/src/resources/static/img/favicon.ico b/src/resources/static/img/favicon.ico new file mode 100755 index 0000000..1041510 Binary files /dev/null and b/src/resources/static/img/favicon.ico differ diff --git a/src/resources/static/img/getbg.png b/src/resources/static/img/getbg.png new file mode 100755 index 0000000..87648c9 Binary files /dev/null and b/src/resources/static/img/getbg.png differ diff --git a/src/resources/static/img/spjcdet_img1.png b/src/resources/static/img/spjcdet_img1.png new file mode 100755 index 0000000..3854f19 Binary files /dev/null and b/src/resources/static/img/spjcdet_img1.png differ diff --git a/src/resources/static/img/spjcdet_img2.jpg b/src/resources/static/img/spjcdet_img2.jpg new file mode 100755 index 0000000..582008c Binary files /dev/null and b/src/resources/static/img/spjcdet_img2.jpg differ diff --git a/src/resources/static/img/spjcdet_img3.png b/src/resources/static/img/spjcdet_img3.png new file mode 100755 index 0000000..5a1dcb3 Binary files /dev/null and b/src/resources/static/img/spjcdet_img3.png differ diff --git a/src/resources/static/img/spjcdet_img4.png b/src/resources/static/img/spjcdet_img4.png new file mode 100755 index 0000000..9fc4f5a Binary files /dev/null and b/src/resources/static/img/spjcdet_img4.png differ diff --git a/src/resources/static/img/wx.png b/src/resources/static/img/wx.png new file mode 100755 index 0000000..00fd6b1 Binary files /dev/null and b/src/resources/static/img/wx.png differ diff --git a/src/resources/static/img/youh.png b/src/resources/static/img/youh.png new file mode 100755 index 0000000..dbc4f55 Binary files /dev/null and b/src/resources/static/img/youh.png differ diff --git a/src/resources/static/js/.pydio b/src/resources/static/js/.pydio new file mode 100644 index 0000000..e7fd507 --- /dev/null +++ b/src/resources/static/js/.pydio @@ -0,0 +1 @@ +e33354c0-3a7c-4ff8-a9d6-4b98fe550e50 \ No newline at end of file diff --git a/src/resources/static/js/app.js b/src/resources/static/js/app.js new file mode 100755 index 0000000..c5e28e6 --- /dev/null +++ b/src/resources/static/js/app.js @@ -0,0 +1,32 @@ +requirejs.config({ require.js + baseUrl: '/js', + waitSeconds: 0, + paths: { + app: 'app', + jquery: 'lib/jquery.min', + swiper: 'lib/swiper/swiper.min', + zui: 'lib/zui/js/zui.min', + utils: 'utils/index', + config: 'config/index' + }, + map: { + '*': { + 'css': 'lib/css' + } + }, + shim : { // 按需加载css + 'app/index': { deps: ['css!/css/home/index.css','css!/js/lib/swiper/swiper.min.css'] }, + 'app/about': { deps: ['css!/css/home/about.css'] }, + 'app/register': { deps: ['css!/css/home/register.css'] } + } +}); + +// 读取每个页面自定义属性data-module获取js文件名,然后自动加载并调用非对应页面的js文件中的 init 方法 +requirejs(["jquery"],function ($) { + var module = $('.pages').attr('data-module'); + if(module != undefined){ + requirejs([ `app/${ module }` ], function (module) { + module.init(); + }) + } +}); diff --git a/src/resources/static/js/app/.pydio b/src/resources/static/js/app/.pydio new file mode 100644 index 0000000..877e560 --- /dev/null +++ b/src/resources/static/js/app/.pydio @@ -0,0 +1 @@ +9faddbd9-b874-40d9-a66d-63fc5d902d36 \ No newline at end of file diff --git a/src/resources/static/js/app/about.js b/src/resources/static/js/app/about.js new file mode 100755 index 0000000..90a5f65 --- /dev/null +++ b/src/resources/static/js/app/about.js @@ -0,0 +1,12 @@ +define(['jquery','utils'],function ($,utils) { + function about() { + + } + + about.prototype = { + init () { + } + }; + + return new about(); +}); \ No newline at end of file diff --git a/src/resources/static/js/app/index.js b/src/resources/static/js/app/index.js new file mode 100755 index 0000000..ea48dd5 --- /dev/null +++ b/src/resources/static/js/app/index.js @@ -0,0 +1,31 @@ +define(['jquery','swiper','utils', 'zui'],function ($,swiper,utils) { + function Index() { + + } + + Index.prototype = { + init () { + new $.zui.Messager('zui弹窗。', { + icon: 'heart', + placement: 'center' + }).show(); + }, + + + //初始化 swiper 轮播图 + newSwiper () { + // new swiper ('.swiper-container', { + // direction: 'horizontal', + // loop: true, + // autoplay: true, + // pagination: { + // el: '.swiper-pagination', + // clickable :true, + // } + // }); + }, + + } + + return new Index(); +}) diff --git a/src/resources/static/js/app/register.js b/src/resources/static/js/app/register.js new file mode 100644 index 0000000..96227b1 --- /dev/null +++ b/src/resources/static/js/app/register.js @@ -0,0 +1,14 @@ +define(['jquery','swiper','utils'],function ($,swiper,utils) { + function Register() { + + } + + Register.prototype = { + init () { + console.log("用户注册") + }, + + }; + + return new Register(); +}); \ No newline at end of file diff --git a/src/resources/static/js/app/test.js b/src/resources/static/js/app/test.js new file mode 100644 index 0000000..007d643 --- /dev/null +++ b/src/resources/static/js/app/test.js @@ -0,0 +1,12 @@ +define(['jquery','utils'],function ($,utils) { + function test() { + + } + + test.prototype = { + init () { + } + }; + + return new test(); +}); diff --git a/src/resources/static/js/config/.pydio b/src/resources/static/js/config/.pydio new file mode 100644 index 0000000..2e5ff8f --- /dev/null +++ b/src/resources/static/js/config/.pydio @@ -0,0 +1 @@ +3f5ff286-3561-4405-9dd8-3cbed06c8892 \ No newline at end of file diff --git a/src/resources/static/js/config/index.js b/src/resources/static/js/config/index.js new file mode 100755 index 0000000..9549b88 --- /dev/null +++ b/src/resources/static/js/config/index.js @@ -0,0 +1,10 @@ +/** + * 网站前端的 config 配置文件 + */ +define([], function () { + return { + + // 请求基地址 + baseURL: 'http://www.geekhelp.cn/bmy/api' + } +}) \ No newline at end of file diff --git a/src/resources/static/js/lib/.pydio b/src/resources/static/js/lib/.pydio new file mode 100644 index 0000000..22cbbda --- /dev/null +++ b/src/resources/static/js/lib/.pydio @@ -0,0 +1 @@ +743a2177-30e9-48f6-9903-32422cd77e5b \ No newline at end of file diff --git a/src/resources/static/js/lib/css.js b/src/resources/static/js/lib/css.js new file mode 100755 index 0000000..df4a337 --- /dev/null +++ b/src/resources/static/js/lib/css.js @@ -0,0 +1,169 @@ +/* + * Require-CSS RequireJS css! loader plugin + * 0.1.10 + * Guy Bedford 2014 + * MIT + */ + +/* + * + * Usage: + * require(['css!./mycssFile']); + * + * Tested and working in (up to latest versions as of March 2013): + * Android + * iOS 6 + * IE 6 - 10 + * Chrome 3 - 26 + * Firefox 3.5 - 19 + * Opera 10 - 12 + * + * browserling.com used for virtual testing environment + * + * Credit to B Cavalier & J Hann for the IE 6 - 9 method, + * refined with help from Martin Cermak + * + * Sources that helped along the way: + * - https://developer.mozilla.org/en-US/docs/Browser_detection_using_the_user_agent + * - http://www.phpied.com/when-is-a-stylesheet-really-loaded/ + * - https://github.com/cujojs/curl/blob/master/src/curl/plugin/css.js + * + */ + +define(function() { +//>>excludeStart('excludeRequireCss', pragmas.excludeRequireCss) + if (typeof window == 'undefined') + return { load: function(n, r, load){ load() } }; + + var head = document.getElementsByTagName('head')[0]; + + var engine = window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/) || 0; + + // use "; +c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| +"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f); +if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d #mq-test-1 { width: 42px; }',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b .canvas { + position: relative; + min-width: 50px; + max-width: 100%; + margin: 0 auto; + } +.img-cutter > .canvas > .cover { + position: absolute; + top: 0; + left: 0; + z-index: 1; + width: 100%; + height: 100%; + -webkit-transition: all .4s cubic-bezier(.175, .885, .32, 1); + -o-transition: all .4s cubic-bezier(.175, .885, .32, 1); + transition: all .4s cubic-bezier(.175, .885, .32, 1); + } +.img-cutter > .canvas > img { + -webkit-transition: all .4s cubic-bezier(.175, .885, .32, 1); + -o-transition: all .4s cubic-bezier(.175, .885, .32, 1); + transition: all .4s cubic-bezier(.175, .885, .32, 1); + } +.img-cutter > .canvas > .controller { + position: absolute; + top: 5%; + left: 5%; + z-index: 5; + width: 100px; + height: 100px; + cursor: move; + background: none; + border: 1px dashed #fff; + border-color: rgba(255, 255, 255, .7); + -webkit-transition: opacity .4s cubic-bezier(.175, .885, .32, 1); + -o-transition: opacity .4s cubic-bezier(.175, .885, .32, 1); + transition: opacity .4s cubic-bezier(.175, .885, .32, 1); + } +.img-cutter > .canvas > .controller > .control { + position: absolute; + width: 6px; + height: 6px; + background: #000; + background: rgba(0, 0, 0, .6); + border: 1px solid #fff; + border-color: rgba(255, 255, 255, .6); + } +.img-cutter > .canvas > .controller > .control[data-direction='left'] { + top: 50%; + left: -4px; + margin-top: -3px; + cursor: w-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='top'] { + top: -4px; + left: 50%; + margin-left: -3px; + cursor: n-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='right'] { + top: 50%; + right: -4px; + margin-top: -3px; + cursor: e-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='bottom'] { + bottom: -4px; + left: 50%; + margin-left: -3px; + cursor: s-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='top-left'] { + top: -4px; + left: -4px; + cursor: nw-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='top-right'] { + top: -4px; + right: -4px; + cursor: ne-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='bottom-left'] { + bottom: -4px; + left: -4px; + cursor: sw-resize; + } +.img-cutter > .canvas > .controller > .control[data-direction='bottom-right'] { + right: -4px; + bottom: -4px; + cursor: se-resize; + } +.img-cutter > .canvas > .cliper { + position: absolute; + top: 0; + left: 0; + z-index: 2; + width: 100%; + height: 100%; + clip: rect(0px, 50px, 50px, 0); + } +.img-cutter.hover > .canvas > img, +.img-cutter.hover > .canvas > .controller > .cover { + filter: alpha(opacity=0); + opacity: 0; + } +.img-cutter.hover > .canvas > .controller { + display: none; + } diff --git a/src/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.js b/src/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.js new file mode 100644 index 0000000..479ea00 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.js @@ -0,0 +1,280 @@ +/*! + * ZUI: 图片裁剪工具 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/* ======================================================================== + * ZUI: img-cutter.js + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + +(function($, Math, undefined) { + 'use strict'; + + if(!$.fn.draggable) console.error('img-cutter requires draggable.js'); + if(!$.zui.imgReady) console.error('img-cutter requires image.ready.js'); + + var NAME = 'zui.imgCutter'; + + var ImgCutter = function(element, options) { + this.$ = $(element); + this.initOptions(options); + this.init(); + }; + + ImgCutter.DEFAULTS = { + coverColor: '#000', + coverOpacity: 0.6, + // fixedRatio: false, + defaultWidth: 128, + defaultHeight: 128, + minWidth: 48, + minHeight: 48 + }; // default options + + ImgCutter.prototype.callEvent = function(name, params) { + var result = this.$.callEvent(name + '.' + NAME, params, this); + return !(result.result !== undefined && (!result.result)); + }; + + ImgCutter.prototype.initOptions = function(options) { + this.options = $.extend({}, ImgCutter.DEFAULTS, this.$.data(), options); + this.options.coverOpacityIE = this.options.coverOpacity * 100; + this.clipWidth = this.options.defaultWidth; + this.clipHeight = this.options.defaultHeight; + }; + + ImgCutter.prototype.init = function() { + this.initDom(); + this.initSize(); + this.bindEvents(); + }; + + ImgCutter.prototype.initDom = function() { + this.$canvas = this.$.children('.canvas'); + this.$img = this.$canvas.children('img'); + this.$actions = this.$.children('.actions'); + this.$btn = this.$.find('.img-cutter-submit'); + this.$preview = this.$.find('.img-cutter-preview'); + + this.options.img = this.$img.attr('src'); + + this.$canvas.append('
      '.format(this.options)); + + this.$cover = this.$canvas.children('.cover'); + this.$controller = this.$canvas.children('.controller'); + this.$cliper = this.$canvas.children('.cliper'); + this.$chipImg = this.$cliper.children('img'); + + if(this.options.fixedRatio) { + this.$.addClass('fixed-ratio'); + } + }; + + ImgCutter.prototype.resetImage = function(img) { + var that = this; + that.options.img = img; + that.$img.attr('src', img); + that.$chipImg.attr('src', img); + that.imgWidth = undefined; + that.left = undefined; + that.initSize(); + }; + + ImgCutter.prototype.initSize = function() { + var that = this; + if(!that.imgWidth) { + $.zui.imgReady(that.options.img, function() { + that.imgWidth = this.width; + that.imgHeight = this.height; + that.callEvent('ready'); + }); + } + + + var waitImgWidth = setInterval(function() { + if(that.imgWidth) { + clearInterval(waitImgWidth); + + that.width = Math.min(that.imgWidth, that.$.width()); + that.$canvas.css('width', this.width); + that.$cliper.css('width', this.width); + that.height = that.$canvas.height(); + + if(that.left === undefined) { + that.left = Math.floor((that.width - that.$controller.width()) / 2); + that.top = Math.floor((that.height - that.$controller.height()) / 2); + } + + that.refreshSize(); + } + }, 0); + }; + + ImgCutter.prototype.refreshSize = function(ratioSide) { + var options = this.options; + + this.clipWidth = Math.max(options.minWidth, Math.min(this.width, this.clipWidth)); + this.clipHeight = Math.max(options.minHeight, Math.min(this.height, this.clipHeight)); + + if(options.fixedRatio) { + if(ratioSide && ratioSide === 'height') { + this.clipWidth = Math.max(options.minWidth, Math.min(this.width, this.clipHeight * options.defaultWidth / options.defaultHeight)); + this.clipHeight = this.clipWidth * options.defaultHeight / options.defaultWidth; + } else { + this.clipHeight = Math.max(options.minHeight, Math.min(this.height, this.clipWidth * options.defaultHeight / options.defaultWidth)); + this.clipWidth = this.clipHeight * options.defaultWidth / options.defaultHeight; + } + } + + this.left = Math.min(this.width - this.clipWidth, Math.max(0, this.left)); + this.top = Math.min(this.height - this.clipHeight, Math.max(0, this.top)); + this.right = this.left + this.clipWidth; + this.bottom = this.top + this.clipHeight; + + this.$controller.css({ + left: this.left, + top: this.top, + width: this.clipWidth, + height: this.clipHeight + }); + this.$cliper.css('clip', 'rect({0}px {1}px {2}px {3}px'.format(this.top, this.left + this.clipWidth, this.top + this.clipHeight, this.left)); + + + this.callEvent('change', { + top: this.top, + left: this.left, + bottom: this.bottom, + right: this.right, + width: this.clipWidth, + height: this.clipHeight + }); + }; + + ImgCutter.prototype.getData = function() { + var that = this; + that.data = { + originWidth: that.imgWidth, + originHeight: that.imgHeight, + scaleWidth: that.width, + scaleHeight: that.height, + width: that.right - that.left, + height: that.bottom - that.top, + left: that.left, + top: that.top, + right: that.right, + bottom: that.bottom, + scaled: that.imgWidth != that.width || that.imgHeight != that.height + }; + return that.data; + }; + + ImgCutter.prototype.bindEvents = function() { + var that = this, + options = this.options; + this.$.resize($.proxy(this.initSize, this)); + this.$btn.hover(function() { + that.$.toggleClass('hover'); + }).click(function() { + var data = that.getData(); + + if(!that.callEvent('before', data)) return; + + var url = options.post || options.get || options.url || null; + if(url !== null) { + $.ajax({ + type: options.post ? 'POST' : 'GET', + url: url, + data: data + }) + .done(function(e) { + that.callEvent('done', e); + }).fail(function(e) { + that.callEvent('fail', e); + }).always(function(e) { + that.callEvent('always', e); + }); + } + }); + + this.$controller.draggable({ + move: false, + container: this.$canvas, + drag: function(e) { + that.left += e.smallOffset.x; + that.top += e.smallOffset.y; + that.refreshSize(); + } + }); + + this.$controller.children('.control').draggable({ + move: false, + container: this.$canvas, + stopPropagation: true, + drag: function(e) { + var dr = e.element.data('direction'); + var offset = e.smallOffset; + var ratioSide = false; + + switch(dr) { + case 'left': + case 'top-left': + case 'bottom-left': + that.left += offset.x; + that.left = Math.min(that.right - options.minWidth, Math.max(0, that.left)); + that.clipWidth = that.right - that.left; + break; + case 'right': + case 'top-right': + case 'bottom-right': + that.clipWidth += offset.x; + that.clipWidth = Math.min(that.width - that.left, Math.max(options.minWidth, that.clipWidth)); + break; + } + switch(dr) { + case 'top': + case 'top-left': + case 'top-right': + that.top += offset.y; + that.top = Math.min(that.bottom - options.minHeight, Math.max(0, that.top)); + that.clipHeight = that.bottom - that.top; + ratioSide = true; + break; + case 'bottom': + case 'bottom-left': + case 'bottom-right': + that.clipHeight += offset.y; + that.clipHeight = Math.min(that.height - that.top, Math.max(options.minHeight, that.clipHeight)); + ratioSide = true; + break; + } + + that.refreshSize(ratioSide); + } + }); + }; + + $.fn.imgCutter = function(option) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new ImgCutter(this, options))); + + if(typeof option == 'string') data[option](); + }); + }; + + $.fn.imgCutter.Constructor = ImgCutter; + + $(function() { + $('[data-toggle="imgCutter"]').imgCutter(); + }); +}(jQuery, Math, undefined)); + diff --git a/src/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.css b/src/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.css new file mode 100644 index 0000000..eb267e7 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.css @@ -0,0 +1,6 @@ +/*! + * ZUI: 图片裁剪工具 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */.img-cutter{padding:10px;margin-bottom:20px;background:#e5e5e5;border:1px solid #ddd}.img-cutter>.canvas{position:relative;min-width:50px;max-width:100%;margin:0 auto}.img-cutter>.canvas>.cover{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;-webkit-transition:all .4s cubic-bezier(.175,.885,.32,1);-o-transition:all .4s cubic-bezier(.175,.885,.32,1);transition:all .4s cubic-bezier(.175,.885,.32,1)}.img-cutter>.canvas>img{-webkit-transition:all .4s cubic-bezier(.175,.885,.32,1);-o-transition:all .4s cubic-bezier(.175,.885,.32,1);transition:all .4s cubic-bezier(.175,.885,.32,1)}.img-cutter>.canvas>.controller{position:absolute;top:5%;left:5%;z-index:5;width:100px;height:100px;cursor:move;background:0 0;border:1px dashed #fff;border-color:rgba(255,255,255,.7);-webkit-transition:opacity .4s cubic-bezier(.175,.885,.32,1);-o-transition:opacity .4s cubic-bezier(.175,.885,.32,1);transition:opacity .4s cubic-bezier(.175,.885,.32,1)}.img-cutter>.canvas>.controller>.control{position:absolute;width:6px;height:6px;background:#000;background:rgba(0,0,0,.6);border:1px solid #fff;border-color:rgba(255,255,255,.6)}.img-cutter>.canvas>.controller>.control[data-direction=left]{top:50%;left:-4px;margin-top:-3px;cursor:w-resize}.img-cutter>.canvas>.controller>.control[data-direction=top]{top:-4px;left:50%;margin-left:-3px;cursor:n-resize}.img-cutter>.canvas>.controller>.control[data-direction=right]{top:50%;right:-4px;margin-top:-3px;cursor:e-resize}.img-cutter>.canvas>.controller>.control[data-direction=bottom]{bottom:-4px;left:50%;margin-left:-3px;cursor:s-resize}.img-cutter>.canvas>.controller>.control[data-direction=top-left]{top:-4px;left:-4px;cursor:nw-resize}.img-cutter>.canvas>.controller>.control[data-direction=top-right]{top:-4px;right:-4px;cursor:ne-resize}.img-cutter>.canvas>.controller>.control[data-direction=bottom-left]{bottom:-4px;left:-4px;cursor:sw-resize}.img-cutter>.canvas>.controller>.control[data-direction=bottom-right]{right:-4px;bottom:-4px;cursor:se-resize}.img-cutter>.canvas>.cliper{position:absolute;top:0;left:0;z-index:2;width:100%;height:100%;clip:rect(0,50px,50px,0)}.img-cutter.hover>.canvas>.controller>.cover,.img-cutter.hover>.canvas>img{filter:alpha(opacity=0);opacity:0}.img-cutter.hover>.canvas>.controller{display:none} \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.js b/src/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.js new file mode 100644 index 0000000..97216db --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/imgcutter/zui.imgcutter.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: 图片裁剪工具 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +!function(t,i,e){"use strict";t.fn.draggable||console.error("img-cutter requires draggable.js"),t.zui.imgReady||console.error("img-cutter requires image.ready.js");var h="zui.imgCutter",o=function(i,e){this.$=t(i),this.initOptions(e),this.init()};o.DEFAULTS={coverColor:"#000",coverOpacity:.6,defaultWidth:128,defaultHeight:128,minWidth:48,minHeight:48},o.prototype.callEvent=function(t,i){var o=this.$.callEvent(t+"."+h,i,this);return!(o.result!==e&&!o.result)},o.prototype.initOptions=function(i){this.options=t.extend({},o.DEFAULTS,this.$.data(),i),this.options.coverOpacityIE=100*this.options.coverOpacity,this.clipWidth=this.options.defaultWidth,this.clipHeight=this.options.defaultHeight},o.prototype.init=function(){this.initDom(),this.initSize(),this.bindEvents()},o.prototype.initDom=function(){this.$canvas=this.$.children(".canvas"),this.$img=this.$canvas.children("img"),this.$actions=this.$.children(".actions"),this.$btn=this.$.find(".img-cutter-submit"),this.$preview=this.$.find(".img-cutter-preview"),this.options.img=this.$img.attr("src"),this.$canvas.append('
      '.format(this.options)),this.$cover=this.$canvas.children(".cover"),this.$controller=this.$canvas.children(".controller"),this.$cliper=this.$canvas.children(".cliper"),this.$chipImg=this.$cliper.children("img"),this.options.fixedRatio&&this.$.addClass("fixed-ratio")},o.prototype.resetImage=function(t){var i=this;i.options.img=t,i.$img.attr("src",t),i.$chipImg.attr("src",t),i.imgWidth=e,i.left=e,i.initSize()},o.prototype.initSize=function(){var h=this;h.imgWidth||t.zui.imgReady(h.options.img,function(){h.imgWidth=this.width,h.imgHeight=this.height,h.callEvent("ready")});var o=setInterval(function(){h.imgWidth&&(clearInterval(o),h.width=i.min(h.imgWidth,h.$.width()),h.$canvas.css("width",this.width),h.$cliper.css("width",this.width),h.height=h.$canvas.height(),h.left===e&&(h.left=i.floor((h.width-h.$controller.width())/2),h.top=i.floor((h.height-h.$controller.height())/2)),h.refreshSize())},0)},o.prototype.refreshSize=function(t){var e=this.options;this.clipWidth=i.max(e.minWidth,i.min(this.width,this.clipWidth)),this.clipHeight=i.max(e.minHeight,i.min(this.height,this.clipHeight)),e.fixedRatio&&(t&&"height"===t?(this.clipWidth=i.max(e.minWidth,i.min(this.width,this.clipHeight*e.defaultWidth/e.defaultHeight)),this.clipHeight=this.clipWidth*e.defaultHeight/e.defaultWidth):(this.clipHeight=i.max(e.minHeight,i.min(this.height,this.clipWidth*e.defaultHeight/e.defaultWidth)),this.clipWidth=this.clipHeight*e.defaultWidth/e.defaultHeight)),this.left=i.min(this.width-this.clipWidth,i.max(0,this.left)),this.top=i.min(this.height-this.clipHeight,i.max(0,this.top)),this.right=this.left+this.clipWidth,this.bottom=this.top+this.clipHeight,this.$controller.css({left:this.left,top:this.top,width:this.clipWidth,height:this.clipHeight}),this.$cliper.css("clip","rect({0}px {1}px {2}px {3}px".format(this.top,this.left+this.clipWidth,this.top+this.clipHeight,this.left)),this.callEvent("change",{top:this.top,left:this.left,bottom:this.bottom,right:this.right,width:this.clipWidth,height:this.clipHeight})},o.prototype.getData=function(){var t=this;return t.data={originWidth:t.imgWidth,originHeight:t.imgHeight,scaleWidth:t.width,scaleHeight:t.height,width:t.right-t.left,height:t.bottom-t.top,left:t.left,top:t.top,right:t.right,bottom:t.bottom,scaled:t.imgWidth!=t.width||t.imgHeight!=t.height},t.data},o.prototype.bindEvents=function(){var e=this,h=this.options;this.$.resize(t.proxy(this.initSize,this)),this.$btn.hover(function(){e.$.toggleClass("hover")}).click(function(){var i=e.getData();if(e.callEvent("before",i)){var o=h.post||h.get||h.url||null;null!==o&&t.ajax({type:h.post?"POST":"GET",url:o,data:i}).done(function(t){e.callEvent("done",t)}).fail(function(t){e.callEvent("fail",t)}).always(function(t){e.callEvent("always",t)})}}),this.$controller.draggable({move:!1,container:this.$canvas,drag:function(t){e.left+=t.smallOffset.x,e.top+=t.smallOffset.y,e.refreshSize()}}),this.$controller.children(".control").draggable({move:!1,container:this.$canvas,stopPropagation:!0,drag:function(t){var o=t.element.data("direction"),s=t.smallOffset,a=!1;switch(o){case"left":case"top-left":case"bottom-left":e.left+=s.x,e.left=i.min(e.right-h.minWidth,i.max(0,e.left)),e.clipWidth=e.right-e.left;break;case"right":case"top-right":case"bottom-right":e.clipWidth+=s.x,e.clipWidth=i.min(e.width-e.left,i.max(h.minWidth,e.clipWidth))}switch(o){case"top":case"top-left":case"top-right":e.top+=s.y,e.top=i.min(e.bottom-h.minHeight,i.max(0,e.top)),e.clipHeight=e.bottom-e.top,a=!0;break;case"bottom":case"bottom-left":case"bottom-right":e.clipHeight+=s.y,e.clipHeight=i.min(e.height-e.top,i.max(h.minHeight,e.clipHeight)),a=!0}e.refreshSize(a)}})},t.fn.imgCutter=function(i){return this.each(function(){var e=t(this),s=e.data(h),a="object"==typeof i&&i;s||e.data(h,s=new o(this,a)),"string"==typeof i&&s[i]()})},t.fn.imgCutter.Constructor=o,t(function(){t('[data-toggle="imgCutter"]').imgCutter()})}(jQuery,Math,void 0); \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/imgready/.pydio b/src/resources/static/js/lib/zui/lib/imgready/.pydio new file mode 100644 index 0000000..7696127 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/imgready/.pydio @@ -0,0 +1 @@ +1e91f338-f680-4ba4-9639-abeb6097ba97 \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/imgready/imgready.js b/src/resources/static/js/lib/zui/lib/imgready/imgready.js new file mode 100644 index 0000000..9661f85 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/imgready/imgready.js @@ -0,0 +1,105 @@ +/* ======================================================================== + * TangBin: image.ready.js + * http://www.planeart.cn/?p=1121 + * + * ZUI: The file has been changed in ZUI. It will not keep update with the + * original version in the future. + * http://zui.sexy + * ======================================================================== + * @version 2011.05.27 + * @author TangBin + * ======================================================================== */ + + +/*! TangBin: image.ready.js http://www.planeart.cn/?p=1121 */ + +(function($) { + 'use strict'; + + /** + * Image ready + * @param {String} image url + * @param {Function} callback on image ready + * @param {Function} callback on image load + * @param {Function} callback on error + * @example imgReady('image.png', function () { + alert('size ready: width=' + this.width + '; height=' + this.height); + }); + */ + $.zui.imgReady = (function() { + var list = [], + intervalId = null, + + // 用来执行队列 + tick = function() { + var i = 0; + for(; i < list.length; i++) { + list[i].end ? list.splice(i--, 1) : list[i](); + }!list.length && stop(); + }, + + // 停止所有定时器队列 + stop = function() { + clearInterval(intervalId); + intervalId = null; + }; + + return function(url, ready, load, error) { + var onready, width, height, newWidth, newHeight, + img = new Image(); + + img.src = url; + + // 如果图片被缓存,则直接返回缓存数据 + if(img.complete) { + ready.call(img); + load && load.call(img); + return; + } + + width = img.width; + height = img.height; + + // 加载错误后的事件 + img.onerror = function() { + error && error.call(img); + onready.end = true; + img = img.onload = img.onerror = null; + }; + + // 图片尺寸就绪 + onready = function() { + newWidth = img.width; + newHeight = img.height; + if(newWidth !== width || newHeight !== height || + // 如果图片已经在其他地方加载可使用面积检测 + newWidth * newHeight > 1024 + ) { + ready.call(img); + onready.end = true; + } + }; + onready(); + + // 完全加载完毕的事件 + img.onload = function() { + // onload在定时器时间差范围内可能比onready快 + // 这里进行检查并保证onready优先执行 + !onready.end && onready(); + + load && load.call(img); + + // IE gif动画会循环执行onload,置空onload即可 + img = img.onload = img.onerror = null; + }; + + // 加入队列中定期执行 + if(!onready.end) { + list.push(onready); + // 无论何时只允许出现一个定时器,减少浏览器性能损耗 + if(intervalId === null) intervalId = setInterval(tick, 40); + } + }; + })(); +}(jQuery)); + diff --git a/src/resources/static/js/lib/zui/lib/imgready/imgready.min.js b/src/resources/static/js/lib/zui/lib/imgready/imgready.min.js new file mode 100644 index 0000000..1f15f04 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/imgready/imgready.min.js @@ -0,0 +1,2 @@ +/*! TangBin: image.ready.js http://www.planeart.cn/?p=1121 */ +!function(n){"use strict";n.zui.imgReady=function(){var n=[],l=null,e=function(){for(var l=0;l1024)&&(r.call(h),c.end=!0)},c(),h.onload=function(){!c.end&&c(),t&&t.call(h),h=h.onload=h.onerror=null},void(c.end||(n.push(c),null===l&&(l=setInterval(e,40)))))}}()}(jQuery); \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/jquery/.pydio b/src/resources/static/js/lib/zui/lib/jquery/.pydio new file mode 100644 index 0000000..65af6bd --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/jquery/.pydio @@ -0,0 +1 @@ +c4ef0fc4-a4fe-412d-a5c0-589a83fd1972 \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/jquery/jquery.js b/src/resources/static/js/lib/zui/lib/jquery/jquery.js new file mode 100644 index 0000000..73f33fb --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/jquery/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v1.11.0 | (c) 2005, 2014 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="".trim,l={},m="1.11.0",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!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));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||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},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:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}: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){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[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&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),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=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="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=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)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(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 mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="
      ",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(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 typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.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},z=b?function(a,b){if(a===b)return j=!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===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.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=db.selectors={cacheLength:50,createPseudo:fb,match:V,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(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===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]||db.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]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(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(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.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+" ").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(),t=!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&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&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]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)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&&(t&&((l[s]||(l[s]={}))[a]=[u,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()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(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),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?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===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.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 X.test(a.nodeName)},input:function(a){return W.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:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;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=[u,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[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(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 sb(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 tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(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?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(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 n.inArray(a,b)>=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=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},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=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.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:z,!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}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,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))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];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,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))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?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):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 E(a,b){do a=a[b];while(a&&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 E(a,"nextSibling")},prev:function(a){return E(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 n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document: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&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(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&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};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 I;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){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(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){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f +}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),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=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(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 n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;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},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML="
      a",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.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=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=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(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.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=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(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,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!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(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/\s*$/g,sb={option:[1,""],legend:[1,"
      ","
      "],area:[1,"",""],param:[1,"",""],thead:[1,"","
      "],tr:[2,"","
      "],col:[2,"","
      "],td:[3,"","
      "],_default:l.htmlSerialize?[0,"",""]:[1,"X
      ","
      "]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(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 yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?""!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(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=xb(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=xb(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(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(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(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}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 W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(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(vb(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,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.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(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}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=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("').css('width', '100%'); + self.textarea = K('').css('width', '100%'); + self.tabIndex = isNaN(parseInt(options.tabIndex, 10)) ? self.srcElement.attr('tabindex') : parseInt(options.tabIndex, 10); + self.iframe.attr('tabindex', self.tabIndex); + self.textarea.attr('tabindex', self.tabIndex); + if(self.width) { + self.setWidth(self.width); + } + if(self.height) { + self.setHeight(self.height); + } + if(self.designMode) { + self.textarea.hide(); + } else { + self.iframe.hide(); + } + + function ready() { + var doc = _iframeDoc(self.iframe); + doc.open(); + if(isDocumentDomain) { + doc.domain = document.domain; + } + doc.write(_getInitHtml(themesPath, bodyClass, cssPath, cssData)); + doc.close(); + self.win = self.iframe[0].contentWindow; + self.doc = doc; + var cmd = _cmd(doc); + self.afterChange(function(e) { + cmd.selection(); + }); + if(_WEBKIT) { + K(doc).click(function(e) { + if(K(e.target).name === 'img') { + cmd.selection(true); + cmd.range.selectNode(e.target); + cmd.select(); + } + }); + } + if(_IE) { + self._mousedownHandler = function() { + var newRange = cmd.range.cloneRange(); + newRange.shrink(); + if(newRange.isControl()) { + self.blur(); + } + }; + K(document).mousedown(self._mousedownHandler); + K(doc).keydown(function(e) { + if(e.which == 8) { + cmd.selection(); + var rng = cmd.range; + if(rng.isControl()) { + rng.collapse(true); + K(rng.startContainer.childNodes[rng.startOffset]).remove(); + e.preventDefault(); + } + } + }); + } + self.cmd = cmd; + self.html(_elementVal(self.srcElement)); + if(_IE) { + doc.body.disabled = true; + doc.body.contentEditable = true; + doc.body.removeAttribute('disabled'); + } else { + doc.designMode = 'on'; + } + if(options.afterCreate) { + options.afterCreate.call(self); + } + } + if(isDocumentDomain) { + self.iframe.bind('load', function(e) { + self.iframe.unbind('load'); + if(_IE) { + ready(); + } else { + setTimeout(ready, 0); + } + }); + } + self.div.append(self.iframe); + self.div.append(self.textarea); + self.srcElement.hide(); + !isDocumentDomain && ready(); + }, + setWidth: function(val) { + this.div.css('width', _addUnit(val)); + return this; + }, + setHeight: function(val) { + var self = this; + val = _addUnit(val); + self.div.css('height', val); + self.iframe.css('height', val); + if((_IE && _V < 8) || _QUIRKS) { + val = _addUnit(_removeUnit(val) - 2); + } + self.textarea.css('height', val); + return self; + }, + remove: function() { + var self = this, + doc = self.doc; + K(doc.body).unbind(); + K(doc).unbind(); + K(self.win).unbind(); + if(self._mousedownHandler) { + K(document).unbind('mousedown', self._mousedownHandler); + } + _elementVal(self.srcElement, self.html()); + self.srcElement.show(); + doc.write(''); + self.iframe.unbind(); + self.textarea.unbind(); + KEdit.parent.remove.call(self); + }, + html: function(val, isFull) { + var self = this, + doc = self.doc; + if(self.designMode) { + var body = doc.body; + if(val === undefined) { + if(isFull) { + val = '' + body.parentNode.innerHTML + ''; + } else { + val = body.innerHTML; + } + if(self.beforeGetHtml) { + val = self.beforeGetHtml(val); + } + if(_GECKO && val == '
      ') { + val = ''; + } + return val; + } + if(self.beforeSetHtml) { + val = self.beforeSetHtml(val); + } + if(_IE && _V >= 9) { + val = val.replace(/(<.*?checked=")checked(".*>)/ig, '$1$2'); + } + K(body).html(val); + if(self.afterSetHtml) { + self.afterSetHtml(); + } + return self; + } + if(val === undefined) { + return self.textarea.val(); + } + self.textarea.val(val); + return self; + }, + design: function(bool) { + var self = this, + val; + if(bool === undefined ? !self.designMode : bool) { + if(!self.designMode) { + val = self.html(); + self.designMode = true; + self.html(val); + self.textarea.hide(); + self.iframe.show(); + } + } else { + if(self.designMode) { + val = self.html(); + self.designMode = false; + self.html(val); + self.iframe.hide(); + self.textarea.show(); + } + } + return self.focus(); + }, + focus: function() { + var self = this; + self.designMode ? self.win.focus() : self.textarea[0].focus(); + return self; + }, + blur: function() { + var self = this; + if(_IE) { + var input = K('', self.div); + self.div.append(input); + input[0].focus(); + input.remove(); + } else { + self.designMode ? self.win.blur() : self.textarea[0].blur(); + } + return self; + }, + afterChange: function(fn) { + var self = this, + doc = self.doc, + body = doc.body; + K(doc).keyup(function(e) { + if(!e.ctrlKey && !e.altKey && _CHANGE_KEY_MAP[e.which]) { + fn(e); + } + }); + K(doc).mouseup(fn).contextmenu(fn); + K(self.win).blur(fn); + + function timeoutHandler(e) { + setTimeout(function() { + fn(e); + }, 1); + } + K(body).bind('paste', timeoutHandler); + K(body).bind('cut', timeoutHandler); + return self; + } + }); + + function _edit(options) { + return new KEdit(options); + } + K.EditClass = KEdit; + K.edit = _edit; + K.iframeDoc = _iframeDoc; + + function _selectToolbar(name, fn) { + var self = this, + knode = self.get(name); + if(knode) { + if(knode.hasClass('ke-disabled')) { + return; + } + fn(knode); + } + } + + function KToolbar(options) { + this.init(options); + } + _extend(KToolbar, KWidget, { + init: function(options) { + var self = this; + KToolbar.parent.init.call(self, options); + self.disableMode = _undef(options.disableMode, false); + self.noDisableItemMap = _toMap(_undef(options.noDisableItems, [])); + self._itemMap = {}; + self.div.addClass('ke-toolbar').bind('contextmenu,mousedown,mousemove', function(e) { + e.preventDefault(); + }).attr('unselectable', 'on'); + + function find(target) { + var knode = K(target); + if(knode.hasClass('ke-outline')) { + return knode; + } + if(knode.hasClass('ke-toolbar-icon')) { + return knode.parent(); + } + } + + function hover(e, method) { + var knode = find(e.target); + if(knode) { + if(knode.hasClass('ke-disabled')) { + return; + } + if(knode.hasClass('ke-selected')) { + return; + } + knode[method]('ke-on'); + } + } + self.div.mouseover(function(e) { + hover(e, 'addClass'); + }) + .mouseout(function(e) { + hover(e, 'removeClass'); + }) + .click(function(e) { + var knode = find(e.target); + if(knode) { + if(knode.hasClass('ke-disabled')) { + return; + } + self.options.click.call(this, e, knode.attr('data-name')); + } + }); + }, + get: function(name) { + if(this._itemMap[name]) { + return this._itemMap[name]; + } + return(this._itemMap[name] = K('span.ke-icon-' + name, this.div).parent()); + }, + select: function(name) { + _selectToolbar.call(this, name, function(knode) { + knode.addClass('ke-selected'); + }); + return self; + }, + unselect: function(name) { + _selectToolbar.call(this, name, function(knode) { + knode.removeClass('ke-selected').removeClass('ke-on'); + }); + return self; + }, + enable: function(name) { + var self = this, + knode = name.get ? name : self.get(name); + if(knode) { + knode.removeClass('ke-disabled'); + knode.opacity(1); + } + return self; + }, + disable: function(name) { + var self = this, + knode = name.get ? name : self.get(name); + if(knode) { + knode.removeClass('ke-selected').addClass('ke-disabled'); + knode.opacity(0.5); + } + return self; + }, + disableAll: function(bool, noDisableItems) { + var self = this, + map = self.noDisableItemMap, + item; + if(noDisableItems) { + map = _toMap(noDisableItems); + } + if(bool === undefined ? !self.disableMode : bool) { + K('span.ke-outline', self.div).each(function() { + var knode = K(this), + name = knode[0].getAttribute('data-name', 2); + if(!map[name]) { + self.disable(knode); + } + }); + self.disableMode = true; + } else { + K('span.ke-outline', self.div).each(function() { + var knode = K(this), + name = knode[0].getAttribute('data-name', 2); + if(!map[name]) { + self.enable(knode); + } + }); + self.disableMode = false; + } + return self; + } + }); + + function _toolbar(options) { + return new KToolbar(options); + } + K.ToolbarClass = KToolbar; + K.toolbar = _toolbar; + + function KMenu(options) { + this.init(options); + } + _extend(KMenu, KWidget, { + init: function(options) { + var self = this; + options.z = options.z || 811213; + KMenu.parent.init.call(self, options); + self.centerLineMode = _undef(options.centerLineMode, true); + self.div.addClass('ke-menu').bind('click,mousedown', function(e) { + e.stopPropagation(); + }).attr('unselectable', 'on'); + }, + addItem: function(item) { + var self = this; + if(item.title === '-') { + self.div.append(K('
      ')); + return; + } + var itemDiv = K('
      '), + leftDiv = K('
      '), + rightDiv = K('
      '), + height = _addUnit(item.height), + iconClass = _undef(item.iconClass, ''); + self.div.append(itemDiv); + if(height) { + itemDiv.css('height', height); + rightDiv.css('line-height', height); + } + var centerDiv; + if(self.centerLineMode) { + centerDiv = K('
      '); + if(height) { + centerDiv.css('height', height); + } + } + itemDiv.mouseover(function(e) { + K(this).addClass('ke-menu-item-on'); + if(centerDiv) { + centerDiv.addClass('ke-menu-item-center-on'); + } + }) + .mouseout(function(e) { + K(this).removeClass('ke-menu-item-on'); + if(centerDiv) { + centerDiv.removeClass('ke-menu-item-center-on'); + } + }) + .click(function(e) { + item.click.call(K(this)); + e.stopPropagation(); + }) + .append(leftDiv); + if(centerDiv) { + itemDiv.append(centerDiv); + } + itemDiv.append(rightDiv); + if(item.checked) { + iconClass = 'ke-icon-checked'; + } + if(iconClass !== '') { + leftDiv.html(''); + } + rightDiv.html(item.title); + return self; + }, + remove: function() { + var self = this; + if(self.options.beforeRemove) { + self.options.beforeRemove.call(self); + } + K('.ke-menu-item', self.div[0]).unbind(); + KMenu.parent.remove.call(self); + return self; + } + }); + + function _menu(options) { + return new KMenu(options); + } + K.MenuClass = KMenu; + K.menu = _menu; + + function KColorPicker(options) { + this.init(options); + } + _extend(KColorPicker, KWidget, { + init: function(options) { + var self = this; + options.z = options.z || 811213; + KColorPicker.parent.init.call(self, options); + var colors = options.colors || [ + ['#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'], + ['#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'], + ['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'], + ['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000'] + ]; + self.selectedColor = (options.selectedColor || '').toLowerCase(); + self._cells = []; + self.div.addClass('ke-colorpicker').bind('click,mousedown', function(e) { + e.stopPropagation(); + }).attr('unselectable', 'on'); + var table = self.doc.createElement('table'); + self.div.append(table); + table.className = 'ke-colorpicker-table'; + table.cellPadding = 0; + table.cellSpacing = 0; + table.border = 0; + var row = table.insertRow(0), + cell = row.insertCell(0); + cell.colSpan = colors[0].length; + self._addAttr(cell, '', 'ke-colorpicker-cell-top'); + for(var i = 0; i < colors.length; i++) { + row = table.insertRow(i + 1); + for(var j = 0; j < colors[i].length; j++) { + cell = row.insertCell(j); + self._addAttr(cell, colors[i][j], 'ke-colorpicker-cell'); + } + } + }, + _addAttr: function(cell, color, cls) { + var self = this; + cell = K(cell).addClass(cls); + if(self.selectedColor === color.toLowerCase()) { + cell.addClass('ke-colorpicker-cell-selected'); + } + cell.attr('title', color || self.options.noColor); + cell.mouseover(function(e) { + K(this).addClass('ke-colorpicker-cell-on'); + }); + cell.mouseout(function(e) { + K(this).removeClass('ke-colorpicker-cell-on'); + }); + cell.click(function(e) { + e.stop(); + self.options.click.call(K(this), color); + }); + if(color) { + cell.append(K('
      ').css('background-color', color)); + } else { + cell.html(self.options.noColor); + } + K(cell).attr('unselectable', 'on'); + self._cells.push(cell); + }, + remove: function() { + var self = this; + _each(self._cells, function() { + this.unbind(); + }); + KColorPicker.parent.remove.call(self); + return self; + } + }); + + function _colorpicker(options) { + return new KColorPicker(options); + } + K.ColorPickerClass = KColorPicker; + K.colorpicker = _colorpicker; + + function KUploadButton(options) { + this.init(options); + } + _extend(KUploadButton, { + init: function(options) { + var self = this, + button = K(options.button), + fieldName = options.fieldName || 'file', + url = options.url || '', + title = button.val(), + extraParams = options.extraParams || {}, + cls = button[0].className || '', + target = options.target || 'kindeditor_upload_iframe_' + new Date().getTime(); + options.afterError = options.afterError || function(str) { + alert(str); + }; + var hiddenElements = []; + for(var k in extraParams) { + hiddenElements.push(''); + } + var html = [ + '
      ', (options.target ? '' : ''), (options.form ? '
      ' : '
      '), + '', + hiddenElements.join(''), + '', + '', + '', (options.form ? '
      ' : ''), + '
      ' + ].join(''); + var div = K(html, button.doc); + button.hide(); + button.before(div); + self.div = div; + self.button = button; + self.iframe = options.target ? K('iframe[name="' + target + '"]') : K('iframe', div); + self.form = options.form ? K(options.form) : K('form', div); + self.fileBox = K('.ke-upload-file', div); + self.options = options; + }, + submit: function() { + var self = this, + iframe = self.iframe; + iframe.bind('load', function() { + iframe.unbind(); + var tempForm = document.createElement('form'); + self.fileBox.before(tempForm); + K(tempForm).append(self.fileBox); + tempForm.reset(); + K(tempForm).remove(true); + var doc = K.iframeDoc(iframe), + pre = doc.getElementsByTagName('pre')[0], + str = '', + data; + if(pre) { + str = pre.innerHTML; + } else { + str = doc.body.innerHTML; + } + str = _unescape(str); + iframe[0].src = 'javascript:false'; + try { + data = K.json(str); + } catch(e) { + self.options.afterError.call(self, '' + doc.body.parentNode.innerHTML + ''); + } + if(data) { + self.options.afterUpload.call(self, data); + } + }); + self.form[0].submit(); + return self; + }, + remove: function() { + var self = this; + if(self.fileBox) { + self.fileBox.unbind(); + } + self.iframe.remove(); + self.div.remove(); + self.button.show(); + return self; + } + }); + + function _uploadbutton(options) { + return new KUploadButton(options); + } + K.UploadButtonClass = KUploadButton; + K.uploadbutton = _uploadbutton; + + function _createButton(arg) { + arg = arg || {}; + var name = arg.name || '', + span = K(''), + btn = K(''); + if(arg.click) { + btn.click(arg.click); + } + span.append(btn); + return span; + } + + function KDialog(options) { + this.init(options); + } + _extend(KDialog, KWidget, { + init: function(options) { + var self = this; + var shadowMode = _undef(options.shadowMode, true); + options.z = options.z || 811213; + options.shadowMode = false; + options.autoScroll = _undef(options.autoScroll, true); + KDialog.parent.init.call(self, options); + var title = options.title, + body = K(options.body, self.doc), + previewBtn = options.previewBtn, + yesBtn = options.yesBtn, + noBtn = options.noBtn, + closeBtn = options.closeBtn, + showMask = _undef(options.showMask, true); + self.div.addClass('ke-dialog').bind('click,mousedown', function(e) { + e.stopPropagation(); + }); + var contentDiv = K('
      ').appendTo(self.div); + if(_IE && _V < 7) { + self.iframeMask = K('').appendTo(self.div); + } else if(shadowMode) { + K('
      ').appendTo(self.div); + } + var headerDiv = K('
      '); + contentDiv.append(headerDiv); + headerDiv.html(title); + self.closeIcon = K('').click(closeBtn.click); + headerDiv.append(self.closeIcon); + self.draggable({ + clickEl: headerDiv, + beforeDrag: options.beforeDrag + }); + var bodyDiv = K('
      '); + contentDiv.append(bodyDiv); + bodyDiv.append(body); + var footerDiv = K(''); + if(previewBtn || yesBtn || noBtn) { + contentDiv.append(footerDiv); + } + _each([{ + btn: previewBtn, + name: 'preview' + }, { + btn: yesBtn, + name: 'yes' + }, { + btn: noBtn, + name: 'no' + }], function() { + if(this.btn) { + var button = _createButton(this.btn); + button.addClass('ke-dialog-' + this.name); + footerDiv.append(button); + } + }); + if(self.height) { + bodyDiv.height(_removeUnit(self.height) - headerDiv.height() - footerDiv.height()); + } + self.div.width(self.div.width()); + self.div.height(self.div.height()); + self.mask = null; + if(showMask) { + var docEl = _docElement(self.doc), + docWidth = Math.max(docEl.scrollWidth, docEl.clientWidth), + docHeight = Math.max(docEl.scrollHeight, docEl.clientHeight); + self.mask = _widget({ + x: 0, + y: 0, + z: self.z - 1, + cls: 'ke-dialog-mask', + width: docWidth, + height: docHeight + }); + } + self.autoPos(self.div.width(), self.div.height()); + self.footerDiv = footerDiv; + self.bodyDiv = bodyDiv; + self.headerDiv = headerDiv; + self.isLoading = false; + }, + setMaskIndex: function(z) { + var self = this; + self.mask.div.css('z-index', z); + }, + showLoading: function(msg) { + msg = _undef(msg, ''); + var self = this, + body = self.bodyDiv; + self.loading = K('
      ' + msg + '
      ') + .width(body.width()).height(body.height()) + .css('top', self.headerDiv.height() + 'px'); + body.css('visibility', 'hidden').after(self.loading); + self.isLoading = true; + return self; + }, + hideLoading: function() { + this.loading && this.loading.remove(); + this.bodyDiv.css('visibility', 'visible'); + this.isLoading = false; + return this; + }, + remove: function() { + var self = this; + if(self.options.beforeRemove) { + self.options.beforeRemove.call(self); + } + self.mask && self.mask.remove(); + self.iframeMask && self.iframeMask.remove(); + self.closeIcon.unbind(); + K('input', self.div).unbind(); + K('button', self.div).unbind(); + self.footerDiv.unbind(); + self.bodyDiv.unbind(); + self.headerDiv.unbind(); + K('iframe', self.div).each(function() { + K(this).remove(); + }); + KDialog.parent.remove.call(self); + return self; + } + }); + + function _dialog(options) { + return new KDialog(options); + } + K.DialogClass = KDialog; + K.dialog = _dialog; + + function _tabs(options) { + var self = _widget(options), + remove = self.remove, + afterSelect = options.afterSelect, + div = self.div, + liList = []; + div.addClass('ke-tabs') + .bind('contextmenu,mousedown,mousemove', function(e) { + e.preventDefault(); + }); + var ul = K('
        '); + div.append(ul); + self.add = function(tab) { + var li = K('
      • ' + tab.title + '
      • '); + li.data('tab', tab); + liList.push(li); + ul.append(li); + }; + self.selectedIndex = 0; + self.select = function(index) { + self.selectedIndex = index; + _each(liList, function(i, li) { + li.unbind(); + if(i === index) { + li.addClass('ke-tabs-li-selected'); + K(li.data('tab').panel).show(''); + } else { + li.removeClass('ke-tabs-li-selected').removeClass('ke-tabs-li-on') + .mouseover(function() { + K(this).addClass('ke-tabs-li-on'); + }) + .mouseout(function() { + K(this).removeClass('ke-tabs-li-on'); + }) + .click(function() { + self.select(i); + }); + K(li.data('tab').panel).hide(); + } + }); + if(afterSelect) { + afterSelect.call(self, index); + } + }; + self.remove = function() { + _each(liList, function() { + this.remove(); + }); + ul.remove(); + remove.call(self); + }; + return self; + } + K.tabs = _tabs; + + function _loadScript(url, fn) { + var head = document.getElementsByTagName('head')[0] || (_QUIRKS ? document.body : document.documentElement), + script = document.createElement('script'); + head.appendChild(script); + script.src = url; + script.charset = 'utf-8'; + script.onload = script.onreadystatechange = function() { + if(!this.readyState || this.readyState === 'loaded') { + if(fn) { + fn(); + } + script.onload = script.onreadystatechange = null; + head.removeChild(script); + } + }; + } + + function _chopQuery(url) { + var index = url.indexOf('?'); + return index > 0 ? url.substr(0, index) : url; + } + + function _loadStyle(url) { + var head = document.getElementsByTagName('head')[0] || (_QUIRKS ? document.body : document.documentElement), + link = document.createElement('link'), + absoluteUrl = _chopQuery(_formatUrl(url, 'absolute')); + var links = K('link[rel="stylesheet"]', head); + for(var i = 0, len = links.length; i < len; i++) { + if(_chopQuery(_formatUrl(links[i].href, 'absolute')) === absoluteUrl) { + return; + } + } + head.appendChild(link); + link.href = url; + link.rel = 'stylesheet'; + } + + function _ajax(url, fn, method, param, dataType) { + method = method || 'GET'; + dataType = dataType || 'json'; + var xhr = window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); + xhr.open(method, url, true); + xhr.onreadystatechange = function() { + if(xhr.readyState == 4 && xhr.status == 200) { + if(fn) { + var data = _trim(xhr.responseText); + if(dataType == 'json') { + data = _json(data); + } + fn(data); + } + } + }; + if(method == 'POST') { + var params = []; + _each(param, function(key, val) { + params.push(encodeURIComponent(key) + '=' + encodeURIComponent(val)); + }); + try { + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + } catch(e) {} + xhr.send(params.join('&')); + } else { + xhr.send(null); + } + } + K.loadScript = _loadScript; + K.loadStyle = _loadStyle; + K.ajax = _ajax; + var _plugins = {}; + + function _plugin(name, fn) { + if(name === undefined) { + return _plugins; + } + if(!fn) { + return _plugins[name]; + } + _plugins[name] = fn; + } + var _language = {}; + + function _parseLangKey(key) { + var match, ns = 'core'; + if((match = /^(\w+)\.(\w+)$/.exec(key))) { + ns = match[1]; + key = match[2]; + } + return { + ns: ns, + key: key + }; + } + + function _lang(mixed, langType) { + langType = langType === undefined ? K.options.langType : langType; + if(typeof mixed === 'string') { + if(!_language[langType]) { + return 'no language'; + } + var pos = mixed.length - 1; + if(mixed.substr(pos) === '.') { + return _language[langType][mixed.substr(0, pos)]; + } + var obj = _parseLangKey(mixed); + return _language[langType][obj.ns][obj.key]; + } + _each(mixed, function(key, val) { + var obj = _parseLangKey(key); + if(!_language[langType]) { + _language[langType] = {}; + } + if(!_language[langType][obj.ns]) { + _language[langType][obj.ns] = {}; + } + _language[langType][obj.ns][obj.key] = val; + }); + } + + function _getImageFromRange(range, fn) { + if(range.collapsed) { + return; + } + range = range.cloneRange().up(); + var sc = range.startContainer, + so = range.startOffset; + if(!_WEBKIT && !range.isControl()) { + return; + } + var img = K(sc.childNodes[so]); + if(!img || img.name != 'img') { + return; + } + if(fn(img)) { + return img; + } + } + + function _bindContextmenuEvent() { + var self = this, + doc = self.edit.doc; + K(doc).contextmenu(function(e) { + if(self.menu) { + self.hideMenu(); + } + if(!self.useContextmenu) { + e.preventDefault(); + return; + } + if(self._contextmenus.length === 0) { + return; + } + var maxWidth = 0, + items = []; + _each(self._contextmenus, function() { + if(this.title == '-') { + items.push(this); + return; + } + if(this.cond && this.cond()) { + items.push(this); + if(this.width && this.width > maxWidth) { + maxWidth = this.width; + } + } + }); + while(items.length > 0 && items[0].title == '-') { + items.shift(); + } + while(items.length > 0 && items[items.length - 1].title == '-') { + items.pop(); + } + var prevItem = null; + _each(items, function(i) { + if(this.title == '-' && prevItem.title == '-') { + delete items[i]; + } + prevItem = this; + }); + if(items.length > 0) { + e.preventDefault(); + var pos = K(self.edit.iframe).pos(), + menu = _menu({ + x: pos.x + e.clientX, + y: pos.y + e.clientY, + width: maxWidth, + css: { + visibility: 'hidden' + }, + shadowMode: self.shadowMode + }); + _each(items, function() { + if(this.title) { + menu.addItem(this); + } + }); + var docEl = _docElement(menu.doc), + menuHeight = menu.div.height(); + if(e.clientY + menuHeight >= docEl.clientHeight - 100) { + menu.pos(menu.x, _removeUnit(menu.y) - menuHeight); + } + menu.div.css('visibility', 'visible'); + self.menu = menu; + } + }); + } + + function _bindNewlineEvent() { + var self = this, + doc = self.edit.doc, + newlineTag = self.newlineTag; + if(_IE && newlineTag !== 'br') { + return; + } + if(_GECKO && _V < 3 && newlineTag !== 'p') { + return; + } + if(_OPERA && _V < 9) { + return; + } + var brSkipTagMap = _toMap('h1,h2,h3,h4,h5,h6,pre,li'), + pSkipTagMap = _toMap('p,h1,h2,h3,h4,h5,h6,pre,li,blockquote'); + + function getAncestorTagName(range) { + var ancestor = K(range.commonAncestor()); + while(ancestor) { + if(ancestor.type == 1 && !ancestor.isStyle()) { + break; + } + ancestor = ancestor.parent(); + } + return ancestor.name; + } + K(doc).keydown(function(e) { + if(e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) { + return; + } + self.cmd.selection(); + var tagName = getAncestorTagName(self.cmd.range); + if(tagName == 'marquee' || tagName == 'select') { + return; + } + if(newlineTag === 'br' && !brSkipTagMap[tagName]) { + e.preventDefault(); + self.insertHtml('
        ' + (_IE && _V < 9 ? '' : '\u200B')); + return; + } + if(!pSkipTagMap[tagName]) { + _nativeCommand(doc, 'formatblock', '

        '); + } + }); + K(doc).keyup(function(e) { + if(e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) { + return; + } + if(newlineTag == 'br') { + return; + } + if(_GECKO) { + var root = self.cmd.commonAncestor('p'); + var a = self.cmd.commonAncestor('a'); + if(a && a.text() == '') { + a.remove(true); + self.cmd.range.selectNodeContents(root[0]).collapse(true); + self.cmd.select(); + } + return; + } + self.cmd.selection(); + var tagName = getAncestorTagName(self.cmd.range); + if(tagName == 'marquee' || tagName == 'select') { + return; + } + if(!pSkipTagMap[tagName]) { + _nativeCommand(doc, 'formatblock', '

        '); + } + + // see fix: [Chrome] 在 Chrome 上添加标题之后换行 JS 报错 https://github.com/kindsoft/kindeditor/commit/6e2d34e740e76c597cc56f99706d5dc706ed6e6a + // var div = self.cmd.commonAncestor('div'); + // if(div) { + // var p = K('

        '), + // child = div[0].firstChild; + // while(child) { + // var next = child.nextSibling; + // p.append(child); + // child = next; + // } + // div.before(p); + // div.remove(); + // self.cmd.range.selectNodeContents(p[0]); + // self.cmd.select(); + // } + }); + } + + function _bindTabEvent() { + var self = this, + doc = self.edit.doc; + K(doc).keydown(function(e) { + if(e.which == 9) { + e.preventDefault(); + if(self.afterTab) { + var tabResult = self.afterTab.call(self, e); + // 如果 afterTab 回调函数返回值为 true,则视为已经处理 tab 键操作,否则继续执行原始 tab 操作 + if (tabResult === true) return; + } + var cmd = self.cmd, + range = cmd.range; + range.shrink(); + if(range.collapsed && range.startContainer.nodeType == 1) { + range.insertNode(K('@ ', doc)[0]); + cmd.select(); + } + self.insertHtml('    '); + } + }); + } + + function _bindFocusEvent() { + var self = this; + K(self.edit.textarea[0], self.edit.win).focus(function(e) { + if(self.afterFocus) { + self.afterFocus.call(self, e); + } + }).blur(function(e) { + if(self.afterBlur) { + self.afterBlur.call(self, e); + } + }); + } + + function _removeBookmarkTag(html) { + return _trim(html.replace(/]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/ig, '')); + } + + function _removeTempTag(html) { + return html.replace(/]+class="?__kindeditor_paste__"?[^>]*>[\s\S]*?<\/div>/ig, ''); + } + + function _addBookmarkToStack(stack, bookmark) { + if(stack.length === 0) { + stack.push(bookmark); + return; + } + var prev = stack[stack.length - 1]; + if(_removeBookmarkTag(bookmark.html) !== _removeBookmarkTag(prev.html)) { + stack.push(bookmark); + } + } + + function _undoToRedo(fromStack, toStack) { + var self = this, + edit = self.edit, + body = edit.doc.body, + range, bookmark; + if(fromStack.length === 0) { + return self; + } + if(edit.designMode) { + range = self.cmd.range; + bookmark = range.createBookmark(true); + bookmark.html = body.innerHTML; + } else { + bookmark = { + html: body.innerHTML + }; + } + _addBookmarkToStack(toStack, bookmark); + var prev = fromStack.pop(); + if(_removeBookmarkTag(bookmark.html) === _removeBookmarkTag(prev.html) && fromStack.length > 0) { + prev = fromStack.pop(); + } + if(edit.designMode) { + edit.html(prev.html); + if(prev.start) { + range.moveToBookmark(prev); + self.select(); + } + } else { + K(body).html(_removeBookmarkTag(prev.html)); + } + return self; + } + + function KEditor(options) { + var self = this; + self.options = {}; + + function setOption(key, val) { + if(KEditor.prototype[key] === undefined) { + self[key] = val; + } + self.options[key] = val; + } + _each(options, function(key, val) { + setOption(key, options[key]); + }); + _each(K.options, function(key, val) { + if(self[key] === undefined) { + setOption(key, val); + } + }); + var se = K(self.srcElement || '', + '' + ].join(''), + dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var type = K('.ke-code-type', dialog.div).val(), + code = textarea.val(), + cls = type === '' ? '' : ' lang-' + type, + html = '
        \n' + K.escape(code) + '
        '; + if(K.trim(code) === '') { + alert(lang.pleaseInput); + textarea[0].focus(); + return; + } + self.insertHtml(html).hideDialog().focus(); + } + } + }), + textarea = K('textarea', dialog.div); + textarea[0].focus(); + }); +}); +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('emoticons', function(K) { + var self = this, + name = 'emoticons', + path = (self.emoticonsPath || self.pluginsPath + 'emoticons/images/'), + allowPreview = self.allowPreviewEmoticons === undefined ? true : self.allowPreviewEmoticons, + currentPageNum = 1; + self.clickToolbar(name, function() { + var rows = 5, + cols = 9, + total = 135, + startNum = 0, + cells = rows * cols, + pages = Math.ceil(total / cells), + colsHalf = Math.floor(cols / 2), + wrapperDiv = K('
        '), + elements = [], + menu = self.createMenu({ + name: name, + beforeRemove: function() { + removeEvent(); + } + }); + menu.div.append(wrapperDiv); + var previewDiv, previewImg; + if(allowPreview) { + previewDiv = K('
        ').css('right', 0); + previewImg = K(''); + wrapperDiv.append(previewDiv); + previewDiv.append(previewImg); + } + + function bindCellEvent(cell, j, num) { + if(previewDiv) { + cell.mouseover(function() { + if(j > colsHalf) { + previewDiv.css('left', 0); + previewDiv.css('right', ''); + } else { + previewDiv.css('left', ''); + previewDiv.css('right', 0); + } + previewImg.attr('src', path + num + '.gif'); + K(this).addClass('ke-on'); + }); + } else { + cell.mouseover(function() { + K(this).addClass('ke-on'); + }); + } + cell.mouseout(function() { + K(this).removeClass('ke-on'); + }); + cell.click(function(e) { + self.insertHtml('').hideMenu().focus(); + e.stop(); + }); + } + + function createEmoticonsTable(pageNum, parentDiv) { + var table = document.createElement('table'); + parentDiv.append(table); + if(previewDiv) { + K(table).mouseover(function() { + previewDiv.show('block'); + }); + K(table).mouseout(function() { + previewDiv.hide(); + }); + elements.push(K(table)); + } + table.className = 'ke-table'; + table.cellPadding = 0; + table.cellSpacing = 0; + table.border = 0; + var num = (pageNum - 1) * cells + startNum; + for(var i = 0; i < rows; i++) { + var row = table.insertRow(i); + for(var j = 0; j < cols; j++) { + var cell = K(row.insertCell(j)); + cell.addClass('ke-cell'); + bindCellEvent(cell, j, num); + var span = K('') + .css('background-position', '-' + (24 * num) + 'px 0px') + .css('background-image', 'url(' + path + 'static.gif)'); + cell.append(span); + elements.push(cell); + num++; + } + } + return table; + } + var table = createEmoticonsTable(currentPageNum, wrapperDiv); + + function removeEvent() { + K.each(elements, function() { + this.unbind(); + }); + } + var pageDiv; + + function bindPageEvent(el, pageNum) { + el.click(function(e) { + removeEvent(); + table.parentNode.removeChild(table); + pageDiv.remove(); + table = createEmoticonsTable(pageNum, wrapperDiv); + createPageTable(pageNum); + currentPageNum = pageNum; + e.stop(); + }); + } + + function createPageTable(currentPageNum) { + pageDiv = K('
        '); + wrapperDiv.append(pageDiv); + for(var pageNum = 1; pageNum <= pages; pageNum++) { + if(currentPageNum !== pageNum) { + var a = K('[' + pageNum + ']'); + bindPageEvent(a, pageNum); + pageDiv.append(a); + elements.push(a); + } else { + pageDiv.append(K('@[' + pageNum + ']')); + } + pageDiv.append(K('@ ')); + } + } + createPageTable(currentPageNum); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('filemanager', function(K) { + var self = this, + name = 'filemanager', + fileManagerJson = K.undef(self.fileManagerJson, self.basePath + 'php/file_manager_json.php'), + imgPath = self.pluginsPath + name + '/images/', + lang = self.lang(name + '.'); + + function makeFileTitle(filename, filesize, datetime) { + return filename + ' (' + Math.ceil(filesize / 1024) + 'KB, ' + datetime + ')'; + } + + function bindTitle(el, data) { + if(data.is_dir) { + el.attr('title', data.filename); + } else { + el.attr('title', makeFileTitle(data.filename, data.filesize, data.datetime)); + } + } + self.plugin.filemanagerDialog = function(options) { + var width = K.undef(options.width, 650), + height = K.undef(options.height, 510), + dirName = K.undef(options.dirName, ''), + viewType = K.undef(options.viewType, 'VIEW').toUpperCase(), // "LIST" or "VIEW" + clickFn = options.clickFn; + var html = [ + '
        ', + // header start + '
        ', + // left start + '
        ', + ' ', + '' + lang.moveup + '', + '
        ', + // right start + '
        ', + lang.viewType + ' ', + lang.orderType + ' ', + '
        ', + '
        ', + '
        ', + // body start + '
        ', + '
        ' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: width, + height: height, + title: self.lang(name), + body: html + }), + div = dialog.div, + bodyDiv = K('.ke-plugin-filemanager-body', div), + moveupImg = K('[name="moveupImg"]', div), + moveupLink = K('[name="moveupLink"]', div), + viewServerBtn = K('[name="viewServer"]', div), + viewTypeBox = K('[name="viewType"]', div), + orderTypeBox = K('[name="orderType"]', div); + + function reloadPage(path, order, func) { + var param = 'path=' + path + '&order=' + order + '&dir=' + dirName; + dialog.showLoading(self.lang('ajaxLoading')); + K.ajax(K.addParam(fileManagerJson, param + '&' + new Date().getTime()), function(data) { + dialog.hideLoading(); + func(data); + }); + } + var elList = []; + + function bindEvent(el, result, data, createFunc) { + var fileUrl = K.formatUrl(result.current_url + data.filename, 'absolute'), + dirPath = encodeURIComponent(result.current_dir_path + data.filename + '/'); + if(data.is_dir) { + el.click(function(e) { + reloadPage(dirPath, orderTypeBox.val(), createFunc); + }); + } else if(data.is_photo) { + el.click(function(e) { + clickFn.call(this, fileUrl, data.filename); + }); + } else { + el.click(function(e) { + clickFn.call(this, fileUrl, data.filename); + }); + } + elList.push(el); + } + + function createCommon(result, createFunc) { + // remove events + K.each(elList, function() { + this.unbind(); + }); + moveupLink.unbind(); + viewTypeBox.unbind(); + orderTypeBox.unbind(); + // add events + if(result.current_dir_path) { + moveupLink.click(function(e) { + reloadPage(result.moveup_dir_path, orderTypeBox.val(), createFunc); + }); + } + + function changeFunc() { + if(viewTypeBox.val() == 'VIEW') { + reloadPage(result.current_dir_path, orderTypeBox.val(), createView); + } else { + reloadPage(result.current_dir_path, orderTypeBox.val(), createList); + } + } + viewTypeBox.change(changeFunc); + orderTypeBox.change(changeFunc); + bodyDiv.html(''); + } + + function createList(result) { + createCommon(result, createList); + var table = document.createElement('table'); + table.className = 'ke-table'; + table.cellPadding = 0; + table.cellSpacing = 0; + table.border = 0; + bodyDiv.append(table); + var fileList = result.file_list; + for(var i = 0, len = fileList.length; i < len; i++) { + var data = fileList[i], + row = K(table.insertRow(i)); + row.mouseover(function(e) { + K(this).addClass('ke-on'); + }) + .mouseout(function(e) { + K(this).removeClass('ke-on'); + }); + var iconUrl = imgPath + (data.is_dir ? 'folder-16.gif' : 'file-16.gif'), + img = K('' + data.filename + ''), + cell0 = K(row[0].insertCell(0)).addClass('ke-cell ke-name').append(img).append(document.createTextNode(' ' + data.filename)); + if(!data.is_dir || data.has_file) { + row.css('cursor', 'pointer'); + cell0.attr('title', data.filename); + bindEvent(cell0, result, data, createList); + } else { + cell0.attr('title', lang.emptyFolder); + } + K(row[0].insertCell(1)).addClass('ke-cell ke-size').html(data.is_dir ? '-' : Math.ceil(data.filesize / 1024) + 'KB'); + K(row[0].insertCell(2)).addClass('ke-cell ke-datetime').html(data.datetime); + } + } + + function createView(result) { + createCommon(result, createView); + var fileList = result.file_list; + for(var i = 0, len = fileList.length; i < len; i++) { + var data = fileList[i], + div = K('
        '); + bodyDiv.append(div); + var photoDiv = K('
        ') + .mouseover(function(e) { + K(this).addClass('ke-on'); + }) + .mouseout(function(e) { + K(this).removeClass('ke-on'); + }); + div.append(photoDiv); + var fileUrl = result.current_url + data.filename, + iconUrl = data.is_dir ? imgPath + 'folder-64.gif' : (data.is_photo ? fileUrl : imgPath + 'file-64.gif'); + var img = K('' + data.filename + ''); + if(!data.is_dir || data.has_file) { + photoDiv.css('cursor', 'pointer'); + bindTitle(photoDiv, data); + bindEvent(photoDiv, result, data, createView); + } else { + photoDiv.attr('title', lang.emptyFolder); + } + photoDiv.append(img); + div.append('
        ' + data.filename + '
        '); + } + } + viewTypeBox.val(viewType); + reloadPage('', orderTypeBox.val(), viewType == 'VIEW' ? createView : createList); + return dialog; + } + +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('flash', function(K) { + var self = this, + name = 'flash', + lang = self.lang(name + '.'), + allowFlashUpload = K.undef(self.allowFlashUpload, true), + allowFileManager = K.undef(self.allowFileManager, false), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'); + self.plugin.flash = { + edit: function() { + var html = [ + '
        ', + //url + '
        ', + '', + '  ', + '  ', + '', + '', + '', + '
        ', + //width + '
        ', + '', + ' ', + '
        ', + //height + '
        ', + '', + ' ', + '
        ', + '
        ' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var url = K.trim(urlBox.val()), + width = widthBox.val(), + height = heightBox.val(); + if(url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if(!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if(!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + var html = K.mediaImg(self.themesPath + 'common/blank.gif', { + src: url, + type: K.mediaType('.swf'), + width: width, + height: height, + quality: 'high' + }); + self.insertHtml(html).hideDialog().focus(); + } + } + }), + div = dialog.div, + urlBox = K('[name="url"]', div), + viewServerBtn = K('[name="viewServer"]', div), + widthBox = K('[name="width"]', div), + heightBox = K('[name="height"]', div); + urlBox.val('http://'); + + if(allowFlashUpload) { + var uploadbutton = K.uploadbutton({ + button: K('.ke-upload-button', div)[0], + fieldName: filePostName, + extraParams: extraParams, + url: K.addParam(uploadJson, 'dir=flash'), + afterUpload: function(data) { + dialog.hideLoading(); + if(data.error === 0) { + var url = data.url; + if(formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + urlBox.val(url); + if(self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + alert(self.lang('uploadSuccess')); + } else { + alert(data.message); + } + }, + afterError: function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + }); + } else { + K('.ke-upload-button', div).hide(); + } + + if(allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType: 'LIST', + dirName: 'flash', + clickFn: function(url, title) { + if(self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if(self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + + var img = self.plugin.getSelectedFlash(); + if(img) { + var attrs = K.mediaAttrs(img.attr('data-ke-tag')); + urlBox.val(attrs.src); + widthBox.val(K.removeUnit(img.css('width')) || attrs.width || 0); + heightBox.val(K.removeUnit(img.css('height')) || attrs.height || 0); + } + urlBox[0].focus(); + urlBox[0].select(); + }, + 'delete': function() { + self.plugin.getSelectedFlash().remove(); + // [IE] 删除图片后立即点击图片按钮出错 + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.flash.edit); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('image', function(K) { + var self = this, + name = 'image', + allowImageUpload = K.undef(self.allowImageUpload, true), + allowImageRemote = K.undef(self.allowImageRemote, true), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + allowFileManager = K.undef(self.allowFileManager, false), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'), + imageTabIndex = K.undef(self.imageTabIndex, 0), + imgPath = self.pluginsPath + 'image/images/', + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + fillDescAfterUploadImage = K.undef(self.fillDescAfterUploadImage, false), + lang = self.lang(name + '.'); + + self.plugin.imageDialog = function(options) { + var imageUrl = options.imageUrl, + imageWidth = K.undef(options.imageWidth, ''), + imageHeight = K.undef(options.imageHeight, ''), + imageTitle = K.undef(options.imageTitle, ''), + imageAlign = K.undef(options.imageAlign, ''), + showRemote = K.undef(options.showRemote, true), + showLocal = K.undef(options.showLocal, true), + tabIndex = K.undef(options.tabIndex, 0), + clickFn = options.clickFn; + var target = 'kindeditor_upload_iframe_' + new Date().getTime(); + var hiddenElements = []; + for(var k in extraParams) { + hiddenElements.push(''); + } + var html = [ + '
        ', + //tabs + '
        ', + //remote image - start + '', + //remote image - end + //local upload - start + '', + //local upload - end + '
        ' + ].join(''); + var dialogWidth = showLocal || allowFileManager ? 450 : 400, + dialogHeight = showLocal && showRemote ? 300 : 250; + var dialog = self.createDialog({ + name: name, + width: dialogWidth, + height: dialogHeight, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + // Bugfix: http://code.google.com/p/kindeditor/issues/detail?id=319 + if(dialog.isLoading) { + return; + } + // insert local image + if(showLocal && showRemote && tabs && tabs.selectedIndex === 1 || !showRemote) { + if(uploadbutton.fileBox.val() == '') { + alert(self.lang('pleaseSelectFile')); + return; + } + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + localUrlBox.val(''); + return; + } + // insert remote image + var url = K.trim(urlBox.val()), + width = widthBox.val(), + height = heightBox.val(), + title = titleBox.val(), + align = ''; + alignBox.each(function() { + if(this.checked) { + align = this.value; + return false; + } + }); + if(url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if(!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if(!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + clickFn.call(self, url, title, width, height, 0, align); + } + }, + beforeRemove: function() { + viewServerBtn.unbind(); + widthBox.unbind(); + heightBox.unbind(); + refreshBtn.unbind(); + } + }), + div = dialog.div; + + var urlBox = K('[name="url"]', div), + localUrlBox = K('[name="localUrl"]', div), + viewServerBtn = K('[name="viewServer"]', div), + widthBox = K('.tab1 [name="width"]', div), + heightBox = K('.tab1 [name="height"]', div), + refreshBtn = K('.ke-refresh-btn', div), + titleBox = K('.tab1 [name="title"]', div), + alignBox = K('.tab1 [name="align"]', div); + + var tabs; + if(showRemote && showLocal) { + tabs = K.tabs({ + src: K('.tabs', div), + afterSelect: function(i) {} + }); + tabs.add({ + title: lang.remoteImage, + panel: K('.tab1', div) + }); + tabs.add({ + title: lang.localImage, + panel: K('.tab2', div) + }); + tabs.select(tabIndex); + } else if(showRemote) { + K('.tab1', div).show(); + } else if(showLocal) { + K('.tab2', div).show(); + } + + var uploadbutton = K.uploadbutton({ + button: K('.ke-upload-button', div)[0], + fieldName: filePostName, + form: K('.ke-form', div), + target: target, + width: 70, + afterUpload: function(data) { + dialog.hideLoading(); + if(data.error === 0) { + var url = data.url; + if(formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + if(self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + if(!fillDescAfterUploadImage) { + clickFn.call(self, url, data.title, data.width, data.height, data.border, data.align); + } else { + K(".ke-dialog-row #remoteUrl", div).val(url); + K(".ke-tabs-li", div)[0].click(); + K(".ke-refresh-btn", div).click(); + } + } else { + alert(data.message); + } + }, + afterError: function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + localUrlBox.val(uploadbutton.fileBox.val()); + }); + if(allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType: 'VIEW', + dirName: 'image', + clickFn: function(url, title) { + if(self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if(self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + var originalWidth = 0, + originalHeight = 0; + + function setSize(width, height) { + widthBox.val(width); + heightBox.val(height); + originalWidth = width; + originalHeight = height; + } + refreshBtn.click(function(e) { + var tempImg = K('', document).css({ + position: 'absolute', + visibility: 'hidden', + top: 0, + left: '-1000px' + }); + tempImg.bind('load', function() { + setSize(tempImg.width(), tempImg.height()); + tempImg.remove(); + }); + K(document.body).append(tempImg); + }); + widthBox.change(function(e) { + if(originalWidth > 0) { + heightBox.val(Math.round(originalHeight / originalWidth * parseInt(this.value, 10))); + } + }); + heightBox.change(function(e) { + if(originalHeight > 0) { + widthBox.val(Math.round(originalWidth / originalHeight * parseInt(this.value, 10))); + } + }); + urlBox.val(options.imageUrl); + setSize(options.imageWidth, options.imageHeight); + titleBox.val(options.imageTitle); + alignBox.each(function() { + if(this.value === options.imageAlign) { + this.checked = true; + return false; + } + }); + if(showRemote && tabIndex === 0) { + urlBox[0].focus(); + urlBox[0].select(); + } + return dialog; + }; + self.plugin.image = { + edit: function() { + var img = self.plugin.getSelectedImage(); + self.plugin.imageDialog({ + imageUrl: img ? img.attr('data-ke-src') : 'http://', + imageWidth: img ? img.width() : '', + imageHeight: img ? img.height() : '', + imageTitle: img ? img.attr('title') : '', + imageAlign: img ? img.attr('align') : '', + showRemote: allowImageRemote, + showLocal: allowImageUpload, + tabIndex: img ? 0 : imageTabIndex, + clickFn: function(url, title, width, height, border, align) { + if(img) { + img.attr('src', url); + img.attr('data-ke-src', url); + img.attr('width', width); + img.attr('height', height); + img.attr('title', title); + img.attr('align', align); + img.attr('alt', title); + } else { + self.exec('insertimage', url, title, width, height, border, align); + } + // Bugfix: [Firefox] 上传图片后,总是出现正在加载的样式,需要延迟执行hideDialog + setTimeout(function() { + self.hideDialog().focus(); + }, 0); + } + }); + }, + 'delete': function() { + var target = self.plugin.getSelectedImage(); + if(target.parent().name == 'a') { + target = target.parent(); + } + target.remove(); + // [IE] 删除图片后立即点击图片按钮出错 + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.image.edit); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('insertfile', function(K) { + var self = this, + name = 'insertfile', + allowFileUpload = K.undef(self.allowFileUpload, true), + allowFileManager = K.undef(self.allowFileManager, false), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'), + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + lang = self.lang(name + '.'); + self.plugin.fileDialog = function(options) { + var fileUrl = K.undef(options.fileUrl, 'http://'), + fileTitle = K.undef(options.fileTitle, ''), + clickFn = options.clickFn; + var html = [ + '
        ', + '
        ', + '', + '  ', + '  ', + '', + '', + '', + '
        ', + //title + '
        ', + '', + '
        ', + '
        ', + //form end + '', + '' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var url = K.trim(urlBox.val()), + title = titleBox.val(); + if(url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if(K.trim(title) === '') { + title = url; + } + clickFn.call(self, url, title); + } + } + }), + div = dialog.div; + + var urlBox = K('[name="url"]', div), + viewServerBtn = K('[name="viewServer"]', div), + titleBox = K('[name="title"]', div); + + if(allowFileUpload) { + var uploadbutton = K.uploadbutton({ + button: K('.ke-upload-button', div)[0], + fieldName: filePostName, + url: K.addParam(uploadJson, 'dir=file'), + extraParams: extraParams, + afterUpload: function(data) { + dialog.hideLoading(); + if(data.error === 0) { + var url = data.url; + if(formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + urlBox.val(url); + if(self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + alert(self.lang('uploadSuccess')); + } else { + alert(data.message); + } + }, + afterError: function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + }); + } else { + K('.ke-upload-button', div).hide(); + } + if(allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType: 'LIST', + dirName: 'file', + clickFn: function(url, title) { + if(self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if(self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + urlBox.val(fileUrl); + titleBox.val(fileTitle); + urlBox[0].focus(); + urlBox[0].select(); + }; + self.clickToolbar(name, function() { + self.plugin.fileDialog({ + clickFn: function(url, title) { + var html = '' + title + ''; + self.insertHtml(html).hideDialog().focus(); + } + }); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('lineheight', function(K) { + var self = this, + name = 'lineheight', + lang = self.lang(name + '.'); + self.clickToolbar(name, function() { + var curVal = '', + commonNode = self.cmd.commonNode({ + '*': '.line-height' + }); + if(commonNode) { + curVal = commonNode.css('line-height'); + } + var menu = self.createMenu({ + name: name, + width: 150 + }); + K.each(lang.lineHeight, function(i, row) { + K.each(row, function(key, val) { + menu.addItem({ + title: val, + checked: curVal === key, + click: function() { + self.cmd.toggle('', { + span: '.line-height=' + key + }); + self.updateState(); + self.addBookmark(); + self.hideMenu(); + } + }); + }); + }); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('link', function(K) { + var self = this, + name = 'link'; + self.plugin.link = { + edit: function() { + var lang = self.lang(name + '.'), + html = '
        ' + + //url + '
        ' + + '' + + '
        ' + + //type + '
        ' + + '' + + '' + + '
        ' + + '
        ', + dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var url = K.trim(urlBox.val()); + if(url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + self.exec('createlink', url, typeBox.val()).hideDialog().focus(); + } + } + }), + div = dialog.div, + urlBox = K('input[name="url"]', div), + typeBox = K('select[name="type"]', div); + urlBox.val('http://'); + typeBox[0].options[0] = new Option(lang.newWindow, '_blank'); + typeBox[0].options[1] = new Option(lang.selfWindow, ''); + self.cmd.selection(); + var a = self.plugin.getSelectedLink(); + if(a) { + self.cmd.range.selectNode(a[0]); + self.cmd.select(); + urlBox.val(a.attr('data-ke-src')); + typeBox.val(a.attr('target')); + } + urlBox[0].focus(); + urlBox[0].select(); + }, + 'delete': function() { + self.exec('unlink', null); + } + }; + self.clickToolbar(name, self.plugin.link.edit); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +// Google Maps: http://code.google.com/apis/maps/index.html + +KindEditor.plugin('map', function(K) { + var self = this, + name = 'map', + lang = self.lang(name + '.'); + self.clickToolbar(name, function() { + var html = ['
        ', + '
        ', + lang.address + ' ', + '', + '', + '', + '
        ', + '
        ', + '
        ' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: 600, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var geocoder = win.geocoder, + map = win.map, + center = map.getCenter().lat() + ',' + map.getCenter().lng(), + zoom = map.getZoom(), + maptype = map.getMapTypeId(), + url = 'http://maps.googleapis.com/maps/api/staticmap'; + url += '?center=' + encodeURIComponent(center); + url += '&zoom=' + encodeURIComponent(zoom); + url += '&size=558x360'; + url += '&maptype=' + encodeURIComponent(maptype); + url += '&markers=' + encodeURIComponent(center); + url += '&language=' + self.langType; + url += '&sensor=false'; + self.exec('insertimage', url).hideDialog().focus(); + } + }, + beforeRemove: function() { + searchBtn.remove(); + if(doc) { + doc.write(''); + } + iframe.remove(); + } + }); + var div = dialog.div, + addressBox = K('[name="address"]', div), + searchBtn = K('[name="searchBtn"]', div), + win, doc; + var iframeHtml = ['', + '', + '', + '', + '', + '', + '', + '
        ', + '' + ].join('\n'); + // TODO:用doc.write(iframeHtml)方式加载时,在IE6上第一次加载报错,暂时使用src方式 + var iframe = K(''); + + function ready() { + win = iframe[0].contentWindow; + doc = K.iframeDoc(iframe); + //doc.open(); + //doc.write(iframeHtml); + //doc.close(); + } + iframe.bind('load', function() { + iframe.unbind('load'); + if(K.IE) { + ready(); + } else { + setTimeout(ready, 0); + } + }); + K('.ke-map', div).replaceWith(iframe); + // search map + searchBtn.click(function() { + win.search(addressBox.val()); + }); + }); +}); +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('media', function(K) { + var self = this, + name = 'media', + lang = self.lang(name + '.'), + allowMediaUpload = K.undef(self.allowMediaUpload, true), + allowFileManager = K.undef(self.allowFileManager, false), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'); + self.plugin.media = { + edit: function() { + var html = [ + '
        ', + //url + '
        ', + '', + '  ', + '  ', + '', + '', + '', + '
        ', + //width + '
        ', + '', + '', + '
        ', + //height + '
        ', + '', + '', + '
        ', + //autostart + '
        ', + '', + ' ', + '
        ', + '
        ' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: 450, + height: 230, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var url = K.trim(urlBox.val()), + width = widthBox.val(), + height = heightBox.val(); + if(url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if(!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if(!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + var html = K.mediaImg(self.themesPath + 'common/blank.gif', { + src: url, + type: K.mediaType(url), + width: width, + height: height, + autostart: autostartBox[0].checked ? 'true' : 'false', + loop: 'true' + }); + self.insertHtml(html).hideDialog().focus(); + } + } + }), + div = dialog.div, + urlBox = K('[name="url"]', div), + viewServerBtn = K('[name="viewServer"]', div), + widthBox = K('[name="width"]', div), + heightBox = K('[name="height"]', div), + autostartBox = K('[name="autostart"]', div); + urlBox.val('http://'); + + if(allowMediaUpload) { + var uploadbutton = K.uploadbutton({ + button: K('.ke-upload-button', div)[0], + fieldName: filePostName, + extraParams: extraParams, + url: K.addParam(uploadJson, 'dir=media'), + afterUpload: function(data) { + dialog.hideLoading(); + if(data.error === 0) { + var url = data.url; + if(formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + urlBox.val(url); + if(self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + alert(self.lang('uploadSuccess')); + } else { + alert(data.message); + } + }, + afterError: function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + }); + } else { + K('.ke-upload-button', div).hide(); + } + + if(allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType: 'LIST', + dirName: 'media', + clickFn: function(url, title) { + if(self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if(self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + + var img = self.plugin.getSelectedMedia(); + if(img) { + var attrs = K.mediaAttrs(img.attr('data-ke-tag')); + urlBox.val(attrs.src); + widthBox.val(K.removeUnit(img.css('width')) || attrs.width || 0); + heightBox.val(K.removeUnit(img.css('height')) || attrs.height || 0); + autostartBox[0].checked = (attrs.autostart === 'true'); + } + urlBox[0].focus(); + urlBox[0].select(); + }, + 'delete': function() { + self.plugin.getSelectedMedia().remove(); + // [IE] 删除图片后立即点击图片按钮出错 + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.media.edit); +}); + +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + + +(function(K) { + + function KSWFUpload(options) { + this.init(options); + } + K.extend(KSWFUpload, { + init : function(options) { + var self = this; + options.afterError = options.afterError || function(str) { + alert(str); + }; + self.options = options; + self.progressbars = {}; + // template + self.div = K(options.container).html([ + '
        ', + '
        ', + '
        ', + '', + '
        ', + '
        ' + options.uploadDesc + '
        ', + '', + '', + '', + '
        ', + '
        ', + '
        ' + ].join('')); + self.bodyDiv = K('.ke-swfupload-body', self.div); + + function showError(itemDiv, msg) { + K('.ke-status > div', itemDiv).hide(); + K('.ke-message', itemDiv).addClass('ke-error').show().html(K.escape(msg)); + } + + var settings = { + debug : false, + upload_url : options.uploadUrl, + flash_url : options.flashUrl, + file_post_name : options.filePostName, + button_placeholder : K('.ke-swfupload-button > input', self.div)[0], + button_image_url: options.buttonImageUrl, + button_width: options.buttonWidth, + button_height: options.buttonHeight, + button_cursor : SWFUpload.CURSOR.HAND, + file_types : options.fileTypes, + file_types_description : options.fileTypesDesc, + file_upload_limit : options.fileUploadLimit, + file_size_limit : options.fileSizeLimit, + post_params : options.postParams, + file_queued_handler : function(file) { + file.url = self.options.fileIconUrl; + self.appendFile(file); + }, + file_queue_error_handler : function(file, errorCode, message) { + var errorName = ''; + switch (errorCode) { + case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED: + errorName = options.queueLimitExceeded; + break; + case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: + errorName = options.fileExceedsSizeLimit; + break; + case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE: + errorName = options.zeroByteFile; + break; + case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE: + errorName = options.invalidFiletype; + break; + default: + errorName = options.unknownError; + break; + } + K.DEBUG && alert(errorName); + }, + upload_start_handler : function(file) { + var self = this; + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv); + K('.ke-status > div', itemDiv).hide(); + K('.ke-progressbar', itemDiv).show(); + }, + upload_progress_handler : function(file, bytesLoaded, bytesTotal) { + var percent = Math.round(bytesLoaded * 100 / bytesTotal); + var progressbar = self.progressbars[file.id]; + progressbar.bar.css('width', Math.round(percent * 80 / 100) + 'px'); + progressbar.percent.html(percent + '%'); + }, + upload_error_handler : function(file, errorCode, message) { + if (file && file.filestatus == SWFUpload.FILE_STATUS.ERROR) { + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv).eq(0); + showError(itemDiv, self.options.errorMessage); + } + }, + upload_success_handler : function(file, serverData) { + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv).eq(0); + var data = {}; + try { + data = K.json(serverData); + } catch (e) { + self.options.afterError.call(this, '' + serverData + ''); + } + if (data.error !== 0) { + showError(itemDiv, K.DEBUG ? data.message : self.options.errorMessage); + return; + } + file.url = data.url; + K('.ke-img', itemDiv).attr('src', file.url).attr('data-status', file.filestatus).data('data', data); + K('.ke-status > div', itemDiv).hide(); + } + }; + self.swfu = new SWFUpload(settings); + + K('.ke-swfupload-startupload input', self.div).click(function() { + self.swfu.startUpload(); + }); + }, + getUrlList : function() { + var list = []; + K('.ke-img', self.bodyDiv).each(function() { + var img = K(this); + var status = img.attr('data-status'); + if (status == SWFUpload.FILE_STATUS.COMPLETE) { + list.push(img.data('data')); + } + }); + return list; + }, + removeFile : function(fileId) { + var self = this; + self.swfu.cancelUpload(fileId); + var itemDiv = K('div[data-id="' + fileId + '"]', self.bodyDiv); + K('.ke-photo', itemDiv).unbind(); + K('.ke-delete', itemDiv).unbind(); + itemDiv.remove(); + }, + removeFiles : function() { + var self = this; + K('.ke-item', self.bodyDiv).each(function() { + self.removeFile(K(this).attr('data-id')); + }); + }, + appendFile : function(file) { + var self = this; + var itemDiv = K('
        '); + self.bodyDiv.append(itemDiv); + var photoDiv = K('
        ') + .mouseover(function(e) { + K(this).addClass('ke-on'); + }) + .mouseout(function(e) { + K(this).removeClass('ke-on'); + }); + itemDiv.append(photoDiv); + + var img = K('' + file.name + ''); + photoDiv.append(img); + K('').appendTo(photoDiv).click(function() { + self.removeFile(file.id); + }); + var statusDiv = K('
        ').appendTo(photoDiv); + // progressbar + K(['
        ', + '
        ', + '
        0%
        '].join('')).hide().appendTo(statusDiv); + // message + K('
        ' + self.options.pendingMessage + '
        ').appendTo(statusDiv); + + itemDiv.append('
        ' + file.name + '
        '); + + self.progressbars[file.id] = { + bar : K('.ke-progressbar-bar-inner', photoDiv), + percent : K('.ke-progressbar-percent', photoDiv) + }; + }, + remove : function() { + this.removeFiles(); + this.swfu.destroy(); + this.div.html(''); + } + }); + + K.swfupload = function(element, options) { + return new KSWFUpload(element, options); + }; + + })(KindEditor); + + KindEditor.plugin('multiimage', function(K) { + var self = this, name = 'multiimage', + formatUploadUrl = K.undef(self.formatUploadUrl, true), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'), + imgPath = self.pluginsPath + 'multiimage/images/', + imageSizeLimit = K.undef(self.imageSizeLimit, '1MB'), + imageFileTypes = K.undef(self.imageFileTypes, '*.jpg;*.gif;*.png'), + imageUploadLimit = K.undef(self.imageUploadLimit, 20), + filePostName = K.undef(self.filePostName, 'imgFile'), + lang = self.lang(name + '.'); + + self.plugin.multiImageDialog = function(options) { + var clickFn = options.clickFn, + uploadDesc = K.tmpl(lang.uploadDesc, {uploadLimit : imageUploadLimit, sizeLimit : imageSizeLimit}); + var html = [ + '
        ', + '
        ', + '
        ', + '
        ' + ].join(''); + var dialog = self.createDialog({ + name : name, + width : 650, + height : 510, + title : self.lang(name), + body : html, + previewBtn : { + name : lang.insertAll, + click : function(e) { + clickFn.call(self, swfupload.getUrlList()); + } + }, + yesBtn : { + name : lang.clearAll, + click : function(e) { + swfupload.removeFiles(); + } + }, + beforeRemove : function() { + // IE9 bugfix: https://github.com/kindsoft/kindeditor/issues/72 + if (!K.IE || K.V <= 8) { + swfupload.remove(); + } + } + }), + div = dialog.div; + + var swfupload = K.swfupload({ + container : K('.swfupload', div), + buttonImageUrl : imgPath + (self.langType == 'zh-CN' ? 'select-files-zh-CN.png' : 'select-files-en.png'), + buttonWidth : self.langType == 'zh-CN' ? 72 : 88, + buttonHeight : 23, + fileIconUrl : imgPath + 'image.png', + uploadDesc : uploadDesc, + startButtonValue : lang.startUpload, + uploadUrl : K.addParam(uploadJson, 'dir=image'), + flashUrl : imgPath + 'swfupload.swf', + filePostName : filePostName, + fileTypes : '*.jpg;*.jpeg;*.gif;*.png;*.bmp', + fileTypesDesc : 'Image Files', + fileUploadLimit : imageUploadLimit, + fileSizeLimit : imageSizeLimit, + postParams : K.undef(self.extraFileUploadParams, {}), + queueLimitExceeded : lang.queueLimitExceeded, + fileExceedsSizeLimit : lang.fileExceedsSizeLimit, + zeroByteFile : lang.zeroByteFile, + invalidFiletype : lang.invalidFiletype, + unknownError : lang.unknownError, + pendingMessage : lang.pending, + errorMessage : lang.uploadError, + afterError : function(html) { + self.errorDialog(html); + } + }); + + return dialog; + }; + self.clickToolbar(name, function() { + self.plugin.multiImageDialog({ + clickFn : function (urlList) { + if (urlList.length === 0) { + return; + } + K.each(urlList, function(i, data) { + if (self.afterUpload) { + self.afterUpload.call(self, data.url, data, 'multiimage'); + } + self.exec('insertimage', data.url, data.title, data.width, data.height, data.border, data.align); + }); + // Bugfix: [Firefox] 上传图片后,总是出现正在加载的样式,需要延迟执行hideDialog + setTimeout(function() { + self.hideDialog().focus(); + }, 0); + } + }); + }); + }); + + + /** + * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com + * + * mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/ + * + * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilz閚 and Mammon Media and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + */ + + + /* ******************* */ + /* Constructor & Init */ + /* ******************* */ + + (function() { + + window.SWFUpload = function (settings) { + this.initSWFUpload(settings); + }; + + SWFUpload.prototype.initSWFUpload = function (settings) { + try { + this.customSettings = {}; // A container where developers can place their own settings associated with this instance. + this.settings = settings; + this.eventQueue = []; + this.movieName = "KindEditor_SWFUpload_" + SWFUpload.movieCount++; + this.movieElement = null; + + + // Setup global control tracking + SWFUpload.instances[this.movieName] = this; + + // Load the settings. Load the Flash movie. + this.initSettings(); + this.loadFlash(); + this.displayDebugInfo(); + } catch (ex) { + delete SWFUpload.instances[this.movieName]; + throw ex; + } + }; + + /* *************** */ + /* Static Members */ + /* *************** */ + SWFUpload.instances = {}; + SWFUpload.movieCount = 0; + SWFUpload.version = "2.2.0 2009-03-25"; + SWFUpload.QUEUE_ERROR = { + QUEUE_LIMIT_EXCEEDED : -100, + FILE_EXCEEDS_SIZE_LIMIT : -110, + ZERO_BYTE_FILE : -120, + INVALID_FILETYPE : -130 + }; + SWFUpload.UPLOAD_ERROR = { + HTTP_ERROR : -200, + MISSING_UPLOAD_URL : -210, + IO_ERROR : -220, + SECURITY_ERROR : -230, + UPLOAD_LIMIT_EXCEEDED : -240, + UPLOAD_FAILED : -250, + SPECIFIED_FILE_ID_NOT_FOUND : -260, + FILE_VALIDATION_FAILED : -270, + FILE_CANCELLED : -280, + UPLOAD_STOPPED : -290 + }; + SWFUpload.FILE_STATUS = { + QUEUED : -1, + IN_PROGRESS : -2, + ERROR : -3, + COMPLETE : -4, + CANCELLED : -5 + }; + SWFUpload.BUTTON_ACTION = { + SELECT_FILE : -100, + SELECT_FILES : -110, + START_UPLOAD : -120 + }; + SWFUpload.CURSOR = { + ARROW : -1, + HAND : -2 + }; + SWFUpload.WINDOW_MODE = { + WINDOW : "window", + TRANSPARENT : "transparent", + OPAQUE : "opaque" + }; + + // Private: takes a URL, determines if it is relative and converts to an absolute URL + // using the current site. Only processes the URL if it can, otherwise returns the URL untouched + SWFUpload.completeURL = function(url) { + if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) { + return url; + } + + var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : ""); + + var indexSlash = window.location.pathname.lastIndexOf("/"); + if (indexSlash <= 0) { + path = "/"; + } else { + path = window.location.pathname.substr(0, indexSlash) + "/"; + } + + return /*currentURL +*/ path + url; + + }; + + + /* ******************** */ + /* Instance Members */ + /* ******************** */ + + // Private: initSettings ensures that all the + // settings are set, getting a default value if one was not assigned. + SWFUpload.prototype.initSettings = function () { + this.ensureDefault = function (settingName, defaultValue) { + this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName]; + }; + + // Upload backend settings + this.ensureDefault("upload_url", ""); + this.ensureDefault("preserve_relative_urls", false); + this.ensureDefault("file_post_name", "Filedata"); + this.ensureDefault("post_params", {}); + this.ensureDefault("use_query_string", false); + this.ensureDefault("requeue_on_error", false); + this.ensureDefault("http_success", []); + this.ensureDefault("assume_success_timeout", 0); + + // File Settings + this.ensureDefault("file_types", "*.*"); + this.ensureDefault("file_types_description", "All Files"); + this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited" + this.ensureDefault("file_upload_limit", 0); + this.ensureDefault("file_queue_limit", 0); + + // Flash Settings + this.ensureDefault("flash_url", "swfupload.swf"); + this.ensureDefault("prevent_swf_caching", true); + + // Button Settings + this.ensureDefault("button_image_url", ""); + this.ensureDefault("button_width", 1); + this.ensureDefault("button_height", 1); + this.ensureDefault("button_text", ""); + this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;"); + this.ensureDefault("button_text_top_padding", 0); + this.ensureDefault("button_text_left_padding", 0); + this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES); + this.ensureDefault("button_disabled", false); + this.ensureDefault("button_placeholder_id", ""); + this.ensureDefault("button_placeholder", null); + this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW); + this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW); + + // Debug Settings + this.ensureDefault("debug", false); + this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API + + // Event Handlers + this.settings.return_upload_start_handler = this.returnUploadStart; + this.ensureDefault("swfupload_loaded_handler", null); + this.ensureDefault("file_dialog_start_handler", null); + this.ensureDefault("file_queued_handler", null); + this.ensureDefault("file_queue_error_handler", null); + this.ensureDefault("file_dialog_complete_handler", null); + + this.ensureDefault("upload_start_handler", null); + this.ensureDefault("upload_progress_handler", null); + this.ensureDefault("upload_error_handler", null); + this.ensureDefault("upload_success_handler", null); + this.ensureDefault("upload_complete_handler", null); + + this.ensureDefault("debug_handler", this.debugMessage); + + this.ensureDefault("custom_settings", {}); + + // Other settings + this.customSettings = this.settings.custom_settings; + + // Update the flash url if needed + if (!!this.settings.prevent_swf_caching) { + this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime(); + } + + if (!this.settings.preserve_relative_urls) { + //this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url); // Don't need to do this one since flash doesn't look at it + this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url); + this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url); + } + + delete this.ensureDefault; + }; + + // Private: loadFlash replaces the button_placeholder element with the flash movie. + SWFUpload.prototype.loadFlash = function () { + var targetElement, tempParent; + + // Make sure an element with the ID we are going to use doesn't already exist + if (document.getElementById(this.movieName) !== null) { + throw "ID " + this.movieName + " is already in use. The Flash Object could not be added"; + } + + // Get the element where we will be placing the flash movie + targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder; + + if (targetElement == undefined) { + throw "Could not find the placeholder element: " + this.settings.button_placeholder_id; + } + + // Append the container and load the flash + tempParent = document.createElement("div"); + tempParent.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers) + targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement); + + // Fix IE Flash/Form bug + if (window[this.movieName] == undefined) { + window[this.movieName] = this.getMovieElement(); + } + + }; + + // Private: getFlashHTML generates the object tag needed to embed the flash in to the document + SWFUpload.prototype.getFlashHTML = function () { + // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay + // Fix bug for IE9 + // http://www.kindsoft.net/view.php?bbsid=7&postid=5825&pagenum=1 + var classid = ''; + if (KindEditor.IE && KindEditor.V > 8) { + classid = ' classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'; + } + return ['', + '', + '', + '', + '', + '', + '', + ''].join(""); + }; + + // Private: getFlashVars builds the parameter string that will be passed + // to flash in the flashvars param. + SWFUpload.prototype.getFlashVars = function () { + // Build a string from the post param object + var paramString = this.buildParamString(); + var httpSuccessString = this.settings.http_success.join(","); + + // Build the parameter string + return ["movieName=", encodeURIComponent(this.movieName), + "&uploadURL=", encodeURIComponent(this.settings.upload_url), + "&useQueryString=", encodeURIComponent(this.settings.use_query_string), + "&requeueOnError=", encodeURIComponent(this.settings.requeue_on_error), + "&httpSuccess=", encodeURIComponent(httpSuccessString), + "&assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout), + "&params=", encodeURIComponent(paramString), + "&filePostName=", encodeURIComponent(this.settings.file_post_name), + "&fileTypes=", encodeURIComponent(this.settings.file_types), + "&fileTypesDescription=", encodeURIComponent(this.settings.file_types_description), + "&fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit), + "&fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit), + "&fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit), + "&debugEnabled=", encodeURIComponent(this.settings.debug_enabled), + "&buttonImageURL=", encodeURIComponent(this.settings.button_image_url), + "&buttonWidth=", encodeURIComponent(this.settings.button_width), + "&buttonHeight=", encodeURIComponent(this.settings.button_height), + "&buttonText=", encodeURIComponent(this.settings.button_text), + "&buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding), + "&buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding), + "&buttonTextStyle=", encodeURIComponent(this.settings.button_text_style), + "&buttonAction=", encodeURIComponent(this.settings.button_action), + "&buttonDisabled=", encodeURIComponent(this.settings.button_disabled), + "&buttonCursor=", encodeURIComponent(this.settings.button_cursor) + ].join(""); + }; + + // Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload + // The element is cached after the first lookup + SWFUpload.prototype.getMovieElement = function () { + if (this.movieElement == undefined) { + this.movieElement = document.getElementById(this.movieName); + } + + if (this.movieElement === null) { + throw "Could not find Flash element"; + } + + return this.movieElement; + }; + + // Private: buildParamString takes the name/value pairs in the post_params setting object + // and joins them up in to a string formatted "name=value&name=value" + SWFUpload.prototype.buildParamString = function () { + var postParams = this.settings.post_params; + var paramStringPairs = []; + + if (typeof(postParams) === "object") { + for (var name in postParams) { + if (postParams.hasOwnProperty(name)) { + paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString())); + } + } + } + + return paramStringPairs.join("&"); + }; + + // Public: Used to remove a SWFUpload instance from the page. This method strives to remove + // all references to the SWF, and other objects so memory is properly freed. + // Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state. + // Credits: Major improvements provided by steffen + SWFUpload.prototype.destroy = function () { + try { + // Make sure Flash is done before we try to remove it + this.cancelUpload(null, false); + + + // Remove the SWFUpload DOM nodes + var movieElement = null; + movieElement = this.getMovieElement(); + + if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE + // Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround) + for (var i in movieElement) { + try { + if (typeof(movieElement[i]) === "function") { + movieElement[i] = null; + } + } catch (ex1) {} + } + + // Remove the Movie Element from the page + try { + movieElement.parentNode.removeChild(movieElement); + } catch (ex) {} + } + + // Remove IE form fix reference + window[this.movieName] = null; + + // Destroy other references + SWFUpload.instances[this.movieName] = null; + delete SWFUpload.instances[this.movieName]; + + this.movieElement = null; + this.settings = null; + this.customSettings = null; + this.eventQueue = null; + this.movieName = null; + + + return true; + } catch (ex2) { + return false; + } + }; + + + // Public: displayDebugInfo prints out settings and configuration + // information about this SWFUpload instance. + // This function (and any references to it) can be deleted when placing + // SWFUpload in production. + SWFUpload.prototype.displayDebugInfo = function () { + this.debug( + [ + "---SWFUpload Instance Info---\n", + "Version: ", SWFUpload.version, "\n", + "Movie Name: ", this.movieName, "\n", + "Settings:\n", + "\t", "upload_url: ", this.settings.upload_url, "\n", + "\t", "flash_url: ", this.settings.flash_url, "\n", + "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n", + "\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n", + "\t", "http_success: ", this.settings.http_success.join(", "), "\n", + "\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n", + "\t", "file_post_name: ", this.settings.file_post_name, "\n", + "\t", "post_params: ", this.settings.post_params.toString(), "\n", + "\t", "file_types: ", this.settings.file_types, "\n", + "\t", "file_types_description: ", this.settings.file_types_description, "\n", + "\t", "file_size_limit: ", this.settings.file_size_limit, "\n", + "\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n", + "\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n", + "\t", "debug: ", this.settings.debug.toString(), "\n", + + "\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n", + + "\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n", + "\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n", + "\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n", + "\t", "button_width: ", this.settings.button_width.toString(), "\n", + "\t", "button_height: ", this.settings.button_height.toString(), "\n", + "\t", "button_text: ", this.settings.button_text.toString(), "\n", + "\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n", + "\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n", + "\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n", + "\t", "button_action: ", this.settings.button_action.toString(), "\n", + "\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n", + + "\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n", + "Event Handlers:\n", + "\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n", + "\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n", + "\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n", + "\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n", + "\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n", + "\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n", + "\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n", + "\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n", + "\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n", + "\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n" + ].join("") + ); + }; + + /* Note: addSetting and getSetting are no longer used by SWFUpload but are included + the maintain v2 API compatibility + */ + // Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used. + SWFUpload.prototype.addSetting = function (name, value, default_value) { + if (value == undefined) { + return (this.settings[name] = default_value); + } else { + return (this.settings[name] = value); + } + }; + + // Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found. + SWFUpload.prototype.getSetting = function (name) { + if (this.settings[name] != undefined) { + return this.settings[name]; + } + + return ""; + }; + + + + // Private: callFlash handles function calls made to the Flash element. + // Calls are made with a setTimeout for some functions to work around + // bugs in the ExternalInterface library. + SWFUpload.prototype.callFlash = function (functionName, argumentArray) { + argumentArray = argumentArray || []; + + var movieElement = this.getMovieElement(); + var returnValue, returnString; + + // Flash's method if calling ExternalInterface methods (code adapted from MooTools). + try { + returnString = movieElement.CallFunction('' + __flash__argumentsToXML(argumentArray, 0) + ''); + returnValue = eval(returnString); + } catch (ex) { + throw "Call to " + functionName + " failed"; + } + + // Unescape file post param values + if (returnValue != undefined && typeof returnValue.post === "object") { + returnValue = this.unescapeFilePostParams(returnValue); + } + + return returnValue; + }; + + /* ***************************** + -- Flash control methods -- + Your UI should use these + to operate SWFUpload + ***************************** */ + + // WARNING: this function does not work in Flash Player 10 + // Public: selectFile causes a File Selection Dialog window to appear. This + // dialog only allows 1 file to be selected. + SWFUpload.prototype.selectFile = function () { + this.callFlash("SelectFile"); + }; + + // WARNING: this function does not work in Flash Player 10 + // Public: selectFiles causes a File Selection Dialog window to appear/ This + // dialog allows the user to select any number of files + // Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names. + // If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around + // for this bug. + SWFUpload.prototype.selectFiles = function () { + this.callFlash("SelectFiles"); + }; + + + // Public: startUpload starts uploading the first file in the queue unless + // the optional parameter 'fileID' specifies the ID + SWFUpload.prototype.startUpload = function (fileID) { + this.callFlash("StartUpload", [fileID]); + }; + + // Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index. + // If you do not specify a fileID the current uploading file or first file in the queue is cancelled. + // If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter. + SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) { + if (triggerErrorEvent !== false) { + triggerErrorEvent = true; + } + this.callFlash("CancelUpload", [fileID, triggerErrorEvent]); + }; + + // Public: stopUpload stops the current upload and requeues the file at the beginning of the queue. + // If nothing is currently uploading then nothing happens. + SWFUpload.prototype.stopUpload = function () { + this.callFlash("StopUpload"); + }; + + /* ************************ + * Settings methods + * These methods change the SWFUpload settings. + * SWFUpload settings should not be changed directly on the settings object + * since many of the settings need to be passed to Flash in order to take + * effect. + * *********************** */ + + // Public: getStats gets the file statistics object. + SWFUpload.prototype.getStats = function () { + return this.callFlash("GetStats"); + }; + + // Public: setStats changes the SWFUpload statistics. You shouldn't need to + // change the statistics but you can. Changing the statistics does not + // affect SWFUpload accept for the successful_uploads count which is used + // by the upload_limit setting to determine how many files the user may upload. + SWFUpload.prototype.setStats = function (statsObject) { + this.callFlash("SetStats", [statsObject]); + }; + + // Public: getFile retrieves a File object by ID or Index. If the file is + // not found then 'null' is returned. + SWFUpload.prototype.getFile = function (fileID) { + if (typeof(fileID) === "number") { + return this.callFlash("GetFileByIndex", [fileID]); + } else { + return this.callFlash("GetFile", [fileID]); + } + }; + + // Public: addFileParam sets a name/value pair that will be posted with the + // file specified by the Files ID. If the name already exists then the + // exiting value will be overwritten. + SWFUpload.prototype.addFileParam = function (fileID, name, value) { + return this.callFlash("AddFileParam", [fileID, name, value]); + }; + + // Public: removeFileParam removes a previously set (by addFileParam) name/value + // pair from the specified file. + SWFUpload.prototype.removeFileParam = function (fileID, name) { + this.callFlash("RemoveFileParam", [fileID, name]); + }; + + // Public: setUploadUrl changes the upload_url setting. + SWFUpload.prototype.setUploadURL = function (url) { + this.settings.upload_url = url.toString(); + this.callFlash("SetUploadURL", [url]); + }; + + // Public: setPostParams changes the post_params setting + SWFUpload.prototype.setPostParams = function (paramsObject) { + this.settings.post_params = paramsObject; + this.callFlash("SetPostParams", [paramsObject]); + }; + + // Public: addPostParam adds post name/value pair. Each name can have only one value. + SWFUpload.prototype.addPostParam = function (name, value) { + this.settings.post_params[name] = value; + this.callFlash("SetPostParams", [this.settings.post_params]); + }; + + // Public: removePostParam deletes post name/value pair. + SWFUpload.prototype.removePostParam = function (name) { + delete this.settings.post_params[name]; + this.callFlash("SetPostParams", [this.settings.post_params]); + }; + + // Public: setFileTypes changes the file_types setting and the file_types_description setting + SWFUpload.prototype.setFileTypes = function (types, description) { + this.settings.file_types = types; + this.settings.file_types_description = description; + this.callFlash("SetFileTypes", [types, description]); + }; + + // Public: setFileSizeLimit changes the file_size_limit setting + SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) { + this.settings.file_size_limit = fileSizeLimit; + this.callFlash("SetFileSizeLimit", [fileSizeLimit]); + }; + + // Public: setFileUploadLimit changes the file_upload_limit setting + SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) { + this.settings.file_upload_limit = fileUploadLimit; + this.callFlash("SetFileUploadLimit", [fileUploadLimit]); + }; + + // Public: setFileQueueLimit changes the file_queue_limit setting + SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) { + this.settings.file_queue_limit = fileQueueLimit; + this.callFlash("SetFileQueueLimit", [fileQueueLimit]); + }; + + // Public: setFilePostName changes the file_post_name setting + SWFUpload.prototype.setFilePostName = function (filePostName) { + this.settings.file_post_name = filePostName; + this.callFlash("SetFilePostName", [filePostName]); + }; + + // Public: setUseQueryString changes the use_query_string setting + SWFUpload.prototype.setUseQueryString = function (useQueryString) { + this.settings.use_query_string = useQueryString; + this.callFlash("SetUseQueryString", [useQueryString]); + }; + + // Public: setRequeueOnError changes the requeue_on_error setting + SWFUpload.prototype.setRequeueOnError = function (requeueOnError) { + this.settings.requeue_on_error = requeueOnError; + this.callFlash("SetRequeueOnError", [requeueOnError]); + }; + + // Public: setHTTPSuccess changes the http_success setting + SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) { + if (typeof http_status_codes === "string") { + http_status_codes = http_status_codes.replace(" ", "").split(","); + } + + this.settings.http_success = http_status_codes; + this.callFlash("SetHTTPSuccess", [http_status_codes]); + }; + + // Public: setHTTPSuccess changes the http_success setting + SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) { + this.settings.assume_success_timeout = timeout_seconds; + this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]); + }; + + // Public: setDebugEnabled changes the debug_enabled setting + SWFUpload.prototype.setDebugEnabled = function (debugEnabled) { + this.settings.debug_enabled = debugEnabled; + this.callFlash("SetDebugEnabled", [debugEnabled]); + }; + + // Public: setButtonImageURL loads a button image sprite + SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) { + if (buttonImageURL == undefined) { + buttonImageURL = ""; + } + + this.settings.button_image_url = buttonImageURL; + this.callFlash("SetButtonImageURL", [buttonImageURL]); + }; + + // Public: setButtonDimensions resizes the Flash Movie and button + SWFUpload.prototype.setButtonDimensions = function (width, height) { + this.settings.button_width = width; + this.settings.button_height = height; + + var movie = this.getMovieElement(); + if (movie != undefined) { + movie.style.width = width + "px"; + movie.style.height = height + "px"; + } + + this.callFlash("SetButtonDimensions", [width, height]); + }; + // Public: setButtonText Changes the text overlaid on the button + SWFUpload.prototype.setButtonText = function (html) { + this.settings.button_text = html; + this.callFlash("SetButtonText", [html]); + }; + // Public: setButtonTextPadding changes the top and left padding of the text overlay + SWFUpload.prototype.setButtonTextPadding = function (left, top) { + this.settings.button_text_top_padding = top; + this.settings.button_text_left_padding = left; + this.callFlash("SetButtonTextPadding", [left, top]); + }; + + // Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button + SWFUpload.prototype.setButtonTextStyle = function (css) { + this.settings.button_text_style = css; + this.callFlash("SetButtonTextStyle", [css]); + }; + // Public: setButtonDisabled disables/enables the button + SWFUpload.prototype.setButtonDisabled = function (isDisabled) { + this.settings.button_disabled = isDisabled; + this.callFlash("SetButtonDisabled", [isDisabled]); + }; + // Public: setButtonAction sets the action that occurs when the button is clicked + SWFUpload.prototype.setButtonAction = function (buttonAction) { + this.settings.button_action = buttonAction; + this.callFlash("SetButtonAction", [buttonAction]); + }; + + // Public: setButtonCursor changes the mouse cursor displayed when hovering over the button + SWFUpload.prototype.setButtonCursor = function (cursor) { + this.settings.button_cursor = cursor; + this.callFlash("SetButtonCursor", [cursor]); + }; + + /* ******************************* + Flash Event Interfaces + These functions are used by Flash to trigger the various + events. + + All these functions a Private. + + Because the ExternalInterface library is buggy the event calls + are added to a queue and the queue then executed by a setTimeout. + This ensures that events are executed in a determinate order and that + the ExternalInterface bugs are avoided. + ******************************* */ + + SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) { + // Warning: Don't call this.debug inside here or you'll create an infinite loop + + if (argumentArray == undefined) { + argumentArray = []; + } else if (!(argumentArray instanceof Array)) { + argumentArray = [argumentArray]; + } + + var self = this; + if (typeof this.settings[handlerName] === "function") { + // Queue the event + this.eventQueue.push(function () { + this.settings[handlerName].apply(this, argumentArray); + }); + + // Execute the next queued event + setTimeout(function () { + self.executeNextEvent(); + }, 0); + + } else if (this.settings[handlerName] !== null) { + throw "Event handler " + handlerName + " is unknown or is not a function"; + } + }; + + // Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout + // we must queue them in order to garentee that they are executed in order. + SWFUpload.prototype.executeNextEvent = function () { + // Warning: Don't call this.debug inside here or you'll create an infinite loop + + var f = this.eventQueue ? this.eventQueue.shift() : null; + if (typeof(f) === "function") { + f.apply(this); + } + }; + + // Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have + // properties that contain characters that are not valid for JavaScript identifiers. To work around this + // the Flash Component escapes the parameter names and we must unescape again before passing them along. + SWFUpload.prototype.unescapeFilePostParams = function (file) { + var reg = /[$]([0-9a-f]{4})/i; + var unescapedPost = {}; + var uk; + + if (file != undefined) { + for (var k in file.post) { + if (file.post.hasOwnProperty(k)) { + uk = k; + var match; + while ((match = reg.exec(uk)) !== null) { + uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16))); + } + unescapedPost[uk] = file.post[k]; + } + } + + file.post = unescapedPost; + } + + return file; + }; + + // Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working) + SWFUpload.prototype.testExternalInterface = function () { + try { + return this.callFlash("TestExternalInterface"); + } catch (ex) { + return false; + } + }; + + // Private: This event is called by Flash when it has finished loading. Don't modify this. + // Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded. + SWFUpload.prototype.flashReady = function () { + // Check that the movie element is loaded correctly with its ExternalInterface methods defined + var movieElement = this.getMovieElement(); + + if (!movieElement) { + this.debug("Flash called back ready but the flash movie can't be found."); + return; + } + + this.cleanUp(movieElement); + + this.queueEvent("swfupload_loaded_handler"); + }; + + // Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE. + // This function is called by Flash each time the ExternalInterface functions are created. + SWFUpload.prototype.cleanUp = function (movieElement) { + // Pro-actively unhook all the Flash functions + try { + if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE + this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)"); + for (var key in movieElement) { + try { + if (typeof(movieElement[key]) === "function") { + movieElement[key] = null; + } + } catch (ex) { + } + } + } + } catch (ex1) { + + } + + // Fix Flashes own cleanup code so if the SWFMovie was removed from the page + // it doesn't display errors. + window["__flash__removeCallback"] = function (instance, name) { + try { + if (instance) { + instance[name] = null; + } + } catch (flashEx) { + + } + }; + + }; + + + /* This is a chance to do something before the browse window opens */ + SWFUpload.prototype.fileDialogStart = function () { + this.queueEvent("file_dialog_start_handler"); + }; + + + /* Called when a file is successfully added to the queue. */ + SWFUpload.prototype.fileQueued = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("file_queued_handler", file); + }; + + + /* Handle errors that occur when an attempt to queue a file fails. */ + SWFUpload.prototype.fileQueueError = function (file, errorCode, message) { + file = this.unescapeFilePostParams(file); + this.queueEvent("file_queue_error_handler", [file, errorCode, message]); + }; + + /* Called after the file dialog has closed and the selected files have been queued. + You could call startUpload here if you want the queued files to begin uploading immediately. */ + SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) { + this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]); + }; + + SWFUpload.prototype.uploadStart = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("return_upload_start_handler", file); + }; + + SWFUpload.prototype.returnUploadStart = function (file) { + var returnValue; + if (typeof this.settings.upload_start_handler === "function") { + file = this.unescapeFilePostParams(file); + returnValue = this.settings.upload_start_handler.call(this, file); + } else if (this.settings.upload_start_handler != undefined) { + throw "upload_start_handler must be a function"; + } + + // Convert undefined to true so if nothing is returned from the upload_start_handler it is + // interpretted as 'true'. + if (returnValue === undefined) { + returnValue = true; + } + + returnValue = !!returnValue; + + this.callFlash("ReturnUploadStart", [returnValue]); + }; + + + + SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]); + }; + + SWFUpload.prototype.uploadError = function (file, errorCode, message) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_error_handler", [file, errorCode, message]); + }; + + SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_success_handler", [file, serverData, responseReceived]); + }; + + SWFUpload.prototype.uploadComplete = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_complete_handler", file); + }; + + /* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the + internal debug console. You can override this event and have messages written where you want. */ + SWFUpload.prototype.debug = function (message) { + this.queueEvent("debug_handler", message); + }; + + + /* ********************************** + Debug Console + The debug console is a self contained, in page location + for debug message to be sent. The Debug Console adds + itself to the body if necessary. + + The console is automatically scrolled as messages appear. + + If you are using your own debug handler or when you deploy to production and + have debug disabled you can remove these functions to reduce the file size + and complexity. + ********************************** */ + + // Private: debugMessage is the default debug_handler. If you want to print debug messages + // call the debug() function. When overriding the function your own function should + // check to see if the debug setting is true before outputting debug information. + SWFUpload.prototype.debugMessage = function (message) { + if (this.settings.debug) { + var exceptionMessage, exceptionValues = []; + + // Check for an exception object and print it nicely + if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") { + for (var key in message) { + if (message.hasOwnProperty(key)) { + exceptionValues.push(key + ": " + message[key]); + } + } + exceptionMessage = exceptionValues.join("\n") || ""; + exceptionValues = exceptionMessage.split("\n"); + exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: "); + SWFUpload.Console.writeLine(exceptionMessage); + } else { + SWFUpload.Console.writeLine(message); + } + } + }; + + SWFUpload.Console = {}; + SWFUpload.Console.writeLine = function (message) { + var console, documentForm; + + try { + console = document.getElementById("SWFUpload_Console"); + + if (!console) { + documentForm = document.createElement("form"); + document.getElementsByTagName("body")[0].appendChild(documentForm); + + console = document.createElement("textarea"); + console.id = "SWFUpload_Console"; + console.style.fontFamily = "monospace"; + console.setAttribute("wrap", "off"); + console.wrap = "off"; + console.style.overflow = "auto"; + console.style.width = "700px"; + console.style.height = "350px"; + console.style.margin = "5px"; + documentForm.appendChild(console); + } + + console.value += message + "\n"; + + console.scrollTop = console.scrollHeight - console.clientHeight; + } catch (ex) { + alert("Exception: " + ex.name + " Message: " + ex.message); + } + }; + + })(); + + (function() { + /* + Queue Plug-in + + Features: + *Adds a cancelQueue() method for cancelling the entire queue. + *All queued files are uploaded when startUpload() is called. + *If false is returned from uploadComplete then the queue upload is stopped. + If false is not returned (strict comparison) then the queue upload is continued. + *Adds a QueueComplete event that is fired when all the queued files have finished uploading. + Set the event handler with the queue_complete_handler setting. + + */ + + if (typeof(SWFUpload) === "function") { + SWFUpload.queue = {}; + + SWFUpload.prototype.initSettings = (function (oldInitSettings) { + return function () { + if (typeof(oldInitSettings) === "function") { + oldInitSettings.call(this); + } + + this.queueSettings = {}; + + this.queueSettings.queue_cancelled_flag = false; + this.queueSettings.queue_upload_count = 0; + + this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler; + this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler; + this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler; + this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler; + + this.settings.queue_complete_handler = this.settings.queue_complete_handler || null; + }; + })(SWFUpload.prototype.initSettings); + + SWFUpload.prototype.startUpload = function (fileID) { + this.queueSettings.queue_cancelled_flag = false; + this.callFlash("StartUpload", [fileID]); + }; + + SWFUpload.prototype.cancelQueue = function () { + this.queueSettings.queue_cancelled_flag = true; + this.stopUpload(); + + var stats = this.getStats(); + while (stats.files_queued > 0) { + this.cancelUpload(); + stats = this.getStats(); + } + }; + + SWFUpload.queue.uploadStartHandler = function (file) { + var returnValue; + if (typeof(this.queueSettings.user_upload_start_handler) === "function") { + returnValue = this.queueSettings.user_upload_start_handler.call(this, file); + } + + // To prevent upload a real "FALSE" value must be returned, otherwise default to a real "TRUE" value. + returnValue = (returnValue === false) ? false : true; + + this.queueSettings.queue_cancelled_flag = !returnValue; + + return returnValue; + }; + + SWFUpload.queue.uploadCompleteHandler = function (file) { + var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler; + var continueUpload; + + if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) { + this.queueSettings.queue_upload_count++; + } + + if (typeof(user_upload_complete_handler) === "function") { + continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true; + } else if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) { + // If the file was stopped and re-queued don't restart the upload + continueUpload = false; + } else { + continueUpload = true; + } + + if (continueUpload) { + var stats = this.getStats(); + if (stats.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) { + this.startUpload(); + } else if (this.queueSettings.queue_cancelled_flag === false) { + this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]); + this.queueSettings.queue_upload_count = 0; + } else { + this.queueSettings.queue_cancelled_flag = false; + this.queueSettings.queue_upload_count = 0; + } + } + }; + } + + })(); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('pagebreak', function(K) { + var self = this; + var name = 'pagebreak'; + var pagebreakHtml = K.undef(self.pagebreakHtml, '
        '); + + self.clickToolbar(name, function() { + var cmd = self.cmd, + range = cmd.range; + self.focus(); + var tail = self.newlineTag == 'br' || K.WEBKIT ? '' : ''; + self.insertHtml(pagebreakHtml + tail); + if(tail !== '') { + var p = K('#__kindeditor_tail_tag__', self.edit.doc); + range.selectNodeContents(p[0]); + p.removeAttr('id'); + cmd.select(); + } + }); +}); +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('plainpaste', function(K) { + var self = this, + name = 'plainpaste'; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '
        ' + + '
        ' + lang.comment + '
        ' + + '' + + '
        ', + dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var html = textarea.val(); + html = K.escape(html); + html = html.replace(/ {2}/g, '  '); + if(self.newlineTag == 'p') { + html = html.replace(/^/, '

        ').replace(/$/, '

        ').replace(/\n/g, '

        '); + } else { + html = html.replace(/\n/g, '
        $&'); + } + self.insertHtml(html).hideDialog().focus(); + } + } + }), + textarea = K('textarea', dialog.div); + textarea[0].focus(); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('preview', function(K) { + var self = this, + name = 'preview'; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '

        ' + + '' + + '
        ', + dialog = self.createDialog({ + name: name, + width: 750, + title: self.lang(name), + body: html + }), + iframe = K('iframe', dialog.div), + doc = K.iframeDoc(iframe); + doc.open(); + doc.write(self.fullHtml()); + doc.write(''); + var cssData = self.options.cssData; + var cssPath = self.options.cssPath; + var bodyClass = self.options.bodyClass; + if(!K.isArray(cssPath)) { + cssPath = [cssPath]; + } + K.each(cssPath, function(i, path) { + if(path) { + doc.write(''); + } + }); + if(cssData) { + doc.write(''); + } + doc.close(); + var body = K(doc.body).css('background-color', '#FFF'); + if (bodyClass) { + body.addClass(bodyClass); + } + iframe[0].contentWindow.focus(); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('quickformat', function(K) { + var self = this, + name = 'quickformat', + blockMap = K.toMap('blockquote,center,div,h1,h2,h3,h4,h5,h6,p'); + + function getFirstChild(knode) { + var child = knode.first(); + while(child && child.first()) { + child = child.first(); + } + return child; + } + self.clickToolbar(name, function() { + self.focus(); + var doc = self.edit.doc, + range = self.cmd.range, + child = K(doc.body).first(), + next, + nodeList = [], + subList = [], + bookmark = range.createBookmark(true); + while(child) { + next = child.next(); + var firstChild = getFirstChild(child); + if(!firstChild || firstChild.name != 'img') { + if(blockMap[child.name]) { + child.html(child.html().replace(/^(\s| | )+/ig, '')); + child.css('text-indent', '2em'); + } else { + subList.push(child); + } + if(!next || (blockMap[next.name] || blockMap[child.name] && !blockMap[next.name])) { + if(subList.length > 0) { + nodeList.push(subList); + } + subList = []; + } + } + child = next; + } + K.each(nodeList, function(i, subList) { + var wrapper = K('

        ', doc); + subList[0].before(wrapper); + K.each(subList, function(i, knode) { + wrapper.append(knode); + }); + }); + range.moveToBookmark(bookmark); + self.addBookmark(); + }); +}); + +/** +-------------------------- +abcd
        +1234
        + +to + +

        + abcd
        + 1234
        +

        + +-------------------------- + +  abcd1233 +

        1234

        + +to + +

        abcd1233

        +

        1234

        + +-------------------------- +*/ +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('template', function(K) { + var self = this, + name = 'template', + lang = self.lang(name + '.'), + htmlPath = self.pluginsPath + name + '/html/'; + + function getFilePath(fileName) { + return htmlPath + fileName + '?ver=' + encodeURIComponent(K.DEBUG ? K.TIME : K.VERSION); + } + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + arr = ['
        ', + '
        ', + // left start + '
        ', + lang.selectTemplate + '
        ', + // right start + '
        ', + ' ', + '
        ', + '
        ', + '
        ', + '', + '
        ' + ].join(''); + var dialog = self.createDialog({ + name: name, + width: 500, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var doc = K.iframeDoc(iframe); + self[checkbox[0].checked ? 'html' : 'insertHtml'](doc.body.innerHTML).hideDialog().focus(); + } + } + }); + var selectBox = K('select', dialog.div), + checkbox = K('[name="replaceFlag"]', dialog.div), + iframe = K('iframe', dialog.div); + checkbox[0].checked = true; + iframe.attr('src', getFilePath(selectBox.val())); + selectBox.change(function() { + iframe.attr('src', getFilePath(this.value)); + }); + }); +}); + +/******************************************************************************* + * KindEditor - WYSIWYG HTML Editor for Internet + * Copyright (C) 2006-2011 kindsoft.net + * + * @author Roddy + * @site http://www.kindsoft.net/ + * @licence http://www.kindsoft.net/license.php + *******************************************************************************/ + +KindEditor.plugin('wordpaste', function(K) { + var self = this, + name = 'wordpaste'; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '
        ' + + '
        ' + lang.comment + '
        ' + + '' + + '
        ', + dialog = self.createDialog({ + name: name, + width: 450, + title: self.lang(name), + body: html, + yesBtn: { + name: self.lang('yes'), + click: function(e) { + var str = doc.body.innerHTML; + str = K.clearMsWord(str, self.filterMode ? self.htmlTags : K.options.htmlTags); + self.insertHtml(str).hideDialog().focus(); + } + } + }), + div = dialog.div, + iframe = K('iframe', div), + doc = K.iframeDoc(iframe); + if(!K.IE) { + doc.designMode = 'on'; + } + doc.open(); + doc.write('WordPaste'); + doc.write(''); + if(!K.IE) { + doc.write('
        '); + } + doc.write(''); + doc.close(); + if(K.IE) { + doc.body.contentEditable = 'true'; + } + iframe[0].contentWindow.focus(); + }); +}); + + +/* ======================================================================== + * ZUI: Kindeditor plugin - zui + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2019-2019 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + $.each(['afterBlur', 'afterFocus', 'afterChange', 'afterTab'], function(_index, name) { + KindEditor.EditorClass.prototype[name] = function(fn) { + return this.handler(name, fn); + }; +}); + +KindEditor.plugin('zui', function(K) { + var self = this; + var options = self.options; + self.uuid = $.zui.uuid(); + + self.afterBlur(function() { + if (options.syncAfterBlur) { + self.sync(); + } + self.container.removeClass('focus'); + }); + + self.afterFocus(function() { + self.container.addClass('focus'); + }); + + self.afterChange(function() { + self.edit.srcElement.change().hide(); + }); + + self.afterCreate(function() { + $(self.edit.srcElement[0]).data('keditor', self); + + var spellcheck = options.spellcheck; + if (spellcheck !== undefined) { + self.edit.doc.documentElement.setAttribute('spellcheck', spellcheck); + } + }); + + if (options.transferTab !== false) { + var nextFormControl = 'input:not([type="hidden"]), textarea:not(.ke-edit-textarea), button[type="submit"], select'; + self.afterTab(function() { + var $editor = $(self.edit.srcElement[0]); + var $next = $editor.next(nextFormControl); + if(!$next.length) $next = $editor.parent().next().find(nextFormControl); + if(!$next.length) $next = $editor.parent().parent().next().find(nextFormControl); + $next = $next.first(); + if ($next.length) { + var keditor = $next.data('keditor'); + if(keditor) { + keditor.focus(); + } else { + $next.focus(); + } + return true; + } + return true; + }); + } +}); +/* ======================================================================== + * ZUI: Kindeditor plugin - placeholder + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2019-2019 cnezsoft.com; Licensed MIT + * ======================================================================== */ + +KindEditor.EditorClass.prototype.setPlaceholder = function(placeholder, asHtml) { + var self = this; + var options = self.options; + var edit = self.edit; + var $doc = $(edit.doc); + var $placeholder = $doc.find('.kindeditor-ph'); + if (!$placeholder.length) { + $placeholder = $('
        '); + if (options.placeholderStyle) { + $placeholder.css(options.placeholderStyle); + } + $doc.find('body').after($placeholder); + } + if (self.plugin.hasContent()) { + $placeholder.hide(); + } + $placeholder[asHtml ? 'html' : 'text'](placeholder); +}; + +KindEditor.EditorClass.prototype.getPlaceholder = function(asHtml) { + return $(this.edit.doc).find('.kindeditor-ph')[asHtml ? 'html' : 'text'](); +}; + +KindEditor.plugin('placeholder', function(K) { + var self = this; + + self.plugin.hasContent = function() { + return self.html().replace(/\s|\n|\r|\t/g, '').replace(//g, '').replace(/

        <\/p>/g, '') !== ''; + }; + + self.afterBlur(function() { + if (!self.plugin.hasContent()) { + $(self.edit.doc).find('.kindeditor-ph').show(); + } + }); + + self.afterFocus(function() { + $(self.edit.doc).find('.kindeditor-ph').hide(); + }); + + self.afterCreate(function() { + var options = self.options; + if (options.placeholderHtml) { + self.setPlaceholder(options.placeholderHtml, true); + } else if (options.placeholder) { + self.setPlaceholder(options.placeholder); + } + }); +}); +/* ======================================================================== + * ZUI: Kindeditor plugin - paste-image + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2019-2019 cnezsoft.com; Licensed MIT + * ======================================================================== */ + +KindEditor.plugin('pasteimage', function(K) { + var self = this; + var allLangs = { + zh_cn: { + notSupportMsg: '您的浏览器不支持粘贴图片!', + placeholder: '可以在编辑器直接贴图。', + failMsg: '贴图失败,请稍后重试。', + uploadingHint: '正在上传图片,请稍后...', + }, + zh_tw: { + notSupportMsg: '您的瀏覽器不支持粘貼圖片!', + placeholder: '可以在編輯器直接貼圖。', + failMsg: '貼圖失敗,請稍後重試。', + uploadingHint: '正在上傳圖片,請稍後...', + }, + en: { + notSupportMsg: 'Image is not allowed to paste in your browser!', + placeholder: 'Paste images here.', + failMsg: 'Pasting image failed. Try again later.', + uploadingHint: 'Uploading...', + } + }; + var lang = $.extend({}, allLangs[($.clientLang || $.zui.clientLang)()]); + self.afterCreate(function() { + var edit = self.edit; + var doc = edit.doc; + var uuid = self.uuid; + var options = self.options.pasteImage; + if (!options) { + return; + } + if (typeof options === 'string') { + options = {postUrl: options}; + } + $.extend({ + placeholder: placeholder + }, options); + if(!K.WEBKIT && !K.GECKO) + { + $(doc.body).on('keyup.ke' + uuid, function(ev) + { + if(ev.keyCode == 86 && ev.ctrlKey) alert(lang.notSupportMsg); + }); + } + + if(self.setPlaceholder) + { + var placeholder = options.placeholder; + if (placeholder === true) placeholder = lang.placeholder; + if (placeholder) { + var oldPlaceholder = self.getPlaceholder(); + if (!oldPlaceholder) oldPlaceholder = placeholder; + else if (oldPlaceholder.indexOf(placeholder) < 0) placeholder = oldPlaceholder + '\n' + placeholder; + self.setPlaceholder(placeholder); + } + } + + var pasteBegin = function() { + // if ($.enableForm) { + // $.enableForm(false, 0, 1); + // $('body').one('click.ke' + uuid, function(){$.enableForm(true);}); + // } + if (options.beforePaste) { + options.beforePaste(); + } + var imageLoadingEle = '

        ' + lang.uploadingHint + '
        '; + edit.cmd.inserthtml(imageLoadingEle); + self.readonly(true); + }; + + var pasteEnd = function(error) { + if(error) { + if (options.onError) { + options.onError(error); + } else { + if(error === true) error = lang.failMsg; + if ($.zui && $.zui.messager) { + $.zui.messager.danger(error, {placement: 'center'}); + } + } + } + // if ($.enableForm) { + // $.enableForm(true, 0, 1); + // } + // $('body').off('.ke' + uuid); + if (options.afterPaste) { + options.afterPaste(); + } + $(doc.body).find('.image-loading-ele').remove(); + self.readonly(false); + }; + + var pasteUrl = options.postUrl; + $(doc.body).on('paste.ke' + uuid, function(ev) { + if (K.WEBKIT) { + /* Paste in chrome.*/ + /* Code reference from http://www.foliotek.com/devblog/copy-images-from-clipboard-in-javascript/. */ + var original = ev.originalEvent; + var clipboardItems = original.clipboardData && original.clipboardData.items; + var clipboardItem = null; + if(clipboardItems) { + var IMAGE_MIME_REGEX = /^image\/(p?jpeg|gif|png)$/i; + for (var i = 0; i < clipboardItems.length; i++) + { + if (IMAGE_MIME_REGEX.test(clipboardItems[i].type)) + { + clipboardItem = clipboardItems[i]; + break; + } + } + } + var file = clipboardItem && clipboardItem.getAsFile(); + if (!file) return; + original.preventDefault(); + pasteBegin(); + + var reader = new FileReader(); + reader.onload = function(evt) { + var result = evt.target.result; + // var arr = result.split(","); + // var data = arr[1]; // raw base64 + // var contentType = arr[0].split(";")[0].split(":")[1]; + + var html = ''; + $.post(pasteUrl, {editor: html}, function(data) + { + if (data) { + edit.cmd.inserthtml(data); + } else { + edit.cmd.inserthtml(html); + } + pasteEnd(); + }).error(function() + { + pasteEnd(true); + }); + }; + reader.readAsDataURL(file); + } else { + /* Paste in firefox and other browsers. */ + setTimeout(function() { + var html = K(doc.body).html(); + if(html.search(/ +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('table', function (K) { + var self = this; + var name = 'table'; + var allLangs = { + zh_cn: { + name: '表格', + xRxC: '{0}行 × {1}列', + headerRow: '标题行', + headerCol: '标题列', + tableStyle: '表格样式', + addHeaderRow: '添加表格标题行', + stripedRows: '隔行变色效果', + hoverRows: '鼠标悬停效果', + autoChangeTableWidth: '自动调整表格尺寸', + tableWidthFixed: '按表格文字自适应', + tableWidthFull: '按页面宽度自适应', + tableBorder: '表格边框', + tableHead: '标题', + tableContent: '内容', + mergeCells: '合并单元格', + defaultColor: '默认颜色', + color: '颜色', + forecolor: '文字颜色', + backcolor: '背景颜色', + invalidBoderWidth: '邊框大小必須為數字。' + }, + zh_tw: { + name: '表格', + xRxC: '{0}行×{1}列', + headerRow: '標題行', + headerCol: '標題列', + tableStyle: '表格樣式', + addHeaderRow: '添加表格標題行', + stripedRows: '隔行變色效果', + hoverRows: '鼠標懸停效果', + autoChangeTableWidth: '自動調整表格尺寸', + tableWidthFixed: '按表格文字自適應', + tableWidthFull: '按頁面寬度自適應', + tableBorder: '表格邊框', + tableHead: '標題', + tableContent: '內容', + mergeCells: '合併單元格', + defaultColor: '默認顏色', + color: '顏色', + forecolor: '文字顏色', + backcolor: '背景顏色', + invalidBoderWidth: '边框大小必须为数字。' + }, + en: { + name: 'Table', + xRxC: '{0} Rows × {1} Columns', + headerRow: 'Header Row', + headerCol: 'Header Column', + tableStyle: 'Table style', + addHeaderRow: 'Add header row', + stripedRows: 'Striped effection', + hoverRows: 'Mouse hover effection', + autoChangeTableWidth: 'Automatically adjust table size', + tableWidthFixed: 'Adaptive by form text', + tableWidthFull: 'Page width adaptive', + tableBorder: 'Table border', + tableHead: 'Title', + tableContent: 'Text', + mergeCells: 'Merge Cells', + defaultColor: 'Default color', + color: 'Color', + forecolor: 'Text Color', + backcolor: 'Back Color', + invalidBoderWidth: 'Border width value must be number' + } + }; + var $elements = []; + var lang = $.extend({}, self.lang('table.'), allLangs[($.clientLang || $.zui.clientLang)()]); + var defaultTableBorderColor = self.options.tableBorderColor || '#ddd'; + + self.tableIdIndex = 0; + + // 设置颜色 + function _setColor(box, color) { + color = color.toUpperCase(); + box.css('background-color', color); + if (color) { + if ($ && $.zui && $.zui.Color) { + box.css('color', new $.zui.Color(color).contrast().toCssStr()); + } else { + box.css('color', (color === '#FFF' || color === '#FFFFFF') ? '#000' : '#FFF'); + } + } + box.name === 'input' ? box.val(color) : box.html(color); + } + // 初始化取色器 + var pickerList = []; + function _initColorPicker(dialogDiv, colorBox, onSetColor) { + colorBox.bind('click,mousedown', function (e) { + e.stopPropagation(); + }); + function removePicker() { + K.each(pickerList, function () { + this.remove(); + }); + pickerList = []; + K(document).unbind('click,mousedown', removePicker); + dialogDiv.unbind('click,mousedown', removePicker); + } + colorBox.click(function (e) { + removePicker(); + var box = K(this), + pos = box.pos(); + var picker = K.colorpicker({ + x: pos.x, + y: pos.y + box.height(), + z: 811214, + selectedColor: K(this).val(), + colors: self.colorTable, + noColor: lang['defaultColor'], + shadowMode: self.shadowMode, + click: function (color) { + _setColor(box, color); + removePicker(); + onSetColor && onSetColor(color); + } + }); + pickerList.push(picker); + K(document).bind('click,mousedown', removePicker); + dialogDiv.bind('click,mousedown', removePicker); + }); + } + // 取得下一行cell的index + function _getCellIndex(table, row, cell) { + var rowSpanCount = 0; + for (var i = 0, len = row.cells.length; i < len; i++) { + if (row.cells[i] == cell) { + break; + } + rowSpanCount += row.cells[i].rowSpan - 1; + } + return cell.cellIndex - rowSpanCount; + } + + function removeEvent() { + K.each($elements, function () { + this.off('.kTable'); + }); + } + + function updateTable(setting, $table, onUpdateSetting) { + if (!$table) { + var table = self.plugin.getSelectedTable(); + $table = $(table[0]); + } + if (!$table || !$table.length) return; + if (!setting) { + setting = $.extend({ + borderColor: defaultTableBorderColor + }, self.tableSetting, setting); + if (setting.autoWidth === undefined) { + setting.autoWidth = $table[0].style.width === 'auto'; + } + if (setting.stripedRows === undefined) { + var $rows = $table.find('tbody>tr'); + var coloredRowsLength = $rows.filter(function () { + return !!this.style.backgroundColor; + }).length; + setting.stripedRows = coloredRowsLength >= Math.floor($rows / 2); + } + } + self.tableSetting = setting; + if (setting.header !== undefined) { + if ($table.is('.ke-plugin-table-example')) { + $table.find('thead').toggleClass('hidden', !setting.header); + } else { + var $thead = $table.find('thead'); + if (setting.header) { + if (!$thead.length) { + var theadHtml = ['
        ']; + var $firstRow = $table.find('tbody>tr:first').children(); + var colsCount = 0; + $firstRow.each(function () { + var $cell = $(this); + var cellSpan = $cell.attr('colspan'); + colsCount += cellSpan ? parseInt(cellSpan) : 1; + }); + for (var i = 0; i < colsCount; ++i) { + theadHtml.push(''); + } + theadHtml.push(''); + $thead = $(theadHtml.join('')); + $table.prepend($thead); + } + } else { + $thead.remove(); + } + } + onUpdateSetting && onUpdateSetting('header', setting.header); + } + if (setting.stripedRows !== undefined) { + var $rows = $table.find('tbody>tr'); + $rows.each(function (index) { + $(this).css('background-color', (setting.stripedRows && (index % 2 === 0)) ? '#f9f9f9' : 'none'); + }); + onUpdateSetting && onUpdateSetting('stripedRows', setting.stripedRows); + } + // if (setting.hoverRows !== undefined) { + // $table.toggleClass('table-hover', !!setting.hoverRows); + // onUpdateSetting && onUpdateSetting('hoverRows', setting.hoverRows); + // } + if (setting.autoWidth !== undefined) { + $table.css(setting.autoWidth ? { + width: 'auto', + maxWidth: '100%' + } : { + width: '100%', + }); + onUpdateSetting && onUpdateSetting('autoWidth', setting.autoWidth); + } + if (setting.borderColor !== undefined) { + $table.find('td,th').css('border-color', setting.borderColor); + onUpdateSetting && onUpdateSetting('borderColor', setting.borderColor); + } + } + + function insertTable(row, col, headerRow, headerCol) { + if (!(row * col)) { + return; + } + var tableID = 'ke-table-' + (self.tableIdIndex++); + var $table = $('
        ' + (K.IE ? ' ' : '
        ') + '
        '); + var $body = $(''); + for (var r = 0; r < row; r++) { + var $row = $(''); + for (var c = 0; c < col; c++) { + var $cell = $('' + (K.IE ? ' ' : '
        ') + ''); + $row.append($cell); + } + $body.append($row); + } + $table.append($body); + var html = $('
        ').append($table).html(); + if (!K.IE) { + html += '
        '; + } + self.insertHtml(html); + var $table = $(self.edit.doc).find('#' + tableID); + $table.attr('id', null); + self.cmd.range.selectNodeContents($table.find('th,td').first()[0]).collapse(true); + self.cmd.select(); + self.addBookmark(); + return $table; + } + + function modifyTable(table) { + var $table = $(table[0]); + var theadHtml = ['']; + var tbodyHtml = ['']; + for (var i = 0; i < 6; ++i) { + theadHtml.push('{tableHead}'); + tbodyHtml.push(''); + for (var j = 0; j < 6; ++j) { + tbodyHtml.push('{tableContent}'); + } + tbodyHtml.push(''); + } + theadHtml.push(''); + tbodyHtml.push(''); + var dialogHtml = [ + '
        ', + '
        ', + '
        ', + '
        ', + '', + '
        ', + '
        ', + // '
        ', + '
        ', + '
        ', + '', + '
        ', + '
        ', + '
        ', + '
        ', + '', + '
        ', + '{borderColor}', + '', + '
        ', + '
        ', + '
        ', + '
        ', + '', + theadHtml.join(''), + tbodyHtml.join(''), + '
        ', + '', + '', + '' + ].join('').format(lang); + var $dialog = $(dialogHtml); + var $exampleTable = $dialog.find('.ke-plugin-table-example'); + var bookmark = self.cmd.range.createBookmark(); + var $colorBox = $dialog.find('.ke-plugin-table-input-color'); + var colorBox = K($colorBox[0]); + $dialog.on('change.kTable', 'input[name]', function () { + var $input = $(this); + var updateSetting = {}; + updateSetting[$input.attr('name')] = $input.is('[type="checkbox"]') ? $input.is(':checked') : $input.val(); + updateTable(updateSetting, $exampleTable); + }); + + var dialog = self.createDialog({ + name: name + 'Dialog', + width: 550, + title: self.lang(name), + body: $dialog[0], + beforeRemove: function () { + $dialog.off('.kTable'); + }, + yesBtn: { + name: self.lang('yes'), + click: function (e) { + updateTable({ + borderColor: $dialog.find('[name="borderColor"]').val(), + header: $dialog.find('[name="header"]').is(':checked'), + stripedRows: $dialog.find('[name="stripedRows"]').is(':checked'), + hoverRows: $dialog.find('[name="hoverRows"]').is(':checked'), + autoWidth: $dialog.find('[name="autoWidth"]:checked').val(), + }, $table); + self.hideDialog().focus(); + self.cmd.range.moveToBookmark(bookmark); + self.cmd.select(); + self.addBookmark(); + } + } + }); + _initColorPicker(dialog.div, colorBox, function (color) { + updateTable({ borderColor: color }, $exampleTable); + }); + + updateTable(self.tableSetting, $exampleTable, function (name, value) { + switch (name) { + case 'borderColor': + _setColor(colorBox, value || defaultTableBorderColor); + break; + case 'header': + $dialog.find('[name="header"]').prop('checked', !!value); + break; + case 'stripedRows': + $dialog.find('[name="stripedRows"]').prop('checked', !!value); + break; + case 'hoverRows': + $dialog.find('[name="hoverRows"]').prop('checked', !!value); + break; + case 'autoWidth': + $dialog.find('[name="autoWidth"][value="' + (value ? 'auto' : '') + '"]').prop('checked', true); + break; + } + }); + } + + if (!self.plugin.table) { + self.plugin.table = { + // modify table + prop: function () { + var table = self.plugin.getSelectedTable(); + if (table && table.length) { + modifyTable(table); + } + }, + //modify cell + cellprop: function () { + var html = [ + '
        ', + //width, height + '
        ', + '', + '
        ', + '
        ', + '' + lang.width + '', + '', + '', + '', + '
        ', + '
        ', + '
        ', + '
        ', + '' + lang.height + '', + '', + '', + '', + '
        ', + '
        ', + '
        ', + //align + '
        ', + '', + '
        ', + '
        ', + '' + lang.textAlign + '', + '', + '
        ', + '
        ', + '
        ', + '
        ', + '' + lang.verticalAlign + '', + '', + '
        ', + '
        ', + '
        ', + //border + '
        ', + '', + '
        ', + '
        ', + '' + lang.borderColor + '', + '', + '
        ', + '
        ', + '
        ', + '
        ', + '' + lang.size + '', + '', + 'px', + '
        ', + '
        ', + '
        ', + //background color + '
        ', + '', + '
        ', + '
        ', + '' + lang.forecolor + '', + '', + '
        ', + '
        ', + '
        ', + '
        ', + '' + lang.backcolor + '', + '', + '
        ', + '
        ', + '
        ', + '
        ', + ].join(''); + var bookmark = self.cmd.range.createBookmark(); + var div, widthBox, heightBox, widthTypeBox, widthTypeBox, textAlignBox, verticalAlignBox, colorBox, borderWidthBox; + var dialog = self.createDialog({ + name: name, + width: 500, + title: self.lang('tablecell'), + body: html, + beforeRemove: function () { + colorBox.unbind(); + }, + yesBtn: { + name: self.lang('yes'), + click: function (e) { + var width = widthBox.val(), + height = heightBox.val(), + widthType = widthTypeBox.val(), + heightType = heightTypeBox.val(), + textAlign = textAlignBox.val(), + verticalAlign = verticalAlignBox.val(), + borderWidth = borderWidthBox.val() + 'px', + borderColor = K(colorBox[0]).val() || '', + textColor = K(colorBox[1]).val() || '', + bgColor = K(colorBox[2]).val() || ''; + if (!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if (!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + if (!/^\d*$/.test(borderWidth)) { + alert(lang.invalidBoderWidth); + borderWidthBox[0].focus(); + return; + } + var cells = self.plugin.getAllSelectedCells(); + var style = { + width: width !== '' ? (width + widthType) : '', + height: height !== '' ? (height + heightType) : '', + 'background-color': bgColor, + 'text-align': textAlign, + 'border-width': borderWidth, + 'vertical-align': verticalAlign, + 'border-color': borderColor, + color: textColor + }; + for(var i = 0; i < cells.length; ++i) { + cells.eq(i).css(style); + } + self.hideDialog().focus(); + self.cmd.range.moveToBookmark(bookmark); + self.cmd.select(); + self.addBookmark(); + } + } + }); + div = dialog.div, + widthBox = K('[name="width"]', div).val(100), + heightBox = K('[name="height"]', div), + widthTypeBox = K('[name="widthType"]', div), + heightTypeBox = K('[name="heightType"]', div), + textAlignBox = K('[name="textAlign"]', div), + verticalAlignBox = K('[name="verticalAlign"]', div), + borderWidthBox = K('[name="borderWidth"]', div), + colorBox = K('.ke-plugin-table-input-color', div); + _initColorPicker(div, colorBox.eq(0)); + _initColorPicker(div, colorBox.eq(1)); + _initColorPicker(div, colorBox.eq(2)); + _setColor(colorBox.eq(0), '#000000'); + _setColor(colorBox.eq(1), ''); + _setColor(colorBox.eq(2), ''); + // foucs and select + widthBox[0].focus(); + widthBox[0].select(); + // get selected cell + var cell = self.plugin.getSelectedCell(); + var match, + cellWidth = cell[0].style.width || cell[0].width || '', + cellHeight = cell[0].style.height || cell[0].height || ''; + if ((match = /^(\d+)((?:px|%)*)$/.exec(cellWidth))) { + widthBox.val(match[1]); + widthTypeBox.val(match[2]); + } else { + widthBox.val(''); + } + if ((match = /^(\d+)((?:px|%)*)$/.exec(cellHeight))) { + heightBox.val(match[1]); + heightTypeBox.val(match[2]); + } + var borderWidth = cell[0].style.borderWidth || ''; + if ((match = /^(\d+)((?:px)*)$/.exec(borderWidth))) { + borderWidthBox.val(match[1]); + } + textAlignBox.val(cell[0].style.textAlign || ''); + verticalAlignBox.val(cell[0].style.verticalAlign || ''); + _setColor(colorBox.eq(0), K.toHex(cell[0].style.borderColor || '')); + _setColor(colorBox.eq(1), K.toHex(cell[0].style.color || '')); + _setColor(colorBox.eq(2), K.toHex(cell[0].style.backgroundColor || '')); + widthBox[0].focus(); + widthBox[0].select(); + }, + insert: function () { + console.warn('Table insert not available.'); + }, + 'delete': function () { + var table = self.plugin.getSelectedTable(); + self.cmd.range.setStartBefore(table[0]).collapse(true); + self.cmd.select(); + table.remove(); + self.addBookmark(); + }, + colinsert: function (offset) { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + index = cell.cellIndex + offset; + // 取得第一行的index + index += table.rows[0].cells.length - row.cells.length; + + for (var i = 0, len = table.rows.length; i < len; i++) { + var newRow = table.rows[i], + newCell = newRow.insertCell(index), + isThead = newRow.parentNode.tagName === 'THEAD'; + newCell.outerHTML = '<' + (isThead ? 'th' : 'td') + (newCell.rowSpan > 1 ? ' rowspan="' + newCell.rowSpan + '"' : '') + (newCell.colSpan > 1 ? ' colspan="' + newCell.colSpan + '"' : '') + ' style="' + (isThead ? 'background-color: #f1f1f1;' : '') + 'border: 1px solid ' + ((self.tableSetting && self.tableSetting.borderColor) || defaultTableBorderColor) + '">' + (K.IE ? ' ' : '
        ') + ''; + // 调整下一行的单元格index + index = _getCellIndex(table, newRow, newCell); + } + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colinsertleft: function () { + this.colinsert(0); + }, + colinsertright: function () { + this.colinsert(1); + }, + rowinsert: function (offset) { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0]; + var rowIndex = row.rowIndex; + if (offset === 1) { + rowIndex = row.rowIndex + (cell.rowSpan - 1) + offset; + } + var newRow = table.insertRow(rowIndex); + var isThead = newRow.parentNode.tagName === 'THEAD'; + + for (var i = 0, len = row.cells.length; i < len; i++) { + // 调整cell个数 + if (row.cells[i].rowSpan > 1) { + len -= row.cells[i].rowSpan - 1; + } + var newCell = newRow.insertCell(i); + // copy colspan + if (offset === 1 && row.cells[i].colSpan > 1) { + newCell.colSpan = row.cells[i].colSpan; + } + newCell.outerHTML = '<' + (isThead ? 'th' : 'td') + (newCell.rowSpan > 1 ? ' rowspan="' + newCell.rowSpan + '"' : '') + (newCell.colSpan > 1 ? ' colspan="' + newCell.colSpan + '"' : '') + ' style="' + (isThead ? 'background-color: #f1f1f1;' : '') + 'border: 1px solid ' + ((self.tableSetting && self.tableSetting.borderColor) || defaultTableBorderColor) + '">' + (K.IE ? ' ' : '
        ') + ''; + + } + // 调整rowspan + for (var j = rowIndex; j >= 0; j--) { + var cells = table.rows[j].cells; + if (cells.length > i) { + for (var k = cell.cellIndex; k >= 0; k--) { + if (cells[k].rowSpan > 1) { + cells[k].rowSpan += 1; + } + } + break; + } + } + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + rowinsertabove: function () { + this.rowinsert(0); + }, + rowinsertbelow: function () { + this.rowinsert(1); + }, + rowmerge: function () { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex, // 当前行的index + nextRowIndex = rowIndex + cell.rowSpan, // 下一行的index + nextRow = table.rows[nextRowIndex]; // 下一行 + // 最后一行不能合并 + if (table.rows.length <= nextRowIndex) { + return; + } + var cellIndex = cell.cellIndex; // 下一行单元格的index + if (nextRow.cells.length <= cellIndex) { + return; + } + var nextCell = nextRow.cells[cellIndex]; // 下一行单元格 + // 上下行的colspan不一致时不能合并 + if (cell.colSpan !== nextCell.colSpan) { + return; + } + cell.rowSpan += nextCell.rowSpan; + nextRow.deleteCell(cellIndex); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colmerge: function () { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex, // 当前行的index + cellIndex = cell.cellIndex, + nextCellIndex = cellIndex + 1; + // 最后一列不能合并 + if (row.cells.length <= nextCellIndex) { + return; + } + var nextCell = row.cells[nextCellIndex]; + // 左右列的rowspan不一致时不能合并 + if (cell.rowSpan !== nextCell.rowSpan) { + return; + } + cell.colSpan += nextCell.colSpan; + row.deleteCell(nextCellIndex); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + mergeCells: function () { + var tableSelectionRange = self.tableSelectionRange; + if (!tableSelectionRange) return; + var table = self.plugin.getSelectedTable()[0]; + var $table = $(table); + var top = tableSelectionRange.top; + var left = tableSelectionRange.left; + var right = tableSelectionRange.right; + var bottom = tableSelectionRange.bottom; + var $firstCell; + $table.children('thead,tbody,tfoot').children('tr').each(function () { + $(this).children('td,th').each(function () { + var $cell = $(this); + var pos = $cell.cellPos(); + if (pos.left === left && pos.top === top) { + $firstCell = $cell; + } else if (pos.right >= left && pos.left <= right && pos.bottom >= top && pos.top <= bottom) { + $cell.addClass('ke-cell-removed'); + } + }); + }); + if ($firstCell) { + $firstCell.attr({ + rowspan: bottom - top + 1, + colspan: right - left + 1, + }); + $table.find('.ke-cell-removed').remove(); + self.cmd.range.selectNodeContents($firstCell[0]).collapse(true); + self.cmd.select(); + self.addBookmark(); + } + }, + rowsplit: function () { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex; + // 不是可分割单元格 + if (cell.rowSpan === 1) { + return; + } + var cellIndex = _getCellIndex(table, row, cell); + for (var i = 1, len = cell.rowSpan; i < len; i++) { + var newRow = table.rows[rowIndex + i], + newCell = newRow.insertCell(cellIndex); + var isThead = newRow.parentNode.tagName === 'THEAD'; + var colSpan = cell.colSpan > 1 ? cell.colSpan : newCell.colSpan; + newCell.outerHTML = '<' + (isThead ? 'th' : 'td') + (newCell.rowSpan > 1 ? ' rowspan="' + newCell.rowSpan + '"' : '') + (colSpan > 1 ? ' colspan="' + colSpan + '"' : '') + ' style="' + (isThead ? 'background-color: #f1f1f1;' : '') + 'border: 1px solid ' + ((self.tableSetting && self.tableSetting.borderColor) || defaultTableBorderColor) + '">' + (K.IE ? ' ' : '
        ') + ''; + if (cell.colSpan > 1) { + newCell.colSpan = cell.colSpan; + } + // 调整下一行的单元格index + cellIndex = _getCellIndex(table, newRow, newCell); + } + K(cell).removeAttr('rowSpan'); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colsplit: function () { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + cellIndex = cell.cellIndex; + // 不是可分割单元格 + if (cell.colSpan === 1) { + return; + } + var isThead = row.parentNode.tagName === 'THEAD'; + for (var i = 1, len = cell.colSpan; i < len; i++) { + var newCell = row.insertCell(cellIndex + i); + var rowSpan = cell.rowSpan > 1 ? cell.rowSpan : newCell.rowSpan; + var colSpan = newCell.colSpan; + newCell.outerHTML = '<' + (isThead ? 'th' : 'td') + (rowSpan > 1 ? ' rowspan="' + rowSpan + '"' : '') + (colSpan > 1 ? ' colspan="' + colSpan + '"' : '') + ' style="' + (isThead ? 'background-color: #f1f1f1;' : '') + 'border: 1px solid ' + ((self.tableSetting && self.tableSetting.borderColor) || defaultTableBorderColor) + '">' + (K.IE ? ' ' : '
        ') + ''; + } + K(cell).removeAttr('colSpan'); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + coldelete: function () { + var table = self.plugin.getSelectedTable()[0]; + var cells = self.plugin.getAllSelectedCells(); + if (!cells.length) return; + for (var j = 0; j < cells.length; ++j) { + var cell = cells.get(j); + var row = cell.parentNode; + if (!row || !row.parentNode) continue; + var index = cell.cellIndex; + for (var i = 0, len = table.rows.length; i < len; i++) { + var newRow = table.rows[i], + newCell = newRow.cells[index]; + if (newCell.colSpan > 1) { + newCell.colSpan -= 1; + if (newCell.colSpan === 1) { + K(newCell).removeAttr('colSpan'); + } + } else { + newRow.deleteCell(index); + } + // 跳过不需要删除的行 + if (newCell.rowSpan > 1) { + i += newCell.rowSpan - 1; + } + } + if (row.cells.length === 0) { + self.cmd.range.setStartBefore(table).collapse(true); + self.cmd.select(); + K(table).remove(); + break; + } + } + if (table.parentNode) { + self.cmd.selection(true); + } + self.addBookmark(); + }, + rowdelete: function () { + var table = self.plugin.getSelectedTable()[0]; + var cells = self.plugin.getAllSelectedCells(); + if (!cells.length) return; + for (var j = 0; j < cells.length; ++j) { + var cell = cells.get(j); + var row = cell.parentNode; + if (!row || !row.parentNode) continue; + // 从下到上删除 + for (var i = cell.rowSpan - 1; i >= 0; i--) { + table.deleteRow(row.rowIndex + i); + } + } + if (table.rows.length === 0) { + self.cmd.range.setStartBefore(table).collapse(true); + self.cmd.select(); + K(table).remove(); + } else { + self.cmd.selection(true); + } + self.addBookmark(); + } + }; + + self.plugin.getSelectedTable = function () { + return K($(self.cmd.range.startContainer).closest('table')[0]); + }; + // 获取选中的行 + self.plugin.getSelectedRow = function () { + return K($(self.cmd.range.startContainer).closest('tr')[0]); + }; + // 获取光标所在的单元格 + self.plugin.getSelectedCell = function () { + return K($(self.cmd.range.startContainer).closest('td,th')[0]); + }; + // 获取用户拖选的单元格 + self.plugin.getSelectedCells = function () { + var table = self.plugin.getSelectedTable(); + if (table && table.length) { + var cells = K('.ke-select-cell', table.get(0)); + if (cells && cells.length > 1) { + return cells; + } + } + }; + // 当用户没有拖选多个单元格时,获取光标所在的单元格 + self.plugin.getSingleSelectedCell = function () { + var selectedCells = self.plugin.getSelectedCells(); + if (selectedCells && selectedCells.length > 1) { + return; + } + return self.plugin.getSelectedCell(); + }; + // 获取用户拖选或光标所在位置的单元格 + self.plugin.getAllSelectedCells = function () { + var selectedCells = self.plugin.getSelectedCells(); + if (selectedCells && selectedCells.length) { + return selectedCells; + } + return self.plugin.getSelectedCell(); + }; + + var contextMenuIconClass = { + mergeCells: 'ke-icon-tablecolmerge' + }; + K.each(('prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,mergeCells,rowmerge,colmerge,rowsplit,colsplit,coldelete,rowdelete,delete').split(','), function (i, val) { + var cond; + if (val === 'prop' || val === 'delete') { + cond = self.plugin.getSelectedTable; + } else if (val === 'mergeCells') { + cond = self.plugin.getSelectedCells; + }else if (val === 'rowmerge') { + cond = function() { + var cell = self.plugin.getSingleSelectedCell(); + if (cell && cell.length) { + if($(cell.get(0)).parent().next('tr').length) { + return cell; + } + } + }; + } else if (val === 'colmerge') { + cond = function() { + var cell = self.plugin.getSingleSelectedCell(); + if (cell && cell.length) { + if($(cell.get(0)).next('th,td').length) { + return cell; + } + } + }; + } else if (val === 'rowsplit') { + cond = function() { + var cell = self.plugin.getSingleSelectedCell(); + if (cell && cell.get(0).rowSpan > 1) { + return cell; + } + }; + } else if (val === 'colsplit') { + cond = function() { + var cell = self.plugin.getSingleSelectedCell(); + if (cell && cell.get(0).colSpan > 1) { + return cell; + } + }; + } else if (K.inArray(val, ['colinsertleft', 'colinsertright', 'rowinsertabove', 'rowinsertbelow']) > -1) { + cond = self.plugin.getSingleSelectedCell; + } else { + cond = self.plugin.getSelectedCell; + } + self.addContextmenu({ + title: lang[val] || self.lang('table' + val), + click: function () { + self.loadPlugin('table', function () { + self.plugin.table[val](); + self.hideMenu(); + }); + }, + cond: cond, + width: 170, + iconClass: contextMenuIconClass[val] || ('ke-icon-table' + val) + }); + }); + } + + self.clickToolbar(name, function () { + if (self.menu) return; + + var menu = self.createMenu({ + name: name, + beforeRemove: function () { + removeEvent(); + } + }); + + var $wrapperDiv = $('
        '); + var $header = $('
        ' + lang.xRxC.format(0, 0) + '
        '); + $wrapperDiv.append($header); + var $grid = $('
        '); + $grid.on('mouseenter.kTable', '.ke-plugin-table-grid-cell', function () { + var $cell = $(this); + var row = $cell.data('row'); + var col = $cell.data('col'); + $header.text(lang.xRxC.format(row, col)); + var $cells = $grid.find('.ke-plugin-table-grid-cell'); + $cells.each(function () { + var $c = $(this); + var r = $c.data('row'); + var c = $c.data('col'); + if (r <= row && c <= col) { + $c.css({ + border: '1px solid #2286d2', + background: '#eff7ff' + }); + } else { + $c.css({ + border: '1px solid #ddd', + background: '#f1f1f1' + }); + } + }); + }).on('click.kTable', '.ke-plugin-table-grid-cell', function (e) { + var $cell = $(this); + var row = $cell.data('row'); + var col = $cell.data('col'); + insertTable(row, col); + self.hideMenu().focus(); + self.addBookmark(); + e.stopPropagation(); + }); + for (var r = 1; r < 11; r++) { + for (var c = 1; c < 11; c++) { + $grid.append('
        '); + } + } + $elements.push($grid); + $wrapperDiv.append($grid); + menu.div.append($wrapperDiv[0]); + }); + + // https://zui.5upm.com/task-view-2.html + self.afterTab(function (result) { + var selectedCell = self.plugin.getSelectedCell(); + if (selectedCell && selectedCell.length) { + var selectNextCell = function ($currentCell) { + if ($currentCell.length) { + var $nextCell = $currentCell.next(); + if (!$nextCell.is('td,th')) { + $nextCell = $currentCell.parent().next('tr').children('th,td').first(); + } + if (!$nextCell.is('td,th')) { + $nextCell = $currentCell.closest('tbody,tfoot,thead').next().children('tr').first().children('th,td').first(); + } + if ($nextCell.length) { + self.cmd.range.selectNodeContents($nextCell[0]).collapse(true); + self.cmd.select(); + return true; + } + } + return false; + }; + var $selectedCell = $(selectedCell.get(0)); + if ($selectedCell.length) { + if (!selectNextCell($selectedCell)) { + self.plugin.table.rowinsertbelow(); + selectNextCell($selectedCell); + } + return true; + } + } + return result; + }); + + var selectCellsRange = function ($table, startPos, endPos) { + var top = endPos ? Math.min(startPos.top, endPos.top) : startPos.top; + var left = endPos ? Math.min(startPos.left, endPos.left) : startPos.left; + var bottom = endPos ? Math.max(startPos.bottom, endPos.bottom) : startPos.bottom; + var right = endPos ? Math.max(startPos.right, endPos.right) : startPos.right; + if (top === bottom && left === right) { + return false; + } + var hasCellSelected = false; + var hasNewCellSelect = false; + var $rows = $table.children('thead,tbody,tfoot').children('tr').each(function () { + $(this).children('td,th').each(function () { + var $cell = $(this); + var pos = $cell.cellPos(); + if (pos.right >= left && pos.left <= right && pos.bottom >= top && pos.top <= bottom) { + top = Math.min(top, pos.top); + left = Math.min(left, pos.left); + bottom = Math.max(bottom, pos.bottom); + right = Math.max(right, pos.right); + $cell.addClass('ke-select-cell'); + hasCellSelected = true; + hasNewCellSelect = true; + } + }); + }); + while(hasNewCellSelect) { + hasNewCellSelect = false; + $rows.each(function () { + $(this).children('td,th').each(function () { + var $cell = $(this); + if ($cell.hasClass('ke-select-cell')) return; + var pos = $cell.cellPos(); + if (pos.right >= left && pos.left <= right && pos.bottom >= top && pos.top <= bottom) { + top = Math.min(top, pos.top); + left = Math.min(left, pos.left); + bottom = Math.max(bottom, pos.bottom); + right = Math.max(right, pos.right); + $cell.addClass('ke-select-cell'); + hasNewCellSelect = true; + } + }); + }); + } + var $selectedCells = $table.find('.ke-select-cell'); + if ($selectedCells.length === 1) { + $selectedCells.removeClass('ke-select-cell'); + hasCellSelected = false; + } + if (hasCellSelected) { + self.tableSelectionRange = { + top: top, + left: left, + bottom: bottom, + right: right, + }; + } else { + self.tableSelectionRange = null; + } + return hasCellSelected; + }; + + var selectRow = function ($table, rowIndex) { + return selectCellsRange($table, { + left: 0, + right: $table.data('tableSize').width - 1, + top: rowIndex, + bottom: rowIndex, + }); + }; + + var selectCol = function ($table, cellIndex) { + return selectCellsRange($table, { + left: cellIndex, + right: cellIndex, + top: 0, + bottom: $table.data('tableSize').height - 1, + }); + }; + + self.afterCreate(function () { + var isMouseDown = false; + var $mouseDownTable = null; + var $mouseMoveTable = null; + var mouseDownCellPos = null; + var mouseMoveCellPos = null; + + var handleMouseUp = function () { + isMouseDown = false; + $mouseDownTable = null; + mouseMoveCellPos = null; + }; + + $(self.edit.doc.body).on('mousedown.ke' + self.uuid, function (e) { + var $cell = $(e.target).closest('td,th'); + var $table = $cell.closest('table'); + var rightClickOnTable = false; + if ($cell.length && $table.length) { + $mouseDownTable = $table; + isMouseDown = true; + mouseDownCellPos = $cell.cellPos(true); + rightClickOnTable = e.which === 3; + $table.removeClass('ke-select-cells'); + } + if (!rightClickOnTable) { + $(self.edit.doc).find('.ke-select-cell').removeClass('ke-select-cell'); + self.tableSelectionRange = null; + } + }).on('mousemove.ke' + self.uuid, function (e) { + var $cell = $(e.target).closest('td,th'); + if (!$cell.length) return isMouseDown ? e.preventDefault() : null; + var $table = $cell.closest('table'); + if (!$table.length) return isMouseDown ? e.preventDefault() : null; + $table.removeClass('ke-select-row ke-select-col ke-select-cells'); + mouseMoveCellPos = $cell.cellPos(); + if (isMouseDown) { + if ($table[0] !== $mouseDownTable[0]) return e.preventDefault(); + $(self.edit.doc).find('table').find('.ke-select-cell').removeClass('ke-select-cell'); + if (selectCellsRange($table, mouseDownCellPos, mouseMoveCellPos)) { + $table.addClass('ke-select-cells'); + e.preventDefault(); + } + } else { + $mouseMoveTable = $table; + var tableOffset = $table.offset(); + var pageX = e.pageX; + var pageY = e.pageY; + var moveX = pageX - tableOffset.left; + var moveY = pageY - tableOffset.top; + if (moveX < 8) { + $table.addClass('ke-select-row'); + mouseMoveCellPos.selectRow = mouseMoveCellPos.top; + delete mouseMoveCellPos.selectCol; + e.preventDefault(); + e.stopPropagation(); + } else if (moveY < 8) { + $table.addClass('ke-select-col'); + mouseMoveCellPos.selectCol = mouseMoveCellPos.left; + delete mouseMoveCellPos.selectRow; + e.preventDefault(); + e.stopPropagation(); + } + } + }).on('mouseup.ke' + self.uuid, function (e) { + var $target = $(e.target); + var $cell = $target.closest('td,th'); + if ($cell.length) { + if (mouseMoveCellPos && mouseMoveCellPos.selectRow !== undefined) { + selectRow($mouseMoveTable, mouseMoveCellPos.selectRow); + e.stopPropagation(); + } else if (mouseMoveCellPos && mouseMoveCellPos.selectCol !== undefined) { + selectCol($mouseMoveTable, mouseMoveCellPos.selectCol); + e.stopPropagation(); + } + } + handleMouseUp(); + }).on('paste.ke' + self.uuid + ' keydown.ke' + self.uuid, function () { + $(self.edit.doc).find('table').removeClass('ke-select-row ke-select-col').find('.ke-select-cell').removeClass('ke-select-cell'); + }); + $(document).on('mouseup.ke' + self.uuid, function () { + handleMouseUp(); + }); + + $(self.edit.doc.head).append([ + '', + ].join('')); + + var cmdToggleBack = self.cmd.toggle; + var cmdToggle = function (wrapper, map, flag) { + var self = this; + if (flag === undefined || flag === null) { + flag = self.commonNode(map); + } + if (flag) { + self.remove(map); + } else { + self.wrap(wrapper); + } + return self.select(); + }; + + var eachSelectCells = function (eachCallback, beforeCallback, afterCallback) { + var range = self.cmd.range; + if (range && range.endContainer) { + var $cell = $(range.endContainer).closest('th,td'); + if (!$cell.length) return; + var $table = $cell.closest('table'); + if (!$table.length) return; + var $selectCells = $table.children('thead,tbody,tfoot').children('tr').children('.ke-select-cell'); + if ($selectCells.length) { + if (beforeCallback) beforeCallback($cell, $table); + $selectCells.each(eachCallback); + if (afterCallback) afterCallback($cell, $table); + + range.selectNodeContents($cell[0]); + // range.collapse(); + self.cmd.select(); + self.focus(); + return true; + } + } + }; + + self.cmd.toggle = function (wrapper, map) { + var flag; + if (eachSelectCells(function () { + self.cmd.range.selectNodeContents(this); + self.cmd.select(); + cmdToggle.call(self.cmd, wrapper, map, flag); + }, function ($cell) { + self.cmd.range.selectNodeContents($cell[0]); + self.cmd.select(); + flag = !!self.cmd.commonNode(map); + })) { + return; + } + return cmdToggleBack.call(self.cmd, wrapper, map); + }; + + var commands = ',justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,'; + var clickToolbarBack = self.clickToolbar; + self.clickToolbar = function (name, fn) { + if (fn === undefined && commands.indexOf(',' + name + ',') > -1) { + if (eachSelectCells(function () { + self.cmd.range.selectNode(this); + self.cmd.select(); + clickToolbarBack.call(self, name, fn); + })) { + return; + } + } + return clickToolbarBack.call(self, name, fn); + } + }); + + self.beforeRemove(function () { + $(self.edit.doc.body).off('.ke' + self.uuid); + $(document).off('.ke' + self.uuid); + }); +}); + +KindEditor.lang({ + table: KindEditor.lang('table') +}); \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.css b/src/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.css new file mode 100644 index 0000000..74fe1ef --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.css @@ -0,0 +1 @@ +/*! KindEditor Copyright (C) kindsoft.net, Licence: http://kindeditor.net/license.php */.ke-inline-block{display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;*display:inline}.ke-clearfix{zoom:1}.ke-clearfix:after{display:block;height:0;clear:both;font-size:0;line-height:0;visibility:hidden;content:"."}.ke-shadow{-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}[class*=" ke-icon-"],[class^=ke-icon-]{width:16px;height:16px}.ke-icon-source{background-position:0 0}.ke-icon-preview{background-position:0 -16px}.ke-icon-print{background-position:0 -32px}.ke-icon-undo{background-position:0 -48px}.ke-icon-redo{background-position:0 -64px}.ke-icon-cut{background-position:0 -80px}.ke-icon-copy{background-position:0 -96px}.ke-icon-paste{background-position:0 -112px}.ke-icon-selectall{background-position:0 -128px}.ke-icon-justifyleft{background-position:0 -144px}.ke-icon-justifycenter{background-position:0 -160px}.ke-icon-justifyright{background-position:0 -176px}.ke-icon-justifyfull{background-position:0 -192px}.ke-icon-insertorderedlist{background-position:0 -208px}.ke-icon-insertunorderedlist{background-position:0 -224px}.ke-icon-indent{background-position:0 -240px}.ke-icon-outdent{background-position:0 -256px}.ke-icon-subscript{background-position:0 -272px}.ke-icon-superscript{background-position:0 -288px}.ke-icon-date{width:25px;background-position:0 -304px}.ke-icon-time{width:25px;background-position:0 -320px}.ke-icon-formatblock{width:25px;background-position:0 -336px}.ke-icon-fontname{width:21px;background-position:0 -352px}.ke-icon-fontsize{width:23px;background-position:0 -368px}.ke-icon-forecolor{width:20px;background-position:0 -384px}.ke-icon-hilitecolor{width:23px;background-position:0 -400px}.ke-icon-bold{background-position:0 -416px}.ke-icon-italic{background-position:0 -432px}.ke-icon-underline{background-position:0 -448px}.ke-icon-strikethrough{background-position:0 -464px}.ke-icon-removeformat{background-position:0 -480px}.ke-icon-image{background-position:0 -496px}.ke-icon-flash{background-position:0 -512px}.ke-icon-media{background-position:0 -528px}.ke-icon-div{background-position:0 -544px}.ke-icon-formula{background-position:0 -576px}.ke-icon-hr{background-position:0 -592px}.ke-icon-emoticons{background-position:0 -608px}.ke-icon-link{background-position:0 -624px}.ke-icon-unlink{background-position:0 -640px}.ke-icon-fullscreen{background-position:0 -656px}.ke-icon-about{background-position:0 -672px}.ke-icon-plainpaste{background-position:0 -704px}.ke-icon-wordpaste{background-position:0 -720px}.ke-icon-table{background-position:0 -784px}.ke-icon-tablemenu{background-position:0 -768px}.ke-icon-tableinsert{background-position:0 -784px}.ke-icon-tabledelete{background-position:0 -800px}.ke-icon-tablecolinsertleft{background-position:0 -816px}.ke-icon-tablecolinsertright{background-position:0 -832px}.ke-icon-tablerowinsertabove{background-position:0 -848px}.ke-icon-tablerowinsertbelow{background-position:0 -864px}.ke-icon-tablecoldelete{background-position:0 -880px}.ke-icon-tablerowdelete{background-position:0 -896px}.ke-icon-tablecellprop{background-position:0 -912px}.ke-icon-tableprop{background-position:0 -928px}.ke-icon-checked{background-position:0 -944px}.ke-icon-code{background-position:0 -960px}.ke-icon-map{background-position:0 -976px}.ke-icon-baidumap{background-position:0 -976px}.ke-icon-lineheight{background-position:0 -992px}.ke-icon-clearhtml{background-position:0 -1008px}.ke-icon-pagebreak{background-position:0 -1024px}.ke-icon-insertfile{background-position:0 -1040px}.ke-icon-quickformat{background-position:0 -1056px}.ke-icon-template{background-position:0 -1072px}.ke-icon-tablecellsplit{background-position:0 -1088px}.ke-icon-tablerowmerge{background-position:0 -1104px}.ke-icon-tablerowsplit{background-position:0 -1120px}.ke-icon-tablecolmerge{background-position:0 -1136px}.ke-icon-tablecolsplit{background-position:0 -1152px}.ke-icon-anchor{background-position:0 -1168px}.ke-icon-search{background-position:0 -1184px}.ke-icon-new{background-position:0 -1200px}.ke-icon-specialchar{background-position:0 -1216px}.ke-icon-multiimage{background-position:0 -1232px}.ke-container{position:relative;display:block;padding:0;margin:0;overflow:hidden;background-color:#fff;border:1px solid #ccc;border-radius:4px}.ke-container.focus{border-color:#145ccd;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6)}.ke-container.ke-loading+textarea.kindeditor,.ke-container.ke-loading>.ke-edit,.ke-container.ke-loading>.ke-statusbar,.ke-container.ke-loading>.ke-toolbar{display:none}.ke-toolbar{padding:2px 5px;overflow:hidden;text-align:left;zoom:1;background-color:#fff;border-bottom:1px solid #ccc}.ke-toolbar-icon{display:block;overflow:hidden;font-size:0;line-height:0;background-repeat:no-repeat}.ke-menu .ke-toolbar-icon{display:inline-block}.ke-toolbar-icon-url{background-image:url(themes/default/default.png)}.ke-toolbar .ke-outline{display:block;float:left;padding:1px 2px;margin:1px;overflow:hidden;font-size:0;line-height:0;cursor:pointer;filter:alpha(opacity=80);border:1px solid #fff;border-radius:4px;opacity:.8}.ke-toolbar .ke-on,.ke-toolbar .ke-selected{filter:alpha(opacity=100);border-color:#ddd;opacity:1}.ke-toolbar .ke-selected{background-color:#f1f1f1}.ke-toolbar .ke-disabled{cursor:default}.ke-toolbar .ke-separator{display:block;float:left;width:0;height:16px;margin:2px 3px;overflow:hidden;font-size:0;line-height:0;border-top:0;border-bottom:0;border-left:1px dotted #ddd}.ke-toolbar .ke-hr{height:1px;overflow:hidden;clear:both}.ke-edit{padding:0}.ke-edit-iframe,.ke-edit-textarea{padding:0;margin:0;overflow:auto;border:0}.ke-edit-textarea{overflow:auto;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#353535;resize:none;background-color:#fff}.ke-edit-textarea:focus{outline:0}.ke-statusbar{position:absolute;right:0;bottom:0;width:14px;height:14px;overflow:hidden;font-size:0;line-height:0;text-align:center;cursor:s-resize;background-color:#fff;filter:alpha(opacity=0);border-top:1px solid #ccc;border-left:1px solid #ccc;opacity:0;-webkit-transition:opacity .2s;-o-transition:opacity .2s;transition:opacity .2s}.ke-statusbar .ke-statusbar-resize-icon{position:relative}.ke-statusbar .ke-statusbar-resize-icon:after,.ke-statusbar .ke-statusbar-resize-icon:before{position:absolute;top:2px;left:-4px;display:block;width:0;height:0;content:' ';border-color:transparent transparent grey transparent;border-style:solid;border-width:0 4px 4px 4px}.ke-statusbar .ke-statusbar-resize-icon:after{top:7px;border-color:grey transparent transparent transparent;border-width:4px 4px 0 4px}.ke-container:hover .ke-statusbar,.ke-statusbar.ke-dragging{filter:alpha(opacity=100);opacity:1}.ke-menu{padding:5px 0;overflow:hidden;font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Source Han Serif','Hiragino Sans GB','WenQuanYi Micro Hei','Microsoft YaHei',sans-serif;font-size:12px;text-align:left;background-color:#fff;border:1px solid #cbcbcb;border:1px solid rgba(0,0,0,.15);border-radius:4px}.ke-menu-item{height:24px;overflow:hidden;cursor:pointer}.ke-menu-item-on{color:#fff;text-decoration:none;background-color:#3280fc;outline:0}.ke-menu-item-left{width:27px;overflow:hidden;text-align:center}.ke-menu-item-center{width:0;height:24px;border-top:0;border-right:1px solid #fff;border-bottom:0;border-left:1px solid #e3e3e3}.ke-menu-item-center-on{border-right:1px solid #e9eff6;border-left:1px solid #e9eff6}.ke-menu-item-right{padding:0 0 0 5px;overflow:hidden;line-height:24px;text-align:left;border:0}.ke-menu-separator{height:0;margin:2px 0;overflow:hidden;border-top:1px solid #ccc;border-right:0;border-bottom:1px solid #fff;border-left:0}.ke-colorpicker{background-color:#fff;border:1px solid #cbcbcb;border:1px solid rgba(0,0,0,.15);border-radius:4px}.ke-colorpicker-table{padding:0;margin:0;border-collapse:separate;border:0}.ke-colorpicker-cell{padding:0;font-size:0;line-height:0;cursor:pointer;border:none}.ke-colorpicker-cell-color{width:25px;height:25px;padding:0;border:0}.ke-colorpicker-cell-top{padding:0;margin:0;font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Source Han Serif','Hiragino Sans GB','WenQuanYi Micro Hei','Microsoft YaHei',sans-serif;font-size:12px;line-height:25px;text-align:center;cursor:pointer}.ke-colorpicker-cell-on{color:#fff;background-color:#3280fc}.ke-colorpicker-cell-on .ke-colorpicker-cell-color{border:2px solid #353535}.ke-colorpicker-cell-selected .ke-colorpicker-cell-color{border:2px solid #353535}.ke-dialog{position:absolute;padding:0;margin:0}.ke-dialog .ke-header{width:100%;margin-bottom:10px}.ke-dialog .ke-header .ke-left{float:left}.ke-dialog .ke-header .ke-right{float:right}.ke-dialog .ke-header label{display:inline;margin-right:0;font-weight:400;vertical-align:top;cursor:pointer}.ke-dialog-content{width:100%;height:100%;overflow:hidden;background-color:#fff;border-radius:4px}.ke-dialog-shadow{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;background-color:#f0f0ee;border-radius:4px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.ke-dialog-header{min-height:16.54px;padding:7.5px 15px;margin:0;font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Source Han Serif','Hiragino Sans GB','WenQuanYi Micro Hei','Microsoft YaHei',sans-serif;font-size:13px;font-weight:700;text-align:left;cursor:move;background:#f1f1f1;border:0;border-bottom:1px solid #e5e5e5}.ke-dialog-icon-close{position:absolute;top:10px;right:8px;display:block;width:16px;height:16px;cursor:pointer;background:url(themes/default/default.png) no-repeat scroll 0 -688px;filter:alpha(opacity=60);opacity:.6}.ke-dialog-icon-close:hover{filter:alpha(opacity=100);opacity:1}.ke-dialog-body{width:100%;overflow:hidden;font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Source Han Serif','Hiragino Sans GB','WenQuanYi Micro Hei','Microsoft YaHei',sans-serif;font-size:12px;text-align:left}.ke-dialog-body textarea{display:block;padding:0;overflow:auto;resize:none}.ke-dialog-body input:focus,.ke-dialog-body select:focus,.ke-dialog-body textarea:focus{outline:0}.ke-dialog-body label{display:-moz-inline-stack;display:inline-block;margin-right:10px;vertical-align:middle;cursor:pointer;zoom:1;*display:inline}.ke-dialog-body img{display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;*display:inline}.ke-dialog-body select{display:-moz-inline-stack;display:inline-block;width:auto;vertical-align:middle;zoom:1;*display:inline}.ke-dialog-body .ke-textarea{display:block;width:408px;height:260px;background-color:#fff;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,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;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,-webkit-box-shadow ease-in-out .15s}.ke-dialog-body .ke-form{padding:0;margin:0}.ke-dialog-loading{position:absolute;top:0;left:1px;z-index:1;text-align:center}.ke-dialog-loading-content{height:31px;padding-left:36px;font-size:14px;font-weight:700;line-height:31px;color:#666;background:url(../common/loading.gif) no-repeat}.ke-dialog-row{margin-bottom:10px}.ke-dialog-footer{width:100%;padding:5px;text-align:right;border-top:1px solid #e5e5e5}.ke-dialog-preview,.ke-dialog-yes{margin:5px}.ke-dialog-no{margin:5px 10px 5px 5px}.ke-dialog-mask{background-color:#000;filter:alpha(opacity=50);opacity:.5}.ke-button-common{display:inline-block;height:23px;overflow:visible;line-height:21px;vertical-align:middle;cursor:pointer}.ke-button-outer{position:relative;display:-moz-inline-stack;display:inline-block;padding:0;vertical-align:middle;zoom:1;*display:inline}.ke-button{left:2px;padding:0 12px;margin:0;font-size:12px;color:#353535;text-decoration:none;background-color:#f2f2f2;border:1px solid #bfbfbf;border-color:#bfbfbf;border-radius:4px}.ke-button.active,.ke-button:active,.ke-button:focus,.ke-button:hover,.open .dropdown-toggle.ke-button{color:#353535;background-color:#dedede;border-color:#a1a1a1;-webkit-box-shadow:0 2px 1px rgba(0,0,0,.1);box-shadow:0 2px 1px rgba(0,0,0,.1)}.ke-button.active,.ke-button:active,.open .dropdown-toggle.ke-button{background-color:#ccc;background-image:none;border-color:#a6a6a6;-webkit-box-shadow:inset 0 4px 6px rgba(0,0,0,.15);box-shadow:inset 0 4px 6px rgba(0,0,0,.15)}.ke-button.disabled,.ke-button.disabled.active,.ke-button.disabled:active,.ke-button.disabled:focus,.ke-button.disabled:hover,.ke-button[disabled],.ke-button[disabled].active,.ke-button[disabled]:active,.ke-button[disabled]:focus,.ke-button[disabled]:hover,fieldset[disabled] .ke-button,fieldset[disabled] .ke-button.active,fieldset[disabled] .ke-button:active,fieldset[disabled] .ke-button:focus,fieldset[disabled] .ke-button:hover{background-color:#f2f2f2;border-color:#bfbfbf}.ke-input-text{display:-moz-inline-stack;display:inline-block;height:20px;padding:0 4px;font-family:"sans serif",tahoma,verdana,helvetica;font-size:12px;line-height:20px;vertical-align:middle;zoom:1;background-color:#fff;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,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;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,-webkit-box-shadow ease-in-out .15s;*display:inline}.ke-input-text.focus,.ke-input-text:focus{border-color:#145ccd;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6)}.ke-input-text[disabled]{background:#eee}.ke-input-number{width:50px}.ke-input-color,ke-dialog-content select{display:-moz-inline-stack;display:inline-block;width:60px;height:20px;padding-left:5px;overflow:hidden;font-size:12px;line-height:20px;vertical-align:middle;cursor:pointer;zoom:1;background-color:#fff;border:1px solid #ccc;*display:inline}.ke-upload-button{position:relative}.ke-upload-area{position:relative;padding:0;margin:0;overflow:hidden}.ke-upload-area .ke-upload-file{position:absolute;top:0;right:0;z-index:811212;padding:0;margin:0;font-size:60px;filter:alpha(opacity=0);border:0 none;opacity:0}.ke-tabs{padding-left:5px;margin-bottom:20px;font:12px/1 "sans serif",tahoma,verdana,helvetica;border-bottom:1px solid #a0a0a0}.ke-tabs-ul{padding:0;margin:0;list-style-position:outside;list-style-type:none;list-style-image:none}.ke-tabs-li{position:relative;float:left;padding:0 20px;margin:0 2px -1px 0;line-height:25px;color:#555;text-align:center;cursor:pointer;background-color:#f0f0ee;border:1px solid #a0a0a0}.ke-tabs-li-selected{color:#000;cursor:default;background-color:#fff;border-bottom:1px solid #fff}.ke-tabs-li-on{color:#000;background-color:#fff}.ke-progressbar{position:relative;padding:0;margin:0}.ke-progressbar-bar{width:80px;height:5px;padding:0;margin:10px 10px 0 10px;border:1px solid #6fa5db}.ke-progressbar-bar-inner{width:0;height:5px;padding:0;margin:0;overflow:hidden;background-color:#6fa5db}.ke-progressbar-percent{position:absolute;top:0;left:40%;display:none}.ke-swfupload-top{position:relative;margin-bottom:10px;_width:608px}.ke-swfupload-button{height:23px;line-height:23px}.ke-swfupload-desc{height:23px;padding:0 10px;line-height:23px}.ke-swfupload-startupload{position:absolute;top:0;right:0}.ke-swfupload-body{width:auto;height:370px;padding:5px;overflow:scroll;background-color:#fff;border:1px solid #ccc}.ke-swfupload-body .ke-item{width:100px;margin:5px}.ke-swfupload-body .ke-photo{position:relative;padding:10px;background-color:#fff;border:1px solid #ddd}.ke-swfupload-body .ke-delete{position:absolute;top:0;right:0;display:block;width:16px;height:16px;cursor:pointer;background:url(themes/default/default.png) no-repeat scroll 0 -688px}.ke-swfupload-body .ke-status{position:absolute;bottom:5px;left:0;width:100px;height:17px}.ke-swfupload-body .ke-message{width:100px;height:17px;overflow:hidden;text-align:center}.ke-swfupload-body .ke-error{color:red}.ke-swfupload-body .ke-name{width:100px;height:16px;overflow:hidden;text-align:center}.ke-swfupload-body .ke-on{background-color:#e9eff6;border:1px solid #5690d2}.ke-plugin-emoticons{position:relative}.ke-plugin-emoticons .ke-preview{position:absolute;top:0;display:none;padding:10px;margin:2px;text-align:center;background-color:#fff;border:1px solid #a0a0a0}.ke-plugin-emoticons .ke-preview-img{padding:0;margin:0;border:0}.ke-plugin-emoticons .ke-table{padding:0;margin:0;border-collapse:separate;border:0}.ke-plugin-emoticons .ke-cell{padding:1px;margin:0;cursor:pointer;border:1px solid #f0f0ee}.ke-plugin-emoticons .ke-on{background-color:#e9eff6;border:1px solid #5690d2}.ke-plugin-emoticons .ke-img{display:block;width:24px;height:24px;padding:0;margin:2px;margin:0;overflow:hidden;background-repeat:no-repeat;border:0}.ke-plugin-emoticons .ke-page{padding:0;margin:5px;font:12px/1 "sans serif",tahoma,verdana,helvetica;color:#333;text-align:right;text-decoration:none;border:0}.ke-plugin-plainpaste-textarea,.ke-plugin-wordpaste-iframe{display:block;width:408px;height:260px;font-family:"sans serif",tahoma,verdana,helvetica;font-size:12px;border:1px solid #ccc}.ke-plugin-filemanager-header{width:100%;margin-bottom:10px}.ke-plugin-filemanager-header .ke-left{float:left}.ke-plugin-filemanager-header .ke-right{float:right}.ke-plugin-filemanager-body{width:auto;height:370px;padding:5px;overflow:scroll;background-color:#fff;border:1px solid #ccc}.ke-plugin-filemanager-body .ke-item{width:100px;margin:5px}.ke-plugin-filemanager-body .ke-photo{padding:10px;background-color:#fff;border:1px solid #ddd}.ke-plugin-filemanager-body .ke-name{width:100px;height:16px;overflow:hidden;text-align:center}.ke-plugin-filemanager-body .ke-on{background-color:#e9eff6;border:1px solid #5690d2}.ke-plugin-filemanager-body .ke-table{width:95%;padding:0;margin:0;border-collapse:separate;border:0}.ke-plugin-filemanager-body .ke-table .ke-cell{padding:0;margin:0;border:0}.ke-plugin-filemanager-body .ke-table .ke-name{width:55%;text-align:left}.ke-plugin-filemanager-body .ke-table .ke-size{width:15%;text-align:left}.ke-plugin-filemanager-body .ke-table .ke-datetime{width:30%;text-align:center}.ke-dialog input[type=number]::-webkit-inner-spin-button,.ke-dialog input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.ke-dialog input[type=number]{-moz-appearance:textfield} \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.js b/src/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.js new file mode 100644 index 0000000..646b4e8 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/kindeditor/kindeditor.min.js @@ -0,0 +1,7 @@ +!function(window,undefined){function _isArray(e){return!!e&&"[object Array]"===Object.prototype.toString.call(e)}function _isFunction(e){return!!e&&"[object Function]"===Object.prototype.toString.call(e)}function _inArray(e,t){for(var n=0,i=t.length;n=0}function _addUnit(e,t){return t=t||"px",e&&/^\d+$/.test(e)?e+t:e}function _removeUnit(e){var t;return e&&(t=/(\d+)/.exec(e))?parseInt(t[1],10):0}function _escape(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function _unescape(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function _toCamel(e){var t=e.split("-");return e="",_each(t,function(t,n){e+=t>0?n.charAt(0).toUpperCase()+n.substr(1):n}),e}function _toHex(e){function t(e){var t=parseInt(e,10).toString(16).toUpperCase();return t.length>1?t:"0"+t}return e.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/gi,function(e,n,i,a){return"#"+t(n)+t(i)+t(a)})}function _toMap(e,t){t=t===undefined?",":t;var n,i={},a=_isArray(e)?e:e.split(t);return _each(a,function(e,t){if(n=/^(\d+)\.\.(\d+)$/.exec(t))for(var a=parseInt(n[1],10);a<=parseInt(n[2],10);a++)i[a.toString()]=!0;else i[t]=!0}),i}function _toArray(e,t){return Array.prototype.slice.call(e,t||0)}function _undef(e,t){return e===undefined?t:e}function _invalidUrl(e){return!e||/[<>"]/.test(e)}function _addParam(e,t){return e.indexOf("?")>=0?e+"&"+t:e+"?"+t}function _extend(e,t,n){n||(n=t,t=null);var i;if(t){var a=function(){};a.prototype=t.prototype,i=new a,_each(n,function(e,t){i[e]=t})}else i=n;i.constructor=e,e.prototype=i,e.parent=t?t.prototype:null}function _json(text){var match;(match=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(text))&&(text=match[0]);var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return eval("("+text+")");throw"JSON parse error"}function _getBasePath(){for(var e,t=document.getElementsByTagName("script"),n=0,i=t.length;n=0)return void _each(t.split(","),function(){_bind(e,this,n)});var i=_getId(e);i||(i=_setId(e)),_eventData[i]===undefined&&(_eventData[i]={});var a=_eventData[i][t];a&&a.length>0?_unbindEvent(e,t,a[0]):(_eventData[i][t]=[],_eventData[i].el=e),a=_eventData[i][t],0===a.length&&(a[0]=function(t){var n=t?new KEvent(e,t):undefined;_each(a,function(t,i){t>0&&i&&i.call(e,n)})}),_inArray(n,a)<0&&a.push(n),_bindEvent(e,t,a[0])}function _unbind(e,t,n){if(t&&t.indexOf(",")>=0)return void _each(t.split(","),function(){_unbind(e,this,n)});var i=_getId(e);if(i){if(t===undefined)return void(i in _eventData&&(_each(_eventData[i],function(t,n){"el"!=t&&n.length>0&&_unbindEvent(e,t,n[0])}),delete _eventData[i],_removeId(e)));if(_eventData[i]){var a=_eventData[i][t];if(a&&a.length>0){n===undefined?(_unbindEvent(e,t,a[0]),delete _eventData[i][t]):(_each(a,function(e,t){e>0&&t===n&&a.splice(e,1)}),1==a.length&&(_unbindEvent(e,t,a[0]),delete _eventData[i][t]));var o=0;_each(_eventData[i],function(){o++}),o<2&&(delete _eventData[i],_removeId(e))}}}}function _fire(e,t){if(t.indexOf(",")>=0)return void _each(t.split(","),function(){_fire(e,this)});var n=_getId(e);if(n){var i=_eventData[n][t];_eventData[n]&&i&&i.length>0&&i[0]()}}function _ctrl(e,t,n){t=/^\d{2,}$/.test(t)?t:t.toUpperCase().charCodeAt(0),_bind(e,"keydown",function(i){!i.ctrlKey||i.which!=t||i.shiftKey||i.altKey||(n.call(e),i.stop())})}function _ready(e){function t(){a||(a=!0,e(KindEditor),_readyFinished=!0)}function n(){if(!a){try{document.documentElement.doScroll("left")}catch(e){return void setTimeout(n,100)}t()}}function i(){"complete"===document.readyState&&t()}if(_readyFinished)return void e(KindEditor);var a=!1;if(document.addEventListener)_bind(document,"DOMContentLoaded",t);else if(document.attachEvent){_bind(document,"readystatechange",i);var o=!1;try{o=null==window.frameElement}catch(r){}document.documentElement.doScroll&&o&&n()}_bind(window,"load",t)}function _getCssList(e){for(var t,n={},i=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g;t=i.exec(e);){var a=_trim(t[1].toLowerCase()),o=_trim(_toHex(t[2]));n[a]=o}return n}function _getAttrList(e){for(var t,n={},i=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g;t=i.exec(e);){var a=(t[1]||t[2]||t[4]||t[6]).toLowerCase(),o=(t[2]?t[3]:t[4]?t[5]:t[7])||"";n[a]=o}return n}function _addClassToTag(e,t){return e=/\s+class\s*=/.test(e)?e.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(e,n,i,a){return(" "+i+" ").indexOf(" "+t+" ")<0?""===i?n+t+a:n+i+" "+t+a:e}):e.substr(0,e.length-1)+' class="'+t+'">'}function _formatCss(e){var t="";return _each(_getCssList(e),function(e,n){t+=e+":"+n+";"}),t}function _formatUrl(e,t,n,i){function a(e){for(var t=e.split("/"),n=[],i=0,a=t.length;i0&&n.pop():""!==o&&"."!=o&&n.push(o)}return"/"+n.join("/")}function o(t,n){if(e.substr(0,t.length)===t){for(var a=[],r=0;r0&&(s+="/"+a.join("/")),"/"==i&&(s+="/"),s+e.substr(t.length)}if(l=/^(.*)\//.exec(t))return o(l[1],++n)}if(t=_undef(t,"").toLowerCase(),"data:"!=e.substr(0,5)&&(e=e.replace(/([^:])\/\//g,"$1/")),_inArray(t,["absolute","relative","domain"])<0)return e;if(n=n||location.protocol+"//"+location.host,i===undefined){var r=location.pathname.match(/^(\/.*)\//);i=r?r[1]:""}var l;if(l=/^(\w+:\/\/[^\/]*)/.exec(e)){if(l[1]!==n)return e}else if(/^\w+:/.test(e))return e;return/^\//.test(e)?e=n+a(e.substr(1)):/^\w+:\/\//.test(e)||(e=n+a(i+"/"+e)),"relative"===t?e=o(n+i,0).substr(2):"absolute"===t&&e.substr(0,n.length)===n&&(e=e.substr(n.length)),e}function _formatHtml(e,t,n,i,a,o){null==e&&(e=""),n=n||"",i=_undef(i,!1),a=_undef(a,"\t");var r="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");e=e.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/gi,function(e,t,n,i){return t+n.replace(/<(?:br|br\s[^>]*)>/gi,"\n")+i}),e=e.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/gi,"

        "),e=e.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/gi,"$1
        $2"),e=e.replace(/\u200B/g,""),e=e.replace(/\u00A9/g,"©"),e=e.replace(/<[^>]+>/g,function(e){return e.replace(/\s+/g," ")});var l={};t&&(_each(t,function(e,t){for(var n=e.split(","),i=0,a=n.length;i]*)>)([\s\S]*?)(<\/script>)/gi,"")),l.style||(e=e.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/gi,"")));var s=/(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g,d=[],c=null;return e=e.replace(s,function(e,s,u,p,h,f,m){var g=e,v=s||"",_=u||"",b=p.toLowerCase(),y=h||"",k=f?" "+f:"",w=m||"";if(t&&!l[b])return"";if(""===k&&_SINGLE_TAG_MAP[b]&&(k=" /"),_INLINE_TAG_MAP[b]&&(v&&(v=" "),w&&(w=" ")),_PRE_TAG_MAP[b]&&(_?w="\n":v="\n"),!i||"br"!=b&&"hr"!==b||o&&c!==!0||(w="\n"),_BLOCK_TAG_MAP[b]&&!_PRE_TAG_MAP[b])if(i){var C=!!(_&&d.length>0&&d[d.length-1]===b);if(C?(d.pop(),o&&(v="",w="\n")):(d.push(b),o&&(v="\n",w="")),o||(v="\n",w="\n"),!o||c===!1&&!C||c===!0)for(var S=0,x=_?d.length:d.length-1;S=0&&(E[e]=_formatUrl(i,n)),(t&&"style"!==e&&!l[b]["*"]&&!l[b][e]||"body"===b&&"contenteditable"===e||/^kindeditor_\d+$/.test(e))&&delete E[e],"style"===e&&""!==i){var a=_getCssList(i);_each(a,function(e,n){!t||l[b].style||l[b]["."+e]||delete a[e]});var o="";_each(a,function(e,t){o+=e+":"+t+";"}),E.style=o}}),y="",_each(E,function(e,t){"style"===e&&""===t||(t=t.replace(/"/g,"""),y+=" "+e+'="'+t+'"')})}return"font"===b&&(b="span"),v+"<"+_+b+y+k+">"+w}),e=e.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/gi,function(e,t,n,i){return t+n.replace(/\n/g,'\n')+i}),e=e.replace(/\n\s*\n/g,"\n"),e=e.replace(/\n/g,"\n"),_trim(e)}function _clearMsWord(e,t){return e=e.replace(//gi,"").replace(//gi,"").replace(/]*>[\s\S]*?<\/style>/gi,"").replace(/]*>[\s\S]*?<\/script>/gi,"").replace(/]+>[\s\S]*?<\/w:[^>]+>/gi,"").replace(/]+>[\s\S]*?<\/o:[^>]+>/gi,"").replace(/[\s\S]*?<\/xml>/gi,"").replace(/<(?:table|td)[^>]*>/gi,function(e){return e.replace(/border-bottom:([#\w\s]+)/gi,"border:$1")}),_formatHtml(e,t)}function _mediaType(e){return/\.(rm|rmvb)(\?|$)/i.test(e)?"audio/x-pn-realaudio-plugin":/\.(swf|flv)(\?|$)/i.test(e)?"application/x-shockwave-flash":"video/x-ms-asf-plugin"}function _mediaClass(e){return/realaudio/i.test(e)?"ke-rm":/flash/i.test(e)?"ke-flash":"ke-media"}function _mediaAttrs(e){return _getAttrList(unescape(e))}function _mediaEmbed(e){var t="0&&(r+="width:"+n+"px;"),/\D/.test(i)?r+="height:"+i+";":i>0&&(r+="height:"+i+"px;");var l=''}function _tmpl(e,t){var n=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+e.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return t?n(t):n}function _contains(e,t){if(9==e.nodeType&&9!=t.nodeType)return!0;for(;t=t.parentNode;)if(t==e)return!0;return!1}function _getAttr(e,t){t=t.toLowerCase();var n=null;if(_GET_SET_ATTRIBUTE||"script"==e.nodeName.toLowerCase())try{n=e.getAttribute(t,2)}catch(i){n=e.getAttribute(t,1)}else{var a=e.ownerDocument.createElement("div");a.appendChild(e.cloneNode(!1));var o=_getAttrList(_unescape(a.innerHTML));t in o&&(n=o[t])}return"style"===t&&null!==n&&(n=_formatCss(n)),n}function _queryAll(e,t){function n(e){return"string"!=typeof e?e:e.replace(/([^\w\-])/g,"\\$1")}function i(e){return e.replace(/\\/g,"")}function a(e,t){return"*"===e||e.toLowerCase()===n(t.toLowerCase())}function o(e,t,n){var o=[],r=n.ownerDocument||n,l=r.getElementById(i(e));return l&&a(t,l.nodeName)&&_contains(n,l)&&o.push(l),o}function r(e,t,n){var o,r,l,s,d=n.ownerDocument||n,c=[];if(n.getElementsByClassName)for(o=n.getElementsByClassName(i(e)),r=0,l=o.length;r-1&&c.push(s)}return c}function l(e,t,n){for(var o,r=[],l=n.ownerDocument||n,s=l.getElementsByName(i(e)),d=0,c=s.length;d])+)/.exec(e);var a=n?n[1]:"*";if(n=/#((?:[\w\-]|\\.)+)$/.exec(e))i=o(n[1],a,t);else if(n=/\.((?:[\w\-]|\\.)+)$/.exec(e))i=r(n[1],a,t);else if(n=/\[((?:[\w\-]|\\.)+)\]/.exec(e))i=s(n[1].toLowerCase(),null,a,t);else if(n=/\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(e)){var d=n[1].toLowerCase(),c=n[2];i="id"===d?o(c,a,t):"class"===d?r(c,a,t):"name"===d?l(c,a,t):s(d,c,a,t)}else for(var u,p=t.getElementsByTagName(a),h=0,f=p.length;h1){var u=[];return _each(c,function(){_each(_queryAll(this,t),function(){_inArray(this,u)<0&&u.push(this)})}),u}t=t||document;for(var p,h=[],f=/((?:\\.|[^\s>])+|[\s>])/g;p=f.exec(e);)" "!==p[1]&&h.push(p[1]);var m=[];if(1==h.length)return d(h[0],t);var g,v,_,b,y,k,w,C,S,x,E=!1;for(k=0,lenth=h.length;k"!==g){if(k>0){for(v=[],w=0,S=m.length;w0?n[0]:null}function _get(e){return K(e)[0]}function _getDoc(e){return e?e.ownerDocument||e.document||e:document}function _getWin(e){if(!e)return window;var t=_getDoc(e);return t.parentWindow||t.defaultView}function _setHtml(e,t){if(1==e.nodeType){var n=_getDoc(e);try{e.innerHTML=''+t;var i=n.getElementById("__kindeditor_temp_tag__");i.parentNode.removeChild(i)}catch(a){K(e).empty(),K("@"+t,n).each(function(){e.appendChild(this)})}}}function _hasClass(e,t){return _inString(t,e.className," ")}function _setAttr(e,t,n){_IE&&_V<8&&"class"==t.toLowerCase()&&(t="className"),e.setAttribute(t,""+n)}function _removeAttr(e,t){_IE&&_V<8&&"class"==t.toLowerCase()&&(t="className"),_setAttr(e,t,""),e.removeAttribute(t)}function _getNodeName(e){return e&&e.nodeName?e.nodeName.toLowerCase():""}function _computedCss(e,t){var n=_getWin(e),i=_toCamel(t),a="";if(n.getComputedStyle){var o=n.getComputedStyle(e,null);a=o[i]||o.getPropertyValue(t)||e.style[i]}else e.currentStyle&&(a=e.currentStyle[i]||e.style[i]);return a}function _hasVal(e){return!!_VALUE_TAG_MAP[_getNodeName(e)]}function _docElement(e){return e=e||document,_QUIRKS?e.body:e.documentElement}function _docHeight(e){var t=_docElement(e);return Math.max(t.scrollHeight,t.clientHeight)}function _docWidth(e){var t=_docElement(e);return Math.max(t.scrollWidth,t.clientWidth)}function _getScrollPos(e){e=e||document;var t,n;return _IE||_NEWIE||_OPERA?(t=_docElement(e).scrollLeft,n=_docElement(e).scrollTop):(t=_getWin(e).scrollX,n=_getWin(e).scrollY),{x:t,y:n}}function KNode(e){this.init(e)}function _updateCollapsed(e){return e.collapsed=e.startContainer===e.endContainer&&e.startOffset===e.endOffset,e}function _copyAndDelete(e,t,n){function i(i,a,o){var r,s=i.nodeValue.length;if(t){var d=i.cloneNode(!0);r=a>0?d.splitText(a):d,o0&&(c=i.splitText(a),e.setStart(i,a)),o=0&&c<=0&&(c=g.compareBoundaryPoints(_START_TO_START,e)),c>=0&&u<=0&&(u=g.compareBoundaryPoints(_END_TO_END,e)),u>=0&&p<=0&&(p=g.compareBoundaryPoints(_END_TO_START,e)),p>=0)return!1;if(f=m.nextSibling,d>0)if(1==m.nodeType)if(c>=0&&u<=0)t&&h.appendChild(m.cloneNode(!0)),n&&l.push(m);else{var v;if(t&&(v=m.cloneNode(!1),h.appendChild(v)),o(m,v)===!1)return!1}else if(3==m.nodeType){var _;if(_=m==s.startContainer?i(m,s.startOffset,m.nodeValue.length):m==s.endContainer?i(m,0,s.endOffset):i(m,0,m.nodeValue.length),t)try{h.appendChild(_)}catch(b){}}m=f}}var r=e.doc,l=[],s=e.cloneRange().down(),d=-1,c=-1,u=-1,p=-1,h=e.commonAncestor(),f=r.createDocumentFragment();if(3==h.nodeType){var m=i(h,e.startOffset,e.endOffset);return t&&f.appendChild(m),a(),t?f:e}o(h,f),n&&e.up().collapse(!0);for(var g=0,v=l.length;g0?l+=f.text.replace(/\r\n|\n|\r/g,"").length:l=0,h&&K(h).remove()}else 3==p.nodeType&&(d.moveStart("character",p.nodeValue.length),l+=p.nodeValue.length);s<0&&(r=p)}if(s<0&&1==r.nodeType)return{node:a,offset:K(a.lastChild).index()+1};if(s>0)for(;r.nextSibling&&1==r.nodeType;)r=r.nextSibling;if(d=e.duplicate(),_moveToElementText(d,a),d.setEndPoint("StartToEnd",i),l-=d.text.replace(/\r\n|\n|\r/g,"").length,s>0&&3==r.nodeType)for(var v=r.previousSibling;v&&3==v.nodeType;)l-=v.nodeValue.length,v=v.previousSibling;return{node:r,offset:l}}function _getEndRange(e,t){var n=e.ownerDocument||e,i=n.body.createTextRange();if(n==e)return i.collapse(!0),i;if(1==e.nodeType&&e.childNodes.length>0){var a,o,r=e.childNodes;if(0===t?(o=r[0],a=!0):(o=r[t-1],a=!1),!o)return i;if("head"===K(o).name)return 1===t&&(a=!0),2===t&&(a=!1),i.collapse(a),i;if(1==o.nodeType){var l,s=K(o);return s.isControl()&&(l=n.createElement("span"),a?s.before(l):s.after(l),o=l),_moveToElementText(i,o),i.collapse(a),l&&K(l).remove(),i}e=o,t=a?0:o.nodeValue.length}var d=n.createElement("span");return K(e).before(d),_moveToElementText(i,d),i.moveStart("character",t),K(d).remove(),i}function _toRange(e){function t(e){"tr"==K(e.node).name&&(e.node=e.node.cells[e.offset],e.offset=0)}var n,i;if(_IERANGE){if(e.item)return n=_getDoc(e.item(0)),i=new KRange(n),i.selectNode(e.item(0)),i;n=e.parentElement().ownerDocument;var a=_getStartEnd(e,!0),o=_getStartEnd(e,!1);return t(a),t(o),i=new KRange(n),i.setStart(a.node,a.offset),i.setEnd(o.node,o.offset),i}var r=e.startContainer;return n=r.ownerDocument||r,i=new KRange(n),i.setStart(r,e.startOffset),i.setEnd(e.endContainer,e.endOffset),i}function KRange(e){this.init(e)}function _range(e){return e.nodeName?new KRange(e):e.constructor===KRange?e:_toRange(e)}function _nativeCommand(e,t,n){try{e.execCommand(t,!1,n)}catch(i){}}function _nativeCommandValue(e,t){var n="";try{n=e.queryCommandValue(t)}catch(i){}return"string"!=typeof n&&(n=""),n}function _getSel(e){var t=_getWin(e);return _IERANGE?e.selection:t.getSelection()}function _getRng(e){var t,n=_getSel(e);try{t=n.rangeCount>0?n.getRangeAt(0):n.createRange()}catch(i){}return!_IERANGE||t&&(t.item||t.parentElement().ownerDocument===e)?t:null}function _singleKeyMap(e){var t,n,i={};return _each(e,function(e,a){t=e.split(",");for(var o=0,r=t.length;o]+>/g,"")}function _mergeWrapper(e,t){e=e.clone(!0);for(var n=_getInnerNode(e),i=e,a=!1;t;){for(;i;)i.name===t.name&&(_mergeAttrs(i,t.attr(),t.css()),a=!0),i=i.first();a||n.append(t.clone(!1)),a=!1,t=t.first()}return e}function _wrapNode(e,t){if(t=t.clone(!0),3==e.type)return _getInnerNode(t).append(e.clone(!1)),e.replaceWith(t),t;for(var n,i=e;(n=e.first())&&1==n.children().length;)e=n;n=e.first();for(var a=e.doc.createDocumentFragment();n;)a.appendChild(n[0]),n=n.next();return t=_mergeWrapper(i,t),a.firstChild&&_getInnerNode(t).append(a),i.replaceWith(t),t}function _mergeAttrs(e,t,n){_each(t,function(t,n){"style"!==t&&e.attr(t,n)}),_each(n,function(t,n){e.css(t,n)})}function _inPreElement(e){for(;e&&"body"!=e.name;){if(_PRE_TAG_MAP[e.name]||"div"==e.name&&e.hasClass("ke-script"))return!0;e=e.parent()}return!1}function KCmd(e){this.init(e)}function _cmd(e){if(e.nodeName){var t=_getDoc(e);e=_range(t).selectNodeContents(t.body).collapse(!1)}return new KCmd(e)}function _drag(e){var t=e.moveEl,n=e.moveFn,i=e.clickEl||t,a=e.beforeDrag,o=e.iframeFix===undefined||e.iframeFix,r=[document];o&&K("iframe").each(function(){var e=_formatUrl(this.src||"","absolute");if(!/^https?:\/\//.test(e)){var t;try{t=_iframeDoc(this)}catch(n){}if(t){var i=K(this).pos();K(t).data("pos-x",i.x),K(t).data("pos-y",i.y),r.push(t)}}}),i.mousedown(function(e){function o(e){e.preventDefault();var t=K(_getDoc(e.target)),a=_round((t.data("pos-x")||0)+e.pageX-f),o=_round((t.data("pos-y")||0)+e.pageY-m);n.call(i,c,u,p,h,a,o)}function l(e){e.preventDefault()}function s(e){e.preventDefault(),K(r).unbind("mousemove",o).unbind("mouseup",s).unbind("selectstart",l),d.releaseCapture&&d.releaseCapture(),K(d).removeClass("ke-dragging")}e.stopPropagation();var d=i.get(),c=_removeUnit(t.css("left")),u=_removeUnit(t.css("top")),p=t.width(),h=t.height(),f=e.pageX,m=e.pageY;K(d).addClass("ke-dragging"),a&&a(),K(r).mousemove(o).mouseup(s).bind("selectstart",l),d.setCapture&&d.setCapture()})}function KWidget(e){this.init(e)}function _widget(e){return new KWidget(e)}function _iframeDoc(e){return e=_get(e),e.contentDocument||e.contentWindow.document}function _getInitHtml(e,t,n,i){var a=[""===_direction?"":'','',""];return _isArray(n)||(n=[n]),_each(n,function(e,t){t&&a.push('')}),i&&a.push(""),a.push(""),a.join("\n")}function _elementVal(e,t){if(e.hasVal()){if(t===undefined){var n=e.val();return n=n.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/gi,"")}return e.val(t)}return e.html(t)}function KEdit(e){this.init(e)}function _edit(e){return new KEdit(e)}function _selectToolbar(e,t){var n=this,i=n.get(e);if(i){if(i.hasClass("ke-disabled"))return;t(i)}}function KToolbar(e){this.init(e)}function _toolbar(e){return new KToolbar(e)}function KMenu(e){this.init(e)}function _menu(e){return new KMenu(e)}function KColorPicker(e){this.init(e)}function _colorpicker(e){return new KColorPicker(e)}function KUploadButton(e){this.init(e)}function _uploadbutton(e){return new KUploadButton(e)}function _createButton(e){e=e||{};var t=e.name||"",n=K(''),i=K('');return e.click&&i.click(e.click),n.append(i),n}function KDialog(e){this.init(e)}function _dialog(e){return new KDialog(e)}function _tabs(e){var t=_widget(e),n=t.remove,i=e.afterSelect,a=t.div,o=[];a.addClass("ke-tabs").bind("contextmenu,mousedown,mousemove",function(e){e.preventDefault()});var r=K('
          ');return a.append(r),t.add=function(e){var t=K('
        • '+e.title+"
        • ");t.data("tab",e),o.push(t),r.append(t)},t.selectedIndex=0,t.select=function(e){t.selectedIndex=e,_each(o,function(n,i){i.unbind(),n===e?(i.addClass("ke-tabs-li-selected"),K(i.data("tab").panel).show("")):(i.removeClass("ke-tabs-li-selected").removeClass("ke-tabs-li-on").mouseover(function(){K(this).addClass("ke-tabs-li-on")}).mouseout(function(){K(this).removeClass("ke-tabs-li-on")}).click(function(){t.select(n)}),K(i.data("tab").panel).hide())}),i&&i.call(t,e)},t.remove=function(){_each(o,function(){this.remove()}),r.remove(),n.call(t)},t}function _loadScript(e,t){var n=document.getElementsByTagName("head")[0]||(_QUIRKS?document.body:document.documentElement),i=document.createElement("script");n.appendChild(i),i.src=e,i.charset="utf-8",i.onload=i.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState||(t&&t(),i.onload=i.onreadystatechange=null,n.removeChild(i))}}function _chopQuery(e){var t=e.indexOf("?");return t>0?e.substr(0,t):e}function _loadStyle(e){for(var t=document.getElementsByTagName("head")[0]||(_QUIRKS?document.body:document.documentElement),n=document.createElement("link"),i=_chopQuery(_formatUrl(e,"absolute")),a=K('link[rel="stylesheet"]',t),o=0,r=a.length;on&&(n=this.width)))});i.length>0&&"-"==i[0].title;)i.shift();for(;i.length>0&&"-"==i[i.length-1].title;)i.pop();var a=null;if(_each(i,function(e){"-"==this.title&&"-"==a.title&&delete i[e],a=this}),i.length>0){t.preventDefault();var o=K(e.edit.iframe).pos(),r=_menu({x:o.x+t.clientX,y:o.y+t.clientY,width:n,css:{visibility:"hidden"},shadowMode:e.shadowMode});_each(i,function(){this.title&&r.addItem(this)});var l=_docElement(r.doc),s=r.div.height();t.clientY+s>=l.clientHeight-100&&r.pos(r.x,_removeUnit(r.y)-s),r.div.css("visibility","visible"),e.menu=r}}})}function _bindNewlineEvent(){function e(e){for(var t=K(e.commonAncestor());t&&(1!=t.type||t.isStyle());)t=t.parent();return t.name}var t=this,n=t.edit.doc,i=t.newlineTag;if(!(_IE&&"br"!==i||_GECKO&&_V<3&&"p"!==i||_OPERA&&_V<9)){var a=_toMap("h1,h2,h3,h4,h5,h6,pre,li"),o=_toMap("p,h1,h2,h3,h4,h5,h6,pre,li,blockquote");K(n).keydown(function(r){if(!(13!=r.which||r.shiftKey||r.ctrlKey||r.altKey)){t.cmd.selection();var l=e(t.cmd.range);if("marquee"!=l&&"select"!=l)return"br"!==i||a[l]?void(o[l]||_nativeCommand(n,"formatblock","

          ")):(r.preventDefault(),void t.insertHtml("
          "+(_IE&&_V<9?"":"​")))}}),K(n).keyup(function(a){if(!(13!=a.which||a.shiftKey||a.ctrlKey||a.altKey)&&"br"!=i){if(_GECKO){var r=t.cmd.commonAncestor("p"),l=t.cmd.commonAncestor("a");return void(l&&""==l.text()&&(l.remove(!0),t.cmd.range.selectNodeContents(r[0]).collapse(!0),t.cmd.select()))}t.cmd.selection();var s=e(t.cmd.range);"marquee"!=s&&"select"!=s&&(o[s]||_nativeCommand(n,"formatblock","

          "))}})}}function _bindTabEvent(){var e=this,t=e.edit.doc;K(t).keydown(function(n){if(9==n.which){if(n.preventDefault(),e.afterTab){var i=e.afterTab.call(e,n);if(i===!0)return}var a=e.cmd,o=a.range;o.shrink(),o.collapsed&&1==o.startContainer.nodeType&&(o.insertNode(K("@ ",t)[0]),a.select()),e.insertHtml("    ")}})}function _bindFocusEvent(){var e=this;K(e.edit.textarea[0],e.edit.win).focus(function(t){e.afterFocus&&e.afterFocus.call(e,t)}).blur(function(t){e.afterBlur&&e.afterBlur.call(e,t)})}function _removeBookmarkTag(e){return _trim(e.replace(/]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/gi,""))}function _removeTempTag(e){return e.replace(/]+class="?__kindeditor_paste__"?[^>]*>[\s\S]*?<\/div>/gi,"")}function _addBookmarkToStack(e,t){if(0===e.length)return void e.push(t);var n=e[e.length-1];_removeBookmarkTag(t.html)!==_removeBookmarkTag(n.html)&&e.push(t)}function _undoToRedo(e,t){var n,i,a=this,o=a.edit,r=o.doc.body;if(0===e.length)return a;o.designMode?(n=a.cmd.range,i=n.createBookmark(!0),i.html=r.innerHTML):i={html:r.innerHTML},_addBookmarkToStack(t,i);var l=e.pop();return _removeBookmarkTag(i.html)===_removeBookmarkTag(l.html)&&e.length>0&&(l=e.pop()), +o.designMode?(o.html(l.html),l.start&&(n.moveToBookmark(l),a.select())):K(r).html(_removeBookmarkTag(l.html)),a}function KEditor(e){function t(e,t){KEditor.prototype[e]===undefined&&(n[e]=t),n.options[e]=t}var n=this;n.options={},_each(e,function(n,i){t(n,e[n])}),_each(K.options,function(e,i){n[e]===undefined&&t(e,i)});var i=K(n.srcElement||"').css("width","100%"),n.tabIndex=isNaN(parseInt(e.tabIndex,10))?n.srcElement.attr("tabindex"):parseInt(e.tabIndex,10),n.iframe.attr("tabindex",n.tabIndex),n.textarea.attr("tabindex",n.tabIndex),n.width&&n.setWidth(n.width),n.height&&n.setHeight(n.height),n.designMode?n.textarea.hide():n.iframe.hide(),l&&n.iframe.bind("load",function(e){n.iframe.unbind("load"),_IE?t():setTimeout(t,0)}),n.div.append(n.iframe),n.div.append(n.textarea),n.srcElement.hide(),!l&&t()},setWidth:function(e){return this.div.css("width",_addUnit(e)),this},setHeight:function(e){var t=this;return e=_addUnit(e),t.div.css("height",e),t.iframe.css("height",e),(_IE&&_V<8||_QUIRKS)&&(e=_addUnit(_removeUnit(e)-2)),t.textarea.css("height",e),t},remove:function(){var e=this,t=e.doc;K(t.body).unbind(),K(t).unbind(),K(e.win).unbind(),e._mousedownHandler&&K(document).unbind("mousedown",e._mousedownHandler),_elementVal(e.srcElement,e.html()),e.srcElement.show(),t.write(""),e.iframe.unbind(),e.textarea.unbind(),KEdit.parent.remove.call(e)},html:function(e,t){var n=this,i=n.doc;if(n.designMode){var a=i.body;return e===undefined?(e=t?""+a.parentNode.innerHTML+"":a.innerHTML,n.beforeGetHtml&&(e=n.beforeGetHtml(e)),_GECKO&&"
          "==e&&(e=""),e):(n.beforeSetHtml&&(e=n.beforeSetHtml(e)),_IE&&_V>=9&&(e=e.replace(/(<.*?checked=")checked(".*>)/gi,"$1$2")),K(a).html(e),n.afterSetHtml&&n.afterSetHtml(),n)}return e===undefined?n.textarea.val():(n.textarea.val(e),n)},design:function(e){var t,n=this;return(e===undefined?!n.designMode:e)?n.designMode||(t=n.html(),n.designMode=!0,n.html(t),n.textarea.hide(),n.iframe.show()):n.designMode&&(t=n.html(),n.designMode=!1,n.html(t),n.iframe.hide(),n.textarea.show()),n.focus()},focus:function(){var e=this;return e.designMode?e.win.focus():e.textarea[0].focus(),e},blur:function(){var e=this;if(_IE){var t=K('',e.div);e.div.append(t),t[0].focus(),t.remove()}else e.designMode?e.win.blur():e.textarea[0].blur();return e},afterChange:function(e){function t(t){setTimeout(function(){e(t)},1)}var n=this,i=n.doc,a=i.body;return K(i).keyup(function(t){t.ctrlKey||t.altKey||!_CHANGE_KEY_MAP[t.which]||e(t)}),K(i).mouseup(e).contextmenu(e),K(n.win).blur(e),K(a).bind("paste",t),K(a).bind("cut",t),n}}),K.EditClass=KEdit,K.edit=_edit,K.iframeDoc=_iframeDoc,_extend(KToolbar,KWidget,{init:function(e){function t(e){var t=K(e);return t.hasClass("ke-outline")?t:t.hasClass("ke-toolbar-icon")?t.parent():void 0}function n(e,n){var i=t(e.target);if(i){if(i.hasClass("ke-disabled"))return;if(i.hasClass("ke-selected"))return;i[n]("ke-on")}}var i=this;KToolbar.parent.init.call(i,e),i.disableMode=_undef(e.disableMode,!1),i.noDisableItemMap=_toMap(_undef(e.noDisableItems,[])),i._itemMap={},i.div.addClass("ke-toolbar").bind("contextmenu,mousedown,mousemove",function(e){e.preventDefault()}).attr("unselectable","on"),i.div.mouseover(function(e){n(e,"addClass")}).mouseout(function(e){n(e,"removeClass")}).click(function(e){var n=t(e.target);if(n){if(n.hasClass("ke-disabled"))return;i.options.click.call(this,e,n.attr("data-name"))}})},get:function(e){return this._itemMap[e]?this._itemMap[e]:this._itemMap[e]=K("span.ke-icon-"+e,this.div).parent()},select:function(e){return _selectToolbar.call(this,e,function(e){e.addClass("ke-selected")}),self},unselect:function(e){return _selectToolbar.call(this,e,function(e){e.removeClass("ke-selected").removeClass("ke-on")}),self},enable:function(e){var t=this,n=e.get?e:t.get(e);return n&&(n.removeClass("ke-disabled"),n.opacity(1)),t},disable:function(e){var t=this,n=e.get?e:t.get(e);return n&&(n.removeClass("ke-selected").addClass("ke-disabled"),n.opacity(.5)),t},disableAll:function(e,t){var n=this,i=n.noDisableItemMap;return t&&(i=_toMap(t)),(e===undefined?!n.disableMode:e)?(K("span.ke-outline",n.div).each(function(){var e=K(this),t=e[0].getAttribute("data-name",2);i[t]||n.disable(e)}),n.disableMode=!0):(K("span.ke-outline",n.div).each(function(){var e=K(this),t=e[0].getAttribute("data-name",2);i[t]||n.enable(e)}),n.disableMode=!1),n}}),K.ToolbarClass=KToolbar,K.toolbar=_toolbar,_extend(KMenu,KWidget,{init:function(e){var t=this;e.z=e.z||811213,KMenu.parent.init.call(t,e),t.centerLineMode=_undef(e.centerLineMode,!0),t.div.addClass("ke-menu").bind("click,mousedown",function(e){e.stopPropagation()}).attr("unselectable","on")},addItem:function(e){var t=this;if("-"===e.title)return void t.div.append(K('

          '));var n=K('
          '),i=K('
          '),a=K('
          '),o=_addUnit(e.height),r=_undef(e.iconClass,"");t.div.append(n),o&&(n.css("height",o),a.css("line-height",o));var l;return t.centerLineMode&&(l=K('
          '),o&&l.css("height",o)),n.mouseover(function(e){K(this).addClass("ke-menu-item-on"),l&&l.addClass("ke-menu-item-center-on")}).mouseout(function(e){K(this).removeClass("ke-menu-item-on"),l&&l.removeClass("ke-menu-item-center-on")}).click(function(t){e.click.call(K(this)),t.stopPropagation()}).append(i),l&&n.append(l),n.append(a),e.checked&&(r="ke-icon-checked"),""!==r&&i.html(''),a.html(e.title),t},remove:function(){var e=this;return e.options.beforeRemove&&e.options.beforeRemove.call(e),K(".ke-menu-item",e.div[0]).unbind(),KMenu.parent.remove.call(e),e}}),K.MenuClass=KMenu,K.menu=_menu,_extend(KColorPicker,KWidget,{init:function(e){var t=this;e.z=e.z||811213,KColorPicker.parent.init.call(t,e);var n=e.colors||[["#E53333","#E56600","#FF9900","#64451D","#DFC5A4","#FFE500"],["#009900","#006600","#99BB00","#B8D100","#60D978","#00D5FF"],["#337FE5","#003399","#4C33E5","#9933E5","#CC33E5","#EE33EE"],["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000"]];t.selectedColor=(e.selectedColor||"").toLowerCase(),t._cells=[],t.div.addClass("ke-colorpicker").bind("click,mousedown",function(e){e.stopPropagation()}).attr("unselectable","on");var i=t.doc.createElement("table");t.div.append(i),i.className="ke-colorpicker-table",i.cellPadding=0,i.cellSpacing=0,i.border=0;var a=i.insertRow(0),o=a.insertCell(0);o.colSpan=n[0].length,t._addAttr(o,"","ke-colorpicker-cell-top");for(var r=0;r').css("background-color",t)):e.html(i.options.noColor),K(e).attr("unselectable","on"),i._cells.push(e)},remove:function(){var e=this;return _each(e._cells,function(){this.unbind()}),KColorPicker.parent.remove.call(e),e}}),K.ColorPickerClass=KColorPicker,K.colorpicker=_colorpicker,_extend(KUploadButton,{init:function(e){var t=this,n=K(e.button),i=e.fieldName||"file",a=e.url||"",o=n.val(),r=e.extraParams||{},l=n[0].className||"",s=e.target||"kindeditor_upload_iframe_"+(new Date).getTime();e.afterError=e.afterError||function(e){alert(e)};var d=[];for(var c in r)d.push('');var u=['
          ',e.target?"":'',e.form?'
          ':'
          ','',d.join(""),'',"",'',e.form?"
          ":"","
          "].join(""),p=K(u,n.doc);n.hide(),n.before(p),t.div=p,t.button=n,t.iframe=e.target?K('iframe[name="'+s+'"]'):K("iframe",p),t.form=e.form?K(e.form):K("form",p),t.fileBox=K(".ke-upload-file",p),t.options=e},submit:function(){var e=this,t=e.iframe;return t.bind("load",function(){t.unbind();var n=document.createElement("form");e.fileBox.before(n),K(n).append(e.fileBox),n.reset(),K(n).remove(!0);var i,a=K.iframeDoc(t),o=a.getElementsByTagName("pre")[0],r="";r=o?o.innerHTML:a.body.innerHTML,r=_unescape(r),t[0].src="javascript:false";try{i=K.json(r)}catch(l){e.options.afterError.call(e,""+a.body.parentNode.innerHTML+"")}i&&e.options.afterUpload.call(e,i)}),e.form[0].submit(),e},remove:function(){var e=this;return e.fileBox&&e.fileBox.unbind(),e.iframe.remove(),e.div.remove(),e.button.show(),e}}),K.UploadButtonClass=KUploadButton,K.uploadbutton=_uploadbutton,_extend(KDialog,KWidget,{init:function(e){var t=this,n=_undef(e.shadowMode,!0);e.z=e.z||811213,e.shadowMode=!1,e.autoScroll=_undef(e.autoScroll,!0),KDialog.parent.init.call(t,e);var i=e.title,a=K(e.body,t.doc),o=e.previewBtn,r=e.yesBtn,l=e.noBtn,s=e.closeBtn,d=_undef(e.showMask,!0);t.div.addClass("ke-dialog").bind("click,mousedown",function(e){e.stopPropagation()});var c=K('
          ').appendTo(t.div);_IE&&_V<7?t.iframeMask=K('').appendTo(t.div):n&&K('
          ').appendTo(t.div);var u=K('
          ');c.append(u),u.html(i),t.closeIcon=K('').click(s.click),u.append(t.closeIcon),t.draggable({clickEl:u,beforeDrag:e.beforeDrag});var p=K('
          ');c.append(p),p.append(a);var h=K('');if((o||r||l)&&c.append(h),_each([{btn:o,name:"preview"},{btn:r,name:"yes"},{btn:l,name:"no"}],function(){if(this.btn){var e=_createButton(this.btn);e.addClass("ke-dialog-"+this.name),h.append(e)}}),t.height&&p.height(_removeUnit(t.height)-u.height()-h.height()),t.div.width(t.div.width()),t.div.height(t.div.height()),t.mask=null,d){var f=_docElement(t.doc),m=Math.max(f.scrollWidth,f.clientWidth),g=Math.max(f.scrollHeight,f.clientHeight);t.mask=_widget({x:0,y:0,z:t.z-1,cls:"ke-dialog-mask",width:m,height:g})}t.autoPos(t.div.width(),t.div.height()),t.footerDiv=h,t.bodyDiv=p,t.headerDiv=u,t.isLoading=!1},setMaskIndex:function(e){var t=this;t.mask.div.css("z-index",e)},showLoading:function(e){e=_undef(e,"");var t=this,n=t.bodyDiv;return t.loading=K('
          '+e+"
          ").width(n.width()).height(n.height()).css("top",t.headerDiv.height()+"px"),n.css("visibility","hidden").after(t.loading),t.isLoading=!0,t},hideLoading:function(){return this.loading&&this.loading.remove(),this.bodyDiv.css("visibility","visible"),this.isLoading=!1,this},remove:function(){var e=this;return e.options.beforeRemove&&e.options.beforeRemove.call(e),e.mask&&e.mask.remove(),e.iframeMask&&e.iframeMask.remove(),e.closeIcon.unbind(),K("input",e.div).unbind(),K("button",e.div).unbind(),e.footerDiv.unbind(),e.bodyDiv.unbind(),e.headerDiv.unbind(),K("iframe",e.div).each(function(){K(this).remove()}),KDialog.parent.remove.call(e),e}}),K.DialogClass=KDialog,K.dialog=_dialog,K.tabs=_tabs,K.loadScript=_loadScript,K.loadStyle=_loadStyle,K.ajax=_ajax;var _plugins={},_language={};KEditor.prototype={lang:function(e){return _lang(e,this.langType)},loadPlugin:function(e,t){var n=this;return _plugins[e]?_isFunction(_plugins[e])?(_plugins[e].call(n,KindEditor),t&&t.call(n),n):(setTimeout(function(){n.loadPlugin(e,t)},100),n):(_plugins[e]="loading",_loadScript(n.pluginsPath+e+"/"+e+".js?ver="+encodeURIComponent(K.DEBUG?_TIME:_VERSION),function(){setTimeout(function(){_plugins[e]&&n.loadPlugin(e,t)},0)}),n)},handler:function(e,t){var n=this;return n._handlers[e]||(n._handlers[e]=[]),_isFunction(t)?(n._handlers[e].push(t),n):(_each(n._handlers[e],function(){t=this.call(n,t)}),t)},clickToolbar:function(e,t){var n=this,i="clickToolbar"+e;return t===undefined?n._handlers[i]?n.handler(i):(n.loadPlugin(e,function(){n.handler(i)}),n):n.handler(i,t)},updateState:function(){var e=this;return _each("justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,subscript,superscript,bold,italic,underline,strikethrough".split(","),function(t,n){e.cmd.state(n)?e.toolbar.select(n):e.toolbar.unselect(n)}),e},addContextmenu:function(e){return this._contextmenus.push(e),this},afterCreate:function(e){return this.handler("afterCreate",e)},beforeRemove:function(e){return this.handler("beforeRemove",e)},beforeGetHtml:function(e){return this.handler("beforeGetHtml",e)},beforeSetHtml:function(e){return this.handler("beforeSetHtml",e)},afterSetHtml:function(e){return this.handler("afterSetHtml",e)},create:function(){function e(){return 0===s.height()?void setTimeout(e,100):void t.resize(i,a,!1)}var t=this,n=t.fullscreenMode;if(t.isCreated)return t;if(t.srcElement.data("kindeditor"))return t;t.srcElement.data("kindeditor","true"),n?_docElement().style.overflow="hidden":_docElement().style.overflow="";var i=n?_docElement().clientWidth+"px":t.width,a=n?_docElement().clientHeight+"px":t.height;(_IE&&_V<8||_QUIRKS)&&(a=_addUnit(_removeUnit(a)+2));var o=t.container=K(t.layout);n?K(document.body).append(o):t.srcElement.before(o);var r=K(".toolbar",o),l=K(".edit",o),s=t.statusbar=K(".statusbar",o);o.removeClass("container").addClass("ke-container ke-container-"+t.themeType).css("width",i),n?(o.css({position:"absolute",left:0,top:0,"z-index":811211}),_GECKO||(t._scrollPos=_getScrollPos()),window.scrollTo(0,0),K(document.body).css({height:"1px",overflow:"hidden"}),K(document.body.parentNode).css("overflow","hidden"),t._fullscreenExecuted=!0):(t._fullscreenExecuted&&(K(document.body).css({height:"",overflow:""}),K(document.body.parentNode).css("overflow","")),t._scrollPos&&window.scrollTo(t._scrollPos.x,t._scrollPos.y));var d=[];K.each(t.items,function(e,n){"|"==n?d.push(''):"/"==n?d.push('
          '):(d.push(''),d.push(''))});var c=t.toolbar=_toolbar({src:r,html:d.join(""),noDisableItems:t.noDisableItems,click:function(e,n){if(e.stop(),t.menu){var i=t.menu.name;if(t.hideMenu(),i===n)return}t.clickToolbar(n)}}),u=_removeUnit(a)-c.div.height(),p=t.edit=_edit({height:u>0&&_removeUnit(a)>t.minHeight?u:t.minHeight,src:l,srcElement:t.srcElement,designMode:t.designMode,themesPath:t.themesPath,bodyClass:t.bodyClass,cssPath:t.cssPath,cssData:t.cssData,beforeGetHtml:function(e){return e=t.beforeGetHtml(e),e=_removeBookmarkTag(_removeTempTag(e)),_formatHtml(e,t.filterMode?t.htmlTags:null,t.urlType,t.wellFormatMode,t.indentChar,t.simpleWrap)},beforeSetHtml:function(e){return e=_formatHtml(e,t.filterMode?t.htmlTags:null,"",!1),t.beforeSetHtml(e)},afterSetHtml:function(){t.edit=p=this,t.afterSetHtml()},afterCreate:function(){if(t.edit=p=this,t.cmd=p.cmd,t._docMousedownFn=function(e){t.menu&&t.hideMenu()},K(p.doc,document).mousedown(t._docMousedownFn),_bindContextmenuEvent.call(t),_bindNewlineEvent.call(t),_bindTabEvent.call(t),_bindFocusEvent.call(t),p.afterChange(function(e){p.designMode&&(t.updateState(),t.addBookmark(),t.options.afterChange&&t.options.afterChange.call(t))}),p.textarea.keyup(function(e){e.ctrlKey||e.altKey||!_INPUT_KEY_MAP[e.which]||t.options.afterChange&&t.options.afterChange.call(t)}),t.readonlyMode&&t.readonly(),t.isCreated=!0,""===t.initContent&&(t.initContent=t.html()),t._undoStack.length>0){var e=t._undoStack.pop();e.start&&(t.html(e.html),p.cmd.range.moveToBookmark(e),t.select())}t.afterCreate(),t.options.afterCreate&&t.options.afterCreate.call(t),t.container.removeClass("ke-loading")}});return s.removeClass("statusbar").addClass("ke-statusbar").append(''),t._fullscreenResizeHandler&&(K(window).unbind("resize",t._fullscreenResizeHandler),t._fullscreenResizeHandler=null),e(),n?(t._fullscreenResizeHandler=function(e){t.isCreated&&t.resize(_docElement().clientWidth,_docElement().clientHeight,!1)},K(window).bind("resize",t._fullscreenResizeHandler),c.select("fullscreen")):(_GECKO&&K(window).bind("scroll",function(e){t._scrollPos=_getScrollPos()}),t.resizeType>0&&_drag({moveEl:o,clickEl:s,moveFn:function(e,n,i,a,o,r){a+=r,t.resize(null,a)}}),2===t.resizeType&&_drag({moveEl:o,clickEl:s.last(),moveFn:function(e,n,i,a,o,r){i+=o,a+=r,t.resize(i,a)}})),t},remove:function(){var e=this;return e.isCreated?(e.beforeRemove(),e.srcElement.data("kindeditor",""),e.menu&&e.hideMenu(),_each(e.dialogs,function(){e.hideDialog()}),K(document).unbind("mousedown",e._docMousedownFn),e.toolbar.remove(),e.edit.remove(),e.statusbar.last().unbind(),e.statusbar.unbind(),e.container.remove(),e.container=e.toolbar=e.edit=e.menu=null,e.dialogs=[],e.isCreated=!1,e):e},resize:function(e,t,n){var i=this;return n=_undef(n,!0),e&&(/%/.test(e)||(e=_removeUnit(e),e=e/gi,"").replace(/ /gi," ")):t.html(_escape(e))},isEmpty:function(){return""===_trim(this.text().replace(/\r\n|\n|\r/,""))},isDirty:function(){return _trim(this.initContent.replace(/\r\n|\n|\r|t/g,""))!==_trim(this.html().replace(/\r\n|\n|\r|t/g,""))},selectedHtml:function(){var e=this.isCreated?this.cmd.range.html():"";return e=_removeBookmarkTag(_removeTempTag(e))},count:function(e){var t=this;return e=(e||"html").toLowerCase(),"html"===e?t.html().length:"text"===e?t.text().replace(/<(?:img|embed).*?>/gi,"K").replace(/\r\n|\n|\r/g,"").length:0},exec:function(e){e=e.toLowerCase();var t=this,n=t.cmd,i=_inArray(e,"selectall,copy,paste,print".split(","))<0;return i&&t.addBookmark(!1),n[e].apply(n,_toArray(arguments,1)),i&&(t.updateState(),t.addBookmark(!1),t.options.afterChange&&t.options.afterChange.call(t)),t},insertHtml:function(e,t){return this.isCreated?(e=this.beforeSetHtml(e),this.exec("inserthtml",e,t),this):this},appendHtml:function(e){if(this.html(this.html()+e),this.isCreated){var t=this.cmd;t.range.selectNodeContents(t.doc.body).collapse(!1),t.select()}return this},sync:function(){return _elementVal(this.srcElement,this.html()),this},focus:function(){return this.isCreated?this.edit.focus():this.srcElement[0].focus(),this},blur:function(){return this.isCreated?this.edit.blur():this.srcElement[0].blur(),this},addBookmark:function(e){e=_undef(e,!0);var t,n=this,i=n.edit,a=i.doc.body,o=_removeTempTag(a.innerHTML);if(e&&n._undoStack.length>0){var r=n._undoStack[n._undoStack.length-1];if(Math.abs(o.length-_removeBookmarkTag(r.html).length)0){var n=t.dialogs[0],i=t.dialogs[t.dialogs.length-1];n.setMaskIndex(i.z+2),e.z=i.z+3,e.showMask=!1}var a=_dialog(e);return t.dialogs.push(a),a},hideDialog:function(){var e=this;if(e.dialogs.length>0&&e.dialogs.pop().remove(),e.dialogs.length>0){var t=e.dialogs[0],n=e.dialogs[e.dialogs.length-1];t.setMaskIndex(n.z-1)}return e},errorDialog:function(e){var t=this,n=t.createDialog({width:750,title:t.lang("uploadError"),body:'
          '}),i=K("iframe",n.div),a=K.iframeDoc(i);return a.open(),a.write(e),a.close(),K(a.body).css("background-color","#FFF"),i[0].contentWindow.focus(),t}},_instances=[],K.remove=function(e){_eachEditor(e,function(e){this.remove(),_instances.splice(e,1)})},K.sync=function(e){_eachEditor(e,function(){this.sync()})},K.html=function(e,t){_eachEditor(e,function(){this.html(t)})},K.insertHtml=function(e,t){_eachEditor(e,function(){this.insertHtml(t)})},K.appendHtml=function(e,t){_eachEditor(e,function(){this.appendHtml(t)})},_IE&&_V<7&&_nativeCommand(document,"BackgroundImageCache",!0),K.EditorClass=KEditor,K.editor=_editor,K.create=_create,K.instances=_instances,K.plugin=_plugin,K.lang=_lang,_plugin("core",function(e){var t=this,n={undo:"Z",redo:"Y",bold:"B",italic:"I",underline:"U",print:"P",selectall:"A"};if(t.afterSetHtml(function(){t.options.afterChange&&t.options.afterChange.call(t)}),t.afterCreate(function(){if("form"==t.syncType){for(var n=e(t.srcElement),i=!1;n=n.parent();)if("form"==n.name){i=!0;break}if(i){n.bind("submit",function(n){t.sync(),e(window).bind("unload",function(){t.edit.textarea.remove()})});var a=e('[type="reset"]',n);a.click(function(){t.html(t.initContent),t.cmd.selection()}),t.beforeRemove(function(){n.unbind(),a.unbind()})}}}),t.clickToolbar("source",function(){t.edit.designMode?(t.toolbar.disableAll(!0),t.edit.design(!1),t.toolbar.select("source")):(t.toolbar.disableAll(!1),t.edit.design(!0),t.toolbar.unselect("source"),_GECKO?setTimeout(function(){t.cmd.selection()},0):t.cmd.selection()),t.designMode=t.edit.designMode}),t.afterCreate(function(){t.designMode||t.toolbar.disableAll(!0).select("source")}),t.clickToolbar("fullscreen",function(){t.fullscreen()}),t.fullscreenShortcut){var i=!1;t.afterCreate(function(){if(e(t.edit.doc,t.edit.textarea).keyup(function(e){27==e.which&&setTimeout(function(){t.fullscreen()},0)}),i){if(_IE&&!t.designMode)return;t.focus()}i||(i=!0)})}_each("undo,redo".split(","),function(e,i){n[i]&&t.afterCreate(function(){_ctrl(this.edit.doc,n[i],function(){t.clickToolbar(i)})}),t.clickToolbar(i,function(){t[i]()})}),t.clickToolbar("formatblock",function(){var e=t.lang("formatblock.formatBlock"),n={h1:28,h2:24,h3:18,H4:14,p:12},i=t.cmd.val("formatblock"),a=t.createMenu({name:"formatblock",width:"en"==t.langType?200:150});_each(e,function(e,o){var r="font-size:"+n[e]+"px;";"h"===e.charAt(0)&&(r+="font-weight:bold;"),a.addItem({title:''+o+"",height:n[e]+12,checked:i===e||i===o,click:function(){t.select().exec("formatblock","<"+e+">").hideMenu()}})})}),t.clickToolbar("fontname",function(){var e=t.cmd.val("fontname"),n=t.createMenu({name:"fontname",width:150});_each(t.lang("fontname.fontName"),function(i,a){n.addItem({title:''+a+"",checked:e===i.toLowerCase()||e===a.toLowerCase(),click:function(){t.exec("fontname",i).hideMenu()}})})}),t.clickToolbar("fontsize",function(){var e=t.cmd.val("fontsize"),n=t.createMenu({name:"fontsize",width:150});_each(t.fontSizeTable,function(i,a){n.addItem({title:''+a+"",height:_removeUnit(a)+12,checked:e===a,click:function(){t.exec("fontsize",a).hideMenu()}})})}),_each("forecolor,hilitecolor".split(","),function(e,n){t.clickToolbar(n,function(){t.createMenu({name:n,selectedColor:t.cmd.val(n)||"default",colors:t.colorTable,click:function(e){t.exec(n,e).hideMenu()}})})}),_each("cut,copy,paste".split(","),function(e,n){t.clickToolbar(n,function(){t.focus();try{t.exec(n,null)}catch(e){alert(t.lang(n+"Error"))}})}),t.clickToolbar("about",function(){var e='
          KindEditor '+_VERSION+'
          Copyright © kindsoft.net All rights reserved.
          ';t.createDialog({name:"about",width:350,title:t.lang("about"),body:e})}),t.plugin.getSelectedLink=function(){return t.cmd.commonAncestor("a")},t.plugin.getSelectedImage=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return!/^ke-\w+$/i.test(e[0].className)})},t.plugin.getSelectedFlash=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return"ke-flash"==e[0].className})},t.plugin.getSelectedMedia=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return"ke-media"==e[0].className||"ke-rm"==e[0].className})},t.plugin.getSelectedAnchor=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return"ke-anchor"==e[0].className})},_each("link,image,flash,media,anchor".split(","),function(e,n){var i=n.charAt(0).toUpperCase()+n.substr(1);_each("edit,delete".split(","),function(e,a){t.addContextmenu({title:t.lang(a+i),click:function(){t.loadPlugin(n,function(){t.plugin[n][a](),t.hideMenu()})},cond:t.plugin["getSelected"+i],width:150,iconClass:"edit"==a?"ke-icon-"+n:undefined})}),t.addContextmenu({title:"-"})}),t.addContextmenu({title:"-"}),_each("selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript,hr,print,bold,italic,underline,strikethrough,removeformat,unlink".split(","),function(e,i){n[i]&&t.afterCreate(function(){_ctrl(this.edit.doc,n[i],function(){t.cmd.selection(),t.clickToolbar(i)})}), +t.clickToolbar(i,function(){t.focus().exec(i,null)})}),t.afterCreate(function(){function n(){i.range.moveToBookmark(a),i.select(),_WEBKIT&&(e("div."+l,o).each(function(){e(this).after("
          ").remove(!0)}),e("span.Apple-style-span",o).remove(!0),e("span.Apple-tab-span",o).remove(!0),e("span[style]",o).each(function(){"nowrap"==e(this).css("white-space")&&e(this).remove(!0)}),e("meta",o).remove());var n=o[0].innerHTML;o.remove(),""!==n&&(_WEBKIT&&(n=n.replace(/(
          )\1/gi,"$1")),2===t.pasteType&&(n=n.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/gi,""),/schemas-microsoft-com|worddocument|mso-\w+/i.test(n)?n=_clearMsWord(n,t.filterMode?t.htmlTags:e.options.htmlTags):(n=_formatHtml(n,t.filterMode?t.htmlTags:null),n=t.beforeSetHtml(n))),1===t.pasteType&&(n=n.replace(/ /gi," "),n=n.replace(/\n\s*\n/g,"\n"),n=n.replace(/]*>/gi,"\n"),n=n.replace(/<\/p>]*>/gi,"\n"),n=n.replace(/<[^>]+>/g,""),n=n.replace(/ {2}/g,"  "),"p"==t.newlineTag?/\n/.test(n)&&(n=n.replace(/^/,"

          ").replace(/$/,"

          ").replace(/\n/g,"

          ")):n=n.replace(/\n/g,"
          $&")),t.insertHtml(n,!0))}var i,a,o,r=t.edit.doc,l="__kindeditor_paste__",s=!1;e(r.body).bind("paste",function(d){if(0===t.pasteType)return void d.stop();if(!s){if(s=!0,e("div."+l,r).remove(),i=t.cmd.selection(),a=i.range.createBookmark(),o=e('

          ',r).css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",left:"-1981px",top:e(a.start).pos().y+"px","white-space":"nowrap"}),e(r.body).append(o),_IE){var c=i.range.get(!0);c.moveToElementText(o[0]),c.select(),c.execCommand("paste"),d.preventDefault()}else i.range.selectNodeContents(o[0]),i.select(),o[0].tabIndex=-1,o[0].focus();setTimeout(function(){n(),s=!1},0)}})}),t.beforeGetHtml(function(e){return _IE&&_V<=8&&(e=e.replace(/]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(e,t){return unescape(t)}),e=e.replace(/(]*)?>)/gi,function(e,t,n){return/\s+type="[^"]+"/i.test(e)?e:t+' type="text"'+n})),e.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/gi,function(e,t,n,i){return t+_unescape(n).replace(/\s+/g," ")+i}).replace(/]*class="?ke-(flash|rm|media)"?[^>]*>/gi,function(e){var t=_getAttrList(e),n=_getCssList(t.style||""),i=_mediaAttrs(t["data-ke-tag"]),a=_undef(n.width,""),o=_undef(n.height,"");return/px/i.test(a)&&(a=_removeUnit(a)),/px/i.test(o)&&(o=_removeUnit(o)),i.width=_undef(t.width,a),i.height=_undef(t.height,o),_mediaEmbed(i)}).replace(/]*class="?ke-anchor"?[^>]*>/gi,function(e){var t=_getAttrList(e);return''}).replace(/]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(e,t,n){return""+unescape(n)+""}).replace(/]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(e,t,n){return""+unescape(n)+""}).replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/gi,function(e,t,n,i){return e=e.replace(/(\s+(?:href|src)=")[^"]*(")/i,function(e,t,i){return t+_unescape(n)+i}),e=e.replace(/\s+data-ke-src="[^"]*"/i,"")}).replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/gi,function(e,t,n){return t+n})}),t.beforeSetHtml(function(e){return _IE&&_V<=8&&(e=e.replace(/]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/gi,function(e){var t=_getAttrList(e),n=_getCssList(t.style||"");return"none"==n.display?'
          ':e})),e.replace(/]*type="([^"]+)"[^>]*>(?:<\/embed>)?/gi,function(e){var n=_getAttrList(e);return n.src=_undef(n.src,""),n.width=_undef(n.width,0),n.height=_undef(n.height,0),_mediaImg(t.themesPath+"common/blank.gif",n)}).replace(/]*name="([^"]+)"[^>]*>(?:<\/a>)?/gi,function(e){var n=_getAttrList(e);return n.href!==undefined?e:''}).replace(/]*)>([\s\S]*?)<\/script>/gi,function(e,t,n){return'
          '+escape(n)+"
          "}).replace(/]*)>([\s\S]*?)<\/noscript>/gi,function(e,t,n){return'
          '+escape(n)+"
          "}).replace(/(<[^>]*)(href|src)="([^"]*)"([^>]*>)/gi,function(e,t,n,i,a){return e.match(/\sdata-ke-src="[^"]*"/i)?e:e=t+n+'="'+i+'" data-ke-src="'+_escape(i)+'"'+a}).replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/gi,function(e,t,n){return t+"data-ke-"+n}).replace(/]*\s+border="0"[^>]*>/gi,function(e){return e.indexOf("ke-zeroborder")>=0?e:_addClassToTag(e,"ke-zeroborder")})})})}}(window),KindEditor.lang({source:"HTML代码",preview:"预览",undo:"后退(Ctrl+Z)",redo:"前进(Ctrl+Y)",cut:"剪切(Ctrl+X)",copy:"复制(Ctrl+C)",paste:"粘贴(Ctrl+V)",plainpaste:"粘贴为无格式文本",wordpaste:"从Word粘贴",selectall:"全选(Ctrl+A)",justifyleft:"左对齐",justifycenter:"居中",justifyright:"右对齐",justifyfull:"两端对齐",insertorderedlist:"编号",insertunorderedlist:"项目符号",indent:"增加缩进",outdent:"减少缩进",subscript:"下标",superscript:"上标",formatblock:"段落",fontname:"字体",fontsize:"文字大小",forecolor:"文字颜色",hilitecolor:"文字背景",bold:"粗体(Ctrl+B)",italic:"斜体(Ctrl+I)",underline:"下划线(Ctrl+U)",strikethrough:"删除线",removeformat:"删除格式",image:"图片",multiimage:"批量图片上传",flash:"Flash",media:"视音频",table:"表格",tablecell:"单元格",hr:"插入横线",emoticons:"插入表情",link:"超级链接",unlink:"取消超级链接",fullscreen:"全屏显示",about:"关于",print:"打印(Ctrl+P)",filemanager:"文件空间",code:"插入程序代码",map:"Google地图",baidumap:"百度地图",lineheight:"行距",clearhtml:"清理HTML代码",pagebreak:"插入分页符",quickformat:"一键排版",insertfile:"插入文件",template:"插入模板",anchor:"锚点",yes:"确定",no:"取消",close:"关闭",editImage:"图片属性",deleteImage:"删除图片",editFlash:"Flash属性",deleteFlash:"删除Flash",editMedia:"视音频属性",deleteMedia:"删除视音频",editLink:"超级链接属性",deleteLink:"取消超级链接",editAnchor:"锚点属性",deleteAnchor:"删除锚点",tableprop:"表格属性",tablecellprop:"单元格属性",tableinsert:"插入表格",tabledelete:"删除表格",tablecolinsertleft:"左侧插入列",tablecolinsertright:"右侧插入列",tablerowinsertabove:"上方插入行",tablerowinsertbelow:"下方插入行",tablerowmerge:"向下合并单元格",tablecolmerge:"向右合并单元格",tablerowsplit:"拆分行",tablecolsplit:"拆分列",tablecoldelete:"删除列",tablerowdelete:"删除行",noColor:"无颜色",pleaseSelectFile:"请选择文件。",invalidImg:"请输入有效的URL地址。\n只允许jpg,gif,bmp,png格式。",invalidMedia:"请输入有效的URL地址。\n只允许swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb格式。",invalidWidth:"宽度必须为数字。",invalidHeight:"高度必须为数字。",invalidBorder:"边框必须为数字。",invalidUrl:"请输入有效的URL地址。",invalidRows:"行数为必选项,只允许输入大于0的数字。",invalidCols:"列数为必选项,只允许输入大于0的数字。",invalidPadding:"边距必须为数字。",invalidSpacing:"间距必须为数字。",invalidJson:"服务器发生故障。",uploadSuccess:"上传成功。",cutError:"您的浏览器安全设置不允许使用剪切操作,请使用快捷键(Ctrl+X)来完成。",copyError:"您的浏览器安全设置不允许使用复制操作,请使用快捷键(Ctrl+C)来完成。",pasteError:"您的浏览器安全设置不允许使用粘贴操作,请使用快捷键(Ctrl+V)来完成。",ajaxLoading:"加载中,请稍候 ...",uploadLoading:"上传中,请稍候 ...",uploadError:"上传错误","plainpaste.comment":"请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。","wordpaste.comment":"请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。","code.pleaseInput":"请输入程序代码。","link.url":"URL","link.linkType":"打开类型","link.newWindow":"新窗口","link.selfWindow":"当前窗口","flash.url":"URL","flash.width":"宽度","flash.height":"高度","flash.upload":"上传","flash.viewServer":"文件空间","media.url":"URL","media.width":"宽度","media.height":"高度","media.autostart":"自动播放","media.upload":"上传","media.viewServer":"文件空间","image.remoteImage":"网络图片","image.localImage":"本地上传","image.remoteUrl":"图片地址","image.localUrl":"上传文件","image.size":"图片大小","image.width":"宽","image.height":"高","image.resetSize":"重置大小","image.align":"对齐方式","image.defaultAlign":"默认方式","image.leftAlign":"左对齐","image.rightAlign":"右对齐","image.imgTitle":"图片说明","image.upload":"浏览...","image.viewServer":"图片空间","multiimage.uploadDesc":"允许用户同时上传<%=uploadLimit%>张图片,单张图片容量不超过<%=sizeLimit%>","multiimage.startUpload":"开始上传","multiimage.clearAll":"全部清空","multiimage.insertAll":"全部插入","multiimage.queueLimitExceeded":"文件数量超过限制。","multiimage.fileExceedsSizeLimit":"文件大小超过限制。","multiimage.zeroByteFile":"无法上传空文件。","multiimage.invalidFiletype":"文件类型不正确。","multiimage.unknownError":"发生异常,无法上传。","multiimage.pending":"等待上传","multiimage.uploadError":"上传失败","filemanager.emptyFolder":"空文件夹","filemanager.moveup":"移到上一级文件夹","filemanager.viewType":"显示方式:","filemanager.viewImage":"缩略图","filemanager.listImage":"详细信息","filemanager.orderType":"排序方式:","filemanager.fileName":"名称","filemanager.fileSize":"大小","filemanager.fileType":"类型","insertfile.url":"URL","insertfile.title":"文件说明","insertfile.upload":"上传","insertfile.viewServer":"文件空间","table.cells":"单元格数","table.rows":"行数","table.cols":"列数","table.size":"大小","table.width":"宽度","table.height":"高度","table.percent":"%","table.px":"px","table.space":"边距间距","table.padding":"边距","table.spacing":"间距","table.align":"对齐方式","table.textAlign":"水平对齐","table.verticalAlign":"垂直对齐","table.alignDefault":"默认","table.alignLeft":"左对齐","table.alignCenter":"居中","table.alignRight":"右对齐","table.alignTop":"顶部","table.alignMiddle":"中部","table.alignBottom":"底部","table.alignBaseline":"基线","table.border":"边框","table.borderWidth":"边框","table.borderColor":"颜色","table.backgroundColor":"背景颜色","map.address":"地址: ","map.search":"搜索","baidumap.address":"地址: ","baidumap.search":"搜索","baidumap.insertDynamicMap":"插入动态地图","anchor.name":"锚点名称","formatblock.formatBlock":{h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",p:"正 文"},"fontname.fontName":{SimSun:"宋体",NSimSun:"新宋体",FangSong_GB2312:"仿宋_GB2312",KaiTi_GB2312:"楷体_GB2312",SimHei:"黑体","Source Han Sans":"思源黑体","Source Han Serif":"思源宋体","Microsoft YaHei":"微软雅黑",Arial:"Arial","Arial Black":"Arial Black","Times New Roman":"Times New Roman","Courier New":"Courier New",Tahoma:"Tahoma",Verdana:"Verdana"},"lineheight.lineHeight":[{1:"单倍行距"},{1.5:"1.5倍行距"},{2:"2倍行距"},{2.5:"2.5倍行距"},{3:"3倍行距"}],"template.selectTemplate":"可选模板","template.replaceContent":"替换当前内容","template.fileList":{"1.html":"图片和文字","2.html":"表格","3.html":"项目编号"}},"zh_CN"),KindEditor.plugin("anchor",function(e){var t=this,n="anchor",i=t.lang(n+".");t.plugin.anchor={edit:function(){var a=['
          ','
          ','",'',"
          ","
          "].join(""),o=t.createDialog({name:n,width:300,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(e){t.insertHtml('').hideDialog().focus()}}}),r=o.div,l=e('input[name="name"]',r),s=t.plugin.getSelectedAnchor();s&&l.val(unescape(s.attr("data-ke-name"))),l[0].focus(),l[0].select()},"delete":function(){t.plugin.getSelectedAnchor().remove()}},t.clickToolbar(n,t.plugin.anchor.edit)}),KindEditor.plugin("autoheight",function(e){function t(){i.iframe.height(o),n.resize(null,Math.max((e.IE?a.scrollHeight:a.offsetHeight)+76,o))}var n=this;if(n.autoHeightMode){var i=n.edit,a=i.doc.body,o=e.removeUnit(n.height);i.iframe[0].scroll="no",a.style.overflowY="hidden",i.afterChange(t),n.isCreated?t():n.afterCreate(t)}}),KindEditor.plugin("baidumap",function(e){var t=this,n="baidumap",i=t.lang(n+"."),a=e.undef(t.mapWidth,558),o=e.undef(t.mapHeight,360);t.clickToolbar(n,function(){function r(){l=m[0].contentWindow,s=e.iframeDoc(m)}var l,s,d=['
          ','
          ','
          ',i.address+' ','','',"","
          ",'
          ',' ","
          ",'
          ',"
          ",'
          ',"
          "].join(""),c=t.createDialog({name:n,width:a+42,title:t.lang(n),body:d,yesBtn:{name:t.lang("yes"),click:function(e){var n=l.map,i=n.getCenter(),r=i.lng+","+i.lat,s=n.getZoom(),d=[f[0].checked?t.pluginsPath+"baidumap/index.html":"http://api.map.baidu.com/staticimage","?center="+encodeURIComponent(r),"&zoom="+encodeURIComponent(s),"&width="+a,"&height="+o,"&markers="+encodeURIComponent(r),"&markerStyles="+encodeURIComponent("l,A")].join("");f[0].checked?t.insertHtml(''):t.exec("insertimage",d),t.hideDialog().focus()}},beforeRemove:function(){h.remove(),s&&s.write(""),m.remove()}}),u=c.div,p=e('[name="address"]',u),h=e('[name="searchBtn"]',u),f=e('[name="insertDynamicMap"]',c.div),m=e('');m.bind("load",function(){m.unbind("load"),e.IE?r():setTimeout(r,0)}),e(".ke-map",u).replaceWith(m),h.click(function(){l.search(p.val())})})}),KindEditor.plugin("clearhtml",function(e){var t=this,n="clearhtml";t.clickToolbar(n,function(){t.focus();var n=t.html();n=n.replace(/(]*>)([\s\S]*?)(<\/script>)/gi,""),n=n.replace(/(]*>)([\s\S]*?)(<\/style>)/gi,""),n=e.formatHtml(n,{a:["href","target"],embed:["src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess"],img:["src","width","height","border","alt","title",".width",".height"],table:["border"],"td,th":["rowspan","colspan"],"div,hr,br,tbody,tr,p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":[]}),t.html(n),t.cmd.selection(!0),t.addBookmark()})}),KindEditor.plugin("code",function(e){var t=this,n="code";t.clickToolbar(n,function(){var i=t.lang(n+"."),a=['
          ','
          ','","
          ",'',"
          "].join(""),o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var a=e(".ke-code-type",o.div).val(),l=r.val(),s=""===a?"":" lang-"+a,d='
          \n'+e.escape(l)+"
          ";return""===e.trim(l)?(alert(i.pleaseInput),void r[0].focus()):void t.insertHtml(d).hideDialog().focus()}}}),r=e("textarea",o.div);r[0].focus()})}),KindEditor.plugin("emoticons",function(e){var t=this,n="emoticons",i=t.emoticonsPath||t.pluginsPath+"emoticons/images/",a=void 0===t.allowPreviewEmoticons||t.allowPreviewEmoticons,o=1;t.clickToolbar(n,function(){function r(n,a,o){k?n.mouseover(function(){a>v?(k.css("left",0),k.css("right","")):(k.css("left",""),k.css("right",0)),w.attr("src",i+o+".gif"),e(this).addClass("ke-on")}):n.mouseover(function(){e(this).addClass("ke-on")}),n.mouseout(function(){e(this).removeClass("ke-on")}),n.click(function(e){t.insertHtml('').hideMenu().focus(),e.stop()})}function l(t,n){var a=document.createElement("table");n.append(a),k&&(e(a).mouseover(function(){k.show("block")}),e(a).mouseout(function(){k.hide()}),b.push(e(a))),a.className="ke-table",a.cellPadding=0,a.cellSpacing=0,a.border=0;for(var o=(t-1)*m+f,l=0;l
          ').css("background-position","-"+24*o+"px 0px").css("background-image","url("+i+"static.gif)");c.append(h),b.push(c),o++}return a}function s(){e.each(b,function(){this.unbind()})}function d(e,t){e.click(function(e){s(),S.parentNode.removeChild(S),C.remove(),S=l(t,_),c(t),o=t,e.stop()})}function c(t){C=e('
          '),_.append(C);for(var n=1;n<=g;n++){if(t!==n){var i=e('
          ['+n+"]");d(i,n),C.append(i),b.push(i)}else C.append(e("@["+n+"]"));C.append(e("@ "))}}var u=5,p=9,h=135,f=0,m=u*p,g=Math.ceil(h/m),v=Math.floor(p/2),_=e('
          '),b=[],y=t.createMenu({name:n,beforeRemove:function(){s()}});y.div.append(_);var k,w;a&&(k=e('
          ').css("right",0),w=e(''),_.append(k),k.append(w));var C,S=l(o,_);c(o)})}),KindEditor.plugin("filemanager",function(e){function t(e,t,n){return e+" ("+Math.ceil(t/1024)+"KB, "+n+")"}function n(e,n){n.is_dir?e.attr("title",n.filename):e.attr("title",t(n.filename,n.filesize,n.datetime))}var i=this,a="filemanager",o=e.undef(i.fileManagerJson,i.basePath+"php/file_manager_json.php"),r=i.pluginsPath+a+"/images/",l=i.lang(a+".");i.plugin.filemanagerDialog=function(t){function s(t,n,a){var r="path="+t+"&order="+n+"&dir="+m;b.showLoading(i.lang("ajaxLoading")),e.ajax(e.addParam(o,r+"&"+(new Date).getTime()),function(e){b.hideLoading(),a(e)})}function d(t,n,i,a){var o=e.formatUrl(n.current_url+i.filename,"absolute"),r=encodeURIComponent(n.current_dir_path+i.filename+"/");i.is_dir?t.click(function(e){s(r,S.val(),a)}):i.is_photo?t.click(function(e){v.call(this,o,i.filename)}):t.click(function(e){v.call(this,o,i.filename)}),x.push(t)}function c(t,n){function i(){"VIEW"==C.val()?s(t.current_dir_path,S.val(),p):s(t.current_dir_path,S.val(),u)}e.each(x,function(){this.unbind()}),w.unbind(),C.unbind(),S.unbind(),t.current_dir_path&&w.click(function(e){s(t.moveup_dir_path,S.val(),n)}),C.change(i),S.change(i),k.html("")}function u(t){c(t,u);var n=document.createElement("table");n.className="ke-table",n.cellPadding=0,n.cellSpacing=0,n.border=0,k.append(n);for(var i=t.file_list,a=0,o=i.length;a'),m=e(p[0].insertCell(0)).addClass("ke-cell ke-name").append(f).append(document.createTextNode(" "+s.filename));!s.is_dir||s.has_file?(p.css("cursor","pointer"),m.attr("title",s.filename),d(m,t,s,u)):m.attr("title",l.emptyFolder),e(p[0].insertCell(1)).addClass("ke-cell ke-size").html(s.is_dir?"-":Math.ceil(s.filesize/1024)+"KB"),e(p[0].insertCell(2)).addClass("ke-cell ke-datetime").html(s.datetime)}}function p(t){c(t,p);for(var i=t.file_list,a=0,o=i.length;a');k.append(u);var h=e('
          ').mouseover(function(t){e(this).addClass("ke-on")}).mouseout(function(t){e(this).removeClass("ke-on")});u.append(h);var f=t.current_url+s.filename,m=s.is_dir?r+"folder-64.gif":s.is_photo?f:r+"file-64.gif",g=e(''+s.filename+'');!s.is_dir||s.has_file?(h.css("cursor","pointer"),n(h,s),d(h,t,s,p)):h.attr("title",l.emptyFolder),h.append(g),u.append('
          '+s.filename+"
          ")}}var h=e.undef(t.width,650),f=e.undef(t.height,510),m=e.undef(t.dirName,""),g=e.undef(t.viewType,"VIEW").toUpperCase(),v=t.clickFn,_=['
          ','
          ','
          ',' ',''+l.moveup+"","
          ",'
          ',l.viewType+' ",l.orderType+' ","
          ",'
          ',"
          ",'
          ',"
          "].join(""),b=i.createDialog({name:a,width:h,height:f,title:i.lang(a),body:_}),y=b.div,k=e(".ke-plugin-filemanager-body",y),w=(e('[name="moveupImg"]',y),e('[name="moveupLink"]',y)),C=(e('[name="viewServer"]',y),e('[name="viewType"]',y)),S=e('[name="orderType"]',y),x=[];return C.val(g),s("",S.val(),"VIEW"==g?p:u),b}}),KindEditor.plugin("flash",function(e){var t=this,n="flash",i=t.lang(n+"."),a=e.undef(t.allowFlashUpload,!0),o=e.undef(t.allowFileManager,!1),r=e.undef(t.formatUploadUrl,!0),l=e.undef(t.extraFileUploadParams,{}),s=e.undef(t.filePostName,"imgFile"),d=e.undef(t.uploadJson,t.basePath+"php/upload_json.php");t.plugin.flash={edit:function(){var c=['
          ','
          ','",'  ','  ','','',"","
          ",'
          ','",' ',"
          ",'
          ','",' ',"
          ","
          "].join(""),u=t.createDialog({name:n,width:450,title:t.lang(n),body:c,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(h.val()),a=m.val(),o=g.val();if("http://"==i||e.invalidUrl(i))return alert(t.lang("invalidUrl")),void h[0].focus();if(!/^\d*$/.test(a))return alert(t.lang("invalidWidth")),void m[0].focus();if(!/^\d*$/.test(o))return alert(t.lang("invalidHeight")),void g[0].focus();var r=e.mediaImg(t.themesPath+"common/blank.gif",{src:i,type:e.mediaType(".swf"),width:a,height:o,quality:"high"});t.insertHtml(r).hideDialog().focus()}}}),p=u.div,h=e('[name="url"]',p),f=e('[name="viewServer"]',p),m=e('[name="width"]',p),g=e('[name="height"]',p);if(h.val("http://"),a){var v=e.uploadbutton({button:e(".ke-upload-button",p)[0],fieldName:s,extraParams:l,url:e.addParam(d,"dir=flash"),afterUpload:function(i){if(u.hideLoading(),0===i.error){var a=i.url;r&&(a=e.formatUrl(a,"absolute")),h.val(a),t.afterUpload&&t.afterUpload.call(t,a,i,n),alert(t.lang("uploadSuccess"))}else alert(i.message)},afterError:function(e){u.hideLoading(),t.errorDialog(e)}});v.fileBox.change(function(e){u.showLoading(t.lang("uploadLoading")),v.submit()})}else e(".ke-upload-button",p).hide();o?f.click(function(n){t.loadPlugin("filemanager",function(){t.plugin.filemanagerDialog({viewType:"LIST",dirName:"flash",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',p).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})})}):f.hide();var _=t.plugin.getSelectedFlash();if(_){var b=e.mediaAttrs(_.attr("data-ke-tag"));h.val(b.src),m.val(e.removeUnit(_.css("width"))||b.width||0),g.val(e.removeUnit(_.css("height"))||b.height||0)}h[0].focus(),h[0].select()},"delete":function(){t.plugin.getSelectedFlash().remove(),t.addBookmark()}},t.clickToolbar(n,t.plugin.flash.edit)}),KindEditor.plugin("image",function(e){var t=this,n="image",i=e.undef(t.allowImageUpload,!0),a=e.undef(t.allowImageRemote,!0),o=e.undef(t.formatUploadUrl,!0),r=e.undef(t.allowFileManager,!1),l=e.undef(t.uploadJson,t.basePath+"php/upload_json.php"),s=e.undef(t.imageTabIndex,0),d=t.pluginsPath+"image/images/",c=e.undef(t.extraFileUploadParams,{}),u=e.undef(t.filePostName,"imgFile"),p=e.undef(t.fillDescAfterUploadImage,!1),h=t.lang(n+".");t.plugin.imageDialog=function(i){function a(e,t){K.val(e),U.val(t),R=e,M=t}var s=(i.imageUrl,e.undef(i.imageWidth,""),e.undef(i.imageHeight,""),e.undef(i.imageTitle,""),e.undef(i.imageAlign,""),e.undef(i.showRemote,!0)),f=e.undef(i.showLocal,!0),m=e.undef(i.tabIndex,0),g=i.clickFn,v="kindeditor_upload_iframe_"+(new Date).getTime(),_=[];for(var b in c)_.push('');var y,k=['
          ','
          ','",'","
          "].join(""),w=f||r?450:400,C=f&&s?300:250,S=t.createDialog({name:n,width:w,height:C,title:t.lang(n),body:k,yesBtn:{name:t.lang("yes"),click:function(n){if(!S.isLoading){if(f&&s&&y&&1===y.selectedIndex||!s)return""==D.fileBox.val()?void alert(t.lang("pleaseSelectFile")):(S.showLoading(t.lang("uploadLoading")),D.submit(),void T.val(""));var i=e.trim(E.val()),a=K.val(),o=U.val(),r=F.val(),l="";return I.each(function(){if(this.checked)return l=this.value,!1}),"http://"==i||e.invalidUrl(i)?(alert(t.lang("invalidUrl")),void E[0].focus()):/^\d*$/.test(a)?/^\d*$/.test(o)?void g.call(t,i,r,a,o,0,l):(alert(t.lang("invalidHeight")),void U[0].focus()):(alert(t.lang("invalidWidth")),void K[0].focus())}}},beforeRemove:function(){A.unbind(),K.unbind(),U.unbind(),N.unbind()}}),x=S.div,E=e('[name="url"]',x),T=e('[name="localUrl"]',x),A=e('[name="viewServer"]',x),K=e('.tab1 [name="width"]',x),U=e('.tab1 [name="height"]',x),N=e(".ke-refresh-btn",x),F=e('.tab1 [name="title"]',x),I=e('.tab1 [name="align"]',x);s&&f?(y=e.tabs({src:e(".tabs",x),afterSelect:function(e){}}),y.add({title:h.remoteImage,panel:e(".tab1",x)}),y.add({title:h.localImage,panel:e(".tab2",x)}),y.select(m)):s?e(".tab1",x).show():f&&e(".tab2",x).show();var D=e.uploadbutton({button:e(".ke-upload-button",x)[0],fieldName:u,form:e(".ke-form",x),target:v,width:70,afterUpload:function(i){if(S.hideLoading(),0===i.error){var a=i.url;o&&(a=e.formatUrl(a,"absolute")),t.afterUpload&&t.afterUpload.call(t,a,i,n),p?(e(".ke-dialog-row #remoteUrl",x).val(a),e(".ke-tabs-li",x)[0].click(),e(".ke-refresh-btn",x).click()):g.call(t,a,i.title,i.width,i.height,i.border,i.align)}else alert(i.message)},afterError:function(e){S.hideLoading(),t.errorDialog(e)}});D.fileBox.change(function(e){T.val(D.fileBox.val())}),r?A.click(function(n){t.loadPlugin("filemanager",function(){t.plugin.filemanagerDialog({viewType:"VIEW",dirName:"image",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',x).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})})}):A.hide();var R=0,M=0;return N.click(function(t){var n=e('',document).css({position:"absolute",visibility:"hidden",top:0,left:"-1000px"});n.bind("load",function(){a(n.width(),n.height()),n.remove()}),e(document.body).append(n)}),K.change(function(e){R>0&&U.val(Math.round(M/R*parseInt(this.value,10)))}),U.change(function(e){M>0&&K.val(Math.round(R/M*parseInt(this.value,10)))}),E.val(i.imageUrl),a(i.imageWidth,i.imageHeight),F.val(i.imageTitle),I.each(function(){if(this.value===i.imageAlign)return this.checked=!0,!1}),s&&0===m&&(E[0].focus(),E[0].select()),S},t.plugin.image={edit:function(){var e=t.plugin.getSelectedImage();t.plugin.imageDialog({imageUrl:e?e.attr("data-ke-src"):"http://",imageWidth:e?e.width():"",imageHeight:e?e.height():"",imageTitle:e?e.attr("title"):"",imageAlign:e?e.attr("align"):"",showRemote:a,showLocal:i,tabIndex:e?0:s,clickFn:function(n,i,a,o,r,l){e?(e.attr("src",n),e.attr("data-ke-src",n),e.attr("width",a),e.attr("height",o),e.attr("title",i),e.attr("align",l),e.attr("alt",i)):t.exec("insertimage",n,i,a,o,r,l),setTimeout(function(){t.hideDialog().focus()},0)}})},"delete":function(){var e=t.plugin.getSelectedImage();"a"==e.parent().name&&(e=e.parent()),e.remove(),t.addBookmark()}},t.clickToolbar(n,t.plugin.image.edit)}),KindEditor.plugin("insertfile",function(e){var t=this,n="insertfile",i=e.undef(t.allowFileUpload,!0),a=e.undef(t.allowFileManager,!1),o=e.undef(t.formatUploadUrl,!0),r=e.undef(t.uploadJson,t.basePath+"php/upload_json.php"),l=e.undef(t.extraFileUploadParams,{}),s=e.undef(t.filePostName,"imgFile"),d=t.lang(n+".");t.plugin.fileDialog=function(c){var u=e.undef(c.fileUrl,"http://"),p=e.undef(c.fileTitle,""),h=c.clickFn,f=['
          ','
          ','",'  ','  ','','',"","
          ",'
          ','",'
          ',"
          ","",""].join(""),m=t.createDialog({name:n,width:450,title:t.lang(n),body:f,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(v.val()),a=b.val();return"http://"==i||e.invalidUrl(i)?(alert(t.lang("invalidUrl")),void v[0].focus()):(""===e.trim(a)&&(a=i),void h.call(t,i,a))}}}),g=m.div,v=e('[name="url"]',g),_=e('[name="viewServer"]',g),b=e('[name="title"]',g);if(i){var y=e.uploadbutton({button:e(".ke-upload-button",g)[0],fieldName:s,url:e.addParam(r,"dir=file"),extraParams:l,afterUpload:function(i){if(m.hideLoading(),0===i.error){var a=i.url;o&&(a=e.formatUrl(a,"absolute")),v.val(a),t.afterUpload&&t.afterUpload.call(t,a,i,n),alert(t.lang("uploadSuccess"))}else alert(i.message)},afterError:function(e){m.hideLoading(),t.errorDialog(e)}});y.fileBox.change(function(e){m.showLoading(t.lang("uploadLoading")),y.submit()})}else e(".ke-upload-button",g).hide();a?_.click(function(n){t.loadPlugin("filemanager",function(){ +t.plugin.filemanagerDialog({viewType:"LIST",dirName:"file",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',g).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})})}):_.hide(),v.val(u),b.val(p),v[0].focus(),v[0].select()},t.clickToolbar(n,function(){t.plugin.fileDialog({clickFn:function(e,n){var i=''+n+"";t.insertHtml(i).hideDialog().focus()}})})}),KindEditor.plugin("lineheight",function(e){var t=this,n="lineheight",i=t.lang(n+".");t.clickToolbar(n,function(){var a="",o=t.cmd.commonNode({"*":".line-height"});o&&(a=o.css("line-height"));var r=t.createMenu({name:n,width:150});e.each(i.lineHeight,function(n,i){e.each(i,function(e,n){r.addItem({title:n,checked:a===e,click:function(){t.cmd.toggle('',{span:".line-height="+e}),t.updateState(),t.addBookmark(),t.hideMenu()}})})})})}),KindEditor.plugin("link",function(e){var t=this,n="link";t.plugin.link={edit:function(){var i=t.lang(n+"."),a='
          ',o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(l.val());return"http://"==i||e.invalidUrl(i)?(alert(t.lang("invalidUrl")),void l[0].focus()):void t.exec("createlink",i,s.val()).hideDialog().focus()}}}),r=o.div,l=e('input[name="url"]',r),s=e('select[name="type"]',r);l.val("http://"),s[0].options[0]=new Option(i.newWindow,"_blank"),s[0].options[1]=new Option(i.selfWindow,""),t.cmd.selection();var d=t.plugin.getSelectedLink();d&&(t.cmd.range.selectNode(d[0]),t.cmd.select(),l.val(d.attr("data-ke-src")),s.val(d.attr("target"))),l[0].focus(),l[0].select()},"delete":function(){t.exec("unlink",null)}},t.clickToolbar(n,t.plugin.link.edit)}),KindEditor.plugin("map",function(e){var t=this,n="map",i=t.lang(n+".");t.clickToolbar(n,function(){function a(){o=p[0].contentWindow,r=e.iframeDoc(p)}var o,r,l=['
          ','
          ',i.address+' ','','',"","
          ",'
          ',"
          "].join(""),s=t.createDialog({name:n,width:600,title:t.lang(n),body:l,yesBtn:{name:t.lang("yes"),click:function(e){var n=(o.geocoder,o.map),i=n.getCenter().lat()+","+n.getCenter().lng(),a=n.getZoom(),r=n.getMapTypeId(),l="http://maps.googleapis.com/maps/api/staticmap";l+="?center="+encodeURIComponent(i),l+="&zoom="+encodeURIComponent(a),l+="&size=558x360",l+="&maptype="+encodeURIComponent(r),l+="&markers="+encodeURIComponent(i),l+="&language="+t.langType,l+="&sensor=false",t.exec("insertimage",l).hideDialog().focus()}},beforeRemove:function(){u.remove(),r&&r.write(""),p.remove()}}),d=s.div,c=e('[name="address"]',d),u=e('[name="searchBtn"]',d),p=(["",'',"",'',"","",'','
          ',""].join("\n"),e(''));p.bind("load",function(){p.unbind("load"),e.IE?a():setTimeout(a,0)}),e(".ke-map",d).replaceWith(p),u.click(function(){o.search(c.val())})})}),KindEditor.plugin("media",function(e){var t=this,n="media",i=t.lang(n+"."),a=e.undef(t.allowMediaUpload,!0),o=e.undef(t.allowFileManager,!1),r=e.undef(t.formatUploadUrl,!0),l=e.undef(t.extraFileUploadParams,{}),s=e.undef(t.filePostName,"imgFile"),d=e.undef(t.uploadJson,t.basePath+"php/upload_json.php");t.plugin.media={edit:function(){var c=['
          ','
          ','",'  ','  ','','',"","
          ",'
          ','",'',"
          ",'
          ','",'',"
          ",'
          ','",' ',"
          ","
          "].join(""),u=t.createDialog({name:n,width:450,height:230,title:t.lang(n),body:c,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(h.val()),a=m.val(),o=g.val();if("http://"==i||e.invalidUrl(i))return alert(t.lang("invalidUrl")),void h[0].focus();if(!/^\d*$/.test(a))return alert(t.lang("invalidWidth")),void m[0].focus();if(!/^\d*$/.test(o))return alert(t.lang("invalidHeight")),void g[0].focus();var r=e.mediaImg(t.themesPath+"common/blank.gif",{src:i,type:e.mediaType(i),width:a,height:o,autostart:v[0].checked?"true":"false",loop:"true"});t.insertHtml(r).hideDialog().focus()}}}),p=u.div,h=e('[name="url"]',p),f=e('[name="viewServer"]',p),m=e('[name="width"]',p),g=e('[name="height"]',p),v=e('[name="autostart"]',p);if(h.val("http://"),a){var _=e.uploadbutton({button:e(".ke-upload-button",p)[0],fieldName:s,extraParams:l,url:e.addParam(d,"dir=media"),afterUpload:function(i){if(u.hideLoading(),0===i.error){var a=i.url;r&&(a=e.formatUrl(a,"absolute")),h.val(a),t.afterUpload&&t.afterUpload.call(t,a,i,n),alert(t.lang("uploadSuccess"))}else alert(i.message)},afterError:function(e){u.hideLoading(),t.errorDialog(e)}});_.fileBox.change(function(e){u.showLoading(t.lang("uploadLoading")),_.submit()})}else e(".ke-upload-button",p).hide();o?f.click(function(n){t.loadPlugin("filemanager",function(){t.plugin.filemanagerDialog({viewType:"LIST",dirName:"media",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',p).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})})}):f.hide();var b=t.plugin.getSelectedMedia();if(b){var y=e.mediaAttrs(b.attr("data-ke-tag"));h.val(y.src),m.val(e.removeUnit(b.css("width"))||y.width||0),g.val(e.removeUnit(b.css("height"))||y.height||0),v[0].checked="true"===y.autostart}h[0].focus(),h[0].select()},"delete":function(){t.plugin.getSelectedMedia().remove(),t.addBookmark()}},t.clickToolbar(n,t.plugin.media.edit)}),function(e){function t(e){this.init(e)}e.extend(t,{init:function(t){function n(t,n){e(".ke-status > div",t).hide(),e(".ke-message",t).addClass("ke-error").show().html(e.escape(n))}var i=this;t.afterError=t.afterError||function(e){alert(e)},i.options=t,i.progressbars={},i.div=e(t.container).html(['
          ','
          ','
          ','',"
          ",'
          '+t.uploadDesc+"
          ",'','',"","
          ",'
          ',"
          "].join("")),i.bodyDiv=e(".ke-swfupload-body",i.div);var a={debug:!1,upload_url:t.uploadUrl,flash_url:t.flashUrl,file_post_name:t.filePostName,button_placeholder:e(".ke-swfupload-button > input",i.div)[0],button_image_url:t.buttonImageUrl,button_width:t.buttonWidth,button_height:t.buttonHeight,button_cursor:SWFUpload.CURSOR.HAND,file_types:t.fileTypes,file_types_description:t.fileTypesDesc,file_upload_limit:t.fileUploadLimit,file_size_limit:t.fileSizeLimit,post_params:t.postParams,file_queued_handler:function(e){e.url=i.options.fileIconUrl,i.appendFile(e)},file_queue_error_handler:function(n,i,a){var o="";switch(i){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:o=t.queueLimitExceeded;break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:o=t.fileExceedsSizeLimit;break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:o=t.zeroByteFile;break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:o=t.invalidFiletype;break;default:o=t.unknownError}e.DEBUG&&alert(o)},upload_start_handler:function(t){var n=this,i=e('div[data-id="'+t.id+'"]',n.bodyDiv);e(".ke-status > div",i).hide(),e(".ke-progressbar",i).show()},upload_progress_handler:function(e,t,n){var a=Math.round(100*t/n),o=i.progressbars[e.id];o.bar.css("width",Math.round(80*a/100)+"px"),o.percent.html(a+"%")},upload_error_handler:function(t,a,o){if(t&&t.filestatus==SWFUpload.FILE_STATUS.ERROR){var r=e('div[data-id="'+t.id+'"]',i.bodyDiv).eq(0);n(r,i.options.errorMessage)}},upload_success_handler:function(t,a){var o=e('div[data-id="'+t.id+'"]',i.bodyDiv).eq(0),r={};try{r=e.json(a)}catch(l){i.options.afterError.call(this,""+a+"")}return 0!==r.error?void n(o,e.DEBUG?r.message:i.options.errorMessage):(t.url=r.url,e(".ke-img",o).attr("src",t.url).attr("data-status",t.filestatus).data("data",r),void e(".ke-status > div",o).hide())}};i.swfu=new SWFUpload(a),e(".ke-swfupload-startupload input",i.div).click(function(){i.swfu.startUpload()})},getUrlList:function(){var t=[];return e(".ke-img",self.bodyDiv).each(function(){var n=e(this),i=n.attr("data-status");i==SWFUpload.FILE_STATUS.COMPLETE&&t.push(n.data("data"))}),t},removeFile:function(t){var n=this;n.swfu.cancelUpload(t);var i=e('div[data-id="'+t+'"]',n.bodyDiv);e(".ke-photo",i).unbind(),e(".ke-delete",i).unbind(),i.remove()},removeFiles:function(){var t=this;e(".ke-item",t.bodyDiv).each(function(){t.removeFile(e(this).attr("data-id"))})},appendFile:function(t){var n=this,i=e('
          ');n.bodyDiv.append(i);var a=e('
          ').mouseover(function(t){e(this).addClass("ke-on")}).mouseout(function(t){e(this).removeClass("ke-on")});i.append(a);var o=e(''+t.name+'');a.append(o),e('').appendTo(a).click(function(){n.removeFile(t.id)});var r=e('
          ').appendTo(a);e(['
          ','
          ','
          0%
          '].join("")).hide().appendTo(r),e('
          '+n.options.pendingMessage+"
          ").appendTo(r),i.append('
          '+t.name+"
          "),n.progressbars[t.id]={bar:e(".ke-progressbar-bar-inner",a),percent:e(".ke-progressbar-percent",a)}},remove:function(){this.removeFiles(),this.swfu.destroy(),this.div.html("")}}),e.swfupload=function(e,n){return new t(e,n)}}(KindEditor),KindEditor.plugin("multiimage",function(e){var t=this,n="multiimage",i=(e.undef(t.formatUploadUrl,!0),e.undef(t.uploadJson,t.basePath+"php/upload_json.php")),a=t.pluginsPath+"multiimage/images/",o=e.undef(t.imageSizeLimit,"1MB"),r=(e.undef(t.imageFileTypes,"*.jpg;*.gif;*.png"),e.undef(t.imageUploadLimit,20)),l=e.undef(t.filePostName,"imgFile"),s=t.lang(n+".");t.plugin.multiImageDialog=function(d){var c=d.clickFn,u=e.tmpl(s.uploadDesc,{uploadLimit:r,sizeLimit:o}),p=['
          ','
          ',"
          ","
          "].join(""),h=t.createDialog({name:n,width:650,height:510,title:t.lang(n),body:p,previewBtn:{name:s.insertAll,click:function(e){c.call(t,m.getUrlList())}},yesBtn:{name:s.clearAll,click:function(e){m.removeFiles()}},beforeRemove:function(){(!e.IE||e.V<=8)&&m.remove()}}),f=h.div,m=e.swfupload({container:e(".swfupload",f),buttonImageUrl:a+("zh-CN"==t.langType?"select-files-zh-CN.png":"select-files-en.png"),buttonWidth:"zh-CN"==t.langType?72:88,buttonHeight:23,fileIconUrl:a+"image.png",uploadDesc:u,startButtonValue:s.startUpload,uploadUrl:e.addParam(i,"dir=image"),flashUrl:a+"swfupload.swf",filePostName:l,fileTypes:"*.jpg;*.jpeg;*.gif;*.png;*.bmp",fileTypesDesc:"Image Files",fileUploadLimit:r,fileSizeLimit:o,postParams:e.undef(t.extraFileUploadParams,{}),queueLimitExceeded:s.queueLimitExceeded,fileExceedsSizeLimit:s.fileExceedsSizeLimit,zeroByteFile:s.zeroByteFile,invalidFiletype:s.invalidFiletype,unknownError:s.unknownError,pendingMessage:s.pending,errorMessage:s.uploadError,afterError:function(e){t.errorDialog(e)}});return h},t.clickToolbar(n,function(){t.plugin.multiImageDialog({clickFn:function(n){0!==n.length&&(e.each(n,function(e,n){t.afterUpload&&t.afterUpload.call(t,n.url,n,"multiimage"),t.exec("insertimage",n.url,n.title,n.width,n.height,n.border,n.align)}),setTimeout(function(){t.hideDialog().focus()},0))}})})}),function(){window.SWFUpload=function(e){this.initSWFUpload(e)},SWFUpload.prototype.initSWFUpload=function(e){try{this.customSettings={},this.settings=e,this.eventQueue=[],this.movieName="KindEditor_SWFUpload_"+SWFUpload.movieCount++,this.movieElement=null,SWFUpload.instances[this.movieName]=this,this.initSettings(),this.loadFlash(),this.displayDebugInfo()}catch(t){throw delete SWFUpload.instances[this.movieName],t}},SWFUpload.instances={},SWFUpload.movieCount=0,SWFUpload.version="2.2.0 2009-03-25",SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130},SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290},SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5},SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120},SWFUpload.CURSOR={ARROW:-1,HAND:-2},SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"},SWFUpload.completeURL=function(e){if("string"!=typeof e||e.match(/^https?:\/\//i)||e.match(/^\//))return e;var t=(window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),window.location.pathname.lastIndexOf("/"));return t<=0?path="/":path=window.location.pathname.substr(0,t)+"/",path+e},SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(e,t){this.settings[e]=void 0==this.settings[e]?t:this.settings[e]},this.ensureDefault("upload_url",""),this.ensureDefault("preserve_relative_urls",!1),this.ensureDefault("file_post_name","Filedata"),this.ensureDefault("post_params",{}),this.ensureDefault("use_query_string",!1),this.ensureDefault("requeue_on_error",!1),this.ensureDefault("http_success",[]),this.ensureDefault("assume_success_timeout",0),this.ensureDefault("file_types","*.*"),this.ensureDefault("file_types_description","All Files"),this.ensureDefault("file_size_limit",0),this.ensureDefault("file_upload_limit",0),this.ensureDefault("file_queue_limit",0),this.ensureDefault("flash_url","swfupload.swf"),this.ensureDefault("prevent_swf_caching",!0),this.ensureDefault("button_image_url",""),this.ensureDefault("button_width",1),this.ensureDefault("button_height",1),this.ensureDefault("button_text",""),this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;"),this.ensureDefault("button_text_top_padding",0),this.ensureDefault("button_text_left_padding",0),this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES),this.ensureDefault("button_disabled",!1),this.ensureDefault("button_placeholder_id",""),this.ensureDefault("button_placeholder",null),this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW),this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW),this.ensureDefault("debug",!1),this.settings.debug_enabled=this.settings.debug,this.settings.return_upload_start_handler=this.returnUploadStart,this.ensureDefault("swfupload_loaded_handler",null),this.ensureDefault("file_dialog_start_handler",null),this.ensureDefault("file_queued_handler",null),this.ensureDefault("file_queue_error_handler",null),this.ensureDefault("file_dialog_complete_handler",null),this.ensureDefault("upload_start_handler",null),this.ensureDefault("upload_progress_handler",null),this.ensureDefault("upload_error_handler",null),this.ensureDefault("upload_success_handler",null),this.ensureDefault("upload_complete_handler",null),this.ensureDefault("debug_handler",this.debugMessage),this.ensureDefault("custom_settings",{}),this.customSettings=this.settings.custom_settings,this.settings.prevent_swf_caching&&(this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+(new Date).getTime()),this.settings.preserve_relative_urls||(this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url),this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)),delete this.ensureDefault},SWFUpload.prototype.loadFlash=function(){var e,t;if(null!==document.getElementById(this.movieName))throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";if(e=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder,void 0==e)throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;t=document.createElement("div"),t.innerHTML=this.getFlashHTML(),e.parentNode.replaceChild(t.firstChild,e),void 0==window[this.movieName]&&(window[this.movieName]=this.getMovieElement())},SWFUpload.prototype.getFlashHTML=function(){var e="";return KindEditor.IE&&KindEditor.V>8&&(e=' classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'),['','','','','','','',""].join("")},SWFUpload.prototype.getFlashVars=function(){var e=this.buildParamString(),t=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&uploadURL=",encodeURIComponent(this.settings.upload_url),"&useQueryString=",encodeURIComponent(this.settings.use_query_string),"&requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&httpSuccess=",encodeURIComponent(t),"&assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&params=",encodeURIComponent(e),"&filePostName=",encodeURIComponent(this.settings.file_post_name),"&fileTypes=",encodeURIComponent(this.settings.file_types),"&fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&buttonWidth=",encodeURIComponent(this.settings.button_width),"&buttonHeight=",encodeURIComponent(this.settings.button_height),"&buttonText=",encodeURIComponent(this.settings.button_text),"&buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&buttonAction=",encodeURIComponent(this.settings.button_action),"&buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")},SWFUpload.prototype.getMovieElement=function(){if(void 0==this.movieElement&&(this.movieElement=document.getElementById(this.movieName)),null===this.movieElement)throw"Could not find Flash element";return this.movieElement},SWFUpload.prototype.buildParamString=function(){var e=this.settings.post_params,t=[];if("object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n.toString())+"="+encodeURIComponent(e[n].toString()));return t.join("&")},SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,!1);var e=null;if(e=this.getMovieElement(),e&&"unknown"==typeof e.CallFunction){for(var t in e)try{"function"==typeof e[t]&&(e[t]=null)}catch(n){}try{e.parentNode.removeChild(e)}catch(i){}}return window[this.movieName]=null,SWFUpload.instances[this.movieName]=null,delete SWFUpload.instances[this.movieName],this.movieElement=null,this.settings=null,this.customSettings=null,this.eventQueue=null,this.movieName=null,!0}catch(a){return!1}},SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url: ",this.settings.upload_url,"\n","\t","flash_url: ",this.settings.flash_url,"\n","\t","use_query_string: ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error: ",this.settings.requeue_on_error.toString(),"\n","\t","http_success: ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout: ",this.settings.assume_success_timeout,"\n","\t","file_post_name: ",this.settings.file_post_name,"\n","\t","post_params: ",this.settings.post_params.toString(),"\n","\t","file_types: ",this.settings.file_types,"\n","\t","file_types_description: ",this.settings.file_types_description,"\n","\t","file_size_limit: ",this.settings.file_size_limit,"\n","\t","file_upload_limit: ",this.settings.file_upload_limit,"\n","\t","file_queue_limit: ",this.settings.file_queue_limit,"\n","\t","debug: ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching: ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id: ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder: ",this.settings.button_placeholder?"Set":"Not Set","\n","\t","button_image_url: ",this.settings.button_image_url.toString(),"\n","\t","button_width: ",this.settings.button_width.toString(),"\n","\t","button_height: ",this.settings.button_height.toString(),"\n","\t","button_text: ",this.settings.button_text.toString(),"\n","\t","button_text_style: ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding: ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action: ",this.settings.button_action.toString(),"\n","\t","button_disabled: ",this.settings.button_disabled.toString(),"\n","\t","custom_settings: ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned: ",("function"==typeof this.settings.swfupload_loaded_handler).toString(),"\n","\t","file_dialog_start_handler assigned: ",("function"==typeof this.settings.file_dialog_start_handler).toString(),"\n","\t","file_queued_handler assigned: ",("function"==typeof this.settings.file_queued_handler).toString(),"\n","\t","file_queue_error_handler assigned: ",("function"==typeof this.settings.file_queue_error_handler).toString(),"\n","\t","upload_start_handler assigned: ",("function"==typeof this.settings.upload_start_handler).toString(),"\n","\t","upload_progress_handler assigned: ",("function"==typeof this.settings.upload_progress_handler).toString(),"\n","\t","upload_error_handler assigned: ",("function"==typeof this.settings.upload_error_handler).toString(),"\n","\t","upload_success_handler assigned: ",("function"==typeof this.settings.upload_success_handler).toString(),"\n","\t","upload_complete_handler assigned: ",("function"==typeof this.settings.upload_complete_handler).toString(),"\n","\t","debug_handler assigned: ",("function"==typeof this.settings.debug_handler).toString(),"\n"].join(""))},SWFUpload.prototype.addSetting=function(e,t,n){return void 0==t?this.settings[e]=n:this.settings[e]=t},SWFUpload.prototype.getSetting=function(e){return void 0!=this.settings[e]?this.settings[e]:""},SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement(),returnValue,returnString;try{returnString=movieElement.CallFunction(''+__flash__argumentsToXML(argumentArray,0)+""),returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}return void 0!=returnValue&&"object"==typeof returnValue.post&&(returnValue=this.unescapeFilePostParams(returnValue)),returnValue},SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")},SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")},SWFUpload.prototype.startUpload=function(e){this.callFlash("StartUpload",[e])},SWFUpload.prototype.cancelUpload=function(e,t){t!==!1&&(t=!0),this.callFlash("CancelUpload",[e,t])},SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")},SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")},SWFUpload.prototype.setStats=function(e){this.callFlash("SetStats",[e])},SWFUpload.prototype.getFile=function(e){return"number"==typeof e?this.callFlash("GetFileByIndex",[e]):this.callFlash("GetFile",[e])},SWFUpload.prototype.addFileParam=function(e,t,n){return this.callFlash("AddFileParam",[e,t,n])},SWFUpload.prototype.removeFileParam=function(e,t){this.callFlash("RemoveFileParam",[e,t])},SWFUpload.prototype.setUploadURL=function(e){this.settings.upload_url=e.toString(),this.callFlash("SetUploadURL",[e])},SWFUpload.prototype.setPostParams=function(e){this.settings.post_params=e,this.callFlash("SetPostParams",[e])},SWFUpload.prototype.addPostParam=function(e,t){this.settings.post_params[e]=t,this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.removePostParam=function(e){delete this.settings.post_params[e],this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.setFileTypes=function(e,t){this.settings.file_types=e,this.settings.file_types_description=t,this.callFlash("SetFileTypes",[e,t])},SWFUpload.prototype.setFileSizeLimit=function(e){this.settings.file_size_limit=e,this.callFlash("SetFileSizeLimit",[e])},SWFUpload.prototype.setFileUploadLimit=function(e){this.settings.file_upload_limit=e,this.callFlash("SetFileUploadLimit",[e])},SWFUpload.prototype.setFileQueueLimit=function(e){this.settings.file_queue_limit=e,this.callFlash("SetFileQueueLimit",[e])},SWFUpload.prototype.setFilePostName=function(e){this.settings.file_post_name=e,this.callFlash("SetFilePostName",[e])},SWFUpload.prototype.setUseQueryString=function(e){this.settings.use_query_string=e,this.callFlash("SetUseQueryString",[e])},SWFUpload.prototype.setRequeueOnError=function(e){this.settings.requeue_on_error=e,this.callFlash("SetRequeueOnError",[e])},SWFUpload.prototype.setHTTPSuccess=function(e){"string"==typeof e&&(e=e.replace(" ","").split(",")),this.settings.http_success=e,this.callFlash("SetHTTPSuccess",[e])},SWFUpload.prototype.setAssumeSuccessTimeout=function(e){this.settings.assume_success_timeout=e,this.callFlash("SetAssumeSuccessTimeout",[e])},SWFUpload.prototype.setDebugEnabled=function(e){this.settings.debug_enabled=e,this.callFlash("SetDebugEnabled",[e])},SWFUpload.prototype.setButtonImageURL=function(e){void 0==e&&(e=""),this.settings.button_image_url=e,this.callFlash("SetButtonImageURL",[e])},SWFUpload.prototype.setButtonDimensions=function(e,t){this.settings.button_width=e,this.settings.button_height=t;var n=this.getMovieElement();void 0!=n&&(n.style.width=e+"px",n.style.height=t+"px"),this.callFlash("SetButtonDimensions",[e,t])},SWFUpload.prototype.setButtonText=function(e){this.settings.button_text=e,this.callFlash("SetButtonText",[e])},SWFUpload.prototype.setButtonTextPadding=function(e,t){this.settings.button_text_top_padding=t,this.settings.button_text_left_padding=e,this.callFlash("SetButtonTextPadding",[e,t])},SWFUpload.prototype.setButtonTextStyle=function(e){this.settings.button_text_style=e,this.callFlash("SetButtonTextStyle",[e])},SWFUpload.prototype.setButtonDisabled=function(e){this.settings.button_disabled=e,this.callFlash("SetButtonDisabled",[e])},SWFUpload.prototype.setButtonAction=function(e){this.settings.button_action=e,this.callFlash("SetButtonAction",[e])},SWFUpload.prototype.setButtonCursor=function(e){this.settings.button_cursor=e,this.callFlash("SetButtonCursor",[e])},SWFUpload.prototype.queueEvent=function(e,t){void 0==t?t=[]:t instanceof Array||(t=[t]);var n=this;if("function"==typeof this.settings[e])this.eventQueue.push(function(){this.settings[e].apply(this,t)}),setTimeout(function(){n.executeNextEvent()},0);else if(null!==this.settings[e])throw"Event handler "+e+" is unknown or is not a function"},SWFUpload.prototype.executeNextEvent=function(){var e=this.eventQueue?this.eventQueue.shift():null;"function"==typeof e&&e.apply(this)},SWFUpload.prototype.unescapeFilePostParams=function(e){var t,n=/[$]([0-9a-f]{4})/i,i={};if(void 0!=e){for(var a in e.post)if(e.post.hasOwnProperty(a)){t=a;for(var o;null!==(o=n.exec(t));)t=t.replace(o[0],String.fromCharCode(parseInt("0x"+o[1],16)));i[t]=e.post[a]}e.post=i}return e},SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(e){return!1}},SWFUpload.prototype.flashReady=function(){ +var e=this.getMovieElement();return e?(this.cleanUp(e),void this.queueEvent("swfupload_loaded_handler")):void this.debug("Flash called back ready but the flash movie can't be found.")},SWFUpload.prototype.cleanUp=function(e){try{if(this.movieElement&&"unknown"==typeof e.CallFunction){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var t in e)try{"function"==typeof e[t]&&(e[t]=null)}catch(n){}}}catch(i){}window.__flash__removeCallback=function(e,t){try{e&&(e[t]=null)}catch(n){}}},SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")},SWFUpload.prototype.fileQueued=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("file_queued_handler",e)},SWFUpload.prototype.fileQueueError=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("file_queue_error_handler",[e,t,n])},SWFUpload.prototype.fileDialogComplete=function(e,t,n){this.queueEvent("file_dialog_complete_handler",[e,t,n])},SWFUpload.prototype.uploadStart=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("return_upload_start_handler",e)},SWFUpload.prototype.returnUploadStart=function(e){var t;if("function"==typeof this.settings.upload_start_handler)e=this.unescapeFilePostParams(e),t=this.settings.upload_start_handler.call(this,e);else if(void 0!=this.settings.upload_start_handler)throw"upload_start_handler must be a function";void 0===t&&(t=!0),t=!!t,this.callFlash("ReturnUploadStart",[t])},SWFUpload.prototype.uploadProgress=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_progress_handler",[e,t,n])},SWFUpload.prototype.uploadError=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_error_handler",[e,t,n])},SWFUpload.prototype.uploadSuccess=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_success_handler",[e,t,n])},SWFUpload.prototype.uploadComplete=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("upload_complete_handler",e)},SWFUpload.prototype.debug=function(e){this.queueEvent("debug_handler",e)},SWFUpload.prototype.debugMessage=function(e){if(this.settings.debug){var t,n=[];if("object"==typeof e&&"string"==typeof e.name&&"string"==typeof e.message){for(var i in e)e.hasOwnProperty(i)&&n.push(i+": "+e[i]);t=n.join("\n")||"",n=t.split("\n"),t="EXCEPTION: "+n.join("\nEXCEPTION: "),SWFUpload.Console.writeLine(t)}else SWFUpload.Console.writeLine(e)}},SWFUpload.Console={},SWFUpload.Console.writeLine=function(e){var t,n;try{t=document.getElementById("SWFUpload_Console"),t||(n=document.createElement("form"),document.getElementsByTagName("body")[0].appendChild(n),t=document.createElement("textarea"),t.id="SWFUpload_Console",t.style.fontFamily="monospace",t.setAttribute("wrap","off"),t.wrap="off",t.style.overflow="auto",t.style.width="700px",t.style.height="350px",t.style.margin="5px",n.appendChild(t)),t.value+=e+"\n",t.scrollTop=t.scrollHeight-t.clientHeight}catch(i){alert("Exception: "+i.name+" Message: "+i.message)}}}(),function(){"function"==typeof SWFUpload&&(SWFUpload.queue={},SWFUpload.prototype.initSettings=function(e){return function(){"function"==typeof e&&e.call(this),this.queueSettings={},this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0,this.queueSettings.user_upload_complete_handler=this.settings.upload_complete_handler,this.queueSettings.user_upload_start_handler=this.settings.upload_start_handler,this.settings.upload_complete_handler=SWFUpload.queue.uploadCompleteHandler,this.settings.upload_start_handler=SWFUpload.queue.uploadStartHandler,this.settings.queue_complete_handler=this.settings.queue_complete_handler||null}}(SWFUpload.prototype.initSettings),SWFUpload.prototype.startUpload=function(e){this.queueSettings.queue_cancelled_flag=!1,this.callFlash("StartUpload",[e])},SWFUpload.prototype.cancelQueue=function(){this.queueSettings.queue_cancelled_flag=!0,this.stopUpload();for(var e=this.getStats();e.files_queued>0;)this.cancelUpload(),e=this.getStats()},SWFUpload.queue.uploadStartHandler=function(e){var t;return"function"==typeof this.queueSettings.user_upload_start_handler&&(t=this.queueSettings.user_upload_start_handler.call(this,e)),t=t!==!1,this.queueSettings.queue_cancelled_flag=!t,t},SWFUpload.queue.uploadCompleteHandler=function(e){var t,n=this.queueSettings.user_upload_complete_handler;if(e.filestatus===SWFUpload.FILE_STATUS.COMPLETE&&this.queueSettings.queue_upload_count++,t="function"==typeof n?n.call(this,e)!==!1:e.filestatus!==SWFUpload.FILE_STATUS.QUEUED){var i=this.getStats();i.files_queued>0&&this.queueSettings.queue_cancelled_flag===!1?this.startUpload():this.queueSettings.queue_cancelled_flag===!1?(this.queueEvent("queue_complete_handler",[this.queueSettings.queue_upload_count]),this.queueSettings.queue_upload_count=0):(this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0)}})}(),KindEditor.plugin("pagebreak",function(e){var t=this,n="pagebreak",i=e.undef(t.pagebreakHtml,'
          ');t.clickToolbar(n,function(){var n=t.cmd,a=n.range;t.focus();var o="br"==t.newlineTag||e.WEBKIT?"":'';if(t.insertHtml(i+o),""!==o){var r=e("#__kindeditor_tail_tag__",t.edit.doc);a.selectNodeContents(r[0]),r.removeAttr("id"),n.select()}})}),KindEditor.plugin("plainpaste",function(e){var t=this,n="plainpaste";t.clickToolbar(n,function(){var i=t.lang(n+"."),a='
          '+i.comment+'
          ',o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var i=r.val();i=e.escape(i),i=i.replace(/ {2}/g,"  "),i="p"==t.newlineTag?i.replace(/^/,"

          ").replace(/$/,"

          ").replace(/\n/g,"

          "):i.replace(/\n/g,"
          $&"),t.insertHtml(i).hideDialog().focus()}}}),r=e("textarea",o.div);r[0].focus()})}),KindEditor.plugin("preview",function(e){var t=this,n="preview";t.clickToolbar(n,function(){var i=(t.lang(n+"."),'

          '),a=t.createDialog({name:n,width:750,title:t.lang(n),body:i}),o=e("iframe",a.div),r=e.iframeDoc(o);r.open(),r.write(t.fullHtml()),r.write("");var l=t.options.cssData,s=t.options.cssPath,d=t.options.bodyClass;e.isArray(s)||(s=[s]),e.each(s,function(e,t){t&&r.write('')}),l&&r.write(""),r.close();var c=e(r.body).css("background-color","#FFF");d&&c.addClass(d),o[0].contentWindow.focus()})}),KindEditor.plugin("quickformat",function(e){function t(e){for(var t=e.first();t&&t.first();)t=t.first();return t}var n=this,i="quickformat",a=e.toMap("blockquote,center,div,h1,h2,h3,h4,h5,h6,p");n.clickToolbar(i,function(){n.focus();for(var i,o=n.edit.doc,r=n.cmd.range,l=e(o.body).first(),s=[],d=[],c=r.createBookmark(!0);l;){i=l.next();var u=t(l);u&&"img"==u.name||(a[l.name]?(l.html(l.html().replace(/^(\s| | )+/gi,"")),l.css("text-indent","2em")):d.push(l),(!i||a[i.name]||a[l.name]&&!a[i.name])&&(d.length>0&&s.push(d),d=[])),l=i}e.each(s,function(t,n){var i=e('

          ',o);n[0].before(i),e.each(n,function(e,t){i.append(t)})}),r.moveToBookmark(c),n.addBookmark()})}),KindEditor.plugin("template",function(e){function t(t){return a+t+"?ver="+encodeURIComponent(e.DEBUG?e.TIME:e.VERSION)}var n=this,i="template",a=(n.lang(i+"."),n.pluginsPath+i+"/html/");n.clickToolbar(i,function(){var a=n.lang(i+"."),o=['
          ','
          ','
          ',a.selectTemplate+"
          ",'
          ',' ","
          ",'
          ',"
          ",'',"
          "].join("");var r=n.createDialog({name:i,width:500,title:n.lang(i),body:html,yesBtn:{name:n.lang("yes"),click:function(t){var i=e.iframeDoc(d);n[s[0].checked?"html":"insertHtml"](i.body.innerHTML).hideDialog().focus()}}}),l=e("select",r.div),s=e('[name="replaceFlag"]',r.div),d=e("iframe",r.div);s[0].checked=!0,d.attr("src",t(l.val())),l.change(function(){d.attr("src",t(this.value))})})}),KindEditor.plugin("wordpaste",function(e){var t=this,n="wordpaste";t.clickToolbar(n,function(){var i=t.lang(n+"."),a='
          '+i.comment+'
          ',o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var i=s.body.innerHTML;i=e.clearMsWord(i,t.filterMode?t.htmlTags:e.options.htmlTags),t.insertHtml(i).hideDialog().focus()}}}),r=o.div,l=e("iframe",r),s=e.iframeDoc(l);e.IE||(s.designMode="on"),s.open(),s.write("WordPaste"),s.write(''),e.IE||s.write("
          "),s.write(""),s.close(),e.IE&&(s.body.contentEditable="true"),l[0].contentWindow.focus()})}),$.each(["afterBlur","afterFocus","afterChange","afterTab"],function(e,t){KindEditor.EditorClass.prototype[t]=function(e){return this.handler(t,e)}}),KindEditor.plugin("zui",function(e){var t=this,n=t.options;if(t.uuid=$.zui.uuid(),t.afterBlur(function(){n.syncAfterBlur&&t.sync(),t.container.removeClass("focus")}),t.afterFocus(function(){t.container.addClass("focus")}),t.afterChange(function(){t.edit.srcElement.change().hide()}),t.afterCreate(function(){$(t.edit.srcElement[0]).data("keditor",t);var e=n.spellcheck;void 0!==e&&t.edit.doc.documentElement.setAttribute("spellcheck",e)}),n.transferTab!==!1){var i='input:not([type="hidden"]), textarea:not(.ke-edit-textarea), button[type="submit"], select';t.afterTab(function(){var e=$(t.edit.srcElement[0]),n=e.next(i);if(n.length||(n=e.parent().next().find(i)),n.length||(n=e.parent().parent().next().find(i)),n=n.first(),n.length){var a=n.data("keditor");return a?a.focus():n.focus(),!0}return!0})}}),KindEditor.EditorClass.prototype.setPlaceholder=function(e,t){var n=this,i=n.options,a=n.edit,o=$(a.doc),r=o.find(".kindeditor-ph");r.length||(r=$('
          '),i.placeholderStyle&&r.css(i.placeholderStyle),o.find("body").after(r)),n.plugin.hasContent()&&r.hide(),r[t?"html":"text"](e)},KindEditor.EditorClass.prototype.getPlaceholder=function(e){return $(this.edit.doc).find(".kindeditor-ph")[e?"html":"text"]()},KindEditor.plugin("placeholder",function(e){var t=this;t.plugin.hasContent=function(){return""!==t.html().replace(/\s|\n|\r|\t/g,"").replace(//g,"").replace(/

          <\/p>/g,"")},t.afterBlur(function(){t.plugin.hasContent()||$(t.edit.doc).find(".kindeditor-ph").show()}),t.afterFocus(function(){$(t.edit.doc).find(".kindeditor-ph").hide()}),t.afterCreate(function(){var e=t.options;e.placeholderHtml?t.setPlaceholder(e.placeholderHtml,!0):e.placeholder&&t.setPlaceholder(e.placeholder)})}),KindEditor.plugin("pasteimage",function(e){var t=this,n={zh_cn:{notSupportMsg:"您的浏览器不支持粘贴图片!",placeholder:"可以在编辑器直接贴图。",failMsg:"贴图失败,请稍后重试。",uploadingHint:"正在上传图片,请稍后..."},zh_tw:{notSupportMsg:"您的瀏覽器不支持粘貼圖片!",placeholder:"可以在編輯器直接貼圖。",failMsg:"貼圖失敗,請稍後重試。",uploadingHint:"正在上傳圖片,請稍後..."},en:{notSupportMsg:"Image is not allowed to paste in your browser!",placeholder:"Paste images here.",failMsg:"Pasting image failed. Try again later.",uploadingHint:"Uploading..."}},i=$.extend({},n[($.clientLang||$.zui.clientLang)()]);t.afterCreate(function(){var n=t.edit,a=n.doc,o=t.uuid,r=t.options.pasteImage;if(r){if("string"==typeof r&&(r={postUrl:r}),$.extend({placeholder:l},r),e.WEBKIT||e.GECKO||$(a.body).on("keyup.ke"+o,function(e){86==e.keyCode&&e.ctrlKey&&alert(i.notSupportMsg)}),t.setPlaceholder){var l=r.placeholder;if(l===!0&&(l=i.placeholder),l){var s=t.getPlaceholder();s?s.indexOf(l)<0&&(l=s+"\n"+l):s=l,t.setPlaceholder(l)}}var d=function(){r.beforePaste&&r.beforePaste();var e='

          '+i.uploadingHint+"
          ";n.cmd.inserthtml(e),t.readonly(!0)},c=function(e){e&&(r.onError?r.onError(e):(e===!0&&(e=i.failMsg),$.zui&&$.zui.messager&&$.zui.messager.danger(e,{placement:"center"}))),r.afterPaste&&r.afterPaste(),$(a.body).find(".image-loading-ele").remove(),t.readonly(!1)},u=r.postUrl;$(a.body).on("paste.ke"+o,function(t){if(e.WEBKIT){var i=t.originalEvent,o=i.clipboardData&&i.clipboardData.items,r=null;if(o)for(var l=/^image\/(p?jpeg|gif|png)$/i,s=0;s';$.post(u,{editor:i},function(e){e?n.cmd.inserthtml(e):n.cmd.inserthtml(i),c()}).error(function(){c(!0)})},h.readAsDataURL(p)}else setTimeout(function(){var t=e(a.body).html();t.search(/"),n.html(e),c()}).error(function(){c(!0)}))},80)}),t.beforeRemove(function(){$(a.body).off(".ke"+o)})}})}),function(e){function t(t){var n=[],i=0,a=0;t.children("thead,tbody,tfoot").children("tr").each(function(t,o){e(o).children("td,th").each(function(o,r){var l,s,d=e(r),c=0|d.attr("colspan"),u=0|d.attr("rowspan");for(c=c?c:1,u=u?u:1;n[t]&&n[t][o];++o);for(l=o;ltr"),r=o.filter(function(){return!!this.style.backgroundColor}).length;t.stripedRows=r>=Math.floor(o/2)}if(s.tableSetting=t,void 0!==t.header){if(n.is(".ke-plugin-table-example"))n.find("thead").toggleClass("hidden",!t.header);else{var l=n.find("thead");if(t.header){if(!l.length){var d=["
          "],c=n.find("tbody>tr:first").children(),u=0;c.each(function(){var e=$(this),t=e.attr("colspan");u+=t?parseInt(t):1});for(var p=0;p'+(e.IE?" ":"
          ")+"");d.push("
          "),l=$(d.join("")),n.prepend(l)}}else l.remove()}i&&i("header",t.header)}if(void 0!==t.stripedRows){var o=n.find("tbody>tr");o.each(function(e){$(this).css("background-color",t.stripedRows&&e%2===0?"#f9f9f9":"none")}),i&&i("stripedRows",t.stripedRows)}void 0!==t.autoWidth&&(n.css(t.autoWidth?{width:"auto",maxWidth:"100%"}:{width:"100%"}),i&&i("autoWidth",t.autoWidth)),void 0!==t.borderColor&&(n.find("td,th").css("border-color",t.borderColor),i&&i("borderColor",t.borderColor))}}function r(t,n,i,a){if(t*n){for(var o="ke-table-"+s.tableIdIndex++,r=$('
          '),l=$(""),d=0;d"),u=0;u'+(e.IE?" ":"
          ")+"");c.append(p)}l.append(c)}r.append(l);var f=$("
          ").append(r).html();e.IE||(f+="
          "),s.insertHtml(f);var r=$(s.edit.doc).find("#"+o);return r.attr("id",null),s.cmd.range.selectNodeContents(r.find("th,td").first()[0]).collapse(!0),s.cmd.select(),s.addBookmark(),r}}function l(i){for(var a=$(i[0]),r=[""],l=[""],c=0;c<6;++c){r.push('{tableHead}'),l.push("");for(var u=0;u<6;++u)l.push('{tableContent}');l.push("")}r.push(""),l.push("");var f=['
          ','
          ','
          ','
          ',"",'
          ','
          ',"
          ",'
          ',"",'
          ','
          ',"
          ",'
          ',"",'
          ','{borderColor}','',"
          ","
          ","
          ",'
          ','',r.join(""),l.join(""),"
          ","","",""].join("").format(p),m=$(f),g=m.find(".ke-plugin-table-example"),v=s.cmd.range.createBookmark(),_=m.find(".ke-plugin-table-input-color"),b=e(_[0]);m.on("change.kTable","input[name]",function(){var e=$(this),t={};t[e.attr("name")]=e.is('[type="checkbox"]')?e.is(":checked"):e.val(),o(t,g)});var y=s.createDialog({name:d+"Dialog",width:550,title:s.lang(d),body:m[0],beforeRemove:function(){m.off(".kTable")},yesBtn:{name:s.lang("yes"),click:function(e){o({borderColor:m.find('[name="borderColor"]').val(),header:m.find('[name="header"]').is(":checked"),stripedRows:m.find('[name="stripedRows"]').is(":checked"),hoverRows:m.find('[name="hoverRows"]').is(":checked"),autoWidth:m.find('[name="autoWidth"]:checked').val()},a),s.hideDialog().focus(),s.cmd.range.moveToBookmark(v),s.cmd.select(),s.addBookmark()}}});n(y.div,b,function(e){o({borderColor:e},g)}),o(s.tableSetting,g,function(e,n){switch(e){case"borderColor":t(b,n||h);break;case"header":m.find('[name="header"]').prop("checked",!!n);break;case"stripedRows":m.find('[name="stripedRows"]').prop("checked",!!n);break;case"hoverRows":m.find('[name="hoverRows"]').prop("checked",!!n);break;case"autoWidth":m.find('[name="autoWidth"][value="'+(n?"auto":"")+'"]').prop("checked",!0)}})}var s=this,d="table",c={zh_cn:{name:"表格",xRxC:"{0}行 × {1}列",headerRow:"标题行",headerCol:"标题列",tableStyle:"表格样式",addHeaderRow:"添加表格标题行",stripedRows:"隔行变色效果",hoverRows:"鼠标悬停效果",autoChangeTableWidth:"自动调整表格尺寸",tableWidthFixed:"按表格文字自适应",tableWidthFull:"按页面宽度自适应",tableBorder:"表格边框",tableHead:"标题",tableContent:"内容",mergeCells:"合并单元格",defaultColor:"默认颜色",color:"颜色",forecolor:"文字颜色",backcolor:"背景颜色",invalidBoderWidth:"邊框大小必須為數字。"},zh_tw:{name:"表格",xRxC:"{0}行×{1}列",headerRow:"標題行",headerCol:"標題列",tableStyle:"表格樣式",addHeaderRow:"添加表格標題行",stripedRows:"隔行變色效果",hoverRows:"鼠標懸停效果",autoChangeTableWidth:"自動調整表格尺寸",tableWidthFixed:"按表格文字自適應",tableWidthFull:"按頁面寬度自適應",tableBorder:"表格邊框",tableHead:"標題",tableContent:"內容",mergeCells:"合併單元格",defaultColor:"默認顏色",color:"顏色",forecolor:"文字顏色",backcolor:"背景顏色",invalidBoderWidth:"边框大小必须为数字。"},en:{name:"Table",xRxC:"{0} Rows × {1} Columns",headerRow:"Header Row",headerCol:"Header Column",tableStyle:"Table style",addHeaderRow:"Add header row",stripedRows:"Striped effection",hoverRows:"Mouse hover effection",autoChangeTableWidth:"Automatically adjust table size",tableWidthFixed:"Adaptive by form text",tableWidthFull:"Page width adaptive",tableBorder:"Table border",tableHead:"Title",tableContent:"Text",mergeCells:"Merge Cells",defaultColor:"Default color",color:"Color",forecolor:"Text Color",backcolor:"Back Color",invalidBoderWidth:"Border width value must be number"}},u=[],p=$.extend({},s.lang("table."),c[($.clientLang||$.zui.clientLang)()]),h=s.options.tableBorderColor||"#ddd";s.tableIdIndex=0;var f=[];if(!s.plugin.table){s.plugin.table={prop:function(){var e=s.plugin.getSelectedTable();e&&e.length&&l(e)},cellprop:function(){var i,a,o,r,r,l,c,u,f,m=['
          ','
          ','",'
          ','
          ',''+p.width+"",'','','","
          ","
          ",'
          ','
          ',''+p.height+"",'','','","
          ","
          ","
          ",'
          ','",'
          ','
          ',''+p.textAlign+"",'","
          ","
          ",'
          ','
          ',''+p.verticalAlign+"",'","
          ","
          ","
          ",'
          ','",'
          ','
          ',''+p.borderColor+"",'',"
          ","
          ",'
          ','
          ',''+p.size+"",'','px',"
          ","
          ","
          ",'
          ','",'
          ','
          ',''+p.forecolor+"",'',"
          ","
          ",'
          ','
          ',''+p.backcolor+"",'',"
          ","
          ","
          ","
          "].join(""),g=s.cmd.range.createBookmark(),v=s.createDialog({name:d,width:500,title:s.lang("tablecell"),body:m,beforeRemove:function(){u.unbind()},yesBtn:{name:s.lang("yes"),click:function(t){var n=a.val(),i=o.val(),d=r.val(),h=heightTypeBox.val(),m=l.val(),v=c.val(),_=f.val()+"px",b=e(u[0]).val()||"",y=e(u[1]).val()||"",k=e(u[2]).val()||"";if(!/^\d*$/.test(n))return alert(s.lang("invalidWidth")),void a[0].focus();if(!/^\d*$/.test(i))return alert(s.lang("invalidHeight")),void o[0].focus();if(!/^\d*$/.test(_))return alert(p.invalidBoderWidth),void f[0].focus();for(var w=s.plugin.getAllSelectedCells(),C={width:""!==n?n+d:"",height:""!==i?i+h:"","background-color":k,"text-align":m,"border-width":_,"vertical-align":v,"border-color":b,color:y},S=0;S1?' rowspan="'+u.rowSpan+'"':"")+(u.colSpan>1?' colspan="'+u.colSpan+'"':"")+' style="'+(p?"background-color: #f1f1f1;":"")+"border: 1px solid "+(s.tableSetting&&s.tableSetting.borderColor||h)+'">'+(e.IE?" ":"
          ")+"",r=i(n,c,u)}s.cmd.range.selectNodeContents(o).collapse(!0),s.cmd.select(),s.addBookmark()},colinsertleft:function(){this.colinsert(0)},colinsertright:function(){this.colinsert(1)},rowinsert:function(t){var n=s.plugin.getSelectedTable()[0],i=s.plugin.getSelectedRow()[0],a=s.plugin.getSelectedCell()[0],o=i.rowIndex;1===t&&(o=i.rowIndex+(a.rowSpan-1)+t);for(var r=n.insertRow(o),l="THEAD"===r.parentNode.tagName,d=0,c=i.cells.length;d1&&(c-=i.cells[d].rowSpan-1);var u=r.insertCell(d);1===t&&i.cells[d].colSpan>1&&(u.colSpan=i.cells[d].colSpan),u.outerHTML="<"+(l?"th":"td")+(u.rowSpan>1?' rowspan="'+u.rowSpan+'"':"")+(u.colSpan>1?' colspan="'+u.colSpan+'"':"")+' style="'+(l?"background-color: #f1f1f1;":"")+"border: 1px solid "+(s.tableSetting&&s.tableSetting.borderColor||h)+'">'+(e.IE?" ":"
          ")+""}for(var p=o;p>=0;p--){var f=n.rows[p].cells;if(f.length>d){for(var m=a.cellIndex;m>=0;m--)f[m].rowSpan>1&&(f[m].rowSpan+=1);break}}s.cmd.range.selectNodeContents(a).collapse(!0),s.cmd.select(),s.addBookmark()},rowinsertabove:function(){this.rowinsert(0)},rowinsertbelow:function(){this.rowinsert(1)},rowmerge:function(){var e=s.plugin.getSelectedTable()[0],t=s.plugin.getSelectedRow()[0],n=s.plugin.getSelectedCell()[0],i=t.rowIndex,a=i+n.rowSpan,o=e.rows[a];if(!(e.rows.length<=a)){var r=n.cellIndex;if(!(o.cells.length<=r)){var l=o.cells[r];n.colSpan===l.colSpan&&(n.rowSpan+=l.rowSpan,o.deleteCell(r),s.cmd.range.selectNodeContents(n).collapse(!0),s.cmd.select(),s.addBookmark())}}},colmerge:function(){var e=(s.plugin.getSelectedTable()[0],s.plugin.getSelectedRow()[0]),t=s.plugin.getSelectedCell()[0],n=(e.rowIndex,t.cellIndex),i=n+1;if(!(e.cells.length<=i)){var a=e.cells[i];t.rowSpan===a.rowSpan&&(t.colSpan+=a.colSpan,e.deleteCell(i),s.cmd.range.selectNodeContents(t).collapse(!0),s.cmd.select(),s.addBookmark())}},mergeCells:function(){var e=s.tableSelectionRange;if(e){var t,n=s.plugin.getSelectedTable()[0],i=$(n),a=e.top,o=e.left,r=e.right,l=e.bottom;i.children("thead,tbody,tfoot").children("tr").each(function(){$(this).children("td,th").each(function(){var e=$(this),n=e.cellPos();n.left===o&&n.top===a?t=e:n.right>=o&&n.left<=r&&n.bottom>=a&&n.top<=l&&e.addClass("ke-cell-removed")})}),t&&(t.attr({rowspan:l-a+1,colspan:r-o+1}),i.find(".ke-cell-removed").remove(),s.cmd.range.selectNodeContents(t[0]).collapse(!0),s.cmd.select(),s.addBookmark())}},rowsplit:function(){var t=s.plugin.getSelectedTable()[0],n=s.plugin.getSelectedRow()[0],a=s.plugin.getSelectedCell()[0],o=n.rowIndex;if(1!==a.rowSpan){for(var r=i(t,n,a),l=1,d=a.rowSpan;l1?a.colSpan:u.colSpan;u.outerHTML="<"+(p?"th":"td")+(u.rowSpan>1?' rowspan="'+u.rowSpan+'"':"")+(f>1?' colspan="'+f+'"':"")+' style="'+(p?"background-color: #f1f1f1;":"")+"border: 1px solid "+(s.tableSetting&&s.tableSetting.borderColor||h)+'">'+(e.IE?" ":"
          ")+"",a.colSpan>1&&(u.colSpan=a.colSpan),r=i(t,c,u)}e(a).removeAttr("rowSpan"),s.cmd.range.selectNodeContents(a).collapse(!0),s.cmd.select(),s.addBookmark()}},colsplit:function(){var t=(s.plugin.getSelectedTable()[0],s.plugin.getSelectedRow()[0]),n=s.plugin.getSelectedCell()[0],i=n.cellIndex;if(1!==n.colSpan){for(var a="THEAD"===t.parentNode.tagName,o=1,r=n.colSpan;o1?n.rowSpan:l.rowSpan,c=l.colSpan;l.outerHTML="<"+(a?"th":"td")+(d>1?' rowspan="'+d+'"':"")+(c>1?' colspan="'+c+'"':"")+' style="'+(a?"background-color: #f1f1f1;":"")+"border: 1px solid "+(s.tableSetting&&s.tableSetting.borderColor||h)+'">'+(e.IE?" ":"
          ")+""}e(n).removeAttr("colSpan"),s.cmd.range.selectNodeContents(n).collapse(!0),s.cmd.select(),s.addBookmark()}},coldelete:function(){var t=s.plugin.getSelectedTable()[0],n=s.plugin.getAllSelectedCells();if(n.length){for(var i=0;i1?(u.colSpan-=1,1===u.colSpan&&e(u).removeAttr("colSpan")):c.deleteCell(r),u.rowSpan>1&&(l+=u.rowSpan-1)}if(0===o.cells.length){s.cmd.range.setStartBefore(t).collapse(!0),s.cmd.select(), +e(t).remove();break}}}t.parentNode&&s.cmd.selection(!0),s.addBookmark()}},rowdelete:function(){var t=s.plugin.getSelectedTable()[0],n=s.plugin.getAllSelectedCells();if(n.length){for(var i=0;i=0;r--)t.deleteRow(o.rowIndex+r)}0===t.rows.length?(s.cmd.range.setStartBefore(t).collapse(!0),s.cmd.select(),e(t).remove()):s.cmd.selection(!0),s.addBookmark()}}},s.plugin.getSelectedTable=function(){return e($(s.cmd.range.startContainer).closest("table")[0])},s.plugin.getSelectedRow=function(){return e($(s.cmd.range.startContainer).closest("tr")[0])},s.plugin.getSelectedCell=function(){return e($(s.cmd.range.startContainer).closest("td,th")[0])},s.plugin.getSelectedCells=function(){var t=s.plugin.getSelectedTable();if(t&&t.length){var n=e(".ke-select-cell",t.get(0));if(n&&n.length>1)return n}},s.plugin.getSingleSelectedCell=function(){var e=s.plugin.getSelectedCells();if(!(e&&e.length>1))return s.plugin.getSelectedCell()},s.plugin.getAllSelectedCells=function(){var e=s.plugin.getSelectedCells();return e&&e.length?e:s.plugin.getSelectedCell()};var m={mergeCells:"ke-icon-tablecolmerge"};e.each("prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,mergeCells,rowmerge,colmerge,rowsplit,colsplit,coldelete,rowdelete,delete".split(","),function(t,n){var i;i="prop"===n||"delete"===n?s.plugin.getSelectedTable:"mergeCells"===n?s.plugin.getSelectedCells:"rowmerge"===n?function(){var e=s.plugin.getSingleSelectedCell();if(e&&e.length&&$(e.get(0)).parent().next("tr").length)return e}:"colmerge"===n?function(){var e=s.plugin.getSingleSelectedCell();if(e&&e.length&&$(e.get(0)).next("th,td").length)return e}:"rowsplit"===n?function(){var e=s.plugin.getSingleSelectedCell();if(e&&e.get(0).rowSpan>1)return e}:"colsplit"===n?function(){var e=s.plugin.getSingleSelectedCell();if(e&&e.get(0).colSpan>1)return e}:e.inArray(n,["colinsertleft","colinsertright","rowinsertabove","rowinsertbelow"])>-1?s.plugin.getSingleSelectedCell:s.plugin.getSelectedCell,s.addContextmenu({title:p[n]||s.lang("table"+n),click:function(){s.loadPlugin("table",function(){s.plugin.table[n](),s.hideMenu()})},cond:i,width:170,iconClass:m[n]||"ke-icon-table"+n})})}s.clickToolbar(d,function(){if(!s.menu){var e=s.createMenu({name:d,beforeRemove:function(){a()}}),t=$('
          '),n=$('
          '+p.xRxC.format(0,0)+"
          ");t.append(n);var i=$('
          ');i.on("mouseenter.kTable",".ke-plugin-table-grid-cell",function(){var e=$(this),t=e.data("row"),a=e.data("col");n.text(p.xRxC.format(t,a));var o=i.find(".ke-plugin-table-grid-cell");o.each(function(){var e=$(this),n=e.data("row"),i=e.data("col");n<=t&&i<=a?e.css({border:"1px solid #2286d2",background:"#eff7ff"}):e.css({border:"1px solid #ddd",background:"#f1f1f1"})})}).on("click.kTable",".ke-plugin-table-grid-cell",function(e){var t=$(this),n=t.data("row"),i=t.data("col");r(n,i),s.hideMenu().focus(),s.addBookmark(),e.stopPropagation()});for(var o=1;o<11;o++)for(var l=1;l<11;l++)i.append('
          ');u.push(i),t.append(i),e.div.append(t[0])}}),s.afterTab(function(e){var t=s.plugin.getSelectedCell();if(t&&t.length){var n=function(e){if(e.length){var t=e.next();if(t.is("td,th")||(t=e.parent().next("tr").children("th,td").first()),t.is("td,th")||(t=e.closest("tbody,tfoot,thead").next().children("tr").first().children("th,td").first()),t.length)return s.cmd.range.selectNodeContents(t[0]).collapse(!0),s.cmd.select(),!0}return!1},i=$(t.get(0));if(i.length)return n(i)||(s.plugin.table.rowinsertbelow(),n(i)),!0}return e});var g=function(e,t,n){var i=n?Math.min(t.top,n.top):t.top,a=n?Math.min(t.left,n.left):t.left,o=n?Math.max(t.bottom,n.bottom):t.bottom,r=n?Math.max(t.right,n.right):t.right;if(i===o&&a===r)return!1;for(var l=!1,d=!1,c=e.children("thead,tbody,tfoot").children("tr").each(function(){$(this).children("td,th").each(function(){var e=$(this),t=e.cellPos();t.right>=a&&t.left<=r&&t.bottom>=i&&t.top<=o&&(i=Math.min(i,t.top),a=Math.min(a,t.left),o=Math.max(o,t.bottom),r=Math.max(r,t.right),e.addClass("ke-select-cell"),l=!0,d=!0)})});d;)d=!1,c.each(function(){$(this).children("td,th").each(function(){var e=$(this);if(!e.hasClass("ke-select-cell")){var t=e.cellPos();t.right>=a&&t.left<=r&&t.bottom>=i&&t.top<=o&&(i=Math.min(i,t.top),a=Math.min(a,t.left),o=Math.max(o,t.bottom),r=Math.max(r,t.right),e.addClass("ke-select-cell"),d=!0)}})});var u=e.find(".ke-select-cell");return 1===u.length&&(u.removeClass("ke-select-cell"),l=!1),l?s.tableSelectionRange={top:i,left:a,bottom:o,right:r}:s.tableSelectionRange=null,l},v=function(e,t){return g(e,{left:0,right:e.data("tableSize").width-1,top:t,bottom:t})},_=function(e,t){return g(e,{left:t,right:t,top:0,bottom:e.data("tableSize").height-1})};s.afterCreate(function(){var e=!1,t=null,n=null,i=null,a=null,o=function(){e=!1,t=null,a=null};$(s.edit.doc.body).on("mousedown.ke"+s.uuid,function(n){var a=$(n.target).closest("td,th"),o=a.closest("table"),r=!1;a.length&&o.length&&(t=o,e=!0,i=a.cellPos(!0),r=3===n.which,o.removeClass("ke-select-cells")),r||($(s.edit.doc).find(".ke-select-cell").removeClass("ke-select-cell"),s.tableSelectionRange=null)}).on("mousemove.ke"+s.uuid,function(o){var r=$(o.target).closest("td,th");if(!r.length)return e?o.preventDefault():null;var l=r.closest("table");if(!l.length)return e?o.preventDefault():null;if(l.removeClass("ke-select-row ke-select-col ke-select-cells"),a=r.cellPos(),e){if(l[0]!==t[0])return o.preventDefault();$(s.edit.doc).find("table").find(".ke-select-cell").removeClass("ke-select-cell"),g(l,i,a)&&(l.addClass("ke-select-cells"),o.preventDefault())}else{n=l;var d=l.offset(),c=o.pageX,u=o.pageY,p=c-d.left,h=u-d.top;p<8?(l.addClass("ke-select-row"),a.selectRow=a.top,delete a.selectCol,o.preventDefault(),o.stopPropagation()):h<8&&(l.addClass("ke-select-col"),a.selectCol=a.left,delete a.selectRow,o.preventDefault(),o.stopPropagation())}}).on("mouseup.ke"+s.uuid,function(e){var t=$(e.target),i=t.closest("td,th");i.length&&(a&&void 0!==a.selectRow?(v(n,a.selectRow),e.stopPropagation()):a&&void 0!==a.selectCol&&(_(n,a.selectCol),e.stopPropagation())),o()}).on("paste.ke"+s.uuid+" keydown.ke"+s.uuid,function(){$(s.edit.doc).find("table").removeClass("ke-select-row ke-select-col").find(".ke-select-cell").removeClass("ke-select-cell")}),$(document).on("mouseup.ke"+s.uuid,function(){o()}),$(s.edit.doc.head).append([""].join(""));var r=s.cmd.toggle,l=function(e,t,n){var i=this;return void 0!==n&&null!==n||(n=i.commonNode(t)),n?i.remove(t):i.wrap(e),i.select()},d=function(e,t,n){var i=s.cmd.range;if(i&&i.endContainer){var a=$(i.endContainer).closest("th,td");if(!a.length)return;var o=a.closest("table");if(!o.length)return;var r=o.children("thead,tbody,tfoot").children("tr").children(".ke-select-cell");if(r.length)return t&&t(a,o),r.each(e),n&&n(a,o),i.selectNodeContents(a[0]),s.cmd.select(),s.focus(),!0}};s.cmd.toggle=function(e,t){var n;if(!d(function(){s.cmd.range.selectNodeContents(this),s.cmd.select(),l.call(s.cmd,e,t,n)},function(e){s.cmd.range.selectNodeContents(e[0]),s.cmd.select(),n=!!s.cmd.commonNode(t)}))return r.call(s.cmd,e,t)};var c=",justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,",u=s.clickToolbar;s.clickToolbar=function(e,t){if(!(void 0===t&&c.indexOf(","+e+",")>-1&&d(function(){s.cmd.range.selectNode(this),s.cmd.select(),u.call(s,e,t)})))return u.call(s,e,t)}}),s.beforeRemove(function(){$(s.edit.doc.body).off(".ke"+s.uuid),$(document).off(".ke"+s.uuid)})}),KindEditor.lang({table:KindEditor.lang("table")}); \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/kindeditor/lang/.pydio b/src/resources/static/js/lib/zui/lib/kindeditor/lang/.pydio new file mode 100644 index 0000000..7e970ca --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/kindeditor/lang/.pydio @@ -0,0 +1 @@ +3cb39051-1e5b-4990-928a-e79cae3315cc \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/kindeditor/lang/en.js b/src/resources/static/js/lib/zui/lib/kindeditor/lang/en.js new file mode 100644 index 0000000..39ce909 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/kindeditor/lang/en.js @@ -0,0 +1,232 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.lang({ + source : 'Source', + preview : 'Preview', + undo : 'Undo(Ctrl+Z)', + redo : 'Redo(Ctrl+Y)', + cut : 'Cut(Ctrl+X)', + copy : 'Copy(Ctrl+C)', + paste : 'Paste(Ctrl+V)', + plainpaste : 'Paste as plain text', + wordpaste : 'Paste from Word', + selectall : 'Select all', + justifyleft : 'Align left', + justifycenter : 'Align center', + justifyright : 'Align right', + justifyfull : 'Align full', + insertorderedlist : 'Ordered list', + insertunorderedlist : 'Unordered list', + indent : 'Increase indent', + outdent : 'Decrease indent', + subscript : 'Subscript', + superscript : 'Superscript', + formatblock : 'Paragraph format', + fontname : 'Font family', + fontsize : 'Font size', + forecolor : 'Text color', + hilitecolor : 'Highlight color', + bold : 'Bold(Ctrl+B)', + italic : 'Italic(Ctrl+I)', + underline : 'Underline(Ctrl+U)', + strikethrough : 'Strikethrough', + removeformat : 'Remove format', + image : 'Image', + multiimage : 'Multi image', + flash : 'Flash', + media : 'Embeded media', + table : 'Table', + tablecell : 'Cell', + hr : 'Insert horizontal line', + emoticons : 'Insert emoticon', + link : 'Link', + unlink : 'Unlink', + fullscreen : 'Toggle fullscreen mode', + about : 'About', + print : 'Print', + filemanager : 'File Manager', + code : 'Insert code', + map : 'Google Maps', + baidumap : 'Baidu Maps', + lineheight : 'Line height', + clearhtml : 'Clear HTML code', + pagebreak : 'Insert Page Break', + quickformat : 'Quick Format', + insertfile : 'Insert file', + template : 'Insert Template', + anchor : 'Anchor', + yes : 'OK', + no : 'Cancel', + close : 'Close', + editImage : 'Image properties', + deleteImage : 'Delete image', + editFlash : 'Flash properties', + deleteFlash : 'Delete flash', + editMedia : 'Media properties', + deleteMedia : 'Delete media', + editLink : 'Link properties', + deleteLink : 'Unlink', + tableprop : 'Table properties', + tablecellprop : 'Cell properties', + tableinsert : 'Insert table', + tabledelete : 'Delete table', + tablecolinsertleft : 'Insert column left', + tablecolinsertright : 'Insert column right', + tablerowinsertabove : 'Insert row above', + tablerowinsertbelow : 'Insert row below', + tablerowmerge : 'Merge down', + tablecolmerge : 'Merge right', + tablerowsplit : 'Split row', + tablecolsplit : 'Split column', + tablecoldelete : 'Delete column', + tablerowdelete : 'Delete row', + noColor : 'Default', + pleaseSelectFile : 'Please select file.', + invalidImg : "Please type valid URL.\nAllowed file extension: jpg,gif,bmp,png", + invalidMedia : "Please type valid URL.\nAllowed file extension: swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb", + invalidWidth : "The width must be number.", + invalidHeight : "The height must be number.", + invalidBorder : "The border must be number.", + invalidUrl : "Please type valid URL.", + invalidRows : 'Invalid rows.', + invalidCols : 'Invalid columns.', + invalidPadding : 'The padding must be number.', + invalidSpacing : 'The spacing must be number.', + invalidJson : 'Invalid JSON string.', + uploadSuccess : 'Upload success.', + cutError : 'Currently not supported by your browser, use keyboard shortcut(Ctrl+X) instead.', + copyError : 'Currently not supported by your browser, use keyboard shortcut(Ctrl+C) instead.', + pasteError : 'Currently not supported by your browser, use keyboard shortcut(Ctrl+V) instead.', + ajaxLoading : 'Loading ...', + uploadLoading : 'Uploading ...', + uploadError : 'Upload Error', + 'plainpaste.comment' : 'Use keyboard shortcut(Ctrl+V) to paste the text into the window.', + 'wordpaste.comment' : 'Use keyboard shortcut(Ctrl+V) to paste the text into the window.', + 'code.pleaseInput' : 'Please input code.', + 'link.url' : 'URL', + 'link.linkType' : 'Target', + 'link.newWindow' : 'New window', + 'link.selfWindow' : 'Same window', + 'flash.url' : 'URL', + 'flash.width' : 'Width', + 'flash.height' : 'Height', + 'flash.upload' : 'Upload', + 'flash.viewServer' : 'Browse', + 'media.url' : 'URL', + 'media.width' : 'Width', + 'media.height' : 'Height', + 'media.autostart' : 'Auto start', + 'media.upload' : 'Upload', + 'media.viewServer' : 'Browse', + 'image.remoteImage' : 'Insert URL', + 'image.localImage' : 'Upload', + 'image.remoteUrl' : 'URL', + 'image.localUrl' : 'File', + 'image.size' : 'Size', + 'image.width' : 'Width', + 'image.height' : 'Height', + 'image.resetSize' : 'Reset dimensions', + 'image.align' : 'Align', + 'image.defaultAlign' : 'Default', + 'image.leftAlign' : 'Left', + 'image.rightAlign' : 'Right', + 'image.imgTitle' : 'Title', + 'image.upload' : 'Browse', + 'image.viewServer' : 'Browse', + 'multiimage.uploadDesc' : 'Allows users to upload <%=uploadLimit%> images, single image size not exceeding <%=sizeLimit%>', + 'multiimage.startUpload' : 'Start upload', + 'multiimage.clearAll' : 'Clear all', + 'multiimage.insertAll' : 'Insert all', + 'multiimage.queueLimitExceeded' : 'Queue limit exceeded.', + 'multiimage.fileExceedsSizeLimit' : 'File exceeds size limit.', + 'multiimage.zeroByteFile' : 'Zero byte file.', + 'multiimage.invalidFiletype' : 'Invalid file type.', + 'multiimage.unknownError' : 'Unknown upload error.', + 'multiimage.pending' : 'Pending ...', + 'multiimage.uploadError' : 'Upload error', + 'filemanager.emptyFolder' : 'Blank', + 'filemanager.moveup' : 'Parent folder', + 'filemanager.viewType' : 'Display: ', + 'filemanager.viewImage' : 'Thumbnails', + 'filemanager.listImage' : 'List', + 'filemanager.orderType' : 'Sorting: ', + 'filemanager.fileName' : 'By name', + 'filemanager.fileSize' : 'By size', + 'filemanager.fileType' : 'By type', + 'insertfile.url' : 'URL', + 'insertfile.title' : 'Title', + 'insertfile.upload' : 'Upload', + 'insertfile.viewServer' : 'Browse', + 'table.cells' : 'Cells', + 'table.rows' : 'Rows', + 'table.cols' : 'Columns', + 'table.size' : 'Dimensions', + 'table.width' : 'Width', + 'table.height' : 'Height', + 'table.percent' : '%', + 'table.px' : 'px', + 'table.space' : 'Space', + 'table.padding' : 'Padding', + 'table.spacing' : 'Spacing', + 'table.align' : 'Align', + 'table.textAlign' : 'Horizontal', + 'table.verticalAlign' : 'Vertical', + 'table.alignDefault' : 'Default', + 'table.alignLeft' : 'Left', + 'table.alignCenter' : 'Center', + 'table.alignRight' : 'Right', + 'table.alignTop' : 'Top', + 'table.alignMiddle' : 'Middle', + 'table.alignBottom' : 'Bottom', + 'table.alignBaseline' : 'Baseline', + 'table.border' : 'Border', + 'table.borderWidth' : 'Width', + 'table.borderColor' : 'Color', + 'table.backgroundColor' : 'Background', + 'map.address' : 'Address: ', + 'map.search' : 'Search', + 'baidumap.address' : 'Address: ', + 'baidumap.search' : 'Search', + 'baidumap.insertDynamicMap' : 'Dynamic Map', + 'anchor.name' : 'Anchor name', + 'formatblock.formatBlock' : { + h1 : 'Heading 1', + h2 : 'Heading 2', + h3 : 'Heading 3', + h4 : 'Heading 4', + p : 'Normal' + }, + 'fontname.fontName' : { + 'Arial' : 'Arial', + 'Arial Black' : 'Arial Black', + 'Comic Sans MS' : 'Comic Sans MS', + 'Courier New' : 'Courier New', + 'Garamond' : 'Garamond', + 'Georgia' : 'Georgia', + 'Tahoma' : 'Tahoma', + 'Times New Roman' : 'Times New Roman', + 'Trebuchet MS' : 'Trebuchet MS', + 'Verdana' : 'Verdana' + }, + 'lineheight.lineHeight' : [ + {'1' : 'Line height 1'}, + {'1.5' : 'Line height 1.5'}, + {'2' : 'Line height 2'}, + {'2.5' : 'Line height 2.5'}, + {'3' : 'Line height 3'} + ], + 'template.selectTemplate' : 'Template', + 'template.replaceContent' : 'Replace current content', + 'template.fileList' : { + '1.html' : 'Image and Text', + '2.html' : 'Table', + '3.html' : 'List' + } +}, 'en'); diff --git a/src/resources/static/js/lib/zui/lib/kindeditor/lang/zh_CN.js b/src/resources/static/js/lib/zui/lib/kindeditor/lang/zh_CN.js new file mode 100644 index 0000000..c159965 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/kindeditor/lang/zh_CN.js @@ -0,0 +1,238 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.lang({ + source : 'HTML代码', + preview : '预览', + undo : '后退(Ctrl+Z)', + redo : '前进(Ctrl+Y)', + cut : '剪切(Ctrl+X)', + copy : '复制(Ctrl+C)', + paste : '粘贴(Ctrl+V)', + plainpaste : '粘贴为无格式文本', + wordpaste : '从Word粘贴', + selectall : '全选(Ctrl+A)', + justifyleft : '左对齐', + justifycenter : '居中', + justifyright : '右对齐', + justifyfull : '两端对齐', + insertorderedlist : '编号', + insertunorderedlist : '项目符号', + indent : '增加缩进', + outdent : '减少缩进', + subscript : '下标', + superscript : '上标', + formatblock : '段落', + fontname : '字体', + fontsize : '文字大小', + forecolor : '文字颜色', + hilitecolor : '文字背景', + bold : '粗体(Ctrl+B)', + italic : '斜体(Ctrl+I)', + underline : '下划线(Ctrl+U)', + strikethrough : '删除线', + removeformat : '删除格式', + image : '图片', + multiimage : '批量图片上传', + flash : 'Flash', + media : '视音频', + table : '表格', + tablecell : '单元格', + hr : '插入横线', + emoticons : '插入表情', + link : '超级链接', + unlink : '取消超级链接', + fullscreen : '全屏显示', + about : '关于', + print : '打印(Ctrl+P)', + filemanager : '文件空间', + code : '插入程序代码', + map : 'Google地图', + baidumap : '百度地图', + lineheight : '行距', + clearhtml : '清理HTML代码', + pagebreak : '插入分页符', + quickformat : '一键排版', + insertfile : '插入文件', + template : '插入模板', + anchor : '锚点', + yes : '确定', + no : '取消', + close : '关闭', + editImage : '图片属性', + deleteImage : '删除图片', + editFlash : 'Flash属性', + deleteFlash : '删除Flash', + editMedia : '视音频属性', + deleteMedia : '删除视音频', + editLink : '超级链接属性', + deleteLink : '取消超级链接', + editAnchor : '锚点属性', + deleteAnchor : '删除锚点', + tableprop : '表格属性', + tablecellprop : '单元格属性', + tableinsert : '插入表格', + tabledelete : '删除表格', + tablecolinsertleft : '左侧插入列', + tablecolinsertright : '右侧插入列', + tablerowinsertabove : '上方插入行', + tablerowinsertbelow : '下方插入行', + tablerowmerge : '向下合并单元格', + tablecolmerge : '向右合并单元格', + tablerowsplit : '拆分行', + tablecolsplit : '拆分列', + tablecoldelete : '删除列', + tablerowdelete : '删除行', + noColor : '无颜色', + pleaseSelectFile : '请选择文件。', + invalidImg : "请输入有效的URL地址。\n只允许jpg,gif,bmp,png格式。", + invalidMedia : "请输入有效的URL地址。\n只允许swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb格式。", + invalidWidth : "宽度必须为数字。", + invalidHeight : "高度必须为数字。", + invalidBorder : "边框必须为数字。", + invalidUrl : "请输入有效的URL地址。", + invalidRows : '行数为必选项,只允许输入大于0的数字。', + invalidCols : '列数为必选项,只允许输入大于0的数字。', + invalidPadding : '边距必须为数字。', + invalidSpacing : '间距必须为数字。', + invalidJson : '服务器发生故障。', + uploadSuccess : '上传成功。', + cutError : '您的浏览器安全设置不允许使用剪切操作,请使用快捷键(Ctrl+X)来完成。', + copyError : '您的浏览器安全设置不允许使用复制操作,请使用快捷键(Ctrl+C)来完成。', + pasteError : '您的浏览器安全设置不允许使用粘贴操作,请使用快捷键(Ctrl+V)来完成。', + ajaxLoading : '加载中,请稍候 ...', + uploadLoading : '上传中,请稍候 ...', + uploadError : '上传错误', + 'plainpaste.comment' : '请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。', + 'wordpaste.comment' : '请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。', + 'code.pleaseInput' : '请输入程序代码。', + 'link.url' : 'URL', + 'link.linkType' : '打开类型', + 'link.newWindow' : '新窗口', + 'link.selfWindow' : '当前窗口', + 'flash.url' : 'URL', + 'flash.width' : '宽度', + 'flash.height' : '高度', + 'flash.upload' : '上传', + 'flash.viewServer' : '文件空间', + 'media.url' : 'URL', + 'media.width' : '宽度', + 'media.height' : '高度', + 'media.autostart' : '自动播放', + 'media.upload' : '上传', + 'media.viewServer' : '文件空间', + 'image.remoteImage' : '网络图片', + 'image.localImage' : '本地上传', + 'image.remoteUrl' : '图片地址', + 'image.localUrl' : '上传文件', + 'image.size' : '图片大小', + 'image.width' : '宽', + 'image.height' : '高', + 'image.resetSize' : '重置大小', + 'image.align' : '对齐方式', + 'image.defaultAlign' : '默认方式', + 'image.leftAlign' : '左对齐', + 'image.rightAlign' : '右对齐', + 'image.imgTitle' : '图片说明', + 'image.upload' : '浏览...', + 'image.viewServer' : '图片空间', + 'multiimage.uploadDesc' : '允许用户同时上传<%=uploadLimit%>张图片,单张图片容量不超过<%=sizeLimit%>', + 'multiimage.startUpload' : '开始上传', + 'multiimage.clearAll' : '全部清空', + 'multiimage.insertAll' : '全部插入', + 'multiimage.queueLimitExceeded' : '文件数量超过限制。', + 'multiimage.fileExceedsSizeLimit' : '文件大小超过限制。', + 'multiimage.zeroByteFile' : '无法上传空文件。', + 'multiimage.invalidFiletype' : '文件类型不正确。', + 'multiimage.unknownError' : '发生异常,无法上传。', + 'multiimage.pending' : '等待上传', + 'multiimage.uploadError' : '上传失败', + 'filemanager.emptyFolder' : '空文件夹', + 'filemanager.moveup' : '移到上一级文件夹', + 'filemanager.viewType' : '显示方式:', + 'filemanager.viewImage' : '缩略图', + 'filemanager.listImage' : '详细信息', + 'filemanager.orderType' : '排序方式:', + 'filemanager.fileName' : '名称', + 'filemanager.fileSize' : '大小', + 'filemanager.fileType' : '类型', + 'insertfile.url' : 'URL', + 'insertfile.title' : '文件说明', + 'insertfile.upload' : '上传', + 'insertfile.viewServer' : '文件空间', + 'table.cells' : '单元格数', + 'table.rows' : '行数', + 'table.cols' : '列数', + 'table.size' : '大小', + 'table.width' : '宽度', + 'table.height' : '高度', + 'table.percent' : '%', + 'table.px' : 'px', + 'table.space' : '边距间距', + 'table.padding' : '边距', + 'table.spacing' : '间距', + 'table.align' : '对齐方式', + 'table.textAlign' : '水平对齐', + 'table.verticalAlign' : '垂直对齐', + 'table.alignDefault' : '默认', + 'table.alignLeft' : '左对齐', + 'table.alignCenter' : '居中', + 'table.alignRight' : '右对齐', + 'table.alignTop' : '顶部', + 'table.alignMiddle' : '中部', + 'table.alignBottom' : '底部', + 'table.alignBaseline' : '基线', + 'table.border' : '边框', + 'table.borderWidth' : '边框', + 'table.borderColor' : '颜色', + 'table.backgroundColor' : '背景颜色', + 'map.address' : '地址: ', + 'map.search' : '搜索', + 'baidumap.address' : '地址: ', + 'baidumap.search' : '搜索', + 'baidumap.insertDynamicMap' : '插入动态地图', + 'anchor.name' : '锚点名称', + 'formatblock.formatBlock' : { + h1 : '标题 1', + h2 : '标题 2', + h3 : '标题 3', + h4 : '标题 4', + p : '正 文' + }, + 'fontname.fontName' : { + 'SimSun' : '宋体', + 'NSimSun' : '新宋体', + 'FangSong_GB2312' : '仿宋_GB2312', + 'KaiTi_GB2312' : '楷体_GB2312', + 'SimHei' : '黑体', + 'Source Han Sans': '思源黑体', + 'Source Han Serif': '思源宋体', + 'Microsoft YaHei' : '微软雅黑', + 'Arial' : 'Arial', + 'Arial Black' : 'Arial Black', + 'Times New Roman' : 'Times New Roman', + 'Courier New' : 'Courier New', + 'Tahoma' : 'Tahoma', + 'Verdana' : 'Verdana' + }, + 'lineheight.lineHeight' : [ + {'1' : '单倍行距'}, + {'1.5' : '1.5倍行距'}, + {'2' : '2倍行距'}, + {'2.5' : '2.5倍行距'}, + {'3' : '3倍行距'} + ], + 'template.selectTemplate' : '可选模板', + 'template.replaceContent' : '替换当前内容', + 'template.fileList' : { + '1.html' : '图片和文字', + '2.html' : '表格', + '3.html' : '项目编号' + } +}, 'zh_CN'); diff --git a/src/resources/static/js/lib/zui/lib/kindeditor/lang/zh_TW.js b/src/resources/static/js/lib/zui/lib/kindeditor/lang/zh_TW.js new file mode 100644 index 0000000..ceac2af --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/kindeditor/lang/zh_TW.js @@ -0,0 +1,235 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.lang({ + source : '原始碼', + preview : '預覽', + undo : '復原(Ctrl+Z)', + redo : '重複(Ctrl+Y)', + cut : '剪下(Ctrl+X)', + copy : '複製(Ctrl+C)', + paste : '貼上(Ctrl+V)', + plainpaste : '貼為純文字格式', + wordpaste : '自Word貼上', + selectall : '全選(Ctrl+A)', + justifyleft : '靠左對齊', + justifycenter : '置中', + justifyright : '靠右對齊', + justifyfull : '左右對齊', + insertorderedlist : '編號清單', + insertunorderedlist : '項目清單', + indent : '增加縮排', + outdent : '減少縮排', + subscript : '下標', + superscript : '上標', + formatblock : '標題', + fontname : '字體', + fontsize : '文字大小', + forecolor : '文字顏色', + hilitecolor : '背景顏色', + bold : '粗體(Ctrl+B)', + italic : '斜體(Ctrl+I)', + underline : '底線(Ctrl+U)', + strikethrough : '刪除線', + removeformat : '清除格式', + image : '影像', + multiimage : '批量影像上傳', + flash : 'Flash', + media : '多媒體', + table : '表格', + hr : '插入水平線', + emoticons : '插入表情', + link : '超連結', + unlink : '移除超連結', + fullscreen : '最大化', + about : '關於', + print : '列印(Ctrl+P)', + fileManager : '瀏覽伺服器', + code : '插入程式代碼', + map : 'Google地圖', + baidumap : 'Baidu地圖', + lineheight : '行距', + clearhtml : '清理HTML代碼', + pagebreak : '插入分頁符號', + quickformat : '快速排版', + insertfile : '插入文件', + template : '插入樣板', + anchor : '錨點', + yes : '確定', + no : '取消', + close : '關閉', + editImage : '影像屬性', + deleteImage : '刪除影像', + editFlash : 'Flash屬性', + deleteFlash : '删除Flash', + editMedia : '多媒體屬性', + deleteMedia : '删除多媒體', + editLink : '超連結屬性', + deleteLink : '移除超連結', + tableprop : '表格屬性', + tablecellprop : '儲存格屬性', + tableinsert : '插入表格', + tabledelete : '刪除表格', + tablecolinsertleft : '向左插入列', + tablecolinsertright : '向右插入列', + tablerowinsertabove : '向上插入欄', + tablerowinsertbelow : '下方插入欄', + tablerowmerge : '向下合併單元格', + tablecolmerge : '向右合併單元格', + tablerowsplit : '分割欄', + tablecolsplit : '分割列', + tablecoldelete : '删除列', + tablerowdelete : '删除欄', + noColor : '自動', + pleaseSelectFile : '請選擇文件。', + invalidImg : "請輸入有效的URL。\n只允許jpg,gif,bmp,png格式。", + invalidMedia : "請輸入有效的URL。\n只允許swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb格式。", + invalidWidth : "寬度必須是數字。", + invalidHeight : "高度必須是數字。", + invalidBorder : "邊框必須是數字。", + invalidUrl : "請輸入有效的URL。", + invalidRows : '欄數是必須輸入項目,只允許輸入大於0的數字。', + invalidCols : '列數是必須輸入項目,只允許輸入大於0的數字。', + invalidPadding : '內距必須是數字。', + invalidSpacing : '間距必須是數字。', + invalidBorder : '边框必须为数字。', + pleaseInput : "請輸入內容。", + invalidJson : '伺服器發生故障。', + uploadSuccess : '上傳成功。', + cutError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+X)完成。', + copyError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+C)完成。', + pasteError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+V)完成。', + ajaxLoading : '加載中,請稍候 ...', + uploadLoading : '上傳中,請稍候 ...', + uploadError : '上傳錯誤', + 'plainpaste.comment' : '請使用快捷鍵(Ctrl+V)把內容貼到下方區域裡。', + 'wordpaste.comment' : '請使用快捷鍵(Ctrl+V)把內容貼到下方區域裡。', + 'code.pleaseInput' : 'Please input code.', + 'link.url' : 'URL', + 'link.linkType' : '打開類型', + 'link.newWindow' : '新窗口', + 'link.selfWindow' : '本頁窗口', + 'flash.url' : 'URL', + 'flash.width' : '寬度', + 'flash.height' : '高度', + 'flash.upload' : '上傳', + 'flash.viewServer' : '瀏覽', + 'media.url' : 'URL', + 'media.width' : '寬度', + 'media.height' : '高度', + 'media.autostart' : '自動播放', + 'media.upload' : '上傳', + 'media.viewServer' : '瀏覽', + 'image.remoteImage' : '網絡影像', + 'image.localImage' : '上傳影像', + 'image.remoteUrl' : '影像URL', + 'image.localUrl' : '影像URL', + 'image.size' : '影像大小', + 'image.width' : '寬度', + 'image.height' : '高度', + 'image.resetSize' : '原始大小', + 'image.align' : '對齊方式', + 'image.defaultAlign' : '未設定', + 'image.leftAlign' : '向左對齊', + 'image.rightAlign' : '向右對齊', + 'image.imgTitle' : '影像說明', + 'image.upload' : '瀏覽...', + 'image.viewServer' : '瀏覽...', + 'multiimage.uploadDesc' : 'Allows users to upload <%=uploadLimit%> images, single image size not exceeding <%=sizeLimit%>', + 'multiimage.startUpload' : 'Start upload', + 'multiimage.clearAll' : 'Clear all', + 'multiimage.insertAll' : 'Insert all', + 'multiimage.queueLimitExceeded' : 'Queue limit exceeded.', + 'multiimage.fileExceedsSizeLimit' : 'File exceeds size limit.', + 'multiimage.zeroByteFile' : 'Zero byte file.', + 'multiimage.invalidFiletype' : 'Invalid file type.', + 'multiimage.unknownError' : 'Unknown upload error.', + 'multiimage.pending' : 'Pending ...', + 'multiimage.uploadError' : 'Upload error', + 'filemanager.emptyFolder' : '空文件夾', + 'filemanager.moveup' : '至上一級文件夾', + 'filemanager.viewType' : '顯示方式:', + 'filemanager.viewImage' : '縮略圖', + 'filemanager.listImage' : '詳細信息', + 'filemanager.orderType' : '排序方式:', + 'filemanager.fileName' : '名稱', + 'filemanager.fileSize' : '大小', + 'filemanager.fileType' : '類型', + 'insertfile.url' : 'URL', + 'insertfile.title' : '文件說明', + 'insertfile.upload' : '上傳', + 'insertfile.viewServer' : '瀏覽', + 'table.cells' : '儲存格數', + 'table.rows' : '欄數', + 'table.cols' : '列數', + 'table.size' : '表格大小', + 'table.width' : '寬度', + 'table.height' : '高度', + 'table.percent' : '%', + 'table.px' : 'px', + 'table.space' : '內距間距', + 'table.padding' : '內距', + 'table.spacing' : '間距', + 'table.align' : '對齊方式', + 'table.textAlign' : '水平對齊', + 'table.verticalAlign' : '垂直對齊', + 'table.alignDefault' : '未設定', + 'table.alignLeft' : '向左對齊', + 'table.alignCenter' : '置中', + 'table.alignRight' : '向右對齊', + 'table.alignTop' : '靠上', + 'table.alignMiddle' : '置中', + 'table.alignBottom' : '靠下', + 'table.alignBaseline' : '基線', + 'table.border' : '表格邊框', + 'table.borderWidth' : '邊框', + 'table.borderColor' : '顏色', + 'table.backgroundColor' : '背景顏色', + 'map.address' : '住所: ', + 'map.search' : '尋找', + 'baidumap.address' : '住所: ', + 'baidumap.search' : '尋找', + 'baidumap.insertDynamicMap' : '插入動態地圖', + 'anchor.name' : '錨點名稱', + 'formatblock.formatBlock' : { + h1 : '標題 1', + h2 : '標題 2', + h3 : '標題 3', + h4 : '標題 4', + p : '一般' + }, + 'fontname.fontName' : { + 'MingLiU' : '細明體', + 'PMingLiU' : '新細明體', + 'DFKai-SB' : '標楷體', + 'SimSun' : '宋體', + 'NSimSun' : '新宋體', + 'FangSong' : '仿宋體', + 'Arial' : 'Arial', + 'Arial Black' : 'Arial Black', + 'Times New Roman' : 'Times New Roman', + 'Courier New' : 'Courier New', + 'Tahoma' : 'Tahoma', + 'Verdana' : 'Verdana' + }, + 'lineheight.lineHeight' : [ + {'1' : '单倍行距'}, + {'1.5' : '1.5倍行距'}, + {'2' : '2倍行距'}, + {'2.5' : '2.5倍行距'}, + {'3' : '3倍行距'} + ], + 'template.selectTemplate' : '可選樣板', + 'template.replaceContent' : '取代當前內容', + 'template.fileList' : { + '1.html' : '影像和文字', + '2.html' : '表格', + '3.html' : '项目清單' + } +}, 'zh_TW'); diff --git a/src/resources/static/js/lib/zui/lib/kindeditor/plugins.zip b/src/resources/static/js/lib/zui/lib/kindeditor/plugins.zip new file mode 100644 index 0000000..c7073f1 Binary files /dev/null and b/src/resources/static/js/lib/zui/lib/kindeditor/plugins.zip differ diff --git a/src/resources/static/js/lib/zui/lib/kindeditor/themes/.pydio b/src/resources/static/js/lib/zui/lib/kindeditor/themes/.pydio new file mode 100644 index 0000000..a1b0206 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/kindeditor/themes/.pydio @@ -0,0 +1 @@ +8f48f3f3-4e53-43cd-ba56-f93bd7f7b4f5 \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/kindeditor/themes/default/.pydio b/src/resources/static/js/lib/zui/lib/kindeditor/themes/default/.pydio new file mode 100644 index 0000000..9bc5ccb --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/kindeditor/themes/default/.pydio @@ -0,0 +1 @@ +949fb4b3-3375-4f5a-99ba-43dca46fb935 \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/kindeditor/themes/default/default.png b/src/resources/static/js/lib/zui/lib/kindeditor/themes/default/default.png new file mode 100644 index 0000000..3e40ec3 Binary files /dev/null and b/src/resources/static/js/lib/zui/lib/kindeditor/themes/default/default.png differ diff --git a/src/resources/static/js/lib/zui/lib/markdoc/.pydio b/src/resources/static/js/lib/zui/lib/markdoc/.pydio new file mode 100644 index 0000000..5c9d48f --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/markdoc/.pydio @@ -0,0 +1 @@ +2c1c7216-968e-4bd3-864a-bdfd93db2c98 \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.js b/src/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.js new file mode 100644 index 0000000..5620c8c --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.js @@ -0,0 +1,1427 @@ +/*! + * ZUI: Markdown 文档生成器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/** + * marked - a markdown parser + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + */ + +;(function() { + +/** + * Block-Level Grammar + */ + +var block = { + newline: /^\n+/, + code: /^( {4}[^\n]+\n*)+/, + fences: noop, + hr: /^( *[-*_]){3,} *(?:\n+|$)/, + heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, + nptable: noop, + lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, + blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, + list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, + def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, + table: noop, + paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, + text: /^[^\n]+/ +}; + +block.bullet = /(?:[*+-]|\d+\.)/; +block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; +block.item = replace(block.item, 'gm') + (/bull/g, block.bullet) + (); + +block.list = replace(block.list) + (/bull/g, block.bullet) + ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') + ('def', '\\n+(?=' + block.def.source + ')') + (); + +block.blockquote = replace(block.blockquote) + ('def', block.def) + (); + +block._tag = '(?!(?:' + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; + +block.html = replace(block.html) + ('comment', //) + ('closed', /<(tag)[\s\S]+?<\/\1>/) + ('closing', /])*?>/) + (/tag/g, block._tag) + (); + +block.paragraph = replace(block.paragraph) + ('hr', block.hr) + ('heading', block.heading) + ('lheading', block.lheading) + ('blockquote', block.blockquote) + ('tag', '<' + block._tag) + ('def', block.def) + (); + +/** + * Normal Block Grammar + */ + +block.normal = merge({}, block); + +/** + * GFM Block Grammar + */ + +block.gfm = merge({}, block.normal, { + fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/, + paragraph: /^/, + heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ +}); + +block.gfm.paragraph = replace(block.paragraph) + ('(?!', '(?!' + + block.gfm.fences.source.replace('\\1', '\\2') + '|' + + block.list.source.replace('\\1', '\\3') + '|') + (); + +/** + * GFM + Tables Block Grammar + */ + +block.tables = merge({}, block.gfm, { + nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, + table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ +}); + +/** + * Block Lexer + */ + +function Lexer(options) { + this.tokens = []; + this.tokens.links = {}; + this.options = options || marked.defaults; + this.rules = block.normal; + + if (this.options.gfm) { + if (this.options.tables) { + this.rules = block.tables; + } else { + this.rules = block.gfm; + } + } +} + +/** + * Expose Block Rules + */ + +Lexer.rules = block; + +/** + * Static Lex Method + */ + +Lexer.lex = function(src, options) { + var lexer = new Lexer(options); + return lexer.lex(src); +}; + +/** + * Preprocessing + */ + +Lexer.prototype.lex = function(src) { + src = src + .replace(/\r\n|\r/g, '\n') + .replace(/\t/g, ' ') + .replace(/\u00a0/g, ' ') + .replace(/\u2424/g, '\n'); + + return this.token(src, true); +}; + +/** + * Lexing + */ + +Lexer.prototype.token = function(src, top, bq) { + var src = src.replace(/^ +$/gm, '') + , next + , loose + , cap + , bull + , b + , item + , space + , i + , l; + + while (src) { + // newline + if (cap = this.rules.newline.exec(src)) { + src = src.substring(cap[0].length); + if (cap[0].length > 1) { + this.tokens.push({ + type: 'space' + }); + } + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + cap = cap[0].replace(/^ {4}/gm, ''); + this.tokens.push({ + type: 'code', + text: !this.options.pedantic + ? cap.replace(/\n+$/, '') + : cap + }); + continue; + } + + // fences (gfm) + if (cap = this.rules.fences.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'code', + lang: cap[2], + text: cap[3] || '' + }); + continue; + } + + // heading + if (cap = this.rules.heading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[1].length, + text: cap[2] + }); + continue; + } + + // table no leading pipe (gfm) + if (top && (cap = this.rules.nptable.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i].split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + + // lheading + if (cap = this.rules.lheading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[2] === '=' ? 1 : 2, + text: cap[1] + }); + continue; + } + + // hr + if (cap = this.rules.hr.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'hr' + }); + continue; + } + + // blockquote + if (cap = this.rules.blockquote.exec(src)) { + src = src.substring(cap[0].length); + + this.tokens.push({ + type: 'blockquote_start' + }); + + cap = cap[0].replace(/^ *> ?/gm, ''); + + // Pass `top` to keep the current + // "toplevel" state. This is exactly + // how markdown.pl works. + this.token(cap, top, true); + + this.tokens.push({ + type: 'blockquote_end' + }); + + continue; + } + + // list + if (cap = this.rules.list.exec(src)) { + src = src.substring(cap[0].length); + bull = cap[2]; + + this.tokens.push({ + type: 'list_start', + ordered: bull.length > 1 + }); + + // Get each top-level item. + cap = cap[0].match(this.rules.item); + + next = false; + l = cap.length; + i = 0; + + for (; i < l; i++) { + item = cap[i]; + + // Remove the list item's bullet + // so it is seen as the next token. + space = item.length; + item = item.replace(/^ *([*+-]|\d+\.) +/, ''); + + // Outdent whatever the + // list item contains. Hacky. + if (~item.indexOf('\n ')) { + space -= item.length; + item = !this.options.pedantic + ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') + : item.replace(/^ {1,4}/gm, ''); + } + + // Determine whether the next list item belongs here. + // Backpedal if it does not belong in this list. + if (this.options.smartLists && i !== l - 1) { + b = block.bullet.exec(cap[i + 1])[0]; + if (bull !== b && !(bull.length > 1 && b.length > 1)) { + src = cap.slice(i + 1).join('\n') + src; + i = l - 1; + } + } + + // Determine whether item is loose or not. + // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ + // for discount behavior. + loose = next || /\n\n(?!\s*$)/.test(item); + if (i !== l - 1) { + next = item.charAt(item.length - 1) === '\n'; + if (!loose) loose = next; + } + + this.tokens.push({ + type: loose + ? 'loose_item_start' + : 'list_item_start' + }); + + // Recurse. + this.token(item, false, bq); + + this.tokens.push({ + type: 'list_item_end' + }); + } + + this.tokens.push({ + type: 'list_end' + }); + + continue; + } + + // html + if (cap = this.rules.html.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: this.options.sanitize + ? 'paragraph' + : 'html', + pre: !this.options.sanitizer + && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), + text: cap[0] + }); + continue; + } + + // def + if ((!bq && top) && (cap = this.rules.def.exec(src))) { + src = src.substring(cap[0].length); + this.tokens.links[cap[1].toLowerCase()] = { + href: cap[2], + title: cap[3] + }; + continue; + } + + // table (gfm) + if (top && (cap = this.rules.table.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i] + .replace(/^ *\| *| *\| *$/g, '') + .split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + + // top-level paragraph + if (top && (cap = this.rules.paragraph.exec(src))) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'paragraph', + text: cap[1].charAt(cap[1].length - 1) === '\n' + ? cap[1].slice(0, -1) + : cap[1] + }); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + // Top-level should never reach here. + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'text', + text: cap[0] + }); + continue; + } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return this.tokens; +}; + +/** + * Inline-Level Grammar + */ + +var inline = { + escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, + autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, + url: noop, + tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, + link: /^!?\[(inside)\]\(href\)/, + reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, + nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, + strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, + em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, + code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, + br: /^ {2,}\n(?!\s*$)/, + del: noop, + text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; + +inline.link = replace(inline.link) + ('inside', inline._inside) + ('href', inline._href) + (); + +inline.reflink = replace(inline.reflink) + ('inside', inline._inside) + (); + +/** + * Normal Inline Grammar + */ + +inline.normal = merge({}, inline); + +/** + * Pedantic Inline Grammar + */ + +inline.pedantic = merge({}, inline.normal, { + strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, + em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ +}); + +/** + * GFM Inline Grammar + */ + +inline.gfm = merge({}, inline.normal, { + escape: replace(inline.escape)('])', '~|])')(), + url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, + del: /^~~(?=\S)([\s\S]*?\S)~~/, + text: replace(inline.text) + (']|', '~]|') + ('|', '|https?://|') + () +}); + +/** + * GFM + Line Breaks Inline Grammar + */ + +inline.breaks = merge({}, inline.gfm, { + br: replace(inline.br)('{2,}', '*')(), + text: replace(inline.gfm.text)('{2,}', '*')() +}); + +/** + * Inline Lexer & Compiler + */ + +function InlineLexer(links, options) { + this.options = options || marked.defaults; + this.links = links; + this.rules = inline.normal; + this.renderer = this.options.renderer || new Renderer; + this.renderer.options = this.options; + + if (!this.links) { + throw new + Error('Tokens array requires a `links` property.'); + } + + if (this.options.gfm) { + if (this.options.breaks) { + this.rules = inline.breaks; + } else { + this.rules = inline.gfm; + } + } else if (this.options.pedantic) { + this.rules = inline.pedantic; + } +} + +/** + * Expose Inline Rules + */ + +InlineLexer.rules = inline; + +/** + * Static Lexing/Compiling Method + */ + +InlineLexer.output = function(src, links, options) { + var inline = new InlineLexer(links, options); + return inline.output(src); +}; + +/** + * Lexing/Compiling + */ + +InlineLexer.prototype.output = function(src) { + var out = '' + , link + , text + , href + , cap; + + while (src) { + // escape + if (cap = this.rules.escape.exec(src)) { + src = src.substring(cap[0].length); + out += cap[1]; + continue; + } + + // autolink + if (cap = this.rules.autolink.exec(src)) { + src = src.substring(cap[0].length); + if (cap[2] === '@') { + text = cap[1].charAt(6) === ':' + ? this.mangle(cap[1].substring(7)) + : this.mangle(cap[1]); + href = this.mangle('mailto:') + text; + } else { + text = escape(cap[1]); + href = text; + } + out += this.renderer.link(href, null, text); + continue; + } + + // url (gfm) + if (!this.inLink && (cap = this.rules.url.exec(src))) { + src = src.substring(cap[0].length); + text = escape(cap[1]); + href = text; + out += this.renderer.link(href, null, text); + continue; + } + + // tag + if (cap = this.rules.tag.exec(src)) { + if (!this.inLink && /^/i.test(cap[0])) { + this.inLink = false; + } + src = src.substring(cap[0].length); + out += this.options.sanitize + ? this.options.sanitizer + ? this.options.sanitizer(cap[0]) + : escape(cap[0]) + : cap[0] + continue; + } + + // link + if (cap = this.rules.link.exec(src)) { + src = src.substring(cap[0].length); + this.inLink = true; + out += this.outputLink(cap, { + href: cap[2], + title: cap[3] + }); + this.inLink = false; + continue; + } + + // reflink, nolink + if ((cap = this.rules.reflink.exec(src)) + || (cap = this.rules.nolink.exec(src))) { + src = src.substring(cap[0].length); + link = (cap[2] || cap[1]).replace(/\s+/g, ' '); + link = this.links[link.toLowerCase()]; + if (!link || !link.href) { + out += cap[0].charAt(0); + src = cap[0].substring(1) + src; + continue; + } + this.inLink = true; + out += this.outputLink(cap, link); + this.inLink = false; + continue; + } + + // strong + if (cap = this.rules.strong.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.strong(this.output(cap[2] || cap[1])); + continue; + } + + // em + if (cap = this.rules.em.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.em(this.output(cap[2] || cap[1])); + continue; + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.codespan(escape(cap[2], true)); + continue; + } + + // br + if (cap = this.rules.br.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.br(); + continue; + } + + // del (gfm) + if (cap = this.rules.del.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.del(this.output(cap[1])); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.text(escape(this.smartypants(cap[0]))); + continue; + } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return out; +}; + +/** + * Compile Link + */ + +InlineLexer.prototype.outputLink = function(cap, link) { + var href = escape(link.href) + , title = link.title ? escape(link.title) : null; + + return cap[0].charAt(0) !== '!' + ? this.renderer.link(href, title, this.output(cap[1])) + : this.renderer.image(href, title, escape(cap[1])); +}; + +/** + * Smartypants Transformations + */ + +InlineLexer.prototype.smartypants = function(text) { + if (!this.options.smartypants) return text; + return text + // em-dashes + .replace(/---/g, '\u2014') + // en-dashes + .replace(/--/g, '\u2013') + // opening singles + .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + // closing singles & apostrophes + .replace(/'/g, '\u2019') + // opening doubles + .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + // closing doubles + .replace(/"/g, '\u201d') + // ellipses + .replace(/\.{3}/g, '\u2026'); +}; + +/** + * Mangle Links + */ + +InlineLexer.prototype.mangle = function(text) { + if (!this.options.mangle) return text; + var out = '' + , l = text.length + , i = 0 + , ch; + + for (; i < l; i++) { + ch = text.charCodeAt(i); + if (Math.random() > 0.5) { + ch = 'x' + ch.toString(16); + } + out += '&#' + ch + ';'; + } + + return out; +}; + +/** + * Renderer + */ + +function Renderer(options) { + this.options = options || {}; +} + +Renderer.prototype.code = function(code, lang, escaped) { + if (this.options.highlight) { + var out = this.options.highlight(code, lang); + if (out != null && out !== code) { + escaped = true; + code = out; + } + } + + if (!lang) { + return '
          '
          +      + (escaped ? code : escape(code, true))
          +      + '\n
          '; + } + + return '
          '
          +    + (escaped ? code : escape(code, true))
          +    + '\n
          \n'; +}; + +Renderer.prototype.blockquote = function(quote) { + return '
          \n' + quote + '
          \n'; +}; + +Renderer.prototype.html = function(html) { + return html; +}; + +Renderer.prototype.heading = function(text, level, raw) { + return '' + + text + + '\n'; +}; + +Renderer.prototype.hr = function() { + return this.options.xhtml ? '
          \n' : '
          \n'; +}; + +Renderer.prototype.list = function(body, ordered) { + var type = ordered ? 'ol' : 'ul'; + return '<' + type + '>\n' + body + '\n'; +}; + +Renderer.prototype.listitem = function(text) { + return '
        • ' + text + '
        • \n'; +}; + +Renderer.prototype.paragraph = function(text) { + return '

          ' + text + '

          \n'; +}; + +Renderer.prototype.table = function(header, body) { + return '
          \n' + + '\n' + + header + + '\n' + + '\n' + + body + + '\n' + + '
          \n'; +}; + +Renderer.prototype.tablerow = function(content) { + return '\n' + content + '\n'; +}; + +Renderer.prototype.tablecell = function(content, flags) { + var type = flags.header ? 'th' : 'td'; + var tag = flags.align + ? '<' + type + ' style="text-align:' + flags.align + '">' + : '<' + type + '>'; + return tag + content + '\n'; +}; + +// span level renderer +Renderer.prototype.strong = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.em = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.codespan = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.br = function() { + return this.options.xhtml ? '
          ' : '
          '; +}; + +Renderer.prototype.del = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.link = function(href, title, text) { + if (this.options.sanitize) { + try { + var prot = decodeURIComponent(unescape(href)) + .replace(/[^\w:]/g, '') + .toLowerCase(); + } catch (e) { + return ''; + } + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) { + return ''; + } + } + var out = '
          '; + return out; +}; + +Renderer.prototype.image = function(href, title, text) { + var out = '' + text + '' : '>'; + return out; +}; + +Renderer.prototype.text = function(text) { + return text; +}; + +/** + * Parsing & Compiling + */ + +function Parser(options) { + this.tokens = []; + this.token = null; + this.options = options || marked.defaults; + this.options.renderer = this.options.renderer || new Renderer; + this.renderer = this.options.renderer; + this.renderer.options = this.options; +} + +/** + * Static Parse Method + */ + +Parser.parse = function(src, options, renderer) { + var parser = new Parser(options, renderer); + return parser.parse(src); +}; + +/** + * Parse Loop + */ + +Parser.prototype.parse = function(src) { + this.inline = new InlineLexer(src.links, this.options, this.renderer); + this.tokens = src.reverse(); + + var out = ''; + while (this.next()) { + out += this.tok(); + } + + return out; +}; + +/** + * Next Token + */ + +Parser.prototype.next = function() { + return this.token = this.tokens.pop(); +}; + +/** + * Preview Next Token + */ + +Parser.prototype.peek = function() { + return this.tokens[this.tokens.length - 1] || 0; +}; + +/** + * Parse Text Tokens + */ + +Parser.prototype.parseText = function() { + var body = this.token.text; + + while (this.peek().type === 'text') { + body += '\n' + this.next().text; + } + + return this.inline.output(body); +}; + +/** + * Parse Current Token + */ + +Parser.prototype.tok = function() { + switch (this.token.type) { + case 'space': { + return ''; + } + case 'hr': { + return this.renderer.hr(); + } + case 'heading': { + return this.renderer.heading( + this.inline.output(this.token.text), + this.token.depth, + this.token.text); + } + case 'code': { + return this.renderer.code(this.token.text, + this.token.lang, + this.token.escaped); + } + case 'table': { + var header = '' + , body = '' + , i + , row + , cell + , flags + , j; + + // header + cell = ''; + for (i = 0; i < this.token.header.length; i++) { + flags = { header: true, align: this.token.align[i] }; + cell += this.renderer.tablecell( + this.inline.output(this.token.header[i]), + { header: true, align: this.token.align[i] } + ); + } + header += this.renderer.tablerow(cell); + + for (i = 0; i < this.token.cells.length; i++) { + row = this.token.cells[i]; + + cell = ''; + for (j = 0; j < row.length; j++) { + cell += this.renderer.tablecell( + this.inline.output(row[j]), + { header: false, align: this.token.align[j] } + ); + } + + body += this.renderer.tablerow(cell); + } + return this.renderer.table(header, body); + } + case 'blockquote_start': { + var body = ''; + + while (this.next().type !== 'blockquote_end') { + body += this.tok(); + } + + return this.renderer.blockquote(body); + } + case 'list_start': { + var body = '' + , ordered = this.token.ordered; + + while (this.next().type !== 'list_end') { + body += this.tok(); + } + + return this.renderer.list(body, ordered); + } + case 'list_item_start': { + var body = ''; + + while (this.next().type !== 'list_item_end') { + body += this.token.type === 'text' + ? this.parseText() + : this.tok(); + } + + return this.renderer.listitem(body); + } + case 'loose_item_start': { + var body = ''; + + while (this.next().type !== 'list_item_end') { + body += this.tok(); + } + + return this.renderer.listitem(body); + } + case 'html': { + var html = !this.token.pre && !this.options.pedantic + ? this.inline.output(this.token.text) + : this.token.text; + return this.renderer.html(html); + } + case 'paragraph': { + return this.renderer.paragraph(this.inline.output(this.token.text)); + } + case 'text': { + return this.renderer.paragraph(this.parseText()); + } + } +}; + +/** + * Helpers + */ + +function escape(html, encode) { + return html + .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} + +function unescape(html) { + // explicitly match decimal, hex, and named HTML entities + return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) { + n = n.toLowerCase(); + if (n === 'colon') return ':'; + if (n.charAt(0) === '#') { + return n.charAt(1) === 'x' + ? String.fromCharCode(parseInt(n.substring(2), 16)) + : String.fromCharCode(+n.substring(1)); + } + return ''; + }); +} + +function replace(regex, opt) { + regex = regex.source; + opt = opt || ''; + return function self(name, val) { + if (!name) return new RegExp(regex, opt); + val = val.source || val; + val = val.replace(/(^|[^\[])\^/g, '$1'); + regex = regex.replace(name, val); + return self; + }; +} + +function noop() {} +noop.exec = noop; + +function merge(obj) { + var i = 1 + , target + , key; + + for (; i < arguments.length; i++) { + target = arguments[i]; + for (key in target) { + if (Object.prototype.hasOwnProperty.call(target, key)) { + obj[key] = target[key]; + } + } + } + + return obj; +} + + +/** + * Marked + */ + +function marked(src, opt, callback) { + if (callback || typeof opt === 'function') { + if (!callback) { + callback = opt; + opt = null; + } + + opt = merge({}, marked.defaults, opt || {}); + + var highlight = opt.highlight + , tokens + , pending + , i = 0; + + try { + tokens = Lexer.lex(src, opt) + } catch (e) { + return callback(e); + } + + pending = tokens.length; + + var done = function(err) { + if (err) { + opt.highlight = highlight; + return callback(err); + } + + var out; + + try { + out = Parser.parse(tokens, opt); + } catch (e) { + err = e; + } + + opt.highlight = highlight; + + return err + ? callback(err) + : callback(null, out); + }; + + if (!highlight || highlight.length < 3) { + return done(); + } + + delete opt.highlight; + + if (!pending) return done(); + + for (; i < tokens.length; i++) { + (function(token) { + if (token.type !== 'code') { + return --pending || done(); + } + return highlight(token.text, token.lang, function(err, code) { + if (err) return done(err); + if (code == null || code === token.text) { + return --pending || done(); + } + token.text = code; + token.escaped = true; + --pending || done(); + }); + })(tokens[i]); + } + + return; + } + try { + if (opt) opt = merge({}, marked.defaults, opt); + return Parser.parse(Lexer.lex(src, opt), opt); + } catch (e) { + e.message += '\nPlease report this to https://github.com/chjj/marked.'; + if ((opt || marked.defaults).silent) { + return '

          An error occured:

          '
          +        + escape(e.message + '', true)
          +        + '
          '; + } + throw e; + } +} + +/** + * Options + */ + +marked.options = +marked.setOptions = function(opt) { + merge(marked.defaults, opt); + return marked; +}; + +marked.defaults = { + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: false, + sanitizer: null, + mangle: true, + smartLists: false, + silent: false, + highlight: null, + langPrefix: 'lang-', + smartypants: false, + headerPrefix: '', + renderer: new Renderer, + xhtml: false +}; + +/** + * Expose + */ + +marked.Parser = Parser; +marked.parser = Parser.parse; + +marked.Renderer = Renderer; + +marked.Lexer = Lexer; +marked.lexer = Lexer.lex; + +marked.InlineLexer = InlineLexer; +marked.inlineLexer = InlineLexer.output; + +marked.parse = marked; + +if (typeof module !== 'undefined' && typeof exports === 'object') { + module.exports = marked; +} else if (typeof define === 'function' && define.amd) { + define(function() { return marked; }); +} else { + this.marked = marked; +} + +}).call(function() { + return this || (typeof window !== 'undefined' ? window : global); +}()); + +/* ======================================================================== + * ZUI: markdoc.js + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2017-2018 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + +(function($) { + 'use strict'; + + $.zui.marked = window.marked; + + var NAME = 'zui.markdoc'; // model name + + // The markdoc model class + var MarkDoc = function(element, options) { + var that = this; + that.name = NAME; + that.$ = $(element); + + that.options = $.extend({}, MarkDoc.DEFAULTS, this.$.data(), options); + that.$.data('originContent', that.$.text()); + that.render(); + }; + + MarkDoc.prototype.render = function(extraOptions) { + var that = this; + if (extraOptions && typeof extraOptions !== 'object') { + extraOptions = {content: extraOptions}; + } + var options = $.extend({}, that.options, extraOptions); + var $ele = that.$; + if ($ele.hasClass('load-indicator')) { + $ele.addClass('loading'); + } + if (that.remoteRequest) { + that.remoteRequest.abort(); + } + that.getContent(function(content) { + $ele.empty(); + if (content) { + var htmlContent = options.markdown(content); + if (options.contentConverter) { + htmlContent = options.contentConverter(htmlContent); + } + $ele.append(htmlContent); + if(window.prettyPrint) { + $ele.find('pre').addClass('prettyprint'); + window.prettyPrint(); + } + } + $ele.removeClass('loading'); + }, options); + }; + + MarkDoc.prototype.getContent = function(callback, options) { + var that = this; + options = options || that.options;; + var content = options.content; + if (content) { + callback($.isFunction(content) ? content(that) : content); + } else if (options.remote) { + var ajaxOptions = $.isPlainObject(options.remote) ? options.remote : {url: options.remote}; + that.remoteRequest = $.ajax($.extend({}, ajaxOptions, { + success: function(data) { + callback(data); + }, + error: function(data) { + callback(null); + }, + complete: function() { + that.remoteRequest = null; + } + })); + } else if (options.source) { + var $source = $.isFunction(options.source) ? options.source(that) : $(options.source); + if ($source.is('textarea,input')) { + callback($source.val()); + } else { + callback($source.text()); + } + } else { + callback(this.$.data('originContent')); + } + }; + + // default options + MarkDoc.DEFAULTS = { + markdown: $.zui.marked + }; + + // Extense jquery element + $.fn.markdoc = function(option, param) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new MarkDoc(this, options))); + + if(typeof option == 'string') data[option](param); + }); + }; + + MarkDoc.NAME = NAME; + + $.fn.markdoc.Constructor = MarkDoc; + + // Auto call markdoc after document load complete + $(function() { + $('[data-render="markdoc"]').markdoc(); + }); + + $(document).on('click', '[data-toggle="markdoc"]', function(e) { + var $this = $(this); + var options = $this.data(); + var $target = $(options.target); + if (!$target.length) { + return; + } + if (!$target.data(NAME)) { + $target.markdoc(); + } + $target.markdoc('render', $.extend(options, { + remote: $this.attr('href') + })); + if($this.is('a')) { + e.preventDefault(); + } + }); +}(jQuery)); + diff --git a/src/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.min.js b/src/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.min.js new file mode 100644 index 0000000..20f5492 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/markdoc/zui.markdoc.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: Markdown 文档生成器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +(function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||h.defaults,this.rules=u.normal,this.options.gfm&&(this.options.tables?this.rules=u.tables:this.rules=u.gfm)}function t(e,t){if(this.options=t||h.defaults,this.links=e,this.rules=p.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=p.breaks:this.rules=p.gfm:this.options.pedantic&&(this.rules=p.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||h.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function o(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function l(){}function a(e){for(var t,n,r=1;rAn error occured:

          "+s(c.message+"",!0)+"
          ";throw c}}var u={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:l,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:l,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:l,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};u.bullet=/(?:[*+-]|\d+\.)/,u.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,u.item=o(u.item,"gm")(/bull/g,u.bullet)(),u.list=o(u.list)(/bull/g,u.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+u.def.source+")")(),u.blockquote=o(u.blockquote)("def",u.def)(),u._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",u.html=o(u.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,u._tag)(),u.paragraph=o(u.paragraph)("hr",u.hr)("heading",u.heading)("lheading",u.lheading)("blockquote",u.blockquote)("tag","<"+u._tag)("def",u.def)(),u.normal=a({},u),u.gfm=a({},u.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),u.gfm.paragraph=o(u.paragraph)("(?!","(?!"+u.gfm.fences.source.replace("\\1","\\2")+"|"+u.list.source.replace("\\1","\\3")+"|")(),u.tables=a({},u.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=u,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,o,l,a,h,p,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),o=i[2],this.tokens.push({type:"list_start",ordered:o.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,p=0;p1&&l.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:l,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:l,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,p.link=o(p.link)("inside",p._inside)("href",p._href)(),p.reflink=o(p.reflink)("inside",p._inside)(),p.normal=a({},p),p.pedantic=a({},p.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),p.gfm=a({},p.normal,{escape:o(p.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:o(p.text)("]|","~]|")("|","|https?://|")()}),p.breaks=a({},p.gfm,{br:o(p.br)("{2,}","*")(),text:o(p.gfm.text)("{2,}","*")()}),t.rules=p,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^
          /i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(s(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,o+=this.renderer.link(r,null,n);return o},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
          '+(n?e:s(e,!0))+"\n
          \n":"
          "+(n?e:s(e,!0))+"\n
          "},n.prototype.blockquote=function(e){return"
          \n"+e+"
          \n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
          \n":"
          \n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
        • "+e+"
        • \n"},n.prototype.paragraph=function(e){return"

          "+e+"

          \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
          \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
          ":"
          "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var o='
          "},n.prototype.image=function(e,t,n){var r=''+n+'":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",o="";for(n="",e=0;e)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}\b/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-dart.js b/src/resources/static/js/lib/zui/lib/prettify/lang-dart.js new file mode 100644 index 0000000..eefccc9 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-dart.js @@ -0,0 +1,3 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!.*/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/.*/],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], +["typ",/^\b(?:bool|double|dynamic|int|num|object|string|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?'''[\S\s]*?[^\\]'''/],["str",/^r?"""[\S\s]*?[^\\]"""/],["str",/^r?'('|[^\n\f\r]*?[^\\]')/],["str",/^r?"("|[^\n\f\r]*?[^\\]")/],["pln",/^[$_a-z]\w*/i],["pun",/^[!%&*+/:<-?^|~-]/],["lit",/^\b0x[\da-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit",/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(),.;[\]{}]/]]), +["dart"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-erlang.js b/src/resources/static/js/lib/zui/lib/prettify/lang-erlang.js new file mode 100644 index 0000000..27214a5 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-erlang.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["lit",/^[a-z]\w*/],["lit",/^'(?:[^\n\f\r'\\]|\\[^&])+'?/,null,"'"],["lit",/^\?[^\t\n ({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], +["kwd",/^-[_a-z]+/],["typ",/^[A-Z_]\w*/],["pun",/^[,.;]/]]),["erlang","erl"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-go.js b/src/resources/static/js/lib/zui/lib/prettify/lang-go.js new file mode 100644 index 0000000..1caca23 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-go.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-hs.js b/src/resources/static/js/lib/zui/lib/prettify/lang-hs.js new file mode 100644 index 0000000..ff3729b --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-hs.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, +null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-lisp.js b/src/resources/static/js/lib/zui/lib/prettify/lang-lisp.js new file mode 100644 index 0000000..9c8cfa5 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-lisp.js @@ -0,0 +1,3 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], +["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","lsp","scm","ss","rkt"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-llvm.js b/src/resources/static/js/lib/zui/lib/prettify/lang-llvm.js new file mode 100644 index 0000000..16fade2 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-llvm.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^!?"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["com",/^;[^\n\r]*/,null,";"]],[["pln",/^[!%@](?:[$\-.A-Z_a-z][\w$\-.]*|\d+)/],["kwd",/^[^\W\d]\w*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[Xx][\dA-Fa-f]+)/],["pun",/^[(-*,:<->[\]{}]|\.\.\.$/]]),["llvm","ll"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-lua.js b/src/resources/static/js/lib/zui/lib/prettify/lang-lua.js new file mode 100644 index 0000000..7e44cca --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-lua.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], +["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-matlab.js b/src/resources/static/js/lib/zui/lib/prettify/lang-matlab.js new file mode 100644 index 0000000..d0d3516 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-matlab.js @@ -0,0 +1,6 @@ +var a=null,b=window.PR,c=[[b.PR_PLAIN,/^[\t-\r \xa0]+/,a," \t\r\n\u000b\u000c\u00a0"],[b.PR_COMMENT,/^%{[^%]*%+(?:[^%}][^%]*%+)*}/,a],[b.PR_COMMENT,/^%[^\n\r]*/,a,"%"],["syscmd",/^![^\n\r]*/,a,"!"]],d=[["linecont",/^\.\.\.\s*[\n\r]/,a],["err",/^\?\?\? [^\n\r]*/,a],["wrn",/^Warning: [^\n\r]*/,a],["codeoutput",/^>>\s+/,a],["codeoutput",/^octave:\d+>\s+/,a],["lang-matlab-operators",/^((?:[A-Za-z]\w*(?:\.[A-Za-z]\w*)*|[).\]}])')/,a],["lang-matlab-identifiers",/^([A-Za-z]\w*(?:\.[A-Za-z]\w*)*)(?!')/,a], +[b.PR_STRING,/^'(?:[^']|'')*'/,a],[b.PR_LITERAL,/^[+-]?\.?\d+(?:\.\d*)?(?:[Ee][+-]?\d+)?[ij]?/,a],[b.PR_TAG,/^[()[\]{}]/,a],[b.PR_PUNCTUATION,/^[!&*-/:->@\\^|~]/,a]],e=[["lang-matlab-identifiers",/^([A-Za-z]\w*(?:\.[A-Za-z]\w*)*)/,a],[b.PR_TAG,/^[()[\]{}]/,a],[b.PR_PUNCTUATION,/^[!&*-/:->@\\^|~]/,a],["transpose",/^'/,a]]; +b.registerLangHandler(b.createSimpleLexer([],[[b.PR_KEYWORD,/^\b(?:break|case|catch|classdef|continue|else|elseif|end|for|function|global|if|otherwise|parfor|persistent|return|spmd|switch|try|while)\b/,a],["const",/^\b(?:true|false|inf|Inf|nan|NaN|eps|pi|ans|nargin|nargout|varargin|varargout)\b/,a],[b.PR_TYPE,/^\b(?:cell|struct|char|double|single|logical|u?int(?:8|16|32|64)|sparse)\b/,a],["fun",/^\b(?:abs|accumarray|acos(?:d|h)?|acot(?:d|h)?|acsc(?:d|h)?|actxcontrol(?:list|select)?|actxGetRunningServer|actxserver|addlistener|addpath|addpref|addtodate|airy|align|alim|all|allchild|alpha|alphamap|amd|ancestor|and|angle|annotation|any|area|arrayfun|asec(?:d|h)?|asin(?:d|h)?|assert|assignin|atan[2dh]?|audiodevinfo|audioplayer|audiorecorder|aufinfo|auread|autumn|auwrite|avifile|aviinfo|aviread|axes|axis|balance|bar(?:3|3h|h)?|base2dec|beep|BeginInvoke|bench|bessel[h-ky]|beta|betainc|betaincinv|betaln|bicg|bicgstab|bicgstabl|bin2dec|bitand|bitcmp|bitget|bitmax|bitnot|bitor|bitset|bitshift|bitxor|blanks|blkdiag|bone|box|brighten|brush|bsxfun|builddocsearchdb|builtin|bvp4c|bvp5c|bvpget|bvpinit|bvpset|bvpxtend|calendar|calllib|callSoapService|camdolly|cameratoolbar|camlight|camlookat|camorbit|campan|campos|camproj|camroll|camtarget|camup|camva|camzoom|cart2pol|cart2sph|cast|cat|caxis|cd|cdf2rdf|cdfepoch|cdfinfo|cdflib(?:.(?:close|closeVar|computeEpoch|computeEpoch16|create|createAttr|createVar|delete|deleteAttr|deleteAttrEntry|deleteAttrgEntry|deleteVar|deleteVarRecords|epoch16Breakdown|epochBreakdown|getAttrEntry|getAttrgEntry|getAttrMaxEntry|getAttrMaxgEntry|getAttrName|getAttrNum|getAttrScope|getCacheSize|getChecksum|getCompression|getCompressionCacheSize|getConstantNames|getConstantValue|getCopyright|getFileBackward|getFormat|getLibraryCopyright|getLibraryVersion|getMajority|getName|getNumAttrEntries|getNumAttrgEntries|getNumAttributes|getNumgAttributes|getReadOnlyMode|getStageCacheSize|getValidate|getVarAllocRecords|getVarBlockingFactor|getVarCacheSize|getVarCompression|getVarData|getVarMaxAllocRecNum|getVarMaxWrittenRecNum|getVarName|getVarNum|getVarNumRecsWritten|getVarPadValue|getVarRecordData|getVarReservePercent|getVarsMaxWrittenRecNum|getVarSparseRecords|getVersion|hyperGetVarData|hyperPutVarData|inquire|inquireAttr|inquireAttrEntry|inquireAttrgEntry|inquireVar|open|putAttrEntry|putAttrgEntry|putVarData|putVarRecordData|renameAttr|renameVar|setCacheSize|setChecksum|setCompression|setCompressionCacheSize|setFileBackward|setFormat|setMajority|setReadOnlyMode|setStageCacheSize|setValidate|setVarAllocBlockRecords|setVarBlockingFactor|setVarCacheSize|setVarCompression|setVarInitialRecs|setVarPadValue|SetVarReservePercent|setVarsCacheSize|setVarSparseRecords))?|cdfread|cdfwrite|ceil|cell2mat|cell2struct|celldisp|cellfun|cellplot|cellstr|cgs|checkcode|checkin|checkout|chol|cholinc|cholupdate|circshift|cla|clabel|class|clc|clear|clearvars|clf|clipboard|clock|close|closereq|cmopts|cmpermute|cmunique|colamd|colon|colorbar|colordef|colormap|colormapeditor|colperm|Combine|comet|comet3|commandhistory|commandwindow|compan|compass|complex|computer|cond|condeig|condest|coneplot|conj|containers.Map|contour(?:[3cf]|slice)?|contrast|conv|conv2|convhull|convhulln|convn|cool|copper|copyfile|copyobj|corrcoef|cos(?:d|h)?|cot(?:d|h)?|cov|cplxpair|cputime|createClassFromWsdl|createSoapMessage|cross|csc(?:d|h)?|csvread|csvwrite|ctranspose|cumprod|cumsum|cumtrapz|curl|customverctrl|cylinder|daqread|daspect|datacursormode|datatipinfo|date|datenum|datestr|datetick|datevec|dbclear|dbcont|dbdown|dblquad|dbmex|dbquit|dbstack|dbstatus|dbstep|dbstop|dbtype|dbup|dde23|ddeget|ddesd|ddeset|deal|deblank|dec2base|dec2bin|dec2hex|decic|deconv|del2|delaunay|delaunay3|delaunayn|DelaunayTri|delete|demo|depdir|depfun|det|detrend|deval|diag|dialog|diary|diff|diffuse|dir|disp|display|dither|divergence|dlmread|dlmwrite|dmperm|doc|docsearch|dos|dot|dragrect|drawnow|dsearch|dsearchn|dynamicprops|echo|echodemo|edit|eig|eigs|ellipj|ellipke|ellipsoid|empty|enableNETfromNetworkDrive|enableservice|EndInvoke|enumeration|eomday|eq|erf|erfc|erfcinv|erfcx|erfinv|error|errorbar|errordlg|etime|etree|etreeplot|eval|evalc|evalin|event.(?:EventData|listener|PropertyEvent|proplistener)|exifread|exist|exit|exp|expint|expm|expm1|export2wsdlg|eye|ezcontour|ezcontourf|ezmesh|ezmeshc|ezplot|ezplot3|ezpolar|ezsurf|ezsurfc|factor|factorial|fclose|feather|feature|feof|ferror|feval|fft|fft2|fftn|fftshift|fftw|fgetl|fgets|fieldnames|figure|figurepalette|fileattrib|filebrowser|filemarker|fileparts|fileread|filesep|fill|fill3|filter|filter2|find|findall|findfigs|findobj|findstr|finish|fitsdisp|fitsinfo|fitsread|fitswrite|fix|flag|flipdim|fliplr|flipud|floor|flow|fminbnd|fminsearch|fopen|format|fplot|fprintf|frame2im|fread|freqspace|frewind|fscanf|fseek|ftell|FTP|full|fullfile|func2str|functions|funm|fwrite|fzero|gallery|gamma|gammainc|gammaincinv|gammaln|gca|gcbf|gcbo|gcd|gcf|gco|ge|genpath|genvarname|get|getappdata|getenv|getfield|getframe|getpixelposition|getpref|ginput|gmres|gplot|grabcode|gradient|gray|graymon|grid|griddata(?:3|n)?|griddedInterpolant|gsvd|gt|gtext|guidata|guide|guihandles|gunzip|gzip|h5create|h5disp|h5info|h5read|h5readatt|h5write|h5writeatt|hadamard|handle|hankel|hdf|hdf5|hdf5info|hdf5read|hdf5write|hdfinfo|hdfread|hdftool|help|helpbrowser|helpdesk|helpdlg|helpwin|hess|hex2dec|hex2num|hgexport|hggroup|hgload|hgsave|hgsetget|hgtransform|hidden|hilb|hist|histc|hold|home|horzcat|hostid|hot|hsv|hsv2rgb|hypot|ichol|idivide|ifft|ifft2|ifftn|ifftshift|ilu|im2frame|im2java|imag|image|imagesc|imapprox|imfinfo|imformats|import|importdata|imread|imwrite|ind2rgb|ind2sub|inferiorto|info|inline|inmem|inpolygon|input|inputdlg|inputname|inputParser|inspect|instrcallback|instrfind|instrfindall|int2str|integral(?:2|3)?|interp(?:1|1q|2|3|ft|n)|interpstreamspeed|intersect|intmax|intmin|inv|invhilb|ipermute|isa|isappdata|iscell|iscellstr|ischar|iscolumn|isdir|isempty|isequal|isequaln|isequalwithequalnans|isfield|isfinite|isfloat|isglobal|ishandle|ishghandle|ishold|isinf|isinteger|isjava|iskeyword|isletter|islogical|ismac|ismatrix|ismember|ismethod|isnan|isnumeric|isobject|isocaps|isocolors|isonormals|isosurface|ispc|ispref|isprime|isprop|isreal|isrow|isscalar|issorted|isspace|issparse|isstr|isstrprop|isstruct|isstudent|isunix|isvarname|isvector|javaaddpath|javaArray|javachk|javaclasspath|javacomponent|javaMethod|javaMethodEDT|javaObject|javaObjectEDT|javarmpath|jet|keyboard|kron|lasterr|lasterror|lastwarn|lcm|ldivide|ldl|le|legend|legendre|length|libfunctions|libfunctionsview|libisloaded|libpointer|libstruct|license|light|lightangle|lighting|lin2mu|line|lines|linkaxes|linkdata|linkprop|linsolve|linspace|listdlg|listfonts|load|loadlibrary|loadobj|log|log10|log1p|log2|loglog|logm|logspace|lookfor|lower|ls|lscov|lsqnonneg|lsqr|lt|lu|luinc|magic|makehgtform|mat2cell|mat2str|material|matfile|matlab.io.MatFile|matlab.mixin.(?:Copyable|Heterogeneous(?:.getDefaultScalarElement)?)|matlabrc|matlabroot|max|maxNumCompThreads|mean|median|membrane|memmapfile|memory|menu|mesh|meshc|meshgrid|meshz|meta.(?:class(?:.fromName)?|DynamicProperty|EnumeratedValue|event|MetaData|method|package(?:.(?:fromName|getAllPackages))?|property)|metaclass|methods|methodsview|mex(?:.getCompilerConfigurations)?|MException|mexext|mfilename|min|minres|minus|mislocked|mkdir|mkpp|mldivide|mlint|mlintrpt|mlock|mmfileinfo|mmreader|mod|mode|more|move|movefile|movegui|movie|movie2avi|mpower|mrdivide|msgbox|mtimes|mu2lin|multibandread|multibandwrite|munlock|namelengthmax|nargchk|narginchk|nargoutchk|native2unicode|nccreate|ncdisp|nchoosek|ncinfo|ncread|ncreadatt|ncwrite|ncwriteatt|ncwriteschema|ndgrid|ndims|ne|NET(?:.(?:addAssembly|Assembly|convertArray|createArray|createGeneric|disableAutoRelease|enableAutoRelease|GenericClass|invokeGenericMethod|NetException|setStaticProperty))?|netcdf.(?:abort|close|copyAtt|create|defDim|defGrp|defVar|defVarChunking|defVarDeflate|defVarFill|defVarFletcher32|delAtt|endDef|getAtt|getChunkCache|getConstant|getConstantNames|getVar|inq|inqAtt|inqAttID|inqAttName|inqDim|inqDimID|inqDimIDs|inqFormat|inqGrpName|inqGrpNameFull|inqGrpParent|inqGrps|inqLibVers|inqNcid|inqUnlimDims|inqVar|inqVarChunking|inqVarDeflate|inqVarFill|inqVarFletcher32|inqVarID|inqVarIDs|open|putAtt|putVar|reDef|renameAtt|renameDim|renameVar|setChunkCache|setDefaultFormat|setFill|sync)|newplot|nextpow2|nnz|noanimate|nonzeros|norm|normest|not|notebook|now|nthroot|null|num2cell|num2hex|num2str|numel|nzmax|ode(?:113|15i|15s|23|23s|23t|23tb|45)|odeget|odeset|odextend|onCleanup|ones|open|openfig|opengl|openvar|optimget|optimset|or|ordeig|orderfields|ordqz|ordschur|orient|orth|pack|padecoef|pagesetupdlg|pan|pareto|parseSoapResponse|pascal|patch|path|path2rc|pathsep|pathtool|pause|pbaspect|pcg|pchip|pcode|pcolor|pdepe|pdeval|peaks|perl|perms|permute|pie|pink|pinv|planerot|playshow|plot|plot3|plotbrowser|plotedit|plotmatrix|plottools|plotyy|plus|pol2cart|polar|poly|polyarea|polyder|polyeig|polyfit|polyint|polyval|polyvalm|pow2|power|ppval|prefdir|preferences|primes|print|printdlg|printopt|printpreview|prod|profile|profsave|propedit|propertyeditor|psi|publish|PutCharArray|PutFullMatrix|PutWorkspaceData|pwd|qhull|qmr|qr|qrdelete|qrinsert|qrupdate|quad|quad2d|quadgk|quadl|quadv|questdlg|quit|quiver|quiver3|qz|rand|randi|randn|randperm|RandStream(?:.(?:create|getDefaultStream|getGlobalStream|list|setDefaultStream|setGlobalStream))?|rank|rat|rats|rbbox|rcond|rdivide|readasync|real|reallog|realmax|realmin|realpow|realsqrt|record|rectangle|rectint|recycle|reducepatch|reducevolume|refresh|refreshdata|regexp|regexpi|regexprep|regexptranslate|rehash|rem|Remove|RemoveAll|repmat|reset|reshape|residue|restoredefaultpath|rethrow|rgb2hsv|rgb2ind|rgbplot|ribbon|rmappdata|rmdir|rmfield|rmpath|rmpref|rng|roots|rose|rosser|rot90|rotate|rotate3d|round|rref|rsf2csf|run|save|saveas|saveobj|savepath|scatter|scatter3|schur|sec|secd|sech|selectmoveresize|semilogx|semilogy|sendmail|serial|set|setappdata|setdiff|setenv|setfield|setpixelposition|setpref|setstr|setxor|shading|shg|shiftdim|showplottool|shrinkfaces|sign|sin(?:d|h)?|size|slice|smooth3|snapnow|sort|sortrows|sound|soundsc|spalloc|spaugment|spconvert|spdiags|specular|speye|spfun|sph2cart|sphere|spinmap|spline|spones|spparms|sprand|sprandn|sprandsym|sprank|spring|sprintf|spy|sqrt|sqrtm|squeeze|ss2tf|sscanf|stairs|startup|std|stem|stem3|stopasync|str2double|str2func|str2mat|str2num|strcat|strcmp|strcmpi|stream2|stream3|streamline|streamparticles|streamribbon|streamslice|streamtube|strfind|strjust|strmatch|strncmp|strncmpi|strread|strrep|strtok|strtrim|struct2cell|structfun|strvcat|sub2ind|subplot|subsasgn|subsindex|subspace|subsref|substruct|subvolume|sum|summer|superclasses|superiorto|support|surf|surf2patch|surface|surfc|surfl|surfnorm|svd|svds|swapbytes|symamd|symbfact|symmlq|symrcm|symvar|system|tan(?:d|h)?|tar|tempdir|tempname|tetramesh|texlabel|text|textread|textscan|textwrap|tfqmr|throw|tic|Tiff(?:.(?:getTagNames|getVersion))?|timer|timerfind|timerfindall|times|timeseries|title|toc|todatenum|toeplitz|toolboxdir|trace|transpose|trapz|treelayout|treeplot|tril|trimesh|triplequad|triplot|TriRep|TriScatteredInterp|trisurf|triu|tscollection|tsearch|tsearchn|tstool|type|typecast|uibuttongroup|uicontextmenu|uicontrol|uigetdir|uigetfile|uigetpref|uiimport|uimenu|uiopen|uipanel|uipushtool|uiputfile|uiresume|uisave|uisetcolor|uisetfont|uisetpref|uistack|uitable|uitoggletool|uitoolbar|uiwait|uminus|undocheckout|unicode2native|union|unique|unix|unloadlibrary|unmesh|unmkpp|untar|unwrap|unzip|uplus|upper|urlread|urlwrite|usejava|userpath|validateattributes|validatestring|vander|var|vectorize|ver|verctrl|verLessThan|version|vertcat|VideoReader(?:.isPlatformSupported)?|VideoWriter(?:.getProfiles)?|view|viewmtx|visdiff|volumebounds|voronoi|voronoin|wait|waitbar|waitfor|waitforbuttonpress|warndlg|warning|waterfall|wavfinfo|wavplay|wavread|wavrecord|wavwrite|web|weekday|what|whatsnew|which|whitebg|who|whos|wilkinson|winopen|winqueryreg|winter|wk1finfo|wk1read|wk1write|workspace|xlabel|xlim|xlsfinfo|xlsread|xlswrite|xmlread|xmlwrite|xor|xslt|ylabel|ylim|zeros|zip|zlabel|zlim|zoom)\b/, +a],["fun_tbx",/^\b(?:addedvarplot|andrewsplot|anova[12n]|ansaribradley|aoctool|barttest|bbdesign|beta(?:cdf|fit|inv|like|pdf|rnd|stat)|bino(?:cdf|fit|inv|pdf|rnd|stat)|biplot|bootci|bootstrp|boxplot|candexch|candgen|canoncorr|capability|capaplot|caseread|casewrite|categorical|ccdesign|cdfplot|chi2(?:cdf|gof|inv|pdf|rnd|stat)|cholcov|Classification(?:BaggedEnsemble|Discriminant(?:.(?:fit|make|template))?|Ensemble|KNN(?:.(?:fit|template))?|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|template))?)|classify|classregtree|cluster|clusterdata|cmdscale|combnk|Compact(?:Classification(?:Discriminant|Ensemble|Tree)|Regression(?:Ensemble|Tree)|TreeBagger)|confusionmat|controlchart|controlrules|cophenet|copula(?:cdf|fit|param|pdf|rnd|stat)|cordexch|corr|corrcov|coxphfit|createns|crosstab|crossval|cvpartition|datasample|dataset|daugment|dcovary|dendrogram|dfittool|disttool|dummyvar|dwtest|ecdf|ecdfhist|ev(?:cdf|fit|inv|like|pdf|rnd|stat)|ExhaustiveSearcher|exp(?:cdf|fit|inv|like|pdf|rnd|stat)|factoran|fcdf|ff2n|finv|fitdist|fitensemble|fpdf|fracfact|fracfactgen|friedman|frnd|fstat|fsurfht|fullfact|gagerr|gam(?:cdf|fit|inv|like|pdf|rnd|stat)|GeneralizedLinearModel(?:.fit)?|geo(?:cdf|inv|mean|pdf|rnd|stat)|gev(?:cdf|fit|inv|like|pdf|rnd|stat)|gline|glmfit|glmval|glyphplot|gmdistribution(?:.fit)?|gname|gp(?:cdf|fit|inv|like|pdf|rnd|stat)|gplotmatrix|grp2idx|grpstats|gscatter|haltonset|harmmean|hist3|histfit|hmm(?:decode|estimate|generate|train|viterbi)|hougen|hyge(?:cdf|inv|pdf|rnd|stat)|icdf|inconsistent|interactionplot|invpred|iqr|iwishrnd|jackknife|jbtest|johnsrnd|KDTreeSearcher|kmeans|knnsearch|kruskalwallis|ksdensity|kstest|kstest2|kurtosis|lasso|lassoglm|lassoPlot|leverage|lhsdesign|lhsnorm|lillietest|LinearModel(?:.fit)?|linhyptest|linkage|logn(?:cdf|fit|inv|like|pdf|rnd|stat)|lsline|mad|mahal|maineffectsplot|manova1|manovacluster|mdscale|mhsample|mle|mlecov|mnpdf|mnrfit|mnrnd|mnrval|moment|multcompare|multivarichart|mvn(?:cdf|pdf|rnd)|mvregress|mvregresslike|mvt(?:cdf|pdf|rnd)|NaiveBayes(?:.fit)?|nan(?:cov|max|mean|median|min|std|sum|var)|nbin(?:cdf|fit|inv|pdf|rnd|stat)|ncf(?:cdf|inv|pdf|rnd|stat)|nct(?:cdf|inv|pdf|rnd|stat)|ncx2(?:cdf|inv|pdf|rnd|stat)|NeighborSearcher|nlinfit|nlintool|nlmefit|nlmefitsa|nlparci|nlpredci|nnmf|nominal|NonLinearModel(?:.fit)?|norm(?:cdf|fit|inv|like|pdf|rnd|stat)|normplot|normspec|ordinal|outlierMeasure|parallelcoords|paretotails|partialcorr|pcacov|pcares|pdf|pdist|pdist2|pearsrnd|perfcurve|perms|piecewisedistribution|plsregress|poiss(?:cdf|fit|inv|pdf|rnd|tat)|polyconf|polytool|prctile|princomp|ProbDist(?:Kernel|Parametric|UnivKernel|UnivParam)?|probplot|procrustes|qqplot|qrandset|qrandstream|quantile|randg|random|randsample|randtool|range|rangesearch|ranksum|rayl(?:cdf|fit|inv|pdf|rnd|stat)|rcoplot|refcurve|refline|regress|Regression(?:BaggedEnsemble|Ensemble|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|template))?)|regstats|relieff|ridge|robustdemo|robustfit|rotatefactors|rowexch|rsmdemo|rstool|runstest|sampsizepwr|scatterhist|sequentialfs|signrank|signtest|silhouette|skewness|slicesample|sobolset|squareform|statget|statset|stepwise|stepwisefit|surfht|tabulate|tblread|tblwrite|tcdf|tdfread|tiedrank|tinv|tpdf|TreeBagger|treedisp|treefit|treeprune|treetest|treeval|trimmean|trnd|tstat|ttest|ttest2|unid(?:cdf|inv|pdf|rnd|stat)|unif(?:cdf|inv|it|pdf|rnd|stat)|vartest(?:2|n)?|wbl(?:cdf|fit|inv|like|pdf|rnd|stat)|wblplot|wishrnd|x2fx|xptread|zscore|ztest)\b/, +a],["fun_tbx",/^\b(?:adapthisteq|analyze75info|analyze75read|applycform|applylut|axes2pix|bestblk|blockproc|bwarea|bwareaopen|bwboundaries|bwconncomp|bwconvhull|bwdist|bwdistgeodesic|bweuler|bwhitmiss|bwlabel|bwlabeln|bwmorph|bwpack|bwperim|bwselect|bwtraceboundary|bwulterode|bwunpack|checkerboard|col2im|colfilt|conndef|convmtx2|corner|cornermetric|corr2|cp2tform|cpcorr|cpselect|cpstruct2pairs|dct2|dctmtx|deconvblind|deconvlucy|deconvreg|deconvwnr|decorrstretch|demosaic|dicom(?:anon|dict|info|lookup|read|uid|write)|edge|edgetaper|entropy|entropyfilt|fan2para|fanbeam|findbounds|fliptform|freqz2|fsamp2|fspecial|ftrans2|fwind1|fwind2|getheight|getimage|getimagemodel|getline|getneighbors|getnhood|getpts|getrangefromclass|getrect|getsequence|gray2ind|graycomatrix|graycoprops|graydist|grayslice|graythresh|hdrread|hdrwrite|histeq|hough|houghlines|houghpeaks|iccfind|iccread|iccroot|iccwrite|idct2|ifanbeam|im2bw|im2col|im2double|im2int16|im2java2d|im2single|im2uint16|im2uint8|imabsdiff|imadd|imadjust|ImageAdapter|imageinfo|imagemodel|imapplymatrix|imattributes|imbothat|imclearborder|imclose|imcolormaptool|imcomplement|imcontour|imcontrast|imcrop|imdilate|imdisplayrange|imdistline|imdivide|imellipse|imerode|imextendedmax|imextendedmin|imfill|imfilter|imfindcircles|imfreehand|imfuse|imgca|imgcf|imgetfile|imhandles|imhist|imhmax|imhmin|imimposemin|imlincomb|imline|immagbox|immovie|immultiply|imnoise|imopen|imoverview|imoverviewpanel|impixel|impixelinfo|impixelinfoval|impixelregion|impixelregionpanel|implay|impoint|impoly|impositionrect|improfile|imputfile|impyramid|imreconstruct|imrect|imregconfig|imregionalmax|imregionalmin|imregister|imresize|imroi|imrotate|imsave|imscrollpanel|imshow|imshowpair|imsubtract|imtool|imtophat|imtransform|imview|ind2gray|ind2rgb|interfileinfo|interfileread|intlut|ippl|iptaddcallback|iptcheckconn|iptcheckhandle|iptcheckinput|iptcheckmap|iptchecknargin|iptcheckstrs|iptdemos|iptgetapi|iptGetPointerBehavior|iptgetpref|ipticondir|iptnum2ordinal|iptPointerManager|iptprefs|iptremovecallback|iptSetPointerBehavior|iptsetpref|iptwindowalign|iradon|isbw|isflat|isgray|isicc|isind|isnitf|isrgb|isrset|lab2double|lab2uint16|lab2uint8|label2rgb|labelmatrix|makecform|makeConstrainToRectFcn|makehdr|makelut|makeresampler|maketform|mat2gray|mean2|medfilt2|montage|nitfinfo|nitfread|nlfilter|normxcorr2|ntsc2rgb|openrset|ordfilt2|otf2psf|padarray|para2fan|phantom|poly2mask|psf2otf|qtdecomp|qtgetblk|qtsetblk|radon|rangefilt|reflect|regionprops|registration.metric.(?:MattesMutualInformation|MeanSquares)|registration.optimizer.(?:OnePlusOneEvolutionary|RegularStepGradientDescent)|rgb2gray|rgb2ntsc|rgb2ycbcr|roicolor|roifill|roifilt2|roipoly|rsetwrite|std2|stdfilt|strel|stretchlim|subimage|tformarray|tformfwd|tforminv|tonemap|translate|truesize|uintlut|viscircles|warp|watershed|whitepoint|wiener2|xyz2double|xyz2uint16|ycbcr2rgb)\b/, +a],["fun_tbx",/^\b(?:bintprog|color|fgoalattain|fminbnd|fmincon|fminimax|fminsearch|fminunc|fseminf|fsolve|fzero|fzmult|gangstr|ktrlink|linprog|lsqcurvefit|lsqlin|lsqnonlin|lsqnonneg|optimget|optimset|optimtool|quadprog)\b/,a],["ident",/^[A-Za-z]\w*(?:\.[A-Za-z]\w*)*/,a]]),["matlab-identifiers"]);b.registerLangHandler(b.createSimpleLexer([],e),["matlab-operators"]);b.registerLangHandler(b.createSimpleLexer(c,d),["matlab"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-ml.js b/src/resources/static/js/lib/zui/lib/prettify/lang-ml.js new file mode 100644 index 0000000..8ed2b0c --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-ml.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], +["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-mumps.js b/src/resources/static/js/lib/zui/lib/prettify/lang-mumps.js new file mode 100644 index 0000000..8a6b3fd --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-mumps.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"]|\\.)*"/,null,'"']],[["com",/^;[^\n\r]*/,null,";"],["dec",/^\$(?:d|device|ec|ecode|es|estack|et|etrap|h|horolog|i|io|j|job|k|key|p|principal|q|quit|st|stack|s|storage|sy|system|t|test|tl|tlevel|tr|trestart|x|y|z[a-z]*|a|ascii|c|char|d|data|e|extract|f|find|fn|fnumber|g|get|j|justify|l|length|na|name|o|order|p|piece|ql|qlength|qs|qsubscript|q|query|r|random|re|reverse|s|select|st|stack|t|text|tr|translate|nan)\b/i, +null],["kwd",/^(?:[^$]b|break|c|close|d|do|e|else|f|for|g|goto|h|halt|h|hang|i|if|j|job|k|kill|l|lock|m|merge|n|new|o|open|q|quit|r|read|s|set|tc|tcommit|tre|trestart|tro|trollback|ts|tstart|u|use|v|view|w|write|x|xecute)\b/i,null],["lit",/^[+-]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?/i],["pln",/^[a-z][^\W_]*/i],["pun",/^[^\w\t\n\r"$%;^\xa0]|_/]]),["mumps"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-n.js b/src/resources/static/js/lib/zui/lib/prettify/lang-n.js new file mode 100644 index 0000000..27812a5 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-n.js @@ -0,0 +1,4 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, +a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, +a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-pascal.js b/src/resources/static/js/lib/zui/lib/prettify/lang-pascal.js new file mode 100644 index 0000000..8435fad --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-pascal.js @@ -0,0 +1,3 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["str",/^'(?:[^\n\r'\\]|\\.)*(?:'|$)/,a,"'"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^\(\*[\S\s]*?(?:\*\)|$)|^{[\S\s]*?(?:}|$)/,a],["kwd",/^(?:absolute|and|array|asm|assembler|begin|case|const|constructor|destructor|div|do|downto|else|end|external|for|forward|function|goto|if|implementation|in|inline|interface|interrupt|label|mod|not|object|of|or|packed|procedure|program|record|repeat|set|shl|shr|then|to|type|unit|until|uses|var|virtual|while|with|xor)\b/i,a], +["lit",/^(?:true|false|self|nil)/i,a],["pln",/^[a-z][^\W_]*/i,a],["lit",/^(?:\$[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)/i,a,"0123456789"],["pun",/^.[^\s\w$'./@]*/,a]]),["pascal"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-proto.js b/src/resources/static/js/lib/zui/lib/prettify/lang-proto.js new file mode 100644 index 0000000..f006ad8 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-proto.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-r.js b/src/resources/static/js/lib/zui/lib/prettify/lang-r.js new file mode 100644 index 0000000..99af8f8 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-r.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^'\\]|\\[\S\s])*(?:'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![\w.])/],["lit",/^0[Xx][\dA-Fa-f]+([Pp]\d+)?[Li]?/],["lit",/^[+-]?(\d+(\.\d+)?|\.\d+)([Ee][+-]?\d+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|\d+))(?![\w.])/], +["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|[!*+/^]|%.*?%|[$=@~]|:{1,3}|[(),;?[\]{}])/],["pln",/^(?:[A-Za-z]+[\w.]*|\.[^\W\d][\w.]*)(?![\w.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-rd.js b/src/resources/static/js/lib/zui/lib/prettify/lang-rd.js new file mode 100644 index 0000000..7a7e43f --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-rd.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[@-Za-z]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[()[\]{}]+/]]),["Rd","rd"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-scala.js b/src/resources/static/js/lib/zui/lib/prettify/lang-scala.js new file mode 100644 index 0000000..3f97dba --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-scala.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], +["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-sql.js b/src/resources/static/js/lib/zui/lib/prettify/lang-sql.js new file mode 100644 index 0000000..8ec4280 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-sql.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|apply|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|connect|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|following|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|matched|merge|natural|national|nocheck|nonclustered|nocycle|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|partition|percent|pivot|plan|preceding|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rows?|rule|save|schema|select|session_user|set|setuser|shutdown|some|start|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|unbounded|union|unique|unpivot|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|within|writetext|xml)(?=[^\w-]|$)/i, +null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-tcl.js b/src/resources/static/js/lib/zui/lib/prettify/lang-tcl.js new file mode 100644 index 0000000..490f562 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-tcl.js @@ -0,0 +1,3 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^{+/,a,"{"],["clo",/^}+/,a,"}"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,a],["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit", +/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["tcl"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-tex.js b/src/resources/static/js/lib/zui/lib/prettify/lang-tex.js new file mode 100644 index 0000000..dcfdadd --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-tex.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-vb.js b/src/resources/static/js/lib/zui/lib/prettify/lang-vb.js new file mode 100644 index 0000000..ddde464 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-vb.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"\u201c\u201d'],["com",/^['\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\n\r_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, +null],["com",/^rem\b.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[!#%&@]+])?|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-vhdl.js b/src/resources/static/js/lib/zui/lib/prettify/lang-vhdl.js new file mode 100644 index 0000000..51f3017 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-vhdl.js @@ -0,0 +1,3 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, +null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], +["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-wiki.js b/src/resources/static/js/lib/zui/lib/prettify/lang-wiki.js new file mode 100644 index 0000000..96c1e34 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-wiki.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); +PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-xq.js b/src/resources/static/js/lib/zui/lib/prettify/lang-xq.js new file mode 100644 index 0000000..e323ae3 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-xq.js @@ -0,0 +1,3 @@ +PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[\w-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^@[\w-]+/],["tag",/^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["com",/^\(:[\S\s]*?:\)/],["pln",/^[(),/;[\]{}]$/],["str",/^(?:"(?:[^"\\{]|\\[\S\s])*(?:"|$)|'(?:[^'\\{]|\\[\S\s])*(?:'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], +["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], +["pln",/^[\w:-]+/],["pln",/^[\t\n\r \xa0]+/]]),["xq","xquery"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/lang-yaml.js b/src/resources/static/js/lib/zui/lib/prettify/lang-yaml.js new file mode 100644 index 0000000..c38729b --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/lang-yaml.js @@ -0,0 +1,2 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); diff --git a/src/resources/static/js/lib/zui/lib/prettify/prettify.css b/src/resources/static/js/lib/zui/lib/prettify/prettify.css new file mode 100644 index 0000000..0007f7f --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/prettify.css @@ -0,0 +1,2 @@ +/*! Apache License 2.0 https://github.com/google/code-prettify*/ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/src/resources/static/js/lib/zui/lib/prettify/prettify.js b/src/resources/static/js/lib/zui/lib/prettify/prettify.js new file mode 100644 index 0000000..6aa972c --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/prettify/prettify.js @@ -0,0 +1,31 @@ +/*! Apache License 2.0 https://github.com/google/code-prettify*/ +!function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a= +b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;ah[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com", +/^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+ +s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/, +q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d= +c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], +O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, +V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", +/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], +["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}), +["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q, +hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); +p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="
          "+a+"
          ";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1}); +return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i=0;){var M=A[m],T=M.src.match(/^[^#?]*\/run_prettify\.js(\?[^#]*)?(?:#.*)?$/);if(T){z=T[1]||"";M.parentNode.removeChild(M);break}}var S=!0,D= +[],N=[],K=[];z.replace(/[&?]([^&=]+)=([^&]+)/g,function(e,j,w){w=decodeURIComponent(w);j=decodeURIComponent(j);j=="autorun"?S=!/^[0fn]/i.test(w):j=="lang"?D.push(w):j=="skin"?N.push(w):j=="callback"&&K.push(w)});m=0;for(z=D.length;m122||(o<65||k>90||f.push([Math.max(65,k)|32,Math.min(o,90)|32]),o<97||k>122||f.push([Math.max(97,k)&-33,Math.min(o,122)&-33]))}}f.sort(function(f,a){return f[0]- +a[0]||a[1]-f[1]});b=[];g=[];for(a=0;ak[0]&&(k[1]+1>k[0]&&c.push("-"),c.push(h(k[1])));c.push("]");return c.join("")}function e(f){for(var a=f.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],g=0,k=0;g=2&&f==="["?a[g]=b(o):f!=="\\"&&(a[g]=o.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var j=0,F=!1,l=!1,I=0,c=a.length;I=5&&"lang-"===y.substring(0,5))&&!(u&&typeof u[1]==="string"))g=!1,y="src";g||(m[B]=y)}k=c;c+=B.length;if(g){g=u[1];var o=B.indexOf(g),H=o+g.length;u[2]&&(H=B.length-u[2].length,o=H-g.length);y=y.substring(5);n(l+k,B.substring(0,o),h,j);n(l+k+o,g,A(y, +g),j);n(l+k+H,B.substring(H),h,j)}else j.push(l+k,y)}a.g=j}var b={},e;(function(){for(var h=a.concat(d),l=[],i={},c=0,p=h.length;c=0;)b[q.charAt(f)]=m;m=m[1];q=""+m;i.hasOwnProperty(q)||(l.push(m),i[q]=r)}l.push(/[\S\s]/);e=j(l)})();var i=d.length;return h}function t(a){var d=[],h=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/, +r,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,r,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,r,"\"'"]);a.verbatimStrings&&h.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,r]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,r,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/, +r,"#"]),h.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,r])):d.push(["com",/^#[^\n\r]*/,r,"#"]));a.cStyleComments&&(h.push(["com",/^\/\/[^\n\r]*/,r]),h.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,r]));if(b=a.regexLiterals){var e=(b=b>1?"":"\n\r")?".":"[\\S\\s]";h.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+ +("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+e+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+e+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&h.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&h.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),r]);d.push(["pln",/^\s+/,r," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");h.push(["lit",/^@[$_a-z][\w$@]*/i,r],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,r],["pln",/^[$_a-z][\w$@]*/i,r],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i, +r,"0123456789"],["pln",/^\\[\S\s]?/,r],["pun",RegExp(b),r]);return C(d,h)}function z(a,d,h){function b(a){var c=a.nodeType;if(c==1&&!j.test(a.className))if("br"===a.nodeName)e(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&h){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),e(a),c||a.parentNode.removeChild(a)}} +function e(a){function b(a,c){var d=c?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),h=a.nextSibling;f.appendChild(d);for(var e=h;e;e=h)h=e.nextSibling,f.appendChild(e)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var j=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,l=a.ownerDocument,i=l.createElement("li");a.firstChild;)i.appendChild(a.firstChild);for(var c=[i],p=0;p=0;){var b=d[h];U.hasOwnProperty(b)?V.console&&console.warn("cannot override language handler %s",b):U[b]=a}}function A(a,d){if(!a||!U.hasOwnProperty(a))a=/^\s*=o&&(b+=2);h>=H&&(t+=2)}}finally{if(g)g.style.display=k}}catch(v){V.console&&console.log(v&&v.stack||v)}}var V=window,G=["break,continue,do,else,for,if,return,while"],O=[[G,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],J=[O,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],K=[O,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], +L=[K,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],O=[O,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],M=[G,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +N=[G,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],R=[G,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],G=[G,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Q=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, +S=/\S/,T=t({keywords:[J,L,O,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",M,N,G],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),U={};i(T,["default-code"]);i(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", +/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);i(C([["pln",/^\s+/,r," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,r,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], +["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);i(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);i(t({keywords:J,hashComments:!0,cStyleComments:!0,types:Q}),["c","cc","cpp","cxx","cyc","m"]);i(t({keywords:"null,true,false"}),["json"]);i(t({keywords:L,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Q}), +["cs"]);i(t({keywords:K,cStyleComments:!0}),["java"]);i(t({keywords:G,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);i(t({keywords:M,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);i(t({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);i(t({keywords:N, +hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);i(t({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);i(t({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);i(t({keywords:R,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); +i(C([],[["str",/^[\S\s]+/]]),["regex"]);var X=V.PR={createSimpleLexer:C,registerLangHandler:i,sourceDecorator:t,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,e){var b=document.createElement("div");b.innerHTML="
          "+a+"
          ";b=b.firstChild;e&&z(b,e,!0);D({h:d,j:e,c:b,i:1});return b.innerHTML}, +prettyPrint:e=e=function(a,d){function e(){for(var b=V.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p= a.left && x <= (a.left + a.width) && y >= a.top && y <= (a.top + a.height); + }; + + var isIntersectArea = function(a, b) { + var x1 = Math.max(a.left, b.left), + y1 = Math.max(a.top, b.top), + x2 = Math.min(a.left + a.width, b.left + b.width), + y2 = Math.min(a.top + a.height, b.top + b.height); + + return isPointInner(x1, y1, a) && isPointInner(x2, y2, a) && isPointInner(x1, y1, b) && isPointInner(x2, y2, b); + }; + + // default options + Selectable.DEFAULTS = { + selector: 'li,tr,div', + trigger: '', + selectClass: 'active', + rangeStyle: { + border: '1px solid ' + ($.zui.colorset ? $.zui.colorset.primary : '#3280fc'), + backgroundColor: $.zui.colorset ? (new $.zui.Color($.zui.colorset.primary).fade(20).toCssStr()) : 'rgba(50, 128, 252, 0.2)' + }, + clickBehavior: 'toggle', + ignoreVal: 3, + listenClick: true + // mouseButton: -1 // 0, 1, 2, -1, all, left, right, middle + }; + + // Get and init options + Selectable.prototype.getOptions = function(options) { + this.options = $.extend({}, Selectable.DEFAULTS, this.$.data(), options); + }; + + Selectable.prototype.select = function(elementOrid) { + this.toggle(elementOrid, true); + }; + + Selectable.prototype.unselect = function(elementOrid) { + this.toggle(elementOrid, false); + }; + + Selectable.prototype.toggle = function(elementOrid, isSelect, handle) { + var $element, id, selector = this.options.selector, that = this; + if(elementOrid === undefined) { + this.$.find(selector).each(function() { + that.toggle(this, isSelect); + }); + return; + } else if(typeof elementOrid === 'object') { + $element = $(elementOrid).closest(selector); + id = $element.data('id'); + } else { + id = elementOrid; + $element = that.$.find('.slectable-item[data-id="' + id + '"]'); + } + if($element && $element.length) { + if(!id) { + id = $.zui.uuid(); + $element.attr('data-id', id); + } + if(isSelect === undefined || isSelect === null) { + isSelect = !that.selections[id]; + } + if(!!isSelect !== !!that.selections[id]) { + var handleResult; + if($.isFunction(handle)) { + handleResult = handle(isSelect); + } + if(handleResult !== true) { + that.selections[id] = isSelect ? that.selectOrder++ : false; + that.callEvent(isSelect ? 'select' : 'unselect', {id: id, selections: that.selections, target: $element, selected: that.getSelectedArray()}, that); + } + } + if (that.options.selectClass) { + $element.toggleClass(that.options.selectClass, isSelect); + } + } + }; + + Selectable.prototype.getSelectedArray = function() { + var selected = []; + $.each(this.selections, function(thisId, thisIsSelected) { + if(thisIsSelected) selected.push(thisId); + }); + return selected; + }; + + Selectable.prototype.syncSelectionsFromClass = function() { + var that = this; + var $children = that.$children = that.$.find(that.options.selector); + that.selections = {}; + that.$children.each(function() { + var $item = $(this); + that.selections[$item.data('id')] = $item.hasClass(that.options.selectClass); + }); + }; + + Selectable.prototype._init = function() { + var options = this.options, that = this; + var ignoreVal = options.ignoreVal; + var isIgnoreMove = true; + var eventNamespace = '.' + this.name + '.' + this.id; + var startX, startY, $range, range, x, y, checkRangeCall; + var checkFunc = $.isFunction(options.checkFunc) ? options.checkFunc : null; + var rangeFunc = $.isFunction(options.rangeFunc) ? options.rangeFunc : null; + var isMouseDown = false; + var mouseDownBackEventCall = null; + var mouseDownEventName = 'mousedown' + eventNamespace; + + var checkRange = function() { + if(!range) return; + that.$children.each(function() { + var $item = $(this); + var offset = $item.offset(); + offset.width = $item.outerWidth(); + offset.height = $item.outerHeight(); + var isIntersect = rangeFunc ? rangeFunc.call(this, range, offset) : isIntersectArea(range, offset); + if(checkFunc) { + var result = checkFunc.call(that, { + intersect: isIntersect, + target: $item, + range: range, + targetRange: offset + }); + if(result === true) { + that.select($item); + } else if(result === false) { + that.unselect($item); + } + } else { + if(isIntersect) { + that.select($item); + } else if(!that.multiKey) { + that.unselect($item); + } + } + }); + }; + + var mousemove = function(e) { + if(!isMouseDown) return; + x = e.pageX; + y = e.pageY; + range = { + width: Math.abs(x - startX), + height: Math.abs(y - startY), + left: x > startX ? startX : x, + top: y > startY ? startY : y + }; + + if(isIgnoreMove && range.width < ignoreVal && range.height < ignoreVal) return; + if(!$range) { + $range = $('.selectable-range[data-id="' + that.id + '"]'); + if(!$range.length) { + $range = $('
          ') + .css($.extend({ + zIndex: 1060, + position: 'absolute', + top: startX, + left: startY, + pointerEvents: 'none', + }, that.options.rangeStyle)) + .appendTo($('body')); + } + } + $range.css(range); + clearTimeout(checkRangeCall); + checkRangeCall = setTimeout(checkRange, 10); + isIgnoreMove = false; + }; + + var mouseup = function(e) { + $(document).off(eventNamespace); + clearTimeout(mouseDownBackEventCall); + if(!isMouseDown) return; + isMouseDown = false; + if($range) $range.remove(); + if(!isIgnoreMove) + { + if(range) { + clearTimeout(checkRangeCall); + checkRange(); + range = null; + } + } + that.callEvent('finish', {selections: that.selections, selected: that.getSelectedArray()}); + e.preventDefault(); + }; + + var mousedown = function(e) { + if(isMouseDown) { + return mouseup(e); + } + + var mouseButton = $.zui.getMouseButtonCode(options.mouseButton); + if(mouseButton > -1 && e.button !== mouseButton) { + return; + } + + if(that.altKey || e.which === 3 || that.callEvent('start', e) === false) { + return; + } + + var $children = that.$children = that.$.find(options.selector); + $children.addClass('slectable-item'); + + var clickBehavior = that.multiKey ? 'multi' : options.clickBehavior; + if(clickBehavior === 'single') { + that.unselect(); + } + if (options.listenClick) { + if(clickBehavior === 'multi') { + that.toggle(e.target); + } else if(clickBehavior === 'single') { + that.select(e.target); + } else if(clickBehavior === 'toggle') { + that.toggle(e.target, null, function(isSelect) { + that.unselect(); + }); + } + } + + if(that.callEvent('startDrag', e) === false) { + that.callEvent('finish', {selections: that.selections, selected: that.getSelectedArray()}); + return; + } + + startX = e.pageX; + startY = e.pageY; + + $range = null; + isIgnoreMove = true; + isMouseDown = true; + + $(document).on('mousemove' + eventNamespace, mousemove).on('mouseup' + eventNamespace, mouseup); + mouseDownBackEventCall = setTimeout(function() { + $(document).on(mouseDownEventName, mouseup); + }, 10); + e.preventDefault(); + }; + + var $container = options.container && options.container !== 'default' ? $(options.container) : this.$; + if(options.trigger) { + $container.on(mouseDownEventName, options.trigger, mousedown); + } else { + $container.on(mouseDownEventName, mousedown); + } + + $(document).on('keydown', function(e) { + var code = e.keyCode; + if(code === 17 || code == 91) that.multiKey = code; + else if(code === 18) that.altKey = true; + }).on('keyup', function(e) { + that.multiKey = false; + that.altKey = false; + }); + }; + + // Call event helper + Selectable.prototype.callEvent = function(name, params) { + var event = $.Event(name + '.' + this.name); + this.$.trigger(event, params); + var result = event.result; + var callback = this.options[name]; + if($.isFunction(callback)) { + result = callback.apply(this, $.isArray(params) ? params : [params]); + } + return result; + }; + + // Extense jquery element + $.fn.selectable = function(option) { + return this.each(function() { + var $this = $(this); + var data = $this.data(name); + var options = typeof option == 'object' && option; + + if(!data) $this.data(name, (data = new Selectable(this, options))); + + if(typeof option == 'string') data[option](); + }); + }; + + $.fn.selectable.Constructor = Selectable; + + // Auto call selectable after document load complete + $(function() { + $('[data-ride="selectable"]').selectable(); + }); +}(jQuery)); + diff --git a/src/resources/static/js/lib/zui/lib/selectable/zui.selectable.min.js b/src/resources/static/js/lib/zui/lib/selectable/zui.selectable.min.js new file mode 100644 index 0000000..cd49678 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/selectable/zui.selectable.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: 拖拽选择 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +!function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),s=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(s,l,t)&&n(i,o,e)&&n(s,l,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,s,l=this.options.selector,c=this;if(void 0===e)return void this.$.find(l).each(function(){c.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(l),s=o.data("id")):(s=e,o=c.$.find('.slectable-item[data-id="'+s+'"]')),o&&o.length){if(s||(s=t.zui.uuid(),o.attr("data-id",s)),void 0!==i&&null!==i||(i=!c.selections[s]),!!i!=!!c.selections[s]){var a;t.isFunction(n)&&(a=n(i)),a!==!0&&(c.selections[s]=!!i&&c.selectOrder++,c.callEvent(i?"select":"unselect",{id:s,selections:c.selections,target:o,selected:c.getSelectedArray()},c))}c.options.selectClass&&o.toggleClass(c.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this;e.$children=e.$.find(e.options.selector);e.selections={},e.$children.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,s,l,c,a,r=this.options,u=this,h=r.ignoreVal,d=!0,g="."+this.name+"."+this.id,f=t.isFunction(r.checkFunc)?r.checkFunc:null,p=t.isFunction(r.rangeFunc)?r.rangeFunc:null,v=!1,y=null,m="mousedown"+g,b=function(){s&&u.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=p?p.call(this,s,i):o(s,i);if(f){var l=f.call(u,{intersect:n,target:e,range:s,targetRange:i});l===!0?u.select(e):l===!1&&u.unselect(e)}else n?u.select(e):u.multiKey||u.unselect(e)})},C=function(o){v&&(l=o.pageX,c=o.pageY,s={width:Math.abs(l-e),height:Math.abs(c-i),left:l>e?e:l,top:c>i?i:c},d&&s.width
          ').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},u.options.rangeStyle)).appendTo(t("body")))),n.css(s),clearTimeout(a),a=setTimeout(b,10),d=!1))},$=function(e){t(document).off(g),clearTimeout(y),v&&(v=!1,n&&n.remove(),d||s&&(clearTimeout(a),b(),s=null),u.callEvent("finish",{selections:u.selections,selected:u.getSelectedArray()}),e.preventDefault())},w=function(o){if(v)return $(o);var s=t.zui.getMouseButtonCode(r.mouseButton);if(!(s>-1&&o.button!==s||u.altKey||3===o.which||u.callEvent("start",o)===!1)){var l=u.$children=u.$.find(r.selector);l.addClass("slectable-item");var c=u.multiKey?"multi":r.clickBehavior;if("single"===c&&u.unselect(),r.listenClick&&("multi"===c?u.toggle(o.target):"single"===c?u.select(o.target):"toggle"===c&&u.toggle(o.target,null,function(t){u.unselect()})),u.callEvent("startDrag",o)===!1)return void u.callEvent("finish",{selections:u.selections,selected:u.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,d=!0,v=!0,t(document).on("mousemove"+g,C).on("mouseup"+g,$),y=setTimeout(function(){t(document).on(m,$)},10),o.preventDefault()}},F=r.container&&"default"!==r.container?t(r.container):this.$;r.trigger?F.on(m,r.trigger,w):F.on(m,w),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?u.multiKey=e:18===e&&(u.altKey=!0)}).on("keyup",function(t){u.multiKey=!1,u.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,s=this.options[e];return t.isFunction(s)&&(o=s.apply(this,t.isArray(i)?i:[i])),o},t.fn.selectable=function(n){return this.each(function(){var o=t(this),s=o.data(e),l="object"==typeof n&&n;s||o.data(e,s=new i(this,l)),"string"==typeof n&&s[n]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery); \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/sortable/.pydio b/src/resources/static/js/lib/zui/lib/sortable/.pydio new file mode 100644 index 0000000..212940c --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/sortable/.pydio @@ -0,0 +1 @@ +50235e21-a2ca-4f48-aafd-bc2c368be5dd \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/sortable/zui.sortable.js b/src/resources/static/js/lib/zui/lib/sortable/zui.sortable.js new file mode 100644 index 0000000..798b252 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/sortable/zui.sortable.js @@ -0,0 +1,178 @@ +/*! + * ZUI: 排序 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/* ======================================================================== + * ZUI: sortable.js + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + ++ function($, window, document) { + 'use strict'; + + if(!$.fn.droppable) { + console.error('Sortable requires droppable.js'); + return; + } + + var NAME = 'zui.sortable', + DEFAULTS = { + selector : 'li,div', + dragCssClass : 'invisible', + sortingClass : 'sortable-sorting' + }, + STR_ORDER = 'order'; + + var Sortable = function(element, options) { + var that = this; + that.$ = $(element); + that.options = $.extend({}, DEFAULTS, that.$.data(), options); + that.init(); + }; + + Sortable.DEFAULTS = DEFAULTS; + Sortable.NAME = NAME; + + Sortable.prototype.init = function() { + var that = this, + $root = that.$, + options = that.options, + selector = options.selector, + containerSelector = options.containerSelector, + sortingClass = options.sortingClass, + dragCssClass = options.dragCssClass, + targetSelector = options.targetSelector, + isReverse = options.reverse, + orderChanged; + + var markOrders = function($items) { + $items = $items || that.getItems(1); + var itemsCount = $items.length; + if (itemsCount) { + $items.each(function(itemIndex) { + var itemOrder = isReverse ? itemsCount - itemIndex : itemIndex; + $(this).attr('data-' + STR_ORDER, itemOrder).data(STR_ORDER, itemOrder); + }); + } + }; + + markOrders(); + + $root.droppable({ + handle : options.trigger, + target : targetSelector ? targetSelector : (containerSelector ? (selector + ',' + containerSelector) : selector), + selector : selector, + container : $root, + always : options.always, + flex : true, + lazy : options.lazy, + canMoveHere : options.canMoveHere, + dropToClass : options.dropToClass, + before : options.before, + nested : !!containerSelector, + mouseButton : options.mouseButton, + stopPropagation : options.stopPropagation, + start: function(e) { + if(dragCssClass) e.element.addClass(dragCssClass); + orderChanged = false; + that.trigger('start', e); + }, + drag: function(e) { + $root.addClass(sortingClass); + if(e.isIn) { + var $ele = e.element, + $target = e.target, + isContainer = containerSelector && $target.is(containerSelector); + + if (isContainer) { + if (!$target.children(selector).filter('.dragging').length) { + $target.append($ele); + var $items = that.getItems(1); + markOrders($items); + that.trigger(STR_ORDER, { + list: $items, + element: $ele + }); + } + return; + } + + var eleOrder = $ele.data(STR_ORDER), + targetOrder = $target.data(STR_ORDER); + if(eleOrder === targetOrder) return markOrders($items); + else if(eleOrder > targetOrder) { + $target[isReverse ? 'after' : 'before']($ele); + } else { + $target[isReverse ? 'before' : 'after']($ele); + } + orderChanged = true; + var $items = that.getItems(1); + markOrders($items); + that.trigger(STR_ORDER, { + list: $items, + element: $ele + }); + } + }, + finish: function(e) { + if(dragCssClass && e.element) e.element.removeClass(dragCssClass); + $root.removeClass(sortingClass); + that.trigger('finish', { + list: that.getItems(), + element: e.element, + changed: orderChanged + }); + } + }); + }; + + Sortable.prototype.destroy = function() { + this.$.droppable('destroy'); + this.$.data(NAME, null); + }; + + Sortable.prototype.reset = function() { + this.destroy(); + this.init(); + }; + + Sortable.prototype.getItems = function(onlyElements) { + var $items = this.$.find(this.options.selector).not('.drag-shadow'); + if(!onlyElements) { + return $items.map(function() { + var $item = $(this); + return { + item: $item, + order: $item.data('order') + }; + }); + } + return $items; + }; + + Sortable.prototype.trigger = function(name, params) { + return $.zui.callEvent(this.options[name], params, this); + }; + + $.fn.sortable = function(option) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new Sortable(this, options))); + else if(typeof option == 'object') data.reset(); + + if(typeof option == 'string') data[option](); + }); + }; + + $.fn.sortable.Constructor = Sortable; +}(jQuery, window, document); + diff --git a/src/resources/static/js/lib/zui/lib/sortable/zui.sortable.min.js b/src/resources/static/js/lib/zui/lib/sortable/zui.sortable.min.js new file mode 100644 index 0000000..a1e95b1 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/sortable/zui.sortable.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: 排序 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ ++function(t,e,r){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var o="zui.sortable",n={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},s="order",a=function(e,r){var o=this;o.$=t(e),o.options=t.extend({},n,o.$.data(),r),o.init()};a.DEFAULTS=n,a.NAME=o,a.prototype.init=function(){var e,r=this,o=r.$,n=r.options,a=n.selector,i=n.containerSelector,l=n.sortingClass,d=n.dragCssClass,f=n.targetSelector,c=n.reverse,g=function(e){e=e||r.getItems(1);var o=e.length;o&&e.each(function(e){var r=c?o-e:e;t(this).attr("data-"+s,r).data(s,r)})};g(),o.droppable({handle:n.trigger,target:f?f:i?a+","+i:a,selector:a,container:o,always:n.always,flex:!0,lazy:n.lazy,canMoveHere:n.canMoveHere,dropToClass:n.dropToClass,before:n.before,nested:!!i,mouseButton:n.mouseButton,stopPropagation:n.stopPropagation,start:function(t){d&&t.element.addClass(d),e=!1,r.trigger("start",t)},drag:function(t){if(o.addClass(l),t.isIn){var n=t.element,d=t.target,f=i&&d.is(i);if(f){if(!d.children(a).filter(".dragging").length){d.append(n);var p=r.getItems(1);g(p),r.trigger(s,{list:p,element:n})}return}var u=n.data(s),h=d.data(s);if(u===h)return g(p);u>h?d[c?"after":"before"](n):d[c?"before":"after"](n),e=!0;var p=r.getItems(1);g(p),r.trigger(s,{list:p,element:n})}},finish:function(t){d&&t.element&&t.element.removeClass(d),o.removeClass(l),r.trigger("finish",{list:r.getItems(),element:t.element,changed:e})}})},a.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(o,null)},a.prototype.reset=function(){this.destroy(),this.init()},a.prototype.getItems=function(e){var r=this.$.find(this.options.selector).not(".drag-shadow");return e?r:r.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},a.prototype.trigger=function(e,r){return t.zui.callEvent(this.options[e],r,this)},t.fn.sortable=function(e){return this.each(function(){var r=t(this),n=r.data(o),s="object"==typeof e&&e;n?"object"==typeof e&&n.reset():r.data(o,n=new a(this,s)),"string"==typeof e&&n[e]()})},t.fn.sortable.Constructor=a}(jQuery,window,document); \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/tabs/.pydio b/src/resources/static/js/lib/zui/lib/tabs/.pydio new file mode 100644 index 0000000..68d4f19 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/tabs/.pydio @@ -0,0 +1 @@ +5bd59fa6-d10b-4f2a-a2b7-e2efaea19874 \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.css b/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.css new file mode 100644 index 0000000..b867823 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.css @@ -0,0 +1,146 @@ +/*! + * ZUI: 标签页管理器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +.tabs { + position: relative; + min-height: 400px; + } +.tabs-navbar { + padding: 4px 4px 0 4px; + } +.tabs-nav { + height: 30px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border-bottom: none; + border-bottom: 1px solid #ddd; + } +.tab-nav-item { + width: 160px; + min-width: 0; + max-width: 160px; + padding-right: 2px; + margin-bottom: 0; + border: none; + } +.tab-nav-item:hover { + min-width: 95px; + } +.tab-nav-link { + position: relative; + height: 30px; + margin: 0; + overflow: hidden; + background-color: rgba(255, 255, 255, .65); + background-color: #e5e5e5; + border-color: #ddd; + border-bottom: none; + border-radius: 2px 2px 0 0; + } +.tab-nav-link > .title { + position: absolute; + top: 5px; + right: 5px; + left: 30px; + display: block; + overflow: hidden; + font-size: 14px; + line-height: 20px; + text-overflow: ellipsis; + white-space: nowrap; + } +.tab-nav-link > .icon { + position: absolute; + top: 5px; + left: 5px; + display: block; + width: 20px; + height: 20px; + line-height: 20px; + text-align: center; + opacity: .8; + } +.tab-nav-item.loading .tab-nav-link > .icon:before { + content: '\e97b'; + -webkit-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; + } +.tab-nav-link > .close { + position: absolute; + top: 5px; + right: 5px; + width: 20px; + height: 20px; + font-weight: 200; + line-height: 16px; + text-align: center; + text-shadow: none; + visibility: hidden; + border-radius: 4px; + opacity: 0; + -webkit-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; + } +.tab-nav-link > .close:hover { + color: #fff; + background-color: #ea644a; + } +.tab-nav-link:hover > .title { + right: 25px; + } +.tab-nav-link:hover > .close { + visibility: visible; + opacity: 1; + } +.tab-nav-link.not-closable > .close { + display: none; + } +.nav-tabs.tabs-nav > li > a, +.nav-tabs.tabs-nav > li > a:hover, +.nav-tabs.tabs-nav > li > a:focus { + border-color: #ddd #ddd transparent #ddd; + } +.tab-nav-condensed .tab-nav-link > .title { + left: 5px; + text-overflow: initial; + } +.tab-nav-condensed .tab-nav-link > .icon { + display: none; + } +.tabs-container { + position: absolute; + top: 34px; + right: 0; + bottom: 0; + left: 0; + } +.tabs-container > .tab-pane { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + display: none; + } +.tabs-container > .tab-pane.active { + display: block; + } +.tab-iframe-cover { + display: none; + } +.tabs-show-contextmenu .tab-iframe-cover { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + display: block; + } diff --git a/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.js b/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.js new file mode 100644 index 0000000..b0fd0c8 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.js @@ -0,0 +1,488 @@ +/*! + * ZUI: 标签页管理器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/* ======================================================================== + * ZUI: tabs.js + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2017-2018 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + +(function($) { + 'use strict'; + + /** + * Tab object + * @param {Object | String} tab + */ + var Tab = function(tab) { + var that = this; + if(typeof tab === 'string') { + that.url = tab; + } else if($.isPlainObject(tab)) { + $.extend(that, tab); + } + if(!that.id) { + that.id = $.zui.uuid(); + } + if(!that.type) { + if(that.iframe) { + that.type = 'iframe'; + that.url = that.url || that.iframe; + } else if(that.ajax) { + that.type = 'ajax'; + that.url = that.url || ($.isPlainObject(that.ajax) ? that.ajax.url : that.ajax); + } else if(that.url) { + that.type = tab.ajax ? 'ajax' : 'iframe'; + } else { + that.type = 'custom'; + } + } + that.createTime = new Date().getTime(); + that.openTime = 0; + that.onCreate && that.onCreate.call(that); + }; + + Tab.prototype.open = function() { + var that = this; + that.openTime = new Date().getTime(); + that.onOpen && that.onOpen.call(that); + }; + + Tab.prototype.close = function() { + var that = this; + that.openTime = 0; + that.onClose && that.onClose.call(that); + }; + + Tab.create = function(data) { + if (data instanceof Tab) { + return data; + } + return new Tab(data); + }; + + var NAME = 'zui.tabs'; // model name + var DEFAULTS = { + tabs: [], + defaultTabIcon: 'icon-window', + contextMenu: true, + errorTemplate: '
          {0}
          ', + // messagerOptions: null, + showMessage: true, + navTemplate: '', + containerTemplate: '
          ' + }; + + var LANG = { + zh_cn: { + reload: '重新加载', + close: '关闭', + closeOthers: '关闭其他标签页', + closeRight: '关闭右侧标签页', + reopenLast: '恢复上次关闭的标签页', + errorCannotFetchFromRemote: '无法从远程服务器({0})获取内容。' + }, + zh_tw: { + reload: '重新加載', + close: '關閉', + closeOthers: '關閉其他標籤頁', + closeRight: '關閉右側標籤頁', + reopenLast: '恢復上次關閉的標籤頁', + errorCannotFetchFromRemote: '無法從遠程服務器({0})獲取內容。' + }, + en: { + reload: 'Reload', + close: 'Close', + closeOthers: 'Close others', + closeRight: 'Close right', + reopenLast: 'Reopen last', + errorCannotFetchFromRemote: 'Cannot fetch data from remote server {0}.' + } + }; + + // The tabs model class + var Tabs = function(element, options) { + var that = this; + that.name = NAME; + that.$ = $(element); + + options = that.options = $.extend({}, DEFAULTS, this.$.data(), options); + var lang = options.lang || 'zh_cn'; + that.lang = $.isPlainObject(lang) ? ($.extend(true, {}, LANG[lang.lang || $.zui.clientLang()], lang)) : LANG[lang]; + + // Initialize here + var $navbar = that.$.find('.tabs-navbar'); + if (!$navbar.length) { + $navbar = $(options.navTemplate).appendTo(that.$); + } + that.$navbar = $navbar; + + var $nav = $navbar.find('.tabs-nav'); + if (!$nav.length) { + $nav = $('').appendTo($navbar); + } + that.$nav = $nav; + + var $tabs = that.$.find('.tabs-container'); + if (!$tabs.length) { + $tabs = $(options.containerTemplate).appendTo(that.$); + } + that.$tabs = $tabs; + + that.activeTabId = options.defaultTab; + var tabs = options.tabs || []; + that.tabs = {}; + $.each(tabs, function(index, item) { + var tab = Tab.create(item); + that.tabs[tab.id] = tab; + + if (!that.activeTabId) { + that.activeTabId = tab.id; + } + + that.renderTab(tab); + }); + that.closedTabs = []; + + that.open(that.getActiveTab()); + + $nav.on('click.' + NAME, '.tab-nav-link', function () { + that.open(that.getTab($(this).data('id'))); + }).on('click.' + NAME, '.tab-nav-close', function (e) { + that.close($(this).closest('.tab-nav-link').data('id')); + e.stopPropagation(); + }).on('resize.' + NAME, function () { + that.adjustNavs(); + }); + + if (options.contextMenu) { + $nav.contextmenu({ + selector: '.tab-nav-link', + itemsCreator: function (e) { + return that.createMenuItems(that.getTab($(this).data('id'))); + }, + onShow: function () { + that.$.addClass('tabs-show-contextmenu'); + }, + onHide: function () { + that.$.removeClass('tabs-show-contextmenu'); + } + }); + } + }; + + Tabs.prototype.createMenuItems = function (tab) { + var that = this; + var lang = that.lang; + return [{ + label: lang.reload, + onClick: function () { + that.open(tab, true); + } + }, '-', { + label: lang.close, + disabled: tab.forbidClose, + onClick: function () { + that.close(tab.id); + } + }, { + label: lang.closeOthers, + disabled: that.$nav.find('.tab-nav-item:not(.hidden)').length <= 1, + onClick: function () { + that.closeOthers(tab.id); + } + }, { + label: lang.closeRight, + disabled: !$('#tab-nav-item-' + tab.id).next('.tab-nav-item:not(.hidden)').length, + onClick: function () { + that.closeRight(tab.id); + } + }, '-', { + label: lang.reopenLast, + disabled: !that.closedTabs.length, + onClick: function () { + that.reopen(); + } + }]; + }; + + Tabs.prototype.adjustNavs = function (immediately) { + var that = this; + if (!immediately) { + if (that.adjustNavsTimer) { + clearTimeout(that.adjustNavsTimer); + } + that.adjustNavsTimer = setTimeout(function() { + that.adjustNavs(true); + }, 50); + return; + } + if (that.adjustNavsTimer) { + that.adjustNavsTimer = null; + } + var $nav = that.$nav; + var $navItems = $nav.find('.tab-nav-item:not(.hidden)'); + var totalWidth = $nav.width(); + var totalCount = $navItems.length; + var maxWidth = Math.floor(totalWidth/totalCount); + if(maxWidth < 96) { + maxWidth = Math.floor((totalWidth-96)/(totalCount-1)) + } + $nav.toggleClass('tab-nav-condensed', maxWidth <= 50); + $navItems.css('max-width', maxWidth); + }; + + Tabs.prototype.renderTab = function(tab, beforeTabId) { + var that = this; + var $nav = that.$nav; + var $tabNav = $('#tab-nav-item-' + tab.id); + if (!$tabNav.length) { + var $a = $('
          ×').attr({ + href: '#tabs-item-' + tab.id, + 'data-id': tab.id + }); + $tabNav = $('
        • ').append($a).appendTo(that.$nav); + if (beforeTabId) { + var $before$nav = $('#tab-nav-item-' + beforeTabId); + if ($before$nav.length) { + $tabNav.insertAfter($before$nav); + } + } + that.adjustNavs(); + } + var $a = $tabNav.find('a').attr('title', tab.desc).toggleClass('not-closable', !!tab.forbidClose); + $a.find('.icon').attr('class', 'icon ' + (tab.icon || that.options.defaultTabIcon)); + $a.find('.title').text(tab.title || tab.defaultTitle || ''); + return $tabNav; + }; + + Tabs.prototype.getActiveTab = function() { + var that = this; + return that.activeTabId ? that.tabs[that.activeTabId] : null; + }; + + Tabs.prototype.getTab = function(tabId) { + var that = this; + if (!tabId) { + return that.getActiveTab(); + } + if (typeof tabId === 'object') { + tabId = tabId.id; + } + return that.tabs[tabId]; + }; + + Tabs.prototype.close = function(tabId, forceClose) { + var that = this; + var tab = that.getTab(tabId); + if (tab && (forceClose || !tab.forbidClose)) { + $('#tab-nav-item-' + tab.id).remove(); + $('#tab-' + tab.id).remove(); + tab.close(); + delete that.tabs[tab.id]; + that.closedTabs.push(tab); + that.$.callComEvent(that, 'onClose', tab); + + var lastTab; + $.each(that.tabs, function (tabId, tab) { + if (!lastTab || lastTab.openTime < tab.openTime) { + lastTab = tab; + } + }); + lastTab && that.open(lastTab); + } + }; + + Tabs.prototype.open = function(tab, forceReload) { + var that = this; + + if (!(tab instanceof Tab)) { + tab = Tab.create(tab); + } + + var $tabNav = that.renderTab(tab); + that.$nav.find('.tab-nav-item.active').removeClass('active'); + $tabNav.addClass('active'); + + var $tabPane = $('#tab-' + tab.id); + if (!$tabPane.length) { + $tabPane = $('
          ').appendTo(that.$tabs); + } + that.$tabs.find('.tab-pane.active').removeClass('active'); + $tabPane.addClass('active'); + + tab.open(); + that.activeTabId = tab.id; + that.tabs[tab.id] = tab; + + if (forceReload || !tab.loaded) { + that.reload(tab); + } + + that.$.callComEvent(that, 'onOpen', tab); + }; + + Tabs.prototype.showMessage = function (message, type) { + $.zui.messager.show(message, $.extend({ + placement: 'center' + }, this.options.messagerOptions, { + type: type + })); + }; + + Tabs.prototype.reload = function(tab) { + var that = this; + + if (typeof tab === 'string') { + tab = that.getTab(tab); + } else if (!tab) { + tab = that.getActiveTab(); + } + + if (!tab) { + return; + } + + if (!tab.openTime) { + return that.open(tab); + } + + var $tabNav = $('#tab-nav-item-' + tab.id).addClass('loading').removeClass('has-error'); + var $tabPane = $('#tab-' + tab.id).addClass('loading').removeClass('has-error'); + var afterRefresh = function (content, error) { + if (!tab.openTime) { + return; + } + $tabNav.removeClass('loading'); + $tabPane.removeClass('loading'); + that.$.callComEvent(that, 'onLoad', tab); + if(typeof content === 'string' || content instanceof $) { + if (tab.contentConverter) { + content = tab.contentConverter(content, tab); + } + $tabPane.empty().append(content); + if (!tab.title) { + content = $tabPane.text().replace(/\n/g, ''); + tab.title = content.length > 10 ? content.substr(0, 10) : content; + that.renderTab(tab); + } + } + if (error) { + $tabNav.addClass('has-error'); + $tabPane.addClass('has-error'); + var showMessage = that.options.showMessage; + if (showMessage) { + if ($.isFunction(showMessage)) { + error = showMessage(error); + } + that.showMessage(error, 'danger'); + } + if (!content) { + $tabPane.html(that.options.errorTemplate.format(error)); + } + } + tab.loaded = new Date().getTime(); + }; + if (tab.type === 'ajax') { + var ajaxOption = { + type: 'get', + url: tab.url, + error: function(jqXHR, textStatus, errorThrown) { + afterRefresh(false, that.lang.errorCannotFetchFromRemote.format(tab.url)); + }, + success: function(data) { + afterRefresh(data); + } + }; + if($.isPlainObject(tab.ajax)) { + ajaxOption = $.extend(ajaxOption, tab.ajax); + } + $.ajax(ajaxOption); + } else if (tab.type === 'iframe') { + try { + var iframeName = 'tab-iframe-' + tab.id; + var $iframe = $(''); + $iframe.appendTo($tabPane.empty()); + $('
          ').appendTo($tabPane); + var frame = document.getElementById(iframeName); + frame.onload = frame.onreadystatechange = function() { + if(this.readyState && this.readyState != 'complete') return; + afterRefresh(); + var contentDocument = frame.contentDocument; + if (contentDocument && !tab.title) { + tab.title = contentDocument.title; + that.renderTab(tab); + } + }; + } catch (e) { + afterRefresh(); + } + } else { + var content = tab.content || tab.custom; + if (typeof content === 'function') { + content = content(tab, afterRefresh, that); + if (content !== true) { + afterRefresh(content); + } + } else { + afterRefresh(content); + } + } + }; + + Tabs.prototype.closeOthers = function(tabId) { + var that = this; + that.$nav.find('.tab-nav-link:not(.hidden)').each(function() { + var thisTabId = $(this).data('id'); + if (thisTabId !== tabId) { + that.close(thisTabId); + } + }); + }; + + Tabs.prototype.closeRight = function(tabId) { + var $tabNav = $('#tab-nav-item-' + tabId); + var $rightNav = $tabNav.next('.tab-nav-item:not(.hidden)'); + while ($rightNav.length) { + this.close($rightNav.data('id')); + $rightNav = $tabNav.next('.tab-nav-item:not(.hidden)'); + } + }; + + Tabs.prototype.closeAll = function() { + var that = this; + that.$nav.find('.tab-nav-link:not(.hidden)').each(function() { + that.close($(this).data('id')); + }); + }; + + Tabs.prototype.reopen = function() { + var that = this; + if(that.closedTabs.length) { + that.open(that.closedTabs.pop(), true); + } + }; + + // Extense jquery element + $.fn.tabs = function(option) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new Tabs(this, options))); + + if(typeof option == 'string') data[option](); + }); + }; + + Tabs.NAME = NAME; + $.fn.tabs.Constructor = Tabs; +}(jQuery)); + diff --git a/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.css b/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.css new file mode 100644 index 0000000..7a81ed5 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.css @@ -0,0 +1,6 @@ +/*! + * ZUI: 标签页管理器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */.tabs{position:relative;min-height:400px}.tabs-navbar{padding:4px 4px 0 4px}.tabs-nav{height:30px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-bottom:none;border-bottom:1px solid #ddd}.tab-nav-item{width:160px;min-width:0;max-width:160px;padding-right:2px;margin-bottom:0;border:none}.tab-nav-item:hover{min-width:95px}.tab-nav-link{position:relative;height:30px;margin:0;overflow:hidden;background-color:rgba(255,255,255,.65);background-color:#e5e5e5;border-color:#ddd;border-bottom:none;border-radius:2px 2px 0 0}.tab-nav-link>.title{position:absolute;top:5px;right:5px;left:30px;display:block;overflow:hidden;font-size:14px;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.tab-nav-link>.icon{position:absolute;top:5px;left:5px;display:block;width:20px;height:20px;line-height:20px;text-align:center;opacity:.8}.tab-nav-item.loading .tab-nav-link>.icon:before{content:'\e97b';-webkit-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}.tab-nav-link>.close{position:absolute;top:5px;right:5px;width:20px;height:20px;font-weight:200;line-height:16px;text-align:center;text-shadow:none;visibility:hidden;border-radius:4px;opacity:0;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s}.tab-nav-link>.close:hover{color:#fff;background-color:#ea644a}.tab-nav-link:hover>.title{right:25px}.tab-nav-link:hover>.close{visibility:visible;opacity:1}.tab-nav-link.not-closable>.close{display:none}.nav-tabs.tabs-nav>li>a,.nav-tabs.tabs-nav>li>a:focus,.nav-tabs.tabs-nav>li>a:hover{border-color:#ddd #ddd transparent #ddd}.tab-nav-condensed .tab-nav-link>.title{left:5px;text-overflow:initial}.tab-nav-condensed .tab-nav-link>.icon{display:none}.tabs-container{position:absolute;top:34px;right:0;bottom:0;left:0}.tabs-container>.tab-pane{position:absolute;top:0;right:0;bottom:0;left:0;display:none}.tabs-container>.tab-pane.active{display:block}.tab-iframe-cover{display:none}.tabs-show-contextmenu .tab-iframe-cover{position:absolute;top:0;right:0;bottom:0;left:0;display:block} \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.js b/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.js new file mode 100644 index 0000000..fbd6029 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/tabs/zui.tabs.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: 标签页管理器 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +!function(e){"use strict";var t=function(t){var a=this;"string"==typeof t?a.url=t:e.isPlainObject(t)&&e.extend(a,t),a.id||(a.id=e.zui.uuid()),a.type||(a.iframe?(a.type="iframe",a.url=a.url||a.iframe):a.ajax?(a.type="ajax",a.url=a.url||(e.isPlainObject(a.ajax)?a.ajax.url:a.ajax)):a.url?a.type=t.ajax?"ajax":"iframe":a.type="custom"),a.createTime=(new Date).getTime(),a.openTime=0,a.onCreate&&a.onCreate.call(a)};t.prototype.open=function(){var e=this;e.openTime=(new Date).getTime(),e.onOpen&&e.onOpen.call(e)},t.prototype.close=function(){var e=this;e.openTime=0,e.onClose&&e.onClose.call(e)},t.create=function(e){return e instanceof t?e:new t(e)};var a="zui.tabs",n={tabs:[],defaultTabIcon:"icon-window",contextMenu:!0,errorTemplate:'
          {0}
          ',showMessage:!0,navTemplate:'',containerTemplate:'
          '},o={zh_cn:{reload:"重新加载",close:"关闭",closeOthers:"关闭其他标签页",closeRight:"关闭右侧标签页",reopenLast:"恢复上次关闭的标签页",errorCannotFetchFromRemote:"无法从远程服务器({0})获取内容。"},zh_tw:{reload:"重新加載",close:"關閉",closeOthers:"關閉其他標籤頁",closeRight:"關閉右側標籤頁",reopenLast:"恢復上次關閉的標籤頁",errorCannotFetchFromRemote:"無法從遠程服務器({0})獲取內容。"},en:{reload:"Reload",close:"Close",closeOthers:"Close others",closeRight:"Close right",reopenLast:"Reopen last",errorCannotFetchFromRemote:"Cannot fetch data from remote server {0}."}},i=function(i,s){var r=this;r.name=a,r.$=e(i),s=r.options=e.extend({},n,this.$.data(),s);var l=s.lang||"zh_cn";r.lang=e.isPlainObject(l)?e.extend(!0,{},o[l.lang||e.zui.clientLang()],l):o[l];var c=r.$.find(".tabs-navbar");c.length||(c=e(s.navTemplate).appendTo(r.$)),r.$navbar=c;var d=c.find(".tabs-nav");d.length||(d=e('').appendTo(c)),r.$nav=d;var v=r.$.find(".tabs-container");v.length||(v=e(s.containerTemplate).appendTo(r.$)),r.$tabs=v,r.activeTabId=s.defaultTab;var p=s.tabs||[];r.tabs={},e.each(p,function(e,a){var n=t.create(a);r.tabs[n.id]=n,r.activeTabId||(r.activeTabId=n.id),r.renderTab(n)}),r.closedTabs=[],r.open(r.getActiveTab()),d.on("click."+a,".tab-nav-link",function(){r.open(r.getTab(e(this).data("id")))}).on("click."+a,".tab-nav-close",function(t){r.close(e(this).closest(".tab-nav-link").data("id")),t.stopPropagation()}).on("resize."+a,function(){r.adjustNavs()}),s.contextMenu&&d.contextmenu({selector:".tab-nav-link",itemsCreator:function(t){return r.createMenuItems(r.getTab(e(this).data("id")))},onShow:function(){r.$.addClass("tabs-show-contextmenu")},onHide:function(){r.$.removeClass("tabs-show-contextmenu")}})};i.prototype.createMenuItems=function(t){var a=this,n=a.lang;return[{label:n.reload,onClick:function(){a.open(t,!0)}},"-",{label:n.close,disabled:t.forbidClose,onClick:function(){a.close(t.id)}},{label:n.closeOthers,disabled:a.$nav.find(".tab-nav-item:not(.hidden)").length<=1,onClick:function(){a.closeOthers(t.id)}},{label:n.closeRight,disabled:!e("#tab-nav-item-"+t.id).next(".tab-nav-item:not(.hidden)").length,onClick:function(){a.closeRight(t.id)}},"-",{label:n.reopenLast,disabled:!a.closedTabs.length,onClick:function(){a.reopen()}}]},i.prototype.adjustNavs=function(e){var t=this;if(!e)return t.adjustNavsTimer&&clearTimeout(t.adjustNavsTimer),void(t.adjustNavsTimer=setTimeout(function(){t.adjustNavs(!0)},50));t.adjustNavsTimer&&(t.adjustNavsTimer=null);var a=t.$nav,n=a.find(".tab-nav-item:not(.hidden)"),o=a.width(),i=n.length,s=Math.floor(o/i);s<96&&(s=Math.floor((o-96)/(i-1))),a.toggleClass("tab-nav-condensed",s<=50),n.css("max-width",s)},i.prototype.renderTab=function(t,a){var n=this,o=(n.$nav,e("#tab-nav-item-"+t.id));if(!o.length){var i=e('×').attr({href:"#tabs-item-"+t.id,"data-id":t.id});if(o=e('
        • ').append(i).appendTo(n.$nav),a){var s=e("#tab-nav-item-"+a);s.length&&o.insertAfter(s)}n.adjustNavs()}var i=o.find("a").attr("title",t.desc).toggleClass("not-closable",!!t.forbidClose);return i.find(".icon").attr("class","icon "+(t.icon||n.options.defaultTabIcon)),i.find(".title").text(t.title||t.defaultTitle||""),o},i.prototype.getActiveTab=function(){var e=this;return e.activeTabId?e.tabs[e.activeTabId]:null},i.prototype.getTab=function(e){var t=this;return e?("object"==typeof e&&(e=e.id),t.tabs[e]):t.getActiveTab()},i.prototype.close=function(t,a){var n=this,o=n.getTab(t);if(o&&(a||!o.forbidClose)){e("#tab-nav-item-"+o.id).remove(),e("#tab-"+o.id).remove(),o.close(),delete n.tabs[o.id],n.closedTabs.push(o),n.$.callComEvent(n,"onClose",o);var i;e.each(n.tabs,function(e,t){(!i||i.openTime').appendTo(o.$tabs)),o.$tabs.find(".tab-pane.active").removeClass("active"),s.addClass("active"),a.open(),o.activeTabId=a.id,o.tabs[a.id]=a,!n&&a.loaded||o.reload(a),o.$.callComEvent(o,"onOpen",a)},i.prototype.showMessage=function(t,a){e.zui.messager.show(t,e.extend({placement:"center"},this.options.messagerOptions,{type:a}))},i.prototype.reload=function(t){var a=this;if("string"==typeof t?t=a.getTab(t):t||(t=a.getActiveTab()),t){if(!t.openTime)return a.open(t);var n=e("#tab-nav-item-"+t.id).addClass("loading").removeClass("has-error"),o=e("#tab-"+t.id).addClass("loading").removeClass("has-error"),i=function(i,s){if(t.openTime){if(n.removeClass("loading"),o.removeClass("loading"),a.$.callComEvent(a,"onLoad",t),("string"==typeof i||i instanceof e)&&(t.contentConverter&&(i=t.contentConverter(i,t)),o.empty().append(i),t.title||(i=o.text().replace(/\n/g,""),t.title=i.length>10?i.substr(0,10):i,a.renderTab(t))),s){n.addClass("has-error"),o.addClass("has-error");var r=a.options.showMessage;r&&(e.isFunction(r)&&(s=r(s)),a.showMessage(s,"danger")),i||o.html(a.options.errorTemplate.format(s))}t.loaded=(new Date).getTime()}};if("ajax"===t.type){var s={type:"get",url:t.url,error:function(e,n,o){i(!1,a.lang.errorCannotFetchFromRemote.format(t.url))},success:function(e){i(e)}};e.isPlainObject(t.ajax)&&(s=e.extend(s,t.ajax)),e.ajax(s)}else if("iframe"===t.type)try{var r="tab-iframe-"+t.id,l=e('');l.appendTo(o.empty()),e('
          ').appendTo(o);var c=document.getElementById(r);c.onload=c.onreadystatechange=function(){if(!this.readyState||"complete"==this.readyState){i();var e=c.contentDocument;e&&!t.title&&(t.title=e.title,a.renderTab(t))}}}catch(d){i()}else{var v=t.content||t.custom;"function"==typeof v?(v=v(t,i,a),v!==!0&&i(v)):i(v)}}},i.prototype.closeOthers=function(t){var a=this;a.$nav.find(".tab-nav-link:not(.hidden)").each(function(){var n=e(this).data("id");n!==t&&a.close(n)})},i.prototype.closeRight=function(t){for(var a=e("#tab-nav-item-"+t),n=a.next(".tab-nav-item:not(.hidden)");n.length;)this.close(n.data("id")),n=a.next(".tab-nav-item:not(.hidden)")},i.prototype.closeAll=function(){var t=this;t.$nav.find(".tab-nav-link:not(.hidden)").each(function(){t.close(e(this).data("id"))})},i.prototype.reopen=function(){var e=this;e.closedTabs.length&&e.open(e.closedTabs.pop(),!0)},e.fn.tabs=function(t){return this.each(function(){var n=e(this),o=n.data(a),s="object"==typeof t&&t;o||n.data(a,o=new i(this,s)),"string"==typeof t&&o[t]()})},i.NAME=a,e.fn.tabs.Constructor=i}(jQuery); \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/treemap/.pydio b/src/resources/static/js/lib/zui/lib/treemap/.pydio new file mode 100644 index 0000000..a0fcc73 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/treemap/.pydio @@ -0,0 +1 @@ +56882ff0-af2a-4afc-b33a-2fdb1955fada \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.css b/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.css new file mode 100644 index 0000000..dccc4eb --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.css @@ -0,0 +1,120 @@ +/*! + * ZUI: 树形图 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +.treemap-data { + text-align: left; + } +.treemap-nodes { + position: relative; + display: table; + padding: 10px; + margin-right: auto; + margin-left: auto; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + } +.treemap-node { + display: table-cell; + vertical-align: top; + } +.treemap-node-wrapper { + position: relative; + z-index: 5; + display: inline-block; + padding: 5px 10px; + border: 1px solid #808080; + border-radius: 1px; + } +a.treemap-node-wrapper { + color: #353535; + cursor: pointer; + } +a.treemap-node-wrapper:active, +a.treemap-node-wrapper:focus, +a.treemap-node-wrapper:hover { + color: #3280fc; + text-decoration: none; + background-color: #ebf2f9; + border-color: #3280fc; + } +.treemap-node-root > .treemap-node-wrapper { + background-color: rgba(0, 0, 0, .1); + } +.treemap-node-children { + display: table; + margin-top: 20px auto 0; + } +.treemap-line-top, +.treemap-line-bottom { + position: absolute; + top: 100%; + left: 50%; + margin-left: -1px; + border-right: none!important; + border-bottom: none!important; + } +.treemap-line-top { + top: 0; + } +.treemap-node > .treemap-line { + position: absolute; + right: 0; + left: 0; + z-index: 1; + border-right: none!important; + border-bottom: none!important; + } +.treemap-node-fold-icon { + position: absolute; + top: -6px; + left: -5px; + z-index: 10; + display: block!important; + width: 10px; + height: 10px; + line-height: 10px; + color: #808080; + background-color: #fff; + border-radius: 5px; + opacity: 0; + -webkit-transition: opacity .2s, -webkit-transform .1s; + -o-transition: opacity .2s, -o-transform .1s; + transition: opacity .2s, -webkit-transform .1s; + transition: opacity .2s, transform .1s; + transition: opacity .2s, transform .1s, -webkit-transform .1s, -o-transform .1s; + } +.treemap-node-fold-icon:before { + min-width: 10px; + content: '\e6f2'; + } +.treemap-node-wrapper:hover .treemap-node-fold-icon { + opacity: 1; + } +.treemap-node.collapsed > .treemap-line, +.treemap-node.collapsed .treemap-line-bottom { + border-color: transparent!important; + } +.treemap-node.collapsed > .treemap-node-children { + display: none; + } +.treemap-node.collapsed .treemap-node-fold-icon { + top: -6px; + color: #808080; + opacity: 1; + -webkit-transform: none!important; + -ms-transform: none!important; + -o-transform: none!important; + transform: none!important; + } +.treemap-node.collapsed .treemap-node-fold-icon:before { + content: '\e6f1'; + } +.treemap-node.tree-node-collapsing > .treemap-line, +.treemap-node.tree-node-collapsing > .treemap-node-children { + visibility: hidden; + } diff --git a/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.js b/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.js new file mode 100644 index 0000000..bbbd58e --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.js @@ -0,0 +1,415 @@ +/*! + * ZUI: 树形图 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/* ======================================================================== + * ZUI: treemap.js + * http://zui.sexy + * ======================================================================== + * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT + * ======================================================================== */ + + +// Tree map data format +// { +// text: main text, +// html: main text as html format +// style: node style, +// textColor: text color, +// color: background color +// border: border style, +// cableWidth: 2, +// cableColor: '#808080' +// cableStyle: 'solid' +// } + + +(function($, window, document, Math, undefined) { + 'use strict'; + + var NAME = 'zui.treemap', + DEFAULTS = { + data: [], + // direction: 'bottom', // or 'top', 'left', 'right' + cableWidth: 1, + cableColor: '#808080', + cableStyle: 'solid', + rowSpace: 30, + nodeSpace: 20, + listenNodeResize: true, + nodeTemplate: '
          ', + foldable: true, + clickNodeToFold: true, + // sort: false, // Boolean or function + // tooltip: null, + // nodeStyle: null, + }; + // var DEFAULT_NODE = { + // id: uuid(), // uuid + // text: '', // main text, + // html: '', // main text as html format + // style: null, // node element style + // textColor: '', // text color + // color: '', // background color + // border: '', // border style, + // tooltip: '' // node caption + // attrs: null // attrs + // title: '' // node title + // tooltip: '' // node tooltip + // }; + + var getDataFromUlList = function($list) { + return $list.children('li,.treemap-data-item').map(function() { + var $item = $(this), + item = $item.data(), + $text = $item.children('.text'), + $html = $item.children('.content'), + $children = $item.children('ul,.treemap-data-list'); + if($text.length) item.text = $text.text(); + if($html.length) item.html = $html.html(); + if($children.length) { + item.children = getDataFromUlList($children); + } + if(!item.text && !item.html) { + var $content = $item.children(':not(ul,.treemap-data-list)'); + var $itemClone = $item.clone(); + $itemClone.find('ul,.treemap-data-list').remove(); + if(!$content.length) { + item.text = $itemClone.text(); + } else { + item.html = $itemClone.html(); + } + } + return item; + }).get(); + }; + + var Treemap = function(element, options) { + var $element = $(element); + if($.isArray(options)) { + options = {data: options}; + } + options = $.extend({}, DEFAULTS, $element.data(), options); + + var data = options.data || []; + if(!data.length) { + var $dataList = $element.children('.treemap-data'); + if($dataList.length) { + data = getDataFromUlList($dataList.hide()); + } + } + + var $nodes = $element.children('.treemap-nodes'); + if(!$nodes.length) { + $nodes = $('
          ').appendTo($element); + } + + var that = this; + that.$ = $element; + that.$nodes = $nodes; + that.data = $.isArray(data) ? data : [data]; + that.options = options; + that.offsetX = 0; + that.offsetY = 0; + that.scale = options.scale || 1; + + // Bind events + + that.render(); + + $nodes.on('resize', '.treemap-node-wrapper', function() { + that.delayDrawLines(); + }); + if(options.foldable) { + $nodes.on('click', options.clickNodeToFold ? '.treemap-node-wrapper' : '.treemap-node-fold-icon', function() { + that.toggle($(this).closest('.treemap-node')); + }); + } + + $nodes.on('click', '.treemap-node-wrapper', function() { + var $node = $(this).closest('.treemap-node'); + that.callEvent('onNodeClick', $node.data('node')); + }); + }; + + Treemap.prototype.toggle = function($node, toggle, ignoreAnimation) { + var that = this; + if(typeof $node === 'boolean') { + toggle = $node; + $node = null; + } + if(!$node) { + $node = that.$nodes.children('.treemap-node').first(); + } + if($node) + { + if($node.data('node').foldable === false) { + return; + } + if(toggle === undefined) { + toggle = $node.hasClass('collapsed'); + } + $node.toggleClass('collapsed', !toggle).find('[data-toggle="tooltip"]').tooltip('hide'); + if (!ignoreAnimation) { + $node.addClass('tree-node-collapsing') + } + that.$nodes.find('.tooltip').remove(); + that.drawLines(); + if (!ignoreAnimation) { + $node.removeClass('tree-node-collapsing'); + } else { + clearTimeout(that.toggleTimeTask); + that.toggleTimeTask = setTimeout(function() { + $node.removeClass('tree-node-collapsing'); + }, 200); + } + } + }; + + Treemap.prototype.showLevel = function(level) { + var that = this; + that.$nodes.find('.treemap-node').each(function() { + var $node = $(this); + that.toggle($node, $node.data('level') < level, true); + }); + }; + + Treemap.prototype.render = function(data) { + var that = this; + that.data = data ? ($.isArray(data) ? data : [data]) : that.data; + + if(that.data) { + that.createNodes(); + that.drawLines(); + that.delayDrawLines(500); + } + + that.callEvent('afterRender'); + }; + + Treemap.prototype.createNodes = function(nodes, parent, callback) { + var that = this, + options = that.options, + rowSpace = options.rowSpace, + $nodes = that.$nodes; + if(!parent) { + $nodes.find('.treemap-node-wrapper').off('resize.' + NAME); + $nodes.empty(); + } + if(options.sort) { + nodes.sort($.isFunction(options.sort) ? options.sort : function(nodeX, nodeY) { + return (nodeX.order || 0) - (nodeY.order); + }); + } + var lastNode = null; + nodes = nodes || that.data; + if (!parent) { + that.maxLevel = 1; + } + $.each(nodes, function(idx, node) { + if(typeof node === 'string') { + node = {html: node}; + nodes[idx] = node; + } + + if(!node.id) node.id = $.zui.uuid(); + node.level = parent ? (parent.level + 1) : 1; + that.maxLevel = Math.max(that.maxLevel, node.level); + + // Create node element + var isCustomNodeTemplate = $.isFunction(options.nodeTemplate); + var $node = isCustomNodeTemplate ? options.nodeTemplate(node, that) : $(options.nodeTemplate); + + // Create node wrapper element + var $wrapper = $node.find('.treemap-node-wrapper'); + if(!$wrapper.length) { + $wrapper = $('
          ').appendTo($node); + } + + var children = node.children; + var hasChild = children && children.length; + node.isOnlyOneChild = hasChild === 1; + + // Set node data attributes + node.idx = idx; + var row = parent ? (parent.row + 1) : 0; + $node.toggleClass('treemap-node-has-child', !!hasChild) + .toggleClass('treemap-node-has-parent', !!parent) + .toggleClass('treemap-node-one-child', hasChild === 1) + .toggleClass('collapsed', !!node.collapsed && node.collapsed !== 'false') + .toggleClass('treemap-node-root', !row) + .attr({'data-id': node.id, 'data-level': node.level}).data('node', node); + if(node.className) { + $node.addClass(node.className); + } + node.row = row; + + // Set node element attributes and sytle + var style = $.extend({}, options.nodeStyle, node.style); + if(node.textColor) style.color = node.textColor; + if(node.color) style.backgroundColor = node.color; + if(node.border) style.border = node.border; + var attrs = $.extend({}, node.attrs, { + title: node.caption + }); + if(node.tooltip) { + attrs['data-toggle'] = 'tooltip'; + attrs.title = node.tooltip; + } + $wrapper.attr(attrs).css(style); + if(lastNode) { + $node.css('padding-left', options.nodeSpace); + } + if(!isCustomNodeTemplate) { + if(node.html) $wrapper.append(node.html); + else if(node.text) $wrapper.text(node.text); + } + + // append node element to ducument + $node.appendTo(parent ? parent.$children : $nodes); + + // Save sizes + // node.bounds = { + // width : $wrapper.outerWidth(), + // height : $wrapper.outerHeight() + // }; + + if(lastNode) { + lastNode.next = node; + } + node.prev = lastNode; + node.parent = parent; + node.$ = $node; + node.$wrapper = $wrapper; + + // Create children + if(hasChild) { + var $children = $node.find('.treemap-node-children'); + if(!$children.length) { + $children = $('
          ').appendTo($node); + } + $children.css('margin-top', rowSpace); + node.$children = $children; + that.createNodes(children, node); + } + + if(options.listenNodeResize) { + $wrapper.on('resize.' + NAME, function() { + // node.bounds.width = $wrapper.outerWidth(); + // node.bounds.height = $wrapper.outerHeight(); + that.delayDrawLines(); + }); + } + + lastNode = node; + callback && callback($node, node); + }); + + if(!parent) { + // Init tooltip + $nodes.find('[data-toggle="tooltip"]').tooltip(options.tooltip); + } + }; + + Treemap.prototype.delayDrawLines = function(delay) { + var that = this; + clearTimeout(that.delayDrawLinesTask); + that.delayDrawLinesTask = setTimeout(function() { + that.drawLines(); + }, delay || 10); + }; + + Treemap.prototype.drawLines = function(nodes, parent) { + var that = this, + options = that.options, + rowSpace = options.rowSpace; + var cableStyle = {}; + if(options.cableWidth) cableStyle.borderWidth = options.cableWidth; + if(options.cableStyle) cableStyle.borderStyle = options.cableStyle; + if(options.cableColor) cableStyle.borderColor = options.cableColor; + var rowSpaceHalf = Math.round(rowSpace/2); + var nodesOffsetLeft = that.$nodes.offset().left; + $.each(nodes || that.data, function(idx, node) { + var $wrapper = node.$wrapper; + var children = node.children; + var nodeCableStyle = $.extend({ + height: rowSpaceHalf, + top: -rowSpaceHalf - 1, + left: Math.round(($wrapper.outerWidth() - cableStyle.borderWidth)/2), + color: cableStyle.borderColor + }, cableStyle); + if(parent && !parent.isOnlyOneChild) { + var $topLine = $wrapper.find('.treemap-line-top'); + if(!$topLine.length) { + $topLine = $('
          ').appendTo($wrapper); + } + $topLine.css(nodeCableStyle); + } + if(children && children.length) { + nodeCableStyle.top = $wrapper.outerHeight() - 1; + if(node.isOnlyOneChild) { + nodeCableStyle.height = rowSpace; + } + var $bottomLine = $wrapper.find('.treemap-line-bottom'); + if(!$bottomLine.length) { + $bottomLine = $('
          ').appendTo($wrapper); + if(options.foldable) { + $bottomLine.append(''); + } + } + $bottomLine.css(nodeCableStyle); + that.drawLines(children, node); + if(children.length > 1) { + var firstChild = children[0], + lastChild = children[children.length - 1]; + + var $centerLine = node.$.children('.treemap-line'); + if(!$centerLine.length) { + $centerLine = $('
          ').insertAfter($wrapper); + } + var lineLeft = Math.round(firstChild.$wrapper.offset().left - nodesOffsetLeft + firstChild.$wrapper.outerWidth()/2); + $centerLine.css($.extend({ + marginTop: rowSpaceHalf, + left: lineLeft, + width: lastChild.$wrapper.offset().left - nodesOffsetLeft -lineLeft + lastChild.$wrapper.outerWidth()/2 + }, cableStyle)); + } + } + }); + + if(!parent) { + that.callEvent('afterDrawLines'); + } + }; + + // Call event + Treemap.prototype.callEvent = function(name, params) { + var that = this; + if(!$.isArray(params)) params = [params]; + that.$.trigger(name, params); + if($.isFunction(that.options[name])) { + return that.options[name].apply(that, params); + } + }; + + Treemap.DEFAULTS = DEFAULTS; + Treemap.NAME = NAME; + + $.fn.treemap = function(option, param1, parma2) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new Treemap(this, options))); + + if(typeof option == 'string') data[option](param1, parma2); + }); + }; + + $.fn.treemap.Constructor = Treemap; +}(jQuery, window, document, Math, undefined)); + diff --git a/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.css b/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.css new file mode 100644 index 0000000..8922f48 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.css @@ -0,0 +1,6 @@ +/*! + * ZUI: 树形图 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */.treemap-data{text-align:left}.treemap-nodes{position:relative;display:table;padding:10px;margin-right:auto;margin-left:auto;text-align:center;-webkit-user-select:none;-moz-user-select:none}.treemap-node{display:table-cell;vertical-align:top}.treemap-node-wrapper{position:relative;z-index:5;display:inline-block;padding:5px 10px;border:1px solid grey;border-radius:1px}a.treemap-node-wrapper{color:#353535;cursor:pointer}a.treemap-node-wrapper:active,a.treemap-node-wrapper:focus,a.treemap-node-wrapper:hover{color:#3280fc;text-decoration:none;background-color:#ebf2f9;border-color:#3280fc}.treemap-node-root>.treemap-node-wrapper{background-color:rgba(0,0,0,.1)}.treemap-node-children{display:table;margin-top:20px auto 0}.treemap-line-bottom,.treemap-line-top{position:absolute;top:100%;left:50%;margin-left:-1px;border-right:none!important;border-bottom:none!important}.treemap-line-top{top:0}.treemap-node>.treemap-line{position:absolute;right:0;left:0;z-index:1;border-right:none!important;border-bottom:none!important}.treemap-node-fold-icon{position:absolute;top:-6px;left:-5px;z-index:10;display:block!important;width:10px;height:10px;line-height:10px;color:grey;background-color:#fff;border-radius:5px;opacity:0;-webkit-transition:opacity .2s,-webkit-transform .1s;-o-transition:opacity .2s,-o-transform .1s;transition:opacity .2s,-webkit-transform .1s;transition:opacity .2s,transform .1s;transition:opacity .2s,transform .1s,-webkit-transform .1s,-o-transform .1s}.treemap-node-fold-icon:before{min-width:10px;content:'\e6f2'}.treemap-node-wrapper:hover .treemap-node-fold-icon{opacity:1}.treemap-node.collapsed .treemap-line-bottom,.treemap-node.collapsed>.treemap-line{border-color:transparent!important}.treemap-node.collapsed>.treemap-node-children{display:none}.treemap-node.collapsed .treemap-node-fold-icon{top:-6px;color:grey;opacity:1;-webkit-transform:none!important;-ms-transform:none!important;-o-transform:none!important;transform:none!important}.treemap-node.collapsed .treemap-node-fold-icon:before{content:'\e6f1'}.treemap-node.tree-node-collapsing>.treemap-line,.treemap-node.tree-node-collapsing>.treemap-node-children{visibility:hidden} \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.js b/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.js new file mode 100644 index 0000000..7005805 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/treemap/zui.treemap.min.js @@ -0,0 +1,7 @@ +/*! + * ZUI: 树形图 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +!function(e,t,a,o,r){"use strict";var n="zui.treemap",l={data:[],cableWidth:1,cableColor:"#808080",cableStyle:"solid",rowSpace:30,nodeSpace:20,listenNodeResize:!0,nodeTemplate:'
          ',foldable:!0,clickNodeToFold:!0},i=function(t){return t.children("li,.treemap-data-item").map(function(){var t=e(this),a=t.data(),o=t.children(".text"),r=t.children(".content"),n=t.children("ul,.treemap-data-list");if(o.length&&(a.text=o.text()),r.length&&(a.html=r.html()),n.length&&(a.children=i(n)),!a.text&&!a.html){var l=t.children(":not(ul,.treemap-data-list)"),d=t.clone();d.find("ul,.treemap-data-list").remove(),l.length?a.html=d.html():a.text=d.text()}return a}).get()},d=function(t,a){var o=e(t);e.isArray(a)&&(a={data:a}),a=e.extend({},l,o.data(),a);var r=a.data||[];if(!r.length){var n=o.children(".treemap-data");n.length&&(r=i(n.hide()))}var d=o.children(".treemap-nodes");d.length||(d=e('
          ').appendTo(o));var s=this;s.$=o,s.$nodes=d,s.data=e.isArray(r)?r:[r],s.options=a,s.offsetX=0,s.offsetY=0,s.scale=a.scale||1,s.render(),d.on("resize",".treemap-node-wrapper",function(){s.delayDrawLines()}),a.foldable&&d.on("click",a.clickNodeToFold?".treemap-node-wrapper":".treemap-node-fold-icon",function(){s.toggle(e(this).closest(".treemap-node"))}),d.on("click",".treemap-node-wrapper",function(){var t=e(this).closest(".treemap-node");s.callEvent("onNodeClick",t.data("node"))})};d.prototype.toggle=function(e,t,a){var o=this;if("boolean"==typeof e&&(t=e,e=null),e||(e=o.$nodes.children(".treemap-node").first()),e){if(e.data("node").foldable===!1)return;t===r&&(t=e.hasClass("collapsed")),e.toggleClass("collapsed",!t).find('[data-toggle="tooltip"]').tooltip("hide"),a||e.addClass("tree-node-collapsing"),o.$nodes.find(".tooltip").remove(),o.drawLines(),a?(clearTimeout(o.toggleTimeTask),o.toggleTimeTask=setTimeout(function(){e.removeClass("tree-node-collapsing")},200)):e.removeClass("tree-node-collapsing")}},d.prototype.showLevel=function(t){var a=this;a.$nodes.find(".treemap-node").each(function(){var o=e(this);a.toggle(o,o.data("level")').appendTo(m));var v=h.children,u=v&&v.length;h.isOnlyOneChild=1===u,h.idx=c;var w=a?a.row+1:0;m.toggleClass("treemap-node-has-child",!!u).toggleClass("treemap-node-has-parent",!!a).toggleClass("treemap-node-one-child",1===u).toggleClass("collapsed",!!h.collapsed&&"false"!==h.collapsed).toggleClass("treemap-node-root",!w).attr({"data-id":h.id,"data-level":h.level}).data("node",h),h.className&&m.addClass(h.className),h.row=w;var y=e.extend({},i.nodeStyle,h.style);h.textColor&&(y.color=h.textColor),h.color&&(y.backgroundColor=h.color),h.border&&(y.border=h.border);var b=e.extend({},h.attrs,{title:h.caption});if(h.tooltip&&(b["data-toggle"]="tooltip",b.title=h.tooltip),g.attr(b).css(y),p&&m.css("padding-left",i.nodeSpace),f||(h.html?g.append(h.html):h.text&&g.text(h.text)),m.appendTo(a?a.$children:s),p&&(p.next=h),h.prev=p,h.parent=a,h.$=m,h.$wrapper=g,u){var x=m.find(".treemap-node-children");x.length||(x=e('
          ').appendTo(m)),x.css("margin-top",d),h.$children=x,l.createNodes(v,h)}i.listenNodeResize&&g.on("resize."+n,function(){l.delayDrawLines()}),p=h,r&&r(m,h)}),a||s.find('[data-toggle="tooltip"]').tooltip(i.tooltip)},d.prototype.delayDrawLines=function(e){var t=this;clearTimeout(t.delayDrawLinesTask),t.delayDrawLinesTask=setTimeout(function(){t.drawLines()},e||10)},d.prototype.drawLines=function(t,a){var r=this,n=r.options,l=n.rowSpace,i={};n.cableWidth&&(i.borderWidth=n.cableWidth),n.cableStyle&&(i.borderStyle=n.cableStyle),n.cableColor&&(i.borderColor=n.cableColor);var d=o.round(l/2),s=r.$nodes.offset().left;e.each(t||r.data,function(t,p){var c=p.$wrapper,h=p.children,f=e.extend({height:d,top:-d-1,left:o.round((c.outerWidth()-i.borderWidth)/2),color:i.borderColor},i);if(a&&!a.isOnlyOneChild){var m=c.find(".treemap-line-top");m.length||(m=e('
          ').appendTo(c)),m.css(f)}if(h&&h.length){f.top=c.outerHeight()-1,p.isOnlyOneChild&&(f.height=l);var g=c.find(".treemap-line-bottom");if(g.length||(g=e('
          ').appendTo(c),n.foldable&&g.append('')),g.css(f),r.drawLines(h,p),h.length>1){var v=h[0],u=h[h.length-1],w=p.$.children(".treemap-line");w.length||(w=e('
          ').insertAfter(c));var y=o.round(v.$wrapper.offset().left-s+v.$wrapper.outerWidth()/2);w.css(e.extend({marginTop:d,left:y,width:u.$wrapper.offset().left-s-y+u.$wrapper.outerWidth()/2},i))}}}),a||r.callEvent("afterDrawLines")},d.prototype.callEvent=function(t,a){var o=this;if(e.isArray(a)||(a=[a]),o.$.trigger(t,a),e.isFunction(o.options[t]))return o.options[t].apply(o,a)},d.DEFAULTS=l,d.NAME=n,e.fn.treemap=function(t,a,o){return this.each(function(){var r=e(this),l=r.data(n),i="object"==typeof t&&t;l||r.data(n,l=new d(this,i)),"string"==typeof t&&l[t](a,o)})},e.fn.treemap.Constructor=d}(jQuery,window,document,Math,void 0); \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/ueditor/.pydio b/src/resources/static/js/lib/zui/lib/ueditor/.pydio new file mode 100644 index 0000000..3163aa4 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/ueditor/.pydio @@ -0,0 +1 @@ +2590ffa1-067a-4eb7-afe6-533ea9eaa2cc \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/ueditor/ueditor.css b/src/resources/static/js/lib/zui/lib/ueditor/ueditor.css new file mode 100644 index 0000000..07eb88a --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/ueditor/ueditor.css @@ -0,0 +1,1604 @@ +/*基础UI构建 +*/ +/* common layer */ +.edui-default .edui-box { + padding: 0; + margin: 0; + overflow: hidden; + border: none; + } +.edui-default a.edui-box { + display: block; + color: black; + text-decoration: none; + } +.edui-default a.edui-box:hover { + text-decoration: none; + } +.edui-default a.edui-box:active { + text-decoration: none; + } +.edui-default table.edui-box { + border-collapse: collapse; + } +.edui-default ul.edui-box { + list-style-type: none; + } +div.edui-box { + position: relative; + display: inline-block !important; + vertical-align: top; + } +.edui-default .edui-clearfix { + zoom: 1; + } +.edui-default .edui-clearfix:after { + display: block; + clear: both; + content: '\20'; + } +* html div.edui-box { + display: inline !important; + } +*:first-child + html div.edui-box { + display: inline !important; + } +/* control layout */ +.edui-default .edui-button-body, +.edui-splitbutton-body, +.edui-menubutton-body, +.edui-combox-body { + position: relative; + } +.edui-default .edui-popup { + position: absolute; + -webkit-user-select: none; + -moz-user-select: none; + } +.edui-default .edui-popup .edui-shadow { + position: absolute; + z-index: -1; + } +.edui-default .edui-popup .edui-bordereraser { + position: absolute; + overflow: hidden; + } +.edui-default .edui-tablepicker .edui-canvas { + position: relative; + } +.edui-default .edui-tablepicker .edui-canvas .edui-overlay { + position: absolute; + } +.edui-default .edui-dialog-modalmask, +.edui-dialog-dragmask { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } +.edui-default .edui-toolbar { + position: relative; + } +/* + * default theme + */ +.edui-default .edui-label { + cursor: default; + } +.edui-default span.edui-clickable { + color: blue; + text-decoration: underline; + cursor: pointer; + } +.edui-default span.edui-unclickable { + color: gray; + cursor: default; + } +/* 工具栏 */ +.edui-default .edui-toolbar { + width: auto; + height: auto; + padding: 1px; + overflow: hidden; + cursor: default; + /*全屏下单独一行不占位*/ + zoom: 1; + -webkit-user-select: none; + -moz-user-select: none; + } +.edui-default .edui-toolbar .edui-button, +.edui-default .edui-toolbar .edui-splitbutton, +.edui-default .edui-toolbar .edui-menubutton, +.edui-default .edui-toolbar .edui-combox { + margin: 1px; + } +/*UI工具栏、编辑区域、底部*/ +.edui-default .edui-editor { + position: relative; + overflow: visible; + background-color: white; + border: 1px solid #d4d4d4; + border-radius: 4px; + } +.edui-editor div { + width: auto; + height: auto; + } +.edui-default .edui-editor-toolbarbox { + position: relative; + zoom: 1; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + } +.edui-default .edui-editor-toolbarboxouter { + background-color: #fafafa; + background-repeat: repeat-x; + border-bottom: 1px solid #d4d4d4; + + *zoom: 1; + } +.edui-default .edui-editor-toolbarboxinner { + padding: 2px; + } +.edui-default .edui-editor-iframeholder { + position: relative; + } +.edui-default .edui-editor-bottomContainer { + overflow: hidden; + } +.edui-default .edui-editor-bottomContainer table { + width: 100%; + height: 0; + overflow: hidden; + border-spacing: 0; + } +.edui-default .edui-editor-bottomContainer td { + font-family: Arial, Helvetica, Tahoma, Verdana, Sans-Serif; + font-size: 12px; + line-height: 20px; + white-space: nowrap; + border-top: 1px solid #ccc; + } +.edui-default .edui-editor-wordcount { + margin-right: 5px; + color: #aaa; + text-align: right; + } +.edui-default .edui-editor-scale { + width: 12px; + } +.edui-default .edui-editor-scale .edui-editor-icon { + float: right; + width: 100%; + height: 12px; + margin-top: 10px; + cursor: se-resize; + background: url(../images/scale.png) no-repeat; + } +.edui-default .edui-editor-breadcrumb { + margin: 2px 0 0 3px; + } +.edui-default .edui-editor-breadcrumb span { + color: blue; + text-decoration: underline; + cursor: pointer; + } +.edui-default .edui-toolbar .edui-for-fullscreen { + float: right; + } +.edui-default .edui-bubble .edui-popup-content { + padding: 5px; + font-family: "宋体"; + font-size: 10pt; + background-color: #fff6d9; + border: 1px solid #dcac6c; + } +.edui-default .edui-editor-toolbarmsg { + position: absolute; + bottom: -25px; + left: 0; + z-index: 1009; + width: 99.9%; + background-color: #fff6d9; + border-bottom: 1px solid #ccc; + } +.edui-default .edui-editor-toolbarmsg-upload { + position: absolute; + top: 5px; + left: 350px; + width: 100px; + height: 16px; + font-size: 14px; + line-height: 16px; + color: blue; + cursor: pointer; + } +.edui-default .edui-editor-toolbarmsg-label { + padding: 4px; + font-size: 12px; + line-height: 16px; + } +.edui-default .edui-editor-toolbarmsg-close { + float: right; + width: 20px; + height: 16px; + line-height: 16px; + color: red; + cursor: pointer; + } +.edui-default .edui-list .edui-bordereraser { + display: none; + } +.edui-default .edui-listitem { + padding: 1px; + white-space: nowrap; + } +.edui-default .edui-list .edui-state-hover { + position: relative; + padding: 0; + background-color: #fff5d4; + border: 1px solid #dcac6c; + } +.edui-default .edui-for-fontfamily .edui-listitem-label { + min-width: 130px; + height: 22px; + padding-left: 5px; + font-size: 12px; + line-height: 22px; + + _width: 120px; + } +.edui-default .edui-for-insertcode .edui-listitem-label { + min-width: 120px; + height: 22px; + padding-left: 5px; + font-size: 12px; + line-height: 22px; + + _width: 120px; + } +.edui-default .edui-for-underline .edui-listitem-label { + min-width: 120px; + padding: 3px 5px; + font-size: 12px; + + _width: 120px; + } +.edui-default .edui-for-fontsize .edui-listitem-label { + min-width: 120px; + padding: 3px 5px; + + _width: 120px; + } +.edui-default .edui-for-paragraph .edui-listitem-label { + min-width: 200px; + padding: 2px 5px; + + _width: 200px; + } +.edui-default .edui-for-rowspacingtop .edui-listitem-label, +.edui-default .edui-for-rowspacingbottom .edui-listitem-label { + min-width: 53px; + padding: 2px 5px; + + _width: 53px; + } +.edui-default .edui-for-lineheight .edui-listitem-label { + min-width: 53px; + padding: 2px 5px; + + _width: 53px; + } +.edui-default .edui-for-customstyle .edui-listitem-label { + width: 200px !important; + min-width: 200px; + padding: 2px 5px; + + _width: 200px; + } +/* 可选中按钮弹出菜单*/ +.edui-default .edui-menu { + z-index: 3000; + } +.edui-default .edui-menu .edui-popup-content { + padding: 3px; + } +.edui-default .edui-menu-body { + min-width: 170px; + background: url("../images/sparator_v.png") repeat-y 25px; + + _width: 150px; + } +.edui-default .edui-menuitem { + height: 20px; + vertical-align: top; + cursor: default; + } +.edui-default .edui-menuitem .edui-icon { + width: 20px !important; + height: 20px !important; + background: url(../images/icons.png) 0 -4000px; + background: url(../images/icons.gif) 0 -4000px\9; + } +.edui-default .edui-menuitem .edui-label { + height: 20px; + padding-left: 10px; + font-size: 12px; + line-height: 20px; + } +.edui-default .edui-state-checked .edui-menuitem-body { + background: url("../images/icons-all.gif") no-repeat 6px -205px; + } +.edui-default .edui-state-disabled .edui-menuitem-label { + color: gray; + } +/*不可选中菜单按钮 */ +.edui-default .edui-toolbar .edui-combox-body .edui-button-body { + width: 60px; + height: 20px; + padding-left: 5px; + margin: 0 3px 0 0; + font-size: 12px; + line-height: 20px; + white-space: nowrap; + } +.edui-default .edui-toolbar .edui-combox-body .edui-arrow { + width: 9px; + height: 20px; + background: url(../images/icons.png) -741px 0; + + _background: url(../images/icons.gif) -741px 0; + } +.edui-default .edui-toolbar .edui-combox .edui-combox-body { + background-color: white; + border: 1px solid #ccc; + border-radius: 2px; + + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + } +.edui-default .edui-toolbar .edui-combox-body .edui-splitborder { + display: none; + } +.edui-default .edui-toolbar .edui-combox-body .edui-arrow { + border-left: 1px solid #ccc; + } +.edui-default .edui-toolbar .edui-state-hover .edui-combox-body { + background-color: #fff5d4; + border: 1px solid #dcac6c; + } +.edui-default .edui-toolbar .edui-state-hover .edui-combox-body .edui-arrow { + border-left: 1px solid #dcac6c; + } +.edui-default .edui-toolbar .edui-state-checked .edui-combox-body { + background-color: #ffe69f; + border: 1px solid #dcac6c; + } +.edui-toolbar .edui-state-checked .edui-combox-body .edui-arrow { + border-left: 1px solid #dcac6c; + } +.edui-toolbar .edui-state-disabled .edui-combox-body { + background-color: #f0f0ee; + filter: alpha(opacity=30); + opacity: .3; + } +.edui-toolbar .edui-state-opened .edui-combox-body { + background-color: white; + border: 1px solid gray; + } +/*普通按钮样式及状态*/ +.edui-default .edui-toolbar .edui-button .edui-icon, +.edui-default .edui-toolbar .edui-menubutton .edui-icon, +.edui-default .edui-toolbar .edui-splitbutton .edui-icon { + width: 20px !important; + height: 20px !important; + background-image: url(../images/icons.png); + background-image: url(../images/icons.gif) \9; + } +.edui-default .edui-toolbar .edui-button .edui-button-wrap { + position: relative; + padding: 1px; + } +.edui-default .edui-toolbar .edui-button .edui-state-hover .edui-button-wrap { + padding: 0; + background-color: #fff5d4; + border: 1px solid #dcac6c; + } +.edui-default .edui-toolbar .edui-button .edui-state-checked .edui-button-wrap { + padding: 0; + background-color: #ffe69f; + border: 1px solid #dcac6c; + border-radius: 2px; + + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + } +.edui-default .edui-toolbar .edui-button .edui-state-active .edui-button-wrap { + padding: 0; + background-color: #fff; + border: 1px solid gray; + } +.edui-default .edui-toolbar .edui-state-disabled .edui-label { + color: #ccc; + } +.edui-default .edui-toolbar .edui-state-disabled .edui-icon { + filter: alpha(opacity=30); + opacity: .3; + } +/* toolbar icons */ +.edui-default .edui-for-undo .edui-icon { + background-position: -160px 0; + } +.edui-default .edui-for-redo .edui-icon { + background-position: -100px 0; + } +.edui-default .edui-for-bold .edui-icon { + background-position: 0 0; + } +.edui-default .edui-for-italic .edui-icon { + background-position: -60px 0; + } +.edui-default .edui-for-fontborder .edui-icon { + background-position: -160px -40px; + } +.edui-default .edui-for-underline .edui-icon { + background-position: -140px 0; + } +.edui-default .edui-for-strikethrough .edui-icon { + background-position: -120px 0; + } +.edui-default .edui-for-subscript .edui-icon { + background-position: -600px 0; + } +.edui-default .edui-for-superscript .edui-icon { + background-position: -620px 0; + } +.edui-default .edui-for-blockquote .edui-icon { + background-position: -220px 0; + } +.edui-default .edui-for-forecolor .edui-icon { + background-position: -720px 0; + } +.edui-default .edui-for-backcolor .edui-icon { + background-position: -760px 0; + } +.edui-default .edui-for-inserttable .edui-icon { + background-position: -580px -20px; + } +.edui-default .edui-for-autotypeset .edui-icon { + background-position: -640px -40px; + } +.edui-default .edui-for-justifyleft .edui-icon { + background-position: -460px 0; + } +.edui-default .edui-for-justifycenter .edui-icon { + background-position: -420px 0; + } +.edui-default .edui-for-justifyright .edui-icon { + background-position: -480px 0; + } +.edui-default .edui-for-justifyjustify .edui-icon { + background-position: -440px 0; + } +.edui-default .edui-for-insertorderedlist .edui-icon { + background-position: -80px 0; + } +.edui-default .edui-for-insertunorderedlist .edui-icon { + background-position: -20px 0; + } +.edui-default .edui-for-lineheight .edui-icon { + background-position: -725px -40px; + } +.edui-default .edui-for-rowspacingbottom .edui-icon { + background-position: -745px -40px; + } +.edui-default .edui-for-rowspacingtop .edui-icon { + background-position: -765px -40px; + } +.edui-default .edui-for-horizontal .edui-icon { + background-position: -360px 0; + } +.edui-default .edui-for-link .edui-icon { + background-position: -500px 0; + } +.edui-default .edui-for-code .edui-icon { + background-position: -440px -40px; + } +.edui-default .edui-for-insertimage .edui-icon { + background-position: -726px -77px; + } +.edui-default .edui-for-insertframe .edui-icon { + background-position: -240px -40px; + } +.edui-default .edui-for-emoticon .edui-icon { + background-position: -60px -20px; + } +.edui-default .edui-for-spechars .edui-icon { + background-position: -240px 0; + } +.edui-default .edui-for-help .edui-icon { + background-position: -340px 0; + } +.edui-default .edui-for-print .edui-icon { + background-position: -440px -20px; + } +.edui-default .edui-for-preview .edui-icon { + background-position: -420px -20px; + } +.edui-default .edui-for-selectall .edui-icon { + background-position: -400px -20px; + } +.edui-default .edui-for-searchreplace .edui-icon { + background-position: -520px -20px; + } +.edui-default .edui-for-map .edui-icon { + background-position: -40px -40px; + } +.edui-default .edui-for-gmap .edui-icon { + background-position: -260px -40px; + } +.edui-default .edui-for-insertvideo .edui-icon { + background-position: -320px -20px; + } +.edui-default .edui-for-time .edui-icon { + background-position: -160px -20px; + } +.edui-default .edui-for-date .edui-icon { + background-position: -140px -20px; + } +.edui-default .edui-for-cut .edui-icon { + background-position: -680px 0; + } +.edui-default .edui-for-copy .edui-icon { + background-position: -700px 0; + } +.edui-default .edui-for-paste .edui-icon { + background-position: -560px 0; + } +.edui-default .edui-for-formatmatch .edui-icon { + background-position: -40px 0; + } +.edui-default .edui-for-pasteplain .edui-icon { + background-position: -360px -20px; + } +.edui-default .edui-for-directionalityltr .edui-icon { + background-position: -20px -20px; + } +.edui-default .edui-for-directionalityrtl .edui-icon { + background-position: -40px -20px; + } +.edui-default .edui-for-source .edui-icon { + background-position: -261px 0; + } +.edui-default .edui-for-removeformat .edui-icon { + background-position: -580px 0; + } +.edui-default .edui-for-unlink .edui-icon { + background-position: -640px 0; + } +.edui-default .edui-for-touppercase .edui-icon { + background-position: -786px 0; + } +.edui-default .edui-for-tolowercase .edui-icon { + background-position: -806px 0; + } +.edui-default .edui-for-insertrow .edui-icon { + background-position: -478px -76px; + } +.edui-default .edui-for-insertrownext .edui-icon { + background-position: -498px -76px; + } +.edui-default .edui-for-insertcol .edui-icon { + background-position: -455px -76px; + } +.edui-default .edui-for-insertcolnext .edui-icon { + background-position: -429px -76px; + } +.edui-default .edui-for-mergeright .edui-icon { + background-position: -60px -40px; + } +.edui-default .edui-for-mergedown .edui-icon { + background-position: -80px -40px; + } +.edui-default .edui-for-splittorows .edui-icon { + background-position: -100px -40px; + } +.edui-default .edui-for-splittocols .edui-icon { + background-position: -120px -40px; + } +.edui-default .edui-for-insertparagraphbeforetable .edui-icon { + background-position: -140px -40px; + } +.edui-default .edui-for-deleterow .edui-icon { + background-position: -660px -20px; + } +.edui-default .edui-for-deletecol .edui-icon { + background-position: -640px -20px; + } +.edui-default .edui-for-splittocells .edui-icon { + background-position: -800px -20px; + } +.edui-default .edui-for-mergecells .edui-icon { + background-position: -760px -20px; + } +.edui-default .edui-for-deletetable .edui-icon { + background-position: -620px -20px; + } +.edui-default .edui-for-cleardoc .edui-icon { + background-position: -520px 0; + } +.edui-default .edui-for-fullscreen .edui-icon { + background-position: -100px -20px; + } +.edui-default .edui-for-anchor .edui-icon { + background-position: -200px 0; + } +.edui-default .edui-for-pagebreak .edui-icon { + background-position: -460px -40px; + } +.edui-default .edui-for-imagenone .edui-icon { + background-position: -480px -40px; + } +.edui-default .edui-for-imageleft .edui-icon { + background-position: -500px -40px; + } +.edui-default .edui-for-wordimage .edui-icon { + background-position: -660px -40px; + } +.edui-default .edui-for-imageright .edui-icon { + background-position: -520px -40px; + } +.edui-default .edui-for-imagecenter .edui-icon { + background-position: -540px -40px; + } +.edui-default .edui-for-indent .edui-icon { + background-position: -400px 0; + } +.edui-default .edui-for-outdent .edui-icon { + background-position: -540px 0; + } +.edui-default .edui-for-webapp .edui-icon { + background-position: -601px -40px; + } +.edui-default .edui-for-table .edui-icon { + background-position: -580px -20px; + } +.edui-default .edui-for-edittable .edui-icon { + background-position: -420px -40px; + } +.edui-default .edui-for-template .edui-icon { + background-position: -339px -40px; + } +.edui-default .edui-for-delete .edui-icon { + background-position: -360px -40px; + } +.edui-default .edui-for-attachment .edui-icon { + background-position: -620px -40px; + } +.edui-default .edui-for-edittd .edui-icon { + background-position: -700px -40px; + } +.edui-default .edui-for-snapscreen .edui-icon { + background-position: -581px -40px; + } +.edui-default .edui-for-scrawl .edui-icon { + background-position: -801px -41px; + } +.edui-default .edui-for-background .edui-icon { + background-position: -680px -40px; + } +.edui-default .edui-for-music .edui-icon { + background-position: -18px -40px; + } +.edui-default .edui-for-formula .edui-icon { + background-position: -200px -40px; + } +.edui-default .edui-for-aligntd .edui-icon { + background-position: -236px -76px; + } +.edui-default .edui-for-insertparagraphtrue .edui-icon { + background-position: -625px -76px; + } +.edui-default .edui-for-insertparagraph .edui-icon { + background-position: -602px -76px; + } +.edui-default .edui-for-insertcaption .edui-icon { + background-position: -336px -76px; + } +.edui-default .edui-for-deletecaption .edui-icon { + background-position: -362px -76px; + } +.edui-default .edui-for-inserttitle .edui-icon { + background-position: -286px -76px; + } +.edui-default .edui-for-deletetitle .edui-icon { + background-position: -311px -76px; + } +.edui-default .edui-for-aligntable .edui-icon { + background-position: -440px 0; + } +.edui-default .edui-for-tablealignment-left .edui-icon { + background-position: -460px 0; + } +.edui-default .edui-for-tablealignment-center .edui-icon { + background-position: -420px 0; + } +.edui-default .edui-for-tablealignment-right .edui-icon { + background-position: -480px 0; + } +.edui-default .edui-for-drafts .edui-icon { + background-position: -560px 0; + } +.edui-default .edui-for-charts .edui-icon { + background: url(../images/charts.png ) no-repeat 2px 3px !important; + } +.edui-default .edui-for-inserttitlecol .edui-icon { + background-position: -673px -76px; + } +.edui-default .edui-for-deletetitlecol .edui-icon { + background-position: -698px -76px; + } +.edui-default .edui-for-simpleupload .edui-icon { + background-position: -380px 0; + } +/*splitbutton*/ +.edui-default .edui-toolbar .edui-splitbutton-body .edui-arrow, +.edui-default .edui-toolbar .edui-menubutton-body .edui-arrow { + width: 9px; + height: 20px; + background: url(../images/icons.png) -741px 0; + + _background: url(../images/icons.gif) -741px 0; + } +.edui-default .edui-toolbar .edui-splitbutton .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-menubutton-body { + padding: 1px; + } +.edui-default .edui-toolbar .edui-splitborder { + width: 1px; + height: 20px; + } +.edui-default .edui-toolbar .edui-state-hover .edui-splitborder { + width: 1px; + border-left: 0 solid #dcac6c; + } +.edui-default .edui-toolbar .edui-state-active .edui-splitborder { + width: 0; + border-left: 1px solid gray; + } +.edui-default .edui-toolbar .edui-state-opened .edui-splitborder { + width: 1px; + border: 0; + } +.edui-default .edui-toolbar .edui-splitbutton .edui-state-hover .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-hover .edui-menubutton-body { + padding: 0; + background-color: #fff5d4; + border: 1px solid #dcac6c; + } +.edui-default .edui-toolbar .edui-splitbutton .edui-state-checked .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-checked .edui-menubutton-body { + padding: 0; + background-color: #ffe69f; + border: 1px solid #dcac6c; + } +.edui-default .edui-toolbar .edui-splitbutton .edui-state-active .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-active .edui-menubutton-body { + padding: 0; + background-color: #fff; + border: 1px solid gray; + } +.edui-default .edui-state-disabled .edui-arrow { + filter: alpha(opacity=30); + opacity: .3; + } +.edui-default .edui-toolbar .edui-splitbutton .edui-state-opened .edui-splitbutton-body, +.edui-default .edui-toolbar .edui-menubutton .edui-state-opened .edui-menubutton-body { + padding: 0; + background-color: white; + border: 1px solid gray; + } +.edui-default .edui-for-insertorderedlist .edui-bordereraser, +.edui-default .edui-for-lineheight .edui-bordereraser, +.edui-default .edui-for-rowspacingtop .edui-bordereraser, +.edui-default .edui-for-rowspacingbottom .edui-bordereraser, +.edui-default .edui-for-insertunorderedlist .edui-bordereraser { + background-color: white; + } +/* 解决嵌套导致的图标问题 */ +.edui-default .edui-for-insertorderedlist .edui-popup-body .edui-icon, +.edui-default .edui-for-lineheight .edui-popup-body .edui-icon, +.edui-default .edui-for-rowspacingtop .edui-popup-body .edui-icon, +.edui-default .edui-for-rowspacingbottom .edui-popup-body .edui-icon, +.edui-default .edui-for-insertunorderedlist .edui-popup-body .edui-icon { + /*background-position: 0 -40px;*/ + background-image: none ; + } +/* 弹出菜单 */ +.edui-default .edui-popup { + z-index: 3000; + width: auto; + height: auto; + background-color: #fff; + } +.edui-default .edui-popup .edui-shadow { + top: 0; + left: 0; + width: 100%; + height: 100%; + } +.edui-default .edui-popup-content { + padding: 5px; + background: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); + box-shadow: 0 6px 12px rgba(0, 0, 0, .175); + + *border-right-width: 2px; + *border-bottom-width: 2px; + } +.edui-default .edui-popup .edui-bordereraser { + height: 3px; + background-color: white; + } +.edui-default .edui-menu .edui-bordereraser { + height: 3px; + } +.edui-default .edui-anchor-topleft .edui-bordereraser { + top: -2px; + left: 1px; + } +.edui-default .edui-anchor-topright .edui-bordereraser { + top: -2px; + right: 1px; + } +.edui-default .edui-anchor-bottomleft .edui-bordereraser { + bottom: -6px; + left: 0; + height: 7px; + border-right: 1px solid gray; + border-left: 1px solid gray; + } +.edui-default .edui-anchor-bottomright .edui-bordereraser { + right: 0; + bottom: -6px; + height: 7px; + border-right: 1px solid gray; + border-left: 1px solid gray; + } +.edui-popup div { + width: auto; + height: auto; + } +.edui-default .edui-editor-messageholder { + position: absolute; + top: 28px; + right: 3px; + display: block; + width: 150px; + height: auto; + padding: 0; + margin: 0; + border: 0; + } +.edui-default .edui-message { + position: relative; + min-height: 10px; + padding: 0; + margin-bottom: 3px; + text-shadow: 0 1px 0 rgba(255, 255, 255, .5); + } +.edui-default .edui-message-body { + padding: 8px 15px 8px 8px; + color: #c09853; + background-color: #fcf8e3; + border: 1px solid #fbeed5; + border-radius: 4px; + } +.edui-default .edui-message-type-info { + color: #3a87ad; + background-color: #d9edf7; + border-color: #bce8f1; + } +.edui-default .edui-message-type-success { + color: #468847; + background-color: #dff0d8; + border-color: #d6e9c6; + } +.edui-default .edui-message-type-danger, +.edui-default .edui-message-type-error { + color: #b94a48; + background-color: #f2dede; + border-color: #eed3d7; + } +.edui-default .edui-message .edui-message-closer { + position: absolute; + top: 0; + right: 0; + display: block; + float: right; + width: 16px; + height: 16px; + padding: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 20px; + font-weight: bold; + line-height: 16px; + color: #999; + text-shadow: 0 1px 0 #fff; + cursor: pointer; + background: transparent; + border: 0; + } +.edui-default .edui-message .edui-message-content { + font-size: 10pt; + word-break: normal; + word-wrap: break-word; + } +/* 弹出对话框按钮和对话框大小 */ +.edui-default .edui-dialog { + position: absolute; + z-index: 2000; + } +.edui-dialog div { + width: auto; + } +.edui-default .edui-dialog-wrap { + margin-right: 6px; + margin-bottom: 6px; + } +.edui-default .edui-dialog-fullscreen-flag { + margin-right: 0; + margin-bottom: 0; + } +.edui-default .edui-dialog-body { + position: relative; + padding: 2px 0 0 2px; + + _zoom: 1; + } +.edui-default .edui-dialog-fullscreen-flag .edui-dialog-body { + padding: 0; + } +.edui-default .edui-dialog-shadow { + position: absolute; + top: 0; + left: 0; + z-index: -1; + width: 100%; + height: 100%; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); + box-shadow: 0 3px 9px rgba(0, 0, 0, .5); + + *border-right-width: 2px; + *border-bottom-width: 2px; + } +.edui-default .edui-dialog-foot { + background-color: white; + } +.edui-default .edui-dialog-titlebar { + position: relative; + min-height: 24px; + padding: 8px 10px; + line-height: 24px; + cursor: move; + border-bottom: 1px solid #e5e5e5; + } +.edui-default .edui-dialog-caption { + padding-left: 5px; + font-size: 12px; + font-weight: bold; + line-height: 26px; + } +.edui-default .edui-dialog-draghandle { + height: 26px; + } +.edui-default .edui-dialog-closebutton { + position: absolute !important; + top: 4px; + right: 3px; + } +.edui-default .edui-dialog-closebutton .edui-button-body { + width: 30px; + height: 30px; + font-size: 19.5px; + font-weight: 700; + line-height: 30px; + color: #000; + text-align: center; + text-shadow: 0 1px 0 #fff; + cursor: pointer; + filter: alpha(opacity=20); + opacity: .2; + } +.edui-default .edui-dialog-closebutton .edui-button-body:before { + content: '×'; + } +.edui-default .edui-dialog-closebutton .edui-button-body:hover { + filter: alpha(opacity=70); + opacity: .7; + } +.edui-default .edui-dialog-foot { + height: 40px; + } +.edui-default .edui-dialog-buttons { + position: absolute; + right: 0; + } +.edui-default .edui-dialog-buttons .edui-button { + margin-right: 10px; + } +.edui-default .edui-dialog-buttons .edui-button .edui-button-body { + width: 96px; + height: 24px; + font-size: 12px; + line-height: 24px; + text-align: center; + cursor: default; + background-color: #f2f2f2; + border: 1px solid #bfbfbf; + border-radius: 4px; + } +.edui-default .edui-dialog-buttons .edui-button .edui-state-hover .edui-button-body { + background-color: #dedede; + border-color: #a1a1a1; + -webkit-box-shadow: 0 2px 1px rgba(0, 0, 0, .1); + box-shadow: 0 2px 1px rgba(0, 0, 0, .1); + } +.edui-default .edui-dialog iframe { + padding: 0; + margin: 0; + vertical-align: top; + border: 0; + } +.edui-default .edui-dialog-modalmask { + position: absolute; + background-color: #ccc; + filter: alpha(opacity=30); + opacity: .3; + /*z-index: 1999;*/ + } +.edui-default .edui-dialog-dragmask { + position: absolute; + cursor: move; + /*z-index: 2001;*/ + background-color: transparent; + } +.edui-default .edui-dialog-content { + position: relative; + } +.edui-default .dialogcontmask { + position: absolute; + display: block; + width: 100%; + height: 100%; + cursor: move; + visibility: hidden; + filter: alpha(opacity=0); + opacity: 0; + } +/*link-dialog*/ +.edui-default .edui-for-link .edui-dialog-content { + width: 420px; + height: 200px; + overflow: hidden; + } +/*background-dialog*/ +.edui-default .edui-for-background .edui-dialog-content { + width: 440px; + height: 280px; + overflow: hidden; + } +/*template-dialog*/ +.edui-default .edui-for-template .edui-dialog-content { + width: 630px; + height: 390px; + overflow: hidden; + } +/*scrawl-dialog*/ +.edui-default .edui-for-scrawl .edui-dialog-content { + width: 515px; + height: 360px; + + *width: 506px; + } +/*spechars-dialog*/ +.edui-default .edui-for-spechars .edui-dialog-content { + width: 620px; + height: 500px; + + *width: 630px; + *height: 570px; + } +/*image-dialog*/ +.edui-default .edui-for-insertimage .edui-dialog-content { + width: 650px; + height: 400px; + overflow: hidden; + } +/*webapp-dialog*/ +.edui-default .edui-for-webapp .edui-dialog-content { + width: 560px; + height: 450px; + overflow: hidden; + + _width: 565px; + } +/*image-insertframe*/ +.edui-default .edui-for-insertframe .edui-dialog-content { + width: 350px; + height: 200px; + overflow: hidden; + } +/*wordImage-dialog*/ +.edui-default .edui-for-wordimage .edui-dialog-content { + width: 620px; + height: 380px; + overflow: hidden; + } +/*attachment-dialog*/ +.edui-default .edui-for-attachment .edui-dialog-content { + width: 650px; + height: 400px; + overflow: hidden; + } +/*map-dialog*/ +.edui-default .edui-for-map .edui-dialog-content { + width: 550px; + height: 400px; + } +/*gmap-dialog*/ +.edui-default .edui-for-gmap .edui-dialog-content { + width: 550px; + height: 400px; + } +/*video-dialog*/ +.edui-default .edui-for-insertvideo .edui-dialog-content { + width: 590px; + height: 390px; + } +/*anchor-dialog*/ +.edui-default .edui-for-anchor .edui-dialog-content { + width: 320px; + height: 60px; + overflow: hidden; + } +/*searchreplace-dialog*/ +.edui-default .edui-for-searchreplace .edui-dialog-content { + width: 400px; + height: 220px; + } +/*help-dialog*/ +.edui-default .edui-for-help .edui-dialog-content { + width: 400px; + height: 420px; + } +/*edittable-dialog*/ +.edui-default .edui-for-edittable .edui-dialog-content { + width: 540px; + height: 335px; + + _width: 590px; + } +/*edittip-dialog*/ +.edui-default .edui-for-edittip .edui-dialog-content { + width: 225px; + height: 60px; + } +/*edittd-dialog*/ +.edui-default .edui-for-edittd .edui-dialog-content { + width: 240px; + height: 50px; + } +/*snapscreen-dialog*/ +.edui-default .edui-for-snapscreen .edui-dialog-content { + width: 400px; + height: 220px; + } +/*music-dialog*/ +.edui-default .edui-for-music .edui-dialog-content { + width: 515px; + height: 360px; + } +/*段落弹出菜单*/ +.edui-default .edui-for-paragraph .edui-listitem-label { + font-family: Tahoma, Verdana, Arial, Helvetica; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-p { + font-size: 22px; + line-height: 27px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h1 { + font-size: 32px; + font-weight: bolder; + line-height: 36px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h2 { + font-size: 27px; + font-weight: bolder; + line-height: 29px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h3 { + font-size: 19px; + font-weight: bolder; + line-height: 23px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h4 { + font-size: 16px; + font-weight: bolder; + line-height: 19px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h5 { + font-size: 13px; + font-weight: bolder; + line-height: 16px; + } +.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h6 { + font-size: 12px; + font-weight: bolder; + line-height: 14px; + } +/* 表格弹出菜单 */ +.edui-default .edui-for-inserttable .edui-splitborder { + display: none; + } +.edui-default .edui-for-inserttable .edui-splitbutton-body .edui-arrow { + width: 0; + } +.edui-default .edui-toolbar .edui-for-inserttable .edui-state-active .edui-splitborder { + border-left: 1px solid transparent; + } +.edui-default .edui-tablepicker .edui-infoarea { + width: 220px; + height: 14px; + margin-bottom: 3px; + clear: both; + font-size: 12px; + line-height: 14px; + } +.edui-default .edui-tablepicker .edui-infoarea .edui-label { + float: left; + } +.edui-default .edui-dialog-buttons .edui-label { + line-height: 24px; + } +.edui-default .edui-tablepicker .edui-infoarea .edui-clickable { + float: right; + } +.edui-default .edui-tablepicker .edui-pickarea { + width: 220px; + height: 220px; + background: url("../images/unhighlighted.gif") repeat; + } +.edui-default .edui-tablepicker .edui-pickarea .edui-overlay { + background: url("../images/highlighted.gif") repeat; + } +/* 颜色弹出菜单 */ +.edui-default .edui-colorpicker-topbar { + width: 200px; + height: 27px; + /*border-bottom: 1px gray dashed;*/ + } +.edui-default .edui-colorpicker-preview { + float: left; + width: 128px; + height: 20px; + margin-left: 1px; + border: 1px inset black; + } +.edui-default .edui-colorpicker-nocolor { + float: right; + height: 14px; + padding: 3px 5px; + margin-right: 1px; + font-size: 12px; + line-height: 14px; + cursor: pointer; + border: 1px solid #333; + } +.edui-default .edui-colorpicker-tablefirstrow { + height: 30px; + } +.edui-default .edui-colorpicker-colorcell { + display: block; + width: 14px; + height: 14px; + margin: 0; + cursor: pointer; + } +.edui-default .edui-colorpicker-colorcell:hover { + width: 14px; + height: 14px; + margin: 0; + } +.edui-default .edui-colorpicker-advbtn { + display: block; + height: 20px; + text-align: center; + cursor: pointer; + } +.arrow_down { + background: white url('../images/arrow_down.png') no-repeat center; + } +.arrow_up { + background: white url('../images/arrow_up.png') no-repeat center; + } +/*高级的样式*/ +.edui-colorpicker-adv { + position: relative; + display: none; + height: 180px; + overflow: hidden; + } +.edui-colorpicker-plant, +.edui-colorpicker-hue { + border: solid 1px #666; + } +.edui-colorpicker-pad { + position: absolute; + top: 13px; + left: 14px; + width: 150px; + height: 150px; + overflow: hidden; + cursor: crosshair; + background: red; + } +.edui-colorpicker-cover { + position: absolute; + top: 0; + left: 0; + width: 150px; + height: 150px; + background: url("../images/tangram-colorpicker.png") -160px -200px; + } +.edui-colorpicker-padDot { + position: absolute; + top: 0; + left: 0; + z-index: 1000; + width: 11px; + height: 11px; + overflow: hidden; + background: url(../images/tangram-colorpicker.png) 0 -200px repeat-x; + } +.edui-colorpicker-sliderMain { + position: absolute; + top: 13px; + left: 171px; + width: 19px; + height: 152px; + background: url(../images/tangram-colorpicker.png) -179px -12px no-repeat; + } +.edui-colorpicker-slider { + width: 100%; + height: 100%; + cursor: pointer; + } +.edui-colorpicker-thumb { + position: absolute; + top: 0; + right: -1px; + left: -1px; + height: 3px; + cursor: pointer; + background: white; + border: 1px solid black; + opacity: .8; + } +/*自动排版弹出菜单*/ +.edui-default .edui-autotypesetpicker .edui-autotypesetpicker-body { + margin-bottom: 3px; + clear: both; + font-size: 12px; + } +.edui-default .edui-autotypesetpicker-body table { + border-spacing: 2px; + border-collapse: separate; + } +.edui-default .edui-autotypesetpicker-body td { + font-size: 12px; + word-wrap: break-word; + } +.edui-default .edui-autotypesetpicker-body td input { + margin: 3px 3px 3px 4px; + + *margin: 1px 0 0 0; + } +/*自动排版弹出菜单*/ +.edui-default .edui-cellalignpicker .edui-cellalignpicker-body { + width: 70px; + font-size: 12px; + cursor: default; + } +.edui-default .edui-cellalignpicker-body table { + border-spacing: 0; + border-collapse: separate; + } +.edui-default .edui-cellalignpicker-body td { + padding: 1px; + } +.edui-default .edui-cellalignpicker-body .edui-icon { + width: 20px; + height: 20px; + padding: 1px; + background-image: url(../images/table-cell-align.png); + } +.edui-default .edui-cellalignpicker-body .edui-left { + background-position: 0 0; + } +.edui-default .edui-cellalignpicker-body .edui-center { + background-position: -25px 0; + } +.edui-default .edui-cellalignpicker-body .edui-right { + background-position: -51px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-left { + background-position: -73px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-center { + background-position: -98px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-right { + background-position: -124px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-left { + background-color: #f1f4f5; + background-position: -146px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-center { + background-position: -245px 0; + } +.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-right { + background-position: -271px 0; + } +/*分隔线*/ +.edui-default .edui-toolbar .edui-separator { + width: 2px; + height: 20px; + margin: 2px 4px 2px 3px; + background: url(../images/icons.png) -181px 0; + background: url(../images/icons.gif) -181px 0 \9; + } +/*颜色按钮 */ +.edui-default .edui-toolbar .edui-colorbutton .edui-colorlump { + position: absolute; + bottom: 1px; + left: 1px; + width: 18px; + height: 4px; + overflow: hidden; + } +/*表情按钮及弹出菜单*/ +/*去除了表情的下拉箭头*/ +.edui-default .edui-for-emotion .edui-icon { + background-position: -60px -20px; + } +.edui-default .edui-for-emotion .edui-popup-content iframe { + width: 514px; + height: 380px; + overflow: hidden; + } +.edui-default .edui-for-emotion .edui-popup-content { + position: relative; + z-index: 555; + } +.edui-default .edui-for-emotion .edui-splitborder { + display: none; + } +.edui-default .edui-for-emotion .edui-splitbutton-body .edui-arrow { + width: 0; + } +.edui-default .edui-toolbar .edui-for-emotion .edui-state-active .edui-splitborder { + border-left: 1px solid transparent; + } +/*contextmenu*/ +.edui-default .edui-hassubmenu .edui-arrow { + float: right; + width: 20px; + height: 20px; + background: url("../images/icons-all.gif") no-repeat 10px -233px; + } +.edui-default .edui-menu-body .edui-menuitem { + padding: 1px; + } +.edui-default .edui-menuseparator { + height: 1px; + margin: 2px 0; + overflow: hidden; + } +.edui-default .edui-menuseparator-inner { + margin-right: 1px; + margin-left: 29px; + border-bottom: 1px solid #e2e3e3; + } +.edui-default .edui-menu-body .edui-state-hover { + padding: 0 !important; + background-color: #fff5d4; + border: 1px solid #dcac6c; + } +/*弹出菜单*/ +.edui-default .edui-shortcutmenu { + width: 190px; + height: 50px; + padding: 2px; + background-color: #fff; + border: 1px solid #ccc; + border-radius: 4px; + } +/*粘贴弹出菜单*/ +.edui-default .edui-wordpastepop .edui-popup-content { + width: 54px; + height: 21px; + padding: 0; + border: none; + } +.edui-default .edui-pasteicon { + width: 100%; + height: 100%; + background-image: url('../images/wordpaste.png'); + background-position: 0 0; + } +.edui-default .edui-pasteicon.edui-state-opened { + background-position: 0 -34px; + } +.edui-default .edui-pastecontainer { + position: relative; + width: 97px; + visibility: hidden; + background: #fff; + border: 1px solid #ccc; + } +.edui-default .edui-pastecontainer .edui-title { + height: 25px; + padding-left: 5px; + font-size: 12px; + font-weight: bold; + line-height: 25px; + background: #f8f8ff; + } +.edui-default .edui-pastecontainer .edui-button { + margin: 3px 0; + overflow: hidden; + } +.edui-default .edui-pastecontainer .edui-button .edui-richtxticon, +.edui-default .edui-pastecontainer .edui-button .edui-tagicon, +.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon { + float: left; + width: 29px; + height: 29px; + margin-left: 5px; + cursor: pointer; + background-image: url('../images/wordpaste.png'); + background-repeat: no-repeat; + } +.edui-default .edui-pastecontainer .edui-button .edui-richtxticon { + margin-left: 0; + background-position: -109px 0; + } +.edui-default .edui-pastecontainer .edui-button .edui-tagicon { + background-position: -148px 1px; + } +.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon { + background-position: -72px 0; + } +.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-richtxticon { + background-position: -109px -34px; + } +.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-tagicon { + background-position: -148px -34px; + } +.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-plaintxticon { + background-position: -72px -34px; + } diff --git a/src/resources/static/js/lib/zui/lib/ueditor/ueditor.min.css b/src/resources/static/js/lib/zui/lib/ueditor/ueditor.min.css new file mode 100644 index 0000000..0900926 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/ueditor/ueditor.min.css @@ -0,0 +1 @@ +.edui-default .edui-box{padding:0;margin:0;overflow:hidden;border:none}.edui-default a.edui-box{display:block;color:#000;text-decoration:none}.edui-default a.edui-box:hover{text-decoration:none}.edui-default a.edui-box:active{text-decoration:none}.edui-default table.edui-box{border-collapse:collapse}.edui-default ul.edui-box{list-style-type:none}div.edui-box{position:relative;display:inline-block!important;vertical-align:top}.edui-default .edui-clearfix{zoom:1}.edui-default .edui-clearfix:after{display:block;clear:both;content:'\20'}* html div.edui-box{display:inline!important}.edui-combox-body,.edui-default .edui-button-body,.edui-menubutton-body,.edui-splitbutton-body{position:relative}.edui-default .edui-popup{position:absolute;-webkit-user-select:none;-moz-user-select:none}.edui-default .edui-popup .edui-shadow{position:absolute;z-index:-1}.edui-default .edui-popup .edui-bordereraser{position:absolute;overflow:hidden}.edui-default .edui-tablepicker .edui-canvas{position:relative}.edui-default .edui-tablepicker .edui-canvas .edui-overlay{position:absolute}.edui-default .edui-dialog-modalmask,.edui-dialog-dragmask{position:absolute;top:0;left:0;width:100%;height:100%}.edui-default .edui-toolbar{position:relative}.edui-default .edui-label{cursor:default}.edui-default span.edui-clickable{color:#00f;text-decoration:underline;cursor:pointer}.edui-default span.edui-unclickable{color:gray;cursor:default}.edui-default .edui-toolbar{width:auto;height:auto;padding:1px;overflow:hidden;cursor:default;zoom:1;-webkit-user-select:none;-moz-user-select:none}.edui-default .edui-toolbar .edui-button,.edui-default .edui-toolbar .edui-combox,.edui-default .edui-toolbar .edui-menubutton,.edui-default .edui-toolbar .edui-splitbutton{margin:1px}.edui-default .edui-editor{position:relative;overflow:visible;background-color:#fff;border:1px solid #d4d4d4;border-radius:4px}.edui-editor div{width:auto;height:auto}.edui-default .edui-editor-toolbarbox{position:relative;zoom:1;border-top-left-radius:4px;border-top-right-radius:4px}.edui-default .edui-editor-toolbarboxouter{background-color:#fafafa;background-repeat:repeat-x;border-bottom:1px solid #d4d4d4;*zoom:1}.edui-default .edui-editor-toolbarboxinner{padding:2px}.edui-default .edui-editor-iframeholder{position:relative}.edui-default .edui-editor-bottomContainer{overflow:hidden}.edui-default .edui-editor-bottomContainer table{width:100%;height:0;overflow:hidden;border-spacing:0}.edui-default .edui-editor-bottomContainer td{font-family:Arial,Helvetica,Tahoma,Verdana,Sans-Serif;font-size:12px;line-height:20px;white-space:nowrap;border-top:1px solid #ccc}.edui-default .edui-editor-wordcount{margin-right:5px;color:#aaa;text-align:right}.edui-default .edui-editor-scale{width:12px}.edui-default .edui-editor-scale .edui-editor-icon{float:right;width:100%;height:12px;margin-top:10px;cursor:se-resize;background:url(../images/scale.png) no-repeat}.edui-default .edui-editor-breadcrumb{margin:2px 0 0 3px}.edui-default .edui-editor-breadcrumb span{color:#00f;text-decoration:underline;cursor:pointer}.edui-default .edui-toolbar .edui-for-fullscreen{float:right}.edui-default .edui-bubble .edui-popup-content{padding:5px;font-family:"宋体";font-size:10pt;background-color:#fff6d9;border:1px solid #dcac6c}.edui-default .edui-editor-toolbarmsg{position:absolute;bottom:-25px;left:0;z-index:1009;width:99.9%;background-color:#fff6d9;border-bottom:1px solid #ccc}.edui-default .edui-editor-toolbarmsg-upload{position:absolute;top:5px;left:350px;width:100px;height:16px;font-size:14px;line-height:16px;color:#00f;cursor:pointer}.edui-default .edui-editor-toolbarmsg-label{padding:4px;font-size:12px;line-height:16px}.edui-default .edui-editor-toolbarmsg-close{float:right;width:20px;height:16px;line-height:16px;color:red;cursor:pointer}.edui-default .edui-list .edui-bordereraser{display:none}.edui-default .edui-listitem{padding:1px;white-space:nowrap}.edui-default .edui-list .edui-state-hover{position:relative;padding:0;background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-for-fontfamily .edui-listitem-label{min-width:130px;height:22px;padding-left:5px;font-size:12px;line-height:22px;_width:120px}.edui-default .edui-for-insertcode .edui-listitem-label{min-width:120px;height:22px;padding-left:5px;font-size:12px;line-height:22px;_width:120px}.edui-default .edui-for-underline .edui-listitem-label{min-width:120px;padding:3px 5px;font-size:12px;_width:120px}.edui-default .edui-for-fontsize .edui-listitem-label{min-width:120px;padding:3px 5px;_width:120px}.edui-default .edui-for-paragraph .edui-listitem-label{min-width:200px;padding:2px 5px;_width:200px}.edui-default .edui-for-rowspacingbottom .edui-listitem-label,.edui-default .edui-for-rowspacingtop .edui-listitem-label{min-width:53px;padding:2px 5px;_width:53px}.edui-default .edui-for-lineheight .edui-listitem-label{min-width:53px;padding:2px 5px;_width:53px}.edui-default .edui-for-customstyle .edui-listitem-label{width:200px!important;min-width:200px;padding:2px 5px;_width:200px}.edui-default .edui-menu{z-index:3000}.edui-default .edui-menu .edui-popup-content{padding:3px}.edui-default .edui-menu-body{min-width:170px;background:url(../images/sparator_v.png) repeat-y 25px;_width:150px}.edui-default .edui-menuitem{height:20px;vertical-align:top;cursor:default}.edui-default .edui-menuitem .edui-icon{width:20px!important;height:20px!important;background:url(../images/icons.png) 0 -4000px;background:url(../images/icons.gif) 0 -4000px\9}.edui-default .edui-menuitem .edui-label{height:20px;padding-left:10px;font-size:12px;line-height:20px}.edui-default .edui-state-checked .edui-menuitem-body{background:url(../images/icons-all.gif) no-repeat 6px -205px}.edui-default .edui-state-disabled .edui-menuitem-label{color:gray}.edui-default .edui-toolbar .edui-combox-body .edui-button-body{width:60px;height:20px;padding-left:5px;margin:0 3px 0 0;font-size:12px;line-height:20px;white-space:nowrap}.edui-default .edui-toolbar .edui-combox-body .edui-arrow{width:9px;height:20px;background:url(../images/icons.png) -741px 0;_background:url(../images/icons.gif) -741px 0}.edui-default .edui-toolbar .edui-combox .edui-combox-body{background-color:#fff;border:1px solid #ccc;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.edui-default .edui-toolbar .edui-combox-body .edui-splitborder{display:none}.edui-default .edui-toolbar .edui-combox-body .edui-arrow{border-left:1px solid #ccc}.edui-default .edui-toolbar .edui-state-hover .edui-combox-body{background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-toolbar .edui-state-hover .edui-combox-body .edui-arrow{border-left:1px solid #dcac6c}.edui-default .edui-toolbar .edui-state-checked .edui-combox-body{background-color:#ffe69f;border:1px solid #dcac6c}.edui-toolbar .edui-state-checked .edui-combox-body .edui-arrow{border-left:1px solid #dcac6c}.edui-toolbar .edui-state-disabled .edui-combox-body{background-color:#f0f0ee;filter:alpha(opacity=30);opacity:.3}.edui-toolbar .edui-state-opened .edui-combox-body{background-color:#fff;border:1px solid gray}.edui-default .edui-toolbar .edui-button .edui-icon,.edui-default .edui-toolbar .edui-menubutton .edui-icon,.edui-default .edui-toolbar .edui-splitbutton .edui-icon{width:20px!important;height:20px!important;background-image:url(../images/icons.png);background-image:url(../images/icons.gif)\9}.edui-default .edui-toolbar .edui-button .edui-button-wrap{position:relative;padding:1px}.edui-default .edui-toolbar .edui-button .edui-state-hover .edui-button-wrap{padding:0;background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-toolbar .edui-button .edui-state-checked .edui-button-wrap{padding:0;background-color:#ffe69f;border:1px solid #dcac6c;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.edui-default .edui-toolbar .edui-button .edui-state-active .edui-button-wrap{padding:0;background-color:#fff;border:1px solid gray}.edui-default .edui-toolbar .edui-state-disabled .edui-label{color:#ccc}.edui-default .edui-toolbar .edui-state-disabled .edui-icon{filter:alpha(opacity=30);opacity:.3}.edui-default .edui-for-undo .edui-icon{background-position:-160px 0}.edui-default .edui-for-redo .edui-icon{background-position:-100px 0}.edui-default .edui-for-bold .edui-icon{background-position:0 0}.edui-default .edui-for-italic .edui-icon{background-position:-60px 0}.edui-default .edui-for-fontborder .edui-icon{background-position:-160px -40px}.edui-default .edui-for-underline .edui-icon{background-position:-140px 0}.edui-default .edui-for-strikethrough .edui-icon{background-position:-120px 0}.edui-default .edui-for-subscript .edui-icon{background-position:-600px 0}.edui-default .edui-for-superscript .edui-icon{background-position:-620px 0}.edui-default .edui-for-blockquote .edui-icon{background-position:-220px 0}.edui-default .edui-for-forecolor .edui-icon{background-position:-720px 0}.edui-default .edui-for-backcolor .edui-icon{background-position:-760px 0}.edui-default .edui-for-inserttable .edui-icon{background-position:-580px -20px}.edui-default .edui-for-autotypeset .edui-icon{background-position:-640px -40px}.edui-default .edui-for-justifyleft .edui-icon{background-position:-460px 0}.edui-default .edui-for-justifycenter .edui-icon{background-position:-420px 0}.edui-default .edui-for-justifyright .edui-icon{background-position:-480px 0}.edui-default .edui-for-justifyjustify .edui-icon{background-position:-440px 0}.edui-default .edui-for-insertorderedlist .edui-icon{background-position:-80px 0}.edui-default .edui-for-insertunorderedlist .edui-icon{background-position:-20px 0}.edui-default .edui-for-lineheight .edui-icon{background-position:-725px -40px}.edui-default .edui-for-rowspacingbottom .edui-icon{background-position:-745px -40px}.edui-default .edui-for-rowspacingtop .edui-icon{background-position:-765px -40px}.edui-default .edui-for-horizontal .edui-icon{background-position:-360px 0}.edui-default .edui-for-link .edui-icon{background-position:-500px 0}.edui-default .edui-for-code .edui-icon{background-position:-440px -40px}.edui-default .edui-for-insertimage .edui-icon{background-position:-726px -77px}.edui-default .edui-for-insertframe .edui-icon{background-position:-240px -40px}.edui-default .edui-for-emoticon .edui-icon{background-position:-60px -20px}.edui-default .edui-for-spechars .edui-icon{background-position:-240px 0}.edui-default .edui-for-help .edui-icon{background-position:-340px 0}.edui-default .edui-for-print .edui-icon{background-position:-440px -20px}.edui-default .edui-for-preview .edui-icon{background-position:-420px -20px}.edui-default .edui-for-selectall .edui-icon{background-position:-400px -20px}.edui-default .edui-for-searchreplace .edui-icon{background-position:-520px -20px}.edui-default .edui-for-map .edui-icon{background-position:-40px -40px}.edui-default .edui-for-gmap .edui-icon{background-position:-260px -40px}.edui-default .edui-for-insertvideo .edui-icon{background-position:-320px -20px}.edui-default .edui-for-time .edui-icon{background-position:-160px -20px}.edui-default .edui-for-date .edui-icon{background-position:-140px -20px}.edui-default .edui-for-cut .edui-icon{background-position:-680px 0}.edui-default .edui-for-copy .edui-icon{background-position:-700px 0}.edui-default .edui-for-paste .edui-icon{background-position:-560px 0}.edui-default .edui-for-formatmatch .edui-icon{background-position:-40px 0}.edui-default .edui-for-pasteplain .edui-icon{background-position:-360px -20px}.edui-default .edui-for-directionalityltr .edui-icon{background-position:-20px -20px}.edui-default .edui-for-directionalityrtl .edui-icon{background-position:-40px -20px}.edui-default .edui-for-source .edui-icon{background-position:-261px 0}.edui-default .edui-for-removeformat .edui-icon{background-position:-580px 0}.edui-default .edui-for-unlink .edui-icon{background-position:-640px 0}.edui-default .edui-for-touppercase .edui-icon{background-position:-786px 0}.edui-default .edui-for-tolowercase .edui-icon{background-position:-806px 0}.edui-default .edui-for-insertrow .edui-icon{background-position:-478px -76px}.edui-default .edui-for-insertrownext .edui-icon{background-position:-498px -76px}.edui-default .edui-for-insertcol .edui-icon{background-position:-455px -76px}.edui-default .edui-for-insertcolnext .edui-icon{background-position:-429px -76px}.edui-default .edui-for-mergeright .edui-icon{background-position:-60px -40px}.edui-default .edui-for-mergedown .edui-icon{background-position:-80px -40px}.edui-default .edui-for-splittorows .edui-icon{background-position:-100px -40px}.edui-default .edui-for-splittocols .edui-icon{background-position:-120px -40px}.edui-default .edui-for-insertparagraphbeforetable .edui-icon{background-position:-140px -40px}.edui-default .edui-for-deleterow .edui-icon{background-position:-660px -20px}.edui-default .edui-for-deletecol .edui-icon{background-position:-640px -20px}.edui-default .edui-for-splittocells .edui-icon{background-position:-800px -20px}.edui-default .edui-for-mergecells .edui-icon{background-position:-760px -20px}.edui-default .edui-for-deletetable .edui-icon{background-position:-620px -20px}.edui-default .edui-for-cleardoc .edui-icon{background-position:-520px 0}.edui-default .edui-for-fullscreen .edui-icon{background-position:-100px -20px}.edui-default .edui-for-anchor .edui-icon{background-position:-200px 0}.edui-default .edui-for-pagebreak .edui-icon{background-position:-460px -40px}.edui-default .edui-for-imagenone .edui-icon{background-position:-480px -40px}.edui-default .edui-for-imageleft .edui-icon{background-position:-500px -40px}.edui-default .edui-for-wordimage .edui-icon{background-position:-660px -40px}.edui-default .edui-for-imageright .edui-icon{background-position:-520px -40px}.edui-default .edui-for-imagecenter .edui-icon{background-position:-540px -40px}.edui-default .edui-for-indent .edui-icon{background-position:-400px 0}.edui-default .edui-for-outdent .edui-icon{background-position:-540px 0}.edui-default .edui-for-webapp .edui-icon{background-position:-601px -40px}.edui-default .edui-for-table .edui-icon{background-position:-580px -20px}.edui-default .edui-for-edittable .edui-icon{background-position:-420px -40px}.edui-default .edui-for-template .edui-icon{background-position:-339px -40px}.edui-default .edui-for-delete .edui-icon{background-position:-360px -40px}.edui-default .edui-for-attachment .edui-icon{background-position:-620px -40px}.edui-default .edui-for-edittd .edui-icon{background-position:-700px -40px}.edui-default .edui-for-snapscreen .edui-icon{background-position:-581px -40px}.edui-default .edui-for-scrawl .edui-icon{background-position:-801px -41px}.edui-default .edui-for-background .edui-icon{background-position:-680px -40px}.edui-default .edui-for-music .edui-icon{background-position:-18px -40px}.edui-default .edui-for-formula .edui-icon{background-position:-200px -40px}.edui-default .edui-for-aligntd .edui-icon{background-position:-236px -76px}.edui-default .edui-for-insertparagraphtrue .edui-icon{background-position:-625px -76px}.edui-default .edui-for-insertparagraph .edui-icon{background-position:-602px -76px}.edui-default .edui-for-insertcaption .edui-icon{background-position:-336px -76px}.edui-default .edui-for-deletecaption .edui-icon{background-position:-362px -76px}.edui-default .edui-for-inserttitle .edui-icon{background-position:-286px -76px}.edui-default .edui-for-deletetitle .edui-icon{background-position:-311px -76px}.edui-default .edui-for-aligntable .edui-icon{background-position:-440px 0}.edui-default .edui-for-tablealignment-left .edui-icon{background-position:-460px 0}.edui-default .edui-for-tablealignment-center .edui-icon{background-position:-420px 0}.edui-default .edui-for-tablealignment-right .edui-icon{background-position:-480px 0}.edui-default .edui-for-drafts .edui-icon{background-position:-560px 0}.edui-default .edui-for-charts .edui-icon{background:url(../images/charts.png) no-repeat 2px 3px!important}.edui-default .edui-for-inserttitlecol .edui-icon{background-position:-673px -76px}.edui-default .edui-for-deletetitlecol .edui-icon{background-position:-698px -76px}.edui-default .edui-for-simpleupload .edui-icon{background-position:-380px 0}.edui-default .edui-toolbar .edui-menubutton-body .edui-arrow,.edui-default .edui-toolbar .edui-splitbutton-body .edui-arrow{width:9px;height:20px;background:url(../images/icons.png) -741px 0;_background:url(../images/icons.gif) -741px 0}.edui-default .edui-toolbar .edui-menubutton .edui-menubutton-body,.edui-default .edui-toolbar .edui-splitbutton .edui-splitbutton-body{padding:1px}.edui-default .edui-toolbar .edui-splitborder{width:1px;height:20px}.edui-default .edui-toolbar .edui-state-hover .edui-splitborder{width:1px;border-left:0 solid #dcac6c}.edui-default .edui-toolbar .edui-state-active .edui-splitborder{width:0;border-left:1px solid gray}.edui-default .edui-toolbar .edui-state-opened .edui-splitborder{width:1px;border:0}.edui-default .edui-toolbar .edui-menubutton .edui-state-hover .edui-menubutton-body,.edui-default .edui-toolbar .edui-splitbutton .edui-state-hover .edui-splitbutton-body{padding:0;background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-toolbar .edui-menubutton .edui-state-checked .edui-menubutton-body,.edui-default .edui-toolbar .edui-splitbutton .edui-state-checked .edui-splitbutton-body{padding:0;background-color:#ffe69f;border:1px solid #dcac6c}.edui-default .edui-toolbar .edui-menubutton .edui-state-active .edui-menubutton-body,.edui-default .edui-toolbar .edui-splitbutton .edui-state-active .edui-splitbutton-body{padding:0;background-color:#fff;border:1px solid gray}.edui-default .edui-state-disabled .edui-arrow{filter:alpha(opacity=30);opacity:.3}.edui-default .edui-toolbar .edui-menubutton .edui-state-opened .edui-menubutton-body,.edui-default .edui-toolbar .edui-splitbutton .edui-state-opened .edui-splitbutton-body{padding:0;background-color:#fff;border:1px solid gray}.edui-default .edui-for-insertorderedlist .edui-bordereraser,.edui-default .edui-for-insertunorderedlist .edui-bordereraser,.edui-default .edui-for-lineheight .edui-bordereraser,.edui-default .edui-for-rowspacingbottom .edui-bordereraser,.edui-default .edui-for-rowspacingtop .edui-bordereraser{background-color:#fff}.edui-default .edui-for-insertorderedlist .edui-popup-body .edui-icon,.edui-default .edui-for-insertunorderedlist .edui-popup-body .edui-icon,.edui-default .edui-for-lineheight .edui-popup-body .edui-icon,.edui-default .edui-for-rowspacingbottom .edui-popup-body .edui-icon,.edui-default .edui-for-rowspacingtop .edui-popup-body .edui-icon{background-image:none}.edui-default .edui-popup{z-index:3000;width:auto;height:auto;background-color:#fff}.edui-default .edui-popup .edui-shadow{top:0;left:0;width:100%;height:100%}.edui-default .edui-popup-content{padding:5px;background:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);*border-right-width:2px;*border-bottom-width:2px}.edui-default .edui-popup .edui-bordereraser{height:3px;background-color:#fff}.edui-default .edui-menu .edui-bordereraser{height:3px}.edui-default .edui-anchor-topleft .edui-bordereraser{top:-2px;left:1px}.edui-default .edui-anchor-topright .edui-bordereraser{top:-2px;right:1px}.edui-default .edui-anchor-bottomleft .edui-bordereraser{bottom:-6px;left:0;height:7px;border-right:1px solid gray;border-left:1px solid gray}.edui-default .edui-anchor-bottomright .edui-bordereraser{right:0;bottom:-6px;height:7px;border-right:1px solid gray;border-left:1px solid gray}.edui-popup div{width:auto;height:auto}.edui-default .edui-editor-messageholder{position:absolute;top:28px;right:3px;display:block;width:150px;height:auto;padding:0;margin:0;border:0}.edui-default .edui-message{position:relative;min-height:10px;padding:0;margin-bottom:3px;text-shadow:0 1px 0 rgba(255,255,255,.5)}.edui-default .edui-message-body{padding:8px 15px 8px 8px;color:#c09853;background-color:#fcf8e3;border:1px solid #fbeed5;border-radius:4px}.edui-default .edui-message-type-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.edui-default .edui-message-type-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.edui-default .edui-message-type-danger,.edui-default .edui-message-type-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.edui-default .edui-message .edui-message-closer{position:absolute;top:0;right:0;display:block;float:right;width:16px;height:16px;padding:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:20px;font-weight:700;line-height:16px;color:#999;text-shadow:0 1px 0 #fff;cursor:pointer;background:0 0;border:0}.edui-default .edui-message .edui-message-content{font-size:10pt;word-break:normal;word-wrap:break-word}.edui-default .edui-dialog{position:absolute;z-index:2000}.edui-dialog div{width:auto}.edui-default .edui-dialog-wrap{margin-right:6px;margin-bottom:6px}.edui-default .edui-dialog-fullscreen-flag{margin-right:0;margin-bottom:0}.edui-default .edui-dialog-body{position:relative;padding:2px 0 0 2px;_zoom:1}.edui-default .edui-dialog-fullscreen-flag .edui-dialog-body{padding:0}.edui-default .edui-dialog-shadow{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);*border-right-width:2px;*border-bottom-width:2px}.edui-default .edui-dialog-foot{background-color:#fff}.edui-default .edui-dialog-titlebar{position:relative;min-height:24px;padding:8px 10px;line-height:24px;cursor:move;border-bottom:1px solid #e5e5e5}.edui-default .edui-dialog-caption{padding-left:5px;font-size:12px;font-weight:700;line-height:26px}.edui-default .edui-dialog-draghandle{height:26px}.edui-default .edui-dialog-closebutton{position:absolute!important;top:4px;right:3px}.edui-default .edui-dialog-closebutton .edui-button-body{width:30px;height:30px;font-size:19.5px;font-weight:700;line-height:30px;color:#000;text-align:center;text-shadow:0 1px 0 #fff;cursor:pointer;filter:alpha(opacity=20);opacity:.2}.edui-default .edui-dialog-closebutton .edui-button-body:before{content:'×'}.edui-default .edui-dialog-closebutton .edui-button-body:hover{filter:alpha(opacity=70);opacity:.7}.edui-default .edui-dialog-foot{height:40px}.edui-default .edui-dialog-buttons{position:absolute;right:0}.edui-default .edui-dialog-buttons .edui-button{margin-right:10px}.edui-default .edui-dialog-buttons .edui-button .edui-button-body{width:96px;height:24px;font-size:12px;line-height:24px;text-align:center;cursor:default;background-color:#f2f2f2;border:1px solid #bfbfbf;border-radius:4px}.edui-default .edui-dialog-buttons .edui-button .edui-state-hover .edui-button-body{background-color:#dedede;border-color:#a1a1a1;-webkit-box-shadow:0 2px 1px rgba(0,0,0,.1);box-shadow:0 2px 1px rgba(0,0,0,.1)}.edui-default .edui-dialog iframe{padding:0;margin:0;vertical-align:top;border:0}.edui-default .edui-dialog-modalmask{position:absolute;background-color:#ccc;filter:alpha(opacity=30);opacity:.3}.edui-default .edui-dialog-dragmask{position:absolute;cursor:move;background-color:transparent}.edui-default .edui-dialog-content{position:relative}.edui-default .dialogcontmask{position:absolute;display:block;width:100%;height:100%;cursor:move;visibility:hidden;filter:alpha(opacity=0);opacity:0}.edui-default .edui-for-link .edui-dialog-content{width:420px;height:200px;overflow:hidden}.edui-default .edui-for-background .edui-dialog-content{width:440px;height:280px;overflow:hidden}.edui-default .edui-for-template .edui-dialog-content{width:630px;height:390px;overflow:hidden}.edui-default .edui-for-scrawl .edui-dialog-content{width:515px;height:360px;*width:506px}.edui-default .edui-for-spechars .edui-dialog-content{width:620px;height:500px;*width:630px;*height:570px}.edui-default .edui-for-insertimage .edui-dialog-content{width:650px;height:400px;overflow:hidden}.edui-default .edui-for-webapp .edui-dialog-content{width:560px;height:450px;overflow:hidden;_width:565px}.edui-default .edui-for-insertframe .edui-dialog-content{width:350px;height:200px;overflow:hidden}.edui-default .edui-for-wordimage .edui-dialog-content{width:620px;height:380px;overflow:hidden}.edui-default .edui-for-attachment .edui-dialog-content{width:650px;height:400px;overflow:hidden}.edui-default .edui-for-map .edui-dialog-content{width:550px;height:400px}.edui-default .edui-for-gmap .edui-dialog-content{width:550px;height:400px}.edui-default .edui-for-insertvideo .edui-dialog-content{width:590px;height:390px}.edui-default .edui-for-anchor .edui-dialog-content{width:320px;height:60px;overflow:hidden}.edui-default .edui-for-searchreplace .edui-dialog-content{width:400px;height:220px}.edui-default .edui-for-help .edui-dialog-content{width:400px;height:420px}.edui-default .edui-for-edittable .edui-dialog-content{width:540px;height:335px;_width:590px}.edui-default .edui-for-edittip .edui-dialog-content{width:225px;height:60px}.edui-default .edui-for-edittd .edui-dialog-content{width:240px;height:50px}.edui-default .edui-for-snapscreen .edui-dialog-content{width:400px;height:220px}.edui-default .edui-for-music .edui-dialog-content{width:515px;height:360px}.edui-default .edui-for-paragraph .edui-listitem-label{font-family:Tahoma,Verdana,Arial,Helvetica}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-p{font-size:22px;line-height:27px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h1{font-size:32px;font-weight:bolder;line-height:36px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h2{font-size:27px;font-weight:bolder;line-height:29px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h3{font-size:19px;font-weight:bolder;line-height:23px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h4{font-size:16px;font-weight:bolder;line-height:19px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h5{font-size:13px;font-weight:bolder;line-height:16px}.edui-default .edui-for-paragraph .edui-listitem-label .edui-for-h6{font-size:12px;font-weight:bolder;line-height:14px}.edui-default .edui-for-inserttable .edui-splitborder{display:none}.edui-default .edui-for-inserttable .edui-splitbutton-body .edui-arrow{width:0}.edui-default .edui-toolbar .edui-for-inserttable .edui-state-active .edui-splitborder{border-left:1px solid transparent}.edui-default .edui-tablepicker .edui-infoarea{width:220px;height:14px;margin-bottom:3px;clear:both;font-size:12px;line-height:14px}.edui-default .edui-tablepicker .edui-infoarea .edui-label{float:left}.edui-default .edui-dialog-buttons .edui-label{line-height:24px}.edui-default .edui-tablepicker .edui-infoarea .edui-clickable{float:right}.edui-default .edui-tablepicker .edui-pickarea{width:220px;height:220px;background:url(../images/unhighlighted.gif) repeat}.edui-default .edui-tablepicker .edui-pickarea .edui-overlay{background:url(../images/highlighted.gif) repeat}.edui-default .edui-colorpicker-topbar{width:200px;height:27px}.edui-default .edui-colorpicker-preview{float:left;width:128px;height:20px;margin-left:1px;border:1px inset #000}.edui-default .edui-colorpicker-nocolor{float:right;height:14px;padding:3px 5px;margin-right:1px;font-size:12px;line-height:14px;cursor:pointer;border:1px solid #333}.edui-default .edui-colorpicker-tablefirstrow{height:30px}.edui-default .edui-colorpicker-colorcell{display:block;width:14px;height:14px;margin:0;cursor:pointer}.edui-default .edui-colorpicker-colorcell:hover{width:14px;height:14px;margin:0}.edui-default .edui-colorpicker-advbtn{display:block;height:20px;text-align:center;cursor:pointer}.arrow_down{background:#fff url(../images/arrow_down.png) no-repeat center}.arrow_up{background:#fff url(../images/arrow_up.png) no-repeat center}.edui-colorpicker-adv{position:relative;display:none;height:180px;overflow:hidden}.edui-colorpicker-hue,.edui-colorpicker-plant{border:solid 1px #666}.edui-colorpicker-pad{position:absolute;top:13px;left:14px;width:150px;height:150px;overflow:hidden;cursor:crosshair;background:red}.edui-colorpicker-cover{position:absolute;top:0;left:0;width:150px;height:150px;background:url(../images/tangram-colorpicker.png) -160px -200px}.edui-colorpicker-padDot{position:absolute;top:0;left:0;z-index:1000;width:11px;height:11px;overflow:hidden;background:url(../images/tangram-colorpicker.png) 0 -200px repeat-x}.edui-colorpicker-sliderMain{position:absolute;top:13px;left:171px;width:19px;height:152px;background:url(../images/tangram-colorpicker.png) -179px -12px no-repeat}.edui-colorpicker-slider{width:100%;height:100%;cursor:pointer}.edui-colorpicker-thumb{position:absolute;top:0;right:-1px;left:-1px;height:3px;cursor:pointer;background:#fff;border:1px solid #000;opacity:.8}.edui-default .edui-autotypesetpicker .edui-autotypesetpicker-body{margin-bottom:3px;clear:both;font-size:12px}.edui-default .edui-autotypesetpicker-body table{border-spacing:2px;border-collapse:separate}.edui-default .edui-autotypesetpicker-body td{font-size:12px;word-wrap:break-word}.edui-default .edui-autotypesetpicker-body td input{margin:3px 3px 3px 4px;*margin:1px 0 0 0}.edui-default .edui-cellalignpicker .edui-cellalignpicker-body{width:70px;font-size:12px;cursor:default}.edui-default .edui-cellalignpicker-body table{border-spacing:0;border-collapse:separate}.edui-default .edui-cellalignpicker-body td{padding:1px}.edui-default .edui-cellalignpicker-body .edui-icon{width:20px;height:20px;padding:1px;background-image:url(../images/table-cell-align.png)}.edui-default .edui-cellalignpicker-body .edui-left{background-position:0 0}.edui-default .edui-cellalignpicker-body .edui-center{background-position:-25px 0}.edui-default .edui-cellalignpicker-body .edui-right{background-position:-51px 0}.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-left{background-position:-73px 0}.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-center{background-position:-98px 0}.edui-default .edui-cellalignpicker-body td.edui-state-hover .edui-right{background-position:-124px 0}.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-left{background-color:#f1f4f5;background-position:-146px 0}.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-center{background-position:-245px 0}.edui-default .edui-cellalignpicker-body td.edui-cellalign-selected .edui-right{background-position:-271px 0}.edui-default .edui-toolbar .edui-separator{width:2px;height:20px;margin:2px 4px 2px 3px;background:url(../images/icons.png) -181px 0;background:url(../images/icons.gif) -181px 0\9}.edui-default .edui-toolbar .edui-colorbutton .edui-colorlump{position:absolute;bottom:1px;left:1px;width:18px;height:4px;overflow:hidden}.edui-default .edui-for-emotion .edui-icon{background-position:-60px -20px}.edui-default .edui-for-emotion .edui-popup-content iframe{width:514px;height:380px;overflow:hidden}.edui-default .edui-for-emotion .edui-popup-content{position:relative;z-index:555}.edui-default .edui-for-emotion .edui-splitborder{display:none}.edui-default .edui-for-emotion .edui-splitbutton-body .edui-arrow{width:0}.edui-default .edui-toolbar .edui-for-emotion .edui-state-active .edui-splitborder{border-left:1px solid transparent}.edui-default .edui-hassubmenu .edui-arrow{float:right;width:20px;height:20px;background:url(../images/icons-all.gif) no-repeat 10px -233px}.edui-default .edui-menu-body .edui-menuitem{padding:1px}.edui-default .edui-menuseparator{height:1px;margin:2px 0;overflow:hidden}.edui-default .edui-menuseparator-inner{margin-right:1px;margin-left:29px;border-bottom:1px solid #e2e3e3}.edui-default .edui-menu-body .edui-state-hover{padding:0!important;background-color:#fff5d4;border:1px solid #dcac6c}.edui-default .edui-shortcutmenu{width:190px;height:50px;padding:2px;background-color:#fff;border:1px solid #ccc;border-radius:4px}.edui-default .edui-wordpastepop .edui-popup-content{width:54px;height:21px;padding:0;border:none}.edui-default .edui-pasteicon{width:100%;height:100%;background-image:url(../images/wordpaste.png);background-position:0 0}.edui-default .edui-pasteicon.edui-state-opened{background-position:0 -34px}.edui-default .edui-pastecontainer{position:relative;width:97px;visibility:hidden;background:#fff;border:1px solid #ccc}.edui-default .edui-pastecontainer .edui-title{height:25px;padding-left:5px;font-size:12px;font-weight:700;line-height:25px;background:#f8f8ff}.edui-default .edui-pastecontainer .edui-button{margin:3px 0;overflow:hidden}.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon,.edui-default .edui-pastecontainer .edui-button .edui-richtxticon,.edui-default .edui-pastecontainer .edui-button .edui-tagicon{float:left;width:29px;height:29px;margin-left:5px;cursor:pointer;background-image:url(../images/wordpaste.png);background-repeat:no-repeat}.edui-default .edui-pastecontainer .edui-button .edui-richtxticon{margin-left:0;background-position:-109px 0}.edui-default .edui-pastecontainer .edui-button .edui-tagicon{background-position:-148px 1px}.edui-default .edui-pastecontainer .edui-button .edui-plaintxticon{background-position:-72px 0}.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-richtxticon{background-position:-109px -34px}.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-tagicon{background-position:-148px -34px}.edui-default .edui-pastecontainer .edui-button .edui-state-hover .edui-plaintxticon{background-position:-72px -34px} \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/uploader/.pydio b/src/resources/static/js/lib/zui/lib/uploader/.pydio new file mode 100644 index 0000000..a3a9075 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/uploader/.pydio @@ -0,0 +1 @@ +25fdfc72-e18a-447c-a840-602dc7308611 \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/uploader/Moxie.swf b/src/resources/static/js/lib/zui/lib/uploader/Moxie.swf new file mode 100644 index 0000000..ca29775 Binary files /dev/null and b/src/resources/static/js/lib/zui/lib/uploader/Moxie.swf differ diff --git a/src/resources/static/js/lib/zui/lib/uploader/Moxie.xap b/src/resources/static/js/lib/zui/lib/uploader/Moxie.xap new file mode 100644 index 0000000..70ef069 Binary files /dev/null and b/src/resources/static/js/lib/zui/lib/uploader/Moxie.xap differ diff --git a/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.css b/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.css new file mode 100644 index 0000000..f5a49ef --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.css @@ -0,0 +1,613 @@ +/*! + * ZUI: 文件上传 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +.uploader { + position: relative; + margin-bottom: 20px; + } +.uploader-btn-hidden { + position: absolute; + top: -1px; + left: -1px; + width: 1px; + height: 1px; + opacity: 0; + } +.file-dragable { + position: relative; + } +[data-drop-placeholder]:before { + position: absolute; + top: 0; + left: 0; + z-index: 10; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + width: 100%; + height: 100%; + font-size: 16px; + text-align: center; + pointer-events: none; + content: attr(data-drop-placeholder); + background-color: rgba(255, 240, 213, .5); + filter: alpha(opacity=0); + border: 2px dashed #f1a325; + opacity: 0; + -webkit-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; + -webkit-transform: scale(.95); + -ms-transform: scale(.95); + -o-transform: scale(.95); + transform: scale(.95); + + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + } +.ie [data-drop-placeholder]:before { + display: none !important; + } +.file-dragable[data-drop-placeholder]:before { + filter: alpha(opacity=100); + opacity: 1; + -webkit-transform: scale(1); + -ms-transform: scale(1); + -o-transform: scale(1); + transform: scale(1); + } +.file-drag-enter[data-drop-placeholder]:before { + background-color: #fff0d5; + border-style: solid; + } +.uploader-files, +.file-list { + position: relative; + min-height: 32px; + margin-bottom: 10px; + border: 1px solid #ddd; + } +.uploader-files[data-drag-placeholder]:before, +.file-list[data-drag-placeholder]:before { + position: absolute; + top: 50%; + right: 0; + left: 0; + display: block; + margin-top: -15px; + line-height: 32px; + color: #ddd; + text-align: center; + pointer-events: none; + content: attr(data-drag-placeholder); + -webkit-transition: all .4s; + -o-transition: all .4s; + transition: all .4s; + } +.uploader-files[data-drag-placeholder]:hover:before, +.file-list[data-drag-placeholder]:hover:before { + color: #808080; + } +.uploader-files .file-icon, +.file-list .file-icon { + position: relative; + width: 32px; + height: 32px; + line-height: 32px; + text-align: center; + filter: alpha(opacity=70); + opacity: .7; + -webkit-transition: opacity .4s; + -o-transition: opacity .4s; + transition: opacity .4s; + } +.uploader-files .file-icon-image, +.file-list .file-icon-image { + position: absolute; + top: 5px; + right: 5px; + bottom: 5px; + left: 5px; + background-color: #fff; + background-repeat: no-repeat; + background-position: center; + -webkit-background-size: cover; + background-size: cover; + border: 1px solid #ddd; + } +.uploader-files .file-name, +.file-list .file-name { + text-decoration: none; + -webkit-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; + } +.uploader-files .file-name[contenteditable], +.file-list .file-name[contenteditable] { + padding: 0 5px; + background-color: #fff; + outline: 1px solid #3280fc; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #97befd; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #97befd; + } +.uploader-files .file-name, +.file-list .file-name, +.uploader-files .file-size, +.file-list .file-size { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +.uploader-files .file-renaming .file-name[contenteditable], +.file-list .file-renaming .file-name[contenteditable] { + text-overflow: initial; + } +.uploader-files .file:hover .file-name, +.file-list .file:hover .file-name { + color: #3280fc; + } +.uploader-files .file:hover .file-icon, +.file-list .file:hover .file-icon { + opacity: 1; + } +.uploader-files .file-status, +.file-list .file-status { + display: inline-block; + line-height: 20px; + text-align: right; + } +.uploader-files .file-status:hover, +.file-list .file-status:hover { + background-color: rgba(0, 0, 0, .07); + } +.uploader-files .file-status > .icon, +.file-list .file-status > .icon { + line-height: 20px; + vertical-align: middle; + opacity: 1; + -webkit-transition: all .8s; + -o-transition: all .8s; + transition: all .8s; + -webkit-transform: scale(1); + -ms-transform: scale(1); + -o-transform: scale(1); + transform: scale(1); + } +.uploader-files .file-status > .icon:before, +.file-list .file-status > .icon:before { + content: '\e653'; + } +.uploader-files .file-status > .text, +.file-list .file-status > .text { + display: inline-block; + padding: 0 6px; + font-size: 12px; + line-height: 20px; + } +.uploader-files .file-status > .text:empty, +.file-list .file-status > .text:empty { + display: none; + } +.uploader-files .file[data-status="uploading"] .file-status > .icon, +.file-list .file[data-status="uploading"] .file-status > .icon { + filter: alpha(opacity=0); + opacity: 0; + -webkit-transform: scale(0); + -ms-transform: scale(0); + -o-transform: scale(0); + transform: scale(0); + } +.uploader-files .file[data-status="uploading"] .file-status > .text, +.file-list .file[data-status="uploading"] .file-status > .text { + color: #fff; + background-color: #3280fc; + border-radius: 10px; + } +.uploader-files .file[data-status="queue"] .file-status, +.file-list .file[data-status="queue"] .file-status { + color: #f1a325; + } +.uploader-files .file[data-status="queue"] .file-status > .icon:before, +.file-list .file[data-status="queue"] .file-status > .icon:before { + content: '\e6cd'; + } +.uploader-files .file[data-status="failed"] .file-status, +.file-list .file[data-status="failed"] .file-status { + color: #ea644a; + } +.uploader-files .file[data-status="failed"] .file-status > .icon:before, +.file-list .file[data-status="failed"] .file-status > .icon:before { + content: '\e66a'; + } +.uploader-files .file[data-status="done"] .file-status, +.file-list .file[data-status="done"] .file-status { + color: #38b03f; + } +.uploader-files .file .actions > .btn-reset-file, +.file-list .file .actions > .btn-reset-file, +.uploader-files .file .actions > .btn-download-file, +.file-list .file .actions > .btn-download-file, +.uploader-files .file[data-status="failed"] .actions > .btn-rename-file, +.file-list .file[data-status="failed"] .actions > .btn-rename-file, +.uploader-files .file[data-status="uploading"] .actions > .btn, +.file-list .file[data-status="uploading"] .actions > .btn, +.uploader-files .file[data-status="done"] .actions > .btn, +.file-list .file[data-status="done"] .actions > .btn { + display: none; + } +.uploader-files .file[data-status="done"] .actions > .btn-download-file[href], +.file-list .file[data-status="done"] .actions > .btn-download-file[href], +.uploader-files.file-show-rename-action-on-done .file[data-status="done"] .actions > .btn-rename-file, +.file-list.file-show-rename-action-on-done .file[data-status="done"] .actions > .btn-rename-file, +.uploader-files.file-show-delete-action-on-done .file[data-status="done"] .actions > .btn-delete-file, +.file-list.file-show-delete-action-on-done .file[data-status="done"] .actions > .btn-delete-file, +.uploader-files .file[data-status="failed"] .actions > .btn-reset-file, +.file-list .file[data-status="failed"] .actions > .btn-reset-file { + display: inline-block; + } +.uploader-files.file-rename-by-click [data-status="queue"] .file-name:hover, +.file-list.file-rename-by-click [data-status="queue"] .file-name:hover { + background-color: rgba(255, 255, 255, .5); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #97befd; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #97befd; + } +.uploader-files .file-progress-bar, +.file-list .file-progress-bar { + position: absolute; + top: 0; + bottom: 0; + left: 0; + z-index: 10; + pointer-events: none; + background-color: rgba(50, 128, 252, .1); + filter: alpha(opacity=0); + -webkit-box-shadow: inset 0 -2px #3280fc; + box-shadow: inset 0 -2px #3280fc; + opacity: 0; + -webkit-transition: width .6s ease, opacity .4s; + -o-transition: width .6s ease, opacity .4s; + transition: width .6s ease, opacity .4s; + } +.uploader-files .file[data-status="uploading"] .file-progress-bar, +.file-list .file[data-status="uploading"] .file-progress-bar { + filter: alpha(opacity=100); + opacity: 1; + } +.uploader-files .file[data-status="queue"], +.file-list .file[data-status="queue"] { + background-color: #fff0d5; + } +.uploader-files .file[data-status="failed"], +.file-list .file[data-status="failed"] { + background-color: #ffe5e0; + } +.uploader-files .file[data-status="done"], +.file-list .file[data-status="done"] { + background-color: #fff; + } +.uploader-actions { + background-color: #f1f1f1; + } +.file-list + .uploader-actions { + margin-top: -10px; + border: 1px solid #ddd; + border-top: none; + } +.uploader-actions .uploader-status { + padding: 5px 10px; + line-height: 20px; + } +.uploader-message { + position: absolute; + top: 0; + right: 0; + left: 0; + z-index: 1; + display: none; + padding: 5px 10px; + color: #fff; + background: #3280fc; + filter: alpha(opacity=95); + opacity: .95; + } +.uploader-message > .close { + position: absolute; + top: 3px; + right: 10px; + color: inherit; + text-shadow: none; + opacity: .4; + } +.uploader-message > .close:hover { + opacity: 1; + } +.uploader-message[data-type="danger"] { + background: #ea644a; + } +.uploader-message[data-type="warning"] { + background: #f1a325; + } +.uploader-message[data-type="info"] { + background: #03b8cf; + } +.uploader-message[data-type="success"] { + background: #38b03f; + } +.file-list .file { + position: relative; + z-index: 0; + background-color: #fff; + -webkit-transition: background .4s; + -o-transition: background .4s; + transition: background .4s; + } +.file-list .file + .file { + border-top: 1px solid #ddd; + } +.file-list .file-wrapper { + position: relative; + z-index: 2; + display: table; + width: 100%; + table-layout: fixed; + -webkit-transition: background .4s; + -o-transition: background .4s; + transition: background .4s; + } +.file-list .file-wrapper:hover { + background-color: rgba(0, 0, 0, .05); + } +.file-list .file-wrapper > .file-icon, +.file-list .file-wrapper > .content, +.file-list .file-wrapper > .actions { + display: table-cell; + vertical-align: middle; + } +.file-list .file-wrapper > .actions { + width: 150px; + text-align: right; + } +.file-list .file-wrapper > .actions > .btn { + padding: 5px 8px; + } +.file-list .file-wrapper > .actions > .btn:hover { + background-color: rgba(0, 0, 0, .07); + } +.file-list .file-name { + display: block; + } +.file-list .file-wrapper > .content > .file-name { + float: left; + } +.file-list .file-wrapper > .content > .file-size { + float: right; + margin-top: 2px; + } +.file-list .file-wrapper > .actions > .btn { + border-radius: 0; + } +.file-list .file-status { + padding: 5px; + } +.file-list-lg .file { + min-height: 50px; + } +.file-list-lg .file-icon { + width: 50px; + line-height: 50px; + } +.file-list-lg .file-icon .icon { + position: relative; + display: block; + width: 50px; + font-size: 28px; + line-height: 50px; + text-align: center; + } +.file-list-lg .file-icon .icon-file-o { + position: relative; + left: -2px; + } +.file-list-lg .file-status { + line-height: 40px; + } +.file-list-lg .file-status > .icon { + font-size: 20px; + } +.file-list-lg .file[data-status="done"] .file-status { + padding: 5px 12px; + } +.file-list-lg .file-wrapper > .content > .file-name { + float: none; + line-height: 20px; + } +.file-list-lg .file-wrapper > .content > .file-size { + float: none; + line-height: 14px; + } +.file-list-lg .file-wrapper > .actions > .btn { + padding: 14px 8px; + } +.file-list-lg .file-renaming .file-name[contenteditable] { + font-size: 14px; + line-height: 34px; + } +.file-list-lg .file-renaming .file-wrapper > .content > .file-size { + display: none; + } +.file-list-grid { + margin-right: -8px; + margin-left: -8px; + border: none; + } +.file-list-grid:before, +.file-list-grid:after { + display: table; + content: " "; + } +.file-list-grid:after { + clear: both; + } +.file-list-grid .file { + display: block; + float: left; + width: 120px; + height: 120px; + margin: 8px 8px 35px 8px; + border: 1px solid #ddd; + border-radius: 4px; + } +.file-list-grid .file .file-icon { + display: block; + width: 118px; + height: 118px; + overflow: hidden; + } +.file-list-grid .file-icon > .icon { + font-size: 70px; + line-height: 118px; + } +.file-list-grid .file-icon-image { + top: -1px; + right: -1px; + bottom: -1px; + left: -1px; + border: none; + } +.file-list-grid .file-wrapper { + position: absolute; + top: 0; + right: 0; + left: 0; + display: block; + width: auto; + } +.file-list-grid .file-wrapper > .content { + position: absolute; + right: -1px; + bottom: -24px; + left: -1px; + display: block; + text-align: center; + -webkit-transition: all .2s; + -o-transition: all .2s; + transition: all .2s; + } +.file-list-grid .file-wrapper > .content > .file-name { + position: relative; + z-index: 5; + float: none; + padding: 4px 0; + line-height: 16px; + border: 1px solid transparent; + } +.file-list-grid .file-wrapper > .content > .file-size { + position: absolute; + top: -24px; + left: 4px; + display: block; + padding: 0 5px; + line-height: 18px; + color: #fff; + background-color: #808080; + background-color: rgba(0, 0, 0, .5); + filter: alpha(opacity=0); + border-radius: 9px; + opacity: 0; + -webkit-transition: opacity .4s; + -o-transition: opacity .4s; + transition: opacity .4s; + } +.file-list-grid .file-renaming .file-wrapper > .content > .file-name, +.file-list-grid .file-wrapper > .content:hover > .file-name { + text-overflow: initial; + word-break: break-all; + white-space: normal; + background-color: #fff; + border-color: #ddd; + -webkit-box-shadow: none; + box-shadow: none; + } +.file-list-grid .file-renaming .file-wrapper > .content > .file-name { + padding: 4px; + text-align: left; + } +.file-list-grid .file[data-status="uploading"] .file-wrapper > .content > .file-size, +.file-list-grid .file:hover .file-wrapper > .content > .file-size { + filter: alpha(opacity=100); + opacity: 1; + } +.file-list-grid .file-wrapper > .actions { + position: absolute; + top: 0; + right: 0; + left: 0; + display: block; + width: 118px; + } +.file-list-grid .file-wrapper:hover > .actions { + background: rgba(255, 255, 255, .85); + } +.file-list-grid .file-wrapper > .actions > .file-status { + position: absolute; + top: 0; + left: 0; + height: 28px; + padding: 4px 5px; + } +.file-list-grid .file-wrapper > .actions > .file-status > .icon { + position: relative; + top: -1px; + display: inline-block; + font-size: 21px; + text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; + } +.file-list-grid .file-wrapper > .actions > .file-status > .text { + padding: 0; + } +.file-list-grid .file[data-status="failed"] .file-wrapper > .actions > .file-status > .icon { + font-size: 14px; + text-shadow: none; + } +.file-list-grid .file[data-status="uploading"] .file-wrapper > .actions > .file-status > .text { + position: absolute; + top: 4px; + left: 4px; + padding: 0 8px; + } +.file-list-grid .file[data-status="failed"] .file-wrapper > .actions > .file-status { + top: 4px; + left: 4px; + height: 20px; + padding: 0 8px; + color: #fff; + background-color: #ea644a; + border-radius: 10px; + } +.file-list-grid .file-wrapper > .actions > .btn { + padding: 3px 6px; + filter: alpha(opacity=0); + opacity: 0; + } +.file-list-grid .file-wrapper:hover > .actions > .btn { + filter: alpha(opacity=100); + opacity: 1; + } +.file-list-grid .file-progress-bar { + -webkit-box-shadow: inset 0 -4px #3280fc; + box-shadow: inset 0 -4px #3280fc; + } +.file-list-grid + .uploader-actions { + border: none; + } diff --git a/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.js b/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.js new file mode 100644 index 0000000..2cfdfec --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.js @@ -0,0 +1,939 @@ +/*! + * ZUI: 文件上传 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ + +/** + * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill + * v1.5.7 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2017-11-03 + */ +!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r0&&c(n,function(n,u){var c=-1!==h(e(n),["array","object"]);return n===r||t&&o[u]===r?!0:(c&&i&&(n=a(n)),e(o[u])===e(n)&&c?s(t,i,[o[u],n]):o[u]=n,void 0)})}),o}function u(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.parent=t.prototype,e}function c(e,t){var i,n,r,o;if(e){try{i=e.length}catch(a){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function l(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function d(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++ri;i++)if(t[i]===e)return i}return-1}function f(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===h(t[r],i)&&n.push(t[r]);return n.length?n:!1}function p(e,t){var i=[];return c(e,function(e){-1!==h(e,t)&&i.push(e)}),i.length?i:null}function g(e){var t,i=[];for(t=0;ti;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:E,typeOf:e,extend:t,extendIf:i,extendImmutable:n,extendImmutableIf:r,clone:o,inherit:u,each:c,isEmptyObj:l,inSeries:d,inParallel:m,inArray:h,arrayDiff:f,arrayIntersect:p,toArray:g,trim:x,sprintf:w,parseSizeStr:v,delay:y}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},i=function(e,i){if("function"==typeof window.atob)return i?t(window.atob(e)):window.atob(e);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!e)return e;e+="";do a=d.indexOf(e.charAt(m++)),s=d.indexOf(e.charAt(m++)),u=d.indexOf(e.charAt(m++)),c=d.indexOf(e.charAt(m++)),l=a<<18|s<<12|u<<6|c,n=255&l>>16,r=255&l>>8,o=255&l,p[h++]=64==u?String.fromCharCode(n):64==c?String.fromCharCode(n,r):String.fromCharCode(n,r,o);while(m>18,s=63&l>>12,u=63&l>>6,c=63&l,p[h++]=d.charAt(a)+d.charAt(s)+d.charAt(u)+d.charAt(c);while(mn;n++)if(e[n]!=t[n]){if(e[n]=u(e[n]),t[n]=u(t[n]),e[n]t[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",i="?",n="function",r="undefined",o="object",a="name",s="version",u={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},c={rgx:function(){for(var t,i,a,s,u,c,l,d=0,m=arguments;d0?2==u.length?t[u[0]]=typeof u[1]==n?u[1].call(this,l):u[1]:3==u.length?t[u[0]]=typeof u[1]!==n||u[1].exec&&u[1].test?l?l.replace(u[1],u[2]):e:l?u[1].call(this,l,u[2]):e:4==u.length&&(t[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):e):t[u]=l?l:e;break}if(c)break}return t},str:function(t,n){for(var r in n)if(typeof n[r]===o&&n[r].length>0){for(var a=0;a=")),i.use_blob_uri},use_data_uri:function(){var e=new Image;return e.onload=function(){i.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return i.use_data_uri&&("IE"!==a.browser||a.version>=9)},use_data_uri_of:function(e){return i.use_data_uri&&33e3>e||i.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),i.use_fileinput=!e.disabled},use_webgl:function(){var e,n=document.createElement("canvas"),r=null;try{r=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(o){}return r||(r=null),e=!!r,i.use_webgl=e,n=t,e}};return function(t){var n=[].slice.call(arguments);return n.shift(),"function"===e.typeOf(i[t])?i[t].apply(this,n):!!i[t]}}(),o=(new n).getResult(),a={can:r,uaParser:n,browser:o.browser.name,version:o.browser.version,os:o.os.name,osVersion:o.os.version,verComp:i,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return a.OS=a.os,a}),n("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:function(){function i(e,i){this.code=e,this.name=t(n,e),this.message=this.name+(i||": RuntimeError "+this.code)}var n={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(i,n),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": ImageError "+this.code}var n={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(i,n),i.prototype=Error.prototype,i}(),FileException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": FileException "+this.code}var n={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(i,n),i.prototype=Error.prototype,i}(),DOMException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": DOMException "+this.code}var n={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(i,n),i.prototype=Error.prototype,i}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),n("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){if(!e.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)},n=function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,i){function n(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===c.compatMode?c.documentElement:c.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}var r,o,a,s=0,u=0,c=document;if(t=t,i=i||c.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!c.documentMode||c.documentMode<8))return o=n(t),a=n(i),{x:o.x-a.x,y:o.y-a.y};for(r=t;r&&r!=i&&r.nodeType;)s+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)s-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;return{x:s,y:u}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:i,addClass:n,removeClass:r,getStyle:o,getPos:a,getSize:s}}),n("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(e,t,i){function n(){this.uid=i.guid()}var r={};return i.extend(n.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(e,t,n,o){var a,s=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),e=i.trim(e),/\s/.test(e)?(i.each(e.split(/\s+/),function(e){s.addEventListener(e,t,n,o)}),void 0):(e=e.toLowerCase(),n=parseInt(n,10)||0,a=r[this.uid]&&r[this.uid][e]||[],a.push({fn:t,priority:n,scope:o||this}),r[this.uid]||(r[this.uid]={}),r[this.uid][e]=a,void 0)},hasEventListener:function(e){var t;return e?(e=e.toLowerCase(),t=r[this.uid]&&r[this.uid][e]):t=r[this.uid],t?t:!1},removeEventListener:function(e,t){var n,o,a=this;if(e=e.toLowerCase(),/\s/.test(e))return i.each(e.split(/\s+/),function(e){a.removeEventListener(e,t)}),void 0;if(n=r[this.uid]&&r[this.uid][e]){if(t){for(o=n.length-1;o>=0;o--)if(n[o].fn===t){n.splice(o,1);break}}else n=[];n.length||(delete r[this.uid][e],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(e){var n,o,a,s,u,c={},l=!0;if("string"!==i.typeOf(e)){if(s=e,"string"!==i.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=s.type,s.total!==u&&s.loaded!==u&&(c.total=s.total,c.loaded=s.loaded),c.async=s.async||!1}if(-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),c.type=e,a.unshift(c);var d=[];i.each(o,function(e){a[0].target=e.scope,c.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&i.inSeries(d,function(e){l=!e})}return l},bindOnce:function(e,t,i,n){var r=this;r.bind.call(this,e,function o(){return r.unbind(e,o),t.apply(this,arguments)},i,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)}),i.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===i.typeOf(t[e])&&(t[e]=null)})}}),n.instance=new n,n}),n("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(e,t,i,n){function r(e,n,o,s,u){var c,l=this,d=t.guid(n+"_"),m=u||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(m=r.getMode(s,e.preferred_caps,m)),c=function(){var e={};return{exec:function(t,i,n,r){return c[i]&&(e[t]||(e[t]={context:this,instance:new c[i]}),e[t].instance[n])?e[t].instance[n].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var i=this;t.each(e,function(e,n){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(n)})}}}(),t.extend(this,{initialized:!1,uid:d,type:n,mode:r.getMode(s,e.required_caps,m),shimid:d+"_container",clients:0,options:e,can:function(e,i){var n=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(i)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],n))return!1;return!0}return"function"===t.typeOf(n[e])?n[e].call(this,i):i===n[e]},getShimContainer:function(){var e,n=i.get(this.shimid);return n||(e=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(n),e=null),n},getShim:function(){return c},shimExec:function(e,t){var i=[].slice.call(arguments,2);return l.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return l[e]&&l[e][t]?l[e][t].apply(this,i):l.shimExec.apply(this,arguments)},destroy:function(){if(l){var e=i.get(this.shimid);e&&e.parentNode.removeChild(e),c&&c.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=l=c=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return a[e]?a[e]:!1},r.addConstructor=function(e,t){t.prototype=n.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var i={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){i[e]=!0}),i)},r.can=function(e,t){var i,n,o=r.getConstructor(e);return o?(i=new o({required_caps:t}),n=i.mode,i.destroy(),!!n):!1},r.thatCan=function(e,t){var i=(t||r.order).split(/\s*,\s*/);for(var n in i)if(r.can(i[n],e))return i[n];return null},r.getMode=function(e,i,n){var r=null;if("undefined"===t.typeOf(n)&&(n="browser"),i&&!t.isEmptyObj(e)){if(t.each(i,function(i,n){if(e.hasOwnProperty(n)){var o=e[n](i);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(n,r)?n:r[0];if(r===!1)return!1}return n},r.getGlobalEventTarget=function(){if(/^moxie\./.test(e.global_event_dispatcher)&&!e.can("access_global_ns")){var i=t.guid("moxie_event_target_");window[i]=function(e,t){n.instance.dispatchEvent(e,t)},e.global_event_dispatcher=i}return e.global_event_dispatcher},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),n("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(e,t,i,n){return function(){var e;i.extend(this,{connectRuntime:function(r){function o(i){var a,u;return i.length?(a=i.shift().toLowerCase(),(u=n.getConstructor(a))?(e=new u(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,s.ruid=e.uid,s.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(i)}),e.bind("Exception",function(e,i){var n=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,n))}),e.mode?(e.init(),void 0):(e.trigger("Error"),void 0)):(o(i),void 0)):(s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),e=null,void 0)}var a,s=this;if("string"===i.typeOf(r)?a=r:"string"===i.typeOf(r.ruid)&&(a=r.ruid),a){if(e=n.getRuntime(a))return s.ruid=a,e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null},can:function(t){return e?e.can(t):!1}})}}),n("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(e,t,i){function n(o,a){function s(t,i,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new n(null,{type:o,size:i-t}),a.detach(s.substr(t,a.size)),a):null}i.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,i){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var i=e.indexOf(";base64,");this.type=e.substring(5,i),e=t.atob(e.substring(i+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return n}),n("moxie/core/I18n",["moxie/core/utils/Basic"],function(e){var t={};return{addI18n:function(i){return e.extend(t,i)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),n("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(e,t){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb xlt xla,application/vnd.ms-powerpoint,ppt pps pot ppa,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",n={},r={},o=function(e){var t,i,o,a=e.split(/,/);for(t=0;ta;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):n.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(i){t.each(n,function(e){i(e.value,e.name)}),e&&i(e.value,e.name)},destroy:function(){e=null,n=[]}})}return n}),n("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u,c,l,d){function m(){this.uid=e.guid("uid_")}function h(){function i(e,t){return I.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?I[e]:A[e]:(l.can("define_property")?I[e]=t:A[e]=t,void 0):void 0}function u(t){function n(){_&&(_.destroy(),_=null),s.dispatchEvent("loadend"),s=null}function r(r){_.bind("LoadStart",function(e){i("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),L&&s.upload.dispatchEvent(e)}),_.bind("Progress",function(e){i("readyState")!==h.LOADING&&(i("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),_.bind("UploadProgress",function(e){L&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),_.bind("Load",function(t){i("readyState",h.DONE),i("status",Number(r.exec.call(_,"XMLHttpRequest","getStatus")||0)),i("statusText",f[i("status")]||""),i("response",r.exec.call(_,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),U=r.exec.call(_,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),i("status")>0?(L&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(F=!0,s.dispatchEvent("error")),n()}),_.bind("Abort",function(e){s.dispatchEvent(e),n()}),_.bind("Error",function(e){F=!0,i("readyState",h.DONE),s.dispatchEvent("readystatechange"),M=!0,s.dispatchEvent(e),n()}),r.exec.call(_,"XMLHttpRequest","send",{url:x,method:v,async:T,user:w,password:y,headers:S,mimeType:D,encoding:O,responseType:s.responseType,withCredentials:s.withCredentials,options:k},t)}var s=this;E=(new Date).getTime(),_=new a,"string"==typeof k.required_caps&&(k.required_caps=o.parseCaps(k.required_caps)),k.required_caps=e.extend({},k.required_caps,{return_response_type:s.responseType}),t instanceof c&&(k.required_caps.send_multipart=!0),e.isEmptyObj(S)||(k.required_caps.send_custom_headers=!0),B||(k.required_caps.do_cors=!0),k.ruid?r(_.connectRuntime(k)):(_.bind("RuntimeInit",function(e,t){r(t)}),_.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),_.connectRuntime(k))}function g(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),E=b=null}var x,v,w,y,E,b,_,R,A=this,I={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,S={},O=null,D=null,N=!1,C=!1,L=!1,M=!1,F=!1,B=!1,P=null,H=null,k={},U="";e.extend(this,I,{uid:e.guid("uid_"),upload:new m,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||n.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(v=o.toUpperCase()),~e.inArray(v,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=n.utf8_encode(a),l=r.parseUrl(a),B=r.hasSameOrigin(l),x=r.resolveUrl(a),(u||c)&&!B)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(w=u||l.user,y=c||l.pass,T=s||!0,T===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);N=!T,C=!1,S={},g.call(this),i("readyState",h.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(i("readyState")!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||n.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(S[r]?S[r]+=", "+o:S[r]=o,!0)},hasRequestHeader:function(e){return e&&S[e.toLowerCase()]||!1},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),F||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(R||(R={},e.each(U.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=e.trim(i[0]),R[i[0].toLowerCase()]={header:i[0],value:e.trim(i[1])})})),R.hasOwnProperty(t))?R[t].header+": "+R[t].value:null},overrideMimeType:function(n){var r,o;if(~e.inArray(i("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n=e.trim(n.toLowerCase()),/;/.test(n)&&(r=n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(n=r[1],r[2]&&(o=r[2])),!d.mimes[n])throw new t.DOMException(t.DOMException.SYNTAX_ERR);P=n,H=o},send:function(i,r){if(k="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof s)k.ruid=i.ruid,D=i.type||"application/octet-stream";else if(i instanceof c){if(i.hasBlob()){var o=i.getBlob();k.ruid=o.ruid,D=o.type||"application/octet-stream"}}else"string"==typeof i&&(O="UTF-8",D="text/plain;charset=UTF-8",i=n.utf8_encode(i));this.withCredentials||(this.withCredentials=k.required_caps&&k.required_caps.send_browser_cookies&&!B),L=!N&&this.upload.hasEventListener(),F=!1,M=!i,N||(C=!0),u.call(this,i)},abort:function(){if(F=!0,N=!1,~e.inArray(i("readyState"),[h.UNSENT,h.OPENED,h.DONE]))i("readyState",h.UNSENT);else{if(i("readyState",h.DONE),C=!1,!_)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);_.getRuntime().exec.call(_,"XMLHttpRequest","abort",M),M=!0}},destroy:function(){_&&("function"===e.typeOf(_.destroy)&&_.destroy(),_=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(p.concat(["readystatechange"])),this.upload.handleEventProps(p)}var f={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};m.prototype=i.instance;var p=["loadstart","progress","abort","error","load","timeout","loadend"];return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=i.instance,h}),n("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i,n){function r(){function n(){l=d=0,c=this.result=null}function o(t,i){var n=this;u=i,n.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(n.state,[r.IDLE,r.DONE])&&a.call(n)},999),n.bind("TransportingComplete",function(){d=l,n.state=r.DONE,c=null,n.result=u.exec.call(n,"Transporter","getAsBlob",t||"")},999),n.state=r.BUSY,n.trigger("TransportingStarted"),a.call(n)}function a(){var e,i=this,n=l-d;m>n&&(m=n),e=t.btoa(c.substr(d,m)),u.exec.call(i,"Transporter","receive",e,l)}var s,u,c,l,d,m;i.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,i,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),m=r.chunk_size,n.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,i,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,i,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),n.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),n.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=n.instance,r}),n("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(e,t,i,n,r,o,a,s,u,c,l,d,m){function h(){function n(e){try{return e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name),!0}catch(t){return this.trigger("error",t.code),!1}}function c(t){var n=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);p.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===n)"data:"===t.substr(0,5)?c.call(this,new l(null,{data:t}),arguments[1]):x.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function p(t,i){var n=this.connectRuntime(t.ruid);this.ruid=n.uid,n.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(i)?!0:i)}function g(t,i){function n(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=o.parseCaps(i.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):n(this.connectRuntime(t.ruid))}function x(e,t){var i,n=this;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){c.apply(this,arguments)},resize:function(t){var n,r,o=this,a={x:0,y:0,width:o.width,height:o.height},s=e.extendIf({width:o.width,height:o.height,type:o.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t);try{if(!o.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(o.width>h.MAX_RESIZE_WIDTH||o.height>h.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if(n=o.meta&&o.meta.tiff&&o.meta.tiff.Orientation||1,-1!==e.inArray(n,[5,6,7,8])){var u=s.width;s.width=s.height,s.height=u}if(s.crop){switch(r=Math.max(s.width/o.width,s.height/o.height),t.fit?(a.width=Math.min(Math.ceil(s.width/r),o.width),a.height=Math.min(Math.ceil(s.height/r),o.height),r=s.width/a.width):(a.width=Math.min(s.width,o.width),a.height=Math.min(s.height,o.height),r=1),"boolean"==typeof s.crop&&(s.crop="cc"),s.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":a.x=o.width-a.width,a.y=o.height-a.height;break;case"cb":case"center-bottom":a.x=Math.floor((o.width-a.width)/2),a.y=o.height-a.height;break;case"lb":case"left-bottom":a.x=0,a.y=o.height-a.height;break;case"lt":case"left-top":a.x=0,a.y=0;break;case"ct":case"center-top":a.x=Math.floor((o.width-a.width)/2),a.y=0;break;case"rt":case"right-top":a.x=o.width-a.width,a.y=0;break;case"rc":case"right-center":case"right-middle":a.x=o.width-a.width,a.y=Math.floor((o.height-a.height)/2);break;case"lc":case"left-center":case"left-middle":a.x=0,a.y=Math.floor((o.height-a.height)/2);break;case"cc":case"center-center":case"center-middle":default:a.x=Math.floor((o.width-a.width)/2),a.y=Math.floor((o.height-a.height)/2)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0)}else r=Math.min(s.width/o.width,s.height/o.height),r>1&&!s.fit&&(r=1);this.exec("Image","resize",a,r,s)}catch(c){o.trigger("error",c.code)}},downsize:function(t){var i,n={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,fit:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?e.extend(n,t):e.extend(n,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]}),this.resize(i)},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return this.exec("Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return m.atob(i.substring(i.indexOf("base64,")+7))},embed:function(n,r){function o(t,r){var o=this;if(u.can("create_canvas")){var l=o.getAsCanvas();if(l)return n.appendChild(l),l=null,o.destroy(),c.trigger("embedded"),void 0}var d=o.getAsDataURL(t,r);if(!d)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",d.length))n.innerHTML='',o.destroy(),c.trigger("embedded");else{var h=new s;h.bind("TransportingComplete",function(){a=c.connectRuntime(this.result.ruid),c.bind("Embedded",function(){e.extend(a.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),a=null},999),a.exec.call(c,"ImageView","display",this.result.uid,width,height),o.destroy()}),h.transport(m.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:n})}}var a,c=this,l=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,fit:!0,resample:"nearest"},r);try{if(!(n=t.get(n)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT;var d=new h;return d.bind("Resize",function(){o.call(this,l.type,l.quality)}),d.bind("Load",function(){this.downsize(l)}),this.meta.thumb&&this.meta.thumb.width>=l.width&&this.meta.thumb.height>=l.height?d.load(this.meta.thumb.data):d.clone(this,!1),d}catch(f){this.trigger("error",f.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.meta&&this.meta.thumb&&this.meta.thumb.data.destroy(),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){return n.call(this)},999)}var f=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=8192,h.MAX_RESIZE_HEIGHT=8192,h.prototype=c.instance,h}),n("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue,l=e.extend({access_binary:u(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!s.Image},display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:u(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:u(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==n.browser||n.verComp(n.version,9,">"))}()),filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),return_response_headers:c,return_response_type:function(e){return"json"===e&&window.JSON?!0:n.can("return_response_type",e)},return_status_code:c,report_upload_progress:u(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&n.can("create_canvas")},select_file:function(){return n.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===n.browser&&n.verComp(n.version,21,">=")||"Firefox"===n.browser&&n.verComp(n.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===n.browser&&"Windows"===n.os||"iOS"===n.os&&n.verComp(n.osVersion,"7.0.0",">")&&n.verComp(n.osVersion,"8.0.0","<"))},send_binary_string:u(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:u(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:u(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:c,use_http_method:c},arguments[2]);i.call(this,t,arguments[1]||a,l),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(e,t,i){var n;if(!window.File.prototype.slice)return(n=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?n.call(e,t,i):null;try{return e.slice(),e.slice(t,i)}catch(r){return e.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))},this.destroy=function(){this.getRuntime().getShim().removeInstance(this.uid)}}return e.Blob=i}),n("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(e){function t(){this.returnValue=!1}function i(){this.cancelBubble=!0}var n={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=i,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),n.hasOwnProperty(o[r])||(n[o[r]]={}),l=n[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,i,o){var a,s;if(i=i.toLowerCase(),t[r]&&n[t[r]]&&n[t[r]][i]){a=n[t[r]][i];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(i,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+i,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete n[t[r]][i],e.isEmptyObj(n[t[r]])){delete n[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,i){t&&t[r]&&e.each(n[t[r]],function(e,n){a(t,n,i)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),n("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){var e,s;i.extend(this,{init:function(u){var c,l,d,m,h,f,p=this,g=p.getRuntime();e=u,d=o.extList2mimes(e.accept,g.can("filter_by_extension")),l=g.getShimContainer(),l.innerHTML='",c=n.get(g.uid),i.extend(c.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=n.get(e.browse_button),s=n.getStyle(m,"z-index")||"auto",g.can("summon_file_dialog")&&("static"===n.getStyle(m,"position")&&(m.style.position="relative"),r.addEvent(m,"click",function(e){var t=n.get(g.uid);t&&!t.disabled&&t.click(),e.preventDefault()},p.uid),p.bind("Refresh",function(){h=parseInt(s,10)||1,n.get(e.browse_button).style.zIndex=h,this.getRuntime().getShimContainer().style.zIndex=h-1})),f=g.can("summon_file_dialog")?m:l,r.addEvent(f,"mouseover",function(){p.trigger("mouseenter")},p.uid),r.addEvent(f,"mouseout",function(){p.trigger("mouseleave")},p.uid),r.addEvent(f,"mousedown",function(){p.trigger("mousedown")},p.uid),r.addEvent(n.get(e.container),"mouseup",function(){p.trigger("mouseup")},p.uid),(g.can("summon_file_dialog")?c:m).setAttribute("tabindex",-1),c.onchange=function x(){if(p.files=[],i.each(this.files,function(i){var n="";return e.directory&&"."==i.name?!0:(i.webkitRelativePath&&(n="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(g.uid,i),i.relativePath=n,p.files.push(i),void 0)}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=x}p.files.length&&p.trigger("change")},p.trigger({type:"ready",async:!0}),l=null},setOption:function(e,t){var i=this.getRuntime(),r=n.get(i.uid);switch(e){case"accept":if(t){var a=t.mimes||o.extList2mimes(t,i.can("filter_by_extension"));r.setAttribute("accept",a.join(","))}else r.removeAttribute("accept");break;case"directory":t&&i.can("select_folder")?(r.setAttribute("directory",""),r.setAttribute("webkitdirectory","")):(r.removeAttribute("directory"),r.removeAttribute("webkitdirectory"));break;case"multiple":t&&i.can("select_multiple")?r.setAttribute("multiple",""):r.removeAttribute("multiple")}},disable:function(e){var t,i=this.getRuntime();(t=n.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var t=this.getRuntime(),i=t.getShim(),o=t.getShimContainer(),a=e&&n.get(e.container),u=e&&n.get(e.browse_button);a&&r.removeAllEvents(a,this.uid),u&&(r.removeAllEvents(u,this.uid),u.style.zIndex=s),o&&(r.removeAllEvents(o,this.uid),o.innerHTML=""),i.removeInstance(this.uid),e=o=a=u=i=null}})}return e.FileInput=s}),n("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,t,i,n,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=i.toArray(e.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function a(e,i){if(u(e)){var n=new t(f,e);n.relativePath=i||"",p.push(n)}}function s(e){for(var t=[],n=0;n=")&&u.verComp(u.version,7,"<"),f="Android Browser"===u.browser,p=!1;if(h=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),m=c(),m.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(p=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),p=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return e.call(s,i,r),void 0;if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}m.upload?(i.withCredentials&&(m.withCredentials=!0),m.addEventListener("load",function(e){s.trigger(e)}),m.addEventListener("error",function(e){s.trigger(e)}),m.addEventListener("progress",function(e){s.trigger(e)}),m.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):m.onreadystatechange=function(){switch(m.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=m.getResponseHeader("Content-Length")||0),m.responseText&&(t=m.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:m.onreadystatechange=function(){};try{if(m.status>=200&&m.status<400){s.trigger("load");break}}catch(r){}s.trigger("error")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){m.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in m&&(m.responseType="json"!==i.responseType||u.can("return_response_type","json")?i.responseType:"text"),p?m.sendAsBinary?m.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;i>r;r++)n[r]=this[e](t+r);return n}}),t}),n("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,t){return function i(n){var r,o,a,s=[],u=0;if(r=new e(n),65496!==r.SHORT(0))throw r.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(o=2;o<=r.length();)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;u=r.SHORT(o+2)+2,a>=65505&&65519>=a&&s.push({hex:a,name:"APP"+(15&a),start:o,length:u,segment:r.SEGMENT(o,u)}),o+=u}return r.clear(),{headers:s,restore:function(t){var i,n,r;for(r=new e(t),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,i=s.length;i>n;n++)r.SEGMENT(o,0,s[n].segment),o+=s[n].length;return t=r.SEGMENT(),r.clear(),t},strip:function(t){var n,r,o,a;for(o=new i(t),r=o.headers,o.purge(),n=new e(t),a=r.length;a--;)n.SEGMENT(r[a].start,r[a].length,"");return t=n.SEGMENT(),n.clear(),t},get:function(e){for(var t=[],i=0,n=s.length;n>i;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;r>i&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),n("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,i,n){function r(o){function a(i,r){var o,a,s,u,c,m,h,f,p=this,g=[],x={},v={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},w={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(o=p.SHORT(i),a=0;o>a;a++)if(g=[],h=i+2+12*a,s=r[p.SHORT(h)],s!==t){if(u=v[p.SHORT(h+=2)],c=p.LONG(h+=2),m=w[u],!m)throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(h+=4,m*c>4&&(h=p.LONG(h)+d.tiffHeader),h+m*c>=this.length())throw new n.ImageError(n.ImageError.INVALID_META_ERR);"ASCII"!==u?(g=p.asArray(u,h,c),f=1==c?g[0]:g,x[s]=l.hasOwnProperty(s)&&"object"!=typeof f?l[s][f]:f):x[s]=e.trim(p.STRING(h,c).replace(/\0$/,""))}return x}function s(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=c[e.toLowerCase()];for(var u in s)if(s[u]===t){t=u;break}}n=d[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var l=0;r>l;l++)if(o=n+12*l+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(m){return!1}return!0}var u,c,l,d,m,h;if(i.call(this,o),c={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},m=d.tiffHeader,u={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return h||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,c.exif)}catch(i){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n=65472&&65475>=t)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}function s(){var e,t,i=d.thumb();return i&&(e=new n(i),t=a(e),e.clear(),t)?(t.data=i,t):null}function u(){d&&l&&c&&(d.clear(),l.purge(),c.clear(),m=l=d=c=null)}var c,l,d,m;if(c=new n(o),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new i(o);try{d=new r(l.get("app1")[0])}catch(h){}m=a.call(this),e.extend(this,{type:"image/jpeg",size:c.length(),width:m&&m.width||0,height:m&&m.height||0,setExif:function(t,i){return d?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,i),l.set("app1",d.SEGMENT()),void 0):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):l.restore(o)},stripHeaders:function(e){return l.strip(e)},purge:function(){u.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),n("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(e,t,i){function n(n){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),n=l=u=c=s=null)}function a(e){var t,i,n,r;return t=s.LONG(e),i=s.STRING(e+=4,4),n=e+=4,r=s.LONG(e+t),{length:t,type:i,start:n,CRC:r}}var s,u,c,l;s=new i(n),function(){var t=0,i=0,n=[35152,20039,3338,6666];for(i=0;ii.height?"width":"height",a=Math.round(i[o]*n),s=!1;"nearest"!==r&&(.5>n||n>2)&&(n=.5>n?.5:2,s=!0);var u=t(i,n);return s?e(u,a/u[o],r):u}function t(e,t){var i=e.width,n=e.height,r=Math.round(i*t),o=Math.round(n*t),a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),e=null,a}return{scale:e}}),n("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(){if(!v&&!g)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return v||g}function c(){var t=e();return"canvas"==t.nodeName.toLowerCase()?t:(v=document.createElement("canvas"),v.width=t.width,v.height=t.height,v.getContext("2d").drawImage(t,0,0),v)}function l(e){return n.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+n.btoa(e)}function m(e){var t=this;g=new Image,g.onerror=function(){p.call(this),t.trigger("error",i.ImageError.WRONG_FORMAT)},g.onload=function(){t.trigger("load")},g.src="data:"==e.substr(0,5)?e:d(e,y.type)}function h(e,t){var n,r=this;return window.FileReader?(n=new FileReader,n.onload=function(){t.call(r,this.result)},n.onerror=function(){r.trigger("error",i.ImageError.WRONG_FORMAT)},n.readAsDataURL(e),void 0):t.call(this,e.getAsDataURL())}function f(e,i){var n=Math.PI/180,r=document.createElement("canvas"),o=r.getContext("2d"),a=e.width,s=e.height;switch(t.inArray(i,[5,6,7,8])>-1?(r.width=s,r.height=a):(r.width=a,r.height=s),i){case 2:o.translate(a,0),o.scale(-1,1);break;case 3:o.translate(a,s),o.rotate(180*n);break;case 4:o.translate(0,s),o.scale(1,-1);break;case 5:o.rotate(90*n),o.scale(1,-1);break;case 6:o.rotate(90*n),o.translate(0,-s);break;case 7:o.rotate(90*n),o.translate(a,-s),o.scale(-1,1);break;case 8:o.rotate(-90*n),o.translate(-a,0)}return o.drawImage(e,0,0,a,s),r}function p(){x&&(x.purge(),x=null),w=g=v=y=null,b=!1}var g,x,v,w,y,E=this,b=!1,_=!0;t.extend(this,{loadFromBlob:function(e){var t=this.getRuntime(),n=arguments.length>1?arguments[1]:!0;if(!t.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return y=e,e.isDetached()?(w=e.getSource(),m.call(this,w),void 0):(h.call(this,e.getSource(),function(e){n&&(w=l(e)),m.call(this,e)}),void 0)},loadFromImage:function(e,t){this.meta=e.meta,y=new o(null,{name:e.name,size:e.size,type:e.type}),m.call(this,t?w=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t,i=this.getRuntime();return!x&&w&&i.can("access_image_binary")&&(x=new a(w)),t={width:e().width||0,height:e().height||0,type:y.type||u.getFileMime(y.name),size:w&&w.length||y.size||0,name:y.name||"",meta:null},_&&(t.meta=x&&x.meta||this.meta||{},!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof r||(t.meta.thumb.data=new r(null,{type:"image/jpeg",data:t.meta.thumb.data}))),t},resize:function(t,i,n){var r=document.createElement("canvas");if(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(e(),t.x,t.y,t.width,t.height,0,0,r.width,r.height),v=s.scale(r,i),_=n.preserveHeaders,!_){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;v=f(v,o)}this.width=v.width,this.height=v.height,b=!0,this.trigger("Resize")},getAsCanvas:function(){return v||(v=c()),v.id=this.uid+"_canvas",v},getAsBlob:function(e,t){return e!==this.type?(b=!0,new o(null,{name:y.name||"",type:e,data:E.getAsDataURL(e,t)})):new o(null,{name:y.name||"",type:e,data:E.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return g.src;if(c(),"image/jpeg"!==e)return v.toDataURL("image/png");try{return v.toDataURL("image/jpeg",t/100)}catch(i){return v.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return w||(w=l(E.getAsDataURL(e,t))),w;if("image/jpeg"!==e)w=l(E.getAsDataURL(e,t));else{var i;t||(t=90),c();try{i=v.toDataURL("image/jpeg",t/100)}catch(n){i=v.toDataURL("image/jpeg")}w=l(i),x&&(w=x.stripHeaders(w),_&&(x.meta&&x.meta.exif&&x.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),w=x.writeHeaders(w)),x.purge(),x=null)}return b=!1,w},destroy:function(){E=null,p.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),n("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function s(e){var n=i.get(e);n&&"OBJECT"==n.nodeName&&("IE"===t.browser?(n.style.display="none",function r(){4==n.readyState?u(e):setTimeout(r,10)}()):n.parentNode.removeChild(n))}function u(e){var t=i.get(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function c(u){var c,m=this;u=e.extend({swf_url:t.swf_url},u),o.call(this,u,l,{access_binary:function(e){return e&&"browser"===m.mode},access_image_binary:function(e){return e&&"browser"===m.mode},display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===m.mode},resize_image:o.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===m.mode},return_status_code:function(t){return"browser"===m.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:function(e){return e&&"browser"===m.mode},send_browser_cookies:function(e){return e&&"browser"===m.mode},send_custom_headers:function(e){return e&&"browser"===m.mode},send_multipart:o.capTrue,slice_blob:function(e){return e&&"browser"===m.mode},stream_upload:function(e){return e&&"browser"===m.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===m.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),a()<11.3&&(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return m.getShim().exec(this.uid,e,t,i)},init:function(){var i,r,a;a=this.getShimContainer(),e.extend(a.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),i=''+''+''+''+"","IE"===t.browser?(r=document.createElement("div"),a.appendChild(r),r.outerHTML=i,r=a=null):a.innerHTML=i,c=setTimeout(function(){m&&!m.initialized&&m.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){s(m.uid),e.call(m),clearTimeout(c),u=c=e=m=null}}(this.destroy)},d)}var l="flash",d={};return o.addConstructor(l,c),d}),n("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={slice:function(e,i,n,r){var o=this.getRuntime();return 0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),e=o.shimExec.call(this,"Blob","slice",i,n,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=i}),n("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){var r={init:function(e){var r=this,o=this.getRuntime(),a=i.get(e.browse_button);a&&(a.setAttribute("tabindex",-1),a=null),this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],n.each(e,function(e){r.files.push(new t(o.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=r}),n("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n=this;return n.result="","readAsDataURL"===e&&(n.result="data:"+(t.type||"")+";base64,"),n.bind("Progress",function(t,r){r&&(n.result+=i(r,e))},999),n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=n}),n("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n,r=this.getRuntime();return(n=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(n="data:"+(t.type||"")+";base64,"+n),i(n,e,t.type)):null}};return e.FileReaderSync=n}),n("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={getAsBlob:function(e){var i=this.getRuntime(),n=i.shimExec.call(this,"Transporter","getAsBlob",e);return n?new t(i.uid,n):null}};return e.Transporter=i}),n("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,t,i,n,r,o,a,s){var u={send:function(e,n){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,n)}function o(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),n=null,r()}function u(e,t){var i=new s;i.bind("TransportingComplete",function(){t(this.result)}),i.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),n instanceof a){var d;if(n.each(function(e,t){e instanceof i?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),n.hasBlob()){var m=n.getBlob();m.isDetached()?u(m,function(e){m.destroy(),o(d,e)}):o(d,m)}else n=null,r()}else n instanceof i?n.isDetached()?u(n,function(e){n.destroy(),n=e.uid,r()}):(n=n.uid,r()):r()},getResponse:function(e){var i,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new n(a.uid,o),"blob"===e)return o;try{if(i=new r,~t.inArray(e,["","text"]))return i.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(i.readAsText(o))}finally{o.destroy()}}return null},abort:function(){var e=this.getRuntime();e.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=u}),n("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,i,n,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(n,"Image","loadFromBlob",e.uid),n=r=null}var n=this,r=n.getRuntime();if(e.isDetached()){var o=new i;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return t.meta&&t.meta.thumb&&t.meta.thumb.data&&!(e.meta.thumb.data instanceof n)&&(t.meta.thumb.data=new n(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var i=this.getRuntime(),r=i.shimExec.call(this,"Image","getAsBlob",e,t);return r?new n(i.uid,r):null},getAsDataURL:function(){var e,t=this.getRuntime(),i=t.Image.getAsBlob.apply(this,arguments);return i?(e=new r,e.readAsDataURL(i)):null}};return e.Image=o}),n("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(e){var t,i,n,r,o,a=!1,s=null,u=0;try{try{s=new ActiveXObject("AgControl.AgControl"),s.IsVersionSupported(e)&&(a=!0),s=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(t=l.description,"1.0.30226.2"===t&&(t="2.0.30226.2"),i=t.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(n=e.split(".");n.length>4;)n.pop();do r=parseInt(n[u],10),o=parseInt(i[u],10),u++;while(u=r&&!isNaN(r)&&(a=!0)}}}catch(d){a=!1}return a}function s(s){var l,d=this;s=e.extend({xap_url:t.xap_url},s),o.call(this,s,u,{access_binary:o.capTrue,access_image_binary:o.capTrue,display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:o.capTrue,resize_image:o.capTrue,return_response_headers:function(e){return e&&"client"===d.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===d.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:o.capTrue,send_browser_cookies:function(e){return e&&"browser"===d.mode},send_custom_headers:function(e){return e&&"client"===d.mode},send_multipart:o.capTrue,slice_blob:o.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:o.capTrue,use_http_method:function(t){return"client"===d.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),a("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(e,t){var i=[].slice.call(arguments,2);return d.getShim().exec(this.uid,e,t,i)},init:function(){var e;e=this.getShimContainer(),e.innerHTML=''+''+''+''+''+''+"",l=setTimeout(function(){d&&!d.initialized&&d.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(d),clearTimeout(l),s=l=e=d=null}}(this.destroy)},c)}var u="silverlight",c={};return o.addConstructor(u,s),c}),n("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){return e.Blob=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){function r(e){for(var t="",i=0;ii;i++)t=s.keys[i],a=s[t],a&&(/^(\d|[1-9]\d+)$/.test(a)?a=parseInt(a,10):/^\d*\.\d+$/.test(a)&&(a=parseFloat(a)),r.meta[e][t]=a)}),r.meta&&r.meta.thumb&&r.meta.thumb.data&&!(e.meta.thumb.data instanceof i)&&(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue;i.call(this,t,a,{access_binary:u(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return s.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:c,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html4",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){function e(){var o,c,d,m,h,f,p=this,g=p.getRuntime();f=i.guid("uid_"),o=g.getShimContainer(),s&&(d=n.get(s+"_form"),d&&(i.extend(d.style,{top:"100%"}),d.firstChild.setAttribute("tabindex",-1))),m=document.createElement("form"),m.setAttribute("id",f+"_form"),m.setAttribute("method","post"),m.setAttribute("enctype","multipart/form-data"),m.setAttribute("encoding","multipart/form-data"),i.extend(m.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=document.createElement("input"),h.setAttribute("id",f),h.setAttribute("type","file"),h.setAttribute("accept",l.join(",")),g.can("summon_file_dialog")&&h.setAttribute("tabindex",-1),i.extend(h.style,{fontSize:"999px",opacity:0}),m.appendChild(h),o.appendChild(m),i.extend(h.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&i.extend(h.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),h.onchange=function(){var i;this.value&&(i=this.files?this.files[0]:{name:this.value},i=new t(g.uid,i),this.onchange=function(){},e.call(p),p.files=[i],h.setAttribute("id",i.uid),m.setAttribute("id",i.uid+"_form"),p.trigger("change"),h=m=null)},g.can("summon_file_dialog")&&(c=n.get(u.browse_button),r.removeEvent(c,"click",p.uid),r.addEvent(c,"click",function(e){h&&!h.disabled&&h.click(),e.preventDefault()},p.uid)),s=f,o=d=c=null}var s,u,c,l=[];i.extend(this,{init:function(t){var i,a=this,s=a.getRuntime();u=t,l=o.extList2mimes(t.accept,s.can("filter_by_extension")),i=s.getShimContainer(),function(){var e,o,l;e=n.get(t.browse_button),c=n.getStyle(e,"z-index")||"auto",s.can("summon_file_dialog")?("static"===n.getStyle(e,"position")&&(e.style.position="relative"),a.bind("Refresh",function(){o=parseInt(c,10)||1,n.get(u.browse_button).style.zIndex=o,this.getRuntime().getShimContainer().style.zIndex=o-1})):e.setAttribute("tabindex",-1),l=s.can("summon_file_dialog")?e:i,r.addEvent(l,"mouseover",function(){a.trigger("mouseenter")},a.uid),r.addEvent(l,"mouseout",function(){a.trigger("mouseleave")},a.uid),r.addEvent(l,"mousedown",function(){a.trigger("mousedown")},a.uid),r.addEvent(n.get(t.container),"mouseup",function(){a.trigger("mouseup")},a.uid),e=null}(),e.call(this),i=null,a.trigger({type:"ready",async:!0})},setOption:function(e,t){var i,r=this.getRuntime();"accept"==e&&(l=t.mimes||o.extList2mimes(t,r.can("filter_by_extension"))),i=n.get(s),i&&i.setAttribute("accept",l.join(","))},disable:function(e){var t;(t=n.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),o=u&&n.get(u.container),a=u&&n.get(u.browse_button);o&&r.removeAllEvents(o,this.uid),a&&(r.removeAllEvents(a,this.uid),a.style.zIndex=c),i&&(r.removeAllEvents(i,this.uid),i.innerHTML=""),t.removeInstance(this.uid),s=l=u=i=o=a=t=null}})}return e.FileInput=s}),n("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),n("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,t,i,n,r,o,a,s){function u(){function e(e){var t,n,r,a,s=this,u=!1;if(l){if(t=l.id.replace(/_iframe$/,""),n=i.get(t+"_form")){for(r=n.getElementsByTagName("input"),a=r.length;a--;)switch(r[a].getAttribute("type")){case"hidden":r[a].parentNode.removeChild(r[a]);break;case"file":u=!0}r=[],u||n.parentNode.removeChild(n),n=null}setTimeout(function(){o.removeEvent(l,"load",s.uid),l.parentNode&&l.parentNode.removeChild(l);var t=s.getRuntime().getShimContainer();t.children.length||t.parentNode.removeChild(t),t=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,m){function h(){var i=w.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='',l=r.firstChild,i.appendChild(l),o.addEvent(l,"load",function(){var i;try{i=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?u=i.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(i.body.innerHTML),v.trigger({type:"progress",loaded:c.length,total:c.length}),x&&v.trigger({type:"uploadprogress",loaded:x.size||1025,total:x.size||1025}))}catch(r){if(!n.hasSameOrigin(d.url))return e.call(v,function(){v.trigger("error")}),void 0;u=404}e.call(v,function(){v.trigger("load")})},v.uid)}var f,p,g,x,v=this,w=v.getRuntime();if(u=c=null,m instanceof s&&m.hasBlob()){if(x=m.getBlob(),f=x.uid,g=i.get(f),p=i.get(f+"_form"),!p)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else f=t.guid("uid_"),p=document.createElement("form"),p.setAttribute("id",f+"_form"),p.setAttribute("method",d.method),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),w.getShimContainer().appendChild(p);p.setAttribute("target",f+"_iframe"),m instanceof s&&m.each(function(e,i){if(e instanceof a)g&&g.setAttribute("name",i);else{var n=document.createElement("input");t.extend(n,{type:"hidden",name:i,value:e}),g?p.insertBefore(n,g):p.appendChild(n)}}),p.setAttribute("action",d.url),h(),p.submit(),v.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})},destroy:function(){this.getRuntime().getShim().removeInstance(this.uid)}})}return e.XMLHttpRequest=u}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)}); +/** + * Plupload - multi-runtime File Uploader + * v2.3.6 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2017-11-03 + */ +!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.plupload};"function"==typeof define&&define.amd?define("plupload",["./moxie"],i):"object"==typeof module&&module.exports?module.exports=i(require("./moxie")):e.plupload=i(e.moxie)}(this||window,function(e){!function(e,t,i){function n(e){function t(e,t,i){var r={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};r[e]?n[r[e]]=t:i||(n[e]=t)}var i=e.required_features,n={};return"string"==typeof i?l.each(i.split(/\s*,\s*/),function(e){t(e,!0)}):"object"==typeof i?l.each(i,function(e,i){t(i,e)}):i===!0&&(e.chunk_size&&e.chunk_size>0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart!==!1||(n.send_binary_string=!0),e.http_method&&(n.use_http_method=e.http_method),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,s={},a=t.core.utils,o=t.runtime.Runtime,l={VERSION:"2.3.6",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,moxie:t,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=o.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){s[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),i(!1),void 0;i(!0)}),l.addFileFilter("prevent_empty",function(e,t,n){e&&!t.size&&t.size!==i?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),n(!1)):n(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t0?Math.ceil(100*(e.loaded/e.size)):100,d()}function d(){var e,t,n,r=0;for(I.reset(),e=0;eS)&&(r+=n),I.loaded+=n):I.size=i,t.status==l.DONE?I.uploaded++:t.status==l.FAILED?I.failed++:I.queued++;I.size===i?I.percent=D.length>0?Math.ceil(100*(I.uploaded/D.length)):0:(I.bytesPerSec=Math.ceil(r/((+new Date-S||1)/1e3)),I.percent=I.size>0?Math.ceil(100*(I.loaded/I.size)):0)}function c(){var e=F[0]||P[0];return e?e.getRuntime().uid:!1}function f(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",b),this.bind("BeforeUpload",m),this.bind("UploadFile",_),this.bind("UploadProgress",E),this.bind("StateChanged",v),this.bind("QueueChanged",d),this.bind("Error",R),this.bind("FileUploaded",y),this.bind("Destroy",z)}function p(e,i){var n=this,r=0,s=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:x,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){s.push(function(s){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,F.push(this),s()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){U||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,s()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){s.push(function(i){var s=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));s.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,P.push(this),i()},s.ondrop=function(){n.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,i()}),s.init()})}),l.inSeries(s,function(){"function"==typeof i&&i(r)})}function g(e,n,r,s){var a=new t.image.Image;try{a.onload=function(){n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),s(e)):a.downsize(n.width,n.height,n.crop,n.preserve_headers)},a.onresize=function(){var t=this.getAsBlob(e.type,n.quality);this.destroy(),s(t)},a.bind("error runtimeerror",function(){this.destroy(),s(e)}),a.load(e,r)}catch(o){s(e)}}function h(e,i,r){function s(e,i,n){var r=O[e];switch(e){case"max_file_size":"max_file_size"===e&&(O.max_file_size=O.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(O[e]=i,O.send_file_name=!0);break;case"multipart":O[e]=i,i||(O.send_file_name=!0);break;case"http_method":O[e]="PUT"===i.toUpperCase()?"PUT":"POST";break;case"unique_names":O[e]=i,i&&(O.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(O.filters,i):O.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),O.filters.mime_types=i.mime_types);break;case"resize":O.resize=i?l.extend({preserve_headers:!0,crop:!1},i):!1;break;case"prevent_duplicates":O.prevent_duplicates=O.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":O[e]=i,n||(u=!0);break;default:O[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){s(t,e,r)}):s(e,i,r),r?(O.required_features=n(l.extend({},O)),x=n(l.extend({},O,{required_features:!0}))):u&&(a.trigger("Destroy"),p.call(a,O,function(e){e?(a.runtime=o.getInfo(c()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function m(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function _(e,i){function n(){c-->0?r(s,1e3):(i.loaded=p,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()}))}function s(){var t,n,r={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(r.name=i.target_name||i.name),d&&f.chunks&&o.size>d?(n=Math.min(d,o.size-p),t=o.slice(p,p+n)):(n=o.size,t=o),d&&f.chunks&&(e.settings.send_chunk_number?(r.chunk=Math.ceil(p/d),r.chunks=Math.ceil(o.size/d)):(r.offset=p,r.total=o.size)),e.trigger("BeforeChunkUpload",i,r,t,p)&&a(r,t,n))}function a(a,d,g){var m;T=new t.xhr.XMLHttpRequest,T.upload&&(T.upload.onprogress=function(t){i.loaded=Math.min(i.size,p+t.loaded),e.trigger("UploadProgress",i)}),T.onload=function(){return T.status<200||T.status>=400?(n(),void 0):(c=e.settings.max_retries,g=o.size?(i.size!=i.origSize&&(o.destroy(),o=null),e.trigger("UploadProgress",i),i.status=l.DONE,i.completeTimestamp=+new Date,e.trigger("FileUploaded",i,{response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()})):r(s,1),void 0)},T.onerror=function(){n()},T.onloadend=function(){this.destroy()},e.settings.multipart&&f.multipart?(T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),m=new t.xhr.FormData,l.each(l.extend(a,e.settings.multipart_params),function(e,t){m.append(t,e)}),m.append(e.settings.file_data_name,d),T.send(m,h)):(u=l.buildUrl(e.settings.url,l.extend(a,e.settings.multipart_params)),T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),T.hasRequestHeader("Content-Type")||T.setRequestHeader("Content-Type","application/octet-stream"),T.send(d,h))}var o,u=e.settings.url,d=e.settings.chunk_size,c=e.settings.max_retries,f=e.features,p=0,h={runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:x,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url};i.loaded&&(p=i.loaded=d?d*Math.floor(i.loaded/d):0),o=i.getSource(),l.isEmptyObj(e.settings.resize)||-1===l.inArray(o.type,["image/jpeg","image/png"])?s():g(o,e.settings.resize,h,function(e){o=e,i.size=e.size,s()})}function E(e,t){u(t)}function v(e){if(e.state==l.STARTED)S=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,d())}function b(){T&&T.abort()}function y(e){d(),r(function(){a.call(e)},1)}function R(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,t.file.completeTimestamp=+new Date,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function z(e){e.stop(),l.each(D,function(e){e.destroy()}),D=[],F.length&&(l.each(F,function(e){e.destroy()}),F=[]),P.length&&(l.each(P,function(e){e.destroy()}),P=[]),x={},U=!1,S=T=null,I.reset()}var O,S,I,T,w=l.guid(),D=[],x={},F=[],P=[],U=!1;O={chunk_size:0,file_data_name:"file",filters:{mime_types:[],max_file_size:0,prevent_duplicates:!1,prevent_empty:!0},flash_swf_url:"js/Moxie.swf",http_method:"POST",max_retries:0,multipart:!0,multi_selection:!0,resize:!1,runtimes:o.order,send_file_name:!0,send_chunk_number:!0,silverlight_xap_url:"js/Moxie.xap"},h.call(this,e,null,!0),I=new l.QueueProgress,l.extend(this,{id:w,uid:w,state:l.STOPPED,features:{},runtime:null,files:D,settings:O,total:I,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),f.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):O.browse_button||O.drop_element?(p.call(i,O,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=o.getInfo(c()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}),void 0):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){h.call(this,e,t,!this.runtime)},getOption:function(e){return e?O[e]:O},refresh:function(){F.length&&l.each(F,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){U=arguments[0]!==i?arguments[0]:!0,F.length&&l.each(F,function(e){e.disable(U)}),this.trigger("DisableBrowse",U)},getFile:function(e){var t;for(t=D.length-1;t>=0;t--)if(D[t].id===e)return D[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){s[n]&&i.push(function(i){s[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var s=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!o)return!1;e.ruid=o,e.connectRuntime(o)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),d.push(function(t){n(e,function(i){i||(D.push(e),f.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(s,["file","blob"])?a(new t.file.File(null,e)):"node"===s&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===s&&(i=null,l.each(e,a))}var o,u=this,d=[],f=[];o=c(),a(e),d.length&&l.inSeries(d,function(){f.length&&u.trigger("FilesAdded",f)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=D.length-1;i>=0;i--)if(D[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=D.splice(e===i?0:e,t===i?D.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n.file-list', '#myFileList', '
          ' + // fileTemplate: '', + // fileFormater: null, + // fileIconCreator: null, + // staticFiles: null, + rename: true, + // renameExtension: false, + renameByClick: true, + // autoUpload: false, + // browseByClickList: false, + dropPlaceholder: true, + // messageCreator: null, // NOT SUPPORT + previewImageIcon: true, + sendFileName: true, + sendFileId: true, + responseHandler: true, + // limitFilesCount: false, + // deleteConfirm: false, + // removeUploaded: false, + // statusCreator: null, // Function + // previewImageSize: {width: 200, height: 200}, + uploadedMessage: true, + // deleteActionOnDone: false, // false, true or function + // renameActionOnDone: false, // false, true or function, + // autoResetFails: false, // if true auto reupload failed files + + // plupload options + drop_element: 'self', // 'self', 'fileList', String or jQuery object, + browse_button: 'hidden', // String or jQuery object + // url: '', // String + filters: {prevent_duplicates: true}, // {mime_types, max_file_size, prevent_duplicates} + // headers: null, // Object + // multipart: true, // true, false + // multipart_params: null, // Object + chunk_size: '1mb', // Number, String + max_retries: 3, + // resize: {}, // {width, height, crop, quality, preserve_headers}, + // multi_selection: true, // true, false, + // required_features: null, // String + // unique_names: false, // true, false + // runtimes: 'html5,flash,silverlight,html4', // String + // file_data_name: 'file', // String + flash_swf_url: 'lib/uploader/Moxie.swf', // String + silverlight_xap_url: 'lib/uploader/Moxie.xap' // String + }; + + var STATUS = { + QUEUED : Plupload.QUEUED, + UPLOADING : Plupload.UPLOADING, + FAILED : Plupload.FAILED, + DONE : Plupload.DONE, + STOPPED : Plupload.STOPPED, + STARTED : Plupload.STARTED + }; + STATUS[Plupload.QUEUED] = 'queue'; + STATUS[Plupload.UPLOADING] = 'uploading'; + STATUS[Plupload.FAILED] = 'failed'; + STATUS[Plupload.DONE] = 'done'; + + var ERRORS = { + GENERIC_ERROR : Plupload.GENERIC_ERROR, + HTTP_ERROR : Plupload.HTTP_ERROR, + IO_ERROR : Plupload.IO_ERROR, + SECURITY_ERROR : Plupload.SECURITY_ERROR, + INIT_ERROR : Plupload.INIT_ERROR, + FILE_SIZE_ERROR : Plupload.FILE_SIZE_ERROR, + FILE_EXTENSION_ERROR : Plupload.FILE_EXTENSION_ERROR, + FILE_DUPLICATE_ERROR : Plupload.FILE_DUPLICATE_ERROR, + IMAGE_FORMAT_ERROR : Plupload.IMAGE_FORMAT_ERROR, + IMAGE_MEMORY_ERROR : Plupload.IMAGE_MEMORY_ERROR, + IMAGE_DIMENSIONS_ERROR: Plupload.IMAGE_DIMENSIONS_ERROR + }; + + // The uploader modal class + var Uploader = function(element, options) { + var that = this; + that.name = NAME; + that.$ = $(element).addClass('uploader'); + options = that.getOptions(options); + + // Init lang + var lang = $.isPlainObject(options.lang) ? ($.extend(true, {}, Uploader.LANG[lang.lang || $.zui.clientLang()], options.lang)) : Uploader.LANG[options.lang]; + that.lang = lang; + + // Init file list element + var $this = that.$; + var fileList = options.fileList; + var $list; + if(!fileList || fileList == 'large' || fileList == 'grid') { + $list = $this.find('.file-list,.uploader-files'); + } else if(fileList.indexOf('>') === 0) $list = $this.find(fileList.substr(1)); + else $list = $(fileList); + if(!$list || !$list.length) $list = $('
          '); + if(!$list.parent().length) $this.append($list); + if(fileList == 'large') $list.addClass('file-list-lg'); + else if(fileList == 'grid') $list.addClass('file-list-grid'); + $list.children('.file').addClass('file-static'); + that.$list = $list; + + if(options.browseByClickList || $list.hasClass('uploader-btn-browse')) { + $list.addClass('uploader-btn-browse').on('click', '.file-wrapper > .actions,.file-renaming .file-name', function(e) { + e.stopPropagation(); + }); + } + + // Init file template + var template = options.fileTemplate; + if(!template) { + var $template = $list.find('.template'); + if($template.length) { + template = $template.first().clone().removeClass('template'); + $template.remove(); + } + if(!template) template = FILE_TEMPLATE; + } + if(typeof template === 'string') { + template = $(template); + if(template.parent()) template = template.clone().removeClass('template'); + } + that.template = template; + + // Init browse button element + var browseBtn = options.browse_button; + var $btn = null; + if(browseBtn) { + if(browseBtn.indexOf('>') === 0) $btn = $this.find(browseBtn.substr(1)); + else if(browseBtn !== 'hidden') $btn = $(browseBtn); + } + if(!$btn || !$btn.length) { + $btn = $('
          ').appendTo($this); + } + that.$button = $btn.first(); + + // Init drop element + var dropElement = options.drop_element; + var $dropElement = (dropElement == 'fileList' ? that.$list : (dropElement == 'self' ? that.$ : $(dropElement))).first().addClass('file-drag-area'); + if (!notSupportDnd) { + var dropPlaceholder = options.dropPlaceholder; + if(dropPlaceholder === true) dropPlaceholder = lang.dropPlaceholder; + if(dropPlaceholder) $dropElement.attr('data-drop-placeholder', dropPlaceholder); + } else { + $dropElement.attr('data-drop-placeholder', ''); + } + that.$dropElement = $dropElement; + + // Init message + that.$message = $this.find('.uploader-message').on('click', '.close', function() { + that.hideMessage(); + }); + that.$status = $this.find('.uploader-status'); + + // Init actions + $this.toggleClass('uploader-rename', !!options.rename); + + // Init plupload + that.initPlupload(); + + // Bind events + $this.on('click.' + NAME, '.uploader-btn-start', function(e) { + that.start(); + }).on('click.' + NAME, '.uploader-btn-browse', function(e) { + if($(this).is(that.$button)) return; + that.$button.trigger('click'); + }).on('click.' + NAME, '.uploader-btn-stop', function(e) { + that.stop(); + }); + + $('body').on('dragleave.' + NAME + ' drop.' + NAME, function(e) { + $this.removeClass('file-dragable'); + + // Below two lines for firefox, open a new tab after drop file + e.preventDefault(); + e.stopPropagation(); + }).on('dragover.' + NAME + ' dragenter.' + NAME, function(e) { + $this.addClass('file-dragable'); + }); + $dropElement.on('dragleave.' + NAME + ' drop.' + NAME, function(e) { + $this.removeClass('file-drag-enter'); + }).on('dragover.' + NAME + ' dragenter.' + NAME, function(e) { + $this.addClass('file-drag-enter'); + }); + + $list.on('click.' + NAME, '.btn-delete-file', function() { + var $file = $(this).closest('.file'); + var file = $file.data('file'); + var deleteActionOnDoneOption = options.deleteActionOnDone; + var doneActionAble = file.status === Plupload.DONE && $.isFunction(deleteActionOnDoneOption); + if(file.status === Plupload.QUEUED || file.status === Plupload.FAILED || doneActionAble) { + var doRemoveFile = function() { + that.removeFile(file); + }; + var removeFile = function() { + if(doneActionAble) { + var result = deleteActionOnDoneOption.call(that, file, doRemoveFile); + if(result === true) { + doRemoveFile(); + } + } else { + doRemoveFile(); + } + }; + var deleteConfirmOption = options.deleteConfirm; + if(deleteConfirmOption) { + var confirmMessage = $.isFunction(deleteConfirmOption) ? deleteConfirmOption(file) : (deleteConfirmOption === true ? lang.deleteConfirm : deleteConfirmOption); + confirmMessage = confirmMessage.format(file); + if(window.bootbox) { + window.bootbox.confirm(confirmMessage, function(result) { + if(result) removeFile(); + }); + } else { + if(window.confirm(confirmMessage)) removeFile(); + } + } else { + removeFile(); + } + } + }).on('click.' + NAME, '.btn-reset-file', function() { + var $file = $(this).closest('.file'); + var file = that.plupload.getFile($file.data('id')) || $file.data('file'); + if(file.status === Plupload.FAILED) { + file.status = Plupload.QUEUED; + that.showFile(file); + if(options.autoUpload) that.start(); + } + }); + if(options.rename) { + $list.toggleClass('file-rename-by-click', !!options.renameByClick) + .toggleClass('file-show-rename-action-on-done', !!options.renameActionOnDone); + $list.on('click.' + NAME, '.btn-rename-file' + (options.renameByClick ? ',.file-name' : ''), function() { + var $file = $(this).closest('.file'); + if($file.hasClass('file-renaming')) return; + var file = that.plupload.getFile($file.data('id')) || $file.data('file'); + var renameActionOnDoneOption = options.renameActionOnDone; + var renameActionAble = file.status === Plupload.DONE && $.isFunction(renameActionOnDoneOption); + if(renameActionAble || file.status === Plupload.QUEUED) { + var $filename = $file.find('.file-name').first(); + $file.addClass('file-renaming'); + that.showFile(file); + if(!options.renameExtension && file.ext) { + $filename.text(file.name.substr(0, file.name.length - file.ext.length - 1)); + } + $filename.attr('contenteditable', 'true').one('blur', function() { + var filename = $.trim($filename.text()); + var renameFile = function() { + if(filename !== undefined && filename !== null && filename !== '') { + var ext = file.ext; + if(ext.length && !options.renameExtension && filename.lastIndexOf('.' + ext) !== (filename.length - ext.length - 1)) { + filename += '.' + ext; + } + file.name = filename; + } + that.showFile(file); + }; + if(renameActionAble) { + var result = renameActionOnDoneOption.call(that, file, filename, renameFile); + if(result === true) { + renameFile(); + } else if(result === false) { + that.showFile(file); + } + } else { + renameFile(); + } + $file.removeClass('file-renaming'); + $filename.off('keydown.' + NAME).attr('contenteditable', null); + }).on('keydown.' + NAME, function(e) { + if(e.keyCode === 13) { + $filename.blur(); + e.preventDefault(); + } + }).focus(); + } + }); + } + + $list.toggleClass('file-show-delete-action-on-done', !!options.deleteActionOnDone); + + // Init static files + that.staticFilesSize = 0; + that.staticFilesCount = 0; + if(options.staticFiles) { + $.each(options.staticFiles, function(idx, file) { + file = $.extend({status: Plupload.DONE}, file); + file.static = true; + if(!file.id) file.id = $.zui.uuid(); + that.showFile(file); + if (file.size) { + that.staticFilesSize += file.size; + that.staticFilesCount++; + } + }); + } + + that.callEvent('onInit'); + }; + + // default options + Uploader.DEFAULTS = DEFAULTS; + + Uploader.prototype.showMessage = function(message, type, time) { + var that = this; + var $msg = that.$message; + if(!message) that.hideMessage(); + else clearTimeout(that.lastDismissMessage); + type = type || 'danger'; + if(time === undefined) time = type === 'danger' ? 10 : 6; + if(time < 20) time *= 1000; + var $content = $msg.find('.content'); + if($content.length) $content.empty().append(message); + else $msg.empty().append(message); + $msg.attr('data-type', type).slideDown('fast'); + if(time) { + that.lastDismissMessage = setTimeout(function() { + that.hideMessage(); + }, time); + } + }; + + Uploader.prototype.hideMessage = function() { + clearTimeout(this.lastDismissMessage); + this.$message.slideUp('fast'); + }; + + Uploader.prototype.start = function() { + if (this.options.autoResetFails) { + $.each(this.getFiles(), function(index, file) { + if(file.status === Plupload.FAILED) { + file.status = Plupload.QUEUED; + } + }); + } + return this.plupload.start(); + }; + + Uploader.prototype.stop = function() { + return this.plupload.stop(); + }; + + Uploader.prototype.getState = function() { + return this.plupload.state; + }; + + Uploader.prototype.isStarted = function() { + return this.getState() === Plupload.STARTED; + }; + + Uploader.prototype.isStopped = function() { + return this.getState() === Plupload.STOPPED; + }; + + Uploader.prototype.getFiles = function() { + return this.plupload.files; + }; + + Uploader.prototype.getTotal = function() { + return this.plupload.total; + }; + + Uploader.prototype.disableBrowse = function(disable) { + this.$.find('.uploader-btn-browse').attr('disable', disable ? 'disable' : null).toggle('disable', !!disable); + return this.plupload.disableBrowse(); + }; + + Uploader.prototype.getFile = function(id) { + return this.plupload.getFile(id); + }; + + Uploader.prototype.destroy = function() { + var that = this; + var eventNamespace = '.' + NAME; + that.$.off(eventNamespace).data(NAME, null); + that.$list.off(eventNamespace); + that.$dropElement.off(eventNamespace); + $('body').off(eventNamespace); + that.plupload.destroy(); + }; + + // see https://github.com/moxiecode/moxie/wiki/API + Uploader.prototype.previewImageSrc = function(file, callback) { + if(!file || !file.getSource || !/image\//.test(file.type)) return; + var size = $.extend({width: 200, height: 200}, this.options.previewImageSize); + if(file.type == 'image/gif') { + //mOxie.Image only support jpg and png + var fr = new Moxie.file.FileReader(); + fr.onload = function() { + callback(fr.result); + fr.destroy(); + fr = null; + }; + fr.readAsDataURL(file.getSource()); + } else { + var preloader = new Moxie.image.Image(); + preloader.onload = function() { + // compressImage + preloader.downsize(size.width, size.height); + var imgsrc = preloader.type == 'image/jpeg' ? preloader.getAsDataURL('image/jpeg', 80) : preloader.getAsDataURL(); // return base64 data + callback(imgsrc); + preloader.destroy(); + preloader = null; + }; + preloader.load(file.getSource()); + } + }; + + Uploader.prototype.createFileIcon = function(file) { + var fileType = file.type; + var ext = file.ext; + var icon = 'file-o'; + var types = fileType ? fileType.split('/') : null; + var type = (types && types.length) ? types[0] : '', subType = (types && types.length) > 1 ? types[1] : ''; + if(type == 'image') icon = 'file-image'; + else if(ext == 'doc' || ext == 'docx' || ext == 'pages') icon = 'file-word'; + else if(ext == 'ppt' || ext == 'pptx' || ext == 'key') icon = 'file-powerpoint'; + else if(ext == 'xls' || ext == 'xlsx' || ext == 'numbers') icon = 'file-excel'; + else if(ext == 'html' || ext == 'htm') icon = 'globe'; + else if(ext == 'js' || ext == 'php' || ext == 'cs' || ext == 'jsx' || ext == 'css' || ext == 'less' || ext == 'json' || ext == 'java' || ext == 'lua' || ext == 'py' || ext == 'c' || ext == 'cpp' || ext == 'swift' || ext == 'h' || ext == 'sh' || ext == 'rb' || ext == 'yml' || ext == 'ini' || ext == 'sql' || ext == 'xml') icon = 'file-code'; + else if(ext == 'apk') icon = 'android'; + else if(ext == 'exe') icon = 'windows'; + else if(ext == 'pkg' || ext == 'msi' || ext == 'dmg') icon = 'cube'; + else if(ext == 'epub') icon = 'book'; + else if(ext == 'sketch') icon = 'diamond'; + else if(subType == 'zip' || subType == 'x-rar' || subType == 'x-7z-compressed') icon = 'file-archive'; + else if(subType == 'pdf') icon = 'file-pdf'; + else if(type == 'video') icon = 'file-movie'; + else if(type == 'audio') icon = 'file-audio'; + else if(type == 'text') icon = 'file-text-o'; + return ''; + }; + + Uploader.prototype.getFileItem = function(file) { + var that = this; + if(typeof file == 'string') { + file = that.plupload.getFile(file); + } + + if(!file) return null; + + var filename = file.name; + if(filename && file.ext === undefined) { + var ext = filename.lastIndexOf('.'); + if(ext > -1) ext = filename.substr(ext + 1); + else ext = ''; + file.ext = ext; + + if(file.type && /image\//.test(file.type)) { + file.isImage = file.ext; + } + } + + var $file = $('#file-' + file.id); + if(!$file.length) { + if($.isFunction(that.template)) { + $file = $(that.template(file, that)); + } else { + $file = $(that.template).clone(); + $file.find('.btn-rename-file').attr('title', that.lang.rename); + $file.find('.btn-delete-file').attr('title', that.lang.remove); + $file.find('.btn-reset-file').attr('title', that.lang.repeat); + $file.find('.btn-download-file').attr('title', that.lang.download).attr('download', file.name); + } + $file.data('id', file.id) + .toggleClass('file-static', !!file.static) + .attr('id', 'file-' + file.id) + .appendTo(that.$list); + if($.fn.tooltip) $file.find('[data-toggle="tooltip"]').tooltip(); + } + return $file; + }; + + Uploader.prototype.showFile = function(file, responseObject) { + var that = this; + if($.isArray(file)) { + $.each(file, function(idx, f) { + that.showFile(f, responseObject); + }); + return; + } + + if(typeof file == 'string') { + file = that.plupload.getFile(file); + } + + if(!file) return; + + var $file = that.getFileItem(file); + if(!$file || !$file.length) { + return; + } + + var options = that.options; + var status = STATUS[file.status]; + if(options.fileFormater) { + options.fileFormater.call(that, $file, file, status); + } else { + var downloadUrl = (status == 'done' && file.url) ? file.url : null; + $file.find('.file-name').text(file.name); + $file.find('.file-size').text((status == 'uploading' ? (Plupload.formatSize(Math.floor(file.size*file.percent/100)).toUpperCase() + '/') : '') + Plupload.formatSize(file.size).toUpperCase()); + $file.find('.file-icon').html(options.fileIconCreator ? options.fileIconCreator(file.type, file, that) : that.createFileIcon(file)).css('color', 'hsl(' + $.zui.strCode(file.type || file.ext) + ', 70%, 40%)'); + $file.find('.file-progress-bar').css('width', file.percent + '%'); + var $status = $file.find('.file-status').attr('title', that.lang[status]); + $status.find('.text').text(status == 'uploading' ? (file.percent + '%') : ((status == 'failed') ? that.lang[status] : '')); + if($.fn.tooltip) $file.find('[data-toggle="tooltip"]').tooltip('fixTitle'); + $file.find('a.btn-download-file, a.file-name').attr('href', downloadUrl); + } + + if(options.previewImageIcon && file.isImage) { + var setPreviewImage = function() { + $file.find('.file-icon').html('
          '); + }; + if(file.previewImage) { + setPreviewImage(); + } else { + that.previewImageSrc(file, function(src) { + file.previewImage = src; + setPreviewImage(); + }); + } + } + + $file.attr('data-status', status).data('file', file); + }; + + Uploader.prototype.showStatus = function() { + var that = this; + var plupload = that.plupload; + var $status = that.$status; + var state = plupload.state, + total = plupload.total, + statusText = '', + totalCount = plupload.files.length; + if(that.options.statusCreator) { + statusText = that.options.statusCreator(total, state, that); + } else { + var stateObj = { + uploading: Math.max(0, Math.min(totalCount, total.uploaded + 1)), + total: that.staticFilesCount + totalCount, + size: Plupload.formatSize(total.size + that.staticFilesSize).toUpperCase(), + queue: total.queued, + failed: total.failed, + uploaded: total.uploaded, + uploadedSize: Plupload.formatSize(total.loaded).toUpperCase(), + percent: total.percent, + speed: Plupload.formatSize(total.bytesPerSec).toUpperCase() + '/S' + }; + if(state == Plupload.STARTED) { + statusText = that.lang.startedStatusText.format(stateObj); + } else { + if(totalCount < 1) { + statusText = that.lang.initStatusText; + } else { + statusText = that.lang.stoppedStatusText.format(stateObj); + } + } + } + $status.html(statusText); + if(total.uploaded < 1) $status.find('.uploader-status-uploaded').remove(); + if(total.failed < 1) $status.find('.uploader-status-failed').remove(); + if(total.queued < 1) $status.find('.uploader-status-queue').remove(); + if($.fn.tooltip) $status.find('[data-toggle="tooltip"]').tooltip(); + }; + + Uploader.prototype.delayShowStatus = function(delay) { + var that = this; + if(that.delayStatusTask) return; + that.delayStatusTask = true; + if(delay === undefined) delay = 500; + that.delayStatusTask = setTimeout(function() { + that.showStatus(); + that.delayStatusTask = false; + }, delay); + }; + + Uploader.prototype.removeFile = function(file, onlyRemoveElement) { + var that = this; + if(typeof file == 'string') { + file = that.plupload.getFile(file); + } + if(onlyRemoveElement || file.static) { + var $file = $('#file-' + file.id); + if($.fn.tooltip) { + $file.find('[data-toggle="tooltip"]').tooltip('destroy'); + $('.tooltip').remove(); + } + $file.fadeOut(function() { + $(this).remove(); + }); + } else { + that.plupload.removeFile(file); + } + }; + + Uploader.prototype.initPlupload = function() { + var that = this; + var options = that.options; + var plOptions = $.extend({}, options, { + browse_button: that.$button[0], + container: that.$[0], + drop_element: that.$dropElement[0], + multipart_params: null + }); + var eventHandlers = { + FilesAdded: function(uploader, files) { + var limitFilesCount = options.limitFilesCount; + if(limitFilesCount) { + if(limitFilesCount === true) limitFilesCount = 1; + var existCount = that.$list.children('.file').length; + if((existCount + files.length) > limitFilesCount) { + that.showMessage(that.lang.limitFilesCountMessage.format({count: limitFilesCount}), 'warning'); + var newFiles = []; + for(var i = 0; i < files.length; ++i) { + if((existCount + i + 1) <= limitFilesCount) { + newFiles.push(files[i]); + } else { + uploader.removeFile(files[i]); + } + } + if(!newFiles.length) return; + files = newFiles; + } + } + that.showFile(files); + if(options.autoUpload) that.start(); + that.showStatus(); + that.callEvent('onFilesAdded', [files]); + }, + UploadProgress: function(uploader, file) { + that.showFile(file); + that.delayShowStatus(); + that.callEvent('onUploadProgress', file); + }, + FileUploaded: function(uploader, file, responseObject) { + if(responseObject) { + var responseData = typeof responseObject === 'object' ? responseObject.response : responseObject; + try {file.remoteData = $.parseJSON(responseData);} + catch(e) {} + } + if(that.qiniuEnable && file.remoteData) { + file.url = uploader.settings.domain + file.remoteData.key; + } + var responseHandlerOption = options.responseHandler; + if(responseHandlerOption) { + var error = null; + if($.isFunction(responseHandlerOption)) { + error = responseHandlerOption.call(that, responseObject, file); + } else if(responseObject.response) { + var json = file.remoteData; + if($.isPlainObject(json)) { + var result = json.status || json.result; + result = result === 'ok' || result === 'success' || result === 200; + if (result) { + if(json.id !== undefined) file.remoteId = json.id; + if(json.url !== undefined) file.url = json.url; + if(json.name !== undefined) file.name = json.name; + } else { + error = {message: json.message, data: json}; + } + } + } + if(error) { + error = $.isPlainObject(error) ? error : {message: error}; + file.status = Plupload.FAILED; + if(error.code === undefined) error.code = Plupload.GENERIC_ERROR; + error.file = file; + error.responseObject = responseObject; + file.errorMessage = error.message; + return; + } + } + + if(file.status === Plupload.DONE) { + that.lastUploadedCount++; + } + that.showFile(file, responseObject); + that.showStatus(); + that.callEvent('onFileUploaded', [file, responseObject]); + + if(file.status === Plupload.DONE) { + var optionRemoveUploaded = options.removeUploaded; + if(optionRemoveUploaded) { + setTimeout(function() { + $('#file-' + file.id).fadeOut(function() { + $(this).remove(); + }); + }, (typeof optionRemoveUploaded) === 'number' ? optionRemoveUploaded : 2000); + } + } + }, + UploadComplete: function(uploader, files) { + that.showFile(files); + that.showStatus(); + var uploadedMessage = options.uploadedMessage; + if(uploadedMessage) { + var uploadedCount = that.lastUploadedCount; + var failedCount = 0; + var failMessages = []; + $.each(files, function(idx, file) { + if(file.status === Plupload.FAILED) { + failedCount++; + if (file.errorMessage) { + failMessages.push(file.errorMessage); + delete file.errorMessage; + } + } + }); + var msg = failMessages && failMessages.length ? ('

          ' + failMessages.join(',') + '

          ') : '', + msgData = { + uploaded: uploadedCount, + failed: failedCount + }; + if(typeof uploadedMessage === 'string') { + msg += uploadedMessage.format(msgData); + } else if($.isFunction(uploadedMessage)) { + msg += uploadedMessage(msgData); + } else { + msg += that.lang[failedCount > 0 ? 'uploadHasFailedMessage' : (uploadedCount > 0 ? 'uploadSuccessMessage' : 'uploadEmptyMessage')].format(msgData); + } + that.showMessage(msg, failedCount > 0 ? 'danger' : (uploadedCount > 0 ? 'success' : 'warning'), 3); + } + that.callEvent('onUploadComplete', [files]); + }, + FilesRemoved: function(uploader, files) { + $.each(files, function(idx, file) { + that.removeFile(file, true); + }); + that.showStatus(); + that.callEvent('onFilesRemoved', files); + }, + ChunkUploaded: function(uploader, file, responseObject) { + that.callEvent('onChunkUploaded', [file, responseObject]); + }, + UploadFile: function(uploader, file) { + that.showStatus(); + that.callEvent('onUploadFile', file); + }, + BeforeUpload: function(uploader, file) { + var oldParams = uploader.getOption('multipart_params'); + var multipartParamsOption = options.multipart_params; + var params = {}; + if (oldParams && oldParams.key) { + params.key = oldParams.key; + } + if (oldParams && oldParams.token) { + params.token = oldParams.token; + } + if(options.sendFileName) params[options.sendFileName === true ? 'name' : options.sendFileName] = file.name; + if(options.sendFileId) params[options.sendFileId === true ? 'uuid' : options.sendFileId] = file.id; + params = $.extend(params, $.isFunction(multipartParamsOption) ? multipartParamsOption(file, params) : multipartParamsOption); + uploader.setOption('multipart_params', params); + that.callEvent('onBeforeUpload', file); + }, + Refresh: function(uploader) { + that.showStatus(); + that.callEvent('onRefresh'); + }, + StateChanged: function(uploader) { + if(uploader.state === Plupload.STARTED) { + that.lastUploadedCount = 0; + } + that.$.toggleClass('uploader-started', Plupload.STARTED === uploader.state); + that.hideMessage(); + that.showStatus(); + that.callEvent('onStateChanged', uploader.state); + }, + QueueChanged: function(uploader) { + that.showStatus(); + that.callEvent('onQueueChanged'); + }, + Error: function(uploader, error) { + var type = 'danger'; + if(error.code === Plupload.FILE_SIZE_ERROR || error.code === Plupload.FILE_SIZE_ERROR || error.code === Plupload.FILE_EXTENSION_ERROR || error.code === Plupload.FILE_DUPLICATE_ERROR || error.code === Plupload.MAGE_FORMAT_ERROR) type = 'warning'; + that.showMessage(error.message, type); + that.callEvent('onError', error); + } + }; + + Plupload.addI18n(that.lang.i18n); + + that.qiniuEnable = $.isPlainObject(options.qiniu) && window.Qiniu; + if(that.qiniuEnable) { + var qiniuOptions = options.qiniu; + var qiniuKeyFunc = qiniuOptions.key; + delete plOptions.qiniu; + if(qiniuKeyFunc) { + delete qiniuOptions.key; + if($.isFunction(qiniuKeyFunc)) { + eventHandlers.Key = qiniuKeyFunc; + } + } else { + eventHandlers.Key = function(uploader, file) { + return file.name; + }; + } + qiniuOptions.init = eventHandlers; + plOptions = $.extend(plOptions, qiniuOptions); + var qiniuSKD = new QiniuJsSDK(); + var plupload = qiniuSKD.uploader(plOptions); + that.plupload = plupload; + } else { + var plupload = new Plupload.Uploader(plOptions); + plupload.init(); + that.plOptions = plOptions; + that.plupload = plupload; + $.each(eventHandlers, function(eventName, eventHandler) { + plupload.bind(eventName, eventHandler); + }); + } + }; + + // Get and init options + Uploader.prototype.getOptions = function(options) { + this.options = $.extend({ + lang: $.zui.clientLang() + }, DEFAULTS, this.$.data(), options); + return this.options; + }; + + // Call event helper + Uploader.prototype.callEvent = function(name, params) { + var that = this; + if(!$.isArray(params)) params = [params]; + that.$.trigger(name, params); + if($.isFunction(that.options[name])) { + return that.options[name].apply(that, params); + } + }; + + // Extense jquery element + $.fn.uploader = function(option, params) { + return this.each(function() { + var $this = $(this); + var data = $this.data(NAME); + var options = typeof option == 'object' && option; + + if(!data) $this.data(NAME, (data = new Uploader(this, options))); + + if(typeof option == 'string') data[option](params); + }); + }; + + Uploader.NAME = NAME; + Uploader.STATUS = STATUS; + Uploader.ERRORS = ERRORS; + Uploader.NAME = NAME; + Uploader.LANG = { + zh_cn: {"limitFilesCountMessage": "所有文件数目不能超过 {count} 个,如果要上传此文件请先从列表移除文件。", "uploadEmptyMessage": "没有文件等待上传。", "uploadSuccessMessage": "已上传 {uploaded} 个文件。", "uploadHasFailedMessage": "已上传 {uploaded} 个文件,{failed} 个文件上传失败。", "startedStatusText": "正在上传第 {uploading} 个文件,共 {total} 个文件,已上传 {uploaded} 个文件,{failed} 个上传失败,进度 {percent}%,平均速度 {speed}。", "initStatusText": "添加文件或拖放文件来上传。", "stoppedStatusText": "共 {total} 个文件{queue} 个文件等待上传,已上传 {uploaded} 个文件{failed} 个上传失败,平均速度 {speed}。", "deleteConfirm": "确定移除文件【{name}】?", "download": "下载", "rename": "重命名", "repeat": "重新上传", "remove": "移除", "dropPlaceholder": "将文件拖放至在此处。", "queue": "待上传", "uploading": "正在上传", "failed": "失败", "done": "已上传", "i18n": {"Stop Upload":"停止上传","Upload URL might be wrong or doesn't exist.":"上传的URL可能是错误的或不存在。","tb":"tb","Size":"大小","Close":"关闭","You must specify either browse_button or drop_element.":"您必须指定 browse_button 或者 drop_element。","Init error.":"初始化错误。","Add files to the upload queue and click the start button.":"将文件添加到上传队列,然后点击”开始上传“按钮。","List":"列表","Filename":"文件名","%s specified, but cannot be found.":"%s 已指定,但是没有找到。","Image format either wrong or not supported.":"图片格式错误或者不支持。","Status":"状态","HTTP Error.":"HTTP 错误。","Start Upload":"开始上传","Error: File too large:":"错误: 文件太大:","kb":"kb","Duplicate file error.":"无法添加重复文件。","File size error.":"文件大小错误。","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"错误:无效的文件扩展名:","Select files":"选择文件","%s already present in the queue.":"%s 已经在当前队列里。","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"超限。%s 支持最大 %wx%hpx 的图片。","File: %s":"文件: %s","b":"b","Uploaded %d/%d files":"已上传 %d/%d 个文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只接受同时上传 %d 个文件,多余的文件将会被删除。","%d files queued":"%d 个文件加入到队列","File: %s, size: %d, max file size: %d":"文件: %s, 大小: %d, 最大文件大小: %d","Thumbnails":"缩略图","Drag files here.":"把文件拖到这里。","Runtime ran out of available memory.":"运行时已消耗所有可用内存。","File count error.":"文件数量错误。","File extension error.":"文件扩展名错误。","mb":"mb","Add Files":"增加文件"}}, + zh_tw: {"limitFilesCountMessage": "所有文件數目不能超過 {count} 個。","uploadEmptyMessage": "没有文件等待上傳。", "uploadSuccessMessage": "已上傳 {uploaded} 个文件。", "uploadHasFailedMessage": "文件上傳完成,已上傳 {uploaded} 個文件,{failed} 個文件上傳失败。", "startedStatusText": "正在上傳第{uploading} 個文件,共{total} 個文件,已上傳{uploaded} 個文件,{failed} 個上傳失敗,進度{percent}%,平均速度{speed}。", "initStatusText": "添加文件或拖放文件來上傳。", "stoppedStatusText": "共{total} 個文件{queue} 個文件等待上傳,已上傳{uploaded} 個文件{failed} 個上傳失敗,平均速度{speed}< /strong>。", "deleteConfirm": "確定移除文件【{name}】?", "download": "下载", "rename": "重命名", "repeat": "重新上傳", "remove": "移除", "dropPlaceholder": "將文件拖放至在此處。", "queue": "待上傳", "uploading": "正在上傳", "failed": "失敗", "done": "已上傳", "i18n": {"Stop Upload":"停止上傳","Upload URL might be wrong or doesn't exist.":"檔案URL可能有誤或者不存在。","tb":"tb","Size":"大小","Close":"關閉","You must specify either browse_button or drop_element.":"您必須指定 browse_button 或 drop_element。","Init error.":"初始化錯誤。","Add files to the upload queue and click the start button.":"將檔案加入上傳序列,然後點選”開始上傳“按鈕。","List":"清單","Filename":"檔案名稱","%s specified, but cannot be found.":"找不到已選擇的 %s。","Image format either wrong or not supported.":"圖片格式錯誤或者不支援。","Status":"狀態","HTTP Error.":"HTTP 錯誤。","Start Upload":"開始上傳","Error: File too large:":"錯誤: 檔案大小太大:","kb":"kb","Duplicate file error.":"錯誤:檔案重複。","File size error.":"錯誤:檔案大小超過限制。","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"錯誤:不接受的檔案格式:","Select files":"選擇檔案","%s already present in the queue.":"%s 已經存在目前的檔案序列。","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"圖片解析度超出範圍! %s 最高只支援到 %wx%hpx。","File: %s":"檔案: %s","b":"b","Uploaded %d/%d files":"已上傳 %d/%d 個文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只能上傳 %d 個檔案,超過限制數量的檔案將被忽略。","%d files queued":"%d 個檔案加入到序列","File: %s, size: %d, max file size: %d":"檔案: %s, 大小: %d, 檔案大小上限: %d","Thumbnails":"縮圖","Drag files here.":"把檔案拖曳到這裡。","Runtime ran out of available memory.":"執行時耗盡了所有可用的記憶體。","File count error.":"檔案數量錯誤。","File extension error.":"檔案副檔名錯誤。","mb":"mb","Add Files":"增加檔案"}}, + en: {"limitFilesCountMessage": "All files count can not over {count}.","uploadEmptyMessage": "No file in queue to upload", "uploadSuccessMessage": "Uploaded {uploaded} files。", "uploadHasFailedMessage": "Uploaded complete, {uploaded} success, {failed} failed.", "startedStatusText": "Uploading NO.{uploading} file, total {total} files, Uploaded {uploaded} files, {failed} failed, progress {percent}%, average spped {speed}。", "initStatusText": "Append or drag file here.", "stoppedStatusText": "Total {total} files, {queue} files in queue, uploaded {uploaded} files, {failed} failed, average spped {speed}。", "deleteConfirm": "Remove file \"{name}\" form upload queue?", "rename": "Rename", "download": "Download", "repeat": "Repeat", "remove": "Remove", "dropPlaceholder": "Drop file here.", "queue": "Wait", "uploading": "Uploading", "failed": "Failed", "done": "Done", "i18n": {"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"tb","Size":"Size","Close":"Close","You must specify either browse_button or drop_element.":"You must specify either browse_button or drop_element.","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Add files to the upload queue and click the start button.","List":"List","Filename":"Filename","%s specified, but cannot be found.":"%s specified, but cannot be found.","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","Error: File too large:":"Error: File too large:","kb":"kb","Duplicate file error.":"Duplicate file error.","File size error.":"File size error.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Select files","%s already present in the queue.":"%s already present in the queue.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.","File: %s":"File: %s","b":"b","Uploaded %d/%d files":"Uploaded %d/%d files","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"File: %s, size: %d, max file size: %d","Thumbnails":"Thumbnails","Drag files here.":"Drag files here.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","mb":"mb","Add Files":"Add Files"}} + }; + + $.zui.plupload = Plupload; + $.zui.moxie = Moxie; + $.zui.Uploader = Uploader; + + $.fn.uploader.Constructor = Uploader; + + // For qiniu + if(!window.mOxie) window.mOxie = { + Env: Moxie.core.utils.Env, + XMLHttpRequest: Moxie.xhr.XMLHttpRequest + }; + + // Auto call uploader after document load complete + $(function() { + $('[data-ride="uploader"]').uploader(); + }); +}(jQuery, window, plupload, moxie, undefined)); + diff --git a/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.css b/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.css new file mode 100644 index 0000000..2b15bb1 --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.css @@ -0,0 +1,6 @@ +/*! + * ZUI: 文件上传 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */.uploader{position:relative;margin-bottom:20px}.uploader-btn-hidden{position:absolute;top:-1px;left:-1px;width:1px;height:1px;opacity:0}.file-dragable{position:relative}[data-drop-placeholder]:before{position:absolute;top:0;left:0;z-index:10;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;height:100%;font-size:16px;text-align:center;pointer-events:none;content:attr(data-drop-placeholder);background-color:rgba(255,240,213,.5);filter:alpha(opacity=0);border:2px dashed #f1a325;opacity:0;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s;-webkit-transform:scale(.95);-ms-transform:scale(.95);-o-transform:scale(.95);transform:scale(.95);-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.ie [data-drop-placeholder]:before{display:none!important}.file-dragable[data-drop-placeholder]:before{filter:alpha(opacity=100);opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}.file-drag-enter[data-drop-placeholder]:before{background-color:#fff0d5;border-style:solid}.file-list,.uploader-files{position:relative;min-height:32px;margin-bottom:10px;border:1px solid #ddd}.file-list[data-drag-placeholder]:before,.uploader-files[data-drag-placeholder]:before{position:absolute;top:50%;right:0;left:0;display:block;margin-top:-15px;line-height:32px;color:#ddd;text-align:center;pointer-events:none;content:attr(data-drag-placeholder);-webkit-transition:all .4s;-o-transition:all .4s;transition:all .4s}.file-list[data-drag-placeholder]:hover:before,.uploader-files[data-drag-placeholder]:hover:before{color:grey}.file-list .file-icon,.uploader-files .file-icon{position:relative;width:32px;height:32px;line-height:32px;text-align:center;filter:alpha(opacity=70);opacity:.7;-webkit-transition:opacity .4s;-o-transition:opacity .4s;transition:opacity .4s}.file-list .file-icon-image,.uploader-files .file-icon-image{position:absolute;top:5px;right:5px;bottom:5px;left:5px;background-color:#fff;background-repeat:no-repeat;background-position:center;-webkit-background-size:cover;background-size:cover;border:1px solid #ddd}.file-list .file-name,.uploader-files .file-name{text-decoration:none;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s}.file-list .file-name[contenteditable],.uploader-files .file-name[contenteditable]{padding:0 5px;background-color:#fff;outline:1px solid #3280fc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #97befd;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #97befd}.file-list .file-name,.file-list .file-size,.uploader-files .file-name,.uploader-files .file-size{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-list .file-renaming .file-name[contenteditable],.uploader-files .file-renaming .file-name[contenteditable]{text-overflow:initial}.file-list .file:hover .file-name,.uploader-files .file:hover .file-name{color:#3280fc}.file-list .file:hover .file-icon,.uploader-files .file:hover .file-icon{opacity:1}.file-list .file-status,.uploader-files .file-status{display:inline-block;line-height:20px;text-align:right}.file-list .file-status:hover,.uploader-files .file-status:hover{background-color:rgba(0,0,0,.07)}.file-list .file-status>.icon,.uploader-files .file-status>.icon{line-height:20px;vertical-align:middle;opacity:1;-webkit-transition:all .8s;-o-transition:all .8s;transition:all .8s;-webkit-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}.file-list .file-status>.icon:before,.uploader-files .file-status>.icon:before{content:'\e653'}.file-list .file-status>.text,.uploader-files .file-status>.text{display:inline-block;padding:0 6px;font-size:12px;line-height:20px}.file-list .file-status>.text:empty,.uploader-files .file-status>.text:empty{display:none}.file-list .file[data-status=uploading] .file-status>.icon,.uploader-files .file[data-status=uploading] .file-status>.icon{filter:alpha(opacity=0);opacity:0;-webkit-transform:scale(0);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0)}.file-list .file[data-status=uploading] .file-status>.text,.uploader-files .file[data-status=uploading] .file-status>.text{color:#fff;background-color:#3280fc;border-radius:10px}.file-list .file[data-status=queue] .file-status,.uploader-files .file[data-status=queue] .file-status{color:#f1a325}.file-list .file[data-status=queue] .file-status>.icon:before,.uploader-files .file[data-status=queue] .file-status>.icon:before{content:'\e6cd'}.file-list .file[data-status=failed] .file-status,.uploader-files .file[data-status=failed] .file-status{color:#ea644a}.file-list .file[data-status=failed] .file-status>.icon:before,.uploader-files .file[data-status=failed] .file-status>.icon:before{content:'\e66a'}.file-list .file[data-status=done] .file-status,.uploader-files .file[data-status=done] .file-status{color:#38b03f}.file-list .file .actions>.btn-download-file,.file-list .file .actions>.btn-reset-file,.file-list .file[data-status=uploading] .actions>.btn,.file-list .file[data-status=failed] .actions>.btn-rename-file,.file-list .file[data-status=done] .actions>.btn,.uploader-files .file .actions>.btn-download-file,.uploader-files .file .actions>.btn-reset-file,.uploader-files .file[data-status=uploading] .actions>.btn,.uploader-files .file[data-status=failed] .actions>.btn-rename-file,.uploader-files .file[data-status=done] .actions>.btn{display:none}.file-list .file[data-status=failed] .actions>.btn-reset-file,.file-list .file[data-status=done] .actions>.btn-download-file[href],.file-list.file-show-delete-action-on-done .file[data-status=done] .actions>.btn-delete-file,.file-list.file-show-rename-action-on-done .file[data-status=done] .actions>.btn-rename-file,.uploader-files .file[data-status=failed] .actions>.btn-reset-file,.uploader-files .file[data-status=done] .actions>.btn-download-file[href],.uploader-files.file-show-delete-action-on-done .file[data-status=done] .actions>.btn-delete-file,.uploader-files.file-show-rename-action-on-done .file[data-status=done] .actions>.btn-rename-file{display:inline-block}.file-list.file-rename-by-click [data-status=queue] .file-name:hover,.uploader-files.file-rename-by-click [data-status=queue] .file-name:hover{background-color:rgba(255,255,255,.5);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #97befd;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #97befd}.file-list .file-progress-bar,.uploader-files .file-progress-bar{position:absolute;top:0;bottom:0;left:0;z-index:10;pointer-events:none;background-color:rgba(50,128,252,.1);filter:alpha(opacity=0);-webkit-box-shadow:inset 0 -2px #3280fc;box-shadow:inset 0 -2px #3280fc;opacity:0;-webkit-transition:width .6s ease,opacity .4s;-o-transition:width .6s ease,opacity .4s;transition:width .6s ease,opacity .4s}.file-list .file[data-status=uploading] .file-progress-bar,.uploader-files .file[data-status=uploading] .file-progress-bar{filter:alpha(opacity=100);opacity:1}.file-list .file[data-status=queue],.uploader-files .file[data-status=queue]{background-color:#fff0d5}.file-list .file[data-status=failed],.uploader-files .file[data-status=failed]{background-color:#ffe5e0}.file-list .file[data-status=done],.uploader-files .file[data-status=done]{background-color:#fff}.uploader-actions{background-color:#f1f1f1}.file-list+.uploader-actions{margin-top:-10px;border:1px solid #ddd;border-top:none}.uploader-actions .uploader-status{padding:5px 10px;line-height:20px}.uploader-message{position:absolute;top:0;right:0;left:0;z-index:1;display:none;padding:5px 10px;color:#fff;background:#3280fc;filter:alpha(opacity=95);opacity:.95}.uploader-message>.close{position:absolute;top:3px;right:10px;color:inherit;text-shadow:none;opacity:.4}.uploader-message>.close:hover{opacity:1}.uploader-message[data-type=danger]{background:#ea644a}.uploader-message[data-type=warning]{background:#f1a325}.uploader-message[data-type=info]{background:#03b8cf}.uploader-message[data-type=success]{background:#38b03f}.file-list .file{position:relative;z-index:0;background-color:#fff;-webkit-transition:background .4s;-o-transition:background .4s;transition:background .4s}.file-list .file+.file{border-top:1px solid #ddd}.file-list .file-wrapper{position:relative;z-index:2;display:table;width:100%;table-layout:fixed;-webkit-transition:background .4s;-o-transition:background .4s;transition:background .4s}.file-list .file-wrapper:hover{background-color:rgba(0,0,0,.05)}.file-list .file-wrapper>.actions,.file-list .file-wrapper>.content,.file-list .file-wrapper>.file-icon{display:table-cell;vertical-align:middle}.file-list .file-wrapper>.actions{width:150px;text-align:right}.file-list .file-wrapper>.actions>.btn{padding:5px 8px}.file-list .file-wrapper>.actions>.btn:hover{background-color:rgba(0,0,0,.07)}.file-list .file-name{display:block}.file-list .file-wrapper>.content>.file-name{float:left}.file-list .file-wrapper>.content>.file-size{float:right;margin-top:2px}.file-list .file-wrapper>.actions>.btn{border-radius:0}.file-list .file-status{padding:5px}.file-list-lg .file{min-height:50px}.file-list-lg .file-icon{width:50px;line-height:50px}.file-list-lg .file-icon .icon{position:relative;display:block;width:50px;font-size:28px;line-height:50px;text-align:center}.file-list-lg .file-icon .icon-file-o{position:relative;left:-2px}.file-list-lg .file-status{line-height:40px}.file-list-lg .file-status>.icon{font-size:20px}.file-list-lg .file[data-status=done] .file-status{padding:5px 12px}.file-list-lg .file-wrapper>.content>.file-name{float:none;line-height:20px}.file-list-lg .file-wrapper>.content>.file-size{float:none;line-height:14px}.file-list-lg .file-wrapper>.actions>.btn{padding:14px 8px}.file-list-lg .file-renaming .file-name[contenteditable]{font-size:14px;line-height:34px}.file-list-lg .file-renaming .file-wrapper>.content>.file-size{display:none}.file-list-grid{margin-right:-8px;margin-left:-8px;border:none}.file-list-grid:after,.file-list-grid:before{display:table;content:" "}.file-list-grid:after{clear:both}.file-list-grid .file{display:block;float:left;width:120px;height:120px;margin:8px 8px 35px 8px;border:1px solid #ddd;border-radius:4px}.file-list-grid .file .file-icon{display:block;width:118px;height:118px;overflow:hidden}.file-list-grid .file-icon>.icon{font-size:70px;line-height:118px}.file-list-grid .file-icon-image{top:-1px;right:-1px;bottom:-1px;left:-1px;border:none}.file-list-grid .file-wrapper{position:absolute;top:0;right:0;left:0;display:block;width:auto}.file-list-grid .file-wrapper>.content{position:absolute;right:-1px;bottom:-24px;left:-1px;display:block;text-align:center;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s}.file-list-grid .file-wrapper>.content>.file-name{position:relative;z-index:5;float:none;padding:4px 0;line-height:16px;border:1px solid transparent}.file-list-grid .file-wrapper>.content>.file-size{position:absolute;top:-24px;left:4px;display:block;padding:0 5px;line-height:18px;color:#fff;background-color:grey;background-color:rgba(0,0,0,.5);filter:alpha(opacity=0);border-radius:9px;opacity:0;-webkit-transition:opacity .4s;-o-transition:opacity .4s;transition:opacity .4s}.file-list-grid .file-renaming .file-wrapper>.content>.file-name,.file-list-grid .file-wrapper>.content:hover>.file-name{text-overflow:initial;word-break:break-all;white-space:normal;background-color:#fff;border-color:#ddd;-webkit-box-shadow:none;box-shadow:none}.file-list-grid .file-renaming .file-wrapper>.content>.file-name{padding:4px;text-align:left}.file-list-grid .file:hover .file-wrapper>.content>.file-size,.file-list-grid .file[data-status=uploading] .file-wrapper>.content>.file-size{filter:alpha(opacity=100);opacity:1}.file-list-grid .file-wrapper>.actions{position:absolute;top:0;right:0;left:0;display:block;width:118px}.file-list-grid .file-wrapper:hover>.actions{background:rgba(255,255,255,.85)}.file-list-grid .file-wrapper>.actions>.file-status{position:absolute;top:0;left:0;height:28px;padding:4px 5px}.file-list-grid .file-wrapper>.actions>.file-status>.icon{position:relative;top:-1px;display:inline-block;font-size:21px;text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff}.file-list-grid .file-wrapper>.actions>.file-status>.text{padding:0}.file-list-grid .file[data-status=failed] .file-wrapper>.actions>.file-status>.icon{font-size:14px;text-shadow:none}.file-list-grid .file[data-status=uploading] .file-wrapper>.actions>.file-status>.text{position:absolute;top:4px;left:4px;padding:0 8px}.file-list-grid .file[data-status=failed] .file-wrapper>.actions>.file-status{top:4px;left:4px;height:20px;padding:0 8px;color:#fff;background-color:#ea644a;border-radius:10px}.file-list-grid .file-wrapper>.actions>.btn{padding:3px 6px;filter:alpha(opacity=0);opacity:0}.file-list-grid .file-wrapper:hover>.actions>.btn{filter:alpha(opacity=100);opacity:1}.file-list-grid .file-progress-bar{-webkit-box-shadow:inset 0 -4px #3280fc;box-shadow:inset 0 -4px #3280fc}.file-list-grid+.uploader-actions{border:none} \ No newline at end of file diff --git a/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.js b/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.js new file mode 100644 index 0000000..ae7256b --- /dev/null +++ b/src/resources/static/js/lib/zui/lib/uploader/zui.uploader.min.js @@ -0,0 +1,11 @@ +/*! + * ZUI: 文件上传 - v1.9.1 - 2019-05-10 + * http://zui.sexy + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2019 cnezsoft.com; Licensed MIT + */ +!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r0&&u(n,function(n,l){var u=-1!==f(e(n),["array","object"]);return!!(n===r||t&&o[l]===r)||(u&&i&&(n=a(n)),void(e(o[l])===e(n)&&u?s(t,i,[o[l],n]):o[l]=n))})}),o}function l(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.parent=t.prototype,e}function u(e,t){var i,n,r,o;if(e){try{i=e.length}catch(a){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function c(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function d(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++ri;i++)if(t[i]===e)return i}return-1}function m(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===f(t[r],i)&&n.push(t[r]);return!!n.length&&n}function h(e,t){var i=[];return u(e,function(e){-1!==f(e,t)&&i.push(e)}),i.length?i:null}function g(e){var t,i=[];for(t=0;ti;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:b,typeOf:e,extend:t,extendIf:i,extendImmutable:n,extendImmutableIf:r,clone:o,inherit:l,each:u,isEmptyObj:c,inSeries:d,inParallel:p,inArray:f,arrayDiff:m,arrayIntersect:h,toArray:g,trim:v,sprintf:E,parseSizeStr:x,delay:y}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},i=function(e,i){if("function"==typeof window.atob)return i?t(window.atob(e)):window.atob(e);var n,r,o,a,s,l,u,c,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p=0,f=0,m="",h=[];if(!e)return e;e+="";do a=d.indexOf(e.charAt(p++)),s=d.indexOf(e.charAt(p++)),l=d.indexOf(e.charAt(p++)),u=d.indexOf(e.charAt(p++)),c=a<<18|s<<12|l<<6|u,n=255&c>>16,r=255&c>>8,o=255&c,h[f++]=64==l?String.fromCharCode(n):64==u?String.fromCharCode(n,r):String.fromCharCode(n,r,o);while(p>18,s=63&c>>12,l=63&c>>6,u=63&c,h[f++]=d.charAt(a)+d.charAt(s)+d.charAt(l)+d.charAt(u);while(pn;n++)if(e[n]!=t[n]){if(e[n]=l(e[n]),t[n]=l(t[n]),e[n]t[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",i="?",n="function",r="undefined",o="object",a="name",s="version",l={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},u={rgx:function(){for(var t,i,a,s,l,u,c,d=0,p=arguments;d0?2==l.length?t[l[0]]=typeof l[1]==n?l[1].call(this,c):l[1]:3==l.length?t[l[0]]=typeof l[1]!==n||l[1].exec&&l[1].test?c?c.replace(l[1],l[2]):e:c?l[1].call(this,c,l[2]):e:4==l.length&&(t[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):e):t[l]=c?c:e;break}if(u)break}return t},str:function(t,n){for(var r in n)if(typeof n[r]===o&&n[r].length>0){for(var a=0;a=")),i.use_blob_uri},use_data_uri:function(){var e=new Image;return e.onload=function(){i.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return i.use_data_uri&&("IE"!==a.browser||a.version>=9)},use_data_uri_of:function(e){return i.use_data_uri&&33e3>e||i.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),i.use_fileinput=!e.disabled},use_webgl:function(){var e,n=document.createElement("canvas"),r=null;try{r=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(o){}return r||(r=null),e=!!r,i.use_webgl=e,n=t,e}};return function(t){var n=[].slice.call(arguments);return n.shift(),"function"===e.typeOf(i[t])?i[t].apply(this,n):!!i[t]}}(),o=(new n).getResult(),a={can:r,uaParser:n,browser:o.browser.name,version:o.browser.version,os:o.os.name,osVersion:o.os.version,verComp:i,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return a.OS=a.os,a}),n("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:function(){function i(e,i){this.code=e,this.name=t(n,e),this.message=this.name+(i||": RuntimeError "+this.code)}var n={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(i,n),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": ImageError "+this.code}var n={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(i,n),i.prototype=Error.prototype,i}(),FileException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": FileException "+this.code}var n={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(i,n),i.prototype=Error.prototype,i}(),DOMException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": DOMException "+this.code}var n={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(i,n),i.prototype=Error.prototype,i}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),n("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){if(!e.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)},n=function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,i){function n(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===u.compatMode?u.documentElement:u.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}var r,o,a,s=0,l=0,u=document;if(t=t,i=i||u.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!u.documentMode||u.documentMode<8))return o=n(t),a=n(i),{x:o.x-a.x,y:o.y-a.y};for(r=t;r&&r!=i&&r.nodeType;)s+=r.offsetLeft||0,l+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)s-=r.scrollLeft||0,l-=r.scrollTop||0,r=r.parentNode;return{x:s,y:l}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:i,addClass:n,removeClass:r,getStyle:o,getPos:a,getSize:s}}),n("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(e,t,i){function n(){this.uid=i.guid()}var r={};return i.extend(n.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(e,t,n,o){var a,s=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),e=i.trim(e),/\s/.test(e)?void i.each(e.split(/\s+/),function(e){s.addEventListener(e,t,n,o)}):(e=e.toLowerCase(),n=parseInt(n,10)||0,a=r[this.uid]&&r[this.uid][e]||[],a.push({fn:t,priority:n,scope:o||this}),r[this.uid]||(r[this.uid]={}),void(r[this.uid][e]=a))},hasEventListener:function(e){var t;return e?(e=e.toLowerCase(),t=r[this.uid]&&r[this.uid][e]):t=r[this.uid],!!t&&t},removeEventListener:function(e,t){var n,o,a=this;if(e=e.toLowerCase(),/\s/.test(e))return void i.each(e.split(/\s+/),function(e){a.removeEventListener(e,t)});if(n=r[this.uid]&&r[this.uid][e]){if(t){for(o=n.length-1;o>=0;o--)if(n[o].fn===t){n.splice(o,1);break}}else n=[];n.length||(delete r[this.uid][e],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(e){var n,o,a,s,l,u={},c=!0;if("string"!==i.typeOf(e)){if(s=e,"string"!==i.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=s.type,s.total!==l&&s.loaded!==l&&(u.total=s.total,u.loaded=s.loaded),u.async=s.async||!1}if(-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),u.type=e,a.unshift(u);var d=[];i.each(o,function(e){a[0].target=e.scope,u.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&i.inSeries(d,function(e){c=!e})}return c},bindOnce:function(e,t,i,n){var r=this;r.bind.call(this,e,function o(){return r.unbind(e,o),t.apply(this,arguments)},i,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)}),i.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===i.typeOf(t[e])&&(t[e]=null)})}}),n.instance=new n,n}),n("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(e,t,i,n){function r(e,n,o,s,l){var u,c=this,d=t.guid(n+"_"),p=l||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(p=r.getMode(s,e.preferred_caps,p)),u=function(){var e={};return{exec:function(t,i,n,r){return u[i]&&(e[t]||(e[t]={context:this,instance:new u[i]}),e[t].instance[n])?e[t].instance[n].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var i=this;t.each(e,function(e,n){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(n)})}}}(),t.extend(this,{initialized:!1,uid:d,type:n,mode:r.getMode(s,e.required_caps,p),shimid:d+"_container",clients:0,options:e,can:function(e,i){var n=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(i)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],n))return!1;return!0}return"function"===t.typeOf(n[e])?n[e].call(this,i):i===n[e]},getShimContainer:function(){var e,n=i.get(this.shimid);return n||(e=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(n),e=null),n},getShim:function(){return u},shimExec:function(e,t){var i=[].slice.call(arguments,2);return c.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return c[e]&&c[e][t]?c[e][t].apply(this,i):c.shimExec.apply(this,arguments)},destroy:function(){if(c){var e=i.get(this.shimid);e&&e.parentNode.removeChild(e),u&&u.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=c=u=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return!!a[e]&&a[e]},r.addConstructor=function(e,t){t.prototype=n.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var i={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){i[e]=!0}),i)},r.can=function(e,t){var i,n,o=r.getConstructor(e);return!!o&&(i=new o({required_caps:t}),n=i.mode,i.destroy(),!!n)},r.thatCan=function(e,t){var i=(t||r.order).split(/\s*,\s*/);for(var n in i)if(r.can(i[n],e))return i[n];return null},r.getMode=function(e,i,n){var r=null;if("undefined"===t.typeOf(n)&&(n="browser"),i&&!t.isEmptyObj(e)){if(t.each(i,function(i,n){if(e.hasOwnProperty(n)){var o=e[n](i);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(n,r)?n:r[0];if(r===!1)return!1}return n},r.getGlobalEventTarget=function(){if(/^moxie\./.test(e.global_event_dispatcher)&&!e.can("access_global_ns")){var i=t.guid("moxie_event_target_");window[i]=function(e,t){n.instance.dispatchEvent(e,t)},e.global_event_dispatcher=i}return e.global_event_dispatcher},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),n("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(e,t,i,n){return function(){var e;i.extend(this,{connectRuntime:function(r){function o(i){var a,l;return i.length?(a=i.shift().toLowerCase(),(l=n.getConstructor(a))?(e=new l(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,s.ruid=e.uid,s.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(i)}),e.bind("Exception",function(e,i){var n=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,n))}),e.mode?void e.init():void e.trigger("Error")):void o(i)):(s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),void(e=null))}var a,s=this;if("string"===i.typeOf(r)?a=r:"string"===i.typeOf(r.ruid)&&(a=r.ruid),a){if(e=n.getRuntime(a))return s.ruid=a,e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null},can:function(t){return!!e&&e.can(t)}})}}),n("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(e,t,i){function n(o,a){function s(t,i,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new n(null,{type:o,size:i-t}),a.detach(s.substr(t,a.size)),a):null}i.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,i){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var i=e.indexOf(";base64,");this.type=e.substring(5,i),e=t.atob(e.substring(i+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return n}),n("moxie/core/I18n",["moxie/core/utils/Basic"],function(e){var t={};return{addI18n:function(i){return e.extend(t,i)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),n("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(e,t){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb xlt xla,application/vnd.ms-powerpoint,ppt pps pot ppa,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",n={},r={},o=function(e){var t,i,o,a=e.split(/,/);for(t=0;ta;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):n.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(i){t.each(n,function(e){i(e.value,e.name)}),e&&i(e.value,e.name)},destroy:function(){e=null,n=[]}})}return n}),n("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,l,u,c,d){function p(){this.uid=e.guid("uid_")}function f(){function i(e,t){return S.hasOwnProperty(e)?1===arguments.length?c.can("define_property")?S[e]:I[e]:void(c.can("define_property")?S[e]=t:I[e]=t):void 0}function l(t){function n(){_&&(_.destroy(),_=null),s.dispatchEvent("loadend"),s=null}function r(r){_.bind("LoadStart",function(e){i("readyState",f.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),N&&s.upload.dispatchEvent(e)}),_.bind("Progress",function(e){i("readyState")!==f.LOADING&&(i("readyState",f.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),_.bind("UploadProgress",function(e){N&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),_.bind("Load",function(t){i("readyState",f.DONE),i("status",Number(r.exec.call(_,"XMLHttpRequest","getStatus")||0)),i("statusText",m[i("status")]||""),i("response",r.exec.call(_,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),k=r.exec.call(_,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),i("status")>0?(N&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(M=!0,s.dispatchEvent("error")),n()}),_.bind("Abort",function(e){s.dispatchEvent(e),n()}),_.bind("Error",function(e){M=!0,i("readyState",f.DONE),s.dispatchEvent("readystatechange"),L=!0,s.dispatchEvent(e),n()}),r.exec.call(_,"XMLHttpRequest","send",{url:v,method:x,async:T,user:E,password:y,headers:A,mimeType:D,encoding:O,responseType:s.responseType,withCredentials:s.withCredentials,options:B},t)}var s=this;b=(new Date).getTime(),_=new a,"string"==typeof B.required_caps&&(B.required_caps=o.parseCaps(B.required_caps)),B.required_caps=e.extend({},B.required_caps,{return_response_type:s.responseType}),t instanceof u&&(B.required_caps.send_multipart=!0),e.isEmptyObj(A)||(B.required_caps.send_custom_headers=!0),z||(B.required_caps.do_cors=!0),B.ruid?r(_.connectRuntime(B)):(_.bind("RuntimeInit",function(e,t){r(t)}),_.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),_.connectRuntime(B))}function g(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),b=w=null}var v,x,E,y,b,w,_,R,I=this,S={timeout:0,readyState:f.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,A={},O=null,D=null,F=!1,C=!1,N=!1,L=!1,M=!1,z=!1,U=null,P=null,B={},k="";e.extend(this,S,{uid:e.guid("uid_"),upload:new p,open:function(o,a,s,l,u){var c;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||n.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(x=o.toUpperCase()),~e.inArray(x,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=n.utf8_encode(a),c=r.parseUrl(a),z=r.hasSameOrigin(c),v=r.resolveUrl(a),(l||u)&&!z)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(E=l||c.user,y=u||c.pass,T=s||!0,T===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);F=!T,C=!1,A={},g.call(this),i("readyState",f.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(i("readyState")!==f.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||n.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),!~e.inArray(r,a)&&!/^(proxy\-|sec\-)/.test(r)&&(A[r]?A[r]+=", "+o:A[r]=o,!0)},hasRequestHeader:function(e){return e&&A[e.toLowerCase()]||!1},getAllResponseHeaders:function(){return k||""},getResponseHeader:function(t){return t=t.toLowerCase(),M||~e.inArray(t,["set-cookie","set-cookie2"])?null:k&&""!==k&&(R||(R={},e.each(k.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=e.trim(i[0]),R[i[0].toLowerCase()]={header:i[0],value:e.trim(i[1])})})),R.hasOwnProperty(t))?R[t].header+": "+R[t].value:null},overrideMimeType:function(n){var r,o;if(~e.inArray(i("readyState"),[f.LOADING,f.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n=e.trim(n.toLowerCase()),/;/.test(n)&&(r=n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(n=r[1],r[2]&&(o=r[2])),!d.mimes[n])throw new t.DOMException(t.DOMException.SYNTAX_ERR);U=n,P=o},send:function(i,r){if(B="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==f.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof s)B.ruid=i.ruid,D=i.type||"application/octet-stream";else if(i instanceof u){if(i.hasBlob()){var o=i.getBlob();B.ruid=o.ruid,D=o.type||"application/octet-stream"}}else"string"==typeof i&&(O="UTF-8",D="text/plain;charset=UTF-8",i=n.utf8_encode(i));this.withCredentials||(this.withCredentials=B.required_caps&&B.required_caps.send_browser_cookies&&!z),N=!F&&this.upload.hasEventListener(),M=!1,L=!i,F||(C=!0),l.call(this,i)},abort:function(){if(M=!0,F=!1,~e.inArray(i("readyState"),[f.UNSENT,f.OPENED,f.DONE]))i("readyState",f.UNSENT);else{if(i("readyState",f.DONE),C=!1,!_)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);_.getRuntime().exec.call(_,"XMLHttpRequest","abort",L),L=!0}},destroy:function(){_&&("function"===e.typeOf(_.destroy)&&_.destroy(),_=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(h.concat(["readystatechange"])),this.upload.handleEventProps(h)}var m={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};p.prototype=i.instance;var h=["loadstart","progress","abort","error","load","timeout","loadend"];return f.UNSENT=0,f.OPENED=1,f.HEADERS_RECEIVED=2,f.LOADING=3,f.DONE=4,f.prototype=i.instance,f}),n("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i,n){function r(){function n(){c=d=0,u=this.result=null}function o(t,i){var n=this;l=i,n.bind("TransportingProgress",function(t){d=t.loaded,c>d&&-1===e.inArray(n.state,[r.IDLE,r.DONE])&&a.call(n)},999),n.bind("TransportingComplete",function(){d=c,n.state=r.DONE,u=null,n.result=l.exec.call(n,"Transporter","getAsBlob",t||"")},999),n.state=r.BUSY,n.trigger("TransportingStarted"),a.call(n)}function a(){var e,i=this,n=c-d;p>n&&(p=n),e=t.btoa(u.substr(d,p)),l.exec.call(i,"Transporter","receive",e,c)}var s,l,u,c,d,p;i.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,i,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),p=r.chunk_size,n.call(this),u=t,c=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,i,this.connectRuntime(r));else{var l=function(e,t){a.unbind("RuntimeInit",l),o.call(a,i,t)};this.bind("RuntimeInit",l),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,l&&(l.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),n.call(e)},destroy:function(){this.unbindAll(),l=null,this.disconnectRuntime(),n.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=n.instance,r}),n("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(e,t,i,n,r,o,a,s,l,u,c,d,p){function f(){function n(e){try{return e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name),!0}catch(t){return this.trigger("error",t.code),!1}}function u(t){var n=e.typeOf(t);try{if(t instanceof f){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);h.apply(this,arguments)}else if(t instanceof c){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))u.call(this,new d(null,t),arguments[1]);else if("string"===n)"data:"===t.substr(0,5)?u.call(this,new c(null,{data:t}),arguments[1]):v.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);u.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function h(t,i){var n=this.connectRuntime(t.ruid);this.ruid=n.uid,n.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(i)||i)}function g(t,i){function n(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=o.parseCaps(i.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):n(this.connectRuntime(t.ruid))}function v(e,t){var i,n=this;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){u.apply(this,arguments)},resize:function(t){var n,r,o=this,a={x:0,y:0,width:o.width,height:o.height},s=e.extendIf({width:o.width,height:o.height,type:o.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t);try{if(!o.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(o.width>f.MAX_RESIZE_WIDTH||o.height>f.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if(n=o.meta&&o.meta.tiff&&o.meta.tiff.Orientation||1,-1!==e.inArray(n,[5,6,7,8])){var l=s.width;s.width=s.height,s.height=l}if(s.crop){switch(r=Math.max(s.width/o.width,s.height/o.height),t.fit?(a.width=Math.min(Math.ceil(s.width/r),o.width),a.height=Math.min(Math.ceil(s.height/r),o.height),r=s.width/a.width):(a.width=Math.min(s.width,o.width),a.height=Math.min(s.height,o.height),r=1),"boolean"==typeof s.crop&&(s.crop="cc"),s.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":a.x=o.width-a.width,a.y=o.height-a.height;break;case"cb":case"center-bottom":a.x=Math.floor((o.width-a.width)/2),a.y=o.height-a.height;break;case"lb":case"left-bottom":a.x=0,a.y=o.height-a.height;break;case"lt":case"left-top":a.x=0,a.y=0;break;case"ct":case"center-top":a.x=Math.floor((o.width-a.width)/2),a.y=0;break;case"rt":case"right-top":a.x=o.width-a.width,a.y=0;break;case"rc":case"right-center":case"right-middle":a.x=o.width-a.width,a.y=Math.floor((o.height-a.height)/2);break;case"lc":case"left-center":case"left-middle":a.x=0,a.y=Math.floor((o.height-a.height)/2);break;case"cc":case"center-center":case"center-middle":default:a.x=Math.floor((o.width-a.width)/2),a.y=Math.floor((o.height-a.height)/2)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0)}else r=Math.min(s.width/o.width,s.height/o.height),r>1&&!s.fit&&(r=1);this.exec("Image","resize",a,r,s)}catch(u){o.trigger("error",u.code)}},downsize:function(t){var i,n={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,fit:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?e.extend(n,t):e.extend(n,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]}),this.resize(i)},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!l.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return this.exec("Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return p.atob(i.substring(i.indexOf("base64,")+7))},embed:function(n,r){function o(t,r){var o=this;if(l.can("create_canvas")){var c=o.getAsCanvas();if(c)return n.appendChild(c),c=null,o.destroy(),void u.trigger("embedded")}var d=o.getAsDataURL(t,r);if(!d)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(l.can("use_data_uri_of",d.length))n.innerHTML='',o.destroy(),u.trigger("embedded");else{var f=new s;f.bind("TransportingComplete",function(){a=u.connectRuntime(this.result.ruid),u.bind("Embedded",function(){e.extend(a.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),a=null},999),a.exec.call(u,"ImageView","display",this.result.uid,width,height),o.destroy()}),f.transport(p.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:n})}}var a,u=this,c=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,fit:!0,resample:"nearest"},r);try{if(!(n=t.get(n)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);this.width>f.MAX_RESIZE_WIDTH||this.height>f.MAX_RESIZE_HEIGHT;var d=new f;return d.bind("Resize",function(){o.call(this,c.type,c.quality)}),d.bind("Load",function(){this.downsize(c)}),this.meta.thumb&&this.meta.thumb.width>=c.width&&this.meta.thumb.height>=c.height?d.load(this.meta.thumb.data):d.clone(this,!1),d}catch(m){this.trigger("error",m.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.meta&&this.meta.thumb&&this.meta.thumb.data.destroy(),this.unbindAll()}}),this.handleEventProps(m),this.bind("Load Resize",function(){return n.call(this)},999)}var m=["progress","load","error","resize","embedded"];return f.MAX_RESIZE_WIDTH=8192,f.MAX_RESIZE_HEIGHT=8192,f.prototype=u.instance,f}),n("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,l=i.capTest,u=i.capTrue,c=e.extend({access_binary:l(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!s.Image},display_media:l((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:l(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:l(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==n.browser||n.verComp(n.version,9,">"))}()),filter_by_extension:l(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),return_response_headers:u,return_response_type:function(e){return!("json"!==e||!window.JSON)||n.can("return_response_type",e)},return_status_code:u,report_upload_progress:l(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&n.can("create_canvas")},select_file:function(){return n.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===n.browser&&n.verComp(n.version,21,">=")||"Firefox"===n.browser&&n.verComp(n.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===n.browser&&"Windows"===n.os||"iOS"===n.os&&n.verComp(n.osVersion,"7.0.0",">")&&n.verComp(n.osVersion,"8.0.0","<"))},send_binary_string:l(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:l(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:l(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:u,use_http_method:u},arguments[2]);i.call(this,t,arguments[1]||a,c),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(e,t,i){var n;if(!window.File.prototype.slice)return(n=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?n.call(e,t,i):null;try{return e.slice(),e.slice(t,i)}catch(r){return e.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))},this.destroy=function(){this.getRuntime().getShim().removeInstance(this.uid)}}return e.Blob=i}),n("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(e){function t(){this.returnValue=!1}function i(){this.cancelBubble=!0}var n={},r="moxie_"+e.guid(),o=function(o,a,s,l){var u,c;a=a.toLowerCase(),o.addEventListener?(u=s,o.addEventListener(a,u,!1)):o.attachEvent&&(u=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=i,s(e)},o.attachEvent("on"+a,u)),o[r]||(o[r]=e.guid()),n.hasOwnProperty(o[r])||(n[o[r]]={}),c=n[o[r]],c.hasOwnProperty(a)||(c[a]=[]),c[a].push({func:u,orig:s,key:l})},a=function(t,i,o){var a,s;if(i=i.toLowerCase(),t[r]&&n[t[r]]&&n[t[r]][i]){a=n[t[r]][i];for(var l=a.length-1;l>=0&&(a[l].orig!==o&&a[l].key!==o||(t.removeEventListener?t.removeEventListener(i,a[l].func,!1):t.detachEvent&&t.detachEvent("on"+i,a[l].func),a[l].orig=null,a[l].func=null,a.splice(l,1),o===s));l--);if(a.length||delete n[t[r]][i],e.isEmptyObj(n[t[r]])){delete n[t[r]];try{delete t[r]}catch(u){t[r]=s}}}},s=function(t,i){t&&t[r]&&e.each(n[t[r]],function(e,n){a(t,n,i)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),n("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){var e,s;i.extend(this,{init:function(l){var u,c,d,p,f,m,h=this,g=h.getRuntime();e=l,d=o.extList2mimes(e.accept,g.can("filter_by_extension")),c=g.getShimContainer(),c.innerHTML='",u=n.get(g.uid),i.extend(u.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),p=n.get(e.browse_button),s=n.getStyle(p,"z-index")||"auto",g.can("summon_file_dialog")&&("static"===n.getStyle(p,"position")&&(p.style.position="relative"),r.addEvent(p,"click",function(e){var t=n.get(g.uid);t&&!t.disabled&&t.click(),e.preventDefault()},h.uid),h.bind("Refresh",function(){f=parseInt(s,10)||1,n.get(e.browse_button).style.zIndex=f,this.getRuntime().getShimContainer().style.zIndex=f-1})),m=g.can("summon_file_dialog")?p:c,r.addEvent(m,"mouseover",function(){h.trigger("mouseenter")},h.uid),r.addEvent(m,"mouseout",function(){h.trigger("mouseleave")},h.uid),r.addEvent(m,"mousedown",function(){h.trigger("mousedown")},h.uid),r.addEvent(n.get(e.container),"mouseup",function(){h.trigger("mouseup")},h.uid),(g.can("summon_file_dialog")?u:p).setAttribute("tabindex",-1),u.onchange=function v(){if(h.files=[],i.each(this.files,function(i){var n="";return!(!e.directory||"."!=i.name)||(i.webkitRelativePath&&(n="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(g.uid,i),i.relativePath=n,void h.files.push(i))}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=v}h.files.length&&h.trigger("change")},h.trigger({type:"ready",async:!0}),c=null},setOption:function(e,t){var i=this.getRuntime(),r=n.get(i.uid);switch(e){case"accept":if(t){var a=t.mimes||o.extList2mimes(t,i.can("filter_by_extension"));r.setAttribute("accept",a.join(","))}else r.removeAttribute("accept");break;case"directory":t&&i.can("select_folder")?(r.setAttribute("directory",""),r.setAttribute("webkitdirectory","")):(r.removeAttribute("directory"),r.removeAttribute("webkitdirectory"));break;case"multiple":t&&i.can("select_multiple")?r.setAttribute("multiple",""):r.removeAttribute("multiple")}},disable:function(e){var t,i=this.getRuntime();(t=n.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var t=this.getRuntime(),i=t.getShim(),o=t.getShimContainer(),a=e&&n.get(e.container),l=e&&n.get(e.browse_button);a&&r.removeAllEvents(a,this.uid),l&&(r.removeAllEvents(l,this.uid),l.style.zIndex=s),o&&(r.removeAllEvents(o,this.uid),o.innerHTML=""),i.removeInstance(this.uid),e=o=a=l=i=null}})}return e.FileInput=s}),n("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,t,i,n,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=i.toArray(e.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function a(e,i){if(l(e)){var n=new t(m,e);n.relativePath=i||"",h.push(n)}}function s(e){for(var t=[],n=0;n=")&&l.verComp(l.version,7,"<"),m="Android Browser"===l.browser,h=!1;if(f=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),p=u(),p.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(h=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),h=!0;else if((c||m)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return void e.call(s,i,r);if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}p.upload?(i.withCredentials&&(p.withCredentials=!0),p.addEventListener("load",function(e){s.trigger(e)}),p.addEventListener("error",function(e){s.trigger(e)}),p.addEventListener("progress",function(e){s.trigger(e)}),p.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):p.onreadystatechange=function(){switch(p.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=p.getResponseHeader("Content-Length")||0),p.responseText&&(t=p.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:p.onreadystatechange=function(){};try{if(p.status>=200&&p.status<400){s.trigger("load");break}}catch(r){}s.trigger("error")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){p.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in p&&(p.responseType="json"!==i.responseType||l.can("return_response_type","json")?i.responseType:"text"),h?p.sendAsBinary?p.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;i>r;r++)n[r]=this[e](t+r);return n}}),t}),n("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,t){return function i(n){var r,o,a,s=[],l=0;if(r=new e(n),65496!==r.SHORT(0))throw r.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(o=2;o<=r.length();)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;l=r.SHORT(o+2)+2,a>=65505&&65519>=a&&s.push({hex:a,name:"APP"+(15&a),start:o,length:l,segment:r.SEGMENT(o,l)}),o+=l}return r.clear(),{headers:s,restore:function(t){var i,n,r;for(r=new e(t),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,i=s.length;i>n;n++)r.SEGMENT(o,0,s[n].segment),o+=s[n].length;return t=r.SEGMENT(),r.clear(),t},strip:function(t){var n,r,o,a;for(o=new i(t),r=o.headers,o.purge(),n=new e(t),a=r.length;a--;)n.SEGMENT(r[a].start,r[a].length,"");return t=n.SEGMENT(),n.clear(),t},get:function(e){for(var t=[],i=0,n=s.length;n>i;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;r>i&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),n("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,i,n){function r(o){function a(i,r){var o,a,s,l,u,p,f,m,h=this,g=[],v={},x={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},E={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(o=h.SHORT(i),a=0;o>a;a++)if(g=[],f=i+2+12*a,s=r[h.SHORT(f)],s!==t){if(l=x[h.SHORT(f+=2)],u=h.LONG(f+=2),p=E[l],!p)throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(f+=4,p*u>4&&(f=h.LONG(f)+d.tiffHeader),f+p*u>=this.length())throw new n.ImageError(n.ImageError.INVALID_META_ERR);"ASCII"!==l?(g=h.asArray(l,f,u),m=1==u?g[0]:g,v[s]=c.hasOwnProperty(s)&&"object"!=typeof m?c[s][m]:m):v[s]=e.trim(h.STRING(f,u).replace(/\0$/,""))}return v}function s(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=u[e.toLowerCase()];for(var l in s)if(s[l]===t){t=l;break}}n=d[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var c=0;r>c;c++)if(o=n+12*c+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(p){return!1}return!0}var l,u,c,d,p,f;if(i.call(this,o),u={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},c={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},p=d.tiffHeader,l={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return f||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,u.exif)}catch(i){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n=65472&&65475>=t)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}function s(){var e,t,i=d.thumb();return i&&(e=new n(i),t=a(e),e.clear(),t)?(t.data=i,t):null}function l(){d&&c&&u&&(d.clear(),c.purge(),u.clear(),p=c=d=u=null)}var u,c,d,p;if(u=new n(o),65496!==u.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);c=new i(o);try{d=new r(c.get("app1")[0])}catch(f){}p=a.call(this),e.extend(this,{type:"image/jpeg",size:u.length(),width:p&&p.width||0,height:p&&p.height||0,setExif:function(t,i){return!!d&&("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,i),void c.set("app1",d.SEGMENT()))},writeHeaders:function(){return arguments.length?c.restore(arguments[0]):c.restore(o)},stripHeaders:function(e){return c.strip(e)},purge:function(){l.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),n("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(e,t,i){function n(n){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),n=c=l=u=s=null)}function a(e){var t,i,n,r;return t=s.LONG(e),i=s.STRING(e+=4,4),n=e+=4,r=s.LONG(e+t),{length:t,type:i,start:n,CRC:r}}var s,l,u,c;s=new i(n),function(){var t=0,i=0,n=[35152,20039,3338,6666];for(i=0;ii.height?"width":"height",a=Math.round(i[o]*n),s=!1;"nearest"!==r&&(.5>n||n>2)&&(n=.5>n?.5:2,s=!0);var l=t(i,n);return s?e(l,a/l[o],r):l}function t(e,t){var i=e.width,n=e.height,r=Math.round(i*t),o=Math.round(n*t),a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),e=null,a}return{scale:e}}),n("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,l){function u(){function e(){if(!x&&!g)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return x||g}function u(){var t=e();return"canvas"==t.nodeName.toLowerCase()?t:(x=document.createElement("canvas"),x.width=t.width,x.height=t.height,x.getContext("2d").drawImage(t,0,0),x)}function c(e){return n.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+n.btoa(e)}function p(e){var t=this;g=new Image,g.onerror=function(){h.call(this),t.trigger("error",i.ImageError.WRONG_FORMAT)},g.onload=function(){t.trigger("load")},g.src="data:"==e.substr(0,5)?e:d(e,y.type)}function f(e,t){var n,r=this;return window.FileReader?(n=new FileReader,n.onload=function(){t.call(r,this.result)},n.onerror=function(){r.trigger("error",i.ImageError.WRONG_FORMAT)},void n.readAsDataURL(e)):t.call(this,e.getAsDataURL())}function m(e,i){var n=Math.PI/180,r=document.createElement("canvas"),o=r.getContext("2d"),a=e.width,s=e.height;switch(t.inArray(i,[5,6,7,8])>-1?(r.width=s,r.height=a):(r.width=a,r.height=s),i){case 2:o.translate(a,0),o.scale(-1,1);break;case 3:o.translate(a,s),o.rotate(180*n);break;case 4:o.translate(0,s),o.scale(1,-1);break;case 5:o.rotate(90*n),o.scale(1,-1);break;case 6:o.rotate(90*n),o.translate(0,-s);break;case 7:o.rotate(90*n),o.translate(a,-s),o.scale(-1,1);break;case 8:o.rotate(-90*n),o.translate(-a,0)}return o.drawImage(e,0,0,a,s),r}function h(){v&&(v.purge(),v=null),E=g=x=y=null,w=!1}var g,v,x,E,y,b=this,w=!1,_=!0;t.extend(this,{loadFromBlob:function(e){var t=this.getRuntime(),n=!(arguments.length>1)||arguments[1];if(!t.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return y=e,e.isDetached()?(E=e.getSource(),void p.call(this,E)):void f.call(this,e.getSource(),function(e){n&&(E=c(e)),p.call(this,e)})},loadFromImage:function(e,t){this.meta=e.meta,y=new o(null,{name:e.name,size:e.size,type:e.type}),p.call(this,t?E=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t,i=this.getRuntime();return!v&&E&&i.can("access_image_binary")&&(v=new a(E)),t={width:e().width||0,height:e().height||0,type:y.type||l.getFileMime(y.name),size:E&&E.length||y.size||0,name:y.name||"",meta:null},_&&(t.meta=v&&v.meta||this.meta||{},!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof r||(t.meta.thumb.data=new r(null,{type:"image/jpeg",data:t.meta.thumb.data}))),t},resize:function(t,i,n){var r=document.createElement("canvas");if(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(e(),t.x,t.y,t.width,t.height,0,0,r.width,r.height),x=s.scale(r,i),_=n.preserveHeaders,!_){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;x=m(x,o)}this.width=x.width,this.height=x.height,w=!0,this.trigger("Resize")},getAsCanvas:function(){return x||(x=u()),x.id=this.uid+"_canvas",x},getAsBlob:function(e,t){return e!==this.type?(w=!0,new o(null,{name:y.name||"",type:e,data:b.getAsDataURL(e,t)})):new o(null,{name:y.name||"",type:e,data:b.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!w)return g.src;if(u(),"image/jpeg"!==e)return x.toDataURL("image/png");try{return x.toDataURL("image/jpeg",t/100)}catch(i){return x.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!w)return E||(E=c(b.getAsDataURL(e,t))),E;if("image/jpeg"!==e)E=c(b.getAsDataURL(e,t));else{var i;t||(t=90),u();try{i=x.toDataURL("image/jpeg",t/100)}catch(n){i=x.toDataURL("image/jpeg")}E=c(i),v&&(E=v.stripHeaders(E),_&&(v.meta&&v.meta.exif&&v.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),E=v.writeHeaders(E)),v.purge(),v=null)}return w=!1,E},destroy:function(){b=null,h.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=u}),n("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function s(e){var n=i.get(e);n&&"OBJECT"==n.nodeName&&("IE"===t.browser?(n.style.display="none",function r(){4==n.readyState?l(e):setTimeout(r,10)}()):n.parentNode.removeChild(n))}function l(e){var t=i.get(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function u(l){var u,p=this;l=e.extend({swf_url:t.swf_url},l),o.call(this,l,c,{access_binary:function(e){return e&&"browser"===p.mode},access_image_binary:function(e){return e&&"browser"===p.mode},display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===p.mode},resize_image:o.capTrue,return_response_headers:!1,return_response_type:function(t){return!("json"!==t||!window.JSON)||(!e.arrayDiff(t,["","text","document"])||"browser"===p.mode)},return_status_code:function(t){return"browser"===p.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:function(e){return e&&"browser"===p.mode},send_browser_cookies:function(e){return e&&"browser"===p.mode},send_custom_headers:function(e){return e&&"browser"===p.mode},send_multipart:o.capTrue,slice_blob:function(e){return e&&"browser"===p.mode},stream_upload:function(e){return e&&"browser"===p.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===p.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),a()<11.3&&(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return p.getShim().exec(this.uid,e,t,i)},init:function(){var i,r,a;a=this.getShimContainer(),e.extend(a.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),i='',"IE"===t.browser?(r=document.createElement("div"),a.appendChild(r),r.outerHTML=i,r=a=null):a.innerHTML=i,u=setTimeout(function(){p&&!p.initialized&&p.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){s(p.uid),e.call(p),clearTimeout(u),l=u=e=p=null}}(this.destroy)},d)}var c="flash",d={};return o.addConstructor(c,u),d}),n("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={slice:function(e,i,n,r){var o=this.getRuntime();return 0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),e=o.shimExec.call(this,"Blob","slice",i,n,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=i}),n("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){var r={init:function(e){var r=this,o=this.getRuntime(),a=i.get(e.browse_button);a&&(a.setAttribute("tabindex",-1),a=null),this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],n.each(e,function(e){r.files.push(new t(o.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=r}),n("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n=this;return n.result="","readAsDataURL"===e&&(n.result="data:"+(t.type||"")+";base64,"),n.bind("Progress",function(t,r){r&&(n.result+=i(r,e))},999),n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=n}),n("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n,r=this.getRuntime();return(n=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(n="data:"+(t.type||"")+";base64,"+n),i(n,e,t.type)):null}};return e.FileReaderSync=n}),n("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={getAsBlob:function(e){var i=this.getRuntime(),n=i.shimExec.call(this,"Transporter","getAsBlob",e);return n?new t(i.uid,n):null}};return e.Transporter=i}),n("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,t,i,n,r,o,a,s){var l={send:function(e,n){function r(){e.transport=c.mode,c.shimExec.call(u,"XMLHttpRequest","send",e,n)}function o(e,t){c.shimExec.call(u,"XMLHttpRequest","appendBlob",e,t.uid),n=null,r()}function l(e,t){var i=new s;i.bind("TransportingComplete",function(){t(this.result)}),i.transport(e.getSource(),e.type,{ruid:c.uid})}var u=this,c=u.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){c.shimExec.call(u,"XMLHttpRequest","setRequestHeader",t,e.toString())}),n instanceof a){var d;if(n.each(function(e,t){e instanceof i?d=t:c.shimExec.call(u,"XMLHttpRequest","append",t,e)}),n.hasBlob()){var p=n.getBlob();p.isDetached()?l(p,function(e){p.destroy(),o(d,e)}):o(d,p)}else n=null,r()}else n instanceof i?n.isDetached()?l(n,function(e){n.destroy(),n=e.uid,r()}):(n=n.uid,r()):r()},getResponse:function(e){var i,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new n(a.uid,o),"blob"===e)return o;try{if(i=new r,~t.inArray(e,["","text"]))return i.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(i.readAsText(o))}finally{o.destroy()}}return null},abort:function(){var e=this.getRuntime();e.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=l}),n("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,i,n,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(n,"Image","loadFromBlob",e.uid),n=r=null}var n=this,r=n.getRuntime();if(e.isDetached()){var o=new i;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return t.meta&&t.meta.thumb&&t.meta.thumb.data&&!(e.meta.thumb.data instanceof n)&&(t.meta.thumb.data=new n(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var i=this.getRuntime(),r=i.shimExec.call(this,"Image","getAsBlob",e,t);return r?new n(i.uid,r):null},getAsDataURL:function(){var e,t=this.getRuntime(),i=t.Image.getAsBlob.apply(this,arguments);return i?(e=new r,e.readAsDataURL(i)):null}};return e.Image=o}),n("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(e){var t,i,n,r,o,a=!1,s=null,l=0;try{try{s=new ActiveXObject("AgControl.AgControl"),s.IsVersionSupported(e)&&(a=!0),s=null}catch(u){var c=navigator.plugins["Silverlight Plug-In"];if(c){for(t=c.description,"1.0.30226.2"===t&&(t="2.0.30226.2"),i=t.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(n=e.split(".");n.length>4;)n.pop();do r=parseInt(n[l],10),o=parseInt(i[l],10),l++;while(l=r&&!isNaN(r)&&(a=!0)}}}catch(d){a=!1}return a}function s(s){var c,d=this;s=e.extend({xap_url:t.xap_url},s),o.call(this,s,l,{access_binary:o.capTrue,access_image_binary:o.capTrue,display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:o.capTrue,resize_image:o.capTrue,return_response_headers:function(e){return e&&"client"===d.mode},return_response_type:function(e){return"json"!==e||!!window.JSON},return_status_code:function(t){return"client"===d.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:o.capTrue,send_browser_cookies:function(e){return e&&"browser"===d.mode},send_custom_headers:function(e){return e&&"client"===d.mode},send_multipart:o.capTrue,slice_blob:o.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:o.capTrue,use_http_method:function(t){return"client"===d.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),a("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(e,t){var i=[].slice.call(arguments,2);return d.getShim().exec(this.uid,e,t,i)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='',c=setTimeout(function(){d&&!d.initialized&&d.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(d),clearTimeout(c),s=c=e=d=null}}(this.destroy)},u)}var l="silverlight",u={};return o.addConstructor(l,s),u}),n("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){ +return e.Blob=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Dom","moxie/core/utils/Basic"],function(e,t,i,n){function r(e){for(var t="",i=0;ii;i++)t=s.keys[i],a=s[t],a&&(/^(\d|[1-9]\d+)$/.test(a)?a=parseInt(a,10):/^\d*\.\d+$/.test(a)&&(a=parseFloat(a)),r.meta[e][t]=a)}),r.meta&&r.meta.thumb&&r.meta.thumb.data&&!(e.meta.thumb.data instanceof i)&&(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,l=i.capTest,u=i.capTrue;i.call(this,t,a,{access_binary:l(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:l((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:l(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return s.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return!("json"!==t||!window.JSON)||!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&!("Firefox"===n.browser&&n.verComp(n.version,4,"<")||"Opera"===n.browser&&n.verComp(n.version,12,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<"))},upload_filesize:u,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html4",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){function e(){var o,u,d,p,f,m,h=this,g=h.getRuntime();m=i.guid("uid_"),o=g.getShimContainer(),s&&(d=n.get(s+"_form"),d&&(i.extend(d.style,{top:"100%"}),d.firstChild.setAttribute("tabindex",-1))),p=document.createElement("form"),p.setAttribute("id",m+"_form"),p.setAttribute("method","post"),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),i.extend(p.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),f=document.createElement("input"),f.setAttribute("id",m),f.setAttribute("type","file"),f.setAttribute("accept",c.join(",")),g.can("summon_file_dialog")&&f.setAttribute("tabindex",-1),i.extend(f.style,{fontSize:"999px",opacity:0}),p.appendChild(f),o.appendChild(p),i.extend(f.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&i.extend(f.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),f.onchange=function(){var i;this.value&&(i=this.files?this.files[0]:{name:this.value},i=new t(g.uid,i),this.onchange=function(){},e.call(h),h.files=[i],f.setAttribute("id",i.uid),p.setAttribute("id",i.uid+"_form"),h.trigger("change"),f=p=null)},g.can("summon_file_dialog")&&(u=n.get(l.browse_button),r.removeEvent(u,"click",h.uid),r.addEvent(u,"click",function(e){f&&!f.disabled&&f.click(),e.preventDefault()},h.uid)),s=m,o=d=u=null}var s,l,u,c=[];i.extend(this,{init:function(t){var i,a=this,s=a.getRuntime();l=t,c=o.extList2mimes(t.accept,s.can("filter_by_extension")),i=s.getShimContainer(),function(){var e,o,c;e=n.get(t.browse_button),u=n.getStyle(e,"z-index")||"auto",s.can("summon_file_dialog")?("static"===n.getStyle(e,"position")&&(e.style.position="relative"),a.bind("Refresh",function(){o=parseInt(u,10)||1,n.get(l.browse_button).style.zIndex=o,this.getRuntime().getShimContainer().style.zIndex=o-1})):e.setAttribute("tabindex",-1),c=s.can("summon_file_dialog")?e:i,r.addEvent(c,"mouseover",function(){a.trigger("mouseenter")},a.uid),r.addEvent(c,"mouseout",function(){a.trigger("mouseleave")},a.uid),r.addEvent(c,"mousedown",function(){a.trigger("mousedown")},a.uid),r.addEvent(n.get(t.container),"mouseup",function(){a.trigger("mouseup")},a.uid),e=null}(),e.call(this),i=null,a.trigger({type:"ready",async:!0})},setOption:function(e,t){var i,r=this.getRuntime();"accept"==e&&(c=t.mimes||o.extList2mimes(t,r.can("filter_by_extension"))),i=n.get(s),i&&i.setAttribute("accept",c.join(","))},disable:function(e){var t;(t=n.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),o=l&&n.get(l.container),a=l&&n.get(l.browse_button);o&&r.removeAllEvents(o,this.uid),a&&(r.removeAllEvents(a,this.uid),a.style.zIndex=u),i&&(r.removeAllEvents(i,this.uid),i.innerHTML=""),t.removeInstance(this.uid),s=c=l=i=o=a=t=null}})}return e.FileInput=s}),n("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),n("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,t,i,n,r,o,a,s){function l(){function e(e){var t,n,r,a,s=this,l=!1;if(c){if(t=c.id.replace(/_iframe$/,""),n=i.get(t+"_form")){for(r=n.getElementsByTagName("input"),a=r.length;a--;)switch(r[a].getAttribute("type")){case"hidden":r[a].parentNode.removeChild(r[a]);break;case"file":l=!0}r=[],l||n.parentNode.removeChild(n),n=null}setTimeout(function(){o.removeEvent(c,"load",s.uid),c.parentNode&&c.parentNode.removeChild(c);var t=s.getRuntime().getShimContainer();t.children.length||t.parentNode.removeChild(t),t=c=null,e()},1)}}var l,u,c;t.extend(this,{send:function(d,p){function f(){var i=E.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='',c=r.firstChild,i.appendChild(c),o.addEvent(c,"load",function(){var i;try{i=c.contentWindow.document||c.contentDocument||window.frames[c.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?l=i.title.replace(/^(\d+).*$/,"$1"):(l=200,u=t.trim(i.body.innerHTML),x.trigger({type:"progress",loaded:u.length,total:u.length}),v&&x.trigger({type:"uploadprogress",loaded:v.size||1025,total:v.size||1025}))}catch(r){if(!n.hasSameOrigin(d.url))return void e.call(x,function(){x.trigger("error")});l=404}e.call(x,function(){x.trigger("load")})},x.uid)}var m,h,g,v,x=this,E=x.getRuntime();if(l=u=null,p instanceof s&&p.hasBlob()){if(v=p.getBlob(),m=v.uid,g=i.get(m),h=i.get(m+"_form"),!h)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else m=t.guid("uid_"),h=document.createElement("form"),h.setAttribute("id",m+"_form"),h.setAttribute("method",d.method),h.setAttribute("enctype","multipart/form-data"),h.setAttribute("encoding","multipart/form-data"),E.getShimContainer().appendChild(h);h.setAttribute("target",m+"_iframe"),p instanceof s&&p.each(function(e,i){if(e instanceof a)g&&g.setAttribute("name",i);else{var n=document.createElement("input");t.extend(n,{type:"hidden",name:i,value:e}),g?h.insertBefore(n,g):h.appendChild(n)}}),h.setAttribute("action",d.url),f(),h.submit(),x.trigger("loadstart")},getStatus:function(){return l},getResponse:function(e){if("json"===e&&"string"===t.typeOf(u)&&window.JSON)try{return JSON.parse(u.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return u},abort:function(){var t=this;c&&c.contentWindow&&(c.contentWindow.stop?c.contentWindow.stop():c.contentWindow.document.execCommand?c.contentWindow.document.execCommand("Stop"):c.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})},destroy:function(){this.getRuntime().getShim().removeInstance(this.uid)}})}return e.XMLHttpRequest=l}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)}),!function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.plupload};"function"==typeof define&&define.amd?define("plupload",["./moxie"],i):"object"==typeof module&&module.exports?module.exports=i(require("./moxie")):e.plupload=i(e.moxie)}(this||window,function(e){!function(e,t,i){function n(e){function t(e,t,i){var r={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};r[e]?n[r[e]]=t:i||(n[e]=t)}var i=e.required_features,n={};return"string"==typeof i?l.each(i.split(/\s*,\s*/),function(e){t(e,!0)}):"object"==typeof i?l.each(i,function(e,i){t(i,e)}):i===!0&&(e.chunk_size&&e.chunk_size>0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart!==!1||(n.send_binary_string=!0),e.http_method&&(n.use_http_method=e.http_method),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,o={},a=t.core.utils,s=t.runtime.Runtime,l={VERSION:"2.3.6",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,moxie:t,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=s.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){o[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),void i(!1);i(!0)}),l.addFileFilter("prevent_empty",function(e,t,n){e&&!t.size&&t.size!==i?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),n(!1)):n(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t0?Math.ceil(100*(e.loaded/e.size)):100,c()}function c(){var e,t,n,r=0;for(S.reset(),e=0;eI)&&(r+=n),S.loaded+=n):S.size=i,t.status==l.DONE?S.uploaded++:t.status==l.FAILED?S.failed++:S.queued++;S.size===i?S.percent=O.length>0?Math.ceil(100*(S.uploaded/O.length)):0:(S.bytesPerSec=Math.ceil(r/((+new Date-I||1)/1e3)),S.percent=S.size>0?Math.ceil(100*(S.loaded/S.size)):0)}function d(){var e=F[0]||C[0];return!!e&&e.getRuntime().uid}function p(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",y),this.bind("BeforeUpload",g),this.bind("UploadFile",v),this.bind("UploadProgress",x),this.bind("StateChanged",E),this.bind("QueueChanged",c),this.bind("Error",w),this.bind("FileUploaded",b),this.bind("Destroy",_)}function f(e,i){var n=this,r=0,o=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:D,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){o.push(function(o){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=s.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,F.push(this),o()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){N||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,o()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){o.push(function(i){var o=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));o.onready=function(){var e=s.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,C.push(this),i()},o.ondrop=function(){n.addFile(this.files)},o.bind("error runtimeerror",function(){o=null,i()}),o.init()})}),l.inSeries(o,function(){"function"==typeof i&&i(r)})}function m(e,n,r,o){var a=new t.image.Image;try{a.onload=function(){n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),o(e)):a.downsize(n.width,n.height,n.crop,n.preserve_headers)},a.onresize=function(){var t=this.getAsBlob(e.type,n.quality);this.destroy(),o(t)},a.bind("error runtimeerror",function(){this.destroy(),o(e)}),a.load(e,r)}catch(s){o(e)}}function h(e,i,r){function o(e,i,n){var r=R[e];switch(e){case"max_file_size":"max_file_size"===e&&(R.max_file_size=R.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(R[e]=i,R.send_file_name=!0);break;case"multipart":R[e]=i,i||(R.send_file_name=!0);break;case"http_method":R[e]="PUT"===i.toUpperCase()?"PUT":"POST";break;case"unique_names":R[e]=i,i&&(R.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(R.filters,i):R.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),R.filters.mime_types=i.mime_types);break;case"resize":R.resize=!!i&&l.extend({preserve_headers:!0,crop:!1},i);break;case"prevent_duplicates":R.prevent_duplicates=R.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":R[e]=i,n||(u=!0);break;default:R[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){o(t,e,r)}):o(e,i,r),r?(R.required_features=n(l.extend({},R)),D=n(l.extend({},R,{required_features:!0}))):u&&(a.trigger("Destroy"),f.call(a,R,function(e){e?(a.runtime=s.getInfo(d()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function g(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function v(e,i){function n(){d-- >0?r(o,1e3):(i.loaded=f,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()}))}function o(){var t,n,r={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(r.name=i.target_name||i.name),c&&p.chunks&&s.size>c?(n=Math.min(c,s.size-f),t=s.slice(f,f+n)):(n=s.size,t=s),c&&p.chunks&&(e.settings.send_chunk_number?(r.chunk=Math.ceil(f/c),r.chunks=Math.ceil(s.size/c)):(r.offset=f,r.total=s.size)),e.trigger("BeforeChunkUpload",i,r,t,f)&&a(r,t,n))}function a(a,c,m){var g;T=new t.xhr.XMLHttpRequest,T.upload&&(T.upload.onprogress=function(t){i.loaded=Math.min(i.size,f+t.loaded),e.trigger("UploadProgress",i)}),T.onload=function(){return T.status<200||T.status>=400?void n():(d=e.settings.max_retries,m=s.size?(i.size!=i.origSize&&(s.destroy(),s=null),e.trigger("UploadProgress",i),i.status=l.DONE,i.completeTimestamp=+new Date,e.trigger("FileUploaded",i,{response:T.responseText,status:T.status,responseHeaders:T.getAllResponseHeaders()})):r(o,1)))},T.onerror=function(){n()},T.onloadend=function(){this.destroy()},e.settings.multipart&&p.multipart?(T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),g=new t.xhr.FormData,l.each(l.extend(a,e.settings.multipart_params),function(e,t){g.append(t,e)}),g.append(e.settings.file_data_name,c),T.send(g,h)):(u=l.buildUrl(e.settings.url,l.extend(a,e.settings.multipart_params)),T.open(e.settings.http_method,u,!0),l.each(e.settings.headers,function(e,t){T.setRequestHeader(t,e)}),T.hasRequestHeader("Content-Type")||T.setRequestHeader("Content-Type","application/octet-stream"),T.send(c,h))}var s,u=e.settings.url,c=e.settings.chunk_size,d=e.settings.max_retries,p=e.features,f=0,h={runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:D,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url};i.loaded&&(f=i.loaded=c?c*Math.floor(i.loaded/c):0),s=i.getSource(),l.isEmptyObj(e.settings.resize)||-1===l.inArray(s.type,["image/jpeg","image/png"])?o():m(s,e.settings.resize,h,function(e){s=e,i.size=e.size,o()})}function x(e,t){u(t)}function E(e){if(e.state==l.STARTED)I=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,c())}function y(){T&&T.abort()}function b(e){c(),r(function(){a.call(e)},1)}function w(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,t.file.completeTimestamp=+new Date,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function _(e){e.stop(),l.each(O,function(e){e.destroy()}),O=[],F.length&&(l.each(F,function(e){e.destroy()}),F=[]),C.length&&(l.each(C,function(e){e.destroy()}),C=[]),D={},N=!1,I=T=null,S.reset()}var R,I,S,T,A=l.guid(),O=[],D={},F=[],C=[],N=!1;R={chunk_size:0,file_data_name:"file",filters:{mime_types:[],max_file_size:0,prevent_duplicates:!1,prevent_empty:!0},flash_swf_url:"js/Moxie.swf",http_method:"POST",max_retries:0,multipart:!0,multi_selection:!0,resize:!1,runtimes:s.order,send_file_name:!0,send_chunk_number:!0,silverlight_xap_url:"js/Moxie.xap"},h.call(this,e,null,!0),S=new l.QueueProgress,l.extend(this,{id:A,uid:A,state:l.STOPPED,features:{},runtime:null,files:O,settings:R,total:S,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),p.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):R.browse_button||R.drop_element?void f.call(i,R,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=s.getInfo(d()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){h.call(this,e,t,!this.runtime)},getOption:function(e){return e?R[e]:R},refresh:function(){F.length&&l.each(F,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){N=arguments[0]===i||arguments[0],F.length&&l.each(F,function(e){e.disable(N)}),this.trigger("DisableBrowse",N)},getFile:function(e){var t;for(t=O.length-1;t>=0;t--)if(O[t].id===e)return O[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){o[n]&&i.push(function(i){o[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var o=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!s)return!1;e.ruid=s,e.connectRuntime(s)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),c.push(function(t){n(e,function(i){i||(O.push(e),p.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(o,["file","blob"])?a(new t.file.File(null,e)):"node"===o&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===o&&(i=null,l.each(e,a))}var s,u=this,c=[],p=[];s=d(),a(e),c.length&&l.inSeries(c,function(){p.length&&u.trigger("FilesAdded",p)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=O.length-1;i>=0;i--)if(O[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=O.splice(e===i?0:e,t===i?O.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n
          0KB
          ',l={rename:!0,renameByClick:!0,dropPlaceholder:!0,previewImageIcon:!0,sendFileName:!0,sendFileId:!0,responseHandler:!0,uploadedMessage:!0,drop_element:"self",browse_button:"hidden",filters:{prevent_duplicates:!0},chunk_size:"1mb",max_retries:3,flash_swf_url:"lib/uploader/Moxie.swf",silverlight_xap_url:"lib/uploader/Moxie.xap"},u={QUEUED:i.QUEUED,UPLOADING:i.UPLOADING,FAILED:i.FAILED,DONE:i.DONE,STOPPED:i.STOPPED,STARTED:i.STARTED};u[i.QUEUED]="queue",u[i.UPLOADING]="uploading",u[i.FAILED]="failed",u[i.DONE]="done";var c={GENERIC_ERROR:i.GENERIC_ERROR,HTTP_ERROR:i.HTTP_ERROR,IO_ERROR:i.IO_ERROR,SECURITY_ERROR:i.SECURITY_ERROR,INIT_ERROR:i.INIT_ERROR,FILE_SIZE_ERROR:i.FILE_SIZE_ERROR,FILE_EXTENSION_ERROR:i.FILE_EXTENSION_ERROR,FILE_DUPLICATE_ERROR:i.FILE_DUPLICATE_ERROR,IMAGE_FORMAT_ERROR:i.IMAGE_FORMAT_ERROR,IMAGE_MEMORY_ERROR:i.IMAGE_MEMORY_ERROR,IMAGE_DIMENSIONS_ERROR:i.IMAGE_DIMENSIONS_ERROR},d=function(n,l){var u=this;u.name=a,u.$=e(n).addClass("uploader"),l=u.getOptions(l);var c=e.isPlainObject(l.lang)?e.extend(!0,{},d.LANG[c.lang||e.zui.clientLang()],l.lang):d.LANG[l.lang];u.lang=c;var p,f=u.$,m=l.fileList;p=m&&"large"!=m&&"grid"!=m?0===m.indexOf(">")?f.find(m.substr(1)):e(m):f.find(".file-list,.uploader-files"),p&&p.length||(p=e('
          ')),p.parent().length||f.append(p),"large"==m?p.addClass("file-list-lg"):"grid"==m&&p.addClass("file-list-grid"),p.children(".file").addClass("file-static"),u.$list=p,(l.browseByClickList||p.hasClass("uploader-btn-browse"))&&p.addClass("uploader-btn-browse").on("click",".file-wrapper > .actions,.file-renaming .file-name",function(e){e.stopPropagation()});var h=l.fileTemplate;if(!h){var g=p.find(".template");g.length&&(h=g.first().clone().removeClass("template"),g.remove()),h||(h=s)}"string"==typeof h&&(h=e(h),h.parent()&&(h=h.clone().removeClass("template"))),u.template=h;var v=l.browse_button,x=null; +v&&(0===v.indexOf(">")?x=f.find(v.substr(1)):"hidden"!==v&&(x=e(v))),x&&x.length||(x=e('
          ').appendTo(f)),u.$button=x.first();var E=l.drop_element,y=("fileList"==E?u.$list:"self"==E?u.$:e(E)).first().addClass("file-drag-area");if(o)y.attr("data-drop-placeholder","");else{var b=l.dropPlaceholder;b===!0&&(b=c.dropPlaceholder),b&&y.attr("data-drop-placeholder",b)}u.$dropElement=y,u.$message=f.find(".uploader-message").on("click",".close",function(){u.hideMessage()}),u.$status=f.find(".uploader-status"),f.toggleClass("uploader-rename",!!l.rename),u.initPlupload(),f.on("click."+a,".uploader-btn-start",function(e){u.start()}).on("click."+a,".uploader-btn-browse",function(t){e(this).is(u.$button)||u.$button.trigger("click")}).on("click."+a,".uploader-btn-stop",function(e){u.stop()}),e("body").on("dragleave."+a+" drop."+a,function(e){f.removeClass("file-dragable"),e.preventDefault(),e.stopPropagation()}).on("dragover."+a+" dragenter."+a,function(e){f.addClass("file-dragable")}),y.on("dragleave."+a+" drop."+a,function(e){f.removeClass("file-drag-enter")}).on("dragover."+a+" dragenter."+a,function(e){f.addClass("file-drag-enter")}),p.on("click."+a,".btn-delete-file",function(){var n=e(this).closest(".file"),r=n.data("file"),o=l.deleteActionOnDone,a=r.status===i.DONE&&e.isFunction(o);if(r.status===i.QUEUED||r.status===i.FAILED||a){var s=function(){u.removeFile(r)},d=function(){if(a){var e=o.call(u,r,s);e===!0&&s()}else s()},p=l.deleteConfirm;if(p){var f=e.isFunction(p)?p(r):p===!0?c.deleteConfirm:p;f=f.format(r),t.bootbox?t.bootbox.confirm(f,function(e){e&&d()}):t.confirm(f)&&d()}else d()}}).on("click."+a,".btn-reset-file",function(){var t=e(this).closest(".file"),n=u.plupload.getFile(t.data("id"))||t.data("file");n.status===i.FAILED&&(n.status=i.QUEUED,u.showFile(n),l.autoUpload&&u.start())}),l.rename&&(p.toggleClass("file-rename-by-click",!!l.renameByClick).toggleClass("file-show-rename-action-on-done",!!l.renameActionOnDone),p.on("click."+a,".btn-rename-file"+(l.renameByClick?",.file-name":""),function(){var t=e(this).closest(".file");if(!t.hasClass("file-renaming")){var n=u.plupload.getFile(t.data("id"))||t.data("file"),o=l.renameActionOnDone,s=n.status===i.DONE&&e.isFunction(o);if(s||n.status===i.QUEUED){var c=t.find(".file-name").first();t.addClass("file-renaming"),u.showFile(n),!l.renameExtension&&n.ext&&c.text(n.name.substr(0,n.name.length-n.ext.length-1)),c.attr("contenteditable","true").one("blur",function(){var i=e.trim(c.text()),d=function(){if(i!==r&&null!==i&&""!==i){var e=n.ext;e.length&&!l.renameExtension&&i.lastIndexOf("."+e)!==i.length-e.length-1&&(i+="."+e),n.name=i}u.showFile(n)};if(s){var p=o.call(u,n,i,d);p===!0?d():p===!1&&u.showFile(n)}else d();t.removeClass("file-renaming"),c.off("keydown."+a).attr("contenteditable",null)}).on("keydown."+a,function(e){13===e.keyCode&&(c.blur(),e.preventDefault())}).focus()}}})),p.toggleClass("file-show-delete-action-on-done",!!l.deleteActionOnDone),u.staticFilesSize=0,u.staticFilesCount=0,l.staticFiles&&e.each(l.staticFiles,function(t,n){n=e.extend({status:i.DONE},n),n["static"]=!0,n.id||(n.id=e.zui.uuid()),u.showFile(n),n.size&&(u.staticFilesSize+=n.size,u.staticFilesCount++)}),u.callEvent("onInit")};d.DEFAULTS=l,d.prototype.showMessage=function(e,t,i){var n=this,o=n.$message;e?clearTimeout(n.lastDismissMessage):n.hideMessage(),t=t||"danger",i===r&&(i="danger"===t?10:6),i<20&&(i*=1e3);var a=o.find(".content");a.length?a.empty().append(e):o.empty().append(e),o.attr("data-type",t).slideDown("fast"),i&&(n.lastDismissMessage=setTimeout(function(){n.hideMessage()},i))},d.prototype.hideMessage=function(){clearTimeout(this.lastDismissMessage),this.$message.slideUp("fast")},d.prototype.start=function(){return this.options.autoResetFails&&e.each(this.getFiles(),function(e,t){t.status===i.FAILED&&(t.status=i.QUEUED)}),this.plupload.start()},d.prototype.stop=function(){return this.plupload.stop()},d.prototype.getState=function(){return this.plupload.state},d.prototype.isStarted=function(){return this.getState()===i.STARTED},d.prototype.isStopped=function(){return this.getState()===i.STOPPED},d.prototype.getFiles=function(){return this.plupload.files},d.prototype.getTotal=function(){return this.plupload.total},d.prototype.disableBrowse=function(e){return this.$.find(".uploader-btn-browse").attr("disable",e?"disable":null).toggle("disable",!!e),this.plupload.disableBrowse()},d.prototype.getFile=function(e){return this.plupload.getFile(e)},d.prototype.destroy=function(){var t=this,i="."+a;t.$.off(i).data(a,null),t.$list.off(i),t.$dropElement.off(i),e("body").off(i),t.plupload.destroy()},d.prototype.previewImageSrc=function(t,i){if(t&&t.getSource&&/image\//.test(t.type)){var r=e.extend({width:200,height:200},this.options.previewImageSize);if("image/gif"==t.type){var o=new n.file.FileReader;o.onload=function(){i(o.result),o.destroy(),o=null},o.readAsDataURL(t.getSource())}else{var a=new n.image.Image;a.onload=function(){a.downsize(r.width,r.height);var e="image/jpeg"==a.type?a.getAsDataURL("image/jpeg",80):a.getAsDataURL();i(e),a.destroy(),a=null},a.load(t.getSource())}}},d.prototype.createFileIcon=function(e){var t=e.type,i=e.ext,n="file-o",r=t?t.split("/"):null,o=r&&r.length?r[0]:"",a=(r&&r.length)>1?r[1]:"";return"image"==o?n="file-image":"doc"==i||"docx"==i||"pages"==i?n="file-word":"ppt"==i||"pptx"==i||"key"==i?n="file-powerpoint":"xls"==i||"xlsx"==i||"numbers"==i?n="file-excel":"html"==i||"htm"==i?n="globe":"js"==i||"php"==i||"cs"==i||"jsx"==i||"css"==i||"less"==i||"json"==i||"java"==i||"lua"==i||"py"==i||"c"==i||"cpp"==i||"swift"==i||"h"==i||"sh"==i||"rb"==i||"yml"==i||"ini"==i||"sql"==i||"xml"==i?n="file-code":"apk"==i?n="android":"exe"==i?n="windows":"pkg"==i||"msi"==i||"dmg"==i?n="cube":"epub"==i?n="book":"sketch"==i?n="diamond":"zip"==a||"x-rar"==a||"x-7z-compressed"==a?n="file-archive":"pdf"==a?n="file-pdf":"video"==o?n="file-movie":"audio"==o?n="file-audio":"text"==o&&(n="file-text-o"),'"},d.prototype.getFileItem=function(t){var i=this;if("string"==typeof t&&(t=i.plupload.getFile(t)),!t)return null;var n=t.name;if(n&&t.ext===r){var o=n.lastIndexOf(".");o=o>-1?n.substr(o+1):"",t.ext=o,t.type&&/image\//.test(t.type)&&(t.isImage=t.ext)}var a=e("#file-"+t.id);return a.length||(e.isFunction(i.template)?a=e(i.template(t,i)):(a=e(i.template).clone(),a.find(".btn-rename-file").attr("title",i.lang.rename),a.find(".btn-delete-file").attr("title",i.lang.remove),a.find(".btn-reset-file").attr("title",i.lang.repeat),a.find(".btn-download-file").attr("title",i.lang.download).attr("download",t.name)),a.data("id",t.id).toggleClass("file-static",!!t["static"]).attr("id","file-"+t.id).appendTo(i.$list),e.fn.tooltip&&a.find('[data-toggle="tooltip"]').tooltip()),a},d.prototype.showFile=function(t,n){var r=this;if(e.isArray(t))return void e.each(t,function(e,t){r.showFile(t,n)});if("string"==typeof t&&(t=r.plupload.getFile(t)),t){var o=r.getFileItem(t);if(o&&o.length){var a=r.options,s=u[t.status];if(a.fileFormater)a.fileFormater.call(r,o,t,s);else{var l="done"==s&&t.url?t.url:null;o.find(".file-name").text(t.name),o.find(".file-size").text(("uploading"==s?i.formatSize(Math.floor(t.size*t.percent/100)).toUpperCase()+"/":"")+i.formatSize(t.size).toUpperCase()),o.find(".file-icon").html(a.fileIconCreator?a.fileIconCreator(t.type,t,r):r.createFileIcon(t)).css("color","hsl("+e.zui.strCode(t.type||t.ext)+", 70%, 40%)"),o.find(".file-progress-bar").css("width",t.percent+"%");var c=o.find(".file-status").attr("title",r.lang[s]);c.find(".text").text("uploading"==s?t.percent+"%":"failed"==s?r.lang[s]:""),e.fn.tooltip&&o.find('[data-toggle="tooltip"]').tooltip("fixTitle"),o.find("a.btn-download-file, a.file-name").attr("href",l)}if(a.previewImageIcon&&t.isImage){var d=function(){o.find(".file-icon").html('
          ')};t.previewImage?d():r.previewImageSrc(t,function(e){t.previewImage=e,d()})}o.attr("data-status",s).data("file",t)}}},d.prototype.showStatus=function(){var t=this,n=t.plupload,r=t.$status,o=n.state,a=n.total,s="",l=n.files.length;if(t.options.statusCreator)s=t.options.statusCreator(a,o,t);else{var u={uploading:Math.max(0,Math.min(l,a.uploaded+1)),total:t.staticFilesCount+l,size:i.formatSize(a.size+t.staticFilesSize).toUpperCase(),queue:a.queued,failed:a.failed,uploaded:a.uploaded,uploadedSize:i.formatSize(a.loaded).toUpperCase(),percent:a.percent,speed:i.formatSize(a.bytesPerSec).toUpperCase()+"/S"};s=o==i.STARTED?t.lang.startedStatusText.format(u):l<1?t.lang.initStatusText:t.lang.stoppedStatusText.format(u)}r.html(s),a.uploaded<1&&r.find(".uploader-status-uploaded").remove(),a.failed<1&&r.find(".uploader-status-failed").remove(),a.queued<1&&r.find(".uploader-status-queue").remove(),e.fn.tooltip&&r.find('[data-toggle="tooltip"]').tooltip()},d.prototype.delayShowStatus=function(e){var t=this;t.delayStatusTask||(t.delayStatusTask=!0,e===r&&(e=500),t.delayStatusTask=setTimeout(function(){t.showStatus(),t.delayStatusTask=!1},e))},d.prototype.removeFile=function(t,i){var n=this;if("string"==typeof t&&(t=n.plupload.getFile(t)),i||t["static"]){var r=e("#file-"+t.id);e.fn.tooltip&&(r.find('[data-toggle="tooltip"]').tooltip("destroy"),e(".tooltip").remove()),r.fadeOut(function(){e(this).remove()})}else n.plupload.removeFile(t)},d.prototype.initPlupload=function(){var n=this,o=n.options,a=e.extend({},o,{browse_button:n.$button[0],container:n.$[0],drop_element:n.$dropElement[0],multipart_params:null}),s={FilesAdded:function(e,t){var i=o.limitFilesCount;if(i){i===!0&&(i=1);var r=n.$list.children(".file").length;if(r+t.length>i){n.showMessage(n.lang.limitFilesCountMessage.format({count:i}),"warning");for(var a=[],s=0;s"+u.join(",")+"

          ":"",d={uploaded:s,failed:l};c+="string"==typeof a?a.format(d):e.isFunction(a)?a(d):n.lang[l>0?"uploadHasFailedMessage":s>0?"uploadSuccessMessage":"uploadEmptyMessage"].format(d),n.showMessage(c,l>0?"danger":s>0?"success":"warning",3)}n.callEvent("onUploadComplete",[r])},FilesRemoved:function(t,i){e.each(i,function(e,t){n.removeFile(t,!0)}),n.showStatus(),n.callEvent("onFilesRemoved",i)},ChunkUploaded:function(e,t,i){n.callEvent("onChunkUploaded",[t,i])},UploadFile:function(e,t){n.showStatus(),n.callEvent("onUploadFile",t)},BeforeUpload:function(t,i){var r=t.getOption("multipart_params"),a=o.multipart_params,s={};r&&r.key&&(s.key=r.key),r&&r.token&&(s.token=r.token),o.sendFileName&&(s[o.sendFileName===!0?"name":o.sendFileName]=i.name),o.sendFileId&&(s[o.sendFileId===!0?"uuid":o.sendFileId]=i.id),s=e.extend(s,e.isFunction(a)?a(i,s):a),t.setOption("multipart_params",s),n.callEvent("onBeforeUpload",i)},Refresh:function(e){n.showStatus(),n.callEvent("onRefresh")},StateChanged:function(e){e.state===i.STARTED&&(n.lastUploadedCount=0),n.$.toggleClass("uploader-started",i.STARTED===e.state),n.hideMessage(),n.showStatus(),n.callEvent("onStateChanged",e.state)},QueueChanged:function(e){n.showStatus(),n.callEvent("onQueueChanged")},Error:function(e,t){var r="danger";t.code!==i.FILE_SIZE_ERROR&&t.code!==i.FILE_SIZE_ERROR&&t.code!==i.FILE_EXTENSION_ERROR&&t.code!==i.FILE_DUPLICATE_ERROR&&t.code!==i.MAGE_FORMAT_ERROR||(r="warning"),n.showMessage(t.message,r),n.callEvent("onError",t)}};if(i.addI18n(n.lang.i18n),n.qiniuEnable=e.isPlainObject(o.qiniu)&&t.Qiniu,n.qiniuEnable){var l=o.qiniu,u=l.key;delete a.qiniu,u?(delete l.key,e.isFunction(u)&&(s.Key=u)):s.Key=function(e,t){return t.name},l.init=s,a=e.extend(a,l);var c=new QiniuJsSDK,d=c.uploader(a);n.plupload=d}else{var d=new i.Uploader(a);d.init(),n.plOptions=a,n.plupload=d,e.each(s,function(e,t){d.bind(e,t)})}},d.prototype.getOptions=function(t){return this.options=e.extend({lang:e.zui.clientLang()},l,this.$.data(),t),this.options},d.prototype.callEvent=function(t,i){var n=this;if(e.isArray(i)||(i=[i]),n.$.trigger(t,i),e.isFunction(n.options[t]))return n.options[t].apply(n,i)},e.fn.uploader=function(t,i){return this.each(function(){var n=e(this),r=n.data(a),o="object"==typeof t&&t;r||n.data(a,r=new d(this,o)),"string"==typeof t&&r[t](i)})},d.NAME=a,d.STATUS=u,d.ERRORS=c,d.NAME=a,d.LANG={zh_cn:{limitFilesCountMessage:"所有文件数目不能超过 {count} 个,如果要上传此文件请先从列表移除文件。",uploadEmptyMessage:"没有文件等待上传。",uploadSuccessMessage:"已上传 {uploaded} 个文件。",uploadHasFailedMessage:"已上传 {uploaded} 个文件,{failed} 个文件上传失败。",startedStatusText:'正在上传第 {uploading} 个文件,共 {total} 个文件,已上传 {uploaded} 个文件,{failed} 个上传失败,进度 {percent}%,平均速度 {speed}。',initStatusText:"添加文件或拖放文件来上传。",stoppedStatusText:'共 {total} 个文件{queue} 个文件等待上传,已上传 {uploaded} 个文件{failed} 个上传失败,平均速度 {speed}。',deleteConfirm:"确定移除文件【{name}】?",download:"下载",rename:"重命名",repeat:"重新上传",remove:"移除",dropPlaceholder:"将文件拖放至在此处。",queue:"待上传",uploading:"正在上传",failed:"失败",done:"已上传",i18n:{"Stop Upload":"停止上传","Upload URL might be wrong or doesn't exist.":"上传的URL可能是错误的或不存在。",tb:"tb",Size:"大小",Close:"关闭","You must specify either browse_button or drop_element.":"您必须指定 browse_button 或者 drop_element。","Init error.":"初始化错误。","Add files to the upload queue and click the start button.":"将文件添加到上传队列,然后点击”开始上传“按钮。",List:"列表",Filename:"文件名","%s specified, but cannot be found.":"%s 已指定,但是没有找到。","Image format either wrong or not supported.":"图片格式错误或者不支持。",Status:"状态","HTTP Error.":"HTTP 错误。","Start Upload":"开始上传","Error: File too large:":"错误: 文件太大:",kb:"kb","Duplicate file error.":"无法添加重复文件。","File size error.":"文件大小错误。","N/A":"N/A",gb:"gb","Error: Invalid file extension:":"错误:无效的文件扩展名:","Select files":"选择文件","%s already present in the queue.":"%s 已经在当前队列里。","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"超限。%s 支持最大 %wx%hpx 的图片。","File: %s":"文件: %s",b:"b","Uploaded %d/%d files":"已上传 %d/%d 个文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只接受同时上传 %d 个文件,多余的文件将会被删除。","%d files queued":"%d 个文件加入到队列","File: %s, size: %d, max file size: %d":"文件: %s, 大小: %d, 最大文件大小: %d",Thumbnails:"缩略图","Drag files here.":"把文件拖到这里。","Runtime ran out of available memory.":"运行时已消耗所有可用内存。","File count error.":"文件数量错误。","File extension error.":"文件扩展名错误。",mb:"mb","Add Files":"增加文件"}},zh_tw:{limitFilesCountMessage:"所有文件數目不能超過 {count} 個。",uploadEmptyMessage:"没有文件等待上傳。",uploadSuccessMessage:"已上傳 {uploaded} 个文件。",uploadHasFailedMessage:"文件上傳完成,已上傳 {uploaded} 個文件,{failed} 個文件上傳失败。",startedStatusText:'正在上傳第{uploading} 個文件,共{total} 個文件,已上傳{uploaded} 個文件,{failed} 個上傳失敗,進度{percent}%,平均速度{speed}。',initStatusText:"添加文件或拖放文件來上傳。",stoppedStatusText:'共{total} 個文件{queue} 個文件等待上傳,已上傳{uploaded} 個文件{failed} 個上傳失敗,平均速度{speed}< /strong>。',deleteConfirm:"確定移除文件【{name}】?",download:"下载",rename:"重命名",repeat:"重新上傳",remove:"移除",dropPlaceholder:"將文件拖放至在此處。",queue:"待上傳",uploading:"正在上傳",failed:"失敗",done:"已上傳",i18n:{"Stop Upload":"停止上傳","Upload URL might be wrong or doesn't exist.":"檔案URL可能有誤或者不存在。",tb:"tb",Size:"大小",Close:"關閉","You must specify either browse_button or drop_element.":"您必須指定 browse_button 或 drop_element。","Init error.":"初始化錯誤。","Add files to the upload queue and click the start button.":"將檔案加入上傳序列,然後點選”開始上傳“按鈕。",List:"清單",Filename:"檔案名稱","%s specified, but cannot be found.":"找不到已選擇的 %s。","Image format either wrong or not supported.":"圖片格式錯誤或者不支援。",Status:"狀態","HTTP Error.":"HTTP 錯誤。","Start Upload":"開始上傳","Error: File too large:":"錯誤: 檔案大小太大:",kb:"kb","Duplicate file error.":"錯誤:檔案重複。","File size error.":"錯誤:檔案大小超過限制。","N/A":"N/A",gb:"gb","Error: Invalid file extension:":"錯誤:不接受的檔案格式:","Select files":"選擇檔案","%s already present in the queue.":"%s 已經存在目前的檔案序列。","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"圖片解析度超出範圍! %s 最高只支援到 %wx%hpx。","File: %s":"檔案: %s",b:"b","Uploaded %d/%d files":"已上傳 %d/%d 個文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只能上傳 %d 個檔案,超過限制數量的檔案將被忽略。","%d files queued":"%d 個檔案加入到序列","File: %s, size: %d, max file size: %d":"檔案: %s, 大小: %d, 檔案大小上限: %d",Thumbnails:"縮圖","Drag files here.":"把檔案拖曳到這裡。","Runtime ran out of available memory.":"執行時耗盡了所有可用的記憶體。","File count error.":"檔案數量錯誤。","File extension error.":"檔案副檔名錯誤。",mb:"mb","Add Files":"增加檔案"}},en:{limitFilesCountMessage:"All files count can not over {count}.",uploadEmptyMessage:"No file in queue to upload",uploadSuccessMessage:"Uploaded {uploaded} files。",uploadHasFailedMessage:"Uploaded complete, {uploaded} success, {failed} failed.",startedStatusText:'Uploading NO.{uploading} file, total {total} files, Uploaded {uploaded} files, {failed} failed, progress {percent}%, average spped {speed}。',initStatusText:"Append or drag file here.",stoppedStatusText:'Total {total} files, {queue} files in queue, uploaded {uploaded} files, {failed} failed, average spped {speed}。',deleteConfirm:'Remove file "{name}" form upload queue?',rename:"Rename",download:"Download",repeat:"Repeat",remove:"Remove",dropPlaceholder:"Drop file here.",queue:"Wait",uploading:"Uploading",failed:"Failed",done:"Done",i18n:{"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.",tb:"tb",Size:"Size",Close:"Close","You must specify either browse_button or drop_element.":"You must specify either browse_button or drop_element.","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Add files to the upload queue and click the start button.",List:"List",Filename:"Filename","%s specified, but cannot be found.":"%s specified, but cannot be found.","Image format either wrong or not supported.":"Image format either wrong or not supported.",Status:"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","Error: File too large:":"Error: File too large:",kb:"kb","Duplicate file error.":"Duplicate file error.","File size error.":"File size error.","N/A":"N/A",gb:"gb","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Select files","%s already present in the queue.":"%s already present in the queue.","Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.":"Resoultion out of boundaries! %s runtime supports images only up to %wx%hpx.","File: %s":"File: %s",b:"b","Uploaded %d/%d files":"Uploaded %d/%d files","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"File: %s, size: %d, max file size: %d",Thumbnails:"Thumbnails","Drag files here.":"Drag files here.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.",mb:"mb","Add Files":"Add Files"}}},e.zui.plupload=i,e.zui.moxie=n,e.zui.Uploader=d,e.fn.uploader.Constructor=d,t.mOxie||(t.mOxie={Env:n.core.utils.Env,XMLHttpRequest:n.xhr.XMLHttpRequest}),e(function(){e('[data-ride="uploader"]').uploader()})}(jQuery,window,plupload,moxie,void 0); \ No newline at end of file diff --git a/src/resources/static/js/utils/.pydio b/src/resources/static/js/utils/.pydio new file mode 100644 index 0000000..7543564 --- /dev/null +++ b/src/resources/static/js/utils/.pydio @@ -0,0 +1 @@ +4d1beaca-6efd-4b27-9fed-cbda4ca0711e \ No newline at end of file diff --git a/src/resources/static/js/utils/index.js b/src/resources/static/js/utils/index.js new file mode 100755 index 0000000..7771385 --- /dev/null +++ b/src/resources/static/js/utils/index.js @@ -0,0 +1,125 @@ +define(['jquery','config','zui'],function ($,config) { + + function utils() { + this.init() + } + + utils.prototype = { + init () { + }, + + // banner高度等于显示器高度 + setBannerHeight () { + if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) { + $("body").css({ "width": $(document).width() }); + } else { + $(".header").css({ "height": $(window).height() }); + $("body").css({ "width": "100%" }); + } + }, + + getUserId () { + if(localStorage.getItem("objectId") != null ) { + return localStorage.getItem("objectId") + } else { + location.href = `/reg?from=${location.pathname}` + } + }, + + /** + * 获取地址栏参数 + * @param name 需要获取的名称 + * @return {string|null} + * @constructor + */ + GetQueryString(name) { + var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); + var r = window.location.search.substr(1).match(reg); + if(r!=null)return unescape(r[2]); return null; + }, + + InfoCourseId () { + return (location.pathname.split("/info/"))[1] + }, + + /** + * + * @param params object 参数 + * { + * url: '请求地址', + * data: '请求参数' + * } + * @param callback function 回调函数 + */ + get (params = {}, callback) { + $.ajax({ + type: 'GET', + url: `${config.baseURL}${params.url}`, + dataType: 'json', + data: params.data, + success: function (res) { + if(res.status = 200) { + callback(res) + } else { + uikit.notification({ + message: `GET 接口报错: ${err.message}`, + status: 'danger', + pos: 'top-right', + timeout: 5000 + }); + } + }, + error: function (err) { + uikit.notification({ + message: `GET 接口报错: ${err.message}`, + status: 'danger', + pos: 'top-right', + timeout: 5000 + }); + throw new Error(`GET 接口报错 ${err.message}`) + } + }) + }, + + /** + * + * @param params object 参数 + * { + * url: '请求地址', + * data: '请求参数' + * } + * @param callback function 回调函数 + */ + post (params = {}, callback) { + $.ajax({ + type: 'POST', + url: `${config.baseURL}${params.url}`, + dataType: 'json', + data: params.data, + success: function (res) { + if(res.status = 200) { + callback(res) + } else { + uikit.notification({ + message: '网络不佳,请稍后重试', + status: 'danger', + pos: 'top-right', + timeout: 5000 + }); + } + }, + error: function (err) { + uikit.notification({ + message: `POST 接口报错: ${err.message}`, + status: 'danger', + pos: 'top-right', + timeout: 5000 + }); + } + }) + } + } + + return new utils(); + +}) \ No newline at end of file diff --git a/src/resources/static/less/.pydio b/src/resources/static/less/.pydio new file mode 100644 index 0000000..584d18e --- /dev/null +++ b/src/resources/static/less/.pydio @@ -0,0 +1 @@ +2f8d161c-9254-4d4d-801a-a400dfb02ebe \ No newline at end of file diff --git a/src/resources/static/less/admin/.pydio b/src/resources/static/less/admin/.pydio new file mode 100644 index 0000000..aaff384 --- /dev/null +++ b/src/resources/static/less/admin/.pydio @@ -0,0 +1 @@ +c345b50d-d3a7-4842-b7d1-29817100d38d \ No newline at end of file diff --git a/src/resources/static/less/admin/index.less b/src/resources/static/less/admin/index.less new file mode 100755 index 0000000..b0fc701 --- /dev/null +++ b/src/resources/static/less/admin/index.less @@ -0,0 +1,10 @@ +.index { + h1 { + color: red; + } + h2 { + font-size-adjust: 19px; + color: blue; + font-weight: bold; + } +} \ No newline at end of file diff --git a/src/resources/static/less/base.less b/src/resources/static/less/base.less new file mode 100755 index 0000000..5973971 --- /dev/null +++ b/src/resources/static/less/base.less @@ -0,0 +1,2 @@ +@import "./tpl/colors.less"; +@import "./tpl/mixins.less"; \ No newline at end of file diff --git a/src/resources/static/less/home/.pydio b/src/resources/static/less/home/.pydio new file mode 100644 index 0000000..9cf3000 --- /dev/null +++ b/src/resources/static/less/home/.pydio @@ -0,0 +1 @@ +2aad0436-9373-4d02-ac18-05936dc94b41 \ No newline at end of file diff --git a/src/resources/static/less/home/about.less b/src/resources/static/less/home/about.less new file mode 100644 index 0000000..f9bfeb4 --- /dev/null +++ b/src/resources/static/less/home/about.less @@ -0,0 +1,3 @@ +.about { + color: red; +} \ No newline at end of file diff --git a/src/resources/static/less/home/error.less b/src/resources/static/less/home/error.less new file mode 100644 index 0000000..34f4970 --- /dev/null +++ b/src/resources/static/less/home/error.less @@ -0,0 +1,41 @@ +.error { + display: flex; + align-items: center; + justify-content: center; + flex-direction: row; + + img { + width: 270px; + margin-bottom: 20px; + } + .i-message { + margin-left: 19px; + .action { + margin-top: 10px; + a[href="/"] { + margin-right: 15px; + } + } + ul { + padding-left: 20px; + margin-top: 8px; + } + h3 { + font-size: 17px; + margin-bottom: 10px; + line-height: 27px; + font-size: 17px; + margin-bottom: 10px; + line-height: 27px; + font-weight: 500; + letter-spacing: 2px; + } + a { + color: #8d8d8d; + } + } + +} +body,html,.error { + height: 100%; +} \ No newline at end of file diff --git a/src/resources/static/less/home/index.less b/src/resources/static/less/home/index.less new file mode 100755 index 0000000..77735b7 --- /dev/null +++ b/src/resources/static/less/home/index.less @@ -0,0 +1,9 @@ +@import "../base.less"; + +.index-title() { + color: #595858; + font-size: 25px; + font-weight: bold; + margin-bottom: 80px; + text-align: center; +} \ No newline at end of file diff --git a/src/resources/static/less/home/register.less b/src/resources/static/less/home/register.less new file mode 100644 index 0000000..048450d --- /dev/null +++ b/src/resources/static/less/home/register.less @@ -0,0 +1,4 @@ +.register { + font-size: 30px; + color: green; +} \ No newline at end of file diff --git a/src/resources/static/less/tpl/.pydio b/src/resources/static/less/tpl/.pydio new file mode 100644 index 0000000..91f76a8 --- /dev/null +++ b/src/resources/static/less/tpl/.pydio @@ -0,0 +1 @@ +88722749-d483-4c39-9708-33df90767324 \ No newline at end of file diff --git a/src/resources/static/less/tpl/colors.less b/src/resources/static/less/tpl/colors.less new file mode 100755 index 0000000..fefc85c --- /dev/null +++ b/src/resources/static/less/tpl/colors.less @@ -0,0 +1,304 @@ +@red50: #ffebee; +@red100: #ffcdd2; +@red200: #ef9a9a; +@red300: #e57373; +@red400: #ef5350; +@red500: #f44336; +@red600: #e53935; +@red700: #d32f2f; +@red800: #c62828; +@red900: #b71c1c; +@redA100: #ff8a80; +@redA200: #ff5252; +@redA400: #ff1744; +@redA700: #d50000; +@red: @red500; + +@pink50: #fce4ec; +@pink100: #f8bbd0; +@pink200: #f48fb1; +@pink300: #f06292; +@pink400: #ec407a; +@pink500: #e91e63; +@pink600: #d81b60; +@pink700: #c2185b; +@pink800: #ad1457; +@pink900: #880e4f; +@pinkA100: #ff80ab; +@pinkA200: #ff4081; +@pinkA400: #f50057; +@pinkA700: #c51162; +@pink: @pink500; + +@purple50: #f3e5f5; +@purple100: #e1bee7; +@purple200: #ce93d8; +@purple300: #ba68c8; +@purple400: #ab47bc; +@purple500: #9c27b0; +@purple600: #8e24aa; +@purple700: #7b1fa2; +@purple800: #6a1b9a; +@purple900: #4a148c; +@purpleA100: #ea80fc; +@purpleA200: #e040fb; +@purpleA400: #d500f9; +@purpleA700: #aa00ff; +@purple: @purple500; + +@deepPurple50: #ede7f6; +@deepPurple100: #d1c4e9; +@deepPurple200: #b39ddb; +@deepPurple300: #9575cd; +@deepPurple400: #7e57c2; +@deepPurple500: #673ab7; +@deepPurple600: #5e35b1; +@deepPurple700: #512da8; +@deepPurple800: #4527a0; +@deepPurple900: #311b92; +@deepPurpleA100: #b388ff; +@deepPurpleA200: #7c4dff; +@deepPurpleA400: #651fff; +@deepPurpleA700: #6200ea; +@deepPurple: @deepPurple500; + +@indigo50: #e8eaf6; +@indigo100: #c5cae9; +@indigo200: #9fa8da; +@indigo300: #7986cb; +@indigo400: #5c6bc0; +@indigo500: #3f51b5; +@indigo600: #3949ab; +@indigo700: #303f9f; +@indigo800: #283593; +@indigo900: #1a237e; +@indigoA100: #8c9eff; +@indigoA200: #536dfe; +@indigoA400: #3d5afe; +@indigoA700: #304ffe; +@indigo: @indigo500; + +@blue50: #e3f2fd; +@blue100: #bbdefb; +@blue200: #90caf9; +@blue300: #64b5f6; +@blue400: #42a5f5; +@blue500: #2196f3; +@blue600: #1e88e5; +@blue700: #1976d2; +@blue800: #1565c0; +@blue900: #0d47a1; +@blueA100: #82b1ff; +@blueA200: #448aff; +@blueA400: #2979ff; +@blueA700: #2962ff; +@blue: @blue500; + +@lightBlue50: #e1f5fe; +@lightBlue100: #b3e5fc; +@lightBlue200: #81d4fa; +@lightBlue300: #4fc3f7; +@lightBlue400: #29b6f6; +@lightBlue500: #03a9f4; +@lightBlue600: #039be5; +@lightBlue700: #0288d1; +@lightBlue800: #0277bd; +@lightBlue900: #01579b; +@lightBlueA100: #80d8ff; +@lightBlueA200: #40c4ff; +@lightBlueA400: #00b0ff; +@lightBlueA700: #0091ea; +@lightBlue: @lightBlue500; + +@cyan50: #e0f7fa; +@cyan100: #b2ebf2; +@cyan200: #80deea; +@cyan300: #4dd0e1; +@cyan400: #26c6da; +@cyan500: #00bcd4; +@cyan600: #00acc1; +@cyan700: #0097a7; +@cyan800: #00838f; +@cyan900: #006064; +@cyanA100: #84ffff; +@cyanA200: #18ffff; +@cyanA400: #00e5ff; +@cyanA700: #00b8d4; +@cyan: @cyan500; + +@teal50: #e0f2f1; +@teal100: #b2dfdb; +@teal200: #80cbc4; +@teal300: #4db6ac; +@teal400: #26a69a; +@teal500: #009688; +@teal600: #00897b; +@teal700: #00796b; +@teal800: #00695c; +@teal900: #004d40; +@tealA100: #a7ffeb; +@tealA200: #64ffda; +@tealA400: #1de9b6; +@tealA700: #00bfa5; +@teal: @teal500; + +@green50: #e8f5e9; +@green100: #c8e6c9; +@green200: #a5d6a7; +@green300: #81c784; +@green400: #66bb6a; +@green500: #4caf50; +@green600: #43a047; +@green700: #388e3c; +@green800: #2e7d32; +@green900: #1b5e20; +@greenA100: #b9f6ca; +@greenA200: #69f0ae; +@greenA400: #00e676; +@greenA700: #00c853; +@green: @green500; + +@lightGreen50: #f1f8e9; +@lightGreen100: #dcedc8; +@lightGreen200: #c5e1a5; +@lightGreen300: #aed581; +@lightGreen400: #9ccc65; +@lightGreen500: #8bc34a; +@lightGreen600: #7cb342; +@lightGreen700: #689f38; +@lightGreen800: #558b2f; +@lightGreen900: #33691e; +@lightGreenA100: #ccff90; +@lightGreenA200: #b2ff59; +@lightGreenA400: #76ff03; +@lightGreenA700: #64dd17; +@lightGreen: @lightGreen500; + +@lime50: #f9fbe7; +@lime100: #f0f4c3; +@lime200: #e6ee9c; +@lime300: #dce775; +@lime400: #d4e157; +@lime500: #cddc39; +@lime600: #c0ca33; +@lime700: #afb42b; +@lime800: #9e9d24; +@lime900: #827717; +@limeA100: #f4ff81; +@limeA200: #eeff41; +@limeA400: #c6ff00; +@limeA700: #aeea00; +@lime: @lime500; + +@yellow50: #fffde7; +@yellow100: #fff9c4; +@yellow200: #fff59d; +@yellow300: #fff176; +@yellow400: #ffee58; +@yellow500: #ffeb3b; +@yellow600: #fdd835; +@yellow700: #fbc02d; +@yellow800: #f9a825; +@yellow900: #f57f17; +@yellowA100: #ffff8d; +@yellowA200: #ffff00; +@yellowA400: #ffea00; +@yellowA700: #ffd600; +@yellow: @yellow500; + +@amber50: #fff8e1; +@amber100: #ffecb3; +@amber200: #ffe082; +@amber300: #ffd54f; +@amber400: #ffca28; +@amber500: #ffc107; +@amber600: #ffb300; +@amber700: #ffa000; +@amber800: #ff8f00; +@amber900: #ff6f00; +@amberA100: #ffe57f; +@amberA200: #ffd740; +@amberA400: #ffc400; +@amberA700: #ffab00; +@amber: @amber500; + +@orange50: #fff3e0; +@orange100: #ffe0b2; +@orange200: #ffcc80; +@orange300: #ffb74d; +@orange400: #ffa726; +@orange500: #ff9800; +@orange600: #fb8c00; +@orange700: #f57c00; +@orange800: #ef6c00; +@orange900: #e65100; +@orangeA100: #ffd180; +@orangeA200: #ffab40; +@orangeA400: #ff9100; +@orangeA700: #ff6d00; +@orange: @orange500; + +@deepOrange50: #fbe9e7; +@deepOrange100: #ffccbc; +@deepOrange200: #ffab91; +@deepOrange300: #ff8a65; +@deepOrange400: #ff7043; +@deepOrange500: #ff5722; +@deepOrange600: #f4511e; +@deepOrange700: #e64a19; +@deepOrange800: #d84315; +@deepOrange900: #bf360c; +@deepOrangeA100: #ff9e80; +@deepOrangeA200: #ff6e40; +@deepOrangeA400: #ff3d00; +@deepOrangeA700: #dd2c00; +@deepOrange: @deepOrange500; + +@brown50: #efebe9; +@brown100: #d7ccc8; +@brown200: #bcaaa4; +@brown300: #a1887f; +@brown400: #8d6e63; +@brown500: #795548; +@brown600: #6d4c41; +@brown700: #5d4037; +@brown800: #4e342e; +@brown900: #3e2723; +@brown: @brown500; + +@blueGrey50: #eceff1; +@blueGrey100: #cfd8dc; +@blueGrey200: #b0bec5; +@blueGrey300: #90a4ae; +@blueGrey400: #78909c; +@blueGrey500: #607d8b; +@blueGrey600: #546e7a; +@blueGrey700: #455a64; +@blueGrey800: #37474f; +@blueGrey900: #263238; +@blueGrey: @blueGrey500; + +@grey50: #fafafa; +@grey100: #f5f5f5; +@grey200: #eeeeee; +@grey300: #e0e0e0; +@grey400: #bdbdbd; +@grey500: #9e9e9e; +@grey600: #757575; +@grey700: #616161; +@grey800: #424242; +@grey900: #212121; +@grey: @grey500; + +@black: #000000; +@white: #ffffff; + +@transparent: rgba(0, 0, 0, 0); +@fullBlack: rgba(0, 0, 0, 1); +@darkBlack: rgba(0, 0, 0, 0.87); +@lightBlack: rgba(0, 0, 0, 0.54); +@minBlack: rgba(0, 0, 0, 0.26); +@faintBlack: rgba(0, 0, 0, 0.12); +@fullWhite: rgba(255, 255, 255, 1); +@darkWhite: rgba(255, 255, 255, 0.87); +@lightWhite: rgba(255, 255, 255, 0.54); \ No newline at end of file diff --git a/src/resources/static/less/tpl/mixins.less b/src/resources/static/less/tpl/mixins.less new file mode 100755 index 0000000..ccbe195 --- /dev/null +++ b/src/resources/static/less/tpl/mixins.less @@ -0,0 +1,10 @@ + +.ellipsis() { + white-space:nowrap; + text-overflow:ellipsis; + overflow:hidden; + word-wrap: break-word; +} +.hidden() { + overflow: hidden; +} \ No newline at end of file diff --git a/src/resources/static/plugins/.pydio b/src/resources/static/plugins/.pydio new file mode 100644 index 0000000..6efb41d --- /dev/null +++ b/src/resources/static/plugins/.pydio @@ -0,0 +1 @@ +df5a141d-390f-4fac-aa5a-16a25dc3e4ff \ No newline at end of file diff --git a/src/resources/view/.pydio b/src/resources/view/.pydio new file mode 100644 index 0000000..f8e6815 --- /dev/null +++ b/src/resources/view/.pydio @@ -0,0 +1 @@ +06bd2fde-f574-44c0-a428-1fa7d3bbfe39 \ No newline at end of file diff --git a/src/resources/view/admin/.babelrc b/src/resources/view/admin/.babelrc new file mode 100755 index 0000000..2f7cfb1 --- /dev/null +++ b/src/resources/view/admin/.babelrc @@ -0,0 +1,3 @@ +{ + "plugins": ["@babel/plugin-transform-runtime"] +} \ No newline at end of file diff --git a/src/resources/view/admin/.pydio b/src/resources/view/admin/.pydio new file mode 100644 index 0000000..4b39b0c --- /dev/null +++ b/src/resources/view/admin/.pydio @@ -0,0 +1 @@ +d4bbde24-4f60-443e-a188-fc9154f05693 \ No newline at end of file diff --git a/src/resources/view/admin/index.html b/src/resources/view/admin/index.html new file mode 100755 index 0000000..94ee988 --- /dev/null +++ b/src/resources/view/admin/index.html @@ -0,0 +1,20 @@ + + + + + + 管理后台 + + + + + + + +
          + +
          + + + + \ No newline at end of file diff --git a/src/resources/view/admin/src/.pydio b/src/resources/view/admin/src/.pydio new file mode 100644 index 0000000..82aac6f --- /dev/null +++ b/src/resources/view/admin/src/.pydio @@ -0,0 +1 @@ +547b3867-723e-4400-a7c6-c6212afc8aa6 \ No newline at end of file diff --git a/src/resources/view/admin/src/App.vue b/src/resources/view/admin/src/App.vue new file mode 100755 index 0000000..64e90b1 --- /dev/null +++ b/src/resources/view/admin/src/App.vue @@ -0,0 +1,70 @@ + + + + + \ No newline at end of file diff --git a/src/resources/view/admin/src/api/.pydio b/src/resources/view/admin/src/api/.pydio new file mode 100644 index 0000000..91bf901 --- /dev/null +++ b/src/resources/view/admin/src/api/.pydio @@ -0,0 +1 @@ +c5b7370f-d859-4294-a93b-8d6d14035f94 \ No newline at end of file diff --git a/src/resources/view/admin/src/api/axios.ts b/src/resources/view/admin/src/api/axios.ts new file mode 100755 index 0000000..f272624 --- /dev/null +++ b/src/resources/view/admin/src/api/axios.ts @@ -0,0 +1,95 @@ +import Vue from "vue"; +import axios from "axios" +import { Notification } from 'element-ui'; + +export class Axios { + + constructor () { + axios.defaults.baseURL = 'http://www.geekhelp.cn/bmy/api'; + axios.defaults.timeout = 30000; + this.RequestInterceptors(); + this.ResponseInterceptors(); + } + + // 添加请求拦截器 + private RequestInterceptors ():any { + + axios.interceptors.request.use(function (config) { + // 在发送请求之前做些什么 + return config; + }, function (error) { + // 对请求错误做些什么 + return Promise.reject(error); + }); + } + + // 添加响应拦截器 + private ResponseInterceptors ():any { + axios.interceptors.response.use(function (response) { + if(response.data.status == 200) { + return response; + } else { + Notification({ + title: '提示1', + message: `没有数据 ${response.data.status}`, + }); + return response; + } + }, function (error) { + Notification({ + title: '提示2', + message: `请求出错:${JSON.stringify(error.message)}`, + }); + // 对响应错误做点什么 + return Promise.reject(error); + }); + } + + /** + * get 请求 + * @param options + * { + * url: 请求地址 + * params: 请求参数 + * } + */ + public get (options: { url: string, params: object }): Promise { + return new Promise((resolve, reject) => { + // @ts-ignore + axios.get(options.url, { + // @ts-ignore + params: options.params + + }).then(function (success) { + resolve(success); + }).catch(function (error) { + console.log(error); + }); + }); + } + + /** + * post 请求 + * @param options + * { + * url: 请求地址 + * params: 请求参数 + * } + */ + public post(options: { url: string, params: object, headers?: any }): Promise { + return new Promise((resolve, reject) => { + // @ts-ignore + axios({ + method: 'post', + url: options.url, + data: options.params, + headers: options.hasOwnProperty("headers") ? options.headers : {} + }).then(function (success) { + resolve(success.data); + }).catch(function (error) { + resolve(error); + }); + }) + } + +} \ No newline at end of file diff --git a/src/resources/view/admin/src/assets/.pydio b/src/resources/view/admin/src/assets/.pydio new file mode 100644 index 0000000..eac45b7 --- /dev/null +++ b/src/resources/view/admin/src/assets/.pydio @@ -0,0 +1 @@ +4cf39bd3-ed31-40e2-bfc7-696512202d61 \ No newline at end of file diff --git a/src/resources/view/admin/src/assets/less/.pydio b/src/resources/view/admin/src/assets/less/.pydio new file mode 100644 index 0000000..db6417b --- /dev/null +++ b/src/resources/view/admin/src/assets/less/.pydio @@ -0,0 +1 @@ +f4344480-f997-469d-8d3a-aa1d888ca772 \ No newline at end of file diff --git a/src/resources/view/admin/src/assets/less/App.less b/src/resources/view/admin/src/assets/less/App.less new file mode 100755 index 0000000..a63d398 --- /dev/null +++ b/src/resources/view/admin/src/assets/less/App.less @@ -0,0 +1,4 @@ +body,.el-header,h1,h2,h3,h4,h5,h6,ul,li,p { + margin: 0; + padding: 0; +} \ No newline at end of file diff --git a/src/resources/view/admin/src/assets/less/aside.less b/src/resources/view/admin/src/assets/less/aside.less new file mode 100755 index 0000000..ba84100 --- /dev/null +++ b/src/resources/view/admin/src/assets/less/aside.less @@ -0,0 +1,10 @@ +.el-aside { + position: fixed; + left: 0; + top: 60px; + bottom: 0; + z-index: 999; + ul { + height:100%; + } +} \ No newline at end of file diff --git a/src/resources/view/admin/src/assets/logo.png b/src/resources/view/admin/src/assets/logo.png new file mode 100755 index 0000000..f3d2503 Binary files /dev/null and b/src/resources/view/admin/src/assets/logo.png differ diff --git a/src/resources/view/admin/src/config/.pydio b/src/resources/view/admin/src/config/.pydio new file mode 100644 index 0000000..fc6b8a7 --- /dev/null +++ b/src/resources/view/admin/src/config/.pydio @@ -0,0 +1 @@ +906780be-f6bf-4e91-8961-accb7a9a3239 \ No newline at end of file diff --git a/src/resources/view/admin/src/config/index.ts b/src/resources/view/admin/src/config/index.ts new file mode 100755 index 0000000..e0e5404 --- /dev/null +++ b/src/resources/view/admin/src/config/index.ts @@ -0,0 +1,98 @@ +import LoginComponents from '../view/template/login.vue'; +import CourseComponents from '../view/template/course/index.vue'; +import AllComponents from '../view/template/course/all.vue'; +import NewComponents from '../view/template/course/new.vue'; +import NewVideoComponents from '../view/template/course/newVideo.vue'; +import AllClassComponents from '../view/template/classify/all.vue'; +import DemoComponents from '../view/template/demo.vue'; + +import { Axios } from "../api/axios"; +import { Utils } from "../utils/index"; + +import Vuex from 'vuex'; +import VueRouter from 'vue-router'; +import ElementUI from 'element-ui'; + + +export class config { + public static mountElement: string = "#app"; + // 需要被挂载的非Vue插件 + public static NotVuePlugs: Array = [ + { n: '$http', f: Axios }, + { n: '$utils', f: Utils }, + { n: '$xxx', f: Utils } + ]; + public static VuePlugs: Array = [ ElementUI, VueRouter, Vuex ] + // 路由配置 + public static RouterConfigUrl: Object = { + mode: 'hash', + routes: [ + { + path: '/demo', + name: 'demo', + component: DemoComponents, + meta: { + ifLogin: false, + title: "测试文件" + } + }, + { + path: '/', + redirect: { + name: 'login' + } + }, + { + path: '/login', + name: 'login', + component: LoginComponents, + meta: { + ifLogin: false, + title: "管理员登录" + } + }, + { + path: '/course', + component: CourseComponents, + children: [ + { + name: 'all', + path: 'all', + component: AllComponents, + meta: { + ifLogin: true, + title: "所有课程" + } + }, + { + name: 'new', + path: 'new', + component: NewComponents, + meta: { + ifLogin: true, + title: "发布课程" + } + }, + { + name: 'video', + path: 'video/:id', + component: NewVideoComponents, + meta: { + ifLogin: true, + title: "发布课程视频" + } + } + ] + }, + { + path: '/class', + name: 'allclass', + component: AllClassComponents, + meta: { + ifLogin: true, + title: "所有课程分类" + } + } + ] + } +} diff --git a/src/resources/view/admin/src/index.ts b/src/resources/view/admin/src/index.ts new file mode 100755 index 0000000..39e5822 --- /dev/null +++ b/src/resources/view/admin/src/index.ts @@ -0,0 +1,2 @@ +import { Main } from "./run/main" +new Main(); \ No newline at end of file diff --git a/src/resources/view/admin/src/public/.pydio b/src/resources/view/admin/src/public/.pydio new file mode 100644 index 0000000..776e6ac --- /dev/null +++ b/src/resources/view/admin/src/public/.pydio @@ -0,0 +1 @@ +f49ac76e-a14c-4b52-81ef-56ba0b3afa86 \ No newline at end of file diff --git a/src/resources/view/admin/src/run/.pydio b/src/resources/view/admin/src/run/.pydio new file mode 100644 index 0000000..29de40a --- /dev/null +++ b/src/resources/view/admin/src/run/.pydio @@ -0,0 +1 @@ +fb6cab37-938d-43e2-9f0b-bdd916e2d078 \ No newline at end of file diff --git a/src/resources/view/admin/src/run/init.ts b/src/resources/view/admin/src/run/init.ts new file mode 100755 index 0000000..a141935 --- /dev/null +++ b/src/resources/view/admin/src/run/init.ts @@ -0,0 +1,80 @@ +import '../utils/class-component-hooks' +import Vue from 'vue'; +import Vuex from 'vuex'; +import VueRouter from 'vue-router'; + +// ElementUI +import 'element-ui/lib/theme-chalk/index.css'; + +// Vuex,config 全站配置 +import Stores from '../store/index' +import { config } from "../config" + +/** + * 初始化Vue需要的插件和构造Vue启动参数 + */ +export class init { + + // 存放 Vue 插件 的数组 + private initVuePlugsArray: Array = config.VuePlugs; + // 存放 非Vue插件 的数组 + private initOtherPlugsArray: Array = config.NotVuePlugs; + // 存放配置好的 Vue-router + protected router: any; + // 存放配置好的 Vuex + protected VuexConfig: any; + + constructoconstructorr () { + Vue.config.productionTip = false; + this.initPlugs() + } + + /** + * 1 统一初始化 Vue 插件 + * 2 统一挂载非 Vue 插件 + */ + private initPlugs ():void { + // @ts-ignore use 挂载Vue需要的插件 + this.initVuePlugsArray.forEach(v => Vue.use(v)); + // @ts-ignore 初始化非Vue插件 + this.initOtherPlugsArray.forEach(v => Vue.prototype[v['n']] = new (v['f'])()); + + this.InitVueRouter(); + this.InitVuex(); + } + + /** + * 1:初始化Vue-router + * 2:并配置全局拦截器 + * @constructor + */ + private InitVueRouter ():void { + this.router = new VueRouter(config.RouterConfigUrl); + this.router.beforeEach((to:any, from:any, next:any) => { + document.title = to.meta.title; + if(to.meta.ifLogin) { + console.log(localStorage.getItem("status")) + if(localStorage.getItem("status") != null){ + next() + } else { + next({ + path:"/login", + query: { + redirect: to.fullPath + } + }) + } + }else { + next() + } + }); + } + + /** + * 初始化Vuex + * @constructor + */ + private InitVuex ():void { + this.VuexConfig = new Vuex.Store(Stores) + } +} diff --git a/src/resources/view/admin/src/run/main.ts b/src/resources/view/admin/src/run/main.ts new file mode 100755 index 0000000..697fe65 --- /dev/null +++ b/src/resources/view/admin/src/run/main.ts @@ -0,0 +1,23 @@ +import Vue from 'vue' +import App from '../App.vue'; +import { init } from "./init"; +import { config } from "../config/index" + +export class Main extends init { + constructor () { + super(); + this.initApp(); + } + /** + * 启动Vue,传入配置参数 initVue + * 挂载到 config.mountElement 上 + */ + public initApp():void { + const router = this.router, store = this.VuexConfig; + new Vue({ + router, + store, + render: (h):any => h(App) + }).$mount(config.mountElement); + } +} \ No newline at end of file diff --git a/src/resources/view/admin/src/store/.pydio b/src/resources/view/admin/src/store/.pydio new file mode 100644 index 0000000..97cc151 --- /dev/null +++ b/src/resources/view/admin/src/store/.pydio @@ -0,0 +1 @@ +a233aaa8-f570-40e5-873e-7bdf2c2af04b \ No newline at end of file diff --git a/src/resources/view/admin/src/store/getters.ts b/src/resources/view/admin/src/store/getters.ts new file mode 100755 index 0000000..091e31e --- /dev/null +++ b/src/resources/view/admin/src/store/getters.ts @@ -0,0 +1,7 @@ +// getter 读取方法 +export default { + isClosedFooter: (state:any) => state.Setting.isClosedFooter, + isClosedHeader: (state:any) => state.Setting.isClosedHeader, + isClosedAside: (state:any) => state.Setting.isClosedAside, + getClassList: (state:any) => state.Main.classData +} \ No newline at end of file diff --git a/src/resources/view/admin/src/store/index.ts b/src/resources/view/admin/src/store/index.ts new file mode 100755 index 0000000..bafe6da --- /dev/null +++ b/src/resources/view/admin/src/store/index.ts @@ -0,0 +1,8 @@ +import index from "./modules/index" +import getters from "./getters" + +// 统一导出各模块 +export default { + modules: { ...index }, + getters +} \ No newline at end of file diff --git a/src/resources/view/admin/src/store/modules/.pydio b/src/resources/view/admin/src/store/modules/.pydio new file mode 100644 index 0000000..d9c29c3 --- /dev/null +++ b/src/resources/view/admin/src/store/modules/.pydio @@ -0,0 +1 @@ +b746997b-2305-40ef-a476-825f50167e1a \ No newline at end of file diff --git a/src/resources/view/admin/src/store/modules/index.ts b/src/resources/view/admin/src/store/modules/index.ts new file mode 100755 index 0000000..0f2d06b --- /dev/null +++ b/src/resources/view/admin/src/store/modules/index.ts @@ -0,0 +1,8 @@ +import Setting from "./setting" +import Main from "./main" + +export default { + Setting, + Main +} + diff --git a/src/resources/view/admin/src/store/modules/main.ts b/src/resources/view/admin/src/store/modules/main.ts new file mode 100755 index 0000000..26db143 --- /dev/null +++ b/src/resources/view/admin/src/store/modules/main.ts @@ -0,0 +1,64 @@ +import { Axios } from "../../api/axios" +const http = new Axios(); +// @ts-ignore +export default { + state: { + classData: [] + }, + mutations: { + SET_CLASSDATA: (state:any, data: Array) => { + state.classData = data; + }, + DELETE_CLASSDATA: (state:any, tag: Object) => { + state.classData.splice(state.classData.indexOf(tag),1) + }, + ADD_CLASSDATA: (state:any, params: Object) => { + state.classData.push({ + // @ts-ignore + objectId: params['i'], + // @ts-ignore + classTitle: params['t'] + }); + } + }, + actions: { + /** + * 获取所有分类 + * @param commit + */ + async getAllClass ({ commit }: any) { + let data = await http.post({ + url: '/admin/getAllClass', + params: { } + }); + commit("SET_CLASSDATA",data.result); + }, + + /** + * 通过 mutations 中 DELETE_CLASSDATA 方法删除 vuex 的 classData 数据 + * 同时发送ajax请求删除服务器的标签 + * @param context + * @param currentTag 需要删除标签对象 + */ + async deleteClass({ commit }: any, currentTag: Object) { + await http.post({ + url: '/admin/deleteClassById', + // @ts-ignore + params: { id: currentTag.objectId } + }); + commit("DELETE_CLASSDATA", currentTag); + }, + + /** + * 添加新的分类,push 数组,并向服务器添加数据 + * @param commit + * @param tagTitle 分类标题 + */ + async addClass({ commit }: any, tagTitle: string) { + commit("ADD_CLASSDATA", { t: tagTitle, i: (await http.post({ + url: '/admin/addNewClass', + params: { title: tagTitle } + })).result.objectId }); + } + } +} \ No newline at end of file diff --git a/src/resources/view/admin/src/store/modules/setting.ts b/src/resources/view/admin/src/store/modules/setting.ts new file mode 100755 index 0000000..a5a7d46 --- /dev/null +++ b/src/resources/view/admin/src/store/modules/setting.ts @@ -0,0 +1,14 @@ +export default { + state: { + isClosedHeader: true, + isClosedFooter: true, + isClosedAside: true + }, + mutations: { + SET_BAR: (state:any, status: boolean) => { + state.isClosedHeader = status; + state.isClosedFooter = status; + state.isClosedAside = status; + } + } +} \ No newline at end of file diff --git a/src/resources/view/admin/src/utils/.pydio b/src/resources/view/admin/src/utils/.pydio new file mode 100644 index 0000000..4bc32f6 --- /dev/null +++ b/src/resources/view/admin/src/utils/.pydio @@ -0,0 +1 @@ +70658377-a521-414a-8991-b03e30d63c80 \ No newline at end of file diff --git a/src/resources/view/admin/src/utils/class-component-hooks.ts b/src/resources/view/admin/src/utils/class-component-hooks.ts new file mode 100755 index 0000000..c47dba5 --- /dev/null +++ b/src/resources/view/admin/src/utils/class-component-hooks.ts @@ -0,0 +1,8 @@ +import Component from 'vue-class-component' + + +Component.registerHooks([ + 'beforeRouteEnter', + 'beforeRouteLeave', + 'beforeRouteUpdate' +]) \ No newline at end of file diff --git a/src/resources/view/admin/src/utils/index.ts b/src/resources/view/admin/src/utils/index.ts new file mode 100755 index 0000000..95fe1b5 --- /dev/null +++ b/src/resources/view/admin/src/utils/index.ts @@ -0,0 +1,58 @@ +import WatchJS from 'melanke-watchjs'; + +export class Utils { + public watch:any; + public NewTargetArray:Array = []; + + constructor() { + this.watch = WatchJS.watch; + } + + /** + * 返回上一页 + */ + goBack() { + history.back() + } + + /** + * 调用 封装的工具类对 对象进行 set 拦截并返回 + * 被修改数据的对象所在的下标。 + * @param OldTarget 需要观察的数据 + * @param cb 回调函数 + * @constructor + */ + public WatchData (OldTarget: Array, cb: Function): void { + OldTarget.forEach( (val,index) => { + this.watch(val, (prop, action, newvalue, oldvalue) => { + cb(index) + }) + }); + } + + /** + * 加密 + * @param code + */ + public compile(code: any) { + code = JSON.stringify(code); + let c = String.fromCharCode(code.charCodeAt(0)+code.length); + for(let i = 1; i < code.length; i++){ + c += String.fromCharCode(code.charCodeAt(i)+code.charCodeAt(i-1)); + } + return (escape(c)); + } + + /** + * 解密 + * @param code + */ + public uncompile(code: any) { + code = unescape(code); + let c = String.fromCharCode(code.charCodeAt(0)-code.length); + for(let i = 1; i < code.length; i++){ + c +=String.fromCharCode(code.charCodeAt(i)-c.charCodeAt(i-1)); + } + return c; + } +} diff --git a/src/resources/view/admin/src/view/.pydio b/src/resources/view/admin/src/view/.pydio new file mode 100644 index 0000000..28098dd --- /dev/null +++ b/src/resources/view/admin/src/view/.pydio @@ -0,0 +1 @@ +8b74909a-2183-4a9c-bb76-bc4e3124e8b3 \ No newline at end of file diff --git a/src/resources/view/admin/src/view/public/.pydio b/src/resources/view/admin/src/view/public/.pydio new file mode 100644 index 0000000..566b0c2 --- /dev/null +++ b/src/resources/view/admin/src/view/public/.pydio @@ -0,0 +1 @@ +57a4c05d-47dc-4150-86c1-17e3736db02b \ No newline at end of file diff --git a/src/resources/view/admin/src/view/public/aside.vue b/src/resources/view/admin/src/view/public/aside.vue new file mode 100755 index 0000000..efced67 --- /dev/null +++ b/src/resources/view/admin/src/view/public/aside.vue @@ -0,0 +1,79 @@ + + + + + \ No newline at end of file diff --git a/src/resources/view/admin/src/view/public/footer.vue b/src/resources/view/admin/src/view/public/footer.vue new file mode 100755 index 0000000..0a51fd0 --- /dev/null +++ b/src/resources/view/admin/src/view/public/footer.vue @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/src/resources/view/admin/src/view/public/header.vue b/src/resources/view/admin/src/view/public/header.vue new file mode 100755 index 0000000..dc2baa4 --- /dev/null +++ b/src/resources/view/admin/src/view/public/header.vue @@ -0,0 +1,70 @@ + + + + + \ No newline at end of file diff --git a/src/resources/view/admin/src/view/template/.pydio b/src/resources/view/admin/src/view/template/.pydio new file mode 100644 index 0000000..78bb117 --- /dev/null +++ b/src/resources/view/admin/src/view/template/.pydio @@ -0,0 +1 @@ +cbef9a55-00bb-47d5-8277-074bf1219e87 \ No newline at end of file diff --git a/src/resources/view/admin/src/view/template/classify/.pydio b/src/resources/view/admin/src/view/template/classify/.pydio new file mode 100644 index 0000000..ce30da7 --- /dev/null +++ b/src/resources/view/admin/src/view/template/classify/.pydio @@ -0,0 +1 @@ +9f3f4868-b053-4e25-847f-8efda1a8461b \ No newline at end of file diff --git a/src/resources/view/admin/src/view/template/classify/all.vue b/src/resources/view/admin/src/view/template/classify/all.vue new file mode 100755 index 0000000..cf1f770 --- /dev/null +++ b/src/resources/view/admin/src/view/template/classify/all.vue @@ -0,0 +1,110 @@ + + + + + \ No newline at end of file diff --git a/src/resources/view/admin/src/view/template/course/.pydio b/src/resources/view/admin/src/view/template/course/.pydio new file mode 100644 index 0000000..427dd77 --- /dev/null +++ b/src/resources/view/admin/src/view/template/course/.pydio @@ -0,0 +1 @@ +dc14a59a-ce0d-4edb-b6eb-b192f5b1400a \ No newline at end of file diff --git a/src/resources/view/admin/src/view/template/course/all.vue b/src/resources/view/admin/src/view/template/course/all.vue new file mode 100755 index 0000000..d268782 --- /dev/null +++ b/src/resources/view/admin/src/view/template/course/all.vue @@ -0,0 +1,247 @@ + + + + + diff --git a/src/resources/view/admin/src/view/template/course/index.vue b/src/resources/view/admin/src/view/template/course/index.vue new file mode 100755 index 0000000..32c6a74 --- /dev/null +++ b/src/resources/view/admin/src/view/template/course/index.vue @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/src/resources/view/admin/src/view/template/course/new.vue b/src/resources/view/admin/src/view/template/course/new.vue new file mode 100755 index 0000000..655de24 --- /dev/null +++ b/src/resources/view/admin/src/view/template/course/new.vue @@ -0,0 +1,318 @@ + + + + + \ No newline at end of file diff --git a/src/resources/view/admin/src/view/template/course/newVideo.vue b/src/resources/view/admin/src/view/template/course/newVideo.vue new file mode 100755 index 0000000..71b3fa0 --- /dev/null +++ b/src/resources/view/admin/src/view/template/course/newVideo.vue @@ -0,0 +1,395 @@ + + + + + \ No newline at end of file diff --git a/src/resources/view/admin/src/view/template/demo.vue b/src/resources/view/admin/src/view/template/demo.vue new file mode 100755 index 0000000..f9a2591 --- /dev/null +++ b/src/resources/view/admin/src/view/template/demo.vue @@ -0,0 +1,56 @@ + + + + + \ No newline at end of file diff --git a/src/resources/view/admin/src/view/template/login.vue b/src/resources/view/admin/src/view/template/login.vue new file mode 100755 index 0000000..25f1e49 --- /dev/null +++ b/src/resources/view/admin/src/view/template/login.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/src/resources/view/admin/src/view/template/main.vue b/src/resources/view/admin/src/view/template/main.vue new file mode 100755 index 0000000..84fac9d --- /dev/null +++ b/src/resources/view/admin/src/view/template/main.vue @@ -0,0 +1,49 @@ + + + + + \ No newline at end of file diff --git a/src/resources/view/admin/src/vue.declare.d.ts b/src/resources/view/admin/src/vue.declare.d.ts new file mode 100755 index 0000000..942154c --- /dev/null +++ b/src/resources/view/admin/src/vue.declare.d.ts @@ -0,0 +1,5 @@ +declare module "*.vue" { + import Vue from "vue"; + export default Vue; +} + diff --git a/src/resources/view/admin/tsconfig.json b/src/resources/view/admin/tsconfig.json new file mode 100755 index 0000000..c5ebfad --- /dev/null +++ b/src/resources/view/admin/tsconfig.json @@ -0,0 +1,40 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "strict": true, + "jsx": "preserve", + "importHelpers": true, + "moduleResolution": "node", + "experimentalDecorators": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "sourceMap": false, + "baseUrl": ".", + "outDir": "admin-dist", + "types": [ + "webpack-env" + ], + "paths": { + "@/*": [ + "src/*" + ] + }, + "lib": [ + "esnext", + "dom", + "dom.iterable", + "scripthost" + ] + }, + "include": [ + "src/**/*.ts", + "src/**/*.tsx", + "src/**/*.vue", + "tests/**/*.ts", + "tests/**/*.tsx" + ], + "exclude": [ + "node_modules" + ] +} diff --git a/src/resources/view/home/.pydio b/src/resources/view/home/.pydio new file mode 100644 index 0000000..8fecc91 --- /dev/null +++ b/src/resources/view/home/.pydio @@ -0,0 +1 @@ +bf354e87-e375-40dc-9507-d921816a60aa \ No newline at end of file diff --git a/src/resources/view/home/layout.jade b/src/resources/view/home/layout.jade new file mode 100755 index 0000000..b55927e --- /dev/null +++ b/src/resources/view/home/layout.jade @@ -0,0 +1,45 @@ +//- 网站的核心的公共父级组件 +//- 一些全局公共css和js可以在这里被加载 +doctype html +html + head + title=title + meta(charset="utf-8") + meta(http-equiv="X-UA-Compatible" content="IE=edge,chrome=1") + meta(name="viewport" content="width=device-width, initial-scale=1") + meta(name="renderer" content="webkit") + meta(name="author" content="编码猿,2271608011@qq.com") + meta(http-equiv="Cache-Control" content="no-cache") + meta(http-equiv="Expires" content="0") + meta(name="renderer" content="webkit") + meta(http-equiv="Cache-Control" content="no-siteapp") + meta(name="apple-mobile-web-app-status-bar-style" content="black") + meta(name="google" value="notranslate") + meta(name="baidu-site-verification" content="21kEPchCxS") + meta(name="360-site-verification" content="6dbeb22f4f20d07f3492eff44f8b25e3") + meta(baidu-gxt-verify-token="8faebbed25a4b01d5b78eafd57bcd370") + link(rel="shortcut icon" href="/img/favicon.ico") + link(rel="stylesheet" href="/js/lib/zui/css/zui.css") + link(rel="stylesheet" href="/js/lib/zui/css/zui-theme-blue.css") + + + + meta(name="description" content="xxx") + meta(name="keywords" content="xxxxx") + + + +body + + //- 公共网站头部 + - if (isShowAction.header) + include ./public/header + + //- 网站主体内容,从 main/*.jade 被载入 + block content + + //- 公共网站版权 + - if (isShowAction.footer) + include ./public/footer + + script(data-main="/js/app.js" src="/js/lib/require.js" defer) diff --git a/src/resources/view/home/page/.pydio b/src/resources/view/home/page/.pydio new file mode 100644 index 0000000..f5ec771 --- /dev/null +++ b/src/resources/view/home/page/.pydio @@ -0,0 +1 @@ +f190f561-7ab1-4003-9a2c-6353c158a28c \ No newline at end of file diff --git a/src/resources/view/home/page/Test.jade b/src/resources/view/home/page/Test.jade new file mode 100644 index 0000000..df6ca46 --- /dev/null +++ b/src/resources/view/home/page/Test.jade @@ -0,0 +1,13 @@ +extends ./../layout + +block title + + meta(name="description" content="xxx") + meta(name="keywords" content="xxxxx") + +//- 网站的主体内容区域 +block content + + .test(class="pages" data-module="test") + .container + h2 测试页面 diff --git a/src/resources/view/home/page/about.jade b/src/resources/view/home/page/about.jade new file mode 100755 index 0000000..983623c --- /dev/null +++ b/src/resources/view/home/page/about.jade @@ -0,0 +1,12 @@ +extends ./../layout + +//- 网站的头部信息这边拆分出来,便于每个页面的SEO配置和配置页面独有的css,js +block title + + meta(name="description" content="关于我们,企业联系,课程咨询,问题答疑") + meta(name="keywords" content="编码猿,关于我们,怪客学堂") + +//- 网站的主体内容区域 +block content + .about(class="pages about" data-module="about") + .container 关于我 \ No newline at end of file diff --git a/src/resources/view/home/page/error.jade b/src/resources/view/home/page/error.jade new file mode 100644 index 0000000..145d7a2 --- /dev/null +++ b/src/resources/view/home/page/error.jade @@ -0,0 +1,28 @@ +extends ./../layout + +//- 网站的头部信息这边拆分出来,便于每个页面的SEO配置和配置页面独有的css,js +block title + + meta(name="description" content="怪客课堂的404错误页面") + meta(name="keywords" content="怪客课堂,编码猿,怪客学堂,错误页面") + link(rel="stylesheet" href="/css/home/error.css") + +//- 网站的主体内容区域 +block content + .error + img(src="/img/bgError.png") + .i-message + h3 + | 哎哟喂~出bug了啊,哈哈... + br + | 页面不存在 + + p 可能的原因: + ul + li 1: 手滑输错地址 + li 2: 估计是程序员小姐姐代码有问题 + li 3: 页面过期失效了 + li 4: 不要干坏事哦 + p.action + a(href="/") 回到首页 + a(onclick="history.back();") 返回上一页 diff --git a/src/resources/view/home/page/index.jade b/src/resources/view/home/page/index.jade new file mode 100755 index 0000000..11b43dd --- /dev/null +++ b/src/resources/view/home/page/index.jade @@ -0,0 +1,14 @@ +extends ./../layout + +block title + + meta(name="description" content="怪客课堂是合肥源学思信息科技有限公司旗下的在线学习品牌,我们专注于通过不断的项目实战和实战经验分享来帮助更多想要进一步提高自身能力的人,同时也为想要从事编程行业的朋友提供一个更加合理快速的通道。在这里你能学习到更多更加有用的实战技能,更多更加干货和有分量的基础视频,我们拒绝废话拒绝啰嗦,在这里一切知识都为了更加符合企业工作需要,提升自我价值实现自我理想。") + meta(name="keywords" content="编码猿,html,css,后端,vue,php,java,node,koa, 在线技术学习") + +//- 网站的主体内容区域 +block content + + .index(class="pages" data-module="index") + .container + | 测试首页 + button(class="btn btn-primary" type="button") 测试按钮 \ No newline at end of file diff --git a/src/resources/view/home/page/register.jade b/src/resources/view/home/page/register.jade new file mode 100644 index 0000000..a13bf92 --- /dev/null +++ b/src/resources/view/home/page/register.jade @@ -0,0 +1,14 @@ +extends ./../layout + +//- 网站的头部信息这边拆分出来,便于每个页面的SEO配置和配置页面独有的css,js +block title + + meta(name="description" content="怪客课堂是合肥源学思信息科技有限公司旗下的在线学习品牌,我们专注于通过不断的项目实战和实战经验分享来帮助更多想要进一步提高自身能力的人,同时也为想要从事编程行业的朋友提供一个更加合理快速的通道。在这里你能学习到更多更加有用的实战技能,更多更加干货和有分量的基础视频,我们拒绝废话拒绝啰嗦,在这里一切知识都为了更加符合企业工作需要,提升自我价值实现自我理想。") + meta(name="keywords" content="编码猿,html,css,后端,vue,php,java,node,koa, 在线技术学习") + +//- 网站的主体内容区域 +block content + + .index(class="pages register" data-module="register") + .container 用户注册 + diff --git a/src/resources/view/home/public/.pydio b/src/resources/view/home/public/.pydio new file mode 100644 index 0000000..dffcb5c --- /dev/null +++ b/src/resources/view/home/public/.pydio @@ -0,0 +1 @@ +ba52c5a5-2875-4d9f-9696-cde2c909c595 \ No newline at end of file diff --git a/src/resources/view/home/public/footer.jade b/src/resources/view/home/public/footer.jade new file mode 100755 index 0000000..fa93361 --- /dev/null +++ b/src/resources/view/home/public/footer.jade @@ -0,0 +1 @@ +.footer 底部 \ No newline at end of file diff --git a/src/resources/view/home/public/header.jade b/src/resources/view/home/public/header.jade new file mode 100755 index 0000000..ec2a65a --- /dev/null +++ b/src/resources/view/home/public/header.jade @@ -0,0 +1 @@ +.header 头部 diff --git a/src/run/.pydio b/src/run/.pydio new file mode 100644 index 0000000..3f0d275 --- /dev/null +++ b/src/run/.pydio @@ -0,0 +1 @@ +41764053-11df-46c9-9f37-7c7bfa148ab2 \ No newline at end of file diff --git a/src/run/app.ts b/src/run/app.ts new file mode 100755 index 0000000..c40c8af --- /dev/null +++ b/src/run/app.ts @@ -0,0 +1,67 @@ +import "reflect-metadata"; +import { useKoaServer,useContainer } from "routing-controllers"; +import { Container } from "typedi"; +import { config } from "../config"; +import { Logs } from "../utils/logs"; +import { initPlugins } from "./init"; +import { logger } from "../utils/logger"; + +import path from "path"; + +export class App extends initPlugins{ + private Controller: Function[]; + private app: any; + + constructor () { + super(); + // typedi 注入到 routing-controllers + useContainer(Container); + this.createKoa(); + } + + /** + * 创建 koa 服务 + */ + createKoa() { + this.app = useKoaServer(this.Koa2, { + cors: true, + validation: true, + classTransformer: true, + controllers: [`${path.join(__dirname, '../controller/**/*{.js,.ts}')}`] + }); + this.run(); + } + + // 启动程序 + private run (): any { + try { + this.app.listen(config.port, () => logger.logSymbolsSuccess(config.banner.welcome())); + } catch (e) { + logger.logSymbolsError(`❌ 启动出错:${e.message}`); + Logs.ApplicationLogger().error(e); + } + this.errorCatch(); + // this.Page_404(); + } + + // 错误捕捉Unsupported type + private errorCatch (): any { + this.app.on('error', err => { + logger.logSymbolsError(`❌ 主程序捕捉到错误:${err.message}`); + Logs.ApplicationLogger().error(err); + }); + } + + /** + * 捕捉到404的时候跳转到error错误页面 + * @constructor + */ + private Page_404 () { + this.app.use(async ctx => { + if (ctx.response.status == 404) { + ctx.redirect('/error'); + } + }) + } + +} \ No newline at end of file diff --git a/src/run/init.ts b/src/run/init.ts new file mode 100755 index 0000000..8918676 --- /dev/null +++ b/src/run/init.ts @@ -0,0 +1,64 @@ +import KoaBodyParser from "koa-bodyparser"; +import serve from "koa-static"; +import views from "koa-views"; +import session from "koa-session"; +import path from "path"; +import koa from "koa"; +import { logger } from "../utils/logger"; +import { Logs } from "../utils/logs"; +import { config } from "../config"; +import { createConnection } from "typeorm"; + +/** + * 把第三方插件 和 中间件 的配置从主启动类中剥离处理 + * 便于项目后期配置更多的第三方插件&中间件 + */ +export class initPlugins { + // 所有需要配置参数的中间件集合 + public PluginsList: Array; + public Koa2: any = new koa(); + constructor () { + this.combinationPlugins(); + } + + /** + * 组装koa2的中间件为Array + */ + private async combinationPlugins () { + // 设置签名的 Cookie 密钥。 + this.Koa2.keys = [ config.initPlugins.SessionKey ]; + this.PluginsList = [ + // 记录系统日志,访问级别的,记录用户的所有请求,作为koa的中间件 + Logs.AccessLogger(), + // 处理post请求 + KoaBodyParser(), + // 静态资源配置 + serve(path.join(__dirname, config.initPlugins.staticPath ), { maxage: 0 }), + // session 配置 + session({ + key: 'koa:sess', + maxAge: 86400000, + overwrite: true, + httpOnly: true, + signed: true, + rolling: false, + renew: false, + },this.Koa2), + // 模板引擎配置 + views(path.join(__dirname, config.initPlugins.viewsPath ), { + extension: 'jade', + options: { ext: 'jade' } + }) + ]; + + try { + this.PluginsList.forEach((v) => this.Koa2.use(v)); + // @ts-ignore + await createConnection(config.typeorm); + } catch (e) { + // 终端输出 + logger.logSymbolsError(`配置插件出错:${e.message}`); + Logs.ApplicationLogger().error(e); + } + } +} \ No newline at end of file diff --git a/src/service/.pydio b/src/service/.pydio new file mode 100644 index 0000000..1dc3252 --- /dev/null +++ b/src/service/.pydio @@ -0,0 +1 @@ +4c10a98b-2bf1-48d3-91a3-02b0e968dc2a \ No newline at end of file diff --git a/src/service/UserService.ts b/src/service/UserService.ts new file mode 100755 index 0000000..4f413fb --- /dev/null +++ b/src/service/UserService.ts @@ -0,0 +1,4 @@ +export interface UserService { + getOneUserService(id: string) : Promise; + getAllUserService() : Promise; +} \ No newline at end of file diff --git a/src/service/impl/.pydio b/src/service/impl/.pydio new file mode 100644 index 0000000..17b958a --- /dev/null +++ b/src/service/impl/.pydio @@ -0,0 +1 @@ +008ab470-5e62-4978-8a68-27780fbb8960 \ No newline at end of file diff --git a/src/service/impl/UserServiceImpl.ts b/src/service/impl/UserServiceImpl.ts new file mode 100755 index 0000000..ce5759a --- /dev/null +++ b/src/service/impl/UserServiceImpl.ts @@ -0,0 +1,19 @@ +import { UserService } from "../UserService"; +import { Service, Inject } from "typedi"; +import { UserDao } from "../../dao/UserDao"; + +@Service() +export class UserServiceImpl implements UserService{ + + @Inject() + private userDao: UserDao; + + public async getOneUserService(id: string): Promise { + + return await this.userDao.getOneUserDao(id); + } + + public async getAllUserService(): Promise { + return await this.userDao.AllUser(); + } +} \ No newline at end of file diff --git a/src/utils/.pydio b/src/utils/.pydio new file mode 100644 index 0000000..1075c89 --- /dev/null +++ b/src/utils/.pydio @@ -0,0 +1 @@ +36af59a8-c167-4eb0-b69e-7ba04e3f6dab \ No newline at end of file diff --git a/src/utils/logger.ts b/src/utils/logger.ts new file mode 100755 index 0000000..ed80998 --- /dev/null +++ b/src/utils/logger.ts @@ -0,0 +1,16 @@ +import logSymbols from "log-symbols"; +import chalk from "chalk"; +export class logger { + public static logSymbolsSuccess(message:string): void { + console.log(chalk.green.bold(logSymbols.success, message)); + } + public static logSymbolsInfo(message:string): void { + console.log(logSymbols.info, message); + } + public static logSymbolsWarning(message:string): void { + console.log(logSymbols.warning, message); + } + public static logSymbolsError(message:string): void { + console.log(chalk.bold.red(logSymbols.error, message)); + } +} \ No newline at end of file diff --git a/src/utils/logs.ts b/src/utils/logs.ts new file mode 100644 index 0000000..ab00bd5 --- /dev/null +++ b/src/utils/logs.ts @@ -0,0 +1,25 @@ +import log4 from "koa-log4"; +import { config } from "../config"; +log4.configure(config.logConfig); + +export class Logs { + /** + * 访问级别的日志 + */ + public static AccessLogger() { + return log4.koaLogger(log4.getLogger('access'), { level: 'auto' }); + } + + /** + * 应用级别的日志 + * @constructor + */ + public static ApplicationLogger() { + return log4.getLogger('application') + } + + public static HttpLogger() { + return log4.getLogger('request') + } + +} \ No newline at end of file diff --git a/src/utils/utils.ts b/src/utils/utils.ts new file mode 100755 index 0000000..5900e97 --- /dev/null +++ b/src/utils/utils.ts @@ -0,0 +1,32 @@ +import { config } from "../config/index"; +import fs from "fs"; +import path from "path"; + +export class utils { + + /** + * 统一设置网站浏览器的 title 标题内容 + * @param title + */ + public static titleName(title:string):string { + return `${title}${config.title}` + } + + /** + * 将get地址栏参数转换为对象 + * @param url + */ + public static parseQueryString (url) { + var reg_url = /^[^\?]+\?([\w\W]+)$/, + reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g, + arr_url = reg_url.exec(url), + ret = {}; + if (arr_url && arr_url[1]) { + var str_para = arr_url[1], result; + while ((result = reg_para.exec(str_para)) != null) { + ret[result[1]] = result[2]; + } + } + return ret; + } +} \ No newline at end of file diff --git a/test/.pydio b/test/.pydio new file mode 100644 index 0000000..9daae85 --- /dev/null +++ b/test/.pydio @@ -0,0 +1 @@ +eddcc721-bb9f-4a69-babc-5385521e0a89 \ No newline at end of file diff --git a/test/aliplayer.html b/test/aliplayer.html new file mode 100755 index 0000000..1488d48 --- /dev/null +++ b/test/aliplayer.html @@ -0,0 +1,26 @@ + + + + + + + Aliplayer Functions + + + + +
          + + + diff --git a/test/demo.html b/test/demo.html new file mode 100755 index 0000000..af241e4 --- /dev/null +++ b/test/demo.html @@ -0,0 +1,22 @@ + + + + + Title + + + + + + + + + + \ No newline at end of file diff --git a/test/tengxunplay.html b/test/tengxunplay.html new file mode 100755 index 0000000..87e2b4b --- /dev/null +++ b/test/tengxunplay.html @@ -0,0 +1,21 @@ + + + + + Title + + + + +
          + + + + \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100755 index 0000000..718b8f7 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "lib": ["es5", "es6", "dom"], + "paths": { "*": ["types/*"] }, + "module": "commonjs", + "target": "es6", + "esModuleInterop": true, + "sourceMap": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "outDir": "dist/" + }, + "exclude": [ + "node_modules" + ] +} \ No newline at end of file