Browse Source

Update nag.js to support Cookies instead of $.cookie

jquery-cookie no longer maintained, superseded by JS Cookie: https://github.com/js-cookie/js-cookie
pull/6505/head
Alexei Danilchik 6 years ago
committed by GitHub
parent
commit
55d9f7240c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions
  1. 16
      src/definitions/modules/nag.js

16
src/definitions/modules/nag.js

@ -204,8 +204,8 @@ $.fn.nag = function(parameters) {
window.sessionStorage.setItem(key, value);
module.debug('Value stored using session storage', key, value);
}
else if($.cookie !== undefined) {
$.cookie(key, value, options);
else if(Cookies !== undefined) {
Cookies.set(key, value, options);
module.debug('Value stored using cookie', key, value, options);
}
else {
@ -224,8 +224,8 @@ $.fn.nag = function(parameters) {
storedValue = window.sessionStorage.getItem(key);
}
// get by cookie
else if($.cookie !== undefined) {
storedValue = $.cookie(key);
else if(Cookies !== undefined) {
storedValue = Cookies.get(key);
}
else {
module.error(error.noCookieStorage);
@ -246,8 +246,8 @@ $.fn.nag = function(parameters) {
window.sessionStorage.removeItem(key);
}
// store by cookie
else if($.cookie !== undefined) {
$.removeCookie(key, options);
else if(Cookies !== undefined) {
Cookies.remove(key, options);
}
else {
module.error(error.noStorage);
@ -476,8 +476,8 @@ $.fn.nag.settings = {
value : 'dismiss',
error: {
noCookieStorage : '$.cookie is not included. A storage solution is required.',
noStorage : 'Neither $.cookie or store is defined. A storage solution is required for storing state',
noCookieStorage : 'js.cookie is not included. A storage solution is required.',
noStorage : 'Neither js.cookie nor storage is defined. A storage solution is required for storing state.',
method : 'The method you called is not defined.'
},

Loading…
Cancel
Save