Línea 1: |
Línea 1: |
− | /*
| + | ( function ( window, document, $, mw, gt ) { |
− | * Guided Tour to test guided tour features.
| |
− | */
| |
− | // Copy the next line into the start of your tour.
| |
− | ( function ( window, document, $, mw, gt ) { | |
− | | |
− | // Declare a variable for use later
| |
| var pageName = 'Help:Guided tours/guider', | | var pageName = 'Help:Guided tours/guider', |
| tour; | | tour; |
− | | + | tour = new gt.TourBuilder( { |
− | tour = new gt.TourBuilder( { | |
− | /*
| |
− | * This is the name of the tour. It must be lowercase, without any hyphen (-) or
| |
− | * period (.) characters.
| |
− | *
| |
− | * The page where you save an on-wiki tour must be named
| |
− | * MediaWiki:Guidedtour-tour-{name}.js , in this example MediaWiki:Guidedtour-tour-mytest.js
| |
− | */
| |
| name: 'inicio' | | name: 'inicio' |
| } ); | | } ); |
| | | |
− | // Information defining each tour step | + | |
− | | |
− | // This tour shows a central overlay at the start of the tour.
| |
− | // Guiders appear in the center if another position is not specified.
| |
− | // To specify the first step of the tour, use .firstStep instead of .step
| |
| tour.firstStep( { | | tour.firstStep( { |
− | name: 'overlay', | + | name: 'portada', |
− | // Note that for on-wiki tours, we use title and description with the actual text.
| + | title: 'Primeros pasos', |
− | // The title appears in the title bar of the guider.
| |
− | title: 'Primeros pasos', | |
− | | |
− | // The description appears in the body
| |
| description: 'Esta es tu puerta de acceso al CNB en línea. ¡Sigue explorando!', | | description: 'Esta es tu puerta de acceso al CNB en línea. ¡Sigue explorando!', |
− | position: 'right', | + | position: 'topRight', |
− | | |
− | // This specifies that there is an overlay behind the guider.
| |
| overlay: true | | overlay: true |
| } ) | | } ) |
− | // This specifies the next step of the tour, and will automatically generate a next button. | + | |
− | // 'callout' refers to the name used in the step immediately below. Although putting the steps
| + | .next( 'portada1' ); |
− | // in a meaningful order is recommended, any step can be specified as next/back.
| |
− | .next( 'callout' ); | |
| | | |
− | tour.step( { | + | tour.step( { |
− | /*
| + | name: 'portada1', |
− | * Callout of left menu
| + | title: 'Primeros pasos', |
− | */
| + | description: 'Desde la portada puedes dirigirte al contenido de cada nivel', |
− | name: 'callout', | + | attachTo: '#n-Inicial', |
− | title: 'Test callouts', | + | position: 'left', |
− | description: 'This is the community portal page.', | |
− | | |
− | // This positions the guider next to a page element, in this
| |
− | // case the portal link (which is "Community portal" on English
| |
− | // Wikipedia, but varies by site).
| |
− | // The string is a jQuery selector. "#n-portal" means the HTML
| |
− | // element with this id attribute, and "a" means an a, or link,
| |
− | // element inside that.
| |
− | attachTo: '#n-portal a', | |
− | | |
− | // This means the guider shows to the right of the Community Portal link
| |
− | position: 'right', | |
| } ) | | } ) |
− | .next( 'description' ) | + | .next( 'portada2' ) |
− | // The 'back' property specifies that you can go back from this step, and where to go
| + | .back( 'portada' ); |
− | // if the back button is clicked.
| |
− | .back( 'overlay' ); | |
| | | |
| tour.step( { | | tour.step( { |