Skip to content

Instantly share code, notes, and snippets.

@craigtaub
Last active August 29, 2015 13:56
Show Gist options
  • Save craigtaub/8848080 to your computer and use it in GitHub Desktop.
Save craigtaub/8848080 to your computer and use it in GitHub Desktop.
define('iplayer/controllers/Preview',
function() {
glow.events.addListener("#preview-opt-in a", "click", function(event) {
event.stopPropagation();
event.preventDefault();
var date = new Date(),
expires;
date.setTime(date.getTime()+(182*24*60*60*1000)); //6 months in future
expires = date.toGMTString();
document.cookie =
'ckps_tviplayer_kombat=1' +
'; expires=' + expires +
'; path=/; domain=.bbc.co.uk';
document.cookie =
'sa_labels=' + encodeURIComponent('link_location=iplayer-preview-opt-in') +
'; max-age=' + 60 +
'; path=/; domain=bbc.co.uk';
window.location.reload(true);
});
return;
});
@mrwillihog
Copy link

yeah i dont care as its a 1 month stop gap, just in auto pilot mode :)

@middric
Copy link

middric commented Feb 6, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment