├── .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 | ![搜索页](https://raw.githubusercontent.com/lynzz/element-admin/master/screenshot/search.jpg) 40 | 41 | ### 编辑器页 42 | 43 | ![带有编辑器的表单页](https://raw.githubusercontent.com/lynzz/element-admin/master/screenshot/form.jpg) 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 | Vue admin with element-ui 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /template/mock/user/list.do.js: -------------------------------------------------------------------------------- 1 | var Mock = require('mockjs') 2 | 3 | module.exports = function (req, res, next) { 4 | var data = { 5 | 'result': 'success', 6 | 'messages': [], 7 | 'fieldErrors': {}, 8 | 'errors': [], 9 | 'data': { 10 | totalCount: 30, 11 | pageNo: req.query.pageNo, 12 | pageSize: req.query.pageSize, 13 | 'listData|10': [{ 14 | id: '@id', 15 | 'name': '@name', 16 | address: '@county(true)', 17 | 'role': '普通用户' 18 | }] 19 | } 20 | } 21 | data = JSON.stringify(Mock.mock(data)) 22 | 23 | res.end(data) 24 | } 25 | -------------------------------------------------------------------------------- /template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "description": "{{description}}", 5 | "author": "{{author}}", 6 | "private": true, 7 | "scripts": { 8 | "dev": "supervisor -w mock build/dev-server.js", 9 | "build": "node build/build.js"{{#unit}}, 10 | "unit": "karma start test/unit/karma.conf.js --single-run"{{/unit}}{{#e2e}}, 11 | "e2e": "node test/e2e/runner.js"{{/e2e}}{{#if_or unit e2e}}, 12 | "test": "{{#unit}}npm run unit{{/unit}}{{#unit}}{{#e2e}} && {{/e2e}}{{/unit}}{{#e2e}}npm run e2e{{/e2e}}"{{/if_or}}, 13 | "lint": "eslint --ext .js,.vue src{{#unit}} test/unit/specs{{/unit}}{{#e2e}} test/e2e/specs{{/e2e}}" 14 | }, 15 | "dependencies": { 16 | "axios": "^0.15.3", 17 | "element-ui": "^1.0.8", 18 | "vue": "2.0.5", 19 | "vue-router": "^2.0.2", 20 | "vuex": "^2.0.0" 21 | }, 22 | "devDependencies": { 23 | "autoprefixer": "^6.4.0", 24 | "babel-core": "^6.0.0", 25 | "babel-eslint": "^7.0.0", 26 | "babel-loader": "^6.0.0", 27 | "babel-plugin-component": "^0.6.0", 28 | "babel-plugin-transform-runtime": "^6.0.0", 29 | "babel-preset-es2015": "^6.0.0", 30 | "babel-preset-stage-2": "^6.0.0", 31 | "babel-register": "^6.0.0", 32 | "chalk": "^1.1.3", 33 | "connect-history-api-fallback": "^1.1.0", 34 | "css-loader": "^0.25.0", 35 | "element-theme-default": "^1.0.5", 36 | "eslint": "^3.7.1", 37 | "eslint-config-standard": "^6.1.0", 38 | "eslint-plugin-promise": "^3.4.0", 39 | "eslint-plugin-standard": "^2.0.1", 40 | "eslint-friendly-formatter": "^2.0.5", 41 | "eslint-loader": "^1.5.0", 42 | "eslint-plugin-html": "^1.3.0", 43 | "eventsource-polyfill": "^0.9.6", 44 | "express": "^4.13.3", 45 | "extract-text-webpack-plugin": "^1.0.1", 46 | "file-loader": "^0.9.0", 47 | "function-bind": "^1.0.2", 48 | "html-webpack-plugin": "^2.8.1", 49 | "http-proxy-middleware": "^0.17.2", 50 | "json-loader": "^0.5.4", 51 | {{#unit}} 52 | "karma": "^1.3.0", 53 | "karma-coverage": "^1.1.1", 54 | "karma-mocha": "^1.2.0", 55 | "karma-phantomjs-launcher": "^1.0.0", 56 | "karma-sinon-chai": "^1.2.0", 57 | "karma-sourcemap-loader": "^0.3.7", 58 | "karma-spec-reporter": "0.0.26", 59 | "karma-webpack": "^1.7.0", 60 | "lolex": "^1.4.0", 61 | "mocha": "^3.1.0", 62 | "chai": "^3.5.0", 63 | "sinon": "^1.17.3", 64 | "sinon-chai": "^2.8.0", 65 | "inject-loader": "^2.0.1", 66 | "isparta-loader": "^2.0.0", 67 | "phantomjs-prebuilt": "^2.1.3", 68 | {{/unit}} 69 | "less": "^2.7.1", 70 | "less-loader": "^2.2.3", 71 | "mocha": "^3.2.0", 72 | "mockjs": "^1.0.0", 73 | "opn": "^4.0.2", 74 | "ora": "^0.3.0", 75 | {{#e2e}} 76 | "chromedriver": "^2.21.2", 77 | "cross-spawn": "^4.0.2", 78 | "nightwatch": "^0.9.8", 79 | "selenium-server": "2.53.1", 80 | {{/e2e}} 81 | "semver": "^5.3.0", 82 | "shelljs": "^0.7.4", 83 | "supervisor": "^0.12.0", 84 | "url-loader": "^0.5.7", 85 | "vue-loader": "^10.0.0", 86 | "vue-style-loader": "^1.0.0", 87 | "vue-template-compiler": "2.0.5", 88 | "walk": "^2.3.9", 89 | "webpack": "^1.13.2", 90 | "webpack-dev-middleware": "^1.8.3", 91 | "webpack-hot-middleware": "^2.12.2", 92 | "webpack-merge": "^0.14.1" 93 | }, 94 | "engines": { 95 | "node": ">= 4.0.0", 96 | "npm": ">= 3.0.0" 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /template/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /template/src/api/request.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | 3 | const handleStatus = (res) => { 4 | return res.data 5 | } 6 | const handleResponse = (res) => { 7 | if (res.result === 'success') { 8 | return Promise.resolve(res.data) 9 | } else { 10 | return Promise.reject(res) 11 | } 12 | } 13 | export default { 14 | get (url, params) { 15 | let queryString = [] 16 | 17 | Object.keys(params).forEach(key => params[key] && queryString.push(`${key}=${params[key]}`)) 18 | if (queryString.length > 0) { 19 | queryString = queryString.join('&') 20 | url += `?${queryString}` 21 | } 22 | 23 | return axios 24 | .get(url) 25 | .then(handleStatus) 26 | .then(handleResponse) 27 | .catch(error => { 28 | console.log(error) 29 | }) 30 | }, 31 | 32 | post (url, params) { 33 | return axios 34 | .post(url, params) 35 | .then(handleStatus) 36 | .then(handleResponse) 37 | .catch(error => { 38 | console.log(error) 39 | }) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /template/src/api/user.js: -------------------------------------------------------------------------------- 1 | import request from './request' 2 | 3 | export function getUserList (params) { 4 | return request.get('/user/list.do', params) 5 | } 6 | -------------------------------------------------------------------------------- /template/src/assets/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/src/assets/avatar.jpg -------------------------------------------------------------------------------- /template/src/auth.js: -------------------------------------------------------------------------------- 1 | /* globals localStorage */ 2 | function pretendRequest (email, pass, cb) { 3 | setTimeout(() => { 4 | if (email === 'admin' && pass === 'admin') { 5 | cb({ 6 | authenticated: true, 7 | token: Math.random().toString(36).substring(7) 8 | }) 9 | } else { 10 | cb({ authenticated: false }) 11 | } 12 | }, 0) 13 | } 14 | 15 | export default { 16 | login (email, pass, cb) { 17 | /* eslint no-param-reassign:0 */ 18 | /* eslint prefer-rest-params:0 */ 19 | cb = arguments[arguments.length - 1] 20 | if (localStorage.token) { 21 | if (cb) cb(true) 22 | this.onChange(true) 23 | return 24 | } 25 | pretendRequest(email, pass, (res) => { 26 | if (res.authenticated) { 27 | localStorage.token = res.token 28 | if (cb) cb(true) 29 | this.onChange(true) 30 | } else { 31 | if (cb) cb(false) 32 | this.onChange(false) 33 | } 34 | }) 35 | }, 36 | 37 | getToken () { 38 | return localStorage.token 39 | }, 40 | 41 | logout (cb) { 42 | delete localStorage.token 43 | if (cb) cb() 44 | this.onChange(false) 45 | }, 46 | 47 | loggedIn () { 48 | return !!localStorage.token 49 | }, 50 | 51 | onChange () {} 52 | } 53 | -------------------------------------------------------------------------------- /template/src/components/Editor.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 68 | -------------------------------------------------------------------------------- /template/src/components/Sider.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/src/components/Sider.vue -------------------------------------------------------------------------------- /template/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import ElementUI from 'element-ui' 3 | import VueRouter from 'vue-router' 4 | 5 | import 'element-ui/lib/theme-default/index.css' 6 | 7 | import auth from './auth' 8 | import App from './App' 9 | 10 | import Layout from './components/Layout' 11 | import Search from './components/Search' 12 | import Editor from './components/Editor' 13 | 14 | import routes from './router-config' 15 | 16 | Vue.component(Layout.name, Layout) 17 | Vue.component(Search.name, Search) 18 | Vue.component(Editor.name, Editor) 19 | 20 | Vue.use(ElementUI) 21 | Vue.use(VueRouter) 22 | 23 | const router = new VueRouter({ 24 | mode: 'hash', 25 | base: __dirname, 26 | routes 27 | }) 28 | 29 | router.beforeEach((to, from, next) => { 30 | if (!auth.loggedIn() && to.name !== 'login') { 31 | next({ 32 | path: '/login', 33 | query: { redirect: to.fullPath } 34 | }) 35 | } else { 36 | next() 37 | } 38 | }) 39 | 40 | /* eslint-disable no-new */ 41 | new Vue({ 42 | el: '#app', 43 | template: '', 44 | router, 45 | components: { App } 46 | }) 47 | -------------------------------------------------------------------------------- /template/src/nav-config.js: -------------------------------------------------------------------------------- 1 | const nav = [ 2 | { 3 | name: 'demo', 4 | text: '演示', 5 | icon: 'gear', 6 | path: '/user', 7 | children: [ 8 | { 9 | name: 'user', 10 | path: '/user', 11 | icon: 'user', 12 | text: '用户管理' 13 | }, { 14 | name: 'editor', 15 | path: '/editor', 16 | icon: 'file', 17 | text: '富文本' 18 | } 19 | ] 20 | } 21 | ] 22 | export default nav 23 | -------------------------------------------------------------------------------- /template/src/router-config.js: -------------------------------------------------------------------------------- 1 | import nav from './nav-config' 2 | import auth from './auth' 3 | 4 | const loginSuccess = (to, from, next) => { 5 | if (auth.loggedIn()) { 6 | next({ 7 | path: '/' 8 | }) 9 | } else { 10 | next() 11 | } 12 | } 13 | const getComponent = name => require(`./views/${name}.vue`) 14 | 15 | const routers = [ 16 | { path: '/', component: require('./views/index') }, 17 | { path: '/login', name: 'login', component: require('./views/login'), beforeEnter: loginSuccess } 18 | ] 19 | 20 | nav.forEach((mod) => { 21 | const subMenus = mod.children 22 | 23 | subMenus.forEach((subMenu) => { 24 | routers.push({ 25 | path: subMenu.path, 26 | name: subMenu.name, 27 | component: getComponent(subMenu.name) 28 | }) 29 | }) 30 | }) 31 | 32 | routers.push({ 33 | path: '*', 34 | name: 'notfound', 35 | component: require('./views/notfound') 36 | }) 37 | 38 | export default routers 39 | -------------------------------------------------------------------------------- /template/src/views/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /template/src/views/login.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 69 | 70 | 71 | 108 | -------------------------------------------------------------------------------- /template/src/views/notfound.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 23 | -------------------------------------------------------------------------------- /template/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/.gitkeep -------------------------------------------------------------------------------- /template/static/js/tinymce/langs/readme.md: -------------------------------------------------------------------------------- 1 | This is where language files should be placed. 2 | 3 | Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ 4 | -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/advlist/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('advlist', function(editor) { 14 | var olMenuItems, ulMenuItems, lastStyles = {}; 15 | 16 | function buildMenuItems(listName, styleValues) { 17 | var items = []; 18 | 19 | tinymce.each(styleValues.split(/[ ,]/), function(styleValue) { 20 | items.push({ 21 | text: styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function(chr) { 22 | return chr.toUpperCase(); 23 | }), 24 | data: styleValue == 'default' ? '' : styleValue 25 | }); 26 | }); 27 | 28 | return items; 29 | } 30 | 31 | olMenuItems = buildMenuItems('OL', editor.getParam( 32 | "advlist_number_styles", 33 | "default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman" 34 | )); 35 | 36 | ulMenuItems = buildMenuItems('UL', editor.getParam("advlist_bullet_styles", "default,circle,disc,square")); 37 | 38 | function applyListFormat(listName, styleValue) { 39 | editor.undoManager.transact(function() { 40 | var list, dom = editor.dom, sel = editor.selection; 41 | 42 | // Check for existing list element 43 | list = dom.getParent(sel.getNode(), 'ol,ul'); 44 | 45 | // Switch/add list type if needed 46 | if (!list || list.nodeName != listName || styleValue === false) { 47 | editor.execCommand(listName == 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList'); 48 | } 49 | 50 | // Set style 51 | styleValue = styleValue === false ? lastStyles[listName] : styleValue; 52 | lastStyles[listName] = styleValue; 53 | 54 | list = dom.getParent(sel.getNode(), 'ol,ul'); 55 | if (list) { 56 | dom.setStyle(list, 'listStyleType', styleValue ? styleValue : null); 57 | list.removeAttribute('data-mce-style'); 58 | } 59 | 60 | editor.focus(); 61 | }); 62 | } 63 | 64 | function updateSelection(e) { 65 | var listStyleType = editor.dom.getStyle(editor.dom.getParent(editor.selection.getNode(), 'ol,ul'), 'listStyleType') || ''; 66 | 67 | e.control.items().each(function(ctrl) { 68 | ctrl.active(ctrl.settings.data === listStyleType); 69 | }); 70 | } 71 | 72 | editor.addButton('numlist', { 73 | type: 'splitbutton', 74 | tooltip: 'Numbered list', 75 | menu: olMenuItems, 76 | onshow: updateSelection, 77 | onselect: function(e) { 78 | applyListFormat('OL', e.control.settings.data); 79 | }, 80 | onclick: function() { 81 | applyListFormat('OL', false); 82 | } 83 | }); 84 | 85 | editor.addButton('bullist', { 86 | type: 'splitbutton', 87 | tooltip: 'Bullet list', 88 | menu: ulMenuItems, 89 | onshow: updateSelection, 90 | onselect: function(e) { 91 | applyListFormat('UL', e.control.settings.data); 92 | }, 93 | onclick: function() { 94 | applyListFormat('UL', false); 95 | } 96 | }); 97 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/advlist/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("advlist",function(e){function t(e,t){var n=[];return tinymce.each(t.split(/[ ,]/),function(e){n.push({text:e.replace(/\-/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),data:"default"==e?"":e})}),n}function n(t,n){e.undoManager.transact(function(){var r,i=e.dom,o=e.selection;r=i.getParent(o.getNode(),"ol,ul"),r&&r.nodeName==t&&n!==!1||e.execCommand("UL"==t?"InsertUnorderedList":"InsertOrderedList"),n=n===!1?a[t]:n,a[t]=n,r=i.getParent(o.getNode(),"ol,ul"),r&&(i.setStyle(r,"listStyleType",n?n:null),r.removeAttribute("data-mce-style")),e.focus()})}function r(t){var n=e.dom.getStyle(e.dom.getParent(e.selection.getNode(),"ol,ul"),"listStyleType")||"";t.control.items().each(function(e){e.active(e.settings.data===n)})}var i,o,a={};i=t("OL",e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),o=t("UL",e.getParam("advlist_bullet_styles","default,circle,disc,square")),e.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:i,onshow:r,onselect:function(e){n("OL",e.control.settings.data)},onclick:function(){n("OL",!1)}}),e.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:o,onshow:r,onselect:function(e){n("UL",e.control.settings.data)},onclick:function(){n("UL",!1)}})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/anchor/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('anchor', function(editor) { 14 | function showDialog() { 15 | var selectedNode = editor.selection.getNode(), name = ''; 16 | var isAnchor = selectedNode.tagName == 'A' && editor.dom.getAttrib(selectedNode, 'href') === ''; 17 | 18 | if (isAnchor) { 19 | name = selectedNode.name || selectedNode.id || ''; 20 | } 21 | 22 | editor.windowManager.open({ 23 | title: 'Anchor', 24 | body: {type: 'textbox', name: 'name', size: 40, label: 'Name', value: name}, 25 | onsubmit: function(e) { 26 | var id = e.data.name; 27 | 28 | if (isAnchor) { 29 | selectedNode.id = id; 30 | } else { 31 | editor.selection.collapse(true); 32 | editor.execCommand('mceInsertContent', false, editor.dom.createHTML('a', { 33 | id: id 34 | })); 35 | } 36 | } 37 | }); 38 | } 39 | 40 | editor.addCommand('mceAnchor', showDialog); 41 | 42 | editor.addButton('anchor', { 43 | icon: 'anchor', 44 | tooltip: 'Anchor', 45 | onclick: showDialog, 46 | stateSelector: 'a:not([href])' 47 | }); 48 | 49 | editor.addMenuItem('anchor', { 50 | icon: 'anchor', 51 | text: 'Anchor', 52 | context: 'insert', 53 | onclick: showDialog 54 | }); 55 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/anchor/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("anchor",function(e){function t(){var t=e.selection.getNode(),n="",r="A"==t.tagName&&""===e.dom.getAttrib(t,"href");r&&(n=t.name||t.id||""),e.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:n},onsubmit:function(n){var i=n.data.name;r?t.id=i:(e.selection.collapse(!0),e.execCommand("mceInsertContent",!1,e.dom.createHTML("a",{id:i})))}})}e.addCommand("mceAnchor",t),e.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:t,stateSelector:"a:not([href])"}),e.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:t})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/autolink/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("autolink",function(e){function t(e){i(e,-1,"(",!0)}function n(e){i(e,0,"",!0)}function r(e){i(e,-1,"",!1)}function i(e,t,n){function r(e,t){if(0>t&&(t=0),3==e.nodeType){var n=e.data.length;t>n&&(t=n)}return t}function i(e,t){1!=e.nodeType||e.hasChildNodes()?a.setStart(e,r(e,t)):a.setStartBefore(e)}function o(e,t){1!=e.nodeType||e.hasChildNodes()?a.setEnd(e,r(e,t)):a.setEndAfter(e)}var a,s,l,c,u,d,f,h,p,m;if("A"!=e.selection.getNode().tagName){if(a=e.selection.getRng(!0).cloneRange(),a.startOffset<5){if(h=a.endContainer.previousSibling,!h){if(!a.endContainer.firstChild||!a.endContainer.firstChild.nextSibling)return;h=a.endContainer.firstChild.nextSibling}if(p=h.length,i(h,p),o(h,p),a.endOffset<5)return;s=a.endOffset,c=h}else{if(c=a.endContainer,3!=c.nodeType&&c.firstChild){for(;3!=c.nodeType&&c.firstChild;)c=c.firstChild;3==c.nodeType&&(i(c,0),o(c,c.nodeValue.length))}s=1==a.endOffset?2:a.endOffset-1-t}l=s;do i(c,s>=2?s-2:0),o(c,s>=1?s-1:0),s-=1,m=a.toString();while(" "!=m&&""!==m&&160!=m.charCodeAt(0)&&s-2>=0&&m!=n);a.toString()==n||160==a.toString().charCodeAt(0)?(i(c,s),o(c,l),s+=1):0===a.startOffset?(i(c,0),o(c,l)):(i(c,s),o(c,l)),d=a.toString(),"."==d.charAt(d.length-1)&&o(c,l-1),d=a.toString(),f=d.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),f&&("www."==f[1]?f[1]="http://www.":/@$/.test(f[1])&&!/^mailto:/.test(f[1])&&(f[1]="mailto:"+f[1]),u=e.selection.getBookmark(),e.selection.setRng(a),e.execCommand("createlink",!1,f[1]+f[2]),e.selection.moveToBookmark(u),e.nodeChanged())}}var o;return e.on("keydown",function(t){return 13==t.keyCode?r(e):void 0}),tinymce.Env.ie?void e.on("focus",function(){if(!o){o=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}}):(e.on("keypress",function(n){return 41==n.keyCode?t(e):void 0}),void e.on("keyup",function(t){return 32==t.keyCode?n(e):void 0}))}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/autoresize/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("autoresize",function(e){function t(){return e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()}function n(r){var a,s,l,c,u,d,f,h,p,m,g,v,y=tinymce.DOM;if(s=e.getDoc()){if(l=s.body,c=s.documentElement,u=i.autoresize_min_height,!l||r&&"setcontent"===r.type&&r.initial||t())return void(l&&c&&(l.style.overflowY="auto",c.style.overflowY="auto"));f=e.dom.getStyle(l,"margin-top",!0),h=e.dom.getStyle(l,"margin-bottom",!0),p=e.dom.getStyle(l,"padding-top",!0),m=e.dom.getStyle(l,"padding-bottom",!0),g=e.dom.getStyle(l,"border-top-width",!0),v=e.dom.getStyle(l,"border-bottom-width",!0),d=l.offsetHeight+parseInt(f,10)+parseInt(h,10)+parseInt(p,10)+parseInt(m,10)+parseInt(g,10)+parseInt(v,10),(isNaN(d)||0>=d)&&(d=tinymce.Env.ie?l.scrollHeight:tinymce.Env.webkit&&0===l.clientHeight?0:l.offsetHeight),d>i.autoresize_min_height&&(u=d),i.autoresize_max_height&&d>i.autoresize_max_height?(u=i.autoresize_max_height,l.style.overflowY="auto",c.style.overflowY="auto"):(l.style.overflowY="hidden",c.style.overflowY="hidden",l.scrollTop=0),u!==o&&(a=u-o,y.setStyle(e.iframeElement,"height",u+"px"),o=u,tinymce.isWebKit&&0>a&&n(r))}}function r(e,t,i){setTimeout(function(){n({}),e--?r(e,t,i):i&&i()},t)}var i=e.settings,o=0;e.settings.inline||(i.autoresize_min_height=parseInt(e.getParam("autoresize_min_height",e.getElement().offsetHeight),10),i.autoresize_max_height=parseInt(e.getParam("autoresize_max_height",0),10),e.on("init",function(){var t,n;t=e.getParam("autoresize_overflow_padding",1),n=e.getParam("autoresize_bottom_margin",50),t!==!1&&e.dom.setStyles(e.getBody(),{paddingLeft:t,paddingRight:t}),n!==!1&&e.dom.setStyles(e.getBody(),{paddingBottom:n})}),e.on("nodechange setcontent keyup FullscreenStateChanged",n),e.getParam("autoresize_on_init",!0)&&e.on("init",function(){r(20,100,function(){r(5,1e3)})}),e.addCommand("mceAutoResize",n))}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/autosave/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce._beforeUnloadHandler=function(){var e;return tinymce.each(tinymce.editors,function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e},tinymce.PluginManager.add("autosave",function(e){function t(e,t){var n={s:1e3,m:6e4};return e=/^(\d+)([ms]?)$/.exec(""+(e||t)),(e[2]?n[e[2]]:1)*parseInt(e,10)}function n(){var e=parseInt(h.getItem(u+"time"),10)||0;return(new Date).getTime()-e>f.autosave_retention?(r(!1),!1):!0}function r(t){h.removeItem(u+"draft"),h.removeItem(u+"time"),t!==!1&&e.fire("RemoveDraft")}function i(){!c()&&e.isDirty()&&(h.setItem(u+"draft",e.getContent({format:"raw",no_events:!0})),h.setItem(u+"time",(new Date).getTime()),e.fire("StoreDraft"))}function o(){n()&&(e.setContent(h.getItem(u+"draft"),{format:"raw"}),e.fire("RestoreDraft"))}function a(){d||(setInterval(function(){e.removed||i()},f.autosave_interval),d=!0)}function s(){var t=this;t.disabled(!n()),e.on("StoreDraft RestoreDraft RemoveDraft",function(){t.disabled(!n())}),a()}function l(){e.undoManager.beforeChange(),o(),r(),e.undoManager.add()}function c(t){var n=e.settings.forced_root_block;return t=tinymce.trim("undefined"==typeof t?e.getBody().innerHTML:t),""===t||new RegExp("^<"+n+"[^>]*>((\xa0| |[ ]|]*>)+?|)|
$","i").test(t)}var u,d,f=e.settings,h=tinymce.util.LocalStorage;u=f.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-",u=u.replace(/\{path\}/g,document.location.pathname),u=u.replace(/\{query\}/g,document.location.search),u=u.replace(/\{id\}/g,e.id),f.autosave_interval=t(f.autosave_interval,"30s"),f.autosave_retention=t(f.autosave_retention,"20m"),e.addButton("restoredraft",{title:"Restore last draft",onclick:l,onPostRender:s}),e.addMenuItem("restoredraft",{text:"Restore last draft",onclick:l,onPostRender:s,context:"file"}),e.settings.autosave_restore_when_empty!==!1&&(e.on("init",function(){n()&&c()&&o()}),e.on("saveContent",function(){r()})),window.onbeforeunload=tinymce._beforeUnloadHandler,this.hasDraft=n,this.storeDraft=i,this.restoreDraft=o,this.removeDraft=r,this.isEmpty=c}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/bbcode/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(e){var t=this,n=e.getParam("bbcode_dialect","punbb").toLowerCase();e.on("beforeSetContent",function(e){e.content=t["_"+n+"_bbcode2html"](e.content)}),e.on("postProcess",function(e){e.set&&(e.content=t["_"+n+"_bbcode2html"](e.content)),e.get&&(e.content=t["_"+n+"_html2bbcode"](e.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Ephox Corp",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"),t(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),t(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),t(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),t(/(.*?)<\/font>/gi,"$1"),t(//gi,"[img]$1[/img]"),t(/(.*?)<\/span>/gi,"[code]$1[/code]"),t(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),t(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),t(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),t(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),t(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),t(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),t(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),t(/<\/(strong|b)>/gi,"[/b]"),t(/<(strong|b)>/gi,"[b]"),t(/<\/(em|i)>/gi,"[/i]"),t(/<(em|i)>/gi,"[i]"),t(/<\/u>/gi,"[/u]"),t(/(.*?)<\/span>/gi,"[u]$1[/u]"),t(//gi,"[u]"),t(/]*>/gi,"[quote]"),t(/<\/blockquote>/gi,"[/quote]"),t(/
/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'; 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 | '' + linkElm.getAttribute('data-mce-alt') + '' 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+="",tinymce.each(n,function(n){var r=t+"/img/smiley-"+n+".gif";e+=''}),e+=""}),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(''+n.getAttribute('),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;rs&&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;ro[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 + '
'; 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=0;c--)e.dom.remove(l[c],1);g.moveToBookmark(f)}function n(){var t=this;e.on("VisualChars",function(e){t.active(e.state)})}var r,i=this;e.addCommand("mceVisualChars",t),e.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:n}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:n,selectable:!0,context:"view",prependToContext:!0}),e.on("beforegetcontent",function(e){r&&"raw"!=e.format&&!e.draft&&(r=!0,t(!1))})}); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/wordcount/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('wordcount', function(editor) { 14 | var self = this, countre, cleanre; 15 | 16 | // Included most unicode blocks see: http://en.wikipedia.org/wiki/Unicode_block 17 | // Latin-1_Supplement letters, a-z, u2019 == ’ 18 | countre = editor.getParam('wordcount_countregex', /[\w\u2019\x27\-\u00C0-\u1FFF]+/g); 19 | cleanre = editor.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g); 20 | 21 | function update() { 22 | editor.theme.panel.find('#wordcount').text(['Words: {0}', self.getCount()]); 23 | } 24 | 25 | editor.on('init', function() { 26 | var statusbar = editor.theme.panel && editor.theme.panel.find('#statusbar')[0]; 27 | 28 | if (statusbar) { 29 | window.setTimeout(function() { 30 | statusbar.insert({ 31 | type: 'label', 32 | name: 'wordcount', 33 | text: ['Words: {0}', self.getCount()], 34 | classes: 'wordcount', 35 | disabled: editor.settings.readonly 36 | }, 0); 37 | 38 | editor.on('setcontent beforeaddundo', update); 39 | 40 | editor.on('keyup', function(e) { 41 | if (e.keyCode == 32) { 42 | update(); 43 | } 44 | }); 45 | }, 0); 46 | } 47 | }); 48 | 49 | self.getCount = function() { 50 | var tx = editor.getContent({format: 'raw'}); 51 | var tc = 0; 52 | 53 | if (tx) { 54 | tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces 55 | tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars 56 | 57 | // deal with html entities 58 | tx = tx.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i, "$1$3").replace(/&.+?;/g, ' '); 59 | tx = tx.replace(cleanre, ''); // remove numbers and punctuation 60 | 61 | var wordArray = tx.match(countre); 62 | if (wordArray) { 63 | tc = wordArray.length; 64 | } 65 | } 66 | 67 | return tc; 68 | }; 69 | }); -------------------------------------------------------------------------------- /template/static/js/tinymce/plugins/wordcount/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("wordcount",function(e){function t(){e.theme.panel.find("#wordcount").text(["Words: {0}",i.getCount()])}var n,r,i=this;n=e.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g),r=e.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),e.on("init",function(){var n=e.theme.panel&&e.theme.panel.find("#statusbar")[0];n&&window.setTimeout(function(){n.insert({type:"label",name:"wordcount",text:["Words: {0}",i.getCount()],classes:"wordcount",disabled:e.settings.readonly},0),e.on("setcontent beforeaddundo",t),e.on("keyup",function(e){32==e.keyCode&&t()})},0)}),i.getCount=function(){var t=e.getContent({format:"raw"}),i=0;if(t){t=t.replace(/\.\.\./g," "),t=t.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," "),t=t.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," "),t=t.replace(r,"");var o=t.match(n);o&&(i=o.length)}return i}}); -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/AbsoluteLayout.less: -------------------------------------------------------------------------------- 1 | // AbsoluteLayout 2 | 3 | .@{prefix}-abs-layout { 4 | position: relative; 5 | } 6 | 7 | body .@{prefix}-abs-layout-item, .@{prefix}-abs-end { 8 | position: absolute; 9 | } 10 | 11 | .@{prefix}-abs-end { 12 | width: 1px; height: 1px; 13 | } 14 | 15 | .@{prefix}-container-body.@{prefix}-abs-layout { 16 | overflow: hidden; 17 | } 18 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Animations.less: -------------------------------------------------------------------------------- 1 | // Animations 2 | 3 | .@{prefix}-fade { 4 | opacity: 0; 5 | .transition(opacity .15s linear); 6 | 7 | &.@{prefix}-in { 8 | opacity: 1; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/ButtonGroup.less: -------------------------------------------------------------------------------- 1 | // ButtonGroup 2 | 3 | .btn-group-border-left(@border-color) when (@has-button-borders = true) { 4 | border-left: 1px solid @border-color; 5 | } 6 | 7 | .btn-group-border-right(@border-color) when (@has-button-borders = true) { 8 | border-right: 1px solid @border-color; 9 | } 10 | 11 | 12 | .@{prefix}-btn-group .@{prefix}-btn { 13 | border-width: @btn-group-border-width; 14 | margin: 0; 15 | .border-radius(0); 16 | margin-left: @flow-layout-spacing; 17 | } 18 | 19 | .@{prefix}-btn-group .@{prefix}-btn when (@has-button-borders = true) { 20 | border-left-width: 0; 21 | border-right-width: 0; 22 | margin-left: 0; 23 | } 24 | 25 | .@{prefix}-btn-group:not(:first-child) when (@has-button-borders = true) { 26 | padding-left: 1px; 27 | margin-left: 1px; 28 | } 29 | 30 | .@{prefix}-btn-group:not(:first-child) when (@has-button-borders = false) { 31 | border-left: 1px solid darken(@btn-bg, 15%); 32 | padding-left: @flow-layout-spacing + 1px; 33 | margin-left: @flow-layout-spacing + 1px; 34 | } 35 | 36 | .@{prefix}-btn-group .@{prefix}-first { 37 | .border-radius(3px 0 0 3px); 38 | .btn-group-border-left(@btn-border-left); 39 | margin-left: 0; 40 | } 41 | 42 | .@{prefix}-btn-group .@{prefix}-last { 43 | .border-radius(0 3px 3px 0); 44 | .btn-group-border-right(@btn-border-right); 45 | } 46 | 47 | .@{prefix}-btn-group .@{prefix}-first.@{prefix}-last { 48 | .border-radius(3px); 49 | } 50 | 51 | .@{prefix}-btn-group .@{prefix}-btn.@{prefix}-flow-layout-item { 52 | margin: 0; 53 | } 54 | 55 | // RTL 56 | 57 | .@{prefix}-rtl .@{prefix}-btn-group .@{prefix}-btn { 58 | margin-left: 0; 59 | margin-right: @flow-layout-spacing; 60 | } 61 | 62 | .@{prefix}-rtl .@{prefix}-btn-group .@{prefix}-first { 63 | margin-right: 0; 64 | } 65 | 66 | .@{prefix}-rtl .@{prefix}-btn-group:not(:first-child) { 67 | border-left: none; 68 | border-right:1px solid darken(@btn-bg, 15%); 69 | padding-right: @flow-layout-spacing + 2px; 70 | margin-right: @flow-layout-spacing + 2px; 71 | } 72 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Checkbox.less: -------------------------------------------------------------------------------- 1 | // Checkbox 2 | 3 | .@{prefix}-checkbox { 4 | cursor: pointer; 5 | } 6 | 7 | i.@{prefix}-i-checkbox { 8 | margin: 0 3px 0 0; 9 | border: 1px solid @checkbox-border; 10 | .border-radius(3px); 11 | .box-shadow(@checkbox-box-shadow); 12 | .vertical-gradient(@checkbox-bg, @checkbox-bg-hlight); 13 | text-indent: -10em; 14 | *font-size: 0; 15 | *line-height: 0; 16 | *text-indent: 0; 17 | overflow: hidden; 18 | } 19 | 20 | .@{prefix}-checked i.@{prefix}-i-checkbox { 21 | color: @btn-text; 22 | font-size: 16px; 23 | line-height: 16px; 24 | text-indent: 0; 25 | } 26 | 27 | .@{prefix}-checkbox:focus i.@{prefix}-i-checkbox, .@{prefix}-checkbox.@{prefix}-focus i.@{prefix}-i-checkbox { 28 | border: 1px solid @checkbox-border-focus; 29 | .box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px fadeout(@checkbox-border-focus, 15%)); 30 | } 31 | 32 | .@{prefix}-checkbox.@{prefix}-disabled .@{prefix}-label, .@{prefix}-checkbox.@{prefix}-disabled i.@{prefix}-i-checkbox { 33 | color: mix(@text, @panel-bg, 40%); 34 | } 35 | 36 | .@{prefix}-checkbox .@{prefix}-label { 37 | vertical-align: middle; 38 | } 39 | 40 | // RTL 41 | 42 | .@{prefix}-rtl .@{prefix}-checkbox { 43 | direction: rtl; 44 | text-align: right; 45 | } 46 | 47 | .@{prefix}-rtl i.@{prefix}-i-checkbox { 48 | margin: 0 0 0 3px; 49 | } 50 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/ColorBox.less: -------------------------------------------------------------------------------- 1 | // ColorBox 2 | 3 | .@{prefix}-colorbox i { 4 | border: 1px solid @textbox-border; 5 | width: 14px; height: 14px; 6 | } 7 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/ColorButton.less: -------------------------------------------------------------------------------- 1 | // ColorButton 2 | 3 | .@{prefix}-colorbutton .@{prefix}-ico { 4 | position: relative; 5 | } 6 | 7 | .@{prefix}-colorbutton-grid { 8 | margin: 4px; 9 | } 10 | 11 | .@{prefix}-colorbutton button { 12 | padding-right: 6px; 13 | padding-left: 6px; 14 | } 15 | 16 | .@{prefix}-colorbutton .@{prefix}-preview { 17 | padding-right: 3px; 18 | display: block; 19 | position: absolute; 20 | left: 50%; 21 | top: 50%; 22 | margin-left: -17px; 23 | margin-top: 7px; 24 | background: gray; 25 | width: 13px; 26 | height: 2px; 27 | overflow: hidden; 28 | } 29 | 30 | .@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-preview { 31 | margin-left: -16px; 32 | padding-right: 0; 33 | width: 16px; 34 | } 35 | 36 | .@{prefix}-colorbutton .@{prefix}-open { 37 | padding-left: 4px; 38 | padding-right: 4px; 39 | border-left: 1px solid transparent; 40 | } 41 | 42 | .@{prefix}-colorbutton:hover .@{prefix}-open { 43 | border-color: darken(@btn-bg, 20%); 44 | } 45 | 46 | .@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-open { 47 | padding: 0 3px 0 3px; 48 | } 49 | 50 | // RTL 51 | 52 | .@{prefix}-rtl .@{prefix}-colorbutton { 53 | direction: rtl; 54 | } 55 | 56 | .@{prefix}-rtl .@{prefix}-colorbutton .@{prefix}-preview { 57 | margin-left: 0; 58 | padding-right: 0; 59 | padding-left: 3px; 60 | } 61 | 62 | .@{prefix}-rtl .@{prefix}-colorbutton.@{prefix}-btn-small .@{prefix}-preview { 63 | margin-left: 0; 64 | padding-right: 0; 65 | padding-left: 2px; 66 | } 67 | 68 | .@{prefix}-rtl .@{prefix}-colorbutton .@{prefix}-open { 69 | padding-left: 4px; 70 | padding-right: 4px; 71 | border-left: 0; 72 | } 73 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/ColorPicker.less: -------------------------------------------------------------------------------- 1 | // ColorPicker 2 | 3 | .@{prefix}-colorpicker { 4 | position: relative; 5 | width: 250px; 6 | height: 220px; 7 | } 8 | 9 | .@{prefix}-colorpicker-sv { 10 | position: absolute; 11 | top: 0; left: 0; 12 | width: 90%; 13 | height: 100%; 14 | border: 1px solid @colorpicker-border; 15 | cursor: crosshair; 16 | overflow: hidden; 17 | } 18 | 19 | .@{prefix}-colorpicker-h-chunk { 20 | width: 100%; 21 | } 22 | 23 | .@{prefix}-colorpicker-overlay1, .@{prefix}-colorpicker-overlay2 { 24 | width: 100%; 25 | height: 100%; 26 | position: absolute; 27 | top: 0; 28 | left: 0; 29 | } 30 | 31 | .@{prefix}-colorpicker-overlay1 { 32 | filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff'); 33 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')"; 34 | background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0)); 35 | } 36 | 37 | .@{prefix}-colorpicker-overlay2 { 38 | filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000'); 39 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')"; 40 | background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1)); 41 | } 42 | 43 | .@{prefix}-colorpicker-selector1 { 44 | background: none; 45 | position: absolute; 46 | width: 12px; 47 | height: 12px; 48 | margin: -8px 0 0 -8px; 49 | border: 1px solid black; 50 | border-radius: 50%; 51 | } 52 | 53 | .@{prefix}-colorpicker-selector2 { 54 | position: absolute; 55 | width: 10px; 56 | height: 10px; 57 | border: 1px solid white; 58 | border-radius: 50%; 59 | } 60 | 61 | .@{prefix}-colorpicker-h { 62 | position: absolute; 63 | top: 0; right: 0; 64 | width: 6.5%; 65 | height: 100%; 66 | border: 1px solid @colorpicker-border; 67 | cursor: crosshair; 68 | } 69 | 70 | .@{prefix}-colorpicker-h-marker { 71 | margin-top: -4px; 72 | position: absolute; 73 | top: 0; 74 | left: -1px; 75 | width: 100%; 76 | border: 1px solid @colorpicker-hue-border; 77 | background: @colorpicker-hue-bg; 78 | height: 4px; 79 | z-index: 100; 80 | } 81 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/ComboBox.less: -------------------------------------------------------------------------------- 1 | // ComboBox 2 | 3 | .@{prefix}-combobox { 4 | .inline-block(); 5 | .border-radius(3px); 6 | .box-shadow(@textbox-box-shadow); 7 | *height: 32px; 8 | } 9 | 10 | .@{prefix}-combobox input { 11 | border: 1px solid @textbox-border; 12 | border-right-color: @combobox-border; 13 | height: 28px; 14 | } 15 | 16 | .@{prefix}-combobox.@{prefix}-disabled input { 17 | color: mix(@text, @textbox-bg, 40%); 18 | } 19 | 20 | .@{prefix}-combobox.@{prefix}-has-open input { 21 | .border-radius(4px 0 0 4px); 22 | } 23 | 24 | .@{prefix}-combobox .@{prefix}-btn { 25 | border: 1px solid @textbox-border; 26 | border-left: 0; 27 | .border-radius(0 4px 4px 0); 28 | } 29 | 30 | .@{prefix}-combobox button { 31 | padding-right: 8px; 32 | padding-left: 8px; 33 | } 34 | 35 | .@{prefix}-combobox.@{prefix}-disabled .@{prefix}-btn button { 36 | cursor: default; 37 | .box-shadow(none); 38 | .opacity(@btn-box-disabled-opacity); 39 | } 40 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Container.less: -------------------------------------------------------------------------------- 1 | // Container 2 | 3 | .@{prefix}-container, .@{prefix}-container-body { 4 | display: block; 5 | } 6 | 7 | .@{prefix}-autoscroll { 8 | overflow: hidden; 9 | } 10 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Content.Inline.less: -------------------------------------------------------------------------------- 1 | /* Content.Inline.less */ 2 | 3 | @import "Content.Objects.less"; 4 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Content.Objects.less: -------------------------------------------------------------------------------- 1 | /* Content.Objects.less */ 2 | 3 | .mce-content-body .mce-reset { 4 | margin: 0; padding: 0; border: 0; outline: 0; 5 | vertical-align: top; background: transparent; 6 | text-decoration: none; color: black; 7 | font-family: Arial; 8 | font-size: 11px; text-shadow: none; float: none; 9 | position: static; width: auto; height: auto; 10 | white-space: nowrap; cursor: inherit; 11 | line-height: normal; font-weight: normal; 12 | text-align: left; 13 | -webkit-tap-highlight-color: transparent; 14 | -moz-box-sizing: content-box; 15 | -webkit-box-sizing: content-box; 16 | box-sizing: content-box; 17 | direction: ltr; 18 | max-width: none; 19 | } 20 | 21 | .mce-object { 22 | border: 1px dotted #3A3A3A; 23 | background: #D5D5D5 url(img/object.gif) no-repeat center; 24 | } 25 | 26 | .mce-pagebreak { 27 | cursor: default; 28 | display: block; 29 | border: 0; 30 | width: 100%; 31 | height: 5px; 32 | border: 1px dashed #666; 33 | margin-top: 15px; 34 | page-break-before: always; 35 | } 36 | 37 | @media print { 38 | .mce-pagebreak { 39 | border: 0px; 40 | } 41 | } 42 | 43 | .mce-item-anchor { 44 | cursor: default; 45 | display: inline-block; 46 | -webkit-user-select: all; 47 | -webkit-user-modify: read-only; 48 | -moz-user-select: all; 49 | -moz-user-modify: read-only; 50 | user-select: all; 51 | user-modify: read-only; 52 | width: 9px !important; 53 | height: 9px !important; 54 | border: 1px dotted #3A3A3A; 55 | background: #D5D5D5 url(img/anchor.gif) no-repeat center; 56 | } 57 | 58 | .mce-nbsp, .mce-shy { 59 | background: #AAA; 60 | } 61 | 62 | .mce-shy::after { 63 | content: '-'; 64 | } 65 | 66 | hr { 67 | cursor: default; 68 | } 69 | 70 | .mce-match-marker { 71 | background: #AAA; 72 | color: #fff; 73 | } 74 | 75 | .mce-match-marker-selected { 76 | background: #3399ff; 77 | color: #fff; 78 | } 79 | 80 | .mce-spellchecker-word { 81 | border-bottom: 2px solid #F00; 82 | cursor: default; 83 | } 84 | 85 | .mce-spellchecker-grammar { 86 | border-bottom: 2px solid #008000; 87 | cursor: default; 88 | } 89 | 90 | .mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption { 91 | border: 1px dashed #BBB; 92 | } 93 | 94 | td.mce-item-selected, th.mce-item-selected { 95 | background-color: #3399ff !important; 96 | } 97 | 98 | .mce-edit-focus { 99 | outline: 1px dotted #333; 100 | } 101 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Content.less: -------------------------------------------------------------------------------- 1 | /* Content.less */ 2 | 3 | @font-family: Verdana, Arial, Helvetica, sans-serif; 4 | @font-size: 11px; 5 | 6 | body { 7 | background-color: #FFFFFF; 8 | color: #000000; 9 | font-family: @font-family; 10 | font-size: @font-size; 11 | scrollbar-3dlight-color: #F0F0EE; 12 | scrollbar-arrow-color: #676662; 13 | scrollbar-base-color: #F0F0EE; 14 | scrollbar-darkshadow-color: #DDDDDD; 15 | scrollbar-face-color: #E0E0DD; 16 | scrollbar-highlight-color: #F0F0EE; 17 | scrollbar-shadow-color: #F0F0EE; 18 | scrollbar-track-color: #F5F5F5; 19 | } 20 | 21 | td, th { 22 | font-family: @font-family; 23 | font-size: @font-size; 24 | } 25 | 26 | @import "Content.Objects.less"; 27 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/CropRect.less: -------------------------------------------------------------------------------- 1 | // CropRect 2 | 3 | .@{prefix}-croprect-container { 4 | position: absolute; 5 | top: 0; 6 | left: 0; 7 | } 8 | 9 | .@{prefix}-croprect-handle { 10 | position: absolute; 11 | top: 0; left: 0; 12 | width: 20px; height: 20px; 13 | border: 2px solid white; 14 | } 15 | 16 | .@{prefix}-croprect-handle-nw { 17 | border-width: 2px 0 0 2px; 18 | margin: -2px 0 0 -2px; 19 | cursor: nw-resize; 20 | top: 100px; left: 100px; 21 | } 22 | 23 | .@{prefix}-croprect-handle-ne { 24 | border-width: 2px 2px 0 0; 25 | margin: -2px 0 0 -20px; 26 | cursor: ne-resize; 27 | top: 100px; left: 200px; 28 | } 29 | 30 | .@{prefix}-croprect-handle-sw { 31 | border-width: 0 0 2px 2px; 32 | margin: -20px 2px 0 -2px; 33 | cursor: sw-resize; 34 | top: 200px; left: 100px; 35 | } 36 | 37 | .@{prefix}-croprect-handle-se { 38 | border-width: 0 2px 2px 0; 39 | margin: -20px 0 0 -20px; 40 | cursor: se-resize; 41 | top: 200px; left: 200px; 42 | } 43 | 44 | .@{prefix}-croprect-handle-move { 45 | position: absolute; 46 | cursor: move; 47 | border: 0; 48 | } 49 | 50 | .@{prefix}-croprect-block { 51 | .opacity(@window-modalblock-opacity); 52 | position: absolute; 53 | background: black; 54 | } 55 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/FieldSet.less: -------------------------------------------------------------------------------- 1 | // FieldSet 2 | 3 | .@{prefix}-fieldset { 4 | border: 0 solid #9E9E9E; 5 | .border-radius(3px); 6 | } 7 | 8 | .@{prefix}-fieldset > .@{prefix}-container-body { 9 | margin-top: -15px; 10 | } 11 | 12 | .@{prefix}-fieldset-title { 13 | margin-left: 5px; 14 | padding: 0 5px 0 5px; 15 | } -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/FitLayout.less: -------------------------------------------------------------------------------- 1 | // FitLayout 2 | 3 | .@{prefix}-fit-layout { 4 | .inline-block(); 5 | } 6 | 7 | .@{prefix}-fit-layout-item { 8 | position: absolute; 9 | } 10 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/FloatPanel.less: -------------------------------------------------------------------------------- 1 | // FloatPanel 2 | 3 | .@{prefix}-floatpanel { 4 | position: absolute; 5 | .box-shadow(@floatpanel-box-shadow); 6 | } 7 | 8 | .@{prefix}-floatpanel.@{prefix}-fixed { 9 | position: fixed; 10 | } 11 | 12 | // Popover panel 13 | 14 | .@{prefix}-floatpanel .@{prefix}-arrow, 15 | .@{prefix}-floatpanel .@{prefix}-arrow:after { 16 | position: absolute; 17 | display: block; 18 | width: 0; 19 | height: 0; 20 | border-color: transparent; 21 | border-style: solid; 22 | } 23 | 24 | .@{prefix}-floatpanel .@{prefix}-arrow { 25 | border-width: @popover-arrow-outer-width; 26 | } 27 | 28 | .@{prefix}-floatpanel .@{prefix}-arrow:after { 29 | border-width: @popover-arrow-width; 30 | content: ""; 31 | } 32 | 33 | .@{prefix}-floatpanel.@{prefix}-popover { 34 | .reset-gradient(); 35 | .border-radius(6px); 36 | .box-shadow(@floatpanel-box-shadow); 37 | top: 0; 38 | left: 0; 39 | background: @popover-bg; 40 | border: 1px solid @panel-border; 41 | border: 1px solid @popover-arrow-outer; 42 | 43 | &.@{prefix}-bottom { 44 | margin-top: @popover-arrow-width; 45 | *margin-top: 0; 46 | 47 | & > .@{prefix}-arrow { 48 | left: 50%; 49 | margin-left: -@popover-arrow-outer-width; 50 | border-top-width: 0; 51 | border-bottom-color: @panel-border; 52 | border-bottom-color: @popover-arrow-outer; 53 | top: -@popover-arrow-outer-width; 54 | 55 | &:after { 56 | top: 1px; 57 | margin-left: -@popover-arrow-width; 58 | border-top-width: 0; 59 | border-bottom-color: @popover-arrow; 60 | } 61 | } 62 | 63 | &.@{prefix}-start { margin-left: -22px; } 64 | &.@{prefix}-start > .@{prefix}-arrow { left: 20px; } 65 | 66 | &.@{prefix}-end { margin-left: 22px; } 67 | &.@{prefix}-end > .@{prefix}-arrow { right: 10px; left: auto; } 68 | } 69 | } -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/FlowLayout.less: -------------------------------------------------------------------------------- 1 | // FlowLayout 2 | 3 | .@{prefix}-flow-layout-item { 4 | .inline-block(); 5 | } 6 | 7 | .@{prefix}-flow-layout-item { 8 | margin: @flow-layout-spacing 0 @flow-layout-spacing @flow-layout-spacing; 9 | } 10 | 11 | .@{prefix}-flow-layout-item.@{prefix}-last { 12 | margin-right: @flow-layout-spacing; 13 | } 14 | 15 | .@{prefix}-flow-layout { 16 | white-space: normal; 17 | } 18 | 19 | .@{prefix}-tinymce-inline .@{prefix}-flow-layout { 20 | white-space: nowrap; 21 | } 22 | 23 | // RTL 24 | 25 | .@{prefix}-rtl .@{prefix}-flow-layout { 26 | text-align: right; 27 | direction: rtl; 28 | } 29 | 30 | .@{prefix}-rtl .@{prefix}-flow-layout-item { 31 | margin: @flow-layout-spacing @flow-layout-spacing @flow-layout-spacing 0; 32 | } 33 | 34 | .@{prefix}-rtl .@{prefix}-flow-layout-item.@{prefix}-last { 35 | margin-left: @flow-layout-spacing; 36 | } 37 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Iframe.less: -------------------------------------------------------------------------------- 1 | // Iframe 2 | 3 | .@{prefix}-iframe { 4 | border: 0 solid @iframe-border; 5 | width: 100%; height: 100%; 6 | } 7 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/ImagePanel.less: -------------------------------------------------------------------------------- 1 | // ImagePanel 2 | 3 | .@{prefix}-imagepanel { 4 | overflow: auto; 5 | background: black; 6 | } 7 | 8 | .@{prefix}-imagepanel img { 9 | position: absolute; 10 | } 11 | 12 | .@{prefix}-imagetool.@{prefix}-btn .@{prefix}-ico { 13 | display: block; 14 | width: 20px; 15 | height: 20px; 16 | text-align: center; 17 | line-height: 20px; 18 | font-size: 20px; 19 | padding: 5px; 20 | } 21 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Label.less: -------------------------------------------------------------------------------- 1 | // Label 2 | 3 | .@{prefix}-label { 4 | .inline-block(); 5 | text-shadow: @text-shadow; 6 | overflow: hidden; 7 | } 8 | 9 | .@{prefix}-label.@{prefix}-autoscroll { 10 | overflow: auto; 11 | } 12 | 13 | .@{prefix}-label.@{prefix}-disabled { 14 | color: @text-disabled; 15 | } 16 | 17 | .@{prefix}-label.@{prefix}-multiline { 18 | white-space: pre-wrap; 19 | } 20 | 21 | .@{prefix}-label.@{prefix}-error { 22 | color: @text-error; 23 | } 24 | 25 | // RTL 26 | 27 | .@{prefix}-rtl .@{prefix}-label { 28 | text-align: right; 29 | direction: rtl; 30 | } 31 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/ListBox.less: -------------------------------------------------------------------------------- 1 | // ListBox 2 | 3 | .@{prefix}-listbox button { 4 | text-align: left; 5 | padding-right: 20px; 6 | position: relative; 7 | } 8 | 9 | .@{prefix}-listbox .@{prefix}-caret { 10 | position: absolute; 11 | margin-top: -2px; 12 | right: 8px; 13 | top: 50%; 14 | } 15 | 16 | // RTL 17 | 18 | .@{prefix}-rtl .@{prefix}-listbox .@{prefix}-caret { 19 | right: auto; 20 | left: 8px; 21 | } 22 | 23 | .@{prefix}-rtl .@{prefix}-listbox button { 24 | padding-right: 10px; 25 | padding-left: 20px; 26 | } 27 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Menu.less: -------------------------------------------------------------------------------- 1 | // Menu 2 | 3 | .@{prefix}-menu { 4 | position: absolute; 5 | left: 0; top: 0; 6 | .reset-gradient(); 7 | z-index: 1000; 8 | padding: 5px 0 5px 0; 9 | margin: @menu-margin; 10 | min-width: 160px; 11 | background: @menu-bg; 12 | border: 1px solid mix(rgb(red(@menu-border), green(@menu-border), blue(@menu-border)), @panel-bg, round(alpha(@menu-border) * 200)); 13 | border: 1px solid @menu-border; 14 | z-index: 1002; 15 | .border-radius(6px); 16 | .box-shadow(0 5px 10px rgba(0,0,0,.2)); 17 | max-height: 400px; 18 | overflow: auto; 19 | overflow-x: hidden; 20 | } 21 | 22 | .@{prefix}-menu i { 23 | display: none; 24 | } 25 | 26 | .@{prefix}-menu-has-icons i { 27 | display: inline-block; 28 | *display: inline; 29 | } 30 | 31 | .@{prefix}-menu-sub-tr-tl { margin: -6px 0 0 -1px; } 32 | .@{prefix}-menu-sub-br-bl { margin: 6px 0 0 -1px; } 33 | .@{prefix}-menu-sub-tl-tr { margin: -6px 0 0 1px; } 34 | .@{prefix}-menu-sub-bl-br { margin: 6px 0 0 1px; } 35 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/MenuBar.less: -------------------------------------------------------------------------------- 1 | /* MenuBar */ 2 | 3 | .@{prefix}-menubar .@{prefix}-menubtn { 4 | border-color: transparent; 5 | background: transparent; 6 | .border-radius(0); 7 | .box-shadow(none); 8 | filter: none; 9 | } 10 | 11 | .@{prefix}-menubar .@{prefix}-menubtn button { 12 | color: @menubar-menubtn-text; 13 | } 14 | 15 | .@{prefix}-menubar { 16 | border: 1px solid @menubar-border; 17 | } 18 | 19 | .@{prefix}-menubar .@{prefix}-menubtn button span { 20 | color: @text; 21 | } 22 | 23 | .@{prefix}-menubar .@{prefix}-caret { 24 | border-top-color: @text; 25 | } 26 | 27 | .@{prefix}-menubar .@{prefix}-menubtn:hover, .@{prefix}-menubar .@{prefix}-menubtn.@{prefix}-active, .@{prefix}-menubar .@{prefix}-menubtn:focus { 28 | border-color: darken(@btn-bg, 20%); 29 | background: @menu-bg; 30 | filter: none; 31 | .box-shadow(none); 32 | } 33 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/MenuButton.less: -------------------------------------------------------------------------------- 1 | /* MenuButton */ 2 | 3 | .@{prefix}-menubtn button { 4 | color: @btn-text; 5 | //margin-right: 2px; 6 | //line-height: @line-height; 7 | //*line-height: @line-height - 4px; 8 | } 9 | 10 | .@{prefix}-menubtn.@{prefix}-btn-small span { 11 | font-size: @font-size - 2px; 12 | } 13 | 14 | .@{prefix}-menubtn.@{prefix}-fixed-width span { 15 | display: inline-block; 16 | overflow-x: hidden; 17 | text-overflow: ellipsis; 18 | width: 90px; 19 | } 20 | 21 | .@{prefix}-menubtn.@{prefix}-fixed-width.@{prefix}-btn-small span { 22 | width: 70px; 23 | } 24 | 25 | .@{prefix}-menubtn .@{prefix}-caret { 26 | *margin-top: 6px; 27 | } 28 | 29 | // RTL 30 | 31 | .@{prefix}-rtl .@{prefix}-menubtn button { 32 | direction: rtl; 33 | text-align: right; 34 | } 35 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | @opacityie: @opacity * 100; 6 | filter: ~"alpha(opacity=@{opacityie})"; 7 | zoom: 1; 8 | } 9 | 10 | .vertical-gradient(@startColor, @endColor) when (@has-gradients = true) { 11 | background-color: mix(@startColor, @endColor, 60%); 12 | background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+ 13 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+ 14 | background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+ 15 | background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10 16 | background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10 17 | background-repeat: repeat-x; 18 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)", argb(@startColor), argb(@endColor))); 19 | zoom: 1; 20 | } 21 | 22 | .vertical-gradient(@startColor, @endColor) when (@has-gradients = false) { 23 | background-color: mix(@startColor, @endColor, 60%); 24 | } 25 | 26 | .border-radius(@radius) when (@has-radius = true) { 27 | -webkit-border-radius: @radius; 28 | -moz-border-radius: @radius; 29 | border-radius: @radius; 30 | } 31 | 32 | .box-shadow(@shadowA, @shadowB:X, ...) when (@has-boxshadow = true) { 33 | // Multiple shadow solution from http://toekneestuck.com/blog/2012/05/15/less-css-arguments-variable/ 34 | @props: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`; 35 | -webkit-box-shadow: @props; 36 | -moz-box-shadow: @props; 37 | box-shadow: @props; 38 | } 39 | 40 | .transition(@transition) { 41 | -webkit-transition: @transition; 42 | transition: @transition; 43 | } 44 | 45 | .inline-block() { 46 | display: inline-block; 47 | *display: inline; 48 | *zoom: 1; 49 | } 50 | 51 | .reset-gradient() { 52 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 53 | background: transparent; 54 | } 55 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Panel.less: -------------------------------------------------------------------------------- 1 | // Panel 2 | 3 | .@{prefix}-panel { 4 | border: 0 solid mix(rgb(red(@panel-border), green(@panel-border), blue(@panel-border)), @panel-bg, 20%); 5 | border: 0 solid @panel-border; 6 | .vertical-gradient(@panel-bg, @panel-bg-hlight); 7 | } 8 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Path.less: -------------------------------------------------------------------------------- 1 | // Path 2 | 3 | .@{prefix}-path { 4 | .inline-block(); 5 | padding: 8px; 6 | white-space: normal; 7 | } 8 | 9 | .@{prefix}-path .@{prefix}-txt { 10 | display: inline-block; 11 | padding-right: 3px; 12 | } 13 | 14 | .@{prefix}-path .@{prefix}-path-body { 15 | display: inline-block; 16 | } 17 | 18 | .@{prefix}-path-item { 19 | .inline-block(); 20 | cursor: pointer; 21 | color: @path-text; 22 | } 23 | 24 | .@{prefix}-path-item:hover { 25 | text-decoration: underline; 26 | } 27 | 28 | .@{prefix}-path-item:focus { 29 | background: @path-bg-focus; 30 | color: @path-text-focus; 31 | } 32 | 33 | .@{prefix}-path .@{prefix}-divider { 34 | display: inline; 35 | } 36 | 37 | .@{prefix}-disabled .@{prefix}-path-item { 38 | color: @text-disabled; 39 | } 40 | 41 | // RTL 42 | 43 | .@{prefix}-rtl .@{prefix}-path { 44 | direction: rtl; 45 | } 46 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Radio.less: -------------------------------------------------------------------------------- 1 | // Radio - not implemented yet 2 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Reset.less: -------------------------------------------------------------------------------- 1 | // Reset 2 | 3 | .@{prefix}-container, .@{prefix}-container *, .@{prefix}-widget, .@{prefix}-widget *, .@{prefix}-reset { 4 | margin: 0; padding: 0; border: 0; outline: 0; 5 | vertical-align: top; background: transparent; 6 | text-decoration: none; color: @text; 7 | font-family: @font-family; 8 | font-size: @font-size; text-shadow: none; float: none; 9 | position: static; width: auto; height: auto; 10 | white-space: nowrap; cursor: inherit; 11 | -webkit-tap-highlight-color: transparent; 12 | line-height: normal; font-weight: normal; 13 | text-align: left; 14 | -moz-box-sizing: content-box; 15 | -webkit-box-sizing: content-box; 16 | box-sizing: content-box; 17 | direction: ltr; 18 | max-width: none; 19 | } 20 | 21 | .@{prefix}-widget button { 22 | -moz-box-sizing: border-box; 23 | -webkit-box-sizing: border-box; 24 | box-sizing: border-box; 25 | } 26 | 27 | .@{prefix}-container *[unselectable] { 28 | -moz-user-select: none; 29 | -webkit-user-select: none; 30 | -o-user-select: none; 31 | user-select: none; 32 | } 33 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/ResizeHandle.less: -------------------------------------------------------------------------------- 1 | .@{prefix}-container-body .@{prefix}-resizehandle { 2 | position: absolute; 3 | right: 0; 4 | bottom: 0; 5 | width: 16px; 6 | height: 16px; 7 | visibility: visible; 8 | cursor: s-resize; 9 | margin: 0; 10 | } 11 | 12 | .@{prefix}-container-body .@{prefix}-resizehandle-both { 13 | cursor: se-resize; 14 | } 15 | 16 | i.@{prefix}-i-resize { 17 | color: @text; 18 | } 19 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Scrollable.less: -------------------------------------------------------------------------------- 1 | // Scrollbar 2 | 3 | .@{prefix}-scrollbar { 4 | position: absolute; 5 | width: 7px; 6 | height: 100%; 7 | top: 2px; 8 | right: 2px; 9 | .opacity(0.4); 10 | } 11 | 12 | .@{prefix}-scrollbar-h { 13 | top: auto; 14 | right: auto; 15 | left: 2px; 16 | bottom: 2px; 17 | width: 100%; 18 | height: 7px; 19 | } 20 | 21 | .@{prefix}-scrollbar-thumb { 22 | position: absolute; 23 | background-color: #000; 24 | border: 1px solid #888; 25 | border-color: rgba(85, 85, 85, .6); 26 | width: 5px; 27 | height: 100%; 28 | .border-radius(7px); 29 | } 30 | 31 | .@{prefix}-scrollbar-h .@{prefix}-scrollbar-thumb { 32 | width: 100%; 33 | height: 5px; 34 | } 35 | 36 | .@{prefix}-scrollbar:hover, .@{prefix}-scrollbar.@{prefix}-active { 37 | background-color: #AAA; 38 | .opacity(0.6); 39 | .border-radius(7px); 40 | } 41 | 42 | .@{prefix}-scroll { 43 | position: relative; 44 | } 45 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Slider.less: -------------------------------------------------------------------------------- 1 | // Slider 2 | 3 | .@{prefix}-slider { 4 | .border-radius(3px); 5 | border: 1px solid @slider-border; 6 | background: @slider-bg; 7 | width: 100px; 8 | height: 10px; 9 | position: relative; 10 | display: block; 11 | } 12 | 13 | .@{prefix}-slider.@{prefix}-vertical { 14 | width: 10px; 15 | height: 100px; 16 | } 17 | 18 | .@{prefix}-slider-handle { 19 | .border-radius(3px); 20 | border: 1px solid @slider-handle-border; 21 | background: @slider-handle-bg; 22 | display: block; 23 | width: 13px; 24 | height: 13px; 25 | position: absolute; 26 | top: 0; left: 0; 27 | margin-left: -1px; 28 | margin-top: -2px; 29 | } 30 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Spacer.less: -------------------------------------------------------------------------------- 1 | // Spacer 2 | 3 | .@{prefix}-spacer { 4 | visibility: hidden; 5 | } 6 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/SplitButton.less: -------------------------------------------------------------------------------- 1 | // SplitButton 2 | 3 | .@{prefix}-splitbtn .@{prefix}-open { 4 | border-left: 1px solid transparent; 5 | } 6 | 7 | .@{prefix}-splitbtn:hover .@{prefix}-open { 8 | border-left-color: darken(@btn-bg, 20%); 9 | } 10 | 11 | .@{prefix}-splitbtn button when (@has-button-borders = false) { 12 | padding-right: 6px; 13 | padding-left: 6px; 14 | } 15 | 16 | .@{prefix}-splitbtn button when (@has-button-borders = true) { 17 | padding-right: 4px; 18 | padding-left: 8px; 19 | } 20 | 21 | .@{prefix}-splitbtn .@{prefix}-open { 22 | padding-right: 4px; 23 | padding-left: 4px; 24 | } 25 | 26 | .@{prefix}-splitbtn .@{prefix}-open.@{prefix}-active { 27 | .vertical-gradient(darken(@btn-bg, 10%), darken(@btn-bg-hlight, 5%)); 28 | outline: 1px solid darken(@btn-bg, 20%); 29 | } 30 | 31 | .@{prefix}-splitbtn.@{prefix}-btn-small .@{prefix}-open { 32 | padding: 0 3px 0 3px; 33 | } 34 | 35 | // RTL 36 | 37 | .@{prefix}-rtl .@{prefix}-splitbtn { 38 | direction: rtl; 39 | text-align: right; 40 | } 41 | 42 | .@{prefix}-rtl .@{prefix}-splitbtn button { 43 | padding-right: 4px; 44 | padding-left: 4px; 45 | } 46 | 47 | .@{prefix}-rtl .@{prefix}-splitbtn .@{prefix}-open { 48 | border-left: 0; 49 | } 50 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/StackLayout.less: -------------------------------------------------------------------------------- 1 | // StackLayout 2 | 3 | .@{prefix}-stack-layout-item { 4 | display: block; 5 | } 6 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/TabPanel.less: -------------------------------------------------------------------------------- 1 | // TabPanel 2 | 3 | .@{prefix}-tabs { 4 | display: block; 5 | border-bottom: 1px solid @tab-border; 6 | } 7 | 8 | .@{prefix}-tabs, 9 | .@{prefix}-tabs + .@{prefix}-container-body { 10 | background: @tabs-bg; 11 | } 12 | 13 | .@{prefix}-tab { 14 | .inline-block(); 15 | border: 1px solid @tab-border; 16 | border-width: 0 1px 0 0; 17 | background: @tab-bg; 18 | padding: 8px; 19 | text-shadow: @text-shadow; 20 | height: 13px; 21 | cursor: pointer; 22 | } 23 | 24 | .@{prefix}-tab:hover { 25 | background: @tab-bg-hover; 26 | } 27 | 28 | .@{prefix}-tab.@{prefix}-active { 29 | background: @tab-bg-active; 30 | border-bottom-color: transparent; 31 | margin-bottom: -1px; 32 | height: 14px; 33 | } 34 | 35 | // RTL 36 | 37 | .@{prefix}-rtl .@{prefix}-tabs { 38 | text-align: right; 39 | direction: rtl; 40 | } 41 | 42 | .@{prefix}-rtl .@{prefix}-tab { 43 | border-width: 0 0 0 1px; 44 | } 45 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/TextBox.less: -------------------------------------------------------------------------------- 1 | // TextBox 2 | 3 | .@{prefix}-textbox { 4 | background: @textbox-bg; 5 | border: 1px solid @textbox-border; 6 | .border-radius(3px); 7 | .box-shadow(@textbox-box-shadow); 8 | display: inline-block; 9 | .transition(~"border linear .2s, box-shadow linear .2s"); 10 | height: 28px; 11 | resize: none; 12 | padding: 0 4px 0 4px; 13 | white-space: pre-wrap; 14 | *white-space: pre; 15 | color: @text; 16 | } 17 | 18 | .@{prefix}-textbox:focus, .@{prefix}-textbox.@{prefix}-focus { 19 | border-color: @textbox-border-focus; 20 | .box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px fadeout(@textbox-border-focus, 15%)); 21 | } 22 | 23 | .@{prefix}-placeholder .@{prefix}-textbox { 24 | color: @textbox-text-placeholder; 25 | } 26 | 27 | .@{prefix}-textbox.@{prefix}-multiline { 28 | padding: 4px; 29 | } 30 | 31 | .@{prefix}-textbox.@{prefix}-disabled { 32 | color: mix(@text, @textbox-bg, 40%); 33 | } 34 | 35 | // RTL 36 | 37 | .@{prefix}-rtl .@{prefix}-textbox { 38 | text-align: right; 39 | direction: rtl; 40 | } 41 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Throbber.less: -------------------------------------------------------------------------------- 1 | // Throbber 2 | 3 | .@{prefix}-throbber { 4 | position: absolute; 5 | top: 0; left: 0; 6 | width: 100%; height: 100%; 7 | .opacity(0.6); 8 | background: @throbber-bg; 9 | } 10 | 11 | .@{prefix}-throbber-inline { 12 | position: static; 13 | height: 50px; 14 | } 15 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/TinyMCE.less: -------------------------------------------------------------------------------- 1 | .@{prefix}-tinymce { 2 | // Avoid FOUC 3 | visibility: inherit !important; 4 | position: relative; 5 | } 6 | 7 | .@{prefix}-fullscreen { 8 | border: 0; padding: 0; margin: 0; 9 | overflow: hidden; 10 | height: 100%; 11 | z-index: 100; 12 | } 13 | 14 | div.@{prefix}-fullscreen { 15 | position: fixed; 16 | top: 0; left: 0; 17 | width: 100%; 18 | height: auto; 19 | } 20 | 21 | .@{prefix}-tinymce { 22 | display: block; 23 | .border-radius(2px); 24 | } 25 | 26 | .@{prefix}-wordcount { 27 | position: absolute; 28 | top: 0; 29 | right: 0; 30 | padding: 8px; 31 | } 32 | 33 | div.@{prefix}-edit-area { 34 | background: #FFF; 35 | filter: none; 36 | } 37 | 38 | .@{prefix}-statusbar { 39 | position: relative; 40 | } 41 | 42 | .@{prefix}-statusbar .@{prefix}-container-body { 43 | position: relative; 44 | } 45 | 46 | .@{prefix}-fullscreen .@{prefix}-resizehandle { 47 | display: none; 48 | } 49 | 50 | // Charmap 51 | 52 | .@{prefix}-charmap { 53 | border-collapse: collapse; 54 | } 55 | 56 | .@{prefix}-charmap td { 57 | cursor: default; 58 | border: 1px solid @panel-border; 59 | width: 20px; 60 | height: 20px; 61 | line-height: 20px; 62 | text-align: center; 63 | vertical-align: middle; 64 | padding: 2px; 65 | } 66 | 67 | .@{prefix}-charmap td div { 68 | text-align: center; 69 | } 70 | 71 | .@{prefix}-charmap td:hover { 72 | background: @btn-bg-hlight; 73 | } 74 | 75 | .@{prefix}-grid td.@{prefix}-grid-cell div { 76 | border: 1px solid @grid-border; 77 | width: 15px; height: 15px; 78 | margin: 0px; 79 | cursor: pointer; 80 | 81 | &:focus { 82 | border-color: @grid-border-active; 83 | } 84 | 85 | &[disabled] { 86 | cursor: not-allowed; 87 | } 88 | } 89 | 90 | .@{prefix}-grid { 91 | border-spacing: 2px; 92 | border-collapse: separate; 93 | 94 | a { 95 | display: block; 96 | border: 1px solid transparent; 97 | 98 | &:hover, &:focus { 99 | border-color: @grid-border-active; 100 | } 101 | } 102 | } 103 | 104 | .@{prefix}-grid-border { 105 | margin: 0 4px 0 4px; 106 | 107 | a { 108 | border-color: @grid-border; 109 | width: 13px; height: 13px; 110 | } 111 | 112 | a:hover, a.@{prefix}-active { 113 | border-color: @grid-border-active; 114 | background: @grid-bg-active; 115 | } 116 | } 117 | 118 | .@{prefix}-text-center { 119 | text-align: center; 120 | } 121 | 122 | div.@{prefix}-tinymce-inline { 123 | width: 100%; 124 | .box-shadow(none); 125 | } 126 | 127 | .@{prefix}-colorbtn-trans div { 128 | text-align: center; 129 | vertical-align: middle; 130 | font-weight: bold; 131 | font-size: 20px; 132 | line-height: 16px; 133 | color: mix(@text, #fff, 70%); 134 | } 135 | 136 | // Reduce double margins between toolbar rows 137 | 138 | .@{prefix}-toolbar-grp when (@has-button-borders = false) { 139 | padding: @flow-layout-spacing 0; 140 | } 141 | 142 | .@{prefix}-toolbar-grp when (@has-button-borders = true) { 143 | padding-bottom: 2px; 144 | } 145 | 146 | .@{prefix}-toolbar-grp .@{prefix}-flow-layout-item { 147 | margin-bottom: 0; 148 | } 149 | 150 | // RTL 151 | 152 | .@{prefix}-rtl .@{prefix}-wordcount { 153 | left: 0; 154 | right: auto; 155 | } 156 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/ToolTip.less: -------------------------------------------------------------------------------- 1 | // Tooltip 2 | 3 | .@{prefix}-tooltip { 4 | position: absolute; 5 | padding: 5px; 6 | .opacity(0.8); 7 | } 8 | 9 | .@{prefix}-tooltip-inner { 10 | font-size: @tooltip-font-size; 11 | background-color: @tooltip-bg; 12 | color: @tooltip-text; 13 | max-width: 200px; 14 | padding: 5px 8px 4px 8px; 15 | text-align: center; 16 | white-space: normal; 17 | } 18 | 19 | .@{prefix}-tooltip-inner { 20 | .border-radius(3px); 21 | } 22 | 23 | .@{prefix}-tooltip-inner { 24 | .box-shadow(0 0 5px @tooltip-bg); 25 | } 26 | 27 | .@{prefix}-tooltip-arrow { 28 | position: absolute; 29 | width: 0; 30 | height: 0; 31 | line-height: 0; 32 | border: 5px dashed @tooltip-bg; 33 | } 34 | 35 | .@{prefix}-tooltip-arrow-n { 36 | border-bottom-color: @tooltip-bg; 37 | } 38 | 39 | .@{prefix}-tooltip-arrow-s { 40 | border-top-color: @tooltip-bg; 41 | } 42 | 43 | .@{prefix}-tooltip-arrow-e { 44 | border-left-color: @tooltip-bg; 45 | } 46 | 47 | .@{prefix}-tooltip-arrow-w { 48 | border-right-color: @tooltip-bg; 49 | } 50 | 51 | .@{prefix}-tooltip-nw, .@{prefix}-tooltip-sw { 52 | margin-left: -14px; 53 | } 54 | 55 | .@{prefix}-tooltip-n .@{prefix}-tooltip-arrow { 56 | top: 0px; 57 | left: 50%; 58 | margin-left: -5px; 59 | border-bottom-style: solid; 60 | border-top: none; 61 | border-left-color: transparent; 62 | border-right-color: transparent; 63 | } 64 | 65 | .@{prefix}-tooltip-nw .@{prefix}-tooltip-arrow { 66 | top: 0; 67 | left: 10px; 68 | border-bottom-style: solid; 69 | border-top: none; 70 | border-left-color: transparent; 71 | border-right-color: transparent; 72 | } 73 | 74 | .@{prefix}-tooltip-ne .@{prefix}-tooltip-arrow { 75 | top: 0; 76 | right: 10px; 77 | border-bottom-style: solid; 78 | border-top: none; 79 | border-left-color: transparent; 80 | border-right-color: transparent; 81 | } 82 | 83 | .@{prefix}-tooltip-s .@{prefix}-tooltip-arrow { 84 | bottom: 0; 85 | left: 50%; 86 | margin-left: -5px; 87 | border-top-style: solid; 88 | border-bottom: none; 89 | border-left-color: transparent; 90 | border-right-color: transparent; 91 | } 92 | 93 | .@{prefix}-tooltip-sw .@{prefix}-tooltip-arrow { 94 | bottom: 0; 95 | left: 10px; 96 | border-top-style: solid; 97 | border-bottom: none; 98 | border-left-color: transparent; 99 | border-right-color: transparent; 100 | } 101 | 102 | .@{prefix}-tooltip-se .@{prefix}-tooltip-arrow { 103 | bottom: 0; 104 | right: 10px; 105 | border-top-style: solid; 106 | border-bottom: none; 107 | border-left-color: transparent; 108 | border-right-color: transparent; 109 | } 110 | 111 | .@{prefix}-tooltip-e .@{prefix}-tooltip-arrow { 112 | right: 0; 113 | top: 50%; 114 | margin-top: -5px; 115 | border-left-style: solid; 116 | border-right: none; 117 | border-top-color: transparent; 118 | border-bottom-color: transparent; 119 | } 120 | 121 | .@{prefix}-tooltip-w .@{prefix}-tooltip-arrow { 122 | left: 0; 123 | top: 50%; 124 | margin-top: -5px; 125 | border-right-style: solid; 126 | border-left: none; 127 | border-top-color: transparent; 128 | border-bottom-color: transparent; 129 | } 130 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/Window.less: -------------------------------------------------------------------------------- 1 | // Window 2 | 3 | .@{prefix}-fullscreen { 4 | border: 0; padding: 0; margin: 0; 5 | overflow: hidden; 6 | height: 100%; 7 | } 8 | 9 | div.@{prefix}-fullscreen { 10 | position: fixed; 11 | top: 0; left: 0; 12 | } 13 | 14 | #@{prefix}-modal-block { 15 | .opacity(0); 16 | position: fixed; 17 | left: 0; top: 0; 18 | width: 100%; height: 100%; 19 | background: @window-modalblock-bg; 20 | } 21 | 22 | #@{prefix}-modal-block.@{prefix}-in { 23 | .opacity(@window-modalblock-opacity); 24 | } 25 | 26 | .@{prefix}-window-move { 27 | cursor: move; 28 | } 29 | 30 | .@{prefix}-window { 31 | .border-radius(6px); 32 | .box-shadow(@window-box-shadow); 33 | .reset-gradient(); 34 | background: @window-bg; 35 | position: fixed; 36 | top: 0; left: 0; 37 | opacity: 0; 38 | .transition(opacity 150ms ease-in); 39 | } 40 | 41 | .@{prefix}-window.@{prefix}-in { 42 | opacity: 1; 43 | } 44 | 45 | .@{prefix}-window-head { 46 | padding: 9px 15px; 47 | border-bottom: 1px solid @window-head-border; 48 | position: relative; 49 | } 50 | 51 | .@{prefix}-window-head .@{prefix}-close { 52 | position: absolute; 53 | right: 15px; 54 | top: 9px; 55 | font-size: 20px; 56 | font-weight: bold; 57 | line-height: 20px; 58 | color: @window-head-close; 59 | cursor: pointer; 60 | 61 | // IE7 62 | height: 20px; 63 | overflow: hidden; 64 | } 65 | 66 | .@{prefix}-close:hover { 67 | color: @window-head-close-hover; 68 | } 69 | 70 | .@{prefix}-window-head .@{prefix}-title { 71 | line-height: 20px; 72 | font-size: @window-title-font-size; 73 | font-weight: bold; 74 | text-rendering: optimizelegibility; 75 | padding-right: 10px; 76 | } 77 | 78 | .@{prefix}-window .@{prefix}-container-body { 79 | display: block; 80 | } 81 | 82 | .@{prefix}-foot { 83 | display: block; 84 | background-color: @window-foot-bg; 85 | border-top: 1px solid @window-foot-border; 86 | .border-radius(0 0 6px 6px); 87 | } 88 | 89 | .@{prefix}-window-head .@{prefix}-dragh { 90 | position: absolute; 91 | top: 0; left: 0; 92 | cursor: move; 93 | width: 90%; 94 | height: 100%; 95 | } 96 | 97 | .@{prefix}-window iframe { 98 | width: 100%; 99 | height: 100%; 100 | } 101 | 102 | .@{prefix}-window.@{prefix}-fullscreen, .@{prefix}-window.@{prefix}-fullscreen .@{prefix}-foot { 103 | .border-radius(0); 104 | } 105 | 106 | .@{prefix}-window-body .@{prefix}-listbox { 107 | border-color: @btn-border-hover; 108 | } 109 | 110 | // RTL 111 | 112 | .@{prefix}-rtl .@{prefix}-window-head .@{prefix}-close { 113 | position: absolute; 114 | right: auto; 115 | left: 15px; 116 | } 117 | 118 | .@{prefix}-rtl .@{prefix}-window-head .@{prefix}-dragh { 119 | left: auto; 120 | right: 0; 121 | } 122 | 123 | .@{prefix}-rtl .@{prefix}-window-head .@{prefix}-title { 124 | direction: rtl; 125 | text-align: right; 126 | } 127 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/content.inline.min.css: -------------------------------------------------------------------------------- 1 | .mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:0 0;text-decoration:none;color:#000;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:400;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333} -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/content.min.css: -------------------------------------------------------------------------------- 1 | body{background-color:#FFF;color:#000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:0 0;text-decoration:none;color:#000;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:400;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333} -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/fonts/readme.md: -------------------------------------------------------------------------------- 1 | Icons are generated and provided by the http://icomoon.io service. 2 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/fonts/tinymce-small.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/skins/lightgray/fonts/tinymce-small.eot -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/fonts/tinymce-small.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/skins/lightgray/fonts/tinymce-small.woff -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/fonts/tinymce.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/skins/lightgray/fonts/tinymce.eot -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/fonts/tinymce.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/skins/lightgray/fonts/tinymce.ttf -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/fonts/tinymce.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/skins/lightgray/fonts/tinymce.woff -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/img/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/skins/lightgray/img/anchor.gif -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/skins/lightgray/img/loader.gif -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/img/object.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/skins/lightgray/img/object.gif -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/img/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/static/js/tinymce/skins/lightgray/img/trans.gif -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/skin.dev.less: -------------------------------------------------------------------------------- 1 | @import "Variables.less"; 2 | @import "Reset.less"; 3 | @import "Mixins.less"; 4 | @import "Animations.less"; 5 | @import "TinyMCE.less"; 6 | @import "CropRect.less"; 7 | @import "ImagePanel.less"; 8 | @import "Container.less"; 9 | @import "Scrollable.less"; 10 | @import "Panel.less"; 11 | @import "FloatPanel.less"; 12 | @import "Window.less"; 13 | @import "AbsoluteLayout.less"; 14 | @import "ToolTip.less"; 15 | @import "Button.less"; 16 | @import "ButtonGroup.less"; 17 | @import "Checkbox.less"; 18 | @import "ComboBox.less"; 19 | @import "ColorBox.less"; 20 | @import "ColorButton.less"; 21 | @import "ColorPicker.less"; 22 | @import "Path.less"; 23 | @import "FieldSet.less"; 24 | @import "FitLayout.less"; 25 | @import "FlowLayout.less"; 26 | @import "Iframe.less"; 27 | @import "Label.less"; 28 | @import "MenuBar.less"; 29 | @import "MenuButton.less"; 30 | @import "MenuItem.less"; 31 | @import "Menu.less"; 32 | @import "ListBox.less"; 33 | @import "Radio.less"; 34 | @import "ResizeHandle.less"; 35 | @import "Slider.less"; 36 | @import "Spacer.less"; 37 | @import "SplitButton.less"; 38 | @import "StackLayout.less"; 39 | @import "TabPanel.less"; 40 | @import "TextBox.less"; 41 | @import "Throbber.less"; 42 | @import "Icons.less"; 43 | -------------------------------------------------------------------------------- /template/static/js/tinymce/skins/lightgray/skin.ie7.dev.less: -------------------------------------------------------------------------------- 1 | @import "Variables.less"; 2 | @import "Reset.less"; 3 | @import "Mixins.less"; 4 | @import "Animations.less"; 5 | @import "TinyMCE.less"; 6 | @import "CropRect.less"; 7 | @import "ImagePanel.less"; 8 | @import "Container.less"; 9 | @import "Scrollable.less"; 10 | @import "Panel.less"; 11 | @import "FloatPanel.less"; 12 | @import "Window.less"; 13 | @import "AbsoluteLayout.less"; 14 | @import "ToolTip.less"; 15 | @import "Button.less"; 16 | @import "ButtonGroup.less"; 17 | @import "Checkbox.less"; 18 | @import "ComboBox.less"; 19 | @import "ColorBox.less"; 20 | @import "ColorButton.less"; 21 | @import "ColorPicker.less"; 22 | @import "Path.less"; 23 | @import "FieldSet.less"; 24 | @import "FitLayout.less"; 25 | @import "FlowLayout.less"; 26 | @import "Iframe.less"; 27 | @import "Label.less"; 28 | @import "MenuBar.less"; 29 | @import "MenuButton.less"; 30 | @import "MenuItem.less"; 31 | @import "Menu.less"; 32 | @import "ListBox.less"; 33 | @import "Radio.less"; 34 | @import "ResizeHandle.less"; 35 | @import "Slider.less"; 36 | @import "Spacer.less"; 37 | @import "SplitButton.less"; 38 | @import "StackLayout.less"; 39 | @import "TabPanel.less"; 40 | @import "TextBox.less"; 41 | @import "Throbber.less"; 42 | @import "Icons.Ie7.less"; 43 | -------------------------------------------------------------------------------- /template/test/e2e/custom-assertions/elementCount.js: -------------------------------------------------------------------------------- 1 | // A custom Nightwatch assertion. 2 | // the name of the method is the filename. 3 | // can be used in tests like this: 4 | // 5 | // browser.assert.elementCount(selector, count) 6 | // 7 | // for how to write custom assertions see 8 | // http://nightwatchjs.org/guide#writing-custom-assertions 9 | exports.assertion = function (selector, count) { 10 | this.message = 'Testing if element <' + selector + '> has count: ' + count 11 | this.expected = count 12 | this.pass = function (val) { 13 | return val === this.expected 14 | } 15 | this.value = function (res) { 16 | return res.value 17 | } 18 | this.command = function (cb) { 19 | var self = this 20 | return this.api.execute(function (selector) { 21 | return document.querySelectorAll(selector).length 22 | }, [selector], function (res) { 23 | cb.call(self, res) 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /template/test/e2e/nightwatch.conf.js: -------------------------------------------------------------------------------- 1 | require('babel-register') 2 | var config = require('../../config') 3 | 4 | // http://nightwatchjs.org/guide#settings-file 5 | module.exports = { 6 | src_folders: ['test/e2e/specs'], 7 | output_folder: 'test/e2e/reports', 8 | custom_assertions_path: ['test/e2e/custom-assertions'], 9 | 10 | selenium: { 11 | start_process: true, 12 | server_path: 'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.1.jar', 13 | host: '127.0.0.1', 14 | port: 4444, 15 | cli_args: { 16 | 'webdriver.chrome.driver': require('chromedriver').path 17 | } 18 | }, 19 | 20 | test_settings: { 21 | default: { 22 | selenium_port: 4444, 23 | selenium_host: 'localhost', 24 | silent: true, 25 | globals: { 26 | devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port) 27 | } 28 | }, 29 | 30 | chrome: { 31 | desiredCapabilities: { 32 | browserName: 'chrome', 33 | javascriptEnabled: true, 34 | acceptSslCerts: true 35 | } 36 | }, 37 | 38 | firefox: { 39 | desiredCapabilities: { 40 | browserName: 'firefox', 41 | javascriptEnabled: true, 42 | acceptSslCerts: true 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /template/test/e2e/runner.js: -------------------------------------------------------------------------------- 1 | // 1. start the dev server using production config 2 | process.env.NODE_ENV = 'testing' 3 | var server = require('../../build/dev-server.js') 4 | 5 | // 2. run the nightwatch test suite against it 6 | // to run in additional browsers: 7 | // 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings" 8 | // 2. add it to the --env flag below 9 | // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox` 10 | // For more information on Nightwatch's config file, see 11 | // http://nightwatchjs.org/guide#settings-file 12 | var opts = process.argv.slice(2) 13 | if (opts.indexOf('--config') === -1) { 14 | opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js']) 15 | } 16 | if (opts.indexOf('--env') === -1) { 17 | opts = opts.concat(['--env', 'chrome']) 18 | } 19 | 20 | var spawn = require('cross-spawn') 21 | var runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' }) 22 | 23 | runner.on('exit', function (code) { 24 | server.close() 25 | process.exit(code) 26 | }) 27 | 28 | runner.on('error', function (err) { 29 | server.close() 30 | throw err 31 | }) 32 | -------------------------------------------------------------------------------- /template/test/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // For authoring Nightwatch tests, see 2 | // http://nightwatchjs.org/guide#usage 3 | 4 | module.exports = { 5 | 'default e2e tests': function (browser) { 6 | // automatically uses dev Server port from /config.index.js 7 | // default: http://localhost:8080 8 | // see nightwatch.conf.js 9 | const devServer = browser.globals.devServerURL 10 | 11 | browser 12 | .url(devServer) 13 | .waitForElementVisible('#app', 5000) 14 | .assert.elementPresent('.hello') 15 | .assert.containsText('h1', 'Welcome to Your Vue.js App') 16 | .assert.elementCount('img', 1) 17 | .end() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /template/test/unit/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true 4 | }, 5 | "globals": { 6 | "expect": true, 7 | "sinon": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /template/test/unit/coverage/lcov-report/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} 2 | -------------------------------------------------------------------------------- /template/test/unit/coverage/lcov-report/sort-arrow-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynzz/element-admin/aa7b7372a6541075721a981269bc352625353ba3/template/test/unit/coverage/lcov-report/sort-arrow-sprite.png -------------------------------------------------------------------------------- /template/test/unit/coverage/lcov-report/src/api/user.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for src/api/user.js 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | all files / src/api/ user.js 20 |

21 |
22 |
23 | 87.5% 24 | Statements 25 | 7/8 26 |
27 |
28 | 100% 29 | Branches 30 | 4/4 31 |
32 |
33 | 50% 34 | Functions 35 | 1/2 36 |
37 |
38 | 75% 39 | Lines 40 | 3/4 41 |
42 |
43 | 1 branch 44 | Ignored      45 |
46 |
47 |
48 |
49 |

50 | 
69 | 
1 51 | 2 52 | 3 53 | 4 54 | 5 55 | 6 56 | 7 57 |   58 | 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 |  
70 |
71 |
72 | 76 | 77 | 78 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /template/test/unit/coverage/lcov-report/src/views/index.vue.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code coverage report for src/views/index.vue 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |
17 |
18 |

19 | all files / src/views/ index.vue 20 |

21 |
22 |
23 | 100% 24 | Statements 25 | 2/2 26 |
27 |
28 | 100% 29 | Branches 30 | 0/0 31 |
32 |
33 | 100% 34 | Functions 35 | 0/0 36 |
37 |
38 | 100% 39 | Lines 40 | 1/1 41 |
42 |
43 |
44 |
45 |

46 | 
77 | 
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 |  
78 |
79 |
80 | 84 | 85 | 86 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /template/test/unit/index.js: -------------------------------------------------------------------------------- 1 | // Polyfill fn.bind() for PhantomJS 2 | /* eslint-disable no-extend-native */ 3 | Function.prototype.bind = require('function-bind') 4 | 5 | // require all test files (files that ends with .spec.js) 6 | const testsContext = require.context('./specs', true, /\.spec$/) 7 | testsContext.keys().forEach(testsContext) 8 | 9 | // require all src files except main.js for coverage. 10 | // you can also change this to match only the subset of files that 11 | // you want coverage for. 12 | const srcContext = require.context('src', true, /^\.\/(?!main(\.js)?$)/) 13 | srcContext.keys().forEach(srcContext) 14 | -------------------------------------------------------------------------------- /template/test/unit/karma.conf.js: -------------------------------------------------------------------------------- 1 | // This is a karma config file. For more details see 2 | // http://karma-runner.github.io/0.13/config/configuration-file.html 3 | // we are also using it with karma-webpack 4 | // https://github.com/webpack/karma-webpack 5 | 6 | var path = require('path') 7 | var merge = require('webpack-merge') 8 | var baseConfig = require('../../build/webpack.base.conf') 9 | var utils = require('../../build/utils') 10 | var webpack = require('webpack') 11 | var projectRoot = path.resolve(__dirname, '../../') 12 | 13 | var webpackConfig = merge(baseConfig, { 14 | // use inline sourcemap for karma-sourcemap-loader 15 | module: { 16 | loaders: utils.styleLoaders() 17 | }, 18 | devtool: '#inline-source-map', 19 | vue: { 20 | loaders: { 21 | js: 'isparta' 22 | } 23 | }, 24 | plugins: [ 25 | new webpack.DefinePlugin({ 26 | 'process.env': require('../../config/test.env') 27 | }) 28 | ] 29 | }) 30 | 31 | // no need for app entry during tests 32 | delete webpackConfig.entry 33 | 34 | // make sure isparta loader is applied before eslint 35 | webpackConfig.module.preLoaders = webpackConfig.module.preLoaders || [] 36 | webpackConfig.module.preLoaders.unshift({ 37 | test: /\.js$/, 38 | loader: 'isparta', 39 | include: path.resolve(projectRoot, 'src') 40 | }) 41 | 42 | // only apply babel for test files when using isparta 43 | webpackConfig.module.loaders.some(function (loader, i) { 44 | if (loader.loader === 'babel') { 45 | loader.include = path.resolve(projectRoot, 'test/unit') 46 | return true 47 | } 48 | }) 49 | 50 | module.exports = function (config) { 51 | config.set({ 52 | // to run in additional browsers: 53 | // 1. install corresponding karma launcher 54 | // http://karma-runner.github.io/0.13/config/browsers.html 55 | // 2. add it to the `browsers` array below. 56 | browsers: ['PhantomJS'], 57 | frameworks: ['mocha', 'sinon-chai'], 58 | reporters: ['spec', 'coverage'], 59 | files: ['./index.js'], 60 | preprocessors: { 61 | './index.js': ['webpack', 'sourcemap'] 62 | }, 63 | webpack: webpackConfig, 64 | webpackMiddleware: { 65 | noInfo: true 66 | }, 67 | coverageReporter: { 68 | dir: './coverage', 69 | reporters: [ 70 | { type: 'lcov', subdir: '.' }, 71 | { type: 'text-summary' } 72 | ] 73 | } 74 | }) 75 | } 76 | -------------------------------------------------------------------------------- /template/test/unit/specs/Editor.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Editor from 'src/components/Editor.vue' 3 | 4 | describe('Editor.vue', () => { 5 | let vm 6 | before(() => { 7 | vm = new Vue({ 8 | el: document.createElement('div'), 9 | template: ``, 10 | components: {Editor}, 11 | data () { 12 | return { 13 | value: 'hello' 14 | } 15 | } 16 | }) 17 | }) 18 | it('init currentContent', () => { 19 | Vue.nextTick(() => { 20 | expect(vm.$refs.editor.currentContent).to.equal('hello') 21 | }) 22 | }) 23 | 24 | it('set currentContent', () => { 25 | Vue.nextTick(() => { 26 | vm.$refs.editor.currentContent = 'hello3' 27 | expect(vm.value).to.equal('hello3') 28 | }) 29 | }) 30 | }) 31 | --------------------------------------------------------------------------------