MediaWiki:Guidedtour-tour-wikimooc31d.js

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

Mozilla / Firefox / Konqueror / Safari : maintenez la touche Majuscule (Shift) en cliquant sur le bouton Actualiser (Reload) ou pressez Maj-Ctrl-R (Cmd-R sur Apple Mac) ;

Chrome / Internet Explorer / Opera : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5.
/*
* Guidedtour #11 du WikiMOOC
* Autres espaces de discussion
*
* Voir [[:mw:Extension:GuidedTour]] pour plus d'informations
*
* Auteur : [[User:0x010C]]
* Création : 6 février 2017
* Dernière révision : 22 février 2017
* [[Catégorie:Guided tour]]
*/
//<nowiki>

( function ( window, document, $, mw, gt ) {
	var tour;

	tour = new gt.TourBuilder( {
		name: 'wikimooc31d',
		shouldLog: false
	} );

	// 1
	tour.firstStep( {
		name: 'bienvenue',
		title: 'Tutoriel #11',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/1' ),
		overlay: true,
		closeOnClickOutside: false,
	} )
	.next( 'goaccueil' )
	.transition( function () {
		// Si l'apprenant n'est pas connecté
		if ( mw.user.getId() === 0 )
			return 'connectetoi';
	} );
	
	// 1b
	tour.step( {
		name: 'goaccueil',
		title: 'Allez sur l\'accueil communautaire',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/1b' ),
		overlay: false,
		attachTo: '#n-portal',
		position: 'right',
		closeOnClickOutside: false,
	} )
	.back( 'bienvenue' )
	.transition( function() {
		if ( mw.config.get( 'wgPageName' ) === 'Wikipédia:Accueil_de_la_communauté' ) {
			return 'accueil';
		}
	} );
	
	// 2
	tour.step( {
		name: 'accueil',
		title: 'L\'accueil communautaire',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/2' ),
		overlay: false,
		attachTo: '',
		position: '',
		closeOnClickOutside: false,
	} )
	.back( function () {
		gt.setTourCookie( 'wikimooc31d', 'goaccueil' );
		window.location.href = mw.util.getUrl( 'Wikipédia:WikiMOOC/2017/Autres espaces de discussion' );
	} )
	.next( 'gobistro' );
	
	// 2b
	tour.step( {
		name: 'gobistro',
		title: 'Allez sur le Bistro',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/2b' ),
		overlay: false,
		attachTo: '#demander p:nth-child(1) a',
		position: 'bottom',
		closeOnClickOutside: false,
	} )
	.back( 'accueil' )
	.transition( function() {
		if ( mw.config.get( 'wgPageName' ).split( '/' )[ 0 ] === 'Wikipédia:Le_Bistro' ) {
			return 'bistro';
		}
	} );
	
	// 3
	tour.step( {
		name: 'bistro',
		title: 'Le bistro',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/3' ),
		overlay: false,
		attachTo: '',
		position: '',
		closeOnClickOutside: false,
	} )
	.back( function () {
		gt.setTourCookie( 'wikimooc31d', 'gobistro' );
		window.location.href = mw.util.getUrl( 'Wikipédia:Accueil de la communauté' );
	} )
	.next( function () {
		gt.setTourCookie( 'wikimooc31d', 'pas' );
		window.location.href = mw.util.getUrl( 'Discussion:Giovanni_De_Micheli/Suppression#Giovanni_De_Micheli' );
	} );
	
	// 4
	tour.step( {
		name: 'pas',
		title: 'Page à supprimer',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/4' ),
		overlay: false,
		attachTo: '',
		position: '',
		closeOnClickOutside: false,
	} )
	.back( function () {
		gt.setTourCookie( 'wikimooc31d', 'bistro' );
		window.location.href = mw.util.getUrl( 'Wikipédia:Le Bistro' );
	} )
	.next( function () {
		gt.setTourCookie( 'wikimooc31d', 'voteadmin' );
		window.location.href = mw.util.getUrl( 'Wikipédia:Administrateur/Amqui' );
	} );
	
	// 5
	tour.step( {
		name: 'voteadmin',
		title: 'Votes communautaires',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/5' ),
		overlay: false,
		attachTo: '',
		position: '',
		closeOnClickOutside: false,
	} )
	.back( function () {
		gt.setTourCookie( 'wikimooc31d', 'pas' );
		window.location.href = mw.util.getUrl( 'Discussion:Giovanni_De_Micheli/Suppression#Giovanni_De_Micheli' );
	} )
	.next( function () {
		gt.setTourCookie( 'wikimooc31d', 'sondage' );
		window.location.href = mw.util.getUrl( 'Wikipédia:Sondage/Affichage du lien archive Wikiwix' );
	} );
	
	// 6
	tour.step( {
		name: 'sondage',
		title: 'Sondages et prises de décisions',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/6' ),
		overlay: false,
		attachTo: '',
		position: '',
		closeOnClickOutside: false,
	} )
	.back( function () {
		gt.setTourCookie( 'wikimooc31d', 'voteadmin' );
		window.location.href = mw.util.getUrl( 'Wikipédia:Administrateur/Amqui' );
	} )
	.next( function () {
		gt.setTourCookie( 'wikimooc31d', 'questionstechniques' );
		window.location.href = mw.util.getUrl( 'Wikipédia:Questions techniques' );
	} );
	
	// 7
	tour.step( {
		name: 'questionstechniques',
		title: 'Les questions techniques',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/7' ),
		overlay: false,
		attachTo: '',
		position: '',
		closeOnClickOutside: false,
	} )
	.back( function () {
		gt.setTourCookie( 'wikimooc31d', 'sondage' );
		window.location.href = mw.util.getUrl( 'Wikipédia:Sondage/Affichage du lien archive Wikiwix' );
	} )
	.next( function () {
		gt.setTourCookie( 'wikimooc31d', 'accueilprojets' );
		window.location.href = mw.util.getUrl( 'Projet:Accueil' );
	} );
	
	// 8
	tour.step( {
		name: 'accueilprojets',
		title: 'Les projets thématiques',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/8' ),
		overlay: false,
		attachTo: '',
		position: '',
		closeOnClickOutside: false,
	} )
	.back( function () {
		gt.setTourCookie( 'wikimooc31d', 'questionstechniques' );
		window.location.href = mw.util.getUrl( 'Wikipédia:Questions techniques' );
	} )
	.next( 'goprojet' );
	
	// 8b
	tour.step( {
		name: 'goprojet',
		title: 'Allez sur un projet',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/8b' ),
		overlay: false,
		attachTo: '',
		position: '',
		closeOnClickOutside: false,
	} )
	.back( 'accueilprojets' )
	.transition( function() {
		if ( ( mw.config.get( 'wgNamespaceNumber' ) === 102 || mw.config.get( 'wgNamespaceNumber' ) === 100 ) && mw.config.get( 'wgTitle' ) !== 'Accueil' ) {
			return 'projet';
		}
	} );
	
	// 9
	tour.step( {
		name: 'projet',
		title: 'Voici un projet',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/9' ),
		overlay: false,
		attachTo: '',
		position: '',
		closeOnClickOutside: false,
	} )
	.back( function () {
		gt.setTourCookie( 'wikimooc31d', 'goprojet' );
		window.location.href = mw.util.getUrl( 'Projet:Accueil' );
	} )
	.next( function () {
		gt.setTourCookie( 'wikimooc31d', 'fin' );
		window.location.href = mw.util.getUrl( 'Wikipédia:WikiMOOC/2017/Autres espaces de discussion' );
	} );
	
	// 10
	tour.step( {
		name: 'fin',
		title: 'Fin du tutoriel',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/3.1/D/10' ),
		overlay: false,
		closeOnClickOutside: false,
		buttons: [ {
			action: 'end',
		} ],
		allowAutomaticOkay: false,
	} )
	.back( function () {
		gt.setTourCookie( 'wikimooc31d', 'accueilprojets' );
		window.location.href = mw.util.getUrl( 'Projet:Accueil' );
	} );



	// 0
	tour.step( {
		name: 'connectetoi',
		title: 'Connectez-vous',
		description: new mw.Title( 'Projet:WikiMOOC/2017/GT/0' ),
		autoFocus: true,
		overlay: true,
		closeOnClickOutside: false,
	} )
	.transition( function() {
		// Si l'apprenant s'est connecté
		if ( mw.user.getId() !== 0 )
			return 'bienvenue';
	} );
	
	//Ajout d'un bouton en bas à droite pour permettre de réafficher une étape accidentellement fermé
	mw.loader.using( [ 'oojs-ui' ], function () {
		var reloadButton = new OO.ui.ButtonWidget( {
			label: 'Réafficher l\'étape courante',
			icon: 'redo',
			title: 'Réafficher'
		} );
		reloadButton.on( 'click', function() {
			gt.launchTourFromUserState();
		} );
		var container = $( '<div>' );
		container.append( reloadButton.$element[ 0 ] );
		container.css( 'position', 'fixed' ).css( 'bottom', '0px' ).css( 'right', '0px' ).css( 'z-index', '3000' ).appendTo( 'body' );
	} );

} ( window, document, jQuery, mediaWiki, mediaWiki.guidedTour ) );

//</nowiki>