Update of multiple frontend libs.

This commit is contained in:
baldo 2017-05-13 13:25:33 +02:00
commit a9c6ddc03b
276 changed files with 41257 additions and 19300 deletions

View file

@ -1,10 +1,44 @@
/**
* @license AngularJS v1.5.6
* (c) 2010-2016 Google, Inc. http://angularjs.org
* @license AngularJS v1.5.11
* (c) 2010-2017 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular) {'use strict';
/* global shallowCopy: true */
/**
* Creates a shallow copy of an object, an array or a primitive.
*
* Assumes that there are no proto properties for objects.
*/
function shallowCopy(src, dst) {
if (isArray(src)) {
dst = dst || [];
for (var i = 0, ii = src.length; i < ii; i++) {
dst[i] = src[i];
}
} else if (isObject(src)) {
dst = dst || {};
for (var key in src) {
if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {
dst[key] = src[key];
}
}
}
return dst || src;
}
/* global shallowCopy: false */
// There are necessary for `shallowCopy()` (included via `src/shallowCopy.js`).
// They are initialized inside the `$RouteProvider`, to ensure `window.angular` is available.
var isArray;
var isObject;
/**
* @ngdoc module
* @name ngRoute
@ -28,6 +62,7 @@ var ngRouteModule = angular.module('ngRoute', ['ng']).
/**
* @ngdoc provider
* @name $routeProvider
* @this
*
* @description
*
@ -40,6 +75,9 @@ var ngRouteModule = angular.module('ngRoute', ['ng']).
* Requires the {@link ngRoute `ngRoute`} module to be installed.
*/
function $RouteProvider() {
isArray = angular.isArray;
isObject = angular.isObject;
function inherit(parent, extra) {
return angular.extend(Object.create(parent), extra);
}
@ -159,7 +197,7 @@ function $RouteProvider() {
*/
this.when = function(path, route) {
//copy original route object to preserve params inherited from proto chain
var routeCopy = angular.copy(route);
var routeCopy = shallowCopy(route);
if (angular.isUndefined(routeCopy.reloadOnSearch)) {
routeCopy.reloadOnSearch = true;
}
@ -173,7 +211,7 @@ function $RouteProvider() {
// create redirection for trailing slashes
if (path) {
var redirectPath = (path[path.length - 1] == '/')
var redirectPath = (path[path.length - 1] === '/')
? path.substr(0, path.length - 1)
: path + '/';
@ -218,7 +256,7 @@ function $RouteProvider() {
path = path
.replace(/([().])/g, '\\$1')
.replace(/(\/)?:(\w+)(\*\?|[\?\*])?/g, function(_, slash, key, option) {
.replace(/(\/)?:(\w+)(\*\?|[?*])?/g, function(_, slash, key, option) {
var optional = (option === '?' || option === '*?') ? '?' : null;
var star = (option === '*' || option === '*?') ? '*' : null;
keys.push({ name: key, optional: !!optional });
@ -232,7 +270,7 @@ function $RouteProvider() {
+ ')'
+ (optional || '');
})
.replace(/([\/$\*])/g, '\\$1');
.replace(/([/$*])/g, '\\$1');
ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');
return ret;
@ -351,12 +389,12 @@ function $RouteProvider() {
* })
*
* .controller('BookController', function($scope, $routeParams) {
* $scope.name = "BookController";
* $scope.name = 'BookController';
* $scope.params = $routeParams;
* })
*
* .controller('ChapterController', function($scope, $routeParams) {
* $scope.name = "ChapterController";
* $scope.name = 'ChapterController';
* $scope.params = $routeParams;
* })
*
@ -389,15 +427,15 @@ function $RouteProvider() {
* it('should load and compile correct template', function() {
* element(by.linkText('Moby: Ch1')).click();
* var content = element(by.css('[ng-view]')).getText();
* expect(content).toMatch(/controller\: ChapterController/);
* expect(content).toMatch(/Book Id\: Moby/);
* expect(content).toMatch(/Chapter Id\: 1/);
* expect(content).toMatch(/controller: ChapterController/);
* expect(content).toMatch(/Book Id: Moby/);
* expect(content).toMatch(/Chapter Id: 1/);
*
* element(by.partialLinkText('Scarlet')).click();
*
* content = element(by.css('[ng-view]')).getText();
* expect(content).toMatch(/controller\: BookController/);
* expect(content).toMatch(/Book Id\: Scarlet/);
* expect(content).toMatch(/controller: BookController/);
* expect(content).toMatch(/Book Id: Scarlet/);
* });
* </file>
* </example>
@ -607,7 +645,7 @@ function $RouteProvider() {
then(resolveLocals).
then(function(locals) {
// after route change
if (nextRoute == $route.current) {
if (nextRoute === $route.current) {
if (nextRoute) {
nextRoute.locals = locals;
angular.copy(nextRoute.params, $routeParams);
@ -615,7 +653,7 @@ function $RouteProvider() {
$rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute);
}
}, function(error) {
if (nextRoute == $route.current) {
if (nextRoute === $route.current) {
$rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);
}
});
@ -704,6 +742,7 @@ ngRouteModule.provider('$routeParams', $RouteParamsProvider);
* @ngdoc service
* @name $routeParams
* @requires $route
* @this
*
* @description
* The `$routeParams` service allows you to retrieve the current set of route parameters.
@ -880,17 +919,17 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
$locationProvider.html5Mode(true);
}])
.controller('MainCtrl', ['$route', '$routeParams', '$location',
function($route, $routeParams, $location) {
function MainCtrl($route, $routeParams, $location) {
this.$route = $route;
this.$location = $location;
this.$routeParams = $routeParams;
}])
.controller('BookCtrl', ['$routeParams', function($routeParams) {
this.name = "BookCtrl";
.controller('BookCtrl', ['$routeParams', function BookCtrl($routeParams) {
this.name = 'BookCtrl';
this.params = $routeParams;
}])
.controller('ChapterCtrl', ['$routeParams', function($routeParams) {
this.name = "ChapterCtrl";
.controller('ChapterCtrl', ['$routeParams', function ChapterCtrl($routeParams) {
this.name = 'ChapterCtrl';
this.params = $routeParams;
}]);
@ -900,15 +939,15 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
it('should load and compile correct template', function() {
element(by.linkText('Moby: Ch1')).click();
var content = element(by.css('[ng-view]')).getText();
expect(content).toMatch(/controller\: ChapterCtrl/);
expect(content).toMatch(/Book Id\: Moby/);
expect(content).toMatch(/Chapter Id\: 1/);
expect(content).toMatch(/controller: ChapterCtrl/);
expect(content).toMatch(/Book Id: Moby/);
expect(content).toMatch(/Chapter Id: 1/);
element(by.partialLinkText('Scarlet')).click();
content = element(by.css('[ng-view]')).getText();
expect(content).toMatch(/controller\: BookCtrl/);
expect(content).toMatch(/Book Id\: Scarlet/);
expect(content).toMatch(/controller: BookCtrl/);
expect(content).toMatch(/Book Id: Scarlet/);
});
</file>
</example>
@ -951,8 +990,8 @@ function ngViewFactory($route, $anchorScroll, $animate) {
}
if (currentElement) {
previousLeaveAnimation = $animate.leave(currentElement);
previousLeaveAnimation.then(function() {
previousLeaveAnimation = null;
previousLeaveAnimation.done(function(response) {
if (response !== false) previousLeaveAnimation = null;
});
currentElement = null;
}
@ -973,8 +1012,8 @@ function ngViewFactory($route, $anchorScroll, $animate) {
// function is called before linking the content, which would apply child
// directives to non existing elements.
var clone = $transclude(newScope, function(clone) {
$animate.enter(clone, null, currentElement || $element).then(function onNgViewEnter() {
if (angular.isDefined(autoScrollExp)
$animate.enter(clone, null, currentElement || $element).done(function onNgViewEnter(response) {
if (response !== false && angular.isDefined(autoScrollExp)
&& (!autoScrollExp || scope.$eval(autoScrollExp))) {
$anchorScroll();
}