Skip to content

Commit

Permalink
Renaming and general tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfranklin committed Jul 31, 2013
1 parent 886e5bc commit 6671417
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions app/app.js
Expand Up @@ -5,7 +5,7 @@

Modules: {},

Utilities: {},
Helpers: {},

Events: $({}),

Expand All @@ -14,7 +14,7 @@
// here we are looping round all of the modules in our app.Modules object. We could have an exclude array for modules
// that we don't want to be immediately initialised. We could initialise them later on in our application lifecycle

for( var x in App.Modules ) {
for(var x in App.Modules) {
App.Modules[x].init();
}

Expand All @@ -23,7 +23,7 @@
// takes data as it's second parameter which is accessible in the 'params' object in the receiving function, i.e. look at the
// 'render' function within the 'jesse' module

App.Events.trigger( 'render' );
App.Events.trigger('render');
}
};

Expand Down
6 changes: 0 additions & 6 deletions app/helper.js

This file was deleted.

4 changes: 4 additions & 0 deletions app/helpers.js
@@ -0,0 +1,4 @@
App.Helpers.toCanonicalMonth = function(month) {
return month < 10 ? "0" + month : month;
}

6 changes: 3 additions & 3 deletions app/modules/introduction.js
Expand Up @@ -12,7 +12,7 @@ App.Modules.introduction = {
// this underscore.js function allows us to use the keyword 'this' inside the 'render' function and for 'this' to have
// the context of our 'introduction' module and not whatever called the 'render' function

_.bindAll( this, 'render' );
_.bindAll(this, 'render');
this.cacheEls();
this.bindEvents();

Expand All @@ -21,7 +21,7 @@ App.Modules.introduction = {
// bindEvents is where you set up your event listeners and even DOM events, ie. this.$button.click(this.buttonClicked)

bindEvents: function () {
App.Events.on( 'render', this.render );
App.Events.on('render', this.render);
},

// this is where you can cache your templates and your DOM elements, ie. this.$button = $(this.el).find('#myButton'), so
Expand All @@ -43,7 +43,7 @@ App.Modules.introduction = {

$(this.el).html(this.template({
day: date.getDate(),
month: App.Utilities.Helpers.toCanonicalMonth( month ),
month: App.Helpers.toCanonicalMonth(month),
year: date.getFullYear()
}));

Expand Down
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -48,7 +48,7 @@ <h3>Features</h3>
<script src="app/vendor/handlebars.js"></script>
<script src="app/vendor/underscore.min.js"></script>
<script src="app/app.js"></script>
<script src="app/helper.js"></script>
<script src="app/helpers.js"></script>
<script src="app/modules/introduction.js"></script>
<script src="app/main.js"></script>
<!-- analytics - replace 'XXXX' with your analytics ID-->
Expand Down

0 comments on commit 6671417

Please sign in to comment.