├── .browserslistrc ├── public ├── favicon.ico └── index.html ├── babel.config.js ├── src ├── assets │ └── images │ │ └── white.png └── lib │ ├── components │ └── marker │ │ ├── index.js │ │ ├── js │ │ └── marker.js │ │ └── index.vue │ └── index.js ├── .editorconfig ├── examples ├── main.js └── App.vue ├── .npmignore ├── .eslintrc.js ├── vue.config.js ├── package-example.json ├── package.json ├── README.md └── LICENSE /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunshengfei/vue-vmarker/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /src/assets/images/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunshengfei/vue-vmarker/HEAD/src/assets/images/white.png -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{js,jsx,ts,tsx,vue}] 2 | indent_style = space 3 | indent_size = 2 4 | trim_trailing_whitespace = true 5 | insert_final_newline = true 6 | -------------------------------------------------------------------------------- /examples/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | 4 | /* eslint-disable */ 5 | new Vue({ 6 | el: '#app', 7 | render: h => h(App) 8 | }) 9 | -------------------------------------------------------------------------------- /src/lib/components/marker/index.js: -------------------------------------------------------------------------------- 1 | import AIMarker from './index.vue' 2 | 3 | AIMarker.install = Vue => Vue.component(AIMarker.name, AIMarker); 4 | 5 | export default AIMarker; -------------------------------------------------------------------------------- /src/lib/index.js: -------------------------------------------------------------------------------- 1 | import AIMarker from './components/marker/index.js' 2 | import PictureMarker from './components/marker/js/marker' 3 | 4 | const components = [ 5 | AIMarker 6 | ] 7 | 8 | const install = (Vue, opts = {}) => { 9 | components.forEach(component => { 10 | Vue.component(component.name, component) 11 | }) 12 | } 13 | 14 | /* 支持使用标签的方式引入 */ 15 | if (typeof window !== 'undefined' && window.Vue) { 16 | install(window.Vue) 17 | } 18 | 19 | export { 20 | install, 21 | AIMarker, 22 | PictureMarker 23 | } 24 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .* 3 | package-lock.json 4 | /.git/ 5 | /.vscode/ 6 | tslint.json 7 | tsconfig.json 8 | node_modules/ 9 | build/ 10 | src/ 11 | public/ 12 | examples/ 13 | npm-debug.log 14 | yarn-error.log 15 | webpack.config.js 16 | *.tgz 17 | .browserslistrc 18 | jest.config.js 19 | vue.config.js 20 | babel.config.js 21 | index.html 22 | 23 | # local env files 24 | .env.local 25 | .env.*.local 26 | 27 | # Log files 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | 32 | # Editor directories and files 33 | .idea 34 | .vscode 35 | .gitignore 36 | .npmrc 37 | *.suo 38 | *.ntvs* 39 | *.njsproj 40 | *.sln 41 | *.sw? -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: [ 7 | 'plugin:vue/essential', 8 | "plugin:vue/recommended" 9 | ], 10 | parserOptions: { 11 | parser: 'babel-eslint' 12 | }, 13 | rules: { 14 | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 15 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 16 | 'quotes': 'off', 17 | 'vue/v-bind-style': 'off', 18 | 'semi': 'off', 19 | 'vue/attribute-hyphenation': 'off', 20 | 'vue/order-in-components': 'off', 21 | 'vue/attributes-order': 'off', 22 | 'vue/html-self-closing': 'off', 23 | 'semi-spacing': 'off', 24 | 'space-before-function-paren': 'off', 25 | 'spaced-comment': 'off', 26 | "eslint-disable-next-line": 'off', 27 | 'prefer-const': 'off' 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | const resolve = (dir) => path.resolve(__dirname, dir); 5 | module.exports = { 6 | // 修改 src 目录 为 examples 目录 7 | publicPath: './', 8 | pages: { 9 | index: { 10 | entry: 'examples/main.js', 11 | template: 'public/index.html', 12 | filename: 'index.html', 13 | } 14 | }, 15 | // vue 通过 file-loader 用版本哈希值和正确的公共基础路径来决定最终的图片路径,再用 url-loader 将小于 4kb 的 16 | // 图片内联,以减少 HTTP 请求的数量。所以我们可以通过 chainWebpack 调整图片的大小限制。例如,我们将 17 | // 图片大小限制设置为 13kb,低于13kb的图片全部被内联,高于13kb的图片会放在单独的img文件夹中。 18 | chainWebpack: (config) => { 19 | const imagesRule = config.module.rule('images'); 20 | imagesRule 21 | .use('url-loader') 22 | .loader('url-loader') 23 | .tap((options) => Object.assign(options, { limit: 13312 })); 24 | }, 25 | outputDir: 'dist', 26 | // 设置css: { extract: false },可以强制内联,就不会将css单独打包成一个文件,导致页面没有style 27 | css: { extract: false }, 28 | productionSourceMap: false 29 | }; -------------------------------------------------------------------------------- /package-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@sunshengfei/vue-vmarker", 3 | "description": "关于ui-picture-bd-marker插件的Vue封装", 4 | "version": "1.4.3", 5 | "author": "freddon ", 6 | "license": "Apache-2.0 License", 7 | "private": false, 8 | "main": "examples/main.js", 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/sunshengfei/vue-vmarker" 12 | }, 13 | "publishConfig": { 14 | "registry": "https://npm.pkg.github.com/" 15 | }, 16 | "bugs": { 17 | "url": "https://github.com/sunshengfei/vue-vmarker/issues" 18 | }, 19 | "scripts": { 20 | "serve": "vue-cli-service serve" 21 | }, 22 | "keywords": [ 23 | "marker", 24 | "画", 25 | "打标签", 26 | "图像画框", 27 | "标签", 28 | "标注" 29 | ], 30 | "dependencies": { 31 | "core-js": "^3.6.5", 32 | "eslint-plugin-vue": "^7.12.1", 33 | "ui-picture-bd-marker": "^2.3.5", 34 | "vue": "^2.6.11", 35 | "vue-picture-bd-marker": "*" 36 | }, 37 | "devDependencies": { 38 | "@vue/cli-plugin-babel": "~4.5.13", 39 | "@vue/cli-plugin-eslint": "~4.5.13", 40 | "@vue/cli-service": "~4.5.13", 41 | "babel-eslint": "^10.1.0", 42 | "eslint": "^6.8.0", 43 | "eslint-plugin-vue": "^6.2.2", 44 | "node-sass": "4.14.1", 45 | "sass-loader": "7.3.1", 46 | "vue-template-compiler": "^2.6.11" 47 | } 48 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-picture-bd-marker", 3 | "description": "关于ui-picture-bd-marker插件的Vue封装", 4 | "version": "1.5.0", 5 | "author": "freddon ", 6 | "license": "Apache-2.0 License", 7 | "private": false, 8 | "main": "dist/index.umd.min.js", 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/sunshengfei/vue-vmarker" 12 | }, 13 | "bugs": { 14 | "url": "https://github.com/sunshengfei/vue-vmarker/issues" 15 | }, 16 | "scripts": { 17 | "serve": "vue-cli-service serve", 18 | "build": "vue-cli-service build", 19 | "lint": "vue-cli-service lint", 20 | "lib": "vue-cli-service build --target lib --name index ./src/lib/index.js" 21 | }, 22 | "keywords": [ 23 | "marker", 24 | "画", 25 | "打标签", 26 | "图像画框", 27 | "标签", 28 | "标注" 29 | ], 30 | "dependencies": { 31 | "core-js": "^3.6.5", 32 | "eslint-plugin-vue": "^7.12.1", 33 | "ui-picture-bd-marker": "^2.3.8", 34 | "vue": "^2.6.11" 35 | }, 36 | "devDependencies": { 37 | "@vue/cli-plugin-babel": "~4.5.13", 38 | "@vue/cli-plugin-eslint": "~4.5.13", 39 | "@vue/cli-service": "~4.5.13", 40 | "babel-eslint": "^10.1.0", 41 | "eslint": "^6.8.0", 42 | "eslint-plugin-vue": "^6.2.2", 43 | "node-sass": "^4.14.1", 44 | "sass-loader": "^7.3.1", 45 | "vue-template-compiler": "^2.6.11" 46 | } 47 | } -------------------------------------------------------------------------------- /src/lib/components/marker/js/marker.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // made by fred 2018年08月12日 3 | import { 4 | BdAIMarker, 5 | positionP2S 6 | } from 'ui-picture-bd-marker' 7 | 8 | export default class PictureMarker { 9 | constructor(parentEl, draftEl, configs) { 10 | this.marker = this._makeMarker(parentEl, draftEl, configs) 11 | } 12 | 13 | _makeMarker = (parentEl, draftEl, configs) => { 14 | return new BdAIMarker( 15 | parentEl, 16 | draftEl, 17 | null, 18 | configs) 19 | } 20 | 21 | updateConfig = (configs) => { 22 | this.marker.setConfigOptions(configs) 23 | } 24 | 25 | getMarker = () => { 26 | return this.marker; 27 | } 28 | 29 | // 打标签 30 | setTag = (tag = {}) => { 31 | this.marker.setTag(tag) 32 | } 33 | 34 | // 渲染数据,数据格式如下 35 | // { 36 | // tag: '009_X0918', //require 37 | // tagName:'Diamond',//require 38 | // pos:2,//自定义属性 ... + 39 | // position: { //require 40 | // x: 350, 41 | // y: 306, 42 | // x1: 377, 43 | // y1: 334, 44 | // }, 45 | // } 46 | renderData = (data, wihe) => { 47 | this.marker.renderData(data, wihe) 48 | } 49 | 50 | // 获取数据 51 | getData = () => { 52 | return this.marker.dataSource() 53 | } 54 | 55 | // 清空数据 56 | clearData = () => { 57 | this.marker.clearAll() 58 | } 59 | 60 | // 数据参照 renderData 参数 61 | mapDataPercent2Real = (dataArray, baseW, baseH) => { 62 | return dataArray.map(item => { 63 | item.position = positionP2S(item.position, baseW, baseH) 64 | return item 65 | }) 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /examples/App.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 126 | 127 | 156 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-picture-bd-marker 2 | 3 | ![](https://img.shields.io/github/license/sunshengfei/vue-ui-picture-bd-marker) ![](https://img.shields.io/npm/v/vue-picture-bd-marker.svg?color=%23ff4400&style=popout) 4 | 5 | 6 | ``` 7 | npm i vue-picture-bd-marker 8 | 9 | ``` 10 | 11 | 12 | 效果图: 13 | 14 | ![](https://github.com/sunshengfei/ui-picture-bd-marker/blob/master/demo.png?raw=true) 15 | 16 | 17 | > 关于[ui-picture-bd-marker](https://www.npmjs.com/package/ui-picture-bd-marker)插件的Vue组件封装 18 | 19 | github仓库地址:[https://github.com/sunshengfei/vue-ui-picture-bd-marker](https://github.com/sunshengfei/vue-ui-picture-bd-marker) 20 | 21 | 文档地址:[https://vmarker.sagocloud.com/](https://vmarker.sagocloud.com/about/) 22 | 23 | 24 | 更新说明 25 | --- 26 | 27 | ## 1.5.0 28 | 29 | --- 30 | 增加config属性: 31 | ``` 32 | v-bind:config="{ closable: true }" 33 | ``` 34 | config接收的值和默认值如下,参见 ui-picture-bd-marker => [https://github.com/sunshengfei/ui-picture-bd-marker/blob/master/src/config.js](https://github.com/sunshengfei/ui-picture-bd-marker/blob/master/src/config.js) 35 | 36 | ``` 37 | deviceType: 'both',//both | mouse | touch 38 | blurOtherDots: false, 39 | blurOtherDotsShowTags: false, 40 | editable: true, 41 | readOnlyCanSelected: true, 42 | readOnlyAcceptEvent: ['mousedown', 'mouseup', 'touchstart', 'touchup'], 43 | showTags: true, 44 | closable: true, 45 | supportDelKey: false, 46 | tagLocation: defaultPositions.bottom, 47 | trashPositionStart: 0, 48 | boundReachPercent: 0.01, 49 | textComponent: () => undefined, 50 | annotationClass: 'annotation', 51 | ``` 52 | 53 | 54 | ## 1.4.5 55 | --- 56 | 1、支持长图模式,外部可以套div进行overflow,只需要在vue组件设置width和ratio组合值即可 57 | 1. width:auto 容器宽度将会使用原有图像宽度 58 | 2. ratio:0 使用原图像缩放比 59 | 2、修复github issues的一些bug 60 | 3、外层增加class `g-handler-touchable`将开启,响应式touch handler外形变化 61 | 62 | ## 1.4.3 63 | --- 64 | 1、增加`@vmarker:onSize="onSize"`事件,返回区域大小与位置 65 | 66 | 67 | ## 1.4.2 68 | --- 69 | 1、提升`ui-picture-bd-marker`最低版本 70 | 2、修复readonly属性响应失效问题 71 | 72 | 73 | ## v1.3.8 74 | 75 | 同步更新`ui-picture-bd-marker`修复的bug 76 | 77 | 78 | ## v1.3.7 79 | 80 | 删除@vmarker:onSelect、@vmarker:onDrawOne事件 81 | 82 | ``` 83 | 96 | ``` 97 | 可以通过this.$refs["aiPanel-editor"].getMarker().updateConfig(config)更新配置,vue-marker内部config默认如下 98 | 99 | ``` 100 | config = { 101 | options: { 102 | blurOtherDots: true, 103 | blurOtherDotsShowTags: true, 104 | editable: this.readOnly ? false : true, 105 | trashPositionStart: 1 106 | }, 107 | onAnnoContextMenu: function(annoData, element, annoContext) { 108 | // console.log("🦁onAnnoContextMenu🦁 data=", annoData); 109 | self.$emit("vmarker:onAnnoContextMenu", annoData, element, self.key); 110 | }, 111 | onAnnoRemoved: function(annoData) { 112 | // console.log("🦁onAnnoRemoved🦁 data=", annoData); 113 | self.$emit("vmarker:onAnnoRemoved", annoData, self.key); 114 | return true; 115 | }, 116 | onAnnoAdded: function(insertItem, element) { 117 | // console.log("🦁onAnnoAdded🦁 data=", insertItem); 118 | self.$emit("vmarker:onAnnoAdded", insertItem, self.key); 119 | }, 120 | onAnnoChanged: function(newValue, oldValue) { 121 | // console.log("🦁onAnnoChanged🦁 ", newValue, oldValue); 122 | self.$emit("vmarker:onAnnoChanged", newValue, oldValue, self.key); 123 | }, 124 | onAnnoDataFullLoaded: function() { 125 | // console.log("🦁onAnnoDataFullLoaded🦁 data=", self.key); 126 | self.$emit("vmarker:onAnnoDataFullLoaded", self.key); 127 | }, 128 | onAnnoSelected: function(value, element) { 129 | // console.log("🦁onAnnoSelected🦁 data=", value); 130 | self.$emit("vmarker:onAnnoSelected", value, element, self.key); 131 | }, 132 | onUpdated: function(data) { 133 | self.$emit("vmarker:onUpdated", data, self.key); 134 | } 135 | }; 136 | ``` 137 | 138 | 内部可配置defaultConfig如下: 139 | ``` 140 | const defaultConfig = { 141 | options: { 142 | deviceType: 'both',//both | mouse | touch 143 | blurOtherDots: false, 144 | blurOtherDotsShowTags: false, 145 | editable: true, 146 | showTags: true, 147 | supportDelKey: false, 148 | tagLocation: defaultPositions.bottom,//1 2 149 | trashPositionStart: 0, 150 | boundReachPercent: 0.01, 151 | annotationClass: 'annotation', 152 | }, 153 | onAnnoContextMenu: function (annoData, element, annoContext) { }, 154 | onAnnoRemoved: function (annoData, element) { return true }, 155 | onAnnoAdded: function (insertItem, element) { }, 156 | onAnnoChanged: function (newValue, oldValue) { }, 157 | onAnnoDataFullLoaded: function () { }, 158 | onAnnoSelected: function (value, element) { }, 159 | onUpdated: function () { }, 160 | }; 161 | ``` 162 | 163 | ## v1.3.5 164 | 165 | 1. 增加Mobile支持 166 | 2. 修复键盘删除键失效问题 167 | 168 | ## v1.3.0 169 | 170 | 1. 重新适配`ui-picture-bd-marker@2.0.0` 171 | 2. 修复ratio默认不生效问题。([issue#3](https://github.com/sunshengfei/ui-picture-bd-marker/issues/3) ) 172 | 173 | ## v1.2.1 174 | 175 | > 注意:不兼容1.0.x版本 176 | 177 | 1. 防止事件名称冲突,更改emit回调事件名称前缀`vmarker`,如:`this.$emit("vmarker:onReady", this.key);` 178 | 2. 增加修改config更改后画布自动刷新机制 -------------------------------------------------------------------------------- /src/lib/components/marker/index.vue: -------------------------------------------------------------------------------- 1 | 22 | 267 | 287 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. --------------------------------------------------------------------------------