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

Commit 20e2245

Browse files
committed
Merge branch 'master' of https://github.com/angular/angular.js into fix_ng-require_invalid_select
2 parents bcce78a + 9190d4c commit 20e2245

File tree

727 files changed

+10216
-277
lines changed

Some content is hidden

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

727 files changed

+10216
-277
lines changed

CHANGELOG.md

+106-22
Large diffs are not rendered by default.

angularFiles.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var angularFiles = {
1414

1515
'src/ng/anchorScroll.js',
1616
'src/ng/animate.js',
17+
'src/ng/animateRunner.js',
1718
'src/ng/animateCss.js',
1819
'src/ng/browser.js',
1920
'src/ng/cacheFactory.js',

docs/content/error/$location/nobase.ngdoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@ngdoc error
22
@name $location:nobase
3-
@fullName $location in HTML5 mode requires a <base> tag to be present!
3+
@fullName $location in HTML5 mode requires a `<base>` tag to be present!
44
@description
55

66
If you configure {@link ng.$location `$location`} to use
@@ -15,7 +15,7 @@ $locationProvider.html5Mode({
1515
});
1616
```
1717

18-
Note that removing the requirement for a <base> tag will have adverse side effects when resolving
18+
Note that removing the requirement for a `<base>` tag will have adverse side effects when resolving
1919
relative paths with `$location` in IE9.
2020

2121
The base URL is then used to resolve all relative URLs throughout the application regardless of the

docs/content/guide/concepts.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ stores/updates the value of the input field into/from a variable.
7676
The second kind of new markup are the double curly braces `{{ expression | filter }}`:
7777
When the compiler encounters this markup, it will replace it with the evaluated value of the markup.
7878
An <a name="expression">{@link expression expression}</a> in a template is a JavaScript-like code snippet that allows
79-
to read and write variables. Note that those variables are not global variables.
79+
Angular to read and write variables. Note that those variables are not global variables.
8080
Just like variables in a JavaScript function live in a scope,
8181
Angular provides a <a name="scope">{@link scope scope}</a> for the variables accessible to expressions.
8282
The values that are stored in variables on the scope are referred to as the <a name="model"></a>*model*

i18n/spec/closureI18nExtractorSpec.js

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ function newTestLocaleInfo() {
1111
DATETIME_FORMATS: {
1212
MONTH: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre',
1313
'octobre', 'novembre', 'décembre'],
14+
STANDALONEMONTH: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre',
15+
'octobre', 'novembre', 'décembre'],
1416
SHORTMONTH: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.',
1517
'nov.', 'déc.'],
1618
DAY: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
@@ -180,6 +182,8 @@ describe("extractDateTimeSymbols", function() {
180182
DATETIME_FORMATS: {
181183
MONTH: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre',
182184
'octobre', 'novembre', 'décembre'],
185+
STANDALONEMONTH: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet',
186+
'août', 'septembre', 'octobre', 'novembre', 'décembre'],
183187
SHORTMONTH: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.',
184188
'nov.', 'déc.'],
185189
DAY: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],

i18n/spec/converterSpec.js

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe("convertNumberData", function() {
2727
describe("convertDatetimeData", function() {
2828
var convert = converter.convertDatetimeData,
2929
dataObj = { MONTHS: ['Enero', 'Pebrero'],
30+
STANDALONEMONTHS: ['Enero', 'Pebrero'],
3031
SHORTMONTHS: ['Ene', 'Peb'],
3132
WEEKDAYS: ['Linggo', 'Lunes'],
3233
SHORTWEEKDAYS: ['Lin', 'Lun'],
@@ -37,6 +38,7 @@ describe("convertDatetimeData", function() {
3738
it('should convert empty datetime obj', function() {
3839
var processedData = convert(dataObj);
3940
expect(processedData.MONTH).toEqual(['Enero', 'Pebrero']);
41+
expect(processedData.STANDALONEMONTH).toEqual(['Enero', 'Pebrero']);
4042
expect(processedData.SHORTMONTH).toEqual(['Ene', 'Peb']);
4143
expect(processedData.DAY).toEqual(['Linggo', 'Lunes']);
4244
expect(processedData.SHORTDAY).toEqual(['Lin', 'Lun']);

i18n/src/converter.js

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function convertDatetimeData(dataObj) {
3939

4040
datetimeFormats.MONTH = dataObj.MONTHS;
4141
datetimeFormats.SHORTMONTH = dataObj.SHORTMONTHS;
42+
datetimeFormats.STANDALONEMONTH = dataObj.STANDALONEMONTHS;
4243
datetimeFormats.DAY = dataObj.WEEKDAYS;
4344
datetimeFormats.SHORTDAY = dataObj.SHORTWEEKDAYS;
4445
datetimeFormats.AMPMS = dataObj.AMPMS;

scripts/bower/publish.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ function init {
1414
TMP_DIR=$(resolveDir ../../tmp)
1515
BUILD_DIR=$(resolveDir ../../build)
1616
NEW_VERSION=$(cat $BUILD_DIR/version.txt)
17+
PROJECT_DIR=$(resolveDir ../..)
1718
# get the npm dist-tag from a custom property (distTag) in package.json
18-
DIST_TAG=$(readJsonProp "package.json" "distTag")
19+
DIST_TAG=$(readJsonProp "$PROJECT_DIR/package.json" "distTag")
1920
}
2021

2122

src/AngularPublic.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
$AnimateProvider,
5858
$CoreAnimateCssProvider,
5959
$$CoreAnimateQueueProvider,
60-
$$CoreAnimateRunnerProvider,
60+
$$AnimateRunnerFactoryProvider,
61+
$$AnimateAsyncRunFactoryProvider,
6162
$BrowserProvider,
6263
$CacheFactoryProvider,
6364
$ControllerProvider,
@@ -218,7 +219,8 @@ function publishExternalAPI(angular) {
218219
$animate: $AnimateProvider,
219220
$animateCss: $CoreAnimateCssProvider,
220221
$$animateQueue: $$CoreAnimateQueueProvider,
221-
$$AnimateRunner: $$CoreAnimateRunnerProvider,
222+
$$AnimateRunner: $$AnimateRunnerFactoryProvider,
223+
$$animateAsyncRun: $$AnimateAsyncRunFactoryProvider,
222224
$browser: $BrowserProvider,
223225
$cacheFactory: $CacheFactoryProvider,
224226
$controller: $ControllerProvider,

src/jqLite.js

+15-8
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,22 @@
3333
*
3434
* If jQuery is available, `angular.element` is an alias for the
3535
* [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`
36-
* delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite."
36+
* delegates to Angular's built-in subset of jQuery, called "jQuery lite" or **jqLite**.
3737
*
38-
* <div class="alert alert-success">jqLite is a tiny, API-compatible subset of jQuery that allows
39-
* Angular to manipulate the DOM in a cross-browser compatible way. **jqLite** implements only the most
40-
* commonly needed functionality with the goal of having a very small footprint.</div>
38+
* jqLite is a tiny, API-compatible subset of jQuery that allows
39+
* Angular to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most
40+
* commonly needed functionality with the goal of having a very small footprint.
4141
*
42-
* To use `jQuery`, simply ensure it is loaded before the `angular.js` file.
42+
* To use `jQuery`, simply ensure it is loaded before the `angular.js` file. You can also use the
43+
* {@link ngJq `ngJq`} directive to specify that jqlite should be used over jQuery, or to use a
44+
* specific version of jQuery if multiple versions exist on the page.
4345
*
44-
* <div class="alert">**Note:** all element references in Angular are always wrapped with jQuery or
45-
* jqLite; they are never raw DOM references.</div>
46+
* <div class="alert alert-info">**Note:** All element references in Angular are always wrapped with jQuery or
47+
* jqLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.</div>
48+
*
49+
* <div class="alert alert-warning">**Note:** Keep in mind that this function will not find elements
50+
* by tag name / CSS selector. For lookups by tag name, try instead `angular.element(document).find(...)`
51+
* or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`.</div>
4652
*
4753
* ## Angular's jqLite
4854
* jqLite provides only the following jQuery methods:
@@ -55,7 +61,8 @@
5561
* - [`children()`](http://api.jquery.com/children/) - Does not support selectors
5662
* - [`clone()`](http://api.jquery.com/clone/)
5763
* - [`contents()`](http://api.jquery.com/contents/)
58-
* - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`. As a setter, does not convert numbers to strings or append 'px'.
64+
* - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`.
65+
* As a setter, does not convert numbers to strings or append 'px', and also does not have automatic property prefixing.
5966
* - [`data()`](http://api.jquery.com/data/)
6067
* - [`detach()`](http://api.jquery.com/detach/)
6168
* - [`empty()`](http://api.jquery.com/empty/)

src/ng/animate.js

+6-24
Original file line numberDiff line numberDiff line change
@@ -53,29 +53,6 @@ function prepareAnimateOptions(options) {
5353
: {};
5454
}
5555

56-
var $$CoreAnimateRunnerProvider = function() {
57-
this.$get = ['$q', '$$rAF', function($q, $$rAF) {
58-
function AnimateRunner() {}
59-
AnimateRunner.all = noop;
60-
AnimateRunner.chain = noop;
61-
AnimateRunner.prototype = {
62-
end: noop,
63-
cancel: noop,
64-
resume: noop,
65-
pause: noop,
66-
complete: noop,
67-
then: function(pass, fail) {
68-
return $q(function(resolve) {
69-
$$rAF(function() {
70-
resolve();
71-
});
72-
}).then(pass, fail);
73-
}
74-
};
75-
return AnimateRunner;
76-
}];
77-
};
78-
7956
// this is prefixed with Core since it conflicts with
8057
// the animateQueueProvider defined in ngAnimate/animateQueue.js
8158
var $$CoreAnimateQueueProvider = function() {
@@ -101,7 +78,12 @@ var $$CoreAnimateQueueProvider = function() {
10178
addRemoveClassesPostDigest(element, options.addClass, options.removeClass);
10279
}
10380

104-
return new $$AnimateRunner(); // jshint ignore:line
81+
var runner = new $$AnimateRunner(); // jshint ignore:line
82+
83+
// since there are no animations to run the runner needs to be
84+
// notified that the animation call is complete.
85+
runner.complete();
86+
return runner;
10587
}
10688
};
10789

src/ng/animateCss.js

+6-34
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,7 @@
1212
* Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}.
1313
*/
1414
var $CoreAnimateCssProvider = function() {
15-
this.$get = ['$$rAF', '$q', function($$rAF, $q) {
16-
17-
var RAFPromise = function() {};
18-
RAFPromise.prototype = {
19-
done: function(cancel) {
20-
this.defer && this.defer[cancel === true ? 'reject' : 'resolve']();
21-
},
22-
end: function() {
23-
this.done();
24-
},
25-
cancel: function() {
26-
this.done(true);
27-
},
28-
getPromise: function() {
29-
if (!this.defer) {
30-
this.defer = $q.defer();
31-
}
32-
return this.defer.promise;
33-
},
34-
then: function(f1,f2) {
35-
return this.getPromise().then(f1,f2);
36-
},
37-
'catch': function(f1) {
38-
return this.getPromise()['catch'](f1);
39-
},
40-
'finally': function(f1) {
41-
return this.getPromise()['finally'](f1);
42-
}
43-
};
44-
15+
this.$get = ['$$rAF', '$q', '$$AnimateRunner', function($$rAF, $q, $$AnimateRunner) {
4516
return function(element, options) {
4617
// there is no point in applying the styles since
4718
// there is no animation that goes on at all in
@@ -55,24 +26,25 @@ var $CoreAnimateCssProvider = function() {
5526
options.from = null;
5627
}
5728

58-
var closed, runner = new RAFPromise();
29+
/* jshint newcap: false */
30+
var closed, runner = new $$AnimateRunner();
5931
return {
6032
start: run,
6133
end: run
6234
};
6335

6436
function run() {
6537
$$rAF(function() {
66-
close();
38+
applyAnimationContents();
6739
if (!closed) {
68-
runner.done();
40+
runner.complete();
6941
}
7042
closed = true;
7143
});
7244
return runner;
7345
}
7446

75-
function close() {
47+
function applyAnimationContents() {
7648
if (options.addClass) {
7749
element.addClass(options.addClass);
7850
options.addClass = null;

0 commit comments

Comments
 (0)