Skip to content

Commit aa2847f

Browse files
author
ccummings
committed
Fixing ups some spelling
1 parent 0b925fb commit aa2847f

File tree

1 file changed

+40
-43
lines changed

1 file changed

+40
-43
lines changed

index.md

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ var hobbies = new can.Observe.List( ['programming',
115115
'party rocking'] )
116116
{% endhighlight %}
117117

118-
__can.Observe__ is used by both __can.Model__ and __can.route__. However, observe
118+
__can.Observe__ is used by both [can.Model](#can_model) and [can.route](#can_route). However, observe
119119
is useful on its own to maintain client-side state (such as pagination data).
120120

121121
### attr `observe.attr( [name,] [value] )`
@@ -457,7 +457,7 @@ Todo.bind( 'created', function( ev, todo ){
457457

458458
[can.Model.List](http://donejs.com/docs.html#!can.Model.List) is a
459459
[can.Observe.List](#can_observe-can_observe_list) that automatically removes items when they are
460-
destroyed. __Model.Lists__ are return by [findAll](#can_model-findall).
460+
destroyed. __Model.Lists__ are returned by [findAll](#can_model-findall).
461461

462462
{% highlight javascript %}
463463
Todo.findAll( {}, function( todos ) {
@@ -973,10 +973,9 @@ The selector can also be templated.
973973

974974
Control can also bind to objects other than `this.element` with
975975
templated event handlers. This is _critical
976-
for avoiding memory leaks that are common among MVC applications.
976+
for avoiding memory leaks that are common among MVC applications_.
977977

978-
If the value inside `{NAME}` is an object, the event will be bound to that object
979-
that object rather than the control. For example, the following tooltip listens to
978+
If the value inside `{NAME}` is an object, the event will be bound to that object rather than the control. For example, the following tooltip listens to
980979
clicks on the window:
981980

982981
{% highlight javascript %}
@@ -1478,38 +1477,36 @@ jQuery events, so for those cases, a workaround should be applied:
14781477
<script src="jquery.ui.datepicker.js"></script>
14791478
<script src="can.jquery.js"></script>
14801479
<script>
1481-
YUI().use('can', 'calendar', function(Y) {
1482-
// create models
1483-
Todo = can.Model({ ... });
1484-
Todo.List = can.Model.List({ ... });
1485-
1486-
// create control
1487-
Todos = can.Control({
1488-
// listen to the calendar widget's datepickerselect event
1489-
'{calendar} datepickerselect': function(calendar, ev){
1490-
// do something with the selected date
1491-
var selectedDate = this.options.calendar.datepicker('getDate');
1492-
...
1493-
}
1494-
});
1480+
// create models
1481+
Todo = can.Model({ ... });
1482+
Todo.List = can.Model.List({ ... });
14951483

1496-
// Initialize the app
1497-
Todo.findAll({}, function(todos) {
1498-
new Todos('#todoapp', {
1499-
todos: todos,
1500-
calendar: $('#calendar').hide().datepicker({
1501-
// Adding a workaround for date selection since the
1502-
// jQuery UI datepicker widget doesn't fire the
1503-
// "datepickerselect" event
1504-
onSelect: function(dateText, datepicker) {
1505-
$(this).trigger({
1506-
type: 'datepickerselect',
1507-
text: dateText,
1508-
target: datepicker
1509-
});
1510-
}
1511-
})
1512-
});
1484+
// create control
1485+
Todos = can.Control({
1486+
// listen to the calendar widget's datepickerselect event
1487+
'{calendar} datepickerselect': function(calendar, ev){
1488+
// do something with the selected date
1489+
var selectedDate = this.options.calendar.datepicker('getDate');
1490+
...
1491+
}
1492+
});
1493+
1494+
// Initialize the app
1495+
Todo.findAll({}, function(todos) {
1496+
new Todos('#todoapp', {
1497+
todos: todos,
1498+
calendar: $('#calendar').hide().datepicker({
1499+
// Adding a workaround for date selection since the
1500+
// jQuery UI datepicker widget doesn't fire the
1501+
// "datepickerselect" event
1502+
onSelect: function(dateText, datepicker) {
1503+
$(this).trigger({
1504+
type: 'datepickerselect',
1505+
text: dateText,
1506+
target: datepicker
1507+
});
1508+
}
1509+
})
15131510
});
15141511
});
15151512
</script>
@@ -1520,7 +1517,7 @@ jQuery events, so for those cases, a workaround should be applied:
15201517
CanJS supports Dojo 1.7+ using its new AMD loader in asynchronous or synchronous mode.
15211518
CanJS depends on the following Dojo modules: __dojo__, __dojo/query__, __dojo/NodeList-dom__ and __dojo/NodeList-traverse__. It also uses the __plugd/trigger__ plugin for internal object and node event triggering.
15221519

1523-
Include Dojo in your page and add the `'can/dojo'` module as a dependency in your require statement.
1520+
Include a copy of Dojo and add the `'can/dojo'` module as a dependency in your require statement to get started.
15241521

15251522
{% highlight html %}
15261523
<script type='text/javascript' src='path/to/js/dojo.js'></script>
@@ -1538,7 +1535,7 @@ If you are including Dojo from a CDN or you want more control over your file str
15381535

15391536
{% highlight html %}
15401537
<script>
1541-
//Using dojoConfig to load can/dojo from the local directory
1538+
//Using dojoConfig to load can/dojo from a local directory
15421539
var dojoConfig = {
15431540
packages: [{
15441541
name: "can/dojo",
@@ -1565,7 +1562,7 @@ You can also configure package paths using the [require function](http://dojotoo
15651562
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/dojo/
15661563
1.7.1/dojo/dojo.js'></script>
15671564
<script>
1568-
//Using require to load can/dojo from the local directory
1565+
//Using require to load can/dojo from a local directory
15691566
require({
15701567
packages: [{
15711568
name: "can/dojo",
@@ -1581,14 +1578,14 @@ require({
15811578
</script>
15821579
{% endhighlight %}
15831580

1584-
CanJS can bind to any Dijit, Dojox or custom widget events using [templated event binding](#can_control-templated_event_handlers_pt_2). Below is an example of binding to the onchnage event of the dijit.CalendarLite widget:
1581+
CanJS can bind to any Dijit, Dojox or custom widget events using [templated event binding](#can_control-templated_event_handlers_pt_2). Below is an example of binding to the __onChange__ event of the dijit.CalendarLite widget:
15851582

15861583
{% highlight javascript %}
15871584
require(['can/dojo',
15881585
'dijit/CalendarLite'],
15891586
function(can, CalendarLite){
15901587
//Define a Control
1591-
var Todos = can.Control({
1588+
Todo = can.Control({
15921589
//events are lowercase and don't use on (onChange -> change)
15931590
"{calendar} change" : function(calendar, newDate) {
15941591
//onChange handler: do something with the newDate selected
@@ -1724,7 +1721,7 @@ YUI().use('can', 'calendar', function(Y) {
17241721
CanJS supports Zepto 0.8+. Include a copy of Zepto along with CanJS to get started.
17251722

17261723
Zepto 0.8 has an issue where __focus__ and __blur__ events are not fired for delegate event listeners.
1727-
There is a fix included for Zepto > 0.8, but apply
1724+
There is a fix included for Zepto > 0.8, but you can apply
17281725
[this patch](https://github.com/madrobby/zepto/commit/ab2a3ef0d18beaf768903f0943efd019a29803f0)
17291726
to __zepto.js__ when using Zepto 0.8.
17301727

@@ -2089,7 +2086,7 @@ listen and interact with the `video` element.
20892086

20902087
### Srchr
20912088

2092-
Srchr searches several data sources for content and displays it to the user. It is built using the jQuery version of CanJS and is a greate example of how to create dumb, isolated widgets that are loosely coupled to the rest of the application.
2089+
Srchr searches several data sources for content and displays it to the user. It is built using the jQuery version of CanJS and is a great example of how to create dumb, isolated widgets that are loosely coupled to the rest of the application.
20932090

20942091
![CanJS Srchr jQuery App](images/examples/srchr.png "CanJS Srchr jQuery App")
20952092

0 commit comments

Comments
 (0)