User:Resutant edition/tour.js

From mediawiki.org

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/*

-------------------------------TASK 1---------------------------
--------A mini-tour that tells about the search feature---------

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


    tour = new gt.TourBuilder( {
        name: 'minitour',
        // Specify that we want logging for this tour
        shouldLog: true
    } );

    tour.firstStep( {
        name: 'intro',
        title: 'Search from all over the page',
        description: 'Write in this input area to search all over the MediaWiki page',
        attachTo: '#searchInput',
        position: 'right',
        allowAutomaticNext: false,
        buttons: [ {
            action: 'next',
            onclick: function () {
                    mw.libs.guiders.next();
            }
        } ]
    } )
    .next( 'searchSection' );

    tour.step( {
        name: 'searchSection',
        title: 'Search Button',
        description: 'after writing in the input area you can Click here to get you results...',
        position: 'right',
        attachTo: '#searchButton',
        autoFocus: true,
        width: 300
    } )
    .transition( function () {
        return gt.TransitionAction.END;
    } )
    .back( 'intro' );

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