Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9692381

Browse files
committed
chore(ngAnimate): CSS classes X-setup/X-start -> X/X-active
style($compile): clarify argument name Merge branch 'master' into ng-repeat-start Conflicts: test/ng/directive/ngRepeatSpec.js
2 parents 95d8999 + 04d4c73 commit 9692381

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+910
-352
lines changed

docs/content/tutorial/step_05.ngdoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ describe('PhoneCat controllers', function() {
138138
describe('PhoneListCtrl', function(){
139139
var scope, ctrl, $httpBackend;
140140

141+
// The injector ignores leading and trailing underscores here (i.e. _$httpBackend_).
142+
// This allows us to inject a service but then attach it to a variable
143+
// with the same name as the service.
141144
beforeEach(inject(function(_$httpBackend_, $rootScope, $controller) {
142145
$httpBackend = _$httpBackend_;
143146
$httpBackend.expectGET('phones/phones.json').

docs/src/gen-docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ writer.makeDir('build/docs/', true).then(function() {
3232
});
3333
}).then(function printStats() {
3434
console.log('DONE. Generated ' + docs.length + ' pages in ' + (now()-start) + 'ms.' );
35-
});
35+
}).done();
3636

3737

3838
function writeTheRest(writesFuture) {

docs/src/ngdoc.js

Lines changed: 62 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -348,28 +348,59 @@ Doc.prototype = {
348348

349349
},
350350

351+
prepare_type_hint_class_name : function(type) {
352+
var typeClass = type.toLowerCase().match(/^[-\w]+/) || [];
353+
typeClass = typeClass[0] ? typeClass[0] : 'object';
354+
return 'label type-hint type-hint-' + typeClass;
355+
},
356+
351357
html_usage_parameters: function(dom) {
352-
dom.h('Parameters', this.param, function(param){
353-
dom.tag('code', function() {
354-
dom.text(param.name);
355-
if (param.optional) {
356-
dom.tag('i', function() {
357-
dom.text('(optional');
358-
if(param['default']) {
359-
dom.text('=' + param['default']);
360-
}
361-
dom.text(')');
362-
});
358+
var self = this;
359+
var params = this.param ? this.param : [];
360+
if(params.length > 0) {
361+
dom.html('<h2 id="parameters">Parameters</h2>');
362+
dom.html('<table class="variables-matrix table table-bordered table-striped">');
363+
dom.html('<thead>');
364+
dom.html('<tr>');
365+
dom.html('<th>Param</th>');
366+
dom.html('<th>Type</th>');
367+
dom.html('<th>Details</th>');
368+
dom.html('</tr>');
369+
dom.html('</thead>');
370+
dom.html('<tbody>');
371+
for(var i=0;i<params.length;i++) {
372+
param = params[i];
373+
var name = param.name;
374+
var types = param.type;
375+
if(types[0]=='(') {
376+
types = types.substr(1);
363377
}
364-
dom.text(' – {');
365-
dom.text(param.type);
378+
379+
var limit = types.length - 1;
380+
if(types.charAt(limit) == ')' && types.charAt(limit-1) != '(') {
381+
types = types.substr(0,limit);
382+
}
383+
types = types.split(/\|(?![\(\)\w\|\s]+>)/);
384+
var description = param.description;
366385
if (param.optional) {
367-
dom.text('=');
386+
name += ' <div><em>(optional)</em></div>';
368387
}
369-
dom.text('} – ');
370-
});
371-
dom.html(param.description);
372-
});
388+
dom.html('<tr>');
389+
dom.html('<td>' + name + '</td>');
390+
dom.html('<td>');
391+
for(var j=0;j<types.length;j++) {
392+
var type = types[j];
393+
dom.html('<a href="" class="' + self.prepare_type_hint_class_name(type) + '">');
394+
dom.text(type);
395+
dom.html('</a>');
396+
}
397+
dom.html('</td>');
398+
dom.html('<td>' + description + '</td>');
399+
dom.html('</tr>');
400+
};
401+
dom.html('</tbody>');
402+
dom.html('</table>');
403+
}
373404
if(this.animations) {
374405
dom.h('Animations', this.animations, function(animations){
375406
dom.html('<ul>');
@@ -387,11 +418,19 @@ Doc.prototype = {
387418
html_usage_returns: function(dom) {
388419
var self = this;
389420
if (self.returns) {
390-
dom.h('Returns', function() {
391-
dom.tag('code', '{' + self.returns.type + '}');
392-
dom.text('– ');
393-
dom.html(self.returns.description);
394-
});
421+
dom.html('<h2 id="returns">Returns</h2>');
422+
dom.html('<table class="variables-matrix">');
423+
dom.html('<tr>');
424+
dom.html('<td>');
425+
dom.html('<a href="" class="' + self.prepare_type_hint_class_name(self.returns.type) + '">');
426+
dom.text(self.returns.type);
427+
dom.html('</a>');
428+
dom.html('</td>');
429+
dom.html('<td>');
430+
dom.html(self.returns.description);
431+
dom.html('</td>');
432+
dom.html('</tr>');
433+
dom.html('</table>');
395434
}
396435
},
397436

docs/src/templates/css/animations.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
.reveal-setup {
1+
.reveal {
22
-webkit-transition:1s linear all;
33
-moz-transition:1s linear all;
44
-o-transition:1s linear all;
55
transition:1s linear all;
66

77
opacity:0;
88
}
9-
.reveal-setup.reveal-start {
9+
.reveal.reveal-active {
1010
opacity:1;
1111
}
1212

@@ -15,7 +15,7 @@
1515
overflow:hidden;
1616
}
1717

18-
.slide-reveal-setup {
18+
.slide-reveal {
1919
-webkit-transition:0.5s linear all;
2020
-moz-transition:0.5s linear all;
2121
-o-transition:0.5s linear all;
@@ -26,12 +26,12 @@
2626
opacity:0;
2727
top:10px;
2828
}
29-
.slide-reveal-setup.slide-reveal-start {
29+
.slide-reveal.slide-reveal-active {
3030
top:0;
3131
opacity:1;
3232
}
3333

34-
.expand-enter-setup {
34+
.expand-enter {
3535
-webkit-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
3636
-moz-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
3737
-o-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
@@ -41,13 +41,13 @@
4141
line-height:0;
4242
height:0!important;
4343
}
44-
.expand-enter-setup.expand-enter-start {
44+
.expand-enter.expand-enter-active {
4545
opacity:1;
4646
line-height:20px;
4747
height:20px!important;
4848
}
4949

50-
.expand-leave-setup {
50+
.expand-leave {
5151
-webkit-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
5252
-moz-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
5353
-o-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
@@ -56,7 +56,7 @@
5656
opacity:1;
5757
height:20px;
5858
}
59-
.expand-leave-setup.expand-leave-start {
59+
.expand-leave.expand-leave-active {
6060
opacity:0;
6161
height:0;
6262
}

docs/src/templates/css/docs.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,42 @@ ul.events > li > h3 {
202202
.clear {
203203
clear: both;
204204
}
205+
206+
.variables-matrix td {
207+
vertical-align:top;
208+
padding:5px;
209+
}
210+
211+
.type-hint {
212+
display:inline-block;
213+
}
214+
215+
.variables-matrix .type-hint {
216+
text-align:center;
217+
display:block;
218+
min-width:60px;
219+
}
220+
221+
.type-hint + .type-hint {
222+
margin-top:5px;
223+
}
224+
225+
.type-hint-string {
226+
background:#3a87ad;
227+
}
228+
229+
.type-hint-object {
230+
background:#999;
231+
}
232+
233+
.type-hint-array {
234+
background:#F90;;
235+
}
236+
237+
.type-hint-boolean {
238+
background:rgb(18, 131, 39);
239+
}
240+
241+
.type-hint-number {
242+
background:rgb(189, 63, 66);
243+
}

karma-e2e.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var angularFiles = require(__dirname + '/angularFiles.js');
22

3-
files = [ANGULAR_SCENARIO, ANGULAR_SCENARIO_ADAPTER, 'build/docs/docs-scenario.js'];
3+
files = ['build/angular-scenario.js', ANGULAR_SCENARIO_ADAPTER, 'build/docs/docs-scenario.js'];
44

55
autoWatch = false;
66
singleRun = true;

src/Angular.js

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,27 @@ function noConflict() {
8181
return a;
8282
}
8383

84+
/**
85+
* @private
86+
* @param {*} obj
87+
* @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...)
88+
*/
89+
function isArrayLike(obj) {
90+
if (!obj || (typeof obj.length !== 'number')) return false;
91+
92+
// We have on object which has length property. Should we treat it as array?
93+
if (typeof obj.hasOwnProperty != 'function' &&
94+
typeof obj.constructor != 'function') {
95+
// This is here for IE8: it is a bogus object treat it as array;
96+
return true;
97+
} else {
98+
return obj instanceof JQLite || // JQLite
99+
(jQuery && obj instanceof jQuery) || // jQuery
100+
toString.call(obj) !== '[object Object]' || // some browser native object
101+
typeof obj.callee === 'function'; // arguments (on IE8 looks like regular obj)
102+
}
103+
}
104+
84105
/**
85106
* @ngdoc function
86107
* @name angular.forEach
@@ -108,30 +129,6 @@ function noConflict() {
108129
* @param {Object=} context Object to become context (`this`) for the iterator function.
109130
* @returns {Object|Array} Reference to `obj`.
110131
*/
111-
112-
113-
/**
114-
* @private
115-
* @param {*} obj
116-
* @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...)
117-
*/
118-
function isArrayLike(obj) {
119-
if (!obj || (typeof obj.length !== 'number')) return false;
120-
121-
// We have on object which has length property. Should we treat it as array?
122-
if (typeof obj.hasOwnProperty != 'function' &&
123-
typeof obj.constructor != 'function') {
124-
// This is here for IE8: it is a bogus object treat it as array;
125-
return true;
126-
} else {
127-
return obj instanceof JQLite || // JQLite
128-
(jQuery && obj instanceof jQuery) || // jQuery
129-
toString.call(obj) !== '[object Object]' || // some browser native object
130-
typeof obj.callee === 'function'; // arguments (on IE8 looks like regular obj)
131-
}
132-
}
133-
134-
135132
function forEach(obj, iterator, context) {
136133
var key;
137134
if (obj) {
@@ -215,6 +212,21 @@ function nextUid() {
215212
return uid.join('');
216213
}
217214

215+
216+
/**
217+
* Set or clear the hashkey for an object.
218+
* @param obj object
219+
* @param h the hashkey (!truthy to delete the hashkey)
220+
*/
221+
function setHashKey(obj, h) {
222+
if (h) {
223+
obj.$$hashKey = h;
224+
}
225+
else {
226+
delete obj.$$hashKey;
227+
}
228+
}
229+
218230
/**
219231
* @ngdoc function
220232
* @name angular.extend
@@ -228,13 +240,16 @@ function nextUid() {
228240
* @param {...Object} src Source object(s).
229241
*/
230242
function extend(dst) {
243+
var h = dst.$$hashKey;
231244
forEach(arguments, function(obj){
232245
if (obj !== dst) {
233246
forEach(obj, function(value, key){
234247
dst[key] = value;
235248
});
236249
}
237250
});
251+
252+
setHashKey(dst,h);
238253
return dst;
239254
}
240255

@@ -594,12 +609,14 @@ function copy(source, destination){
594609
destination.push(copy(source[i]));
595610
}
596611
} else {
612+
var h = destination.$$hashKey;
597613
forEach(destination, function(value, key){
598614
delete destination[key];
599615
});
600616
for ( var key in source) {
601617
destination[key] = copy(source[key]);
602618
}
619+
setHashKey(destination,h);
603620
}
604621
}
605622
return destination;

src/angular-bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,6 @@
222222
function isActuallyNaN(val) {
223223
return (typeof val === 'number') && isNaN(val);
224224
}
225-
};
225+
}
226226
})(window, document);
227227

src/auto/injector.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@ function annotate(fn) {
151151
* @returns {*} the value returned by the invoked `fn` function.
152152
*/
153153

154+
/**
155+
* @ngdoc method
156+
* @name AUTO.$injector#has
157+
* @methodOf AUTO.$injector
158+
*
159+
* @description
160+
* Allows the user to query if the particular service exist.
161+
*
162+
* @param {string} Name of the service to query.
163+
* @returns {boolean} returns true if injector has given service.
164+
*/
165+
154166
/**
155167
* @ngdoc method
156168
* @name AUTO.$injector#instantiate

src/jqLite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ function createEventHandler(element, events) {
560560
}
561561

562562
event.isDefaultPrevented = function() {
563-
return event.defaultPrevented;
563+
return event.defaultPrevented || event.returnValue == false;
564564
};
565565

566566
forEach(events[type || event.type], function(fn) {

src/ng/animation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ function $AnimationProvider($provide) {
5656
return $injector.get(animationName);
5757
}
5858
}
59-
}
59+
};
6060
}];
61-
};
61+
}

0 commit comments

Comments
 (0)