Permalink
Browse files

fixed some redundancies in JS file

  • Loading branch information...
impressivewebs committed Jan 6, 2013
1 parent c90f611 commit 9047d2f6ec25f860976b028d7b4f789c16bd6864
Binary file not shown.
View
@@ -1,55 +1,53 @@
-/*globals $ */
-
-// The script below does essentially nothing other than define some nearly empty methods and a few settings for demonstration purposes
-// You can delete this whole thing, or do whatever you want with it
-
-// variable for caching settings
-var s = null,
-
- PrimaryNameSpace = {
- // define your oft-used settings below
- settings: {
- basicExample: $('.main'),
- nestedExample: {
- first: true,
- second: true,
- third: true,
- fourth: true,
- fifth: ['one', 'two', 'three', 'four', 'five', 'six']
- },
-
- foo: 'bar'
- },
-
- // the method that initializes stuff
- init: function () {
- /* the line below can be included in each method to reference the settings
- without always having to type "this.settings" each time */
- s = this.settings;
- // using firebug you can view all settings with "console.log(s)";
-
- // after you do stuff here, you can call the next method
- // You can use "this" in the current context to reference "PrimaryNameSpace" directly
- this.nextMethod();
-
- },
-
- nextMethod: function () {
- s = this.settings;
- // do stuff here
- },
-
- anotherMethod: function () {
- s = this.settings;
- // do more stuff here
- }
-
- // remember not to use a trailing comma after the last method is defined; you could leave a dummy method here to prevent that error
- };
-
-// The section below initializes the whole thing; you could pass in some JSON data or some other object that needs to be worked with, and call individual methods.
-
-$(function () {
- PrimaryNameSpace.init();
- PrimaryNameSpace.anotherMethod();
+/*globals $ */
+
+// The script below does essentially nothing other than define some nearly empty methods and a few settings for demonstration purposes
+// You can delete this whole thing, or do whatever you want with it
+
+// variable for caching settings
+var s = null,
+
+ PrimaryNameSpace = {
+ // define your oft-used settings below
+ settings: {
+ basicExample: $('.main'),
+ nestedExample: {
+ first: true,
+ second: true,
+ third: true,
+ fourth: true,
+ fifth: ['one', 'two', 'three', 'four', 'five', 'six']
+ },
+
+ foo: 'bar'
+ },
+
+ // the method that initializes stuff
+ init: function () {
+ /* the line below is included to reference the settings
+ without always having to type "this.settings" each time */
+ s = this.settings;
+ // using firebug you can view all settings with "console.log(s)";
+
+ // after you do stuff here, you can call the next method
+ // You can use "this" in the current context to reference "PrimaryNameSpace" directly
+ this.nextMethod();
+
+ },
+
+ nextMethod: function () {
+ // do stuff here
+ },
+
+ anotherMethod: function () {
+ // do more stuff here
+ }
+
+ // remember not to use a trailing comma after the last method is defined; you could leave a dummy method here to prevent that error
+ };
+
+// The section below initializes the whole thing; you could pass in some JSON data or some other object that needs to be worked with, and call individual methods.
+
+$(function () {
+ PrimaryNameSpace.init();
+ PrimaryNameSpace.anotherMethod();
});
@@ -1,37 +1,35 @@
-/*globals $ */
-
-var s = null,
-
- PrimaryNameSpace = {
- settings : {
- basicExample: $('.main'),
- nestedExample : {
- first: true,
- second: true,
- third: true,
- fourth: true,
- fifth : ['one', 'two', 'three', 'four', 'five', 'six']
- },
-
- foo: 'bar'
- },
-
- init: function () {
- s = this.settings;
- this.nextMethod();
- },
-
- nextMethod: function () {
- s = this.settings;
- },
-
- anotherMethod: function () {
- s = this.settings;
- }
-
- };
-
-$(function () {
- PrimaryNameSpace.init();
- PrimaryNameSpace.anotherMethod();
+/*globals $ */
+
+var s = null,
+
+ PrimaryNameSpace = {
+ settings : {
+ basicExample: $('.main'),
+ nestedExample : {
+ first: true,
+ second: true,
+ third: true,
+ fourth: true,
+ fifth : ['one', 'two', 'three', 'four', 'five', 'six']
+ },
+
+ foo: 'bar'
+ },
+
+ init: function () {
+ s = this.settings;
+ this.nextMethod();
+ },
+
+ nextMethod: function () {
+ },
+
+ anotherMethod: function () {
+ }
+
+ };
+
+$(function () {
+ PrimaryNameSpace.init();
+ PrimaryNameSpace.anotherMethod();
});

0 comments on commit 9047d2f

Please sign in to comment.