├── .gitignore ├── Procfile ├── package.json ├── README.md ├── index.js ├── lib ├── img.js ├── js.js └── css.js ├── tests └── index.js └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: node index.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-server" 3 | , "description": "a build tool for bootstrap" 4 | , "version": "1.0.0" 5 | , "engines": { 6 | "node": "0.10.x", 7 | "npm": "1.3.x" 8 | } 9 | , "main": "web.js" 10 | , "dependencies": { 11 | "express": "2.5.5" 12 | , "uglify-js": "1.2.4" 13 | , "less": "1.3.3" 14 | , "node-native-zip": "1.0.1" 15 | } 16 | , "author": "@fat" 17 | , "repository": { 18 | "type": "git" 19 | , "url": "https://github.com/twbs/bootstrap-server.git" 20 | } 21 | , "licenses": [ { "type": "Apache-2.0" , "url": "http://www.apache.org/licenses/LICENSE-2.0" } ] 22 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #### No longer maintained 2 | 3 | The Bootstrap server is now handled via all client-side JavaScript within the main Bootstrap repo. 4 | 5 | ----- 6 | 7 | ## [Bootstrap](http://getbootstrap.com) Server <3 8 | 9 | The bootstrap server is responsible for backing the custom builds from bootstrap's download page. 10 | 11 | It serves zip files containing custom built and minified css and js. 12 | 13 | ## Quick start 14 | 15 | install dependencies 16 | ``` 17 | $ npm install 18 | ``` 19 | 20 | start server 21 | ``` 22 | $ node . 23 | ``` 24 | 25 | run tests 26 | ``` 27 | $ node tests 28 | ``` 29 | 30 | ## Authors 31 | 32 | **Jacob Thornton** 33 | 34 | + http://github.com/fat 35 | 36 | ## License 37 | 38 | Copyright 2013 Twitter, Inc. 39 | 40 | Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 41 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | // ======================================================================== 2 | // bootstrap-server v1.0.0 3 | // http://twbs.github.com/bootstrap 4 | // ======================================================================== 5 | // Copyright 2013 Twitter, Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // ======================================================================== 19 | 20 | "use strict" 21 | 22 | var express = require('express') 23 | , zip = require('node-native-zip') 24 | , app = express.createServer() 25 | , types = {} 26 | 27 | types.img = require('./lib/img') 28 | types.js = require('./lib/js') 29 | types.css = require('./lib/css') 30 | 31 | app.use(express.bodyParser()) 32 | 33 | function refreshCache() { 34 | Object.keys(types).forEach(function (type) { 35 | types[type].cache() 36 | }) 37 | } 38 | 39 | refreshCache() 40 | setInterval(refreshCache, 1000 * 60 * 60 * 2) 41 | 42 | // API args: 43 | // + js = array 44 | // + css = array 45 | // + img = array 46 | // + vars = obj 47 | 48 | app.get('/', function (req, res) { 49 | res.send('Bootstrap Server - w/cache. <3'); 50 | }) 51 | 52 | app.post('/', function(req, res) { 53 | var dist = [] 54 | , started = 0 55 | , params = {} 56 | , archive = new zip() 57 | 58 | params.js = req.body.js && JSON.parse(req.body.js) 59 | params.css = req.body.css && JSON.parse(req.body.css) 60 | params.img = req.body.img && JSON.parse(req.body.img) 61 | params.vars = req.body.vars && JSON.parse(req.body.vars) 62 | 63 | Object.keys(types).forEach(function (type) { 64 | if (!params[type] || !params[type].length) return 65 | types[type](params, complete) 66 | }) 67 | 68 | function complete (err, files) { 69 | for (var i in files) archive.add(i, files[i]) 70 | } 71 | 72 | res.attachment('bootstrap.zip') 73 | res.send(archive.toBuffer()) 74 | }) 75 | 76 | app.listen(process.env.PORT || 3000) 77 | -------------------------------------------------------------------------------- /lib/img.js: -------------------------------------------------------------------------------- 1 | // ======================================================================== 2 | // bootstrap-server v1.0.0 3 | // http://twbs.github.com/bootstrap 4 | // ======================================================================== 5 | // Copyright 2013 Twitter, Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // ======================================================================== 19 | 20 | "use strict" 21 | 22 | var path = require('path') 23 | , https = require('https') 24 | , TAG = 'v2.3.2' 25 | , CACHE = {} 26 | , FILES = [ 'glyphicons-halflings.png' 27 | , 'glyphicons-halflings-white.png' ] 28 | 29 | function cache(callback) { 30 | var _cache = {} 31 | , complete = 0 32 | 33 | FILES.forEach(function (filename) { 34 | var req 35 | , res 36 | , i = 0 37 | , content = [] 38 | , options = { 39 | host: 'raw.github.com' 40 | , port: 443 41 | , path: path.join('/twbs/bootstrap', TAG, 'img', filename) 42 | , method: 'GET' 43 | } 44 | 45 | req = https.request(options, function(res) { 46 | 47 | var buffer = new Buffer(parseInt(res.header('Content-Length'))) 48 | 49 | res.setEncoding('binary') 50 | 51 | res.on('data', function (chunk) { 52 | buffer.write(chunk, i, 'binary') 53 | i += chunk.length 54 | }) 55 | 56 | res.on('end', function () { 57 | _cache[filename] = buffer 58 | if (++complete == FILES.length) { 59 | CACHE = _cache 60 | callback && callback(null, CACHE) 61 | } 62 | }) 63 | 64 | }) 65 | 66 | req.end() 67 | }) 68 | 69 | } 70 | 71 | function img(params, callback) { 72 | var contents = {} 73 | params.img.forEach(function (filename) { 74 | contents['img/' + filename] = CACHE[filename] 75 | }) 76 | callback(null, contents) 77 | } 78 | 79 | module.exports = img 80 | module.exports.cache = cache 81 | module.exports.FILES = FILES 82 | -------------------------------------------------------------------------------- /tests/index.js: -------------------------------------------------------------------------------- 1 | // ======================================================================== 2 | // bootstrap-server v0.1.0 - tests 3 | // http://twbs.github.com/bootstrap 4 | // ======================================================================== 5 | // Copyright 2013 twitter, Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // ======================================================================== 19 | 20 | var assert = require('assert') 21 | var express = require('express') 22 | 23 | // CSS 24 | // ======================================= 25 | 26 | var CSS = require('../lib/css') 27 | 28 | // basic api 29 | assert.ok(typeof CSS == 'function') 30 | assert.ok(typeof CSS.cache == 'function') 31 | assert.ok(typeof CSS.FILES == 'object') 32 | 33 | // css cache method 34 | CSS.cache(function (err, cache) { 35 | assert(!err) 36 | 37 | CSS.FILES.forEach(function (filename) { 38 | assert.ok(cache[filename]) 39 | }) 40 | 41 | CSS({ css: ['reset.less'] }, function (err, response) { 42 | assert(!err) 43 | assert(response['css/bootstrap.css']) 44 | assert(response['css/bootstrap.min.css']) 45 | }) 46 | }) 47 | 48 | 49 | // IMG 50 | // ======================================= 51 | 52 | var IMG = require('../lib/img') 53 | 54 | // basic api 55 | assert.ok(typeof IMG == 'function') 56 | assert.ok(typeof IMG.cache == 'function') 57 | assert.ok(typeof IMG.FILES == 'object') 58 | 59 | // css cache method 60 | IMG.cache(function (err, cache) { 61 | assert(!err) 62 | 63 | IMG.FILES.forEach(function (filename) { 64 | assert.ok(cache[filename]) 65 | }) 66 | 67 | IMG({ img: ['glyphicons-halflings.png'] }, function (err, response) { 68 | assert(!err) 69 | assert(response['img/glyphicons-halflings.png']) 70 | }) 71 | }) 72 | 73 | 74 | // JS 75 | // ======================================= 76 | 77 | var JS = require('../lib/js') 78 | 79 | // basic api 80 | assert.ok(typeof JS == 'function') 81 | assert.ok(typeof JS.cache == 'function') 82 | assert.ok(typeof JS.FILES == 'object') 83 | 84 | // css cache method 85 | JS.cache(function (err, cache) { 86 | assert(!err) 87 | 88 | JS.FILES.forEach(function (filename) { 89 | assert.ok(cache[filename]) 90 | }) 91 | 92 | JS({ js: ['bootstrap-transition.js'] }, function (err, response) { 93 | assert(!err) 94 | assert(response['js/bootstrap.js']) 95 | assert(response['js/bootstrap.min.js']) 96 | }) 97 | }) -------------------------------------------------------------------------------- /lib/js.js: -------------------------------------------------------------------------------- 1 | // ======================================================================== 2 | // bootstrap-server v1.0.0 3 | // http://twbs.github.com/bootstrap 4 | // ======================================================================== 5 | // Copyright 2013 Twitter, Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // ======================================================================== 19 | 20 | "use strict" 21 | 22 | var uglifyJS = require('uglify-js') 23 | , path = require('path') 24 | , https = require('https') 25 | , TAG = 'v2.3.2' 26 | , CACHE = {} 27 | , FILES = [ "bootstrap-transition.js" 28 | , "bootstrap-affix.js" 29 | , "bootstrap-modal.js" 30 | , "bootstrap-dropdown.js" 31 | , "bootstrap-scrollspy.js" 32 | , "bootstrap-tab.js" 33 | , "bootstrap-tooltip.js" 34 | , "bootstrap-popover.js" 35 | , "bootstrap-alert.js" 36 | , "bootstrap-button.js" 37 | , "bootstrap-collapse.js" 38 | , "bootstrap-carousel.js" 39 | , "bootstrap-typeahead.js" ] 40 | 41 | function cache() { 42 | 43 | var done = 0 44 | , _cache = {} 45 | 46 | FILES.forEach(function (filename) { 47 | var req 48 | , content = [] 49 | , options = { 50 | host: 'raw.github.com' 51 | , port: 443 52 | , path: path.join('/twbs/bootstrap/', TAG, '/js/', filename) 53 | , method: 'GET' 54 | } 55 | 56 | req = https.request(options, function(res) { 57 | 58 | res.setEncoding('utf8') 59 | 60 | res.on('data', function (chunk) { 61 | content.push(chunk) 62 | }) 63 | 64 | res.on('end', function () { 65 | _cache[filename] = content.join('') 66 | if (++done == FILES.length) { 67 | CACHE = _cache 68 | } 69 | }) 70 | }) 71 | 72 | req.end() 73 | }) 74 | 75 | } 76 | 77 | function js(params, callback) { 78 | var min, content = params.js.map(function (filename) { 79 | return CACHE[filename] 80 | }).join('\n') 81 | 82 | try { 83 | min = uglify(content, params.js) 84 | } catch (e) { 85 | min = 'Error minifying source - please open issue on http://github.com/twbs/bootstrap! thank you :)' 86 | } 87 | 88 | callback(null, { 89 | 'js/bootstrap.js' : new Buffer(content, 'utf8') 90 | , 'js/bootstrap.min.js': new Buffer(min, 'utf8') 91 | }) 92 | } 93 | 94 | function uglify(input, names) { 95 | var content = input.replace(/[\"\']use strict[\"\']/gi, '') 96 | , tok = uglifyJS.parser.tokenizer(content) 97 | , c = tok() 98 | , result 99 | , ast 100 | 101 | result = '/**\n' 102 | + '* Bootstrap.js by @fat & @mdo\n' 103 | + '* plugins: ' + names.join(', ') + '\n' 104 | + '* Copyright 2013 Twitter, Inc.\n' 105 | + '* http://www.apache.org/licenses/LICENSE-2.0.txt\n' 106 | + '*/\n' 107 | 108 | ast = uglifyJS.parser.parse(content) 109 | ast = uglifyJS.uglify.ast_mangle(ast) 110 | ast = uglifyJS.uglify.ast_squeeze(ast) 111 | 112 | return result += uglifyJS.uglify.gen_code(ast) 113 | } 114 | 115 | module.exports = js 116 | module.exports.cache = cache 117 | module.exports.FILES = FILES 118 | -------------------------------------------------------------------------------- /lib/css.js: -------------------------------------------------------------------------------- 1 | // ======================================================================== 2 | // bootstrap-server v1.0.0 3 | // http://twbs.github.com/bootstrap 4 | // ======================================================================== 5 | // Copyright 2013 Twitter, Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // ======================================================================== 19 | 20 | "use strict" 21 | 22 | var path = require('path') 23 | , https = require('https') 24 | , less = require('less') 25 | , CACHE = {} 26 | , TAG = "v2.3.2" 27 | , CW = "/*!\n * Bootstrap v2.3.2\n *\n * Copyright 2013 Twitter, Inc\n * Licensed under the Apache License v2.0\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Designed and built with all the love in the world @twitter by @mdo and @fat.\n */\n" 28 | , ERROR = "A less error occured trying to build your bundle. You've likely entered an invalid input into the less variable field. Check your syntax and try again!\n\n thanks!\n\n" 29 | , FILES = [ // CSS Reset 30 | "reset.less" 31 | 32 | // Core variables and mixins 33 | , "variables.less" 34 | , "mixins.less" 35 | 36 | // Grid system and page structure 37 | , "scaffolding.less" 38 | , "grid.less" 39 | , "layouts.less" 40 | 41 | // Base CSS 42 | , "type.less" 43 | , "code.less" 44 | , "forms.less" 45 | , "tables.less" 46 | 47 | // Components: common 48 | , "sprites.less" 49 | , "dropdowns.less" 50 | , "wells.less" 51 | , "component-animations.less" 52 | , "close.less" 53 | 54 | // Components: Buttons & Alerts 55 | , "buttons.less" 56 | , "button-groups.less" 57 | , "alerts.less" 58 | 59 | // Components: Nav 60 | , "navs.less" 61 | , "navbar.less" 62 | , "breadcrumbs.less" 63 | , "pagination.less" 64 | , "pager.less" 65 | 66 | // Components: Popovers 67 | , "modals.less" 68 | , "tooltip.less" 69 | , "popovers.less" 70 | 71 | // Components: Misc 72 | , "thumbnails.less" 73 | , "media.less" 74 | , "labels-badges.less" 75 | , "progress-bars.less" 76 | , "accordion.less" 77 | , "carousel.less" 78 | , "hero-unit.less" 79 | 80 | // Utility classes 81 | , "utilities.less" 82 | 83 | // responsive styles 84 | , "responsive-1200px-min.less" 85 | , "responsive-767px-max.less" 86 | , "responsive-768px-979px.less" 87 | , "responsive-navbar.less" 88 | , "responsive-utilities.less" ] 89 | 90 | 91 | function cache(callback) { 92 | var complete = 0 93 | , _cache = {} 94 | 95 | FILES.forEach(function (filename) { 96 | var req 97 | , res 98 | , content = [] 99 | , options = { 100 | host: 'raw.github.com' 101 | , port: 443 102 | , path: path.join('/twbs/bootstrap/', TAG, '/less/', filename) 103 | , method: 'GET' 104 | } 105 | 106 | req = https.request(options, function(res) { 107 | 108 | res.setEncoding('utf8') 109 | 110 | res.on('data', function (chunk) { 111 | content.push(chunk) 112 | }) 113 | 114 | res.on('end', function () { 115 | 116 | _cache[filename] = content.join('') 117 | 118 | if (++complete == FILES.length) { 119 | CACHE = _cache 120 | callback && callback(null, CACHE) 121 | } 122 | 123 | }) 124 | }) 125 | 126 | req.end() 127 | }) 128 | } 129 | 130 | function css(params, callback) { 131 | var result = '' 132 | 133 | result += CACHE['variables.less'] 134 | result += generateCustomCSS(params) 135 | result += CACHE['mixins.less'] 136 | 137 | params.css.forEach(function (filename) { 138 | result += CACHE[filename] 139 | }) 140 | 141 | result = result.replace(/@import[^\n]*/gi, '') //strip any imports 142 | 143 | try { 144 | var parser = new less.Parser({ 145 | paths: ['variables.less', 'mixins.less'] 146 | , optimization: 0 147 | , filename: 'bootstrap.css' 148 | }).parse(result, function (err, tree) { 149 | if (err) callback(null, {'css/error.txt': new Buffer(ERROR + '\n' + JSON.stringify(err), 'utf8')}) 150 | callback(null, { 151 | 'css/bootstrap.css' : new Buffer(CW + tree.toCSS(), 'utf8') 152 | , 'css/bootstrap.min.css': new Buffer(CW + tree.toCSS({ compress: true }), 'utf8') 153 | }) 154 | }) 155 | } catch (err) { 156 | callback(null, {'css/error.txt': new Buffer(ERROR + '\n' + JSON.stringify(err), 'utf8')}) 157 | } 158 | } 159 | 160 | function generateCustomCSS (params) { 161 | return params.vars ? Object.keys(params.vars) 162 | .map(function (key) { 163 | return params.vars[key] ? (key + ': ' + params.vars[key] + ';') : '' 164 | }) 165 | .join('\n') + '\n\n' : '' 166 | } 167 | 168 | module.exports = css 169 | module.exports.cache = cache 170 | module.exports.FILES = FILES 171 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS --------------------------------------------------------------------------------