diff --git a/design-patterns/builder.html b/design-patterns/builder.html index b06662a..52a4741 100644 --- a/design-patterns/builder.html +++ b/design-patterns/builder.html @@ -23,6 +23,11 @@ console.log('Requested Beer: '+beer); }); } + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate +// http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/ \ No newline at end of file diff --git a/design-patterns/chain-of-responsibility.html b/design-patterns/chain-of-responsibility.html index f4f2d17..a6e051c 100644 --- a/design-patterns/chain-of-responsibility.html +++ b/design-patterns/chain-of-responsibility.html @@ -56,6 +56,11 @@ //} button.handle(); + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate +// http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/ \ No newline at end of file diff --git a/design-patterns/command.html b/design-patterns/command.html index 20a0acf..a78bd63 100644 --- a/design-patterns/command.html +++ b/design-patterns/command.html @@ -33,6 +33,10 @@ })(); +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate +// http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/ \ No newline at end of file diff --git a/design-patterns/decorator.html b/design-patterns/decorator.html index fd1f92a..e9a91be 100644 --- a/design-patterns/decorator.html +++ b/design-patterns/decorator.html @@ -42,6 +42,11 @@ tree = tree.getDecorator('RedBalls'); tree.decorate(); + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate +// http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/ \ No newline at end of file diff --git a/design-patterns/facade.html b/design-patterns/facade.html index f5bdb25..2930ac5 100644 --- a/design-patterns/facade.html +++ b/design-patterns/facade.html @@ -14,6 +14,11 @@ } // ... }; + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate +// http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/ \ No newline at end of file diff --git a/design-patterns/factory.html b/design-patterns/factory.html index e3bb4dc..636368a 100644 --- a/design-patterns/factory.html +++ b/design-patterns/factory.html @@ -6,7 +6,6 @@ \ No newline at end of file diff --git a/design-patterns/iterator.html b/design-patterns/iterator.html index 4881fd3..d632cb0 100644 --- a/design-patterns/iterator.html +++ b/design-patterns/iterator.html @@ -58,6 +58,11 @@ // go back agg.rewind(); console.log(agg.current()); // 1 + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate +// http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/ \ No newline at end of file diff --git a/design-patterns/mediator.html b/design-patterns/mediator.html index 72c89ab..aa1f8ca 100644 --- a/design-patterns/mediator.html +++ b/design-patterns/mediator.html @@ -80,6 +80,10 @@ console.log('Game over!'); }, 30000); +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate +// http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/ \ No newline at end of file diff --git a/design-patterns/observer.html b/design-patterns/observer.html index 721e5c0..57ba2fd 100644 --- a/design-patterns/observer.html +++ b/design-patterns/observer.html @@ -70,6 +70,11 @@ la_times.addSubscriber(jill.gossip); la_times.newIssue(); + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate +// http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/ \ No newline at end of file diff --git a/design-patterns/proxy.html b/design-patterns/proxy.html index 4a4b988..c995533 100644 --- a/design-patterns/proxy.html +++ b/design-patterns/proxy.html @@ -201,6 +201,10 @@

Dave Matthews vids

} }; +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate +// http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/ \ No newline at end of file diff --git a/design-patterns/singleton.html b/design-patterns/singleton.html index e4acf94..ce2607f 100644 --- a/design-patterns/singleton.html +++ b/design-patterns/singleton.html @@ -136,6 +136,11 @@ this.bang = "Big"; }; }()); + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate +// http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/ \ No newline at end of file diff --git a/design-patterns/strategy.html b/design-patterns/strategy.html index f9133cd..cd53348 100644 --- a/design-patterns/strategy.html +++ b/design-patterns/strategy.html @@ -103,6 +103,11 @@ if (validator.hasErrors()) { console.log(validator.messages.join("\n")); } + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate +// http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/ \ No newline at end of file diff --git a/function-patterns/callback.html b/function-patterns/callback.html index 5dfb294..6fb52db 100644 --- a/function-patterns/callback.html +++ b/function-patterns/callback.html @@ -39,7 +39,9 @@ // find the nodes and hide them as you go findNodes(hide); - +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate \ No newline at end of file diff --git a/function-patterns/configuration-objects.html b/function-patterns/configuration-objects.html index ebd0132..e1d2222 100644 --- a/function-patterns/configuration-objects.html +++ b/function-patterns/configuration-objects.html @@ -12,6 +12,10 @@ last: "Shi" }; addPerson(conf); + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate \ No newline at end of file diff --git a/function-patterns/currying.html b/function-patterns/currying.html index d7aa995..082d954 100644 --- a/function-patterns/currying.html +++ b/function-patterns/currying.html @@ -93,6 +93,10 @@ return fn.apply(null, args); }; } + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate \ No newline at end of file diff --git a/function-patterns/enforcing-new-in-constructors.html b/function-patterns/enforcing-new-in-constructors.html index 88e4e23..f1d1073 100644 --- a/function-patterns/enforcing-new-in-constructors.html +++ b/function-patterns/enforcing-new-in-constructors.html @@ -14,6 +14,10 @@ }; return that; } + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate \ No newline at end of file diff --git a/function-patterns/immediate-functions.html b/function-patterns/immediate-functions.html index 989ebbb..a318c00 100644 --- a/function-patterns/immediate-functions.html +++ b/function-patterns/immediate-functions.html @@ -9,6 +9,10 @@ (function () { console.log('watch out!'); }()); + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate \ No newline at end of file diff --git a/function-patterns/immediate-object-initialization.html b/function-patterns/immediate-object-initialization.html index c9c86f8..59d0225 100644 --- a/function-patterns/immediate-object-initialization.html +++ b/function-patterns/immediate-object-initialization.html @@ -23,6 +23,10 @@ // more init tasks... } }).init(); + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate \ No newline at end of file diff --git a/function-patterns/init-time-branching.html b/function-patterns/init-time-branching.html index ccbf5b0..30d0bd0 100644 --- a/function-patterns/init-time-branching.html +++ b/function-patterns/init-time-branching.html @@ -47,7 +47,10 @@ el['on' + type] = null; }; } - + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate \ No newline at end of file diff --git a/function-patterns/returning-functions.html b/function-patterns/returning-functions.html index 7c2b6e7..5f2eb2f 100644 --- a/function-patterns/returning-functions.html +++ b/function-patterns/returning-functions.html @@ -27,6 +27,10 @@ //next(); // returns 1 //next(); // returns 2 //next(); // returns 3 + +// reference +// http://www.jspatterns.com/ +// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate \ No newline at end of file diff --git a/general-patterns/access-to-global-object.html b/general-patterns/access-to-global-object.html new file mode 100644 index 0000000..e397652 --- /dev/null +++ b/general-patterns/access-to-global-object.html @@ -0,0 +1,19 @@ + + + +JavaScript Patterns + + + + + + \ No newline at end of file diff --git a/general-patterns/avoiding-eval.html b/general-patterns/avoiding-eval.html new file mode 100644 index 0000000..ef43c76 --- /dev/null +++ b/general-patterns/avoiding-eval.html @@ -0,0 +1,32 @@ + + + +JavaScript Patterns + + + + + + \ No newline at end of file diff --git a/general-patterns/avoiding-implied-typecasting.html b/general-patterns/avoiding-implied-typecasting.html new file mode 100644 index 0000000..3f4cda5 --- /dev/null +++ b/general-patterns/avoiding-implied-typecasting.html @@ -0,0 +1,25 @@ + + + +JavaScript Patterns + + + + + + \ No newline at end of file diff --git a/general-patterns/built-in-prototypes.html b/general-patterns/built-in-prototypes.html new file mode 100644 index 0000000..cc935d6 --- /dev/null +++ b/general-patterns/built-in-prototypes.html @@ -0,0 +1,19 @@ + + + +JavaScript Patterns + + + + + + \ No newline at end of file diff --git a/general-patterns/globals.html b/general-patterns/globals.html index 21f391c..fd2cfa2 100644 --- a/general-patterns/globals.html +++ b/general-patterns/globals.html @@ -23,16 +23,16 @@ // ... } +var a = (b = 0); + function foo() { var a, b; // ... a = b = 0; // both local } -var global = (function () { - return this; -}()); - +// reference +// http://net.tutsplus.com/tutorials/javascript-ajax/the-essentials-of-writing-high-quality-javascript/ \ No newline at end of file diff --git a/general-patterns/hoisting.html b/general-patterns/hoisting.html index 6c4d60c..1a6f6d2 100644 --- a/general-patterns/hoisting.html +++ b/general-patterns/hoisting.html @@ -15,6 +15,7 @@ } func(); +// The preceding code snippet will behave as if it were implemented like so: myname = "global"; // global variable function func() { var myname; // same as -> var myname = undefined; @@ -24,6 +25,8 @@ } func(); +// reference +// http://net.tutsplus.com/tutorials/javascript-ajax/the-essentials-of-writing-high-quality-javascript/ \ No newline at end of file diff --git a/general-patterns/minimizing-globals.html b/general-patterns/minimizing-globals.html new file mode 100644 index 0000000..5c1e6fd --- /dev/null +++ b/general-patterns/minimizing-globals.html @@ -0,0 +1,19 @@ + + + +JavaScript Patterns + + + + + + \ No newline at end of file diff --git a/general-patterns/parseint.html b/general-patterns/parseint.html new file mode 100644 index 0000000..39a6e7c --- /dev/null +++ b/general-patterns/parseint.html @@ -0,0 +1,21 @@ + + + +JavaScript Patterns + + + + + + \ No newline at end of file diff --git a/general-patterns/switch-pattern.html b/general-patterns/switch-pattern.html new file mode 100644 index 0000000..d2c4fa1 --- /dev/null +++ b/general-patterns/switch-pattern.html @@ -0,0 +1,26 @@ + + + +JavaScript Patterns + + + + + + \ No newline at end of file diff --git a/jquery-patterns/append.html b/jquery-patterns/append.html index 5bfbe78..ba173b4 100644 --- a/jquery-patterns/append.html +++ b/jquery-patterns/append.html @@ -27,6 +27,9 @@ myhtml += '
  • ' + item + '
  • '; }); $('#ballers').html(myhtml); + +// reference +// http://paulirish.com/2009/perf/ \ No newline at end of file diff --git a/jquery-patterns/context-and-find.html b/jquery-patterns/context-and-find.html index f3322ff..fe78974 100644 --- a/jquery-patterns/context-and-find.html +++ b/jquery-patterns/context-and-find.html @@ -15,6 +15,9 @@ $('.reply_form', $(this).closest('.comment')).hide(); // preferred $('this').closet('.comment').find('.reply_form').hide(); + +// reference +// http://paulirish.com/2009/perf/ \ No newline at end of file diff --git a/jquery-patterns/data.html b/jquery-patterns/data.html index fcb6379..8802850 100644 --- a/jquery-patterns/data.html +++ b/jquery-patterns/data.html @@ -11,6 +11,9 @@ // preferred $.data(elem,key,value); + +// reference +// http://paulirish.com/2009/perf/ \ No newline at end of file diff --git a/jquery-patterns/decending-from-id.html b/jquery-patterns/decending-from-id.html index ee20543..7ac7db8 100644 --- a/jquery-patterns/decending-from-id.html +++ b/jquery-patterns/decending-from-id.html @@ -18,6 +18,9 @@ // preferred var arms = $('#container').find('div.robotarm'); + +// reference +// http://paulirish.com/2009/perf/ \ No newline at end of file diff --git a/jquery-patterns/detach.html b/jquery-patterns/detach.html index a6a3cea..79cd9e5 100644 --- a/jquery-patterns/detach.html +++ b/jquery-patterns/detach.html @@ -15,6 +15,9 @@ table.detach(); table.addLotsAndLotsOfRows(); parent.append(table); + +// reference +// http://paulirish.com/2009/perf/ \ No newline at end of file diff --git a/jquery-patterns/event-delegation.html b/jquery-patterns/event-delegation.html index 3defd18..634fb26 100644 --- a/jquery-patterns/event-delegation.html +++ b/jquery-patterns/event-delegation.html @@ -11,6 +11,9 @@ // preferred $('#container').delegate('click', 'a.trigger', handlerFn) + +// reference +// http://paulirish.com/2009/perf/ \ No newline at end of file diff --git a/jquery-patterns/left-and-right.html b/jquery-patterns/left-and-right.html index 0ca44e0..b6992df 100644 --- a/jquery-patterns/left-and-right.html +++ b/jquery-patterns/left-and-right.html @@ -15,6 +15,9 @@ // preferred $('.data td.brad') + +// reference +// http://paulirish.com/2009/perf/ \ No newline at end of file diff --git a/jquery-patterns/requery.html b/jquery-patterns/requery.html index 5883ce1..b560d18 100644 --- a/jquery-patterns/requery.html +++ b/jquery-patterns/requery.html @@ -17,6 +17,9 @@ $("
    ") .appendTo(document.body) .click(function(){}); + +// reference +// http://paulirish.com/2009/perf/ \ No newline at end of file diff --git a/jquery-patterns/specific-when-needed.html b/jquery-patterns/specific-when-needed.html index 1693a52..6c69f5e 100644 --- a/jquery-patterns/specific-when-needed.html +++ b/jquery-patterns/specific-when-needed.html @@ -15,6 +15,9 @@ // preferred var arms = $('.data td.brad'); + +// reference +// http://paulirish.com/2009/perf/ \ No newline at end of file diff --git a/jquery-patterns/universal-selector.html b/jquery-patterns/universal-selector.html index 5e53ab9..46d4592 100644 --- a/jquery-patterns/universal-selector.html +++ b/jquery-patterns/universal-selector.html @@ -16,6 +16,9 @@ $('.gender *:radio') // preferred $('.gender input:radio') + +// reference +// http://paulirish.com/2009/perf/ \ No newline at end of file