MediaWiki:Guidedtour-tour-twa5.js

Nota: Després de desar, heu de netejar la memòria cau del navegador per veure els canvis. En la majoria de navegadors amb Windows o Linux, premeu Ctrl+F5 o bé premeu Shift i cliqueu el botó "Actualitza" (Ctrl i "Actualitza" amb Internet Explorer). Vegeu més informació i instruccions per a cada navegador a Viquipèdia:Neteja de la memòria cau.

// 5a etapa del Bus turístic, adaptació de
// The Wikipedia Adventure Mission 5

( function ( window, document, $, mw, gt ) {
 
//automatic api:edit function to send yourself messages
function sendMessage( targetPage, msgPage, linkTo ) {
	var api = new mw.Api();
	api.get( {
		'action' : 'query',
		'titles' : msgPage,
		'prop'   : 'revisions|info',
		'intoken' : 'edit',
		'rvprop' : 'content',
		'indexpageids' : 1
	} ).done( function (result) {
		result = result.query;
		var page = result.pages[result.pageids[0]];
		var text = "{{subst:" + msgPage + "}}";
		api.post( {
			'action' : 'edit',
			'title' : targetPage,
			'appendtext' : "\n" + text,
			'summary' : 'Nou missatge (simulat automàticament com a part de [[VP:BUS|Bus turístic]])',
			'token' : page.edittoken
		} ).done( function () {
			window.location.href = linkTo;
		} );
	} );
}
 
// Fail gracefully post-save but not postedit
var postEditButtons = [];
if ( mw.config.get( 'wgAction' ) === 'view' && !gt.isPostEdit() ) {
        postEditButtons.push( {
                name: 'Cliqueu aquí per anar enrere i fer una edició',
                onclick: function() {
                        window.location.href = new mw.Uri().extend( { action: 'edit' } ).toString();
                }
        } );
}

// Fail gracefully post-save but not postedit for visual editor
var postEditButtonsVisual = [];
if ( mw.config.get( 'wgAction' ) === 'view' && !gt.isPostEdit() ) {
        postEditButtonsVisual.push( {
                name: 'Vés enrere per fer una edició',
                onclick: function() {
                        window.location.href = window.location.href +
"&veaction=edit";
                }
        } );
}

gt.defineTour( {
        name: 'twa5',
        shouldLog: true,
        steps: [ {

                //1
                title: 'Som-hi! ',
                description: '<br><div align="right">[[File:Wikipe-tan head.png|80px|link=]]</div>SocraTres ens repta amb una pregunta intrigant: Com sabem si la informació de la Viquipèdia és correcta?<br><br>És una pregunta especial que necessita un lloc especial per obtenir una resposta acurada.<br><br>',
                overlay: true,
                onShow: gt.parseDescription,
                buttons: [ {
                        name: 'Plantegem la pregunta',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/Teahouse' ) + '?tour=twa5&step=2'      
                } ],
		allowAutomaticOkay: false

        },  {
                //2
                title: 'Què és aquest lloc?',
                description: '<br><div align="right">[[File:Wikipe-tan head.png|80px|link=]]</div>Hi ha espais socials per preguntar sobre la Viquipèdia i demanar ajuda sempre que ho necessitis. Normalment hi ha usuaris experimentats disposats a ajudar amb respostes simples i clares a tots els nouvinguts.<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/Start' ) + '?tour=twa5&step=1' 
                } , { 
                        name: 'Anem a provar',
                        action:'next',          
                } ],

                allowAutomaticOkay: false,
                
        },  {
                //3
                title: 'Un lloc de trobada.',
                description: '<br><div align="left">[[File:Wikitanface.png|100px|link=]]</div>Demanar ajuda és una forma d\'esdevenir un gran editor. Hi ha moltes coses per aprendre i molta gent disposada a donar un cop de mà.<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/Teahouse' ) + '?tour=twa5&step=2' 
                } , { 
                        name: 'Compartim els dubtes',
                        action: 'next',
                } ],     
                
        },  {

                //4
                title: 'Preguntem!',
                description: '<br>Fiabilitat de la Viquipèdia<br><br>"Hola, sóc nou aquí i vull aprendre més sobre la Viquipèdia. M\'estava preguntant, com puc saber si alguna cosa que diu la Viquipèdia és *correcta*?"<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/Teahouse' ) + '?tour=twa5&step=3' 
                } , { 
                        name: 'Publiquem-ho!',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/Teahouse/1' ) + '?tour=twa5&step=5'
                        } ],
},  {
                //5
                title: 'Preguntar és excitant',
                description: 'NOU ESCALAFÓ:  <b>Distinció d\'Investigador</b><center>[[File:TWA badge 7.png|250px|link=]]</center><br>Ei, tens una notificació de que algú ha contestat la teva pregunta.<br>',
                onShow: gt.parseDescription,
                attachTo: '#content.mw-body',
                position: 'topRight',
                autoFocus: 'yes',
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/Teahouse' ) + '?tour=twa5&step=4' 
                } , { 
                        name: 'Comprovem la resposta',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/Teahouse/2' ) + '?tour=twa5&step=6'
                        } ],
                allowAutomaticOkay: false,
                
        },  {
                //6
                title: 'Això és important',
                description: '<br><div align="right">[[File:Wikipe-tan head.png|80px|link=]]</div>És a dir, només escrivim sobre allò que podem verificar en una font publicada. No sobre la nostra experiència, investigació original o opinions personals. Només informació publicada.<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                attachTo: '#content.mw-body',
                position: 'bottomRight',
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/Teahouse' ) + '?tour=twa5&step=5' 
                } , { 
                        name: 'Endinsem-nos en la Verificabilitat*',
                        onclick: function()  {  if(!mw.config.get('wgUserName')){  alert( "Registreu-vos." );   return;   } sendMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Viquipèdia:Bus_turístic/Badge/7template2' , mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/V' ) + '?tour=twa5&step=7'); }
                } ],      
                allowAutomaticOkay: false

},  {
                //7
                title: 'Descobriu-ho vosaltres mateixos...',
                description: '',
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/Teahouse/2' ) + '?tour=twa5&step=6' 
                } ]

} , {
                //8
                title: 'Has aconseguit la Verific-habilitat',
                description: 'NOU ESCALAFÓ:  <b>Distinció de Verificabilitat</b><center>[[File:TWA badge 8.png|250px|link=]]</center><br>Anem a utilitzar aquest nou concepte!<br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/V' ) + '?tour=twa5&step=7' 
                } , { 
                        name: 'Comprovem els missatges*',
                        onclick: function()  {  if(!mw.config.get('wgUserName')){  alert( "Registreu-vos." );   return;   } sendMessage( 'User talk:' + mw.config.get( 'wgUserName' ) + '/Bus', 'Viquipèdia:Bus_turístic/MyTalk/5' , mw.util.getUrl( 'Special:MyTalk/Bus' ) + '?tour=twa5&step=9'); }           
                } ],
                allowAutomaticOkay: false

} , {
                //9
                title: 'Cercant fonts',
                description: '<br><div align="left">[[File:Wikitanface.png|100px|link=]]</div>Anem a veure què ens diu de nou GaiaNoia</br>',
                onShow: gt.parseDescription,
                overlay: false,
                attachTo: '#content.mw-body',
                position: 'bottom',
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/Start' ) + '?tour=twa5&step=8' 
                } , { 
                        name: 'Cap a la discussió de Terra*',
                        onclick: function()  {  if(!mw.config.get('wgUserName')){  alert( "Registreu-vos." );   return;   } sendMessage( 'User talk:' + mw.config.get( 'wgUserName' ) + '/Bus/Terra', 'Viquipèdia:Bus_turístic/Earth/Talk/1' , mw.util.getUrl( 'Special:MyTalk/Bus/Terra' ) + '?tour=twa5&step=10'); }           
                } ],
                allowAutomaticOkay: false
				
} , {
                //10
                title: 'Tres fonts',
                description: '<br><div align="left">[[File:Wikitanface.png|100px|link=]]</div>Sembla que la GaiaNoia ens dóna algunes opcions.<br><br>La verificabilitat ens diu que volem fonts fiables publicades amb reputació de comprovació dels fets i precisió. Fonts en les que ens podem basar.<br><br> ',
                onShow: gt.parseDescription,
                overlay: false,
                attachTo: '#content.mw-body',
                position: 'bottom',
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/Start' ) + '?tour=twa5&step=9' 
                } , { 
                        name: 'Quina d\'aquestes seria millor?',
                        onclick: function()  {  if(!mw.config.get('wgUserName')){  alert( "Registreu-vos." );   return;   } sendMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Viquipèdia:Bus_turístic/Badge/8template2' , mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/RS' ) + '?tour=twa5&step=11'); }
                } ],      

                allowAutomaticOkay: false

},  {
                //11
                title: 'Descobriu-ho vosaltres mateixos...',
                description: 'Consell: es pot aprendre tant fent-ho bé com malament. Sempre es pot intentar de nou!',
                attachTo:'#contentSub',
                position: 'bottom',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false, 
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyTalk/Bus/Terra' ) + '?tour=twa5&step=10' 
                }],

}, {
                //12
                title: 'Ets molt fiable',
                description: 'NOU ESCALAFÓ:  <b>Distinció de Documentació</b><center>[[File:TWA badge 9.png|250px|link=]]</center><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/RS' ) + '?tour=twa5&step=11' 
                } , { 
                        name: 'Responem a GaiaNoia*',
                        onclick: function()  {  if(!mw.config.get('wgUserName')){  alert( "Registreu-vos." );   return;   } sendMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Viquipèdia:Bus_turístic/Badge/9template2' , mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/Start' ) + '?tour=twa5&step=13'); }
                } ],    
                allowAutomaticOkay: false

}, {
                //13
                title: 'Ara què fem?',
                description: '<br><div align="right">[[File:Wikipe-tan head.png|80px|link=]]</div>Ara que tenim la font, què en fem?<br><br>Primer, anem a deixar una nota a la discussió explicant a GaiaNoia86 què en pensem.<br><br>Hmm... què hi podem dir?<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyTalk/Bus/Terra' ) + '?tour=twa5&step=12' 
                },{
                        name: 'Responem a GaiaNoia',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/Reply' ) + '?tour=twa5&step=14'
                        } ],
                allowAutomaticOkay: false

} , {
                //14
                title: 'Descobriu-ho vosaltres mateixos...',
                description: 'Consell: es pot aprendre tant fent-ho bé com malament. Sempre es pot intentar de nou!',
                attachTo:'#contentSub',
                position: 'bottom',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false, 
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/Start' ) + '?tour=twa5&step=13' 
                }],

        },  {
                //15
                title: 'Resposta a GaiaNoia',
                description: '<br>Cliquem MODIFICA EL CODI per deixar la resposta a GaiaNoia<br><br>',
                attachTo: '#ca-edit',
                position: 'bottom',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/Reply' ) + '?tour=twa5&step=14' 
                }],
                shouldSkip: function() {
                        return gt.hasQuery( { action: 'edit' } );
                }
 
        },  {
                //16
                title: 'Copiem el missatge al final',
                description: '<br><div align="right">[[File:Wikipe-tan head.png|80px|link=]]</div>:La Revista Ciència i Natura sembla una font sòlida i rellevant amb bona reputació. Penso que ens podem basar en ella per aquest article més que en les altres. Bona recerca! <nowiki>--~~~~</nowiki><br>',
                onShow: gt.parseDescription,
                overlay: false,
                attachTo: '#wpTextbox1', 
                position: 'bottomRight',
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyTalk/Bus/Terra' ) + '?tour=twa5&step=15' 
                } , {
                        name: 'Copiat',
                        action: 'next',
                        } ],
 
} , {
                //17
                title: 'Resum i Desa',
                description: '<br>Per exemple, "Consideracions sobre una font fiable". Cliquem DESA LA PÀGINA per publicar-ho.<br><br>',
                attachTo: '#wpSave',
                position: 'bottomRight',
                autoFocus: 'yes',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyTalk/Bus/Terra' ) + '?tour=twa5&step=16&action=edit' 
                } ], 
                shouldSkip: function() {
                        return gt.isPostEdit();
                },
                buttons: postEditButtons

} , {
                //18
                title: 'Fantàstic!',
                description: 'NOU ESCALAFÓ:  <b>Distinció d\'Assessor</b><center>[[File:TWA badge 10.png|250px|link=]]</center><br><br>Vista la discussió de Terra, GaiaNoia ha afegit algun contingut interessant. Comprovat!',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyTalk/Bus/Terra' ) + '?tour=twa5&step=17&action=edit' 
                } , {
                        name: 'Viatgem més enllà*',
                        onclick: function()  {  if(!mw.config.get('wgUserName')){  alert( "Registreu-vos." );   return;   } sendMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Viquipèdia:Bus_turístic/Badge/10template2' , mw.util.getUrl( 'Viquipèdia:Bus_turístic/5/End' ) + '?tour=twa5&step=19'); }
                } ], 
                allowAutomaticOkay: false

} , {
                //19
                title: '5a etapa completada!',
                description: '<br>[[File:Northern mountains (short).ogg]]<br><b>Viatgem a la 6a etapa...</b>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: 'Felicita\'m!',
                        action: 'end'
                } ],
                allowAutomaticOkay: false
		         
}]
 
} );
 
} (window, document, jQuery, mediaWiki, mediaWiki.guidedTour ) ) ;