MediaWiki:Guidedtour-tour-GTA2.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// Guided Tour to help users start editing
 
( function ( window, document, $, mw, gt ) {
gt.defineTour( {
        name: 'GTA2',
        steps: [ {
                title: 'Need some help?',
                description: 'This tour will show you how to ask other Wikimedia Commons editors for help through the help desk.',
                overlay: true,
                buttons: [ {
                        action: 'next'
                } ],
 
                // shouldSkip is a general tool to skip a step based on their progress towards some goal.  This is used to ensure this step will not be shown once they have started editing.
                // shouldSkip always returns true to skip, or false otherwise.
                shouldSkip: function() {
                        return gt.hasQuery( { section: 'new' } );
                }
        },  {
                title: 'Click \'Add topic\'',
                description: 'This will let you write a message to other editors on the help desk.',
                attachTo: '#ca-addsection',
                position: 'bottom',
                // Same as above.  We plan to make this less repetitive in the future.
                shouldSkip: function() {
                        return gt.hasQuery( { section: 'new' } );
                }
        },
        }, {
                title: 'You\'re almost finished!',
                description: 'Click \'Save\' and your message will be publicly visible.',
                attachTo: '#wpSave',
                position: 'top',
 
                // Normally, guiders will close when the user clicks outside them.  But you may want to disable this in some cases.
                // For example, since people normally click on the edit box, we are disabling them on steps that are on the edit screen.
                closeOnClickOutside: false,
 
                // We skip if they are not doing a preview, show changes, etc.
                shouldSkip: function() {
                        return !gt.hasQuery( { action: 'submit' } );
                }
        }, {
                title: 'Check back soon',
                description: 'Come back to this page soon to see if your message has received a reply.',
                onShow: gt.parseDescription,
                overlay: true,
 
                // We don't want to show this step if they didn't complete an edit.
                // Note that this requires they actually change something, not just click save.
                shouldSkip: function() {
                        return !gt.isPostEdit();
                },
                buttons: [ {
                        action: 'end'
                } ]
        } ]
} );
 
} (window, document, jQuery, mediaWiki, mediaWiki.guidedTour ) );