MediaWiki:Common.js: verschil tussen versies
Naar navigatie springen
Naar zoeken springen
k |
|||
(11 tussenliggende versies door 3 gebruikers niet weergegeven) | |||
Regel 5: | Regel 5: | ||
url: 'https://hackalot.nl/statejson', | url: 'https://hackalot.nl/statejson', | ||
}).done(function(res) { | }).done(function(res) { | ||
− | jQuery("<div id=spacestatus class="+(res.state.open ? "open" : "closed")+"></div>").appendTo(jQuery("#p-logo")); | + | jQuery("<div id=spacestatus class='"+(res.state.open ? "open" : "closed")+(RLCONF['wgUserName']?' loggedin':'')+"'></div>").appendTo(jQuery("#p-logo")); |
}); | }); | ||
if ($("#kiekjes").length) { | if ($("#kiekjes").length) { | ||
− | $.get("/kiekjes/latest?amount=1", function (data) { | + | $.get("https://kiekjes.hackalot.nl/latest?amount=1", function (data) { |
var item = data.latest[0]; | var item = data.latest[0]; | ||
$("#kiekjes").find('img').attr('src', 'https://kiekjes.hackalot.nl' + item.thumbnail) | $("#kiekjes").find('img').attr('src', 'https://kiekjes.hackalot.nl' + item.thumbnail) | ||
+ | $("#kiekjes").find('img').attr('srcset', 'https://kiekjes.hackalot.nl' + item.thumbnail) | ||
}); | }); | ||
} | } | ||
+ | |||
+ | var elsa_images = [ | ||
+ | "000034.3509722891.jpeg", | ||
+ | "000016.4106135923.jpeg", | ||
+ | "000017.1900970595.jpeg", | ||
+ | "000017.2225146150.jpeg", | ||
+ | "000017.2269763487.jpeg", | ||
+ | "000017.3168357051.jpeg", | ||
+ | "000017.3917283196.jpeg", | ||
+ | "000017.4237592611.jpeg", | ||
+ | "000018.3804424912.jpeg", | ||
+ | "000019.4.jpeg", | ||
+ | "000019.21545514.jpeg", | ||
+ | "000019.630065297.jpeg", | ||
+ | "000019.981422875.jpeg", | ||
+ | "000019.1013818839.jpeg", | ||
+ | "000023.314951548.jpeg", | ||
+ | "000023.1165879329.jpeg", | ||
+ | "000023.2001993259.jpeg", | ||
+ | "000023.2251487474.jpeg", | ||
+ | "000023.4162803750.jpeg", | ||
+ | "000024.310645646.jpeg", | ||
+ | "000024.671694223.jpeg", | ||
+ | "000024.687804783.jpeg", | ||
+ | "000024.2318442972.jpeg", | ||
+ | "000024.2413145236.jpeg", | ||
+ | "000024.2755543690.jpeg", | ||
+ | "000024.3003636429.jpeg", | ||
+ | "000024.3845741777.jpeg", | ||
+ | "000024.3920287907.jpeg", | ||
+ | "000025.228604922.jpeg", | ||
+ | "000025.2006798362.jpeg", | ||
+ | "000025.2340620712.jpeg", | ||
+ | "000025.2871873945.jpeg", | ||
+ | "000025.3107163712.jpeg", | ||
+ | "000025.3166144486.jpeg", | ||
+ | "000025.3367540098.jpeg", | ||
+ | "000025.3441188098.jpeg", | ||
+ | "000025.3479745169.jpeg", | ||
+ | "000025.3488524781.jpeg", | ||
+ | "000025.3591600378.jpeg", | ||
+ | "000025.3652975010.jpeg", | ||
+ | "000025.4199874461.jpeg", | ||
+ | "000026.46832705.jpeg", | ||
+ | "000026.982748219.jpeg", | ||
+ | "000026.2147366994.jpeg", | ||
+ | "000026.3416595094.jpeg", | ||
+ | "000027.454303868.jpeg", | ||
+ | "000027.2761374706.jpeg", | ||
+ | "000027.4031353450.jpeg", | ||
+ | "000029.611281597.jpeg", | ||
+ | "000029.2146377237.jpeg", | ||
+ | "000029.3180855652.jpeg", | ||
+ | "000029.3583395620.jpeg", | ||
+ | "000034.279635133.jpeg", | ||
+ | ] | ||
+ | |||
+ | function random_stable_diffusion_logo_image() { | ||
+ | if (!RLCONF['wgUserName']) { | ||
+ | return; | ||
+ | } | ||
+ | var parentDOM = document.getElementById("p-logo"); | ||
+ | var logo = parentDOM.getElementsByClassName("mw-wiki-logo")[0]; | ||
+ | var image = elsa_images[Math.floor(Math.random()*elsa_images.length)]; | ||
+ | logo.style.backgroundImage = 'url(/images/5/5f/Hackalot_side_wiki_logo_with_resolution.png), url(https://hackalot.nl/sdimages/'+ image +')'; | ||
+ | logo.style.backgroundSize = 'cover'; | ||
+ | logo.classList.add('loggedin'); | ||
+ | } | ||
+ | |||
+ | random_stable_diffusion_logo_image() |
Huidige versie van 25 sep 2022 om 18:08
/* JavaScript die hier wordt geplaatst heeft invloed op alle pagina's voor alle gebruikers */ jQuery.ajax({ method: 'GET', url: 'https://hackalot.nl/statejson', }).done(function(res) { jQuery("<div id=spacestatus class='"+(res.state.open ? "open" : "closed")+(RLCONF['wgUserName']?' loggedin':'')+"'></div>").appendTo(jQuery("#p-logo")); }); if ($("#kiekjes").length) { $.get("https://kiekjes.hackalot.nl/latest?amount=1", function (data) { var item = data.latest[0]; $("#kiekjes").find('img').attr('src', 'https://kiekjes.hackalot.nl' + item.thumbnail) $("#kiekjes").find('img').attr('srcset', 'https://kiekjes.hackalot.nl' + item.thumbnail) }); } var elsa_images = [ "000034.3509722891.jpeg", "000016.4106135923.jpeg", "000017.1900970595.jpeg", "000017.2225146150.jpeg", "000017.2269763487.jpeg", "000017.3168357051.jpeg", "000017.3917283196.jpeg", "000017.4237592611.jpeg", "000018.3804424912.jpeg", "000019.4.jpeg", "000019.21545514.jpeg", "000019.630065297.jpeg", "000019.981422875.jpeg", "000019.1013818839.jpeg", "000023.314951548.jpeg", "000023.1165879329.jpeg", "000023.2001993259.jpeg", "000023.2251487474.jpeg", "000023.4162803750.jpeg", "000024.310645646.jpeg", "000024.671694223.jpeg", "000024.687804783.jpeg", "000024.2318442972.jpeg", "000024.2413145236.jpeg", "000024.2755543690.jpeg", "000024.3003636429.jpeg", "000024.3845741777.jpeg", "000024.3920287907.jpeg", "000025.228604922.jpeg", "000025.2006798362.jpeg", "000025.2340620712.jpeg", "000025.2871873945.jpeg", "000025.3107163712.jpeg", "000025.3166144486.jpeg", "000025.3367540098.jpeg", "000025.3441188098.jpeg", "000025.3479745169.jpeg", "000025.3488524781.jpeg", "000025.3591600378.jpeg", "000025.3652975010.jpeg", "000025.4199874461.jpeg", "000026.46832705.jpeg", "000026.982748219.jpeg", "000026.2147366994.jpeg", "000026.3416595094.jpeg", "000027.454303868.jpeg", "000027.2761374706.jpeg", "000027.4031353450.jpeg", "000029.611281597.jpeg", "000029.2146377237.jpeg", "000029.3180855652.jpeg", "000029.3583395620.jpeg", "000034.279635133.jpeg", ] function random_stable_diffusion_logo_image() { if (!RLCONF['wgUserName']) { return; } var parentDOM = document.getElementById("p-logo"); var logo = parentDOM.getElementsByClassName("mw-wiki-logo")[0]; var image = elsa_images[Math.floor(Math.random()*elsa_images.length)]; logo.style.backgroundImage = 'url(/images/5/5f/Hackalot_side_wiki_logo_with_resolution.png), url(https://hackalot.nl/sdimages/'+ image +')'; logo.style.backgroundSize = 'cover'; logo.classList.add('loggedin'); } random_stable_diffusion_logo_image()