From 55d9f7240c6f7531b11ce1e784e641595e8e5dd7 Mon Sep 17 00:00:00 2001 From: Alexei Danilchik Date: Wed, 25 Jul 2018 07:49:07 +0300 Subject: [PATCH] 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 --- src/definitions/modules/nag.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/definitions/modules/nag.js b/src/definitions/modules/nag.js index 79d431130..64afdc023 100644 --- a/src/definitions/modules/nag.js +++ b/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.' },