User:Rurin/timeless.js
From Tardis Wiki, the free Doctor Who reference
Clear your cache often around here
After changes are made to this site's CSS or Javascript, you have to bypass your browser's cache to see the changes. You can always do this by going to your browser's preferences panel. But many browsers also offer keyboard shortcuts to save you that trouble. The following shortcuts work in the versions of the browsers that Tardis currently supports. They may not work in earlier versions.
- Firefox: hold down Shift while performing a page reload.
- Opera offers no default keyboard shortcut, but you can create a custom keyboard shortcut with the value Clear disk cache
- Safari users should simultaneously hold down ⌘ + Option + E. You may need to enable the Develop menu first
- Chrome: press Ctrl + F5 or Shift + F5 while performing a page reload.
/* ############################################ */
/* ### ProfileTags ### */
/* ### User:RurinGas ### */
/* ############################################ */
$(function ($) {
'use strict';
var conf = mw.config.get([
'wgTitle'
]);
var params = {
action: 'raw',
title: 'MediaWiki:ProfileTags'
};
$.get(mw.util.wikiScript(), params, function (data) {
if (!data.length) {
return;
}
var escapeRegExp = mw.util.escapeRegExp || (mw.RegExp || {}).escape,
user = escapeRegExp(conf.wgTitle),
re = new RegExp('(?:^|\\n)\\s*' + user + '\\s*\\|\\s*(.*?)\\s*(?:\\n|$)'),
match = re.exec(data);
if (match !== null) {
var profileTags = match[1].split(/\s*,\s*/);
insertTextString(profileTags);
}
});
function insertTextString(profileTags) {
var tardisProfileTag = document.createElement("p");
tardisProfileTag.id = 'tardisProfileTag';
var textToInsert = 'TARDIS';
tardisProfileTag.innerHTML = textToInsert;
$('.mw-page-title-main').append(tardisProfileTag);
}
});