Użytkownik:SH3VEK/monobook.js: Różnice pomiędzy wersjami
Z Nonsensopedii, polskiej encyklopedii humoru
(Wielka czystka) Znacznik: edytor źródłowy |
M Znacznik: edytor źródłowy |
||
Linia 1: | Linia 1: | ||
window.os_animateChangeWidth=function(){return 1;}; |
|||
/* STYLE */ |
/* STYLE */ |
||
$("<style>"+ |
$("<style>"+ |
||
"#content{transition: background-color .5s .25s, margin-left .5s .25s; z-index: 4;} #p-cactions .pBody{transition: margin-left .5s .25s;} #content.wide, #p-cactions .pBody.wide{margin-left: 0 !important;} #p-logo{transition: width .5s .25s, height .5s .25s;} #p-logo a{transition: width .5s .25s, height .5s .25s; background-size: contain;} #p-logo.wide, #p-logo.wide a{width: 45px !important; height: 45px !important;}"+ |
"#content{transition: background-color .5s .25s, margin-left .5s .25s; z-index: 4;} #p-cactions .pBody{transition: margin-left .5s .25s;} #content.wide, #p-cactions .pBody.wide{margin-left: 0 !important;} #p-logo{transition: width .5s .25s, height .5s .25s;} #p-logo a{transition: width .5s .25s, height .5s .25s; background-size: contain;} #p-logo.wide, #p-logo.wide a{width: 45px !important; height: 45px !important;}"+ |
||
".yt-iframe iframe{width: 100%; height: 100%;}"+ |
|||
"#p-search.stickpart{position: fixed !important; top: 4px !important;}"+ |
"#p-search.stickpart{position: fixed !important; top: 4px !important;}"+ |
||
"</style>").appendTo("head"); |
"</style>").appendTo("head"); |
Aktualna wersja na dzień 17:57, 16 cze 2017
window.os_animateChangeWidth=function(){return 1;};
/* STYLE */
$("<style>"+
"#content{transition: background-color .5s .25s, margin-left .5s .25s; z-index: 4;} #p-cactions .pBody{transition: margin-left .5s .25s;} #content.wide, #p-cactions .pBody.wide{margin-left: 0 !important;} #p-logo{transition: width .5s .25s, height .5s .25s;} #p-logo a{transition: width .5s .25s, height .5s .25s; background-size: contain;} #p-logo.wide, #p-logo.wide a{width: 45px !important; height: 45px !important;}"+
"#p-search.stickpart{position: fixed !important; top: 4px !important;}"+
"</style>").appendTo("head");
$(function(){
$("a.video[itemprop='video']").click(function(e){e.preventDefault();var slf=this;new mw.Api().get({action:"query",titles:"Plik:"+$(slf).children("img").data("video-name"),prop:"imageinfo",iiprop:"metadata",indexpageids:""}).done(function(e){var id=e.query.pageids[0],v=e.query.pages[id].imageinfo[0].metadata.filter(function(e){return "name" in e&&e.name=="videoId";})[0].value;$(slf).before("<iframe style=\"width: 100%; height: 100%;\" src=\"//www.youtube-nocookie.com/embed/"+v+"?rel=0&modestbranding=1&autohide=1&autoplay=1\" frameborder=\"0\" allowfullscreen></iframe>").remove();});});
/* Przełączane boczne menu */
addPortletLink("p-cactions","#","Przełącz","p-wide","Przełącza widok bocznego menu");
$("#p-wide a").click(function(e){e.preventDefault();$("#content, #p-cactions .pBody, #p-logo").toggleClass("wide");});
window.addEventListener("scroll",function(e){$("#p-search")[e.pageY>=46?"addClass":"removeClass"]("stickpart");});
});