Skip to content

Instantly share code, notes, and snippets.

@antoinegrant
Last active December 21, 2015 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save antoinegrant/6251033 to your computer and use it in GitHub Desktop.
Save antoinegrant/6251033 to your computer and use it in GitHub Desktop.
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['mb/core', 'jQuery', 'handlebars', 'responsive/lib/jquery.cookie'], factory);
} else {
// Browser globals (root is window)
root.returnExports = factory(root.mb, root.jQuery, root.Handlebars);
}
}(this,
function(mb, $, Handlebars) {
//firstly make sure the namespace exists:
var log = mb.logger,
cookiesNs = mb.nameSpace('utils','cookies');
function setEmailCookie(){
$.cookie('MBUSA_ESM_STATUS','1',{ path: '/', expires:new Date( 2042, 1, 1 ) });
};
function removeEmailCookie(){
$.removeCookie('MBUSA_ESM_STATUS', { path: '/' });
};
cookiesNs = {
setEmailCookie : setEmailCookie,
removeEmailCookie : removeEmailCookie
};
return cookiesNs;
}
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment