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

Commit 3141607

Browse files
committed
[WIP] followup (grunt docs works)
1 parent b0c4a5f commit 3141607

Some content is hidden

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

63 files changed

+245
-204
lines changed

changelog.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var parseRawCommit = function(raw) {
4848

4949

5050
msg.body = lines.join('\n');
51-
match = msg.subject.match(/^(.*)\((.*)\)\:\s(.*)$/);
51+
match = msg.subject.match(/^(.*)\((.*)\):\s(.*)$/);
5252

5353
if (!match || !match[1] || !match[3]) {
5454
warn('Incorrect message: %s %s', msg.hash, msg.subject);

compare-master-to-stable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ then(function(tags) {
106106
var major = tags[0].split('.')[0];
107107
return tags.
108108
filter(function(ver) {
109-
return semver(ver).major == major;
109+
return semver(ver).major === major;
110110
});
111111
}).
112112
then(function(tags) {

docs/app/src/.eslintrc.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": false
5+
},
6+
7+
"globals": {
8+
// AngularJS
9+
"angular": false,
10+
11+
// ngMocks
12+
"module": false,
13+
"inject": true
14+
}
15+
}

docs/app/src/search.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
angular.module('search', [])
24

35
.controller('DocsSearchCtrl', ['$scope', '$location', 'docsSearch', function($scope, $location, docsSearch) {
@@ -23,14 +25,15 @@ angular.module('search', [])
2325
angular.forEach(hits, function(hit) {
2426
var area = hit.area;
2527

26-
var limit = (area == 'api') ? 40 : 14;
28+
var limit = (area === 'api') ? 40 : 14;
2729
results[area] = results[area] || [];
2830
if (results[area].length < limit) {
2931
results[area].push(hit);
3032
}
3133
});
3234

3335
var totalAreas = 0;
36+
// eslint-disable-next-line no-unused-vars
3437
for (var i in results) {
3538
++totalAreas;
3639
}
@@ -206,15 +209,15 @@ angular.module('search', [])
206209
FORWARD_SLASH_KEYCODE = 191;
207210
angular.element($document[0].body).on('keydown', function(event) {
208211
var input = element[0];
209-
if (event.keyCode == FORWARD_SLASH_KEYCODE && document.activeElement != input) {
212+
if (event.keyCode === FORWARD_SLASH_KEYCODE && document.activeElement !== input) {
210213
event.stopPropagation();
211214
event.preventDefault();
212215
input.focus();
213216
}
214217
});
215218

216219
element.on('keydown', function(event) {
217-
if (event.keyCode == ESCAPE_KEY_KEYCODE) {
220+
if (event.keyCode === ESCAPE_KEY_KEYCODE) {
218221
event.stopPropagation();
219222
event.preventDefault();
220223
scope.$apply(function() {

docs/app/test/.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"env": {
33
"browser": true,
4+
"node": false,
45
"jasmine": true
56
},
67

docs/content/error/$rootScope/inprog.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ value of its attribute becomes true.
222222
angular.module('app', []).directive('setFocusIf', function() {
223223
return function link($scope, $element, $attr) {
224224
$scope.$watch($attr.setFocusIf, function(value) {
225-
if ( value ) { $element[0].focus(); }
225+
if (value) { $element[0].focus(); }
226226
});
227227
};
228228
});

docs/content/guide/$location.ngdoc

+31-31
Original file line numberDiff line numberDiff line change
@@ -227,18 +227,18 @@ it('should show example', inject(
227227
},
228228
function($location) {
229229
// open http://example.com/base/index.html#!/a
230-
$location.absUrl() == 'http://example.com/base/index.html#!/a'
231-
$location.path() == '/a'
230+
$location.absUrl() === 'http://example.com/base/index.html#!/a'
231+
$location.path() === '/a'
232232

233233
$location.path('/foo')
234-
$location.absUrl() == 'http://example.com/base/index.html#!/foo'
234+
$location.absUrl() === 'http://example.com/base/index.html#!/foo'
235235

236-
$location.search() == {}
236+
$location.search() === {}
237237
$location.search({a: 'b', c: true});
238-
$location.absUrl() == 'http://example.com/base/index.html#!/foo?a=b&c'
238+
$location.absUrl() === 'http://example.com/base/index.html#!/foo?a=b&c'
239239

240240
$location.path('/new').search('x=y');
241-
$location.absUrl() == 'http://example.com/base/index.html#!/new?x=y'
241+
$location.absUrl() === 'http://example.com/base/index.html#!/new?x=y'
242242
}
243243
));
244244
```
@@ -271,29 +271,29 @@ it('should show example', inject(
271271
// in browser with HTML5 history support:
272272
// open http://example.com/#!/a -> rewrite to http://example.com/a
273273
// (replacing the http://example.com/#!/a history record)
274-
$location.path() == '/a'
274+
$location.path() === '/a'
275275

276276
$location.path('/foo');
277-
$location.absUrl() == 'http://example.com/foo'
277+
$location.absUrl() === 'http://example.com/foo'
278278

279-
$location.search() == {}
279+
$location.search() === {}
280280
$location.search({a: 'b', c: true});
281-
$location.absUrl() == 'http://example.com/foo?a=b&c'
281+
$location.absUrl() === 'http://example.com/foo?a=b&c'
282282

283283
$location.path('/new').search('x=y');
284-
$location.url() == 'new?x=y'
285-
$location.absUrl() == 'http://example.com/new?x=y'
284+
$location.url() === 'new?x=y'
285+
$location.absUrl() === 'http://example.com/new?x=y'
286286

287287
// in browser without html5 history support:
288288
// open http://example.com/new?x=y -> redirect to http://example.com/#!/new?x=y
289289
// (again replacing the http://example.com/new?x=y history item)
290-
$location.path() == '/new'
291-
$location.search() == {x: 'y'}
290+
$location.path() === '/new'
291+
$location.search() === {x: 'y'}
292292

293293
$location.path('/foo/bar');
294-
$location.path() == '/foo/bar'
295-
$location.url() == '/foo/bar?x=y'
296-
$location.absUrl() == 'http://example.com/#!/foo/bar?x=y'
294+
$location.path() === '/foo/bar'
295+
$location.url() === '/foo/bar?x=y'
296+
$location.absUrl() === 'http://example.com/#!/foo/bar?x=y'
297297
}
298298
));
299299
```
@@ -411,9 +411,9 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
411411

412412
.controller("LocationController", function($scope, $location) {
413413
$scope.$location = {};
414-
angular.forEach("protocol host port path search hash".split(" "), function(method){
415-
$scope.$location[method] = function(){
416-
var result = $location[method].call($location);
414+
angular.forEach("protocol host port path search hash".split(" "), function(method) {
415+
$scope.$location[method] = function() {
416+
var result = $location[method]($location);
417417
return angular.isObject(result) ? angular.toJson(result) : result;
418418
};
419419
});
@@ -460,7 +460,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
460460
.directive('ngAddressBar', function($browser, $timeout) {
461461
return {
462462
template: 'Address: <input id="addressBar" type="text" style="width: 400px" >',
463-
link: function(scope, element, attrs){
463+
link: function(scope, element, attrs) {
464464
var input = element.children("input"), delay;
465465

466466
input.on('keypress keyup keydown', function(event) {
@@ -488,7 +488,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
488488
url = 'http://www.example.com/base/path?a=b#h';
489489

490490

491-
it("should show fake browser info on load", function(){
491+
it("should show fake browser info on load", function() {
492492
expect(addressBar.getAttribute('value')).toBe(url);
493493

494494
expect(element(by.binding('$location.protocol()')).getText()).toBe('http');
@@ -500,7 +500,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
500500

501501
});
502502

503-
it("should change $location accordingly", function(){
503+
it("should change $location accordingly", function() {
504504
var navigation = element.all(by.css("#navigation a"));
505505

506506
navigation.get(0).click();
@@ -565,9 +565,9 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
565565

566566
.controller("LocationController", function($scope, $location) {
567567
$scope.$location = {};
568-
angular.forEach("protocol host port path search hash".split(" "), function(method){
569-
$scope.$location[method] = function(){
570-
var result = $location[method].call($location);
568+
angular.forEach("protocol host port path search hash".split(" "), function(method) {
569+
$scope.$location[method] = function() {
570+
var result = $location[method]($location);
571571
return angular.isObject(result) ? angular.toJson(result) : result;
572572
};
573573
});
@@ -614,7 +614,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
614614
.directive('ngAddressBar', function($browser, $timeout) {
615615
return {
616616
template: 'Address: <input id="addressBar" type="text" style="width: 400px" >',
617-
link: function(scope, element, attrs){
617+
link: function(scope, element, attrs) {
618618
var input = element.children("input"), delay;
619619

620620
input.on('keypress keyup keydown', function(event) {
@@ -641,7 +641,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
641641
var addressBar = element(by.css("#addressBar")),
642642
url = 'http://www.example.com/base/index.html#!/path?a=b#h';
643643

644-
it("should show fake browser info on load", function(){
644+
it("should show fake browser info on load", function() {
645645
expect(addressBar.getAttribute('value')).toBe(url);
646646

647647
expect(element(by.binding('$location.protocol()')).getText()).toBe('http');
@@ -653,7 +653,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
653653

654654
});
655655

656-
it("should change $location accordingly", function(){
656+
it("should change $location accordingly", function() {
657657
var navigation = element.all(by.css("#navigation a"));
658658

659659
navigation.get(0).click();
@@ -735,7 +735,7 @@ ng.$rootScope.Scope scope} life-cycle. This means it's your responsibility to ca
735735
```js
736736
describe('serviceUnderTest', function() {
737737
beforeEach(module(function($provide) {
738-
$provide.factory('serviceUnderTest', function($location){
738+
$provide.factory('serviceUnderTest', function($location) {
739739
// whatever it does...
740740
});
741741
});
@@ -843,7 +843,7 @@ to bind it to `ngModel`:
843843
<file name="script.js">
844844
angular.module('locationExample', [])
845845
.controller('LocationController', ['$scope', '$location', function($scope, $location) {
846-
$scope.locationPath = function (newLocation) {
846+
$scope.locationPath = function(newLocation) {
847847
return $location.path(newLocation);
848848
};
849849
}]);

docs/content/guide/accessibility.ngdoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,20 @@ attributes (if they have not been explicitly specified by the developer):
7474
</form>
7575
</file>
7676
<file name="script.js">
77-
var app = angular.module('ngAria_ngModelExample', ['ngAria'])
78-
.controller('formsController', function($scope){
77+
angular.module('ngAria_ngModelExample', ['ngAria'])
78+
.controller('formsController', function($scope) {
7979
$scope.checked = false;
80-
$scope.toggleCheckbox = function(){
80+
$scope.toggleCheckbox = function() {
8181
$scope.checked = !$scope.checked;
8282
};
8383
})
84-
.directive('someCheckbox', function(){
84+
.directive('someCheckbox', function() {
8585
return {
8686
restrict: 'E',
8787
link: function($scope, $el, $attrs) {
88-
$el.on('keypress', function(event){
88+
$el.on('keypress', function(event) {
8989
event.preventDefault();
90-
if(event.keyCode === 32 || event.keyCode === 13){
90+
if (event.keyCode === 32 || event.keyCode === 13) {
9191
$scope.toggleCheckbox();
9292
$scope.$apply();
9393
}

docs/content/guide/component-router.ngdoc

+9-9
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ You can see the complete application running below.
230230

231231
this.getHero = function(id) {
232232
return heroesPromise.then(function(heroes) {
233-
for(var i=0; i<heroes.length; i++) {
234-
if ( heroes[i].id == id) return heroes[i];
233+
for (var i = 0; i < heroes.length; i++) {
234+
if (heroes[i].id === id) return heroes[i];
235235
}
236236
});
237237
};
@@ -250,7 +250,7 @@ You can see the complete application running below.
250250
};
251251

252252
this.isSelected = function(hero) {
253-
return (hero.id == selectedId);
253+
return (hero.id === selectedId);
254254
};
255255
}
256256

@@ -321,8 +321,8 @@ You can see the complete application running below.
321321

322322
this.getCrisis = function(id) {
323323
return crisesPromise.then(function(crises) {
324-
for(var i=0; i<crises.length; i++) {
325-
if ( crises[i].id == id) return crises[i];
324+
for (var i = 0; i < crises.length; i++) {
325+
if (crises[i].id === id) return crises[i];
326326
}
327327
});
328328
};
@@ -342,7 +342,7 @@ You can see the complete application running below.
342342
};
343343

344344
this.isSelected = function(crisis) {
345-
return (crisis.id == selectedId);
345+
return (crisis.id === selectedId);
346346
};
347347

348348
this.onSelect = function(crisis) {
@@ -725,8 +725,8 @@ function HeroService($q) {
725725

726726
this.getHero = function(id) {
727727
return heroesPromise.then(function(heroes) {
728-
for(var i=0; i<heroes.length; i++) {
729-
if ( heroes[i].id == id) return heroes[i];
728+
for (var i = 0; i < heroes.length; i++) {
729+
if (heroes[i].id === id) return heroes[i];
730730
}
731731
});
732732
};
@@ -924,7 +924,7 @@ function HeroListComponent(heroService) {
924924
};
925925

926926
this.isSelected = function(hero) {
927-
return (hero.id == selectedId);
927+
return (hero.id === selectedId);
928928
};
929929
}
930930
```

docs/content/guide/component.ngdoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Components can be registered using the `.component()` method of an Angular modul
3333

3434
<example name="heroComponentSimple" module="heroApp">
3535
<file name="index.js">
36-
angular.module('heroApp', []).controller('mainCtrl', function() {
36+
angular.module('heroApp', []).controller('MainCtrl', function MainCtrl() {
3737
this.hero = {
3838
name: 'Spawn'
3939
};
@@ -55,7 +55,7 @@ Components can be registered using the `.component()` method of an Angular modul
5555
</file>
5656
<file name="index.html">
5757
<!-- components match only elements -->
58-
<div ng-controller="mainCtrl as ctrl">
58+
<div ng-controller="MainCtrl as ctrl">
5959
<b>Hero</b><br>
6060
<hero-detail hero="ctrl.hero"></hero-detail>
6161
</div>
@@ -200,7 +200,7 @@ it upwards to the heroList component, which updates the original data.
200200

201201
<example name="heroComponentTree" module="heroApp">
202202
<file name="index.js">
203-
var mode = angular.module('heroApp', []);
203+
angular.module('heroApp', []);
204204
</file>
205205

206206
<file name="heroList.js">
@@ -388,7 +388,7 @@ Here is a tab pane example built from components:
388388
angular.module('docsTabsExample', [])
389389
.component('myTabs', {
390390
transclude: true,
391-
controller: function() {
391+
controller: function Controller() {
392392
var panes = this.panes = [];
393393
this.select = function(pane) {
394394
angular.forEach(panes, function(pane) {

0 commit comments

Comments
 (0)