This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Tab Module Bootstrap | |
* | |
* @category ProjectNamespace | |
* @package Application | |
* @subpackage Tab | |
* @author Curtis Branum <cbranum@nerdery.com> | |
* @version $Id$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This controller is the tab index controller | |
* | |
* @category ProjectNamespace | |
* @package Application | |
* @subpackage Tab | |
* @author Curtis Branum <cbranum@nerdery.com> | |
* @version $Id$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources.modules = On | |
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NERD.FeedPostDialog = { | |
init: function () { | |
this.bind(); | |
}, | |
bind: function () { | |
$(document).on('click', '.feed-post-dialog', function(e){ | |
e.preventDefault(); | |
var params = $(this).data(); | |
params.method = 'feed'; | |
FB.ui(params, NERD.FeedPostDialog.callback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The functional pattern, defined in Douglas Crockford's "Javascript: The Good Parts", allows for | |
* JavaScript to achieve both inheritance and information hiding (private variables) with a compact syntax. | |
* The specification that is passed in, as well as potentially more vars you may define in each pseudo-class, are not | |
* accessible from the object that is returned, we consider these private variables. Public vars may | |
* be added to the "that" return object as desired. | |
*/ | |
/** | |
* Person is our base pseudo-class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* We are not assigning a function to myObject, only the result of | |
* invoking a function. While the returned object (which is assigned | |
* to "myObject") contains methods that can access the "value" variable, | |
* the "value" variable cannot be accessed directly through "myObject". | |
* This is how closures achieve information hiding, a.k.a. private variables. | |
* | |
* Information hiding is useful when we want to provide users with an interface, | |
* and prevent users from tampering with the javascript objects in ways that we | |
* do not want them to (hacking with private vars). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// all objects inherit from Object.prototype, | |
// we can add capabilities like so: | |
console.log('adding capabilities to Object.prototype'); | |
if (typeof Object.prototype.totalBills != 'function') { | |
Object.prototype.totalBills = function () { | |
if (this.bills && this.bills.constructor === Array) { | |
var total = 0; | |
for (var i=0; i<this.bills.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Constructor Invocation Pattern | |
* Requires use of the "new" keyword, allows for inheritance, but no information hiding | |
*/ | |
// create a constructor function for the base class | |
var Person = function (spec) { | |
// pseudo-class vars | |
spec.name = spec.name || ''; | |
this.name = spec.name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileOverview Boilerplate Module | |
* @version 2.0 | |
* @depends $ jQuery | |
*/ | |
/** | |
* Module definition, wrapped in a closure, any dependencies are passed in | |
*/ | |
(function ($) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>The JS Debugger</title> | |
</head> | |
<body> | |
<h1>JS Debugger</h1> | |
<p>You must have your browser's web inspector open in order to see debugger breakpoints.</p> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> |
OlderNewer