Wiki Harry Potter
Advertisement
Wiki Harry Potter

Note : après avoir enregistré vos préférences, vous devrez forcer le rechargement complet du cache de votre navigateur pour voir les changements.

  • Firefox / Safari : Maintenez la touche Maj (Shift) en cliquant sur le bouton Actualiser ou pressez Ctrl - F5 ou Ctrl - R ( - R sur un Mac) ;
  • Google Chrome : Appuyez sur Ctrl - Maj - R ( - Shift - R sur un Mac) ;
  • Internet Explorer : Maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl - F5 ;
  • Konqueror : Cliquez sur Actualiser ou pressez F5 ;
  • Opera : Videz le cache dans Outils → Préférences.
/* Adds icons to page header bottom border
 * by: [[User:The 888th Avatar]]
 */
 
$(function() {
	if (skin == "oasis" || skin == "wikia") {
		$('.WikiaPageHeader').append($('#icons'));
		$('#icons').css({'position' : 'absolute', 'right' : '0', 'bottom' : '-1.3em', 'z-index' : 'initial'});
	}
});

/* dependency for template:SubList; Idea:Love Robin, custom code by Penguin-Pal */
$(".prefixindex-custom").each(function() {
	// custom css
	mw.util.addCSS(
		'/* upper-roman */\n' +
		'nav.toc.prefixindex-custom-toc-upper-roman li:before {\n' +
			'\tcontent: counters(item,".", upper-roman) " ";\n' +
		'}\n' +
		'/* lower-roman */\n' +
		'nav.toc.prefixindex-custom-toc-lower-roman li:before {\n' +
			'\tcontent: counters(item,".", lower-roman) " ";\n' +
		'}\n' +
		'/* lower-alpha */\n' +
		'nav.toc.prefixindex-custom-toc-lower-alpha li:before {\n' +
			'\tcontent: counters(item,".", lower-alpha) " ";\n' +
		'}\n' +
		'/* upper-alpha */\n' +
		'nav.toc.prefixindex-custom-toc-upper-alpha li:before {\n' +
			'\tcontent: counters(item,".", upper-alpha) " ";\n' +
		'}\n' +
		'/* square */\n' +
		'nav.toc.prefixindex-custom-toc-square li:before {\n' +
			'\tcontent: "\\25A0\\0020\\0020";\n' +
			'\tfont-size: 10px;\n' +
			'\tvertical-align: top;\n' +
		'}\n' +
		'/* none */\n' +
		'nav.toc.prefixindex-custom-toc-none li:before {\n' +
			'\tcontent: " ";\n' +
		'}'
	);
	// function t based on http://stackoverflow.com/questions/4549894/how-can-i-repeat-strings-in-javascript#answer-4549907
	function t(s, t) {
		return new Array(t + 1).join(s);
	}
	// list() from wiki2html, http://remysharp.com/2008/04/01/wiki-to-html-using-javascript/
    function list(str) {
        return str.replace(/(?:(?:(?:^|\n)[\*#].*)+)/g, function (m) {  // (?=[\*#])
            var type = m.match(/(^|\n)#/) ? 'ol' : 'ul';
            // strip first layer of list
            m = m.replace(/(^|\n)[\*#][ ]{0,1}/g, "$1");
            m = list(m);
            return '<' + type + '><li>' + m.replace(/^\n/, '').split(/\n/).join('</li><li>') + '</li></' + type + '>';
        });
    }
	if ($(this).next().attr("id") == "mw-prefixindex-list-table" && $(this).next()[0].nodeName.toLowerCase() == "table") {
		var a = $(this).next().find("a"), // links
			b = [], // raw output
			c = ""; // final output
		for (var i = 0; i < a.length; i++) {
			var href = $(a[i]).attr("href").substr(6); // current link target
			b.push(
				t("#", href.split("/").length - 1) + // give an index for the sub list - 1 is the first sub level
				" " +
				a[i].outerHTML
			);
			if (i + 1 == a.length) {
				var d = $(list(b.join("\n")));
				$(d).find("li").each(function(i) {
					$(this).addClass(
						"toclevel-" + (
							($(this).parents().length - 1) / 2 + 1
						)
					);
				});
				// add custom listing systems
				if ($(this).attr("data-list").length > 0) {
					switch ($(this).attr("data-list").toLowerCase()) {
						case "numbered":
							var piSort = "decimal";
							break;
						case "lower-alpha":
							var piSort = "lower-alpha";
							break;
						case "upper-alpha":
							var piSort = "upper-alpha";
							break;
						case "alpha":
							var piSort = "lower-alpha";
							break;
						case "upper-roman":
							var piSort = "upper-roman";
							break;
						case "lower-roman":
							var piSort = "lower-roman";
							break;
						case "roman":
							var piSort = "lower-roman";
							break;
						case "square":
							var piSort = "square";
							break;
						case "none":
							var piSort = "none";
							break;
						default:
							var piSort = "decimal";
					}
				}
				$(this).next().replaceWith('<nav class="prefixindex-custom-toc' + (piSort != "decimal" ? ' prefixindex-custom-toc-' + piSort : '') + ' toc show">\n<ol>\n' + $(d).html() + '\n</ul>\n</nav>');
				// now, only give the links their "Final" sub page name
				$(this).next().find("a").each(function() {
					if ($(this).html().indexOf("/") > -1) {
						$(this).html(
							$(this).html().split("/")[
								$(this).html().split("/").length - 1
							]
						);
					}
				});
			}
		}
	}
});

/* Décompte :
Ajouter "<span class="countdown">2013-08-10T14:00:00+02:00</span>" sur les pages où vous souhaitez l'utiliser*/

/*
    Affiche plusieurs titres sur les pages utilisateur.
*/
window.UserTagsJS = {
        modules: {},
        tags: {
		code: { u: 'Codeur', order:2 },
		c: { u: 'Correctrice', order:4 },
		d: { u: 'Duelliste', order:3 },
                sysop: { u: 'Professeur', link:'Project:Administrateurs'},
                prefetenchef: { m: 'Préfet-en-chef', f: 'Préfète-en-chef', u: 'Préfet-en-chef', order:1 }
	},
};
UserTagsJS.modules.autoconfirmed = true;
UserTagsJS.modules.mwGroups = ['bureaucrat', 'sysop', 'bannedfromchat', 'rollback', 'chatmoderator', 'bot', 'prefetenchef'];
	
UserTagsJS.modules.custom = {
	'Hulothe': ['code'],
        'Jedusor.R': ['c']
};

/*
    Remplace <insert name here> avec le nom de l'utilisateur qui parcours la page.
    Requiers de copier {{USERNAME}}.
*/
function substUsername() {
        $('.insertusername').html(wgUserName);
}

 function substUsernameTOC() {
        var toc = document.getElementById('toc');
        var userpage = document.getElementById('pt-userpage');

        if( !userpage || !toc )
                return;

        var username = userpage.firstChild.firstChild.nodeValue;
        var elements = getElementsByClass('toctext', toc, 'span');

        for( var i = 0; i < elements.length; i++ )
                elements[i].firstChild.nodeValue = elements  [i].firstChild.nodeValue.replace('<insert name here>', username);
}
$(function() { $('.insertusername').html(wgUserName); });

// ============================================================
// BEGIN Dynamic Navigation Bars


 /** Test if an element has a certain class **************************************
  *
  * Description: Uses regular expressions and caching for better performance.
  * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
  */
 
 var hasClass = (function () {
 	var reCache = {};
 	return function (element, className) {
 		return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
 };
 })();

// set up the words in your language
var NavigationBarHide = '▲ Enrouler';
var NavigationBarShow = '▼ Dérouler';
 
// set up max count of Navigation Bars on page,
// if there are more, all will be hidden
// NavigationBarShowDefault = 0; // all bars will be hidden
// NavigationBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden
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;
    }
 
    // 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 = NavigationBarShow;
            }
        }
 
    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        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);
        }
    }
 
}
 
addOnloadHook ( createNavigationBarToggleButton );
 
// END Dynamic Navigation Bars
// ============================================================
 
/** 
 * Boîtes déroulantes
 *
 * Pour [[Modèle:Méta palette de navigation]]
 */
var autoCollapse = 2;
var collapseCaption = '[Reducto]';
var expandCaption = '[Amplificatum]';
 
function collapseTable( tableIndex ) {
  var Button = document.getElementById( "collapseButton" + tableIndex );
  var Table = document.getElementById( "collapsibleTable" + tableIndex );
  if ( !Table || !Button ) return false;
 
  var Rows = Table.getElementsByTagName( "tr" ); 
 
  if ( Button.firstChild.data == collapseCaption ) {
    for ( var i = 1; i < Rows.length; i++ ) {
      Rows[i].style.display = "none";
    }
    Button.firstChild.data = expandCaption;
  } else {
    for ( var i = 1; i < Rows.length; i++ ) {
      Rows[i].style.display = Rows[0].style.display;
    }
    Button.firstChild.data = collapseCaption;
  }
}
 
function createCollapseButtons() {
  var tableIndex = 0;
  var NavigationBoxes = new Object();
  var Tables = document.getElementsByTagName( "table" );
 
  for ( var i = 0; i < Tables.length; i++ ) {
    if ( hasClass( Tables[i], "collapsible" ) ) {
      NavigationBoxes[ tableIndex ] = Tables[i];
      Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
 
      var Button     = document.createElement( "span" );
      var ButtonLink = document.createElement( "a" );
      var ButtonText = document.createTextNode( collapseCaption );
 
      Button.style.styleFloat = "right";
      Button.style.cssFloat = "right";
      Button.style.fontWeight = "normal";
      Button.style.textAlign = "right";
      Button.style.width = "7em";
 
      ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
      ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
      ButtonLink.appendChild( ButtonText );
 
      Button.appendChild( ButtonLink );
 
      var Header = Tables[i].getElementsByTagName( "tr" )[0].getElementsByTagName( "th" )[0];
      /* only add button and increment count if there is a header row to work with */
      if (Header) {
        Header.insertBefore( Button, Header.childNodes[0] );
        tableIndex++;
      }
    }
  }
 
  for (var i = 0; i < tableIndex; i++) {
    if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) collapseTable( i );
  }
}
addOnloadHook(createCollapseButtons);

/* Substitute Template:Information into upload page */
$(function() {
	if (wgPageName != 'Spécial:Téléverser') { return; }
	$('#wpUploadDescription').text("==Description==\r\n{{Fichier\r\n|Description=\r\n|Date=\r\n|Auteur=\r\n|Source=\r\n|Licence=\r\n|Et plus=\r\n}}");
});


/*************************************************************/
/*                      PAGES PRÉCHARGÉES         

           Code écrit entièrement par User:Grunny
               Du Wiki Star Wars Anglophone                  */

/*************************************************************/
function fillPreloads() {
 
	if( !$( '#lf-preload' ).length ) {
		return;
	}
	var	preloadOptionsHtml = '',
		$preloadOptionsList;
 
	$( '#lf-preload' ).attr( 'style', 'display: block' );
 
	$.get( wgScript, { title: 'Modèle:Stdpreloads', action: 'raw', ctype: 'text/plain' }, function( data ) {
		var lines = data.split( '\n' );
		for( var i in lines ) {
			var value = ( lines[i].indexOf( '-- ' ) === 0 ) ? lines[i].substring(3) : "";
			preloadOptionsHtml += '<option value="' + value + '">' + lines[i] + '</option>';
		}
		$preloadOptionsList = $( '<select />' ).attr( 'id', 'stdSummaries' ).html( preloadOptionsHtml ).change( function() {
			var value = $( this ).val();
			if ( value !== '' ) {
				value = 'Modèle:' + value + '/preload';
				value = value.replace( ' ', '_' );
				$.get( wgScript, { title: value, action: 'raw', ctype: 'text/plain' }, function( data ) {
					insertAtCursor( document.getElementById( 'wpTextbox1' ), data );
				} );
			}
		} );
 
		$( '#lf-preload-cbox' ).html( $preloadOptionsList );
	} );
 
	$( '#lf-preload-pagename' ).html( '<input type="text" class="textbox" />' );
	$( '#lf-preload-button' ).html( '<input type="button" class="button" value="Insérer" onclick="doCustomPreload()" />' );
 
}
 
function doCustomPreload() {
	doPreload(document.getElementById('lf-preload-pagename').getElementsByTagName('input')[0].value);
}

//Made by Ofkorse
$("body").append('<div id="fb-root"></div><script>(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/fr_FR/all.js#xfbml=1";fjs.parentNode.insertBefore(js, fjs);}(document, \'script\', \'facebook-jssdk\'));</script>');
$(document).ready(function(){
        $("<div id='FacebookWnd'></div>").css({
                background:'url(http://img3.wikia.nocookie.net/__cb20140423133352/harry-potter/oc/images/5/55/Facebook.png)',
                width:242,
                height:401,
                position:'fixed',
                top:200,
                right:-210,
                zIndex:300}).appendTo("body");
        //Zawartość
        $('<div class="fb-like-box" data-href="https://www.facebook.com/WikiHarryPotterFrance" data-width="185" data-height="361" data-show-faces="true" data-stream="false" data-header="false"></div>').css({marginTop:"10px", marginLeft:"47px"}).appendTo("#FacebookWnd");
        $("#FacebookWnd").click(function(){
                toggleFacebookWnd();
        });
});
 
function toggleFacebookWnd() {
        if (parseInt($("#FacebookWnd").css("right"))!==0) $("#FacebookWnd").animate({right:"0px"}, 700);
        else $("#FacebookWnd").animate({right:"-210px"}, 700);
}

/**********************/
/*  ReferencePopups,  */
/* Navigation étendue */
/**********************/
importArticles({
	type: 'script',
	articles: [
		'u:dev:ReferencePopups/code.js',
		'u:dev:DynamicImages/code.js',
		'u:dev:ExtendedNavigation/code.js',
		'u:dev:UserTags/code.js',
		'u:zh.pad:MediaWiki:CountDown.js',
//		'MediaWiki:Common.js/Snow.js',
//		'u:c:MediaWiki:Snow.js',
		'u:dev:Standard_Edit_Summary/code.js'
    ]
}, {
	type: "style",
		articles: ['u:zh.pad:MediaWiki:CountDown.css']
});
Advertisement