Skip to content

Commit 5845a1c

Browse files
committed
Merge pull request emberjs#3305 from stefanpenner/improve_docs
improve docs (formatting mostly)
2 parents 32d39ec + ced169c commit 5845a1c

File tree

16 files changed

+95
-67
lines changed

16 files changed

+95
-67
lines changed

docs/yuidoc.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
"../packages/ember-routing/lib",
1515
"../packages/ember-application/lib",
1616
"../packages/ember-testing/lib",
17-
"../packages/ember-handlebars-compiler/lib"
17+
"../packages/ember-handlebars-compiler/lib",
18+
"../packages/container/lib",
19+
"../packages/rsvp/lib",
20+
"../packages/metamorph/lib",
21+
"../packages/loader/lib"
1822
],
1923
"exclude": "vendor",
2024
"outdir": "./build"

packages/container/lib/main.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
/**
2+
@module container
3+
*/
4+
5+
/*
26
Flag to enable/disable model factory injections (disabled by default)
37
If model factory injections are enabled, models should not be
48
accessed globally (only through `container.lookupFactory('model:modelName'))`);
@@ -86,7 +90,7 @@ define("container",
8690
8791
@method has
8892
@param {String} key
89-
@returns {Boolean}
93+
@return {Boolean}
9094
*/
9195
has: function(key) {
9296
var dict = this.dict;
@@ -213,7 +217,7 @@ define("container",
213217
to correctly inherit from the current container.
214218
215219
@method child
216-
@returns {Container}
220+
@return {Container}
217221
*/
218222
child: function() {
219223
var container = new Container(this);
@@ -327,7 +331,7 @@ define("container",
327331
328332
@method resolve
329333
@param {String} fullName
330-
@returns {Function} fullName's factory
334+
@return {Function} fullName's factory
331335
*/
332336
resolve: function(fullName) {
333337
return this.resolver(fullName) || this.registry.get(fullName);
@@ -497,7 +501,7 @@ define("container",
497501
this.optionsForType(type, options);
498502
},
499503

500-
/*
504+
/**
501505
@private
502506
503507
Used only via `injection`.
@@ -539,16 +543,16 @@ define("container",
539543
addTypeInjection(this.typeInjections, type, property, fullName);
540544
},
541545

542-
/*
546+
/**
543547
Defines injection rules.
544548
545549
These rules are used to inject dependencies onto objects when they
546550
are instantiated.
547551
548552
Two forms of injections are possible:
549553
550-
* Injecting one fullName on another fullName
551-
* Injecting one fullName on a type
554+
* Injecting one fullName on another fullName
555+
* Injecting one fullName on a type
552556
553557
Example:
554558
@@ -594,7 +598,7 @@ define("container",
594598
},
595599

596600

597-
/*
601+
/**
598602
@private
599603
600604
Used only via `factoryInjection`.
@@ -631,7 +635,7 @@ define("container",
631635
addTypeInjection(this.factoryTypeInjections, type, property, fullName);
632636
},
633637

634-
/*
638+
/**
635639
Defines factory injection rules.
636640
637641
Similar to regular injection rules, but are run against factories, via
@@ -642,8 +646,8 @@ define("container",
642646
643647
Two forms of injections are possible:
644648
645-
* Injecting one fullName on another fullName
646-
* Injecting one fullName on a type
649+
* Injecting one fullName on another fullName
650+
* Injecting one fullName on a type
647651
648652
Example:
649653

packages/ember-application/lib/system/application.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,8 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
610610
/**
611611
@private
612612
613-
If the application has a router, use it to route to the current URL, and
614613
trigger a new call to `route` whenever the URL changes.
614+
If the application has a router, use it to route to the current URL, and
615615
616616
@method startRouting
617617
@property router {Ember.Router}
@@ -638,10 +638,10 @@ var Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin
638638
ready: Ember.K,
639639

640640
/**
641-
642641
@deprecated Use 'Resolver' instead
643642
Set this to provide an alternate class to `Ember.DefaultResolver`
644643
644+
645645
@property resolver
646646
*/
647647
resolver: null,

packages/ember-application/lib/system/resolver.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ var get = Ember.get,
1313
container lookups before consulting the container for registered
1414
items:
1515
16-
* templates are looked up on `Ember.TEMPLATES`
17-
* other names are looked up on the application after converting
18-
the name. For example, `controller:post` looks up
19-
`App.PostController` by default.
20-
* there are some nuances (see examples below)
16+
* templates are looked up on `Ember.TEMPLATES`
17+
* other names are looked up on the application after converting
18+
the name. For example, `controller:post` looks up
19+
`App.PostController` by default.
20+
* there are some nuances (see examples below)
2121
2222
### How Resolving Works
2323

packages/ember-handlebars-compiler/lib/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ if (Handlebars.JavaScriptCompiler) {
155155

156156
Ember.Handlebars.JavaScriptCompiler.prototype.namespace = "Ember.Handlebars";
157157

158-
159158
Ember.Handlebars.JavaScriptCompiler.prototype.initializeBuffer = function() {
160159
return "''";
161160
};
@@ -259,7 +258,7 @@ if (Handlebars.compile) {
259258

260259
var template = Ember.Handlebars.template(templateSpec);
261260
template.isMethod = false; //Make sure we don't wrap templates with ._super
262-
261+
263262
return template;
264263
};
265264
}

packages/ember-handlebars/lib/controls.js

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require("ember-handlebars/controls/select");
66

77
/**
88
@module ember
9-
@submodule ember-handlebars
9+
@submodule ember-handlebars-compiler
1010
*/
1111

1212
function normalizeHash(hash, hashTypes) {
@@ -29,30 +29,32 @@ function normalizeHash(hash, hashTypes) {
2929
An `{{input}}` with no `type` or a `type` of `text` will render an HTML text input.
3030
The following HTML attributes can be set via the helper:
3131
32-
* `value`
33-
* `size`
34-
* `name`
35-
* `pattern`
36-
* `placeholder`
37-
* `disabled`
38-
* `maxlength`
39-
* `tabindex`
32+
* `value`
33+
* `size`
34+
* `name`
35+
* `pattern`
36+
* `placeholder`
37+
* `disabled`
38+
* `maxlength`
39+
* `tabindex`
40+
4041
4142
When set to a quoted string, these values will be directly applied to the HTML
4243
element. When left unquoted, these values will be bound to a property on the
4344
template's current rendering context (most typically a controller instance).
4445
45-
Unbound:
46+
## Unbound:
4647
4748
```handlebars
4849
{{input value="http://www.facebook.com"}}
4950
```
5051
52+
5153
```html
5254
<input type="text" value="http://www.facebook.com"/>
5355
```
5456
55-
Bound:
57+
## Bound:
5658
5759
```javascript
5860
App.ApplicationController = Ember.Controller.extend({
@@ -61,15 +63,18 @@ function normalizeHash(hash, hashTypes) {
6163
});
6264
```
6365
66+
6467
```handlebars
6568
{{input type="text" value=firstName disabled=entryNotAllowed size="50"}}
6669
```
6770
71+
6872
```html
6973
<input type="text" value="Stanley" disabled="disabled" size="50"/>
7074
```
7175
72-
### Extension
76+
## Extension
77+
7378
Internally, `{{input type="text"}}` creates an instance of `Ember.TextField`, passing
7479
arguments from the helper to `Ember.TextField`'s `create` method. You can extend the
7580
capablilties of text inputs in your applications by reopening this class. For example,
@@ -83,20 +88,21 @@ function normalizeHash(hash, hashTypes) {
8388
```
8489
8590
## Use as checkbox
91+
8692
An `{{input}}` with a `type` of `checkbox` will render an HTML checkbox input.
8793
The following HTML attributes can be set via the helper:
8894
89-
* `checked`
90-
* `disabled`
91-
* `tabindex`
92-
* `indeterminate`
93-
* `name`
95+
* `checked`
96+
* `disabled`
97+
* `tabindex`
98+
* `indeterminate`
99+
* `name`
94100
95101
When set to a quoted string, these values will be directly applied to the HTML
96102
element. When left unquoted, these values will be bound to a property on the
97103
template's current rendering context (most typically a controller instance).
98104
99-
Unbound:
105+
## Unbound:
100106
101107
```handlebars
102108
{{input type="checkbox" name="isAdmin"}}
@@ -106,23 +112,26 @@ function normalizeHash(hash, hashTypes) {
106112
<input type="checkbox" name="isAdmin" />
107113
```
108114
109-
Bound:
115+
## Bound:
110116
111117
```javascript
112118
App.ApplicationController = Ember.Controller.extend({
113119
isAdmin: true
114120
});
115121
```
116122
123+
117124
```handlebars
118125
{{input type="checkbox" checked=isAdmin }}
119126
```
120127
128+
121129
```html
122130
<input type="checkbox" checked="checked" />
123131
```
124132
125-
### Extension
133+
## Extension
134+
126135
Internally, `{{input type="checkbox"}}` creates an instance of `Ember.Checkbox`, passing
127136
arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the
128137
capablilties of checkbox inputs in your applications by reopening this class. For example,
@@ -280,7 +289,7 @@ Ember.Handlebars.registerHelper('input', function(options) {
280289
</textarea>
281290
```
282291
283-
### Extension
292+
## Extension
284293
285294
Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing
286295
arguments from the helper to `Ember.TextArea`'s `create` method. You can

packages/ember-handlebars/lib/controls/select.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Ember.SelectOptgroup = Ember.CollectionView.extend({
8585
`content` property. The underlying data object of the selected `<option>` is
8686
stored in the `Element.Select`'s `value` property.
8787
88-
### `content` as an array of Strings
88+
## The Content Property (array of strings)
8989
9090
The simplest version of an `Ember.Select` takes an array of strings as its
9191
`content` property. The string will be used as both the `value` property and
@@ -141,7 +141,7 @@ Ember.SelectOptgroup = Ember.CollectionView.extend({
141141
A user interacting with the rendered `<select>` to choose "Yehuda" would
142142
update the value of `selectedName` to "Yehuda".
143143
144-
### `content` as an Array of Objects
144+
## The Content Property (array of Objects)
145145
146146
An `Ember.Select` can also take an array of JavaScript or Ember objects as
147147
its `content` property.
@@ -255,7 +255,7 @@ Ember.SelectOptgroup = Ember.CollectionView.extend({
255255
the newly selected `<option>`. In this case it is the first object
256256
in the `programmers`
257257
258-
### Supplying a Prompt
258+
## Supplying a Prompt
259259
260260
A `null` value for the `Ember.Select`'s `value` or `selection` property
261261
results in there being no `<option>` with a `selected` attribute:

packages/ember-routing/lib/helpers/link_to.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
204204
205205
This method is invoked by observers installed during `init` that fire
206206
whenever the helpers
207+
@method _paramsChanged
207208
*/
208209
_paramsChanged: function() {
209210
this.notifyPropertyChange('resolvedParams');

packages/ember-routing/lib/system/route.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ Ember.Route = Ember.Object.extend(Ember.ActionHandler, {
257257
@deprecated
258258
259259
Please use `actions` instead.
260+
@method events
260261
*/
261262
events: null,
262263

packages/ember-runtime/lib/computed/array_computed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ ArrayComputedProperty.prototype.resetValue = function (array) {
153153
@for Ember
154154
@param {String} [dependentKeys*]
155155
@param {Object} options
156-
@returns {Ember.ComputedProperty}
156+
@return {Ember.ComputedProperty}
157157
*/
158158
Ember.arrayComputed = function (options) {
159159
var args;

0 commit comments

Comments
 (0)