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

Commit 9ab91b0

Browse files
committed
feature(logProvider): added log enablers for every log type
2 parents c7e82bf + adb5c6d commit 9ab91b0

File tree

109 files changed

+3526
-1418
lines changed

Some content is hidden

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

109 files changed

+3526
-1418
lines changed

Diff for: .travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ env:
1111
- JOB=unit
1212
- JOB=e2e TEST_TARGET=jqlite
1313
- JOB=e2e TEST_TARGET=jquery
14-
- JOB=e2e TEST_TARGET=doce2e
1514
global:
1615
- SAUCE_USERNAME=angular-ci
1716
- SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987

Diff for: CHANGELOG.md

+371
Large diffs are not rendered by default.

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ it makes development fun!
1515
* Tutorial: http://docs.angularjs.org/tutorial
1616
* API Docs: http://docs.angularjs.org/api
1717
* Developer Guide: http://docs.angularjs.org/guide
18-
* Contribution guidelines: http://docs.angularjs.org/misc/contribute
18+
* Contribution guidelines: [CONTRIBUTING.md](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md)
1919
* Dashboard: http://dashboard.angularjs.org
2020

2121
Building AngularJS
@@ -37,7 +37,7 @@ To execute end-to-end (e2e) tests, use:
3737
grunt test:e2e
3838

3939
To learn more about the grunt tasks, run `grunt --help` and also read our
40-
[contribution guidelines](http://docs.angularjs.org/misc/contribute).
40+
[contribution guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md).
4141

4242

4343
[![Analytics](https://ga-beacon.appspot.com/UA-8594346-11/angular.js/README.md?pixel)](https://github.com/igrigorik/ga-beacon)

Diff for: angularFiles.js

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ var angularFiles = {
3434
'src/ng/sanitizeUri.js',
3535
'src/ng/sce.js',
3636
'src/ng/sniffer.js',
37+
'src/ng/templateRequest.js',
38+
'src/ng/testability.js',
3739
'src/ng/timeout.js',
3840
'src/ng/urlUtils.js',
3941
'src/ng/window.js',

Diff for: benchmarks/largetable-bp/app.js

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
var app = angular.module('largetableBenchmark', []);
22

3+
app.config(function($compileProvider) {
4+
if ($compileProvider.debugInfoEnabled) {
5+
$compileProvider.debugInfoEnabled(false);
6+
}
7+
});
8+
39
app.filter('noop', function() {
410
return function(input) {
511
return input;

Diff for: benchmarks/orderby-bp/app.js

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
var app = angular.module('orderByBenchmark', []);
2+
3+
app.controller('DataController', function($rootScope, $scope) {
4+
this.ngRepeatCount = 5000;
5+
this.rows = [];
6+
var self = this;
7+
8+
$scope.benchmarkType = 'basic';
9+
10+
$scope.rawProperty = function(key) {
11+
return function(item) {
12+
return item[key];
13+
};
14+
};
15+
16+
// Returns a random integer between min (included) and max (excluded)
17+
function getRandomInt(min, max) {
18+
return Math.floor(Math.random() * (max - min)) + min;
19+
}
20+
21+
benchmarkSteps.push({
22+
name: 'setup',
23+
description: 'Set rows to empty array and apply, then push new rows to be applied in next step',
24+
fn: function() {
25+
var oldRows = self.rows;
26+
$rootScope.$apply(function() {
27+
self.rows = [];
28+
});
29+
self.rows = oldRows;
30+
if (self.rows.length !== self.ngRepeatCount) {
31+
self.rows = [];
32+
for (var i = 0; i < self.ngRepeatCount; i++) {
33+
self.rows.push({
34+
'name': getRandomInt(i, (i + 40)),
35+
'index': i
36+
});
37+
}
38+
}
39+
}
40+
})
41+
42+
benchmarkSteps.push({
43+
name: '$apply',
44+
fn: function() {
45+
$rootScope.$apply();
46+
}
47+
});
48+
});

Diff for: benchmarks/orderby-bp/bp.conf.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = function(config) {
2+
config.set({
3+
scripts: [
4+
{
5+
"id": "jquery",
6+
"src": "jquery-noop.js"
7+
},{
8+
id: 'angular',
9+
src: '/build/angular.js'
10+
},{
11+
src: 'app.js',
12+
}]
13+
});
14+
};

Diff for: benchmarks/orderby-bp/main.html

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<div class="container-fluid" ng-app="orderByBenchmark">
2+
<div class="row" ng-controller="DataController as ctrl">
3+
<div class="col-lg-8">
4+
<p>Filters</p>
5+
6+
<p>
7+
<label>Number of ngRepeats:</label>
8+
<input type="number" ng-model="ctrl.ngRepeatCount">
9+
</p>
10+
11+
<p>
12+
<div class="radio">
13+
<label>
14+
<input type="radio" ng-model="benchmarkType" value="baseline">baseline
15+
</label>
16+
</div>
17+
<pre><code>ng-repeat="row in ctrl.rows"</code></pre>
18+
<br />
19+
<div class="radio">
20+
<label>
21+
<input type="radio" ng-model="benchmarkType" value="orderBy">orderBy
22+
</label>
23+
</div>
24+
<pre><code>ng-repeat="row in ctrl.rows | orderBy:'name'"</code></pre>
25+
<br />
26+
<div class="radio">
27+
<label>
28+
<input type="radio" ng-model="benchmarkType" value="orderByArray">orderBy array expression
29+
</label>
30+
</div>
31+
<pre><code>ng-repeat="row in ctrl.rows | orderBy:['name', 'index']"</code></pre>
32+
<br />
33+
<div class="radio">
34+
<label>
35+
<input type="radio" ng-model="benchmarkType"
36+
value="orderByFunction">orderBy function expression
37+
</label>
38+
</div>
39+
<pre><code>ng-repeat="row in ctrl.rows | orderBy:rawProperty('name')"</code></pre>
40+
<br />
41+
<div class="radio">
42+
<label>
43+
<input type="radio" ng-model="benchmarkType"
44+
value="orderByArrayFunction">orderBy array function expression
45+
</label>
46+
</div>
47+
<pre><code>ng-repeat="row in ctrl.rows | orderBy:[rawProperty('name'), rawProperty('index')]"</code></pre>
48+
</p>
49+
50+
51+
Debug output:
52+
<ng-switch on="benchmarkType">
53+
<div ng-switch-when="baseline">
54+
<span ng-repeat="row in ctrl.rows">
55+
<span ng-bind="row.name"></span>,
56+
</span>
57+
</div>
58+
<div ng-switch-when="orderBy">
59+
<span ng-repeat="row in ctrl.rows | orderBy:'name'">
60+
<span ng-bind="row.name"></span>,
61+
</span>
62+
</div>
63+
<div ng-switch-when="orderByArray">
64+
<span ng-repeat="row in ctrl.rows | orderBy:['name', 'index']">
65+
<span ng-bind="row.name"></span>,
66+
</span>
67+
</div>
68+
<div ng-switch-when="orderByFunction">
69+
<span ng-repeat="row in ctrl.rows | orderBy:rawProperty('name')">
70+
<span ng-bind="row.name"></span>,
71+
</span>
72+
</div>
73+
<div ng-switch-when="orderByArrayFunction">
74+
<span ng-repeat="row in ctrl.rows | orderBy:[rawProperty('name'), rawProperty('index')]">
75+
<span ng-bind="row.name"></span>,
76+
</span>
77+
</div>
78+
</ng-switch>
79+
80+
</div>
81+
</div>
82+
</div>

Diff for: bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"lunr.js": "0.4.3",
66
"open-sans-fontface": "1.0.4",
77
"google-code-prettify": "1.0.1",
8-
"closure-compiler": "https://closure-compiler.googlecode.com/files/compiler-20130603.zip",
8+
"closure-compiler": "https://dl.google.com/closure-compiler/compiler-20140814.zip",
99
"ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.3/assets/ng-closure-runner.zip",
1010
"bootstrap": "3.1.1"
1111
}

Diff for: compare-master-to-stable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ then(allInSeries(function (branch) {
145145
line = line.split(' ');
146146
var sha = line.shift();
147147
var msg = line.join(' ');
148-
return sha + (msg.toLowerCase().indexOf('fix') === -1 ? ' ' : ' * ') + msg;
148+
return sha + ((/fix\([^\)]+\):/i.test(msg)) ? ' * ' : ' ') + msg;
149149
});
150150
branch.log = log.map(function (line) {
151151
return line.substr(41);

Diff for: docs/app/assets/css/docs.css

+6-4
Original file line numberDiff line numberDiff line change
@@ -635,12 +635,14 @@ ul.events > li {
635635
display:inline-block;
636636
padding:3px 0;
637637
}
638-
.nav-index-group .nav-index-listing:not(.nav-index-section) + .nav-index-listing:not(.nav-index-section):after {
639-
padding-right:5px;
640-
content:", ";
638+
.nav-index-group .nav-index-listing:not(.nav-index-section):after {
639+
padding-right:5px;
640+
margin-left:-3px;
641+
content:", ";
641642
}
642-
.nav-index-group .nav-index-listing:last-child {
643+
.nav-index-group .nav-index-listing:last-child:after {
643644
content:"";
645+
display:inline-block;
644646
}
645647
.nav-index-group .nav-index-section {
646648
display:block;

Diff for: docs/app/e2e/docsAppE2E.js

+29
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
'use strict';
22

3+
var webdriver = require('protractor/node_modules/selenium-webdriver');
4+
35
describe('docs.angularjs.org', function () {
6+
7+
beforeEach(function() {
8+
// read and clear logs from previous tests
9+
browser.manage().logs().get('browser');
10+
});
11+
12+
13+
afterEach(function() {
14+
// verify that there were no console errors in the browser
15+
browser.manage().logs().get('browser').then(function(browserLog) {
16+
var filteredLog = browserLog.filter(function(logEntry) {
17+
return logEntry.level.value > webdriver.logging.Level.WARNING.value;
18+
});
19+
expect(filteredLog.length).toEqual(0);
20+
if (filteredLog.length) {
21+
console.log('browser console errors: ' + require('util').inspect(filteredLog));
22+
}
23+
});
24+
});
25+
26+
427
describe('App', function () {
528
// it('should filter the module list when searching', function () {
629
// browser.get();
@@ -67,6 +90,12 @@ describe('docs.angularjs.org', function () {
6790
browser.get('index-debug.html#!error/ng/areq?p0=Missing&p1=not%20a%20function,%20got%20undefined');
6891
expect(element(by.css('.minerr-errmsg')).getText()).toEqual("Argument 'Missing' is not a function, got undefined");
6992
});
93+
94+
95+
it("should display links to code on GitHub", function() {
96+
browser.get('index-debug.html#!/api/does/not/exist');
97+
expect(element(by.css('h1')).getText()).toBe('Oops!');
98+
});
7099
});
71100

72101
describe("templates", function() {

Diff for: docs/app/src/docs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ angular.module('DocsController', [])
3333

3434
$scope.navClass = function(navItem) {
3535
return {
36-
active: navItem.href && this.currentPage.path,
36+
active: navItem.href && this.currentPage && this.currentPage.path,
3737
'nav-index-section': navItem.type === 'section'
3838
};
3939
};

Diff for: docs/app/src/search.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ angular.module('search', [])
7474
var index = lunrSearch(function() {
7575
this.ref('id');
7676
this.field('title', {boost: 50});
77+
this.field('members', { boost: 40});
7778
this.field('keywords', { boost : 20 });
7879
});
7980

@@ -82,7 +83,8 @@ angular.module('search', [])
8283
index.store({
8384
id : key,
8485
title : page.searchTerms.titleWords,
85-
keywords : page.searchTerms.keywords
86+
keywords : page.searchTerms.keywords,
87+
members : page.searchTerms.members
8688
});
8789
};
8890
});

Diff for: docs/config/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ module.exports = function(config) {
2222
]);
2323

2424
config.append('processing.tagDefinitions', [
25-
require('./tag-defs/tutorial-step')
25+
require('./tag-defs/tutorial-step'),
26+
require('./tag-defs/sortOrder')
2627
]);
2728

2829
config.append('processing.defaultTagTransforms', [

Diff for: docs/config/processors/keywords.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
"use strict";
12
var _ = require('lodash');
23
var log = require('winston');
34
var fs = require('fs');
45
var path = require('canonical-path');
56

67
module.exports = {
78
name: 'keywords',
8-
runAfter: ['docs-processed'],
9+
runAfter: ['docs-processed', 'api-docs'],
910
runBefore: ['adding-extra-docs'],
1011
description: 'This processor extracts all the keywords from the document',
1112
process: function(docs, config) {
@@ -52,7 +53,7 @@ module.exports = {
5253
_.forEach(tokens, function(token){
5354
var match = token.match(KEYWORD_REGEX);
5455
if (match){
55-
key = match[1];
56+
var key = match[1];
5657
if ( !keywordMap[key]) {
5758
keywordMap[key] = true;
5859
words.push(key);
@@ -69,17 +70,28 @@ module.exports = {
6970

7071
var words = [];
7172
var keywordMap = _.clone(ignoreWordsMap);
73+
var members = [];
74+
var membersMap = {};
7275

7376
// Search each top level property of the document for search terms
7477
_.forEach(doc, function(value, key) {
78+
7579
if ( _.isString(value) && !propertiesToIgnore[key] ) {
7680
extractWords(value, words, keywordMap);
7781
}
82+
83+
if ( key === 'methods' || key === 'properties' || key === 'events' ) {
84+
_.forEach(value, function(member) {
85+
extractWords(member.name, members, membersMap);
86+
});
87+
}
7888
});
7989

90+
8091
doc.searchTerms = {
8192
titleWords: extractTitleWords(doc.name),
82-
keywords: _.sortBy(words).join(' ')
93+
keywords: _.sortBy(words).join(' '),
94+
members: _.sortBy(members).join(' ')
8395
};
8496

8597
});

Diff for: docs/config/processors/pages-data.js

+14-7
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,20 @@ var navGroupMappers = {
119119
})];
120120
},
121121
pages: function(pages, area) {
122-
return [getNavGroup(pages, area, 'path', function(page) {
123-
return {
124-
name: page.name,
125-
href: page.path,
126-
type: 'page'
127-
};
128-
})];
122+
return [getNavGroup(
123+
pages,
124+
area,
125+
function(page) {
126+
return page.sortOrder || page.path;
127+
},
128+
function(page) {
129+
return {
130+
name: page.name,
131+
href: page.path,
132+
type: 'page'
133+
};
134+
}
135+
)];
129136
}
130137
};
131138

Diff for: docs/config/tag-defs/sortOrder.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
name: 'sortOrder',
3+
transforms: function(doc, tag, value) {
4+
return parseInt(value, 10);
5+
}
6+
};

0 commit comments

Comments
 (0)