├── .gitignore ├── README.md ├── meta.js ├── package.json ├── screenshot ├── form.jpg └── search.jpg └── template ├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── README.md ├── build ├── build.js ├── check-versions.js ├── dev-client.js ├── dev-server.js ├── utils.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js ├── prod.env.js └── test.env.js ├── element-variables.css ├── index.html ├── mock └── user │ └── list.do.js ├── package.json ├── src ├── App.vue ├── api │ ├── request.js │ └── user.js ├── assets │ └── avatar.jpg ├── auth.js ├── components │ ├── Editor.vue │ ├── Layout.vue │ ├── Search.vue │ └── Sider.vue ├── main.js ├── nav-config.js ├── router-config.js └── views │ ├── editor.vue │ ├── index.vue │ ├── login.vue │ ├── notfound.vue │ └── user.vue ├── static ├── .gitkeep └── js │ └── tinymce │ ├── langs │ ├── readme.md │ └── zh_CN.js │ ├── license.txt │ ├── plugins │ ├── advlist │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── anchor │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── autolink │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── autoresize │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── autosave │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── bbcode │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── charmap │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── code │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── colorpicker │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── compat3x │ │ ├── css │ │ │ └── dialog.css │ │ ├── img │ │ │ ├── buttons.png │ │ │ ├── icons.gif │ │ │ ├── items.gif │ │ │ ├── menu_arrow.gif │ │ │ ├── menu_check.gif │ │ │ ├── progress.gif │ │ │ └── tabs.gif │ │ ├── plugin.js │ │ ├── plugin.min.js │ │ ├── tiny_mce_popup.js │ │ └── utils │ │ │ ├── editable_selects.js │ │ │ ├── form_utils.js │ │ │ ├── mctabs.js │ │ │ └── validate.js │ ├── contextmenu │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── directionality │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── emoticons │ │ ├── img │ │ │ ├── smiley-cool.gif │ │ │ ├── smiley-cry.gif │ │ │ ├── smiley-embarassed.gif │ │ │ ├── smiley-foot-in-mouth.gif │ │ │ ├── smiley-frown.gif │ │ │ ├── smiley-innocent.gif │ │ │ ├── smiley-kiss.gif │ │ │ ├── smiley-laughing.gif │ │ │ ├── smiley-money-mouth.gif │ │ │ ├── smiley-sealed.gif │ │ │ ├── smiley-smile.gif │ │ │ ├── smiley-surprised.gif │ │ │ ├── smiley-tongue-out.gif │ │ │ ├── smiley-undecided.gif │ │ │ ├── smiley-wink.gif │ │ │ └── smiley-yell.gif │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── example │ │ ├── dialog.html │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── example_dependency │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── fullpage │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── fullscreen │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── hr │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── image │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── imagetools │ │ ├── classes │ │ │ ├── Canvas.js │ │ │ ├── ColorMatrix.js │ │ │ ├── Conversions.js │ │ │ ├── CropRect.js │ │ │ ├── Dialog.js │ │ │ ├── Filters.js │ │ │ ├── ImagePanel.js │ │ │ ├── ImageSize.js │ │ │ ├── ImageTools.js │ │ │ ├── Mime.js │ │ │ ├── Plugin.js │ │ │ └── UndoStack.js │ │ ├── plugin.dev.js │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── importcss │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── insertdatetime │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── layer │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── legacyoutput │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── link │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── lists │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── media │ │ ├── moxieplayer.swf │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── nonbreaking │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── noneditable │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── pagebreak │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── paste │ │ ├── classes │ │ │ ├── Clipboard.js │ │ │ ├── Plugin.js │ │ │ ├── Quirks.js │ │ │ ├── Utils.js │ │ │ └── WordFilter.js │ │ ├── plugin.dev.js │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── preview │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── print │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── save │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── searchreplace │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── spellchecker │ │ ├── classes │ │ │ ├── DomTextMatcher.js │ │ │ └── Plugin.js │ │ ├── plugin.dev.js │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── tabfocus │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── table │ │ ├── classes │ │ │ ├── CellSelection.js │ │ │ ├── Dialogs.js │ │ │ ├── Plugin.js │ │ │ ├── Quirks.js │ │ │ ├── TableGrid.js │ │ │ └── Utils.js │ │ ├── plugin.dev.js │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── template │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── textcolor │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── textpattern │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── visualblocks │ │ ├── css │ │ │ └── visualblocks.css │ │ ├── img │ │ │ ├── address.gif │ │ │ ├── article.gif │ │ │ ├── aside.gif │ │ │ ├── blockquote.gif │ │ │ ├── div.gif │ │ │ ├── dl.gif │ │ │ ├── figure.gif │ │ │ ├── h1.gif │ │ │ ├── h2.gif │ │ │ ├── h3.gif │ │ │ ├── h4.gif │ │ │ ├── h5.gif │ │ │ ├── h6.gif │ │ │ ├── hgroup.gif │ │ │ ├── ol.gif │ │ │ ├── p.gif │ │ │ ├── pre.gif │ │ │ ├── section.gif │ │ │ └── ul.gif │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── visualchars │ │ ├── plugin.js │ │ └── plugin.min.js │ └── wordcount │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── skins │ └── lightgray │ │ ├── AbsoluteLayout.less │ │ ├── Animations.less │ │ ├── Button.less │ │ ├── ButtonGroup.less │ │ ├── Checkbox.less │ │ ├── ColorBox.less │ │ ├── ColorButton.less │ │ ├── ColorPicker.less │ │ ├── ComboBox.less │ │ ├── Container.less │ │ ├── Content.Inline.less │ │ ├── Content.Objects.less │ │ ├── Content.less │ │ ├── CropRect.less │ │ ├── FieldSet.less │ │ ├── FitLayout.less │ │ ├── FloatPanel.less │ │ ├── FlowLayout.less │ │ ├── Icons.Ie7.less │ │ ├── Icons.less │ │ ├── Iframe.less │ │ ├── ImagePanel.less │ │ ├── Label.less │ │ ├── ListBox.less │ │ ├── Menu.less │ │ ├── MenuBar.less │ │ ├── MenuButton.less │ │ ├── MenuItem.less │ │ ├── Mixins.less │ │ ├── Panel.less │ │ ├── Path.less │ │ ├── Radio.less │ │ ├── Reset.less │ │ ├── ResizeHandle.less │ │ ├── Scrollable.less │ │ ├── Slider.less │ │ ├── Spacer.less │ │ ├── SplitButton.less │ │ ├── StackLayout.less │ │ ├── TabPanel.less │ │ ├── TextBox.less │ │ ├── Throbber.less │ │ ├── TinyMCE.less │ │ ├── ToolTip.less │ │ ├── Variables.less │ │ ├── Window.less │ │ ├── content.inline.min.css │ │ ├── content.min.css │ │ ├── fonts │ │ ├── readme.md │ │ ├── tinymce-small.eot │ │ ├── tinymce-small.json │ │ ├── tinymce-small.svg │ │ ├── tinymce-small.ttf │ │ ├── tinymce-small.woff │ │ ├── tinymce.eot │ │ ├── tinymce.json │ │ ├── tinymce.svg │ │ ├── tinymce.ttf │ │ └── tinymce.woff │ │ ├── img │ │ ├── anchor.gif │ │ ├── loader.gif │ │ ├── object.gif │ │ └── trans.gif │ │ ├── skin.dev.less │ │ ├── skin.ie7.dev.less │ │ ├── skin.ie7.less │ │ ├── skin.ie7.min.css │ │ ├── skin.less │ │ └── skin.min.css │ ├── themes │ └── modern │ │ ├── theme.js │ │ └── theme.min.js │ ├── tinymce.dev.js │ ├── tinymce.js │ └── tinymce.min.js └── test ├── e2e ├── custom-assertions │ └── elementCount.js ├── nightwatch.conf.js ├── runner.js └── specs │ └── test.js └── unit ├── .eslintrc ├── coverage ├── lcov-report │ ├── base.css │ ├── index.html │ ├── prettify.css │ ├── prettify.js │ ├── sort-arrow-sprite.png │ ├── sorter.js │ └── src │ │ ├── api │ │ ├── index.html │ │ ├── request.js.html │ │ └── user.js.html │ │ ├── auth.js.html │ │ ├── components │ │ ├── Editor.vue.html │ │ ├── Layout.vue.html │ │ ├── Search.vue.html │ │ └── index.html │ │ ├── index.html │ │ ├── nav-config.js.html │ │ ├── router-config.js.html │ │ └── views │ │ ├── editor.vue.html │ │ ├── index.html │ │ ├── index.vue.html │ │ ├── login.vue.html │ │ └── user.vue.html └── lcov.info ├── index.js ├── karma.conf.js └── specs ├── Editor.spec.js └── Search.spec.js /.gitignore: -------------------------------------------------------------------------------- 1 | demo 2 | .DS_Store 3 | .idea 4 | .git 5 | .svn 6 | node_modules 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-element-admin-boilerplate 2 | 3 | > 用 vue-cli 生成的 vue2 与 element-ui 的后台开发脚手架 4 | 5 | **已长期不维护,请移至** [waye-pro](https://github.com/wayejs/waye-pro.git) 6 | 7 | ## 介绍 8 | 9 | 公司的 java 开发人员已会用 vue2 和 element-ui 开发后台系统,但每个人的开发风格都不一致,所以整一套标准的基于 [vue-cli](https://github.com/vuejs/vue-cli) 的 [webpack](https://github.com/vuejs-templates/webpack) 的模板供开发人员使用。 10 | 11 | ## 用法 12 | 13 | ``` bash 14 | $ npm install -g vue-cli 15 | $ vue init lynzz/element-admin my-project 16 | $ cd my-project 17 | $ npm install 18 | $ npm run dev 19 | ``` 20 | 21 | ## 特性 22 | 23 | - 支持 [mock](http://mockjs.com/) 数据, `mock` 路由按文件路径,单个文件就是一个接口 24 | 25 | - `ESLint` 采用 `standard` 方式 26 | 27 | - 编辑器用 [tinymce](https://www.tinymce.com/), 见 [Editor.vue](https://github.com/lynzz/element-admin/blob/master/template/src/components/Editor.vue) 28 | 29 | ## 演示 30 | 31 | [element-admin-demo](https://element-admin-demo-pvcijgwhsa.now.sh/) 32 | 33 | 用户名密码都是 `admin` 34 | 35 | ## 界面预览 36 | 37 | ### 搜索页 38 | 39 |  40 | 41 | ### 编辑器页 42 | 43 |  44 | 45 | ## TODO 46 | 47 | - [ ] add Vuex 48 | -------------------------------------------------------------------------------- /meta.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "helpers": { 3 | "if_or": function (v1, v2, options) { 4 | if (v1 || v2) { 5 | return options.fn(this); 6 | } 7 | 8 | return options.inverse(this); 9 | } 10 | }, 11 | "prompts": { 12 | "name": { 13 | "type": "string", 14 | "required": true, 15 | "message": "Project name" 16 | }, 17 | "description": { 18 | "type": "string", 19 | "required": false, 20 | "message": "Project description", 21 | "default": "A Vue.js admin project" 22 | }, 23 | "author": { 24 | "type": "string", 25 | "message": "Author" 26 | }, 27 | "unit": { 28 | "type": "confirm", 29 | "message": "Setup unit tests with Karma + Mocha?" 30 | }, 31 | "e2e": { 32 | "type": "confirm", 33 | "message": "Setup e2e tests with Nightwatch?" 34 | } 35 | }, 36 | "filters": { 37 | "config/test.env.js": "unit || e2e", 38 | "test/unit/**/*": "unit", 39 | "test/e2e/**/*": "e2e" 40 | }, 41 | "completeMessage": "To get started:\n\n cd {{destDirName}}\n npm install\n npm run dev\n\nDocumentation can be found at https://.github.com/lynzz/element-admin" 42 | }; 43 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element-admin", 3 | "version": "0.1.0", 4 | "description": "An Element UI & Vue.js quick start boilerplate with vue-cli support", 5 | "main": "meta.js", 6 | "scripts": { 7 | "test": "npm test" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/lynzz/element-admin.git" 12 | }, 13 | "keywords": [ 14 | "vue", 15 | "element", 16 | "mock", 17 | "ui", 18 | "tinymce", 19 | "vuex", 20 | "boilerplate", 21 | "admin" 22 | ], 23 | "author": "lynzz", 24 | "license": "MIT", 25 | "bugs": { 26 | "url": "https://github.com/lynzz/element-admin/issues" 27 | }, 28 | "homepage": "https://github.com/lynzz/element-admin#readme" 29 | } 30 | -------------------------------------------------------------------------------- /screenshot/form.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/screenshot/form.jpg -------------------------------------------------------------------------------- /screenshot/search.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/screenshot/search.jpg -------------------------------------------------------------------------------- /template/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": [ 4 | "transform-runtime", 5 | ["component", [{ 6 | "libraryName": "element-ui", 7 | "styleLibraryName": "theme-default" 8 | }]] 9 | ], 10 | "comments": false 11 | } 12 | -------------------------------------------------------------------------------- /template/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /template/.eslintignore: -------------------------------------------------------------------------------- 1 | build/*.js 2 | config/*.js 3 | static/js/tinymce 4 | -------------------------------------------------------------------------------- /template/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: 'babel-eslint', 4 | parserOptions: { 5 | sourceType: 'module' 6 | }, 7 | // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style 8 | extends: 'standard', 9 | // required to lint *.vue files 10 | plugins: [ 11 | 'html' 12 | ], 13 | globals: { 14 | tinymce: true, 15 | require: true 16 | }, 17 | 18 | // add your custom rules here 19 | 'rules': { 20 | // allow paren-less arrow functions 21 | 'arrow-parens': 0, 22 | // allow async-await 23 | 'generator-star-spacing': 0, 24 | // allow debugger during development 25 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /template/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /template/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | > {{description}} 4 | 5 | ## 使用 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # run e2e tests 18 | npm run e2e 19 | 20 | # run unit tests 21 | npm run unit 22 | 23 | # run all tests 24 | run test 25 | ``` 26 | 27 | ## 结构 28 | 29 | ``` 30 | | - src 31 | | - api 定义请求接口 32 | | - components 存放定义的组件 33 | | - store vuex 34 | | - views 存放路由页面 35 | | - nav-config.js 路由配置 36 | | - static 静态资源 37 | ``` 38 | -------------------------------------------------------------------------------- /template/build/build.js: -------------------------------------------------------------------------------- 1 | // https://github.com/shelljs/shelljs 2 | require('./check-versions')() 3 | require('shelljs/global') 4 | env.NODE_ENV = 'production' 5 | 6 | var path = require('path') 7 | var config = require('../config') 8 | var ora = require('ora') 9 | var webpack = require('webpack') 10 | var webpackConfig = require('./webpack.prod.conf') 11 | 12 | console.log( 13 | ' Tip:\n' + 14 | ' Built files are meant to be served over an HTTP server.\n' + 15 | ' Opening index.html over file:// won\'t work.\n' 16 | ) 17 | 18 | var spinner = ora('building for production...') 19 | spinner.start() 20 | 21 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 22 | rm('-rf', assetsPath) 23 | mkdir('-p', assetsPath) 24 | cp('-R', 'static/*', assetsPath) 25 | 26 | webpack(webpackConfig, function (err, stats) { 27 | spinner.stop() 28 | if (err) throw err 29 | process.stdout.write(stats.toString({ 30 | colors: true, 31 | modules: false, 32 | children: false, 33 | chunks: false, 34 | chunkModules: false 35 | }) + '\n') 36 | }) 37 | -------------------------------------------------------------------------------- /template/build/check-versions.js: -------------------------------------------------------------------------------- 1 | var semver = require('semver') 2 | var chalk = require('chalk') 3 | var packageConfig = require('../package.json') 4 | var exec = function (cmd) { 5 | return require('child_process') 6 | .execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | }, 15 | { 16 | name: 'npm', 17 | currentVersion: exec('npm --version'), 18 | versionRequirement: packageConfig.engines.npm 19 | } 20 | ] 21 | 22 | module.exports = function () { 23 | var warnings = [] 24 | for (var i = 0; i < versionRequirements.length; i++) { 25 | var mod = versionRequirements[i] 26 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 27 | warnings.push(mod.name + ': ' + 28 | chalk.red(mod.currentVersion) + ' should be ' + 29 | chalk.green(mod.versionRequirement) 30 | ) 31 | } 32 | } 33 | 34 | if (warnings.length) { 35 | console.log('') 36 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 37 | console.log() 38 | for (var i = 0; i < warnings.length; i++) { 39 | var warning = warnings[i] 40 | console.log(' ' + warning) 41 | } 42 | console.log() 43 | process.exit(1) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /template/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /template/build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | var config = require('../config') 3 | if (!process.env.NODE_ENV) process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) 4 | var path = require('path') 5 | var fs = require('fs') 6 | var express = require('express') 7 | var webpack = require('webpack') 8 | var opn = require('opn') 9 | var proxyMiddleware = require('http-proxy-middleware') 10 | var webpackConfig = require('./webpack.dev.conf') 11 | 12 | var walk = require('walk') 13 | var walker = walk.walk('./mock', {followLinks: false}) 14 | 15 | // default port where dev server listens for incoming traffic 16 | var port = process.env.PORT || config.dev.port 17 | // Define HTTP proxies to your custom API backend 18 | // https://github.com/chimurai/http-proxy-middleware 19 | var proxyTable = config.dev.proxyTable 20 | 21 | var app = express() 22 | var compiler = webpack(webpackConfig) 23 | 24 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 25 | publicPath: webpackConfig.output.publicPath, 26 | stats: { 27 | colors: true, 28 | chunks: false 29 | } 30 | }) 31 | 32 | var hotMiddleware = require('webpack-hot-middleware')(compiler) 33 | // force page reload when html-webpack-plugin template changes 34 | compiler.plugin('compilation', function (compilation) { 35 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 36 | hotMiddleware.publish({ action: 'reload' }) 37 | cb() 38 | }) 39 | }) 40 | 41 | // proxy api requests 42 | Object.keys(proxyTable).forEach(function (context) { 43 | var options = proxyTable[context] 44 | if (typeof options === 'string') { 45 | options = { target: options } 46 | } 47 | app.use(proxyMiddleware(context, options)) 48 | }) 49 | 50 | // handle fallback for HTML5 history API 51 | app.use(require('connect-history-api-fallback')()) 52 | 53 | // serve webpack bundle output 54 | app.use(devMiddleware) 55 | 56 | // enable hot-reload and state-preserving 57 | // compilation error display 58 | app.use(hotMiddleware) 59 | 60 | // serve pure static assets 61 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 62 | app.use(staticPath, express.static('./static')) 63 | 64 | walker.on('file', function(root, fileStat, next) { 65 | if (!/\.js$/.test(fileStat.name)) next() 66 | 67 | var filepath = path.join(root, fileStat.name) 68 | var url = filepath.replace('mock', '').replace('.js', '') 69 | var mod = filepath.replace('mock', '../mock') 70 | 71 | app.all(url, require(mod)) 72 | // fs.watchFile(path.resolve(root, fileStat.name), function(curr, prev) { 73 | // hotMiddleware.publish({ action: 'reload' }) 74 | // }) 75 | }) 76 | 77 | walker.on('errors', function(root, nodeStatsArray, next) { 78 | nodeStatsArray.forEach(function (n) { 79 | console.error('[ERROR] ' + n.name) 80 | console.error(n.error.message || (n.error.code + ': ' + n.error.path)) 81 | }) 82 | next() 83 | }) 84 | 85 | walker.on('end', function() { 86 | console.log('walker all done') 87 | }) 88 | 89 | module.exports = app.listen(port, function (err) { 90 | if (err) { 91 | console.log(err) 92 | return 93 | } 94 | var uri = 'http://localhost:' + port 95 | console.log('Listening at ' + uri + '\n') 96 | 97 | // when env is testing, don't need open it 98 | // if (process.env.NODE_ENV !== 'testing') { 99 | // opn(uri) 100 | // } 101 | }) 102 | -------------------------------------------------------------------------------- /template/build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | // generate loader string to be used with extract text plugin 15 | function generateLoaders (loaders) { 16 | var sourceLoader = loaders.map(function (loader) { 17 | var extraParamChar 18 | if (/\?/.test(loader)) { 19 | loader = loader.replace(/\?/, '-loader?') 20 | extraParamChar = '&' 21 | } else { 22 | loader = loader + '-loader' 23 | extraParamChar = '?' 24 | } 25 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '') 26 | }).join('!') 27 | 28 | // Extract CSS when that option is specified 29 | // (which is the case during production build) 30 | if (options.extract) { 31 | return ExtractTextPlugin.extract('vue-style-loader', sourceLoader) 32 | } else { 33 | return ['vue-style-loader', sourceLoader].join('!') 34 | } 35 | } 36 | 37 | // http://vuejs.github.io/vue-loader/en/configurations/extract-css.html 38 | return { 39 | css: generateLoaders(['css']), 40 | postcss: generateLoaders(['css']), 41 | less: generateLoaders(['css', 'less']), 42 | sass: generateLoaders(['css', 'sass?indentedSyntax']), 43 | scss: generateLoaders(['css', 'sass']), 44 | stylus: generateLoaders(['css', 'stylus']), 45 | styl: generateLoaders(['css', 'stylus']) 46 | } 47 | } 48 | 49 | // Generate loaders for standalone style files (outside of .vue) 50 | exports.styleLoaders = function (options) { 51 | var output = [] 52 | var loaders = exports.cssLoaders(options) 53 | for (var extension in loaders) { 54 | var loader = loaders[extension] 55 | output.push({ 56 | test: new RegExp('\\.' + extension + '$'), 57 | loader: loader 58 | }) 59 | } 60 | return output 61 | } 62 | -------------------------------------------------------------------------------- /template/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var utils = require('./utils') 4 | var projectRoot = path.resolve(__dirname, '../') 5 | 6 | var env = process.env.NODE_ENV 7 | // check env & config/index.js to decide weither to enable CSS Sourcemaps for the 8 | // various preprocessor loaders added to vue-loader at the end of this file 9 | var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap) 10 | var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap) 11 | var useCssSourceMap = cssSourceMapDev || cssSourceMapProd 12 | 13 | module.exports = { 14 | entry: { 15 | app: './src/main.js' 16 | }, 17 | output: { 18 | path: config.build.assetsRoot, 19 | publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath, 20 | filename: '[name].js' 21 | }, 22 | resolve: { 23 | extensions: ['', '.js', '.vue'], 24 | fallback: [path.join(__dirname, '../node_modules')], 25 | alias: { 26 | 'vue$': 'vue/dist/vue.js', 27 | 'src': path.resolve(__dirname, '../src'), 28 | 'assets': path.resolve(__dirname, '../src/assets'), 29 | 'components': path.resolve(__dirname, '../src/components'), 30 | 'views': path.resolve(__dirname, '../src/views') 31 | } 32 | }, 33 | resolveLoader: { 34 | fallback: [path.join(__dirname, '../node_modules')] 35 | }, 36 | module: { 37 | preLoaders: [ 38 | { 39 | test: /\.vue$/, 40 | loader: 'eslint', 41 | include: projectRoot, 42 | exclude: /node_modules/ 43 | }, 44 | { 45 | test: /\.js$/, 46 | loader: 'eslint', 47 | include: projectRoot, 48 | exclude: /node_modules/ 49 | } 50 | ], 51 | loaders: [ 52 | { 53 | test: /\.vue$/, 54 | loader: 'vue' 55 | }, 56 | { 57 | test: /\.js$/, 58 | loader: 'babel', 59 | include: projectRoot, 60 | exclude: /node_modules/ 61 | }, 62 | { 63 | test: /\.json$/, 64 | loader: 'json' 65 | }, 66 | { 67 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 68 | loader: 'url', 69 | query: { 70 | limit: 10000, 71 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 72 | } 73 | }, 74 | { 75 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 76 | loader: 'url', 77 | query: { 78 | limit: 10000, 79 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 80 | } 81 | } 82 | ] 83 | }, 84 | eslint: { 85 | formatter: require('eslint-friendly-formatter') 86 | }, 87 | vue: { 88 | loaders: utils.cssLoaders({ sourceMap: useCssSourceMap }), 89 | postcss: [ 90 | require('autoprefixer')({ 91 | browsers: ['last 2 versions'] 92 | }) 93 | ] 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /template/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var config = require('../config') 2 | var webpack = require('webpack') 3 | var merge = require('webpack-merge') 4 | var utils = require('./utils') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | 8 | // add hot-reload related code to entry chunks 9 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 10 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 11 | }) 12 | 13 | module.exports = merge(baseWebpackConfig, { 14 | module: { 15 | loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 16 | }, 17 | // eval-source-map is faster for development 18 | devtool: '#eval-source-map', 19 | plugins: [ 20 | new webpack.DefinePlugin({ 21 | 'process.env': config.dev.env 22 | }), 23 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 24 | new webpack.optimize.OccurenceOrderPlugin(), 25 | new webpack.HotModuleReplacementPlugin(), 26 | new webpack.NoErrorsPlugin(), 27 | // https://github.com/ampedandwired/html-webpack-plugin 28 | new HtmlWebpackPlugin({ 29 | filename: 'index.html', 30 | template: 'index.html', 31 | inject: true 32 | }) 33 | ] 34 | }) 35 | -------------------------------------------------------------------------------- /template/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /template/config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'] 18 | }, 19 | dev: { 20 | env: require('./dev.env'), 21 | port: 8080, 22 | assetsSubDirectory: 'static', 23 | assetsPublicPath: '/', 24 | proxyTable: {}, 25 | // CSS Sourcemaps off by default because relative paths are "buggy" 26 | // with this option, according to the CSS-Loader README 27 | // (https://github.com/webpack/css-loader#sourcemaps) 28 | // In our experience, they generally work as expected, 29 | // just be aware of this issue when enabling this option. 30 | cssSourceMap: false 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /template/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /template/config/test.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var devEnv = require('./dev.env') 3 | 4 | module.exports = merge(devEnv, { 5 | NODE_ENV: '"testing"' 6 | }) 7 | -------------------------------------------------------------------------------- /template/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |登录
7 |]*>/gi,"[quote]"),t(/<\/blockquote>/gi,"[/quote]"),t(/'; 27 | } 28 | 29 | function compileCharMapToRegExp() { 30 | var key, regExp = ''; 31 | 32 | for (key in charMap) { 33 | regExp += key; 34 | } 35 | 36 | return new RegExp('[' + regExp + ']', 'g'); 37 | } 38 | 39 | function compileCharMapToCssSelector() { 40 | var key, selector = ''; 41 | 42 | for (key in charMap) { 43 | if (selector) { 44 | selector += ','; 45 | } 46 | 47 | selector += 'span.mce-' + charMap[key]; 48 | } 49 | 50 | return selector; 51 | } 52 | 53 | state = !state; 54 | self.state = state; 55 | editor.fire('VisualChars', {state: state}); 56 | visualCharsRegExp = compileCharMapToRegExp(); 57 | 58 | if (addBookmark) { 59 | bookmark = selection.getBookmark(); 60 | } 61 | 62 | if (state) { 63 | nodeList = []; 64 | tinymce.walk(body, function(n) { 65 | if (n.nodeType == 3 && n.nodeValue && visualCharsRegExp.test(n.nodeValue)) { 66 | nodeList.push(n); 67 | } 68 | }, 'childNodes'); 69 | 70 | for (i = 0; i < nodeList.length; i++) { 71 | nodeValue = nodeList[i].nodeValue; 72 | nodeValue = nodeValue.replace(visualCharsRegExp, wrapCharWithSpan); 73 | 74 | div = editor.dom.create('div', null, nodeValue); 75 | while ((node = div.lastChild)) { 76 | editor.dom.insertAfter(node, nodeList[i]); 77 | } 78 | 79 | editor.dom.remove(nodeList[i]); 80 | } 81 | } else { 82 | nodeList = editor.dom.select(compileCharMapToCssSelector(), body); 83 | 84 | for (i = nodeList.length - 1; i >= 0; i--) { 85 | editor.dom.remove(nodeList[i], 1); 86 | } 87 | } 88 | 89 | selection.moveToBookmark(bookmark); 90 | } 91 | 92 | function toggleActiveState() { 93 | var self = this; 94 | 95 | editor.on('VisualChars', function(e) { 96 | self.active(e.state); 97 | }); 98 | } 99 | 100 | editor.addCommand('mceVisualChars', toggleVisualChars); 101 | 102 | editor.addButton('visualchars', { 103 | title: 'Show invisible characters', 104 | cmd: 'mceVisualChars', 105 | onPostRender: toggleActiveState 106 | }); 107 | 108 | editor.addMenuItem('visualchars', { 109 | text: 'Show invisible characters', 110 | cmd: 'mceVisualChars', 111 | onPostRender: toggleActiveState, 112 | selectable: true, 113 | context: 'view', 114 | prependToContext: true 115 | }); 116 | 117 | editor.on('beforegetcontent', function(e) { 118 | if (state && e.format != 'raw' && !e.draft) { 119 | state = true; 120 | toggleVisualChars(false); 121 | } 122 | }); 123 | }); 124 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/visualchars/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("visualchars",function(e){function t(t){function n(e){return''+e+""}function o(){var e,t="";for(e in h)t+=e;return new RegExp("["+t+"]","g")}function a(){var e,t="";for(e in h)t&&(t+=","),t+="span.mce-"+h[e];return t}var s,l,c,u,d,f,h,p,m=e.getBody(),g=e.selection;if(h={"\xa0":"nbsp","\xad":"shy"},r=!r,i.state=r,e.fire("VisualChars",{state:r}),p=o(),t&&(f=g.getBookmark()),r)for(l=[],tinymce.walk(m,function(e){3==e.nodeType&&e.nodeValue&&p.test(e.nodeValue)&&l.push(e)},"childNodes"),c=0;c
/gi,"\n"),t(/
/gi,"\n"),t(/
/gi,"\n"),t(//gi,""),t(/<\/p>/gi,"\n"),t(/ |\u00a0/gi," "),t(/"/gi,'"'),t(/</gi,"<"),t(/>/gi,">"),t(/&/gi,"&"),e},_punbb_bbcode2html:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/\n/gi,"
"),t(/\[b\]/gi,""),t(/\[\/b\]/gi,""),t(/\[i\]/gi,""),t(/\[\/i\]/gi,""),t(/\[u\]/gi,""),t(/\[\/u\]/gi,""),t(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),t(/\[url\](.*?)\[\/url\]/gi,'$1'),t(/\[img\](.*?)\[\/img\]/gi,''),t(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),t(/\[code\](.*?)\[\/code\]/gi,'$1 '),t(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),e}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}(); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/code/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('code', function(editor) { 14 | function showDialog() { 15 | var win = editor.windowManager.open({ 16 | title: "Source code", 17 | body: { 18 | type: 'textbox', 19 | name: 'code', 20 | multiline: true, 21 | minWidth: editor.getParam("code_dialog_width", 600), 22 | minHeight: editor.getParam("code_dialog_height", Math.min(tinymce.DOM.getViewPort().h - 200, 500)), 23 | spellcheck: false, 24 | style: 'direction: ltr; text-align: left' 25 | }, 26 | onSubmit: function(e) { 27 | // We get a lovely "Wrong document" error in IE 11 if we 28 | // don't move the focus to the editor before creating an undo 29 | // transation since it tries to make a bookmark for the current selection 30 | editor.focus(); 31 | 32 | editor.undoManager.transact(function() { 33 | editor.setContent(e.data.code); 34 | }); 35 | 36 | editor.selection.setCursorLocation(); 37 | editor.nodeChanged(); 38 | } 39 | }); 40 | 41 | // Gecko has a major performance issue with textarea 42 | // contents so we need to set it when all reflows are done 43 | win.find('#code').value(editor.getContent({source_view: true})); 44 | } 45 | 46 | editor.addCommand("mceCodeEditor", showDialog); 47 | 48 | editor.addButton('code', { 49 | icon: 'code', 50 | tooltip: 'Source code', 51 | onclick: showDialog 52 | }); 53 | 54 | editor.addMenuItem('code', { 55 | icon: 'code', 56 | text: 'Source code', 57 | context: 'tools', 58 | onclick: showDialog 59 | }); 60 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/code/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("code",function(e){function t(){var t=e.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:e.getParam("code_dialog_width",600),minHeight:e.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(t){e.focus(),e.undoManager.transact(function(){e.setContent(t.data.code)}),e.selection.setCursorLocation(),e.nodeChanged()}});t.find("#code").value(e.getContent({source_view:!0}))}e.addCommand("mceCodeEditor",t),e.addButton("code",{icon:"code",tooltip:"Source code",onclick:t}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:t})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/colorpicker/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('colorpicker', function(editor) { 14 | function colorPickerCallback(callback, value) { 15 | function setColor(value) { 16 | var color = new tinymce.util.Color(value), rgb = color.toRgb(); 17 | 18 | win.fromJSON({ 19 | r: rgb.r, 20 | g: rgb.g, 21 | b: rgb.b, 22 | hex: color.toHex().substr(1) 23 | }); 24 | 25 | showPreview(color.toHex()); 26 | } 27 | 28 | function showPreview(hexColor) { 29 | win.find('#preview')[0].getEl().style.background = hexColor; 30 | } 31 | 32 | var win = editor.windowManager.open({ 33 | title: 'Color', 34 | items: { 35 | type: 'container', 36 | layout: 'flex', 37 | direction: 'row', 38 | align: 'stretch', 39 | padding: 5, 40 | spacing: 10, 41 | items: [ 42 | { 43 | type: 'colorpicker', 44 | value: value, 45 | onchange: function() { 46 | var rgb = this.rgb(); 47 | 48 | if (win) { 49 | win.find('#r').value(rgb.r); 50 | win.find('#g').value(rgb.g); 51 | win.find('#b').value(rgb.b); 52 | win.find('#hex').value(this.value().substr(1)); 53 | showPreview(this.value()); 54 | } 55 | } 56 | }, 57 | { 58 | type: 'form', 59 | padding: 0, 60 | labelGap: 5, 61 | defaults: { 62 | type: 'textbox', 63 | size: 7, 64 | value: '0', 65 | flex: 1, 66 | spellcheck: false, 67 | onchange: function() { 68 | var colorPickerCtrl = win.find('colorpicker')[0]; 69 | var name, value; 70 | 71 | name = this.name(); 72 | value = this.value(); 73 | 74 | if (name == "hex") { 75 | value = '#' + value; 76 | setColor(value); 77 | colorPickerCtrl.value(value); 78 | return; 79 | } 80 | 81 | value = { 82 | r: win.find('#r').value(), 83 | g: win.find('#g').value(), 84 | b: win.find('#b').value() 85 | }; 86 | 87 | colorPickerCtrl.value(value); 88 | setColor(value); 89 | } 90 | }, 91 | items: [ 92 | {name: 'r', label: 'R', autofocus: 1}, 93 | {name: 'g', label: 'G'}, 94 | {name: 'b', label: 'B'}, 95 | {name: 'hex', label: '#', value: '000000'}, 96 | {name: 'preview', type: 'container', border: 1} 97 | ] 98 | } 99 | ] 100 | }, 101 | onSubmit: function() { 102 | callback('#' + this.toJSON().hex); 103 | } 104 | }); 105 | 106 | setColor(value); 107 | } 108 | 109 | if (!editor.settings.color_picker_callback) { 110 | editor.settings.color_picker_callback = colorPickerCallback; 111 | } 112 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/colorpicker/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("colorpicker",function(e){function t(t,n){function r(e){var t=new tinymce.util.Color(e),n=t.toRgb();o.fromJSON({r:n.r,g:n.g,b:n.b,hex:t.toHex().substr(1)}),i(t.toHex())}function i(e){o.find("#preview")[0].getEl().style.background=e}var o=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:n,onchange:function(){var e=this.rgb();o&&(o.find("#r").value(e.r),o.find("#g").value(e.g),o.find("#b").value(e.b),o.find("#hex").value(this.value().substr(1)),i(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,t,n=o.find("colorpicker")[0];return e=this.name(),t=this.value(),"hex"==e?(t="#"+t,r(t),void n.value(t)):(t={r:o.find("#r").value(),g:o.find("#g").value(),b:o.find("#b").value()},n.value(t),void r(t))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){t("#"+this.toJSON().hex)}});r(n)}e.settings.color_picker_callback||(e.settings.color_picker_callback=t)}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/compat3x/img/buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/plugins/compat3x/img/buttons.png -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/compat3x/img/icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/plugins/compat3x/img/icons.gif -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/compat3x/img/items.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/plugins/compat3x/img/items.gif -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/compat3x/img/menu_arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/plugins/compat3x/img/menu_arrow.gif -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/compat3x/img/menu_check.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/plugins/compat3x/img/menu_check.gif -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/compat3x/img/progress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/plugins/compat3x/img/progress.gif -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/compat3x/img/tabs.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/plugins/compat3x/img/tabs.gif -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/compat3x/utils/editable_selects.js: -------------------------------------------------------------------------------- 1 | /** 2 | * editable_selects.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | var TinyMCE_EditableSelects = { 12 | editSelectElm : null, 13 | 14 | init : function() { 15 | var nl = document.getElementsByTagName("select"), i, d = document, o; 16 | 17 | for (i=0; i
'; 28 | 29 | tinymce.each(row, function(icon) { 30 | var emoticonUrl = url + '/img/smiley-' + icon + '.gif'; 31 | 32 | emoticonsHtml += ' '; 35 | }); 36 | 37 | emoticonsHtml += ''; 38 | }); 39 | 40 | emoticonsHtml += ''; 41 | 42 | return emoticonsHtml; 43 | } 44 | 45 | editor.addButton('emoticons', { 46 | type: 'panelbutton', 47 | panel: { 48 | role: 'application', 49 | autohide: true, 50 | html: getHtml, 51 | onclick: function(e) { 52 | var linkElm = editor.dom.getParent(e.target, 'a'); 53 | 54 | if (linkElm) { 55 | editor.insertContent( 56 | ' ' 57 | ); 58 | 59 | this.hide(); 60 | } 61 | } 62 | }, 63 | tooltip: 'Emoticons' 64 | }); 65 | }); 66 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/emoticons/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("emoticons",function(e,t){function n(){var e;return e='
',tinymce.each(r,function(n){e+="
"}var r=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];e.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:n,onclick:function(t){var n=e.dom.getParent(t.target,"a");n&&(e.insertContent('",tinymce.each(n,function(n){var r=t+"/img/smiley-"+n+".gif";e+=' "}),e+="'}),e+=" '),this.hide())}},tooltip:"Emoticons"})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/example/dialog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
Custom dialog
5 | Input some text: 6 | 7 | 8 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/example/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*jshint unused:false */ 12 | /*global tinymce:true */ 13 | 14 | /** 15 | * Example plugin that adds a toolbar button and menu item. 16 | */ 17 | tinymce.PluginManager.add('example', function(editor, url) { 18 | // Add a button that opens a window 19 | editor.addButton('example', { 20 | text: 'My button', 21 | icon: false, 22 | onclick: function() { 23 | // Open window 24 | editor.windowManager.open({ 25 | title: 'Example plugin', 26 | body: [ 27 | {type: 'textbox', name: 'title', label: 'Title'} 28 | ], 29 | onsubmit: function(e) { 30 | // Insert content when the window form is submitted 31 | editor.insertContent('Title: ' + e.data.title); 32 | } 33 | }); 34 | } 35 | }); 36 | 37 | // Adds a menu item to the tools menu 38 | editor.addMenuItem('example', { 39 | text: 'Example plugin', 40 | context: 'tools', 41 | onclick: function() { 42 | // Open window with a specific url 43 | editor.windowManager.open({ 44 | title: 'TinyMCE site', 45 | url: url + '/dialog.html', 46 | width: 600, 47 | height: 400, 48 | buttons: [ 49 | { 50 | text: 'Insert', 51 | onclick: function() { 52 | // Top most window object 53 | var win = editor.windowManager.getWindows()[0]; 54 | 55 | // Insert the contents of the dialog.html textarea into the editor 56 | editor.insertContent(win.getContentWindow().document.getElementById('content').value); 57 | 58 | // Close the window 59 | win.close(); 60 | } 61 | }, 62 | 63 | {text: 'Close', onclick: 'close'} 64 | ] 65 | }); 66 | } 67 | }); 68 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/example/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("example",function(e,t){e.addButton("example",{text:"My button",icon:!1,onclick:function(){e.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(t){e.insertContent("Title: "+t.data.title)}})}}),e.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){e.windowManager.open({title:"TinyMCE site",url:t+"/dialog.html",width:600,height:400,buttons:[{text:"Insert",onclick:function(){var t=e.windowManager.getWindows()[0];e.insertContent(t.getContentWindow().document.getElementById("content").value),t.close()}},{text:"Close",onclick:"close"}]})}})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/example_dependency/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*jshint unused:false */ 12 | /*global tinymce:true */ 13 | 14 | /** 15 | * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, 16 | * with the list loaded in order. plugins in this list will be initialised when this plugin is initialized. (before the 17 | * init method is called). plugins in a depends list should typically be specified using the short name). If necessary 18 | * this can be done with an object which has the url to the plugin and the shortname. 19 | */ 20 | tinymce.PluginManager.add('example_dependency', function() { 21 | // Example logic here 22 | }, ['example']); 23 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/example_dependency/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("example_dependency",function(){},["example"]); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/fullscreen/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,r=document,i=r.body;return i.offsetWidth&&(e=i.offsetWidth,t=i.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){function n(){c.setStyle(f,"height",t().h-(d.clientHeight-f.clientHeight))}var u,d,f,h,p=document.body,m=document.documentElement;l=!l,d=e.getContainer(),u=d.style,f=e.getContentAreaContainer().firstChild,h=f.style,l?(r=h.width,i=h.height,h.width=h.height="100%",a=u.width,s=u.height,u.width=u.height="",c.addClass(p,"mce-fullscreen"),c.addClass(m,"mce-fullscreen"),c.addClass(d,"mce-fullscreen"),c.bind(window,"resize",n),n(),o=n):(h.width=r,h.height=i,a&&(u.width=a),s&&(u.height=s),c.removeClass(p,"mce-fullscreen"),c.removeClass(m,"mce-fullscreen"),c.removeClass(d,"mce-fullscreen"),c.unbind(window,"resize",o)),e.fire("FullscreenStateChanged",{state:l})}var r,i,o,a,s,l=!1,c=tinymce.DOM;return e.settings.inline?void 0:(e.on("init",function(){e.addShortcut("Meta+Alt+F","",n)}),e.on("remove",function(){o&&c.unbind(window,"resize",o)}),e.addCommand("mceFullScreen",n),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Alt+F",selectable:!0,onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Meta+Alt+F",onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return l}})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/hr/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('hr', function(editor) { 14 | editor.addCommand('InsertHorizontalRule', function() { 15 | editor.execCommand('mceInsertContent', false, '
'); 16 | }); 17 | 18 | editor.addButton('hr', { 19 | icon: 'hr', 20 | tooltip: 'Horizontal line', 21 | cmd: 'InsertHorizontalRule' 22 | }); 23 | 24 | editor.addMenuItem('hr', { 25 | icon: 'hr', 26 | text: 'Horizontal line', 27 | cmd: 'InsertHorizontalRule', 28 | context: 'insert' 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/hr/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("hr",function(e){e.addCommand("InsertHorizontalRule",function(){e.execCommand("mceInsertContent",!1,"
")}),e.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/imagetools/classes/Canvas.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Canvas.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * Contains various canvas functions. 13 | */ 14 | define("tinymce/imagetoolsplugin/Canvas", [], function() { 15 | function create(width, height) { 16 | return resize(document.createElement('canvas'), width, height); 17 | } 18 | 19 | function get2dContext(canvas) { 20 | return canvas.getContext("2d"); 21 | } 22 | 23 | function resize(canvas, width, height) { 24 | canvas.width = width; 25 | canvas.height = height; 26 | 27 | return canvas; 28 | } 29 | 30 | return { 31 | create: create, 32 | resize: resize, 33 | get2dContext: get2dContext 34 | }; 35 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/imagetools/classes/ImageSize.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ImageSize.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * Returns the size of images. 13 | */ 14 | define("tinymce/imagetoolsplugin/ImageSize", [], function() { 15 | function getWidth(image) { 16 | return image.naturalWidth || image.width; 17 | } 18 | 19 | function getHeight(image) { 20 | return image.naturalHeight || image.height; 21 | } 22 | 23 | return { 24 | getWidth: getWidth, 25 | getHeight: getHeight 26 | }; 27 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/imagetools/classes/ImageTools.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ImageTools.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * Modifies image blobs. 13 | */ 14 | define("tinymce/imagetoolsplugin/ImageTools", [ 15 | "tinymce/imagetoolsplugin/Conversions", 16 | "tinymce/imagetoolsplugin/Canvas", 17 | "tinymce/imagetoolsplugin/ImageSize" 18 | ], function(Conversions, Canvas, ImageSize) { 19 | var revokeImageUrl = Conversions.revokeImageUrl; 20 | 21 | function rotate(blob, angle) { 22 | return Conversions.blobToImage(blob).then(function(image) { 23 | var canvas = Canvas.create(ImageSize.getWidth(image), ImageSize.getHeight(image)), 24 | context = Canvas.get2dContext(canvas), 25 | translateX = 0, translateY = 0; 26 | 27 | angle = angle < 0 ? 360 + angle : angle; 28 | 29 | if (angle == 90 || angle == 270) { 30 | Canvas.resize(canvas, canvas.height, canvas.width); 31 | } 32 | 33 | if (angle == 90 || angle == 180) { 34 | translateX = canvas.width; 35 | } 36 | 37 | if (angle == 270 || angle == 180) { 38 | translateY = canvas.height; 39 | } 40 | 41 | context.translate(translateX, translateY); 42 | context.rotate(angle * Math.PI / 180); 43 | context.drawImage(image, 0, 0); 44 | revokeImageUrl(image); 45 | 46 | return Conversions.canvasToBlob(canvas, blob.type); 47 | }); 48 | } 49 | 50 | function flip(blob, axis) { 51 | return Conversions.blobToImage(blob).then(function(image) { 52 | var canvas = Canvas.create(ImageSize.getWidth(image), ImageSize.getHeight(image)), 53 | context = Canvas.get2dContext(canvas); 54 | 55 | if (axis == 'v') { 56 | context.scale(1, -1); 57 | context.drawImage(image, 0, -canvas.height); 58 | } else { 59 | context.scale(-1, 1); 60 | context.drawImage(image, -canvas.width, 0); 61 | } 62 | 63 | revokeImageUrl(image); 64 | 65 | return Conversions.canvasToBlob(canvas); 66 | }); 67 | } 68 | 69 | function crop(blob, x, y, w, h) { 70 | return Conversions.blobToImage(blob).then(function(image) { 71 | var canvas = Canvas.create(w, h), 72 | context = Canvas.get2dContext(canvas); 73 | 74 | context.drawImage(image, -x, -y); 75 | revokeImageUrl(image); 76 | 77 | return Conversions.canvasToBlob(canvas); 78 | }); 79 | } 80 | 81 | function resize(blob, w, h) { 82 | return Conversions.blobToImage(blob).then(function(image) { 83 | var canvas = Canvas.create(w, h), 84 | context = Canvas.get2dContext(canvas); 85 | 86 | context.drawImage(image, 0, 0, w, h); 87 | revokeImageUrl(image); 88 | 89 | return Conversions.canvasToBlob(canvas, blob.type); 90 | }); 91 | } 92 | 93 | return { 94 | rotate: rotate, 95 | flip: flip, 96 | crop: crop, 97 | resize: resize 98 | }; 99 | }); 100 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/imagetools/classes/Mime.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Mime.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * Returns mime types for uris. 13 | */ 14 | define("tinymce/imagetoolsplugin/Mime", [], function() { 15 | function getUriPathName(uri) { 16 | var a = document.createElement('a'); 17 | 18 | a.href = uri; 19 | 20 | return a.pathname; 21 | } 22 | 23 | function guessMimeType(uri) { 24 | var parts = getUriPathName(uri).split('.'), 25 | ext = parts[parts.length - 1], 26 | mimes = { 27 | 'jpg': 'image/jpeg', 28 | 'jpeg': 'image/jpeg', 29 | 'png': 'image/png' 30 | }; 31 | 32 | if (ext) { 33 | ext = ext.toLowerCase(); 34 | } 35 | 36 | return mimes[ext]; 37 | } 38 | 39 | return { 40 | guessMimeType: guessMimeType 41 | }; 42 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/imagetools/classes/UndoStack.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UndoStack.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define("tinymce/imagetoolsplugin/UndoStack", [ 12 | ], function() { 13 | return function() { 14 | var data = [], index = -1; 15 | 16 | function add(state) { 17 | var removed; 18 | 19 | removed = data.splice(++index); 20 | data.push(state); 21 | 22 | return { 23 | state: state, 24 | removed: removed 25 | }; 26 | } 27 | 28 | function undo() { 29 | if (canUndo()) { 30 | return data[--index]; 31 | } 32 | } 33 | 34 | function redo() { 35 | if (canRedo()) { 36 | return data[++index]; 37 | } 38 | } 39 | 40 | function canUndo() { 41 | return index > 0; 42 | } 43 | 44 | function canRedo() { 45 | return index != -1 && index < data.length - 1; 46 | } 47 | 48 | return { 49 | data: data, 50 | add: add, 51 | undo: undo, 52 | redo: redo, 53 | canUndo: canUndo, 54 | canRedo: canRedo 55 | }; 56 | }; 57 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/importcss/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("importcss",function(e){function t(e){return"string"==typeof e?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e}function n(t,n){function r(e,t){var a,s=e.href;if(s&&n(s,t)){o(e.imports,function(e){r(e,!0)});try{a=e.cssRules||e.rules}catch(l){}o(a,function(e){e.styleSheet?r(e.styleSheet,!0):e.selectorText&&o(e.selectorText.split(","),function(e){i.push(tinymce.trim(e))})})}}var i=[],a={};o(e.contentCSS,function(e){a[e]=!0}),n||(n=function(e,t){return t||a[e]});try{o(t.styleSheets,function(e){r(e)})}catch(s){}return i}function r(t){var n,r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(r){var i=r[1],o=r[2].substr(1).split(".").join(" "),a=tinymce.makeMap("a,img");return r[1]?(n={title:t},e.schema.getTextBlockElements()[i]?n.block=i:e.schema.getBlockElements()[i]||a[i.toLowerCase()]?n.selector=i:n.inline=i):r[2]&&(n={inline:"span",title:t.substr(1),classes:o}),e.settings.importcss_merge_classes!==!1?n.classes=o:n.attributes={"class":o},n}}var i=this,o=tinymce.each;e.on("renderFormatsMenu",function(a){var s=e.settings,l={},c=s.importcss_selector_converter||r,u=t(s.importcss_selector_filter),d=a.control;e.settings.importcss_append||d.items().remove();var f=[];tinymce.each(s.importcss_groups,function(e){e=tinymce.extend({},e),e.filter=t(e.filter),f.push(e)}),o(n(a.doc||e.getDoc(),t(s.importcss_file_filter)),function(t){if(-1===t.indexOf(".mce-")&&!l[t]&&(!u||u(t))){var n,r=c.call(i,t);if(r){var o=r.name||tinymce.DOM.uniqueId();if(f)for(var a=0;a'+r+"";var o=e.dom.getParent(e.selection.getStart(),"time");if(o)return void e.dom.setOuterHTML(o,r)}e.insertContent(r)}var r,i,o="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),s="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),l="January February March April May June July August September October November December".split(" "),c=[];e.addCommand("mceInsertDate",function(){n(e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),e.addCommand("mceInsertTime",function(){n(e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S")))}),e.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){n(r||i)},menu:c}),tinymce.each(e.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(e){i||(i=e),c.push({text:t(e),onclick:function(){r=e,n(e)}})}),e.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:c,context:"insert"})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/layer/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("layer",function(e){function t(e){do if(e.className&&-1!=e.className.indexOf("mceItemLayer"))return e;while(e=e.parentNode)}function n(t){var n=e.dom;tinymce.each(n.select("div,p",t),function(e){/^(absolute|relative|fixed)$/i.test(e.style.position)&&(e.hasVisual?n.addClass(e,"mceItemVisualAid"):n.removeClass(e,"mceItemVisualAid"),n.addClass(e,"mceItemLayer"))})}function r(n){var r,i,o=[],a=t(e.selection.getNode()),s=-1,l=-1;for(i=[],tinymce.walk(e.getBody(),function(e){1==e.nodeType&&/^(absolute|relative|static)$/i.test(e.style.position)&&i.push(e)},"childNodes"),r=0;r s&&i[r]==a&&(s=r);if(0>n){for(r=0;r -1?(i[s].style.zIndex=o[l],i[l].style.zIndex=o[s]):o[s]>0&&(i[s].style.zIndex=o[s]-1)}else{for(r=0;r o[s]){l=r;break}l>-1?(i[s].style.zIndex=o[l],i[l].style.zIndex=o[s]):i[s].style.zIndex=o[s]+1}e.execCommand("mceRepaint")}function i(){var t=e.dom,n=t.getPos(t.getParent(e.selection.getNode(),"*")),r=e.getBody();e.dom.add(r,"div",{style:{position:"absolute",left:n.x,top:n.y>20?n.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},e.selection.getContent()||e.getLang("layer.content")),tinymce.Env.ie&&t.setHTML(r,r.innerHTML)}function o(){var n=t(e.selection.getNode());n||(n=e.dom.getParent(e.selection.getNode(),"DIV,P,IMG")),n&&("absolute"==n.style.position.toLowerCase()?(e.dom.setStyles(n,{position:"",left:"",top:"",width:"",height:""}),e.dom.removeClass(n,"mceItemVisualAid"),e.dom.removeClass(n,"mceItemLayer")):(n.style.left||(n.style.left="20px"),n.style.top||(n.style.top="20px"),n.style.width||(n.style.width=n.width?n.width+"px":"100px"),n.style.height||(n.style.height=n.height?n.height+"px":"100px"),n.style.position="absolute",e.dom.setAttrib(n,"data-mce-style",""),e.addVisual(e.getBody())),e.execCommand("mceRepaint"),e.nodeChanged())}e.addCommand("mceInsertLayer",i),e.addCommand("mceMoveForward",function(){r(1)}),e.addCommand("mceMoveBackward",function(){r(-1)}),e.addCommand("mceMakeAbsolute",function(){o()}),e.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),e.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),e.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),e.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),e.on("init",function(){tinymce.Env.ie&&e.getDoc().execCommand("2D-Position",!1,!0)}),e.on("mouseup",function(n){var r=t(n.target);r&&e.dom.setAttrib(r,"data-mce-style","")}),e.on("mousedown",function(n){var r,i=n.target,o=e.getDoc();tinymce.Env.gecko&&(t(i)?"on"!==o.designMode&&(o.designMode="on",i=o.body,r=i.parentNode,r.removeChild(i),r.appendChild(i)):"on"==o.designMode&&(o.designMode="off"))}),e.on("NodeChange",n)}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/legacyoutput/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(e){e.on("AddEditor",function(e){e.editor.settings.inline_styles=!1}),e.PluginManager.add("legacyoutput",function(t,n,r){t.on("init",function(){var n="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",r=e.explode(t.settings.font_size_style_values),i=t.schema;t.formatter.register({alignleft:{selector:n,attributes:{align:"left"}},aligncenter:{selector:n,attributes:{align:"center"}},alignright:{selector:n,attributes:{align:"right"}},alignjustify:{selector:n,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(t){return e.inArray(r,t.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),e.each("b,i,u,strike".split(","),function(e){i.addValidElements(e+"[*]")}),i.getElementRule("font")||i.addValidElements("font[face|size|color|style]"),e.each(n.split(","),function(e){var t=i.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})}),t.addButton("fontsizeselect",function(){var e=[],n="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",r=t.settings.fontsize_formats||n;return t.$.each(r.split(" "),function(t,n){var r=n,i=n,o=n.split("=");o.length>1&&(r=o[0],i=o[1]),e.push({text:r,value:i})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:e,fixedWidth:!0,onPostRender:function(){var e=this;t.on("NodeChange",function(){var n;n=t.dom.getParent(t.selection.getNode(),"font"),n?e.value(n.size):e.value("")})},onclick:function(e){e.control.settings.value&&t.execCommand("FontSize",!1,e.control.settings.value)}}}),t.addButton("fontselect",function(){function e(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}var n="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",i=[],o=e(t.settings.font_formats||n);return r.each(o,function(e,t){i.push({text:{raw:t[0]},value:t[1],textStyle:-1==t[1].indexOf("dings")?"font-family:"+t[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:function(){var e=this;t.on("NodeChange",function(){var n;n=t.dom.getParent(t.selection.getNode(),"font"),n?e.value(n.face):e.value("")})},onselect:function(e){e.control.settings.value&&t.execCommand("FontName",!1,e.control.settings.value)}}})})}(tinymce); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/media/moxieplayer.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/plugins/media/moxieplayer.swf -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/nonbreaking/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('nonbreaking', function(editor) { 14 | var setting = editor.getParam('nonbreaking_force_tab'); 15 | 16 | editor.addCommand('mceNonBreaking', function() { 17 | editor.insertContent( 18 | (editor.plugins.visualchars && editor.plugins.visualchars.state) ? 19 | ' ' : ' ' 20 | ); 21 | 22 | editor.dom.setAttrib(editor.dom.select('span.mce-nbsp'), 'data-mce-bogus', '1'); 23 | }); 24 | 25 | editor.addButton('nonbreaking', { 26 | title: 'Nonbreaking space', 27 | cmd: 'mceNonBreaking' 28 | }); 29 | 30 | editor.addMenuItem('nonbreaking', { 31 | text: 'Nonbreaking space', 32 | cmd: 'mceNonBreaking', 33 | context: 'insert' 34 | }); 35 | 36 | if (setting) { 37 | var spaces = +setting > 1 ? +setting : 3; // defaults to 3 spaces if setting is true (or 1) 38 | 39 | editor.on('keydown', function(e) { 40 | if (e.keyCode == 9) { 41 | 42 | if (e.shiftKey) { 43 | return; 44 | } 45 | 46 | e.preventDefault(); 47 | for (var i = 0; i < spaces; i++) { 48 | editor.execCommand('mceNonBreaking'); 49 | } 50 | } 51 | }); 52 | } 53 | }); 54 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/nonbreaking/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("nonbreaking",function(e){var t=e.getParam("nonbreaking_force_tab");if(e.addCommand("mceNonBreaking",function(){e.insertContent(e.plugins.visualchars&&e.plugins.visualchars.state?' ':" "),e.dom.setAttrib(e.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),e.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),e.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),t){var n=+t>1?+t:3;e.on("keydown",function(t){if(9==t.keyCode){if(t.shiftKey)return;t.preventDefault();for(var r=0;n>r;r++)e.execCommand("mceNonBreaking")}})}}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/pagebreak/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('pagebreak', function(editor) { 14 | var pageBreakClass = 'mce-pagebreak', separatorHtml = editor.getParam('pagebreak_separator', ''); 15 | 16 | var pageBreakSeparatorRegExp = new RegExp(separatorHtml.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) { 17 | return '\\' + a; 18 | }), 'gi'); 19 | 20 | var pageBreakPlaceHolderHtml = ' '; 22 | 23 | // Register commands 24 | editor.addCommand('mcePageBreak', function() { 25 | if (editor.settings.pagebreak_split_block) { 26 | editor.insertContent('
' + pageBreakPlaceHolderHtml + '
'); 27 | } else { 28 | editor.insertContent(pageBreakPlaceHolderHtml); 29 | } 30 | }); 31 | 32 | // Register buttons 33 | editor.addButton('pagebreak', { 34 | title: 'Page break', 35 | cmd: 'mcePageBreak' 36 | }); 37 | 38 | editor.addMenuItem('pagebreak', { 39 | text: 'Page break', 40 | icon: 'pagebreak', 41 | cmd: 'mcePageBreak', 42 | context: 'insert' 43 | }); 44 | 45 | editor.on('ResolveName', function(e) { 46 | if (e.target.nodeName == 'IMG' && editor.dom.hasClass(e.target, pageBreakClass)) { 47 | e.name = 'pagebreak'; 48 | } 49 | }); 50 | 51 | editor.on('click', function(e) { 52 | e = e.target; 53 | 54 | if (e.nodeName === 'IMG' && editor.dom.hasClass(e, pageBreakClass)) { 55 | editor.selection.select(e); 56 | } 57 | }); 58 | 59 | editor.on('BeforeSetContent', function(e) { 60 | e.content = e.content.replace(pageBreakSeparatorRegExp, pageBreakPlaceHolderHtml); 61 | }); 62 | 63 | editor.on('PreInit', function() { 64 | editor.serializer.addNodeFilter('img', function(nodes) { 65 | var i = nodes.length, node, className; 66 | 67 | while (i--) { 68 | node = nodes[i]; 69 | className = node.attr('class'); 70 | if (className && className.indexOf('mce-pagebreak') !== -1) { 71 | // Replace parent block node if pagebreak_split_block is enabled 72 | var parentNode = node.parent; 73 | if (editor.schema.getBlockElements()[parentNode.name] && editor.settings.pagebreak_split_block) { 74 | parentNode.type = 3; 75 | parentNode.value = separatorHtml; 76 | parentNode.raw = true; 77 | node.remove(); 78 | continue; 79 | } 80 | 81 | node.type = 3; 82 | node.value = separatorHtml; 83 | node.raw = true; 84 | } 85 | } 86 | }); 87 | }); 88 | }); 89 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/pagebreak/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("pagebreak",function(e){var t="mce-pagebreak",n=e.getParam("pagebreak_separator",""),r=new RegExp(n.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),i='';e.addCommand("mcePageBreak",function(){e.settings.pagebreak_split_block?e.insertContent("
"+i+"
"):e.insertContent(i)}),e.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),e.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),e.on("ResolveName",function(n){"IMG"==n.target.nodeName&&e.dom.hasClass(n.target,t)&&(n.name="pagebreak")}),e.on("click",function(n){n=n.target,"IMG"===n.nodeName&&e.dom.hasClass(n,t)&&e.selection.select(n)}),e.on("BeforeSetContent",function(e){e.content=e.content.replace(r,i)}),e.on("PreInit",function(){e.serializer.addNodeFilter("img",function(t){for(var r,i,o=t.length;o--;)if(r=t[o],i=r.attr("class"),i&&-1!==i.indexOf("mce-pagebreak")){var a=r.parent;if(e.schema.getBlockElements()[a.name]&&e.settings.pagebreak_split_block){a.type=3,a.value=n,a.raw=!0,r.remove();continue}r.type=3,r.value=n,r.raw=!0}})})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/paste/classes/Plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * This class contains the tinymce plugin logic for the paste plugin. 13 | * 14 | * @class tinymce.pasteplugin.Plugin 15 | * @private 16 | */ 17 | define("tinymce/pasteplugin/Plugin", [ 18 | "tinymce/PluginManager", 19 | "tinymce/pasteplugin/Clipboard", 20 | "tinymce/pasteplugin/WordFilter", 21 | "tinymce/pasteplugin/Quirks" 22 | ], function(PluginManager, Clipboard, WordFilter, Quirks) { 23 | var userIsInformed; 24 | 25 | PluginManager.add('paste', function(editor) { 26 | var self = this, clipboard, settings = editor.settings; 27 | 28 | function togglePlainTextPaste() { 29 | if (clipboard.pasteFormat == "text") { 30 | this.active(false); 31 | clipboard.pasteFormat = "html"; 32 | } else { 33 | clipboard.pasteFormat = "text"; 34 | this.active(true); 35 | 36 | if (!userIsInformed) { 37 | editor.windowManager.alert( 38 | 'Paste is now in plain text mode. Contents will now ' + 39 | 'be pasted as plain text until you toggle this option off.' 40 | ); 41 | 42 | userIsInformed = true; 43 | } 44 | } 45 | } 46 | 47 | self.clipboard = clipboard = new Clipboard(editor); 48 | self.quirks = new Quirks(editor); 49 | self.wordFilter = new WordFilter(editor); 50 | 51 | if (editor.settings.paste_as_text) { 52 | self.clipboard.pasteFormat = "text"; 53 | } 54 | 55 | if (settings.paste_preprocess) { 56 | editor.on('PastePreProcess', function(e) { 57 | settings.paste_preprocess.call(self, self, e); 58 | }); 59 | } 60 | 61 | if (settings.paste_postprocess) { 62 | editor.on('PastePostProcess', function(e) { 63 | settings.paste_postprocess.call(self, self, e); 64 | }); 65 | } 66 | 67 | editor.addCommand('mceInsertClipboardContent', function(ui, value) { 68 | if (value.content) { 69 | self.clipboard.pasteHtml(value.content); 70 | } 71 | 72 | if (value.text) { 73 | self.clipboard.pasteText(value.text); 74 | } 75 | }); 76 | 77 | // Block all drag/drop events 78 | if (editor.paste_block_drop) { 79 | editor.on('dragend dragover draggesture dragdrop drop drag', function(e) { 80 | e.preventDefault(); 81 | e.stopPropagation(); 82 | }); 83 | } 84 | 85 | // Prevent users from dropping data images on Gecko 86 | if (!editor.settings.paste_data_images) { 87 | editor.on('drop', function(e) { 88 | var dataTransfer = e.dataTransfer; 89 | 90 | if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) { 91 | e.preventDefault(); 92 | } 93 | }); 94 | } 95 | 96 | editor.addButton('pastetext', { 97 | icon: 'pastetext', 98 | tooltip: 'Paste as text', 99 | onclick: togglePlainTextPaste, 100 | active: self.clipboard.pasteFormat == "text" 101 | }); 102 | 103 | editor.addMenuItem('pastetext', { 104 | text: 'Paste as text', 105 | selectable: true, 106 | active: clipboard.pasteFormat, 107 | onclick: togglePlainTextPaste 108 | }); 109 | }); 110 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/preview/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('preview', function(editor) { 14 | var settings = editor.settings, sandbox = !tinymce.Env.ie; 15 | 16 | editor.addCommand('mcePreview', function() { 17 | editor.windowManager.open({ 18 | title: 'Preview', 19 | width: parseInt(editor.getParam("plugin_preview_width", "650"), 10), 20 | height: parseInt(editor.getParam("plugin_preview_height", "500"), 10), 21 | html: '', 22 | buttons: { 23 | text: 'Close', 24 | onclick: function() { 25 | this.parent().parent().close(); 26 | } 27 | }, 28 | onPostRender: function() { 29 | var previewHtml, headHtml = ''; 30 | 31 | headHtml += ''; 32 | 33 | tinymce.each(editor.contentCSS, function(url) { 34 | headHtml += ''; 35 | }); 36 | 37 | var bodyId = settings.body_id || 'tinymce'; 38 | if (bodyId.indexOf('=') != -1) { 39 | bodyId = editor.getParam('body_id', '', 'hash'); 40 | bodyId = bodyId[editor.id] || bodyId; 41 | } 42 | 43 | var bodyClass = settings.body_class || ''; 44 | if (bodyClass.indexOf('=') != -1) { 45 | bodyClass = editor.getParam('body_class', '', 'hash'); 46 | bodyClass = bodyClass[editor.id] || ''; 47 | } 48 | 49 | var dirAttr = editor.settings.directionality ? ' dir="' + editor.settings.directionality + '"' : ''; 50 | 51 | previewHtml = ( 52 | '' + 53 | '' + 54 | '' + 55 | headHtml + 56 | '' + 57 | '' + 58 | editor.getContent() + 59 | '' + 60 | '' 61 | ); 62 | 63 | if (!sandbox) { 64 | // IE 6-11 doesn't support data uris on iframes 65 | // so I guess they will have to be less secure since we can't sandbox on those 66 | // TODO: Use sandbox if future versions of IE supports iframes with data: uris. 67 | var doc = this.getEl('body').firstChild.contentWindow.document; 68 | doc.open(); 69 | doc.write(previewHtml); 70 | doc.close(); 71 | } else { 72 | this.getEl('body').firstChild.src = 'data:text/html;charset=utf-8,' + encodeURIComponent(previewHtml); 73 | } 74 | } 75 | }); 76 | }); 77 | 78 | editor.addButton('preview', { 79 | title: 'Preview', 80 | cmd: 'mcePreview' 81 | }); 82 | 83 | editor.addMenuItem('preview', { 84 | text: 'Preview', 85 | cmd: 'mcePreview', 86 | context: 'view' 87 | }); 88 | }); 89 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/preview/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("preview",function(e){var t=e.settings,n=!tinymce.Env.ie;e.addCommand("mcePreview",function(){e.windowManager.open({title:"Preview",width:parseInt(e.getParam("plugin_preview_width","650"),10),height:parseInt(e.getParam("plugin_preview_height","500"),10),html:'",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var r,i="";i+=' ',tinymce.each(e.contentCSS,function(t){i+=''});var o=t.body_id||"tinymce";-1!=o.indexOf("=")&&(o=e.getParam("body_id","","hash"),o=o[e.id]||o);var a=t.body_class||"";-1!=a.indexOf("=")&&(a=e.getParam("body_class","","hash"),a=a[e.id]||"");var s=e.settings.directionality?' dir="'+e.settings.directionality+'"':"";if(r=""+i+'"+e.getContent()+"",n)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(r);else{var l=this.getEl("body").firstChild.contentWindow.document;l.open(),l.write(r),l.close()}}})}),e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/print/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('print', function(editor) { 14 | editor.addCommand('mcePrint', function() { 15 | editor.getWin().print(); 16 | }); 17 | 18 | editor.addButton('print', { 19 | title: 'Print', 20 | cmd: 'mcePrint' 21 | }); 22 | 23 | editor.addShortcut('Meta+P', '', 'mcePrint'); 24 | 25 | editor.addMenuItem('print', { 26 | text: 'Print', 27 | cmd: 'mcePrint', 28 | icon: 'print', 29 | shortcut: 'Meta+P', 30 | context: 'file' 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/print/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("print",function(e){e.addCommand("mcePrint",function(){e.getWin().print()}),e.addButton("print",{title:"Print",cmd:"mcePrint"}),e.addShortcut("Meta+P","","mcePrint"),e.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Meta+P",context:"file"})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/save/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('save', function(editor) { 14 | function save() { 15 | var formObj; 16 | 17 | formObj = tinymce.DOM.getParent(editor.id, 'form'); 18 | 19 | if (editor.getParam("save_enablewhendirty", true) && !editor.isDirty()) { 20 | return; 21 | } 22 | 23 | tinymce.triggerSave(); 24 | 25 | // Use callback instead 26 | if (editor.getParam("save_onsavecallback")) { 27 | if (editor.execCallback('save_onsavecallback', editor)) { 28 | editor.startContent = tinymce.trim(editor.getContent({format: 'raw'})); 29 | editor.nodeChanged(); 30 | } 31 | 32 | return; 33 | } 34 | 35 | if (formObj) { 36 | editor.isNotDirty = true; 37 | 38 | if (!formObj.onsubmit || formObj.onsubmit()) { 39 | if (typeof formObj.submit == "function") { 40 | formObj.submit(); 41 | } else { 42 | editor.windowManager.alert("Error: Form submit field collision."); 43 | } 44 | } 45 | 46 | editor.nodeChanged(); 47 | } else { 48 | editor.windowManager.alert("Error: No form element found."); 49 | } 50 | } 51 | 52 | function cancel() { 53 | var h = tinymce.trim(editor.startContent); 54 | 55 | // Use callback instead 56 | if (editor.getParam("save_oncancelcallback")) { 57 | editor.execCallback('save_oncancelcallback', editor); 58 | return; 59 | } 60 | 61 | editor.setContent(h); 62 | editor.undoManager.clear(); 63 | editor.nodeChanged(); 64 | } 65 | 66 | function stateToggle() { 67 | var self = this; 68 | 69 | editor.on('nodeChange', function() { 70 | self.disabled(editor.getParam("save_enablewhendirty", true) && !editor.isDirty()); 71 | }); 72 | } 73 | 74 | editor.addCommand('mceSave', save); 75 | editor.addCommand('mceCancel', cancel); 76 | 77 | editor.addButton('save', { 78 | icon: 'save', 79 | text: 'Save', 80 | cmd: 'mceSave', 81 | disabled: true, 82 | onPostRender: stateToggle 83 | }); 84 | 85 | editor.addButton('cancel', { 86 | text: 'Cancel', 87 | icon: false, 88 | cmd: 'mceCancel', 89 | disabled: true, 90 | onPostRender: stateToggle 91 | }); 92 | 93 | editor.addShortcut('Meta+S', '', 'mceSave'); 94 | }); 95 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/save/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("save",function(e){function t(){var t;return t=tinymce.DOM.getParent(e.id,"form"),!e.getParam("save_enablewhendirty",!0)||e.isDirty()?(tinymce.triggerSave(),e.getParam("save_onsavecallback")?void(e.execCallback("save_onsavecallback",e)&&(e.startContent=tinymce.trim(e.getContent({format:"raw"})),e.nodeChanged())):void(t?(e.isNotDirty=!0,(!t.onsubmit||t.onsubmit())&&("function"==typeof t.submit?t.submit():e.windowManager.alert("Error: Form submit field collision.")),e.nodeChanged()):e.windowManager.alert("Error: No form element found."))):void 0}function n(){var t=tinymce.trim(e.startContent);return e.getParam("save_oncancelcallback")?void e.execCallback("save_oncancelcallback",e):(e.setContent(t),e.undoManager.clear(),void e.nodeChanged())}function r(){var t=this;e.on("nodeChange",function(){t.disabled(e.getParam("save_enablewhendirty",!0)&&!e.isDirty())})}e.addCommand("mceSave",t),e.addCommand("mceCancel",n),e.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:r}),e.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:r}),e.addShortcut("Meta+S","","mceSave")}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/tabfocus/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('tabfocus', function(editor) { 14 | var DOM = tinymce.DOM, each = tinymce.each, explode = tinymce.explode; 15 | 16 | function tabCancel(e) { 17 | if (e.keyCode === 9 && !e.ctrlKey && !e.altKey && !e.metaKey) { 18 | e.preventDefault(); 19 | } 20 | } 21 | 22 | function tabHandler(e) { 23 | var x, el, v, i; 24 | 25 | if (e.keyCode !== 9 || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) { 26 | return; 27 | } 28 | 29 | function find(direction) { 30 | el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); 31 | 32 | function canSelectRecursive(e) { 33 | return e.nodeName === "BODY" || (e.type != 'hidden' && 34 | e.style.display != "none" && 35 | e.style.visibility != "hidden" && canSelectRecursive(e.parentNode)); 36 | } 37 | 38 | function canSelect(el) { 39 | return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && tinymce.get(e.id) && el.tabIndex != -1 && canSelectRecursive(el); 40 | } 41 | 42 | each(el, function(e, i) { 43 | if (e.id == editor.id) { 44 | x = i; 45 | return false; 46 | } 47 | }); 48 | if (direction > 0) { 49 | for (i = x + 1; i < el.length; i++) { 50 | if (canSelect(el[i])) { 51 | return el[i]; 52 | } 53 | } 54 | } else { 55 | for (i = x - 1; i >= 0; i--) { 56 | if (canSelect(el[i])) { 57 | return el[i]; 58 | } 59 | } 60 | } 61 | 62 | return null; 63 | } 64 | 65 | v = explode(editor.getParam('tab_focus', editor.getParam('tabfocus_elements', ':prev,:next'))); 66 | 67 | if (v.length == 1) { 68 | v[1] = v[0]; 69 | v[0] = ':prev'; 70 | } 71 | 72 | // Find element to focus 73 | if (e.shiftKey) { 74 | if (v[0] == ':prev') { 75 | el = find(-1); 76 | } else { 77 | el = DOM.get(v[0]); 78 | } 79 | } else { 80 | if (v[1] == ':next') { 81 | el = find(1); 82 | } else { 83 | el = DOM.get(v[1]); 84 | } 85 | } 86 | 87 | if (el) { 88 | var focusEditor = tinymce.get(el.id || el.name); 89 | 90 | if (el.id && focusEditor) { 91 | focusEditor.focus(); 92 | } else { 93 | window.setTimeout(function() { 94 | if (!tinymce.Env.webkit) { 95 | window.focus(); 96 | } 97 | 98 | el.focus(); 99 | }, 10); 100 | } 101 | 102 | e.preventDefault(); 103 | } 104 | } 105 | 106 | editor.on('init', function() { 107 | if (editor.inline) { 108 | // Remove default tabIndex in inline mode 109 | tinymce.DOM.setAttrib(editor.getBody(), 'tabIndex', null); 110 | } 111 | 112 | editor.on('keyup', tabCancel); 113 | 114 | if (tinymce.Env.gecko) { 115 | editor.on('keypress keydown', tabHandler); 116 | } else { 117 | editor.on('keydown', tabHandler); 118 | } 119 | }); 120 | }); 121 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/tabfocus/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("tabfocus",function(e){function t(e){9!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}function n(t){function n(n){function o(e){return"BODY"===e.nodeName||"hidden"!=e.type&&"none"!=e.style.display&&"hidden"!=e.style.visibility&&o(e.parentNode)}function l(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&tinymce.get(t.id)&&-1!=e.tabIndex&&o(e)}if(s=r.select(":input:enabled,*[tabindex]:not(iframe)"),i(s,function(t,n){return t.id==e.id?(a=n,!1):void 0}),n>0){for(c=a+1;c =0;c--)if(l(s[c]))return s[c];return null}var a,s,l,c;if(!(9!==t.keyCode||t.ctrlKey||t.altKey||t.metaKey||t.isDefaultPrevented())&&(l=o(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==l.length&&(l[1]=l[0],l[0]=":prev"),s=t.shiftKey?":prev"==l[0]?n(-1):r.get(l[0]):":next"==l[1]?n(1):r.get(l[1]))){var u=tinymce.get(s.id||s.name);s.id&&u?u.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),s.focus()},10),t.preventDefault()}}var r=tinymce.DOM,i=tinymce.each,o=tinymce.explode;e.on("init",function(){e.inline&&tinymce.DOM.setAttrib(e.getBody(),"tabIndex",null),e.on("keyup",t),tinymce.Env.gecko?e.on("keypress keydown",n):e.on("keydown",n)})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/table/classes/Utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Utils.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * Various utility functions. 13 | * 14 | * @class tinymce.tableplugin.Utils 15 | * @private 16 | */ 17 | define("tinymce/tableplugin/Utils", [ 18 | "tinymce/Env" 19 | ], function(Env) { 20 | function getSpanVal(td, name) { 21 | return parseInt(td.getAttribute(name) || 1, 10); 22 | } 23 | 24 | function paddCell(cell) { 25 | if (!Env.ie || Env.ie > 10) { 26 | cell.innerHTML = '
'; 27 | } 28 | } 29 | 30 | return { 31 | getSpanVal: getSpanVal, 32 | paddCell: paddCell 33 | }; 34 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/textpattern/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("textpattern",function(e){function t(){return c&&(l.sort(function(e,t){return e.start.length>t.start.length?-1:e.start.length' + value + '
1 51 | 2 52 | 3 53 | 4 54 | 5 55 | 6 56 | 7 | 1× 57 | 58 | 1× 59 | 60 | 61 | 62 | | import request from './request' 63 | 64 | export function getUserList (params) { 65 | return request.get('/user/list.do', params) 66 | } 67 | 68 | |
1 47 | 2 48 | 3 49 | 4 50 | 5 51 | 6 52 | 7 53 | 8 54 | 9 55 | 10 56 | 11 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | | // 67 | // 68 | // 69 | // 70 | // 71 | 72 | export default { 73 | name: 'index' 74 | } 75 | 76 | |