MediaWiki:Guidedtour-tour-twa2.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.
// 2a etapa del Bus turístic
// The Wikipedia Adventure Mission 2
( 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 des del [[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',
onclick: function() {
window.location.href = window.location.href +
"&veaction=edit";
}
} );
}
gt.defineTour( {
name: 'twa2',
shouldLog: true,
steps: [ {
//1
title: 'Comencem la 2a etapa!',
description: '<br><div align="right">[[File:Wikipe-tan head.png|80px|link=]]</div>Benvinguts de nou. En aquest viatge veurem com comunicar-nos amb altres editors.<br><br>',
onShow: gt.parseDescription,
overlay: true,
closeOnClickOutside: false,
buttons: [ {
name: 'Som-hi',
action: 'next',
} ],
allowAutomaticOkay: false
}, {
//2
title: 'La pàgina de discussió',
description: '<br><div align="right">[[File:Wikipe-tan head.png|80px|link=]]</div>A més d\'una pàgina d\'usuari, tot editor té també la seva pàgina de discussió. La gent us pot deixar missatges.<br><br>Ei, mireu això ... algú us ha enviat un missatge.<br><br>',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/2/Start' ) + '?tour=twa2&step=1'
} , {
name: 'Comprova el nou missatge*',
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/1' , mw.util.getUrl( 'Special:MyTalk/Bus' ) + '?tour=twa2&step=3'); }
} ],
allowAutomaticOkay: false
}, {
//3
title: 'Gent real',
description: '<br><div align="left">[[File:Wikitanface.png|100px|link=]]</div>Guau, aquí hi ha gent com jo.<br><br>Anem a respondre al missatge.<br><br>',
onShow: gt.parseDescription,
attachTo: '#content.mw-body',
position: 'bottom',
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/2/Start' ) + '?tour=twa2&step=2'
} , {
name: 'Resposta a Ben',
action: 'externalLink',
url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/2/Ben' ) + '?tour=twa2&step=4'
} ],
allowAutomaticOkay: false
}, {
//4
title: 'Descobriu-ho vosaltres mateixos...',
description: 'Consell: podeu aprendre tant fent-ho bé com malament. Sempre podeu intentar-ho 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' ) + '?tour=twa2&step=3'
} ],
}, {
//5
title: 'Escriviu la resposta',
description: '<br>Cliqueu MODIFICA EL CODI per deixar un missatge a Ben<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/2/Ben' ) + '?tour=twa2&step=4'
} ],
shouldSkip: function() {
return gt.hasQuery( { action: 'edit' } );
}
}, {
//6
title: 'Copia el missatge',
description: '<br><div align="left">[[File:Wikitanface.png|100px|link=]]</div>Copia i enganxa la millor resposta en la caixa d\'edició, al final sota del missatge de Ben<br><br>:Moltes gràcies per la calurosa benvinguda <nowiki>[[Usuari:Benvolent]]</nowiki>. No puc esperar a començar a editar! <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' ) + '?tour=twa2&step=5'
} , {
name: 'Copiat',
action: 'next',
} ],
allowAutomaticOkay: false
}, {
//7
title: 'Tres coses ràpides',
description: '<br><b>Sagneu</b> les respostes amb dos punts <code > : </code> per moure el text una mica a la dreta indicant que esteu responent al missatge anterior.<br><br> <b>Signeu</b> els missatges amb <code><nowiki>~~~~</nowiki></code> per deixar marcat el vostre nom i data. Només signem en pàgines de discussió, no en articles.<br><br><b>Notifiqueu</b> a Ben que l\'heu respost escrivint el seu nom enllaçat en algun lloc de la resposta, com <code><nowiki>[[Usuari:Benvolent]]</nowiki></code>. Si esteu en la seva pàgina de discussió ja rebrà la notificació automàticament.',
attachTo: '#wpTextbox1',
position: 'bottomRight',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyTalk/TWA' ) + '?tour=twa2&step=6&action=edit'
} , {
name: 'Ja ho entenc',
action: 'next'
} ],
allowAutomaticOkay: false,
} , {
//8
title: 'Resum i Desar',
description: '<br>Afegiu un resum dels canvis, alguna cosa com: "Gràcies per la benvinguda".<br><br>Cliqueu DESA LA PÀGINA quan ho tingueu a punt.<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' ) + '?tour=twa2&step=7&action=edit'
} ],
shouldSkip: function() {
return gt.isPostEdit();
},
buttons: postEditButtons
} , {
//9
title: 'Sagnat, signat i notificat!',
description: 'NOU ESCALAFÓ: <b>Distinció de comunicador</b><center>[[File:TWA badge 3.png|250px|link=]]</center><br>',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyTalk/Bus' ) + '?tour=twa2&step=8&action=edit'
} , {
name: 'Seguim parlant*',
onclick: function() { if(!mw.config.get('wgUserName')){ alert( "Registreu-vos." ); return; } sendMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Viquipèdia:Bus_turístic/Badge/3template2' , mw.util.getUrl( 'Viquipèdia:Bus_turístic/2/Start' ) + '?tour=twa2&step=10'); }
} ],
allowAutomaticOkay: false
} , {
//10
title: 'El poder de la comunicació!',
description: '<br><div align="right">[[File:Wikipe-tan head.png|80px|link=]]</div>Què passa si teniu moltes converses alhora? Com podeu seguir-les totes?<br><br>',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyTalk/Bus' ) + '?tour=twa2&step=9'
} , {
name: 'És un problema bo de tenir...',
action: 'next'
} ],
}, {
//11
title: 'Una solució',
description: '<br>La llista de seguiment. El vostre propi canal de canvis en els articles i pàgines que vulgueu seguir.<br><br>Per seguir una pàgina només cal clicar l\'estrella de dalt de la pàgina. Quan es torna blava ja l\'esteu seguint! (També ho podeu configurar a les vostres preferències).<br><br>Cliqueu SEGUIMENT.',
attachTo: '#pt-watchlist',
position: 'bottomLeft',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyTalk/Bus' ) + '?tour=twa2&step=10'
} ],
shouldSkip: function() {
return gt.isPage( 'Especial:Llista_de_seguiment' );
}
} , {
//12
title: 'Comprovació de la llista de seguiment',
description: '<br><div align="left">[[File:Wikitanface.png|100px|link=]]</div>Una cosa <i>força</i> interessant és que cada una de les edicions queden registrades. Això permet comprovar la feina feta pels altres i ens permet poder-los ajudar.<br>',
onShow: gt.parseDescription,
attachTo: '#content.mw-body',
position: 'bottom',
overlay: false,
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyTalk/Bus' ) + '?tour=twa2&step=11'
} , {
name: 'El nostre lema',
action: 'next'
} ],
} , {
//13
title: 'Llanceu-vos-hi',
description: 'És realment difícil espatllar res aquí, perquè sempre es pot tornar a una versió anterior de la pàgina.<br><br>Tranquilitzant, no?<br><br> Per això el nostre lema és <b>llanceu-vos-hi!</b><br><br>',
onShow: gt.parseDescription,
overlay: true,
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:Watchlist' ) + '?tour=twa2&step=12'
} , {
name: 'Més enllà del seguiment',
action: 'next'
} ],
} , {
//14
title: 'Les vostres contribucions',
description: '<br>A més de seguir els canvis en totes les pàgines de la vostra llista de seguiment, també podeu seguir les vostres edicions.<br><br>Cliqueu CONTRIBUCIONS.',
onShow: gt.parseDescription,
overlay: false,
attachTo: '#pt-mycontris',
position: 'bottomLeft',
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:Watchlist' ) + '?tour=twa2&step=13'
} ],
shouldSkip: function() {
return gt.isPage( 'Especial:Contribucions/' + mw.config.get( 'wgUserName' ).replace(/ /g, '_') );
}
} , {
//15
title: 'Tota la vostra feina',
description: '<br>Aquí teniu totes les vostres contribucions fins ara. De moment seran en la vostra pàgina d\'usuari i de discussió...<br><br>Anem a veure què més podem fer.<br><br>Oh, un moment, sembla que teniu un nou missatge.<br><br>',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:Watchlist' ) + '?tour=twa2&step=14'
} , {
name: 'Comprova el nou missatge*',
onclick: function() { if(!mw.config.get('wgUserName')){ alert( "Registre-vos." ); return; } sendMessage( 'User talk:' + mw.config.get( 'wgUserName' ) + '/Bus', 'Viquipèdia:Bus_turístic/MyTalk/2' , mw.util.getUrl( 'Special:MyTalk/Bus' ) + '?tour=twa2&step=16'); }
} ],
allowAutomaticOkay: false
} , {
//16
title: 'Una invitació',
description: '<br><div align="right">[[File:Wikipe-tan head.png|80px|link=]]</div>Perfecte, alguna cosa sobre la que treballar...<br><br>',
onShow: gt.parseDescription,
attachTo: '#content.mw-body',
position: 'bottom',
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl ('Special:Contributions/' ) + mw.config.get( 'wgUserName' ) + '?tour=twa2&step=15'
} , {
name: 'Resposta a GaiaNoia',
action: 'externalLink',
url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/2/Gaia' ) + '?tour=twa2&step=17'
} ],
allowAutomaticOkay: false
}, {
//17
title: 'Descobriu-ho vosaltres mateixos...',
description: 'Consell: podeu aprendre tant fent-ho bé com malament. Sempre podeu intentar-ho 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' ) + '?tour=twa2&step=16'
} ],
}, {
//18
title: 'Resposta',
description: '<br>Cliqueu MODIFICA EL CODI per poder deixar una 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/2/Gaia' ) + '?tour=twa2&step=17'
} ],
shouldSkip: function() {
return gt.hasQuery( { action: 'edit' } );
}
}, {
//19
title: 'Escriviu un missatge',
description: '<br>Copieu la resposta en la caixa de text sota el de GaiaNoia.<br><br>:Perfecte <nowiki>[[Usuari:GaiaNoia86]]</nowiki>, és el meu planeta favorit! Com hi puc ajudar? <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' ) + '?tour=twa2&step=18'
} , {
name: 'Copiat',
action: 'next'
} ],
allowAutomaticOkay: false
}, {
//20
title: 'Resum i Desar',
description: '<br>Afegiu un resum de l\'edició. Com ara, "M\'agradaria participar".<br><br>Cliqueu DESA LA PÀGINA quan ho tingueu a punt.<br><br>',
onShow: gt.parseDescription,
overlay: false,
attachTo: '#wpSave',
position: 'bottomRight',
autoFocus: 'yes',
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl ( 'Special:MyTalk/Bus' ) + '?tour=twa2&step=19&action=edit'
} ],
shouldSkip: function() {
return gt.isPostEdit();
},
buttons: postEditButtons
} , {
//21
title: 'Tic-tac, tic-tac',
description: '<br><div align="right">[[File:Wikipe-tan head.png|80px|link=]]</div>Anem a recarregar la pàgina a veure si GaiaNoia ha respost!',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl ( 'Special:MyTalk/Bus' ) + '?tour=twa2&step=20&action=edit'
} , {
name: 'Al voltant de la Terra*',
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/3' , mw.util.getUrl( 'Special:MyTalk/Bus' ) + '?tour=twa2&step=22'); }
} ],
} , {
//22
title: 'Adreça?',
description: '<br><div align="right">[[File:Wikipe-tan head.png|80px|link=]]</div>Ja t\'hi porto. Segeueix-me a la TERRA.<br><br>',
onShow: gt.parseDescription,
overlay: false,
attachTo: '#content.mw-body',
position: 'bottom',
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl ( 'Special:MyTalk/Bus' ) + '?tour=twa2&step=21'
} , {
name: 'Cap a la Terra',
action: 'externalLink',
url: mw.util.getUrl( 'Viquipèdia:Bus_turístic/2/End' ) + '?tour=twa2&step=23'
} ],
} , {
//23
title: 'Hem arribat al final de la 2a etapa!',
description: '<br>[[File:Ringtone (3).ogg]]<br><b>Viatge per la 3a etapa...</b>',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: 'Felicita\'m!',
action: 'end'
} ],
allowAutomaticOkay: false
}]
} );
} (window, document, jQuery, mediaWiki, mediaWiki.guidedTour ) ) ;