MediaWiki:Chat.js

var sfNotifications = {}; sfNotifications.options = { audio: 'http://images.wikia.com/monchbox/images/0/01/Beep-sound.ogg', caseInsensitive: true, highlight: true, highlightColor: 'red', notification: true, ping: true, pings: ["Foo", "Bar", "Baz"], regex: false, window: false }; importArticles({   type: 'script',    articles: [        'u:dev:ChatOptions/code.js',		'u:dev:ChatNotifications/code.js',		'u:dev:ChatModHover/code.js',		'u:dev:ChatTags/code.js',		'u:dev:ChatReload/code.js',		'u:dev:jumbles/startup.js',		'u:dev:SpellingBee/startup.js'    ] }); /* * Replace picture URL with picture * By AnimatedCartoons * Supported picture formats: .jpg, .jpeg, .png, .gif, .bmp, and .svg */ setInterval(function {    "use strict";    var $jpg = $('.Chat .message a[href$=".jpg"]').text,        $jpeg, $png, $gif, $bmp, $svg;    $('.Chat .message a[href$=".jpg"]').replaceWith('');    $jpeg = $('.Chat .message a[href$=".jpeg"]').text;    $('.Chat .message a[href$=".jpeg"]').replaceWith('');    $png = $('.Chat .message a[href$=".png"]').text;    $('.Chat .message a[href$=".png"]').replaceWith('');    $gif = $('.Chat .message a[href$=".gif"]').text;    $('.Chat .message a[href$=".gif"]').replaceWith('');    $bmp = $('.Chat .message a[href$=".bmp"]').text;    $('.Chat .message a[href$=".bmp"]').replaceWith('');    $svg = $('.Chat .message a[href$=".svg"]').text;    $('.Chat .message a[href$=".svg"]').replaceWith(''); }, 1);

/** * Replace YouTube video or playlist URL with YouTube video or playlist * Copyright © 2012, User:AnimatedCartoons */ setInterval(function {    "use strict";    var $video1 = $('.Chat .message a[href*="www.youtube.com/watch?v="]').text,        video2 = $video1.replace('www.youtube.com/watch?v=', 'www.youtube-nocookie.com/embed/'),        video3,        $playlist1 = $('.Chat .message a[href*="www.youtube.com/playlist?list="]').text,        playlist2 = $playlist1.replace('www.youtube.com', 'www.youtube-nocookie.com/embed'),        playlist3;    if (video2.indexOf('http://') === 0) {        video3 = video2.slice(7);    } else if (video2.indexOf('https://') === 0) {        video3 = video2.slice(8);    } else if (playlist2.indexOf('http://') === 0) {        playlist3 = playlist2.slice(7);    } else if (playlist2.indexOf('https://') === 0) {        playlist3 = playlist2.slice(8);    }    $('.Chat .message a[href*="www.youtube.com/watch?v="]').replaceWith(' '); $('.Chat .message a[href*="www.youtube.com/playlist?list="]').replaceWith(' '); }, 1);

/** * Replace Wikipedia article URL with Wikipedia article * By AnimatedCartoons */ setInterval(function {    "use strict";    var $wiki1 = $('.Chat .message a[href*="wikipedia.org"]').text,        wiki2 = $wiki1.replace('wikipedia.org', 'm.wikipedia.org'),        wiki3;    if (wiki2.indexOf('http://') === 0) {        wiki3 = wiki2.slice(7);    } else if (wiki2.indexOf('https://') === 0) {        wiki3 = wiki2.slice(8);    }    $('.Chat .message a[href*="wikipedia.org"]').replaceWith(' '); }, 1);