From 953cc7a84dce30021f4f6477803ddcfd3669e07e Mon Sep 17 00:00:00 2001 From: bill rowland Date: Sat, 23 May 2015 09:42:36 -0400 Subject: [PATCH] added ncp - copy files added fix to ncp module https://github.com/AvianFlu/ncp/pull/96 --- appology/css/main.css | 15 + appology/css/normalize.css | 427 ++++++++++++++++++ appology/test.html | 5 + includes/functions.js | 67 ++- includes/input.js | 8 +- includes/sandbox.js | 1 - index.js | 26 +- node_modules/.bin/ncp | 1 + node_modules/ncp/.npmignore | 4 + node_modules/ncp/.travis.yml | 6 + node_modules/ncp/LICENSE.md | 21 + node_modules/ncp/README.md | 63 +++ node_modules/ncp/bin/ncp | 48 ++ node_modules/ncp/lib/ncp.js | 263 +++++++++++ node_modules/ncp/package.json | 64 +++ node_modules/ncp/test/modified-files/out/a | 1 + node_modules/ncp/test/modified-files/src/a | 1 + node_modules/ncp/test/ncp.js | 197 ++++++++ node_modules/ncp/test/regular-fixtures/src/a | 1 + node_modules/ncp/test/regular-fixtures/src/b | 1 + node_modules/ncp/test/regular-fixtures/src/c | 0 node_modules/ncp/test/regular-fixtures/src/d | 0 node_modules/ncp/test/regular-fixtures/src/e | 0 node_modules/ncp/test/regular-fixtures/src/f | 0 .../ncp/test/regular-fixtures/src/sub/a | 1 + .../ncp/test/regular-fixtures/src/sub/b | 0 .../ncp/test/symlink-fixtures/src/dir/bar | 1 + .../ncp/test/symlink-fixtures/src/foo | 1 + views/baseFiles/body.jade | 17 + views/baseFiles/main.css | 15 + views/baseFiles/normalize.css | 427 ++++++++++++++++++ 31 files changed, 1666 insertions(+), 16 deletions(-) create mode 100644 appology/css/main.css create mode 100644 appology/css/normalize.css create mode 100644 appology/test.html create mode 120000 node_modules/.bin/ncp create mode 100644 node_modules/ncp/.npmignore create mode 100644 node_modules/ncp/.travis.yml create mode 100644 node_modules/ncp/LICENSE.md create mode 100644 node_modules/ncp/README.md create mode 100755 node_modules/ncp/bin/ncp create mode 100644 node_modules/ncp/lib/ncp.js create mode 100644 node_modules/ncp/package.json create mode 100644 node_modules/ncp/test/modified-files/out/a create mode 100644 node_modules/ncp/test/modified-files/src/a create mode 100644 node_modules/ncp/test/ncp.js create mode 100644 node_modules/ncp/test/regular-fixtures/src/a create mode 100644 node_modules/ncp/test/regular-fixtures/src/b create mode 100644 node_modules/ncp/test/regular-fixtures/src/c create mode 100644 node_modules/ncp/test/regular-fixtures/src/d create mode 100644 node_modules/ncp/test/regular-fixtures/src/e create mode 100644 node_modules/ncp/test/regular-fixtures/src/f create mode 100644 node_modules/ncp/test/regular-fixtures/src/sub/a create mode 100644 node_modules/ncp/test/regular-fixtures/src/sub/b create mode 100644 node_modules/ncp/test/symlink-fixtures/src/dir/bar create mode 100644 node_modules/ncp/test/symlink-fixtures/src/foo create mode 100644 views/baseFiles/body.jade create mode 100644 views/baseFiles/main.css create mode 100644 views/baseFiles/normalize.css diff --git a/appology/css/main.css b/appology/css/main.css new file mode 100644 index 0000000..c1894b8 --- /dev/null +++ b/appology/css/main.css @@ -0,0 +1,15 @@ +html, body { height: 100%; } +body { + color: #333; +} + + +/* data-binding: heroes */ + +#heroes { + padding-top: 20px; +} +#heroes li span { + display: inline-block; + width: 150px; +} diff --git a/appology/css/normalize.css b/appology/css/normalize.css new file mode 100644 index 0000000..458eea1 --- /dev/null +++ b/appology/css/normalize.css @@ -0,0 +1,427 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9/10. + */ + +img { + border: 0; +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ + +button, +input, +optgroup, +select, +textarea { + color: inherit; /* 1 */ + font: inherit; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} diff --git a/appology/test.html b/appology/test.html new file mode 100644 index 0000000..c2908d5 --- /dev/null +++ b/appology/test.html @@ -0,0 +1,5 @@ + +

this is a test file

+

you can delete

+

appology

+

/Users/billrowland/Sites/repos/buildIt/appology

\ No newline at end of file diff --git a/includes/functions.js b/includes/functions.js index 4a74c75..d7bb041 100644 --- a/includes/functions.js +++ b/includes/functions.js @@ -4,6 +4,49 @@ var prompt = require('prompt'); // its use is deprecated var request = require("request"); var FS = require('fs'); var jade = require('jade'); +var ncp = require('ncp').ncp; + +var copyBaseFileSet = function(fileSet){ + var deferred = Q.defer(); + var regx = new RegExp(/.*\.css/); +// ncp.errs = process.stdout; + options = { limit : 16, filter : regx }; +// options = { limit : 16 }; + ncp('views/baseFiles/', fileSet.toFolder, options, function (err) { + if (err) { + deferred.reject({'function' : 'copyBaseFileSet', 'err' : err }); + } else { + deferred.resolve('copy successful'); + } + }); + deferred.resolve('copy successful'); + return deferred.promise; +} + +exports.copyBaseFiles = function(values){ + var deferred = Q.defer(); + var p = []; + var fileSets = [ + { 'regex' : '.*\.css' , 'toFolder' : values.rootFolder + '/css'}, + // { 'regex' : '.*\.jade' , 'toFolder' : values.rootFolder + '/jade'} + ]; + for (var i = fileSets.length - 1; i >= 0; i--) { + p.push(copyBaseFileSet(fileSets[i])); + }; + + var bunchOPromises = Q.all(p); + bunchOPromises + .then(function (results) { + // this contains an array of the + deferred.resolve(results); + }).fail(function(e){ + deferred.reject('buildManyFiles error: '); + }); + return deferred.promise; + +} + + /* input: user input from prompt @@ -13,9 +56,28 @@ exports.buildManyFiles = function(values){ var deferred = Q.defer(); var builds = []; - var filesToBuild = [{ 'fname' : 'TEST.html', 'tplName' : 'test.jade'},{ 'fname' : 'TEST2.html', 'tplName' : 'test.jade'}]; + var filesToBuild = [{ 'fname' : 'test.html', 'tplName' : 'test.jade'}]; var tplDir = 'views/'; for (var i = 0; i < filesToBuild.length; i++) { + switch(filesToBuild[i]) { + case 'main.css': + if(values.dataBinding == 'y'){ + this.readFile('views/dataBinding.css.jade') + .then(function(data){ + values.dataBindingData = data; + }).fail(function(e){ + console.log('error reading template data: ' + e); + }) + } + break; + case 'n': + console.log('ugh'); + break; + default: + //console.log('default code block'); + } + + /* call buildFile with: the files to generate: ie index.html, main.css..., name of the template file: ie index.jade..., @@ -23,8 +85,8 @@ exports.buildManyFiles = function(values){ */ builds.push(this.buildFile( { 'filename' : values.rootFolder + '/' + filesToBuild[i].fname, 'tplName' : tplDir + filesToBuild[i].tplName, 'values' : values } )); }; - var bunchOPromises = Q.all(builds); + var bunchOPromises = Q.all(builds); bunchOPromises .then(function (results) { // this contains an array of the @@ -59,6 +121,7 @@ exports.buildFile = function(data){ } /* + note: deprecated note: using prompt to get data from user input: the filename of the schema holding the prompt data return: an object holding the input values diff --git a/includes/input.js b/includes/input.js index ddc65c8..b42f2e7 100644 --- a/includes/input.js +++ b/includes/input.js @@ -20,8 +20,12 @@ exports.getUserInput = function(){ answers.appFolder = answer == "" ? folderName : answer; // not sure which of these two properties to use, so... create both answers.rootFolder = CURDIR + '/' + answers.appFolder; - deferred.resolve(answers); - rl.close(); + rl.question("data binding (y): ", function(answer) { + answers.dataBinding = answer == "" ? 'y' : answer; + + deferred.resolve(answers); + rl.close(); + }); }); }); }); diff --git a/includes/sandbox.js b/includes/sandbox.js index f309e0b..342eb26 100644 --- a/includes/sandbox.js +++ b/includes/sandbox.js @@ -21,7 +21,6 @@ var createRootFolder = function(values){ */ exports.processInput = function(values){ var deferred = Q.defer(); - var promiseArr = []; promiseArr.push(createRootFolder(values)); diff --git a/index.js b/index.js index 3a78f44..4ad2391 100644 --- a/index.js +++ b/index.js @@ -14,17 +14,21 @@ func.readFile(schemaFile) // read the input schema - presently deprec results = x; // converting to global to pass down the line sbox.processInput(results) // process thie user input .then(function(y){ - func.buildManyFiles(results) // create HTML from templates and schema - .then(function(z){ - func.writeManyFiles(z) // create files from the HTML - .then(function(msg){ - console.log(msg); - func.exit('finished\r\n'); // all done : ) - }).fail(function(e){console.log('1',e) }); - }).fail(function(e){ console.log('2',e) }); - }).fail(function(e){ console.log('3',e) }); - }).fail(function(e){ console.log('4',e) }); - }).fail(function(e){ console.log('5',e) }); + func.copyBaseFiles(results) + .then(function(xx){ +console.log('xx',xx); + func.buildManyFiles(results) // create HTML from templates and schema + .then(function(z){ + func.writeManyFiles(z) // create files from the HTML + .then(function(msg){ + console.log(msg); + func.exit('finished\r\n'); // all done : ) + }).fail(function(e){console.log('1',e) }); + }).fail(function(e){ console.log('2',e) }); + }).fail(function(e){ console.log('3',e) }); + }).fail(function(e){ console.log('44',e) }); + }).fail(function(e){ console.log('5',e) }); + }).fail(function(e){ console.log('6',e) }); /* files to build diff --git a/node_modules/.bin/ncp b/node_modules/.bin/ncp new file mode 120000 index 0000000..1c02648 --- /dev/null +++ b/node_modules/.bin/ncp @@ -0,0 +1 @@ +../ncp/bin/ncp \ No newline at end of file diff --git a/node_modules/ncp/.npmignore b/node_modules/ncp/.npmignore new file mode 100644 index 0000000..3e6a4d7 --- /dev/null +++ b/node_modules/ncp/.npmignore @@ -0,0 +1,4 @@ +node_modules +.*.sw[op] +.DS_Store +test/*fixtures/out diff --git a/node_modules/ncp/.travis.yml b/node_modules/ncp/.travis.yml new file mode 100644 index 0000000..a6e2198 --- /dev/null +++ b/node_modules/ncp/.travis.yml @@ -0,0 +1,6 @@ +language: node_js + +node_js: + - 0.8 + - "0.10" + - "0.11" diff --git a/node_modules/ncp/LICENSE.md b/node_modules/ncp/LICENSE.md new file mode 100644 index 0000000..e2b9b41 --- /dev/null +++ b/node_modules/ncp/LICENSE.md @@ -0,0 +1,21 @@ +# MIT License + +###Copyright (C) 2011 by Charlie McConnell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/ncp/README.md b/node_modules/ncp/README.md new file mode 100644 index 0000000..9480032 --- /dev/null +++ b/node_modules/ncp/README.md @@ -0,0 +1,63 @@ +# ncp - Asynchronous recursive file & directory copying + +[![Build Status](https://secure.travis-ci.org/AvianFlu/ncp.png)](http://travis-ci.org/AvianFlu/ncp) + +Think `cp -r`, but pure node, and asynchronous. `ncp` can be used both as a CLI tool and programmatically. + +## Command Line usage + +Usage is simple: `ncp [source] [dest] [--limit=concurrency limit] +[--filter=filter] --stopOnErr` + +The 'filter' is a Regular Expression - matched files will be copied. + +The 'concurrency limit' is an integer that represents how many pending file system requests `ncp` has at a time. + +'stoponerr' is a boolean flag that will tell `ncp` to stop immediately if any +errors arise, rather than attempting to continue while logging errors. The default behavior is to complete as many copies as possible, logging errors along the way. + +If there are no errors, `ncp` will output `done.` when complete. If there are errors, the error messages will be logged to `stdout` and to `./ncp-debug.log`, and the copy operation will attempt to continue. + +## Programmatic usage + +Programmatic usage of `ncp` is just as simple. The only argument to the completion callback is a possible error. + +```javascript +var ncp = require('ncp').ncp; + +ncp.limit = 16; + +ncp(source, destination, function (err) { + if (err) { + return console.error(err); + } + console.log('done!'); +}); +``` + +You can also call ncp like `ncp(source, destination, options, callback)`. +`options` should be a dictionary. Currently, such options are available: + + * `options.filter` - a `RegExp` instance, against which each file name is + tested to determine whether to copy it or not, or a function taking single + parameter: copied file name, returning `true` or `false`, determining + whether to copy file or not. + + * `options.transform` - a function: `function (read, write) { read.pipe(write) }` + used to apply streaming transforms while copying. + + * `options.clobber` - boolean=true. if set to false, `ncp` will not overwrite + destination files that already exist. + + * `options.dereference` - boolean=false. If set to true, `ncp` will follow symbolic + links. For example, a symlink in the source tree pointing to a regular file + will become a regular file in the destination tree. Broken symlinks will result in + errors. + + * `options.stopOnErr` - boolean=false. If set to true, `ncp` will behave like `cp -r`, + and stop on the first error it encounters. By default, `ncp` continues copying, logging all + errors and returning an array. + + * `options.errs` - stream. If `options.stopOnErr` is `false`, a stream can be provided, and errors will be written to this stream. + +Please open an issue if any bugs arise. As always, I accept (working) pull requests, and refunds are available at `/dev/null`. diff --git a/node_modules/ncp/bin/ncp b/node_modules/ncp/bin/ncp new file mode 100755 index 0000000..388eaba --- /dev/null +++ b/node_modules/ncp/bin/ncp @@ -0,0 +1,48 @@ +#!/usr/bin/env node + + + + +var ncp = require('../lib/ncp'), + args = process.argv.slice(2), + source, dest; + +if (args.length < 2) { + console.error('Usage: ncp [source] [destination] [--filter=filter] [--limit=concurrency limit]'); + process.exit(1); +} + +// parse arguments the hard way +function startsWith(str, prefix) { + return str.substr(0, prefix.length) == prefix; +} + +var options = {}; +args.forEach(function (arg) { + if (startsWith(arg, "--limit=")) { + options.limit = parseInt(arg.split('=', 2)[1], 10); + } + if (startsWith(arg, "--filter=")) { + options.filter = new RegExp(arg.split('=', 2)[1]); + } + if (startsWith(arg, "--stoponerr")) { + options.stopOnErr = true; + } +}); + +ncp.ncp(args[0], args[1], options, function (err) { + if (Array.isArray(err)) { + console.error('There were errors during the copy.'); + err.forEach(function (err) { + console.error(err.stack || err.message); + }); + process.exit(1); + } + else if (err) { + console.error('An error has occurred.'); + console.error(err.stack || err.message); + process.exit(1); + } +}); + + diff --git a/node_modules/ncp/lib/ncp.js b/node_modules/ncp/lib/ncp.js new file mode 100644 index 0000000..34141d4 --- /dev/null +++ b/node_modules/ncp/lib/ncp.js @@ -0,0 +1,263 @@ +var fs = require('fs'), + path = require('path'); + +module.exports = ncp; +ncp.ncp = ncp; + +function ncp (source, dest, options, callback) { + var cback = callback; + + if (!callback) { + cback = options; + options = {}; + } + + var basePath = process.cwd(), + currentPath = path.resolve(basePath, source), + targetPath = path.resolve(basePath, dest), + filter = options.filter, + rename = options.rename, + transform = options.transform, + clobber = options.clobber !== false, + modified = options.modified, + dereference = options.dereference, + errs = null, + started = 0, + finished = 0, + running = 0, + limit = options.limit || ncp.limit || 16; + + limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit; + + startCopy(currentPath); + + function startCopy(source) { + started++; + if (filter && started > 1) { + if (filter instanceof RegExp) { + if (!filter.test(source)) { + return cb(true); + } else { + console.log('this matched!'); + } + } + else if (typeof filter === 'function') { + if (!filter(source)) { + return cb(true); + } + } + } + console.log('getStats'); + return getStats(source); + } + + function getStats(source) { + var stat = dereference ? fs.stat : fs.lstat; + if (running >= limit) { + return setImmediate(function () { + getStats(source); + }); + } + running++; + stat(source, function (err, stats) { + var item = {}; + if (err) { + return onError(err); + } + // We need to get the mode from the stats object and preserve it. + item.name = source; + item.mode = stats.mode; + item.mtime = stats.mtime; //modified time + item.atime = stats.atime; //access time + + if (stats.isDirectory()) { + return onDir(item); + } + else if (stats.isFile()) { + return onFile(item); + } + else if (stats.isSymbolicLink()) { + // Symlinks don't really need to know about the mode. + return onLink(source); + } + }); + } + + function onFile(file) { + var target = file.name.replace(currentPath, targetPath); + if(rename) { + target = rename(target); + } + isWritable(target, function (writable) { + if (writable) { + return copyFile(file, target); + } + if(clobber) { + rmFile(target, function () { + copyFile(file, target); + }); + } + if (modified) { + var stat = dereference ? fs.stat : fs.lstat; + stat(target, function(err, stats) { + //if souce modified time greater to target modified time copy file + if (file.mtime.getTime()>stats.mtime.getTime()) + copyFile(file, target); + else return cb(); + }); + } + else { + return cb(); + } + }); + } + + function copyFile(file, target) { + var readStream = fs.createReadStream(file.name), + writeStream = fs.createWriteStream(target, { mode: file.mode }); + + readStream.on('error', onError); + writeStream.on('error', onError); + + if(transform) { + transform(readStream, writeStream, file); + } else { + writeStream.on('open', function() { + readStream.pipe(writeStream); + }); + } + writeStream.once('finish', function() { + if (modified) { + //target file modified date sync. + fs.utimesSync(target, file.atime, file.mtime); + cb(); + } + else cb(); + }); + } + + function rmFile(file, done) { + fs.unlink(file, function (err) { + if (err) { + return onError(err); + } + return done(); + }); + } + + function onDir(dir) { + var target = dir.name.replace(currentPath, targetPath); + isWritable(target, function (writable) { + if (writable) { + return mkDir(dir, target); + } + copyDir(dir.name); + }); + } + + function mkDir(dir, target) { + fs.mkdir(target, dir.mode, function (err) { + if (err) { + return onError(err); + } + copyDir(dir.name); + }); + } + + function copyDir(dir) { + fs.readdir(dir, function (err, items) { + if (err) { + return onError(err); + } + items.forEach(function (item) { + startCopy(path.join(dir, item)); + }); + return cb(); + }); + } + + function onLink(link) { + var target = link.replace(currentPath, targetPath); + fs.readlink(link, function (err, resolvedPath) { + if (err) { + return onError(err); + } + checkLink(resolvedPath, target); + }); + } + + function checkLink(resolvedPath, target) { + if (dereference) { + resolvedPath = path.resolve(basePath, resolvedPath); + } + isWritable(target, function (writable) { + if (writable) { + return makeLink(resolvedPath, target); + } + fs.readlink(target, function (err, targetDest) { + if (err) { + return onError(err); + } + if (dereference) { + targetDest = path.resolve(basePath, targetDest); + } + if (targetDest === resolvedPath) { + return cb(); + } + return rmFile(target, function () { + makeLink(resolvedPath, target); + }); + }); + }); + } + + function makeLink(linkPath, target) { + fs.symlink(linkPath, target, function (err) { + if (err) { + return onError(err); + } + return cb(); + }); + } + + function isWritable(path, done) { + fs.lstat(path, function (err) { + if (err) { + if (err.code === 'ENOENT') return done(true); + return done(false); + } + return done(false); + }); + } + + function onError(err) { + if (options.stopOnError) { + return cback(err); + } + else if (!errs && options.errs) { + errs = fs.createWriteStream(options.errs); + } + else if (!errs) { + errs = []; + } + if (typeof errs.write === 'undefined') { + errs.push(err); + } + else { + errs.write(err.stack + '\n\n'); + } + return cb(); + } + + function cb(skipped) { + if (!skipped) running--; + finished++; + if ((started === finished) && (running === 0)) { + if (cback !== undefined ) { + return errs ? cback(errs) : cback(null); + } + } + } +} + + diff --git a/node_modules/ncp/package.json b/node_modules/ncp/package.json new file mode 100644 index 0000000..9f3fa20 --- /dev/null +++ b/node_modules/ncp/package.json @@ -0,0 +1,64 @@ +{ + "name": "ncp", + "version": "2.0.0", + "author": { + "name": "AvianFlu", + "email": "charlie@charlieistheman.com" + }, + "description": "Asynchronous recursive file copy utility.", + "bin": { + "ncp": "./bin/ncp" + }, + "devDependencies": { + "mocha": "1.15.x", + "rimraf": "1.0.x", + "read-dir-files": "0.0.x" + }, + "main": "./lib/ncp.js", + "repository": { + "type": "git", + "url": "git+https://github.com/AvianFlu/ncp.git" + }, + "keywords": [ + "cli", + "copy" + ], + "license": "MIT", + "engine": { + "node": ">=0.10" + }, + "scripts": { + "test": "mocha -R spec" + }, + "gitHead": "93c7c6c719e2a4944dc09a16178b09aef428cdf0", + "bugs": { + "url": "https://github.com/AvianFlu/ncp/issues" + }, + "homepage": "https://github.com/AvianFlu/ncp", + "_id": "ncp@2.0.0", + "_shasum": "195a21d6c46e361d2fb1281ba38b91e9df7bdbb3", + "_from": "ncp@*", + "_npmVersion": "2.6.0", + "_nodeVersion": "0.13.0-pre", + "_npmUser": { + "name": "mmalecki", + "email": "me@mmalecki.com" + }, + "maintainers": [ + { + "name": "avianflu", + "email": "charlie@charlieistheman.com" + }, + { + "name": "mmalecki", + "email": "me@mmalecki.com" + } + ], + "dist": { + "shasum": "195a21d6c46e361d2fb1281ba38b91e9df7bdbb3", + "tarball": "http://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "http://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/ncp/test/modified-files/out/a b/node_modules/ncp/test/modified-files/out/a new file mode 100644 index 0000000..29f446a --- /dev/null +++ b/node_modules/ncp/test/modified-files/out/a @@ -0,0 +1 @@ +test3 \ No newline at end of file diff --git a/node_modules/ncp/test/modified-files/src/a b/node_modules/ncp/test/modified-files/src/a new file mode 100644 index 0000000..29f446a --- /dev/null +++ b/node_modules/ncp/test/modified-files/src/a @@ -0,0 +1 @@ +test3 \ No newline at end of file diff --git a/node_modules/ncp/test/ncp.js b/node_modules/ncp/test/ncp.js new file mode 100644 index 0000000..bc6df22 --- /dev/null +++ b/node_modules/ncp/test/ncp.js @@ -0,0 +1,197 @@ + + +var assert = require('assert'), + fs = require('fs'), + path = require('path'), + rimraf = require('rimraf'), + readDirFiles = require('read-dir-files'), + util = require('util'), + ncp = require('../').ncp; + + + +describe('ncp', function () { + describe('regular files and directories', function () { + var fixtures = path.join(__dirname, 'regular-fixtures'), + src = path.join(fixtures, 'src'), + out = path.join(fixtures, 'out'); + + before(function (cb) { + rimraf(out, function() { + ncp(src, out, cb); + }); + }); + + describe('when copying a directory of files', function () { + it('files are copied correctly', function (cb) { + readDirFiles(src, 'utf8', function (srcErr, srcFiles) { + readDirFiles(out, 'utf8', function (outErr, outFiles) { + assert.ifError(srcErr); + assert.deepEqual(srcFiles, outFiles); + cb(); + }); + }); + }); + }); + + describe('when copying files using filter', function () { + before(function (cb) { + var filter = function(name) { + return name.substr(name.length - 1) != 'a'; + }; + rimraf(out, function () { + ncp(src, out, {filter: filter}, cb); + }); + }); + + it('files are copied correctly', function (cb) { + readDirFiles(src, 'utf8', function (srcErr, srcFiles) { + function filter(files) { + for (var fileName in files) { + var curFile = files[fileName]; + if (curFile instanceof Object) + return filter(curFile); + if (fileName.substr(fileName.length - 1) == 'a') + delete files[fileName]; + } + } + filter(srcFiles); + readDirFiles(out, 'utf8', function (outErr, outFiles) { + assert.ifError(outErr); + assert.deepEqual(srcFiles, outFiles); + cb(); + }); + }); + }); + }); + + describe('when using clobber=false', function () { + it('the copy is completed successfully', function (cb) { + ncp(src, out, function() { + ncp(src, out, {clobber: false}, function(err) { + assert.ifError(err); + cb(); + }); + }); + }); + }); + + describe('when using transform', function () { + it('file descriptors are passed correctly', function (cb) { + ncp(src, out, { + transform: function(read,write,file) { + assert.notEqual(file.name, undefined); + assert.strictEqual(typeof file.mode,'number'); + read.pipe(write); + } + }, cb); + }); + }); + + describe('when using rename', function() { + it('output files are correctly redirected', function(cb) { + ncp(src, out, { + rename: function(target) { + if(path.basename(target) == 'a') return path.resolve(path.dirname(target), 'z'); + return target; + } + }, function(err) { + if(err) return cb(err); + + readDirFiles(src, 'utf8', function (srcErr, srcFiles) { + readDirFiles(out, 'utf8', function (outErr, outFiles) { + assert.ifError(srcErr); + assert.deepEqual(srcFiles.a, outFiles.z); + cb(); + }); + }); + }); + }); + }); + }); + + describe('symlink handling', function () { + var fixtures = path.join(__dirname, 'symlink-fixtures'), + src = path.join(fixtures, 'src'), + out = path.join(fixtures, 'out'); + + beforeEach(function (cb) { + rimraf(out, cb); + }); + + it('copies symlinks by default', function (cb) { + ncp(src, out, function (err) { + if (err) return cb(err); + assert.equal(fs.readlinkSync(path.join(out, 'file-symlink')), 'foo'); + assert.equal(fs.readlinkSync(path.join(out, 'dir-symlink')), 'dir'); + cb(); + }) + }); + + it('copies file contents when dereference=true', function (cb) { + ncp(src, out, { dereference: true }, function (err) { + var fileSymlinkPath = path.join(out, 'file-symlink'); + assert.ok(fs.lstatSync(fileSymlinkPath).isFile()); + assert.equal(fs.readFileSync(fileSymlinkPath), 'foo contents'); + + var dirSymlinkPath = path.join(out, 'dir-symlink'); + assert.ok(fs.lstatSync(dirSymlinkPath).isDirectory()); + assert.deepEqual(fs.readdirSync(dirSymlinkPath), ['bar']); + + cb(); + }); + }); + }); + + describe('broken symlink handling', function () { + var fixtures = path.join(__dirname, 'broken-symlink-fixtures'), + src = path.join(fixtures, 'src'), + out = path.join(fixtures, 'out'); + + beforeEach(function (cb) { + rimraf(out, cb); + }); + + it('copies broken symlinks by default', function (cb) { + ncp(src, out, function (err) { + if (err) return cb(err); + assert.equal(fs.readlinkSync(path.join(out, 'broken-symlink')), 'does-not-exist'); + cb(); + }) + }); + + it('returns an error when dereference=true', function (cb) { + ncp(src, out, {dereference: true}, function (err) { + assert.equal(err.length, 1); + assert.equal(err[0].code, 'ENOENT'); + cb(); + }); + }); + }); + + describe('modified files copies', function () { + var fixtures = path.join(__dirname, 'modified-files'), + src = path.join(fixtures, 'src'), + out = path.join(fixtures, 'out'); + + it('if file not exists copy file to target', function(cb) { + rimraf(out, function() { + ncp(src, out, {modified: true, clobber: false}, function (err) { + assert.equal(fs.existsSync(out), true); + cb(); + }); + }); + }); + + it('change source file mtime and copy', function(cb) { + fs.utimesSync(src+"/a", new Date().getTime()/1000, new Date('2015-01-01 00:00:00').getTime()/1000); + ncp(src, out, {modified: true, clobber: false}, function (err) { + fs.stat(out+"/a", function(err, stats) { + assert.equal(stats.mtime.getTime(), new Date('2015-01-01 00:00:00').getTime()); + cb(); + }); + }); + }); + + }); +}); \ No newline at end of file diff --git a/node_modules/ncp/test/regular-fixtures/src/a b/node_modules/ncp/test/regular-fixtures/src/a new file mode 100644 index 0000000..802992c --- /dev/null +++ b/node_modules/ncp/test/regular-fixtures/src/a @@ -0,0 +1 @@ +Hello world diff --git a/node_modules/ncp/test/regular-fixtures/src/b b/node_modules/ncp/test/regular-fixtures/src/b new file mode 100644 index 0000000..9f6bb18 --- /dev/null +++ b/node_modules/ncp/test/regular-fixtures/src/b @@ -0,0 +1 @@ +Hello ncp diff --git a/node_modules/ncp/test/regular-fixtures/src/c b/node_modules/ncp/test/regular-fixtures/src/c new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/ncp/test/regular-fixtures/src/d b/node_modules/ncp/test/regular-fixtures/src/d new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/ncp/test/regular-fixtures/src/e b/node_modules/ncp/test/regular-fixtures/src/e new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/ncp/test/regular-fixtures/src/f b/node_modules/ncp/test/regular-fixtures/src/f new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/ncp/test/regular-fixtures/src/sub/a b/node_modules/ncp/test/regular-fixtures/src/sub/a new file mode 100644 index 0000000..cf291b5 --- /dev/null +++ b/node_modules/ncp/test/regular-fixtures/src/sub/a @@ -0,0 +1 @@ +Hello nodejitsu diff --git a/node_modules/ncp/test/regular-fixtures/src/sub/b b/node_modules/ncp/test/regular-fixtures/src/sub/b new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/ncp/test/symlink-fixtures/src/dir/bar b/node_modules/ncp/test/symlink-fixtures/src/dir/bar new file mode 100644 index 0000000..fd06f5f --- /dev/null +++ b/node_modules/ncp/test/symlink-fixtures/src/dir/bar @@ -0,0 +1 @@ +bar contents \ No newline at end of file diff --git a/node_modules/ncp/test/symlink-fixtures/src/foo b/node_modules/ncp/test/symlink-fixtures/src/foo new file mode 100644 index 0000000..35fc060 --- /dev/null +++ b/node_modules/ncp/test/symlink-fixtures/src/foo @@ -0,0 +1 @@ +foo contents \ No newline at end of file diff --git a/views/baseFiles/body.jade b/views/baseFiles/body.jade new file mode 100644 index 0000000..8ff5f15 --- /dev/null +++ b/views/baseFiles/body.jade @@ -0,0 +1,17 @@ +a(href='#/main') main + br +a(href='#/restCalls/1010') rest calls +br +div(ng-view='') +script(src='js/libs/jquery/jquery-2.0.3.js') +script(src='https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js') +// +script(src='js/libs/angular/angular-route.js') +script(src='js/libs/bootstrap/js/bootstrap.min.js') +script(src='js/main.js') +script(src='js/controllers.js') +script(src='js/functions.js') +script(src='js/db.js') +// firebase +script(src='https://cdn.firebase.com/v0/firebase.js') +script(src='https://cdn.firebase.com/libs/angularfire/0.7.1/angularfire.min.js') diff --git a/views/baseFiles/main.css b/views/baseFiles/main.css new file mode 100644 index 0000000..c1894b8 --- /dev/null +++ b/views/baseFiles/main.css @@ -0,0 +1,15 @@ +html, body { height: 100%; } +body { + color: #333; +} + + +/* data-binding: heroes */ + +#heroes { + padding-top: 20px; +} +#heroes li span { + display: inline-block; + width: 150px; +} diff --git a/views/baseFiles/normalize.css b/views/baseFiles/normalize.css new file mode 100644 index 0000000..458eea1 --- /dev/null +++ b/views/baseFiles/normalize.css @@ -0,0 +1,427 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9/10. + */ + +img { + border: 0; +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ + +button, +input, +optgroup, +select, +textarea { + color: inherit; /* 1 */ + font: inherit; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +}