Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery', 'mb/core', 'responsive/lib/jquery.cookie'], factory);
} else {
// Browser globals (root is window)
factory(root.jQuery, root.mb);
}
}(this,
function($, mb) {
//grab mb namespace, until mb/core is converted to requireJs
mb = mb || window.mb;
var log = mb.logger,
utilsNS = mb.nameSpace('utils');
function setEmailCookie(){
$.cookie('MBUSA_ESM_STATUS','1',{ path: '/', expires:new Date( 2042, 1, 1 ) });
};
function removeEmailCookie(){
$.removeCookie('MBUSA_ESM_STATUS', { path: '/' });
};
utilsNS.cookie = {
setEmailCookie : setEmailCookie,
removeEmailCookie : removeEmailCookie
};
return utilsNS.cookie;
}
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment