diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2019-03-31 07:26:37 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2019-03-31 07:26:37 -0400 |
| commit | 71114877e8e5409e37dc5a4c03015408f8e905fc (patch) | |
| tree | 4d939c212d0fd21ba360012022e208be61f92e53 /etc/js/angular-translate-storage-cookie.js | |
| parent | f02d53b6318e2bf492a5b7d6c0c7b2f6de3bb8dd (diff) | |
#801 rip out bower, move to unmanaged externals
Diffstat (limited to 'etc/js/angular-translate-storage-cookie.js')
| -rw-r--r-- | etc/js/angular-translate-storage-cookie.js | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/etc/js/angular-translate-storage-cookie.js b/etc/js/angular-translate-storage-cookie.js new file mode 100644 index 00000000..5b45f3d1 --- /dev/null +++ b/etc/js/angular-translate-storage-cookie.js @@ -0,0 +1,97 @@ +/*! + * angular-translate - v2.11.1 - 2016-07-17 + * + * Copyright (c) 2016 The angular-translate team, Pascal Precht; Licensed MIT + */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define([], function () { + return (factory()); + }); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } else { + factory(); + } +}(this, function () { + +$translateCookieStorageFactory.$inject = ['$cookieStore']; +angular.module('pascalprecht.translate') + +/** + * @ngdoc object + * @name pascalprecht.translate.$translateCookieStorage + * @requires $cookieStore + * + * @description + * Abstraction layer for cookieStore. This service is used when telling angular-translate + * to use cookieStore as storage. + * + */ + .factory('$translateCookieStorage', $translateCookieStorageFactory); + +function $translateCookieStorageFactory($cookieStore) { + + 'use strict'; + + var $translateCookieStorage = { + + /** + * @ngdoc function + * @name pascalprecht.translate.$translateCookieStorage#get + * @methodOf pascalprecht.translate.$translateCookieStorage + * + * @description + * Returns an item from cookieStorage by given name. + * + * @param {string} name Item name + * @return {string} Value of item name + */ + get: function (name) { + return $cookieStore.get(name); + }, + + /** + * @ngdoc function + * @name pascalprecht.translate.$translateCookieStorage#set + * @methodOf pascalprecht.translate.$translateCookieStorage + * + * @description + * Sets an item in cookieStorage by given name. + * + * @deprecated use #put + * + * @param {string} name Item name + * @param {string} value Item value + */ + set: function (name, value) { + $cookieStore.put(name, value); + }, + + /** + * @ngdoc function + * @name pascalprecht.translate.$translateCookieStorage#put + * @methodOf pascalprecht.translate.$translateCookieStorage + * + * @description + * Sets an item in cookieStorage by given name. + * + * @param {string} name Item name + * @param {string} value Item value + */ + put: function (name, value) { + $cookieStore.put(name, value); + } + }; + + return $translateCookieStorage; +} + +$translateCookieStorageFactory.displayName = '$translateCookieStorage'; +return 'pascalprecht.translate'; + +})); |
