Update bower dependencies.

This commit is contained in:
baldo 2019-03-29 22:00:08 +01:00
commit 2beab45f32
185 changed files with 21559 additions and 8189 deletions

View file

@ -11,7 +11,7 @@
"license": "MIT", "license": "MIT",
"ignore": [], "ignore": [],
"description": "Native AngularJS (Angular) directives for Bootstrap.", "description": "Native AngularJS (Angular) directives for Bootstrap.",
"version": "1.3.3", "version": "2.5.0",
"main": [ "main": [
"./ui-bootstrap-tpls.js" "./ui-bootstrap-tpls.js"
], ],
@ -19,13 +19,13 @@
"angular": ">=1.4.0" "angular": ">=1.4.0"
}, },
"homepage": "https://github.com/angular-ui/bootstrap-bower", "homepage": "https://github.com/angular-ui/bootstrap-bower",
"_release": "1.3.3", "_release": "2.5.0",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.3.3", "tag": "2.5.0",
"commit": "d45246707f5bf9533e3824861a29abd36757db45" "commit": "2ab82fe5b072269e897d5d11333e9925888df456"
}, },
"_source": "https://github.com/angular-ui/bootstrap-bower.git", "_source": "https://github.com/angular-ui/bootstrap-bower.git",
"_target": "1.3.3", "_target": "2.5.0",
"_originalSource": "angular-bootstrap" "_originalSource": "angular-bootstrap"
} }

View file

@ -11,7 +11,7 @@
"license": "MIT", "license": "MIT",
"ignore": [], "ignore": [],
"description": "Native AngularJS (Angular) directives for Bootstrap.", "description": "Native AngularJS (Angular) directives for Bootstrap.",
"version": "1.3.3", "version": "2.5.0",
"main": ["./ui-bootstrap-tpls.js"], "main": ["./ui-bootstrap-tpls.js"],
"dependencies": { "dependencies": {
"angular": ">=1.4.0" "angular": ">=1.4.0"

View file

@ -1,6 +1,6 @@
{ {
"name": "angular-ui-bootstrap", "name": "angular-ui-bootstrap",
"version": "1.3.3", "version": "2.5.0",
"description": "Bootstrap widgets for Angular", "description": "Bootstrap widgets for Angular",
"main": "index.js", "main": "index.js",
"homepage": "http://angular-ui.github.io/bootstrap/", "homepage": "http://angular-ui.github.io/bootstrap/",

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -1,20 +1,20 @@
{ {
"name": "angular-route", "name": "angular-route",
"version": "1.5.11", "version": "1.7.8",
"license": "MIT", "license": "MIT",
"main": "./angular-route.js", "main": "./angular-route.js",
"ignore": [], "ignore": [],
"dependencies": { "dependencies": {
"angular": "1.5.11" "angular": "1.7.8"
}, },
"homepage": "https://github.com/angular/bower-angular-route", "homepage": "https://github.com/angular/bower-angular-route",
"_release": "1.5.11", "_release": "1.7.8",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.5.11", "tag": "v1.7.8",
"commit": "cdb9db456ece8b3f80a638bb7bd69dc2dcd4eee9" "commit": "3d3b033f45993827dc587474a18649092391d251"
}, },
"_source": "https://github.com/angular/bower-angular-route.git", "_source": "https://github.com/angular/bower-angular-route.git",
"_target": "1.5.11", "_target": "1.7.8",
"_originalSource": "angular-route" "_originalSource": "angular-route"
} }

View file

@ -1,6 +1,6 @@
/** /**
* @license AngularJS v1.5.11 * @license AngularJS v1.7.8
* (c) 2010-2017 Google, Inc. http://angularjs.org * (c) 2010-2018 Google, Inc. http://angularjs.org
* License: MIT * License: MIT
*/ */
(function(window, angular) {'use strict'; (function(window, angular) {'use strict';
@ -32,32 +32,84 @@ function shallowCopy(src, dst) {
return dst || src; return dst || src;
} }
/* global routeToRegExp: true */
/**
* @param {string} path - The path to parse. (It is assumed to have query and hash stripped off.)
* @param {Object} opts - Options.
* @return {Object} - An object containing an array of path parameter names (`keys`) and a regular
* expression (`regexp`) that can be used to identify a matching URL and extract the path
* parameter values.
*
* @description
* Parses the given path, extracting path parameter names and a regular expression to match URLs.
*
* Originally inspired by `pathRexp` in `visionmedia/express/lib/utils.js`.
*/
function routeToRegExp(path, opts) {
var keys = [];
var pattern = path
.replace(/([().])/g, '\\$1')
.replace(/(\/)?:(\w+)(\*\?|[?*])?/g, function(_, slash, key, option) {
var optional = option === '?' || option === '*?';
var star = option === '*' || option === '*?';
keys.push({name: key, optional: optional});
slash = slash || '';
return (
(optional ? '(?:' + slash : slash + '(?:') +
(star ? '(.+?)' : '([^/]+)') +
(optional ? '?)?' : ')')
);
})
.replace(/([/$*])/g, '\\$1');
if (opts.ignoreTrailingSlashes) {
pattern = pattern.replace(/\/+$/, '') + '/*';
}
return {
keys: keys,
regexp: new RegExp(
'^' + pattern + '(?:[?#]|$)',
opts.caseInsensitiveMatch ? 'i' : ''
)
};
}
/* global routeToRegExp: false */
/* global shallowCopy: false */ /* global shallowCopy: false */
// There are necessary for `shallowCopy()` (included via `src/shallowCopy.js`). // `isArray` and `isObject` are necessary for `shallowCopy()` (included via `src/shallowCopy.js`).
// They are initialized inside the `$RouteProvider`, to ensure `window.angular` is available. // They are initialized inside the `$RouteProvider`, to ensure `window.angular` is available.
var isArray; var isArray;
var isObject; var isObject;
var isDefined;
var noop;
/** /**
* @ngdoc module * @ngdoc module
* @name ngRoute * @name ngRoute
* @description * @description
* *
* # ngRoute * The `ngRoute` module provides routing and deeplinking services and directives for AngularJS apps.
*
* The `ngRoute` module provides routing and deeplinking services and directives for angular apps.
* *
* ## Example * ## Example
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`. * See {@link ngRoute.$route#examples $route} for an example of configuring and using `ngRoute`.
* *
*
* <div doc-module-components="ngRoute"></div>
*/ */
/* global -ngRouteModule */ /* global -ngRouteModule */
var ngRouteModule = angular.module('ngRoute', ['ng']). var ngRouteModule = angular.
provider('$route', $RouteProvider), module('ngRoute', []).
$routeMinErr = angular.$$minErr('ngRoute'); info({ angularVersion: '1.7.8' }).
provider('$route', $RouteProvider).
// Ensure `$route` will be instantiated in time to capture the initial `$locationChangeSuccess`
// event (unless explicitly disabled). This is necessary in case `ngView` is included in an
// asynchronously loaded template.
run(instantiateRoute);
var $routeMinErr = angular.$$minErr('ngRoute');
var isEagerInstantiationEnabled;
/** /**
* @ngdoc provider * @ngdoc provider
@ -69,7 +121,7 @@ var ngRouteModule = angular.module('ngRoute', ['ng']).
* Used for configuring routes. * Used for configuring routes.
* *
* ## Example * ## Example
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`. * See {@link ngRoute.$route#examples $route} for an example of configuring and using `ngRoute`.
* *
* ## Dependencies * ## Dependencies
* Requires the {@link ngRoute `ngRoute`} module to be installed. * Requires the {@link ngRoute `ngRoute`} module to be installed.
@ -77,6 +129,8 @@ var ngRouteModule = angular.module('ngRoute', ['ng']).
function $RouteProvider() { function $RouteProvider() {
isArray = angular.isArray; isArray = angular.isArray;
isObject = angular.isObject; isObject = angular.isObject;
isDefined = angular.isDefined;
noop = angular.noop;
function inherit(parent, extra) { function inherit(parent, extra) {
return angular.extend(Object.create(parent), extra); return angular.extend(Object.create(parent), extra);
@ -113,12 +167,12 @@ function $RouteProvider() {
* *
* Object properties: * Object properties:
* *
* - `controller` – `{(string|function()=}` – Controller fn that should be associated with * - `controller` – `{(string|Function)=}` – Controller fn that should be associated with
* newly created scope or the name of a {@link angular.Module#controller registered * newly created scope or the name of a {@link angular.Module#controller registered
* controller} if passed as a string. * controller} if passed as a string.
* - `controllerAs` – `{string=}` – An identifier name for a reference to the controller. * - `controllerAs` – `{string=}` – An identifier name for a reference to the controller.
* If present, the controller will be published to scope under the `controllerAs` name. * If present, the controller will be published to scope under the `controllerAs` name.
* - `template` – `{string=|function()=}` – html template as a string or a function that * - `template` – `{(string|Function)=}` – html template as a string or a function that
* returns an html template as a string which should be used by {@link * returns an html template as a string which should be used by {@link
* ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives. * ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.
* This property takes precedence over `templateUrl`. * This property takes precedence over `templateUrl`.
@ -128,7 +182,9 @@ function $RouteProvider() {
* - `{Array.<Object>}` - route parameters extracted from the current * - `{Array.<Object>}` - route parameters extracted from the current
* `$location.path()` by applying the current route * `$location.path()` by applying the current route
* *
* - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html * One of `template` or `templateUrl` is required.
*
* - `templateUrl` – `{(string|Function)=}` – path or function that returns a path to an html
* template that should be used by {@link ngRoute.directive:ngView ngView}. * template that should be used by {@link ngRoute.directive:ngView ngView}.
* *
* If `templateUrl` is a function, it will be called with the following parameters: * If `templateUrl` is a function, it will be called with the following parameters:
@ -136,7 +192,9 @@ function $RouteProvider() {
* - `{Array.<Object>}` - route parameters extracted from the current * - `{Array.<Object>}` - route parameters extracted from the current
* `$location.path()` by applying the current route * `$location.path()` by applying the current route
* *
* - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should * One of `templateUrl` or `template` is required.
*
* - `resolve` - `{Object.<string, Function>=}` - An optional map of dependencies which should
* be injected into the controller. If any of these dependencies are promises, the router * be injected into the controller. If any of these dependencies are promises, the router
* will wait for them all to be resolved or one to be rejected before the controller is * will wait for them all to be resolved or one to be rejected before the controller is
* instantiated. * instantiated.
@ -156,7 +214,7 @@ function $RouteProvider() {
* The map object is: * The map object is:
* *
* - `key` – `{string}`: a name of a dependency to be injected into the controller. * - `key` – `{string}`: a name of a dependency to be injected into the controller.
* - `factory` - `{string|function}`: If `string` then it is an alias for a service. * - `factory` - `{string|Function}`: If `string` then it is an alias for a service.
* Otherwise if function, then it is {@link auto.$injector#invoke injected} * Otherwise if function, then it is {@link auto.$injector#invoke injected}
* and the return value is treated as the dependency. If the result is a promise, it is * and the return value is treated as the dependency. If the result is a promise, it is
* resolved before its value is injected into the controller. Be aware that * resolved before its value is injected into the controller. Be aware that
@ -166,7 +224,7 @@ function $RouteProvider() {
* - `resolveAs` - `{string=}` - The name under which the `resolve` map will be available on * - `resolveAs` - `{string=}` - The name under which the `resolve` map will be available on
* the scope of the route. If omitted, defaults to `$resolve`. * the scope of the route. If omitted, defaults to `$resolve`.
* *
* - `redirectTo` – `{(string|function())=}` – value to update * - `redirectTo` – `{(string|Function)=}` – value to update
* {@link ng.$location $location} path with and trigger route redirection. * {@link ng.$location $location} path with and trigger route redirection.
* *
* If `redirectTo` is a function, it will be called with the following parameters: * If `redirectTo` is a function, it will be called with the following parameters:
@ -177,13 +235,48 @@ function $RouteProvider() {
* - `{Object}` - current `$location.search()` * - `{Object}` - current `$location.search()`
* *
* The custom `redirectTo` function is expected to return a string which will be used * The custom `redirectTo` function is expected to return a string which will be used
* to update `$location.path()` and `$location.search()`. * to update `$location.url()`. If the function throws an error, no further processing will
* take place and the {@link ngRoute.$route#$routeChangeError $routeChangeError} event will
* be fired.
*
* Routes that specify `redirectTo` will not have their controllers, template functions
* or resolves called, the `$location` will be changed to the redirect url and route
* processing will stop. The exception to this is if the `redirectTo` is a function that
* returns `undefined`. In this case the route transition occurs as though there was no
* redirection.
*
* - `resolveRedirectTo` – `{Function=}` – a function that will (eventually) return the value
* to update {@link ng.$location $location} URL with and trigger route redirection. In
* contrast to `redirectTo`, dependencies can be injected into `resolveRedirectTo` and the
* return value can be either a string or a promise that will be resolved to a string.
*
* Similar to `redirectTo`, if the return value is `undefined` (or a promise that gets
* resolved to `undefined`), no redirection takes place and the route transition occurs as
* though there was no redirection.
*
* If the function throws an error or the returned promise gets rejected, no further
* processing will take place and the
* {@link ngRoute.$route#$routeChangeError $routeChangeError} event will be fired.
*
* `redirectTo` takes precedence over `resolveRedirectTo`, so specifying both on the same
* route definition, will cause the latter to be ignored.
*
* - `[reloadOnUrl=true]` - `{boolean=}` - reload route when any part of the URL changes
* (including the path) even if the new URL maps to the same route.
*
* If the option is set to `false` and the URL in the browser changes, but the new URL maps
* to the same route, then a `$routeUpdate` event is broadcasted on the root scope (without
* reloading the route).
* *
* - `[reloadOnSearch=true]` - `{boolean=}` - reload route when only `$location.search()` * - `[reloadOnSearch=true]` - `{boolean=}` - reload route when only `$location.search()`
* or `$location.hash()` changes. * or `$location.hash()` changes.
* *
* If the option is set to `false` and url in the browser changes, then * If the option is set to `false` and the URL in the browser changes, then a `$routeUpdate`
* `$routeUpdate` event is broadcasted on the root scope. * event is broadcasted on the root scope (without reloading the route).
*
* <div class="alert alert-warning">
* **Note:** This option has no effect if `reloadOnUrl` is set to `false`.
* </div>
* *
* - `[caseInsensitiveMatch=false]` - `{boolean=}` - match routes without being case sensitive * - `[caseInsensitiveMatch=false]` - `{boolean=}` - match routes without being case sensitive
* *
@ -198,6 +291,9 @@ function $RouteProvider() {
this.when = function(path, route) { this.when = function(path, route) {
//copy original route object to preserve params inherited from proto chain //copy original route object to preserve params inherited from proto chain
var routeCopy = shallowCopy(route); var routeCopy = shallowCopy(route);
if (angular.isUndefined(routeCopy.reloadOnUrl)) {
routeCopy.reloadOnUrl = true;
}
if (angular.isUndefined(routeCopy.reloadOnSearch)) { if (angular.isUndefined(routeCopy.reloadOnSearch)) {
routeCopy.reloadOnSearch = true; routeCopy.reloadOnSearch = true;
} }
@ -206,7 +302,8 @@ function $RouteProvider() {
} }
routes[path] = angular.extend( routes[path] = angular.extend(
routeCopy, routeCopy,
path && pathRegExp(path, routeCopy) {originalPath: path},
path && routeToRegExp(path, routeCopy)
); );
// create redirection for trailing slashes // create redirection for trailing slashes
@ -216,8 +313,8 @@ function $RouteProvider() {
: path + '/'; : path + '/';
routes[redirectPath] = angular.extend( routes[redirectPath] = angular.extend(
{redirectTo: path}, {originalPath: path, redirectTo: path},
pathRegExp(redirectPath, routeCopy) routeToRegExp(redirectPath, routeCopy)
); );
} }
@ -235,47 +332,6 @@ function $RouteProvider() {
*/ */
this.caseInsensitiveMatch = false; this.caseInsensitiveMatch = false;
/**
* @param path {string} path
* @param opts {Object} options
* @return {?Object}
*
* @description
* Normalizes the given path, returning a regular expression
* and the original path.
*
* Inspired by pathRexp in visionmedia/express/lib/utils.js.
*/
function pathRegExp(path, opts) {
var insensitive = opts.caseInsensitiveMatch,
ret = {
originalPath: path,
regexp: path
},
keys = ret.keys = [];
path = path
.replace(/([().])/g, '\\$1')
.replace(/(\/)?:(\w+)(\*\?|[?*])?/g, function(_, slash, key, option) {
var optional = (option === '?' || option === '*?') ? '?' : null;
var star = (option === '*' || option === '*?') ? '*' : null;
keys.push({ name: key, optional: !!optional });
slash = slash || '';
return ''
+ (optional ? '' : slash)
+ '(?:'
+ (optional ? slash : '')
+ (star && '(.+?)' || '([^/]+)')
+ (optional || '')
+ ')'
+ (optional || '');
})
.replace(/([/$*])/g, '\\$1');
ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');
return ret;
}
/** /**
* @ngdoc method * @ngdoc method
* @name $routeProvider#otherwise * @name $routeProvider#otherwise
@ -296,6 +352,47 @@ function $RouteProvider() {
return this; return this;
}; };
/**
* @ngdoc method
* @name $routeProvider#eagerInstantiationEnabled
* @kind function
*
* @description
* Call this method as a setter to enable/disable eager instantiation of the
* {@link ngRoute.$route $route} service upon application bootstrap. You can also call it as a
* getter (i.e. without any arguments) to get the current value of the
* `eagerInstantiationEnabled` flag.
*
* Instantiating `$route` early is necessary for capturing the initial
* {@link ng.$location#$locationChangeStart $locationChangeStart} event and navigating to the
* appropriate route. Usually, `$route` is instantiated in time by the
* {@link ngRoute.ngView ngView} directive. Yet, in cases where `ngView` is included in an
* asynchronously loaded template (e.g. in another directive's template), the directive factory
* might not be called soon enough for `$route` to be instantiated _before_ the initial
* `$locationChangeSuccess` event is fired. Eager instantiation ensures that `$route` is always
* instantiated in time, regardless of when `ngView` will be loaded.
*
* The default value is true.
*
* **Note**:<br />
* You may want to disable the default behavior when unit-testing modules that depend on
* `ngRoute`, in order to avoid an unexpected request for the default route's template.
*
* @param {boolean=} enabled - If provided, update the internal `eagerInstantiationEnabled` flag.
*
* @returns {*} The current value of the `eagerInstantiationEnabled` flag if used as a getter or
* itself (for chaining) if used as a setter.
*/
isEagerInstantiationEnabled = true;
this.eagerInstantiationEnabled = function eagerInstantiationEnabled(enabled) {
if (isDefined(enabled)) {
isEagerInstantiationEnabled = enabled;
return this;
}
return isEagerInstantiationEnabled;
};
this.$get = ['$rootScope', this.$get = ['$rootScope',
'$location', '$location',
@ -304,7 +401,8 @@ function $RouteProvider() {
'$injector', '$injector',
'$templateRequest', '$templateRequest',
'$sce', '$sce',
function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce) { '$browser',
function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce, $browser) {
/** /**
* @ngdoc service * @ngdoc service
@ -483,12 +581,14 @@ function $RouteProvider() {
* @name $route#$routeChangeError * @name $route#$routeChangeError
* @eventType broadcast on root scope * @eventType broadcast on root scope
* @description * @description
* Broadcasted if any of the resolve promises are rejected. * Broadcasted if a redirection function fails or any redirection or resolve promises are
* rejected.
* *
* @param {Object} angularEvent Synthetic event object * @param {Object} angularEvent Synthetic event object
* @param {Route} current Current route information. * @param {Route} current Current route information.
* @param {Route} previous Previous route information. * @param {Route} previous Previous route information.
* @param {Route} rejection Rejection of the promise. Usually the error of the failed promise. * @param {Route} rejection The thrown error or the rejection reason of the promise. Usually
* the rejection reason is the error that caused the promise to get rejected.
*/ */
/** /**
@ -496,8 +596,9 @@ function $RouteProvider() {
* @name $route#$routeUpdate * @name $route#$routeUpdate
* @eventType broadcast on root scope * @eventType broadcast on root scope
* @description * @description
* The `reloadOnSearch` property has been set to false, and we are reusing the same * Broadcasted if the same instance of a route (including template, controller instance,
* instance of the Controller. * resolved dependencies, etc.) is being reused. This can happen if either `reloadOnSearch` or
* `reloadOnUrl` has been set to `false`.
* *
* @param {Object} angularEvent Synthetic event object * @param {Object} angularEvent Synthetic event object
* @param {Route} current Current/previous route information. * @param {Route} current Current/previous route information.
@ -557,7 +658,7 @@ function $RouteProvider() {
// interpolate modifies newParams, only query params are left // interpolate modifies newParams, only query params are left
$location.search(newParams); $location.search(newParams);
} else { } else {
throw $routeMinErr('norout', 'Tried updating route when with no current route'); throw $routeMinErr('norout', 'Tried updating route with no current route');
} }
} }
}; };
@ -605,9 +706,7 @@ function $RouteProvider() {
var lastRoute = $route.current; var lastRoute = $route.current;
preparedRoute = parseRoute(); preparedRoute = parseRoute();
preparedRouteIsUpdateOnly = preparedRoute && lastRoute && preparedRoute.$$route === lastRoute.$$route preparedRouteIsUpdateOnly = isNavigationUpdateOnly(preparedRoute, lastRoute);
&& angular.equals(preparedRoute.pathParams, lastRoute.pathParams)
&& !preparedRoute.reloadOnSearch && !forceReload;
if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) { if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) {
if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) { if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) {
@ -629,19 +728,16 @@ function $RouteProvider() {
} else if (nextRoute || lastRoute) { } else if (nextRoute || lastRoute) {
forceReload = false; forceReload = false;
$route.current = nextRoute; $route.current = nextRoute;
if (nextRoute) {
if (nextRoute.redirectTo) {
if (angular.isString(nextRoute.redirectTo)) {
$location.path(interpolate(nextRoute.redirectTo, nextRoute.params)).search(nextRoute.params)
.replace();
} else {
$location.url(nextRoute.redirectTo(nextRoute.pathParams, $location.path(), $location.search()))
.replace();
}
}
}
$q.when(nextRoute). var nextRoutePromise = $q.resolve(nextRoute);
$browser.$$incOutstandingRequestCount('$route');
nextRoutePromise.
then(getRedirectionData).
then(handlePossibleRedirection).
then(function(keepProcessingRoute) {
return keepProcessingRoute && nextRoutePromise.
then(resolveLocals). then(resolveLocals).
then(function(locals) { then(function(locals) {
// after route change // after route change
@ -652,14 +748,92 @@ function $RouteProvider() {
} }
$rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute); $rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute);
} }
}, function(error) { });
}).catch(function(error) {
if (nextRoute === $route.current) { if (nextRoute === $route.current) {
$rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error); $rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);
} }
}).finally(function() {
// Because `commitRoute()` is called from a `$rootScope.$evalAsync` block (see
// `$locationWatch`), this `$$completeOutstandingRequest()` call will not cause
// `outstandingRequestCount` to hit zero. This is important in case we are redirecting
// to a new route which also requires some asynchronous work.
$browser.$$completeOutstandingRequest(noop, '$route');
}); });
} }
} }
function getRedirectionData(route) {
var data = {
route: route,
hasRedirection: false
};
if (route) {
if (route.redirectTo) {
if (angular.isString(route.redirectTo)) {
data.path = interpolate(route.redirectTo, route.params);
data.search = route.params;
data.hasRedirection = true;
} else {
var oldPath = $location.path();
var oldSearch = $location.search();
var newUrl = route.redirectTo(route.pathParams, oldPath, oldSearch);
if (angular.isDefined(newUrl)) {
data.url = newUrl;
data.hasRedirection = true;
}
}
} else if (route.resolveRedirectTo) {
return $q.
resolve($injector.invoke(route.resolveRedirectTo)).
then(function(newUrl) {
if (angular.isDefined(newUrl)) {
data.url = newUrl;
data.hasRedirection = true;
}
return data;
});
}
}
return data;
}
function handlePossibleRedirection(data) {
var keepProcessingRoute = true;
if (data.route !== $route.current) {
keepProcessingRoute = false;
} else if (data.hasRedirection) {
var oldUrl = $location.url();
var newUrl = data.url;
if (newUrl) {
$location.
url(newUrl).
replace();
} else {
newUrl = $location.
path(data.path).
search(data.search).
replace().
url();
}
if (newUrl !== oldUrl) {
// Exit out and don't process current next value,
// wait for next location change from redirect
keepProcessingRoute = false;
}
}
return keepProcessingRoute;
}
function resolveLocals(route) { function resolveLocals(route) {
if (route) { if (route) {
var locals = angular.extend({}, route.resolve); var locals = angular.extend({}, route.resolve);
@ -676,7 +850,6 @@ function $RouteProvider() {
} }
} }
function getTemplateFor(route) { function getTemplateFor(route) {
var template, templateUrl; var template, templateUrl;
if (angular.isDefined(template = route.template)) { if (angular.isDefined(template = route.template)) {
@ -695,7 +868,6 @@ function $RouteProvider() {
return template; return template;
} }
/** /**
* @returns {Object} the current active route, by matching it against the URL * @returns {Object} the current active route, by matching it against the URL
*/ */
@ -714,6 +886,29 @@ function $RouteProvider() {
return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}}); return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
} }
/**
* @param {Object} newRoute - The new route configuration (as returned by `parseRoute()`).
* @param {Object} oldRoute - The previous route configuration (as returned by `parseRoute()`).
* @returns {boolean} Whether this is an "update-only" navigation, i.e. the URL maps to the same
* route and it can be reused (based on the config and the type of change).
*/
function isNavigationUpdateOnly(newRoute, oldRoute) {
// IF this is not a forced reload
return !forceReload
// AND both `newRoute`/`oldRoute` are defined
&& newRoute && oldRoute
// AND they map to the same Route Definition Object
&& (newRoute.$$route === oldRoute.$$route)
// AND `reloadOnUrl` is disabled
&& (!newRoute.reloadOnUrl
// OR `reloadOnSearch` is disabled
|| (!newRoute.reloadOnSearch
// AND both routes have the same path params
&& angular.equals(newRoute.pathParams, oldRoute.pathParams)
)
);
}
/** /**
* @returns {string} interpolation of the redirect path with the parameters * @returns {string} interpolation of the redirect path with the parameters
*/ */
@ -735,6 +930,14 @@ function $RouteProvider() {
}]; }];
} }
instantiateRoute.$inject = ['$injector'];
function instantiateRoute($injector) {
if (isEagerInstantiationEnabled) {
// Instantiate `$route`
$injector.get('$route');
}
}
ngRouteModule.provider('$routeParams', $RouteParamsProvider); ngRouteModule.provider('$routeParams', $RouteParamsProvider);
@ -786,7 +989,6 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
* @restrict ECA * @restrict ECA
* *
* @description * @description
* # Overview
* `ngView` is a directive that complements the {@link ngRoute.$route $route} service by * `ngView` is a directive that complements the {@link ngRoute.$route $route} service by
* including the rendered template of the current route into the main layout (`index.html`) file. * including the rendered template of the current route into the main layout (`index.html`) file.
* Every time the current route changes, the included view changes with it according to the * Every time the current route changes, the included view changes with it according to the
@ -802,13 +1004,6 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
* *
* The enter and leave animation occur concurrently. * The enter and leave animation occur concurrently.
* *
* @knownIssue If `ngView` is contained in an asynchronously loaded template (e.g. in another
* directive's templateUrl or in a template loaded using `ngInclude`), then you need to
* make sure that `$route` is instantiated in time to capture the initial
* `$locationChangeStart` event and load the appropriate view. One way to achieve this
* is to have it as a dependency in a `.run` block:
* `myModule.run(['$route', function() {}]);`
*
* @scope * @scope
* @priority 400 * @priority 400
* @param {string=} onload Expression to evaluate whenever the view updates. * @param {string=} onload Expression to evaluate whenever the view updates.

View file

@ -1,16 +1,17 @@
/* /*
AngularJS v1.5.11 AngularJS v1.7.8
(c) 2010-2017 Google, Inc. http://angularjs.org (c) 2010-2018 Google, Inc. http://angularjs.org
License: MIT License: MIT
*/ */
(function(E,d){'use strict';function y(t,l,g){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(b,e,a,c,k){function p(){m&&(g.cancel(m),m=null);h&&(h.$destroy(),h=null);n&&(m=g.leave(n),m.done(function(b){!1!==b&&(m=null)}),n=null)}function B(){var a=t.current&&t.current.locals;if(d.isDefined(a&&a.$template)){var a=b.$new(),c=t.current;n=k(a,function(a){g.enter(a,null,n||e).done(function(a){!1===a||!d.isDefined(A)||A&&!b.$eval(A)||l()});p()});h=c.scope=a;h.$emit("$viewContentLoaded"); (function(I,b){'use strict';function z(b,h){var d=[],c=b.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)(\*\?|[?*])?/g,function(b,c,h,k){b="?"===k||"*?"===k;k="*"===k||"*?"===k;d.push({name:h,optional:b});c=c||"";return(b?"(?:"+c:c+"(?:")+(k?"(.+?)":"([^/]+)")+(b?"?)?":")")}).replace(/([/$*])/g,"\\$1");h.ignoreTrailingSlashes&&(c=c.replace(/\/+$/,"")+"/*");return{keys:d,regexp:new RegExp("^"+c+"(?:[?#]|$)",h.caseInsensitiveMatch?"i":"")}}function A(b){p&&b.get("$route")}function v(u,h,d){return{restrict:"ECA",
h.$eval(s)}else p()}var h,n,m,A=a.autoscroll,s=a.onload||"";b.$on("$routeChangeSuccess",B);B()}}}function w(d,l,g){return{restrict:"ECA",priority:-400,link:function(b,e){var a=g.current,c=a.locals;e.html(c.$template);var k=d(e.contents());if(a.controller){c.$scope=b;var p=l(a.controller,c);a.controllerAs&&(b[a.controllerAs]=p);e.data("$ngControllerController",p);e.children().data("$ngControllerController",p)}b[a.resolveAs||"$resolve"]=c;k(b)}}}var x,C,s=d.module("ngRoute",["ng"]).provider("$route", terminal:!0,priority:400,transclude:"element",link:function(c,f,g,l,k){function q(){r&&(d.cancel(r),r=null);m&&(m.$destroy(),m=null);s&&(r=d.leave(s),r.done(function(b){!1!==b&&(r=null)}),s=null)}function C(){var g=u.current&&u.current.locals;if(b.isDefined(g&&g.$template)){var g=c.$new(),l=u.current;s=k(g,function(g){d.enter(g,null,s||f).done(function(d){!1===d||!b.isDefined(w)||w&&!c.$eval(w)||h()});q()});m=l.scope=g;m.$emit("$viewContentLoaded");m.$eval(p)}else q()}var m,s,r,w=g.autoscroll,p=g.onload||
function(){function t(b,e){return d.extend(Object.create(b),e)}function l(b,d){var a=d.caseInsensitiveMatch,c={originalPath:b,regexp:b},g=c.keys=[];b=b.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)(\*\?|[?*])?/g,function(b,a,d,c){b="?"===c||"*?"===c?"?":null;c="*"===c||"*?"===c?"*":null;g.push({name:d,optional:!!b});a=a||"";return""+(b?"":a)+"(?:"+(b?a:"")+(c&&"(.+?)"||"([^/]+)")+(b||"")+")"+(b||"")}).replace(/([/$*])/g,"\\$1");c.regexp=new RegExp("^"+b+"$",a?"i":"");return c}x=d.isArray;C=d.isObject; "";c.$on("$routeChangeSuccess",C);C()}}}function x(b,h,d){return{restrict:"ECA",priority:-400,link:function(c,f){var g=d.current,l=g.locals;f.html(l.$template);var k=b(f.contents());if(g.controller){l.$scope=c;var q=h(g.controller,l);g.controllerAs&&(c[g.controllerAs]=q);f.data("$ngControllerController",q);f.children().data("$ngControllerController",q)}c[g.resolveAs||"$resolve"]=l;k(c)}}}var D,E,F,G,y=b.module("ngRoute",[]).info({angularVersion:"1.7.8"}).provider("$route",function(){function u(d,
var g={};this.when=function(b,e){var a;a=void 0;if(x(e)){a=a||[];for(var c=0,k=e.length;c<k;c++)a[c]=e[c]}else if(C(e))for(c in a=a||{},e)if("$"!==c.charAt(0)||"$"!==c.charAt(1))a[c]=e[c];a=a||e;d.isUndefined(a.reloadOnSearch)&&(a.reloadOnSearch=!0);d.isUndefined(a.caseInsensitiveMatch)&&(a.caseInsensitiveMatch=this.caseInsensitiveMatch);g[b]=d.extend(a,b&&l(b,a));b&&(c="/"===b[b.length-1]?b.substr(0,b.length-1):b+"/",g[c]=d.extend({redirectTo:b},l(c,a)));return this};this.caseInsensitiveMatch=!1; c){return b.extend(Object.create(d),c)}D=b.isArray;E=b.isObject;F=b.isDefined;G=b.noop;var h={};this.when=function(d,c){var f;f=void 0;if(D(c)){f=f||[];for(var g=0,l=c.length;g<l;g++)f[g]=c[g]}else if(E(c))for(g in f=f||{},c)if("$"!==g.charAt(0)||"$"!==g.charAt(1))f[g]=c[g];f=f||c;b.isUndefined(f.reloadOnUrl)&&(f.reloadOnUrl=!0);b.isUndefined(f.reloadOnSearch)&&(f.reloadOnSearch=!0);b.isUndefined(f.caseInsensitiveMatch)&&(f.caseInsensitiveMatch=this.caseInsensitiveMatch);h[d]=b.extend(f,{originalPath:d},
this.otherwise=function(b){"string"===typeof b&&(b={redirectTo:b});this.when(null,b);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function(b,e,a,c,k,p,l){function h(a){var f=v.current;(x=(r=y())&&f&&r.$$route===f.$$route&&d.equals(r.pathParams,f.pathParams)&&!r.reloadOnSearch&&!z)||!f&&!r||b.$broadcast("$routeChangeStart",r,f).defaultPrevented&&a&&a.preventDefault()}function n(){var u=v.current,f=r;if(x)u.params=f.params,d.copy(u.params, d&&z(d,f));d&&(g="/"===d[d.length-1]?d.substr(0,d.length-1):d+"/",h[g]=b.extend({originalPath:d,redirectTo:d},z(g,f)));return this};this.caseInsensitiveMatch=!1;this.otherwise=function(b){"string"===typeof b&&(b={redirectTo:b});this.when(null,b);return this};p=!0;this.eagerInstantiationEnabled=function(b){return F(b)?(p=b,this):p};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce","$browser",function(d,c,f,g,l,k,q,p){function m(a){var e=t.current;n=A();(x=
a),b.$broadcast("$routeUpdate",u);else if(f||u)z=!1,(v.current=f)&&f.redirectTo&&(d.isString(f.redirectTo)?e.path(w(f.redirectTo,f.params)).search(f.params).replace():e.url(f.redirectTo(f.pathParams,e.path(),e.search())).replace()),c.when(f).then(m).then(function(c){f===v.current&&(f&&(f.locals=c,d.copy(f.params,a)),b.$broadcast("$routeChangeSuccess",f,u))},function(a){f===v.current&&b.$broadcast("$routeChangeError",f,u,a)})}function m(a){if(a){var b=d.extend({},a.resolve);d.forEach(b,function(a, !B&&n&&e&&n.$$route===e.$$route&&(!n.reloadOnUrl||!n.reloadOnSearch&&b.equals(n.pathParams,e.pathParams)))||!e&&!n||d.$broadcast("$routeChangeStart",n,e).defaultPrevented&&a&&a.preventDefault()}function s(){var a=t.current,e=n;if(x)a.params=e.params,b.copy(a.params,f),d.$broadcast("$routeUpdate",a);else if(e||a){B=!1;t.current=e;var c=g.resolve(e);p.$$incOutstandingRequestCount("$route");c.then(r).then(w).then(function(g){return g&&c.then(y).then(function(c){e===t.current&&(e&&(e.locals=c,b.copy(e.params,
c){b[c]=d.isString(a)?k.get(a):k.invoke(a,null,null,c)});a=s(a);d.isDefined(a)&&(b.$template=a);return c.all(b)}}function s(a){var b,c;d.isDefined(b=a.template)?d.isFunction(b)&&(b=b(a.params)):d.isDefined(c=a.templateUrl)&&(d.isFunction(c)&&(c=c(a.params)),d.isDefined(c)&&(a.loadedTemplateUrl=l.valueOf(c),b=p(c)));return b}function y(){var a,b;d.forEach(g,function(c,g){var q;if(q=!b){var h=e.path();q=c.keys;var l={};if(c.regexp)if(h=c.regexp.exec(h)){for(var k=1,p=h.length;k<p;++k){var m=q[k-1], f)),d.$broadcast("$routeChangeSuccess",e,a))})}).catch(function(b){e===t.current&&d.$broadcast("$routeChangeError",e,a,b)}).finally(function(){p.$$completeOutstandingRequest(G,"$route")})}}function r(a){var e={route:a,hasRedirection:!1};if(a)if(a.redirectTo)if(b.isString(a.redirectTo))e.path=v(a.redirectTo,a.params),e.search=a.params,e.hasRedirection=!0;else{var d=c.path(),f=c.search();a=a.redirectTo(a.pathParams,d,f);b.isDefined(a)&&(e.url=a,e.hasRedirection=!0)}else if(a.resolveRedirectTo)return g.resolve(l.invoke(a.resolveRedirectTo)).then(function(a){b.isDefined(a)&&
n=h[k];m&&n&&(l[m.name]=n)}q=l}else q=null;else q=null;q=a=q}q&&(b=t(c,{params:d.extend({},e.search(),a),pathParams:a}),b.$$route=c)});return b||g[null]&&t(g[null],{params:{},pathParams:{}})}function w(a,b){var c=[];d.forEach((a||"").split(":"),function(a,d){if(0===d)c.push(a);else{var e=a.match(/(\w+)(?:[?*])?(.*)/),g=e[1];c.push(b[g]);c.push(e[2]||"");delete b[g]}});return c.join("")}var z=!1,r,x,v={routes:g,reload:function(){z=!0;var a={defaultPrevented:!1,preventDefault:function(){this.defaultPrevented= (e.url=a,e.hasRedirection=!0);return e});return e}function w(a){var b=!0;if(a.route!==t.current)b=!1;else if(a.hasRedirection){var g=c.url(),d=a.url;d?c.url(d).replace():d=c.path(a.path).search(a.search).replace().url();d!==g&&(b=!1)}return b}function y(a){if(a){var e=b.extend({},a.resolve);b.forEach(e,function(a,c){e[c]=b.isString(a)?l.get(a):l.invoke(a,null,null,c)});a=z(a);b.isDefined(a)&&(e.$template=a);return g.all(e)}}function z(a){var e,c;b.isDefined(e=a.template)?b.isFunction(e)&&(e=e(a.params)):
!0;z=!1}};b.$evalAsync(function(){h(a);a.defaultPrevented||n()})},updateParams:function(a){if(this.current&&this.current.$$route)a=d.extend({},this.current.params,a),e.path(w(this.current.$$route.originalPath,a)),e.search(a);else throw D("norout");}};b.$on("$locationChangeStart",h);b.$on("$locationChangeSuccess",n);return v}]}),D=d.$$minErr("ngRoute");s.provider("$routeParams",function(){this.$get=function(){return{}}});s.directive("ngView",y);s.directive("ngView",w);y.$inject=["$route","$anchorScroll", b.isDefined(c=a.templateUrl)&&(b.isFunction(c)&&(c=c(a.params)),b.isDefined(c)&&(a.loadedTemplateUrl=q.valueOf(c),e=k(c)));return e}function A(){var a,e;b.forEach(h,function(d,g){var f;if(f=!e){var h=c.path();f=d.keys;var l={};if(d.regexp)if(h=d.regexp.exec(h)){for(var k=1,p=h.length;k<p;++k){var m=f[k-1],n=h[k];m&&n&&(l[m.name]=n)}f=l}else f=null;else f=null;f=a=f}f&&(e=u(d,{params:b.extend({},c.search(),a),pathParams:a}),e.$$route=d)});return e||h[null]&&u(h[null],{params:{},pathParams:{}})}function v(a,
"$animate"];w.$inject=["$compile","$controller","$route"]})(window,window.angular); c){var d=[];b.forEach((a||"").split(":"),function(a,b){if(0===b)d.push(a);else{var f=a.match(/(\w+)(?:[?*])?(.*)/),g=f[1];d.push(c[g]);d.push(f[2]||"");delete c[g]}});return d.join("")}var B=!1,n,x,t={routes:h,reload:function(){B=!0;var a={defaultPrevented:!1,preventDefault:function(){this.defaultPrevented=!0;B=!1}};d.$evalAsync(function(){m(a);a.defaultPrevented||s()})},updateParams:function(a){if(this.current&&this.current.$$route)a=b.extend({},this.current.params,a),c.path(v(this.current.$$route.originalPath,
a)),c.search(a);else throw H("norout");}};d.$on("$locationChangeStart",m);d.$on("$locationChangeSuccess",s);return t}]}).run(A),H=b.$$minErr("ngRoute"),p;A.$inject=["$injector"];y.provider("$routeParams",function(){this.$get=function(){return{}}});y.directive("ngView",v);y.directive("ngView",x);v.$inject=["$route","$anchorScroll","$animate"];x.$inject=["$compile","$controller","$route"]})(window,window.angular);
//# sourceMappingURL=angular-route.min.js.map //# sourceMappingURL=angular-route.min.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,10 +1,10 @@
{ {
"name": "angular-route", "name": "angular-route",
"version": "1.5.11", "version": "1.7.8",
"license": "MIT", "license": "MIT",
"main": "./angular-route.js", "main": "./angular-route.js",
"ignore": [], "ignore": [],
"dependencies": { "dependencies": {
"angular": "1.5.11" "angular": "1.7.8"
} }
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "angular-route", "name": "angular-route",
"version": "1.5.11", "version": "1.7.8",
"description": "AngularJS router module", "description": "AngularJS router module",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View file

@ -1,20 +1,20 @@
{ {
"name": "angular-sanitize", "name": "angular-sanitize",
"version": "1.5.11", "version": "1.7.8",
"license": "MIT", "license": "MIT",
"main": "./angular-sanitize.js", "main": "./angular-sanitize.js",
"ignore": [], "ignore": [],
"dependencies": { "dependencies": {
"angular": "1.5.11" "angular": "1.7.8"
}, },
"homepage": "https://github.com/angular/bower-angular-sanitize", "homepage": "https://github.com/angular/bower-angular-sanitize",
"_release": "1.5.11", "_release": "1.7.8",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.5.11", "tag": "v1.7.8",
"commit": "84df06c4ec4f1eef7f9d0b849b9fdf5433c2669c" "commit": "845b3064da357de96f38fdbbb923f918d0d82bbe"
}, },
"_source": "https://github.com/angular/bower-angular-sanitize.git", "_source": "https://github.com/angular/bower-angular-sanitize.git",
"_target": "1.5.11", "_target": "1.7.8",
"_originalSource": "angular-sanitize" "_originalSource": "angular-sanitize"
} }

View file

@ -1,6 +1,6 @@
/** /**
* @license AngularJS v1.5.11 * @license AngularJS v1.7.8
* (c) 2010-2017 Google, Inc. http://angularjs.org * (c) 2010-2018 Google, Inc. http://angularjs.org
* License: MIT * License: MIT
*/ */
(function(window, angular) {'use strict'; (function(window, angular) {'use strict';
@ -20,9 +20,11 @@ var $sanitizeMinErr = angular.$$minErr('$sanitize');
var bind; var bind;
var extend; var extend;
var forEach; var forEach;
var isArray;
var isDefined; var isDefined;
var lowercase; var lowercase;
var noop; var noop;
var nodeContains;
var htmlParser; var htmlParser;
var htmlSanitizeWriter; var htmlSanitizeWriter;
@ -31,13 +33,8 @@ var htmlSanitizeWriter;
* @name ngSanitize * @name ngSanitize
* @description * @description
* *
* # ngSanitize
*
* The `ngSanitize` module provides functionality to sanitize HTML. * The `ngSanitize` module provides functionality to sanitize HTML.
* *
*
* <div doc-module-components="ngSanitize"></div>
*
* See {@link ngSanitize.$sanitize `$sanitize`} for usage. * See {@link ngSanitize.$sanitize `$sanitize`} for usage.
*/ */
@ -50,12 +47,11 @@ var htmlSanitizeWriter;
* Sanitizes an html string by stripping all potentially dangerous tokens. * Sanitizes an html string by stripping all potentially dangerous tokens.
* *
* The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are * The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are
* then serialized back to properly escaped html string. This means that no unsafe input can make * then serialized back to a properly escaped HTML string. This means that no unsafe input can make
* it into the returned string. * it into the returned string.
* *
* The whitelist for URL sanitization of attribute values is configured using the functions * The whitelist for URL sanitization of attribute values is configured using the functions
* `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider * `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link $compileProvider}.
* `$compileProvider`}.
* *
* The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}. * The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}.
* *
@ -154,9 +150,11 @@ var htmlSanitizeWriter;
* Creates and configures {@link $sanitize} instance. * Creates and configures {@link $sanitize} instance.
*/ */
function $SanitizeProvider() { function $SanitizeProvider() {
var hasBeenInstantiated = false;
var svgEnabled = false; var svgEnabled = false;
this.$get = ['$$sanitizeUri', function($$sanitizeUri) { this.$get = ['$$sanitizeUri', function($$sanitizeUri) {
hasBeenInstantiated = true;
if (svgEnabled) { if (svgEnabled) {
extend(validElements, svgElements); extend(validElements, svgElements);
} }
@ -197,7 +195,7 @@ function $SanitizeProvider() {
* </div> * </div>
* *
* @param {boolean=} flag Enable or disable SVG support in the sanitizer. * @param {boolean=} flag Enable or disable SVG support in the sanitizer.
* @returns {boolean|ng.$sanitizeProvider} Returns the currently configured value if called * @returns {boolean|$sanitizeProvider} Returns the currently configured value if called
* without an argument or self for chaining otherwise. * without an argument or self for chaining otherwise.
*/ */
this.enableSvg = function(enableSvg) { this.enableSvg = function(enableSvg) {
@ -209,6 +207,105 @@ function $SanitizeProvider() {
} }
}; };
/**
* @ngdoc method
* @name $sanitizeProvider#addValidElements
* @kind function
*
* @description
* Extends the built-in lists of valid HTML/SVG elements, i.e. elements that are considered safe
* and are not stripped off during sanitization. You can extend the following lists of elements:
*
* - `htmlElements`: A list of elements (tag names) to extend the current list of safe HTML
* elements. HTML elements considered safe will not be removed during sanitization. All other
* elements will be stripped off.
*
* - `htmlVoidElements`: This is similar to `htmlElements`, but marks the elements as
* "void elements" (similar to HTML
* [void elements](https://rawgit.com/w3c/html/html5.1-2/single-page.html#void-elements)). These
* elements have no end tag and cannot have content.
*
* - `svgElements`: This is similar to `htmlElements`, but for SVG elements. This list is only
* taken into account if SVG is {@link ngSanitize.$sanitizeProvider#enableSvg enabled} for
* `$sanitize`.
*
* <div class="alert alert-info">
* This method must be called during the {@link angular.Module#config config} phase. Once the
* `$sanitize` service has been instantiated, this method has no effect.
* </div>
*
* <div class="alert alert-warning">
* Keep in mind that extending the built-in lists of elements may expose your app to XSS or
* other vulnerabilities. Be very mindful of the elements you add.
* </div>
*
* @param {Array<String>|Object} elements - A list of valid HTML elements or an object with one or
* more of the following properties:
* - **htmlElements** - `{Array<String>}` - A list of elements to extend the current list of
* HTML elements.
* - **htmlVoidElements** - `{Array<String>}` - A list of elements to extend the current list of
* void HTML elements; i.e. elements that do not have an end tag.
* - **svgElements** - `{Array<String>}` - A list of elements to extend the current list of SVG
* elements. The list of SVG elements is only taken into account if SVG is
* {@link ngSanitize.$sanitizeProvider#enableSvg enabled} for `$sanitize`.
*
* Passing an array (`[...]`) is equivalent to passing `{htmlElements: [...]}`.
*
* @return {$sanitizeProvider} Returns self for chaining.
*/
this.addValidElements = function(elements) {
if (!hasBeenInstantiated) {
if (isArray(elements)) {
elements = {htmlElements: elements};
}
addElementsTo(svgElements, elements.svgElements);
addElementsTo(voidElements, elements.htmlVoidElements);
addElementsTo(validElements, elements.htmlVoidElements);
addElementsTo(validElements, elements.htmlElements);
}
return this;
};
/**
* @ngdoc method
* @name $sanitizeProvider#addValidAttrs
* @kind function
*
* @description
* Extends the built-in list of valid attributes, i.e. attributes that are considered safe and are
* not stripped off during sanitization.
*
* **Note**:
* The new attributes will not be treated as URI attributes, which means their values will not be
* sanitized as URIs using `$compileProvider`'s
* {@link ng.$compileProvider#aHrefSanitizationWhitelist aHrefSanitizationWhitelist} and
* {@link ng.$compileProvider#imgSrcSanitizationWhitelist imgSrcSanitizationWhitelist}.
*
* <div class="alert alert-info">
* This method must be called during the {@link angular.Module#config config} phase. Once the
* `$sanitize` service has been instantiated, this method has no effect.
* </div>
*
* <div class="alert alert-warning">
* Keep in mind that extending the built-in list of attributes may expose your app to XSS or
* other vulnerabilities. Be very mindful of the attributes you add.
* </div>
*
* @param {Array<String>} attrs - A list of valid attributes.
*
* @returns {$sanitizeProvider} Returns self for chaining.
*/
this.addValidAttrs = function(attrs) {
if (!hasBeenInstantiated) {
extend(validAttrs, arrayToMap(attrs, true));
}
return this;
};
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////
// Private stuff // Private stuff
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////
@ -216,13 +313,19 @@ function $SanitizeProvider() {
bind = angular.bind; bind = angular.bind;
extend = angular.extend; extend = angular.extend;
forEach = angular.forEach; forEach = angular.forEach;
isArray = angular.isArray;
isDefined = angular.isDefined; isDefined = angular.isDefined;
lowercase = angular.lowercase; lowercase = angular.$$lowercase;
noop = angular.noop; noop = angular.noop;
htmlParser = htmlParserImpl; htmlParser = htmlParserImpl;
htmlSanitizeWriter = htmlSanitizeWriterImpl; htmlSanitizeWriter = htmlSanitizeWriterImpl;
nodeContains = window.Node.prototype.contains || /** @this */ function(arg) {
// eslint-disable-next-line no-bitwise
return !!(this.compareDocumentPosition(arg) & 16);
};
// Regular Expressions for parsing tags and attributes // Regular Expressions for parsing tags and attributes
var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
// Match everything outside of normal chars and " (quote character) // Match everything outside of normal chars and " (quote character)
@ -235,23 +338,23 @@ function $SanitizeProvider() {
// Safe Void Elements - HTML5 // Safe Void Elements - HTML5
// http://dev.w3.org/html5/spec/Overview.html#void-elements // http://dev.w3.org/html5/spec/Overview.html#void-elements
var voidElements = toMap('area,br,col,hr,img,wbr'); var voidElements = stringToMap('area,br,col,hr,img,wbr');
// Elements that you can, intentionally, leave open (and which close themselves) // Elements that you can, intentionally, leave open (and which close themselves)
// http://dev.w3.org/html5/spec/Overview.html#optional-tags // http://dev.w3.org/html5/spec/Overview.html#optional-tags
var optionalEndTagBlockElements = toMap('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'), var optionalEndTagBlockElements = stringToMap('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'),
optionalEndTagInlineElements = toMap('rp,rt'), optionalEndTagInlineElements = stringToMap('rp,rt'),
optionalEndTagElements = extend({}, optionalEndTagElements = extend({},
optionalEndTagInlineElements, optionalEndTagInlineElements,
optionalEndTagBlockElements); optionalEndTagBlockElements);
// Safe Block Elements - HTML5 // Safe Block Elements - HTML5
var blockElements = extend({}, optionalEndTagBlockElements, toMap('address,article,' + var blockElements = extend({}, optionalEndTagBlockElements, stringToMap('address,article,' +
'aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' + 'aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +
'h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul')); 'h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul'));
// Inline Elements - HTML5 // Inline Elements - HTML5
var inlineElements = extend({}, optionalEndTagInlineElements, toMap('a,abbr,acronym,b,' + var inlineElements = extend({}, optionalEndTagInlineElements, stringToMap('a,abbr,acronym,b,' +
'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,' + 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,' +
'samp,small,span,strike,strong,sub,sup,time,tt,u,var')); 'samp,small,span,strike,strong,sub,sup,time,tt,u,var'));
@ -259,12 +362,12 @@ function $SanitizeProvider() {
// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements
// Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted. // Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted.
// They can potentially allow for arbitrary javascript to be executed. See #11290 // They can potentially allow for arbitrary javascript to be executed. See #11290
var svgElements = toMap('circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,' + var svgElements = stringToMap('circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,' +
'hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,' + 'hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,' +
'radialGradient,rect,stop,svg,switch,text,title,tspan'); 'radialGradient,rect,stop,svg,switch,text,title,tspan');
// Blocked Elements (will be stripped) // Blocked Elements (will be stripped)
var blockedElements = toMap('script,style'); var blockedElements = stringToMap('script,style');
var validElements = extend({}, var validElements = extend({},
voidElements, voidElements,
@ -273,9 +376,9 @@ function $SanitizeProvider() {
optionalEndTagElements); optionalEndTagElements);
//Attributes that have href and hence need to be sanitized //Attributes that have href and hence need to be sanitized
var uriAttrs = toMap('background,cite,href,longdesc,src,xlink:href'); var uriAttrs = stringToMap('background,cite,href,longdesc,src,xlink:href,xml:base');
var htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' + var htmlAttrs = stringToMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' + 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +
'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' + 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +
'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' + 'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' +
@ -283,7 +386,7 @@ function $SanitizeProvider() {
// SVG attributes (without "id" and "name" attributes) // SVG attributes (without "id" and "name" attributes)
// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes
var svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' + var svgAttrs = stringToMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' +
'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' + 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' +
'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' + 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' +
'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' + 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' +
@ -304,35 +407,96 @@ function $SanitizeProvider() {
svgAttrs, svgAttrs,
htmlAttrs); htmlAttrs);
function toMap(str, lowercaseKeys) { function stringToMap(str, lowercaseKeys) {
var obj = {}, items = str.split(','), i; return arrayToMap(str.split(','), lowercaseKeys);
}
function arrayToMap(items, lowercaseKeys) {
var obj = {}, i;
for (i = 0; i < items.length; i++) { for (i = 0; i < items.length; i++) {
obj[lowercaseKeys ? lowercase(items[i]) : items[i]] = true; obj[lowercaseKeys ? lowercase(items[i]) : items[i]] = true;
} }
return obj; return obj;
} }
var inertBodyElement; function addElementsTo(elementsMap, newElements) {
(function(window) { if (newElements && newElements.length) {
var doc; extend(elementsMap, arrayToMap(newElements));
if (window.document && window.document.implementation) { }
doc = window.document.implementation.createHTMLDocument('inert'); }
/**
* Create an inert document that contains the dirty HTML that needs sanitizing
* Depending upon browser support we use one of three strategies for doing this.
* Support: Safari 10.x -> XHR strategy
* Support: Firefox -> DomParser strategy
*/
var getInertBodyElement /* function(html: string): HTMLBodyElement */ = (function(window, document) {
var inertDocument;
if (document && document.implementation) {
inertDocument = document.implementation.createHTMLDocument('inert');
} else { } else {
throw $sanitizeMinErr('noinert', 'Can\'t create an inert html document'); throw $sanitizeMinErr('noinert', 'Can\'t create an inert html document');
} }
var docElement = doc.documentElement || doc.getDocumentElement(); var inertBodyElement = (inertDocument.documentElement || inertDocument.getDocumentElement()).querySelector('body');
var bodyElements = docElement.getElementsByTagName('body');
// usually there should be only one body element in the document, but IE doesn't have any, so we need to create one // Check for the Safari 10.1 bug - which allows JS to run inside the SVG G element
if (bodyElements.length === 1) { inertBodyElement.innerHTML = '<svg><g onload="this.parentNode.remove()"></g></svg>';
inertBodyElement = bodyElements[0]; if (!inertBodyElement.querySelector('svg')) {
return getInertBodyElement_XHR;
} else { } else {
var html = doc.createElement('html'); // Check for the Firefox bug - which prevents the inner img JS from being sanitized
inertBodyElement = doc.createElement('body'); inertBodyElement.innerHTML = '<svg><p><style><img src="</style><img src=x onerror=alert(1)//">';
html.appendChild(inertBodyElement); if (inertBodyElement.querySelector('svg img')) {
doc.appendChild(html); return getInertBodyElement_DOMParser;
} else {
return getInertBodyElement_InertDocument;
} }
})(window); }
function getInertBodyElement_XHR(html) {
// We add this dummy element to ensure that the rest of the content is parsed as expected
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the `<head>` tag.
html = '<remove></remove>' + html;
try {
html = encodeURI(html);
} catch (e) {
return undefined;
}
var xhr = new window.XMLHttpRequest();
xhr.responseType = 'document';
xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false);
xhr.send(null);
var body = xhr.response.body;
body.firstChild.remove();
return body;
}
function getInertBodyElement_DOMParser(html) {
// We add this dummy element to ensure that the rest of the content is parsed as expected
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the `<head>` tag.
html = '<remove></remove>' + html;
try {
var body = new window.DOMParser().parseFromString(html, 'text/html').body;
body.firstChild.remove();
return body;
} catch (e) {
return undefined;
}
}
function getInertBodyElement_InertDocument(html) {
inertBodyElement.innerHTML = html;
// Support: IE 9-11 only
// strip custom-namespaced attributes on IE<=11
if (document.documentMode) {
stripCustomNsAttrs(inertBodyElement);
}
return inertBodyElement;
}
})(window, window.document);
/** /**
* @example * @example
@ -352,7 +516,9 @@ function $SanitizeProvider() {
} else if (typeof html !== 'string') { } else if (typeof html !== 'string') {
html = '' + html; html = '' + html;
} }
inertBodyElement.innerHTML = html;
var inertBodyElement = getInertBodyElement(html);
if (!inertBodyElement) return '';
//mXSS protection //mXSS protection
var mXSSAttempts = 5; var mXSSAttempts = 5;
@ -362,12 +528,9 @@ function $SanitizeProvider() {
} }
mXSSAttempts--; mXSSAttempts--;
// strip custom-namespaced attributes on IE<=11 // trigger mXSS if it is going to happen by reading and writing the innerHTML
if (window.document.documentMode) { html = inertBodyElement.innerHTML;
stripCustomNsAttrs(inertBodyElement); inertBodyElement = getInertBodyElement(html);
}
html = inertBodyElement.innerHTML; //trigger mXSS
inertBodyElement.innerHTML = html;
} while (html !== inertBodyElement.innerHTML); } while (html !== inertBodyElement.innerHTML);
var node = inertBodyElement.firstChild; var node = inertBodyElement.firstChild;
@ -386,12 +549,12 @@ function $SanitizeProvider() {
if (node.nodeType === 1) { if (node.nodeType === 1) {
handler.end(node.nodeName.toLowerCase()); handler.end(node.nodeName.toLowerCase());
} }
nextNode = node.nextSibling; nextNode = getNonDescendant('nextSibling', node);
if (!nextNode) { if (!nextNode) {
while (nextNode == null) { while (nextNode == null) {
node = node.parentNode; node = getNonDescendant('parentNode', node);
if (node === inertBodyElement) break; if (node === inertBodyElement) break;
nextNode = node.nextSibling; nextNode = getNonDescendant('nextSibling', node);
if (node.nodeType === 1) { if (node.nodeType === 1) {
handler.end(node.nodeName.toLowerCase()); handler.end(node.nodeName.toLowerCase());
} }
@ -523,9 +686,18 @@ function $SanitizeProvider() {
stripCustomNsAttrs(nextNode); stripCustomNsAttrs(nextNode);
} }
node = node.nextSibling; node = getNonDescendant('nextSibling', node);
} }
} }
function getNonDescendant(propName, node) {
// An element is clobbered if its `propName` property points to one of its descendants
var nextNode = node[propName];
if (nextNode && nodeContains.call(node, nextNode)) {
throw $sanitizeMinErr('elclob', 'Failed to sanitize html because the element is clobbered: {0}', node.outerHTML || node.outerText);
}
return nextNode;
}
} }
function sanitizeText(chars) { function sanitizeText(chars) {
@ -537,7 +709,9 @@ function sanitizeText(chars) {
// define ngSanitize module and register $sanitize service // define ngSanitize module and register $sanitize service
angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider); angular.module('ngSanitize', [])
.provider('$sanitize', $SanitizeProvider)
.info({ angularVersion: '1.7.8' });
/** /**
* @ngdoc filter * @ngdoc filter
@ -545,13 +719,13 @@ angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);
* @kind function * @kind function
* *
* @description * @description
* Finds links in text input and turns them into html links. Supports `http/https/ftp/mailto` and * Finds links in text input and turns them into html links. Supports `http/https/ftp/sftp/mailto` and
* plain email address links. * plain email address links.
* *
* Requires the {@link ngSanitize `ngSanitize`} module to be installed. * Requires the {@link ngSanitize `ngSanitize`} module to be installed.
* *
* @param {string} text Input text. * @param {string} text Input text.
* @param {string} target Window (`_blank|_self|_parent|_top`) or named frame to open links in. * @param {string} [target] Window (`_blank|_self|_parent|_top`) or named frame to open links in.
* @param {object|function(url)} [attributes] Add custom attributes to the link element. * @param {object|function(url)} [attributes] Add custom attributes to the link element.
* *
* Can be one of: * Can be one of:
@ -668,7 +842,7 @@ angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);
*/ */
angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) { angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
var LINKY_URL_REGEXP = var LINKY_URL_REGEXP =
/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i, /((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,
MAILTO_REGEXP = /^mailto:/i; MAILTO_REGEXP = /^mailto:/i;
var linkyMinErr = angular.$$minErr('linky'); var linkyMinErr = angular.$$minErr('linky');

View file

@ -1,16 +1,18 @@
/* /*
AngularJS v1.5.11 AngularJS v1.7.8
(c) 2010-2017 Google, Inc. http://angularjs.org (c) 2010-2018 Google, Inc. http://angularjs.org
License: MIT License: MIT
*/ */
(function(s,g){'use strict';function H(g){var l=[];t(l,A).chars(g);return l.join("")}var B=g.$$minErr("$sanitize"),C,l,D,E,q,A,F,t;g.module("ngSanitize",[]).provider("$sanitize",function(){function k(a,e){var b={},c=a.split(","),h;for(h=0;h<c.length;h++)b[e?q(c[h]):c[h]]=!0;return b}function I(a){for(var e={},b=0,c=a.length;b<c;b++){var h=a[b];e[h.name]=h.value}return e}function G(a){return a.replace(/&/g,"&amp;").replace(J,function(a){var b=a.charCodeAt(0);a=a.charCodeAt(1);return"&#"+(1024*(b-55296)+ (function(s,c){'use strict';function P(c){var h=[];C(h,E).chars(c);return h.join("")}var D=c.$$minErr("$sanitize"),F,h,G,H,I,q,E,J,K,C;c.module("ngSanitize",[]).provider("$sanitize",function(){function f(a,e){return B(a.split(","),e)}function B(a,e){var d={},b;for(b=0;b<a.length;b++)d[e?q(a[b]):a[b]]=!0;return d}function t(a,e){e&&e.length&&h(a,B(e))}function Q(a){for(var e={},d=0,b=a.length;d<b;d++){var k=a[d];e[k.name]=k.value}return e}function L(a){return a.replace(/&/g,"&amp;").replace(z,function(a){var d=
(a-56320)+65536)+";"}).replace(K,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function x(a){for(;a;){if(a.nodeType===s.Node.ELEMENT_NODE)for(var e=a.attributes,b=0,c=e.length;b<c;b++){var h=e[b],d=h.name.toLowerCase();if("xmlns:ns1"===d||0===d.lastIndexOf("ns1:",0))a.removeAttributeNode(h),b--,c--}(e=a.firstChild)&&x(e);a=a.nextSibling}}var u=!1;this.$get=["$$sanitizeUri",function(a){u&&l(v,w);return function(e){var b=[];F(e,t(b,function(b,h){return!/^unsafe:/.test(a(b, a.charCodeAt(0);a=a.charCodeAt(1);return"&#"+(1024*(d-55296)+(a-56320)+65536)+";"}).replace(u,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function A(a){for(;a;){if(a.nodeType===s.Node.ELEMENT_NODE)for(var e=a.attributes,d=0,b=e.length;d<b;d++){var k=e[d],g=k.name.toLowerCase();if("xmlns:ns1"===g||0===g.lastIndexOf("ns1:",0))a.removeAttributeNode(k),d--,b--}(e=a.firstChild)&&A(e);a=v("nextSibling",a)}}function v(a,e){var d=e[a];if(d&&J.call(e,d))throw D("elclob",
h))}));return b.join("")}}];this.enableSvg=function(a){return E(a)?(u=a,this):u};C=g.bind;l=g.extend;D=g.forEach;E=g.isDefined;q=g.lowercase;A=g.noop;F=function(a,e){null===a||void 0===a?a="":"string"!==typeof a&&(a=""+a);f.innerHTML=a;var b=5;do{if(0===b)throw B("uinput");b--;s.document.documentMode&&x(f);a=f.innerHTML;f.innerHTML=a}while(a!==f.innerHTML);for(b=f.firstChild;b;){switch(b.nodeType){case 1:e.start(b.nodeName.toLowerCase(),I(b.attributes));break;case 3:e.chars(b.textContent)}var c;if(!(c= e.outerHTML||e.outerText);return d}var y=!1,g=!1;this.$get=["$$sanitizeUri",function(a){y=!0;g&&h(m,l);return function(e){var d=[];K(e,C(d,function(b,d){return!/^unsafe:/.test(a(b,d))}));return d.join("")}}];this.enableSvg=function(a){return I(a)?(g=a,this):g};this.addValidElements=function(a){y||(H(a)&&(a={htmlElements:a}),t(l,a.svgElements),t(r,a.htmlVoidElements),t(m,a.htmlVoidElements),t(m,a.htmlElements));return this};this.addValidAttrs=function(a){y||h(M,B(a,!0));return this};F=c.bind;h=c.extend;
b.firstChild)&&(1===b.nodeType&&e.end(b.nodeName.toLowerCase()),c=b.nextSibling,!c))for(;null==c;){b=b.parentNode;if(b===f)break;c=b.nextSibling;1===b.nodeType&&e.end(b.nodeName.toLowerCase())}b=c}for(;b=f.firstChild;)f.removeChild(b)};t=function(a,e){var b=!1,c=C(a,a.push);return{start:function(a,d){a=q(a);!b&&z[a]&&(b=a);b||!0!==v[a]||(c("<"),c(a),D(d,function(b,d){var f=q(d),g="img"===a&&"src"===f||"background"===f;!0!==m[f]||!0===n[f]&&!e(b,g)||(c(" "),c(d),c('="'),c(G(b)),c('"'))}),c(">"))}, G=c.forEach;H=c.isArray;I=c.isDefined;q=c.$$lowercase;E=c.noop;K=function(a,e){null===a||void 0===a?a="":"string"!==typeof a&&(a=""+a);var d=N(a);if(!d)return"";var b=5;do{if(0===b)throw D("uinput");b--;a=d.innerHTML;d=N(a)}while(a!==d.innerHTML);for(b=d.firstChild;b;){switch(b.nodeType){case 1:e.start(b.nodeName.toLowerCase(),Q(b.attributes));break;case 3:e.chars(b.textContent)}var k;if(!(k=b.firstChild)&&(1===b.nodeType&&e.end(b.nodeName.toLowerCase()),k=v("nextSibling",b),!k))for(;null==k;){b=
end:function(a){a=q(a);b||!0!==v[a]||!0===y[a]||(c("</"),c(a),c(">"));a==b&&(b=!1)},chars:function(a){b||c(G(a))}}};var J=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,K=/([^#-~ |!])/g,y=k("area,br,col,hr,img,wbr"),d=k("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),r=k("rp,rt"),p=l({},r,d),d=l({},d,k("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),r=l({},r,k("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")), v("parentNode",b);if(b===d)break;k=v("nextSibling",b);1===b.nodeType&&e.end(b.nodeName.toLowerCase())}b=k}for(;b=d.firstChild;)d.removeChild(b)};C=function(a,e){var d=!1,b=F(a,a.push);return{start:function(a,g){a=q(a);!d&&w[a]&&(d=a);d||!0!==m[a]||(b("<"),b(a),G(g,function(d,g){var c=q(g),f="img"===a&&"src"===c||"background"===c;!0!==M[c]||!0===O[c]&&!e(d,f)||(b(" "),b(g),b('="'),b(L(d)),b('"'))}),b(">"))},end:function(a){a=q(a);d||!0!==m[a]||!0===r[a]||(b("</"),b(a),b(">"));a==d&&(d=!1)},chars:function(a){d||
w=k("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),z=k("script,style"),v=l({},y,d,r,p),n=k("background,cite,href,longdesc,src,xlink:href"),p=k("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"), b(L(a))}}};J=s.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)};var z=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=/([^#-~ |!])/g,r=f("area,br,col,hr,img,wbr"),x=f("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),p=f("rp,rt"),n=h({},p,x),x=h({},x,f("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),p=h({},p,f("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),
r=k("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan", l=f("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),w=f("script,style"),m=h({},r,x,p,n),O=f("background,cite,href,longdesc,src,xlink:href,xml:base"),n=f("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),
!0),m=l({},n,r,p),f;(function(a){if(a.document&&a.document.implementation)a=a.document.implementation.createHTMLDocument("inert");else throw B("noinert");var e=(a.documentElement||a.getDocumentElement()).getElementsByTagName("body");1===e.length?f=e[0]:(e=a.createElement("html"),f=a.createElement("body"),e.appendChild(f),a.appendChild(e))})(s)});g.module("ngSanitize").filter("linky",["$sanitize",function(k){var l=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i, p=f("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",
q=/^mailto:/i,x=g.$$minErr("linky"),u=g.isDefined,s=g.isFunction,t=g.isObject,y=g.isString;return function(d,g,p){function w(a){a&&m.push(H(a))}function z(a,b){var c,d=v(a);m.push("<a ");for(c in d)m.push(c+'="'+d[c]+'" ');!u(g)||"target"in d||m.push('target="',g,'" ');m.push('href="',a.replace(/"/g,"&quot;"),'">');w(b);m.push("</a>")}if(null==d||""===d)return d;if(!y(d))throw x("notstring",d);for(var v=s(p)?p:t(p)?function(){return p}:function(){return{}},n=d,m=[],f,a;d=n.match(l);)f=d[0],d[2]|| !0),M=h({},O,p,n),N=function(a,e){function d(b){b="<remove></remove>"+b;try{var d=(new a.DOMParser).parseFromString(b,"text/html").body;d.firstChild.remove();return d}catch(e){}}function b(a){c.innerHTML=a;e.documentMode&&A(c);return c}var g;if(e&&e.implementation)g=e.implementation.createHTMLDocument("inert");else throw D("noinert");var c=(g.documentElement||g.getDocumentElement()).querySelector("body");c.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>';return c.querySelector("svg")?
d[4]||(f=(d[3]?"http://":"mailto:")+f),a=d.index,w(n.substr(0,a)),z(f,d[0].replace(q,"")),n=n.substring(a+d[0].length);w(n);return k(m.join(""))}}])})(window,window.angular); (c.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',c.querySelector("svg img")?d:b):function(b){b="<remove></remove>"+b;try{b=encodeURI(b)}catch(d){return}var e=new a.XMLHttpRequest;e.responseType="document";e.open("GET","data:text/html;charset=utf-8,"+b,!1);e.send(null);b=e.response.body;b.firstChild.remove();return b}}(s,s.document)}).info({angularVersion:"1.7.8"});c.module("ngSanitize").filter("linky",["$sanitize",function(f){var h=/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,
t=/^mailto:/i,q=c.$$minErr("linky"),s=c.isDefined,A=c.isFunction,v=c.isObject,y=c.isString;return function(c,z,u){function r(c){c&&l.push(P(c))}function x(c,g){var f,a=p(c);l.push("<a ");for(f in a)l.push(f+'="'+a[f]+'" ');!s(z)||"target"in a||l.push('target="',z,'" ');l.push('href="',c.replace(/"/g,"&quot;"),'">');r(g);l.push("</a>")}if(null==c||""===c)return c;if(!y(c))throw q("notstring",c);for(var p=A(u)?u:v(u)?function(){return u}:function(){return{}},n=c,l=[],w,m;c=n.match(h);)w=c[0],c[2]||
c[4]||(w=(c[3]?"http://":"mailto:")+w),m=c.index,r(n.substr(0,m)),x(w,c[0].replace(t,"")),n=n.substring(m+c[0].length);r(n);return f(l.join(""))}}])})(window,window.angular);
//# sourceMappingURL=angular-sanitize.min.js.map //# sourceMappingURL=angular-sanitize.min.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,10 +1,10 @@
{ {
"name": "angular-sanitize", "name": "angular-sanitize",
"version": "1.5.11", "version": "1.7.8",
"license": "MIT", "license": "MIT",
"main": "./angular-sanitize.js", "main": "./angular-sanitize.js",
"ignore": [], "ignore": [],
"dependencies": { "dependencies": {
"angular": "1.5.11" "angular": "1.7.8"
} }
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "angular-sanitize", "name": "angular-sanitize",
"version": "1.5.11", "version": "1.7.8",
"description": "AngularJS module for sanitizing HTML", "description": "AngularJS module for sanitizing HTML",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View file

@ -1,18 +1,18 @@
{ {
"name": "angular", "name": "angular",
"version": "1.5.11", "version": "1.7.8",
"license": "MIT", "license": "MIT",
"main": "./angular.js", "main": "./angular.js",
"ignore": [], "ignore": [],
"dependencies": {}, "dependencies": {},
"homepage": "https://github.com/angular/bower-angular", "homepage": "https://github.com/angular/bower-angular",
"_release": "1.5.11", "_release": "1.7.8",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.5.11", "tag": "v1.7.8",
"commit": "0f57428c3ffe2f486264ab7fbee3968dccc7b720" "commit": "56690b5e545ad36d04e369a65171de1adbe3ce64"
}, },
"_source": "https://github.com/angular/bower-angular.git", "_source": "https://github.com/angular/bower-angular.git",
"_target": "1.5.11", "_target": "1.7.8",
"_originalSource": "angular" "_originalSource": "angular"
} }

Some files were not shown because too many files have changed in this diff Show more