Actions

MediaWiki

MediaWiki:Common.js

From KAYŌ 💖 DAY

Revision as of 15:17, 16 July 2019 by Dachy (talk | contribs)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. */

$(function () {

    var pipingUrl
    if ($('.image').length > 0) {
        var selectedImage = $('.image')[Math.ceil(Math.random() * $('.image').length) - 1].href
        $.get(selectedImage, function (data) {
            pipingUrl = $(data).find('.fullImageLink a').attr('href')
            if ($('.piping').length === 0) {
                $('#page-content').before('<div class="piping"></div>')
                $('footer').after('<div class="piping"></div>')
            }
            $('.piping').css({
                'height': $('.top-bar').height(),
                'background': 'url(' + pipingUrl + ') center center/cover no-repeat',
            })
        })
    }

    $('.record-label').each(function () {
        if ($(this).text() === '†') {
            $(this).remove()
        }
    })

}())