/* cookie-consent.js ================= A modern alternative and more page friendly version of jquery.cookiecuttr.js */ // Set the display type sCookieDisplayType = "fixed"; // Set the display position (only supports top or bottom) sCookieDisplayPosition = "bottom"; // Store the page that goes to our privacy policy sLinkToPrivacyPolicy = "privacy/page_901"; (function ($) { // If we have consented to cookie usage already, don't display the cookie stuff and just exit if( $.cookie('cc_cookie_accept') == "cc_cookie_accept" ) { // Exit the function return; } // If the cookie display position isn't a supported type if( sCookieDisplayPosition != "top" && sCookieDisplayPosition != "bottom" ) { // Default to bottom sCookieDisplayPosition = "bottom"; } // Store the style tag, as loading an entire css file for this would be pointles sStyle = "margin : 0px; width : 100%; position : " + sCookieDisplayType + "; " + sCookieDisplayPosition + " : -600px; left : 0px;"; sStyle += "z-index : 999999999; color : #000000; background-color : #f0f0f0; border-top : solid 1px #c2c2c2"; // Button styling sButtonClasses = "visible-xs-block visible-sm-inline-block visible-md-inline-block visible-lg-inline-block d-block d-sm-inline"; // Create the cookie clicker wrapper var oCookieWrapper = $(""); // Store the cookie consent content wrapper var oCookieContent = $("
"); // Cookie clicker wrapper text var oCookieText = $("We use cookies on this website to personalise content and analyse traffic. To use the website as intended, please...
"); // Cookie clicker wrapper text var oCookieButton = $("Accept"); // Append the data oCookieWrapper.append(oCookieContent); oCookieContent.append(oCookieText); oCookieContent.append(oCookieButton); oCookieWrapper = $("body").append(oCookieWrapper); // Store what we want to animate var oToAnimate = {} // Set the animation speed var nAnimationSpeed = 0; // If we are working with a fixed display type if( sCookieDisplayType == "fixed" ) { // Set the animation speed nAnimationSpeed = 2000; } // Animate the cookie display position oToAnimate[ sCookieDisplayPosition ] = "0px"; // Animate the consent box $("#cookie-consent").animate( oToAnimate, nAnimationSpeed ); })(jQuery); /* OnCookieConsent =============== What happens when the 'accept' button is pressed. Logix is done here. */ function OnCookieConsent(e) { // Prevent e.preventDefault(); // Store what we want to animate var oToAnimate = {} // If we are working with a fixed display type if( sCookieDisplayType == "fixed" ) { // Animate the cookie display position oToAnimate[ sCookieDisplayPosition ] = "-600px"; // Animate the consent box $("#cookie-consent").animate( oToAnimate, 1000, function() { // Remove it as it's no longer needed $("#cookie-consent").remove(); }); } // If we are not in fixed type, don't bother animating just remove else { // Remove it as it's no longer needed $("#cookie-consent").remove(); } // Set the cookies accept (This is called this as the old cookie consenter we used had this cookie name so we don't break anything) $.cookie("cc_cookie_accept", "cc_cookie_accept", { expires: 365, path: '/' }); }