MediaWiki:Wikia.js

/* Any JavaScript here will be loaded for all users on every page load. */ /* Please don't change without Admin's permission. That means another Admin, not just you. */ // importScriptPage('MediaWiki:Wikia.js/rights-list.js', 'htmlcss'); // importScriptPage('MediaWiki:Wikia.js/to-do-list.js', 'htmlcss'); // importScriptPage('MediaWiki:Wikia.js/localScroll.js', 'htmlcss'); $.ready(function{ }); if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://vignette.wikia.nocookie.net/central/images/c/c7/B.WARNING_1.png/revision/latest?cb=20110102062219", "speedTip": "Header 1", "tagOpen": "==", "tagClose": "==", "sampleText": "Header Text" }; } if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://vignette.wikia.nocookie.net/central/images/5/54/B.WARNING_2.png/revision/latest?cb=20110102062220", "speedTip": "Header 2", "tagOpen": "===", "tagClose": "===", "sampleText": "Header Text" }; } if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://vignette.wikia.nocookie.net/central/images/4/43/Button-template.png/revision/latest?cb=20150823102547&format=webp", "speedTip": "Add template", "tagOpen": "", "sampleText": "templatename" }; } if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://vignette.wikia.nocookie.net/central/images/c/c4/Button_ref.png/revision/latest?cb=20081020123248&format=webp", "speedTip": "Add a reference", "tagOpen": " ", "sampleText": "reftext" }; } if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://vignette.wikia.nocookie.net/central/images/4/49/Button_talk.png/revision/latest?cb=20080209054415&format=webp", "speedTip": "Add a wikia user link", "tagOpen": "user:",    "tagClose": "", "sampleText": "username" }; } if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://vignette.wikia.nocookie.net/central/images/a/a4/TableStart.png/revision/latest?cb=20070927085428&format=webp", "speedTip": "Table start and end", "tagOpen": "{|", "tagClose": "|}", "sampleText": "add table code" }; } if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://vignette.wikia.nocookie.net/central/images/e/ea/Button_align_left.png/revision/latest?cb=20090417031656&format=webp", "speedTip": "Move text left", "tagOpen": " ", "tagClose": " ", "sampleText": "text" }; } if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://vignette.wikia.nocookie.net/central/images/a/a5/Button_align_right.png/revision/latest?cb=20081020112018&format=webp", "speedTip": "Move text right", "tagOpen": " ", "tagClose": " ", "sampleText": "text" }; } if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "https://vignette.wikia.nocookie.net/central/images/5/5f/Button_center.png/revision/latest?cb=20081020114414&format=webp", "speedTip": "Move text to center", "tagOpen": " ", "tagClose": " ", "sampleText": "text" }; } $(window).ready(function {       var nobr = $('#nobr'); // Use jQuery CSS-selector feature to find all elements with id="nobr".        if(nobr.length > 0){ // If there are any...            nobr.each(function { // call this function as a method of each one: var that = $(this); // Get jQuery's representation of the element (needed within the click handler). var contents = that.contents // The contents are in jQuery representation too. .replaceWith($(document.createElement('a')) // Replace them with a link...                           .attr('href', '#') // that doesn't really point anywhere and says...                            .append(document.createTextNode('Click here, but note that this will mess up the page\'s layout.'))                            .click(function (event){ // When the link is clicked...                                    that.contents.replaceWith(contents); // replace it with the original contents. event.preventDefault // And make sure that # isn't added to the URL so the Back button still works. return false; // Ignored by jQuery, but doesn't hurt; this is the non-standard way to preventDefault. // It's necessary for cross-browser compatibility when jQuery is absent. }));               });        }    }); // BEGIN JavaScript title rewrite -- jQuery version and new wikia skin fixes by Grunny function rewriteTitle { if( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) { return; }	if( $('#title-meta').length === 0 ) { return; }	var newTitle = $('#title-meta').html; if( skin == "oasis" ) { $('header.WikiaPageHeader > h1').html(' ' + newTitle + ' '); $('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html + ';'); } else { $('.firstHeading').html(' ' + newTitle + ' '); $('.firstHeading').attr('style','text-align:' + $('#title-align').html + ';'); } } function showEras(className) { if( typeof( SKIP_ERAS ) != 'undefined' && SKIP_ERAS ) return; var titleDiv = document.getElementById( className ); if( titleDiv === null || titleDiv === undefined ) return; var cloneNode = titleDiv.cloneNode(true); var firstHeading = getFirstHeading; firstHeading.insertBefore(cloneNode, firstHeading.childNodes[0]); cloneNode.style.display = "block"; } // END JavaScript title rewrite addOnloadHook(rewriteTitle); /* function fBox { $('#fbox').append(''); } $(fBox); function UserNameReplace { if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName === null) return; var n = YAHOO.util.Dom.getElementsByClassName('insertusername', 'span', document.getElementById('bodyContent')); for ( var x in n ) { n[x].innerHTML = wgUserName; } } addOnloadHook(UserNameReplace); /* // Start of SSgtGriffin's personal YouTube widget function SSgtGriffinYouTubeBox { $('#SSgtGriffinYouTubeBox').append(''); } $(SSgtGriffinYouTubeBox); // End of SSgtGriffin's personal YouTube widget // Start of the SSgtGriffin Facebook like box function SSgtGriffinFacebookBox { $('#SSgtGriffinFacebookBox').append(''); } $(SSgtGriffinFacebookBox); // End of SSgtGriffin Facebook like box function SSGfbButton { $('#SSGfbButton').append(' '); } $(SSGfbButton); // Start of SSgtGriffin's Twitter button function SSgtGriffinTwitter { $('#SSgtGriffinTwitter').append(''); } $(SSgtGriffinTwitter); // End of SSgtGriffin Twitter button /* // SSgtGriffin Twitter Widget function SSGTwitterBox { $('#SSGTwitterBox').append(' new TWTR.Widget({ version: 2, type: 'profile', rpp: 4, interval: 6000, width: 250, height: 300, theme: { shell: { background: 'black', color: 'purple' },   tweets: { background: '#000000', color: '#ffffff', links: '#4aed05' } },  features: { scrollbar: false, loop: false, live: false, hashtags: true, timestamp: true, avatars: false, behavior: 'all' } }).render.setUser('SSgtGriffin').start; '); } $(SSGTwitterBox); // End of SSgtGriffin Twitter Widget $(function {	if (wgCanonicalNamespace == 'Create') {  		var replaceParagraph = $('#WikiaArticle #mw-content-text > p');		var replaceParagraphContent = $('#WikiaArticle #mw-content-text > p').html;		if(replaceParagraphContent == "Vote on more Community Choice Awards here!") {			var replaceText = '';			replaceParagraph.html(replaceText);		}	} // 05:22, December 25, 2013 (UTC) //  });