MediaWiki:Guidedtour-tour-wikimooc12b.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 #2 du WikiMOOC
* Interface des articles
*
* Voir [[:mw:Extension:GuidedTour]] pour plus d'informations
*
* Auteur : [[User:0x010C]]
* Création : 25 octobre 2016
* Dernière révision : 6 mars 2017
* [[Catégorie:Guided tour]]
*/
//<nowiki>
( function ( window, document, $, mw, gt ) {
var tour;
// Prepare some hack to place correctly some boxes
//step2
if ( mw.config.get( 'wgPageName' ) == 'Framboise' ) {
$( 'h1' ).html( 'Framboise<span id="gt-mooc-12b-titre"></span>' );
}
tour = new gt.TourBuilder( {
name: 'wikimooc12b',
shouldLog: false
} );
// 1
tour.firstStep( {
name: 'bienvenue',
title: 'Bienvenue ! (1/11)',
description: new mw.Title( 'Projet:WikiMOOC/2017/GT/1.2/B/1' ),
overlay: true,
closeOnClickOutside: false,
onShow: function() {
var api = new mw.Api();
api.postWithToken( 'csrf', {
action: 'edit',
title: 'Projet:MOOC/2017/Participation/1.2',
summary: 'Émargement automatique pour le second module de la semaine 1 du WikiMOOC',
appendtext: '\n# {{u|' + mw.config.get( 'wgUserName' ) + '}}',
tags: 'wikimooc2017',
format: 'json',
} );
},
} )
.next( function() {
window.location.href = mw.util.getUrl( 'Framboise' );
} )
.transition( function() {
// Si l'apprenant n'est pas connecté
if ( mw.user.getId() === 0 )
return 'connectetoi';
if ( mw.config.get( 'wgPageName' ) == 'Framboise' )
return 'titre';
} );
// 2
tour.step( {
name: 'titre',
title: 'Titre de l\'article (2/11)',
description: new mw.Title( 'Projet:WikiMOOC/2017/GT/1.2/B/2' ),
attachTo: '#gt-mooc-12b-titre',
position: 'right',
autoFocus: true,
closeOnClickOutside: false,
} )
.back( 'bienvenue' )
.next( 'onglets' );
// 3
tour.step( {
name: 'onglets',
title: 'Une interface constante (3/11)',
description: new mw.Title( 'Projet:WikiMOOC/2017/GT/1.2/B/3' ),
attachTo: '#ca-nstab-main',
position: 'bottomRight',
autoFocus: true,
closeOnClickOutside: false,
} )
.back( 'titre' )
.next( 'discussion' );
// 4
tour.step( {
name: 'discussion',
title: 'Naviguer entre article et discussions (4/11)',
description: new mw.Title( 'Projet:WikiMOOC/2017/GT/1.2/B/4' ),
attachTo: '#ca-talk',
position: 'bottomRight',
autoFocus: true,
closeOnClickOutside: false,
} )
.back( 'onglets' )
.transition( function() {
if ( mw.config.get( 'wgPageName' ) === 'Discussion:Framboise' ) {
return 'revenirarticle';
}
} );
// 4b
tour.step( {
name: 'revenirarticle',
title: 'Naviguer entre article et discussions (5/11)',
description: new mw.Title( 'Projet:WikiMOOC/2017/GT/1.2/B/4b' ),
attachTo: '#ca-nstab-main',
position: 'bottomRight',
autoFocus: true,
closeOnClickOutside: false,
} )
.transition( function() {
if ( mw.config.get( 'wgPageName' ) === 'Framboise' ) {
return 'modifier';
}
} );
// 5
tour.step( {
name: 'modifier',
title: 'Modifier la page (6/11)',
description: new mw.Title( 'Projet:WikiMOOC/2017/GT/1.2/B/5' ),
attachTo: '#ca-ve-edit',
position: 'bottom',
autoFocus: true,
closeOnClickOutside: false,
} )
.back( 'discussion' )
.next( 'historique' );
// 6
tour.step( {
name: 'historique',
title: 'Un historique pour accéder aux archives (7/11)',
description: new mw.Title( 'Projet:WikiMOOC/2017/GT/1.2/B/6' ),
attachTo: '#ca-history',
position: 'bottom',
autoFocus: true,
closeOnClickOutside: false,
} )
.back( 'modifier' )
.next( 'lds' );
// 7
tour.step( {
name: 'lds',
title: 'Suivre un article (8/11)',
description: new mw.Title( 'Projet:WikiMOOC/2017/GT/1.2/B/7' ),
attachTo: '#ca-watch',
position: 'bottom',
autoFocus: true,
closeOnClickOutside: false,
} )
.back( 'historique' )
.next( 'section' );
// 8
tour.step( {
name: 'section',
title: 'Modifier une seule section (9/11)',
description: new mw.Title( 'Projet:WikiMOOC/2017/GT/1.2/B/8' ),
attachTo: '.mw-editsection',
position: 'right',
autoFocus: true,
closeOnClickOutside: false,
} )
.back( 'lds' )
.next( 'interlangues' );
// 9
tour.step( {
name: 'interlangues',
title: 'Pour les polyglottes (10/11)',
description: new mw.Title( 'Projet:WikiMOOC/2017/GT/1.2/B/9' ),
attachTo: '#p-lang-label',
position: 'rightTop',
autoFocus: true,
closeOnClickOutside: false,
} )
.back( 'section' )
.next( function() {
window.location.href = mw.util.getUrl( 'Wikipédia:WikiMOOC/2017/Interface_des_articles' );
} )
.transition( function() {
if(mw.config.get( 'wgPageName' ) == 'Wikipédia:WikiMOOC/2017/Interface_des_articles' )
return 'fin';
} );
// 10
tour.step( {
name: 'fin',
title: 'Fin du tutoriel (11/11)',
description: new mw.Title( 'Projet:WikiMOOC/2017/GT/1.2/B/10' ),
autoFocus: true,
overlay: true,
closeOnClickOutside: false,
buttons: [ {
action: 'end'
} ],
allowAutomaticOkay: false,
} )
.back( 'interlangues' );
// 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>