User:Emperor Jarjarkine/global.js

importScriptPage( 'AjaxDiff/code.js', 'dev' ); importArticles({   type: 'script',    articles: [         'u:dev:View_Source/code.js'    ] });

importScriptPage('MediaWiki:Gadget-purgebutton.js', 'starwars'); importScriptPage('MediaWiki:Gadget-ajaxundo.js', 'starwars'); importScriptPage('MediaWiki:Gadget-inactiveusers..js', 'starwars'); importArticles({    type: 'script',     articles: [         'u:dev:Quick_Management/code.js'     ] });

importScriptPage('WHAM/code.2.js', 'dev'); importScriptPage('ContribsLink/code.js', 'dev'); importArticles( {    type: 'script',     articles: [         // ...         'u:dev:LastEdited/code.js',         // ...     ] } ); importArticles({   type: 'script',    articles: [        // ...        'w:c:dev:ReferencePopups/code.js',        // ...    ] });

/** * Ajoute les contributions et la liste de suivi au menu déroulant des comptes utilisateurs * Auteur original inconnu * * Autres auteurs : Ryan PM et Cqm de RuneScape Wiki + Hulothe */ (function ($, console, document, rswiki) {   'use strict';    // make sure the gadgets property exists

rswiki.gadgets = rswiki.gadgets || {}; rswiki.gadgets.addContribs = function { $('#AccountNavigation > li > .subnav > li:first-child').after(           $('').attr({ 'id': 'MyContribs' }).append( $('').attr({                   'href': '/wiki/Special:MyContributions'                }).text('Contributions') ),           $('').attr({ 'id': 'Liste' }).append( $('').attr({                   'href': 'http://starwars.wikia.com/wiki/Special:WikiActivity'                }).text('Wook') ),           $('').attr({ 'id': 'ct' }).append( $('').attr({                   'href': 'http://starwars.wikia.com/wiki/Wookieepedia:Consensus_track'                }).text('CT') ),

$('').attr({               'id': 'TC'            }).append(                $('').attr({ 'href': 'http://starwars.wikia.com/wiki/Wookieepedia:Trash_compactor' }).text('TC')           ) );   };    $(rswiki.gadgets.addContribs); }(this.jQuery, this.console, this.document, this.rswiki = this.rswiki || {}));

var nom_utilisateur_courant = mw.config.get( 'wgUserName' ); var lien_page_discu = "/wiki/User_talk:"+nom_utilisateur_courant; $('.sprite.close-notification + a:contains("de nouveaux messages")').attr('href',lien_page_discu); $('a[data-id*="mytalk"]').attr('href',lien_page_discu);

//

/** * Originally from https:////en.wikipedia.org/wiki/User:Ucucha/duplinks.js * * Modified to work in both the Wikia and Monobook skins */ $( function($) {   if((wgNamespaceNumber != 0) && (wgNamespaceNumber != 2)) {        // only check links in mainspace and userspace (for userspace drafts)        return;    }    var portletlink;    if ( mw.config.get( 'skin' ) === 'monobook' ) {        portletlink = mw.util.addPortletLink('p-tb', '#', 'Highlight duplicate links', 'ca-findduplicatelinks');    } else {        portletlink = $( '' ).append( $( '' ).attr( 'href', '#' ).text( 'Highlight duplicate links' ) );        $( '#WikiaBarWrapper' ).find( '#my-tools-menu' ).prepend( portletlink );    }    $(portletlink).click( function(e) { e.preventDefault; // create a separate div surrounding the lead // first get the element immediately surrounding the article text. Unfortunately, MW doesn't seem to provide a non-fragile way for that. var content = ".mw-content-ltr"; $(content).prepend(document.createElement('div')); var lead = $(content).children[0]; $(lead).attr('id', 'lead'); $(content).children.each( function {           if(this.nodeName.toLowerCase == 'h2') {                return false;            }            if($(this).attr('id') != 'lead') {                $(lead).append(this);            }            return true;        }); // detect duplicate links mw.util.addCSS(".duplicate-link { border: 1px solid red; }"); var finddups = function { var href = $(this).attr('href'); if(href != undefined && href.indexOf('#') != 0) { if(seen[href]) { $(this).addClass("duplicate-link"); }               else { seen[href] = true; }           }            return true; };       // array to keep track of whether we've seen a link before var seen = []; mw.util.$content.find('p a').not('#lead *, .infobox *, .navbox *').each(finddups); var seen = []; mw.util.$content.find('#lead p a').not('.infobox *, .navbox *').each(finddups); }); } );

importScriptPage('MultipleFileDelete/code.js', 'dev'); importScriptPage("MediaWiki:Gadget-HotCat.js","a"); importScriptPage("CategoryRenameAuto-update/code.js", "dev");

/****************************************************************************** * Auteur : Think D. Solucer                                                ** * Idée : Flo121297                                                         ** * Basé sur le script : AjaxBatchDelete (du dev wikia)                      ** * Crédits:                                                                 ** * @Splarka (Wikipedia)                                                     ** * @Grunny                                                                  ** * @Ozuzanna                                                                ** * @Ransomtime                                                              ** * Pour l'utiliser :                                                        ** * importScriptPage('Utilisateur:Think_D._Solucer/MultiM.js', 'fr.onepiece');** * Pour ajouter un groupe par défaut (avant l'import !) :                   ** * var groupe_multim=['pseudo1','pseudo2', 'pseudo3', etc.];                ** * Exemple avec le groupe "Flo", "Homard", "Matt", "Lia"                    ** *                                                                          ** * var groupe_multim=['Flo','Homard', 'Matt', 'Lia'];                        ** * importScriptPage('Utilisateur:Think_D._Solucer/MultiM.js', 'fr.onepiece');**

if (console) console.log('Script MultiM (v1.05) en marche !');

if ( $(".wikia-msg-snd-multi").length ) return; var li_envois='MULTIM'; $(".buttons").prepend(li_envois); importArticle({           type: "style",            article: "u:fr.onepiece:User:Think_D._Solucer/MultiM.css"        }); var FormHTML = '\  \ \   Titre de la section: \  \ \ \		 Votre message (signé !): \ \			 \ \     Mettez les noms des personnes à qui envoyer votre message séparés par des virgules. . \        \ <div id="text-error-output" style="height:10em; width: 80%; margin: 5px auto 0px auto; color: #000; background-color: #ffbfbf; height: 150px; border: 1px solid black; font-weight: bold; overflow: scroll">Toute erreur produite sera affichée ici. \   \  ',  token = mw.user.tokens.get('editToken'), delay = 1000; $('.wikia-msg-snd-multi').click(function {    $.showCustomModal('Ajax Multi Messages', FormHTML, { id: 'form-multi-snd', width: 800, buttons: [{ message: 'Annuler', handler: function { $('#form-multi-snd').closeModal; }     }, {          message: 'Ajouter un groupe', defaultButton: true, handler: function { ajoutGroupe; }     }, {          id: 'startButton', message: 'Envoyer le message', defaultButton: true, handler: function { init; }     }, {          message:'Ajout le groupe par défaut', defaultButton: true, handler: function{ if ( groupe_multim[0].length ) for (var i in groupe_multim) $('#perso-multi-snd').append(groupe_multim[i]+','); }     }]    });  });    function init { var txt = document.getElementById('perso-multi-snd'), multi_message = document.getElementById('text-multi-snd').value, titre_du_message = document.getElementById('titre-multi-snd').value, personnes = txt.value.split(','), personne_actuelle = personnes[0]; if (!multi_message) { alert('Merci de mettre un message à envoyer !'); return; }     document.getElementById('startButton').setAttribute('disabled','disabled'); if (!personne_actuelle) { document.getElementById('startButton').removeAttribute("disabled"); $.showCustomModal('Fini !', 'J\'ai envoyé à tout le monde normalement.', {          id: 'multi-snd-complete',           width: 200,           buttons: [{              message: 'Fermer',              defaultButton: true,              handler: function {                 $('#multi-snd-complete').closeModal;              }           }]        }); }      else { poster_message(personne_actuelle,multi_message, titre_du_message); }     personnes = personnes.slice(1,personnes.length); txt.value = personnes.join(','); }  function choisirBonGroupe(groupe) {       switch(groupe) {               case 'administrateur': bon_groupe='sysop'; break; case 'robot': bon_groupe='bot'; break; case 'bureaucrate': bon_groupe='bureaucrat'; break; case 'tous': bon_groupe='*'; break; case 'rollback': bon_groupe='rollback'; break; default: return groupe; }           return bon_groupe; }   function ajoutGroupe { var groupe = prompt('Merci d\'entrer le nom du groupe (en miniscule !)'); bon_groupe=choisirBonGroupe(groupe); new mw.Api.get({     action: 'query',      list: 'allusers',      augroup: bon_groupe,      }) .done(function(d) {       if (!d.error) {          var data = d.query;        for (var i in data.allusers) {            $('#perso-multi-snd').append((data.allusers[i]).name+',');          }        }        else {          $('#text-error-output').append('Echec lors du chargement des membres du groupe des '+ groupe +' : '+ d.error.code +' ');        }      }) .fail(function {       $('#text-error-output').append('Echec lors du chargements  du groupe des '+ groupe +'! ');     });    }     function poster_message(personne,msg, titre) { new mw.Api.post({     format      : 'json',      action      : 'edit',      title       : 'Discussion_utilisateur:'+personne,      section     : 'new',      sectiontitle: titre,      text        : msg,      token       : token      }) .done(function(d) {        if (!d.error) {          console.log('Envoi du message à '+personne+' réussi !');        } 	else {          console.log('Echec d\'envoi du message à  '+personne+': '+ d.error.code);          $('#text-error-output').append('Echec d\'envoi du message à  '+personne+': '+d.error.code+' ');        }      }) .fail(function {       console.log('Echec d\'envoi du message à  '+personne+': unknownerror');        $('#text-error-output').append('Echec d\'envoi du message à  '+personne+': unknownerror ');      }); setTimeout(init,delay); } }) (this.jQuery, this.mediaWiki);
 * (function($, mw) {

importScriptPage('ChatOptions/code.js', 'dev'); importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); importScriptPage('User:Joeytje50/ChatPMs.js', 'c'); importScriptPage('MessageBlocker/code.js', 'dev'); importScriptPage("User:Madnessfan34537/multikick.js","cod"); importScriptPage('User:Madnessfan34537/quickban.js', 'callofduty'); importArticles({   type: 'script',    articles: [        'u:dev:WHAM/code.2.js',        'u:dev:QuickDelete/code.js',        'u:dev:FastDelete/code.js',        'u:dev:MassRename/code.js',        'u:dev:AjaxBatchDelete/code.2.js'    ] });

AjaxDiff = { expiry: "3 days", reason: "Spam" };

importArticles({   type: 'script',    articles: [        'u:dev:PortableCSSPad/code.js',        'u:dev:MiniComplete/code.js',        'u:wikimarks:Client.js',        'u:dev:View_Source/code.js',        'u:fr.harrypotter:Mediawiki:Contribs.js',        'u:dev:PageMakerPro/code.js',        'u:dev:QQX/code.js',        'u:dev:PurgeButton/code.js',        'u:dev:AutoEditDropdown/code.js',        'u:dev:CategoryRenameAuto-update/code.js',        'u:fr.harrypotter:MediaWiki:CdT.js',        'u:dev:AjaxDiff/code.js',        'u:dev:FindAndReplace/code.js',        'u:dev:LastEdited/code.js'     ] });

//Edit count tab $(function {   var loc = window.location.href;    var username = (wgTitle == "Contributions") ? loc.substring(loc.lastIndexOf("/")+1) : wgTitle;    $('.tabs-container > ul.tabs').append('<li data-id="editcount">Editcount</a></li>'); });

/* Wikimarks */ addOnloadHook( function {    $( '.WikiNav .wikimarks-logo' ).html( 'Outils' ); } );

//Special CSS controller jQuery(function ($) {   if (mw.config.get('wgCanonicalSpecialPageName') === 'CSS') {        $(".css-editor").prepend(" 100% ");    }    var countcss = 0;    $("#buttom-css").click(function  { countcss += 1; if (countcss == 1) { $(this).text("Default"); $(".css-editor-wrapper").css("width", "100%"); $(".css-side-bar").css("display", "none"); $(".ace_gutter").css("display", "none"); $(".ace_scroller").css("left", "0px"); }       if (countcss == 2) { $(this).text("100%"); $(".css-editor-wrapper").css("width", "auto"); $(".css-side-bar").css("display", "block"); $(".ace_gutter").css("display", "block"); $(".ace_scroller").css("left", "49px"); countcss = 0 }   }); });

var lien = '<li>Factory</a></li>'; var lien2 = '<li>C.C.</a></li>'; var lien3 = '<li>WLB</a></li>'; $('.toolbar > ul.tools').append(lien).append(lien2).append(lien3);

importScriptPage('User:Monchoman45/ChatHacks.js', 'c');

/* var specialpages = [ "Special:BrokenRedirects", "Special:DoubleRedirects", "Special:DeadendPages", "Special:BrokenRedirects", "Special:LonelyPages", "Special:UnusedFiles", "Special:UnusedTemplates" ]; if (specialpages.indexOf(mw.config.get('wgPageName')) !== -1) { $('#WikiaArticle').prepend('<textarea id="output-box" rows="10" cols="100"> '); if ("Special:UnusedFiles".indexOf(wgPageName) !== -1) { $('div.thumb img').each(function {       $('#output-box').append('File:'+$(this).attr('data-image-name')+'\n')}); } else { $('ol.special').find('li').each(function {       var text = $(this).find('a').first.text;        document.getElementById('output-box').value += text + '\n';}); } }
 * Display a list of text for certain special pages
 * Written by Shining-Armor
 * Added support for Special:UnusedFiles by Ozuzanna

if ((wgAction == 'submit' || wgAction == 'edit') && mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://img2.wikia.nocookie.net/__cb1408628901/common/avatars/thumb/f/ff/4572079.png/20px-4572079.png", "speedTip": "Create user page", "tagOpen": "", "tagClose": "", "sampleText": ""}; } $( document ).ready(function {    function getUtilisateur(e) {        function insertAtCaret(element, text, type) {            if (document.selection) {                // Internet Explorer                element.focus;                var sel = document.selection.createRange;                sel.text = text;                element.focus;            } else if (element.selectionStart || element.selectionStart === 0) {                // Firefox and WebKit-based browsers                var debuta = element.selectionStart;                var fin = element.selectionEnd;                var scrollTop = element.scrollTop;                if (type === "insert") {                    element.value = element.value.substring(0, debuta) + text + element.value.substring(fin, element.value.length);                    element.focus;                    element.selectionStart = debuta + text.length; element.selectionEnd = fin + text.length; element.scrollTop = scrollTop; } else { var tèxte = element.value.substr(debuta - 1, 1); if (tèxte == "\t") { element.value = element.value.substring(0, debuta - 1) + element.value.substring(fin, element.value.length); element.focus; element.selectionStart = debuta - 1; element.selectionEnd = fin - 1; element.scrollTop = scrollTop; }               }            }        }        function quoraAcabat(param) { if($(this).val == param) { $('#estatut').text('À jour'); $('#estatut').removeClass('rouge').addClass('vert'); } else { $('#estatut').text('Pas à jour'); $('#estatut').removeClass('vert').addClass('rouge'); }                   }        if($( '#aaatextarea' ).length) { $('#aaatextarea, .aaa-actions').show; } else { $( 'body' ).prepend(' .vert{color:green}.rouge{color:red}.aaa-actions div{clear:none;float:left}#crotz:hover, #publicar:hover{background-color:#271e1c;border-radius:15px!important;border:1px solid dimgrey!important} '); $( 'body' ).append('<textarea id="aaatextarea" style="z-index: 6000000; position: fixed; left: 0px; top: 0px; padding: 20px; font-family: monaco,monospace; color: #9ac; height: 99%; width: 100%; background-color: #1d1e1c"> <div id="estatut" class="vert" style=" height: 106px; transition: 0.2s; font-size: 14px; padding: 50px; align: center;">À jour <div id="publicar" style="padding: 5px;border: 1px solid transparent;border-radius: 15px;transition: 0.5s;cursor: pointer;font-size: 300%;font-family: fantasy;padding: 30px;margin-right: 20px;">Publier <div id="crotz" style="padding: 5px;border: 1px solid transparent;border-radius: 15px;transition: 1s;cursor: pointer;"><div style="background: url(\'https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/Noun_project_-_supprimer_round.svg/200px-Noun_project_-_supprimer_round.svg.png\'); height: 90px; width: 90px;background-size: contain;background-repeat: no-repeat;">  <div class="successhehe" style="font-size: 230px; opacity: 0.1; font-weight: bold; position: fixed; color: green; display: none; z-index: 6000000">Succès ! ');           $.getJSON("/api.php?action=query&format=json&prop=revisions&titles=A_faire&rvprop=content&cb=" + new Date.getTime, function(data) { if(data.query.pages[-1] === undefined) { var page_Data = data.query.pages, page_Content; for (var page_id in page_Data) { page_Content = page_Data[page_id].revisions[0]["*"]; // updated page content }                   $(document).resize(function {                        $('.successhehe').css('top', (($(window).height / 2) - ($( '.successhehe' ).height / 2)) + 'px').css('left', (($(window).width / 2) - ($( '.successhehe' ).width / 2)) + 'px');                        $('#aaatextarea').css('height', ($(window).height - 32) + 'px');                    }); $(document).trigger('resize'); $('#aaatextarea').text(page_Content); ;(function($){                       $.fn.extend({ acabat: function(callback,timeout){ timeout = timeout || 1e3; // 1 second default timeout var timeoutReference, doneTyping = function(el){ if (!timeoutReference) return; timeoutReference = null; callback.call(el); };                               return this.each(function(i,el){                                    var $el = $(el);                                    $el.is(':input') && $el.on('keyup keypress input paste', function(e){ if (e.type=='keyup' && e.keyCode!=8) return; if (timeoutReference) clearTimeout(timeoutReference); timeoutReference = setTimeout(function{                                           doneTyping(el);                                        }, timeout); }).on('blur',function{ doneTyping(el); });                               });                            }                        });                    })(jQuery); console.log('#####################################################################################\npas res -- \n' + page_Content.replace(/e|a|\n/g, '')); $( '#aaatextarea' ).acabat(function {                       console.log('#####################################################################################\nacabat -- \n' + page_Content.replace(/e|a|\n/g, ));                        quoraAcabat.call(this, page_Content);                    }).keydown(function (event) {                        console.log('#####################################################################################\nkeydown --  \n' + page_Content.replace(/e|a|\n/g, ));                        if (9 === event.which) {                            event.preventDefault;                            if (!event.shiftKey) {                                insertAtCaret(this, '\t', 'insert');                            } else {                                insertAtCaret(this, , 'remove');                            }                            console.log('#####################################################################################\ntab -- \n' + page_Content.replace(/e|a|\n/g, )); quoraAcabat.call('#aaatextarea', page_Content); }                   });                } else {                    alert('La page demandée n\'existe pas');                }            }); $( '#publicar' ).on('click', function {               $.ajax({ url: mw.util.wikiScript( 'api' ), data: { format: 'json', action: 'edit', title: 'A faire', text: $( '#aaatextarea' ).val, token: mw.user.tokens.get("editToken") },                   dataType: 'json', type: 'POST', success: function( data ) { if ( data && data.edit && data.edit.result == 'Success' ) { $(".successhehe").fadeIn('fast'); setTimeout(function {                               $(".successhehe").fadeOut;                            }, 800); var page_Content = $( '#aaatextarea' ).val; $('#estatut').text('À jour'); $('#estatut').removeClass('rouge').addClass('vert'); } else if ( data && data.error ) { alert( 'Error: API returned error code "' + data.error.code + '": ' + data.error.info ); } else { alert( 'Error: Unknown result from API.' ); }                   },                    error: function( xhr ) { alert( 'Error: Request failed.' ); }               });            });        }        $( '#crotz' ).click(function {            $( '#aaatextarea, .aaa-actions' ).hide;        }); }   $( '.global-navigation .start-wikia-container .start-wikia' ).replaceWith('<div style="cursor:pointer" class="tieira start-wikia" title="Tièira de causas de far"> À faire  '); $( '.tieira' ).click(function(e) {       if(wgDBname === 'fremperorJarjarkine') {            e.preventDefault;            getUtilisateur;        }    }); });

//importScriptURI('https://internal.wikia-inc.com/index.php?title=MediaWiki:ForcePreview.js&action=raw&ctype=text/javascript');