├── demo ├── img │ ├── favicon.ico │ └── preview.gif ├── fw │ └── ext │ │ ├── appHighlight.js │ │ ├── appExpandBall.js │ │ ├── index.js │ │ └── appRouter.js ├── features │ ├── home │ │ ├── route.js │ │ ├── subs │ │ │ ├── about.vue │ │ │ ├── contribution.vue │ │ │ └── github.vue │ │ └── index.vue │ ├── common │ │ ├── directives │ │ │ ├── index.js │ │ │ └── highlight.js │ │ └── components │ │ │ └── topnav.vue │ ├── apidoc │ │ ├── route.js │ │ ├── subs │ │ │ ├── api-sidebar.vue │ │ │ ├── api-content.vue │ │ │ └── docExpandBall.vue │ │ └── index.vue │ ├── quickstart │ │ ├── route.js │ │ ├── subs │ │ │ ├── install.vue │ │ │ ├── usage.vue │ │ │ └── import-it.vue │ │ └── index.vue │ └── index.js ├── index.js ├── index.html └── documentation.vue ├── .gitignore ├── .vscode └── settings.json ├── postcss.config.js ├── src ├── helper │ ├── event.js │ └── dom.js ├── index.js ├── directives │ ├── setupStyle.js │ ├── toggleExpand.js │ └── draggable.js └── components │ └── expand-ball.vue ├── bower.json ├── package.json ├── webpack.config.prod.js ├── README.md ├── webpack.config.js ├── .eslintrc ├── dist ├── vue-expand-ball.min.js └── vue-expand-ball.js ├── .esformatter └── LICENSE /demo/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leftstick/vue-expand-ball/HEAD/demo/img/favicon.ico -------------------------------------------------------------------------------- /demo/img/preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leftstick/vue-expand-ball/HEAD/demo/img/preview.gif -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #npm 2 | node_modules/ 3 | npm-debug.log 4 | 5 | #osx 6 | .DS_Store 7 | 8 | #build 9 | build/ -------------------------------------------------------------------------------- /demo/fw/ext/appHighlight.js: -------------------------------------------------------------------------------- 1 | import 'highlight.js'; 2 | import 'highlight.js/styles/atom-one-dark.css'; 3 | 4 | export default function() { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /demo/features/home/route.js: -------------------------------------------------------------------------------- 1 | import Home from './index'; 2 | 3 | export default [{ 4 | path: '/home', 5 | component: Home, 6 | isDefault: true 7 | }]; 8 | -------------------------------------------------------------------------------- /demo/features/common/directives/index.js: -------------------------------------------------------------------------------- 1 | import highlight from './highlight'; 2 | 3 | export default [{ 4 | name: 'highlight', 5 | directive: highlight 6 | }]; 7 | -------------------------------------------------------------------------------- /demo/features/apidoc/route.js: -------------------------------------------------------------------------------- 1 | import Apidoc from './index'; 2 | 3 | export default [{ 4 | path: '/apidoc', 5 | component: Apidoc, 6 | isDefault: false 7 | }]; 8 | -------------------------------------------------------------------------------- /demo/fw/ext/appExpandBall.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import {VueExpandBall} from '../../../src'; 3 | 4 | export default function() { 5 | Vue.use(VueExpandBall); 6 | } 7 | -------------------------------------------------------------------------------- /demo/features/quickstart/route.js: -------------------------------------------------------------------------------- 1 | import QuickStart from './index'; 2 | 3 | export default [{ 4 | path: '/quickstart', 5 | component: QuickStart, 6 | isDefault: false 7 | }]; 8 | -------------------------------------------------------------------------------- /demo/features/index.js: -------------------------------------------------------------------------------- 1 | import home from './home/route'; 2 | import quickstart from './quickstart/route'; 3 | import apidoc from './apidoc/route'; 4 | 5 | export const routes = [...home, ...quickstart, ...apidoc]; 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "editor.formatOnSave": true, 4 | "html.format.enable": false, 5 | "javascript.validate.enable": false, 6 | "files.associations": { 7 | "*.css": "postcss" 8 | } 9 | } -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | const autoprefixer = require('autoprefixer'); 2 | const postcssVars = require('postcss-simple-vars'); 3 | 4 | module.exports = { 5 | plugins: [ 6 | autoprefixer({ 7 | browsers: ['last 5 versions'] 8 | }), 9 | postcssVars() 10 | ] 11 | }; 12 | -------------------------------------------------------------------------------- /src/helper/event.js: -------------------------------------------------------------------------------- 1 | 2 | export function stop(e) { 3 | if (e.stopPropagation) { 4 | e.stopPropagation(); 5 | } 6 | if (e.stopImmediatePropagation) { 7 | e.stopImmediatePropagation(); 8 | } 9 | if (e.preventDefault) { 10 | e.preventDefault(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /demo/fw/ext/index.js: -------------------------------------------------------------------------------- 1 | import appRouter from './appRouter'; 2 | import appHighlight from './appHighlight'; 3 | import appExpandBall from './appExpandBall'; 4 | 5 | export default function() { 6 | appHighlight(); 7 | appExpandBall(); 8 | return { 9 | router: appRouter() 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import ExpandBall from './components/expand-ball'; 2 | 3 | const components = [ 4 | ExpandBall 5 | ]; 6 | 7 | export const VueExpandBall = { 8 | install(Vue) { 9 | if (VueExpandBall.installed) { 10 | return; 11 | } 12 | 13 | components.forEach(_component => { 14 | Vue.component(_component.name, _component); 15 | }); 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /demo/features/common/directives/highlight.js: -------------------------------------------------------------------------------- 1 | import hljs from 'highlight.js'; 2 | 3 | export default { 4 | bind(el, bindings) { 5 | const snippets = el.querySelectorAll('.snippet pre code'); 6 | Array 7 | .prototype 8 | .slice 9 | .apply(snippets) 10 | .forEach(s => { 11 | hljs.highlightBlock(s); 12 | }); 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /demo/features/home/subs/about.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-expand-ball", 3 | "description": "A damn easy expandable menu", 4 | "main": [ 5 | "dist/vue-expand-ball.js", 6 | "dist/vue-expand-ball.min.js" 7 | ], 8 | "moduleType": [ 9 | "amd", 10 | "globals", 11 | "node", 12 | "es6" 13 | ], 14 | "authors": [ 15 | "Howard.Zuo" 16 | ], 17 | "license": "GPL-3.0", 18 | "keywords": [ 19 | "vue", 20 | "menu" 21 | ], 22 | "homepage": "https://github.com/leftstick/vue-expand-ball", 23 | "ignore": [ 24 | "**/.*", 25 | "node_modules" 26 | ] 27 | } -------------------------------------------------------------------------------- /demo/features/home/subs/contribution.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /demo/features/home/subs/github.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /demo/fw/ext/appRouter.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import VueRouter from 'vue-router'; 3 | 4 | import {routes} from '../../features'; 5 | 6 | export default function() { 7 | Vue.use(VueRouter); 8 | 9 | let defaultPaths = routes 10 | .filter(route => route.isDefault) 11 | .map(route => route.path); 12 | 13 | if (!defaultPaths.length) { 14 | defaultPaths = [routes[0].path]; 15 | } 16 | 17 | const defaultRoute = { 18 | path: '*', 19 | redirect: defaultPaths[0] 20 | }; 21 | 22 | return new VueRouter({ 23 | routes: [...routes, defaultRoute], 24 | mode: 'hash', 25 | scrollBehavior: function(to, from, savedPosition) { 26 | const defaultPos = { 27 | x: 0, 28 | y: 0 29 | }; 30 | return savedPosition || defaultPos; 31 | } 32 | }); 33 | } 34 | -------------------------------------------------------------------------------- /demo/features/common/components/topnav.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /src/directives/setupStyle.js: -------------------------------------------------------------------------------- 1 | import {retrieveMenuNodes} from '../helper/dom'; 2 | 3 | export default { 4 | bind(el, bindings, vnode) { 5 | const {ballSize, menuSize, ballColor, menuColor} = bindings.value; 6 | const ballEl = el.querySelector('.center-ball'); 7 | 8 | el.style.width = ballSize + 'px'; 9 | el.style.height = ballSize + 'px'; 10 | el.style.lineHeight = ballSize + 'px'; 11 | 12 | ballEl.style.width = ballSize + 'px'; 13 | ballEl.style.height = ballSize + 'px'; 14 | ballEl.style.lineHeight = ballSize + 'px'; 15 | ballEl.style.backgroundColor = ballColor; 16 | 17 | retrieveMenuNodes(el) 18 | .forEach(node => { 19 | node.style.backgroundColor = menuColor; 20 | node.style.width = menuSize + 'px'; 21 | node.style.height = menuSize + 'px'; 22 | node.style.lineHeight = menuSize + 'px'; 23 | node.style.top = (ballSize - menuSize) / 2 + 'px'; 24 | node.style.left = (ballSize - menuSize) / 2 + 'px'; 25 | }); 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /src/directives/toggleExpand.js: -------------------------------------------------------------------------------- 1 | import {retrieveMenuNodes} from '../helper/dom'; 2 | 3 | export default { 4 | bind(el, bindings, vnode) { 5 | toggle(bindings, el); 6 | }, 7 | update(el, bindings, vnode) { 8 | toggle(bindings, el); 9 | } 10 | }; 11 | 12 | 13 | function toggle(bindings, el) { 14 | const nodes = retrieveMenuNodes(el); 15 | const {expanded, radius, ballSize, menuSize} = bindings.value; 16 | if (expanded) { 17 | return nodes 18 | .forEach((node, index) => { 19 | node.style.transitionDelay = (100 * index) + 'ms'; 20 | node.style.webkitTransitionDelay = (100 * index) + 'ms'; 21 | node.style.left = parseInt(node.style.left) + (radius * Math.cos(2 * Math.PI / 360 * (360 / nodes.length * index))) + 'px'; 22 | node.style.top = parseInt(node.style.top) + (-radius * Math.sin(2 * Math.PI / 360 * (360 / nodes.length * index))) + 'px'; 23 | }); 24 | } 25 | nodes 26 | .forEach((node, index) => { 27 | node.style.top = (ballSize - menuSize) / 2 + 'px'; 28 | node.style.left = (ballSize - menuSize) / 2 + 'px'; 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /demo/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import extensions from './fw/ext'; 3 | import directives from './features/common//directives'; 4 | import documentation from './documentation'; 5 | 6 | class App { 7 | 8 | constructor() { 9 | this.extensionsOpts = extensions(); 10 | Vue.config.devtools = process.env.NODE_ENV === 'dev'; 11 | } 12 | 13 | createVueOpts() { 14 | this.vueOps = { 15 | render(h) { 16 | return h(documentation); 17 | }, 18 | ...this.extensionsOpts 19 | }; 20 | } 21 | 22 | registerDirectives() { 23 | directives.forEach(dir => { 24 | Vue.directive(dir.name, dir.directive); 25 | }); 26 | } 27 | 28 | destroySplash() { 29 | document.head.removeChild(document.querySelector('#splash-spinner')); 30 | document.body.removeChild(document.querySelector('.spinner')); 31 | } 32 | 33 | launch() { 34 | new Vue(this.vueOps).$mount('#application'); 35 | } 36 | 37 | run() { 38 | this.createVueOpts(); 39 | this.registerDirectives(); 40 | this.destroySplash(); 41 | this.launch(); 42 | } 43 | 44 | } 45 | 46 | new App().run(); 47 | -------------------------------------------------------------------------------- /src/helper/dom.js: -------------------------------------------------------------------------------- 1 | 2 | export function retrieveMenuNodes(el) { 3 | return [].slice.apply(el.querySelector('.rounded-menus').childNodes).filter(node => node.nodeType === 1); 4 | } 5 | 6 | 7 | export function isDescendant(parent, child) { 8 | let node = child.parentNode; 9 | while (node !== null) { 10 | if (node === parent) { 11 | return true; 12 | } 13 | node = node.parentNode; 14 | } 15 | return false; 16 | } 17 | 18 | export const isTouchable = 'ontouchstart' in window; 19 | 20 | export const screenSize = document.documentElement; 21 | 22 | let original = {}; 23 | 24 | export function toggleScrollable(bool) { 25 | if (!bool) { 26 | original.height = document.body.style.height; 27 | original.position = document.body.style.position; 28 | 29 | document.body.style.touchAction = 'none'; 30 | document.body.style.msTouchAction = 'none'; 31 | document.body.style.height = '100%'; 32 | document.body.style.position = 'fixed'; 33 | return; 34 | } 35 | 36 | document.body.style.touchAction = ''; 37 | document.body.style.msTouchAction = ''; 38 | document.body.style.height = original.height; 39 | document.body.style.position = original.position; 40 | } 41 | -------------------------------------------------------------------------------- /demo/features/apidoc/subs/api-sidebar.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 20 | 21 | -------------------------------------------------------------------------------- /demo/features/quickstart/subs/install.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 34 | 35 | -------------------------------------------------------------------------------- /demo/features/quickstart/subs/usage.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 35 | 36 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | vue-expand-ball 7 | 8 | 22 | 45 | 46 | 47 | 48 |
49 |
50 | 51 | 52 | -------------------------------------------------------------------------------- /demo/features/home/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 37 | 38 | -------------------------------------------------------------------------------- /demo/features/quickstart/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 26 | 27 | 40 | 41 | -------------------------------------------------------------------------------- /demo/features/apidoc/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 39 | 40 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-expand-ball", 3 | "version": "1.1.0", 4 | "description": "A damn easy expandable menu", 5 | "main": "dist/vue-expand-ball.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git://github.com/leftstick/vue-expand-ball.git" 9 | }, 10 | "scripts": { 11 | "start": "webpack-dev-server --content-base build/ --hot --inline --host 0.0.0.0 --port 8080", 12 | "dist": "rm -rf dist && webpack --config webpack.config.prod.js", 13 | "deployDemo": "webpack --env.isDemo && git checkout gh-pages && rm -f *.* && mv build/* ." 14 | }, 15 | "files": [ 16 | "dist/vue-expand-ball.js", 17 | "dist/vue-expand-ball.min.js" 18 | ], 19 | "keywords": [ 20 | "vue", 21 | "menu" 22 | ], 23 | "author": "Howard.Zuo", 24 | "license": "GPL-3.0", 25 | "bugs": { 26 | "url": "https://github.com/leftstick/vue-expand-ball/issues" 27 | }, 28 | "homepage": "https://github.com/leftstick/vue-expand-ball", 29 | "peerDependencies": { 30 | "vue": "^2.1.10" 31 | }, 32 | "devDependencies": { 33 | "vue": "^2.3.4", 34 | "vue-router": "^2.6.0", 35 | "autoprefixer": "^7.1.1", 36 | "babel-core": "^6.25.0", 37 | "babel-loader": "^7.1.0", 38 | "babel-plugin-transform-object-rest-spread": "^6.23.0", 39 | "babel-preset-es2015": "^6.24.1", 40 | "css-loader": "^0.28.4", 41 | "file-loader": "^0.11.2", 42 | "highlight.js": "^9.12.0", 43 | "html-webpack-plugin": "^2.28.0", 44 | "postcss-loader": "^2.0.6", 45 | "postcss-simple-vars": "^4.0.0", 46 | "style-loader": "^0.18.2", 47 | "vue-hot-reload-api": "^2.1.0", 48 | "vue-html-loader": "^1.2.4", 49 | "vue-loader": "^12.2.1", 50 | "vue-style-loader": "^3.0.1", 51 | "vue-template-compiler": "^2.3.4", 52 | "unminified-webpack-plugin": "^1.2.0", 53 | "webpack": "^3.0.0", 54 | "webpack-dev-server": "^2.5.0" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /demo/features/quickstart/subs/import-it.vue: -------------------------------------------------------------------------------- 1 | 38 | 39 | 42 | 43 | -------------------------------------------------------------------------------- /demo/features/apidoc/subs/api-content.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 29 | 30 | -------------------------------------------------------------------------------- /webpack.config.prod.js: -------------------------------------------------------------------------------- 1 | const {resolve} = require('path'); 2 | const webpack = require('webpack'); 3 | const UnminifiedWebpackPlugin = require('unminified-webpack-plugin'); 4 | 5 | module.exports = function() { 6 | return { 7 | entry: { 8 | index: resolve(__dirname, 'src', 'index.js') 9 | }, 10 | output: { 11 | path: resolve(__dirname, 'dist'), 12 | filename: 'vue-expand-ball.min.js', 13 | libraryTarget: 'umd' 14 | 15 | }, 16 | module: { 17 | rules: [ 18 | { 19 | test: /\.vue$/, 20 | use: [{ 21 | loader: 'vue-loader', 22 | options: { 23 | loaders: { 24 | js: 'babel-loader?{"presets":[["es2015", {"modules": false}]],"plugins": ["transform-object-rest-spread"]}', 25 | css: 'vue-style-loader!css-loader!postcss-loader' 26 | } 27 | } 28 | }] 29 | }, 30 | { 31 | test: /\.js$/, 32 | use: [ 33 | { 34 | loader: 'babel-loader', 35 | options: { 36 | presets: [['es2015', { 37 | modules: false 38 | }]], 39 | plugins: ['transform-object-rest-spread'] 40 | } 41 | } 42 | ], 43 | exclude: /node_modules/ 44 | } 45 | ] 46 | }, 47 | resolve: { 48 | modules: [ 49 | resolve(__dirname, 'node_modules'), 50 | resolve(__dirname, 'src') 51 | ], 52 | extensions: [ 53 | '.js', 54 | '.vue' 55 | ] 56 | }, 57 | plugins: [ 58 | new webpack.optimize.UglifyJsPlugin({ 59 | compress: { 60 | warnings: false 61 | } 62 | }), 63 | new UnminifiedWebpackPlugin() 64 | ] 65 | }; 66 | }; 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | vue-expand-ball 2 | ======================= 3 | [![NPM version][npm-image]][npm-url] 4 | ![][david-url] 5 | ![][dt-url] 6 | ![][license-url] 7 | 8 | A damn easy expandable menu without any extra dependency for `vue`. 9 | 10 | Read full documentation here: [documentation](https://leftstick.github.io/vue-expand-ball/) 11 | 12 | ![](./demo/img/preview.gif) 13 | 14 | ## Getting started 15 | 16 | This is a component requires vue `^2.1.10`. And ease the way to display a draggable menu item on your page. 17 | 18 | ## Requirements ## 19 | 20 | - [vue][vue-url] 21 | 22 | ## Install ## 23 | 24 | ### from npm ### 25 | 26 | ```bash 27 | npm install --save vue vue-expand-ball 28 | ``` 29 | 30 | ### from bower ### 31 | 32 | ```bash 33 | bower install --save vue vue-expand-ball 34 | ``` 35 | 36 | ## Import ## 37 | 38 | ### ES2015 ### 39 | 40 | ```javascript 41 | import {VueExpandBall} from 'vue-expand-ball'; 42 | ``` 43 | 44 | ### CommonJS ### 45 | 46 | ```javascript 47 | const {VueExpandBall} = require('vue-expand-ball'); 48 | ``` 49 | 50 | ### script ### 51 | 52 | ```html 53 | 54 | 55 | 56 | 57 | DEMO 58 | 59 | 60 | 61 | 62 | 63 | 66 | 67 | 68 | ``` 69 | 70 | ## Basic Usage ## 71 | 72 | ```css 73 | .ball-pos { 74 | bottom: 200px; 75 | right: 200px; 76 | } 77 | ``` 78 | 79 | ```html 80 | 81 | M1 82 | M2 83 | 84 | ``` 85 | 86 | ```javascript 87 | export default { 88 | methods: { 89 | clicked(str) { 90 | alert(str + ' is just clicked!!'); 91 | } 92 | } 93 | }; 94 | ``` 95 | 96 | 97 | ## LICENSE ## 98 | 99 | [GPL v3 License](https://raw.githubusercontent.com/leftstick/vue-expand-ball/master/LICENSE) 100 | 101 | 102 | [npm-url]: https://npmjs.org/package/vue-expand-ball 103 | [npm-image]: https://img.shields.io/npm/v/vue-expand-ball.svg 104 | [david-url]: https://david-dm.org/leftstick/vue-expand-ball.png 105 | [dt-url]:https://img.shields.io/npm/dt/vue-expand-ball.svg 106 | [license-url]:https://img.shields.io/npm/l/vue-expand-ball.svg 107 | [vue-url]:https://vuejs.org/ -------------------------------------------------------------------------------- /demo/documentation.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 20 | 21 | -------------------------------------------------------------------------------- /src/components/expand-ball.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 84 | 85 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const {resolve} = require('path'); 2 | const webpack = require('webpack'); 3 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 4 | 5 | module.exports = function(env = {}) { 6 | const {isDemo} = env; 7 | return { 8 | entry: { 9 | ext: resolve(__dirname, 'demo', 'fw', 'ext', 'index.js'), 10 | index: resolve(__dirname, 'demo', 'index.js') 11 | }, 12 | output: { 13 | path: resolve(__dirname, 'build'), 14 | filename: (isDemo ? '[hash].' : '') + '[name].bundle.js', 15 | chunkFilename: (isDemo ? '[hash].' : '') + '[id].bundle.js', 16 | publicPath: isDemo ? '/vue-expand-ball/' : '/' 17 | }, 18 | devtool: isDemo ? '' : '#source-map', 19 | module: { 20 | rules: [ 21 | { 22 | test: /\.css$/, 23 | use: [ 24 | 'style-loader', 25 | 'css-loader', 26 | 'postcss-loader' 27 | ] 28 | }, 29 | { 30 | test: /\.vue$/, 31 | use: [{ 32 | loader: 'vue-loader', 33 | options: { 34 | loaders: { 35 | js: 'babel-loader?{"presets":[["es2015", {"modules": false}]],"plugins": ["transform-object-rest-spread"]}', 36 | css: 'vue-style-loader!css-loader!postcss-loader?sourceMap=true' 37 | } 38 | } 39 | }] 40 | }, 41 | { 42 | test: /\.js$/, 43 | use: [ 44 | { 45 | loader: 'babel-loader', 46 | options: { 47 | presets: [['es2015', { 48 | modules: false 49 | }]], 50 | plugins: ['transform-object-rest-spread'] 51 | } 52 | } 53 | ], 54 | exclude: /node_modules/ 55 | }, 56 | { 57 | test: /\.(eot|svg|ttf|woff|woff2|png|gif)\w*/, 58 | use: ['file-loader'] 59 | } 60 | ] 61 | }, 62 | resolve: { 63 | modules: [ 64 | resolve(__dirname, 'node_modules'), 65 | resolve(__dirname, 'demo') 66 | ], 67 | extensions: [ 68 | '.js', 69 | '.vue' 70 | ] 71 | }, 72 | plugins: (isDemo ? [new webpack.optimize.UglifyJsPlugin({ 73 | compress: { 74 | warnings: false 75 | } 76 | })] : []).concat([ 77 | new webpack.optimize.CommonsChunkPlugin({ 78 | name: ['app', 'ext'] 79 | }), 80 | new HtmlWebpackPlugin({ 81 | filename: 'index.html', 82 | inject: 'body', 83 | template: resolve(__dirname, 'demo', 'index.html'), 84 | favicon: resolve(__dirname, 'demo', 'img', 'favicon.ico'), 85 | hash: false 86 | }) 87 | ]) 88 | } 89 | }; 90 | -------------------------------------------------------------------------------- /src/directives/draggable.js: -------------------------------------------------------------------------------- 1 | import {isDescendant, isTouchable, screenSize, toggleScrollable} from '../helper/dom'; 2 | import {stop} from '../helper/event'; 3 | 4 | const listeners = {}; 5 | 6 | export default { 7 | bind(el, bindings, vnode) { 8 | 9 | const {startEvent, moveEvent, endEvent} = geAvailableEvents(); 10 | 11 | el.dataset.listenerId = 'listener_' + new Date().getTime(); 12 | 13 | listeners[el.dataset.listenerId] = [{ 14 | name: startEvent, 15 | listener: startDrag 16 | }, { 17 | name: endEvent, 18 | listener: stopDrag 19 | }]; 20 | 21 | let timer = null, 22 | coordinates = null; 23 | 24 | function mouseMoveHandler(e) { 25 | const evt = e || window.e; 26 | const coords = getCoords(evt); 27 | stop(e); 28 | const offsetX = parseFloat(coordinates.x); 29 | const offsetY = parseFloat(coordinates.y); 30 | if (coords.x !== offsetX || coords.y !== offsetY) { 31 | moveElement(el, coords.x - offsetX, coords.y - offsetY); 32 | coordinates = coords; 33 | } 34 | return false; 35 | } 36 | 37 | function startDrag(e) { 38 | if (!isDescendant(el, e.target)) { 39 | return false; 40 | } 41 | 42 | isTouchable && toggleScrollable(false); 43 | 44 | timer = setTimeout(() => { 45 | el.dataset.dragging = 'true'; 46 | const evt = e || window.e; 47 | if (evt.preventDefault) { 48 | evt.preventDefault(); 49 | } 50 | 51 | coordinates = getCoords(evt); 52 | 53 | document.body.addEventListener(moveEvent, mouseMoveHandler, { 54 | passive: false, 55 | cancelable: true 56 | }); 57 | }, 100); 58 | return false; 59 | } 60 | 61 | function stopDrag(e) { 62 | if (timer) { 63 | adjustBall(el); 64 | } 65 | clearTimeout(timer); 66 | timer = null; 67 | 68 | document.body.removeEventListener(moveEvent, mouseMoveHandler); 69 | 70 | setTimeout(() => { 71 | el.dataset.dragging = ''; 72 | isTouchable && toggleScrollable(true); 73 | }, 50); 74 | return false; 75 | } 76 | 77 | window.addEventListener(startEvent, startDrag, { 78 | passive: false, 79 | cancelable: true 80 | }); 81 | window.addEventListener(endEvent, stopDrag, false); 82 | }, 83 | 84 | unbind(el) { 85 | if (listeners[el.dataset.listenerId] && listeners[el.dataset.listenerId].length) { 86 | listeners[el.dataset.listenerId].forEach(listener => { 87 | window.removeEventListener(listener.name, listener.listener); 88 | }); 89 | delete listeners[el.dataset.listenerId]; 90 | } 91 | } 92 | }; 93 | 94 | function adjustBall(ball) { 95 | const {top, left, right, bottom, width, height} = ball.getBoundingClientRect(); 96 | 97 | if (top < 0) { 98 | ball.style.top = '1px'; 99 | } 100 | if (left < 0) { 101 | ball.style.left = '1px'; 102 | } 103 | if (bottom > screenSize.clientHeight) { 104 | ball.style.top = screenSize.clientHeight - height - 1 + 'px'; 105 | } 106 | if (right > screenSize.clientWidth) { 107 | ball.style.left = screenSize.clientWidth - width - 1 + 'px'; 108 | } 109 | } 110 | 111 | function getCoords(event) { 112 | // touch move and touch end have different touch data 113 | const touches = event.touches, 114 | data = touches && touches.length ? touches : event.changedTouches; 115 | 116 | return { 117 | x: isTouchable ? data[0].clientX : event.pageX, 118 | y: isTouchable ? data[0].clientY : event.pageY 119 | }; 120 | } 121 | 122 | function geAvailableEvents() { 123 | return { 124 | startEvent: isTouchable ? 'touchstart' : 'mousedown', 125 | moveEvent: isTouchable ? 'touchmove' : 'mousemove', 126 | endEvent: isTouchable ? 'touchend' : 'mouseup' 127 | }; 128 | } 129 | 130 | function moveElement(el, x, y) { 131 | let left = parseFloat(window.getComputedStyle(el).left); 132 | if (!left) { 133 | left = screenSize.clientWidth - parseFloat(window.getComputedStyle(el).right); 134 | } 135 | 136 | let top = parseFloat(window.getComputedStyle(el).top); 137 | if (!top) { 138 | top = screenSize.clientHeight - parseFloat(window.getComputedStyle(el).bottom); 139 | } 140 | el.style.left = (left + x) + 'px'; 141 | el.style.top = (top + y) + 'px'; 142 | } 143 | -------------------------------------------------------------------------------- /demo/features/apidoc/subs/docExpandBall.vue: -------------------------------------------------------------------------------- 1 | 166 | 167 | 185 | 186 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions":{ 3 | "ecmaVersion": 6, 4 | "sourceType": "module", 5 | "ecmaFeatures": { 6 | "globalReturn": true, 7 | "impliedStrict": false, 8 | "jsx": false, 9 | "experimentalObjectRestSpread": true 10 | } 11 | }, 12 | "env": { 13 | "shared-node-browser": true, 14 | "browser": true, 15 | "commonjs": true, 16 | "node": true, 17 | "es6": true, 18 | "mocha": true, 19 | "jquery": true 20 | }, 21 | "rules": { 22 | "comma-dangle": [2, "never"], 23 | "no-cond-assign": [2, "except-parens"], 24 | "no-console": 0, 25 | "no-constant-condition": 1, 26 | "no-control-regex": 2, 27 | "no-debugger": 2, 28 | "no-dupe-args": 2, 29 | "no-dupe-keys": 2, 30 | "no-duplicate-case": 2, 31 | "no-empty-character-class": 1, 32 | "no-empty": 1, 33 | "no-ex-assign": 2, 34 | "no-extra-boolean-cast": 1, 35 | "no-extra-parens": [1, "functions"], 36 | "no-extra-semi": 2, 37 | "no-func-assign": 2, 38 | "no-inner-declarations": [1, "functions"], 39 | "no-invalid-regexp": 2, 40 | "no-irregular-whitespace": 1, 41 | "no-negated-in-lhs": 2, 42 | "no-obj-calls": 2, 43 | "no-regex-spaces": 1, 44 | "no-sparse-arrays": 2, 45 | "no-unexpected-multiline": 2, 46 | "no-unreachable": 2, 47 | "use-isnan": 2, 48 | "valid-jsdoc": 0, 49 | "valid-typeof": 2, 50 | "accessor-pairs": [1, { "getWithoutSet": true, "setWithoutGet": true }], 51 | "array-callback-return": 1, 52 | "block-scoped-var": 0, 53 | "complexity": [1, 20], 54 | "consistent-return": 0, 55 | "curly": 1, 56 | "default-case": 2, 57 | "dot-location": [1, "property"], 58 | "dot-notation": [1, { "allowKeywords": true}], 59 | "eqeqeq": 2, 60 | "guard-for-in": 0, 61 | "no-alert": 2, 62 | "no-caller": 2, 63 | "no-case-declarations": 2, 64 | "no-div-regex": 1, 65 | "no-else-return": 1, 66 | "no-empty-function": 0, 67 | "no-empty-pattern": 2, 68 | "no-eq-null": 2, 69 | "no-eval": 2, 70 | "no-extend-native": 1, 71 | "no-extra-bind": 1, 72 | "no-extra-label": 1, 73 | "no-fallthrough": 2, 74 | "no-floating-decimal": 2, 75 | "no-implicit-coercion": 0, 76 | "no-implicit-globals": 0, 77 | "no-implied-eval": 2, 78 | "no-invalid-this": 0, 79 | "no-iterator": 1, 80 | "no-labels": [2, {"allowLoop": false, "allowSwitch": false}], 81 | "no-lone-blocks": 2, 82 | "no-loop-func": 2, 83 | "no-magic-numbers": 0, 84 | "no-multi-spaces": 1, 85 | "no-multi-str": 2, 86 | "no-native-reassign": 2, 87 | "no-new-func": 2, 88 | "no-new-wrappers": 2, 89 | "no-new": 1, 90 | "no-octal-escape": 1, 91 | "no-octal": 1, 92 | "no-param-reassign": [2, {"props": false}], 93 | "no-process-env": 0, 94 | "no-proto": 2, 95 | "no-redeclare": [2, { "builtinGlobals": true }], 96 | "no-return-assign": [2, "except-parens"], 97 | "no-script-url": 2, 98 | "no-self-assign": 2, 99 | "no-self-compare": 2, 100 | "no-sequences": 2, 101 | "no-throw-literal": 2, 102 | "no-unmodified-loop-condition": 1, 103 | "no-unused-expressions": [2, { "allowShortCircuit": true, "allowTernary": false }], 104 | "no-unused-labels": 1, 105 | "no-useless-call": 1, 106 | "no-useless-concat": 1, 107 | "no-void": 2, 108 | "no-warning-comments": [1, { "terms": ["todo", "fix"], "location": "anywhere" }], 109 | "no-with": 2, 110 | "radix": [2, "as-needed"], 111 | "vars-on-top": 0, 112 | "wrap-iife": [2, "outside"], 113 | "yoda": [1, "never", { "onlyEquality": true }], 114 | "strict": [1, "safe"], 115 | "init-declarations": 0, 116 | "no-catch-shadow": 2, 117 | "no-delete-var": 2, 118 | "no-label-var": 2, 119 | "no-shadow-restricted-names": 2, 120 | "no-shadow": [2, {"builtinGlobals": false, "hoist": "functions"}], 121 | "no-undef-init": 1, 122 | "no-undef": [2, { "typeof": false }], 123 | "no-undefined": 0, 124 | "no-unused-vars": [1, { "vars": "all", "args": "none" }], 125 | "no-use-before-define": [1, {"functions": false, "classes": true}], 126 | "array-bracket-spacing": [1, "never"], 127 | "block-spacing": [1, "always"], 128 | "brace-style": [1, "1tbs", { "allowSingleLine": true }], 129 | "camelcase": [1, {"properties": "never"}], 130 | "comma-spacing": [2, {"before": false, "after": true}], 131 | "comma-style": [1, "last"], 132 | "computed-property-spacing": [1, "never"], 133 | "consistent-this": [1, "_this", "self", "ctx"], 134 | "eol-last": [1, "unix"], 135 | "func-names": 0, 136 | "func-style": [0, "expression", { "allowArrowFunctions": true }], 137 | "id-length": [2, {"min": 1, "max": 35, "properties": "never"}], 138 | "id-match": 0, 139 | "id-blacklist": 0, 140 | "indent": [1, 4, {"VariableDeclarator": 1, "SwitchCase": 1}], 141 | "jsx-quotes": 0, 142 | "key-spacing": [1, {"beforeColon": false, "afterColon": true}], 143 | "keyword-spacing": [1, {"before": true, "after": true}], 144 | "linebreak-style": [1, "unix"], 145 | "lines-around-comment": [1, { "beforeBlockComment": true, "afterBlockComment": false, "beforeLineComment": true, "afterLineComment": false, "allowBlockStart": true, "allowBlockEnd": true, "allowObjectStart": true, "allowArrayStart": false, "allowArrayEnd": false }], 146 | "max-depth": [1, 5], 147 | "max-len": [1, {"code": 300, "comments": 300, "tabWidth": 4, "ignoreUrls": true}], 148 | "max-nested-callbacks": [1, 5], 149 | "max-params": [1, 10], 150 | "max-statements": [1, 30, {"ignoreTopLevelFunctions": true}], 151 | "new-cap": [1, {"newIsCap": true, "capIsNew": true, "properties": false}], 152 | "new-parens": 1, 153 | "newline-after-var": 0, 154 | "newline-per-chained-call": 0, 155 | "no-array-constructor": 1, 156 | "no-bitwise": 0, 157 | "no-continue": 0, 158 | "no-inline-comments": 0, 159 | "no-lonely-if": 1, 160 | "no-mixed-spaces-and-tabs": 1, 161 | "no-multiple-empty-lines": [1, {"max": 2}], 162 | "no-negated-condition": 0, 163 | "no-nested-ternary": 1, 164 | "no-new-object": 1, 165 | "no-plusplus": 0, 166 | "no-restricted-syntax": [1, "WithStatement"], 167 | "no-whitespace-before-property": 1, 168 | "no-spaced-func": 1, 169 | "no-ternary": 0, 170 | "no-trailing-spaces": [1, { "skipBlankLines": true }], 171 | "no-underscore-dangle": 0, 172 | "no-unneeded-ternary": 1, 173 | "object-curly-spacing": [1, "never"], 174 | "one-var": 0, 175 | "one-var-declaration-per-line": 0, 176 | "operator-assignment": 0, 177 | "operator-linebreak": 0, 178 | "padded-blocks": 0, 179 | "quote-props": [1, "as-needed"], 180 | "quotes": [1, "single"], 181 | "require-jsdoc": 0, 182 | "semi-spacing": [2, { "before": false, "after": true }], 183 | "semi": [1, "always"], 184 | "sort-vars": 0, 185 | "sort-imports": 0, 186 | "space-before-blocks": [1, { "functions": "always", "keywords": "always", "classes": "always" }], 187 | "space-before-function-paren": [1, {"anonymous": "never", "named": "never"}], 188 | "space-in-parens": [1, "never"], 189 | "space-infix-ops": 1, 190 | "space-unary-ops": [1, { "words": true, "nonwords": false }], 191 | "spaced-comment": 0, 192 | "wrap-regex": 0 193 | }, 194 | "globals": { 195 | "AMap": true 196 | } 197 | } -------------------------------------------------------------------------------- /dist/vue-expand-ball.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,n){"use strict";function o(e){return[].slice.apply(e.querySelector(".rounded-menus").childNodes).filter(function(e){return 1===e.nodeType})}function r(e,t){for(var n=t.parentNode;null!==n;){if(n===e)return!0;n=n.parentNode}return!1}function i(e){if(!e)return u.height=document.body.style.height,u.position=document.body.style.position,document.body.style.touchAction="none",document.body.style.msTouchAction="none",document.body.style.height="100%",void(document.body.style.position="fixed");document.body.style.touchAction="",document.body.style.msTouchAction="",document.body.style.height=u.height,document.body.style.position=u.position}t.c=o,t.a=r,n.d(t,"b",function(){return a}),n.d(t,"d",function(){return s}),t.e=i;var a="ontouchstart"in window,s=document.documentElement,u={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"VueExpandBall",function(){return a});var o=n(2),r=n.n(o),i=[r.a],a={install:function(e){a.installed||i.forEach(function(t){e.component(t.name,t)})}}},function(e,t,n){function o(e){r||n(3)}var r=!1,i=n(8)(n(9),n(14),o,"data-v-6f039d14",null);i.options.__file="/Users/howard/codes/github/vue-expand-ball/src/components/expand-ball.vue",i.esModule&&Object.keys(i.esModule).some(function(e){return"default"!==e&&"__"!==e.substr(0,2)})&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] expand-ball.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){var o=n(4);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(6)("0ea83f28",o,!1)},function(e,t,n){t=e.exports=n(5)(void 0),t.push([e.i,"\n.expand-ball[data-v-6f039d14] {\n position: fixed;\n margin: 0;\n padding: 0;\n text-align: center;\n color: #fff;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.expand-ball .rounded-menus > *[data-v-6f039d14],\n.center-ball[data-v-6f039d14] {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n}\n.expand-ball .rounded-menus > *[data-v-6f039d14] {\n -webkit-transition: all 0.5s;\n -o-transition: all 0.5s;\n transition: all 0.5s;\n}\n.center-ball[data-v-6f039d14] {\n z-index: 1;\n border-radius: 50%;\n}\n",""])},function(e,t){function n(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=o(r);return[n].concat(r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"})).concat([i]).join("\n")}return[n].join("\n")}function o(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var o=n(t,e);return t[2]?"@media "+t[2]+"{"+o+"}":o}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;rn.parts.length&&(o.parts.length=n.parts.length)}else{for(var a=[],r=0;re?e:this.options.menuSize,expanded:this.expanded,radius:this.options.radius||60,ballColor:t,menuColor:this.options.menuColor||t}}},mounted:function(){var e=this;o.c(this.$el).forEach(function(t){t.addEventListener("click",function(){e.expanded&&(e.expanded=!e.expanded)},!1)})},methods:{toggle:function(){"true"!==this.$el.dataset.dragging&&(this.expanded=!this.expanded)}},directives:{toggleExpand:r.a,setupStyle:i.a,draggable:a.a}}},function(e,t,n){"use strict";function o(e,t){var n=r.c(t),o=e.value,i=o.expanded,a=o.radius,s=o.ballSize,u=o.menuSize;if(i)return n.forEach(function(e,t){e.style.transitionDelay=100*t+"ms",e.style.webkitTransitionDelay=100*t+"ms",e.style.left=parseInt(e.style.left)+a*Math.cos(2*Math.PI/360*(360/n.length*t))+"px",e.style.top=parseInt(e.style.top)+-a*Math.sin(2*Math.PI/360*(360/n.length*t))+"px"});n.forEach(function(e,t){e.style.top=(s-u)/2+"px",e.style.left=(s-u)/2+"px"})}var r=n(0);t.a={bind:function(e,t,n){o(t,e)},update:function(e,t,n){o(t,e)}}},function(e,t,n){"use strict";var o=n(0);t.a={bind:function(e,t,n){var r=t.value,i=r.ballSize,a=r.menuSize,s=r.ballColor,u=r.menuColor,l=e.querySelector(".center-ball");e.style.width=i+"px",e.style.height=i+"px",e.style.lineHeight=i+"px",l.style.width=i+"px",l.style.height=i+"px",l.style.lineHeight=i+"px",l.style.backgroundColor=s,o.c(e).forEach(function(e){e.style.backgroundColor=u,e.style.width=a+"px",e.style.height=a+"px",e.style.lineHeight=a+"px",e.style.top=(i-a)/2+"px",e.style.left=(i-a)/2+"px"})}}},function(e,t,n){"use strict";function o(e){var t=e.getBoundingClientRect(),n=t.top,o=t.left,r=t.right,i=t.bottom,a=t.width,u=t.height;n<0&&(e.style.top="1px"),o<0&&(e.style.left="1px"),i>s.d.clientHeight&&(e.style.top=s.d.clientHeight-u-1+"px"),r>s.d.clientWidth&&(e.style.left=s.d.clientWidth-a-1+"px")}function r(e){var t=e.touches,n=t&&t.length?t:e.changedTouches;return{x:s.b?n[0].clientX:e.pageX,y:s.b?n[0].clientY:e.pageY}}function i(){return{startEvent:s.b?"touchstart":"mousedown",moveEvent:s.b?"touchmove":"mousemove",endEvent:s.b?"touchend":"mouseup"}}function a(e,t,n){var o=parseFloat(window.getComputedStyle(e).left);o||(o=s.d.clientWidth-parseFloat(window.getComputedStyle(e).right));var r=parseFloat(window.getComputedStyle(e).top);r||(r=s.d.clientHeight-parseFloat(window.getComputedStyle(e).bottom)),e.style.left=o+t+"px",e.style.top=r+n+"px"}var s=n(0),u=n(13),l={};t.a={bind:function(e,t,n){function d(t){var n=t||window.e,o=r(n);u.a(t);var i=parseFloat(y.x),s=parseFloat(y.y);return o.x===i&&o.y===s||(a(e,o.x-i,o.y-s),y=o),!1}function c(t){return!!s.a(e,t.target)&&(s.b&&s.e(!1),g=setTimeout(function(){e.dataset.dragging="true";var n=t||window.e;n.preventDefault&&n.preventDefault(),y=r(n),document.body.addEventListener(v,d,{passive:!1,cancelable:!0})},100),!1)}function p(t){return g&&o(e),clearTimeout(g),g=null,document.body.removeEventListener(v,d),setTimeout(function(){e.dataset.dragging="",s.b&&s.e(!0)},50),!1}var f=i(),h=f.startEvent,v=f.moveEvent,m=f.endEvent;e.dataset.listenerId="listener_"+(new Date).getTime(),l[e.dataset.listenerId]=[{name:h,listener:c},{name:m,listener:p}];var g=null,y=null;window.addEventListener(h,c,{passive:!1,cancelable:!0}),window.addEventListener(m,p,!1)},unbind:function(e){l[e.dataset.listenerId]&&l[e.dataset.listenerId].length&&(l[e.dataset.listenerId].forEach(function(e){window.removeEventListener(e.name,e.listener)}),delete l[e.dataset.listenerId])}}},function(e,t,n){"use strict";function o(e){e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),e.preventDefault&&e.preventDefault()}t.a=o},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"toggle-expand",rawName:"v-toggle-expand",value:e.opts,expression:"opts"},{name:"setup-style",rawName:"v-setup-style",value:e.opts,expression:"opts"},{name:"draggable",rawName:"v-draggable"}],staticClass:"expand-ball"},[n("div",{staticClass:"center-ball",on:{click:e.toggle}},[e.opts.expanded?e._t("ball-open",[e._v("-")]):e._e(),e._v(" "),e.opts.expanded?e._e():e._t("ball-close",[e._v("+")])],2),e._v(" "),n("div",{staticClass:"rounded-menus"},[e._t("menu")],2)])},staticRenderFns:[]},e.exports.render._withStripped=!0}])}); -------------------------------------------------------------------------------- /.esformatter: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "indent": { 4 | "value": " ", 5 | "alignComments": true, 6 | "ArrayExpression": 1, 7 | "ArrayPattern": 1, 8 | "ArrowFunctionExpression": 1, 9 | "AssignmentExpression": 1, 10 | "AssignmentExpression.BinaryExpression": 1, 11 | "AssignmentExpression.LogicalExpression": 1, 12 | "AssignmentExpression.UnaryExpression": 1, 13 | "CallExpression": 1, 14 | "CallExpression.BinaryExpression": 1, 15 | "CallExpression.LogicalExpression": 1, 16 | "CallExpression.UnaryExpression": 1, 17 | "CatchClause": 1, 18 | "ConditionalExpression": 1, 19 | "CommentInsideEmptyBlock": 1, 20 | "ClassDeclaration": 1, 21 | "ClassExpression": 1, 22 | "DoWhileStatement": 1, 23 | "ForInStatement": 1, 24 | "ForOfStatement": 1, 25 | "ForStatement": 1, 26 | "FunctionDeclaration": 1, 27 | "FunctionExpression": 1, 28 | "IfStatement": 1, 29 | "MemberExpression": 1, 30 | "MultipleVariableDeclaration": 1, 31 | "NewExpression": 1, 32 | "ObjectExpression": 1, 33 | "ObjectExpression.BinaryExpression": 1, 34 | "ObjectExpression.LogicalExpression": 1, 35 | "ObjectExpression.UnaryExpression": 1, 36 | "ObjectPattern": 1, 37 | "ParameterList": 1, 38 | "ReturnStatement": 1, 39 | "SingleVariableDeclaration": 0, 40 | "SwitchCase": 1, 41 | "SwitchStatement": 1, 42 | "TopLevelFunctionBlock": 1, 43 | "TryStatement": 1, 44 | "VariableDeclaration.BinaryExpression": 1, 45 | "VariableDeclaration.LogicalExpression": 1, 46 | "VariableDeclaration.UnaryExpression": 1, 47 | "WhileStatement": 1 48 | }, 49 | "lineBreak": { 50 | "value": "\n", 51 | 52 | "before": { 53 | "AssignmentExpression" : ">=1", 54 | "AssignmentOperator": 0, 55 | "AssignmentPattern" : 0, 56 | "ArrayPatternOpening": 0, 57 | "ArrayPatternClosing": 0, 58 | "ArrayPatternComma": 0, 59 | "ArrowFunctionExpressionArrow": 0, 60 | "ArrowFunctionExpressionOpeningBrace": 0, 61 | "ArrowFunctionExpressionClosingBrace": ">=1", 62 | "BlockStatement" : 0, 63 | "BreakKeyword": ">=1", 64 | "CallExpression" : -1, 65 | "CallExpressionOpeningParentheses" : 0, 66 | "CallExpressionClosingParentheses" : -1, 67 | "ClassDeclaration" : ">=1", 68 | "ClassExpression" : ">=1", 69 | "ClassOpeningBrace" : 0, 70 | "ClassClosingBrace" : ">=1", 71 | "ConditionalExpression" : ">=1", 72 | "CatchOpeningBrace" : 0, 73 | "CatchClosingBrace" : ">=1", 74 | "CatchKeyword": 0, 75 | "DeleteOperator" : ">=1", 76 | "DoWhileStatement" : ">=1", 77 | "DoWhileStatementOpeningBrace" : 0, 78 | "DoWhileStatementClosingBrace" : ">=1", 79 | "EndOfFile" : -1, 80 | "EmptyStatement" : -1, 81 | "FinallyKeyword" : -1, 82 | "FinallyOpeningBrace" : 0, 83 | "FinallyClosingBrace" : ">=1", 84 | "ForInStatement" : ">=1", 85 | "ForInStatementExpressionOpening" : 0, 86 | "ForInStatementExpressionClosing" : 0, 87 | "ForInStatementOpeningBrace" : 0, 88 | "ForInStatementClosingBrace" : ">=1", 89 | "ForOfStatement" : ">=1", 90 | "ForOfStatementExpressionOpening" : 0, 91 | "ForOfStatementExpressionClosing" : 0, 92 | "ForOfStatementOpeningBrace" : 0, 93 | "ForOfStatementClosingBrace" : ">=1", 94 | "ForStatement" : ">=1", 95 | "ForStatementExpressionOpening" : 0, 96 | "ForStatementExpressionClosing" : "<2", 97 | "ForStatementOpeningBrace" : 0, 98 | "ForStatementClosingBrace" : ">=1", 99 | "FunctionExpression" : -1, 100 | "FunctionExpressionOpeningBrace" : 0, 101 | "FunctionExpressionClosingBrace" : ">=1", 102 | "FunctionDeclaration" : ">=1", 103 | "FunctionDeclarationOpeningBrace" : 0, 104 | "FunctionDeclarationClosingBrace" : ">=1", 105 | "IIFEClosingParentheses" : 0, 106 | "IfStatement" : ">=1", 107 | "IfStatementOpeningBrace" : 0, 108 | "IfStatementClosingBrace" : ">=1", 109 | "ElseIfStatement" : 0, 110 | "ElseIfStatementOpeningBrace" : 0, 111 | "ElseIfStatementClosingBrace" : ">=1", 112 | "ElseStatement" : 0, 113 | "ElseStatementOpeningBrace" : 0, 114 | "ElseStatementClosingBrace" : ">=1", 115 | "LogicalExpression" : -1, 116 | "MethodDefinition": ">=1", 117 | "MemberExpressionOpening": 0, 118 | "MemberExpressionClosing": "<2", 119 | "MemberExpressionPeriod": -1, 120 | "ObjectExpressionClosingBrace" : ">=1", 121 | "ObjectPatternOpeningBrace": 0, 122 | "ObjectPatternClosingBrace": 0, 123 | "ObjectPatternComma": 0, 124 | "Property" : ">=1", 125 | "PropertyValue" : 0, 126 | "ReturnStatement" : -1, 127 | "SwitchOpeningBrace" : 0, 128 | "SwitchClosingBrace" : ">=1", 129 | "SwitchCaseColon": 0, 130 | "ThisExpression" : -1, 131 | "ThrowStatement" : ">=1", 132 | "TryKeyword": -1, 133 | "TryOpeningBrace" : 0, 134 | "TryClosingBrace" : ">=1", 135 | "VariableName" : ">=1", 136 | "VariableValue" : 0, 137 | "VariableDeclaration" : ">=1", 138 | "VariableDeclarationSemiColon" : 0, 139 | "VariableDeclarationWithoutInit" : ">=1", 140 | "WhileStatement" : ">=1", 141 | "WhileStatementOpeningBrace" : 0, 142 | "WhileStatementClosingBrace" : ">=1" 143 | }, 144 | 145 | "after": { 146 | "AssignmentExpression" : ">=1", 147 | "AssignmentOperator" : 0, 148 | "AssignmentPattern" : 0, 149 | "ArrayPatternOpening": 0, 150 | "ArrayPatternClosing": 0, 151 | "ArrayPatternComma": 0, 152 | "ArrowFunctionExpressionArrow": 0, 153 | "ArrowFunctionExpressionOpeningBrace": ">=1", 154 | "ArrowFunctionExpressionClosingBrace": -1, 155 | "BlockStatement" : 0, 156 | "BreakKeyword": -1, 157 | "CallExpression" : -1, 158 | "CallExpressionOpeningParentheses" : -1, 159 | "CallExpressionClosingParentheses" : -1, 160 | "ClassDeclaration" : ">=1", 161 | "ClassExpression" : ">=1", 162 | "ClassOpeningBrace" : ">=1", 163 | "ClassClosingBrace" : ">=1", 164 | "CatchOpeningBrace" : ">=1", 165 | "CatchClosingBrace" : ">=0", 166 | "CatchKeyword": 0, 167 | "ConditionalExpression" : ">=1", 168 | "DeleteOperator" : ">=1", 169 | "DoWhileStatement" : ">=1", 170 | "DoWhileStatementOpeningBrace" : ">=1", 171 | "DoWhileStatementClosingBrace" : 0, 172 | "EmptyStatement" : -1, 173 | "FinallyKeyword" : -1, 174 | "FinallyOpeningBrace" : ">=1", 175 | "FinallyClosingBrace" : ">=1", 176 | "ForInStatement" : ">=1", 177 | "ForInStatementExpressionOpening" : "<2", 178 | "ForInStatementExpressionClosing" : -1, 179 | "ForInStatementOpeningBrace" : ">=1", 180 | "ForInStatementClosingBrace" : ">=1", 181 | "ForOfStatement" : ">=1", 182 | "ForOfStatementExpressionOpening" : "<2", 183 | "ForOfStatementExpressionClosing" : -1, 184 | "ForOfStatementOpeningBrace" : ">=1", 185 | "ForOfStatementClosingBrace" : ">=1", 186 | "ForStatement" : ">=1", 187 | "ForStatementExpressionOpening" : "<2", 188 | "ForStatementExpressionClosing" : -1, 189 | "ForStatementOpeningBrace" : ">=1", 190 | "ForStatementClosingBrace" : ">=1", 191 | "FunctionExpression" : ">=1", 192 | "FunctionExpressionOpeningBrace" : ">=1", 193 | "FunctionExpressionClosingBrace" : -1, 194 | "FunctionDeclaration" : ">=1", 195 | "FunctionDeclarationOpeningBrace" : ">=1", 196 | "FunctionDeclarationClosingBrace" : ">=1", 197 | "IIFEOpeningParentheses" : 0, 198 | "IfStatement" : ">=1", 199 | "IfStatementOpeningBrace" : ">=1", 200 | "IfStatementClosingBrace" : ">=1", 201 | "ElseIfStatement" : ">=1", 202 | "ElseIfStatementOpeningBrace" : ">=1", 203 | "ElseIfStatementClosingBrace" : ">=1", 204 | "ElseStatement" : ">=1", 205 | "ElseStatementOpeningBrace" : ">=1", 206 | "ElseStatementClosingBrace" : ">=1", 207 | "LogicalExpression" : -1, 208 | "MethodDefinition": ">=1", 209 | "MemberExpressionOpening": "<2", 210 | "MemberExpressionClosing": "<2", 211 | "MemberExpressionPeriod": 0, 212 | "ObjectExpressionOpeningBrace" : ">=1", 213 | "ObjectPatternOpeningBrace": 0, 214 | "ObjectPatternClosingBrace": 0, 215 | "ObjectPatternComma": 0, 216 | "Property" : 0, 217 | "PropertyName" : 0, 218 | "ReturnStatement" : -1, 219 | "SwitchOpeningBrace" : ">=1", 220 | "SwitchClosingBrace" : ">=1", 221 | "SwitchCaseColon": ">=1", 222 | "ThisExpression" : 0, 223 | "ThrowStatement" : ">=1", 224 | "TryKeyword": -1, 225 | "TryOpeningBrace" : ">=1", 226 | "TryClosingBrace" : 0, 227 | "VariableValue" : -1, 228 | "VariableDeclaration" : ">=1", 229 | "VariableDeclarationSemiColon" : ">=1", 230 | "WhileStatement" : ">=1", 231 | "WhileStatementOpeningBrace" : ">=1", 232 | "WhileStatementClosingBrace" : ">=1" 233 | } 234 | }, 235 | 236 | 237 | "whiteSpace": { 238 | "value": " ", 239 | "removeTrailing" : 1, 240 | 241 | "before": { 242 | "AssignmentPattern" : 1, 243 | "ArrayExpressionOpening" : 0, 244 | "ArrayExpressionClosing" : 0, 245 | "ArrayExpressionComma" : 0, 246 | "ArrayPatternOpening": 1, 247 | "ArrayPatternClosing": 0, 248 | "ArrayPatternComma": 0, 249 | "ArrowFunctionExpressionArrow": 1, 250 | "ArrowFunctionExpressionOpeningBrace": 1, 251 | "ArrowFunctionExpressionClosingBrace": 0, 252 | "ArgumentComma" : 0, 253 | "ArgumentList" : 0, 254 | "AssignmentOperator" : 1, 255 | "BinaryExpression": 0, 256 | "BinaryExpressionOperator" : 1, 257 | "BlockComment" : 1, 258 | "CallExpression" : -1, 259 | "CallExpressionOpeningParentheses" : 0, 260 | "CallExpressionClosingParentheses" : -1, 261 | "CatchParameterList" : 0, 262 | "CatchOpeningBrace" : 1, 263 | "CatchClosingBrace" : 1, 264 | "CatchKeyword" : 1, 265 | "CommaOperator" : 0, 266 | "ClassOpeningBrace" : 1, 267 | "ClassClosingBrace" : 1, 268 | "ConditionalExpressionConsequent" : 1, 269 | "ConditionalExpressionAlternate" : 1, 270 | "DoWhileStatementOpeningBrace" : 1, 271 | "DoWhileStatementClosingBrace" : 1, 272 | "DoWhileStatementConditional" : 1, 273 | "EmptyStatement" : 0, 274 | "ExpressionClosingParentheses" : 0, 275 | "FinallyKeyword" : -1, 276 | "FinallyOpeningBrace" : 1, 277 | "FinallyClosingBrace" : 1, 278 | "ForInStatement" : 1, 279 | "ForInStatementExpressionOpening" : 1, 280 | "ForInStatementExpressionClosing" : 0, 281 | "ForInStatementOpeningBrace" : 1, 282 | "ForInStatementClosingBrace" : 1, 283 | "ForOfStatement" : 1, 284 | "ForOfStatementExpressionOpening" : 1, 285 | "ForOfStatementExpressionClosing" : 0, 286 | "ForOfStatementOpeningBrace" : 1, 287 | "ForOfStatementClosingBrace" : 1, 288 | "ForStatement" : 1, 289 | "ForStatementExpressionOpening" : 1, 290 | "ForStatementExpressionClosing" : 0, 291 | "ForStatementOpeningBrace" : 1, 292 | "ForStatementClosingBrace" : 1, 293 | "ForStatementSemicolon" : 0, 294 | "FunctionDeclarationOpeningBrace" : 1, 295 | "FunctionDeclarationClosingBrace" : 1, 296 | "FunctionExpressionOpeningBrace" : 1, 297 | "FunctionExpressionClosingBrace" : 1, 298 | "FunctionGeneratorAsterisk": 0, 299 | "FunctionName" : 1, 300 | "IIFEClosingParentheses" : 0, 301 | "IfStatementConditionalOpening" : 1, 302 | "IfStatementConditionalClosing" : 0, 303 | "IfStatementOpeningBrace" : 1, 304 | "IfStatementClosingBrace" : 1, 305 | "ModuleSpecifierClosingBrace": 0, 306 | "ElseStatementOpeningBrace" : 1, 307 | "ElseStatementClosingBrace" : 1, 308 | "ElseIfStatementOpeningBrace" : 1, 309 | "ElseIfStatementClosingBrace" : 1, 310 | "LineComment" : 1, 311 | "LogicalExpressionOperator" : 1, 312 | "MemberExpressionOpening": 0, 313 | "MemberExpressionClosing": 0, 314 | "MemberExpressionPeriod": 0, 315 | "ObjectExpressionOpeningBrace": -1, 316 | "ObjectExpressionClosingBrace": 0, 317 | "ObjectPatternOpeningBrace": 1, 318 | "ObjectPatternClosingBrace": 0, 319 | "ObjectPatternComma": 0, 320 | "Property" : 1, 321 | "PropertyName" : 1, 322 | "PropertyValue" : 1, 323 | "ParameterComma" : 0, 324 | "ParameterList" : 0, 325 | "SwitchDiscriminantOpening" : 1, 326 | "SwitchDiscriminantClosing" : 0, 327 | "SwitchCaseColon": 0, 328 | "ThrowKeyword": 1, 329 | "TryKeyword": -1, 330 | "TryOpeningBrace" : 1, 331 | "TryClosingBrace" : 1, 332 | "UnaryExpressionOperator": 0, 333 | "VariableName" : 1, 334 | "VariableValue" : 1, 335 | "VariableDeclarationSemiColon" : 0, 336 | "WhileStatementConditionalOpening" : 1, 337 | "WhileStatementConditionalClosing" : 0, 338 | "WhileStatementOpeningBrace" : 1, 339 | "WhileStatementClosingBrace" : 1 340 | }, 341 | 342 | "after": { 343 | "AssignmentPattern" : 1, 344 | "ArrayExpressionOpening" : 0, 345 | "ArrayExpressionClosing" : 0, 346 | "ArrayExpressionComma" : 1, 347 | "ArrayPatternOpening": 0, 348 | "ArrayPatternClosing": 1, 349 | "ArrayPatternComma": 1, 350 | "ArrowFunctionExpressionArrow": 1, 351 | "ArrowFunctionExpressionOpeningBrace": 0, 352 | "ArrowFunctionExpressionClosingBrace": 0, 353 | "ArgumentComma" : 1, 354 | "ArgumentList" : 0, 355 | "AssignmentOperator" : 1, 356 | "BinaryExpression": 0, 357 | "BinaryExpressionOperator" : 1, 358 | "BlockComment" : 1, 359 | "CallExpression" : -1, 360 | "CallExpressionOpeningParentheses" : -1, 361 | "CallExpressionClosingParentheses" : -1, 362 | "CatchParameterList" : 0, 363 | "CatchOpeningBrace" : 1, 364 | "CatchClosingBrace" : 1, 365 | "CatchKeyword" : 1, 366 | "ClassOpeningBrace" : 1, 367 | "ClassClosingBrace" : 1, 368 | "CommaOperator" : 1, 369 | "ConditionalExpressionConsequent" : 1, 370 | "ConditionalExpressionTest" : 1, 371 | "DoWhileStatementOpeningBrace" : 1, 372 | "DoWhileStatementClosingBrace" : 1, 373 | "DoWhileStatementBody" : 1, 374 | "EmptyStatement" : 0, 375 | "ExpressionOpeningParentheses" : 0, 376 | "FinallyKeyword" : -1, 377 | "FinallyOpeningBrace" : 1, 378 | "FinallyClosingBrace" : 1, 379 | "ForInStatement" : 1, 380 | "ForInStatementExpressionOpening" : 0, 381 | "ForInStatementExpressionClosing" : 1, 382 | "ForInStatementOpeningBrace" : 1, 383 | "ForInStatementClosingBrace" : 1, 384 | "ForOfStatement" : 1, 385 | "ForOfStatementExpressionOpening" : 0, 386 | "ForOfStatementExpressionClosing" : 1, 387 | "ForOfStatementOpeningBrace" : 1, 388 | "ForOfStatementClosingBrace" : 1, 389 | "ForStatement" : 1, 390 | "ForStatementExpressionOpening" : 0, 391 | "ForStatementExpressionClosing" : 1, 392 | "ForStatementClosingBrace" : 1, 393 | "ForStatementOpeningBrace" : 1, 394 | "ForStatementSemicolon" : 1, 395 | "FunctionReservedWord": 0, 396 | "FunctionName" : 0, 397 | "FunctionExpressionOpeningBrace" : 1, 398 | "FunctionExpressionClosingBrace" : 0, 399 | "FunctionDeclarationOpeningBrace" : 1, 400 | "FunctionDeclarationClosingBrace" : 1, 401 | "IIFEOpeningParentheses" : 0, 402 | "IfStatementConditionalOpening" : 0, 403 | "IfStatementConditionalClosing" : 1, 404 | "IfStatementOpeningBrace" : 1, 405 | "IfStatementClosingBrace" : 1, 406 | "ModuleSpecifierOpeningBrace": 0, 407 | "ElseStatementOpeningBrace" : 1, 408 | "ElseStatementClosingBrace" : 1, 409 | "ElseIfStatementOpeningBrace" : 1, 410 | "ElseIfStatementClosingBrace" : 1, 411 | "MemberExpressionClosing": 0, 412 | "MemberExpressionOpening": 0, 413 | "MemberExpressionPeriod": 0, 414 | "MethodDefinitionName": 0, 415 | "LogicalExpressionOperator" : 1, 416 | "ObjectExpressionOpeningBrace": 0, 417 | "ObjectExpressionClosingBrace": 0, 418 | "ObjectPatternOpeningBrace": 0, 419 | "ObjectPatternClosingBrace": 0, 420 | "ObjectPatternComma": 1, 421 | "Property" : 0, 422 | "PropertyName" : 0, 423 | "PropertyValue" : 0, 424 | "ParameterComma" : 1, 425 | "ParameterList" : 0, 426 | "SwitchDiscriminantOpening" : 0, 427 | "SwitchDiscriminantClosing" : 1, 428 | "ThrowKeyword": 1, 429 | "TryKeyword": -1, 430 | "TryOpeningBrace" : 1, 431 | "TryClosingBrace" : 1, 432 | "UnaryExpressionOperator": 0, 433 | "VariableName" : 1, 434 | "VariableValue" : 0, 435 | "VariableDeclarationSemiColon" : 0, 436 | "WhileStatementConditionalOpening" : 0, 437 | "WhileStatementConditionalClosing" : 1, 438 | "WhileStatementOpeningBrace" : 1, 439 | "WhileStatementClosingBrace" : 1 440 | } 441 | }, 442 | "quotes": { 443 | "type": "single", 444 | "avoidEscape": false 445 | }, 446 | "plugins": [ 447 | "esformatter-braces", 448 | "esformatter-dot-notation", 449 | "esformatter-literal-notation", 450 | "esformatter-quotes" 451 | ] 452 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /dist/vue-expand-ball.js: -------------------------------------------------------------------------------- 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(); 4 | else if(typeof define === 'function' && define.amd) 5 | define([], factory); 6 | else { 7 | var a = factory(); 8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; 9 | } 10 | })(this, function() { 11 | return /******/ (function(modules) { // webpackBootstrap 12 | /******/ // The module cache 13 | /******/ var installedModules = {}; 14 | /******/ 15 | /******/ // The require function 16 | /******/ function __webpack_require__(moduleId) { 17 | /******/ 18 | /******/ // Check if module is in cache 19 | /******/ if(installedModules[moduleId]) { 20 | /******/ return installedModules[moduleId].exports; 21 | /******/ } 22 | /******/ // Create a new module (and put it into the cache) 23 | /******/ var module = installedModules[moduleId] = { 24 | /******/ i: moduleId, 25 | /******/ l: false, 26 | /******/ exports: {} 27 | /******/ }; 28 | /******/ 29 | /******/ // Execute the module function 30 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 31 | /******/ 32 | /******/ // Flag the module as loaded 33 | /******/ module.l = true; 34 | /******/ 35 | /******/ // Return the exports of the module 36 | /******/ return module.exports; 37 | /******/ } 38 | /******/ 39 | /******/ 40 | /******/ // expose the modules object (__webpack_modules__) 41 | /******/ __webpack_require__.m = modules; 42 | /******/ 43 | /******/ // expose the module cache 44 | /******/ __webpack_require__.c = installedModules; 45 | /******/ 46 | /******/ // define getter function for harmony exports 47 | /******/ __webpack_require__.d = function(exports, name, getter) { 48 | /******/ if(!__webpack_require__.o(exports, name)) { 49 | /******/ Object.defineProperty(exports, name, { 50 | /******/ configurable: false, 51 | /******/ enumerable: true, 52 | /******/ get: getter 53 | /******/ }); 54 | /******/ } 55 | /******/ }; 56 | /******/ 57 | /******/ // getDefaultExport function for compatibility with non-harmony modules 58 | /******/ __webpack_require__.n = function(module) { 59 | /******/ var getter = module && module.__esModule ? 60 | /******/ function getDefault() { return module['default']; } : 61 | /******/ function getModuleExports() { return module; }; 62 | /******/ __webpack_require__.d(getter, 'a', getter); 63 | /******/ return getter; 64 | /******/ }; 65 | /******/ 66 | /******/ // Object.prototype.hasOwnProperty.call 67 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 68 | /******/ 69 | /******/ // __webpack_public_path__ 70 | /******/ __webpack_require__.p = ""; 71 | /******/ 72 | /******/ // Load entry module and return exports 73 | /******/ return __webpack_require__(__webpack_require__.s = 1); 74 | /******/ }) 75 | /************************************************************************/ 76 | /******/ ([ 77 | /* 0 */ 78 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 79 | 80 | "use strict"; 81 | /* harmony export (immutable) */ __webpack_exports__["c"] = retrieveMenuNodes; 82 | /* harmony export (immutable) */ __webpack_exports__["a"] = isDescendant; 83 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isTouchable; }); 84 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return screenSize; }); 85 | /* harmony export (immutable) */ __webpack_exports__["e"] = toggleScrollable; 86 | 87 | function retrieveMenuNodes(el) { 88 | return [].slice.apply(el.querySelector('.rounded-menus').childNodes).filter(function (node) { 89 | return node.nodeType === 1; 90 | }); 91 | } 92 | 93 | function isDescendant(parent, child) { 94 | var node = child.parentNode; 95 | while (node !== null) { 96 | if (node === parent) { 97 | return true; 98 | } 99 | node = node.parentNode; 100 | } 101 | return false; 102 | } 103 | 104 | var isTouchable = 'ontouchstart' in window; 105 | 106 | var screenSize = document.documentElement; 107 | 108 | var original = {}; 109 | 110 | function toggleScrollable(bool) { 111 | if (!bool) { 112 | original.height = document.body.style.height; 113 | original.position = document.body.style.position; 114 | 115 | document.body.style.touchAction = 'none'; 116 | document.body.style.msTouchAction = 'none'; 117 | document.body.style.height = '100%'; 118 | document.body.style.position = 'fixed'; 119 | return; 120 | } 121 | 122 | document.body.style.touchAction = ''; 123 | document.body.style.msTouchAction = ''; 124 | document.body.style.height = original.height; 125 | document.body.style.position = original.position; 126 | } 127 | 128 | /***/ }), 129 | /* 1 */ 130 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 131 | 132 | "use strict"; 133 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 134 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VueExpandBall", function() { return VueExpandBall; }); 135 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_expand_ball__ = __webpack_require__(2); 136 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_expand_ball___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__components_expand_ball__); 137 | 138 | 139 | var components = [__WEBPACK_IMPORTED_MODULE_0__components_expand_ball___default.a]; 140 | 141 | var VueExpandBall = { 142 | install: function install(Vue) { 143 | if (VueExpandBall.installed) { 144 | return; 145 | } 146 | 147 | components.forEach(function (_component) { 148 | Vue.component(_component.name, _component); 149 | }); 150 | } 151 | }; 152 | 153 | /***/ }), 154 | /* 2 */ 155 | /***/ (function(module, exports, __webpack_require__) { 156 | 157 | var disposed = false 158 | function injectStyle (ssrContext) { 159 | if (disposed) return 160 | __webpack_require__(3) 161 | } 162 | var Component = __webpack_require__(8)( 163 | /* script */ 164 | __webpack_require__(9), 165 | /* template */ 166 | __webpack_require__(14), 167 | /* styles */ 168 | injectStyle, 169 | /* scopeId */ 170 | "data-v-6f039d14", 171 | /* moduleIdentifier (server only) */ 172 | null 173 | ) 174 | Component.options.__file = "/Users/howard/codes/github/vue-expand-ball/src/components/expand-ball.vue" 175 | if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")} 176 | if (Component.options.functional) {console.error("[vue-loader] expand-ball.vue: functional components are not supported with templates, they should use render functions.")} 177 | 178 | /* hot reload */ 179 | if (false) {(function () { 180 | var hotAPI = require("vue-hot-reload-api") 181 | hotAPI.install(require("vue"), false) 182 | if (!hotAPI.compatible) return 183 | module.hot.accept() 184 | if (!module.hot.data) { 185 | hotAPI.createRecord("data-v-6f039d14", Component.options) 186 | } else { 187 | hotAPI.reload("data-v-6f039d14", Component.options) 188 | } 189 | module.hot.dispose(function (data) { 190 | disposed = true 191 | }) 192 | })()} 193 | 194 | module.exports = Component.exports 195 | 196 | 197 | /***/ }), 198 | /* 3 */ 199 | /***/ (function(module, exports, __webpack_require__) { 200 | 201 | // style-loader: Adds some css to the DOM by adding a