MediaWiki:Common.js

/* */

/* Include Global Anime-Common.js Information */ importScriptURI('http://anime.wikia.com/index.php?title=MediaWiki:Anime-Common.js&action=raw&ctype=text/javascript&dontcountme=s&smaxage=86400&templates=expand');

// ArchiveTool var archiveListTemplate = 'ArchiveList'; var archivePageTemplate = 'ArchivePage'; importScriptPage('ArchiveTool/code.js', 'dev');

$(function { if ( skin === "monaco" ) {    var $siteNotice = $('#siteNotice');    $siteNotice.find('script').remove;    $siteNotice.insertBefore('#article');    $siteNotice.find('table table').appendTo($siteNotice);    $siteNotice.find('#mw-dismissable-notice').remove;  } else if ( skin === "oasis" || skin === "wikia" ) {    // START Notification Bubble Integration /*jQuery(function($) { function hasNotificationBubble { return !!$("#WikiaNotifications li").length; }	function ensureWikiaNotificationsArea { if ( $('#WikiaNotifications').length ) return; $('').prependTo('#WikiaFooter .toolbar'); }	function addNotificationBubble(msg, onclose) { var $li = $(' '); var $div = $(' ').html(msg).appendTo($li); $('') .click(function {				$(this).closest('li').remove;				if ( onclose )					onclose.apply(this, arguments);			}) .prependTo($div); ensureWikiaNotificationsArea; $li.appendTo("#WikiaNotifications"); }	function doReaderNotice(msg, id) { if ( hasNotificationBubble ) // Only display a reader bubble when nothing else is using the area return; var cookieName = "readernotice_bubble_dismiss"; if ( $.cookies.get(cookieName) === id.toString ) return; addNotificationBubble(msg, function {			$.cookies.set(cookieName, id.toString, { hoursToLive: 30*24 });		}); }	if ( $.cookies.get("readernotice_bubble_dismiss") === "1" ) { doReaderNotice('Sorry if you already answered our survey, but we had issues with the last one. If you still have time please fill out our new survey.', 2); } else { doReaderNotice('We\'d like to know what you think of Wikia\'s new look, if you have time please fill out this survey.', 2); } });*/   // END Notification Bubble Integration  } else {    $('#mw-dismissable-notice > tbody > tr > td:last').remove;  }  if( ( wgAction === "edit" && wgNamespaceNumber > -1 && wgNamespaceNumber % 2 === 0 ) || wgPageName === "Special:CreatePage" )    $(" Do not add new manga information to the wiki until the entire chapter is available. ")      .prependTo(skin === "oasis" || skin === "wikia" ? '#WikiaArticle' : '#bodyContent'); if( wgAction === "edit" && wgNamespaceNumber === 8 && wgTitle === "Monaco-sidebar" ) {    $("#bodyContent #wikiPreview ul li").each(function { var n = this; var texts = this.firstChild.nodeValue.replace(/^\s+/, "").replace(/\s+$/, "").split("|"); n.removeChild(n.firstChild); var before = n.firstChild; texts.forEach(function(text, i) {       if ( i )          n.insertBefore(document.createTextNode("|"), before);        if ( /[#:]/.test(text) )          n.insertBefore(document.createTextNode(text), before);        else          n.insertBefore($("").attr({href: wgArticlePath.replace("$1", "MediaWiki:"+text.replace(/^\s+/, ""))}).text(text)[0], before);      }); }); } });

/* Include Global Anime-Common.js Information */ importScriptURI('http://anime.wikia.com/index.php?title=MediaWiki:Anime-Common.js&action=raw&ctype=text/javascript&dontcountme=s&templates=expand');

// BEGINNING: JavaScript for placing the fair use rationale template inside the summary box on Special:Upload. Code by "wikipedia:User:Pinky49", created and coded specifically for Duty & Valour. Modified by Yyp for use on Bleach Wiki. function preloadUploadDesc { if (wgPageName.toLowerCase != 'special:upload') { return; } document.getElementById('wpUploadDescription').appendChild(document.createTextNode("")); } addOnloadHook (preloadUploadDesc) // ****** END: JavaScript for Special:Upload ******

/* Code for custom edit buttons (ō, ū characters). */ if (mwCustomEditButtons) {

/*** wrappers *****/ mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/8/8c/Button_RedX.png?1", "speedTip": "request delete", "tagOpen": "\{\{delete|reason=", "tagClose": "\}\}", "sampleText": "your reason here"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/__cb20100821183407/bleach/en/images/e/e1/O_Accent_Button.png", "speedTip": "Add the ō character", "tagOpen": "ō", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images4.wikia.nocookie.net/__cb20100821183407/bleach/en/images/d/db/U_Accent_Button.png", "speedTip": "Add the ū character", "tagOpen": "ū", "tagClose": "", "sampleText": ""}; }

/* Code for auto-adding template to all new blog posts (thanks to User:Monchoman45 @ Central Wikia for this). */ function BlogPreload { var creating = true; for(i in location.href.split('&')) { if(location.href.split('&')[i].split('=')[0] == 'article') { creating = false; }	}	if(wgPageName == 'Special:CreateBlogPage' && creating == true) { if(document.getElementById('#cke_contents_wpTextbox1') != null) { document.getElementById('cke_contents_wpTextbox1').getElementsByTagName('iframe')[0].contentDocument.getElementById('bodyContent').innerHTML = '  '; }		else { document.getElementById('wpTextbox1').innerHTML = '\n\n'; }	} }

addOnloadHook(BlogPreload); /* */