Skip to content

Commit

Permalink
added code comment to design patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
chuanxshi committed Jan 29, 2012
1 parent f367724 commit 98045e1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions design-patterns/builder.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
});
}

var el = document.querySelector("#test");
el.addEventListener("click", getBeerByIdBridge, false);
var el = document.querySelector('#test');
el.addEventListener('click', getBeerByIdBridge, false);

function getBeerByIdBridge (e) {
getBeerById(this.id, function(beer) {
Expand Down
4 changes: 2 additions & 2 deletions design-patterns/command.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
return CarManager[commad.request](commad.model,commad.carID);
};

var actionA = CarManager.execute({request: "requestInfo", model: 'Ford Mondeo', carID: '543434'});
var actionA = CarManager.execute({request: 'requestInfo', model: 'Ford Mondeo', carID: '543434'});
console.log(actionA);
var actionB = CarManager.execute({request: "buyVehicle", model: 'Ford Mondeo', carID: '543434'});
var actionB = CarManager.execute({request: 'buyVehicle', model: 'Ford Mondeo', carID: '543434'});
console.log(actionB);

})();
Expand Down
8 changes: 4 additions & 4 deletions design-patterns/factory.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@
}

var o = jsp.dom.factory('Link');
o.url = 'http://google.com'
o.url = 'http://google.com';
o.insert(document.body);

var taskManager = {};

taskManager.update = function() {
console.log("update");
console.log('update');
}

taskManager.read = function() {
console.log("read");
console.log('read');
}

var type = "update";
var type = 'update';
var task;

if (type === 'update') {
Expand Down
2 changes: 1 addition & 1 deletion design-patterns/proxy.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h1>Dave Matthews vids</h1>
}
},
flush: function () {
http.makeRequest(this.ids, "proxy.handler");
http.makeRequest(this.ids, 'proxy.handler');
// clear timeout and queue
this.timeout = null;
this.ids = [];
Expand Down
2 changes: 1 addition & 1 deletion design-patterns/singleton.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
function Universe() {

// do we have an existing instance?
if (typeof Universe.instance === "object") {
if (typeof Universe.instance === 'object') {
return Universe.instance;
}

Expand Down

0 comments on commit 98045e1

Please sign in to comment.