Signin  Pricing  Examples  Support

Libraries > en_GB_home.js

en_GB_home.js - Search Live Website Code
It's like doing CTRL+F on millions of websites' source code



NerdyData is a search engine for source code. Search the source code of 200 million websites.


JAVASCRIPT FILE http://game.co.uk/wcsstore/jawrjs/N1185984140/bundles/en_GB_home.js

Function Explorer










Libraries on game.co.uk


jquery.min.js

jquery.bxslider.js

Game.js

homepage.2.4.js

criteo_ld3.js

embed.js

cmcustom.js

AppGlobalBundle.js

en_GB_ie.js

en_GB_home.js



Explore More


ccard.js

ds-sleight.js

cookies.js

translate.js

en_GB_home.js
				

var App=App||{};App.EMS=App.EMS||{};App.EMS.AutoScrollBanner=(function(node){var $node=$(node),$products=$node.find("ul.products").find("li.productItem"),$pagination=$node.find("ol.navigation"),$control=$pagination.find("li.control a"),count=$products.length,delay=parseInt(Salmon.Global.PageContext.CAROUSEL_TIMER)*1000,interval=null,animating=false;currentPage=0,showClass="show",hideClass="hide",activeClass="active",speed="fast",paused=false;init();function init(){$pagination.removeClass("hide");for(var i=0;i<count;i++){if(i===0){show($products[i]);$($pagination.find("li.page").get(0)).addClass(activeClass);}else{hide($products[i]);}}
bindPaginationEvents();start();}
function bindPaginationEvents(){$control.bind("click",function(){if(!paused){$(this).removeClass("pause").addClass("play");stop();}else{stop();$(this).removeClass("play").addClass("pause");start();}
return false;});$pagination.find("li.page a").bind("click",function(){clearInterval(interval);activateItem(parseInt($(this).data('index'))-1,true);paused=true;$control.removeClass("pause").addClass("play");return false;});}
function start(){paused=false;interval=setInterval((function(){activateItem((currentPage<count-1)?currentPage+1:0);}),delay);}
function stop(){paused=true;clearInterval(interval);}
function show(item){$(item).show().addClass(showClass).removeClass(hideClass);return $(item);}
function hide(item){$(item).hide().addClass(hideClass).removeClass(showClass).css("zIndex",1);return $(item);}
function activateItem(index,manual){var ignorePause=manual||false;if(!animating&&index!==currentPage&&(!paused||ignorePause)){var $item=$($products.get(currentPage)),$newItem=$($products.get(index));show($newItem).css("zIndex",0);animating=true;$item.fadeOut(speed,function(){$newItem.css("zIndex",1);hide(this);currentPage=index;updatePagination();animating=false;});}}
function updatePagination(){$pagination.find("li.page").each(function(index){if(index===currentPage){$(this).addClass(activeClass);}else{$(this).removeClass(activeClass);}});}});App.EMS.VideoSlider=(function(){var config={transitionDuration:300,pager:false,playVideoButtonClass:'playVideoButton',closeVideoButtonClass:'closeVideo',defaultSwipeParams:{triggerOnTouchEnd:true,allowPageScroll:"horizontal",threshold:175,excludedElements:[]}};var _private={windowWidth:$(window).width(),speed:5000,isAnimating:1}
var newSlider=function(options){this.options=$.extend({},config,options);this.sliderCurrentPosition=0;this.currentSlide=0;this.isAnimating=false;this.init();this.interacted=false;};var proto=newSlider.prototype;proto.init=function(){this.setupElements();this.setupWidths();this.setupPager();this.initiateVideo();this.setupAutoScroll();this.setupClone();this.setupEvents();};proto.setupClone=function(){this.$elements.firstClone=this.$elements.slides.eq(0).clone()
this.$elements.firstClone.addClass('clone').appendTo(this.$elements.slidesContainer);this.$elements.lastClone=this.$elements.slides.eq(this.maxSlides-1).clone()
this.$elements.lastClone.addClass('clone').prependTo(this.$elements.slidesContainer);this.$elements.slidesContainer.width(this.wWidth*(this.maxSlides+2));this.$elements.slidesContainer.css('left',this.wWidth*-1);};proto.setupElements=function(){this.$elements={};this.$elements.window=$(window);this.$elements.mainContainer=$(this.options.elements.sliderContainer);this.$elements.slidesContainer=this.$elements.mainContainer.find('.slides');this.$elements.slides=this.$elements.slidesContainer.find('.slide');this.$elements.sliderControlPrev=this.$elements.mainContainer.find('.carouselPrev');this.$elements.sliderControlNext=this.$elements.mainContainer.find('.carouselNext')
this.maxSlides=this.$elements.slides.length;}
proto.setupWidths=function(){this.wWidth=this.$elements.window.width();this.$elements.slides.width(this.wWidth);this.scrollStep=this.wWidth;}
proto.setupEvents=function(){var self=this;this.$elements.sliderControlNext.bind('click',function(){if(!self.isAnimating){self.currentSlide++;self.moveSlider();self.stopAutoScroll();self.setInteracted()}});this.$elements.sliderControlPrev.bind('click',function(){if(!self.isAnimating){self.currentSlide--;self.moveSlider();self.stopAutoScroll();self.setInteracted()}});this.$elements.window.on('resize',function(){self.setupWidths();self.$elements.firstClone.width(this.wWidth)});this.$elements.slidesContainer.find('.slide').on('click',function(e){var $slide=$(this),url=$slide.data('href');if(typeof url!='undefined'&&url.length>0&&e.target==this)window.location.href=url;});this.$elements.mainContainer.on('mouseenter',function(){self.stopAutoScroll();});this.$elements.mainContainer.on('mouseleave',function(){if(!self.interacted&&self.autoScrollInterval==0)self.setupAutoScroll();});$(document).on('click','.'+self.options.playVideoButtonClass,function(e){e.preventDefault();e.stopPropagation();var $slide=$(this).parent();self.setInteracted()
self.startVideo($slide.data('limelightvideo'));});$(document).on('click','.'+self.options.closeVideoButtonClass,function(e){e.preventDefault();e.stopPropagation();self.closeVideo();});$(document).on('click','.sliderContainer .pager li',function(){if(!self.isAnimating){var index=$.inArray(this,$('.sliderContainer .pager li'))
self.currentSlide=index;self.moveSlider();self.stopAutoScroll();self.setInteracted()}});self.options.defaultSwipeParams.swipe=function(event,direction,distance,duration,fingerCount,fingerData){self.swiped(direction,distance,duration,fingerCount,fingerData);}
self.$elements.slidesContainer.swipe(self.options.defaultSwipeParams);};proto.swiped=function(direction,distance,duration,fingerCount,fingerData){var self=this;if(!self.isAnimating){switch(direction){case'left':self.currentSlide++;break;case'right':self.currentSlide--;break;}
self.moveSlider();self.stopAutoScroll();self.interacted=true;}}
proto.startVideo=function(videoId){if(typeof this.LimelightPlayer!='undefined'){this.LimelightPlayer.doLoadChannel(videoId,true);this.$elements.limelightContainer.addClass('visible');}else{this.$elements.limelightContainer.addClass('visible');this.autoPlayLimelightID=videoId;}};proto.initiateLimelight=function(){var self=this;window.limelightPlayerCallback=function(playerId,eventName,data){var id="limelight_player_156792";self.LimelightPlayer=LimelightPlayer;if(eventName=='onPlayerLoad'){LimelightPlayer.registerPlayer(id);if(typeof self.autoPlayLimelightID!='undefined'){this.LimelightPlayer.doLoadChannel(self.autoPlayLimelightID,true);}}
if(eventName=='onChannelLoad'||eventName=='onMediaLoad'){self.videoInitiated();}}};proto.closeVideo=function(){this.LimelightPlayer.doPause();this.$elements.limelightContainer.removeClass('visible');}
proto.setupLimelightTrigger=function($slide){var self=this;$slide.append('<a href="#" class="'+self.options.playVideoButtonClass+'">Play Video</a>');self.$elements.limelightContainer=self.$elements.mainContainer.find('.limeLightContainer');};proto.initiateVideo=function(){var self=this;this.$elements.slides.each(function(){var limelightVideoId=$(this).data('limelightvideo');if(typeof limelightVideoId!='undefined'){self.initiateLimelight();self.setupLimelightTrigger($(this));}});}
proto.adjustCurrentSlide=function(){if(this.currentSlide>this.maxSlides){}}
proto.moveSlider=function(){var self=this;if(!this.isAnimating){this.adjustCurrentSlide();this.isAnimating=true;var animateObj={left:(this.currentSlide==-1)?0:(this.currentSlide+1)*this.scrollStep*-1}
this.$elements.slidesContainer.animate(animateObj,this.options.transitionDuration,function(){self.isAnimating=false;if(self.currentSlide==self.maxSlides){self.$elements.slidesContainer.css('left',self.wWidth*-1);self.currentSlide=0;}
if(self.currentSlide==-1){self.$elements.slidesContainer.css('left',self.wWidth*(self.maxSlides)*-1);self.currentSlide=self.maxSlides-1;}});if(self.currentSlide!=self.maxSlides){this.$elements.pager.find('li').removeClass('active');this.$elements.pager.find('li').eq(this.currentSlide).addClass('active');}else{this.$elements.pager.find('li').removeClass('active');this.$elements.pager.find('li').eq(0).addClass('active');}}};proto.setupAutoScroll=function(){var self=this;self.autoScrollInterval=setInterval(function(){self.currentSlide++;self.moveSlider();},_private.speed);};proto.stopAutoScroll=function(){var self=this;if(typeof self.autoScrollInterval!='undefined'){clearInterval(self.autoScrollInterval);self.autoScrollInterval=0;}}
proto.resetSlider=function(){this.setupElements();this.setupWidths();}
proto.setInteracted=function(){var self=this;this.interacted=true;clearTimeout(this.restartAutoTimeout);this.restartAutoTimeout=setTimeout(function(){if(!self.$elements.limelightContainer.hasClass('visible')){self.interacted=false;self.setupAutoScroll();}},5000);}
proto.setupPager=function(){pagerItems='';slideCount=this.$elements.slides.length;active='active';if(slideCount>1){for(var i=0;i<slideCount;i++){if(i!=0)active='';pagerItems+='<li class="'+active+'">&nbsp;</li>';}
pagerHtml='<div class="pager"><ul>'+pagerItems+'</ul></div>';this.$elements.mainContainer.prepend(pagerHtml);this.$elements.pager=this.$elements.mainContainer.find('.pager');}}
proto.windowEvents=function(){}
return{newSlider:newSlider}})()
var App=App||{};App.EMS=App.EMS||{};App.EMS.EMSCarousel=new(function(){});var App=App||{};App.EMS=App.EMS||{};App.EMS.Controller=new(function(){var $topReviews;$(init);function init(){var $content=$("#content");var $ratings=$content.find("div.productsESpot").find("li.review").removeClass("hide");new App.Global.Ratings($ratings);if(App.Global.Pluck.Check()){$topReviews=$content.find("div.mostReviewed").find("div.topReview");if($topReviews.length>0){var requests=new Array();for(var i=0;i<$topReviews.length;i++){var request=new PluckSDK.ReviewsPageRequest(),articleKey=new PluckSDK.ExternalResourceKey({Key:$topReviews[i].getAttribute("rel")});request.ItemsPerPage=1;request.OneBasedOnPage=1;request.ReviewedKey=articleKey;request.SortType=new PluckSDK.ScoreSort({SortOrder:"Descending"});requests.push(request);}
PluckSDK.SendRequests(requests,showTopUserReview);}}}
function showTopUserReview(responses){if(responses.length>0){if(responses[0].Items.length>0){showTopUserReviewSummary(responses[0].Items);}}}
function showTopUserReviewSummary(reviews){for(var i=0;i<$topReviews.length;i++){var $topReview=$($topReviews[i]),review=reviews[i];$topReview.removeClass("hide").find("div.user").text(reviews[i].ReviewedBy.DisplayName);var reviewBody=review.Body;if(reviewBody.length>100){reviewBody="&#8216;"+reviewBody.substring(0,97)+"&#8217;&hellip;"}else{reviewBody="&#8216;"+reviewBody+"&#8217;"}
$topReview.find("p").html(reviewBody);$topReview.find("div.rating").addClass("rating"+Math.floor(review.Rating));}}});App=App||{};App.Homepage=App.Homepage||{};App.Homepage.Recommendations=new(function(){$(document).ready(function(){var rec={zoneId:"Home_1",categoryId:"_TS_"}});});App.Homepage.CommunityGenerator=function(){var pathToFile='//img.game.co.uk/salmon/newHomepage/community.js',$select=$('#chooseFranchise'),$franchiseContainer=$('section.community .franchiseContainer'),$mainBoxes=$franchiseContainer.find('.mainBoxes'),$medBoxes=$franchiseContainer.find('.medBoxes'),boxes={},generateBox=function(boxClass,obj){var $box=$('<a />',{class:boxClass,html:'<span>'+obj.title+'</span><img src="'+obj.img+'" alt="'+obj.title+'" />',href:obj.link});return $box;},populateBox=function(boxClass,obj){if(typeof boxes[boxClass]=='undefined'){boxes[boxClass]=generateBox(boxClass,obj);boxes[boxClass].appendTo((boxClass.indexOf('medBox')==-1)?$mainBoxes:$medBoxes);}else{var $box=boxes[boxClass];$box.attr('href',obj.link).show();$box.find('span').text(obj.title);$box.find('img').attr('src',obj.img).attr('alt',obj.title);}
if(obj.img.length==0)boxes[boxClass].hide();},populateFranchise=function(franchiseObj){for(var i in franchiseObj.boxes){populateBox(i,franchiseObj.boxes[i]);}},generateInitially=function(){var firstFranchise=HomeFranchises[Object.keys(HomeFranchises)[0]];for(var i in HomeFranchises){var title=HomeFranchises[i].title;$select.append('<option value="'+i+'">'+title+'</option>');}
populateFranchise(firstFranchise);},setupEvents=function(){$select.on('change',function(){var franchiseName=$select.val();populateFranchise(HomeFranchises[franchiseName]);});},init=function(){generateInitially();setupEvents();}
if(typeof HomeFranchises=='undefined'){var js=document.createElement("script");js.type="text/javascript";js.src=pathToFile;js.onload=function(){if(typeof HomeFranchises!='undefined')init();};document.body.appendChild(js);}else{init();}};if(Salmon.Global.FeatureToggles.getFeature('NewHOMEPAGE')){App.Homepage.CommunityGenerator();}


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z