User:Sophiedp/global.js

/* Remove the part of the url that opens the editor on redlinks */ var head = $('a[href$="?action=edit&redlink=1"]'); if ($('a[href$="?action=edit&redlink=1"]').attr("href")) { head.attr("href", head.attr("href").replace("?action=edit&redlink=1", "")); } /* Hide the footer */ mw.util.addCSS('.wds-global-footer { display: none; }');

/* Link to report thread on suwiki */ $('', {id: 'report'}) .html('Report Thread') .prependTo('.toolbar .tools') .click(function {   window.location.hash = $('.SpeechBubble.message').last.attr('id'); });

/* Link to subpages in my tools menu */ $('', {id: 'subpages'}) .html('Subpages') .prependTo('.toolbar .tools');

/* Disable site js */ $('', {id: 'nositejs'}) .html('No Site JS') .prependTo('#my-tools-menu');

/* Disable 5 sec edit save delay */ GlobalTriggers.bind("WikiaEditorReady", function(point) { if (point.controls) {    point.controls.editform.off("submit").on("submit", function { point.setState(3); }); } });

/* * Name:       UnhideUserWikis * Description: Unhides hidden user wikis in masthead and appends the edit count * Author:     KockaAdmiralac <1405223@gmail.com> */ $(function {   if($('#UserProfileMasthead').length === 0) {        return;    }    $.getJSON(mw.util.wikiScript('api'), { action: 'query', list: 'users', ususers: $('.masthead-info hgroup h1').text, format: 'json' }, function(d) { var u = d.query.users; if(u && u[0] && u[0].userid) { $.getJSON(mw.util.wikiScript('wikia'), {               controller: 'UserProfilePageController',                method: 'renderLightbox',                userId: u[0].userid,                format: 'json'            }, function(da) {                if(da && da.user && da.user.topWikis && da.user.topWikis.length > 0) {                    $('.masthead-info-lower .wikis').remove;                    var el = $(''),                        tw = da.user.topWikis;                    for(var i in tw) {                        if(tw.hasOwnProperty(i)) {                            var w = tw[i];                            el.append( $('') .append(                                       $('')                                            .attr('href', w.wikiUrl)                                            .text(w.wikiName + ' (' + w.edits + ')')                                    ) );                       }                    }                    $('.masthead-info-lower').append( $('') .attr('class', 'wikis') .append(                           $(' ')                              .text('My favorite wikis')                          ) .append(el) );               }            });        }    }); });

/* PageCreator settings */ window.pageCreatorAvatar = true;

/* Staff/VSTF/Bot/Helper highlights */ importStylesheetPage('Highlight/code.css', 'dev');

/* WLB highlights */ importStylesheetPage('MediaWiki:WLBhighlight.css', 'wlb');

/* Imports */ importArticles({   type: "script",    articles: [        'u:dev:MediaWiki:CacheCheck/code.js',        'u:dev:MediaWiki:MarkBlocked.js',        'u:dev:MediaWiki:AjaxRC/code.js',        'u:dev:MediaWiki:LastEdited/code.js',        'u:dev:MediaWiki:AjaxUndo/code.js',        'u:dev:MediaWiki:PageCreator/code2.js',        'u:dev:MediaWiki:HoverEditCount/code.js',        'u:dev:MediaWiki:QuickDiff/code.js',        'u:dev:MediaWiki:UserAccountAge/code.js',        'u:dev:MediaWiki:ContribsLink/code.js',        'u:dev:MediaWiki:DupImageList/code.js',        'u:dev:MediaWiki:DisplayTimer/code.js',        'u:dev:MediaWiki:Linksweeper/code.js',        'u:dev:MediaWiki:RecentChangesMultiple/code.2.js'    ] });