fix: 初始化

This commit is contained in:
kaizheng(郑凯) 2025-01-26 21:07:26 +08:00
commit 58e3df1c04
572 changed files with 170353 additions and 0 deletions

14
.editorconfig Normal file
View File

@ -0,0 +1,14 @@
# https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

8
.env.development Normal file
View File

@ -0,0 +1,8 @@
ENV = 'development'
# 接口地址
VUE_APP_BASE_API = 'https://lczqvideodev.test.upchina.com'
VUE_APP_WS_API = 'ws://localhost:8000'
# 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true

7
.env.production Normal file
View File

@ -0,0 +1,7 @@
ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
VUE_APP_BASE_API = 'https://eladmin.vip'
# 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'wss://eladmin.vip'

4
.eslintignore Normal file
View File

@ -0,0 +1,4 @@
build/*.js
src/assets
public
dist

275
.eslintrc.js Normal file
View File

@ -0,0 +1,275 @@
module.exports = {
root: true,
parserOptions: {
parser: "babel-eslint",
sourceType: "module"
},
env: {
browser: true,
node: true,
es6: true
},
extends: ["plugin:vue/recommended", "eslint:recommended"],
// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
"vue/max-attributes-per-line": [
2,
{
singleline: 10,
multiline: {
max: 1,
allowFirstLine: false
}
}
],
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline": "off",
"vue/name-property-casing": ["error", "PascalCase"],
"vue/no-v-html": "off",
"accessor-pairs": 2,
"arrow-spacing": [
2,
{
before: true,
after: true
}
],
"block-spacing": [2, "always"],
"brace-style": [
2,
"1tbs",
{
allowSingleLine: true
}
],
camelcase: [
0,
{
properties: "always"
}
],
"comma-dangle": [2, "never"],
"comma-spacing": [
2,
{
before: false,
after: true
}
],
"comma-style": [2, "last"],
"constructor-super": 2,
curly: [2, "multi-line"],
"dot-location": [2, "property"],
"eol-last": 2,
eqeqeq: ["error", "always", { null: "ignore" }],
"generator-star-spacing": [
2,
{
before: true,
after: true
}
],
"handle-callback-err": [2, "^(err|error)$"],
indent: [
2,
2,
{
SwitchCase: 1
}
],
"jsx-quotes": [2, "prefer-single"],
"key-spacing": [
2,
{
beforeColon: false,
afterColon: true
}
],
"keyword-spacing": [
2,
{
before: true,
after: true
}
],
"new-cap": [
2,
{
newIsCap: true,
capIsNew: false
}
],
"new-parens": 2,
"no-array-constructor": 2,
"no-caller": 2,
"no-console": "off",
"no-class-assign": 2,
"no-cond-assign": 2,
"no-const-assign": 2,
"no-control-regex": 0,
"no-delete-var": 2,
"no-dupe-args": 2,
"no-dupe-class-members": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-empty-pattern": 2,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": [2, "functions"],
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inner-declarations": [2, "functions"],
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-labels": [
2,
{
allowLoop: false,
allowSwitch: false
}
],
"no-lone-blocks": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-multiple-empty-lines": [
2,
{
max: 1
}
],
"no-native-reassign": 2,
"no-negated-in-lhs": 2,
"no-new-object": 2,
"no-new-require": 2,
"no-new-symbol": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-path-concat": 2,
"no-proto": 2,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-return-assign": [2, "except-parens"],
"no-self-assign": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-shadow-restricted-names": 2,
"no-spaced-func": 2,
"no-sparse-arrays": 2,
"no-this-before-super": 2,
"no-throw-literal": 2,
"no-trailing-spaces": 2,
"no-undef": 2,
"no-undef-init": 2,
"no-unexpected-multiline": 2,
"no-unmodified-loop-condition": 2,
"no-unneeded-ternary": [
2,
{
defaultAssignment: false
}
],
"no-unreachable": 2,
"no-unsafe-finally": 2,
"no-unused-vars": [
2,
{
vars: "all",
args: "none"
}
],
"no-useless-call": 2,
"no-useless-computed-key": 2,
"no-useless-constructor": 2,
"no-useless-escape": 0,
"no-whitespace-before-property": 2,
"no-with": 2,
"one-var": [
2,
{
initialized: "never"
}
],
"operator-linebreak": [
2,
"after",
{
overrides: {
"?": "before",
":": "before"
}
}
],
"padded-blocks": [2, "never"],
quotes: [
0,
"single",
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
semi: [0, "never"],
"semi-spacing": [
2,
{
before: false,
after: true
}
],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "never"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [
2,
{
words: true,
nonwords: false
}
],
"spaced-comment": [
2,
"always",
{
markers: [
"global",
"globals",
"eslint",
"eslint-disable",
"*package",
"!",
","
]
}
],
"template-curly-spacing": [2, "never"],
"use-isnan": 2,
"valid-typeof": 2,
"wrap-iife": [2, "any"],
"yield-star-spacing": [2, "both"],
yoda: [2, "never"],
"prefer-const": 2,
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
"object-curly-spacing": [
2,
"always",
{
objectsInObjects: false
}
],
"array-bracket-spacing": [2, "never"]
}
};

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
.DS_Store
node_modules/
dist/
demo/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.local
package-lock.json
yarn.lock

5
.travis.yml Normal file
View File

@ -0,0 +1,5 @@
language: node_js
node_js: 10
script: npm run test
notifications:
email: false

191
LICENSE Normal file
View File

@ -0,0 +1,191 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
3. Grant of Patent License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
4. Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
6. Trademarks.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
8. Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "{}" replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
Copyright 2019 Zheng Jie
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.

84
README.md Normal file
View File

@ -0,0 +1,84 @@
# ELADMIN-WEB
ELADMIN 前端源码
#### 项目源码
| | 后端源码 | 前端源码 |
|--- |--- | --- |
| github | https://github.com/elunez/eladmin | https://github.com/elunez/eladmin-web |
| 码云 | https://gitee.com/elunez/eladmin | https://gitee.com/elunez/eladmin-web |
#### 开发文档
[https://eladmin.vip](https://eladmin.vip)
#### 体验地址
[https://eladmin.vip/demo](https://eladmin.vip/demo)
#### 前端模板
初始模板基于: [https://github.com/PanJiaChen/vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
模板文档: [https://panjiachen.github.io/vue-element-admin-site/zh/guide/](https://panjiachen.github.io/vue-element-admin-site/zh/guide/)
#### VPS推荐
<a href="https://bwh81.net/aff.php?aff=70876" target="_blank">
<img src="https://eladmin.vip/images/banner/side.jpeg" style="width: 435px;border-radius: 2px;">
</a>
使用优惠码: `BWHCGLUKKB`,可获得 6.81% 的折扣, [查看介绍](https://bwhstock.in/)
#### Build Setup
**推荐 node 版本12-16**
``` bash
# 配置镜像加速
https://www.ydyno.com/archives/1219.html
# 安装依赖
npm install
# 启动服务 localhost:8013
npm run dev
# 构建生产环境
npm run build:prod
```
#### 常见问题
1、linux 系统在安装依赖的时候会出现 node-sass 无法安装的问题
解决方案:
```
1. 单独安装npm install --unsafe-perm node-sass
2. 直接使用npm install --unsafe-perm
```
2、加速node-sass安装
https://izlzl.com/archives/1219.html
3、出现 No module named 'distutils'
```
需要安装 python安装 pip 或者 pip3
然后安装 pip install distutils / pip3 install distutils
```
#### 特别鸣谢
- 感谢 [JetBrains](https://www.jetbrains.com/) 提供的非商业开源软件开发授权
- 感谢 [PanJiaChen](https://github.com/PanJiaChen/vue-element-admin) 大佬提供的前端模板
- 感谢 [Moxun](https://github.com/moxun1639) 大佬提供的前端 Crud 通用组件
- 感谢 [zhy6599](https://gitee.com/zhy6599) 大佬提供的后端运维管理相关功能
- 感谢 [j.yao.SUSE](https://github.com/everhopingandwaiting) 大佬提供的匿名接口与Redis限流等功能
- 感谢 [d15801543974](https://github.com/d15801543974) 大佬提供的基于注解的通用查询方式
#### 反馈交流
- QQ交流群891137268 、947578238、659622532

11
babel.config.js Normal file
View File

@ -0,0 +1,11 @@
const plugins = ['@vue/babel-plugin-transform-vue-jsx']
// 生产环境移除console
if (process.env.NODE_ENV === 'production') {
plugins.push('transform-remove-console')
}
module.exports = {
plugins: plugins,
presets: [
'@vue/app'
]
}

24
jest.config.js Normal file
View File

@ -0,0 +1,24 @@
module.exports = {
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest'
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
snapshotSerializers: ['jest-serializer-vue'],
testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
],
collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
coverageDirectory: '<rootDir>/tests/unit/coverage',
// 'collectCoverage': true,
'coverageReporters': [
'lcov',
'text-summary'
],
testURL: 'http://localhost/'
}

123
package.json Normal file
View File

@ -0,0 +1,123 @@
{
"name": "eladmin-web",
"version": "2.7.0",
"description": "ELADMIN 前端源码",
"author": "Zheng Jie",
"license": "Apache-2.0",
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src",
"test:unit": "jest --clearCache && vue-cli-service test:unit",
"svgo": "svgo -f src/assets/icons/svg --config=src/assets/icons/svgo.yml",
"new": "plop"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"repository": {
"type": "git",
"url": "https://github.com/elunez/eladmin-web.git"
},
"bugs": {
"url": "https://github.com/elunez/eladmin/issues"
},
"dependencies": {
"@riophae/vue-treeselect": "^0.4.0",
"@stomp/stompjs": "^6.1.2",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^1.0.2",
"axios": "1.7.4",
"babel-eslint": "^8.2.2",
"clipboard": "2.0.4",
"codemirror": "^5.49.2",
"core-js": "^2.6.12",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.13",
"echarts": "^4.2.1",
"echarts-wordcloud": "^1.1.3",
"element-ui": "^2.15.8",
"file-saver": "1.3.8",
"fuse.js": "3.4.4",
"js-beautify": "^1.10.2",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"jszip": "^3.7.1",
"mavon-editor": "^2.9.1",
"moment": "^2.30.1",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "8.0.0",
"qrcodejs2": "^0.0.2",
"qs": "^6.10.1",
"screenfull": "4.2.0",
"sortablejs": "1.8.4",
"vod-js-sdk-v6": "^1.7.1-beta.1",
"vue": "^2.6.14",
"vue-count-to": "^1.0.13",
"vue-cropper": "0.4.9",
"vue-echarts": "^5.0.0-beta.0",
"vue-image-crop-upload": "^2.5.0",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
"vuedraggable": "2.20.0",
"vuex": "3.1.0",
"wangeditor": "^4.7.11",
"webpack": "^4.47.0",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@babel/parser": "^7.7.4",
"@babel/register": "7.0.0",
"@vue/babel-plugin-transform-vue-jsx": "^1.2.1",
"@vue/cli-plugin-babel": "3.5.3",
"@vue/cli-plugin-eslint": "^3.9.1",
"@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-service": "3.5.3",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "23.6.0",
"babel-plugin-dynamic-import-node": "2.3.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"chalk": "2.4.2",
"chokidar": "2.1.5",
"compression-webpack-plugin": "5.0.2",
"connect": "3.6.6",
"eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2",
"html-webpack-plugin": "3.2.0",
"http-proxy-middleware": "3.0.3",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"plop": "2.3.0",
"sass": "1.32.13",
"sass-loader": "10.2.0",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",
"serve-static": "1.16.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"tasksfile": "^5.1.1",
"vue-template-compiler": "2.7.15",
"vue2-editor": "^2.10.3"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

7
plopfile.js Normal file
View File

@ -0,0 +1,7 @@
const viewGenerator = require('./plop-templates/view/prompt')
const componentGenerator = require('./plop-templates/component/prompt')
module.exports = function(plop) {
plop.setGenerator('view', viewGenerator)
plop.setGenerator('component', componentGenerator)
}

5
postcss.config.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {}
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

32
public/index.html Normal file
View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="renderer" content="webkit" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
/>
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= webpackConfig.name %></title>
<link href="<%= BASE_URL %>static/css/tcplayer.min.css" rel="stylesheet" />
<script src="<%= BASE_URL %>static/js/config.js"></script>
<!--如果需要在 Chrome 和 Firefox 等现代浏览器中通过 H5 播放 Webrtc 视频,需要在 tcplayer.vx.x.x.min.js 之前引入 TXLivePlayer-x.x.x.min.js。-->
<!--有些浏览器环境不支持 Webrtc播放器会将 Webrtc 流地址自动转换为 HLS 格式地址因此快直播场景同样需要引入hls.min.x.xx.xm.js。-->
<script src="<%= BASE_URL %>static/js/TXLivePlayer-1.2.3.min.js"></script>
<!--如果需要在 Chrome 和 Firefox 等现代浏览器中通过 H5 播放 HLS 协议的视频,需要在 tcplayer.vx.x.x.min.js 之前引入 hls.min.x.xx.xm.js。-->
<script src="<%= BASE_URL %>static/js/hls.min.1.1.5.js"></script>
<!--如果需要在 Chrome 和 Firefox 等现代浏览器中通过 H5 播放 FLV 格式的视频,需要在 tcplayer.vx.x.x.min.js 之前引入 flv.min.x.x.x.js。-->
<script src="<%= BASE_URL %>static/js/flv.min.1.6.3.js"></script>
<!--如果需要在 Chrome 和 Firefox 等现代浏览器中通过 H5 播放 DASH 视频,需要在 tcplayer.vx.x.x.min.js 之前引入 dash.min.x.x.x.js。-->
<script src="<%= BASE_URL %>static/js/dash.all.min.4.4.1.js"></script>
<!--播放器脚本文件-->
<script src="<%= BASE_URL %>static/js/tcplayer.v4.6.0.min.js"></script>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
<script src="<%= BASE_URL %>static/tinymce/tinymce.min.js"></script>
</body>
</html>

2
public/robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-agent: *
Disallow: /

1
public/static/css/tcplayer.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,6 @@
window.config = {
qwUserPhotoUrl: "https://workwxbench.test.upchina.com/#/userinfo?corpId=ww7b2c628cf4c199eb&userId=",
// 生产https://workwxbench-open.uptougu.com/#/userinfo?corpId=wwc6af46b4e2aa04b0&userId=${uid}
webAuthUrl: "http://passport.test.upchina.com", // 登录跳转地址
openPortraitScreen: true // 创建直播的时候是否允许创建竖屏
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

17
public/static/js/tcplayer.v4.6.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,21 @@
{
"name": "tinymce",
"description": "Web based JavaScript HTML WYSIWYG editor control.",
"license": "LGPL-2.1",
"keywords": [
"editor",
"wysiwyg",
"tinymce",
"richtext",
"javascript",
"html"
],
"homepage": "http://www.tinymce.com",
"ignore": [
"readme.md",
"composer.json",
"package.json",
".npmignore",
"changelog.txt"
]
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,42 @@
{
"name": "tinymce/tinymce",
"version": "4.9.11",
"description": "Web based JavaScript HTML WYSIWYG editor control.",
"license": [
"LGPL-2.1-only"
],
"keywords": [
"editor",
"wysiwyg",
"tinymce",
"richtext",
"javascript",
"html"
],
"homepage": "http://www.tinymce.com",
"type": "component",
"extra": {
"component": {
"scripts": [
"tinymce.js",
"plugins/*/plugin.js",
"themes/*/theme.js"
],
"files": [
"tinymce.min.js",
"plugins/*/plugin.min.js",
"themes/*/theme.min.js",
"skins/**"
]
}
},
"archive": {
"exclude": [
"readme.md",
"bower.js",
"package.json",
".npmignore",
"changelog.txt"
]
}
}

View File

@ -0,0 +1 @@
!function(){var f,c,u,p,d,s=[];d="undefined"!=typeof global?global:window,p=d.jQuery;var v=function(){return d.tinymce};p.fn.tinymce=function(o){var e,t,i,l=this,r="";if(!l.length)return l;if(!o)return v()?v().get(l[0].id):null;l.css("visibility","hidden");var n=function(){var a=[],c=0;u||(m(),u=!0),l.each(function(e,t){var n,i=t.id,r=o.oninit;i||(t.id=i=v().DOM.uniqueId()),v().get(i)||(n=v().createEditor(i,o),a.push(n),n.on("init",function(){var e,t=r;l.css("visibility",""),r&&++c==a.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:v().resolve(t.replace(/\.\w+$/,"")),t=v().resolve(t)),t.apply(e||v(),a))}))}),p.each(a,function(e,t){t.render()})};if(d.tinymce||c||!(e=o.script_url))1===c?s.push(n):n();else{c=1,t=e.substring(0,e.lastIndexOf("/")),-1!=e.indexOf(".min")&&(r=".min"),d.tinymce=d.tinyMCEPreInit||{base:t,suffix:r},-1!=e.indexOf("gzip")&&(i=o.language||"en",e=e+(/\?/.test(e)?"&":"?")+"js=true&core=true&suffix="+escape(r)+"&themes="+escape(o.theme||"modern")+"&plugins="+escape(o.plugins||"")+"&languages="+(i||""),d.tinyMCE_GZ||(d.tinyMCE_GZ={start:function(){var n=function(e){v().ScriptLoader.markDone(v().baseURI.toAbsolute(e))};n("langs/"+i+".js"),n("themes/"+o.theme+"/theme"+r+".js"),n("themes/"+o.theme+"/langs/"+i+".js"),p.each(o.plugins.split(","),function(e,t){t&&(n("plugins/"+t+"/plugin"+r+".js"),n("plugins/"+t+"/langs/"+i+".js"))})},end:function(){}}));var a=document.createElement("script");a.type="text/javascript",a.onload=a.onreadystatechange=function(e){e=e||window.event,2===c||"load"!=e.type&&!/complete|loaded/.test(a.readyState)||(v().dom.Event.domLoaded=1,c=2,o.script_loaded&&o.script_loaded(),n(),p.each(s,function(e,t){t()}))},a.src=e,document.body.appendChild(a)}return l},p.extend(p.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in d&&(t=v().get(e.id))&&t.editorManager===v())}});var m=function(){var r=function(e){"remove"===e&&this.each(function(e,t){var n=l(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=v().get(t.id.replace(/_parent$/,""));n&&n.remove()})},o=function(i){var e,t=this;if(null!=i)r.call(t),t.each(function(e,t){var n;(n=v().get(t.id))&&n.setContent(i)});else if(0<t.length&&(e=v().get(t[0].id)))return e.getContent()},l=function(e){var t=null;return e&&e.id&&d.tinymce&&(t=v().get(e.id)),t},u=function(e){return!!(e&&e.length&&d.tinymce&&e.is(":tinymce"))},s={};p.each(["text","html","val"],function(e,t){var a=s[t]=p.fn[t],c="text"===t;p.fn[t]=function(e){var t=this;if(!u(t))return a.apply(t,arguments);if(e!==f)return o.call(t.filter(":tinymce"),e),a.apply(t.not(":tinymce"),arguments),t;var i="",r=arguments;return(c?t:t.eq(0)).each(function(e,t){var n=l(t);i+=n?c?n.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):n.getContent({save:!0}):a.apply(p(t),r)}),i}}),p.each(["append","prepend"],function(e,t){var n=s[t]=p.fn[t],r="prepend"===t;p.fn[t]=function(i){var e=this;return u(e)?i!==f?("string"==typeof i&&e.filter(":tinymce").each(function(e,t){var n=l(t);n&&n.setContent(r?i+n.getContent():n.getContent()+i)}),n.apply(e.not(":tinymce"),arguments),e):void 0:n.apply(e,arguments)}}),p.each(["remove","replaceWith","replaceAll","empty"],function(e,t){var n=s[t]=p.fn[t];p.fn[t]=function(){return r.call(this,t),n.apply(this,arguments)}}),s.attr=p.fn.attr,p.fn.attr=function(e,t){var n=this,i=arguments;if(!e||"value"!==e||!u(n))return s.attr.apply(n,i);if(t!==f)return o.call(n.filter(":tinymce"),t),s.attr.apply(n.not(":tinymce"),i),n;var r=n[0],a=l(r);return a?a.getContent({save:!0}):s.attr.apply(p(r),i)}}}();

View File

@ -0,0 +1 @@
!function(){var f,c,u,p,d,s=[];d="undefined"!=typeof global?global:window,p=d.jQuery;var v=function(){return d.tinymce};p.fn.tinymce=function(o){var e,t,i,l=this,r="";if(!l.length)return l;if(!o)return v()?v().get(l[0].id):null;l.css("visibility","hidden");var n=function(){var a=[],c=0;u||(m(),u=!0),l.each(function(e,t){var n,i=t.id,r=o.oninit;i||(t.id=i=v().DOM.uniqueId()),v().get(i)||(n=v().createEditor(i,o),a.push(n),n.on("init",function(){var e,t=r;l.css("visibility",""),r&&++c==a.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:v().resolve(t.replace(/\.\w+$/,"")),t=v().resolve(t)),t.apply(e||v(),a))}))}),p.each(a,function(e,t){t.render()})};if(d.tinymce||c||!(e=o.script_url))1===c?s.push(n):n();else{c=1,t=e.substring(0,e.lastIndexOf("/")),-1!=e.indexOf(".min")&&(r=".min"),d.tinymce=d.tinyMCEPreInit||{base:t,suffix:r},-1!=e.indexOf("gzip")&&(i=o.language||"en",e=e+(/\?/.test(e)?"&":"?")+"js=true&core=true&suffix="+escape(r)+"&themes="+escape(o.theme||"modern")+"&plugins="+escape(o.plugins||"")+"&languages="+(i||""),d.tinyMCE_GZ||(d.tinyMCE_GZ={start:function(){var n=function(e){v().ScriptLoader.markDone(v().baseURI.toAbsolute(e))};n("langs/"+i+".js"),n("themes/"+o.theme+"/theme"+r+".js"),n("themes/"+o.theme+"/langs/"+i+".js"),p.each(o.plugins.split(","),function(e,t){t&&(n("plugins/"+t+"/plugin"+r+".js"),n("plugins/"+t+"/langs/"+i+".js"))})},end:function(){}}));var a=document.createElement("script");a.type="text/javascript",a.onload=a.onreadystatechange=function(e){e=e||window.event,2===c||"load"!=e.type&&!/complete|loaded/.test(a.readyState)||(v().dom.Event.domLoaded=1,c=2,o.script_loaded&&o.script_loaded(),n(),p.each(s,function(e,t){t()}))},a.src=e,document.body.appendChild(a)}return l},p.extend(p.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in d&&(t=v().get(e.id))&&t.editorManager===v())}});var m=function(){var r=function(e){"remove"===e&&this.each(function(e,t){var n=l(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=v().get(t.id.replace(/_parent$/,""));n&&n.remove()})},o=function(i){var e,t=this;if(null!=i)r.call(t),t.each(function(e,t){var n;(n=v().get(t.id))&&n.setContent(i)});else if(0<t.length&&(e=v().get(t[0].id)))return e.getContent()},l=function(e){var t=null;return e&&e.id&&d.tinymce&&(t=v().get(e.id)),t},u=function(e){return!!(e&&e.length&&d.tinymce&&e.is(":tinymce"))},s={};p.each(["text","html","val"],function(e,t){var a=s[t]=p.fn[t],c="text"===t;p.fn[t]=function(e){var t=this;if(!u(t))return a.apply(t,arguments);if(e!==f)return o.call(t.filter(":tinymce"),e),a.apply(t.not(":tinymce"),arguments),t;var i="",r=arguments;return(c?t:t.eq(0)).each(function(e,t){var n=l(t);i+=n?c?n.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):n.getContent({save:!0}):a.apply(p(t),r)}),i}}),p.each(["append","prepend"],function(e,t){var n=s[t]=p.fn[t],r="prepend"===t;p.fn[t]=function(i){var e=this;return u(e)?i!==f?("string"==typeof i&&e.filter(":tinymce").each(function(e,t){var n=l(t);n&&n.setContent(r?i+n.getContent():n.getContent()+i)}),n.apply(e.not(":tinymce"),arguments),e):void 0:n.apply(e,arguments)}}),p.each(["remove","replaceWith","replaceAll","empty"],function(e,t){var n=s[t]=p.fn[t];p.fn[t]=function(){return r.call(this,t),n.apply(this,arguments)}}),s.attr=p.fn.attr,p.fn.attr=function(e,t){var n=this,i=arguments;if(!e||"value"!==e||!u(n))return s.attr.apply(n,i);if(t!==f)return o.call(n.filter(":tinymce"),t),s.attr.apply(n.not(":tinymce"),i),n;var r=n[0],a=l(r);return a?a.getContent({save:!0}):s.attr.apply(p(r),i)}}}();

View File

@ -0,0 +1,462 @@
tinymce.addI18n('zh_CN',{
"Redo": "\u91cd\u505a",
"Undo": "\u64a4\u9500",
"Cut": "\u526a\u5207",
"Copy": "\u590d\u5236",
"Paste": "\u7c98\u8d34",
"Select all": "\u5168\u9009",
"New document": "\u65b0\u6587\u4ef6",
"Ok": "\u786e\u5b9a",
"Cancel": "\u53d6\u6d88",
"Visual aids": "\u7f51\u683c\u7ebf",
"Bold": "\u7c97\u4f53",
"Italic": "\u659c\u4f53",
"Underline": "\u4e0b\u5212\u7ebf",
"Strikethrough": "\u5220\u9664\u7ebf",
"Superscript": "\u4e0a\u6807",
"Subscript": "\u4e0b\u6807",
"Clear formatting": "\u6e05\u9664\u683c\u5f0f",
"Align left": "\u5de6\u8fb9\u5bf9\u9f50",
"Align center": "\u4e2d\u95f4\u5bf9\u9f50",
"Align right": "\u53f3\u8fb9\u5bf9\u9f50",
"Justify": "\u4e24\u7aef\u5bf9\u9f50",
"Bullet list": "\u9879\u76ee\u7b26\u53f7",
"Numbered list": "\u7f16\u53f7\u5217\u8868",
"Decrease indent": "\u51cf\u5c11\u7f29\u8fdb",
"Increase indent": "\u589e\u52a0\u7f29\u8fdb",
"Close": "\u5173\u95ed",
"Formats": "\u683c\u5f0f",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "\u4f60\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6253\u5f00\u526a\u8d34\u677f\uff0c\u8bf7\u4f7f\u7528Ctrl+X\/C\/V\u7b49\u5feb\u6377\u952e\u3002",
"Headers": "\u6807\u9898",
"Header 1": "\u6807\u98981",
"Header 2": "\u6807\u98982",
"Header 3": "\u6807\u98983",
"Header 4": "\u6807\u98984",
"Header 5": "\u6807\u98985",
"Header 6": "\u6807\u98986",
"Headings": "\u6807\u9898",
"Heading 1": "\u6807\u98981",
"Heading 2": "\u6807\u98982",
"Heading 3": "\u6807\u98983",
"Heading 4": "\u6807\u98984",
"Heading 5": "\u6807\u98985",
"Heading 6": "\u6807\u98986",
"Preformatted": "\u9884\u5148\u683c\u5f0f\u5316\u7684",
"Div": "Div",
"Pre": "Pre",
"Code": "\u4ee3\u7801",
"Paragraph": "\u6bb5\u843d",
"Blockquote": "\u5f15\u6587\u533a\u5757",
"Inline": "\u6587\u672c",
"Blocks": "\u57fa\u5757",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "\u5f53\u524d\u4e3a\u7eaf\u6587\u672c\u7c98\u8d34\u6a21\u5f0f\uff0c\u518d\u6b21\u70b9\u51fb\u53ef\u4ee5\u56de\u5230\u666e\u901a\u7c98\u8d34\u6a21\u5f0f\u3002",
"Fonts": "\u5b57\u4f53",
"Font Sizes": "\u5b57\u53f7",
"Class": "\u7c7b\u578b",
"Browse for an image": "\u6d4f\u89c8\u56fe\u50cf",
"OR": "\u6216",
"Drop an image here": "\u62d6\u653e\u4e00\u5f20\u56fe\u50cf\u81f3\u6b64",
"Upload": "\u4e0a\u4f20",
"Block": "\u5757",
"Align": "\u5bf9\u9f50",
"Default": "\u9ed8\u8ba4",
"Circle": "\u7a7a\u5fc3\u5706",
"Disc": "\u5b9e\u5fc3\u5706",
"Square": "\u65b9\u5757",
"Lower Alpha": "\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd",
"Lower Greek": "\u5c0f\u5199\u5e0c\u814a\u5b57\u6bcd",
"Lower Roman": "\u5c0f\u5199\u7f57\u9a6c\u5b57\u6bcd",
"Upper Alpha": "\u5927\u5199\u82f1\u6587\u5b57\u6bcd",
"Upper Roman": "\u5927\u5199\u7f57\u9a6c\u5b57\u6bcd",
"Anchor...": "\u951a\u70b9...",
"Name": "\u540d\u79f0",
"Id": "\u6807\u8bc6\u7b26",
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "\u6807\u8bc6\u7b26\u5e94\u8be5\u4ee5\u5b57\u6bcd\u5f00\u5934\uff0c\u540e\u8ddf\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u7834\u6298\u53f7\u3001\u70b9\u3001\u5192\u53f7\u6216\u4e0b\u5212\u7ebf\u3002",
"You have unsaved changes are you sure you want to navigate away?": "\u4f60\u8fd8\u6709\u6587\u6863\u5c1a\u672a\u4fdd\u5b58\uff0c\u786e\u5b9a\u8981\u79bb\u5f00\uff1f",
"Restore last draft": "\u6062\u590d\u4e0a\u6b21\u7684\u8349\u7a3f",
"Special character...": "\u7279\u6b8a\u5b57\u7b26...",
"Source code": "\u6e90\u4ee3\u7801",
"Insert\/Edit code sample": "\u63d2\u5165\/\u7f16\u8f91\u4ee3\u7801\u793a\u4f8b",
"Language": "\u8bed\u8a00",
"Code sample...": "\u793a\u4f8b\u4ee3\u7801...",
"Color Picker": "\u9009\u8272\u5668",
"R": "R",
"G": "G",
"B": "B",
"Left to right": "\u4ece\u5de6\u5230\u53f3",
"Right to left": "\u4ece\u53f3\u5230\u5de6",
"Emoticons": "\u8868\u60c5",
"Emoticons...": "\u8868\u60c5\u7b26\u53f7...",
"Metadata and Document Properties": "\u5143\u6570\u636e\u548c\u6587\u6863\u5c5e\u6027",
"Title": "\u6807\u9898",
"Keywords": "\u5173\u952e\u8bcd",
"Description": "\u63cf\u8ff0",
"Robots": "\u673a\u5668\u4eba",
"Author": "\u4f5c\u8005",
"Encoding": "\u7f16\u7801",
"Fullscreen": "\u5168\u5c4f",
"Action": "\u64cd\u4f5c",
"Shortcut": "\u5feb\u6377\u952e",
"Help": "\u5e2e\u52a9",
"Address": "\u5730\u5740",
"Focus to menubar": "\u79fb\u52a8\u7126\u70b9\u5230\u83dc\u5355\u680f",
"Focus to toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u5de5\u5177\u680f",
"Focus to element path": "\u79fb\u52a8\u7126\u70b9\u5230\u5143\u7d20\u8def\u5f84",
"Focus to contextual toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u4e0a\u4e0b\u6587\u83dc\u5355",
"Insert link (if link plugin activated)": "\u63d2\u5165\u94fe\u63a5 (\u5982\u679c\u94fe\u63a5\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Save (if save plugin activated)": "\u4fdd\u5b58(\u5982\u679c\u4fdd\u5b58\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Find (if searchreplace plugin activated)": "\u67e5\u627e(\u5982\u679c\u67e5\u627e\u66ff\u6362\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Plugins installed ({0}):": "\u5df2\u5b89\u88c5\u63d2\u4ef6 ({0}):",
"Premium plugins:": "\u4f18\u79c0\u63d2\u4ef6\uff1a",
"Learn more...": "\u4e86\u89e3\u66f4\u591a...",
"You are using {0}": "\u4f60\u6b63\u5728\u4f7f\u7528 {0}",
"Plugins": "\u63d2\u4ef6",
"Handy Shortcuts": "\u5feb\u6377\u952e",
"Horizontal line": "\u6c34\u5e73\u5206\u5272\u7ebf",
"Insert\/edit image": "\u63d2\u5165\/\u7f16\u8f91\u56fe\u7247",
"Alternative description": "\u66ff\u4ee3\u63cf\u8ff0",
"Accessibility": "\u8f85\u52a9\u529f\u80fd",
"Image is decorative": "\u56fe\u50cf\u662f\u88c5\u9970\u6027\u7684",
"Source": "\u5730\u5740",
"Dimensions": "\u5927\u5c0f",
"Constrain proportions": "\u4fdd\u6301\u7eb5\u6a2a\u6bd4",
"General": "\u666e\u901a",
"Advanced": "\u9ad8\u7ea7",
"Style": "\u6837\u5f0f",
"Vertical space": "\u5782\u76f4\u8fb9\u8ddd",
"Horizontal space": "\u6c34\u5e73\u8fb9\u8ddd",
"Border": "\u8fb9\u6846",
"Insert image": "\u63d2\u5165\u56fe\u7247",
"Image...": "\u56fe\u7247...",
"Image list": "\u56fe\u7247\u5217\u8868",
"Rotate counterclockwise": "\u9006\u65f6\u9488\u65cb\u8f6c",
"Rotate clockwise": "\u987a\u65f6\u9488\u65cb\u8f6c",
"Flip vertically": "\u5782\u76f4\u7ffb\u8f6c",
"Flip horizontally": "\u6c34\u5e73\u7ffb\u8f6c",
"Edit image": "\u7f16\u8f91\u56fe\u7247",
"Image options": "\u56fe\u7247\u9009\u9879",
"Zoom in": "\u653e\u5927",
"Zoom out": "\u7f29\u5c0f",
"Crop": "\u88c1\u526a",
"Resize": "\u8c03\u6574\u5927\u5c0f",
"Orientation": "\u65b9\u5411",
"Brightness": "\u4eae\u5ea6",
"Sharpen": "\u9510\u5316",
"Contrast": "\u5bf9\u6bd4\u5ea6",
"Color levels": "\u989c\u8272\u5c42\u6b21",
"Gamma": "\u4f3d\u9a6c\u503c",
"Invert": "\u53cd\u8f6c",
"Apply": "\u5e94\u7528",
"Back": "\u540e\u9000",
"Insert date\/time": "\u63d2\u5165\u65e5\u671f\/\u65f6\u95f4",
"Date\/time": "\u65e5\u671f\/\u65f6\u95f4",
"Insert\/edit link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5",
"Text to display": "\u663e\u793a\u6587\u5b57",
"Url": "\u5730\u5740",
"Open link in...": "\u94fe\u63a5\u6253\u5f00\u4f4d\u7f6e...",
"Current window": "\u5f53\u524d\u7a97\u53e3",
"None": "\u65e0",
"New window": "\u5728\u65b0\u7a97\u53e3\u6253\u5f00",
"Open link": "\u6253\u5f00\u94fe\u63a5",
"Remove link": "\u5220\u9664\u94fe\u63a5",
"Anchors": "\u951a\u70b9",
"Link...": "\u94fe\u63a5...",
"Paste or type a link": "\u7c98\u8d34\u6216\u8f93\u5165\u94fe\u63a5",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u4e3a\u90ae\u4ef6\u5730\u5740\uff0c\u9700\u8981\u52a0\u4e0amailto:\u524d\u7f00\u5417\uff1f",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u5c5e\u4e8e\u5916\u90e8\u94fe\u63a5\uff0c\u9700\u8981\u52a0\u4e0ahttp:\/\/:\u524d\u7f00\u5417\uff1f",
"The URL you entered seems to be an external link. Do you want to add the required https:\/\/ prefix?": "\u60a8\u8f93\u5165\u7684 URL \u4f3c\u4e4e\u662f\u4e00\u4e2a\u5916\u90e8\u94fe\u63a5\u3002\u60a8\u60f3\u6dfb\u52a0\u6240\u9700\u7684 https:\/\/ \u524d\u7f00\u5417\uff1f",
"Link list": "\u94fe\u63a5\u5217\u8868",
"Insert video": "\u63d2\u5165\u89c6\u9891",
"Insert\/edit video": "\u63d2\u5165\/\u7f16\u8f91\u89c6\u9891",
"Insert\/edit media": "\u63d2\u5165\/\u7f16\u8f91\u5a92\u4f53",
"Alternative source": "\u955c\u50cf",
"Alternative source URL": "\u66ff\u4ee3\u6765\u6e90\u7f51\u5740",
"Media poster (Image URL)": "\u5c01\u9762(\u56fe\u7247\u5730\u5740)",
"Paste your embed code below:": "\u5c06\u5185\u5d4c\u4ee3\u7801\u7c98\u8d34\u5728\u4e0b\u9762:",
"Embed": "\u5185\u5d4c",
"Media...": "\u591a\u5a92\u4f53...",
"Nonbreaking space": "\u4e0d\u95f4\u65ad\u7a7a\u683c",
"Page break": "\u5206\u9875\u7b26",
"Paste as text": "\u7c98\u8d34\u4e3a\u6587\u672c",
"Preview": "\u9884\u89c8",
"Print...": "\u6253\u5370...",
"Save": "\u4fdd\u5b58",
"Find": "\u67e5\u627e",
"Replace with": "\u66ff\u6362\u4e3a",
"Replace": "\u66ff\u6362",
"Replace all": "\u5168\u90e8\u66ff\u6362",
"Previous": "\u4e0a\u4e00\u4e2a",
"Next": "\u4e0b\u4e00\u4e2a",
"Find and Replace": "\u67e5\u627e\u548c\u66ff\u6362",
"Find and replace...": "\u67e5\u627e\u5e76\u66ff\u6362...",
"Could not find the specified string.": "\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9.",
"Match case": "\u533a\u5206\u5927\u5c0f\u5199",
"Find whole words only": "\u5168\u5b57\u5339\u914d",
"Find in selection": "\u5728\u9009\u533a\u4e2d\u67e5\u627e",
"Spellcheck": "\u62fc\u5199\u68c0\u67e5",
"Spellcheck Language": "\u62fc\u5199\u68c0\u67e5\u8bed\u8a00",
"No misspellings found.": "\u6ca1\u6709\u53d1\u73b0\u62fc\u5199\u9519\u8bef",
"Ignore": "\u5ffd\u7565",
"Ignore all": "\u5168\u90e8\u5ffd\u7565",
"Finish": "\u5b8c\u6210",
"Add to Dictionary": "\u6dfb\u52a0\u5230\u5b57\u5178",
"Insert table": "\u63d2\u5165\u8868\u683c",
"Table properties": "\u8868\u683c\u5c5e\u6027",
"Delete table": "\u5220\u9664\u8868\u683c",
"Cell": "\u5355\u5143\u683c",
"Row": "\u884c",
"Column": "\u5217",
"Cell properties": "\u5355\u5143\u683c\u5c5e\u6027",
"Merge cells": "\u5408\u5e76\u5355\u5143\u683c",
"Split cell": "\u62c6\u5206\u5355\u5143\u683c",
"Insert row before": "\u5728\u4e0a\u65b9\u63d2\u5165",
"Insert row after": "\u5728\u4e0b\u65b9\u63d2\u5165",
"Delete row": "\u5220\u9664\u884c",
"Row properties": "\u884c\u5c5e\u6027",
"Cut row": "\u526a\u5207\u884c",
"Copy row": "\u590d\u5236\u884c",
"Paste row before": "\u7c98\u8d34\u5230\u4e0a\u65b9",
"Paste row after": "\u7c98\u8d34\u5230\u4e0b\u65b9",
"Insert column before": "\u5728\u5de6\u4fa7\u63d2\u5165",
"Insert column after": "\u5728\u53f3\u4fa7\u63d2\u5165",
"Delete column": "\u5220\u9664\u5217",
"Cols": "\u5217",
"Rows": "\u884c",
"Width": "\u5bbd",
"Height": "\u9ad8",
"Cell spacing": "\u5355\u5143\u683c\u5916\u95f4\u8ddd",
"Cell padding": "\u5355\u5143\u683c\u5185\u8fb9\u8ddd",
"Caption": "\u6807\u9898",
"Show caption": "\u663e\u793a\u6807\u9898",
"Left": "\u5de6\u5bf9\u9f50",
"Center": "\u5c45\u4e2d",
"Right": "\u53f3\u5bf9\u9f50",
"Cell type": "\u5355\u5143\u683c\u7c7b\u578b",
"Scope": "\u8303\u56f4",
"Alignment": "\u5bf9\u9f50\u65b9\u5f0f",
"H Align": "\u6c34\u5e73\u5bf9\u9f50",
"V Align": "\u5782\u76f4\u5bf9\u9f50",
"Top": "\u9876\u90e8\u5bf9\u9f50",
"Middle": "\u5782\u76f4\u5c45\u4e2d",
"Bottom": "\u5e95\u90e8\u5bf9\u9f50",
"Header cell": "\u8868\u5934\u5355\u5143\u683c",
"Row group": "\u884c\u7ec4",
"Column group": "\u5217\u7ec4",
"Row type": "\u884c\u7c7b\u578b",
"Header": "\u8868\u5934",
"Body": "\u8868\u4f53",
"Footer": "\u8868\u5c3e",
"Border color": "\u8fb9\u6846\u989c\u8272",
"Insert template...": "\u63d2\u5165\u6a21\u677f...",
"Templates": "\u6a21\u677f",
"Template": "\u6a21\u677f",
"Text color": "\u6587\u5b57\u989c\u8272",
"Background color": "\u80cc\u666f\u8272",
"Custom...": "\u81ea\u5b9a\u4e49...",
"Custom color": "\u81ea\u5b9a\u4e49\u989c\u8272",
"No color": "\u65e0",
"Remove color": "\u79fb\u9664\u989c\u8272",
"Table of Contents": "\u5185\u5bb9\u5217\u8868",
"Show blocks": "\u663e\u793a\u533a\u5757\u8fb9\u6846",
"Show invisible characters": "\u663e\u793a\u4e0d\u53ef\u89c1\u5b57\u7b26",
"Word count": "\u5b57\u6570",
"Count": "\u8ba1\u6570",
"Document": "\u6587\u6863",
"Selection": "\u9009\u62e9",
"Words": "\u5355\u8bcd",
"Words: {0}": "\u5b57\u6570\uff1a{0}",
"{0} words": "{0} \u5b57",
"File": "\u6587\u4ef6",
"Edit": "\u7f16\u8f91",
"Insert": "\u63d2\u5165",
"View": "\u89c6\u56fe",
"Format": "\u683c\u5f0f",
"Table": "\u8868\u683c",
"Tools": "\u5de5\u5177",
"Powered by {0}": "\u7531{0}\u9a71\u52a8",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "\u5728\u7f16\u8f91\u533a\u6309ALT-F9\u6253\u5f00\u83dc\u5355\uff0c\u6309ALT-F10\u6253\u5f00\u5de5\u5177\u680f\uff0c\u6309ALT-0\u67e5\u770b\u5e2e\u52a9",
"Image title": "\u56fe\u7247\u6807\u9898",
"Border width": "\u8fb9\u6846\u5bbd\u5ea6",
"Border style": "\u8fb9\u6846\u6837\u5f0f",
"Error": "\u9519\u8bef",
"Warn": "\u8b66\u544a",
"Valid": "\u6709\u6548",
"To open the popup, press Shift+Enter": "\u6309Shitf+Enter\u952e\u6253\u5f00\u5bf9\u8bdd\u6846",
"Rich Text Area. Press ALT-0 for help.": "\u7f16\u8f91\u533a\u3002\u6309Alt+0\u952e\u6253\u5f00\u5e2e\u52a9\u3002",
"System Font": "\u7cfb\u7edf\u5b57\u4f53",
"Failed to upload image: {0}": "\u56fe\u7247\u4e0a\u4f20\u5931\u8d25: {0}",
"Failed to load plugin: {0} from url {1}": "\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25: {0} \u6765\u81ea\u94fe\u63a5 {1}",
"Failed to load plugin url: {0}": "\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25 \u94fe\u63a5: {0}",
"Failed to initialize plugin: {0}": "\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25: {0}",
"example": "\u793a\u4f8b",
"Search": "\u641c\u7d22",
"All": "\u5168\u90e8",
"Currency": "\u8d27\u5e01",
"Text": "\u6587\u5b57",
"Quotations": "\u5f15\u7528",
"Mathematical": "\u6570\u5b66",
"Extended Latin": "\u62c9\u4e01\u8bed\u6269\u5145",
"Symbols": "\u7b26\u53f7",
"Arrows": "\u7bad\u5934",
"User Defined": "\u81ea\u5b9a\u4e49",
"dollar sign": "\u7f8e\u5143\u7b26\u53f7",
"currency sign": "\u8d27\u5e01\u7b26\u53f7",
"euro-currency sign": "\u6b27\u5143\u7b26\u53f7",
"colon sign": "\u5192\u53f7",
"cruzeiro sign": "\u514b\u9c81\u8d5b\u7f57\u5e01\u7b26\u53f7",
"french franc sign": "\u6cd5\u90ce\u7b26\u53f7",
"lira sign": "\u91cc\u62c9\u7b26\u53f7",
"mill sign": "\u5bc6\u5c14\u7b26\u53f7",
"naira sign": "\u5948\u62c9\u7b26\u53f7",
"peseta sign": "\u6bd4\u585e\u5854\u7b26\u53f7",
"rupee sign": "\u5362\u6bd4\u7b26\u53f7",
"won sign": "\u97e9\u5143\u7b26\u53f7",
"new sheqel sign": "\u65b0\u8c22\u514b\u5c14\u7b26\u53f7",
"dong sign": "\u8d8a\u5357\u76fe\u7b26\u53f7",
"kip sign": "\u8001\u631d\u57fa\u666e\u7b26\u53f7",
"tugrik sign": "\u56fe\u683c\u91cc\u514b\u7b26\u53f7",
"drachma sign": "\u5fb7\u62c9\u514b\u9a6c\u7b26\u53f7",
"german penny symbol": "\u5fb7\u56fd\u4fbf\u58eb\u7b26\u53f7",
"peso sign": "\u6bd4\u7d22\u7b26\u53f7",
"guarani sign": "\u74dc\u62c9\u5c3c\u7b26\u53f7",
"austral sign": "\u6fb3\u5143\u7b26\u53f7",
"hryvnia sign": "\u683c\u91cc\u592b\u5c3c\u4e9a\u7b26\u53f7",
"cedi sign": "\u585e\u5730\u7b26\u53f7",
"livre tournois sign": "\u91cc\u5f17\u5f17\u5c14\u7b26\u53f7",
"spesmilo sign": "spesmilo\u7b26\u53f7",
"tenge sign": "\u575a\u6208\u7b26\u53f7",
"indian rupee sign": "\u5370\u5ea6\u5362\u6bd4",
"turkish lira sign": "\u571f\u8033\u5176\u91cc\u62c9",
"nordic mark sign": "\u5317\u6b27\u9a6c\u514b",
"manat sign": "\u9a6c\u7eb3\u7279\u7b26\u53f7",
"ruble sign": "\u5362\u5e03\u7b26\u53f7",
"yen character": "\u65e5\u5143\u5b57\u6837",
"yuan character": "\u4eba\u6c11\u5e01\u5143\u5b57\u6837",
"yuan character, in hong kong and taiwan": "\u5143\u5b57\u6837\uff08\u6e2f\u53f0\u5730\u533a\uff09",
"yen\/yuan character variant one": "\u5143\u5b57\u6837\uff08\u5927\u5199\uff09",
"Loading emoticons...": "\u52a0\u8f7d\u8868\u60c5\u7b26\u53f7...",
"Could not load emoticons": "\u4e0d\u80fd\u52a0\u8f7d\u8868\u60c5\u7b26\u53f7",
"People": "\u4eba\u7c7b",
"Animals and Nature": "\u52a8\u7269\u548c\u81ea\u7136",
"Food and Drink": "\u98df\u7269\u548c\u996e\u54c1",
"Activity": "\u6d3b\u52a8",
"Travel and Places": "\u65c5\u6e38\u548c\u5730\u70b9",
"Objects": "\u7269\u4ef6",
"Flags": "\u65d7\u5e1c",
"Characters": "\u5b57\u7b26",
"Characters (no spaces)": "\u5b57\u7b26(\u65e0\u7a7a\u683c)",
"{0} characters": "{0} \u4e2a\u5b57\u7b26",
"Error: Form submit field collision.": "\u9519\u8bef: \u8868\u5355\u63d0\u4ea4\u5b57\u6bb5\u51b2\u7a81\u3002",
"Error: No form element found.": "\u9519\u8bef: \u6ca1\u6709\u8868\u5355\u63a7\u4ef6\u3002",
"Update": "\u66f4\u65b0",
"Color swatch": "\u989c\u8272\u6837\u672c",
"Turquoise": "\u9752\u7eff\u8272",
"Green": "\u7eff\u8272",
"Blue": "\u84dd\u8272",
"Purple": "\u7d2b\u8272",
"Navy Blue": "\u6d77\u519b\u84dd",
"Dark Turquoise": "\u6df1\u84dd\u7eff\u8272",
"Dark Green": "\u6df1\u7eff\u8272",
"Medium Blue": "\u4e2d\u84dd\u8272",
"Medium Purple": "\u4e2d\u7d2b\u8272",
"Midnight Blue": "\u6df1\u84dd\u8272",
"Yellow": "\u9ec4\u8272",
"Orange": "\u6a59\u8272",
"Red": "\u7ea2\u8272",
"Light Gray": "\u6d45\u7070\u8272",
"Gray": "\u7070\u8272",
"Dark Yellow": "\u6697\u9ec4\u8272",
"Dark Orange": "\u6df1\u6a59\u8272",
"Dark Red": "\u6df1\u7ea2\u8272",
"Medium Gray": "\u4e2d\u7070\u8272",
"Dark Gray": "\u6df1\u7070\u8272",
"Light Green": "\u6d45\u7eff\u8272",
"Light Yellow": "\u6d45\u9ec4\u8272",
"Light Red": "\u6d45\u7ea2\u8272",
"Light Purple": "\u6d45\u7d2b\u8272",
"Light Blue": "\u6d45\u84dd\u8272",
"Dark Purple": "\u6df1\u7d2b\u8272",
"Dark Blue": "\u6df1\u84dd\u8272",
"Black": "\u9ed1\u8272",
"White": "\u767d\u8272",
"Switch to or from fullscreen mode": "\u5207\u6362\u5168\u5c4f\u6a21\u5f0f",
"Open help dialog": "\u6253\u5f00\u5e2e\u52a9\u5bf9\u8bdd\u6846",
"history": "\u5386\u53f2",
"styles": "\u6837\u5f0f",
"formatting": "\u683c\u5f0f\u5316",
"alignment": "\u5bf9\u9f50",
"indentation": "\u7f29\u8fdb",
"Font": "\u5b57\u4f53",
"Size": "\u5b57\u53f7",
"More...": "\u66f4\u591a...",
"Select...": "\u9009\u62e9...",
"Preferences": "\u9996\u9009\u9879",
"Yes": "\u662f",
"No": "\u5426",
"Keyboard Navigation": "\u952e\u76d8\u6307\u5f15",
"Version": "\u7248\u672c",
"Code view": "\u4ee3\u7801\u89c6\u56fe",
"Open popup menu for split buttons": "\u6253\u5f00\u5f39\u51fa\u5f0f\u83dc\u5355\uff0c\u7528\u4e8e\u62c6\u5206\u6309\u94ae",
"List Properties": "\u5217\u8868\u5c5e\u6027",
"List properties...": "\u6807\u9898\u5b57\u4f53\u5c5e\u6027",
"Start list at number": "\u4ee5\u6570\u5b57\u5f00\u59cb\u5217\u8868",
"Line height": "\u884c\u9ad8",
"comments": "\u5907\u6ce8",
"Format Painter": "\u683c\u5f0f\u5237",
"Insert\/edit iframe": "\u63d2\u5165\/\u7f16\u8f91\u6846\u67b6",
"Capitalization": "\u5927\u5199",
"lowercase": "\u5c0f\u5199",
"UPPERCASE": "\u5927\u5199",
"Title Case": "\u9996\u5b57\u6bcd\u5927\u5199",
"permanent pen": "\u8bb0\u53f7\u7b14",
"Permanent Pen Properties": "\u6c38\u4e45\u7b14\u5c5e\u6027",
"Permanent pen properties...": "\u6c38\u4e45\u7b14\u5c5e\u6027...",
"case change": "\u6848\u4f8b\u66f4\u6539",
"page embed": "\u9875\u9762\u5d4c\u5165",
"Advanced sort...": "\u9ad8\u7ea7\u6392\u5e8f...",
"Advanced Sort": "\u9ad8\u7ea7\u6392\u5e8f",
"Sort table by column ascending": "\u6309\u5217\u5347\u5e8f\u8868",
"Sort table by column descending": "\u6309\u5217\u964d\u5e8f\u8868",
"Sort": "\u6392\u5e8f",
"Order": "\u6392\u5e8f",
"Sort by": "\u6392\u5e8f\u65b9\u5f0f",
"Ascending": "\u5347\u5e8f",
"Descending": "\u964d\u5e8f",
"Column {0}": "\u5217{0}",
"Row {0}": "\u884c{0}",
"Spellcheck...": "\u62fc\u5199\u68c0\u67e5...",
"Misspelled word": "\u62fc\u5199\u9519\u8bef\u7684\u5355\u8bcd",
"Suggestions": "\u5efa\u8bae",
"Change": "\u66f4\u6539",
"Finding word suggestions": "\u67e5\u627e\u5355\u8bcd\u5efa\u8bae",
"Success": "\u6210\u529f",
"Repair": "\u4fee\u590d",
"Issue {0} of {1}": "\u5171\u8ba1{1}\u95ee\u9898{0}",
"Images must be marked as decorative or have an alternative text description": "\u56fe\u50cf\u5fc5\u987b\u6807\u8bb0\u4e3a\u88c5\u9970\u6027\u6216\u5177\u6709\u66ff\u4ee3\u6587\u672c\u63cf\u8ff0",
"Images must have an alternative text description. Decorative images are not allowed.": "\u56fe\u50cf\u5fc5\u987b\u5177\u6709\u66ff\u4ee3\u6587\u672c\u63cf\u8ff0\u3002\u4e0d\u5141\u8bb8\u4f7f\u7528\u88c5\u9970\u56fe\u50cf\u3002",
"Or provide alternative text:": "\u6216\u63d0\u4f9b\u5907\u9009\u6587\u672c\uff1a",
"Make image decorative:": "\u4f7f\u56fe\u50cf\u88c5\u9970\uff1a",
"ID attribute must be unique": "ID \u5c5e\u6027\u5fc5\u987b\u662f\u552f\u4e00\u7684",
"Make ID unique": "\u4f7f ID \u72ec\u4e00\u65e0\u4e8c",
"Keep this ID and remove all others": "\u4fdd\u7559\u6b64 ID \u5e76\u5220\u9664\u6240\u6709\u5176\u4ed6",
"Remove this ID": "\u5220\u9664\u6b64 ID",
"Remove all IDs": "\u6e05\u9664\u5168\u90e8IDs",
"Checklist": "\u6e05\u5355",
"Anchor": "\u951a\u70b9",
"Special character": "\u7279\u6b8a\u7b26\u53f7",
"Code sample": "\u4ee3\u7801\u793a\u4f8b",
"Color": "\u989c\u8272",
"Document properties": "\u6587\u6863\u5c5e\u6027",
"Image description": "\u56fe\u7247\u63cf\u8ff0",
"Image": "\u56fe\u7247",
"Insert link": "\u63d2\u5165\u94fe\u63a5",
"Target": "\u6253\u5f00\u65b9\u5f0f",
"Link": "\u94fe\u63a5",
"Poster": "\u5c01\u9762",
"Media": "\u5a92\u4f53",
"Print": "\u6253\u5370",
"Prev": "\u4e0a\u4e00\u4e2a",
"Find and replace": "\u67e5\u627e\u548c\u66ff\u6362",
"Whole words": "\u5168\u5b57\u5339\u914d",
"Insert template": "\u63d2\u5165\u6a21\u677f"
});

View File

@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -0,0 +1,52 @@
{
"_from": "tinymce@4",
"_id": "tinymce@4.9.11",
"_inBundle": false,
"_integrity": "sha1-49rgmXIilMW42Eun7xjdEm3mtYI=",
"_location": "/tinymce",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "tinymce@4",
"name": "tinymce",
"escapedName": "tinymce",
"rawSpec": "4",
"saveSpec": null,
"fetchSpec": "4"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmmirror.com/tinymce/download/tinymce-4.9.11.tgz?cache=0&sync_timestamp=1637123728362&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Ftinymce%2Fdownload%2Ftinymce-4.9.11.tgz",
"_shasum": "e3dae099722294c5b8d84ba7ef18dd126de6b582",
"_spec": "tinymce@4",
"_where": "E:\\work\\hlzqtgadminwebserver",
"author": {
"name": "Ephox Corporation"
},
"bugs": {
"url": "https://github.com/tinymce/tinymce/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Web based JavaScript HTML WYSIWYG editor control.",
"homepage": "https://github.com/tinymce/tinymce-dist#readme",
"keywords": [
"editor",
"wysiwyg",
"tinymce",
"richtext",
"javascript",
"html"
],
"license": "LGPL-2.1",
"main": "tinymce.js",
"name": "tinymce",
"repository": {
"type": "git",
"url": "git+https://github.com/tinymce/tinymce-dist.git"
},
"version": "4.9.11"
}

View File

@ -0,0 +1,7 @@
// Exports the "advlist" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/advlist')
// ES2015:
// import 'tinymce/plugins/advlist'
require('./plugin.js');

View File

@ -0,0 +1,160 @@
(function () {
var advlist = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var applyListFormat = function (editor, listName, styleValue) {
var cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList';
editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue });
};
var Actions = { applyListFormat: applyListFormat };
var register = function (editor) {
editor.addCommand('ApplyUnorderedListStyle', function (ui, value) {
Actions.applyListFormat(editor, 'UL', value['list-style-type']);
});
editor.addCommand('ApplyOrderedListStyle', function (ui, value) {
Actions.applyListFormat(editor, 'OL', value['list-style-type']);
});
};
var Commands = { register: register };
var getNumberStyles = function (editor) {
var styles = editor.getParam('advlist_number_styles', 'default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman');
return styles ? styles.split(/[ ,]/) : [];
};
var getBulletStyles = function (editor) {
var styles = editor.getParam('advlist_bullet_styles', 'default,circle,disc,square');
return styles ? styles.split(/[ ,]/) : [];
};
var Settings = {
getNumberStyles: getNumberStyles,
getBulletStyles: getBulletStyles
};
var isChildOfBody = function (editor, elm) {
return editor.$.contains(editor.getBody(), elm);
};
var isTableCellNode = function (node) {
return node && /^(TH|TD)$/.test(node.nodeName);
};
var isListNode = function (editor) {
return function (node) {
return node && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node);
};
};
var getSelectedStyleType = function (editor) {
var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
return editor.dom.getStyle(listElm, 'listStyleType') || '';
};
var ListUtils = {
isTableCellNode: isTableCellNode,
isListNode: isListNode,
getSelectedStyleType: getSelectedStyleType
};
var styleValueToText = function (styleValue) {
return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function (chr) {
return chr.toUpperCase();
});
};
var toMenuItems = function (styles) {
return global$1.map(styles, function (styleValue) {
var text = styleValueToText(styleValue);
var data = styleValue === 'default' ? '' : styleValue;
return {
text: text,
data: data
};
});
};
var ListStyles = { toMenuItems: toMenuItems };
var findIndex = function (list, predicate) {
for (var index = 0; index < list.length; index++) {
var element = list[index];
if (predicate(element)) {
return index;
}
}
return -1;
};
var listState = function (editor, listName) {
return function (e) {
var ctrl = e.control;
editor.on('NodeChange', function (e) {
var tableCellIndex = findIndex(e.parents, ListUtils.isTableCellNode);
var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents;
var lists = global$1.grep(parents, ListUtils.isListNode(editor));
ctrl.active(lists.length > 0 && lists[0].nodeName === listName);
});
};
};
var updateSelection = function (editor) {
return function (e) {
var listStyleType = ListUtils.getSelectedStyleType(editor);
e.control.items().each(function (ctrl) {
ctrl.active(ctrl.settings.data === listStyleType);
});
};
};
var addSplitButton = function (editor, id, tooltip, cmd, nodeName, styles) {
editor.addButton(id, {
active: false,
type: 'splitbutton',
tooltip: tooltip,
menu: ListStyles.toMenuItems(styles),
onPostRender: listState(editor, nodeName),
onshow: updateSelection(editor),
onselect: function (e) {
Actions.applyListFormat(editor, nodeName, e.control.settings.data);
},
onclick: function () {
editor.execCommand(cmd);
}
});
};
var addButton = function (editor, id, tooltip, cmd, nodeName, styles) {
editor.addButton(id, {
active: false,
type: 'button',
tooltip: tooltip,
onPostRender: listState(editor, nodeName),
onclick: function () {
editor.execCommand(cmd);
}
});
};
var addControl = function (editor, id, tooltip, cmd, nodeName, styles) {
if (styles.length > 0) {
addSplitButton(editor, id, tooltip, cmd, nodeName, styles);
} else {
addButton(editor, id, tooltip, cmd, nodeName);
}
};
var register$1 = function (editor) {
addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', Settings.getNumberStyles(editor));
addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', Settings.getBulletStyles(editor));
};
var Buttons = { register: register$1 };
global.add('advlist', function (editor) {
var hasPlugin = function (editor, plugin) {
var plugins = editor.settings.plugins ? editor.settings.plugins : '';
return global$1.inArray(plugins.split(/[ ,]/), plugin) !== -1;
};
if (hasPlugin(editor, 'lists')) {
Buttons.register(editor);
Commands.register(editor);
}
});
function Plugin () {
}
return Plugin;
}());
})();

View File

@ -0,0 +1 @@
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},o=function(n){n.addCommand("ApplyUnorderedListStyle",function(t,e){s(n,"UL",e["list-style-type"])}),n.addCommand("ApplyOrderedListStyle",function(t,e){s(n,"OL",e["list-style-type"])})},e=function(t){var e=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return e?e.split(/[ ,]/):[]},n=function(t){var e=t.getParam("advlist_bullet_styles","default,circle,disc,square");return e?e.split(/[ ,]/):[]},u=function(t){return t&&/^(TH|TD)$/.test(t.nodeName)},c=function(r){return function(t){return t&&/^(OL|UL|DL)$/.test(t.nodeName)&&(n=t,(e=r).$.contains(e.getBody(),n));var e,n}},d=function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul");return t.dom.getStyle(e,"listStyleType")||""},p=function(t){return a.map(t,function(t){return{text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()}),data:"default"===t?"":t}})},f=function(i,l){return function(t){var o=t.control;i.on("NodeChange",function(t){var e=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}(t.parents,u),n=-1!==e?t.parents.slice(0,e):t.parents,r=a.grep(n,c(i));o.active(0<r.length&&r[0].nodeName===l)})}},m=function(e,t,n,r,o,i){var l;e.addButton(t,{active:!1,type:"splitbutton",tooltip:n,menu:p(i),onPostRender:f(e,o),onshow:(l=e,function(t){var e=d(l);t.control.items().each(function(t){t.active(t.settings.data===e)})}),onselect:function(t){s(e,o,t.control.settings.data)},onclick:function(){e.execCommand(r)}})},r=function(t,e,n,r,o,i){var l,a,s,u,c;0<i.length?m(t,e,n,r,o,i):(a=e,s=n,u=r,c=o,(l=t).addButton(a,{active:!1,type:"button",tooltip:s,onPostRender:f(l,c),onclick:function(){l.execCommand(u)}}))},i=function(t){r(t,"numlist","Numbered list","InsertOrderedList","OL",e(t)),r(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))};t.add("advlist",function(t){var e,n,r;n="lists",r=(e=t).settings.plugins?e.settings.plugins:"",-1!==a.inArray(r.split(/[ ,]/),n)&&(i(t),o(t))})}();

View File

@ -0,0 +1,7 @@
// Exports the "anchor" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/anchor')
// ES2015:
// import 'tinymce/plugins/anchor'
require('./plugin.js');

View File

@ -0,0 +1,118 @@
(function () {
var anchor = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var isValidId = function (id) {
return /^[A-Za-z][A-Za-z0-9\-:._]*$/.test(id);
};
var getId = function (editor) {
var selectedNode = editor.selection.getNode();
var isAnchor = selectedNode.tagName === 'A' && editor.dom.getAttrib(selectedNode, 'href') === '';
return isAnchor ? selectedNode.id || selectedNode.name : '';
};
var insert = function (editor, id) {
var selectedNode = editor.selection.getNode();
var isAnchor = selectedNode.tagName === 'A' && editor.dom.getAttrib(selectedNode, 'href') === '';
if (isAnchor) {
selectedNode.removeAttribute('name');
selectedNode.id = id;
editor.undoManager.add();
} else {
editor.focus();
editor.selection.collapse(true);
editor.execCommand('mceInsertContent', false, editor.dom.createHTML('a', { id: id }));
}
};
var Anchor = {
isValidId: isValidId,
getId: getId,
insert: insert
};
var insertAnchor = function (editor, newId) {
if (!Anchor.isValidId(newId)) {
editor.windowManager.alert('Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.');
return true;
} else {
Anchor.insert(editor, newId);
return false;
}
};
var open = function (editor) {
var currentId = Anchor.getId(editor);
editor.windowManager.open({
title: 'Anchor',
body: {
type: 'textbox',
name: 'id',
size: 40,
label: 'Id',
value: currentId
},
onsubmit: function (e) {
var newId = e.data.id;
if (insertAnchor(editor, newId)) {
e.preventDefault();
}
}
});
};
var Dialog = { open: open };
var register = function (editor) {
editor.addCommand('mceAnchor', function () {
Dialog.open(editor);
});
};
var Commands = { register: register };
var isAnchorNode = function (node) {
return !node.attr('href') && (node.attr('id') || node.attr('name')) && !node.firstChild;
};
var setContentEditable = function (state) {
return function (nodes) {
for (var i = 0; i < nodes.length; i++) {
if (isAnchorNode(nodes[i])) {
nodes[i].attr('contenteditable', state);
}
}
};
};
var setup = function (editor) {
editor.on('PreInit', function () {
editor.parser.addNodeFilter('a', setContentEditable('false'));
editor.serializer.addNodeFilter('a', setContentEditable(null));
});
};
var FilterContent = { setup: setup };
var register$1 = function (editor) {
editor.addButton('anchor', {
icon: 'anchor',
tooltip: 'Anchor',
cmd: 'mceAnchor',
stateSelector: 'a:not([href])'
});
editor.addMenuItem('anchor', {
icon: 'anchor',
text: 'Anchor',
context: 'insert',
cmd: 'mceAnchor'
});
};
var Buttons = { register: register$1 };
global.add('anchor', function (editor) {
FilterContent.setup(editor);
Commands.register(editor);
Buttons.register(editor);
});
function Plugin () {
}
return Plugin;
}());
})();

View File

@ -0,0 +1 @@
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},e=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.id||e.name:""},i=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e,t.undoManager.add()):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},n=function(r){var t=e(r);r.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:t},onsubmit:function(t){var e,n,o=t.data.id;e=r,(a(n=o)?(i(e,n),0):(e.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))&&t.preventDefault()}})},o=function(t){t.addCommand("mceAnchor",function(){n(t)})},r=function(o){return function(t){for(var e=0;e<t.length;e++)(n=t[e]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||t[e].attr("contenteditable",o);var n}},c=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",r("false")),t.serializer.addNodeFilter("a",r(null))})},d=function(t){t.addButton("anchor",{icon:"anchor",tooltip:"Anchor",cmd:"mceAnchor",stateSelector:"a:not([href])"}),t.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",cmd:"mceAnchor"})};t.add("anchor",function(t){c(t),o(t),d(t)})}();

View File

@ -0,0 +1,7 @@
// Exports the "autolink" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/autolink')
// ES2015:
// import 'tinymce/plugins/autolink'
require('./plugin.js');

View File

@ -0,0 +1,180 @@
(function () {
var autolink = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var getAutoLinkPattern = function (editor) {
return editor.getParam('autolink_pattern', /^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i);
};
var getDefaultLinkTarget = function (editor) {
return editor.getParam('default_link_target', '');
};
var Settings = {
getAutoLinkPattern: getAutoLinkPattern,
getDefaultLinkTarget: getDefaultLinkTarget
};
var rangeEqualsDelimiterOrSpace = function (rangeString, delimiter) {
return rangeString === delimiter || rangeString === ' ' || rangeString.charCodeAt(0) === 160;
};
var handleEclipse = function (editor) {
parseCurrentLine(editor, -1, '(');
};
var handleSpacebar = function (editor) {
parseCurrentLine(editor, 0, '');
};
var handleEnter = function (editor) {
parseCurrentLine(editor, -1, '');
};
var scopeIndex = function (container, index) {
if (index < 0) {
index = 0;
}
if (container.nodeType === 3) {
var len = container.data.length;
if (index > len) {
index = len;
}
}
return index;
};
var setStart = function (rng, container, offset) {
if (container.nodeType !== 1 || container.hasChildNodes()) {
rng.setStart(container, scopeIndex(container, offset));
} else {
rng.setStartBefore(container);
}
};
var setEnd = function (rng, container, offset) {
if (container.nodeType !== 1 || container.hasChildNodes()) {
rng.setEnd(container, scopeIndex(container, offset));
} else {
rng.setEndAfter(container);
}
};
var parseCurrentLine = function (editor, endOffset, delimiter) {
var rng, end, start, endContainer, bookmark, text, matches, prev, len, rngText;
var autoLinkPattern = Settings.getAutoLinkPattern(editor);
var defaultLinkTarget = Settings.getDefaultLinkTarget(editor);
if (editor.selection.getNode().tagName === 'A') {
return;
}
rng = editor.selection.getRng(true).cloneRange();
if (rng.startOffset < 5) {
prev = rng.endContainer.previousSibling;
if (!prev) {
if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) {
return;
}
prev = rng.endContainer.firstChild.nextSibling;
}
len = prev.length;
setStart(rng, prev, len);
setEnd(rng, prev, len);
if (rng.endOffset < 5) {
return;
}
end = rng.endOffset;
endContainer = prev;
} else {
endContainer = rng.endContainer;
if (endContainer.nodeType !== 3 && endContainer.firstChild) {
while (endContainer.nodeType !== 3 && endContainer.firstChild) {
endContainer = endContainer.firstChild;
}
if (endContainer.nodeType === 3) {
setStart(rng, endContainer, 0);
setEnd(rng, endContainer, endContainer.nodeValue.length);
}
}
if (rng.endOffset === 1) {
end = 2;
} else {
end = rng.endOffset - 1 - endOffset;
}
}
start = end;
do {
setStart(rng, endContainer, end >= 2 ? end - 2 : 0);
setEnd(rng, endContainer, end >= 1 ? end - 1 : 0);
end -= 1;
rngText = rng.toString();
} while (rngText !== ' ' && rngText !== '' && rngText.charCodeAt(0) !== 160 && end - 2 >= 0 && rngText !== delimiter);
if (rangeEqualsDelimiterOrSpace(rng.toString(), delimiter)) {
setStart(rng, endContainer, end);
setEnd(rng, endContainer, start);
end += 1;
} else if (rng.startOffset === 0) {
setStart(rng, endContainer, 0);
setEnd(rng, endContainer, start);
} else {
setStart(rng, endContainer, end);
setEnd(rng, endContainer, start);
}
text = rng.toString();
if (text.charAt(text.length - 1) === '.') {
setEnd(rng, endContainer, start - 1);
}
text = rng.toString().trim();
matches = text.match(autoLinkPattern);
if (matches) {
if (matches[1] === 'www.') {
matches[1] = 'http://www.';
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
matches[1] = 'mailto:' + matches[1];
}
bookmark = editor.selection.getBookmark();
editor.selection.setRng(rng);
editor.execCommand('createlink', false, matches[1] + matches[2]);
if (defaultLinkTarget) {
editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget);
}
editor.selection.moveToBookmark(bookmark);
editor.nodeChanged();
}
};
var setup = function (editor) {
var autoUrlDetectState;
editor.on('keydown', function (e) {
if (e.keyCode === 13) {
return handleEnter(editor);
}
});
if (global$1.ie) {
editor.on('focus', function () {
if (!autoUrlDetectState) {
autoUrlDetectState = true;
try {
editor.execCommand('AutoUrlDetect', false, true);
} catch (ex) {
}
}
});
return;
}
editor.on('keypress', function (e) {
if (e.keyCode === 41) {
return handleEclipse(editor);
}
});
editor.on('keyup', function (e) {
if (e.keyCode === 32) {
return handleSpacebar(editor);
}
});
};
var Keys = { setup: setup };
global.add('autolink', function (editor) {
Keys.setup(editor);
});
function Plugin () {
}
return Plugin;
}());
})();

View File

@ -0,0 +1 @@
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.Env"),m=function(e){return e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i)},y=function(e){return e.getParam("default_link_target","")},o=function(e,t){if(t<0&&(t=0),3===e.nodeType){var n=e.data.length;n<t&&(t=n)}return t},k=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)},p=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)},r=function(e,t,n){var i,o,r,a,f,s,d,l,c,u,g=m(e),h=y(e);if("A"!==e.selection.getNode().tagName){if((i=e.selection.getRng(!0).cloneRange()).startOffset<5){if(!(l=i.endContainer.previousSibling)){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;l=i.endContainer.firstChild.nextSibling}if(c=l.length,k(i,l,c),p(i,l,c),i.endOffset<5)return;o=i.endOffset,a=l}else{if(3!==(a=i.endContainer).nodeType&&a.firstChild){for(;3!==a.nodeType&&a.firstChild;)a=a.firstChild;3===a.nodeType&&(k(i,a,0),p(i,a,a.nodeValue.length))}o=1===i.endOffset?2:i.endOffset-1-t}for(r=o;k(i,a,2<=o?o-2:0),p(i,a,1<=o?o-1:0),o-=1," "!==(u=i.toString())&&""!==u&&160!==u.charCodeAt(0)&&0<=o-2&&u!==n;);var C;(C=i.toString())===n||" "===C||160===C.charCodeAt(0)?(k(i,a,o),p(i,a,r),o+=1):(0===i.startOffset?k(i,a,0):k(i,a,o),p(i,a,r)),"."===(s=i.toString()).charAt(s.length-1)&&p(i,a,r-1),(d=(s=i.toString().trim()).match(g))&&("www."===d[1]?d[1]="http://www.":/@$/.test(d[1])&&!/^mailto:/.test(d[1])&&(d[1]="mailto:"+d[1]),f=e.selection.getBookmark(),e.selection.setRng(i),e.execCommand("createlink",!1,d[1]+d[2]),h&&e.dom.setAttrib(e.selection.getNode(),"target",h),e.selection.moveToBookmark(f),e.nodeChanged())}},t=function(t){var n;t.on("keydown",function(e){13!==e.keyCode||r(t,-1,"")}),i.ie?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){41!==e.keyCode||r(t,-1,"(")}),t.on("keyup",function(e){32!==e.keyCode||r(t,0,"")}))};e.add("autolink",function(e){t(e)})}();

View File

@ -0,0 +1,7 @@
// Exports the "autoresize" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/autoresize')
// ES2015:
// import 'tinymce/plugins/autoresize'
require('./plugin.js');

View File

@ -0,0 +1,169 @@
(function () {
var autoresize = (function () {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
var clone = function () {
return Cell(get());
};
return {
get: get,
set: set,
clone: clone
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var getAutoResizeMinHeight = function (editor) {
return parseInt(editor.getParam('autoresize_min_height', editor.getElement().offsetHeight), 10);
};
var getAutoResizeMaxHeight = function (editor) {
return parseInt(editor.getParam('autoresize_max_height', 0), 10);
};
var getAutoResizeOverflowPadding = function (editor) {
return editor.getParam('autoresize_overflow_padding', 1);
};
var getAutoResizeBottomMargin = function (editor) {
return editor.getParam('autoresize_bottom_margin', 50);
};
var shouldAutoResizeOnInit = function (editor) {
return editor.getParam('autoresize_on_init', true);
};
var Settings = {
getAutoResizeMinHeight: getAutoResizeMinHeight,
getAutoResizeMaxHeight: getAutoResizeMaxHeight,
getAutoResizeOverflowPadding: getAutoResizeOverflowPadding,
getAutoResizeBottomMargin: getAutoResizeBottomMargin,
shouldAutoResizeOnInit: shouldAutoResizeOnInit
};
var isFullscreen = function (editor) {
return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
};
var wait = function (editor, oldSize, times, interval, callback) {
global$2.setEditorTimeout(editor, function () {
resize(editor, oldSize);
if (times--) {
wait(editor, oldSize, times, interval, callback);
} else if (callback) {
callback();
}
}, interval);
};
var toggleScrolling = function (editor, state) {
var body = editor.getBody();
if (body) {
body.style.overflowY = state ? '' : 'hidden';
if (!state) {
body.scrollTop = 0;
}
}
};
var resize = function (editor, oldSize) {
var deltaSize, doc, body, resizeHeight, myHeight;
var marginTop, marginBottom, paddingTop, paddingBottom, borderTop, borderBottom;
var dom = editor.dom;
doc = editor.getDoc();
if (!doc) {
return;
}
if (isFullscreen(editor)) {
toggleScrolling(editor, true);
return;
}
body = doc.body;
resizeHeight = Settings.getAutoResizeMinHeight(editor);
marginTop = dom.getStyle(body, 'margin-top', true);
marginBottom = dom.getStyle(body, 'margin-bottom', true);
paddingTop = dom.getStyle(body, 'padding-top', true);
paddingBottom = dom.getStyle(body, 'padding-bottom', true);
borderTop = dom.getStyle(body, 'border-top-width', true);
borderBottom = dom.getStyle(body, 'border-bottom-width', true);
myHeight = body.offsetHeight + parseInt(marginTop, 10) + parseInt(marginBottom, 10) + parseInt(paddingTop, 10) + parseInt(paddingBottom, 10) + parseInt(borderTop, 10) + parseInt(borderBottom, 10);
if (isNaN(myHeight) || myHeight <= 0) {
myHeight = global$1.ie ? body.scrollHeight : global$1.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight;
}
if (myHeight > Settings.getAutoResizeMinHeight(editor)) {
resizeHeight = myHeight;
}
var maxHeight = Settings.getAutoResizeMaxHeight(editor);
if (maxHeight && myHeight > maxHeight) {
resizeHeight = maxHeight;
toggleScrolling(editor, true);
} else {
toggleScrolling(editor, false);
}
if (resizeHeight !== oldSize.get()) {
deltaSize = resizeHeight - oldSize.get();
dom.setStyle(editor.iframeElement, 'height', resizeHeight + 'px');
oldSize.set(resizeHeight);
if (global$1.webkit && deltaSize < 0) {
resize(editor, oldSize);
}
}
};
var setup = function (editor, oldSize) {
editor.on('init', function () {
var overflowPadding, bottomMargin;
var dom = editor.dom;
overflowPadding = Settings.getAutoResizeOverflowPadding(editor);
bottomMargin = Settings.getAutoResizeBottomMargin(editor);
if (overflowPadding !== false) {
dom.setStyles(editor.getBody(), {
paddingLeft: overflowPadding,
paddingRight: overflowPadding
});
}
if (bottomMargin !== false) {
dom.setStyles(editor.getBody(), { paddingBottom: bottomMargin });
}
});
editor.on('nodechange setcontent keyup FullscreenStateChanged', function (e) {
resize(editor, oldSize);
});
if (Settings.shouldAutoResizeOnInit(editor)) {
editor.on('init', function () {
wait(editor, oldSize, 20, 100, function () {
wait(editor, oldSize, 5, 1000);
});
});
}
};
var Resize = {
setup: setup,
resize: resize
};
var register = function (editor, oldSize) {
editor.addCommand('mceAutoResize', function () {
Resize.resize(editor, oldSize);
});
};
var Commands = { register: register };
global.add('autoresize', function (editor) {
if (!editor.inline) {
var oldSize = Cell(0);
Commands.register(editor, oldSize);
Resize.setup(editor, oldSize);
}
});
function Plugin () {
}
return Plugin;
}());
})();

View File

@ -0,0 +1 @@
!function(){"use strict";var i=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return i(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),h=function(t){return parseInt(t.getParam("autoresize_min_height",t.getElement().offsetHeight),10)},v=function(t){return parseInt(t.getParam("autoresize_max_height",0),10)},o=function(t){return t.getParam("autoresize_overflow_padding",1)},a=function(t){return t.getParam("autoresize_bottom_margin",50)},n=function(t){return t.getParam("autoresize_on_init",!0)},u=function(t,e,n,i,o){r.setEditorTimeout(t,function(){_(t,e),n--?u(t,e,n,i,o):o&&o()},i)},S=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},_=function(t,e){var n,i,o,r,a,u,s,l,g,c,f,d=t.dom;if(i=t.getDoc())if((m=t).plugins.fullscreen&&m.plugins.fullscreen.isFullscreen())S(t,!0);else{var m;o=i.body,r=h(t),u=d.getStyle(o,"margin-top",!0),s=d.getStyle(o,"margin-bottom",!0),l=d.getStyle(o,"padding-top",!0),g=d.getStyle(o,"padding-bottom",!0),c=d.getStyle(o,"border-top-width",!0),f=d.getStyle(o,"border-bottom-width",!0),a=o.offsetHeight+parseInt(u,10)+parseInt(s,10)+parseInt(l,10)+parseInt(g,10)+parseInt(c,10)+parseInt(f,10),(isNaN(a)||a<=0)&&(a=y.ie?o.scrollHeight:y.webkit&&0===o.clientHeight?0:o.offsetHeight),a>h(t)&&(r=a);var p=v(t);p&&p<a?(r=p,S(t,!0)):S(t,!1),r!==e.get()&&(n=r-e.get(),d.setStyle(t.iframeElement,"height",r+"px"),e.set(r),y.webkit&&n<0&&_(t,e))}},s={setup:function(i,e){i.on("init",function(){var t,e,n=i.dom;t=o(i),e=a(i),!1!==t&&n.setStyles(i.getBody(),{paddingLeft:t,paddingRight:t}),!1!==e&&n.setStyles(i.getBody(),{paddingBottom:e})}),i.on("nodechange setcontent keyup FullscreenStateChanged",function(t){_(i,e)}),n(i)&&i.on("init",function(){u(i,e,20,100,function(){u(i,e,5,1e3)})})},resize:_},l=function(t,e){t.addCommand("mceAutoResize",function(){s.resize(t,e)})};t.add("autoresize",function(t){if(!t.inline){var e=i(0);l(t,e),s.setup(t,e)}})}();

View File

@ -0,0 +1,7 @@
// Exports the "autosave" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/autosave')
// ES2015:
// import 'tinymce/plugins/autosave'
require('./plugin.js');

View File

@ -0,0 +1,216 @@
(function () {
var autosave = (function (domGlobals) {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
var clone = function () {
return Cell(get());
};
return {
get: get,
set: set,
clone: clone
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.LocalStorage');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var fireRestoreDraft = function (editor) {
return editor.fire('RestoreDraft');
};
var fireStoreDraft = function (editor) {
return editor.fire('StoreDraft');
};
var fireRemoveDraft = function (editor) {
return editor.fire('RemoveDraft');
};
var parse = function (timeString, defaultTime) {
var multiples = {
s: 1000,
m: 60000
};
var toParse = timeString || defaultTime;
var parsedTime = /^(\d+)([ms]?)$/.exec('' + toParse);
return (parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(toParse, 10);
};
var shouldAskBeforeUnload = function (editor) {
return editor.getParam('autosave_ask_before_unload', true);
};
var getAutoSavePrefix = function (editor) {
var prefix = editor.getParam('autosave_prefix', 'tinymce-autosave-{path}{query}{hash}-{id}-');
prefix = prefix.replace(/\{path\}/g, domGlobals.document.location.pathname);
prefix = prefix.replace(/\{query\}/g, domGlobals.document.location.search);
prefix = prefix.replace(/\{hash\}/g, domGlobals.document.location.hash);
prefix = prefix.replace(/\{id\}/g, editor.id);
return prefix;
};
var shouldRestoreWhenEmpty = function (editor) {
return editor.getParam('autosave_restore_when_empty', false);
};
var getAutoSaveInterval = function (editor) {
return parse(editor.settings.autosave_interval, '30s');
};
var getAutoSaveRetention = function (editor) {
return parse(editor.settings.autosave_retention, '20m');
};
var isEmpty = function (editor, html) {
var forcedRootBlockName = editor.settings.forced_root_block;
html = global$2.trim(typeof html === 'undefined' ? editor.getBody().innerHTML : html);
return html === '' || new RegExp('^<' + forcedRootBlockName + '[^>]*>((\xA0|&nbsp;|[ \t]|<br[^>]*>)+?|)</' + forcedRootBlockName + '>|<br>$', 'i').test(html);
};
var hasDraft = function (editor) {
var time = parseInt(global$1.getItem(getAutoSavePrefix(editor) + 'time'), 10) || 0;
if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
removeDraft(editor, false);
return false;
}
return true;
};
var removeDraft = function (editor, fire) {
var prefix = getAutoSavePrefix(editor);
global$1.removeItem(prefix + 'draft');
global$1.removeItem(prefix + 'time');
if (fire !== false) {
fireRemoveDraft(editor);
}
};
var storeDraft = function (editor) {
var prefix = getAutoSavePrefix(editor);
if (!isEmpty(editor) && editor.isDirty()) {
global$1.setItem(prefix + 'draft', editor.getContent({
format: 'raw',
no_events: true
}));
global$1.setItem(prefix + 'time', new Date().getTime().toString());
fireStoreDraft(editor);
}
};
var restoreDraft = function (editor) {
var prefix = getAutoSavePrefix(editor);
if (hasDraft(editor)) {
editor.setContent(global$1.getItem(prefix + 'draft'), { format: 'raw' });
fireRestoreDraft(editor);
}
};
var startStoreDraft = function (editor, started) {
var interval = getAutoSaveInterval(editor);
if (!started.get()) {
setInterval(function () {
if (!editor.removed) {
storeDraft(editor);
}
}, interval);
started.set(true);
}
};
var restoreLastDraft = function (editor) {
editor.undoManager.transact(function () {
restoreDraft(editor);
removeDraft(editor);
});
editor.focus();
};
function curry(fn) {
var initialArgs = [];
for (var _i = 1; _i < arguments.length; _i++) {
initialArgs[_i - 1] = arguments[_i];
}
return function () {
var restArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
restArgs[_i] = arguments[_i];
}
var all = initialArgs.concat(restArgs);
return fn.apply(null, all);
};
}
var get = function (editor) {
return {
hasDraft: curry(hasDraft, editor),
storeDraft: curry(storeDraft, editor),
restoreDraft: curry(restoreDraft, editor),
removeDraft: curry(removeDraft, editor),
isEmpty: curry(isEmpty, editor)
};
};
var global$3 = tinymce.util.Tools.resolve('tinymce.EditorManager');
global$3._beforeUnloadHandler = function () {
var msg;
global$2.each(global$3.get(), function (editor) {
if (editor.plugins.autosave) {
editor.plugins.autosave.storeDraft();
}
if (!msg && editor.isDirty() && shouldAskBeforeUnload(editor)) {
msg = editor.translate('You have unsaved changes are you sure you want to navigate away?');
}
});
return msg;
};
var setup = function (editor) {
domGlobals.window.onbeforeunload = global$3._beforeUnloadHandler;
};
var postRender = function (editor, started) {
return function (e) {
var ctrl = e.control;
ctrl.disabled(!hasDraft(editor));
editor.on('StoreDraft RestoreDraft RemoveDraft', function () {
ctrl.disabled(!hasDraft(editor));
});
startStoreDraft(editor, started);
};
};
var register = function (editor, started) {
editor.addButton('restoredraft', {
title: 'Restore last draft',
onclick: function () {
restoreLastDraft(editor);
},
onPostRender: postRender(editor, started)
});
editor.addMenuItem('restoredraft', {
text: 'Restore last draft',
onclick: function () {
restoreLastDraft(editor);
},
onPostRender: postRender(editor, started),
context: 'file'
});
};
global.add('autosave', function (editor) {
var started = Cell(false);
setup();
register(editor, started);
editor.on('init', function () {
if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) {
restoreDraft(editor);
}
});
return get(editor);
});
function Plugin () {
}
return Plugin;
}(window));
})();

View File

@ -0,0 +1 @@
!function(a){"use strict";var i=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return i(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t,e){var n=t||e,r=/^(\d+)([ms]?)$/.exec(""+n);return(r[2]?{s:1e3,m:6e4}[r[2]]:1)*parseInt(n,10)},s=function(t){var e=t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-");return e=(e=(e=(e=e.replace(/\{path\}/g,a.document.location.pathname)).replace(/\{query\}/g,a.document.location.search)).replace(/\{hash\}/g,a.document.location.hash)).replace(/\{id\}/g,t.id)},c=function(t,e){var n=t.settings.forced_root_block;return""===(e=o.trim(void 0===e?t.getBody().innerHTML:e))||new RegExp("^<"+n+"[^>]*>((\xa0|&nbsp;|[ \t]|<br[^>]*>)+?|)</"+n+">|<br>$","i").test(e)},f=function(t){var e=parseInt(r.getItem(s(t)+"time"),10)||0;return!((new Date).getTime()-e>u(t.settings.autosave_retention,"20m")&&(l(t,!1),1))},l=function(t,e){var n=s(t);r.removeItem(n+"draft"),r.removeItem(n+"time"),!1!==e&&t.fire("RemoveDraft")},m=function(t){var e=s(t);!c(t)&&t.isDirty()&&(r.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),r.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))},v=function(t){var e=s(t);f(t)&&(t.setContent(r.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))},d=function(t,e){var n=u(t.settings.autosave_interval,"30s");e.get()||(setInterval(function(){t.removed||m(t)},n),e.set(!0))},g=function(t){t.undoManager.transact(function(){v(t),l(t)}),t.focus()};function y(r){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=o.concat(t);return r.apply(null,n)}}var p=tinymce.util.Tools.resolve("tinymce.EditorManager");p._beforeUnloadHandler=function(){var e;return o.each(p.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e};var h=function(n,r){return function(t){var e=t.control;e.disabled(!f(n)),n.on("StoreDraft RestoreDraft RemoveDraft",function(){e.disabled(!f(n))}),d(n,r)}};t.add("autosave",function(t){var e,n,r,o=i(!1);return a.window.onbeforeunload=p._beforeUnloadHandler,n=o,(e=t).addButton("restoredraft",{title:"Restore last draft",onclick:function(){g(e)},onPostRender:h(e,n)}),e.addMenuItem("restoredraft",{text:"Restore last draft",onclick:function(){g(e)},onPostRender:h(e,n),context:"file"}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&v(t)}),{hasDraft:y(f,r=t),storeDraft:y(m,r),restoreDraft:y(v,r),removeDraft:y(l,r),isEmpty:y(c,r)}})}(window);

View File

@ -0,0 +1,7 @@
// Exports the "bbcode" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/bbcode')
// ES2015:
// import 'tinymce/plugins/bbcode'
require('./plugin.js');

View File

@ -0,0 +1,101 @@
(function () {
var bbcode = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var html2bbcode = function (s) {
s = global$1.trim(s);
var rep = function (re, str) {
s = s.replace(re, str);
};
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi, '[url=$1]$2[/url]');
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]');
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]');
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]');
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]');
rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi, '[color=$1]$2[/color]');
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, '[color=$1]$2[/color]');
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi, '[size=$1]$2[/size]');
rep(/<font>(.*?)<\/font>/gi, '$1');
rep(/<img.*?src=\"(.*?)\".*?\/>/gi, '[img]$1[/img]');
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi, '[code]$1[/code]');
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi, '[quote]$1[/quote]');
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi, '[code][b]$1[/b][/code]');
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi, '[quote][b]$1[/b][/quote]');
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi, '[code][i]$1[/i][/code]');
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi, '[quote][i]$1[/i][/quote]');
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi, '[code][u]$1[/u][/code]');
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi, '[quote][u]$1[/u][/quote]');
rep(/<\/(strong|b)>/gi, '[/b]');
rep(/<(strong|b)>/gi, '[b]');
rep(/<\/(em|i)>/gi, '[/i]');
rep(/<(em|i)>/gi, '[i]');
rep(/<\/u>/gi, '[/u]');
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi, '[u]$1[/u]');
rep(/<u>/gi, '[u]');
rep(/<blockquote[^>]*>/gi, '[quote]');
rep(/<\/blockquote>/gi, '[/quote]');
rep(/<br \/>/gi, '\n');
rep(/<br\/>/gi, '\n');
rep(/<br>/gi, '\n');
rep(/<p>/gi, '');
rep(/<\/p>/gi, '\n');
rep(/&nbsp;|\u00a0/gi, ' ');
rep(/&quot;/gi, '"');
rep(/&lt;/gi, '<');
rep(/&gt;/gi, '>');
rep(/&amp;/gi, '&');
return s;
};
var bbcode2html = function (s) {
s = global$1.trim(s);
var rep = function (re, str) {
s = s.replace(re, str);
};
rep(/\n/gi, '<br />');
rep(/\[b\]/gi, '<strong>');
rep(/\[\/b\]/gi, '</strong>');
rep(/\[i\]/gi, '<em>');
rep(/\[\/i\]/gi, '</em>');
rep(/\[u\]/gi, '<u>');
rep(/\[\/u\]/gi, '</u>');
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, '<a href="$1">$2</a>');
rep(/\[url\](.*?)\[\/url\]/gi, '<a href="$1">$1</a>');
rep(/\[img\](.*?)\[\/img\]/gi, '<img src="$1" />');
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi, '<font color="$1">$2</font>');
rep(/\[code\](.*?)\[\/code\]/gi, '<span class="codeStyle">$1</span>&nbsp;');
rep(/\[quote.*?\](.*?)\[\/quote\]/gi, '<span class="quoteStyle">$1</span>&nbsp;');
return s;
};
var Convert = {
html2bbcode: html2bbcode,
bbcode2html: bbcode2html
};
global.add('bbcode', function () {
return {
init: function (editor) {
editor.on('beforeSetContent', function (e) {
e.content = Convert.bbcode2html(e.content);
});
editor.on('postProcess', function (e) {
if (e.set) {
e.content = Convert.bbcode2html(e.content);
}
if (e.get) {
e.content = Convert.html2bbcode(e.content);
}
});
}
};
});
function Plugin () {
}
return Plugin;
}());
})();

View File

@ -0,0 +1 @@
!function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(e){e=t.trim(e);var o=function(o,t){e=e.replace(o,t)};return o(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/<font>(.*?)<\/font>/gi,"$1"),o(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),o(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),o(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),o(/<\/(strong|b)>/gi,"[/b]"),o(/<(strong|b)>/gi,"[b]"),o(/<\/(em|i)>/gi,"[/i]"),o(/<(em|i)>/gi,"[i]"),o(/<\/u>/gi,"[/u]"),o(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),o(/<u>/gi,"[u]"),o(/<blockquote[^>]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/<br \/>/gi,"\n"),o(/<br\/>/gi,"\n"),o(/<br>/gi,"\n"),o(/<p>/gi,""),o(/<\/p>/gi,"\n"),o(/&nbsp;|\u00a0/gi," "),o(/&quot;/gi,'"'),o(/&lt;/gi,"<"),o(/&gt;/gi,">"),o(/&amp;/gi,"&"),e},i=function(e){e=t.trim(e);var o=function(o,t){e=e.replace(o,t)};return o(/\n/gi,"<br />"),o(/\[b\]/gi,"<strong>"),o(/\[\/b\]/gi,"</strong>"),o(/\[i\]/gi,"<em>"),o(/\[\/i\]/gi,"</em>"),o(/\[u\]/gi,"<u>"),o(/\[\/u\]/gi,"</u>"),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),o(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),o(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),o(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),e};o.add("bbcode",function(){return{init:function(o){o.on("beforeSetContent",function(o){o.content=i(o.content)}),o.on("postProcess",function(o){o.set&&(o.content=i(o.content)),o.get&&(o.content=e(o.content))})}}})}();

View File

@ -0,0 +1,7 @@
// Exports the "charmap" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/charmap')
// ES2015:
// import 'tinymce/plugins/charmap'
require('./plugin.js');

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
// Exports the "code" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/code')
// ES2015:
// import 'tinymce/plugins/code'
require('./plugin.js');

View File

@ -0,0 +1,94 @@
(function () {
var code = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var getMinWidth = function (editor) {
return editor.getParam('code_dialog_width', 600);
};
var getMinHeight = function (editor) {
return editor.getParam('code_dialog_height', Math.min(global$1.DOM.getViewPort().h - 200, 500));
};
var Settings = {
getMinWidth: getMinWidth,
getMinHeight: getMinHeight
};
var setContent = function (editor, html) {
editor.focus();
editor.undoManager.transact(function () {
editor.setContent(html);
});
editor.selection.setCursorLocation();
editor.nodeChanged();
};
var getContent = function (editor) {
return editor.getContent({ source_view: true });
};
var Content = {
setContent: setContent,
getContent: getContent
};
var open = function (editor) {
var minWidth = Settings.getMinWidth(editor);
var minHeight = Settings.getMinHeight(editor);
var win = editor.windowManager.open({
title: 'Source code',
body: {
type: 'textbox',
name: 'code',
multiline: true,
minWidth: minWidth,
minHeight: minHeight,
spellcheck: false,
style: 'direction: ltr; text-align: left'
},
onSubmit: function (e) {
Content.setContent(editor, e.data.code);
}
});
win.find('#code').value(Content.getContent(editor));
};
var Dialog = { open: open };
var register = function (editor) {
editor.addCommand('mceCodeEditor', function () {
Dialog.open(editor);
});
};
var Commands = { register: register };
var register$1 = function (editor) {
editor.addButton('code', {
icon: 'code',
tooltip: 'Source code',
onclick: function () {
Dialog.open(editor);
}
});
editor.addMenuItem('code', {
icon: 'code',
text: 'Source code',
onclick: function () {
Dialog.open(editor);
}
});
};
var Buttons = { register: register$1 };
global.add('code', function (editor) {
Commands.register(editor);
Buttons.register(editor);
return {};
});
function Plugin () {
}
return Plugin;
}());
})();

View File

@ -0,0 +1 @@
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(t){return t.getParam("code_dialog_width",600)},i=function(t){return t.getParam("code_dialog_height",Math.min(n.DOM.getViewPort().h-200,500))},c=function(t,n){t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged()},d=function(t){return t.getContent({source_view:!0})},e=function(n){var t=o(n),e=i(n);n.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:t,minHeight:e,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(t){c(n,t.data.code)}}).find("#code").value(d(n))},u=function(t){t.addCommand("mceCodeEditor",function(){e(t)})},a=function(t){t.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){e(t)}}),t.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){e(t)}})};t.add("code",function(t){return u(t),a(t),{}})}();

View File

@ -0,0 +1,138 @@
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

View File

@ -0,0 +1,7 @@
// Exports the "codesample" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/codesample')
// ES2015:
// import 'tinymce/plugins/codesample'
require('./plugin.js');

View File

@ -0,0 +1,967 @@
(function () {
var codesample = (function (domGlobals) {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
var clone = function () {
return Cell(get());
};
return {
get: get,
set: set,
clone: clone
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var getContentCss = function (editor) {
return editor.settings.codesample_content_css;
};
var getLanguages = function (editor) {
return editor.settings.codesample_languages;
};
var getDialogMinWidth = function (editor) {
return Math.min(global$1.DOM.getViewPort().w, editor.getParam('codesample_dialog_width', 800));
};
var getDialogMinHeight = function (editor) {
return Math.min(global$1.DOM.getViewPort().w, editor.getParam('codesample_dialog_height', 650));
};
var Settings = {
getContentCss: getContentCss,
getLanguages: getLanguages,
getDialogMinWidth: getDialogMinWidth,
getDialogMinHeight: getDialogMinHeight
};
var window = {};
var global$2 = window;
var _self = typeof window !== 'undefined' ? window : typeof WorkerGlobalScope !== 'undefined' && domGlobals.self instanceof WorkerGlobalScope ? domGlobals.self : {};
var Prism = function () {
var lang = /\blang(?:uage)?-(?!\*)(\w+)\b/i;
var _ = _self.Prism = {
util: {
encode: function (tokens) {
if (tokens instanceof Token) {
return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias);
} else if (_.util.type(tokens) === 'Array') {
return tokens.map(_.util.encode);
} else {
return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
}
},
type: function (o) {
return Object.prototype.toString.call(o).match(/\[object (\w+)\]/)[1];
},
clone: function (o) {
var type = _.util.type(o);
switch (type) {
case 'Object':
var clone = {};
for (var key in o) {
if (o.hasOwnProperty(key)) {
clone[key] = _.util.clone(o[key]);
}
}
return clone;
case 'Array':
return o.map && o.map(function (v) {
return _.util.clone(v);
});
}
return o;
}
},
languages: {
extend: function (id, redef) {
var lang = _.util.clone(_.languages[id]);
for (var key in redef) {
lang[key] = redef[key];
}
return lang;
},
insertBefore: function (inside, before, insert, root) {
root = root || _.languages;
var grammar = root[inside];
if (arguments.length === 2) {
insert = arguments[1];
for (var newToken in insert) {
if (insert.hasOwnProperty(newToken)) {
grammar[newToken] = insert[newToken];
}
}
return grammar;
}
var ret = {};
for (var token in grammar) {
if (grammar.hasOwnProperty(token)) {
if (token === before) {
for (var newToken in insert) {
if (insert.hasOwnProperty(newToken)) {
ret[newToken] = insert[newToken];
}
}
}
ret[token] = grammar[token];
}
}
_.languages.DFS(_.languages, function (key, value) {
if (value === root[inside] && key !== inside) {
this[key] = ret;
}
});
return root[inside] = ret;
},
DFS: function (o, callback, type) {
for (var i in o) {
if (o.hasOwnProperty(i)) {
callback.call(o, i, o[i], type || i);
if (_.util.type(o[i]) === 'Object') {
_.languages.DFS(o[i], callback);
} else if (_.util.type(o[i]) === 'Array') {
_.languages.DFS(o[i], callback, i);
}
}
}
}
},
plugins: {},
highlightAll: function (async, callback) {
var elements = domGlobals.document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');
for (var i = 0, element = void 0; element = elements[i++];) {
_.highlightElement(element, async === true, callback);
}
},
highlightElement: function (element, async, callback) {
var language, grammar, parent = element;
while (parent && !lang.test(parent.className)) {
parent = parent.parentNode;
}
if (parent) {
language = (parent.className.match(lang) || [
,
''
])[1];
grammar = _.languages[language];
}
element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
parent = element.parentNode;
if (/pre/i.test(parent.nodeName)) {
parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
}
var code = element.textContent;
var env = {
element: element,
language: language,
grammar: grammar,
code: code
};
if (!code || !grammar) {
_.hooks.run('complete', env);
return;
}
_.hooks.run('before-highlight', env);
if (async && _self.Worker) {
var worker = new domGlobals.Worker(_.filename);
worker.onmessage = function (evt) {
env.highlightedCode = evt.data;
_.hooks.run('before-insert', env);
env.element.innerHTML = env.highlightedCode;
if (callback) {
callback.call(env.element);
}
_.hooks.run('after-highlight', env);
_.hooks.run('complete', env);
};
worker.postMessage(JSON.stringify({
language: env.language,
code: env.code,
immediateClose: true
}));
} else {
env.highlightedCode = _.highlight(env.code, env.grammar, env.language);
_.hooks.run('before-insert', env);
env.element.innerHTML = env.highlightedCode;
if (callback) {
callback.call(element);
}
_.hooks.run('after-highlight', env);
_.hooks.run('complete', env);
}
},
highlight: function (text, grammar, language) {
var tokens = _.tokenize(text, grammar);
return Token.stringify(_.util.encode(tokens), language);
},
tokenize: function (text, grammar, language) {
var Token = _.Token;
var strarr = [text];
var rest = grammar.rest;
if (rest) {
for (var token in rest) {
grammar[token] = rest[token];
}
delete grammar.rest;
}
tokenloop:
for (var token in grammar) {
if (!grammar.hasOwnProperty(token) || !grammar[token]) {
continue;
}
var patterns = grammar[token];
patterns = _.util.type(patterns) === 'Array' ? patterns : [patterns];
for (var j = 0; j < patterns.length; ++j) {
var pattern = patterns[j];
var inside = pattern.inside;
var lookbehind = !!pattern.lookbehind;
var lookbehindLength = 0;
var alias = pattern.alias;
pattern = pattern.pattern || pattern;
for (var i = 0; i < strarr.length; i++) {
var str = strarr[i];
if (strarr.length > text.length) {
break tokenloop;
}
if (str instanceof Token) {
continue;
}
pattern.lastIndex = 0;
var match = pattern.exec(str);
if (match) {
if (lookbehind) {
lookbehindLength = match[1].length;
}
var from = match.index - 1 + lookbehindLength;
match = match[0].slice(lookbehindLength);
var len = match.length, to = from + len, before = str.slice(0, from + 1), after = str.slice(to + 1);
var args = [
i,
1
];
if (before) {
args.push(before);
}
var wrapped = new Token(token, inside ? _.tokenize(match, inside) : match, alias);
args.push(wrapped);
if (after) {
args.push(after);
}
Array.prototype.splice.apply(strarr, args);
}
}
}
}
return strarr;
},
hooks: {
all: {},
add: function (name, callback) {
var hooks = _.hooks.all;
hooks[name] = hooks[name] || [];
hooks[name].push(callback);
},
run: function (name, env) {
var callbacks = _.hooks.all[name];
if (!callbacks || !callbacks.length) {
return;
}
for (var i = 0, callback = void 0; callback = callbacks[i++];) {
callback(env);
}
}
}
};
var Token = _.Token = function (type, content, alias) {
this.type = type;
this.content = content;
this.alias = alias;
};
Token.stringify = function (o, language, parent) {
if (typeof o === 'string') {
return o;
}
if (_.util.type(o) === 'Array') {
return o.map(function (element) {
return Token.stringify(element, language, o);
}).join('');
}
var env = {
type: o.type,
content: Token.stringify(o.content, language, parent),
tag: 'span',
classes: [
'token',
o.type
],
attributes: {},
language: language,
parent: parent
};
if (env.type === 'comment') {
env.attributes.spellcheck = 'true';
}
if (o.alias) {
var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias];
Array.prototype.push.apply(env.classes, aliases);
}
_.hooks.run('wrap', env);
var attributes = '';
for (var name in env.attributes) {
attributes += (attributes ? ' ' : '') + name + '="' + (env.attributes[name] || '') + '"';
}
return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + '</' + env.tag + '>';
};
if (!_self.document) {
if (!_self.addEventListener) {
return _self.Prism;
}
_self.addEventListener('message', function (evt) {
var message = JSON.parse(evt.data), lang = message.language, code = message.code, immediateClose = message.immediateClose;
_self.postMessage(_.highlight(code, _.languages[lang], lang));
if (immediateClose) {
_self.close();
}
}, false);
return _self.Prism;
}
}();
if (typeof global$2 !== 'undefined') {
global$2.Prism = Prism;
}
Prism.languages.markup = {
comment: /<!--[\w\W]*?-->/,
prolog: /<\?[\w\W]+?\?>/,
doctype: /<!DOCTYPE[\w\W]+?>/,
cdata: /<!\[CDATA\[[\w\W]*?]]>/i,
tag: {
pattern: /<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,
inside: {
'tag': {
pattern: /^<\/?[^\s>\/]+/i,
inside: {
punctuation: /^<\/?/,
namespace: /^[^\s>\/:]+:/
}
},
'attr-value': {
pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,
inside: { punctuation: /[=>"']/ }
},
'punctuation': /\/?>/,
'attr-name': {
pattern: /[^\s>\/]+/,
inside: { namespace: /^[^\s>\/:]+:/ }
}
}
},
entity: /&#?[\da-z]{1,8};/i
};
Prism.hooks.add('wrap', function (env) {
if (env.type === 'entity') {
env.attributes.title = env.content.replace(/&amp;/, '&');
}
});
Prism.languages.xml = Prism.languages.markup;
Prism.languages.html = Prism.languages.markup;
Prism.languages.mathml = Prism.languages.markup;
Prism.languages.svg = Prism.languages.markup;
Prism.languages.css = {
comment: /\/\*[\w\W]*?\*\//,
atrule: {
pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i,
inside: { rule: /@[\w-]+/ }
},
url: /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
selector: /[^\{\}\s][^\{\};]*?(?=\s*\{)/,
string: /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,
property: /(\b|\B)[\w-]+(?=\s*:)/i,
important: /\B!important\b/i,
function: /[-a-z0-9]+(?=\()/i,
punctuation: /[(){};:]/
};
Prism.languages.css.atrule.inside.rest = Prism.util.clone(Prism.languages.css);
if (Prism.languages.markup) {
Prism.languages.insertBefore('markup', 'tag', {
style: {
pattern: /<style[\w\W]*?>[\w\W]*?<\/style>/i,
inside: {
tag: {
pattern: /<style[\w\W]*?>|<\/style>/i,
inside: Prism.languages.markup.tag.inside
},
rest: Prism.languages.css
},
alias: 'language-css'
}
});
Prism.languages.insertBefore('inside', 'attr-value', {
'style-attr': {
pattern: /\s*style=("|').*?\1/i,
inside: {
'attr-name': {
pattern: /^\s*style/i,
inside: Prism.languages.markup.tag.inside
},
'punctuation': /^\s*=\s*['"]|['"]\s*$/,
'attr-value': {
pattern: /.+/i,
inside: Prism.languages.css
}
},
alias: 'language-css'
}
}, Prism.languages.markup.tag);
}
Prism.languages.clike = {
'comment': [
{
pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
lookbehind: true
},
{
pattern: /(^|[^\\:])\/\/.*/,
lookbehind: true
}
],
'string': /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
'class-name': {
pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,
lookbehind: true,
inside: { punctuation: /(\.|\\)/ }
},
'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
'boolean': /\b(true|false)\b/,
'function': /[a-z0-9_]+(?=\()/i,
'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,
'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
'punctuation': /[{}[\];(),.:]/
};
Prism.languages.javascript = Prism.languages.extend('clike', {
keyword: /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,
number: /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,
function: /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i
});
Prism.languages.insertBefore('javascript', 'keyword', {
regex: {
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,
lookbehind: true
}
});
Prism.languages.insertBefore('javascript', 'class-name', {
'template-string': {
pattern: /`(?:\\`|\\?[^`])*`/,
inside: {
interpolation: {
pattern: /\$\{[^}]+\}/,
inside: {
'interpolation-punctuation': {
pattern: /^\$\{|\}$/,
alias: 'punctuation'
},
'rest': Prism.languages.javascript
}
},
string: /[\s\S]+/
}
}
});
if (Prism.languages.markup) {
Prism.languages.insertBefore('markup', 'tag', {
script: {
pattern: /<script[\w\W]*?>[\w\W]*?<\/script>/i,
inside: {
tag: {
pattern: /<script[\w\W]*?>|<\/script>/i,
inside: Prism.languages.markup.tag.inside
},
rest: Prism.languages.javascript
},
alias: 'language-javascript'
}
});
}
Prism.languages.js = Prism.languages.javascript;
Prism.languages.c = Prism.languages.extend('clike', {
keyword: /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
operator: /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,
number: /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i
});
Prism.languages.insertBefore('c', 'string', {
macro: {
pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,
lookbehind: true,
alias: 'property',
inside: {
string: {
pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,
lookbehind: true
}
}
}
});
delete Prism.languages.c['class-name'];
delete Prism.languages.c.boolean;
Prism.languages.csharp = Prism.languages.extend('clike', {
keyword: /\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,
string: [
/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,
/("|')(\\?.)*?\1/
],
number: /\b-?(0x[\da-f]+|\d*\.?\d+)\b/i
});
Prism.languages.insertBefore('csharp', 'keyword', {
preprocessor: {
pattern: /(^\s*)#.*/m,
lookbehind: true
}
});
Prism.languages.cpp = Prism.languages.extend('c', {
keyword: /\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,
boolean: /\b(true|false)\b/,
operator: /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/
});
Prism.languages.insertBefore('cpp', 'keyword', {
'class-name': {
pattern: /(class\s+)[a-z0-9_]+/i,
lookbehind: true
}
});
Prism.languages.java = Prism.languages.extend('clike', {
keyword: /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,
number: /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,
operator: {
pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,
lookbehind: true
}
});
Prism.languages.php = Prism.languages.extend('clike', {
keyword: /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,
constant: /\b[A-Z0-9_]{2,}\b/,
comment: {
pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,
lookbehind: true
}
});
Prism.languages.insertBefore('php', 'class-name', {
'shell-comment': {
pattern: /(^|[^\\])#.*/,
lookbehind: true,
alias: 'comment'
}
});
Prism.languages.insertBefore('php', 'keyword', {
delimiter: /\?>|<\?(?:php)?/i,
variable: /\$\w+\b/i,
package: {
pattern: /(\\|namespace\s+|use\s+)[\w\\]+/,
lookbehind: true,
inside: { punctuation: /\\/ }
}
});
Prism.languages.insertBefore('php', 'operator', {
property: {
pattern: /(->)[\w]+/,
lookbehind: true
}
});
if (Prism.languages.markup) {
Prism.hooks.add('before-highlight', function (env) {
if (env.language !== 'php') {
return;
}
env.tokenStack = [];
env.backupCode = env.code;
env.code = env.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/ig, function (match) {
env.tokenStack.push(match);
return '{{{PHP' + env.tokenStack.length + '}}}';
});
});
Prism.hooks.add('before-insert', function (env) {
if (env.language === 'php') {
env.code = env.backupCode;
delete env.backupCode;
}
});
Prism.hooks.add('after-highlight', function (env) {
if (env.language !== 'php') {
return;
}
for (var i = 0, t = void 0; t = env.tokenStack[i]; i++) {
env.highlightedCode = env.highlightedCode.replace('{{{PHP' + (i + 1) + '}}}', Prism.highlight(t, env.grammar, 'php').replace(/\$/g, '$$$$'));
}
env.element.innerHTML = env.highlightedCode;
});
Prism.hooks.add('wrap', function (env) {
if (env.language === 'php' && env.type === 'markup') {
env.content = env.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g, '<span class="token php">$1</span>');
}
});
Prism.languages.insertBefore('php', 'comment', {
markup: {
pattern: /<[^?]\/?(.*?)>/,
inside: Prism.languages.markup
},
php: /\{\{\{PHP[0-9]+\}\}\}/
});
}
Prism.languages.python = {
'comment': {
pattern: /(^|[^\\])#.*/,
lookbehind: true
},
'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,
'function': {
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,
lookbehind: true
},
'class-name': {
pattern: /(\bclass\s+)[a-z0-9_]+/i,
lookbehind: true
},
'keyword': /\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,
'boolean': /\b(?:True|False)\b/,
'number': /\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,
'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,
'punctuation': /[{}[\];(),.:]/
};
(function (Prism) {
Prism.languages.ruby = Prism.languages.extend('clike', {
comment: /#(?!\{[^\r\n]*?\}).*/,
keyword: /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/
});
var interpolation = {
pattern: /#\{[^}]+\}/,
inside: {
delimiter: {
pattern: /^#\{|\}$/,
alias: 'tag'
},
rest: Prism.util.clone(Prism.languages.ruby)
}
};
Prism.languages.insertBefore('ruby', 'keyword', {
regex: [
{
pattern: /%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,
inside: { interpolation: interpolation }
},
{
pattern: /%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,
inside: { interpolation: interpolation }
},
{
pattern: /%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,
inside: { interpolation: interpolation }
},
{
pattern: /%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,
inside: { interpolation: interpolation }
},
{
pattern: /%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,
inside: { interpolation: interpolation }
},
{
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,
lookbehind: true
}
],
variable: /[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,
symbol: /:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/
});
Prism.languages.insertBefore('ruby', 'number', {
builtin: /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,
constant: /\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/
});
Prism.languages.ruby.string = [
{
pattern: /%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,
inside: { interpolation: interpolation }
},
{
pattern: /%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,
inside: { interpolation: interpolation }
},
{
pattern: /%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,
inside: { interpolation: interpolation }
},
{
pattern: /%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,
inside: { interpolation: interpolation }
},
{
pattern: /%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,
inside: { interpolation: interpolation }
},
{
pattern: /("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,
inside: { interpolation: interpolation }
}
];
}(Prism));
function isCodeSample(elm) {
return elm && elm.nodeName === 'PRE' && elm.className.indexOf('language-') !== -1;
}
function trimArg(predicateFn) {
return function (arg1, arg2) {
return predicateFn(arg2);
};
}
var Utils = {
isCodeSample: isCodeSample,
trimArg: trimArg
};
var getSelectedCodeSample = function (editor) {
var node = editor.selection.getNode();
if (Utils.isCodeSample(node)) {
return node;
}
return null;
};
var insertCodeSample = function (editor, language, code) {
editor.undoManager.transact(function () {
var node = getSelectedCodeSample(editor);
code = global$1.DOM.encode(code);
if (node) {
editor.dom.setAttrib(node, 'class', 'language-' + language);
node.innerHTML = code;
Prism.highlightElement(node);
editor.selection.select(node);
} else {
editor.insertContent('<pre id="__new" class="language-' + language + '">' + code + '</pre>');
editor.selection.select(editor.$('#__new').removeAttr('id')[0]);
}
});
};
var getCurrentCode = function (editor) {
var node = getSelectedCodeSample(editor);
if (node) {
return node.textContent;
}
return '';
};
var CodeSample = {
getSelectedCodeSample: getSelectedCodeSample,
insertCodeSample: insertCodeSample,
getCurrentCode: getCurrentCode
};
var getLanguages$1 = function (editor) {
var defaultLanguages = [
{
text: 'HTML/XML',
value: 'markup'
},
{
text: 'JavaScript',
value: 'javascript'
},
{
text: 'CSS',
value: 'css'
},
{
text: 'PHP',
value: 'php'
},
{
text: 'Ruby',
value: 'ruby'
},
{
text: 'Python',
value: 'python'
},
{
text: 'Java',
value: 'java'
},
{
text: 'C',
value: 'c'
},
{
text: 'C#',
value: 'csharp'
},
{
text: 'C++',
value: 'cpp'
}
];
var customLanguages = Settings.getLanguages(editor);
return customLanguages ? customLanguages : defaultLanguages;
};
var getCurrentLanguage = function (editor) {
var matches;
var node = CodeSample.getSelectedCodeSample(editor);
if (node) {
matches = node.className.match(/language-(\w+)/);
return matches ? matches[1] : '';
}
return '';
};
var Languages = {
getLanguages: getLanguages$1,
getCurrentLanguage: getCurrentLanguage
};
var Dialog = {
open: function (editor) {
var minWidth = Settings.getDialogMinWidth(editor);
var minHeight = Settings.getDialogMinHeight(editor);
var currentLanguage = Languages.getCurrentLanguage(editor);
var currentLanguages = Languages.getLanguages(editor);
var currentCode = CodeSample.getCurrentCode(editor);
editor.windowManager.open({
title: 'Insert/Edit code sample',
minWidth: minWidth,
minHeight: minHeight,
layout: 'flex',
direction: 'column',
align: 'stretch',
body: [
{
type: 'listbox',
name: 'language',
label: 'Language',
maxWidth: 200,
value: currentLanguage,
values: currentLanguages
},
{
type: 'textbox',
name: 'code',
multiline: true,
spellcheck: false,
ariaLabel: 'Code view',
flex: 1,
style: 'direction: ltr; text-align: left',
classes: 'monospace',
value: currentCode,
autofocus: true
}
],
onSubmit: function (e) {
CodeSample.insertCodeSample(editor, e.data.language, e.data.code);
}
});
}
};
var register = function (editor) {
editor.addCommand('codesample', function () {
var node = editor.selection.getNode();
if (editor.selection.isCollapsed() || Utils.isCodeSample(node)) {
Dialog.open(editor);
} else {
editor.formatter.toggle('code');
}
});
};
var Commands = { register: register };
var setup = function (editor) {
var $ = editor.$;
editor.on('PreProcess', function (e) {
$('pre[contenteditable=false]', e.node).filter(Utils.trimArg(Utils.isCodeSample)).each(function (idx, elm) {
var $elm = $(elm), code = elm.textContent;
$elm.attr('class', $.trim($elm.attr('class')));
$elm.removeAttr('contentEditable');
$elm.empty().append($('<code></code>').each(function () {
this.textContent = code;
}));
});
});
editor.on('SetContent', function () {
var unprocessedCodeSamples = $('pre').filter(Utils.trimArg(Utils.isCodeSample)).filter(function (idx, elm) {
return elm.contentEditable !== 'false';
});
if (unprocessedCodeSamples.length) {
editor.undoManager.transact(function () {
unprocessedCodeSamples.each(function (idx, elm) {
$(elm).find('br').each(function (idx, elm) {
elm.parentNode.replaceChild(editor.getDoc().createTextNode('\n'), elm);
});
elm.contentEditable = false;
elm.innerHTML = editor.dom.encode(elm.textContent);
Prism.highlightElement(elm);
elm.className = $.trim(elm.className);
});
});
}
});
};
var FilterContent = { setup: setup };
var loadCss = function (editor, pluginUrl, addedInlineCss, addedCss) {
var linkElm;
var contentCss = Settings.getContentCss(editor);
if (editor.inline && addedInlineCss.get()) {
return;
}
if (!editor.inline && addedCss.get()) {
return;
}
if (editor.inline) {
addedInlineCss.set(true);
} else {
addedCss.set(true);
}
if (contentCss !== false) {
linkElm = editor.dom.create('link', {
rel: 'stylesheet',
href: contentCss ? contentCss : pluginUrl + '/css/prism.css'
});
editor.getDoc().getElementsByTagName('head')[0].appendChild(linkElm);
}
};
var LoadCss = { loadCss: loadCss };
var register$1 = function (editor) {
editor.addButton('codesample', {
cmd: 'codesample',
title: 'Insert/Edit code sample'
});
editor.addMenuItem('codesample', {
cmd: 'codesample',
text: 'Code sample',
icon: 'codesample'
});
};
var Buttons = { register: register$1 };
var addedInlineCss = Cell(false);
global.add('codesample', function (editor, pluginUrl) {
var addedCss = Cell(false);
FilterContent.setup(editor);
Buttons.register(editor);
Commands.register(editor);
editor.on('init', function () {
LoadCss.loadCss(editor, pluginUrl, addedInlineCss, addedCss);
});
editor.on('dblclick', function (ev) {
if (Utils.isCodeSample(ev.target)) {
Dialog.open(editor);
}
});
});
function Plugin () {
}
return Plugin;
}(window));
})();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
// Exports the "colorpicker" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/colorpicker')
// ES2015:
// import 'tinymce/plugins/colorpicker'
require('./plugin.js');

View File

@ -0,0 +1,126 @@
(function () {
var colorpicker = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Color');
var showPreview = function (win, hexColor) {
win.find('#preview')[0].getEl().style.background = hexColor;
};
var setColor = function (win, value) {
var color = global$1(value), rgb = color.toRgb();
win.fromJSON({
r: rgb.r,
g: rgb.g,
b: rgb.b,
hex: color.toHex().substr(1)
});
showPreview(win, color.toHex());
};
var open = function (editor, callback, value) {
var win = editor.windowManager.open({
title: 'Color',
items: {
type: 'container',
layout: 'flex',
direction: 'row',
align: 'stretch',
padding: 5,
spacing: 10,
items: [
{
type: 'colorpicker',
value: value,
onchange: function () {
var rgb = this.rgb();
if (win) {
win.find('#r').value(rgb.r);
win.find('#g').value(rgb.g);
win.find('#b').value(rgb.b);
win.find('#hex').value(this.value().substr(1));
showPreview(win, this.value());
}
}
},
{
type: 'form',
padding: 0,
labelGap: 5,
defaults: {
type: 'textbox',
size: 7,
value: '0',
flex: 1,
spellcheck: false,
onchange: function () {
var colorPickerCtrl = win.find('colorpicker')[0];
var name, value;
name = this.name();
value = this.value();
if (name === 'hex') {
value = '#' + value;
setColor(win, value);
colorPickerCtrl.value(value);
return;
}
value = {
r: win.find('#r').value(),
g: win.find('#g').value(),
b: win.find('#b').value()
};
colorPickerCtrl.value(value);
setColor(win, value);
}
},
items: [
{
name: 'r',
label: 'R',
autofocus: 1
},
{
name: 'g',
label: 'G'
},
{
name: 'b',
label: 'B'
},
{
name: 'hex',
label: '#',
value: '000000'
},
{
name: 'preview',
type: 'container',
border: 1
}
]
}
]
},
onSubmit: function () {
callback('#' + win.toJSON().hex);
}
});
setColor(win, value);
};
var Dialog = { open: open };
global.add('colorpicker', function (editor) {
if (!editor.settings.color_picker_callback) {
editor.settings.color_picker_callback = function (callback, value) {
Dialog.open(editor, callback, value);
};
}
});
function Plugin () {
}
return Plugin;
}());
})();

View File

@ -0,0 +1 @@
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Color"),a=function(e,n){e.find("#preview")[0].getEl().style.background=n},o=function(e,n){var i=l(n),t=i.toRgb();e.fromJSON({r:t.r,g:t.g,b:t.b,hex:i.toHex().substr(1)}),a(e,i.toHex())},t=function(e,n,i){var t=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:i,onchange:function(){var e=this.rgb();t&&(t.find("#r").value(e.r),t.find("#g").value(e.g),t.find("#b").value(e.b),t.find("#hex").value(this.value().substr(1)),a(t,this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,n,i=t.find("colorpicker")[0];if(e=this.name(),n=this.value(),"hex"===e)return o(t,n="#"+n),void i.value(n);n={r:t.find("#r").value(),g:t.find("#g").value(),b:t.find("#b").value()},i.value(n),o(t,n)}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){n("#"+t.toJSON().hex)}});o(t,i)};e.add("colorpicker",function(i){i.settings.color_picker_callback||(i.settings.color_picker_callback=function(e,n){t(i,e,n)})})}();

View File

@ -0,0 +1,7 @@
// Exports the "contextmenu" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/contextmenu')
// ES2015:
// import 'tinymce/plugins/contextmenu'
require('./plugin.js');

View File

@ -0,0 +1,168 @@
(function () {
var contextmenu = (function () {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
var clone = function () {
return Cell(get());
};
return {
get: get,
set: set,
clone: clone
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var get = function (visibleState) {
var isContextMenuVisible = function () {
return visibleState.get();
};
return { isContextMenuVisible: isContextMenuVisible };
};
var Api = { get: get };
var shouldNeverUseNative = function (editor) {
return editor.settings.contextmenu_never_use_native;
};
var getContextMenu = function (editor) {
return editor.getParam('contextmenu', 'link openlink image inserttable | cell row column deletetable');
};
var Settings = {
shouldNeverUseNative: shouldNeverUseNative,
getContextMenu: getContextMenu
};
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var getUiContainer = function (editor) {
return global$1.DOM.select(editor.settings.ui_container)[0];
};
var nu = function (x, y) {
return {
x: x,
y: y
};
};
var transpose = function (pos, dx, dy) {
return nu(pos.x + dx, pos.y + dy);
};
var fromPageXY = function (e) {
return nu(e.pageX, e.pageY);
};
var fromClientXY = function (e) {
return nu(e.clientX, e.clientY);
};
var transposeUiContainer = function (element, pos) {
if (element && global$1.DOM.getStyle(element, 'position', true) !== 'static') {
var containerPos = global$1.DOM.getPos(element);
var dx = containerPos.x - element.scrollLeft;
var dy = containerPos.y - element.scrollTop;
return transpose(pos, -dx, -dy);
} else {
return transpose(pos, 0, 0);
}
};
var transposeContentAreaContainer = function (element, pos) {
var containerPos = global$1.DOM.getPos(element);
return transpose(pos, containerPos.x, containerPos.y);
};
var getPos = function (editor, e) {
if (editor.inline) {
return transposeUiContainer(getUiContainer(editor), fromPageXY(e));
} else {
var iframePos = transposeContentAreaContainer(editor.getContentAreaContainer(), fromClientXY(e));
return transposeUiContainer(getUiContainer(editor), iframePos);
}
};
var Coords = { getPos: getPos };
var global$2 = tinymce.util.Tools.resolve('tinymce.ui.Factory');
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var renderMenu = function (editor, visibleState) {
var menu, contextmenu;
var items = [];
contextmenu = Settings.getContextMenu(editor);
global$3.each(contextmenu.split(/[ ,]/), function (name) {
var item = editor.menuItems[name];
if (name === '|') {
item = { text: name };
}
if (item) {
item.shortcut = '';
items.push(item);
}
});
for (var i = 0; i < items.length; i++) {
if (items[i].text === '|') {
if (i === 0 || i === items.length - 1) {
items.splice(i, 1);
}
}
}
menu = global$2.create('menu', {
items: items,
context: 'contextmenu',
classes: 'contextmenu'
});
menu.uiContainer = getUiContainer(editor);
menu.renderTo(getUiContainer(editor));
menu.on('hide', function (e) {
if (e.control === this) {
visibleState.set(false);
}
});
editor.on('remove', function () {
menu.remove();
menu = null;
});
return menu;
};
var show = function (editor, pos, visibleState, menu) {
if (menu.get() === null) {
menu.set(renderMenu(editor, visibleState));
} else {
menu.get().show();
}
menu.get().moveTo(pos.x, pos.y);
visibleState.set(true);
};
var ContextMenu = { show: show };
var isNativeOverrideKeyEvent = function (editor, e) {
return e.ctrlKey && !Settings.shouldNeverUseNative(editor);
};
var setup = function (editor, visibleState, menu) {
editor.on('contextmenu', function (e) {
if (isNativeOverrideKeyEvent(editor, e)) {
return;
}
e.preventDefault();
ContextMenu.show(editor, Coords.getPos(editor, e), visibleState, menu);
});
};
var Bind = { setup: setup };
global.add('contextmenu', function (editor) {
var menu = Cell(null), visibleState = Cell(false);
Bind.setup(editor, visibleState, menu);
return Api.get(visibleState);
});
function Plugin () {
}
return Plugin;
}());
})();

View File

@ -0,0 +1 @@
!function(){"use strict";var o=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return o(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return{isContextMenuVisible:function(){return t.get()}}},r=function(t){return t.settings.contextmenu_never_use_native},u=function(t){return t.getParam("contextmenu","link openlink image inserttable | cell row column deletetable")},l=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=function(t){return l.DOM.select(t.settings.ui_container)[0]},a=function(t,n){return{x:t,y:n}},f=function(t,n,e){return a(t.x+n,t.y+e)},m=function(t,n){if(t&&"static"!==l.DOM.getStyle(t,"position",!0)){var e=l.DOM.getPos(t),o=e.x-t.scrollLeft,i=e.y-t.scrollTop;return f(n,-o,-i)}return f(n,0,0)},c=function(t,n){if(t.inline)return m(s(t),a((u=n).pageX,u.pageY));var e,o,i,r,u,c=(e=t.getContentAreaContainer(),o=a((r=n).clientX,r.clientY),i=l.DOM.getPos(e),f(o,i.x,i.y));return m(s(t),c)},g=tinymce.util.Tools.resolve("tinymce.ui.Factory"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),y=function(t,n,e,o){null===o.get()?o.set(function(e,n){var t,o,i=[];o=u(e),v.each(o.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"===t&&(n={text:t}),n&&(n.shortcut="",i.push(n))});for(var r=0;r<i.length;r++)"|"===i[r].text&&(0!==r&&r!==i.length-1||i.splice(r,1));return(t=g.create("menu",{items:i,context:"contextmenu",classes:"contextmenu"})).uiContainer=s(e),t.renderTo(s(e)),t.on("hide",function(t){t.control===this&&n.set(!1)}),e.on("remove",function(){t.remove(),t=null}),t}(t,e)):o.get().show(),o.get().moveTo(n.x,n.y),e.set(!0)},x=function(e,o,i){e.on("contextmenu",function(t){var n;n=e,(!t.ctrlKey||r(n))&&(t.preventDefault(),y(e,c(e,t),o,i))})};t.add("contextmenu",function(t){var n=o(null),e=o(!1);return x(t,e,n),i(e)})}();

View File

@ -0,0 +1,7 @@
// Exports the "directionality" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/directionality')
// ES2015:
// import 'tinymce/plugins/directionality'
require('./plugin.js');

View File

@ -0,0 +1,66 @@
(function () {
var directionality = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var setDir = function (editor, dir) {
var dom = editor.dom;
var curDir;
var blocks = editor.selection.getSelectedBlocks();
if (blocks.length) {
curDir = dom.getAttrib(blocks[0], 'dir');
global$1.each(blocks, function (block) {
if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) {
dom.setAttrib(block, 'dir', curDir !== dir ? dir : null);
}
});
editor.nodeChanged();
}
};
var Direction = { setDir: setDir };
var register = function (editor) {
editor.addCommand('mceDirectionLTR', function () {
Direction.setDir(editor, 'ltr');
});
editor.addCommand('mceDirectionRTL', function () {
Direction.setDir(editor, 'rtl');
});
};
var Commands = { register: register };
var generateSelector = function (dir) {
var selector = [];
global$1.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function (name) {
selector.push(name + '[dir=' + dir + ']');
});
return selector.join(',');
};
var register$1 = function (editor) {
editor.addButton('ltr', {
title: 'Left to right',
cmd: 'mceDirectionLTR',
stateSelector: generateSelector('ltr')
});
editor.addButton('rtl', {
title: 'Right to left',
cmd: 'mceDirectionRTL',
stateSelector: generateSelector('rtl')
});
};
var Buttons = { register: register$1 };
global.add('directionality', function (editor) {
Commands.register(editor);
Buttons.register(editor);
});
function Plugin () {
}
return Plugin;
}());
})();

View File

@ -0,0 +1 @@
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(t,e){var i,n=t.dom,o=t.selection.getSelectedBlocks();o.length&&(i=n.getAttrib(o[0],"dir"),c.each(o,function(t){n.getParent(t.parentNode,'*[dir="'+e+'"]',n.getRoot())||n.setAttrib(t,"dir",i!==e?e:null)}),t.nodeChanged())},i=function(t){t.addCommand("mceDirectionLTR",function(){e(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){e(t,"rtl")})},n=function(e){var i=[];return c.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(t){i.push(t+"[dir="+e+"]")}),i.join(",")},o=function(t){t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})};t.add("directionality",function(t){i(t),o(t)})}();

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

View File

@ -0,0 +1,7 @@
// Exports the "emoticons" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/emoticons')
// ES2015:
// import 'tinymce/plugins/emoticons'
require('./plugin.js');

View File

@ -0,0 +1,87 @@
(function () {
var emoticons = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var emoticons = [
[
'cool',
'cry',
'embarassed',
'foot-in-mouth'
],
[
'frown',
'innocent',
'kiss',
'laughing'
],
[
'money-mouth',
'sealed',
'smile',
'surprised'
],
[
'tongue-out',
'undecided',
'wink',
'yell'
]
];
var getHtml = function (pluginUrl) {
var emoticonsHtml;
emoticonsHtml = '<table role="list" class="mce-grid">';
global$1.each(emoticons, function (row) {
emoticonsHtml += '<tr>';
global$1.each(row, function (icon) {
var emoticonUrl = pluginUrl + '/img/smiley-' + icon + '.gif';
emoticonsHtml += '<td><a href="#" data-mce-url="' + emoticonUrl + '" data-mce-alt="' + icon + '" tabindex="-1" ' + 'role="option" aria-label="' + icon + '"><img src="' + emoticonUrl + '" style="width: 18px; height: 18px" role="presentation" /></a></td>';
});
emoticonsHtml += '</tr>';
});
emoticonsHtml += '</table>';
return emoticonsHtml;
};
var PanelHtml = { getHtml: getHtml };
var insertEmoticon = function (editor, src, alt) {
editor.insertContent(editor.dom.createHTML('img', {
src: src,
alt: alt
}));
};
var register = function (editor, pluginUrl) {
var panelHtml = PanelHtml.getHtml(pluginUrl);
editor.addButton('emoticons', {
type: 'panelbutton',
panel: {
role: 'application',
autohide: true,
html: panelHtml,
onclick: function (e) {
var linkElm = editor.dom.getParent(e.target, 'a');
if (linkElm) {
insertEmoticon(editor, linkElm.getAttribute('data-mce-url'), linkElm.getAttribute('data-mce-alt'));
this.hide();
}
}
},
tooltip: 'Emoticons'
});
};
var Buttons = { register: register };
global.add('emoticons', function (editor, pluginUrl) {
Buttons.register(editor, pluginUrl);
});
function Plugin () {
}
return Plugin;
}());
})();

View File

@ -0,0 +1 @@
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]],i=function(i){var o;return o='<table role="list" class="mce-grid">',e.each(n,function(t){o+="<tr>",e.each(t,function(t){var e=i+"/img/smiley-"+t+".gif";o+='<td><a href="#" data-mce-url="'+e+'" data-mce-alt="'+t+'" tabindex="-1" role="option" aria-label="'+t+'"><img src="'+e+'" style="width: 18px; height: 18px" role="presentation" /></a></td>'}),o+="</tr>"}),o+="</table>"},o=function(a,t){var e=i(t);a.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:e,onclick:function(t){var e,i,o,n=a.dom.getParent(t.target,"a");n&&(e=a,i=n.getAttribute("data-mce-url"),o=n.getAttribute("data-mce-alt"),e.insertContent(e.dom.createHTML("img",{src:i,alt:o})),this.hide())}},tooltip:"Emoticons"})};t.add("emoticons",function(t,e){o(t,e)})}();

View File

@ -0,0 +1,7 @@
// Exports the "fullpage" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/fullpage')
// ES2015:
// import 'tinymce/plugins/fullpage'
require('./plugin.js');

View File

@ -0,0 +1,519 @@
(function () {
var fullpage = (function () {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
var clone = function () {
return Cell(get());
};
return {
get: get,
set: set,
clone: clone
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$2 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
var global$3 = tinymce.util.Tools.resolve('tinymce.html.Node');
var global$4 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
var shouldHideInSourceView = function (editor) {
return editor.getParam('fullpage_hide_in_source_view');
};
var getDefaultXmlPi = function (editor) {
return editor.getParam('fullpage_default_xml_pi');
};
var getDefaultEncoding = function (editor) {
return editor.getParam('fullpage_default_encoding');
};
var getDefaultFontFamily = function (editor) {
return editor.getParam('fullpage_default_font_family');
};
var getDefaultFontSize = function (editor) {
return editor.getParam('fullpage_default_font_size');
};
var getDefaultTextColor = function (editor) {
return editor.getParam('fullpage_default_text_color');
};
var getDefaultTitle = function (editor) {
return editor.getParam('fullpage_default_title');
};
var getDefaultDocType = function (editor) {
return editor.getParam('fullpage_default_doctype', '<!DOCTYPE html>');
};
var Settings = {
shouldHideInSourceView: shouldHideInSourceView,
getDefaultXmlPi: getDefaultXmlPi,
getDefaultEncoding: getDefaultEncoding,
getDefaultFontFamily: getDefaultFontFamily,
getDefaultFontSize: getDefaultFontSize,
getDefaultTextColor: getDefaultTextColor,
getDefaultTitle: getDefaultTitle,
getDefaultDocType: getDefaultDocType
};
var parseHeader = function (head) {
return global$2({
validate: false,
root_name: '#document'
}).parse(head);
};
var htmlToData = function (editor, head) {
var headerFragment = parseHeader(head);
var data = {};
var elm, matches;
function getAttr(elm, name) {
var value = elm.attr(name);
return value || '';
}
data.fontface = Settings.getDefaultFontFamily(editor);
data.fontsize = Settings.getDefaultFontSize(editor);
elm = headerFragment.firstChild;
if (elm.type === 7) {
data.xml_pi = true;
matches = /encoding="([^"]+)"/.exec(elm.value);
if (matches) {
data.docencoding = matches[1];
}
}
elm = headerFragment.getAll('#doctype')[0];
if (elm) {
data.doctype = '<!DOCTYPE' + elm.value + '>';
}
elm = headerFragment.getAll('title')[0];
if (elm && elm.firstChild) {
data.title = elm.firstChild.value;
}
global$1.each(headerFragment.getAll('meta'), function (meta) {
var name = meta.attr('name');
var httpEquiv = meta.attr('http-equiv');
var matches;
if (name) {
data[name.toLowerCase()] = meta.attr('content');
} else if (httpEquiv === 'Content-Type') {
matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
if (matches) {
data.docencoding = matches[1];
}
}
});
elm = headerFragment.getAll('html')[0];
if (elm) {
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
}
data.stylesheets = [];
global$1.each(headerFragment.getAll('link'), function (link) {
if (link.attr('rel') === 'stylesheet') {
data.stylesheets.push(link.attr('href'));
}
});
elm = headerFragment.getAll('body')[0];
if (elm) {
data.langdir = getAttr(elm, 'dir');
data.style = getAttr(elm, 'style');
data.visited_color = getAttr(elm, 'vlink');
data.link_color = getAttr(elm, 'link');
data.active_color = getAttr(elm, 'alink');
}
return data;
};
var dataToHtml = function (editor, data, head) {
var headerFragment, headElement, html, elm, value;
var dom = editor.dom;
function setAttr(elm, name, value) {
elm.attr(name, value ? value : undefined);
}
function addHeadNode(node) {
if (headElement.firstChild) {
headElement.insert(node, headElement.firstChild);
} else {
headElement.append(node);
}
}
headerFragment = parseHeader(head);
headElement = headerFragment.getAll('head')[0];
if (!headElement) {
elm = headerFragment.getAll('html')[0];
headElement = new global$3('head', 1);
if (elm.firstChild) {
elm.insert(headElement, elm.firstChild, true);
} else {
elm.append(headElement);
}
}
elm = headerFragment.firstChild;
if (data.xml_pi) {
value = 'version="1.0"';
if (data.docencoding) {
value += ' encoding="' + data.docencoding + '"';
}
if (elm.type !== 7) {
elm = new global$3('xml', 7);
headerFragment.insert(elm, headerFragment.firstChild, true);
}
elm.value = value;
} else if (elm && elm.type === 7) {
elm.remove();
}
elm = headerFragment.getAll('#doctype')[0];
if (data.doctype) {
if (!elm) {
elm = new global$3('#doctype', 10);
if (data.xml_pi) {
headerFragment.insert(elm, headerFragment.firstChild);
} else {
addHeadNode(elm);
}
}
elm.value = data.doctype.substring(9, data.doctype.length - 1);
} else if (elm) {
elm.remove();
}
elm = null;
global$1.each(headerFragment.getAll('meta'), function (meta) {
if (meta.attr('http-equiv') === 'Content-Type') {
elm = meta;
}
});
if (data.docencoding) {
if (!elm) {
elm = new global$3('meta', 1);
elm.attr('http-equiv', 'Content-Type');
elm.shortEnded = true;
addHeadNode(elm);
}
elm.attr('content', 'text/html; charset=' + data.docencoding);
} else if (elm) {
elm.remove();
}
elm = headerFragment.getAll('title')[0];
if (data.title) {
if (!elm) {
elm = new global$3('title', 1);
addHeadNode(elm);
} else {
elm.empty();
}
elm.append(new global$3('#text', 3)).value = data.title;
} else if (elm) {
elm.remove();
}
global$1.each('keywords,description,author,copyright,robots'.split(','), function (name) {
var nodes = headerFragment.getAll('meta');
var i, meta;
var value = data[name];
for (i = 0; i < nodes.length; i++) {
meta = nodes[i];
if (meta.attr('name') === name) {
if (value) {
meta.attr('content', value);
} else {
meta.remove();
}
return;
}
}
if (value) {
elm = new global$3('meta', 1);
elm.attr('name', name);
elm.attr('content', value);
elm.shortEnded = true;
addHeadNode(elm);
}
});
var currentStyleSheetsMap = {};
global$1.each(headerFragment.getAll('link'), function (stylesheet) {
if (stylesheet.attr('rel') === 'stylesheet') {
currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet;
}
});
global$1.each(data.stylesheets, function (stylesheet) {
if (!currentStyleSheetsMap[stylesheet]) {
elm = new global$3('link', 1);
elm.attr({
rel: 'stylesheet',
text: 'text/css',
href: stylesheet
});
elm.shortEnded = true;
addHeadNode(elm);
}
delete currentStyleSheetsMap[stylesheet];
});
global$1.each(currentStyleSheetsMap, function (stylesheet) {
stylesheet.remove();
});
elm = headerFragment.getAll('body')[0];
if (elm) {
setAttr(elm, 'dir', data.langdir);
setAttr(elm, 'style', data.style);
setAttr(elm, 'vlink', data.visited_color);
setAttr(elm, 'link', data.link_color);
setAttr(elm, 'alink', data.active_color);
dom.setAttribs(editor.getBody(), {
style: data.style,
dir: data.dir,
vLink: data.visited_color,
link: data.link_color,
aLink: data.active_color
});
}
elm = headerFragment.getAll('html')[0];
if (elm) {
setAttr(elm, 'lang', data.langcode);
setAttr(elm, 'xml:lang', data.langcode);
}
if (!headElement.firstChild) {
headElement.remove();
}
html = global$4({
validate: false,
indent: true,
apply_source_formatting: true,
indent_before: 'head,html,body,meta,title,script,link,style',
indent_after: 'head,html,body,meta,title,script,link,style'
}).serialize(headerFragment);
return html.substring(0, html.indexOf('</body>'));
};
var Parser = {
parseHeader: parseHeader,
htmlToData: htmlToData,
dataToHtml: dataToHtml
};
var open = function (editor, headState) {
var data = Parser.htmlToData(editor, headState.get());
editor.windowManager.open({
title: 'Document properties',
data: data,
defaults: {
type: 'textbox',
size: 40
},
body: [
{
name: 'title',
label: 'Title'
},
{
name: 'keywords',
label: 'Keywords'
},
{
name: 'description',
label: 'Description'
},
{
name: 'robots',
label: 'Robots'
},
{
name: 'author',
label: 'Author'
},
{
name: 'docencoding',
label: 'Encoding'
}
],
onSubmit: function (e) {
var headHtml = Parser.dataToHtml(editor, global$1.extend(data, e.data), headState.get());
headState.set(headHtml);
}
});
};
var Dialog = { open: open };
var register = function (editor, headState) {
editor.addCommand('mceFullPageProperties', function () {
Dialog.open(editor, headState);
});
};
var Commands = { register: register };
var protectHtml = function (protect, html) {
global$1.each(protect, function (pattern) {
html = html.replace(pattern, function (str) {
return '<!--mce:protected ' + escape(str) + '-->';
});
});
return html;
};
var unprotectHtml = function (html) {
return html.replace(/<!--mce:protected ([\s\S]*?)-->/g, function (a, m) {
return unescape(m);
});
};
var Protect = {
protectHtml: protectHtml,
unprotectHtml: unprotectHtml
};
var each = global$1.each;
var low = function (s) {
return s.replace(/<\/?[A-Z]+/g, function (a) {
return a.toLowerCase();
});
};
var handleSetContent = function (editor, headState, footState, evt) {
var startPos, endPos, content, headerFragment, styles = '';
var dom = editor.dom;
var elm;
if (evt.selection) {
return;
}
content = Protect.protectHtml(editor.settings.protect, evt.content);
if (evt.format === 'raw' && headState.get()) {
return;
}
if (evt.source_view && Settings.shouldHideInSourceView(editor)) {
return;
}
if (content.length === 0 && !evt.source_view) {
content = global$1.trim(headState.get()) + '\n' + global$1.trim(content) + '\n' + global$1.trim(footState.get());
}
content = content.replace(/<(\/?)BODY/gi, '<$1body');
startPos = content.indexOf('<body');
if (startPos !== -1) {
startPos = content.indexOf('>', startPos);
headState.set(low(content.substring(0, startPos + 1)));
endPos = content.indexOf('</body', startPos);
if (endPos === -1) {
endPos = content.length;
}
evt.content = global$1.trim(content.substring(startPos + 1, endPos));
footState.set(low(content.substring(endPos)));
} else {
headState.set(getDefaultHeader(editor));
footState.set('\n</body>\n</html>');
}
headerFragment = Parser.parseHeader(headState.get());
each(headerFragment.getAll('style'), function (node) {
if (node.firstChild) {
styles += node.firstChild.value;
}
});
elm = headerFragment.getAll('body')[0];
if (elm) {
dom.setAttribs(editor.getBody(), {
style: elm.attr('style') || '',
dir: elm.attr('dir') || '',
vLink: elm.attr('vlink') || '',
link: elm.attr('link') || '',
aLink: elm.attr('alink') || ''
});
}
dom.remove('fullpage_styles');
var headElm = editor.getDoc().getElementsByTagName('head')[0];
if (styles) {
dom.add(headElm, 'style', { id: 'fullpage_styles' }, styles);
elm = dom.get('fullpage_styles');
if (elm.styleSheet) {
elm.styleSheet.cssText = styles;
}
}
var currentStyleSheetsMap = {};
global$1.each(headElm.getElementsByTagName('link'), function (stylesheet) {
if (stylesheet.rel === 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) {
currentStyleSheetsMap[stylesheet.href] = stylesheet;
}
});
global$1.each(headerFragment.getAll('link'), function (stylesheet) {
var href = stylesheet.attr('href');
if (!href) {
return true;
}
if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') === 'stylesheet') {
dom.add(headElm, 'link', {
'rel': 'stylesheet',
'text': 'text/css',
'href': href,
'data-mce-fullpage': '1'
});
}
delete currentStyleSheetsMap[href];
});
global$1.each(currentStyleSheetsMap, function (stylesheet) {
stylesheet.parentNode.removeChild(stylesheet);
});
};
var getDefaultHeader = function (editor) {
var header = '', value, styles = '';
if (Settings.getDefaultXmlPi(editor)) {
var piEncoding = Settings.getDefaultEncoding(editor);
header += '<?xml version="1.0" encoding="' + (piEncoding ? piEncoding : 'ISO-8859-1') + '" ?>\n';
}
header += Settings.getDefaultDocType(editor);
header += '\n<html>\n<head>\n';
if (value = Settings.getDefaultTitle(editor)) {
header += '<title>' + value + '</title>\n';
}
if (value = Settings.getDefaultEncoding(editor)) {
header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';
}
if (value = Settings.getDefaultFontFamily(editor)) {
styles += 'font-family: ' + value + ';';
}
if (value = Settings.getDefaultFontSize(editor)) {
styles += 'font-size: ' + value + ';';
}
if (value = Settings.getDefaultTextColor(editor)) {
styles += 'color: ' + value + ';';
}
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
return header;
};
var handleGetContent = function (editor, head, foot, evt) {
if (!evt.selection && (!evt.source_view || !Settings.shouldHideInSourceView(editor))) {
evt.content = Protect.unprotectHtml(global$1.trim(head) + '\n' + global$1.trim(evt.content) + '\n' + global$1.trim(foot));
}
};
var setup = function (editor, headState, footState) {
editor.on('BeforeSetContent', function (evt) {
handleSetContent(editor, headState, footState, evt);
});
editor.on('GetContent', function (evt) {
handleGetContent(editor, headState.get(), footState.get(), evt);
});
};
var FilterContent = { setup: setup };
var register$1 = function (editor) {
editor.addButton('fullpage', {
title: 'Document properties',
cmd: 'mceFullPageProperties'
});
editor.addMenuItem('fullpage', {
text: 'Document properties',
cmd: 'mceFullPageProperties',
context: 'file'
});
};
var Buttons = { register: register$1 };
global.add('fullpage', function (editor) {
var headState = Cell(''), footState = Cell('');
Commands.register(editor, headState);
Buttons.register(editor);
FilterContent.setup(editor, headState, footState);
});
function Plugin () {
}
return Plugin;
}());
})();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
// Exports the "fullscreen" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/fullscreen')
// ES2015:
// import 'tinymce/plugins/fullscreen'
require('./plugin.js');

View File

@ -0,0 +1,177 @@
(function () {
var fullscreen = (function (domGlobals) {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
var clone = function () {
return Cell(get());
};
return {
get: get,
set: set,
clone: clone
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var get = function (fullscreenState) {
return {
isFullscreen: function () {
return fullscreenState.get() !== null;
}
};
};
var Api = { get: get };
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var fireFullscreenStateChanged = function (editor, state) {
editor.fire('FullscreenStateChanged', { state: state });
};
var Events = { fireFullscreenStateChanged: fireFullscreenStateChanged };
var DOM = global$1.DOM;
var getWindowSize = function () {
var w;
var h;
var win = domGlobals.window;
var doc = domGlobals.document;
var body = doc.body;
if (body.offsetWidth) {
w = body.offsetWidth;
h = body.offsetHeight;
}
if (win.innerWidth && win.innerHeight) {
w = win.innerWidth;
h = win.innerHeight;
}
return {
w: w,
h: h
};
};
var getScrollPos = function () {
var vp = DOM.getViewPort();
return {
x: vp.x,
y: vp.y
};
};
var setScrollPos = function (pos) {
domGlobals.window.scrollTo(pos.x, pos.y);
};
var toggleFullscreen = function (editor, fullscreenState) {
var body = domGlobals.document.body;
var documentElement = domGlobals.document.documentElement;
var editorContainerStyle;
var editorContainer, iframe, iframeStyle;
var fullscreenInfo = fullscreenState.get();
var resize = function () {
DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
};
var removeResize = function () {
DOM.unbind(domGlobals.window, 'resize', resize);
};
editorContainer = editor.getContainer();
editorContainerStyle = editorContainer.style;
iframe = editor.getContentAreaContainer().firstChild;
iframeStyle = iframe.style;
if (!fullscreenInfo) {
var newFullScreenInfo = {
scrollPos: getScrollPos(),
containerWidth: editorContainerStyle.width,
containerHeight: editorContainerStyle.height,
iframeWidth: iframeStyle.width,
iframeHeight: iframeStyle.height,
resizeHandler: resize,
removeHandler: removeResize
};
iframeStyle.width = iframeStyle.height = '100%';
editorContainerStyle.width = editorContainerStyle.height = '';
DOM.addClass(body, 'mce-fullscreen');
DOM.addClass(documentElement, 'mce-fullscreen');
DOM.addClass(editorContainer, 'mce-fullscreen');
DOM.bind(domGlobals.window, 'resize', resize);
editor.on('remove', removeResize);
resize();
fullscreenState.set(newFullScreenInfo);
Events.fireFullscreenStateChanged(editor, true);
} else {
iframeStyle.width = fullscreenInfo.iframeWidth;
iframeStyle.height = fullscreenInfo.iframeHeight;
if (fullscreenInfo.containerWidth) {
editorContainerStyle.width = fullscreenInfo.containerWidth;
}
if (fullscreenInfo.containerHeight) {
editorContainerStyle.height = fullscreenInfo.containerHeight;
}
DOM.removeClass(body, 'mce-fullscreen');
DOM.removeClass(documentElement, 'mce-fullscreen');
DOM.removeClass(editorContainer, 'mce-fullscreen');
setScrollPos(fullscreenInfo.scrollPos);
DOM.unbind(domGlobals.window, 'resize', fullscreenInfo.resizeHandler);
editor.off('remove', fullscreenInfo.removeHandler);
fullscreenState.set(null);
Events.fireFullscreenStateChanged(editor, false);
}
};
var Actions = { toggleFullscreen: toggleFullscreen };
var register = function (editor, fullscreenState) {
editor.addCommand('mceFullScreen', function () {
Actions.toggleFullscreen(editor, fullscreenState);
});
};
var Commands = { register: register };
var postRender = function (editor) {
return function (e) {
var ctrl = e.control;
editor.on('FullscreenStateChanged', function (e) {
ctrl.active(e.state);
});
};
};
var register$1 = function (editor) {
editor.addMenuItem('fullscreen', {
text: 'Fullscreen',
shortcut: 'Ctrl+Shift+F',
selectable: true,
cmd: 'mceFullScreen',
onPostRender: postRender(editor),
context: 'view'
});
editor.addButton('fullscreen', {
active: false,
tooltip: 'Fullscreen',
cmd: 'mceFullScreen',
onPostRender: postRender(editor)
});
};
var Buttons = { register: register$1 };
global.add('fullscreen', function (editor) {
var fullscreenState = Cell(null);
if (editor.settings.inline) {
return Api.get(fullscreenState);
}
Commands.register(editor, fullscreenState);
Buttons.register(editor);
editor.addShortcut('Ctrl+Shift+F', '', 'mceFullScreen');
return Api.get(fullscreenState);
});
function Plugin () {
}
return Plugin;
}(window));
})();

View File

@ -0,0 +1 @@
!function(m){"use strict";var i=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return i(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return{isFullscreen:function(){return null!==e.get()}}},n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),g=function(e,n){e.fire("FullscreenStateChanged",{state:n})},w=n.DOM,r=function(e,n){var t,r,l,i,o,c,s=m.document.body,u=m.document.documentElement,d=n.get(),a=function(){var e,n,t,i;w.setStyle(l,"height",(t=m.window,i=m.document.body,i.offsetWidth&&(e=i.offsetWidth,n=i.offsetHeight),t.innerWidth&&t.innerHeight&&(e=t.innerWidth,n=t.innerHeight),{w:e,h:n}).h-(r.clientHeight-l.clientHeight))},h=function(){w.unbind(m.window,"resize",a)};if(t=(r=e.getContainer()).style,i=(l=e.getContentAreaContainer().firstChild).style,d)i.width=d.iframeWidth,i.height=d.iframeHeight,d.containerWidth&&(t.width=d.containerWidth),d.containerHeight&&(t.height=d.containerHeight),w.removeClass(s,"mce-fullscreen"),w.removeClass(u,"mce-fullscreen"),w.removeClass(r,"mce-fullscreen"),o=d.scrollPos,m.window.scrollTo(o.x,o.y),w.unbind(m.window,"resize",d.resizeHandler),e.off("remove",d.removeHandler),n.set(null),g(e,!1);else{var f={scrollPos:(c=w.getViewPort(),{x:c.x,y:c.y}),containerWidth:t.width,containerHeight:t.height,iframeWidth:i.width,iframeHeight:i.height,resizeHandler:a,removeHandler:h};i.width=i.height="100%",t.width=t.height="",w.addClass(s,"mce-fullscreen"),w.addClass(u,"mce-fullscreen"),w.addClass(r,"mce-fullscreen"),w.bind(m.window,"resize",a),e.on("remove",h),a(),n.set(f),g(e,!0)}},l=function(e,n){e.addCommand("mceFullScreen",function(){r(e,n)})},o=function(t){return function(e){var n=e.control;t.on("FullscreenStateChanged",function(e){n.active(e.state)})}},c=function(e){e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,cmd:"mceFullScreen",onPostRender:o(e),context:"view"}),e.addButton("fullscreen",{active:!1,tooltip:"Fullscreen",cmd:"mceFullScreen",onPostRender:o(e)})};e.add("fullscreen",function(e){var n=i(null);return e.settings.inline||(l(e,n),c(e),e.addShortcut("Ctrl+Shift+F","","mceFullScreen")),t(n)})}(window);

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,7 @@
// Exports the "help" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/help')
// ES2015:
// import 'tinymce/plugins/help'
require('./plugin.js');

View File

@ -0,0 +1,659 @@
(function () {
var help = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var noop = function () {
};
var constant = function (value) {
return function () {
return value;
};
};
function curry(fn) {
var initialArgs = [];
for (var _i = 1; _i < arguments.length; _i++) {
initialArgs[_i - 1] = arguments[_i];
}
return function () {
var restArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
restArgs[_i] = arguments[_i];
}
var all = initialArgs.concat(restArgs);
return fn.apply(null, all);
};
}
var not = function (f) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return !f.apply(null, args);
};
};
var never = constant(false);
var always = constant(true);
var none = function () {
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var me = {
fold: function (n, s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
getOrThunk: call,
getOrDie: function (msg) {
throw new Error(msg || 'error: getOrDie called on none.');
},
getOrNull: constant(null),
getOrUndefined: constant(undefined),
or: id,
orThunk: call,
map: none,
each: noop,
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
toArray: function () {
return [];
},
toString: constant('none()')
};
if (Object.freeze) {
Object.freeze(me);
}
return me;
}();
var some = function (a) {
var constant_a = constant(a);
var self = function () {
return me;
};
var bind = function (f) {
return f(a);
};
var me = {
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
getOrThunk: constant_a,
getOrDie: constant_a,
getOrNull: constant_a,
getOrUndefined: constant_a,
or: self,
orThunk: self,
map: function (f) {
return some(f(a));
},
each: function (f) {
f(a);
},
bind: bind,
exists: bind,
forall: bind,
filter: function (f) {
return f(a) ? me : NONE;
},
toArray: function () {
return [a];
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
};
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
some: some,
none: none,
from: from
};
var typeOf = function (x) {
if (x === null) {
return 'null';
}
var t = typeof x;
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
return 'array';
}
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
return 'string';
}
return t;
};
var isType = function (type) {
return function (value) {
return typeOf(value) === type;
};
};
var isFunction = isType('function');
var nativeSlice = Array.prototype.slice;
var nativeIndexOf = Array.prototype.indexOf;
var rawIndexOf = function (ts, t) {
return nativeIndexOf.call(ts, t);
};
var contains = function (xs, x) {
return rawIndexOf(xs, x) > -1;
};
var map = function (xs, f) {
var len = xs.length;
var r = new Array(len);
for (var i = 0; i < len; i++) {
var x = xs[i];
r[i] = f(x, i);
}
return r;
};
var filter = function (xs, pred) {
var r = [];
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
if (pred(x, i)) {
r.push(x);
}
}
return r;
};
var find = function (xs, pred) {
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
if (pred(x, i)) {
return Option.some(x);
}
}
return Option.none();
};
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
return nativeSlice.call(x);
};
var global$1 = tinymce.util.Tools.resolve('tinymce.util.I18n');
var global$2 = tinymce.util.Tools.resolve('tinymce.Env');
var meta = global$2.mac ? '\u2318' : 'Ctrl';
var access = global$2.mac ? 'Ctrl + Alt' : 'Shift + Alt';
var shortcuts = [
{
shortcut: meta + ' + B',
action: 'Bold'
},
{
shortcut: meta + ' + I',
action: 'Italic'
},
{
shortcut: meta + ' + U',
action: 'Underline'
},
{
shortcut: meta + ' + A',
action: 'Select all'
},
{
shortcut: meta + ' + Y or ' + meta + ' + Shift + Z',
action: 'Redo'
},
{
shortcut: meta + ' + Z',
action: 'Undo'
},
{
shortcut: access + ' + 1',
action: 'Header 1'
},
{
shortcut: access + ' + 2',
action: 'Header 2'
},
{
shortcut: access + ' + 3',
action: 'Header 3'
},
{
shortcut: access + ' + 4',
action: 'Header 4'
},
{
shortcut: access + ' + 5',
action: 'Header 5'
},
{
shortcut: access + ' + 6',
action: 'Header 6'
},
{
shortcut: access + ' + 7',
action: 'Paragraph'
},
{
shortcut: access + ' + 8',
action: 'Div'
},
{
shortcut: access + ' + 9',
action: 'Address'
},
{
shortcut: 'Alt + F9',
action: 'Focus to menubar'
},
{
shortcut: 'Alt + F10',
action: 'Focus to toolbar'
},
{
shortcut: 'Alt + F11',
action: 'Focus to element path'
},
{
shortcut: 'Ctrl + F9',
action: 'Focus to contextual toolbar'
},
{
shortcut: meta + ' + K',
action: 'Insert link (if link plugin activated)'
},
{
shortcut: meta + ' + S',
action: 'Save (if save plugin activated)'
},
{
shortcut: meta + ' + F',
action: 'Find (if searchreplace plugin activated)'
}
];
var KeyboardShortcuts = { shortcuts: shortcuts };
var makeTab = function () {
var makeAriaLabel = function (shortcut) {
return 'aria-label="Action: ' + shortcut.action + ', Shortcut: ' + shortcut.shortcut.replace(/Ctrl/g, 'Control') + '"';
};
var shortcutLisString = map(KeyboardShortcuts.shortcuts, function (shortcut) {
return '<tr data-mce-tabstop="1" tabindex="-1" ' + makeAriaLabel(shortcut) + '>' + '<td>' + global$1.translate(shortcut.action) + '</td>' + '<td>' + shortcut.shortcut + '</td>' + '</tr>';
}).join('');
return {
title: 'Handy Shortcuts',
type: 'container',
style: 'overflow-y: auto; overflow-x: hidden; max-height: 250px',
items: [{
type: 'container',
html: '<div>' + '<table class="mce-table-striped">' + '<thead>' + '<th>' + global$1.translate('Action') + '</th>' + '<th>' + global$1.translate('Shortcut') + '</th>' + '</thead>' + shortcutLisString + '</table>' + '</div>'
}]
};
};
var KeyboardShortcutsTab = { makeTab: makeTab };
var keys = Object.keys;
var supplant = function (str, obj) {
var isStringOrNumber = function (a) {
var t = typeof a;
return t === 'string' || t === 'number';
};
return str.replace(/\$\{([^{}]*)\}/g, function (fullMatch, key) {
var value = obj[key];
return isStringOrNumber(value) ? value.toString() : fullMatch;
});
};
var urls = [
{
key: 'advlist',
name: 'Advanced List'
},
{
key: 'anchor',
name: 'Anchor'
},
{
key: 'autolink',
name: 'Autolink'
},
{
key: 'autoresize',
name: 'Autoresize'
},
{
key: 'autosave',
name: 'Autosave'
},
{
key: 'bbcode',
name: 'BBCode'
},
{
key: 'charmap',
name: 'Character Map'
},
{
key: 'code',
name: 'Code'
},
{
key: 'codesample',
name: 'Code Sample'
},
{
key: 'colorpicker',
name: 'Color Picker'
},
{
key: 'compat3x',
name: '3.x Compatibility'
},
{
key: 'contextmenu',
name: 'Context Menu'
},
{
key: 'directionality',
name: 'Directionality'
},
{
key: 'emoticons',
name: 'Emoticons'
},
{
key: 'fullpage',
name: 'Full Page'
},
{
key: 'fullscreen',
name: 'Full Screen'
},
{
key: 'help',
name: 'Help'
},
{
key: 'hr',
name: 'Horizontal Rule'
},
{
key: 'image',
name: 'Image'
},
{
key: 'imagetools',
name: 'Image Tools'
},
{
key: 'importcss',
name: 'Import CSS'
},
{
key: 'insertdatetime',
name: 'Insert Date/Time'
},
{
key: 'legacyoutput',
name: 'Legacy Output'
},
{
key: 'link',
name: 'Link'
},
{
key: 'lists',
name: 'Lists'
},
{
key: 'media',
name: 'Media'
},
{
key: 'nonbreaking',
name: 'Nonbreaking'
},
{
key: 'noneditable',
name: 'Noneditable'
},
{
key: 'pagebreak',
name: 'Page Break'
},
{
key: 'paste',
name: 'Paste'
},
{
key: 'preview',
name: 'Preview'
},
{
key: 'print',
name: 'Print'
},
{
key: 'save',
name: 'Save'
},
{
key: 'searchreplace',
name: 'Search and Replace'
},
{
key: 'spellchecker',
name: 'Spell Checker'
},
{
key: 'tabfocus',
name: 'Tab Focus'
},
{
key: 'table',
name: 'Table'
},
{
key: 'template',
name: 'Template'
},
{
key: 'textcolor',
name: 'Text Color'
},
{
key: 'textpattern',
name: 'Text Pattern'
},
{
key: 'toc',
name: 'Table of Contents'
},
{
key: 'visualblocks',
name: 'Visual Blocks'
},
{
key: 'visualchars',
name: 'Visual Characters'
},
{
key: 'wordcount',
name: 'Word Count'
}
];
var PluginUrls = { urls: urls };
var makeLink = curry(supplant, '<a href="${url}" target="_blank" rel="noopener">${name}</a>');
var maybeUrlize = function (editor, key) {
return find(PluginUrls.urls, function (x) {
return x.key === key;
}).fold(function () {
var getMetadata = editor.plugins[key].getMetadata;
return typeof getMetadata === 'function' ? makeLink(getMetadata()) : key;
}, function (x) {
return makeLink({
name: x.name,
url: 'https://www.tinymce.com/docs/plugins/' + x.key
});
});
};
var getPluginKeys = function (editor) {
var keys$1 = keys(editor.plugins);
return editor.settings.forced_plugins === undefined ? keys$1 : filter(keys$1, not(curry(contains, editor.settings.forced_plugins)));
};
var pluginLister = function (editor) {
var pluginKeys = getPluginKeys(editor);
var pluginLis = map(pluginKeys, function (key) {
return '<li>' + maybeUrlize(editor, key) + '</li>';
});
var count = pluginLis.length;
var pluginsString = pluginLis.join('');
return '<p><b>' + global$1.translate([
'Plugins installed ({0}):',
count
]) + '</b></p>' + '<ul>' + pluginsString + '</ul>';
};
var installedPlugins = function (editor) {
return {
type: 'container',
html: '<div style="overflow-y: auto; overflow-x: hidden; max-height: 230px; height: 230px;" data-mce-tabstop="1" tabindex="-1">' + pluginLister(editor) + '</div>',
flex: 1
};
};
var availablePlugins = function () {
return {
type: 'container',
html: '<div style="padding: 10px; background: #e3e7f4; height: 100%;" data-mce-tabstop="1" tabindex="-1">' + '<p><b>' + global$1.translate('Premium plugins:') + '</b></p>' + '<ul>' + '<li>PowerPaste</li>' + '<li>Spell Checker Pro</li>' + '<li>Accessibility Checker</li>' + '<li>Advanced Code Editor</li>' + '<li>Enhanced Media Embed</li>' + '<li>Link Checker</li>' + '</ul><br />' + '<p style="float: right;"><a href="https://www.tinymce.com/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">' + global$1.translate('Learn more...') + '</a></p>' + '</div>',
flex: 1
};
};
var makeTab$1 = function (editor) {
return {
title: 'Plugins',
type: 'container',
style: 'overflow-y: auto; overflow-x: hidden;',
layout: 'flex',
padding: 10,
spacing: 10,
items: [
installedPlugins(editor),
availablePlugins()
]
};
};
var PluginsTab = { makeTab: makeTab$1 };
var global$3 = tinymce.util.Tools.resolve('tinymce.EditorManager');
var getVersion = function (major, minor) {
return major.indexOf('@') === 0 ? 'X.X.X' : major + '.' + minor;
};
var makeRow = function () {
var version = getVersion(global$3.majorVersion, global$3.minorVersion);
var changeLogLink = '<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE ' + version + '</a>';
return [
{
type: 'label',
html: global$1.translate([
'You are using {0}',
changeLogLink
])
},
{
type: 'spacer',
flex: 1
},
{
text: 'Close',
onclick: function () {
this.parent().parent().close();
}
}
];
};
var ButtonsRow = { makeRow: makeRow };
var open = function (editor, pluginUrl) {
return function () {
editor.windowManager.open({
title: 'Help',
bodyType: 'tabpanel',
layout: 'flex',
body: [
KeyboardShortcutsTab.makeTab(),
PluginsTab.makeTab(editor)
],
buttons: ButtonsRow.makeRow(),
onPostRender: function () {
var title = this.getEl('title');
title.innerHTML = '<img src="' + pluginUrl + '/img/logo.png" alt="TinyMCE Logo" style="display: inline-block; width: 200px; height: 50px">';
}
});
};
};
var Dialog = { open: open };
var register = function (editor, pluginUrl) {
editor.addCommand('mceHelp', Dialog.open(editor, pluginUrl));
};
var Commands = { register: register };
var register$1 = function (editor, pluginUrl) {
editor.addButton('help', {
icon: 'help',
onclick: Dialog.open(editor, pluginUrl)
});
editor.addMenuItem('help', {
text: 'Help',
icon: 'help',
context: 'help',
onclick: Dialog.open(editor, pluginUrl)
});
};
var Buttons = { register: register$1 };
global.add('help', function (editor, pluginUrl) {
Buttons.register(editor, pluginUrl);
Commands.register(editor, pluginUrl);
editor.shortcuts.add('Alt+0', 'Open help dialog', 'mceHelp');
});
function Plugin () {
}
return Plugin;
}());
})();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
// Exports the "hr" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/hr')
// ES2015:
// import 'tinymce/plugins/hr'
require('./plugin.js');

View File

@ -0,0 +1,39 @@
(function () {
var hr = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var register = function (editor) {
editor.addCommand('InsertHorizontalRule', function () {
editor.execCommand('mceInsertContent', false, '<hr />');
});
};
var Commands = { register: register };
var register$1 = function (editor) {
editor.addButton('hr', {
icon: 'hr',
tooltip: 'Horizontal line',
cmd: 'InsertHorizontalRule'
});
editor.addMenuItem('hr', {
icon: 'hr',
text: 'Horizontal line',
cmd: 'InsertHorizontalRule',
context: 'insert'
});
};
var Buttons = { register: register$1 };
global.add('hr', function (editor) {
Commands.register(editor);
Buttons.register(editor);
});
function Plugin () {
}
return Plugin;
}());
})();

Some files were not shown because too many files have changed in this diff Show More