├── .gitignore ├── hero.png ├── package.json ├── license.txt ├── gulpfile.js ├── .jsbeautifyrc ├── README.md └── .jshintrc /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | .tmp 4 | builds/development/images/** -------------------------------------------------------------------------------- /hero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planetoftheweb/CodeClinicJS/HEAD/hero.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootCarousel", 3 | "version": "0.0.1", 4 | "description": "Assets for my Bootstrap Layouts: Carousel course at Lynda.com", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/planetoftheweb/bootcarousel.git" 8 | }, 9 | "author": "Ray Villalobos", 10 | "devDependencies": { 11 | "gulp": "^3.8.8", 12 | "gulp-jsbeautifier": "0.0.4", 13 | "gulp-jshint": "^1.9.0", 14 | "gulp-util": "^2.2.20", 15 | "gulp-w3cjs": "^0.2.1", 16 | "gulp-webserver": "^0.8.8", 17 | "jshint-stylish": "^1.0.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Eric (Ray) Villalobos 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'), 2 | gutil = require('gulp-util'), 3 | stylish = require('jshint-stylish'), 4 | jshint = require('gulp-jshint'), 5 | w3cjs = require('gulp-w3cjs'), 6 | prettify = require('gulp-jsbeautifier'), 7 | webserver = require('gulp-webserver'); 8 | 9 | gulp.task('js', function() { 10 | return gulp.src('builds/development/js/myscript.js') 11 | .pipe(jshint('./.jshintrc')) 12 | .pipe(jshint.reporter('jshint-stylish')); 13 | }); 14 | 15 | gulp.task('html', function() { 16 | gulp.src('builds/development/*.html') 17 | .pipe(w3cjs()); 18 | }); 19 | 20 | gulp.task('css', function() { 21 | gulp.src('builds/development/css/*.css') 22 | }); 23 | 24 | gulp.task('watch', function() { 25 | gulp.watch('builds/development/js/**/*', ['js']); 26 | gulp.watch('builds/development/css/*.css', ['css']); 27 | gulp.watch(['builds/development/*.html', 28 | 'builds/development/views/*.html' 29 | ], ['html']); 30 | }); 31 | 32 | gulp.task('webserver', function() { 33 | gulp.src('builds/development/') 34 | .pipe(webserver({ 35 | livereload: true, 36 | open: true 37 | })); 38 | }); 39 | 40 | gulp.task('default', ['watch', 'html', 'js', 'css', 'webserver']); 41 | -------------------------------------------------------------------------------- /.jsbeautifyrc: -------------------------------------------------------------------------------- 1 | { 2 | // The plugin looks for a .jsbeautifyrc file in the same directory as the 3 | // source file you're prettifying (or any directory above if it doesn't exist, 4 | // or in your home folder if everything else fails) and uses those options 5 | // along the default ones. 6 | 7 | // Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options 8 | // Documentation: https://github.com/einars/js-beautify/ 9 | "html": { 10 | "allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg"], 11 | "brace_style": "none", // collapse|expand|end-expand Put braces on the same line as control statements, or put braces on own line, or just put end braces on own line. 12 | "end_with_newline": false, 13 | "indent_char": " ", 14 | "indent_handlebars": false, // e.g. {{#foo}}, {{/foo}} 15 | "indent_inner_html": false, // Indent and sections. 16 | "indent_scripts": "separate", // "separate", "normal" 17 | "indent_size": 2, 18 | "max_preserve_newlines": 10, 19 | "padcomments": false, 20 | "preserve_newlines": true, 21 | "unformatted": ["a", "div", "span", "li", "img", "code", "pre", "sub", "sup", "em", "strong", "b", "i", "u", "strike", "big","small", "pre", "h1", "h2", "h3", "h4", "h5", "h6", "!--"], 22 | "wrap_line_length": 0 23 | }, 24 | 25 | "css": { 26 | "allowed_file_extensions": ["css", "scss", "sass", "less"], 27 | "end_with_newline": false, 28 | "indent_char": " ", 29 | "indent_size": 2, 30 | "selector_separator": " ", 31 | "selector_separator_newline": false 32 | }, 33 | "js": { 34 | "allowed_file_extensions": ["js", "json", "jshintrc", "jsbeautifyrc"], 35 | "brace_style": "collapse", // "expand", "end-expand", "none" 36 | "break_chained_methods": false, 37 | "e4x": false, 38 | "end_with_newline": false, 39 | "eval_code": false, 40 | "indent_char": " ", 41 | "indent_level": 0, 42 | "indent_size": 2, 43 | "indent_with_tabs": false, 44 | "jslint_happy": false, 45 | "keep_array_indentation": false, 46 | "keep_function_indentation": false, 47 | "max_preserve_newlines": 10, 48 | "preserve_newlines": true, 49 | "space_after_anon_function": false, 50 | "space_before_conditional": true, 51 | "space_in_empty_paren": false, 52 | "space_in_paren": false, 53 | "unescape_strings": false, 54 | "wrap_line_length": 0 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Code Clinic: JavaScript 2 | This is the repository for my course Code Clinic: JavaScript. The full course is available on [LinkedIn Learning](https://www.linkedin.com/learning/code-clinic-javascript?trk=insiders_6787408_learning) and [Lynda.com](https://www.lynda.com/JavaScript-tutorials/Code-Clinic-JavaScript/369707-2.html) 3 | 4 | [![Code Clinic: JavaScript](https://media-exp2.licdn.com/media-proxy/ext?w=1200&h=675&f=n&hash=Vers84NztDDIA7G5s8GGuQQ7iCo%3D&ora=1%2CaFBCTXdkRmpGL2lvQUFBPQ%2CxAVta5g-0R6plxVUzgUv5K_PrkC9q0RIUJDPBy-iXSyt-tKfY3HgfsfYZLSioVoWcC8JlgY3euugSDjiF469LcLmY4Yx3A)](https://www.linkedin.com/learning/code-clinic-javascript?trk=insiders_6787408_learning) 5 | 6 | ## Instructions 7 | This repository has branches for each of the videos in the course. You can use the branch pop up menu in github to switch to a specific branch and take a look at the course at that stage. Or you can simply add `/tree/BRANCH_NAME` to the URL to go to the branch you want to peek at. 8 | 9 | ## Branches 10 | The branches are structured so that they correspond to the videos in the course. So, for example if I name a branch `02_03b` then that branch corresponds to the second chapter and the third video in that chapter. The extra letter at the end of the name corresponds to the state of the branch. A `b` means that this is how the code looks at the beginning of the video, an `e` means that is how the code looked at the end of the video. 11 | 12 | You may find additional branches that correspod to other states, so for example, you may see a `t`, which means this is a target branch. A target branch is something I use during development or updates of a course and it's for a branch that I'm working towards. For the purposes of taking a course, you may ignore any additional branches. The `master` branch usually has the state of the project as I'm working through it and the final state of the code when I finish the course. 13 | 14 | ## Installing 15 | 1. Make sure you have these installed 16 | - [node.js](http://nodejs.org/) 17 | - [git](http://git-scm.com/) 18 | - [gulp](http://gulpjs.com/) 19 | 2. Clone this repository into your local machine using the terminal (mac) or Gitbash (PC) `> git clone CLONEURL` 20 | 3. CD to the folder `cd FOLDERNAME` 21 | 4. Run `> npm install` to install the project dependencies 22 | 5. Run `> gulp` to start live preview server 23 | 24 | ## More Stuff 25 | Check out some of my other courses on [LinkedIn Learning](https://www.linkedin.com/learning/instructors/ray-villalobos?trk=insiders_6787408_learning) and [lynda.com](http://lynda.com/rayvillalobos). You can follow me on [LinkedIn](https://www.linkedin.com/in/planetoftheweb/), read [my blog](http://raybo.org), [follow me on twitter](http://twitter.com/planetoftheweb), or check out my [youtube channel](http://youtube.com/planetoftheweb). 26 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "maxerr": 50, // {int} Maximum error before stopping 4 | 5 | // Enforcing 6 | "bitwise": true, // true: Prohibit bitwise operators (&, |, ^, etc.) 7 | "camelcase": false, // true: Identifiers must be in camelCase 8 | "curly": true, // true: Require {} for every new block or scope 9 | "eqeqeq": true, // true: Require triple equals (===) for comparison 10 | "forin": true, // true: Require filtering for..in loops with obj.hasOwnProperty() 11 | "freeze": true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. 12 | "immed": true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` 13 | "indent": 4, // {int} Number of spaces to use for indentation 14 | "latedef": true, // true: Require variables/functions to be defined before being used 15 | "newcap": false, // true: Require capitalization of all constructor functions e.g. `new F()` 16 | "noarg": true, // true: Prohibit use of `arguments.caller` and `arguments.callee` 17 | "noempty": true, // true: Prohibit use of empty blocks 18 | "nonbsp": true, // true: Prohibit "non-breaking whitespace" characters. 19 | "nonew": true, // true: Prohibit use of constructors for side-effects (without assignment) 20 | "plusplus": false, // true: Prohibit use of `++` & `--` 21 | "quotmark": "single", // Quotation mark consistency: 22 | // false : do nothing (default) 23 | // true : ensure whatever is used is consistent 24 | // "single" : require single quotes 25 | // "double" : require double quotes 26 | "undef": true, // true: Require all non-global variables to be declared (prevents global leaks) 27 | "unused": false, // true: Require all defined variables be used 28 | "strict": true, // true: Requires all functions run in ES5 Strict Mode 29 | "maxparams": false, // {int} Max number of formal params allowed per function 30 | "maxdepth": 4, // {int} Max depth of nested blocks (within functions) 31 | "maxstatements": false, // {int} Max number statements per function 32 | "maxcomplexity": false, // {int} Max cyclomatic complexity per function 33 | "maxlen": 400, // {int} Max number of characters per line 34 | 35 | // Relaxing 36 | "browser": true, //true: Assume this is going to a browser 37 | "devel": true, //true: Allow poor man console.log debugging, make sure you remove for production 38 | "asi": false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) 39 | "boss": false, // true: Tolerate assignments where comparisons would be expected 40 | "debug": false, // true: Allow debugger statements e.g. browser breakpoints. 41 | "eqnull": false, // true: Tolerate use of `== null` 42 | "es5": false, // true: Allow ES5 syntax (ex: getters and setters) 43 | "esnext": true, // true: Allow ES.next (ES6) syntax (ex: `const`) 44 | "moz": false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) 45 | // (ex: `for each`, multiple try/catch, function expression…) 46 | "evil": true, // true: Tolerate use of `eval` and `new Function()` 47 | "expr": true, // true: Tolerate `ExpressionStatement` as Programs 48 | "funcscope": false, // true: Tolerate defining variables inside control statements 49 | "globalstrict": false, // true: Allow global "use strict" (also enables 'strict') 50 | "iterator": false, // true: Tolerate using the `__iterator__` property 51 | "lastsemic": false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block 52 | "laxbreak": false, // true: Tolerate possibly unsafe line breakings 53 | "laxcomma": false, // true: Tolerate comma-first style coding 54 | "loopfunc": true, // true: Tolerate functions being defined in loops 55 | "multistr": true, // true: Tolerate multi-line strings 56 | "noyield": false, // true: Tolerate generator functions with no yield statement in them. 57 | "notypeof": false, // true: Tolerate invalid typeof operator values 58 | "proto": false, // true: Tolerate using the `__proto__` property 59 | "scripturl": false, // true: Tolerate script-targeted URLs 60 | "shadow": false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` 61 | "sub": false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation 62 | "supernew": false, // true: Tolerate `new function () { ... };` and `new Object;` 63 | "validthis": false, // true: Tolerate using this in a non-constructor function 64 | 65 | // Custom Globals 66 | "globals": { 67 | "$": false, 68 | "jquery": false, 69 | "c3": false, 70 | "jsonReturnData": false, 71 | "Mustache": false, 72 | "JpegMeta": false, 73 | "resemble": false, 74 | "AudioContext": false, 75 | "webkitAudioContext": false, 76 | "angular": false 77 | } // additional predefined global variables 78 | } 79 | --------------------------------------------------------------------------------