diff options
Diffstat (limited to 'xstatic/pkg/angular/data/angular-cookies.js')
-rw-r--r-- | xstatic/pkg/angular/data/angular-cookies.js | 117 |
1 files changed, 24 insertions, 93 deletions
diff --git a/xstatic/pkg/angular/data/angular-cookies.js b/xstatic/pkg/angular/data/angular-cookies.js index a03ff49..a1dac51 100644 --- a/xstatic/pkg/angular/data/angular-cookies.js +++ b/xstatic/pkg/angular/data/angular-cookies.js @@ -1,6 +1,6 @@ /** - * @license AngularJS v1.5.8 - * (c) 2010-2016 Google, Inc. http://angularjs.org + * @license AngularJS v1.8.2 + * (c) 2010-2020 Google, Inc. http://angularjs.org * License: MIT */ (function(window, angular) {'use strict'; @@ -10,25 +10,21 @@ * @name ngCookies * @description * - * # ngCookies - * * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies. * - * - * <div doc-module-components="ngCookies"></div> - * * See {@link ngCookies.$cookies `$cookies`} for usage. */ angular.module('ngCookies', ['ng']). + info({ angularVersion: '"1.8.2"' }). /** * @ngdoc provider * @name $cookiesProvider * @description * Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service. * */ - provider('$cookies', [function $CookiesProvider() { + provider('$cookies', [/** @this */function $CookiesProvider() { /** * @ngdoc property * @name $cookiesProvider#defaults @@ -47,10 +43,24 @@ angular.module('ngCookies', ['ng']). * or a Date object indicating the exact date/time this cookie will expire. * - **secure** - `{boolean}` - If `true`, then the cookie will only be available through a * secured connection. + * - **samesite** - `{string}` - prevents the browser from sending the cookie along with cross-site requests. + * Accepts the values `lax` and `strict`. See the [OWASP Wiki](https://www.owasp.org/index.php/SameSite) + * for more info. Note that as of May 2018, not all browsers support `SameSite`, + * so it cannot be used as a single measure against Cross-Site-Request-Forgery (CSRF) attacks. * * Note: By default, the address that appears in your `<base>` tag will be used as the path. * This is important so that cookies will be visible for all routes when html5mode is enabled. * + * @example + * + * ```js + * angular.module('cookiesProviderExample', ['ngCookies']) + * .config(['$cookiesProvider', function($cookiesProvider) { + * // Setting default options + * $cookiesProvider.defaults.domain = 'foo.com'; + * $cookiesProvider.defaults.secure = true; + * }]); + * ``` **/ var defaults = this.defaults = {}; @@ -66,7 +76,7 @@ angular.module('ngCookies', ['ng']). * Provides read/write access to browser's cookies. * * <div class="alert alert-info"> - * Up until Angular 1.3, `$cookies` exposed properties that represented the + * Up until AngularJS 1.3, `$cookies` exposed properties that represented the * current browser cookie values. In version 1.4, this behavior has changed, and * `$cookies` now provides a standard api of getters, setters etc. * </div> @@ -179,86 +189,6 @@ angular.module('ngCookies', ['ng']). }]; }]); -angular.module('ngCookies'). -/** - * @ngdoc service - * @name $cookieStore - * @deprecated - * @requires $cookies - * - * @description - * Provides a key-value (string-object) storage, that is backed by session cookies. - * Objects put or retrieved from this storage are automatically serialized or - * deserialized by angular's toJson/fromJson. - * - * Requires the {@link ngCookies `ngCookies`} module to be installed. - * - * <div class="alert alert-danger"> - * **Note:** The $cookieStore service is **deprecated**. - * Please use the {@link ngCookies.$cookies `$cookies`} service instead. - * </div> - * - * @example - * - * ```js - * angular.module('cookieStoreExample', ['ngCookies']) - * .controller('ExampleController', ['$cookieStore', function($cookieStore) { - * // Put cookie - * $cookieStore.put('myFavorite','oatmeal'); - * // Get cookie - * var favoriteCookie = $cookieStore.get('myFavorite'); - * // Removing a cookie - * $cookieStore.remove('myFavorite'); - * }]); - * ``` - */ - factory('$cookieStore', ['$cookies', function($cookies) { - - return { - /** - * @ngdoc method - * @name $cookieStore#get - * - * @description - * Returns the value of given cookie key - * - * @param {string} key Id to use for lookup. - * @returns {Object} Deserialized cookie value, undefined if the cookie does not exist. - */ - get: function(key) { - return $cookies.getObject(key); - }, - - /** - * @ngdoc method - * @name $cookieStore#put - * - * @description - * Sets a value for given cookie key - * - * @param {string} key Id for the `value`. - * @param {Object} value Value to be stored. - */ - put: function(key, value) { - $cookies.putObject(key, value); - }, - - /** - * @ngdoc method - * @name $cookieStore#remove - * - * @description - * Remove given cookie - * - * @param {string} key Id of the key-value pair to delete. - */ - remove: function(key) { - $cookies.remove(key); - } - }; - - }]); - /** * @name $$cookieWriter * @requires $document @@ -292,6 +222,7 @@ function $$CookieWriter($document, $log, $browser) { str += options.domain ? ';domain=' + options.domain : ''; str += expires ? ';expires=' + expires.toUTCString() : ''; str += options.secure ? ';secure' : ''; + str += options.samesite ? ';samesite=' + options.samesite : ''; // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum: // - 300 cookies @@ -299,9 +230,9 @@ function $$CookieWriter($document, $log, $browser) { // - 4096 bytes per cookie var cookieLength = str.length + 1; if (cookieLength > 4096) { - $log.warn("Cookie '" + name + - "' possibly not set or overflowed because it was too large (" + - cookieLength + " > 4096 bytes)!"); + $log.warn('Cookie \'' + name + + '\' possibly not set or overflowed because it was too large (' + + cookieLength + ' > 4096 bytes)!'); } return str; @@ -314,7 +245,7 @@ function $$CookieWriter($document, $log, $browser) { $$CookieWriter.$inject = ['$document', '$log', '$browser']; -angular.module('ngCookies').provider('$$cookieWriter', function $$CookieWriterProvider() { +angular.module('ngCookies').provider('$$cookieWriter', /** @this */ function $$CookieWriterProvider() { this.$get = $$CookieWriter; }); |