正在显示
108 个修改的文件
包含
884 行增加
和
664 行删除
| ... | @@ -6,6 +6,8 @@ | ... | @@ -6,6 +6,8 @@ |
| 6 | [ | 6 | [ |
| 7 | "@babel/preset-env", | 7 | "@babel/preset-env", |
| 8 | { | 8 | { |
| 9 | + "useBuiltIns": "usage", | ||
| 10 | + "corejs": 3, | ||
| 9 | "targets": { | 11 | "targets": { |
| 10 | "node": 7 | 12 | "node": 7 |
| 11 | } | 13 | } |
| ... | @@ -46,7 +48,9 @@ | ... | @@ -46,7 +48,9 @@ |
| 46 | [ | 48 | [ |
| 47 | "@babel/preset-env", | 49 | "@babel/preset-env", |
| 48 | { | 50 | { |
| 49 | - "modules": false | 51 | + "modules": false, |
| 52 | + "useBuiltIns": "entry", | ||
| 53 | + "corejs": 3 | ||
| 50 | } | 54 | } |
| 51 | ] | 55 | ] |
| 52 | ], | 56 | ], |
| ... | @@ -84,7 +88,9 @@ | ... | @@ -84,7 +88,9 @@ |
| 84 | [ | 88 | [ |
| 85 | "@babel/preset-env", | 89 | "@babel/preset-env", |
| 86 | { | 90 | { |
| 87 | - "modules": false | 91 | + "modules": false, |
| 92 | + "useBuiltIns": "entry", | ||
| 93 | + "corejs": 3 | ||
| 88 | } | 94 | } |
| 89 | ] | 95 | ] |
| 90 | ], | 96 | ], | ... | ... |
| ... | @@ -11,7 +11,6 @@ const Multispinner = require('multispinner') | ... | @@ -11,7 +11,6 @@ const Multispinner = require('multispinner') |
| 11 | 11 | ||
| 12 | const mainConfig = require('./webpack.main.config') | 12 | const mainConfig = require('./webpack.main.config') |
| 13 | const rendererConfig = require('./webpack.renderer.config') | 13 | const rendererConfig = require('./webpack.renderer.config') |
| 14 | -const webConfig = require('./webpack.web.config') | ||
| 15 | 14 | ||
| 16 | const doneLog = chalk.bgGreen.white(' DONE ') + ' ' | 15 | const doneLog = chalk.bgGreen.white(' DONE ') + ' ' |
| 17 | const errorLog = chalk.bgRed.white(' ERROR ') + ' ' | 16 | const errorLog = chalk.bgRed.white(' ERROR ') + ' ' |
| ... | @@ -22,13 +21,13 @@ if (process.env.BUILD_TARGET === 'clean') clean() | ... | @@ -22,13 +21,13 @@ if (process.env.BUILD_TARGET === 'clean') clean() |
| 22 | else if (process.env.BUILD_TARGET === 'web') web() | 21 | else if (process.env.BUILD_TARGET === 'web') web() |
| 23 | else build() | 22 | else build() |
| 24 | 23 | ||
| 25 | -function clean () { | 24 | +function clean() { |
| 26 | - del.sync(['dist/electron/*','build/*', '!build/icons','!build/lib','!build/lib/electron-build.*', '!build/icons/icon.*']) | 25 | + del.sync(['dist/electron/*', 'dist/web/*', 'build/*', '!build/icons', '!build/lib', '!build/lib/electron-build.*', '!build/icons/icon.*']) |
| 27 | console.log(`\n${doneLog}clear done`) | 26 | console.log(`\n${doneLog}clear done`) |
| 28 | process.exit() | 27 | process.exit() |
| 29 | } | 28 | } |
| 30 | 29 | ||
| 31 | -function build () { | 30 | +function build() { |
| 32 | greeting() | 31 | greeting() |
| 33 | 32 | ||
| 34 | del.sync(['dist/electron/*', '!.gitkeep']) | 33 | del.sync(['dist/electron/*', '!.gitkeep']) |
| ... | @@ -69,7 +68,7 @@ function build () { | ... | @@ -69,7 +68,7 @@ function build () { |
| 69 | }) | 68 | }) |
| 70 | } | 69 | } |
| 71 | 70 | ||
| 72 | -function pack (config) { | 71 | +function pack(config) { |
| 73 | return new Promise((resolve, reject) => { | 72 | return new Promise((resolve, reject) => { |
| 74 | config.mode = 'production' | 73 | config.mode = 'production' |
| 75 | webpack(config, (err, stats) => { | 74 | webpack(config, (err, stats) => { |
| ... | @@ -97,10 +96,10 @@ function pack (config) { | ... | @@ -97,10 +96,10 @@ function pack (config) { |
| 97 | }) | 96 | }) |
| 98 | } | 97 | } |
| 99 | 98 | ||
| 100 | -function web () { | 99 | +function web() { |
| 101 | del.sync(['dist/web/*', '!.gitkeep']) | 100 | del.sync(['dist/web/*', '!.gitkeep']) |
| 102 | - webConfig.mode = 'production' | 101 | + rendererConfig.mode = 'production' |
| 103 | - webpack(webConfig, (err, stats) => { | 102 | + webpack(rendererConfig, (err, stats) => { |
| 104 | if (err || stats.hasErrors()) console.log(err) | 103 | if (err || stats.hasErrors()) console.log(err) |
| 105 | 104 | ||
| 106 | console.log(stats.toString({ | 105 | console.log(stats.toString({ |
| ... | @@ -112,7 +111,7 @@ function web () { | ... | @@ -112,7 +111,7 @@ function web () { |
| 112 | }) | 111 | }) |
| 113 | } | 112 | } |
| 114 | 113 | ||
| 115 | -function greeting () { | 114 | +function greeting() { |
| 116 | const cols = process.stdout.columns | 115 | const cols = process.stdout.columns |
| 117 | let text = '' | 116 | let text = '' |
| 118 | 117 | ... | ... |
| 1 | 'use strict' | 1 | 'use strict' |
| 2 | 2 | ||
| 3 | +process.env.NODE_ENV = 'development' | ||
| 4 | + | ||
| 3 | const chalk = require('chalk') | 5 | const chalk = require('chalk') |
| 4 | const electron = require('electron') | 6 | const electron = require('electron') |
| 5 | const path = require('path') | 7 | const path = require('path') |
| ... | @@ -75,13 +77,10 @@ function startRenderer() { | ... | @@ -75,13 +77,10 @@ function startRenderer() { |
| 75 | heartbeat: 2500 | 77 | heartbeat: 2500 |
| 76 | }) | 78 | }) |
| 77 | 79 | ||
| 78 | - compiler.hooks.compilation.tap('compilation', compilation => { | 80 | + compiler.hooks.afterEmit.tap('afterEmit', () => { |
| 79 | - compilation.hooks.htmlWebpackPluginAfterEmit.tapAsync('html-webpack-plugin-after-emit', (data, cb) => { | ||
| 80 | hotMiddleware.publish({ | 81 | hotMiddleware.publish({ |
| 81 | action: 'reload' | 82 | action: 'reload' |
| 82 | }) | 83 | }) |
| 83 | - cb() | ||
| 84 | - }) | ||
| 85 | }) | 84 | }) |
| 86 | 85 | ||
| 87 | compiler.hooks.done.tap('done', stats => { | 86 | compiler.hooks.done.tap('done', stats => { | ... | ... |
| ... | @@ -2,13 +2,10 @@ | ... | @@ -2,13 +2,10 @@ |
| 2 | 2 | ||
| 3 | process.env.BABEL_ENV = 'main' | 3 | process.env.BABEL_ENV = 'main' |
| 4 | 4 | ||
| 5 | -const os = require('os') | ||
| 6 | const path = require('path') | 5 | const path = require('path') |
| 7 | const { dependencies } = require('../package.json') | 6 | const { dependencies } = require('../package.json') |
| 8 | const webpack = require('webpack') | 7 | const webpack = require('webpack') |
| 9 | -const MinifyPlugin = require("babel-minify-webpack-plugin"); | 8 | +const config = require('../config') |
| 10 | -const HappyPack = require('happypack') | ||
| 11 | -const HappyThreadPool = HappyPack.ThreadPool({ size: os.cpus().length }) | ||
| 12 | 9 | ||
| 13 | function resolve(dir) { | 10 | function resolve(dir) { |
| 14 | return path.join(__dirname, '..', dir) | 11 | return path.join(__dirname, '..', dir) |
| ... | @@ -36,8 +33,14 @@ let mainConfig = { | ... | @@ -36,8 +33,14 @@ let mainConfig = { |
| 36 | // }, | 33 | // }, |
| 37 | { | 34 | { |
| 38 | test: /\.js$/, | 35 | test: /\.js$/, |
| 39 | - use: 'happypack/loader?id=MainHappyBabel', | 36 | + use: ['thread-loader', { |
| 37 | + loader: 'babel-loader', | ||
| 38 | + options: { | ||
| 39 | + cacheDirectory: true | ||
| 40 | + } | ||
| 41 | + }], | ||
| 40 | exclude: /node_modules/ | 42 | exclude: /node_modules/ |
| 43 | + | ||
| 41 | }, | 44 | }, |
| 42 | { | 45 | { |
| 43 | test: /\.node$/, | 46 | test: /\.node$/, |
| ... | @@ -54,19 +57,7 @@ let mainConfig = { | ... | @@ -54,19 +57,7 @@ let mainConfig = { |
| 54 | libraryTarget: 'commonjs2', | 57 | libraryTarget: 'commonjs2', |
| 55 | path: path.join(__dirname, '../dist/electron') | 58 | path: path.join(__dirname, '../dist/electron') |
| 56 | }, | 59 | }, |
| 57 | - plugins: [ | 60 | + plugins: [], |
| 58 | - new webpack.NoEmitOnErrorsPlugin(), | ||
| 59 | - new HappyPack({ | ||
| 60 | - id: "MainHappyBabel", | ||
| 61 | - loaders: [{ | ||
| 62 | - loader: 'babel-loader', | ||
| 63 | - options: { | ||
| 64 | - cacheDirectory: true | ||
| 65 | - } | ||
| 66 | - }], | ||
| 67 | - threadPool: HappyThreadPool | ||
| 68 | - }) | ||
| 69 | - ], | ||
| 70 | resolve: { | 61 | resolve: { |
| 71 | alias: { | 62 | alias: { |
| 72 | '@config': resolve('config'), | 63 | '@config': resolve('config'), |
| ... | @@ -82,7 +73,8 @@ let mainConfig = { | ... | @@ -82,7 +73,8 @@ let mainConfig = { |
| 82 | if (process.env.NODE_ENV !== 'production') { | 73 | if (process.env.NODE_ENV !== 'production') { |
| 83 | mainConfig.plugins.push( | 74 | mainConfig.plugins.push( |
| 84 | new webpack.DefinePlugin({ | 75 | new webpack.DefinePlugin({ |
| 85 | - '__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"` | 76 | + '__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`, |
| 77 | + '__lib': `"${path.join(__dirname, `../${config.DllFolder}`).replace(/\\/g, '\\\\')}"` | ||
| 86 | }) | 78 | }) |
| 87 | ) | 79 | ) |
| 88 | } | 80 | } |
| ... | @@ -92,7 +84,6 @@ if (process.env.NODE_ENV !== 'production') { | ... | @@ -92,7 +84,6 @@ if (process.env.NODE_ENV !== 'production') { |
| 92 | */ | 84 | */ |
| 93 | if (process.env.NODE_ENV === 'production') { | 85 | if (process.env.NODE_ENV === 'production') { |
| 94 | mainConfig.plugins.push( | 86 | mainConfig.plugins.push( |
| 95 | - new MinifyPlugin(), | ||
| 96 | new webpack.DefinePlugin({ | 87 | new webpack.DefinePlugin({ |
| 97 | 'process.env.NODE_ENV': '"production"' | 88 | 'process.env.NODE_ENV': '"production"' |
| 98 | }) | 89 | }) | ... | ... |
| ... | @@ -2,21 +2,17 @@ | ... | @@ -2,21 +2,17 @@ |
| 2 | 2 | ||
| 3 | process.env.BABEL_ENV = 'renderer' | 3 | process.env.BABEL_ENV = 'renderer' |
| 4 | 4 | ||
| 5 | -const os = require('os') | ||
| 6 | const path = require('path') | 5 | const path = require('path') |
| 7 | const { dependencies } = require('../package.json') | 6 | const { dependencies } = require('../package.json') |
| 8 | const webpack = require('webpack') | 7 | const webpack = require('webpack') |
| 9 | const config = require('../config') | 8 | const config = require('../config') |
| 9 | +const IsWeb = process.env.ENV_TARGET === 'web' | ||
| 10 | 10 | ||
| 11 | -const MinifyPlugin = require("babel-minify-webpack-plugin"); | ||
| 12 | const CopyWebpackPlugin = require('copy-webpack-plugin') | 11 | const CopyWebpackPlugin = require('copy-webpack-plugin') |
| 13 | const MiniCssExtractPlugin = require('mini-css-extract-plugin') | 12 | const MiniCssExtractPlugin = require('mini-css-extract-plugin') |
| 14 | const HtmlWebpackPlugin = require('html-webpack-plugin') | 13 | const HtmlWebpackPlugin = require('html-webpack-plugin') |
| 15 | const TerserPlugin = require('terser-webpack-plugin'); | 14 | const TerserPlugin = require('terser-webpack-plugin'); |
| 16 | const { VueLoaderPlugin } = require('vue-loader') | 15 | const { VueLoaderPlugin } = require('vue-loader') |
| 17 | -const HappyPack = require('happypack') | ||
| 18 | -const HappyThreadPool = HappyPack.ThreadPool({ size: os.cpus().length }) | ||
| 19 | - | ||
| 20 | function resolve(dir) { | 16 | function resolve(dir) { |
| 21 | return path.join(__dirname, '..', dir) | 17 | return path.join(__dirname, '..', dir) |
| 22 | } | 18 | } |
| ... | @@ -27,7 +23,7 @@ function resolve(dir) { | ... | @@ -27,7 +23,7 @@ function resolve(dir) { |
| 27 | * that provide pure *.vue files that need compiling | 23 | * that provide pure *.vue files that need compiling |
| 28 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals | 24 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals |
| 29 | */ | 25 | */ |
| 30 | -let whiteListedModules = ['vue', "element-ui"] | 26 | +let whiteListedModules = IsWeb ? [] : ['vue', "element-ui"] |
| 31 | 27 | ||
| 32 | let rendererConfig = { | 28 | let rendererConfig = { |
| 33 | devtool: '#cheap-module-eval-source-map', | 29 | devtool: '#cheap-module-eval-source-map', |
| ... | @@ -52,19 +48,44 @@ let rendererConfig = { | ... | @@ -52,19 +48,44 @@ let rendererConfig = { |
| 52 | // }, | 48 | // }, |
| 53 | { | 49 | { |
| 54 | test: /\.scss$/, | 50 | test: /\.scss$/, |
| 55 | - use: ['vue-style-loader', 'css-loader', 'sass-loader'] | 51 | + use: ['vue-style-loader', |
| 52 | + { | ||
| 53 | + loader: 'css-loader', | ||
| 54 | + options: { | ||
| 55 | + esModule: false | ||
| 56 | + } | ||
| 57 | + }, | ||
| 58 | + 'sass-loader'] | ||
| 56 | }, | 59 | }, |
| 57 | { | 60 | { |
| 58 | test: /\.sass$/, | 61 | test: /\.sass$/, |
| 59 | - use: ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax'] | 62 | + use: ['vue-style-loader', |
| 63 | + { | ||
| 64 | + loader: 'css-loader', | ||
| 65 | + options: { | ||
| 66 | + esModule: false | ||
| 67 | + } | ||
| 68 | + }, 'sass-loader?indentedSyntax'] | ||
| 60 | }, | 69 | }, |
| 61 | { | 70 | { |
| 62 | test: /\.less$/, | 71 | test: /\.less$/, |
| 63 | - use: ['vue-style-loader', 'css-loader', 'less-loader'] | 72 | + use: ['vue-style-loader', |
| 73 | + { | ||
| 74 | + loader: 'css-loader', | ||
| 75 | + options: { | ||
| 76 | + esModule: false | ||
| 77 | + } | ||
| 78 | + }, 'less-loader'] | ||
| 64 | }, | 79 | }, |
| 65 | { | 80 | { |
| 66 | test: /\.css$/, | 81 | test: /\.css$/, |
| 67 | - use: ['vue-style-loader', 'css-loader'] | 82 | + use: ['vue-style-loader', |
| 83 | + { | ||
| 84 | + loader: 'css-loader', | ||
| 85 | + options: { | ||
| 86 | + esModule: false | ||
| 87 | + } | ||
| 88 | + }] | ||
| 68 | }, | 89 | }, |
| 69 | { | 90 | { |
| 70 | test: /\.html$/, | 91 | test: /\.html$/, |
| ... | @@ -72,7 +93,12 @@ let rendererConfig = { | ... | @@ -72,7 +93,12 @@ let rendererConfig = { |
| 72 | }, | 93 | }, |
| 73 | { | 94 | { |
| 74 | test: /\.js$/, | 95 | test: /\.js$/, |
| 75 | - use: 'happypack/loader?id=HappyRendererBabel', | 96 | + use: ['thread-loader', { |
| 97 | + loader: 'babel-loader', | ||
| 98 | + options: { | ||
| 99 | + cacheDirectory: true | ||
| 100 | + } | ||
| 101 | + }], | ||
| 76 | exclude: /node_modules/ | 102 | exclude: /node_modules/ |
| 77 | }, | 103 | }, |
| 78 | { | 104 | { |
| ... | @@ -81,19 +107,13 @@ let rendererConfig = { | ... | @@ -81,19 +107,13 @@ let rendererConfig = { |
| 81 | }, | 107 | }, |
| 82 | { | 108 | { |
| 83 | test: /\.vue$/, | 109 | test: /\.vue$/, |
| 84 | - use: [{ | 110 | + use: { |
| 85 | loader: 'vue-loader', | 111 | loader: 'vue-loader', |
| 86 | options: { | 112 | options: { |
| 87 | cacheDirectory: 'node_modules/.cache/vue-loader', | 113 | cacheDirectory: 'node_modules/.cache/vue-loader', |
| 88 | cacheIdentifier: '7270960a', | 114 | cacheIdentifier: '7270960a', |
| 89 | - extractCSS: process.env.NODE_ENV === 'production', | ||
| 90 | - loaders: { | ||
| 91 | - sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1', | ||
| 92 | - scss: 'vue-style-loader!css-loader!sass-loader', | ||
| 93 | - less: 'vue-style-loader!css-loader!less-loader' | ||
| 94 | } | 115 | } |
| 95 | } | 116 | } |
| 96 | - }] | ||
| 97 | }, | 117 | }, |
| 98 | { | 118 | { |
| 99 | test: /\.svg$/, | 119 | test: /\.svg$/, |
| ... | @@ -145,7 +165,8 @@ let rendererConfig = { | ... | @@ -145,7 +165,8 @@ let rendererConfig = { |
| 145 | new VueLoaderPlugin(), | 165 | new VueLoaderPlugin(), |
| 146 | new MiniCssExtractPlugin({ filename: 'styles.css' }), | 166 | new MiniCssExtractPlugin({ filename: 'styles.css' }), |
| 147 | new webpack.DefinePlugin({ | 167 | new webpack.DefinePlugin({ |
| 148 | - 'process.env': process.env.NODE_ENV === 'production' ? config.build.env : config.dev.env | 168 | + 'process.env': process.env.NODE_ENV === 'production' ? config.build.env : config.dev.env, |
| 169 | + 'process.env.IS_WEB': IsWeb | ||
| 149 | }), | 170 | }), |
| 150 | new HtmlWebpackPlugin({ | 171 | new HtmlWebpackPlugin({ |
| 151 | filename: 'index.html', | 172 | filename: 'index.html', |
| ... | @@ -172,22 +193,11 @@ let rendererConfig = { | ... | @@ -172,22 +193,11 @@ let rendererConfig = { |
| 172 | nodeModules: false | 193 | nodeModules: false |
| 173 | }), | 194 | }), |
| 174 | new webpack.HotModuleReplacementPlugin(), | 195 | new webpack.HotModuleReplacementPlugin(), |
| 175 | - new webpack.NoEmitOnErrorsPlugin(), | ||
| 176 | - new HappyPack({ | ||
| 177 | - id: 'HappyRendererBabel', | ||
| 178 | - loaders: [{ | ||
| 179 | - loader: 'babel-loader', | ||
| 180 | - options: { | ||
| 181 | - cacheDirectory: true | ||
| 182 | - } | ||
| 183 | - }], | ||
| 184 | - threadPool: HappyThreadPool | ||
| 185 | - }), | ||
| 186 | ], | 196 | ], |
| 187 | output: { | 197 | output: { |
| 188 | filename: '[name].js', | 198 | filename: '[name].js', |
| 189 | - libraryTarget: 'commonjs2', | 199 | + libraryTarget: IsWeb ? 'var' : 'commonjs2', |
| 190 | - path: path.join(__dirname, '../dist/electron') | 200 | + path: IsWeb ? path.join(__dirname, '../dist/web') : path.join(__dirname, '../dist/electron') |
| 191 | }, | 201 | }, |
| 192 | resolve: { | 202 | resolve: { |
| 193 | alias: { | 203 | alias: { |
| ... | @@ -202,10 +212,9 @@ let rendererConfig = { | ... | @@ -202,10 +212,9 @@ let rendererConfig = { |
| 202 | /** | 212 | /** |
| 203 | * Adjust rendererConfig for development settings | 213 | * Adjust rendererConfig for development settings |
| 204 | */ | 214 | */ |
| 205 | -if (process.env.NODE_ENV !== 'production') { | 215 | +if (process.env.NODE_ENV !== 'production' && !IsWeb) { |
| 206 | rendererConfig.plugins.push( | 216 | rendererConfig.plugins.push( |
| 207 | new webpack.DefinePlugin({ | 217 | new webpack.DefinePlugin({ |
| 208 | - '__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`, | ||
| 209 | '__lib': `"${path.join(__dirname, `../${config.DllFolder}`).replace(/\\/g, '\\\\')}"` | 218 | '__lib': `"${path.join(__dirname, `../${config.DllFolder}`).replace(/\\/g, '\\\\')}"` |
| 210 | }) | 219 | }) |
| 211 | ) | 220 | ) |
| ... | @@ -218,7 +227,6 @@ if (process.env.NODE_ENV === 'production') { | ... | @@ -218,7 +227,6 @@ if (process.env.NODE_ENV === 'production') { |
| 218 | rendererConfig.devtool = '' | 227 | rendererConfig.devtool = '' |
| 219 | 228 | ||
| 220 | rendererConfig.plugins.push( | 229 | rendererConfig.plugins.push( |
| 221 | - new MinifyPlugin(), | ||
| 222 | new CopyWebpackPlugin({ | 230 | new CopyWebpackPlugin({ |
| 223 | patterns: [ | 231 | patterns: [ |
| 224 | { | 232 | { |
| ... | @@ -242,7 +250,7 @@ if (process.env.NODE_ENV === 'production') { | ... | @@ -242,7 +250,7 @@ if (process.env.NODE_ENV === 'production') { |
| 242 | new TerserPlugin({ | 250 | new TerserPlugin({ |
| 243 | test: /\.js(\?.*)?$/i, | 251 | test: /\.js(\?.*)?$/i, |
| 244 | extractComments: false, | 252 | extractComments: false, |
| 245 | - cache: false, | 253 | + cache: true, |
| 246 | sourceMap: false, | 254 | sourceMap: false, |
| 247 | terserOptions: { | 255 | terserOptions: { |
| 248 | warnings: false, | 256 | warnings: false, |
| ... | @@ -263,6 +271,31 @@ if (process.env.NODE_ENV === 'production') { | ... | @@ -263,6 +271,31 @@ if (process.env.NODE_ENV === 'production') { |
| 263 | } | 271 | } |
| 264 | })] | 272 | })] |
| 265 | } | 273 | } |
| 274 | + if (IsWeb) { | ||
| 275 | + rendererConfig.optimization.splitChunks = { | ||
| 276 | + chunks: "async", | ||
| 277 | + cacheGroups: { | ||
| 278 | + vendor: { // 将第三方模块提取出来 | ||
| 279 | + minSize: 30000, | ||
| 280 | + minChunks: 1, | ||
| 281 | + test: /node_modules/, | ||
| 282 | + chunks: 'initial', | ||
| 283 | + name: 'vendor', | ||
| 284 | + priority: 1 | ||
| 285 | + }, | ||
| 286 | + commons: { | ||
| 287 | + test: /[\\/]src[\\/]common[\\/]/, | ||
| 288 | + name: 'commons', | ||
| 289 | + minSize: 30000, | ||
| 290 | + minChunks: 3, | ||
| 291 | + chunks: 'initial', | ||
| 292 | + priority: -1, | ||
| 293 | + reuseExistingChunk: true // 这个配置允许我们使用已经存在的代码块 | ||
| 294 | + } | ||
| 295 | + } | ||
| 296 | + } | ||
| 297 | + rendererConfig.optimization.runtimeChunk = { name: 'runtime' } | ||
| 298 | + } | ||
| 266 | } | 299 | } |
| 267 | 300 | ||
| 268 | module.exports = rendererConfig | 301 | module.exports = rendererConfig | ... | ... |
.electron-vue/webpack.web.config.js
deleted
100644 → 0
| 1 | -'use strict' | ||
| 2 | - | ||
| 3 | -process.env.BABEL_ENV = 'web' | ||
| 4 | - | ||
| 5 | -const path = require('path') | ||
| 6 | -const webpack = require('webpack') | ||
| 7 | - | ||
| 8 | -const MinifyPlugin = require("babel-minify-webpack-plugin"); | ||
| 9 | -const CopyWebpackPlugin = require('copy-webpack-plugin') | ||
| 10 | -const MiniCssExtractPlugin = require('mini-css-extract-plugin') | ||
| 11 | -const HtmlWebpackPlugin = require('html-webpack-plugin') | ||
| 12 | -const TerserPlugin = require('terser-webpack-plugin'); | ||
| 13 | -const { VueLoaderPlugin } = require('vue-loader') | ||
| 14 | - | ||
| 15 | -function resolve(dir) { | ||
| 16 | - return path.join(__dirname, '..', dir) | ||
| 17 | -} | ||
| 18 | - | ||
| 19 | -let webConfig = { | ||
| 20 | - devtool: '#cheap-module-eval-source-map', | ||
| 21 | - entry: { | ||
| 22 | - web: resolve('src/renderer/main.js') | ||
| 23 | - }, | ||
| 24 | - module: { | ||
| 25 | - rules: [ | ||
| 26 | - // { | ||
| 27 | - // test: /\.(js|vue)$/, | ||
| 28 | - // enforce: 'pre', | ||
| 29 | - // exclude: /node_modules/, | ||
| 30 | - // use: { | ||
| 31 | - // loader: 'eslint-loader', | ||
| 32 | - // options: { | ||
| 33 | - // formatter: require('eslint-friendly-formatter') | ||
| 34 | - // } | ||
| 35 | - // } | ||
| 36 | - // }, | ||
| 37 | - { | ||
| 38 | - test: /\.scss$/, | ||
| 39 | - use: ['vue-style-loader', 'css-loader', 'sass-loader'] | ||
| 40 | - }, | ||
| 41 | - { | ||
| 42 | - test: /\.sass$/, | ||
| 43 | - use: ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax'] | ||
| 44 | - }, | ||
| 45 | - { | ||
| 46 | - test: /\.less$/, | ||
| 47 | - use: ['vue-style-loader', 'css-loader', 'less-loader'] | ||
| 48 | - }, | ||
| 49 | - { | ||
| 50 | - test: /\.css$/, | ||
| 51 | - use: ['vue-style-loader', 'css-loader'] | ||
| 52 | - }, | ||
| 53 | - { | ||
| 54 | - test: /\.html$/, | ||
| 55 | - use: 'vue-html-loader' | ||
| 56 | - }, | ||
| 57 | - { | ||
| 58 | - test: /\.js$/, | ||
| 59 | - use: 'babel-loader', | ||
| 60 | - include: [resolve('src/renderer')], | ||
| 61 | - exclude: /node_modules/ | ||
| 62 | - }, | ||
| 63 | - { | ||
| 64 | - test: /\.vue$/, | ||
| 65 | - use: { | ||
| 66 | - loader: 'vue-loader', | ||
| 67 | - options: { | ||
| 68 | - extractCSS: true, | ||
| 69 | - loaders: { | ||
| 70 | - sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1', | ||
| 71 | - scss: 'vue-style-loader!css-loader!sass-loader', | ||
| 72 | - less: 'vue-style-loader!css-loader!less-loader' | ||
| 73 | - } | ||
| 74 | - } | ||
| 75 | - } | ||
| 76 | - }, | ||
| 77 | - { | ||
| 78 | - test: /\.svg$/, | ||
| 79 | - loader: 'svg-sprite-loader', | ||
| 80 | - include: [resolve('src/renderer/icons')], | ||
| 81 | - options: { | ||
| 82 | - symbolId: 'icon-[name]' | ||
| 83 | - } | ||
| 84 | - }, | ||
| 85 | - { | ||
| 86 | - test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, | ||
| 87 | - exclude: [resolve('src/renderer/icons')], | ||
| 88 | - use: { | ||
| 89 | - loader: 'url-loader', | ||
| 90 | - query: { | ||
| 91 | - esModule: false, | ||
| 92 | - limit: 10000, | ||
| 93 | - name: 'imgs/[name].[ext]' | ||
| 94 | - } | ||
| 95 | - }, | ||
| 96 | - }, | ||
| 97 | - { | ||
| 98 | - test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, | ||
| 99 | - use: { | ||
| 100 | - loader: 'url-loader', | ||
| 101 | - query: { | ||
| 102 | - esModule: false, | ||
| 103 | - limit: 10000, | ||
| 104 | - name: 'fonts/[name].[ext]' | ||
| 105 | - } | ||
| 106 | - } | ||
| 107 | - } | ||
| 108 | - ] | ||
| 109 | - }, | ||
| 110 | - plugins: [ | ||
| 111 | - new VueLoaderPlugin(), | ||
| 112 | - new MiniCssExtractPlugin({ filename: 'styles.css' }), | ||
| 113 | - new HtmlWebpackPlugin({ | ||
| 114 | - filename: 'index.html', | ||
| 115 | - template: path.resolve(__dirname, '../src/index.ejs'), | ||
| 116 | - minify: { | ||
| 117 | - collapseWhitespace: true, | ||
| 118 | - removeAttributeQuotes: true, | ||
| 119 | - removeComments: true | ||
| 120 | - }, | ||
| 121 | - nodeModules: false | ||
| 122 | - }), | ||
| 123 | - new webpack.DefinePlugin({ | ||
| 124 | - 'process.env.IS_WEB': 'true' | ||
| 125 | - }), | ||
| 126 | - new webpack.HotModuleReplacementPlugin(), | ||
| 127 | - new webpack.NoEmitOnErrorsPlugin() | ||
| 128 | - ], | ||
| 129 | - output: { | ||
| 130 | - filename: '[name].js', | ||
| 131 | - path: path.join(__dirname, '../dist/web') | ||
| 132 | - }, | ||
| 133 | - resolve: { | ||
| 134 | - alias: { | ||
| 135 | - '@': path.join(__dirname, '../src/renderer'), | ||
| 136 | - 'vue$': 'vue/dist/vue.esm.js' | ||
| 137 | - }, | ||
| 138 | - extensions: ['.js', '.vue', '.json', '.css'] | ||
| 139 | - }, | ||
| 140 | - target: 'web' | ||
| 141 | -} | ||
| 142 | - | ||
| 143 | -/** | ||
| 144 | - * Adjust webConfig for production settings | ||
| 145 | - */ | ||
| 146 | -if (process.env.NODE_ENV === 'production') { | ||
| 147 | - webConfig.devtool = '' | ||
| 148 | - | ||
| 149 | - webConfig.plugins.push( | ||
| 150 | - new MinifyPlugin(), | ||
| 151 | - new CopyWebpackPlugin({ | ||
| 152 | - patterns: [ | ||
| 153 | - { | ||
| 154 | - from: path.join(__dirname, '../static'), | ||
| 155 | - to: path.join(__dirname, '../dist/electron/static'), | ||
| 156 | - globOptions: { | ||
| 157 | - ignore: ['.*'] | ||
| 158 | - } | ||
| 159 | - } | ||
| 160 | - ] | ||
| 161 | - }), | ||
| 162 | - new webpack.DefinePlugin({ | ||
| 163 | - 'process.env.NODE_ENV': '"production"' | ||
| 164 | - }), | ||
| 165 | - new webpack.LoaderOptionsPlugin({ | ||
| 166 | - minimize: true | ||
| 167 | - }) | ||
| 168 | - ) | ||
| 169 | - webConfig.optimization = { | ||
| 170 | - splitChunks: { | ||
| 171 | - chunks: "async", | ||
| 172 | - cacheGroups: { | ||
| 173 | - vendor: { // 将第三方模块提取出来 | ||
| 174 | - minSize: 30000, | ||
| 175 | - minChunks: 1, | ||
| 176 | - test: /node_modules/, | ||
| 177 | - chunks: 'initial', | ||
| 178 | - name: 'vendor', | ||
| 179 | - priority: 1 | ||
| 180 | - }, | ||
| 181 | - commons: { | ||
| 182 | - test: /[\\/]src[\\/]common[\\/]/, | ||
| 183 | - name: 'commons', | ||
| 184 | - minSize: 30000, | ||
| 185 | - minChunks: 3, | ||
| 186 | - chunks: 'initial', | ||
| 187 | - priority: -1, | ||
| 188 | - reuseExistingChunk: true // 这个配置允许我们使用已经存在的代码块 | ||
| 189 | - } | ||
| 190 | - } | ||
| 191 | - }, | ||
| 192 | - runtimeChunk: { name: 'runtime' }, | ||
| 193 | - minimizer: [ | ||
| 194 | - new TerserPlugin({ | ||
| 195 | - test: /\.js(\?.*)?$/i, | ||
| 196 | - extractComments: false, | ||
| 197 | - cache: false, | ||
| 198 | - sourceMap: false, | ||
| 199 | - terserOptions: { | ||
| 200 | - warnings: false, | ||
| 201 | - compress: { | ||
| 202 | - warnings: false, | ||
| 203 | - drop_console: true, | ||
| 204 | - drop_debugger: true, | ||
| 205 | - pure_funcs: ['console.log'] | ||
| 206 | - }, | ||
| 207 | - output: { | ||
| 208 | - comments: false, | ||
| 209 | - }, | ||
| 210 | - } | ||
| 211 | - })] | ||
| 212 | - } | ||
| 213 | -} | ||
| 214 | - | ||
| 215 | -module.exports = webConfig |
| 1 | # Electron-Vue-template | 1 | # Electron-Vue-template |
| 2 | 2 | ||
| 3 | -> This is a project based on electron-vue, using the elementUI, vuex, vue-router, axios technology stack. This project is divided into two branches. The master maintains the original project structure and features for dependency updates, and the SynchronizedUpdates branch. It keeps the original file structure and the code part is completely customized by me personally; it includes: a complete background management interface, nedb database package, and two complete update download methods. If you feel redundant, you can delete it yourself. | 3 | +> An electron-vue project |
| 4 | - | ||
| 5 | -[中文文档地址](https://github.com/umbrella22/electron-vue-template/blob/master/README_ZH.md) | ||
| 6 | -[中文在线文档](https://umbrella22.github.io/electron-vue-template-doc/) | ||
| 7 | -[国内访问地址](https://gitee.com/Zh-Sky/electron-vue-template) | ||
| 8 | -[国内文档访问地址](https://zh-sky.gitee.io/electron-vue-template-doc/) | ||
| 9 | - | ||
| 10 | -- electron of react [Electron-react-template](https://github.com/umbrella22/electron-react-template) | ||
| 11 | - | ||
| 12 | -<h3 align="center">Thanks for support.</h3> | ||
| 13 | - | ||
| 14 | -<p align="center"> | ||
| 15 | - <a href="https://www.jetbrains.com/?from=electron-vue-template" target="_blank"> | ||
| 16 | - <img width="160px" src="https://github.com/umbrella22/MCsever/blob/master/jetbrains.png"> | ||
| 17 | - </a> | ||
| 18 | -</p> | ||
| 19 | - | ||
| 20 | - | ||
| 21 | 4 | ||
| 22 | #### Build Setup | 5 | #### Build Setup |
| 23 | 6 | ||
| 24 | ``` bash | 7 | ``` bash |
| 8 | +# For Chinese Developers | ||
| 9 | +# install nrm | ||
| 10 | +npm i -g nrm | ||
| 11 | +# Switch to Taobao Source with NRM | ||
| 12 | +nrm ls | ||
| 13 | +nrm use taobao | ||
| 25 | # install dependencies | 14 | # install dependencies |
| 26 | -npm install or yarn install | 15 | +npm install |
| 27 | 16 | ||
| 28 | # serve with hot reload at localhost:9080 | 17 | # serve with hot reload at localhost:9080 |
| 29 | -npm run dev or yarn dev | 18 | +npm run dev |
| 30 | 19 | ||
| 31 | # build electron application for production | 20 | # build electron application for production |
| 32 | -npm run build or yarn build | 21 | +npm run build |
| 33 | 22 | ||
| 34 | # run unit & end-to-end tests | 23 | # run unit & end-to-end tests |
| 35 | npm test | 24 | npm test |
| ... | @@ -40,4 +29,3 @@ npm test | ... | @@ -40,4 +29,3 @@ npm test |
| 40 | --- | 29 | --- |
| 41 | 30 | ||
| 42 | This project was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue)@[8fae476](https://github.com/SimulatedGREG/electron-vue/tree/8fae4763e9d225d3691b627e83b9e09b56f6c935) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html). | 31 | This project was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue)@[8fae476](https://github.com/SimulatedGREG/electron-vue/tree/8fae4763e9d225d3691b627e83b9e09b56f6c935) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html). |
| 43 | -Manage interface code address [here](https://github.com/PanJiaChen/electron-vue-admin) | ... | ... |
lib/updater.html
0 → 100644
文件属性发生变化
| ... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
| 13 | "build:mac": "cross-env BUILD_TARGET=clean node .electron-vue/build.js && node .electron-vue/build.js && electron-builder --mac", | 13 | "build:mac": "cross-env BUILD_TARGET=clean node .electron-vue/build.js && node .electron-vue/build.js && electron-builder --mac", |
| 14 | "build:dir": "cross-env BUILD_TARGET=clean node .electron-vue/build.js && node .electron-vue/build.js && electron-builder --dir", | 14 | "build:dir": "cross-env BUILD_TARGET=clean node .electron-vue/build.js && node .electron-vue/build.js && electron-builder --dir", |
| 15 | "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js", | 15 | "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js", |
| 16 | - "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js", | 16 | + "build:web": "cross-env BUILD_TARGET=web ENV_TARGET=web node .electron-vue/build.js", |
| 17 | "pack": "npm run pack:main && npm run pack:renderer", | 17 | "pack": "npm run pack:main && npm run pack:renderer", |
| 18 | "pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js", | 18 | "pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js", |
| 19 | "pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js", | 19 | "pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js", |
| ... | @@ -57,100 +57,91 @@ | ... | @@ -57,100 +57,91 @@ |
| 57 | }, | 57 | }, |
| 58 | "win": { | 58 | "win": { |
| 59 | "icon": "build/icons/icon.ico", | 59 | "icon": "build/icons/icon.ico", |
| 60 | - "target": [ | 60 | + "target": "nsis" |
| 61 | - { | ||
| 62 | - "target": "nsis", | ||
| 63 | - "arch": [ | ||
| 64 | - "x64", | ||
| 65 | - "ia32" | ||
| 66 | - ] | ||
| 67 | - } | ||
| 68 | - ] | ||
| 69 | }, | 61 | }, |
| 70 | "linux": { | 62 | "linux": { |
| 63 | + "target": "deb", | ||
| 71 | "icon": "build/icons" | 64 | "icon": "build/icons" |
| 72 | } | 65 | } |
| 73 | }, | 66 | }, |
| 74 | "dependencies": { | 67 | "dependencies": { |
| 75 | "axios": "^0.21.1", | 68 | "axios": "^0.21.1", |
| 76 | - "date-fns": "^2.15.0", | 69 | + "date-fns": "^2.16.1", |
| 77 | "electron-updater": "^4.3.5", | 70 | "electron-updater": "^4.3.5", |
| 78 | "element-ui": "^2.15.0", | 71 | "element-ui": "^2.15.0", |
| 79 | "express": "^4.17.1", | 72 | "express": "^4.17.1", |
| 80 | "fs-extra": "^9.1.0", | 73 | "fs-extra": "^9.1.0", |
| 81 | - "js-cookie": "^2.2.1", | ||
| 82 | - "nedb": "^1.8.0", | ||
| 83 | "nprogress": "^0.2.0", | 74 | "nprogress": "^0.2.0", |
| 84 | - "vue": "^2.6.11", | 75 | + "vue": "^2.6.12", |
| 85 | - "vue-router": "^3.4.9", | 76 | + "vue-router": "^3.5.1", |
| 86 | - "vuex": "^3.6.0" | 77 | + "vuex": "^3.6.2" |
| 87 | }, | 78 | }, |
| 88 | "devDependencies": { | 79 | "devDependencies": { |
| 89 | - "@babel/core": "^7.12.9", | 80 | + "@babel/core": "^7.12.13", |
| 90 | - "@babel/plugin-proposal-class-properties": "^7.12.1", | 81 | + "@babel/plugin-proposal-class-properties": "^7.12.13", |
| 91 | - "@babel/plugin-proposal-decorators": "^7.12.12", | 82 | + "@babel/plugin-proposal-decorators": "^7.12.13", |
| 92 | - "@babel/plugin-proposal-do-expressions": "^7.12.1", | 83 | + "@babel/plugin-proposal-do-expressions": "^7.12.13", |
| 93 | - "@babel/plugin-proposal-export-default-from": "^7.12.1", | 84 | + "@babel/plugin-proposal-export-default-from": "^7.12.13", |
| 94 | - "@babel/plugin-proposal-export-namespace-from": "^7.12.1", | 85 | + "@babel/plugin-proposal-export-namespace-from": "^7.12.13", |
| 95 | - "@babel/plugin-proposal-function-bind": "^7.12.1", | 86 | + "@babel/plugin-proposal-function-bind": "^7.12.13", |
| 96 | - "@babel/plugin-proposal-function-sent": "^7.12.1", | 87 | + "@babel/plugin-proposal-function-sent": "^7.12.13", |
| 97 | - "@babel/plugin-proposal-json-strings": "^7.12.1", | 88 | + "@babel/plugin-proposal-json-strings": "^7.12.13", |
| 98 | - "@babel/plugin-proposal-logical-assignment-operators": "^7.12.1", | 89 | + "@babel/plugin-proposal-logical-assignment-operators": "^7.12.13", |
| 99 | - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1", | 90 | + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13", |
| 100 | - "@babel/plugin-proposal-numeric-separator": "^7.12.7", | 91 | + "@babel/plugin-proposal-numeric-separator": "^7.12.13", |
| 101 | - "@babel/plugin-proposal-optional-chaining": "^7.12.7", | 92 | + "@babel/plugin-proposal-optional-chaining": "^7.12.13", |
| 102 | - "@babel/plugin-proposal-pipeline-operator": "^7.12.1", | 93 | + "@babel/plugin-proposal-pipeline-operator": "^7.12.13", |
| 103 | - "@babel/plugin-proposal-throw-expressions": "^7.12.1", | 94 | + "@babel/plugin-proposal-throw-expressions": "^7.12.13", |
| 104 | "@babel/plugin-syntax-dynamic-import": "^7.8.3", | 95 | "@babel/plugin-syntax-dynamic-import": "^7.8.3", |
| 105 | "@babel/plugin-syntax-import-meta": "^7.10.4", | 96 | "@babel/plugin-syntax-import-meta": "^7.10.4", |
| 106 | - "@babel/plugin-transform-runtime": "^7.12.1", | 97 | + "@babel/plugin-transform-runtime": "^7.12.13", |
| 107 | - "@babel/polyfill": "^7.12.1", | 98 | + "@babel/preset-env": "^7.12.13", |
| 108 | - "@babel/preset-env": "^7.12.11", | 99 | + "@babel/register": "^7.12.13", |
| 109 | - "@babel/register": "^7.12.1", | 100 | + "@babel/runtime": "^7.12.13", |
| 110 | - "@babel/runtime": "^7.12.5", | 101 | + "@types/fs-extra": "^9.0.6", |
| 111 | - "ajv": "^6.12.6", | 102 | + "@types/node": "^14.14.22", |
| 112 | - "babel-eslint": "^9.0.0", | 103 | + "ajv": "^7.0.4", |
| 104 | + "babel-eslint": "^10.1.0", | ||
| 113 | "babel-loader": "^8.2.2", | 105 | "babel-loader": "^8.2.2", |
| 114 | - "babel-minify-webpack-plugin": "^0.3.1", | ||
| 115 | "cache-loader": "^4.1.0", | 106 | "cache-loader": "^4.1.0", |
| 116 | "cfonts": "^2.9.1", | 107 | "cfonts": "^2.9.1", |
| 117 | - "chalk": "^4.1.0", | 108 | + "chalk": "^4.0.0", |
| 118 | "copy-webpack-plugin": "^6.3.2", | 109 | "copy-webpack-plugin": "^6.3.2", |
| 119 | - "cross-env": "^7.0.2", | 110 | + "core-js": "^3.8.3", |
| 120 | - "css-loader": "^3.6.0", | 111 | + "cross-env": "^7.0.3", |
| 112 | + "css-loader": "^5.0.1", | ||
| 121 | "del": "^6.0.0", | 113 | "del": "^6.0.0", |
| 122 | - "electron": "^8.5.5", | 114 | + "electron": "^11.2.2", |
| 123 | "electron-builder": "^22.9.1", | 115 | "electron-builder": "^22.9.1", |
| 124 | "electron-devtools-installer": "^3.1.1", | 116 | "electron-devtools-installer": "^3.1.1", |
| 125 | - "eslint": "^6.8.0", | 117 | + "eslint": "^7.19.0", |
| 126 | "eslint-config-standard": "^14.1.1", | 118 | "eslint-config-standard": "^14.1.1", |
| 127 | "eslint-friendly-formatter": "^4.0.1", | 119 | "eslint-friendly-formatter": "^4.0.1", |
| 128 | - "eslint-loader": "^3.0.4", | 120 | + "eslint-loader": "^4.0.2", |
| 129 | "eslint-plugin-html": "^6.1.1", | 121 | "eslint-plugin-html": "^6.1.1", |
| 130 | "eslint-plugin-import": "^2.22.1", | 122 | "eslint-plugin-import": "^2.22.1", |
| 131 | - "eslint-plugin-node": "^9.2.0", | 123 | + "eslint-plugin-node": "^11.1.0", |
| 132 | "eslint-plugin-promise": "^4.2.1", | 124 | "eslint-plugin-promise": "^4.2.1", |
| 133 | - "eslint-plugin-standard": "^4.1.0", | 125 | + "eslint-plugin-standard": "^5.0.0", |
| 134 | "file-loader": "^6.2.0", | 126 | "file-loader": "^6.2.0", |
| 135 | - "happypack": "^5.0.1", | 127 | + "html-webpack-plugin": "^4.5.1", |
| 136 | - "hard-source-webpack-plugin": "^0.13.1", | 128 | + "mini-css-extract-plugin": "1.3.5", |
| 137 | - "html-webpack-plugin": "^3.2.0", | ||
| 138 | - "mini-css-extract-plugin": "1.3.4", | ||
| 139 | "multispinner": "^0.2.1", | 129 | "multispinner": "^0.2.1", |
| 140 | "node-loader": "^1.0.2", | 130 | "node-loader": "^1.0.2", |
| 141 | "portfinder": "^1.0.28", | 131 | "portfinder": "^1.0.28", |
| 142 | - "sass": "^1.32.5", | 132 | + "sass": "^1.32.6", |
| 143 | "sass-loader": "^10.1.1", | 133 | "sass-loader": "^10.1.1", |
| 144 | - "split2": "^3.2.1", | 134 | + "split2": "^3.2.2", |
| 145 | - "style-loader": "^1.3.0", | 135 | + "style-loader": "^2.0.0", |
| 146 | "svg-sprite-loader": "^5.2.1", | 136 | "svg-sprite-loader": "^5.2.1", |
| 147 | "terser-webpack-plugin": "^4.2.3", | 137 | "terser-webpack-plugin": "^4.2.3", |
| 138 | + "thread-loader": "^3.0.1", | ||
| 148 | "through2-filter": "^3.0.0", | 139 | "through2-filter": "^3.0.0", |
| 149 | "url-loader": "^4.1.1", | 140 | "url-loader": "^4.1.1", |
| 150 | "vue-html-loader": "^1.2.4", | 141 | "vue-html-loader": "^1.2.4", |
| 151 | "vue-loader": "^15.9.6", | 142 | "vue-loader": "^15.9.6", |
| 152 | "vue-style-loader": "^4.1.2", | 143 | "vue-style-loader": "^4.1.2", |
| 153 | - "vue-template-compiler": "^2.6.11", | 144 | + "vue-template-compiler": "^2.6.12", |
| 154 | "webpack": "^4.44.2", | 145 | "webpack": "^4.44.2", |
| 155 | "webpack-cli": "^3.3.12", | 146 | "webpack-cli": "^3.3.12", |
| 156 | "webpack-dev-server": "^3.11.2", | 147 | "webpack-dev-server": "^3.11.2", | ... | ... |
| ... | @@ -15,7 +15,11 @@ | ... | @@ -15,7 +15,11 @@ |
| 15 | <!-- Set `__static` path to static files in production --> | 15 | <!-- Set `__static` path to static files in production --> |
| 16 | <% if (!process.browser) { %> | 16 | <% if (!process.browser) { %> |
| 17 | <script> | 17 | <script> |
| 18 | - if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\') | 18 | + if (process.env.NODE_ENV !== 'development') { |
| 19 | + window.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\') | ||
| 20 | + }else{ | ||
| 21 | + window.__static = `http://localhost:${process.env.PORT}/static` | ||
| 22 | + } | ||
| 19 | if (process.env.NODE_ENV !== 'development') window.__lib = require('path').join(__dirname,'..','..','..','..',`${require('../config/index.js').DllFolder}`).replace(/\\/g, '\\\\') | 23 | if (process.env.NODE_ENV !== 'development') window.__lib = require('path').join(__dirname,'..','..','..','..',`${require('../config/index.js').DllFolder}`).replace(/\\/g, '\\\\') |
| 20 | </script> | 24 | </script> |
| 21 | <% } %> | 25 | <% } %> | ... | ... |
src/main/config/StaticPath.js
0 → 100644
| 1 | +// 这里定义了静态文件路径的位置 | ||
| 2 | +import path from 'path' | ||
| 3 | + | ||
| 4 | +/** | ||
| 5 | + * Set `__static` path to static files in production | ||
| 6 | + * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html | ||
| 7 | + */ | ||
| 8 | +// 这个瓜皮全局变量只能在单个js中生效,而并不是整个主进程中 | ||
| 9 | +if (process.env.NODE_ENV !== 'development') { | ||
| 10 | + global.__static = path.join(__dirname, '/static').replace(/\\/g, '\\\\') | ||
| 11 | +} | ||
| 12 | + | ||
| 13 | +export const winURL = process.env.NODE_ENV === 'development' ? `http://localhost:${process.env.PORT}` : `file://${__dirname}/index.html` | ||
| 14 | +export const loadingURL = process.env.NODE_ENV === 'development' ? `http://localhost:${process.env.PORT}/static/loader.html` : `file://${__static}/loader.html` |
| ... | @@ -16,12 +16,22 @@ function onAppReady () { | ... | @@ -16,12 +16,22 @@ function onAppReady () { |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | app.isReady() ? onAppReady() : app.on('ready', onAppReady) | 18 | app.isReady() ? onAppReady() : app.on('ready', onAppReady) |
| 19 | +// 解决9.x跨域异常问题 | ||
| 20 | +app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors') | ||
| 19 | 21 | ||
| 20 | app.on('window-all-closed', () => { | 22 | app.on('window-all-closed', () => { |
| 21 | - if (process.platform !== 'darwin') { | 23 | + // 所有平台均为所有窗口关闭就退出软件 |
| 22 | app.quit() | 24 | app.quit() |
| 23 | - } | ||
| 24 | }) | 25 | }) |
| 25 | app.on('browser-window-created', () => { | 26 | app.on('browser-window-created', () => { |
| 26 | console.log('window-created') | 27 | console.log('window-created') |
| 27 | }) | 28 | }) |
| 29 | + | ||
| 30 | +if (process.defaultApp) { | ||
| 31 | + if (process.argv.length >= 2) { | ||
| 32 | + app.removeAsDefaultProtocolClient('electron-vue-template') | ||
| 33 | + console.log('有于框架特殊性开发环境下无法使用') | ||
| 34 | + } | ||
| 35 | +} else { | ||
| 36 | + app.setAsDefaultProtocolClient('electron-vue-template') | ||
| 37 | +} | ... | ... |
| ... | @@ -3,12 +3,13 @@ import app from './server' | ... | @@ -3,12 +3,13 @@ import app from './server' |
| 3 | import http from 'http' | 3 | import http from 'http' |
| 4 | import config from '@config' | 4 | import config from '@config' |
| 5 | const port = config.BuiltInServerPort | 5 | const port = config.BuiltInServerPort |
| 6 | +var server = null | ||
| 6 | app.set('port', port) | 7 | app.set('port', port) |
| 7 | 8 | ||
| 8 | export default { | 9 | export default { |
| 9 | StatrServer () { | 10 | StatrServer () { |
| 10 | return new Promise((resolve, reject) => { | 11 | return new Promise((resolve, reject) => { |
| 11 | - const server = http.createServer(app) | 12 | + server = http.createServer(app) |
| 12 | server.listen(port) | 13 | server.listen(port) |
| 13 | server.on('error', (error) => { | 14 | server.on('error', (error) => { |
| 14 | switch (error.code) { | 15 | switch (error.code) { |
| ... | @@ -26,5 +27,19 @@ export default { | ... | @@ -26,5 +27,19 @@ export default { |
| 26 | resolve('服务端运行中') | 27 | resolve('服务端运行中') |
| 27 | }) | 28 | }) |
| 28 | }) | 29 | }) |
| 30 | + }, | ||
| 31 | + StopServer () { | ||
| 32 | + return new Promise((resolve, reject) => { | ||
| 33 | + console.log(server) | ||
| 34 | + if (server) { | ||
| 35 | + server.close() | ||
| 36 | + server.on('close', () => { | ||
| 37 | + server = null | ||
| 38 | + resolve(1) | ||
| 39 | + }) | ||
| 40 | + } else { | ||
| 41 | + reject('服务端尚未开启') | ||
| 42 | + } | ||
| 43 | + }) | ||
| 29 | } | 44 | } |
| 30 | } | 45 | } | ... | ... |
| ... | @@ -22,6 +22,8 @@ export default { | ... | @@ -22,6 +22,8 @@ export default { |
| 22 | console.log(err.message) | 22 | console.log(err.message) |
| 23 | if (err.message.includes('sha512 checksum mismatch')) { | 23 | if (err.message.includes('sha512 checksum mismatch')) { |
| 24 | Message(mainWindow, -1, 'sha512校验失败') | 24 | Message(mainWindow, -1, 'sha512校验失败') |
| 25 | + } else { | ||
| 26 | + Message(mainWindow, -1, '请检查主进程报错信息') | ||
| 25 | } | 27 | } |
| 26 | }) | 28 | }) |
| 27 | 29 | ||
| ... | @@ -54,13 +56,13 @@ export default { | ... | @@ -54,13 +56,13 @@ export default { |
| 54 | Message(mainWindow, 4) | 56 | Message(mainWindow, 4) |
| 55 | }) | 57 | }) |
| 56 | // 执行自动更新检查 | 58 | // 执行自动更新检查 |
| 57 | - ipcMain.on('check-update', () => { | 59 | + ipcMain.handle('check-update', () => { |
| 58 | autoUpdater.checkForUpdates().catch(err => { | 60 | autoUpdater.checkForUpdates().catch(err => { |
| 59 | console.log('网络连接问题', err) | 61 | console.log('网络连接问题', err) |
| 60 | }) | 62 | }) |
| 61 | }) | 63 | }) |
| 62 | // 渲染进程执行更新操作 | 64 | // 渲染进程执行更新操作 |
| 63 | - ipcMain.on('confirm-update', () => { | 65 | + ipcMain.handle('confirm-update', () => { |
| 64 | autoUpdater.quitAndInstall() | 66 | autoUpdater.quitAndInstall() |
| 65 | }) | 67 | }) |
| 66 | } | 68 | } | ... | ... |
| ... | @@ -21,9 +21,8 @@ if (os.platform().includes('win32')) { | ... | @@ -21,9 +21,8 @@ if (os.platform().includes('win32')) { |
| 21 | } | 21 | } |
| 22 | export default { | 22 | export default { |
| 23 | download (mainWindow) { | 23 | download (mainWindow) { |
| 24 | - ipcMain.on('start-download', (event, msg) => { | 24 | + ipcMain.handle('start-download', (event, msg) => { |
| 25 | - mainWindow.webContents.downloadURL(msg?.downloadUrL || defaultDownloadUrL) | 25 | + mainWindow.webContents.downloadURL(msg.downloadUrL || defaultDownloadUrL) |
| 26 | - event.reply('confirm-download', true) | ||
| 27 | mainWindow.webContents.session.on('will-download', (event, item, webContents) => { | 26 | mainWindow.webContents.session.on('will-download', (event, item, webContents) => { |
| 28 | // 将文件保存在系统的下载目录 | 27 | // 将文件保存在系统的下载目录 |
| 29 | const filePath = path.join(app.getPath('downloads'), item.getFilename()) | 28 | const filePath = path.join(app.getPath('downloads'), item.getFilename()) | ... | ... |
| 1 | -import { ipcMain, dialog } from 'electron' | 1 | +import { ipcMain, dialog, BrowserWindow } from 'electron' |
| 2 | import Server from '../server/index' | 2 | import Server from '../server/index' |
| 3 | +import { winURL } from '../config/StaticPath' | ||
| 4 | + | ||
| 3 | export default { | 5 | export default { |
| 4 | Mainfunc (mainWindow, IsUseSysTitle) { | 6 | Mainfunc (mainWindow, IsUseSysTitle) { |
| 5 | - ipcMain.on('IsUseSysTitle', (event) => { | 7 | + ipcMain.handle('IsUseSysTitle', async () => { |
| 6 | - const data = IsUseSysTitle | 8 | + return IsUseSysTitle |
| 7 | - event.reply('CisUseSysTitle', data) | ||
| 8 | }) | 9 | }) |
| 9 | - ipcMain.on('windows-mini', () => { | 10 | + ipcMain.handle('windows-mini', () => { |
| 10 | mainWindow.minimize() | 11 | mainWindow.minimize() |
| 11 | }) | 12 | }) |
| 12 | - ipcMain.on('window-max', (event) => { | 13 | + ipcMain.handle('window-max', async () => { |
| 13 | if (mainWindow.isMaximized()) { | 14 | if (mainWindow.isMaximized()) { |
| 14 | - event.reply('window-confirm', false) | ||
| 15 | mainWindow.restore() | 15 | mainWindow.restore() |
| 16 | + return { status: false } | ||
| 16 | } else { | 17 | } else { |
| 17 | - event.reply('window-confirm', true) | ||
| 18 | mainWindow.maximize() | 18 | mainWindow.maximize() |
| 19 | + return { status: true } | ||
| 19 | } | 20 | } |
| 20 | }) | 21 | }) |
| 21 | - ipcMain.on('window-close', () => { | 22 | + ipcMain.handle('window-close', () => { |
| 22 | mainWindow.close() | 23 | mainWindow.close() |
| 23 | }) | 24 | }) |
| 24 | - ipcMain.on('open-messagebox', (event, arg) => { | 25 | + ipcMain.handle('open-messagebox', async (event, arg) => { |
| 25 | - dialog.showMessageBox(mainWindow, { | 26 | + const res = await dialog.showMessageBox(mainWindow, { |
| 26 | type: arg.type || 'info', | 27 | type: arg.type || 'info', |
| 27 | title: arg.title || '', | 28 | title: arg.title || '', |
| 28 | buttons: arg.buttons || [], | 29 | buttons: arg.buttons || [], |
| 29 | message: arg.message || '', | 30 | message: arg.message || '', |
| 30 | noLink: arg.noLink || true | 31 | noLink: arg.noLink || true |
| 31 | - }).then(res => { | ||
| 32 | - event.reply('confirm-message', res) | ||
| 33 | }) | 32 | }) |
| 33 | + return res | ||
| 34 | }) | 34 | }) |
| 35 | - ipcMain.on('open-errorbox', (event, arg) => { | 35 | + ipcMain.handle('open-errorbox', (event, arg) => { |
| 36 | dialog.showErrorBox( | 36 | dialog.showErrorBox( |
| 37 | arg.title, | 37 | arg.title, |
| 38 | arg.message | 38 | arg.message |
| 39 | ) | 39 | ) |
| 40 | }) | 40 | }) |
| 41 | - ipcMain.on('statr-server', (event, arg) => { | 41 | + ipcMain.handle('statr-server', async () => { |
| 42 | - Server.StatrServer().then(res => { | 42 | + try { |
| 43 | - event.reply('confirm-start', res) | 43 | + const serveStatus = await Server.StatrServer() |
| 44 | - }).catch(err => { | 44 | + console.log(serveStatus) |
| 45 | + return serveStatus | ||
| 46 | + } catch (error) { | ||
| 45 | dialog.showErrorBox( | 47 | dialog.showErrorBox( |
| 46 | '错误', | 48 | '错误', |
| 47 | - err | 49 | + error |
| 48 | ) | 50 | ) |
| 51 | + } | ||
| 52 | + }) | ||
| 53 | + ipcMain.handle('stop-server', async (event, arg) => { | ||
| 54 | + try { | ||
| 55 | + const serveStatus = await Server.StopServer() | ||
| 56 | + return serveStatus | ||
| 57 | + } catch (error) { | ||
| 58 | + dialog.showErrorBox( | ||
| 59 | + '错误', | ||
| 60 | + error | ||
| 61 | + ) | ||
| 62 | + } | ||
| 63 | + }) | ||
| 64 | + ipcMain.handle('open-win', (event, arg) => { | ||
| 65 | + const ChildWin = new BrowserWindow({ | ||
| 66 | + height: 595, | ||
| 67 | + useContentSize: true, | ||
| 68 | + width: 842, | ||
| 69 | + autoHideMenuBar: true, | ||
| 70 | + minWidth: 842, | ||
| 71 | + show: false, | ||
| 72 | + webPreferences: { | ||
| 73 | + nodeIntegration: true, | ||
| 74 | + webSecurity: false, | ||
| 75 | + // 如果是开发模式可以使用devTools | ||
| 76 | + devTools: process.env.NODE_ENV === 'development', | ||
| 77 | + // devTools: true, | ||
| 78 | + // 在macos中启用橡皮动画 | ||
| 79 | + scrollBounce: process.platform === 'darwin' | ||
| 80 | + } | ||
| 81 | + }) | ||
| 82 | + ChildWin.loadURL(winURL + `#${arg.url}`) | ||
| 83 | + ChildWin.webContents.once('dom-ready', () => { | ||
| 84 | + ChildWin.show() | ||
| 85 | + ChildWin.webContents.send('send-data', arg.sendData) | ||
| 86 | + if (arg.IsPay) { | ||
| 87 | + // 检查支付时候自动关闭小窗口 | ||
| 88 | + const testUrl = setInterval(() => { | ||
| 89 | + const Url = ChildWin.webContents.getURL() | ||
| 90 | + if (Url.includes(arg.PayUrl)) { | ||
| 91 | + ChildWin.close() | ||
| 92 | + } | ||
| 93 | + }, 1200) | ||
| 94 | + ChildWin.on('close', () => { | ||
| 95 | + clearInterval(testUrl) | ||
| 96 | + }) | ||
| 97 | + } | ||
| 49 | }) | 98 | }) |
| 50 | }) | 99 | }) |
| 51 | } | 100 | } | ... | ... |
| ... | @@ -4,19 +4,8 @@ import config from '@config' | ... | @@ -4,19 +4,8 @@ import config from '@config' |
| 4 | import setIpc from './ipcMain' | 4 | import setIpc from './ipcMain' |
| 5 | import upload from './checkupdate' | 5 | import upload from './checkupdate' |
| 6 | import DownloadUpdate from './downloadFile' | 6 | import DownloadUpdate from './downloadFile' |
| 7 | -import path from 'path' | 7 | +import { winURL, loadingURL } from '../config/StaticPath' |
| 8 | 8 | ||
| 9 | -/** | ||
| 10 | - * Set `__static` path to static files in production | ||
| 11 | - * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html | ||
| 12 | - */ | ||
| 13 | -// 这个瓜皮全局变量只能在单个js中生效,而并不是整个主进程中 | ||
| 14 | -if (process.env.NODE_ENV !== 'development') { | ||
| 15 | - global.__static = path.join(__dirname, '/static').replace(/\\/g, '\\\\') | ||
| 16 | -} | ||
| 17 | -// 将文件地址挪到这里 | ||
| 18 | -const winURL = process.env.NODE_ENV === 'development' ? `http://localhost:${process.env.PORT}` : `file://${__dirname}/index.html` | ||
| 19 | -const loadingURL = process.env.NODE_ENV === 'development' ? `http://localhost:${process.env.PORT}/static/loader.html` : `file://${__static}/loader.html` | ||
| 20 | var loadWindow = null | 9 | var loadWindow = null |
| 21 | var mainWindow = null | 10 | var mainWindow = null |
| 22 | 11 | ||
| ... | @@ -37,6 +26,7 @@ function createMainWindow () { | ... | @@ -37,6 +26,7 @@ function createMainWindow () { |
| 37 | webSecurity: false, | 26 | webSecurity: false, |
| 38 | // 如果是开发模式可以使用devTools | 27 | // 如果是开发模式可以使用devTools |
| 39 | devTools: process.env.NODE_ENV === 'development', | 28 | devTools: process.env.NODE_ENV === 'development', |
| 29 | + // devTools: true, | ||
| 40 | // 在macos中启用橡皮动画 | 30 | // 在macos中启用橡皮动画 |
| 41 | scrollBounce: process.platform === 'darwin' | 31 | scrollBounce: process.platform === 'darwin' |
| 42 | } | 32 | } |
| ... | @@ -79,8 +69,8 @@ function loadingWindow () { | ... | @@ -79,8 +69,8 @@ function loadingWindow () { |
| 79 | height: 600, | 69 | height: 600, |
| 80 | frame: false, | 70 | frame: false, |
| 81 | backgroundColor: '#222', | 71 | backgroundColor: '#222', |
| 82 | - transparent: true, | ||
| 83 | skipTaskbar: true, | 72 | skipTaskbar: true, |
| 73 | + transparent: true, | ||
| 84 | resizable: false, | 74 | resizable: false, |
| 85 | webPreferences: { experimentalFeatures: true } | 75 | webPreferences: { experimentalFeatures: true } |
| 86 | }) | 76 | }) | ... | ... |
| 1 | +// 仅示例 | ||
| 1 | import request from '@/utils/request' | 2 | import request from '@/utils/request' |
| 2 | 3 | ||
| 3 | -export function login (data) { | 4 | +// export function login (data) { |
| 4 | - return request({ | 5 | +// return request({ |
| 5 | - url: '/user/login', | 6 | +// url: '/user/login', |
| 6 | - method: 'post', | 7 | +// method: 'post', |
| 7 | - data | 8 | +// data |
| 8 | - }) | 9 | +// }) |
| 9 | -} | 10 | +// } |
| 10 | - | ||
| 11 | -export function getInfo (token) { | ||
| 12 | - return request({ | ||
| 13 | - url: '/user/info', | ||
| 14 | - method: 'get', | ||
| 15 | - params: { token } | ||
| 16 | - }) | ||
| 17 | -} | ||
| 18 | - | ||
| 19 | -export function logout () { | ||
| 20 | - return request({ | ||
| 21 | - url: '/user/logout', | ||
| 22 | - method: 'post' | ||
| 23 | - }) | ||
| 24 | -} | ||
| 25 | 11 | ||
| 12 | +// export function getInfo (token) { | ||
| 13 | +// return request({ | ||
| 14 | +// url: '/user/info', | ||
| 15 | +// method: 'get', | ||
| 16 | +// params: { token } | ||
| 17 | +// }) | ||
| 18 | +// } | ||
| 26 | export function message () { | 19 | export function message () { |
| 27 | return request({ | 20 | return request({ |
| 28 | url: '/message', | 21 | url: '/message', | ... | ... |
| ... | @@ -17,13 +17,8 @@ | ... | @@ -17,13 +17,8 @@ |
| 17 | 17 | ||
| 18 | <div class="right-side"> | 18 | <div class="right-side"> |
| 19 | <div class="doc"> | 19 | <div class="doc"> |
| 20 | - <div class="title alt">您可以点击的按钮</div> | 20 | + <div class="title alt">您可以点击的按钮测试功能</div> |
| 21 | <el-button type="primary" round @click="open()">控制台打印</el-button> | 21 | <el-button type="primary" round @click="open()">控制台打印</el-button> |
| 22 | - <el-button type="primary" round @click="setdata">写入数据</el-button> | ||
| 23 | - <el-button type="primary" round @click="getdata">读取数据</el-button> | ||
| 24 | - <el-button type="primary" round @click="deledata" | ||
| 25 | - >清除所有数据</el-button | ||
| 26 | - > | ||
| 27 | <el-button type="primary" round @click="CheckUpdate('one')" | 22 | <el-button type="primary" round @click="CheckUpdate('one')" |
| 28 | >检查更新</el-button | 23 | >检查更新</el-button |
| 29 | > | 24 | > |
| ... | @@ -35,10 +30,18 @@ | ... | @@ -35,10 +30,18 @@ |
| 35 | <el-button type="primary" round @click="StartServer" | 30 | <el-button type="primary" round @click="StartServer" |
| 36 | >启动内置服务端</el-button | 31 | >启动内置服务端</el-button |
| 37 | > | 32 | > |
| 33 | + <el-button type="primary" round @click="StopServer" | ||
| 34 | + >关闭内置服务端</el-button | ||
| 35 | + > | ||
| 38 | <el-button type="primary" round @click="getMessage" | 36 | <el-button type="primary" round @click="getMessage" |
| 39 | >查看消息</el-button | 37 | >查看消息</el-button |
| 40 | > | 38 | > |
| 41 | </div> | 39 | </div> |
| 40 | + <div class="doc"> | ||
| 41 | + <el-button type="primary" round @click="openNewWin" | ||
| 42 | + >打开新窗口</el-button | ||
| 43 | + > | ||
| 44 | + </div> | ||
| 42 | </div> | 45 | </div> |
| 43 | </main> | 46 | </main> |
| 44 | <el-dialog | 47 | <el-dialog |
| ... | @@ -64,6 +67,7 @@ | ... | @@ -64,6 +67,7 @@ |
| 64 | <script> | 67 | <script> |
| 65 | import SystemInformation from "./LandingPage/SystemInformation"; | 68 | import SystemInformation from "./LandingPage/SystemInformation"; |
| 66 | import { message } from "@/api/login"; | 69 | import { message } from "@/api/login"; |
| 70 | +import { ipcRenderer } from "electron"; | ||
| 67 | export default { | 71 | export default { |
| 68 | name: "landing-page", | 72 | name: "landing-page", |
| 69 | components: { SystemInformation }, | 73 | components: { SystemInformation }, |
| ... | @@ -89,44 +93,17 @@ export default { | ... | @@ -89,44 +93,17 @@ export default { |
| 89 | }), | 93 | }), |
| 90 | created() { | 94 | created() { |
| 91 | console.log(__lib); | 95 | console.log(__lib); |
| 92 | - // 异步进程通信监听 | 96 | + ipcRenderer.on("download-progress", (event, arg) => { |
| 93 | - this.$ipcApi.on("confirm-message", (event, arg) => { | ||
| 94 | - console.log(arg); | ||
| 95 | - if (arg.response === 0) { | ||
| 96 | - this.$db.deleall({ name: "yyy" }).then((res) => { | ||
| 97 | - console.log(res); | ||
| 98 | - if (res !== 0) { | ||
| 99 | - this.getdata(); | ||
| 100 | - this.$message({ | ||
| 101 | - message: "成功删除" + res + "条", | ||
| 102 | - type: "success", | ||
| 103 | - }); | ||
| 104 | - } else { | ||
| 105 | - let errormsg = { | ||
| 106 | - title: "错误", | ||
| 107 | - message: "已经没有数据可以被删除!", | ||
| 108 | - }; | ||
| 109 | - this.$ipcApi.send("open-errorbox", errormsg); | ||
| 110 | - } | ||
| 111 | - }); | ||
| 112 | - } | ||
| 113 | - }); | ||
| 114 | - this.$ipcApi.on("confirm-download", (event, arg) => { | ||
| 115 | - if (arg) { | ||
| 116 | - this.dialogVisible = true; | ||
| 117 | - } | ||
| 118 | - }); | ||
| 119 | - this.$ipcApi.on("download-progress", (event, arg) => { | ||
| 120 | this.percentage = Number(arg); | 97 | this.percentage = Number(arg); |
| 121 | }); | 98 | }); |
| 122 | - this.$ipcApi.on("download-error", (event, arg) => { | 99 | + ipcRenderer.on("download-error", (event, arg) => { |
| 123 | if (arg) { | 100 | if (arg) { |
| 124 | this.progressStaus = "exception"; | 101 | this.progressStaus = "exception"; |
| 125 | this.percentage = 40; | 102 | this.percentage = 40; |
| 126 | this.colors = "#d81e06"; | 103 | this.colors = "#d81e06"; |
| 127 | } | 104 | } |
| 128 | }); | 105 | }); |
| 129 | - this.$ipcApi.on("download-paused", (event, arg) => { | 106 | + ipcRenderer.on("download-paused", (event, arg) => { |
| 130 | if (arg) { | 107 | if (arg) { |
| 131 | this.progressStaus = "warning"; | 108 | this.progressStaus = "warning"; |
| 132 | this.$alert("下载由于未知原因被中断!", "提示", { | 109 | this.$alert("下载由于未知原因被中断!", "提示", { |
| ... | @@ -137,80 +114,25 @@ export default { | ... | @@ -137,80 +114,25 @@ export default { |
| 137 | }); | 114 | }); |
| 138 | } | 115 | } |
| 139 | }); | 116 | }); |
| 140 | - this.$ipcApi.on("download-done", (event, age) => { | 117 | + ipcRenderer.on("download-done", (event, age) => { |
| 141 | this.filePath = age.filePath; | 118 | this.filePath = age.filePath; |
| 142 | this.progressStaus = "success"; | 119 | this.progressStaus = "success"; |
| 143 | this.$alert("更新下载完成!", "提示", { | 120 | this.$alert("更新下载完成!", "提示", { |
| 144 | confirmButtonText: "确定", | 121 | confirmButtonText: "确定", |
| 145 | callback: (action) => { | 122 | callback: (action) => { |
| 146 | - this.$electron.shell.openItem(this.filePath); | 123 | + this.$electron.shell.openPath(this.filePath); |
| 147 | - }, | ||
| 148 | - }); | ||
| 149 | - }); | ||
| 150 | }, | 124 | }, |
| 151 | - methods: { | ||
| 152 | - getMessage() { | ||
| 153 | - message().then((res) => { | ||
| 154 | - this.$alert(res.data, "提示", { | ||
| 155 | - confirmButtonText: "确定", | ||
| 156 | }); | 125 | }); |
| 157 | }); | 126 | }); |
| 158 | - }, | 127 | + ipcRenderer.on("UpdateMsg", (event, age) => { |
| 159 | - StartServer() { | 128 | + switch (age.state) { |
| 160 | - this.$ipcApi.send("statr-server"); | ||
| 161 | - this.$ipcApi.on("confirm-start", (event, arg) => { | ||
| 162 | - console.log(arg); | ||
| 163 | - this.$message({ | ||
| 164 | - type: "success", | ||
| 165 | - message: arg, | ||
| 166 | - }); | ||
| 167 | - }); | ||
| 168 | - }, | ||
| 169 | - // 获取electron方法 | ||
| 170 | - open() {}, | ||
| 171 | - // 设置数据库的数据 | ||
| 172 | - setdata() { | ||
| 173 | - this.$db | ||
| 174 | - .adddata(this.newdata) | ||
| 175 | - .then((res) => this.getdata()) | ||
| 176 | - .catch((err) => console.log(err)); | ||
| 177 | - }, | ||
| 178 | - // 获取数据库的数据 | ||
| 179 | - getdata() { | ||
| 180 | - this.$db | ||
| 181 | - .finddata() | ||
| 182 | - .then((res) => { | ||
| 183 | - console.log(res); | ||
| 184 | - this.textarray = res; | ||
| 185 | - console.log(this.textarray); | ||
| 186 | - }) | ||
| 187 | - .catch((err) => console.log(err)); | ||
| 188 | - }, | ||
| 189 | - // 清空数据库的数据 | ||
| 190 | - deledata() { | ||
| 191 | - // data则是显示需要的参数 | ||
| 192 | - const data = { | ||
| 193 | - title: "清除数据", | ||
| 194 | - buttons: ["确定了!", "才不要,我手滑了"], | ||
| 195 | - noLink: true, | ||
| 196 | - message: "此操作会清空本地数据库中的所有数据,是否继续?", | ||
| 197 | - }; | ||
| 198 | - this.$ipcApi.send("open-messagebox", data); | ||
| 199 | - }, | ||
| 200 | - CheckUpdate(data) { | ||
| 201 | - switch (data) { | ||
| 202 | - case "one": | ||
| 203 | - const dialog = this.$electron.remote.dialog; | ||
| 204 | - this.$ipcApi.send("check-update"); | ||
| 205 | - console.log("启动检查"); | ||
| 206 | - this.$ipcApi.on("UpdateMsg", (event, data) => { | ||
| 207 | - console.log(data); | ||
| 208 | - switch (data.state) { | ||
| 209 | case -1: | 129 | case -1: |
| 210 | const msgdata = { | 130 | const msgdata = { |
| 211 | - title: data.msg, | 131 | + title: "发生错误", |
| 132 | + message: age.msg, | ||
| 212 | }; | 133 | }; |
| 213 | - api.MessageBox(dialog, msgdata); | 134 | + this.dialogVisible = false; |
| 135 | + this.$ipcApi.send("open-errorbox", msgdata); | ||
| 214 | break; | 136 | break; |
| 215 | case 0: | 137 | case 0: |
| 216 | this.$message("正在检查更新"); | 138 | this.$message("正在检查更新"); |
| ... | @@ -226,7 +148,7 @@ export default { | ... | @@ -226,7 +148,7 @@ export default { |
| 226 | this.$message({ type: "success", message: "无新版本" }); | 148 | this.$message({ type: "success", message: "无新版本" }); |
| 227 | break; | 149 | break; |
| 228 | case 3: | 150 | case 3: |
| 229 | - this.percentage = data.msg.percent.toFixed(1); | 151 | + this.percentage = age.msg.percent.toFixed(1); |
| 230 | break; | 152 | break; |
| 231 | case 4: | 153 | case 4: |
| 232 | this.progressStaus = "success"; | 154 | this.progressStaus = "success"; |
| ... | @@ -242,10 +164,53 @@ export default { | ... | @@ -242,10 +164,53 @@ export default { |
| 242 | break; | 164 | break; |
| 243 | } | 165 | } |
| 244 | }); | 166 | }); |
| 167 | + }, | ||
| 168 | + methods: { | ||
| 169 | + openNewWin() { | ||
| 170 | + let data = { | ||
| 171 | + url: "/form/index", | ||
| 172 | + }; | ||
| 173 | + this.$ipcApi.send("open-win", data); | ||
| 174 | + }, | ||
| 175 | + getMessage() { | ||
| 176 | + message().then((res) => { | ||
| 177 | + this.$alert(res.data, "提示", { | ||
| 178 | + confirmButtonText: "确定", | ||
| 179 | + }); | ||
| 180 | + }); | ||
| 181 | + }, | ||
| 182 | + StopServer() { | ||
| 183 | + this.$ipcApi.send("stop-server").then((res) => { | ||
| 184 | + this.$message({ | ||
| 185 | + type: "success", | ||
| 186 | + message: "已关闭", | ||
| 187 | + }); | ||
| 188 | + }); | ||
| 189 | + }, | ||
| 190 | + StartServer() { | ||
| 191 | + this.$ipcApi.send("statr-server").then((res) => { | ||
| 192 | + if (res) { | ||
| 193 | + this.$message({ | ||
| 194 | + type: "success", | ||
| 195 | + message: res, | ||
| 196 | + }); | ||
| 197 | + } | ||
| 198 | + }); | ||
| 199 | + }, | ||
| 200 | + // 获取electron方法 | ||
| 201 | + open() {}, | ||
| 202 | + CheckUpdate(data) { | ||
| 203 | + switch (data) { | ||
| 204 | + case "one": | ||
| 205 | + this.$ipcApi.send("check-update").then((res) => { | ||
| 206 | + console.log("启动检查"); | ||
| 207 | + }); | ||
| 208 | + | ||
| 245 | break; | 209 | break; |
| 246 | case "two": | 210 | case "two": |
| 247 | - console.log(111); | 211 | + this.$ipcApi.send("start-download").then(() => { |
| 248 | - this.$ipcApi.send("start-download"); | 212 | + this.dialogVisible = true; |
| 213 | + }); | ||
| 249 | 214 | ||
| 250 | break; | 215 | break; |
| 251 | 216 | ||
| ... | @@ -258,9 +223,12 @@ export default { | ... | @@ -258,9 +223,12 @@ export default { |
| 258 | }, | 223 | }, |
| 259 | }, | 224 | }, |
| 260 | destroyed() { | 225 | destroyed() { |
| 226 | + console.log("销毁了哦"); | ||
| 261 | this.$ipcApi.remove("confirm-message"); | 227 | this.$ipcApi.remove("confirm-message"); |
| 262 | this.$ipcApi.remove("download-done"); | 228 | this.$ipcApi.remove("download-done"); |
| 263 | this.$ipcApi.remove("download-paused"); | 229 | this.$ipcApi.remove("download-paused"); |
| 230 | + this.$ipcApi.remove("confirm-stop"); | ||
| 231 | + this.$ipcApi.remove("confirm-start"); | ||
| 264 | this.$ipcApi.remove("confirm-download"); | 232 | this.$ipcApi.remove("confirm-download"); |
| 265 | this.$ipcApi.remove("download-progress"); | 233 | this.$ipcApi.remove("download-progress"); |
| 266 | this.$ipcApi.remove("download-error"); | 234 | this.$ipcApi.remove("download-error"); | ... | ... |
| ... | @@ -91,16 +91,14 @@ export default { | ... | @@ -91,16 +91,14 @@ export default { |
| 91 | } | 91 | } |
| 92 | } | 92 | } |
| 93 | }, | 93 | }, |
| 94 | - handleError(err){ | 94 | + handleError(err) { |
| 95 | - console.log(err) | 95 | + console.log(err); |
| 96 | - this.$alert(err, '发生错误', { | 96 | + this.$alert(err, "发生错误", { |
| 97 | - confirmButtonText: '确定', | 97 | + confirmButtonText: "确定", |
| 98 | - callback: action => { | 98 | + callback: (action) => {}, |
| 99 | - | ||
| 100 | - } | ||
| 101 | }); | 99 | }); |
| 102 | - } | 100 | + }, |
| 103 | - } | 101 | + }, |
| 104 | }; | 102 | }; |
| 105 | </script> | 103 | </script> |
| 106 | 104 | ... | ... |
| ... | @@ -12,6 +12,7 @@ const dynamicLoadScript = (src, callback) => { | ... | @@ -12,6 +12,7 @@ const dynamicLoadScript = (src, callback) => { |
| 12 | 12 | ||
| 13 | if (!existingScript) { | 13 | if (!existingScript) { |
| 14 | const script = document.createElement('script') | 14 | const script = document.createElement('script') |
| 15 | + console.log(src) | ||
| 15 | script.src = src // src url for the third-party library being loaded. | 16 | script.src = src // src url for the third-party library being loaded. |
| 16 | script.id = src | 17 | script.id = src |
| 17 | document.body.appendChild(script) | 18 | document.body.appendChild(script) | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | - <div :class="{fullscreen:fullscreen}" class="tinymce-container" :style="{width:containerWidth}"> | 2 | + <div |
| 3 | + :class="{ fullscreen: fullscreen }" | ||
| 4 | + class="tinymce-container" | ||
| 5 | + :style="{ width: containerWidth }" | ||
| 6 | + > | ||
| 3 | <textarea :id="tinymceId" class="tinymce-textarea" /> | 7 | <textarea :id="tinymceId" class="tinymce-textarea" /> |
| 4 | <div class="editor-custom-btn-container"> | 8 | <div class="editor-custom-btn-container"> |
| 5 | - <editorImage color="#1890ff" class="editor-upload-btn" @successCBK="imageSuccessCBK" /> | 9 | + <editorImage |
| 10 | + color="#1890ff" | ||
| 11 | + class="editor-upload-btn" | ||
| 12 | + @successCBK="imageSuccessCBK" | ||
| 13 | + /> | ||
| 6 | </div> | 14 | </div> |
| 7 | </div> | 15 | </div> |
| 8 | </template> | 16 | </template> |
| ... | @@ -12,49 +20,52 @@ | ... | @@ -12,49 +20,52 @@ |
| 12 | * docs: | 20 | * docs: |
| 13 | * https://panjiachen.github.io/vue-element-admin-site/feature/component/rich-editor.html#tinymce | 21 | * https://panjiachen.github.io/vue-element-admin-site/feature/component/rich-editor.html#tinymce |
| 14 | */ | 22 | */ |
| 15 | -import editorImage from './components/EditorImage' | 23 | +import editorImage from "./components/EditorImage"; |
| 16 | -import plugins from './plugins' | 24 | +import plugins from "./plugins"; |
| 17 | -import toolbar from './toolbar' | 25 | +import toolbar from "./toolbar"; |
| 18 | -import load from './dynamicLoadScript' | 26 | +import load from "./dynamicLoadScript"; |
| 19 | 27 | ||
| 20 | -// why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one | 28 | +const tinymceFile = `${__static}/tinymce/tinymce.min.js`; |
| 21 | -const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js' | ||
| 22 | 29 | ||
| 23 | export default { | 30 | export default { |
| 24 | - name: 'Tinymce', | 31 | + name: "Tinymce", |
| 25 | components: { editorImage }, | 32 | components: { editorImage }, |
| 26 | props: { | 33 | props: { |
| 27 | id: { | 34 | id: { |
| 28 | type: String, | 35 | type: String, |
| 29 | - default: function() { | 36 | + default: function () { |
| 30 | - return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '') | 37 | + return ( |
| 31 | - } | 38 | + "vue-tinymce-" + |
| 39 | + +new Date() + | ||
| 40 | + ((Math.random() * 1000).toFixed(0) + "") | ||
| 41 | + ); | ||
| 42 | + }, | ||
| 32 | }, | 43 | }, |
| 33 | value: { | 44 | value: { |
| 34 | type: String, | 45 | type: String, |
| 35 | - default: '' | 46 | + default: "", |
| 36 | }, | 47 | }, |
| 37 | toolbar: { | 48 | toolbar: { |
| 38 | type: Array, | 49 | type: Array, |
| 39 | required: false, | 50 | required: false, |
| 40 | default() { | 51 | default() { |
| 41 | - return [] | 52 | + return []; |
| 42 | - } | 53 | + }, |
| 43 | }, | 54 | }, |
| 44 | menubar: { | 55 | menubar: { |
| 45 | type: String, | 56 | type: String, |
| 46 | - default: '' | 57 | + default: "", |
| 47 | }, | 58 | }, |
| 48 | height: { | 59 | height: { |
| 49 | type: [Number, String], | 60 | type: [Number, String], |
| 50 | required: false, | 61 | required: false, |
| 51 | - default: 360 | 62 | + default: 360, |
| 52 | }, | 63 | }, |
| 53 | width: { | 64 | width: { |
| 54 | type: [Number, String], | 65 | type: [Number, String], |
| 55 | required: false, | 66 | required: false, |
| 56 | - default: 'auto' | 67 | + default: "auto", |
| 57 | - } | 68 | + }, |
| 58 | }, | 69 | }, |
| 59 | data() { | 70 | data() { |
| 60 | return { | 71 | return { |
| ... | @@ -63,148 +74,124 @@ export default { | ... | @@ -63,148 +74,124 @@ export default { |
| 63 | tinymceId: this.id, | 74 | tinymceId: this.id, |
| 64 | fullscreen: false, | 75 | fullscreen: false, |
| 65 | languageTypeList: { | 76 | languageTypeList: { |
| 66 | - 'zh': 'zh_CN', | 77 | + zh: "zh_CN", |
| 67 | - } | 78 | + }, |
| 68 | - } | 79 | + }; |
| 69 | }, | 80 | }, |
| 70 | computed: { | 81 | computed: { |
| 71 | containerWidth() { | 82 | containerWidth() { |
| 72 | - const width = this.width | 83 | + const width = this.width; |
| 73 | - if (/^[\d]+(\.[\d]+)?$/.test(width)) { // matches `100`, `'100'` | 84 | + if (/^[\d]+(\.[\d]+)?$/.test(width)) { |
| 74 | - return `${width}px` | 85 | + // matches `100`, `'100'` |
| 75 | - } | 86 | + return `${width}px`; |
| 76 | - return width | ||
| 77 | } | 87 | } |
| 88 | + return width; | ||
| 89 | + }, | ||
| 78 | }, | 90 | }, |
| 79 | watch: { | 91 | watch: { |
| 80 | value(val) { | 92 | value(val) { |
| 81 | if (!this.hasChange && this.hasInit) { | 93 | if (!this.hasChange && this.hasInit) { |
| 82 | this.$nextTick(() => | 94 | this.$nextTick(() => |
| 83 | - window.tinymce.get(this.tinymceId).setContent(val || '')) | 95 | + window.tinymce.get(this.tinymceId).setContent(val || "") |
| 84 | - } | 96 | + ); |
| 85 | } | 97 | } |
| 86 | }, | 98 | }, |
| 99 | + }, | ||
| 87 | mounted() { | 100 | mounted() { |
| 88 | - this.init() | 101 | + this.init(); |
| 89 | }, | 102 | }, |
| 90 | activated() { | 103 | activated() { |
| 91 | if (window.tinymce) { | 104 | if (window.tinymce) { |
| 92 | - this.initTinymce() | 105 | + this.initTinymce(); |
| 93 | } | 106 | } |
| 94 | }, | 107 | }, |
| 95 | deactivated() { | 108 | deactivated() { |
| 96 | - this.destroyTinymce() | 109 | + this.destroyTinymce(); |
| 97 | }, | 110 | }, |
| 98 | destroyed() { | 111 | destroyed() { |
| 99 | - this.destroyTinymce() | 112 | + this.destroyTinymce(); |
| 100 | }, | 113 | }, |
| 101 | methods: { | 114 | methods: { |
| 102 | init() { | 115 | init() { |
| 103 | // dynamic load tinymce from cdn | 116 | // dynamic load tinymce from cdn |
| 104 | - load(tinymceCDN, (err) => { | 117 | + load(tinymceFile, (err) => { |
| 105 | if (err) { | 118 | if (err) { |
| 106 | - this.$message.error(err.message) | 119 | + this.$message.error(err.message); |
| 107 | - return | 120 | + return; |
| 108 | } | 121 | } |
| 109 | - this.initTinymce() | 122 | + this.initTinymce(); |
| 110 | - }) | 123 | + }); |
| 111 | }, | 124 | }, |
| 112 | initTinymce() { | 125 | initTinymce() { |
| 113 | - const _this = this | 126 | + const _this = this; |
| 114 | window.tinymce.init({ | 127 | window.tinymce.init({ |
| 115 | selector: `#${this.tinymceId}`, | 128 | selector: `#${this.tinymceId}`, |
| 116 | - language: this.languageTypeList['zh'], | 129 | + language: this.languageTypeList["zh"], |
| 117 | - height: this.height, | 130 | + min_height: this.height, |
| 118 | - body_class: 'panel-body ', | 131 | + body_class: "panel-body ", |
| 132 | + draggable_modal: true, | ||
| 119 | object_resizing: false, | 133 | object_resizing: false, |
| 120 | toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar, | 134 | toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar, |
| 121 | menubar: this.menubar, | 135 | menubar: this.menubar, |
| 122 | plugins: plugins, | 136 | plugins: plugins, |
| 137 | + fontsize_formats: "12px 14px 16px 18px 24px 36px 48px 56px 72px", | ||
| 138 | + font_formats: | ||
| 139 | + "微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;", | ||
| 123 | end_container_on_empty_block: true, | 140 | end_container_on_empty_block: true, |
| 124 | - powerpaste_word_import: 'clean', | 141 | + powerpaste_word_import: "clean", |
| 125 | code_dialog_height: 450, | 142 | code_dialog_height: 450, |
| 126 | code_dialog_width: 1000, | 143 | code_dialog_width: 1000, |
| 127 | - advlist_bullet_styles: 'square', | 144 | + custom_undo_redo_levels:50, |
| 128 | - advlist_number_styles: 'default', | 145 | + advlist_bullet_styles: "square", |
| 129 | - imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'], | 146 | + advlist_number_styles: "default", |
| 130 | - default_link_target: '_blank', | 147 | + imagetools_cors_hosts: ["www.tinymce.com", "codepen.io"], |
| 148 | + default_link_target: "_blank", | ||
| 131 | link_title: false, | 149 | link_title: false, |
| 132 | - branding:false, | 150 | + branding: false, |
| 133 | nonbreaking_force_tab: true, // inserting nonbreaking space need Nonbreaking Space Plugin | 151 | nonbreaking_force_tab: true, // inserting nonbreaking space need Nonbreaking Space Plugin |
| 134 | - init_instance_callback: editor => { | 152 | + init_instance_callback: (editor) => { |
| 135 | if (_this.value) { | 153 | if (_this.value) { |
| 136 | - editor.setContent(_this.value) | 154 | + editor.setContent(_this.value); |
| 137 | } | 155 | } |
| 138 | - _this.hasInit = true | 156 | + _this.hasInit = true; |
| 139 | - editor.on('NodeChange Change KeyUp SetContent', () => { | 157 | + editor.on("NodeChange Change KeyUp SetContent", () => { |
| 140 | - this.hasChange = true | 158 | + this.hasChange = true; |
| 141 | - this.$emit('input', editor.getContent()) | 159 | + this.$emit("input", editor.getContent()); |
| 142 | - }) | 160 | + }); |
| 143 | }, | 161 | }, |
| 144 | setup(editor) { | 162 | setup(editor) { |
| 145 | - editor.on('FullscreenStateChanged', (e) => { | 163 | + editor.on("FullscreenStateChanged", (e) => { |
| 146 | - _this.fullscreen = e.state | 164 | + _this.fullscreen = e.state; |
| 147 | - }) | 165 | + }); |
| 148 | - } | 166 | + }, |
| 149 | - // 整合七牛上传 | 167 | + }); |
| 150 | - // images_dataimg_filter(img) { | ||
| 151 | - // setTimeout(() => { | ||
| 152 | - // const $image = $(img); | ||
| 153 | - // $image.removeAttr('width'); | ||
| 154 | - // $image.removeAttr('height'); | ||
| 155 | - // if ($image[0].height && $image[0].width) { | ||
| 156 | - // $image.attr('data-wscntype', 'image'); | ||
| 157 | - // $image.attr('data-wscnh', $image[0].height); | ||
| 158 | - // $image.attr('data-wscnw', $image[0].width); | ||
| 159 | - // $image.addClass('wscnph'); | ||
| 160 | - // } | ||
| 161 | - // }, 0); | ||
| 162 | - // return img | ||
| 163 | - // }, | ||
| 164 | - // images_upload_handler(blobInfo, success, failure, progress) { | ||
| 165 | - // progress(0); | ||
| 166 | - // const token = _this.$store.getters.token; | ||
| 167 | - // getToken(token).then(response => { | ||
| 168 | - // const url = response.data.qiniu_url; | ||
| 169 | - // const formData = new FormData(); | ||
| 170 | - // formData.append('token', response.data.qiniu_token); | ||
| 171 | - // formData.append('key', response.data.qiniu_key); | ||
| 172 | - // formData.append('file', blobInfo.blob(), url); | ||
| 173 | - // upload(formData).then(() => { | ||
| 174 | - // success(url); | ||
| 175 | - // progress(100); | ||
| 176 | - // }) | ||
| 177 | - // }).catch(err => { | ||
| 178 | - // failure('出现未知问题,刷新页面,或者联系程序员') | ||
| 179 | - // console.log(err); | ||
| 180 | - // }); | ||
| 181 | - // }, | ||
| 182 | - }) | ||
| 183 | }, | 168 | }, |
| 184 | destroyTinymce() { | 169 | destroyTinymce() { |
| 185 | - const tinymce = window.tinymce.get(this.tinymceId) | 170 | + const tinymce = window.tinymce.get(this.tinymceId); |
| 186 | if (this.fullscreen) { | 171 | if (this.fullscreen) { |
| 187 | - tinymce.execCommand('mceFullScreen') | 172 | + tinymce.execCommand("mceFullScreen"); |
| 188 | } | 173 | } |
| 189 | 174 | ||
| 190 | if (tinymce) { | 175 | if (tinymce) { |
| 191 | - tinymce.destroy() | 176 | + tinymce.destroy(); |
| 192 | } | 177 | } |
| 193 | }, | 178 | }, |
| 194 | setContent(value) { | 179 | setContent(value) { |
| 195 | - window.tinymce.get(this.tinymceId).setContent(value) | 180 | + window.tinymce.get(this.tinymceId).setContent(value); |
| 196 | }, | 181 | }, |
| 197 | getContent() { | 182 | getContent() { |
| 198 | - window.tinymce.get(this.tinymceId).getContent() | 183 | + window.tinymce.get(this.tinymceId).getContent(); |
| 199 | }, | 184 | }, |
| 200 | imageSuccessCBK(arr) { | 185 | imageSuccessCBK(arr) { |
| 201 | - const _this = this | 186 | + const _this = this; |
| 202 | - arr.forEach(v => { | 187 | + arr.forEach((v) => { |
| 203 | - window.tinymce.get(_this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`) | 188 | + window.tinymce |
| 204 | - }) | 189 | + .get(_this.tinymceId) |
| 205 | - } | 190 | + .insertContent(`<img class="wscnph" src="${v.url}" >`); |
| 206 | - } | 191 | + }); |
| 207 | -} | 192 | + }, |
| 193 | + }, | ||
| 194 | +}; | ||
| 208 | </script> | 195 | </script> |
| 209 | 196 | ||
| 210 | <style scoped> | 197 | <style scoped> |
| ... | @@ -212,7 +199,7 @@ export default { | ... | @@ -212,7 +199,7 @@ export default { |
| 212 | position: relative; | 199 | position: relative; |
| 213 | line-height: normal; | 200 | line-height: normal; |
| 214 | } | 201 | } |
| 215 | -.tinymce-container>>>.mce-fullscreen { | 202 | +.tinymce-container >>> .mce-fullscreen { |
| 216 | z-index: 10000; | 203 | z-index: 10000; |
| 217 | } | 204 | } |
| 218 | .tinymce-textarea { | 205 | .tinymce-textarea { | ... | ... |
| ... | @@ -2,6 +2,6 @@ | ... | @@ -2,6 +2,6 @@ |
| 2 | // Detail plugins list see https://www.tinymce.com/docs/plugins/ | 2 | // Detail plugins list see https://www.tinymce.com/docs/plugins/ |
| 3 | // Custom builds see https://www.tinymce.com/download/custom-builds/ | 3 | // Custom builds see https://www.tinymce.com/download/custom-builds/ |
| 4 | 4 | ||
| 5 | -const plugins = ['advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount'] | 5 | +const plugins = ['print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template code codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools help emoticons autoresize'] |
| 6 | 6 | ||
| 7 | export default plugins | 7 | export default plugins | ... | ... |
| 1 | // Here is a list of the toolbar | 1 | // Here is a list of the toolbar |
| 2 | // Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols | 2 | // Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols |
| 3 | 3 | ||
| 4 | -const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen'] | 4 | +// eslint-disable-next-line no-multi-str |
| 5 | +const toolbar = ['code undo redo restoredraft | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify outdent indent | \ | ||
| 6 | +styleselect formatselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \ | ||
| 7 | +table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter axupimgs'] | ||
| 5 | 8 | ||
| 6 | export default toolbar | 9 | export default toolbar | ... | ... |
| ... | @@ -35,11 +35,9 @@ export default { | ... | @@ -35,11 +35,9 @@ export default { |
| 35 | 35 | ||
| 36 | components: {}, | 36 | components: {}, |
| 37 | created() { | 37 | created() { |
| 38 | - this.$ipcApi.send("IsUseSysTitle"); | 38 | + this.$ipcApi.send("IsUseSysTitle").then(res => { |
| 39 | - this.$ipcApi.on( | 39 | + this.IsUseSysTitle = res; |
| 40 | - "CisUseSysTitle", | 40 | + }); |
| 41 | - (event, arg) => (this.IsUseSysTitle = arg) | ||
| 42 | - ); | ||
| 43 | }, | 41 | }, |
| 44 | 42 | ||
| 45 | mounted() {}, | 43 | mounted() {}, |
| ... | @@ -49,8 +47,9 @@ export default { | ... | @@ -49,8 +47,9 @@ export default { |
| 49 | this.$ipcApi.send("windows-mini"); | 47 | this.$ipcApi.send("windows-mini"); |
| 50 | }, | 48 | }, |
| 51 | MixOrReduction() { | 49 | MixOrReduction() { |
| 52 | - this.$ipcApi.send("window-max"); | 50 | + this.$ipcApi.send("window-max").then(res=>{ |
| 53 | - this.$ipcApi.on("window-confirm", (event, arg) => (this.mix = arg)); | 51 | + this.mix = res.status |
| 52 | + }) | ||
| 54 | }, | 53 | }, |
| 55 | Close() { | 54 | Close() { |
| 56 | this.$ipcApi.send("window-close"); | 55 | this.$ipcApi.send("window-close"); | ... | ... |
| ... | @@ -17,7 +17,6 @@ if (!process.env.IS_WEB) { | ... | @@ -17,7 +17,6 @@ if (!process.env.IS_WEB) { |
| 17 | require('@/styles/custom-title.scss') | 17 | require('@/styles/custom-title.scss') |
| 18 | } | 18 | } |
| 19 | // 当处于electron状态下才引用db | 19 | // 当处于electron状态下才引用db |
| 20 | - Vue.prototype.$db = require('./api/operationalData').default | ||
| 21 | Vue.prototype.$ipcApi = require('./utils/ipcRenderer').default | 20 | Vue.prototype.$ipcApi = require('./utils/ipcRenderer').default |
| 22 | } | 21 | } |
| 23 | 22 | ... | ... |
| 1 | -import $electron from 'electron' | 1 | +import { ipcRenderer } from 'electron' |
| 2 | - | ||
| 3 | export default { | 2 | export default { |
| 4 | - send (data, arg, cb) { | 3 | + send (name, data = {}) { |
| 5 | - $electron.ipcRenderer.send(data, arg, (event, arg) => cb(event, arg)) | 4 | + return new Promise((resolve, reject) => { |
| 6 | - }, | 5 | + ipcRenderer.invoke(name, data).then(res => { |
| 7 | - on (data, arg, cb) { | 6 | + resolve(res) |
| 8 | - $electron.ipcRenderer.on(data, arg, (event, arg) => cb(event, arg)) | 7 | + }) |
| 8 | + }) | ||
| 9 | }, | 9 | }, |
| 10 | remove (data) { | 10 | remove (data) { |
| 11 | - $electron.ipcRenderer.removeAllListeners(data) | 11 | + ipcRenderer.removeAllListeners(data) |
| 12 | } | 12 | } |
| 13 | } | 13 | } | ... | ... |
| ... | @@ -24,6 +24,10 @@ serves.interceptors.response.use(res => { | ... | @@ -24,6 +24,10 @@ serves.interceptors.response.use(res => { |
| 24 | console.log('错误回调', err) | 24 | console.log('错误回调', err) |
| 25 | Message.error('网络超时') | 25 | Message.error('网络超时') |
| 26 | } | 26 | } |
| 27 | + if (err.message.includes('Network Error')) { | ||
| 28 | + console.log('错误回调', err) | ||
| 29 | + Message.error('服务端未启动,或网络连接错误') | ||
| 30 | + } | ||
| 27 | return Promise.reject(err) | 31 | return Promise.reject(err) |
| 28 | }) | 32 | }) |
| 29 | 33 | ... | ... |
| ... | @@ -3,8 +3,8 @@ | ... | @@ -3,8 +3,8 @@ |
| 3 | */ | 3 | */ |
| 4 | 4 | ||
| 5 | export function isvalidUsername (str) { | 5 | export function isvalidUsername (str) { |
| 6 | - const valid_map = ['admin', 'editor'] | 6 | + const validMap = ['admin', 'editor'] |
| 7 | - return valid_map.indexOf(str.trim()) >= 0 | 7 | + return validMap.indexOf(str.trim()) >= 0 |
| 8 | } | 8 | } |
| 9 | 9 | ||
| 10 | /* 合法uri */ | 10 | /* 合法uri */ | ... | ... |
| ... | @@ -32,7 +32,40 @@ | ... | @@ -32,7 +32,40 @@ |
| 32 | margin: 0; | 32 | margin: 0; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | + /* .loading-line { | ||
| 36 | + height: 1px; | ||
| 37 | + width: 100%; | ||
| 38 | + position: absolute; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + .top { | ||
| 42 | + background: linear-gradient(-225deg, #ff3cac 0%, #2b86c5 58%, #ff3cac 100%); | ||
| 43 | + | ||
| 44 | + top: 0; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + .left { | ||
| 48 | + background: linear-gradient(-225deg, #ff3cac 0%, #2b86c5 58%, #ff3cac 100%); | ||
| 49 | + right: 99px; | ||
| 50 | + transform: rotate(90deg); | ||
| 51 | + width: 600px; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + .right { | ||
| 55 | + left: 99px; | ||
| 56 | + transform: rotate(90deg); | ||
| 57 | + width: 600px; | ||
| 58 | + background: linear-gradient(-225deg, #ff3cac 0%, #2b86c5 58%, #ff3cac 100%); | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + .bottom { | ||
| 62 | + background: linear-gradient(-225deg, #ff3cac 0%, #2b86c5 58%, #ff3cac 100%); | ||
| 63 | + | ||
| 64 | + bottom: 0; | ||
| 65 | + } */ | ||
| 66 | + | ||
| 35 | .scene { | 67 | .scene { |
| 68 | + position: relative; | ||
| 36 | display: flex; | 69 | display: flex; |
| 37 | justify-content: center; | 70 | justify-content: center; |
| 38 | align-items: center; | 71 | align-items: center; |
| ... | @@ -110,11 +143,23 @@ | ... | @@ -110,11 +143,23 @@ |
| 110 | transform: rotate(1turn); | 143 | transform: rotate(1turn); |
| 111 | } | 144 | } |
| 112 | } | 145 | } |
| 146 | + /* @keyframes slidein{ | ||
| 147 | + from{ | ||
| 148 | + | ||
| 149 | + } | ||
| 150 | + to{ | ||
| 151 | + | ||
| 152 | + } | ||
| 153 | + } */ | ||
| 113 | </style> | 154 | </style> |
| 114 | </head> | 155 | </head> |
| 115 | 156 | ||
| 116 | <body> | 157 | <body> |
| 117 | <div class="scene"> | 158 | <div class="scene"> |
| 159 | + <!-- <i class="loading-line top"></i> | ||
| 160 | + <i class="loading-line right"></i> | ||
| 161 | + <i class="loading-line bottom"></i> | ||
| 162 | + <i class="loading-line left"></i> --> | ||
| 118 | <div class="loader"> | 163 | <div class="loader"> |
| 119 | <span></span> | 164 | <span></span> |
| 120 | <span></span> | 165 | <span></span> | ... | ... |
static/pay.html
0 → 100644
| 1 | +<!DOCTYPE html> | ||
| 2 | +<html lang="en"> | ||
| 3 | + | ||
| 4 | +<head> | ||
| 5 | + <meta charset="UTF-8"> | ||
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| 7 | + <meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
| 8 | + <title>支付宝</title> | ||
| 9 | +</head> | ||
| 10 | + | ||
| 11 | +<body> | ||
| 12 | + <div id="alipay"></div> | ||
| 13 | +</body> | ||
| 14 | +<script> | ||
| 15 | + const { ipcRenderer } = require('electron') | ||
| 16 | + window.onload = () => { | ||
| 17 | + ipcRenderer.on('send-data', (event, arg) => { | ||
| 18 | + document.getElementById('alipay').innerHTML = arg | ||
| 19 | + document.forms.alipay_submit.submit() | ||
| 20 | + }) | ||
| 21 | + } | ||
| 22 | +</script> | ||
| 23 | + | ||
| 24 | +</html> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
static/tinymce/icons/default/icons.min.js
0 → 100644
此文件的差异被折叠,
点击展开。
static/tinymce/langs/readme.md
0 → 100644
static/tinymce/langs/zh_CN.js
0 → 100644
此文件的差异被折叠,
点击展开。
static/tinymce/license.txt
0 → 100644
此文件的差异被折叠,
点击展开。
static/tinymce/plugins/advlist/plugin.min.js
0 → 100644
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var n,e,t,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(n,e,t){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===t?null:{"list-style-type":t})},l=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(n){return function(){return n}},c=i(!1),s=i(!0),o=function(){return a},a=(n=function(n){return n.isNone()},{fold:function(n,e){return n()},is:c,isSome:c,isNone:s,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:t,orThunk:e,map:o,each:function(){},bind:o,exists:c,forall:s,filter:o,equals:n,equals_:n,toArray:function(){return[]},toString:i("none()")}),f=function(t){var n=i(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:s,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return f(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:a},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(c,function(n){return e(t,n)})}};return o},d=function(n){return null===n||n===undefined?a:f(n)},g=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},m=function(r){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&(t=n,(e=r).$.contains(e.getBody(),t));var e,t}},p=function(n,e,t){var r=function(n,e){for(var t=0;t<n.length;t++){if(e(n[t]))return t}return-1}(e.parents,g),o=-1!==r?e.parents.slice(0,r):e.parents,i=l.grep(o,m(n));return 0<i.length&&i[0].nodeName===t},y=function(o,n,e,t,r,i){o.ui.registry.addSplitButton(n,{tooltip:e,icon:"OL"===r?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(n){n(l.map(i,function(n){return{type:"choiceitem",value:"default"===n?"":n,icon:"list-"+("OL"===r?"num":"bull")+"-"+("disc"===n||"decimal"===n?"default":n),text:n.replace(/\-/g," ").replace(/\b\w/g,function(n){return n.toUpperCase()})}}))},onAction:function(){return o.execCommand(t)},onItemAction:function(n,e){u(o,r,e)},select:function(e){var n,t,r;return(t=(n=o).dom.getParent(n.selection.getNode(),"ol,ul"),r=n.dom.getStyle(t,"listStyleType"),d(r)).map(function(n){return e===n}).getOr(!1)},onSetup:function(e){var n=function(n){e.setActive(p(o,n,r))};return o.on("NodeChange",n),function(){return o.off("NodeChange",n)}}})},v=function(n,e,t,r,o,i){var u,l,c,s,a;1<i.length?y(n,e,t,r,o,i):(l=e,c=t,s=r,a=o,(u=n).ui.registry.addToggleButton(l,{active:!1,tooltip:c,icon:"OL"===a?"ordered-list":"unordered-list",onSetup:function(e){var n=function(n){e.setActive(p(u,n,a))};return u.on("NodeChange",n),function(){return u.off("NodeChange",n)}},onAction:function(){return u.execCommand(s)}}))};r.add("advlist",function(n){var t,e,r,o;n.hasPlugin("lists")&&(v(e=n,"numlist","Numbered list","InsertOrderedList","OL",(r=e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"))?r.split(/[ ,]/):[]),v(e,"bullist","Bullet list","InsertUnorderedList","UL",(o=e.getParam("advlist_bullet_styles","default,circle,square"))?o.split(/[ ,]/):[]),(t=n).addCommand("ApplyUnorderedListStyle",function(n,e){u(t,"UL",e["list-style-type"])}),t.addCommand("ApplyOrderedListStyle",function(n,e){u(t,"OL",e["list-style-type"])}))})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
static/tinymce/plugins/anchor/plugin.min.js
0 → 100644
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),a="a:not([href])",n=function(e){return e.getAttribute("id")||e.getAttribute("name")||""},r=function(e){return(t=e)&&"a"===t.nodeName.toLowerCase()&&!e.getAttribute("href")&&""!==n(e);var t},c=function(e){var n=e.dom;t(n).walk(e.selection.getRng(),function(e){o.each(e,function(e){var t;r(t=e)&&!t.firstChild&&n.remove(e,!1)})})},u=function(e){return e.dom.getParent(e.selection.getStart(),a)},i=function(e,t){var n,o,a,r,i,l=u(e);l?(a=e,r=t,(i=l).removeAttribute("name"),i.id=r,a.addVisual(),a.undoManager.add()):(o=t,(n=e).undoManager.transact(function(){n.getParam("allow_html_in_named_anchor",!1,"boolean")||n.selection.collapse(!0),n.selection.isCollapsed()?n.insertContent(n.dom.createHTML("a",{id:o})):(c(n),n.formatter.remove("namedAnchor",null,null,!0),n.formatter.apply("namedAnchor",{value:o}),n.addVisual())})),e.focus()},l=function(o){var e,t=(e=u(o))?n(e):"";o.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(e){var t,n;t=o,n=e.getData().id,(/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(n)?(i(t,n),1):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),0))&&e.close()}})},d=function(r){return function(e){for(var t,n,o=0;o<e.length;o++){var a=e[o];n=void 0,!(n=t=a)||n.attr("href")||!n.attr("id")&&!n.attr("name")||t.firstChild||a.attr("contenteditable",r)}}};e.add("anchor",function(e){var t,n,o;(t=e).on("PreInit",function(){t.parser.addNodeFilter("a",d("false")),t.serializer.addNodeFilter("a",d(null))}),(n=e).addCommand("mceAnchor",function(){l(n)}),(o=e).ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return o.execCommand("mceAnchor")},onSetup:function(e){return o.selection.selectorChangedWithUnbind("a:not([href])",e.setActive).unbind}}),o.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return o.execCommand("mceAnchor")}}),e.on("PreInit",function(){e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:function(e,t,n){return r(e)}})})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),i=function(e,t){var n;return t<0&&(t=0),3!==e.nodeType||(n=e.data.length)<t&&(t=n),t},y=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,i(t,n)):e.setStartBefore(t)},k=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,i(t,n)):e.setEndAfter(t)},r=function(e,t,n){var o,i,r,a,s,d,f,l=e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i),c=e.getParam("default_link_target",!1);if("A"!==e.selection.getNode().tagName){var g=e.selection.getRng().cloneRange();if(g.startOffset<5){if(!(s=g.endContainer.previousSibling)){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;s=g.endContainer.firstChild.nextSibling}if(d=s.length,y(g,s,d),k(g,s,d),g.endOffset<5)return;o=g.endOffset,i=s}else{if(3!==(i=g.endContainer).nodeType&&i.firstChild){for(;3!==i.nodeType&&i.firstChild;)i=i.firstChild;3===i.nodeType&&(y(g,i,0),k(g,i,i.nodeValue.length))}o=1===g.endOffset?2:g.endOffset-1-t}for(var u,h=o;y(g,i,2<=o?o-2:0),k(g,i,1<=o?o-1:0),--o," "!==(f=g.toString())&&""!==f&&160!==f.charCodeAt(0)&&0<=o-2&&f!==n;);(u=g.toString())===n||" "===u||160===u.charCodeAt(0)?(y(g,i,o),k(g,i,h),o+=1):(0===g.startOffset?y(g,i,0):y(g,i,o),k(g,i,h)),"."===(a=g.toString()).charAt(a.length-1)&&k(g,i,h-1);var m=(a=g.toString().trim()).match(l),C=e.getParam("link_default_protocol","http","string");m&&("www."===m[1]?m[1]=C+"://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),r=e.selection.getBookmark(),e.selection.setRng(g),e.execCommand("createlink",!1,m[1]+m[2]),!1!==c&&e.dom.setAttrib(e.selection.getNode(),"target",c),e.selection.moveToBookmark(r),e.nodeChanged())}},t=function(t){var n;t.on("keydown",function(e){13!==e.keyCode||r(t,-1,"")}),o.browser.isIE()?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)})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),h=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},a=function(e,t,n,i,o){r.setEditorTimeout(e,function(){b(e,t),n--?a(e,t,n,i,o):o&&o()},i)},p=function(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))},v=function(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o},b=function(e,t){var n,i,o,r,s,a,g,u,l,c,m,f=e.dom,d=e.getDoc();d&&((n=e).plugins.fullscreen&&n.plugins.fullscreen.isFullscreen()?p(e,!0):(i=d.documentElement,o=e.getParam("autoresize_bottom_margin",50,"number"),r=y(e),s=v(f,i,"margin-top",!0),a=v(f,i,"margin-bottom",!0),(g=i.offsetHeight+s+a+o)<0&&(g=0),g+(u=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight)>y(e)&&(r=g+u),(l=e.getParam("max_height",0,"number"))&&l<r?(r=l,p(e,!0)):p(e,!1),r!==t.get()&&(c=r-t.get(),f.setStyle(e.getContainer(),"height",r+"px"),t.set(r),e.fire("ResizeEditor"),h.browser.isSafari()&&h.mac&&(m=e.getWin()).scrollTo(m.pageXOffset,m.pageYOffset),e.hasFocus()&&e.selection.scrollIntoView(e.selection.getNode()),h.webkit&&c<0&&b(e,t))))};e.add("autoresize",function(e){var t,n,i,o,r,s;e.settings.hasOwnProperty("resize")||(e.settings.resize=!1),e.inline||(s=0,r=t={get:function(){return s},set:function(e){s=e}},(o=e).addCommand("mceAutoResize",function(){b(o,r)}),i=t,(n=e).on("init",function(){var e=n.getParam("autoresize_overflow_padding",1,"number"),t=n.dom;t.setStyles(n.getDoc().documentElement,{height:"auto"}),t.setStyles(n.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),n.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(){b(n,i)}),n.getParam("autoresize_on_init",!0,"boolean")&&n.on("init",function(){a(n,i,20,100,function(){a(n,i,5,1e3)})}))})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=(e=undefined,function(t){return e===t}),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),n=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,e){var r=t||e,n=/^(\d+)([ms]?)$/.exec(""+r);return(n[2]?{s:1e3,m:6e4}[n[2]]:1)*parseInt(r,10)},u=function(t){var e=document.location;return t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},s=function(t,e){if(a(e))return t.dom.isEmpty(t.getBody());var r=o.trim(e);if(""===r)return!0;var n=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(n)},f=function(t){var e=parseInt(n.getItem(u(t)+"time"),10)||0;return!((new Date).getTime()-e>i(t.getParam("autosave_retention"),"20m"))||(c(t,!1),!1)},c=function(t,e){var r=u(t);n.removeItem(r+"draft"),n.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},m=function(t){var e=u(t);!s(t)&&t.isDirty()&&(n.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),n.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))},l=function(t){var e=u(t);f(t)&&(t.setContent(n.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))},v=function(t){var e=i(t.getParam("autosave_interval"),"30s");r.setEditorInterval(t,function(){m(t)},e)},d=function(t){t.undoManager.transact(function(){l(t),c(t)}),t.focus()},g=tinymce.util.Tools.resolve("tinymce.EditorManager"),y=function(r){return function(t){t.setDisabled(!f(r));var e=function(){return t.setDisabled(!f(r))};return r.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return r.off("StoreDraft RestoreDraft RemoveDraft",e)}}};t.add("autosave",function(t){var e,r;return t.editorManager.on("BeforeUnload",function(t){var e;o.each(g.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&&(t.preventDefault(),t.returnValue=e)}),v(e=t),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){d(e)},onSetup:y(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){d(e)},onSetup:y(e)}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&l(t)}),r=t,{hasDraft:function(){return f(r)},storeDraft:function(){return m(r)},restoreDraft:function(){return l(r)},removeDraft:function(t){return c(r,t)},isEmpty:function(t){return s(r,t)}}})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
static/tinymce/plugins/bbcode/plugin.min.js
0 → 100644
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};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> '),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> '),t};o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=t(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=t(o.content)),o.get&&(o.content=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};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(/ |\u00a0/gi," "),o(/"/gi,'"'),o(/</gi,"<"),o(/>/gi,">"),o(/&/gi,"&"),t}(o.content))})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
static/tinymce/plugins/charmap/plugin.min.js
0 → 100644
此文件的差异被折叠,
点击展开。
static/tinymce/plugins/code/plugin.min.js
0 → 100644
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(o){var e=o.getContent({source_view:!0});o.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){var t,n;t=o,n=e.getData().code,t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged(),e.close()}})};e.add("code",function(e){var t,n;return(t=e).addCommand("mceCodeEditor",function(){o(t)}),(n=e).ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return o(n)}}),n.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return o(n)}}),{}})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
此文件的差异被折叠,
点击展开。
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("colorpicker",function(){console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("contextmenu",function(){console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var n,t,e,o,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(n,t){var e,o=n.dom,r=n.selection.getSelectedBlocks();r.length&&(e=o.getAttrib(r[0],"dir"),u.each(r,function(n){o.getParent(n.parentNode,'*[dir="'+t+'"]',o.getRoot())||o.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},c=function(n){return function(){return n}},f=c(!1),d=c(!0),l=function(){return m},m=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:f,isSome:f,isNone:d,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(undefined),or:e,orThunk:t,map:l,each:function(){},bind:l,exists:f,forall:d,filter:l,equals:n,equals_:n,toArray:function(){return[]},toString:c("none()")}),a=function(e){var n=c(e),t=function(){return r},o=function(n){return n(e)},r={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:d,isNone:f,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return a(n(e))},each:function(n){n(e)},bind:o,exists:o,forall:o,filter:function(n){return n(e)?r:m},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return r},s={some:a,none:l,from:function(n){return null===n||n===undefined?m:a(n)}},g=(o="function",function(n){return typeof n===o}),h=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:n}},y={fromHtml:function(n,t){var e=(t||document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return h(e.childNodes[0])},fromTag:function(n,t){var e=(t||document).createElement(n);return h(e)},fromText:function(n,t){var e=(t||document).createTextNode(n);return h(e)},fromDom:h,fromPoint:function(n,t,e){return s.from(n.dom.elementFromPoint(t,e)).map(h)}},v=("undefined"!=typeof window||Function("return this;")(),function(t){return function(n){return n.dom.nodeType===t}}),p=v(3),T=v(9),N=v(11),D=g(Element.prototype.attachShadow)&&g(Node.prototype.getRootNode)?function(n){return y.fromDom(n.dom.getRootNode())}:function(n){return T(n)?n:(t=n,y.fromDom(t.dom.ownerDocument));var t},w=function(n){var t=D(n);return N(t)?s.some(t):s.none()},O=function(n){return y.fromDom(n.dom.host)},C=function(n){var t=p(n)?n.dom.parentNode:n.dom;if(t===undefined||null===t||null===t.ownerDocument)return!1;var e,o,r=t.ownerDocument;return w(y.fromDom(t)).fold(function(){return r.body.contains(t)},(e=C,o=O,function(n){return e(o(n))}))},S=function(n,t){return(e=n).style!==undefined&&g(e.style.getPropertyValue)?n.style.getPropertyValue(t):"";var e},L=function(n){return"rtl"===(e="direction",o=(t=n).dom,""!==(r=window.getComputedStyle(o).getPropertyValue(e))||C(t)?r:S(o,e))?"rtl":"ltr";var t,e,o,r},R=function(t,o){return function(e){var n=function(n){var t=y.fromDom(n.element);e.setActive(L(t)===o)};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}};r.add("directionality",function(n){var t,e;(t=n).addCommand("mceDirectionLTR",function(){i(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){i(t,"rtl")}),(e=n).ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return e.execCommand("mceDirectionLTR")},onSetup:R(e,"ltr")}),e.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return e.execCommand("mceDirectionRTL")},onSetup:R(e,"rtl")})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var u,t,n,e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},m=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}},a=Object.prototype.hasOwnProperty,c=function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},r=0;r<t.length;r++){var o=t[r];for(var i in o)a.call(o,i)&&(e[i]=u(e[i],o[i]))}return e},i=function(t){return function(){return t}},l=i(!(u=function(t,n){return n})),s=i(!0),f=function(){return g},g=(t=function(t){return t.isNone()},{fold:function(t,n){return t()},is:l,isSome:l,isNone:s,getOr:e=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:e,orThunk:n,map:f,each:function(){},bind:f,exists:l,forall:s,filter:f,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}),d=function(e){var t=i(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:s,isNone:l,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return d(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:g},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(l,function(t){return n(e,t)})}};return o},h={some:d,none:f,from:function(t){return null===t||t===undefined?g:d(t)}},y=Object.keys,v=Object.hasOwnProperty,p=function(t,n){for(var e=y(t),r=0,o=e.length;r<o;r++){var i=e[r];n(t[i],i)}},b=function(t,r){var o={};return p(t,function(t,n){var e=r(t,n);o[e.k]=e.v}),o},w=function(t,n){return-1!==t.indexOf(n)},O=tinymce.util.Tools.resolve("tinymce.Resource"),C=tinymce.util.Tools.resolve("tinymce.util.Delay"),j=tinymce.util.Tools.resolve("tinymce.util.Promise"),k="All",A={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},_=function(t,n){return e=t,r=n,v.call(e,r)?t[n]:n;var e,r},T=function(t){var e,n=t.getParam("emoticons_append",{},"object");return e=function(t){return o({keywords:[],category:"user"},t)},b(n,function(t,n){return{k:n,v:e(t,n)}})},P=function(e,o,t){var r=m(h.none()),n=m(h.none()),f=e.getParam("emoticons_images_url","https://twemoji.maxcdn.com/v/13.0.1/72x72/","string"),i=function(t){var l={},s=[];p(t,function(t,n){var e,r,o,i,u,a={title:n,keywords:t.keywords,"char":(r=(e=t)["char"],u=0,i="<img",(o=r).length>=i.length&&o.substr(u,u+i.length)===i?e["char"].replace(/src="([^"]+)"/,function(t,n){return'src="'+f+n+'"'}):e["char"]),category:_(A,t.category)},c=l[a.category]!==undefined?l[a.category]:[];l[a.category]=c.concat([a]),s.push(a)}),r.set(h.some(l)),n.set(h.some(s))};e.on("init",function(){O.load(t,o).then(function(t){var n=T(e);i(c(t,n))},function(t){console.log("Failed to load emoticons: "+t),r.set(h.some({})),n.set(h.some([]))})});var u=function(){return n.get().getOr([])},a=function(){return r.get().isSome()&&n.get().isSome()};return{listCategories:function(){return[k].concat(y(r.get().getOr({})))},hasLoaded:a,waitForLoad:function(){return a()?j.resolve(!0):new j(function(t,n){var e=15,r=C.setInterval(function(){a()?(C.clearInterval(r),t(!0)):--e<0&&(console.log("Could not load emojis from url: "+o),C.clearInterval(r),n(!1))},100)})},listAll:u,listCategory:function(n){return n===k?u():r.get().bind(function(t){return h.from(t[n])}).getOr([])}}},x=function(t,n,e){for(var r=[],o=n.toLowerCase(),i=e.fold(function(){return l},function(n){return function(t){return n<=t}}),u=0;u<t.length&&(0!==n.length&&!function(t,n){return w(t.title.toLowerCase(),n)||function(t,n){for(var e=0,r=t.length;e<r;e++){if(n(t[e],e))return!0}return!1}(t.keywords,function(t){return w(t.toLowerCase(),n)})}(t[u],o)||(r.push({value:t[u]["char"],text:t[u].title,icon:t[u]["char"]}),!i(r.length)));u++);return r},D="pattern",L=function(o,u){var e,r,i,t={pattern:"",results:x(u.listAll(),"",h.some(300))},a=m(k),c=(e=function(t){var n,e,r,o,i;e=(n=t).getData(),r=a.get(),o=u.listCategory(r),i=x(o,e[D],r===k?h.some(300):h.none()),n.setData({results:i})},r=200,i=null,{cancel:function(){null!==i&&(clearTimeout(i),i=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null!==i&&clearTimeout(i),i=setTimeout(function(){e.apply(null,t),i=null},r)}}),n={label:"Search",type:"input",name:D},l={type:"collection",name:"results"},s=function(){return{title:"Emoticons",size:"normal",body:{type:"tabpanel",tabs:function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r}(u.listCategories(),function(t){return{title:t,name:t,items:[n,l]}})},initialData:t,onTabChange:function(t,n){a.set(n.newTabName),c.throttle(t)},onChange:c.throttle,onAction:function(t,n){var e,r;"results"===n.name&&(e=o,r=n.value,e.insertContent(r),t.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}},f=o.windowManager.open(s());f.focus(D),u.hasLoaded()||(f.block("Loading emoticons..."),u.waitForLoad().then(function(){f.redial(s()),c.throttle(f),f.focus(D),f.unblock()})["catch"](function(t){f.redial({title:"Emoticons",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"<p>Could not load emoticons</p>"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),f.focus(D),f.unblock()}))};r.add("emoticons",function(t,n){var e,r,o,i,u,a,c,l,s,f=(r=n,o=(e=t).getParam("emoticons_database","emojis","string"),e.getParam("emoticons_database_url",r+"/js/"+o+e.suffix+".js","string")),m=t.getParam("emoticons_database_id","tinymce.plugins.emoticons","string"),g=P(t,f,m);u=g,a=function(){return L(i,u)},(i=t).ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:a}),i.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:a}),l=g,(c=t).ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(n,e){return l.waitForLoad().then(function(){var t=l.listAll();return x(t,n,h.some(e))})},onAction:function(t,n,e){c.selection.setRng(n),c.insertContent(e),t.hide()}}),(s=t).on("PreInit",function(){s.parser.addAttributeFilter("data-emoticon",function(t){!function(t,n){for(var e=0,r=t.length;e<r;e++){n(t[e],e)}}(t,function(t){t.attr("data-mce-resize","false"),t.attr("data-mce-placeholder","1")})})})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var s=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){return(u=Object.assign||function(e){for(var t,n=1,l=arguments.length;n<l;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},p=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=tinymce.util.Tools.resolve("tinymce.html.DomParser"),m=tinymce.util.Tools.resolve("tinymce.html.Node"),f=tinymce.util.Tools.resolve("tinymce.html.Serializer"),h=function(e){return e.getParam("fullpage_hide_in_source_view")},i=function(e){return e.getParam("fullpage_default_encoding")},g=function(e){return e.getParam("fullpage_default_font_family")},y=function(e){return e.getParam("fullpage_default_font_size")},v=function(e){return t({validate:!1,root_name:"#document"}).parse(e,{format:"xhtml"})},d=function(l,i){var e,t,n,o,r,a,c=(e=l,t=i.get(),r=v(t),(a={}).fontface=g(e),a.fontsize=y(e),7===(n=r.firstChild).type&&(a.xml_pi=!0,(o=/encoding="([^"]+)"/.exec(n.value))&&(a.docencoding=o[1])),(n=r.getAll("#doctype")[0])&&(a.doctype="<!DOCTYPE"+n.value+">"),(n=r.getAll("title")[0])&&n.firstChild&&(a.title=n.firstChild.value),p.each(r.getAll("meta"),function(e){var t,n=e.attr("name"),l=e.attr("http-equiv");n?a[n.toLowerCase()]=e.attr("content"):"Content-Type"===l&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")))&&(a.docencoding=t[1])}),(n=r.getAll("html")[0])&&(a.langcode=s(n,"lang")||s(n,"xml:lang")),a.stylesheets=[],p.each(r.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&a.stylesheets.push(e.attr("href"))}),(n=r.getAll("body")[0])&&(a.langdir=s(n,"dir"),a.style=s(n,"style"),a.visited_color=s(n,"vlink"),a.link_color=s(n,"link"),a.active_color=s(n,"alink")),a);function s(e,t){return e.attr(t)||""}var d=u(u({},{title:"",keywords:"",description:"",robots:"",author:"",docencoding:""}),c);l.windowManager.open({title:"Metadata and Document Properties",size:"normal",body:{type:"panel",items:[{name:"title",type:"input",label:"Title"},{name:"keywords",type:"input",label:"Keywords"},{name:"description",type:"input",label:"Description"},{name:"robots",type:"input",label:"Robots"},{name:"author",type:"input",label:"Author"},{name:"docencoding",type:"input",label:"Encoding"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:d,onSubmit:function(e){var t=e.getData(),n=function(e,o,t){var r,n,l=e.dom;function i(e,t,n){e.attr(t,n||undefined)}function a(e){c.firstChild?c.insert(e,c.firstChild):c.append(e)}var c,s=v(t);(c=s.getAll("head")[0])||(r=s.getAll("html")[0],c=new m("head",1),r.firstChild?r.insert(c,r.firstChild,!0):r.append(c)),r=s.firstChild,o.xml_pi?(n='version="1.0"',o.docencoding&&(n+=' encoding="'+o.docencoding+'"'),7!==r.type&&(r=new m("xml",7),s.insert(r,s.firstChild,!0)),r.value=n):r&&7===r.type&&r.remove(),r=s.getAll("#doctype")[0],o.doctype?(r||(r=new m("#doctype",10),o.xml_pi?s.insert(r,s.firstChild):a(r)),r.value=o.doctype.substring(9,o.doctype.length-1)):r&&r.remove(),r=null,p.each(s.getAll("meta"),function(e){"Content-Type"===e.attr("http-equiv")&&(r=e)}),o.docencoding?(r||((r=new m("meta",1)).attr("http-equiv","Content-Type"),r.shortEnded=!0,a(r)),r.attr("content","text/html; charset="+o.docencoding)):r&&r.remove(),r=s.getAll("title")[0],o.title?(r?r.empty():a(r=new m("title",1)),r.append(new m("#text",3)).value=o.title):r&&r.remove(),p.each("keywords,description,author,copyright,robots".split(","),function(e){for(var t,n=s.getAll("meta"),l=o[e],i=0;i<n.length;i++)if((t=n[i]).attr("name")===e)return void(l?t.attr("content",l):t.remove());l&&((r=new m("meta",1)).attr("name",e),r.attr("content",l),r.shortEnded=!0,a(r))});var d={};p.each(s.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&(d[e.attr("href")]=e)}),p.each(o.stylesheets,function(e){d[e]||((r=new m("link",1)).attr({rel:"stylesheet",text:"text/css",href:e}),r.shortEnded=!0,a(r)),delete d[e]}),p.each(d,function(e){e.remove()}),(r=s.getAll("body")[0])&&(i(r,"dir",o.langdir),i(r,"style",o.style),i(r,"vlink",o.visited_color),i(r,"link",o.link_color),i(r,"alink",o.active_color),l.setAttribs(e.getBody(),{style:o.style,dir:o.dir,vLink:o.visited_color,link:o.link_color,aLink:o.active_color})),(r=s.getAll("html")[0])&&(i(r,"lang",o.langcode),i(r,"xml:lang",o.langcode)),c.firstChild||c.remove();var u=f({validate:!1,indent:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(s);return u.substring(0,u.indexOf("</body>"))}(l,p.extend(c,t),i.get());i.set(n),e.close()}})},_=p.each,b=function(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})},x=function(e,t,n,l){var i,o,r,a,c,s,d,u,m,f="",g=e.dom;l.selection||(a=e.getParam("protect"),c=l.content,p.each(a,function(e){c=c.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})}),r=c,"raw"===l.format&&t.get()||l.source_view&&h(e)||(0!==r.length||l.source_view||(r=p.trim(t.get())+"\n"+p.trim(r)+"\n"+p.trim(n.get())),-1!==(i=(r=r.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("<body"))?(i=r.indexOf(">",i),t.set(b(r.substring(0,i+1))),-1===(o=r.indexOf("</body",i))&&(o=r.length),l.content=p.trim(r.substring(i+1,o)),n.set(b(r.substring(o)))):(t.set(k(e)),n.set("\n</body>\n</html>")),s=v(t.get()),_(s.getAll("style"),function(e){e.firstChild&&(f+=e.firstChild.value)}),(d=s.getAll("body")[0])&&g.setAttribs(e.getBody(),{style:d.attr("style")||"",dir:d.attr("dir")||"",vLink:d.attr("vlink")||"",link:d.attr("link")||"",aLink:d.attr("alink")||""}),g.remove("fullpage_styles"),u=e.getDoc().getElementsByTagName("head")[0],f&&g.add(u,"style",{id:"fullpage_styles"}).appendChild(document.createTextNode(f)),m={},p.each(u.getElementsByTagName("link"),function(e){"stylesheet"===e.rel&&e.getAttribute("data-mce-fullpage")&&(m[e.href]=e)}),p.each(s.getAll("link"),function(e){var t=e.attr("href");if(!t)return!0;m[t]||"stylesheet"!==e.attr("rel")||g.add(u,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete m[t]}),p.each(m,function(e){e.parentNode.removeChild(e)})))},k=function(e){var t,n="",l="";return e.getParam("fullpage_default_xml_pi")&&(n+='<?xml version="1.0" encoding="'+(i(e)||"ISO-8859-1")+'" ?>\n'),n+=e.getParam("fullpage_default_doctype","<!DOCTYPE html>"),n+="\n<html>\n<head>\n",(t=e.getParam("fullpage_default_title"))&&(n+="<title>"+t+"</title>\n"),(t=i(e))&&(n+='<meta http-equiv="Content-Type" content="text/html; charset='+t+'" />\n'),(t=g(e))&&(l+="font-family: "+t+";"),(t=y(e))&&(l+="font-size: "+t+";"),(t=e.getParam("fullpage_default_text_color"))&&(l+="color: "+t+";"),n+="</head>\n<body"+(l?' style="'+l+'"':"")+">\n"},C=function(e,t,n,l){"html"!==l.format||l.selection||l.source_view&&h(e)||(l.content=(p.trim(t)+"\n"+p.trim(l.content)+"\n"+p.trim(n)).replace(/<!--mce:protected ([\s\S]*?)-->/g,function(e,t){return unescape(t)}))};e.add("fullpage",function(e){var t,n,l,i,o,r,a=s(""),c=s("");n=a,(t=e).addCommand("mceFullPageProperties",function(){d(t,n)}),(l=e).ui.registry.addButton("fullpage",{tooltip:"Metadata and document properties",icon:"document-properties",onAction:function(){l.execCommand("mceFullPageProperties")}}),l.ui.registry.addMenuItem("fullpage",{text:"Metadata and document properties",icon:"document-properties",onAction:function(){l.execCommand("mceFullPageProperties")}}),o=a,r=c,(i=e).on("BeforeSetContent",function(e){x(i,o,r,e)}),i.on("GetContent",function(e){C(i,o.get(),r.get(),e)})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
此文件的差异被折叠,
点击展开。
static/tinymce/plugins/help/plugin.min.js
0 → 100644
此文件的差异被折叠,
点击展开。
static/tinymce/plugins/hr/plugin.min.js
0 → 100644
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");n.add("hr",function(n){var o,t;(o=n).addCommand("InsertHorizontalRule",function(){o.execCommand("mceInsertContent",!1,"<hr />")}),(t=n).ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
static/tinymce/plugins/image/plugin.min.js
0 → 100644
此文件的差异被折叠,
点击展开。
此文件的差异被折叠,
点击展开。
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var n,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),m=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(t){return t.getParam("importcss_selector_converter")},o=(n="array",function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}),i=Array.prototype.push,l=function(t,e){return function(t){for(var e=[],r=0,n=t.length;r<n;++r){if(!o(t[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+t);i.apply(e,t[r])}return e}(function(t,e){for(var r=t.length,n=new Array(r),o=0;o<r;o++){var i=t[o];n[o]=e(i,o)}return n}(t,e))},p=function(e){return"string"==typeof e?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e},_=function(s,t,a){var u=[],r={};function l(t,e){var r,n,o,i=t.href;if(n=i,o=m.cacheSuffix,"string"==typeof n&&(n=n.replace("?"+o,"").replace("&"+o,"")),(i=n)&&a(i,e)&&!function(t,e){var r,n=!1!==(r=t.getParam("skin"))&&(r||"oxide");if(n){var o=t.getParam("skin_url"),i=o?t.documentBaseURI.toAbsolute(o):f.baseURL+"/skins/ui/"+n,c=f.baseURL+"/skins/content/";return e===i+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(c)}return!1}(s,i)){h.each(t.imports,function(t){l(t,!0)});try{r=t.cssRules||t.rules}catch(c){}h.each(r,function(t){t.styleSheet?l(t.styleSheet,!0):t.selectorText&&h.each(t.selectorText.split(","),function(t){u.push(h.trim(t))})})}}h.each(s.contentCSS,function(t){r[t]=!0}),a=a||function(t,e){return e||r[t]};try{h.each(t.styleSheets,function(t){l(t)})}catch(e){}return u},x=function(t,e){var r,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var o=n[1],i=n[2].substr(1).split(".").join(" "),c=h.makeMap("a,img");return n[1]?(r={title:e},t.schema.getTextBlockElements()[o]?r.block=o:t.schema.getBlockElements()[o]||c[o.toLowerCase()]?r.selector=o:r.inline=o):n[2]&&(r={inline:"span",title:e.substr(1),classes:i}),!1!==t.getParam("importcss_merge_classes")?r.classes=i:r.attributes={"class":i},r}},P=function(t,e){return null===e||!1!==t.getParam("importcss_exclusive")},r=function(y){y.on("init",function(t){var e,r,n,o,i=(e=[],r=[],n={},{addItemToGroup:function(t,e){n[t]?n[t].push(e):(r.push(t),n[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return l(r,function(t){var e=n[t];return 0===e.length?[]:[{title:t,items:e}]}).concat(e)}}),g={},c=p(y.getParam("importcss_selector_filter")),s=(o=y.getParam("importcss_groups"),h.map(o,function(t){return h.extend({},t,{original:t,selectors:{},filter:p(t.filter),item:{text:t.title,menu:[]}})})),a=function(t,e){if(f=t,p=g,!(P(y,m=e)?f in p:f in m.selectors)){a=t,l=g,P(y,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(i=(o=y).plugins.importcss,c=t,((s=e)&&s.selector_converter?s.selector_converter:d(o)?d(o):function(){return x(o,c)}).call(i,c,s));if(r){var n=r.name||v.DOM.uniqueId();return y.formatter.register(n,r),h.extend({},{title:r.title,format:n})}}var o,i,c,s,a,u,l,f,m,p;return null};h.each(_(y,y.getDoc(),p(y.getParam("importcss_file_filter"))),function(r){var t,e,n,o;-1===r.indexOf(".mce-")&&(c&&!c(r)||(n=s,o=r,0<(t=h.grep(n,function(t){return!t.filter||t.filter(o)})).length?h.each(t,function(t){var e=a(r,t);e&&i.addItemToGroup(t.title,e)}):(e=a(r,null))&&i.addItem(e)))});var u=i.toFormats();y.fire("addStyleModifications",{items:u,replace:!y.getParam("importcss_append")})})};t.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return x(e,t)}};var e})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},c=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),i="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),o="January February March April May June July August September October November December".split(" "),m=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},s=function(e,t,n){return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",m(n.getMonth()+1,2))).replace("%d",m(n.getDate(),2))).replace("%H",""+m(n.getHours(),2))).replace("%M",""+m(n.getMinutes(),2))).replace("%S",""+m(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(o[n.getMonth()]))).replace("%b",""+e.translate(i[n.getMonth()]))).replace("%A",""+e.translate(a[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},l=function(e,t){var n,r,a,i,o,u,c,m;e.getParam("insertdatetime_element",!1)?(n=s(e,t),r=void 0,r=/%[HMSIp]/.test(t)?s(e,"%Y-%m-%dT%H:%M"):s(e,"%Y-%m-%d"),(a=e.dom.getParent(e.selection.getStart(),"time"))?(o=a,u=r,c=n,m=(i=e).dom.create("time",{datetime:u},c),o.parentNode.insertBefore(m,o),i.dom.remove(o),i.selection.select(m,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")):e.insertContent(s(e,t))},t=function(t){t.addCommand("mceInsertDate",function(){var e;l(t,(e=t).getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),t.addCommand("mceInsertTime",function(){l(t,u(t))})},d=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(n){var e,t,r,a,i=c(n),o=(a=c(r=n),e=0<a.length?a[0]:u(r),t=e,{get:function(){return t},set:function(e){t=e}});n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===o.get()},fetch:function(e){e(d.map(i,function(e){return{type:"choiceitem",text:s(n,e),value:e}}))},onAction:function(e){l(n,o.get())},onItemAction:function(e,t){o.set(t),l(n,t)}});n.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return d.map(i,function(e){return{type:"menuitem",text:s(n,e),onAction:(t=e,function(){o.set(t),l(n,t)})};var t})}})};e.add("insertdatetime",function(e){t(e),n(e)})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(s){var e,t,i,a;t=!1,(e=s).settings.inline_styles=t,e.getParam("fontsize_formats")||(i="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",e.settings.fontsize_formats=i),e.getParam("font_formats")||(a="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e.settings.font_formats=a),s.on("PreInit",function(){return e=s,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),a=e.schema,e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all",preserve_attributes:["class","style"]},{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all",preserve_attributes:["class","style"]},{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(l.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){a.addValidElements(e+"[*]")}),a.getElementRule("font")||a.addValidElements("font[face|size|color|style]"),void l.each(t.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))});var e,t,i,a})};e.add("legacyoutput",function(e){t(e)})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
static/tinymce/plugins/link/plugin.min.js
0 → 100644
此文件的差异被折叠,
点击展开。
static/tinymce/plugins/lists/plugin.min.js
0 → 100644
此文件的差异被折叠,
点击展开。
static/tinymce/plugins/media/plugin.min.js
0 → 100644
此文件的差异被折叠,
点击展开。
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n,e){for(var a="",o=0;o<e;o++)a+=n;return a},r=function(n,e){var a,o=n.getParam("nonbreaking_wrap",!0,"boolean")||n.plugins.visualchars?'<span class="'+((a=n).plugins.visualchars&&a.plugins.visualchars.isEnabled()?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+i(" ",e)+"</span>":i(" ",e);n.undoManager.transact(function(){return n.insertContent(o)})},c=tinymce.util.Tools.resolve("tinymce.util.VK");n.add("nonbreaking",function(n){var e,a,o,i,t;(e=n).addCommand("mceNonBreaking",function(){r(e,1)}),(a=n).ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:function(){return a.execCommand("mceNonBreaking")}}),a.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:function(){return a.execCommand("mceNonBreaking")}}),0<(t="boolean"==typeof(i=(o=n).getParam("nonbreaking_force_tab",0))?!0===i?3:0:i)&&o.on("keydown",function(n){if(n.keyCode===c.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),r(o,t)}})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},f=function(e){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(e)}},e=function(e){var t,r="contenteditable",n=" "+l.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",a=" "+l.trim(u(e))+" ",i=f(n),o=f(a),c=(t=e.getParam("noneditable_regexp",[]))&&t.constructor===RegExp?[t]:t;e.on("PreInit",function(){0<c.length&&e.on("BeforeSetContent",function(t){!function(t,e,n){var r=e.length,a=n.content;if("raw"!==n.format){for(;r--;)a=a.replace(e[r],function(i,o,c){return function(t){var e=arguments,n=e[e.length-2],r=0<n?o.charAt(n-1):"";if('"'===r)return t;if(">"===r){var a=o.lastIndexOf("<",n);if(-1!==a)if(-1!==o.substring(a,n).indexOf('contenteditable="false"'))return t}return'<span class="'+c+'" data-mce-content="'+i.dom.encode(e[0])+'">'+i.dom.encode("string"==typeof e[1]?e[1]:e[0])+"</span>"}}(t,a,u(t)));n.content=a}}(e,c,t)}),e.parser.addAttributeFilter("class",function(t){for(var e,n=t.length;n--;)e=t[n],i(e)?e.attr(r,"true"):o(e)&&e.attr(r,"false")}),e.serializer.addAttributeFilter(r,function(t){for(var e,n=t.length;n--;)e=t[n],(i(e)||o(e))&&(0<c.length&&e.attr("data-mce-content")?(e.name="#text",e.type=3,e.raw=!0,e.value=e.attr("data-mce-content")):e.attr(r,null))})})};t.add("noneditable",function(t){e(t)})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),i=function(e){return e.getParam("pagebreak_split_block",!1)},g=function(){return"mce-pagebreak"},m=function(){return'<img src="'+a.transparentSrc+'" class="'+g()+'" data-mce-resize="false" data-mce-placeholder />'};e.add("pagebreak",function(e){var a,n,o,c,t,r;(a=e).addCommand("mcePageBreak",function(){i(a)?a.insertContent("<p>"+m()+"</p>"):a.insertContent(m())}),(n=e).ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return n.execCommand("mcePageBreak")}}),n.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return n.execCommand("mcePageBreak")}}),c=(o=e).getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e"),t=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),o.on("BeforeSetContent",function(e){e.content=e.content.replace(t,m())}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var a,n,t=e.length;t--;)if((n=(a=e[t]).attr("class"))&&-1!==n.indexOf("mce-pagebreak")){var r=a.parent;if(o.schema.getBlockElements()[r.name]&&i(o)){r.type=3,r.value=c,r.raw=!0,a.remove();continue}a.type=3,a.value=c,a.raw=!0}})}),(r=e).on("ResolveName",function(e){"IMG"===e.target.nodeName&&r.dom.hasClass(e.target,g())&&(e.name="pagebreak")})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
static/tinymce/plugins/paste/plugin.min.js
0 → 100644
此文件的差异被折叠,
点击展开。
static/tinymce/plugins/preview/plugin.min.js
0 → 100644
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.Env"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(e){var t=function(t){var n="",i=t.dom.encode,e=t.getParam("content_style","","string");n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>");var o=t.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"";w.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'"'+o+">"});var r,a,c,s,d,m,l,y=-1===(s=(r=t).getParam("body_id","tinymce","string")).indexOf("=")?s:(c=(a=r).getParam("body_id","","hash"))[a.id]||c,u=-1===(l=(d=t).getParam("body_class","","string")).indexOf("=")?l:(m=d).getParam("body_class","","hash")[m.id]||"",v='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(f.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",g=t.getBody().dir,p=g?' dir="'+i(g)+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(y)+'" class="mce-content-body '+i(u)+'"'+p+">"+t.getContent()+v+"</body></html>"}(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}}).focus("close")};e.add("preview",function(e){var t,n;(t=e).addCommand("mcePreview",function(){i(t)}),(n=e).ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:function(){return n.execCommand("mcePreview")}}),n.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:function(){return n.execCommand("mcePreview")}})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
static/tinymce/plugins/print/plugin.min.js
0 → 100644
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env");n.add("print",function(n){var t,i;(t=n).addCommand("mcePrint",function(){e.browser.isIE()?t.getDoc().execCommand("print",!1,null):t.getWin().print()}),(i=n).ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:function(){return i.execCommand("mcePrint")}}),i.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:function(){return i.execCommand("mcePrint")}}),n.addShortcut("Meta+P","","mcePrint")})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e,t,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=0,a=function(e,t,n){var r,o,i=e.editorUpload.blobCache,u=i.create((r="mceu",o=(new Date).getTime(),r+"_"+Math.floor(1e9*Math.random())+ ++c+String(o)),n,t);i.add(u),e.insertContent(e.dom.createHTML("img",{src:u.blobUri()}))},l=tinymce.util.Tools.resolve("tinymce.util.Promise"),s=tinymce.util.Tools.resolve("tinymce.Env"),f=tinymce.util.Tools.resolve("tinymce.util.Delay"),i=function(u){u.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:function(){var i;i=u,new l(function(n){var r=document.createElement("input");r.type="file",r.accept="image/*",r.style.position="fixed",r.style.left="0",r.style.top="0",r.style.opacity="0.001",document.body.appendChild(r),r.addEventListener("change",function(e){n(Array.prototype.slice.call(e.target.files))});var o=function(e){var t=function(){n([]),r.parentNode.removeChild(r)};s.os.isAndroid()&&"remove"!==e.type?f.setEditorTimeout(i,t,0):t(),i.off("focusin remove",o)};i.on("focusin remove",o),r.click()}).then(function(e){var t,n;0<e.length&&(t=e[0],n=t,new l(function(e){var t=new FileReader;t.onloadend=function(){e(t.result.split(",")[1])},t.readAsDataURL(n)}).then(function(e){a(u,e,t)}))})}}),u.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:function(){var e,t,n,r,o,i;n=t=2,(e=u).plugins.table?e.plugins.table.insertTable(t,n):(o=t,i=n,(r=e).undoManager.transact(function(){r.insertContent(function(e,t){var n,r,o='<table data-mce-id="mce" style="width: 100%">';for(o+="<tbody>",r=0;r<t;r++){for(o+="<tr>",n=0;n<e;n++)o+="<td><br></td>";o+="</tr>"}return o+="</tbody>",o+="</table>"}(o,i));var e=r.dom.select("*[data-mce-id]")[0];e.removeAttribute("data-mce-id");var t=r.dom.select("td,th",e);r.selection.setCursorLocation(t[0],0)}))}})},u=function(e){return function(){return e}},d=u(!1),m=u(!0),g=function(){return h},h=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:d,isSome:d,isNone:m,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:n,orThunk:t,map:g,each:function(){},bind:g,exists:d,forall:m,filter:g,equals:e,equals_:e,toArray:function(){return[]},toString:u("none()")}),p=function(n){var e=u(n),t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return p(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?o:h},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(d,function(e){return t(n,e)})}};return o},b={some:p,none:g,from:function(e){return null===e||e===undefined?h:p(e)}},y=function(r){return function(e){return n=typeof(t=e),(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n)===r;var t,n}},v=function(t){return function(e){return typeof e===t}},k=y("string"),w=y("object"),T=y("array"),N=v("boolean"),q=(r=undefined,function(e){return r===e}),E=v("function");function M(e,t,n,r,o){return e(n,r)?b.some(n):E(o)&&o(n)?b.none():t(n,r,o)}var S,C=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:e}},O={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return C(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return C(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return C(n)},fromDom:C,fromPoint:function(e,t,n){return b.from(e.dom.elementFromPoint(t,n)).map(C)}},x=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(r.matches!==undefined)return r.matches(t);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(t);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(t);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},A=("undefined"!=typeof window||Function("return this;")(),function(e,t,n){for(var r=e.dom,o=E(n)?n:d;r.parentNode;){r=r.parentNode;var i=O.fromDom(r);if(t(i))return b.some(i);if(o(i))break}return b.none()}),D=function(e,t,n){return A(e,function(e){return x(e,t)},n)},_=(S=k,function(e,t,n){return function(e,t){if(!t(e))throw new Error("Default value doesn't match requested type.")}(n,S),function(e,t){if(T(e)||w(e))throw new Error("expected a string but found: "+e);return q(e)?t:N(e)?!1===e?"":t:e}(e.getParam(t,n),n)}),L=function(o){var e=_(o,"quickbars_insert_toolbar","quickimage quicktable");0<e.trim().length&&o.ui.registry.addContextToolbar("quickblock",{predicate:function(e){var t=O.fromDom(e),n=o.schema.getTextBlockElements(),r=function(e){return e.dom===o.getBody()};return M(x,D,t,"table",r).fold(function(){return M(function(e,t){return t(e)},A,t,function(e){return e.dom.nodeName.toLowerCase()in n&&o.dom.isEmpty(e.dom)},r).isSome()},function(){return!1})},items:e,position:"line",scope:"editor"})},P=function(n){var r=function(e){return"IMG"===e.nodeName||"FIGURE"===e.nodeName&&/image/i.test(e.className)},e=_(n,"quickbars_image_toolbar","alignleft aligncenter alignright");0<e.trim().length&&n.ui.registry.addContextToolbar("imageselection",{predicate:r,items:e,position:"node"});var t=_(n,"quickbars_selection_toolbar","bold italic | quicklink h2 h3 blockquote");0<t.trim().length&&n.ui.registry.addContextToolbar("textselection",{predicate:function(e){return!r(e)&&!n.selection.isCollapsed()&&(t=e,"false"!==n.dom.getContentEditableParent(t));var t},items:t,position:"selection",scope:"editor"})};o.add("quickbars",function(e){i(e),L(e),P(e)})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
static/tinymce/plugins/save/plugin.min.js
0 → 100644
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(e){return e.getParam("save_enablewhendirty",!0)},c=function(e,n){e.notificationManager.open({text:n,type:"error"})},t=function(t){t.addCommand("mceSave",function(){!function(e){var n=o.DOM.getParent(e.id,"form");if(!i(e)||e.isDirty()){if(e.save(),e.getParam("save_onsavecallback"))return e.execCallback("save_onsavecallback",e),e.nodeChanged();n?(e.setDirty(!1),n.onsubmit&&!n.onsubmit()||("function"==typeof n.submit?n.submit():c(e,"Error: Form submit field collision.")),e.nodeChanged()):c(e,"Error: No form element found.")}}(t)}),t.addCommand("mceCancel",function(){var e,n;e=t,n=a.trim(e.startContent),e.getParam("save_oncancelcallback")?e.execCallback("save_oncancelcallback",e):e.resetContent(n)})},r=function(t){return function(e){var n=function(){e.setDisabled(i(t)&&!t.isDirty())};return t.on("NodeChange dirty",n),function(){return t.off("NodeChange dirty",n)}}};e.add("save",function(e){var n;(n=e).ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:r(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:r(n)}),n.addShortcut("Meta+S","","mceSave"),t(e)})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
此文件的差异被折叠,
点击展开。
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var N=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=Object.hasOwnProperty,g=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.URI"),f=tinymce.util.Tools.resolve("tinymce.util.XHR"),h=function(e){return e.getParam("spellchecker_rpc_url")},k=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)};function p(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var r=function(i,r){var n,a=[],v=r.dom,f=r.schema.getBlockElements(),h=r.schema.getWhiteSpaceElements(),g=r.schema.getShortEndedElements();function o(e){var t=i.getElementsByTagName("*"),n=[];e="number"==typeof e?""+e:null;for(var r=0;r<t.length;r++){var o=t[r],a=o.getAttribute("data-mce-index");null!==a&&a.length&&-1!==o.className.indexOf("mce-spellchecker-word")&&(a!==e&&null!==e||n.push(o))}return n}function c(e){for(var t=a.length;t--;)if(a[t]===e)return t;return-1}function e(e){for(var t=0,n=a.length;t<n&&!1!==e(a[t],t);t++);return this}function t(e){for(var t=o(e?c(e):null),n=t.length;n--;)!function(e){for(var t=e.parentNode;0<e.childNodes.length;)t.insertBefore(e.childNodes[0],e);t.removeChild(e)}(t[n]);return this}function s(e){var t=o(c(e)),n=r.dom.createRng();return n.setStartBefore(t[0]),n.setEndAfter(t[t.length-1]),n}var l=function u(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!f[e.nodeName])return"";if(p(e))return"\n";if(t="",(f[e.nodeName]||g[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=u(e),e=e.nextSibling;);return t}(i);return{text:l,matches:a,each:e,filter:function(n){var r=[];return e(function(e,t){n(e,t)&&r.push(e)}),a=r,this},reset:function(){return a.splice(0,a.length),t(),this},matchFromElement:function(e){return a[e.getAttribute("data-mce-index")]},elementFromMatch:function(e){return o(c(e))[0]},find:function(e,t){if(l&&e.global)for(;n=e.exec(l);)a.push(function(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}(n,t));return this},add:function(e,t,n){return a.push({start:e,end:e+t,text:l.substr(e,t),data:n}),this},wrap:function(e){function m(e,t){var n=a[t];n.stencil||(n.stencil=o(n));var r=n.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(v.doc.createTextNode(e)),r}var o;return a.length&&function(e,t,n){var r,o,a,i,c,s=[],l=0,u=e,d=0;(t=t.slice(0)).sort(function(e,t){return e.start-t.start}),c=t.shift();e:for(;;){if((f[u.nodeName]||g[u.nodeName]||p(u))&&l++,3===u.nodeType&&(!o&&u.length+l>=c.end?(o=u,i=c.end-l):r&&s.push(u),!r&&u.length+l>c.start&&(r=u,a=c.start-l),l+=u.length),r&&o){if(u=n({startNode:r,startNodeIndex:a,endNode:o,endNodeIndex:i,innerNodes:s,match:c.text,matchIndex:d}),l-=o.length-i,o=r=null,s=[],d++,!(c=t.shift()))break}else if(h[u.nodeName]&&!f[u.nodeName]||!u.firstChild){if(u.nextSibling){u=u.nextSibling;continue}}else if(!p(u)){u=u.firstChild;continue}for(;;){if(u.nextSibling){u=u.nextSibling;break}if(u.parentNode===e)break e;u=u.parentNode}}}(i,a,(o=e,function(e){var t,n,r=e.startNode,o=e.endNode,a=e.matchIndex,i=v.doc;if(r===o){var c=r,s=c.parentNode;0<e.startNodeIndex&&(t=i.createTextNode(c.data.substring(0,e.startNodeIndex)),s.insertBefore(t,c));var l=m(e.match,a);return s.insertBefore(l,c),e.endNodeIndex<c.length&&(n=i.createTextNode(c.data.substring(e.endNodeIndex)),s.insertBefore(n,c)),c.parentNode.removeChild(c),l}t=i.createTextNode(r.data.substring(0,e.startNodeIndex)),n=i.createTextNode(o.data.substring(e.endNodeIndex));for(var u=m(r.data.substring(e.startNodeIndex),a),d=0,f=e.innerNodes.length;d<f;++d){var h=e.innerNodes[d],g=m(h.data,a);h.parentNode.replaceChild(g,h)}var p=m(o.data.substring(0,e.endNodeIndex),a);return(s=r.parentNode).insertBefore(t,r),s.insertBefore(u,r),s.removeChild(r),(s=o.parentNode).insertBefore(p,o),s.insertBefore(n,o),s.removeChild(o),p})),this},unwrap:t,replace:function(e,t){var n=s(e);return n.deleteContents(),0<t.length&&n.insertNode(r.dom.doc.createTextNode(t)),n},rangeFromMatch:s,indexOf:c}},u=function(e,t){var n;return t.get()||(n=r(e.getBody(),e),t.set(n)),t.get()},m=function(e,t,n,r,o,a,i){var c,s,l,u=e.getParam("spellchecker_callback");(u||(c=e,s=t,l=n,function(e,t,r,o){var n={method:e,lang:l.get()},a="";n["addToDictionary"===e?"word":"text"]=t,g.each(n,function(e,t){a&&(a+="&"),a+=t+"="+encodeURIComponent(e)}),f.send({url:new d(s).toAbsolute(h(c)),type:"post",content_type:"application/x-www-form-urlencoded",data:a,success:function(e){var t,n=JSON.parse(e);n?n.error?o(n.error):r(n):(t=c.translate("Server response wasn't proper JSON."),o(t))},error:function(){var e=c.translate("The spelling service was not found: (")+h(c)+c.translate(")");o(e)}})})).call(e.plugins.spellchecker,r,o,a,i)},y=function(t,e,n,r,o,a){i(t,n,r)||(t.setProgressState(!0),m(t,e,a,"spellcheck",u(t,r).text,function(e){S(t,n,r,o,e)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1),i(t,n,r)}),t.focus())},v=function(e,t,n){e.dom.select("span.mce-spellchecker-word").length||i(e,t,n)},o=function(t,e,n,r,o,a){t.selection.collapse(),a?g.each(t.dom.select("span.mce-spellchecker-word"),function(e){e.getAttribute("data-mce-word")===r&&t.dom.remove(e,!0)}):t.dom.remove(o,!0),v(t,e,n)},i=function(e,t,n){var r=e.selection.getBookmark();if(u(e,n).reset(),e.selection.moveToBookmark(r),n.set(null),t.get())return t.set(!1),e.fire("SpellcheckEnd"),!0},x=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},S=function(t,e,n,r,o){var a=!!o.dictionary,i=o.words;if(t.setProgressState(!1),function(e){for(var t in e)if(l.call(e,t))return!1;return!0}(i)){var c=t.translate("No misspellings found.");return t.notificationManager.open({text:c,type:"info"}),void e.set(!1)}r.set({suggestions:i,hasDictionarySupport:a});var s=t.selection.getBookmark();u(t,n).find(k(t)).filter(function(e){return!!i[e.text]}).wrap(function(e){return t.dom.create("span",{"class":"mce-spellchecker-word","aria-invalid":"spelling","data-mce-bogus":1,"data-mce-word":e.text})}),t.selection.moveToBookmark(s),e.set(!0),t.fire("SpellcheckStart")},b=function(){return(b=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},w="SpellcheckStart SpellcheckEnd",T=function(n,e,r,t,o,a){var i,c,s,l=(s=n,i=g.map(s.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv").split(","),function(e){var t=e.split("=");return{name:t[0],value:t[1]}}),c=[],g.each(i,function(e){c.push({selectable:!0,text:e.name,data:e.value})}),c),u=function(){y(n,e,r,t,a,o)},d={tooltip:"Spellcheck",onAction:u,icon:"spell-check",onSetup:function(e){var t=function(){e.setActive(r.get())};return n.on(w,t),function(){n.off(w,t)}}},f=b(b({},d),{type:"splitbutton",select:function(e){return e===o.get()},fetch:function(e){e(g.map(l,function(e){return{type:"choiceitem",value:e.data,text:e.text}}))},onItemAction:function(e,t){o.set(t)}});1<l.length?n.ui.registry.addSplitButton("spellchecker",f):n.ui.registry.addToggleButton("spellchecker",d),n.ui.registry.addToggleMenuItem("spellchecker",{text:"Spellcheck",icon:"spell-check",onSetup:function(e){e.setActive(r.get());var t=function(){e.setActive(r.get())};return n.on(w,t),function(){n.off(w,t)}},onAction:u})},A=function(c,s,e,l,u,d,f,h){var t=[],n=e.get().suggestions[f];return g.each(n,function(e){t.push({text:e,onAction:function(){c.insertContent(c.dom.encode(e)),c.dom.remove(h),v(c,l,u)}})}),e.get().hasDictionarySupport&&(t.push({type:"separator"}),t.push({text:"Add to dictionary",onAction:function(){var t,e,n,r,o,a,i;e=s,n=l,r=u,o=d,a=f,i=h,(t=c).setProgressState(!0),m(t,e,o,"addToDictionary",a,function(){t.setProgressState(!1),t.dom.remove(i,!0),v(t,n,r)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1)})}})),t.push.apply(t,[{type:"separator"},{text:"Ignore",onAction:function(){o(c,l,u,f,h)}},{text:"Ignore all",onAction:function(){o(c,l,u,f,h,!0)}}]),t},B=function(o,a,i,c,s,l){o.ui.registry.addContextMenu("spellchecker",{update:function(e){var t=e;if("mce-spellchecker-word"!==t.className)return[];var n=function(e,t){var n=[],r=g.toArray(e.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var a=x(r[o]);null!==a&&a.length&&a===t.toString()&&n.push(r[o])}return n}(o,x(t));if(0<n.length){var r=o.dom.createRng();return r.setStartBefore(n[0]),r.setEndAfter(n[n.length-1]),o.selection.setRng(r),A(o,a,i,c,s,l,t.getAttribute("data-mce-word"),n)}}})};e.add("spellchecker",function(e,t){if(!1==(!!e.hasPlugin("tinymcespellchecker",!0)&&("undefined"!=typeof window.console&&window.console.log&&window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),!0))){var n=N(!1),r=N((x=(v=e).getParam("language","en"),v.getParam("spellchecker_language",x))),o=N(null),a=N(null);return T(e,t,n,o,r,a),B(e,t,a,n,o,r),f=t,h=n,g=o,p=a,m=r,(d=e).addCommand("mceSpellCheck",function(){y(d,f,h,g,p,m)}),i=e,c=n,s=a,l=o,u=r,{getTextMatcher:function(){return l.get()},getWordCharPattern:function(){return k(i)},markErrors:function(e){S(i,c,l,s,e)},getLanguage:function(){return u.get()}}}var i,c,s,l,u,d,f,h,g,p,m,v,x})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),m=t.DOM,n=function(e){e.keyCode!==f.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(s){function e(i){var o,l,e,t,n,u;function r(e){var t=m.select(":input:enabled,*[tabindex]:not(iframe)");function n(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&c.get(i.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(d.each(t,function(e,t){if(e.id===s.id)return o=t,!1}),0<e){for(l=o+1;l<t.length;l++)if(n(t[l]))return t[l]}else for(l=o-1;0<=l;l--)if(n(t[l]))return t[l];return null}i.keyCode!==f.TAB||i.ctrlKey||i.altKey||i.metaKey||i.isDefaultPrevented()||(1===(e=d.explode((t=s).getParam("tab_focus",t.getParam("tabfocus_elements",":prev,:next")))).length&&(e[1]=e[0],e[0]=":prev"),(n=i.shiftKey?":prev"===e[0]?r(-1):m.get(e[0]):":next"===e[1]?r(1):m.get(e[1]))&&(u=c.get(n.id||n.name),n.id&&u?u.focus():y.setTimeout(function(){a.webkit||window.focus(),n.focus()},10),i.preventDefault()))}s.on("init",function(){s.inline&&m.setAttrib(s.getBody(),"tabIndex",null),s.on("keyup",n),a.gecko?s.on("keypress keydown",e):s.on("keydown",e)})};e.add("tabfocus",function(e){i(e)})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
static/tinymce/plugins/table/plugin.min.js
0 → 100644
此文件的差异太大,无法显示。
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(){},o=function(e){return function(){return e}};var n,r,a,c=o(!1),u=o(!0),_=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=tinymce.util.Tools.resolve("tinymce.util.XHR"),i=function(e){return e.getParam("template_mdate_classes","mdate")},l=function(e){return e.getParam("template_replace_values")},f=function(e){return e.getParam("template_mdate_format",e.translate("%Y-%m-%d"))},m=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},p=function(e,t,n){var r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),c="January February March April May June July August September October November December".split(" ");return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",m(n.getMonth()+1,2))).replace("%d",m(n.getDate(),2))).replace("%H",""+m(n.getHours(),2))).replace("%M",""+m(n.getMinutes(),2))).replace("%S",""+m(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(c[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(a[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},d=function(t,n){return function(){var e=t.getParam("templates");"function"!=typeof e?"string"==typeof e?s.send({url:e,success:function(e){n(JSON.parse(e))}}):n(e):e(n)}},x=function(n,e){return _.each(e,function(e,t){"function"==typeof e&&(e=e(t)),n=n.replace(new RegExp("\\{\\$"+t+"\\}","g"),e)}),n},g=function(e,t){var r=e.dom,a=l(e);_.each(r.select("*",t),function(n){_.each(a,function(e,t){r.hasClass(n,t)&&"function"==typeof a[t]&&a[t](n)})})},v=function(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)},y=function(n,e,t){var r,a=n.dom,o=n.selection.getContent();t=x(t,l(n)),r=a.create("div",null,t);var c=a.select(".mceTmpl",r);c&&0<c.length&&(r=a.create("div",null)).appendChild(c[0].cloneNode(!0)),_.each(a.select("*",r),function(e){var t;v(e,n.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(e.innerHTML=p(n,(t=n).getParam("template_cdate_format",t.translate("%Y-%m-%d")))),v(e,i(n).replace(/\s+/g,"|"))&&(e.innerHTML=p(n,f(n))),v(e,n.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(e.innerHTML=o)}),g(n,r),n.execCommand("mceInsertContent",!1,r.innerHTML),n.addVisual()},h=function(e){e.addCommand("mceInsertTemplate",function(r){for(var a=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.concat(e);return r.apply(null,n)}}(y,e))},b=function(){return T},T=(n=function(e){return e.isNone()},{fold:function(e,t){return e()},is:c,isSome:c,isNone:u,getOr:a=function(e){return e},getOrThunk:r=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:a,orThunk:r,map:b,each:t,bind:b,exists:c,forall:u,filter:b,equals:n,equals_:n,toArray:function(){return[]},toString:o("none()")}),M=function(n){var e=o(n),t=function(){return a},r=function(e){return e(n)},a={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:u,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return M(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?a:T},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(c,function(e){return t(n,e)})}};return a},O={some:M,none:b,from:function(e){return null===e||e===undefined?T:M(e)}},P=function(e,t){return function(e,t,n){for(var r=0,a=e.length;r<a;r++){var o=e[r];if(t(o,r))return O.some(o);if(n(o,r))break}return O.none()}(e,t,c)},S=tinymce.util.Tools.resolve("tinymce.Env"),w=tinymce.util.Tools.resolve("tinymce.util.Promise"),D=Object.hasOwnProperty,A=function(e,t){return D.call(e,t)},C={'"':""","<":"<",">":">","&":"&","'":"'"},N=function(e){return e.replace(/["'<>&]/g,function(e){return(A(t=C,n=e)?O.from(t[n]):O.none()).getOr(e);var t,n})},I=function(M,t){var e=function(e){return function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var o=e[a];r[a]=t(o,a)}return r}(e,function(e){return{text:e.text,value:e.text}})},u=function(e,t){return P(e,function(e){return e.text===t})},i=function(e){M.windowManager.alert("Could not load the specified template.",function(){return e.focus("template")})},l=function(e){return new w(function(t,n){e.value.url.fold(function(){return t(e.value.content.getOr(""))},function(e){return s.send({url:e,success:function(e){t(e)},error:function(e){n(e)}})})})};(function(){if(t&&0!==t.length)return O.from(_.map(t,function(e,t){var n=function(e){return e.url!==undefined};return{selected:0===t,text:e.title,value:{url:n(e)?O.from(e.url):O.none(),content:n(e)?O.none():O.from(e.content),description:e.description}}}));var e=M.translate("No templates defined.");return M.notificationManager.open({text:e,type:"info"}),O.none()})().each(function(o){var b=e(o),T=function(e,t){return{title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:t,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(t){var e=t.getData();u(n,e.template).each(function(e){l(e).then(function(e){y(M,0,e),t.close()})["catch"](function(){t.disable("save"),i(t)})})},onChange:(r=n=o,a=c,function(n,e){var t;"template"===e.name&&(t=n.getData().template,u(r,t).each(function(t){n.block("Loading..."),l(t).then(function(e){a(n,t,e)})["catch"](function(){a(n,t,""),n.disable("save"),i(n)})}))})};var r,a,n},c=function(e,t,n){var r,a,o,c,u,i,l,s,f,m,p,d,g,v=(r=M,-1===(a=n).indexOf("<html>")&&(o="",(c=r.getParam("content_style","","string"))&&(o+='<style type="text/css">'+c+"</style>"),u=r.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"",_.each(r.contentCSS,function(e){o+='<link type="text/css" rel="stylesheet" href="'+r.documentBaseURI.toAbsolute(e)+'"'+u+">"}),i=-1===(g=(p=r).getParam("body_class","","string")).indexOf("=")?g:(d=p).getParam("body_class","","hash")[d.id]||"",l=r.dom.encode,s='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(S.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",m=(f=r.getBody().dir)?' dir="'+l(f)+'"':"",a='<!DOCTYPE html><html><head><base href="'+l(r.documentBaseURI.getURI())+'">'+o+s+'</head><body class="'+l(i)+'"'+m+">"+a+"</body></html>"),x(a,r.getParam("template_preview_replace_values"))),y=[{type:"selectbox",name:"template",label:"Templates",items:b},{type:"htmlpanel",html:'<p aria-live="polite">'+N(t.value.description)+"</p>"},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],h={template:t.text,preview:v};e.unblock(),e.redial(T(y,h)),e.focus("template")},t=M.windowManager.open(T([],{template:"",preview:""}));t.block("Loading..."),l(o[0]).then(function(e){c(t,o[0],e)})["catch"](function(){c(t,o[0],""),t.disable("save"),i(t)})})},k=function(t){return function(e){I(t,e)}};e.add("template",function(e){var t,r;(t=e).ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:d(t,k(t))}),t.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:d(t,k(t))}),h(e),(r=e).on("PreProcess",function(e){var t=r.dom,n=f(r);_.each(t.select("div",e.node),function(e){t.hasClass(e,"mceTmpl")&&(_.each(t.select("*",e),function(e){t.hasClass(e,i(r).replace(/\s+/g,"|"))&&(e.innerHTML=p(r,n))}),g(r,e))})})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",function(){console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
此文件的差异被折叠,
点击展开。
static/tinymce/plugins/toc/plugin.min.js
0 → 100644
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var e,n,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.util.I18n"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(t){return t.getParam("toc_class","mce-toc")},m=function(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"},a=(e="mcetoc_",n=0,function(){var t=(new Date).getTime().toString(32);return e+t+(n++).toString(32)}),v=function(n){var t,o=l(n),e=m(n),r=function(t){for(var e=[],n=1;n<=t;n++)e.push("h"+n);return e.join(",")}(1<=(t=parseInt(n.getParam("toc_depth","3"),10))&&t<=9?t:3),i=n.$(r);return i.length&&/^h[1-9]$/i.test(e)&&(i=i.filter(function(t,e){return!n.dom.hasClass(e.parentNode,o)})),c.map(i,function(t){var e=t.id;return{id:e||a(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})},u=function(t){var e,n,o,r,i,c,l,a="",u=v(t),d=function(t){for(var e=9,n=0;n<t.length;n++)if(t[n].level<e&&(e=t[n].level),1===e)return e;return e}(u)-1;if(!u.length)return"";for(a+=(i=m(t),c=f.translate("Table of Contents"),l="</"+i+">","<"+i+' contenteditable="true">'+s.DOM.encode(c)+l),e=0;e<u.length;e++){if((o=u[e]).element.id=o.id,r=u[e+1]&&u[e+1].level,d===o.level)a+="<li>";else for(n=d;n<o.level;n++)a+="<ul><li>";if(a+='<a href="#'+o.id+'">'+o.title+"</a>",r!==o.level&&r)for(n=o.level;r<n;n--)a+="</li></ul><li>";else a+="</li>",r||(a+="</ul>");d=o.level}return a},i=function(t){var e,n,o,r,i=l(t),c=t.$("."+i);o=t,!(r=c).length||0<o.dom.getParents(r[0],".mce-offscreen-selection").length?t.insertContent((n=u(e=t),'<div class="'+e.dom.encode(l(e))+'" contenteditable="false">'+n+"</div>")):d(t)},d=function(t){var e=l(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(u(t))})},o=function(n){return function(t){var e=function(){return t.setDisabled(n.mode.isReadOnly()||!(0<v(n).length))};return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}},g=function(t){var e;t.ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:o(t)}),t.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return t.execCommand("mceUpdateToc")}}),t.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:o(t)}),t.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:(e=t,function(t){return t&&e.dom.is(t,"."+l(e))&&e.getBody().contains(t)}),scope:"node",position:"node"})};t.add("toc",function(t){var e,n,o,r;(e=t).addCommand("mceInsertToc",function(){i(e)}),e.addCommand("mceUpdateToc",function(){d(e)}),g(t),o=(n=t).$,r=l(n),n.on("PreProcess",function(t){var e=o("."+r,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),n.on("SetContent",function(){var t=o("."+r);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t,o,e){var n,i;t.dom.toggleClass(t.getBody(),"mce-visualblocks"),e.set(!e.get()),n=t,i=e.get(),n.fire("VisualBlocks",{state:i})},f=function(e,n){return function(o){o.setActive(n.get());var t=function(t){return o.setActive(t.state)};return e.on("VisualBlocks",t),function(){return e.off("VisualBlocks",t)}}};t.add("visualblocks",function(t,o){var e,n,i,s,c,u,l,a=(e=!1,{get:function(){return e},set:function(t){e=t}});i=a,(n=t).addCommand("mceVisualBlocks",function(){r(n,0,i)}),c=a,(s=t).ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:function(){return s.execCommand("mceVisualBlocks")},onSetup:f(s,c)}),s.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:function(){return s.execCommand("mceVisualBlocks")},onSetup:f(s,c)}),l=a,(u=t).on("PreviewFormats AfterPreviewFormats",function(t){l.get()&&u.dom.toggleClass(u.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),u.on("init",function(){u.getParam("visualblocks_default_state",!1,"boolean")&&r(u,0,l)})})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + * | ||
| 7 | + * Version: 5.6.2 (2020-12-08) | ||
| 8 | + */ | ||
| 9 | +!function(){"use strict";var n,t,e,r,o,u,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(n){return function(){return n}},a=c(!1),s=c(!0),f=function(){return l},l=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:a,isSome:a,isNone:s,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(undefined),or:e,orThunk:t,map:f,each:function(){},bind:f,exists:a,forall:s,filter:f,equals:n,equals_:n,toArray:function(){return[]},toString:c("none()")}),d=function(e){var n=c(e),t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:s,isNone:a,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return d(n(e))},each:function(n){n(e)},bind:r,exists:r,forall:r,filter:function(n){return n(e)?o:l},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(a,function(n){return t(e,n)})}};return o},m=function(n){return null===n||n===undefined?l:d(n)},v=function(t){return function(n){return typeof n===t}},g=(r="string",function(n){return e=typeof(t=n),(null===t?"null":"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e)===r;var t,e}),h=v("boolean"),p=v("number"),y=function(n,t){for(var e=0,r=n.length;e<r;e++){t(n[e],e)}},b=Object.keys,w=function(n,t){for(var e=b(n),r=0,o=e.length;r<o;r++){var u=e[r];t(n[u],u)}},N=("undefined"!=typeof window||Function("return this;")(),function(n){return n.dom.nodeValue}),T=(o=3,function(n){return n.dom.nodeType===o}),k=function(n,t,e){!function(n,t,e){if(!(g(e)||h(e)||p(e)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",e,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(t,e+"")}(n.dom,t,e)},A=function(n,t){n.dom.removeAttribute(t)},O=function(n,t){var e,r,o=(e=t,null===(r=n.dom.getAttribute(e))?undefined:r);return o===undefined||""===o?[]:o.split(" ")},C=function(n){return n.dom.classList!==undefined},S=function(n,t){return o=t,u=O(e=n,r="class").concat([o]),k(e,r,u.join(" ")),!0;var e,r,o,u},D=function(n,t){return o=t,0<(u=function(n,t){for(var e=[],r=0,o=n.length;r<o;r++){var u=n[r];t(u,r)&&e.push(u)}return e}(O(e=n,r="class"),function(n){return n!==o})).length?k(e,r,u.join(" ")):A(e,r),!1;var e,r,o,u},E=function(n){0===(C(n)?n.dom.classList:O(n,"class")).length&&A(n,"class")},L=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:n}},x={fromHtml:function(n,t){var e=(t||document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return L(e.childNodes[0])},fromTag:function(n,t){var e=(t||document).createElement(n);return L(e)},fromText:function(n,t){var e=(t||document).createTextNode(n);return L(e)},fromDom:L,fromPoint:function(n,t,e){return m(n.dom.elementFromPoint(t,e)).map(L)}},V={"\xa0":"nbsp","\xad":"shy"},B=function(n,t){var e="";return w(n,function(n,t){e+=t}),new RegExp("["+e+"]",t?"g":"")},P=B(V),_=B(V,!0),j=(u="",w(V,function(n){u&&(u+=","),u+="span.mce-"+n}),u),M="mce-nbsp",q=function(n){return'<span data-mce-bogus="1" class="mce-'+V[n]+'">'+n+"</span>"},H=function(n){var t=N(n);return T(n)&&t!==undefined&&P.test(t)},F=function(n,t){var e=[],r=function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var u=n[o];r[o]=t(u,o)}return r}(n.dom.childNodes,x.fromDom);return y(r,function(n){t(n)&&(e=e.concat([n])),e=e.concat(F(n,t))}),e},I=function(n){return"span"===n.nodeName.toLowerCase()&&n.classList.contains("mce-nbsp-wrap")},U=function(c,n){var t=F(x.fromDom(n),H);y(t,function(n){var t,e,r=n.dom.parentNode;if(I(r))t=x.fromDom(r),e=M,C(t)?t.dom.classList.add(e):S(t,e);else{for(var o=c.dom.encode(N(n)).replace(_,q),u=c.dom.create("div",null,o),i=void 0;i=u.lastChild;)c.dom.insertAfter(i,n.dom);c.dom.remove(n.dom)}})},K=function(r,n){var t=r.dom.select(j,n);y(t,function(n){var t,e;I(n)?(t=x.fromDom(n),e=M,C(t)?t.dom.classList.remove(e):D(t,e),E(t)):r.dom.remove(n,!0)})},R=function(n){var t=n.getBody(),e=n.selection.getBookmark(),r=(r=function(n,t){for(;n.parentNode;){if(n.parentNode===t)return n;n=n.parentNode}}(n.selection.getNode(),t))!==undefined?r:t;K(n,r),U(n,r),n.selection.moveToBookmark(e)},z=function(n,t){var e,r;e=n,r=t.get(),e.fire("VisualChars",{state:r});var o=n.getBody();(!0===t.get()?U:K)(n,o)},G=function(n,t){n.addCommand("mceVisualChars",function(){!function(n,t){t.set(!t.get());var e=n.selection.getBookmark();z(n,t),n.selection.moveToBookmark(e)}(n,t)})},J=tinymce.util.Tools.resolve("tinymce.util.Delay"),Q=function(e,r){return function(t){t.setActive(r.get());var n=function(n){return t.setActive(n.state)};return e.on("VisualChars",n),function(){return e.off("VisualChars",n)}}};i.add("visualchars",function(n){var t,e,r,o,u,i,c,a,s,f,l=(t=n.getParam("visualchars_default_state",!1),e=t,{get:function(){return e},set:function(n){e=n}});return G(n,l),o=l,(r=n).ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:function(){return r.execCommand("mceVisualChars")},onSetup:Q(r,o)}),r.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:function(){return r.execCommand("mceVisualChars")},onSetup:Q(r,o)}),u=n,i=l,c=J.debounce(function(){R(u)},300),!1!==u.getParam("forced_root_block")&&u.on("keydown",function(n){!0===i.get()&&(13===n.keyCode?R(u):c())}),u.on("remove",c.stop),s=l,(a=n).on("init",function(){z(a,s)}),f=l,{isEnabled:function(){return f.get()}}})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
此文件的差异被折叠,
点击展开。
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + */ | ||
| 7 | +body{background-color:#2f3742;color:#dfe0e4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#6d737b}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem} |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + */ | ||
| 7 | +body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + */ | ||
| 7 | +@media screen{html{background:#f4f4f4;min-height:100%}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;margin:1rem auto 0;max-width:820px;min-height:calc(100vh - 1rem);padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} |
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + */ | ||
| 7 | +body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} |
此文件的差异被折叠,
点击展开。
此文件的差异被折叠,
点击展开。
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + */ | ||
| 7 | +.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse} |
此文件类型无法预览
此文件的差异被折叠,
点击展开。
此文件的差异被折叠,
点击展开。
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + */ | ||
| 7 | +body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;left:0;margin:0;overflow:hidden;-ms-scroll-chaining:none;overscroll-behavior:none;padding:0;position:fixed;top:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox.tox-tinymce.tox-fullscreen{z-index:1200}.tox-shadowhost.tox-fullscreen{z-index:1200}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201} |
此文件的差异被折叠,
点击展开。
此文件的差异被折叠,
点击展开。
| 1 | +/** | ||
| 2 | + * Copyright (c) Tiny Technologies, Inc. All rights reserved. | ||
| 3 | + * Licensed under the LGPL or a commercial license. | ||
| 4 | + * For LGPL see License.txt in the project root for license information. | ||
| 5 | + * For commercial licenses see https://www.tiny.cloud/ | ||
| 6 | + */ | ||
| 7 | +.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse} |
此文件类型无法预览
static/tinymce/skins/ui/oxide/skin.min.css
0 → 100644
此文件的差异被折叠,
点击展开。
此文件的差异被折叠,
点击展开。
此文件的差异被折叠,
点击展开。
static/tinymce/themes/mobile/theme.min.js
0 → 100644
此文件的差异太大,无法显示。
static/tinymce/themes/silver/theme.min.js
0 → 100644
此文件的差异太大,无法显示。
static/tinymce/tinymce.d.ts
0 → 100644
此文件的差异太大,无法显示。
static/tinymce/tinymce.min.js
0 → 100644
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
-
请 注册 或 登录 后发表评论