2dee55c10543ff4b3c231cb2b56cb12fc1150f43f1bed89add69538f50b5a4fe

Source Code:

var currentTitle,currentDuration,currentRating,currentThumb,vKeyAddVideo,menuPosition,menu=document.querySelector(".add-to-playlist-menu"),playlistMenu=document.querySelector(".playlist-option-menu"),playlist_menu_fading=!1,thumbScroll=0,showOverlay=function(e){var t=e.target||e.srcElement,l=t.querySelector(".linkWrapper"),s=t.querySelector(".add-to-playlist-icon"),n=t.querySelector(".not-interested-button");l&&(MG_Utils.addClass(l.querySelector(".borderLink"),"hoverPL"),l.querySelector(".playAllLink").style.display="block",l.querySelector(".viewPlaylistLink").style.display="block"),s&&!t.closest(".innerHeaderSubMenu")&&"false"==disablePlaylistPlusButon&&MG_Utils.removeClass(s,"display-none"),(menuPosition=menu?MG_Utils.offset(menu).left:null)&&0<menuPosition&&(MG_Utils.hasClass(menu,"display-none")||MG_Utils.addClass(menu,"display-none"),activePlaylists()),n&&(MG_Utils.removeClass(n.parentNode,"display-none"),MG_Utils.addClass(n,"active"))},hideOverlay=function(e){function t(){n&&!s.closest(".innerHeaderSubMenu")&&(MG_Utils.hasClass(n.parentNode,"display-none")||(MG_Utils.addClass(n.parentNode,"display-none"),MG_Utils.removeClass(n,"active"))),i&&(MG_Utils.hasClass(i.parentNode,"display-none")||(MG_Utils.addClass(i.parentNode,"display-none"),MG_Utils.removeClass(i,"active"))),a&&(MG_Utils.removeClass(a.querySelector(".borderLink"),"hoverPL"),a.querySelector(".playAllLink").style.display="none",a.querySelector(".viewPlaylistLink").style.display="none")}function l(){menu&&(MG_Utils.hasClass(menu,"display-none")||MG_Utils.addClass(menu,"display-none"),activePlaylists()),MG_Utils.hasClass(s.parentNode,"active")&&MG_Utils.removeClass(s.parentNode,"active")}var s=e.target||e.srcElement,n=s.querySelector(".open-playlist-link"),a=s.querySelector(".linkWrapper"),i=s.querySelector(".not-interested-button"),o=menu?MG_Utils.offset(menu).left:null,r=e.clientX,u=e.clientY,d=document.elementFromPoint(r,u);menu&&!s.closest(".innerHeaderSubMenu")&&0<o?MG_Utils.hasClass(d.parentNode,"add-to-playlist-menu")||MG_Utils.closest(d,".add-to-playlist-menu")?MG_Utils.addEventHandler(menu,"mouseleave",function(e){t(),l()}):MG_Utils.hasClass(d.parentNode,"add-to-playlist-menu")||(t(),l()):t()},addToSubmenu=function(t){var e,l,s=t.target||t.srcElement;playlist_menu_fading=clearTimeout(playlist_menu_fading)&&!1,MG_Utils.hasClass(s,"open-playlist-link")&&(vKeyAddVideo=s.getAttribute("data-rel"),currentTitle=MG_Utils.nextElementSibling(s.parentNode).querySelector("a").innerHTML,currentDuration=s.parentNode.parentNode.querySelector(".marker-overlays").querySelector(".duration").innerHTML,currentRating=MG_Utils.nextElementSibling(s.parentNode).querySelector(".value")?parseInt(MG_Utils.nextElementSibling(s.parentNode).querySelector(".value").innerHTML)/20:"",currentThumb=MG_Utils.previousElementSibling(s.parentNode).querySelector("img")&&MG_Utils.previousElementSibling(s.parentNode).querySelector("img").getAttribute("data-smallthumb")?MG_Utils.previousElementSibling(s.parentNode).querySelector("img").getAttribute("data-smallthumb"):"",menu.querySelector(".custom-playlist")&&menu.querySelector(".custom-playlist").querySelectorAll("li").length&&(menu.querySelector("#scrollParent").style.borderBottom="1px solid #313131"),hideShowMenu(s,menu),MG_Utils.hasClass(menu,"fadeOut")&&MG_Utils.removeClass(menu,"fadeOut"),thumbScroll||(MG_Scroll.init({selector:document.querySelectorAll("#scrollThumbs"),height:"auto",color:"#7d7c7c",size:"7px",alwaysVisible:!0,railVisible:!0,railOpacity:1,railColor:"#222",distance:0,opacity:1,railClass:"track4",barClass:"handle4",wrapperClass:"wrapper4"}),thumbScroll=1)),MG_Utils.hasClass(s,"not-interested-button")&&(e=s.getAttribute("data-url"),l={id:s.getAttribute("data-rel"),value:0,token:s.getAttribute("data-token"),type:s.getAttribute("data-type")},$j.ajax({type:"POST",url:e,data:l,success:function(e){successCallback(e,t)},error:errorCallback}))};MG_Utils.domReady(function(){document.body.addEventListener("mouseenter",function(e){var t=e.target;t&&MG_Utils.hasClass(t,"wrap")&&showOverlay(e)},!0),document.body.addEventListener("mouseleave",function(e){var t=e.target;t&&MG_Utils.hasClass(t,"wrap")&&hideOverlay(e)},!0),document.body.addEventListener("click",function(e){var t=e.target;t&&(MG_Utils.hasClass(t,"open-playlist-link")||MG_Utils.hasClass(t,"not-interested-button"))&&addToSubmenu(e)})});var hideShowMenu=function(e,t){e&&t&&(MG_Utils.hasClass(e,"active")?(MG_Utils.removeClass(e,"active"),MG_Utils.addClass(t,"display-none")):MG_Utils.hasClass(e,"active")||(activePlaylists(),MG_Utils.addClass(e,"active"),MG_Utils.removeClass(t,"display-none"),positionMenu(e,t)))},positionMenu=function(e,t){var l,s,n;e&&t&&(t.style.top=MG_Utils.offset(e).top+27+"px",t.style.left=MG_Utils.offset(e).left+"px",l=t.getBoundingClientRect(),s=window.innerWidth,(n=t.offsetLeft+t.clientLeft+l.width)&&s<n&&(t.style.top=MG_Utils.offset(e).top+27+"px",t.style.left=MG_Utils.offset(e).left-245+"px"))},playlist_menu_fadeout=function(){playlist_menu_fading=playlist_menu_fading&&(clearTimeout(playlist_menu_fading)&&!1),playlist_menu_fading=setTimeout(function(){MG_Utils.addClass(menu,"fadeOut"),activePlaylists()},2e3)},successCallback=function(e,t){var l,s,n;"OK"==e&&t.target&&(l=findAncestor(t.target,"videoBox"),s=findAncestor(t.target,"wrap"),l&&(n=l.querySelector(".not-interested-overlay"),l.style.pointerEvents="none"),s&&(n=s.querySelector(".not-interested-overlay"),s.style.pointerEvents="none"),n&&(n.style.display="block"))};function findAncestor(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e}function errorCallback(e,t,l){alert("something went wrong  "+e+" "+t+" "+l)}var hideSubmenu=function(e){var t=e.target||e.srcElement,l=document.querySelector(".zoom.active");MG_Utils.hasClass(t,"open-playlist-link")||menu&&!MG_Utils.hasClass(menu,"display-none")&&(t.closest(".add-to-playlist-menu")?activePlaylists():l?MG_Utils.removeClass(l,"active"):(activePlaylists(),MG_Utils.hasClass(menu,"display-none")||MG_Utils.addClass(menu,"display-none"))),playlistMenu&&!t.closest(".playlist-option-menu")&&t.parentNode!=document.querySelector("#options")&&t!=document.querySelector("#options")&&MG_Utils.addClass(playlistMenu,"display-none")};MG_Utils.addEventHandler(document,"mouseup",hideSubmenu);var activePlaylists=function(e){var t=document.querySelector(".open-playlist-link.active"),l=document.querySelector(".not-interested-button.active");if(void 0===e){if(menu.querySelector(".custom-playlist")&&menu.querySelector(".custom-playlist").querySelectorAll("li").length){var s=menu.querySelector(".custom-playlist").querySelectorAll("li.added");if(s)for(var n=0;n<s.length;n++){MG_Utils.removeClass(s[n],"added");var a=s[n].querySelector("span");a&&(a.textContent="")}}menu.querySelector(".quicklick.added")&&MG_Utils.removeClass(menu.querySelector(".quicklick.added"),"added")}t&&(MG_Utils.removeClass(t,"active"),MG_Utils.addClass(t.parentNode,"display-none")),l&&(MG_Utils.removeClass(l,"active"),MG_Utils.addClass(l.parentNode,"display-none"))};window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,l=(this.document||this.ownerDocument).querySelectorAll(e),s=this;do{for(t=l.length;0<=--t&&l.item(t)!==s;);}while(t<0&&(s=s.parentElement));return s}),document.querySelector("#commentPlaylist")&&MG_Utils.addEventHandler(document.querySelector("#commentPlaylist"),"click",function(e){var t=document.querySelector("#videoPlaylist"),l=t.querySelectorAll("li").length<=8?1e3:500;MG_Utils.addClass(t,"stopLazyload");var s=MG_Utils.offset(document.querySelector("#cmtPlaylist")).top;$j("html, body").animate({scrollTop:s},l,function(){setTimeout(function(){MG_Utils.removeClass(t,"stopLazyload")},50)})});var htmlWrapper,isMacLike=navigator.platform.match(/Mac/i);!isMacLike||(htmlWrapper=document.querySelector("html"))&&MG_Utils.addClass(htmlWrapper,"macintosh");