MediaWiki:Common.js

/*================================================================================

Common.js on BlazBlue Wiki. Original: Gothicpedia

Placed here JavaScript will be loaded by every user, during page loading the page.

=
==================================================================*/

//=============================================================================== // SCRIPT IMPORT // In the last line don't put a comma! //===============================================================================

importArticles({	type: "script",	articles: [ // Scripts on Wiki	"MediaWiki:Common.js/facebook.js",		/* Facebook, that one on the right side */	"MediaWiki:Common.js/userRightsIcons.js",	/* Descriptions of users groups in the user profile */	"MediaWiki:Common.js/sourceButtons.js",		/* Additional buttons in source mode */	"MediaWiki:Common.js/extraRollbacks.js",	/* Additional buttons of rollbacking - by Monchoman45 */ 	"MediaWiki:Common.js/slider.js",		/* New slider */	"MediaWiki:Common.js/editSummaries.js",		/* Edit summaries */	"MediaWiki:Common.js/addLicense.js",		/* Easy adding the license for uploaded files */	"MediaWiki:Common.js/showhide.js",		/* Dropdown tables */	"MediaWiki:Gadget-ajaxbatchdelete.js",	/* Delete many files at once - taken from Polish Elder Scrolls Wiki */ // Import scripts from other Wiki	"u:dev:VisualSpellCheck/code.js",		/* Spellcheck in visual mode */	"u:dev:BackToTopButton/code.js",		/* Back to top button */ "w:dev:ReferencePopups/code.js",               /* References */ "u:dev:ListFiles/code.js"                      /* */ "u:dev:DupImageList/code.js",			/* List of duplicated files */ "u:dev:SearchSuggest/code.js",			/* Suggestions for search results */ "u:dev:WallGreetingButton/code.js",		/* Edit button for greeting on Message Wall */ "u:dev:ListAdmins/code.js",			/* Automatic update of list of admins and bureaucrats */ "u:dev:LockOldBlogs/code.js"			/* Disables commenting on old blog posts */ ] });

//=============================================================================== // Edit button // In Monaco skin //===============================================================================

if ($('.editsection').length) { $('.editsection a:last-child').text('Edit'); }

//=============================================================================== // Corrects for user profile //===============================================================================

// Move edit button on better place $('.UserProfileActionButton').prependTo('.tabs-container').css({       marginRight: '320px',        float: 'right',        marginTop: '4px'    }); });

//=============================================================================== // Replace "a wikia contributor" with IP address // Version for admins //===============================================================================

window.RevealAnonIP = { permissions : ['rollback', 'sysop', 'bureaucrat'] }; importScriptPage('RevealAnonIP/code.js', 'dev');

//=============================================================================== // Slider jquery by Tierrie //===============================================================================

//wsl.loadScript("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"); //wsl.loadScript("http://es.maxpayne.wikia.com/index.php?title=MediaWiki:Jquery-ui.min.js&action=raw&ctype=text/javascript"); mw.loader.using( ['jquery.ui.tabs'], function { $(document).ready(function { var $tabs = $("#portal_slider").tabs({ fx: {opacity:'toggle', duration:100} } ); $("[class^=portal_sliderlink]").click(function { // bind click event to link   $tabs.tabs('select', this.className.replace("portal_sliderlink_", ""));    return false;  }); $('#portal_next').click(function {   $tabs.tabs('select', ($tabs.tabs('option', 'selected') == ($tabs.tabs('length'))-1) ? 0 : $tabs.tabs('option', 'selected') + 1 ); // switch to next tab   return false;  }); $('#portal_prev').click(function { // bind click event to link   $tabs.tabs('select', ($tabs.tabs('option', 'selected') == 0) ? ($tabs.tabs('length')-1) : $tabs.tabs('option', 'selected') - 1 ); // switch to previous tab   return false;  }); }); } );

//=============================================================================== // Warning for uploading files without license //===============================================================================

function emptyLicenseAlert(form) { var msg = "License has not been selected. You can try again, but remember, files without license will be deleted." if(window.emptyLicenseWarningDelivered) return true; if($('#wpLicense').val == '') { alert(msg); window.emptyLicenseWarningDelivered = true return false }	return true; } $('#mw-upload-form').submit(function(e) {return emptyLicenseAlert(this);});

//=============================================================================== // Useful buttons in editor // (dropdown menu of button "Preview") //=============================================================================== function EditorDropdown { $('section#EditPage nav.wikia-menu-button ul').prepend('History'); $('section#EditPage nav.wikia-menu-button ul').append('Cancel'); } addOnloadHook(EditorDropdown);

//=============================================================================== // Additional options for dropdown menu //=============================================================================== /* Import displaytitle. see that page for usage */ importScriptPage('DISPLAYTITLE/code.js', 'dev'); /* Import dup image list. see that page for usage */ importScriptPage('DupImageList/code.js', 'dev'); /* add "view source" link to edit dropdown */ importScriptPage('View_Source/code.js', 'dev'); /* add "refresh" link to edit dropdown */ importScriptPage('PurgeButton/code.js', 'dev'); /* add "search suggestions" to search results */ importScriptPage('SearchSuggest/code.js', 'dev');