MediaWiki:Common.js: Difference between revisions

From Screamer Wiki
Jump to: navigation, search
imported>Lawiki1534virus
(Iframe test for BitChute)
(Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: $("#iframeloader-GoodIntentions").replaceWith('<iframe src=https://www.bitchute.com/embed/UNBNbGMM1B...")
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
/* Replaces {{Username}} with the name of the user browsing the page.
$("#iframeloader-GoodIntentions").replaceWith('<iframe src=https://www.bitchute.com/embed/UNBNbGMM1B1q/ WIDTH=480 HEIGHT=360>');
  Requires copying Template:Username. */
$("#iframeloader-ABabyToy").replaceWith('<iframe src=https://www.bitchute.com/embed/7ONLxUCacy4c/ WIDTH=480 HEIGHT=360>');
$("#iframeloader-JingleBellsReversed").replaceWith('<iframe src=https://www.bitchute.com/embed/gyxTQDvlDDay/ WIDTH=480 HEIGHT=360>');
$("#iframeloader-ChrisTheJackOLantern").replaceWith('<iframe src=https://www.bitchute.com/embed/BzK2JS21Ng5l/ WIDTH=480 HEIGHT=360>');
   
   
function UserNameReplace() {
/* BitChute Player (adapted from YouTube player .js) */
     if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;
mw.hook('wikipage.content').add(function($content) {
    $("span.insertusername").html(wgUserName);
     $content.find('.bitchuteplayer:not(.loaded)').each(function() {
}
        var $this = $(this),
addOnloadHook(UserNameReplace);
            data = $this.data(),
            uri = new mw.Uri('https://www.bitchute.com/embed/'),
            id = String(data.id || '').trim();
   
   
  importArticles({
        if (id === '') {
    type: 'script',
            console.warn('[BitChute Player] Video ID is not defined.');
    articles: [
            return;
         'u:dev:MediaWiki:YoutubePlayer/code.js'
        }
     ]
        uri.path += id;
   
        $this.html(
            $('<iframe>', {
                width: String(data.width || '').trim(),
                height: String(data.height || '').trim(),
                src: uri.toString(),
            })
         ).addClass('loaded');
     });
});
});
/* End of the {{USERNAME}} replacement */
importScriptPage('InactiveUsers/code.js', 'dev');
$("#iframeloader-HitTheDot").replaceWith('<iframe src=https://www.bitchute.com/embed/AeyDEgrX8oAV/ WIDTH=480 HEIGHT=360>');

Revision as of 16:36, 19 August 2019

/* Any JavaScript here will be loaded for all users on every page load. */
$("#iframeloader-GoodIntentions").replaceWith('<iframe src=https://www.bitchute.com/embed/UNBNbGMM1B1q/ WIDTH=480 HEIGHT=360>');
$("#iframeloader-ABabyToy").replaceWith('<iframe src=https://www.bitchute.com/embed/7ONLxUCacy4c/ WIDTH=480 HEIGHT=360>');
$("#iframeloader-JingleBellsReversed").replaceWith('<iframe src=https://www.bitchute.com/embed/gyxTQDvlDDay/ WIDTH=480 HEIGHT=360>');
$("#iframeloader-ChrisTheJackOLantern").replaceWith('<iframe src=https://www.bitchute.com/embed/BzK2JS21Ng5l/ WIDTH=480 HEIGHT=360>');
 
/* BitChute Player (adapted from YouTube player .js) */
mw.hook('wikipage.content').add(function($content) {
    $content.find('.bitchuteplayer:not(.loaded)').each(function() {
        var $this = $(this),
            data = $this.data(),
            uri = new mw.Uri('https://www.bitchute.com/embed/'),
            id = String(data.id || '').trim();
 
        if (id === '') {
            console.warn('[BitChute Player] Video ID is not defined.');
            return;
        }
 
        uri.path += id;
 
        $this.html(
            $('<iframe>', {
                width: String(data.width || '').trim(),
                height: String(data.height || '').trim(),
                src: uri.toString(),
            })
        ).addClass('loaded');
    });
});