User:UltimateSupreme/global.js

// 18:24, October 17, 2013 (UTC)

jQuery(function($) {

if (mw.config.get('wgAction') === 'delete') { $('#wpDeleteReasonList option').click(function {           $('#wpReason').focus.val('');        }); }

//Highlight whitespace characters in diffs when they're the only thing in the change if ($.getUrlVar('diff')) { $('.diffchange-inline').each(function {           if (!(new RegExp('\\S+').test($(this).text))) {                $(this).css('background-color', 'red');            }        }); }

var globalJSArticles;

try { globalJSArticles = JSON.parse(sessionStorage.getItem('globalJSArticles')); } catch (e) { globalJSArticles = null; }

var qtUserPageTemplate = '', qtEnableUserPageOverwrite = true;

if (!$.isArray(globalJSArticles)) { globalJSArticles = [ 'w:c:wikimarks:Client.js', 'w:c:dev:User:UltimateSupreme/accountnav.js', 'w:c:dev:UnsafeScripts/code.js', 'w:c:dev:TabKeyInserter/code.js', 'w:c:dev:AntiUnicruft/code.js', 'w:c:dev:AjaxUndo/code.js', 'w:c:dev:QuickCreateUserPage/code.js', 'w:c:dev:AjaxBatchDelete/code.js', 'w:c:dev:EditIntroButton/code.js', 'w:c:dev:NoImageLightbox/code.js', 'w:c:dev:SkinSwitchButton/code.js', 'w:c:dev:PortableCSSPad/code.js' ];   }

console.log("globalJSArticles =", globalJSArticles); console.log(       "\nglobalJSArticles.splice(4, 1); sessionStorage.setItem(\"globalJSArticles\", JSON.stringify(globalJSArticles)); window.location.reload;\n\nsessionStorage.removeItem(\"globalJSArticles\"); window.location.reload;\n");

importArticles({       type: 'script',        articles: globalJSArticles    });

if (mw.config.get('skin') === 'monobook') { mw.loader.load(           '//commons.wikimedia.org/w/index.php?title=MediaWiki:JSValidator.js&action=raw&ctype=text/javascript');

mw.loader.load(           'https://raw.github.com/Krinkle/mw-gadgets-jsUpdater/master/src/jsUpdater.js');

// Ugly hack to make search work mw.loader.using('jquery.ui.autocomplete', function {           $('#searchInput').autocomplete({ minLength: 2, source: function(request, response) { $.getJSON(                       mw.util.wikiScript('api'), {                        format: 'json',                        action: 'opensearch',                        search: request.term                    }, function(arr) {                        if (arr && arr.length > 1) {                            response(arr[1]);                        } else {                            response([]);                        }                    }); }           });        });    } });