User:Fngplg/global.js

window.BackToTopSpeed=500; window.BackToTopStart=1;

if (wgSiteName !== 'Borderlands Wiki') { window.nQuoteSettings = window.nQuoteSettings || {}; //window.nQuoteSettings.debug = false; window.nQuoteSettings.useQuoteTemplate = false; window.nQuoteSettings.quoteStyle = 'border-width:1px;border-style:ridge;'; mw.loader.load('http://ru.borderlands.wikia.com/index.php?title=MediaWiki:Common.js/Quotes.js&action=raw&ctype=text/javascript'); mw.loader.load('http://dev.wikia.com/index.php?title=MediaWiki:LinkPreview/code.js&action=raw&ctype=text/javascript'); } //window.pPreview = window.pPreview || {}; //pPreview.RegExp = pPreview.RegExp || {}; //pPreview.RegExp.dtag = new RegExp('(.*)','gm'); //window.pPreview.debug = true; //importArticles({type: 'script', articles: ['u:dev:deadvideo/code.js']}); /*importArticles({   type: "style",    articles: ["u:dev:LinkPreview/code.css"] });*/ //mw.loader.load('http://dev.wikia.com/index.php?title=MediaWiki:deadvideo/code.js&action=raw&ctype=text/javascript'); mw.loader.load('http://dev.wikia.com/index.php?title=MediaWiki:AjaxRC/code.js&action=raw&ctype=text/javascript'); //mw.loader.load('http://dev.wikia.com/index.php?title=MediaWiki:StarRatings/code.js&action=raw&ctype=text/javascript'); mw.loader.load('http://dev.wikia.com/index.php?title=MediaWiki:ViewRemoved/code.js&action=raw&ctype=text/javascript'); /*,{   type: "script", articles:["u:dev:LinkPreview/code.js"] });*/ //$.getScript('http://ru.borderlands.wikia.com/index.php?title=MediaWiki:Common.js/pagePreview.js&action=raw&ctype=text/javascript'); //mw.loader.load('http://ru.borderlands.wikia.com/index.php?title=MediaWiki:Common.js/pagePreview.js&action=raw&ctype=text/javascript'); //mw.loader.load('http://ru.borderlands.wikia.com/index.php?title=MediaWiki:Common.js/emo.js&action=raw&ctype=text/javascript'); //mw.loader.load('https://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-popups.js&action=raw&ctype=text/javascript'); //mw.loader.load('https://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-navpop.css&action=raw&ctype=text/css', 'text/css'); /* importScriptPage('BackToTopButton/code.js', 'dev'); //console.log('global'); //switch code editor to classic mode /* importArticles({ type: 'script', articles: [ 'u:dev:MediaWiki:CodeEditorSwitch/code.js' ] }); (function{ //test mode everywhere $('body').on('click', '.content-review-module-test-mode-enable', function(e){       e.preventDefault;        e.stopPropagation;        var data = {pageId: wgArticleId, wikiId: wgCityId, editToken: mw.user.tokens.get('editToken')};        $.nirvana.sendRequest({controller: 'ContentReviewApiController', method: 'enableTestMode', data: data, callback: function { var qs = new Wikia.Querystring; qs.addCb.goTo; },           onErrorCallback: function { console.error('test mode enabler error', arguments); }       });//sendrequest    });//onclick });//test mode everywhere

$(function {    //another jspad    function btnClick (e) {        if (e && e.preventDefault)             e.preventDefault;        gui.find('textarea').val('');        $('body').prepend(gui);        gui.show;    }//btnclick    function btnBClick (e) {        $(' ', {type: 'text/javascript', text: gui.find('textarea').val}).prependTo($('head'));        $('#ngui').remove;    }//btnbclick    var hs = '.wds-community-header__top-container .wds-community-header__wiki-buttons';    var btn = $('', {class: 'wds-button wds-is-squished wds-is-secondary', text: 'JS', href: '#', id: 'nbtnshowgui'});    var gui = $(' ', {id: 'ngui', style: 'position:absolute;left:0;top:100px;width:100%;height:90%;z-index:10000;visibility:visible;'});    var guib = $(' ', {type: 'button', class: 'wikia-button', value: 'start', id: 'nbtnstart'});    var guit = $(' ', {id: 'ntxtscript', style: 'display:block;margin: 0 5%;width:80%;height:auto;min-height:100px;max-height:80%;'}); gui.append(guib).append(guit); if ($(hs).length) { //oasis $(hs).append(btn); } else { //monobook $('#p-personal .pBody ul').append(btn); }   $('body').on('click', '#nbtnshowgui', btnClick); $('body').on('click', '#nbtnstart', btnBClick); $('body').on('keydown', '#ntxtscript', function (e) {       if (e.keyCode === 38 || e.keyCode === 40) return true; //up/down arrow        if (e.keyCode === 13) {            btnClick;            return;        }        if (!e.shiftKey && e.keyCode === 27) {            $('#ngui').remove;            return;        }        if ($('#ntxtscript').val.length > 100) $('#ntxtscript').height($('#ntxtscript').get(0).scrollHeight);    });//txt keydown });