|
|
| (92 dazwischenliegende Versionen von 4 Benutzern werden nicht angezeigt) |
| Zeile 1: |
Zeile 1: |
| /* <nowiki> */ | | // For [[Module:CSS]]; [[T:CSS]] dependency |
| | | mw.hook("wikipage.content").add(function () { |
| /* ######################################################################## */
| | $("span.import-css").each(function () { |
| /* ### JavaScript here is loaded for all users and all skins. ### */
| | mw.util.addCSS($(this).attr("data-css")); |
| /* ######################################################################## */
| | }); |
| | |
| /* ######################################################################## */
| |
| /* ### SKRIPTLADER ### */
| |
| /* ### ---------------------------------------------------------------- ### */
| |
| /* ### Beschreibung: Lädt alle anderen Skripte. ### */
| |
| /* ### Credit: Benutzer:Porter21 ### */
| |
| /* ######################################################################## */
| |
|
| |
| // Globale Variablen einrichten
| |
| var fwConfig = {
| |
| chevronDown: '<span class="fw-chevron-down"></span>',
| |
| chevronLeft: '<span class="fw-chevron-left"></span>',
| |
| chevronRight: '<span class="fw-chevron-right"></span>',
| |
| chevronUp: '<span class="fw-chevron-up"></span>',
| |
| loadIndicator: '<img src="' + mw.config.get('stylepath') + '/common/images/ajax-loader.gif' + '" style="vertical-align: middle;" width="16" height="16" border="0" title="Im Gang..." alt="Im Gang..." />'
| |
| };
| |
|
| |
| // Lade Skripte
| |
| function fwScriptLoader () { | |
| // Always loaded
| |
| addTitleIcons();
| |
| fancyTooltips();
| |
|
| |
| // Only loaded for specific namespaces
| |
| if (mw.config.get('wgNamespaceNumber') > 0 && mw.config.get('wgNamespaceNumber') % 2 != 0) {
| |
| // Diskussionsseiten
| |
| disableArchiveEdit();
| |
| }
| |
|
| |
| if (mw.config.get('wgNamespaceNumber') == 112 || mw.config.get('wgIsMainPage')) {
| |
| // Portale
| |
| addCountdowns();
| |
| }
| |
|
| |
| if (mw.config.get('wgNamespaceNumber') == 115) {
| |
| wikilogCommentImprovements();
| |
| }
| |
|
| |
| // Only loaded for specific pages
| |
| if (mw.config.get('wgTitle') == 'Duplicate files' && mw.config.get('wgNamespaceNumber') == 4) {
| |
| findDupFiles();
| |
| }
| |
| }
| |
|
| |
| jQuery(function($) {
| |
| fwScriptLoader();
| |
| }); | | }); |
|
| |
| /* ######################################################################## */
| |
| /* ### TITLE ICONS (Vorlage:Spiele) ### */
| |
| /* ### ---------------------------------------------------------------- ### */
| |
| /* ### Beschreibung: Fügt Icons zum Artikeltitel hinzu ### */
| |
| /* ### Credit: User:Porter21 ### */
| |
| /* ######################################################################## */
| |
|
| |
| function addTitleIcons () {
| |
| var iconBar = $('#fw-titleicons');
| |
| var previewBar = $('#fw-titleicons-preview');
| |
|
| |
| if (mw.config.get('skin') != 'wikia' &&
| |
| mw.config.get('skin') != 'monobook'
| |
| ) {
| |
| return;
| |
| }
| |
|
| |
| if (iconBar.length > 0 && $('a', previewBar).length > 0) {
| |
| switch (mw.config.get('skin')) {
| |
| case 'monobook':
| |
| case 'wikia':
| |
| var firstHeading = $('#firstHeading').css({'overflow': 'visible', 'position': 'relative'});
| |
|
| |
| if (firstHeading.length > 0) {
| |
| iconBar.css('display', 'block').appendTo(firstHeading.css('padding-right', previewBar.width() + 25));
| |
| }
| |
| break;
| |
| }
| |
|
| |
| $('#fw-titleicons-more').append(fwConfig.chevronDown);
| |
|
| |
| iconBar.hover(
| |
| function () {
| |
| $(this).addClass('fw-titleicons-hover');
| |
| }, function () {
| |
| $(this).removeClass('fw-titleicons-hover');
| |
| });
| |
| }
| |
| }
| |
|
| |
| /* ######################################################################## */
| |
| /* ### FANCY TOOLTIPS (Vorlage:Icon, Template:Infobox, ### */
| |
| /* ### Vorlage:Tooltip) ### */
| |
| /* ### ---------------------------------------------------------------- ### */
| |
| /* ### Beschreibung: Nicer-looking tooltips using jQuery.tipsy ### */
| |
| /* ### Credit: User:Porter21 ### */
| |
| /* ######################################################################## */
| |
|
| |
| function fancyTooltips () {
| |
| var ftTooltipsE = $('.fw-infobox-tooltip-cell');
| |
| var ftTooltipsS = $('.fw-icon, .fw-tooltip');
| |
|
| |
| if (ftTooltipsE.length || ftTooltipsS.length) {
| |
| mw.loader.using('jquery.tipsy', function () {
| |
| if (ftTooltipsE.length) {
| |
| // Tooltip appears to the left of the element
| |
| ftTooltipsE.tipsy({gravity: 'e'});
| |
| }
| |
| if (ftTooltipsS.length) {
| |
| // Tooltip appears above the element
| |
| ftTooltipsS.tipsy({gravity: 's'});
| |
| }
| |
| });
| |
| }
| |
| }
| |
|
| |
| /* ######################################################################## */
| |
| /* ### COLLAPSIBLE TABLES ### */
| |
| /* ### ---------------------------------------------------------------- ### */
| |
| /* ### Description: Allow tables to be collapsible ### */
| |
| /* ### Credit: http://en.wikipedia.org/wiki/MediaWiki:Common.js ### */
| |
| /* ### Customized for Fallout Wiki by User:Porter21 ### */
| |
| /* ######################################################################## */
| |
|
| |
| /* **************************************
| |
| * Test if an element has a certain class
| |
| * Description: Uses regular expressions and caching for better performance.
| |
| * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
| |
| */
| |
|
| |
| var hasClass = (function () {
| |
| var reCache = {};
| |
| return function (element, className) {
| |
| return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
| |
| };
| |
| })();
| |
|
| |
| /** *********************************************************
| |
| * Collapsible tables
| |
| * Description: Allows tables to be collapsed, showing only the header. See
| |
| * [[Wikipedia:NavFrame]].
| |
| * Maintainers: [[User:R. Koot]]
| |
| */
| |
|
| |
| var autoCollapse = 1;
| |
| var collapseCaption = "Einklappen";
| |
| var expandCaption = "Ausklappen";
| |
| var enableCollapsing = true;
| |
|
| |
| function collapseTable(tableIndex) {
| |
| var Button = document.getElementById( "collapseButton" + tableIndex );
| |
| var Table = document.getElementById( "collapsibleTable" + tableIndex );
| |
|
| |
| if ( !Table || !Button ) {
| |
| return false;
| |
| }
| |
|
| |
| var Rows = Table.rows;
| |
|
| |
| if ( Button.firstChild.data == collapseCaption ) {
| |
| for ( var i = 1; i < Rows.length; i++ ) {
| |
| Rows[i].style.display = "none";
| |
| }
| |
| Button.firstChild.data = expandCaption;
| |
| } else {
| |
| for ( var i = 1; i < Rows.length; i++ ) {
| |
| Rows[i].style.display = Rows[0].style.display;
| |
| }
| |
| Button.firstChild.data = collapseCaption;
| |
| }
| |
| }
| |
|
| |
| function createCollapseButtons() {
| |
| var tableIndex = 0;
| |
| var collapseIndex = 0;
| |
| var NavigationBoxes = new Object();
| |
| var Tables = document.getElementsByTagName( "table" );
| |
|
| |
| for ( var i = 0; i < Tables.length; i++ ) {
| |
| if ( hasClass( Tables[i], "collapsible" ) ) {
| |
|
| |
| /* only add button and increment count if there is a header row to work with */
| |
| var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
| |
| if (!HeaderRow) continue;
| |
| var Header = HeaderRow.getElementsByTagName( "th" )[0];
| |
| if (!Header) continue;
| |
|
| |
| NavigationBoxes[ tableIndex ] = Tables[i];
| |
| Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
| |
|
| |
| var Button = document.createElement( "span" );
| |
| var ButtonLink = document.createElement( "a" );
| |
| var ButtonText = document.createTextNode( collapseCaption );
| |
|
| |
| Button.style.styleFloat = "right";
| |
| Button.style.cssFloat = "right";
| |
| Button.style.fontWeight = "normal";
| |
| Button.style.textAlign = "right";
| |
| Button.style.width = "6em";
| |
| Button.className = "t_show_hide";
| |
|
| |
| ButtonLink.style.color = Header.style.color;
| |
| ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
| |
| ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
| |
| ButtonLink.appendChild( ButtonText );
| |
|
| |
| Button.appendChild( document.createTextNode( "[" ) );
| |
| Button.appendChild( ButtonLink );
| |
| Button.appendChild( document.createTextNode( "]" ) );
| |
|
| |
| Header.insertBefore( Button, Header.childNodes[0] );
| |
|
| |
| if ( !hasClass( Tables[i], "nocount" ) ) {
| |
| collapseIndex++;
| |
| }
| |
| tableIndex++;
| |
| }
| |
| }
| |
|
| |
| for ( var i = 0; i < tableIndex; i++ ) {
| |
| if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( collapseIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
| |
| collapseTable( i );
| |
| }
| |
| else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {
| |
| var element = NavigationBoxes[i];
| |
| while (element = element.parentNode) {
| |
| if ( hasClass( element, "outercollapse" ) ) {
| |
| collapseTable ( i );
| |
| break;
| |
| }
| |
| }
| |
| }
| |
| }
| |
| }
| |
|
| |
| /* ######################################################################## */
| |
| /* ### AJAX RC ### */
| |
| /* ### ---------------------------------------------------------------- ### */
| |
| /* ### Description: Automatically refresh "Recent changes" via AJAX ### */
| |
| /* ### Credit: User:pcj (original) ### */
| |
| /* ### User:Grunny (bug fixes) ### */
| |
| /* ######################################################################## */
| |
|
| |
| var ajaxIndicator = stylepath + '/common/progress-wheel.gif';
| |
| var ajaxPages = new Array("Special:RecentChanges", "Special:WikiActivity", "The_Vault:WikiActivity");
| |
| var ajaxCallAgain = [];
| |
| var ajaxTimer;
| |
| var ajaxRefresh = 60000;
| |
| var refreshText = 'Auto-refresh';
| |
| var refreshHover = 'Enable auto-refreshing page loads';
| |
| var doRefresh = true;
| |
|
| |
| /**
| |
| * Sets the cookie
| |
| * @param c_name string Name of the cookie
| |
| * @param value string 'on' or 'off'
| |
| * @param expiredays integer Expiry time of the cookie in days
| |
| */
| |
| function setCookie(c_name, value, expiredays) {
| |
| var exdate = new Date();
| |
| exdate.setDate(exdate.getDate() + expiredays);
| |
| document.cookie = c_name + "=" + escape(value) + ((expiredays === null) ? "" : ";expires=" + exdate.toGMTString());
| |
| }
| |
|
| |
| /**
| |
| * Gets the cookie
| |
| * @param c_name string Cookie name
| |
| * @return The cookie name or empty string
| |
| */
| |
| function getCookie(c_name) {
| |
| if (document.cookie.length > 0) {
| |
| var c_start = document.cookie.indexOf(c_name + "=");
| |
| if (c_start !== -1) {
| |
| c_start = c_start + c_name.length + 1;
| |
| var c_end = document.cookie.indexOf(";", c_start);
| |
| if (c_end === -1) {
| |
| c_end = document.cookie.length;
| |
| }
| |
| return unescape(document.cookie.substring(c_start, c_end));
| |
| }
| |
| }
| |
| return "";
| |
| }
| |
|
| |
| /**
| |
| * Main function to start the Auto-refresh process
| |
| */
| |
| function preloadAJAXRL() {
| |
| var ajaxRLCookie = (getCookie("ajaxload-" + wgPageName) == "on") ? true : false;
| |
| var appTo = ($('#WikiaPageHeader' ).length) ? $('#WikiaPageHeader > h1') : ($('#AdminDashboardHeader').length ? $('#AdminDashboardHeader > h1') : $('.firstHeading'));
| |
|
| |
| appTo.append(' <span style="font-size: xx-small; line-height: 100%;" id="ajaxRefresh"><span style="border-bottom: 1px dotted; cursor: help;" id="ajaxToggleText" title="' + refreshHover + '">' + refreshText + ':</span><input type="checkbox" style="margin-bottom: 0;" id="ajaxToggle"><span style="display: none;" id="ajaxLoadProgress"><img src="' + ajaxIndicator + '" style="float: none; vertical-align: baseline;" border="0" alt="Refreshing page" /></span></span>');
| |
|
| |
| $('#ajaxLoadProgress').ajaxSend(function(event, xhr, settings) {
| |
| if (location.href == settings.url) {
| |
| $(this).show();
| |
| }
| |
| } ).ajaxComplete(function(event, xhr, settings) {
| |
| if (location.href == settings.url) {
| |
| $(this).hide();
| |
| for(i in ajaxCallAgain) {
| |
| ajaxCallAgain[i]();
| |
| }
| |
| }
| |
| } );
| |
|
| |
| $('#ajaxToggle').click(toggleAjaxReload).attr('checked', ajaxRLCookie);
| |
|
| |
| if (getCookie("ajaxload-" + wgPageName) == "on") {
| |
| loadPageData();
| |
| }
| |
| }
| |
|
| |
| /**
| |
| * Turn refresh on and off by toggling the checkbox
| |
| */
| |
| function toggleAjaxReload() {
| |
| if ($('#ajaxToggle').prop('checked') == true) {
| |
| setCookie("ajaxload-" + wgPageName, "on", 30);
| |
| doRefresh = true;
| |
| loadPageData();
| |
| } else {
| |
| setCookie("ajaxload-" + wgPageName, "off", 30);
| |
| doRefresh = false;
| |
| clearTimeout(ajaxTimer);
| |
| }
| |
| }
| |
|
| |
| /**
| |
| * Does the actual refresh
| |
| */
| |
| function loadPageData() {
| |
| var cC = ($('#WikiaArticle').length ) ? '#WikiaArticle' : '#bodyContent';
| |
| $(cC).load(location.href + " " + cC + " > *", function (data) {
| |
| if (doRefresh) {
| |
| ajaxTimer = setTimeout("loadPageData();", ajaxRefresh);
| |
| }
| |
| });
| |
| }
| |
|
| |
| /* ######################################################################## */
| |
| /* ### DISABLE ARCHIVE EDIT ### */
| |
| /* ### ---------------------------------------------------------------- ### */
| |
| /* ### Description: Remove section edit links and gray out main edit ### */
| |
| /* ### button on archived talk pages ### */
| |
| /* ### Credit: User:Porter21 ### */
| |
| /* ######################################################################## */
| |
|
| |
| function disableArchiveEdit () {
| |
| // Configuration
| |
| var userconfig = (window.DisableArchiveEditConfig) ? window.DisableArchiveEditConfig : {};
| |
| var config = $.extend(true, {
| |
| archiveSubpage: 'Archive',
| |
| disableCompletely: false,
| |
| textColor: '#D9D9D9',
| |
| userLang: false,
| |
| // English
| |
| en: {
| |
| archived: "Archived",
| |
| archivedTooltip: "This page is an archive and should not be edited."
| |
| }
| |
| }, userconfig);
| |
|
| |
| // Function for multi-language support (by Daniel Friesen aka User:Dantman)
| |
| function msg(name) {
| |
| if ( config.userLang && wgUserLanguage in config && name in config[wgUserLanguage] )
| |
| return config[wgUserLanguage][name];
| |
| if ( wgContentLanguage in config && name in config[wgContentLanguage] )
| |
| return config[wgContentLanguage][name];
| |
| return config.en[name];
| |
| }
| |
|
| |
| // Check whether page is an archive
| |
| if ((new RegExp('\\/\[' + config.archiveSubpage.substr(0,1).toUpperCase()
| |
| + config.archiveSubpage.substr(0,1).toLowerCase() + '\]' + config.archiveSubpage.substr(1)
| |
| + '\\s\*\\d\*')).test(wgTitle)) {
| |
| // Remove "add new section" links and prepare altering "edit" page control
| |
| switch (skin) {
| |
| case 'monaco':
| |
| $('#control_addsection').remove();
| |
| $('#fe_newsection').remove();
| |
|
| |
| editlink = $('#ca-edit');
| |
| break;
| |
| case 'monobook':
| |
| $('#ca-addsection').remove();
| |
|
| |
| editlink = $('#ca-edit > a');
| |
| break;
| |
| case 'oasis':
| |
| case 'wikia':
| |
| var oasisButton = $(((wgNamespaceNumber == 3) ? '#WikiaUserPagesHeader' : '#WikiaPageHeader') + ' > ul.wikia-menu-button > li');
| |
|
| |
| oasisButton.children("a:first").prependTo($('ul:first', oasisButton)).wrap('<li />').children('img').remove();
| |
| oasisButton.prepend('<a />');
| |
| $('a[data-id="addtopic"]', oasisButton).parent().remove();
| |
|
| |
| editlink = $('a:first', oasisButton);
| |
| break;
| |
| }
| |
|
| |
| // Remove "edit section" links
| |
| $('span.editsection').remove();
| |
|
| |
| // Alter "edit" page control
| |
| if (config.disableCompletely) {
| |
| editlink.remove();
| |
| } else {
| |
| editlink.attr('title', msg('archivedTooltip')).css('color', config.textColor).text(msg('archived'));
| |
| }
| |
| }
| |
| }
| |
|
| |
| /* ######################################################################## */
| |
| /* ### COUNTDOWN ### */
| |
| /* ### ---------------------------------------------------------------- ### */
| |
| /* ### Description: Adds countdown to specific date to a page. ### */
| |
| /* ### (jQuery version of http://dev.wikia.com/Countdown) ### */
| |
| /* ### Credit: User:Splarka (original) ### */
| |
| /* ### User:Porter21 (jQuery version) ### */
| |
| /* ######################################################################## */
| |
|
| |
| // Usage example:
| |
| // <span class="countdown" style="display:none;">January 01 2020 00:00:00 PST</span>
| |
|
| |
| function updateCountdowns(targets, countdowns) {
| |
| var now = new Date();
| |
|
| |
| now = now.getTime();
| |
|
| |
| countdowns.each(function(i) {
| |
| var diff = Math.floor((targets[i]-now)/1000);
| |
|
| |
| // determine plus/minus
| |
| if (diff < 0 ) { diff = -diff; }
| |
|
| |
| // convert the difference into readable formatting
| |
| var left = (diff%60) + ' seconds';
| |
|
| |
| diff = Math.floor(diff/60);
| |
| if (diff > 0) { left = (diff%60) + ' minutes ' + left; }
| |
| diff = Math.floor(diff/60);
| |
| if (diff > 0) { left = (diff%24) + ' hours ' + left; }
| |
| diff = Math.floor(diff/24);
| |
| if (diff > 0) { left = diff + ' days ' + left; }
| |
|
| |
| $(this).text(left);
| |
| });
| |
|
| |
| setTimeout(function() { updateCountdowns(targets, countdowns); }, 1000);
| |
| }
| |
|
| |
| function addCountdowns() {
| |
| var targets = [];
| |
| var countdowns = $('span.countdown').filter(function() {
| |
| var content = $(this).text();
| |
| var converted = new Date(content);
| |
|
| |
| if (content == "" || isNaN(converted)) {
| |
| return false;
| |
| } else {
| |
| $(this).css("display", "inline");
| |
| targets[targets.length] = converted.getTime();
| |
| return true;
| |
| }
| |
| });
| |
|
| |
| if (targets.length <= 0) {
| |
| return;
| |
| }
| |
|
| |
| updateCountdowns(targets, countdowns);
| |
| }
| |
|
| |
| /* ######################################################################## */
| |
| /* ### DUPLICATE FILE LIST ### */
| |
| /* ### ---------------------------------------------------------------- ### */
| |
| /* ### Description: Finds duplicate files on the wiki. ### */
| |
| /* ### Credit: User:pcj (http://www.wowpedia.org) ### */
| |
| /* ######################################################################## */
| |
|
| |
| function findDupFiles(gf) {
| |
| var fileDiv = $('#mw-dupfiles');
| |
|
| |
| if (fileDiv.length) {
| |
| dil = new Array();
| |
| ajaxIndicator = stylepath + '/common/progress-wheel.gif';
| |
| output = '';
| |
| url = '/api.php?action=query&generator=allimages&prop=duplicatefiles&gailimit=500&format=json';
| |
|
| |
| if (!($('#dupFilesProgress').length)) {
| |
| fileDiv.prepend('<span style="float: right;" id="dupFilesProgress" title="In progress..."><img src="' + ajaxIndicator + '" style="vertical-align: baseline;" border="0" alt="In progress..." /></span>');
| |
| }
| |
|
| |
| if (gf) {
| |
| url += "&gaifrom=" + gf;
| |
| }
| |
|
| |
| $.getJSON( url, function (data) {
| |
| if ( data.query ) {
| |
| pages = data.query.pages;
| |
|
| |
| for (pageID in pages) {
| |
| dils = "," + dil.join();
| |
|
| |
| if ( dils.indexOf("," + pages[pageID].title) == -1
| |
| && pages[pageID].title.indexOf("File::") == -1 && pages[pageID].duplicatefiles ) {
| |
| output += "<h3><a href='/wiki/" + encodeURIComponent(pages[pageID].title).replace(/'/g, "%27") + "'>" + pages[pageID].title + "</a></h3>\n<ul>\n";
| |
|
| |
| for ( x = 0; x < pages[pageID].duplicatefiles.length; x++ ) {
| |
| output += "<li><a href='/wiki/File:" + encodeURIComponent(pages[pageID].duplicatefiles[x].name).replace(/'/g, "%27") + "'>File:" + pages[pageID].duplicatefiles[x].name + "</a></li>\n";
| |
| dil.push("File:" + pages[pageID].duplicatefiles[x].name.replace(/_/g, " "));
| |
| }
| |
| output += "</ul>\n\n"
| |
| }
| |
| }
| |
|
| |
| fileDiv.append(output);
| |
|
| |
| if (data["query-continue"]) {
| |
| setTimeout("findDupFiles('" + encodeURIComponent(data["query-continue"].allimages.gaifrom).replace(/'/g, "%27") + "');", 5000);
| |
| } else {
| |
| $('#dupFilesProgress').hide();
| |
| }
| |
| }
| |
| } );
| |
| }
| |
| }
| |
|
| |
| /* ######################################################################## */
| |
| /* ### CHAT IMPROVEMENTS ### */
| |
| /* ### ---------------------------------------------------------------- ### */
| |
| /* ### Description: Improvements for Special:Chat ### */
| |
| /* ### Credit: User:Porter21 ### */
| |
| /* ######################################################################## */
| |
|
| |
| function openChatWindow() {
| |
| vaultChatWindow = window.open('/wiki/Special:Chat', 'wikiachat', 'width=600, height=600, location=no, menubar=no, resizable=yes, scrollbars=no, status=no, toolbar=no');
| |
| return vaultChatWindow;
| |
| }
| |
|
| |
| function rewriteChatLink() {
| |
| $('#WikiHeader > nav > ul > li > ul.subnav > li > a[href="/wiki/Special:Chat"]').click(function(e){
| |
| openChatWindow();
| |
| return false;
| |
| });
| |
| }
| |
|
| |
| /* ######################################################################## */
| |
| /* ### JQUERY AJAX PATROL LINKS ### */
| |
| /* ### ---------------------------------------------------------------- ### */
| |
| /* ### Description: Mark pages as patrolled via AJAX ### */
| |
| /* ### Credit: User:Grunny (http://dev.wikia.com) ### */
| |
| /* ######################################################################## */
| |
|
| |
| function ajaxPatrolLinks() {
| |
| var ajaxIndicator = stylepath + '/common/progress-wheel.gif';
| |
| var patrolLinks = $('.patrollink');
| |
|
| |
| if(!patrolLinks.length) {
| |
| return;
| |
| }
| |
|
| |
| patrolLinks.click(function (e) {
| |
| var curLink = $(this);
| |
| var curURL = curLink.children('a').attr('href');
| |
|
| |
| e.preventDefault();
| |
| curLink.html('<img src="' + ajaxIndicator + '" style="vertical-align: baseline;" border="0" alt="Marking as patrolled..." />');
| |
| $.get(curURL, function (data) {
| |
| curLink.css('color', 'grey').text('[Marked as patrolled]');
| |
| });
| |
| });
| |
| }
| |
|
| |
| /* ######################################################################## */
| |
| /* ### SCRIPT LOADER ### */
| |
| /* ### ---------------------------------------------------------------- ### */
| |
| /* ### Description: Loads all the other scripts ### */
| |
| /* ### Credit: User:Porter21 ### */
| |
| /* ######################################################################## */
| |
|
| |
| function fwScriptLoader () {
| |
| // Always loaded
| |
| addCountdowns();
| |
| if (enableCollapsing) {
| |
| createCollapseButtons();
| |
| }
| |
| rewriteChatLink();
| |
|
| |
| // Only loaded for specific namespaces
| |
| if ((wgNamespaceNumber === 0 || wgNamespaceNumber == 4 || wgNamespaceNumber == 110 || wgNamespaceNumber == 502) &&
| |
| (!mw.config.get('wgIsMainPage'))) {
| |
| addTitleIcons();
| |
| }
| |
|
| |
| if (wgNamespaceNumber%2 != 0 && wgNamespaceNumber != 501) {
| |
| archiveTool();
| |
| disableArchiveEdit();
| |
| }
| |
|
| |
| // Only loaded for specific pages
| |
| if (wgPageName == 'Fallout_Wiki:Dateiduplikate') {
| |
| findDupFiles();
| |
| }
| |
|
| |
| for (x in ajaxPages) {
| |
| if (wgPageName == ajaxPages[x] && $("#ajaxToggle").length==0) {
| |
| preloadAJAXRL();
| |
| }
| |
| }
| |
| }
| |
|
| |
| jQuery(function($) {
| |
| fwScriptLoader();
| |
| });
| |
|
| |
| // install [[Wikipedia:User:Cacycle/wikEd]] in-browser text editor
| |
|
| |
| document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
| |
|
| |
| + '&action=raw&ctype=text/javascript"></' + 'script>');
| |
|
| |
| /* </nowiki> */
| |