MediaWiki:Guidedtour-tour-twa7sandbox.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// The Wikipedia Adventure Mission 7

( function ( window, document, $, mw, gt ) {

//automatic api:edit function to send yourself messages 
function sendTalkMessage( targetPage, msgPage, linkTo, overwrite, isTalkPost) {
	if(!mw.config.get('wgUserName')) {  
		alert( "Please login." );   
		return;
	}
    var api = new mw.Api();
    api.get( {
        'action' : 'query',
        'titles' : msgPage+'|'+targetPage,
        'prop'   : 'revisions',
        'meta'   : 'tokens',
        'type'   : 'csrf',
        'rvprop' : 'content',
        'indexpageids' : 1
    } ).done( function (result) {
        result = result.query;
        var page = result.pages[result.pageids[1]];
        var text = page.revisions[0]['*'];
        text = text.replaceAll("<nowiki/>","");
        if (result.pageids[0] > 0) {
            var targetSrc = result.pages[result.pageids[0]];
            var srcText = targetSrc.revisions[0]['*'];
            if (!overwrite) {
            	// Check for duplicate talk messages with only the first 20 characters in case the messages subst into something different
            	if (isTalkPost && srcText.includes(text.substring(0, 20))) {
        			// Don't send duplicate badges/talk posts
        			window.location.href = linkTo;
        			return;
        		} else if (srcText.includes(text)) {
        			// Check for duplicate badges literally
        			window.location.href = linkTo;
        			return;
        		}
            	if (isTalkPost) {
            		// Preserve the banner for talk posts
	                text = srcText.replace("</div></div></div>","") + "\n" + text + "</div></div></div>"; 
            	} else {
            		// Otherwise just add for badges
            		text = srcText + "\n" + text;
            	}
           }
        }
        api.post( {
            'action' : 'edit',
            'title' : targetPage,
            'text' : text,
            'summary' : 'New Message (simulated automatically as part of [[WP:The Wikipedia Adventure|The Wikipedia Adventure]])',
            'token' : result.tokens.csrftoken
        } ).done( function () {
        	window.location.href = linkTo;
        } );
    } );
}

var tour = new gt.TourBuilder( {
        name: 'twa7sandbox',
});
var steps = [{
                //1
                title: 'Let\'s see what\'s new! ',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>We\'re starting off right at the Earth article.<br><br>'),
                overlay: true,
                buttons: [ {
                        name: 'Head to Earth*',
                        onclick: function()  {sendTalkMessage( 'User:' + mw.config.get( 'wgUserName' ) + '/TWA/Earth/2', 'Wikipedia:TWA/Earth/4' , mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=2', true, true); }           
                } ],
		        allowAutomaticOkay: false,
 
        },  {
                //2
                title: 'Wow! What vibrant additions!',
                description:  new gt.WikitextDescription('<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>How on Earth did *that* happen?<br><br>'),
                attachTo: '#content.mw-body',
                position: 'bottom',
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/1/Start' ) + '?tour=twa7&step=1'          
                } , {
                        name: 'Find out how in the page History',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/Earth/History/2' ) + '?tour=twa7&step=3'
 
                } ],
                allowAutomaticOkay: false,
 
        },  {
                //3
                title: 'History of Earth',
                description:  new gt.WikitextDescription('<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>This is what collaboration on Earth looks like.<br><br>'),
                overlay: false,
                attachTo: '#content.mw-body',
                position: 'bottom',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=2'          
                } , {
                        name: 'Pretty neat, huh?',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/7/Start' ) + '?tour=twa7&step=4'      
                } ],
               
 
        },  {

                //4
                title: 'Wiki Wiki!',
                description:  new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>The name Wikipedia is based on the Hawaiian word Wiki, which means *quick*.<br><br> Wikis let people collaborate from all across the globe at the same time, and when people work together amazing things happen at an awesome pace.<br><br>'),
                overlay: false,
                closeOnClickOutside: false,
	            allowAutomaticOkay: false,
		        buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/Earth/History/2' ) + '?tour=twa7&step=3'          
                } , {
                        name: 'But how does it "work"?',
                        action: 'next'      
                } ],



        },  {
                //5
                title: 'Wikipedia Works',
                description:  new gt.WikitextDescription('<br>How does something so open remain reliable?<br><br>Wikipedia works because changes go through a virtual filter of intelligent-computer and human review.<br><br> Automated "bots" reject and rank suspicious edits.  Then thousands of people are constantly scouring new changes, and millions of readers keep an eye out for anything that seems off.<br><br>Most people want to help, and there are many more who want to do good than bad.  That\'s how it works.'),
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                 buttons: [ {
                        name: '<big>←</big>',
                        action: 'back',
                } , {
                        name: 'Linus\' Law?',
                        action: 'next'      
                } ],

        },  {
                //6
                title: 'Linus\' Law',
                description:  new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>Research has shown that Wikipedia is just as accurate as other encyclopedias, but its errors get fixed *faster*.<br><br>We are living proof of the coders\' motto that:<br><br><b>"With enough eyeballs, all bugs are shallow"</b>.<br><br> In other words, <i>all of us</i> make <i>anything</i> possible.</br><br>'),
                overlay: false,
                closeOnClickOutside: false,
	            allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/7/Start' ) + '?tour=twa7&step=5'          
                } , {
                        name: 'Take Earth to the next level',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=7'      
                } ],	

},  {
                //7
                title: 'Earth Needs to Sparkle',
                description:  new gt.WikitextDescription('<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>This collaborative process added so much stellar content to Earth, but Earth is still looking a bit—well, it lacks *pizazz*<br><br>'),
                overlay: false,
                closeOnClickOutside: false,
	            allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/7/Start' ) + '?tour=twa7&step=6'          
                } , {
                        name: 'Spruce up Earth',
                        action: 'next'
                } ],	


} , {
                //8
                title: 'Articles should look great, too.',
                description:  new gt.WikitextDescription('<br><div align="left">[[File:TWA_guide_right_top.png|link=]]</div>Let\'s make that happen, starting with sections.<br><br>As an article gets longer, we break the text into sections to make it more pleasant and easy to read. A table of contents will magically appear if there are enough sections.<br><br>'),
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=7'          
                } , {
                	    name: 'Add some section magic!',
                        action: 'next',
                        } ],
                allowAutomaticOkay: false
				
} , {

                //9
                title: 'Click edit',
                description: new gt.WikitextDescription('<br>Click EDIT so you can add sections.<br><br>'),
                attachTo: '#ca-edit',
                position: 'bottom',
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=8'          
                } ],
                skip: "vefork",
                hooks: "ve.activationComplete",
        },  {
                //10
                title: 'Add section headings',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>First, highlight the section title "Shape and structure".<br><br>Then Click PARAGRAPH in the toolbar to show the HEADING menu.  You want to use HEADING for the standard header level.<br><br>Do the same for EACH of the section titles:<br>1) Shape and structure<br>2) Tectonic plates<br>3) Surface<br>4) Atmosphere<br>5) Weather, climate, and water cycle<br>6) Orbit and rotation<br>7) References<br><br>'),
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                overlay: false,
                attachTo: "#bodyContent",
                position: 'leftTop',
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=9'          
                } , {
                	    name: 'Added headings',
                        action: 'next',
                } ],

 },  {
                //11
                title: 'A note for the future',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>We only capitalize the first word of a section heading, unless it\'s a proper noun.<br><br>Also, you can have sections within sections by selecting a sub-heading (so Sub-Heading 1 would go inside heading, Sub-Heading 2 would go inside Sub-Heading 1, and so on)<br><br>Now click PUBLISH CHANGES.'),
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                overlay: false,
                attachTo: "#bodyContent",
                position: 'leftTop',
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=10&action=edit'          
                }],
                skip: function(transitionEvent) {
                	return transitionEvent.type === gt.TransitionEvent.MW_HOOK && transitionEvent.hookName == "ve.saveDialog.stateChanged";
                },
                hooks: "ve.saveDialog.stateChanged"

} , {
                //12
                title: 'Edit summary and Publish',
                description: new gt.WikitextDescription('<br>Let them know that you, "Added section headings".<br><br>Then PUBLISH CHANGES when you\'re ready.'),
                attachTo: "#footer",
                position:"bottom",
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: 'Go back',
                        action: 'back'          
                } ],
                skip: gt.isPostEdit,
} , {
                //13
                title: 'Keep going',
                description: new gt.WikitextDescription('<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>That looks better already just with some simple formatting.<br><br>Now let\'s connect Earth to the rest of the universe with some WIKILINKS to other articles, like the ones you used on your userpage bio..<br><br>'),
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=12&action=edit'          
                }, {
                	    name: 'Wikilink it',
                        action: 'next',
                        } ],
                allowAutomaticOkay: false
} , {
                //14
                title: 'Click edit',
                description: new gt.WikitextDescription('<br>Click EDIT so you can add wikilinks.<br><br>'),
                attachTo: '#ca-edit',
                position: 'bottom',
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'back',
                }],
                skip: "vefork",
                hooks: "ve.activationComplete"
        },  {
                //15
                title: 'Add wikilinks',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>Here\'s a list of key words and phrases to wikilink <i>inside the paragraph text</i> of each section.  You can do them all, or just a few... <br><br>*Shape and structure: <b>circumference</b><br>*Tectonic plates: <b>plate tectonics</b> (just the first mention)<br>*Surface: <b>urbanisation</b><br>*Atmosphere: <b>methane</b><br>*Weather, climate, and water cycle: <b>convection</b><br>*Orbit and rotation: <b>Orion Arm</b> <br><br>Highlight one at a time in the article, and click the [[File:OOjs UI icon link-ltr.svg]] button on the toolbar and then click DONE.<br><br>'),
                overlay: false,
                attachTo: "#bodyContent",
                position: 'leftTop',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=14&action=edit'          
                }, {
                	    name: 'Wikilinks added',
                        action: 'next',
                        } 
               ],

 },  {
                //16
                title: 'Another note for the future',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>We add wikilinks to relevant and important terms in an article so people can learn more about those terms. You don\'t want to Wikilink *everything*, just the special and directly connected concepts.<br><br>Now click PUBLISH CHANGES to continue.'),
                overlay: false,
                attachTo: "#bodyContent",
                position: 'leftTop',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'back',
                }],
                skip: function(transitionEvent) {
                	return transitionEvent.type === gt.TransitionEvent.MW_HOOK && transitionEvent.hookName == "ve.saveDialog.stateChanged";
                },
                hooks: "ve.saveDialog.stateChanged"
} , {
                //17
                title: 'Edit summary and Publish',
                description: new gt.WikitextDescription('<br>Let them know that you, "Added wikilinks to relevant and unique terms".<br><br>Then PUBLISH CHANGES when you\'re ready.'),
                attachTo: "#footer",
                position:"bottom",
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: 'Go back',
                        action: 'back'          
                } ],
                skip: function(transitionEvent) {
                	 // Can't use gt.isPostEdit here since it still things we're postedit from the previous save
                	 return transitionEvent.type === gt.TransitionEvent.MW_HOOK && transitionEvent.hookName == "postEdit";
                }
} , {
                //18
                title: 'Great job!',
                description: new gt.WikitextDescription('NEW TOOL EARNED:  <b>WikiLinker Badge</b><div class="center">[[File:TWA badge 12.png|250px|link=]]</div><br>People will be busy all day learning about Earth and its related subjects.<br>'),
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=17&action=edit'          
                } , {
                        name : 'Now Earth needs...*',
                        onclick: function() {sendTalkMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Wikipedia:TWA/Badge/13template2' , mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=19', false, false); } 
                } ],
                allowAutomaticOkay: false
} , { 
                //19
                title: 'Hmm...',
                description: new gt.WikitextDescription('<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>You know what this article is missing? A few vivid and relevant images to give readers an immersive and educational bonus as they read the article.  Where could we get some?<br><br>'),
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'back',
                } , {
                	    name: 'Free as in freedom',
                        action: 'next',
                        } ],
                allowAutomaticOkay: false
	

        },  {
                //20
                title: 'What we have in Commons',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>Images are stored on Wikipedia\'s sister site <br><strong>Wikimedia Commons</strong>.<br><br> You see, Wikipedia is part of the <b>Wikimedia movement</b>, a collection of projects that all focus on free knowledge in different ways. And not just in English, but in hundreds of other languages, too!<br><br>The <b>Wikimedia Foundation</b> in San Francisco develops our technology, handles our fundraising, and supports the community with grants and other programs.<br><br>'),
                overlay: true,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'back',
                } , {
                	    name: 'Neat!',
                        action: 'next',
                        } ],

 },  {
                //21
                title: 'The treasures of the Commons',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>Commons has an enormous collection of images, audio files, and video, and it\'s growing every day... over 100 million files!<br><br>These images are free for anyone to use, modify, or even sell! Just like Wikipedia\'s content :)<br><br>Let\'s check the Earth talk page. Maybe someone has some image suggestions for you.<br><br>'),
                overlay: true,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=20'          
                } , {
                        name: 'Check out Talk*',
                        onclick: function()  {  sendTalkMessage( 'User talk:' + mw.config.get( 'wgUserName' ) + '/TWA/Earth', 'Wikipedia:TWA/Earth/Talk/5' , mw.util.getUrl( 'Special:MyTalk/TWA/Earth' ) + '?tour=twa7&step=22', false, true); }           
                } ],
                allowAutomaticOkay: false,

},  {
                //22
                title: 'Adding images',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>Ok, let\'s go back to Earth and add some of these great images.  I\'ll show you how.<br><br>'),
                overlay: false,
                attachTo: '#content.mw-body',
                position: 'bottom',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=21'          
                } , {
                        name: 'Add \'em',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=23'      
                } ],             

} , {

                //23
                title: 'Click edit',
                description: new gt.WikitextDescription('<br>Click EDIT so you can add those images.<br><br>'),
                attachTo: '#ca-edit',
                position: 'bottom',
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=22'          
                } ],
                skip: "vefork",
                hooks: "ve.activationComplete"
} , {
                //24
                title: 'How to Image. It\'s easy!',
                description: new gt.WikitextDescription('<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>First, COPY the filename: <b>The Blue Marble.jpg</b><br><br> Now click your mouse beneath the first section heading (Shape and structure)<br><br> Then click open the INSERT menu of the toolbar and click the the "[[File:OOjs UI icon image-ltr.svg]] Images and Media" entry.<br><br> Last, PASTE into the filename box, click on the image you want once it loads.<br><br>Then click USE THIS IMAGE and finally INSERT to add the image to the article.<br>'),
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                overlay: false,
                attachTo: "#bodyContent",
                position: 'leftTop',
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=23'          
                } , {
                	    name: 'Added the first image',
                        action: 'next',
                        } ],

} , {

                //25
                title: 'More image beauty',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>Use the rest of the images from GaiaGirl, copying each filename and then inserting it into the article, one at a time, under each section heading of the article (except for References):<br><br>Tectonic plates (empty).svg<br>Global View of the Arctic and Antarctic.jpg <br>Top of Atmosphere.jpg<br>HydrologicalCycle1.png<br>North season.jpg<br><br>When you\'re done, click PUBLISH CHANGES.<br />'),
                overlay: false,
                attachTo: "#bodyContent",
                position: 'leftTop',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'back',
                }],
                skip: function(transitionEvent) {
                	return transitionEvent.type === gt.TransitionEvent.MW_HOOK && transitionEvent.hookName == "ve.saveDialog.stateChanged";
                },
                hooks: "ve.saveDialog.stateChanged"
} , {
                //26
                title: 'Edit summary and Publish',
                description: new gt.WikitextDescription('<br>Let them know that you, "Added an image to each section".<br><br>Then PUBLISH CHANGES when you\'re ready.<br><br>'),
                attachTo: "#footer",
                position:"bottom",
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: 'Go back',
                        action: 'back'          
                } ],
                skip: gt.isPostEdit
},  {
                //27
                title: 'Wow',
                description: new gt.WikitextDescription('NEW TOOL EARNED:  <b>Illustrator Badge</b><div class="center">[[File:TWA badge 12.png|250px|link=]]</div><br>Take a look at what you\'ve done. What a beautiful Earth you\'ve created.<br>'),
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=26&action=edit'          
                } , {
                        name: 'Soak it in*',
                        onclick: function()  { sendTalkMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Wikipedia:TWA/Badge/14template2' , mw.util.getUrl( 'Wikipedia:TWA/7/Start' ) + '?tour=twa7&step=28', false, false); } 
                } ],

},  {
                //28
                title: 'You.',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>You added a new level to the pyramid of knowledge in the temple of Earth. A redwood tree in the forest of culture and civilization. A ferris-wheel at the carnival of humanity...<br><br> You get the idea...!  Hey, and you have a new message!<br><br>'),
                overlay: true,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=27'          
                } , {
                        name: 'Check your messages*',
                        onclick: function()  {  sendTalkMessage( 'User talk:' + mw.config.get( 'wgUserName' ) + '/TWA', 'Wikipedia:TWA/MyTalk/8' , mw.util.getUrl( 'Special:MyTalk/TWA' ) + '?tour=twa7&step=29', false, true); }           
                } ],
                allowAutomaticOkay: false,

},  {
                //29
                title: ':-)',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>It feels gooooood to be noticed, acknowledged, and recognized for your contributions.<br><br>We call that <b>WikiLove</b>, and when you see someone doing something great, you should tell them!  It\'s easy if you just click the [[File:WikiLove icon.PNG]] icon at the top of any user\'s page.<br><br> I like it here. I hope you do, too. I\'m proud of you. And I think you\'re ready.<br><br>'),
                overlay: false,
                attachTo: '#content.mw-body',
                position: 'bottom',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/7/Start' ) + '?tour=twa7&step=28'          
                } , {
                        name: 'Go Explore*',
                        onclick: function()  {  sendTalkMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Wikipedia:TWA/Badge/15template2' , mw.util.getUrl( 'Wikipedia:TWA/7/End' ) + '?tour=twa7&step=30', false, false); }           
                } ],

} , {
                //30
                title: 'The Wikipedia Adventure BEGINS',
                description: new gt.WikitextDescription('<div align="left">[[File:TWA_guide_left_top.png|link=]]</div>You can change the world.  Go make a better Earth.  I\'ll see you there!<div align="right">[[File:TWA_guide_right_top.png|link=]]</div>'),
                overlay: false,
                closeOnClickOutside: true,
	            buttons: [ {
	        	        name: 'CONGRATS ME!!',
                        action: 'end'
                } ],
                allowAutomaticOkay: false
		       
}];
var sourceEditorStepOverrides = {
	10: {
				title: 'Add section headings',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>First, highlight the section title "Shape and structure".<br><br>Then Click ADVANCED in the toolbar to show the HEADING menu.  You want to use Heading LEVEL 2.<br><br>Do the same for EACH of the section titles:<br>1) Shape and structure<br>2) Tectonic plates<br>3) Surface<br>4) Atmosphere<br>5) Weather, climate, and water cycle<br>6) Orbit and rotation<br>7) References<br><br>'),
                overlay: false,
                attachTo: '#wpTextbox1', 
                position: 'bottomRight',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=9'          
                } , {
                	    name: 'Added headings',
                        action: 'next',
                } ],
	}, 11: {
		        title: 'A note for the future',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>We only capitalize the first word of a section heading, unless it\'s a proper noun.<br><br>Also, you can have sections within sections by selecting a higher level Heading (so Level 3 would go inside Level 2)<br><br>'),
                overlay: false,
                attachTo: '#wpTextbox1', 
                position: 'bottomRight',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=10&action=edit'          
                } , {
                	    name: 'Got it',
                        action: 'next',
               } ],
	}, 12: {
                title: 'Edit summary and Publish',
                description: new gt.WikitextDescription('<br>Let them know that you, "Added section headings".<br><br>Then PUBLISH when you\'re ready.'),
	            attachTo: '#wpSave',
                position: 'bottomRight',
                autoFocus: 'yes',
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'back',
                }],
                skip: gt.isPostEdit
	}, 15: {
                title: 'Add wikilinks',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>Here\'s a list of key words and phrases to wikilink <i>inside the paragraph text</i> of each section.  You can do them all, or just a few... <br><br>*Shape and structure: <b>circumference</b><br>*Tectonic plates: <b>plate tectonics</b> (just the first mention)<br>*Surface: <b>urbanisation</b><br>*Atmosphere: <b>methane</b><br>*Weather, climate, and water cycle: <b>convection</b><br>*Orbit and rotation: <b>Orion Arm</b> <br><br>Highlight one at a time in the article, and click the [[File:OOjs UI icon link-ltr.svg]] button on the toolbar and then click INSERT LINK.<br><br>'),
                overlay: false,
                attachTo: '#wpTextbox1', 
                position: 'bottomRight',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=14&action=edit'          
                }, {
                	    name: 'Wikilinks added',
                        action: 'next',
                } ],
	}, 16: {
		        title: 'Another note for the future',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>We add wikilinks to relevant and important terms in an article so people can learn more about those terms. You don\'t want to Wikilink *everything*, just the special and directly connected concepts.<br><br>'),
                overlay: false,
                attachTo: '#wpTextbox1', 
                position: 'bottomRight',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'back',
                }, {
                	    name: 'Got it',
                        action: 'next',
                } ],
	}, 17: {
		        title: 'Edit summary and Publish',
                description: new gt.WikitextDescription('<br>Let them know that you, "Added wikilinks to relevant and unique terms".<br><br>Then PUBLISH when you\'re ready.'),
	            attachTo: '#wpSave',
                position: 'bottomRight',
                autoFocus: 'yes',
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'back',
                }],
                skip: gt.isPostEdit
	}, 24: {
		        title: 'How to Image. It\'s easy!',
                description: new gt.WikitextDescription('<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>First, COPY the filename: <b>The Blue Marble.jpg</b><br><br> Now click your mouse beneath the first section heading (Shape and structure)<br><br> Then Click the [[File:OOjs UI icon image-ltr.svg]] on the top <i>left</i> of the toolbar.<br><br> Last, PASTE into the filename box and INSERT the image.<br><br>'),
                overlay: false,
                attachTo: '#wpTextbox1', 
                position: 'bottomRight',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage/TWA/Earth/2' ) + '?tour=twa7&step=23'          
                } , {
                	    name: 'Added the first image',
                        action: 'next',
                } ],
	}, 25: {
		        title: 'More image beauty',
                description: new gt.WikitextDescription('<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>Use the rest of the images from GaiaGirl, copying each filename and then inserting it into the article with the IMAGE button, one at a time, under each section heading of the article (except for References):<br><br>Tectonic plates (empty).svg<br>Global View of the Arctic and Antarctic.jpg <br>Top of Atmosphere.jpg<br>HydrologicalCycle1.png<br>North season.jpg<br><br>'),
                overlay: false,
                attachTo: '#wpTextbox1', 
                position: 'bottomRight',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'back',
                } , {
                	    name: 'All images added!',
                        action: 'next',
                } ],
	}, 26: {
		        title: 'Edit summary and Publish',
                description: new gt.WikitextDescription('<br>Let them know that you, "Added an image to each section".<br><br>Then PUBLISH when you\'re ready.<br><br>'),
	            attachTo: '#wpSave',
                position: 'bottomRight',
                autoFocus: 'yes',
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'back',
                }],
                skip: gt.isPostEdit
	}
};
var stepBuilders = [];
var sStepBuilders = []; 
function makeSkip(target, query) {
	return function(event) {
		if (query(event)) {
			return target;
		}
	};
}
function makeVeSkip(target1, target2) {
	return function(transitionEvent) {
		// Can't use gt.isEditingWithVisualEditor here because there are sometimes multiple VE events on the same page without a reload
		if (transitionEvent.type === gt.TransitionEvent.MW_HOOK && transitionEvent.hookName == "ve.activationComplete") {
			return target1;
		} else if (gt.isEditingWithWikitext()) {
			return target2;
		} 
	};
}
for (var i = 0; i < steps.length; i++) {
	var step = steps[i];
	step.allowAutomaticNext = false;
	step.name = (i+1).toString();
	var stepBuilder;
	if (i == 0) {
		stepBuilder = tour.firstStep(step);
	} else {
		stepBuilder = tour.step(step);
	}
	stepBuilders[i] = stepBuilder;
	if (sourceEditorStepOverrides[i]) {
		var sStep = sourceEditorStepOverrides[i];
		sStep.allowAutomaticNext = false;
		sStep.name = i.toString()+"src";
		sStepBuilders[i-1] = tour.step(sStep);
	}
}
for (var j = 0; j < steps.length; j++) {
	if (steps[j].hooks) {
		stepBuilders[j].listenForMwHooks(steps[j].hooks);
	}
	if (steps[j].skip) {
		if (steps[j].skip == "vefork") {
			stepBuilders[j].transition(makeVeSkip(stepBuilders[j+1], sStepBuilders[j+1]));
		} else {
			stepBuilders[j].transition(makeSkip(stepBuilders[j+1], steps[j].skip));
		}
	}
	if (sourceEditorStepOverrides[j] && sourceEditorStepOverrides[j].skip) {
		sStepBuilders[j-1].transition(makeSkip(sStepBuilders[j] || stepBuilders[j], sourceEditorStepOverrides[j].skip));
	}
	if (j > 0) {
		stepBuilders[j].back(stepBuilders[j-1]);
		if (sStepBuilders[j] && sStepBuilders[j-1]) {
			sStepBuilders[j].back(sStepBuilders[j-1]);
		}
	}
	if (j < steps.length - 1) {
		stepBuilders[j].next(stepBuilders[j+1]);
		if (sStepBuilders[j] && sStepBuilders[j+1]) {
			sStepBuilders[j].next(sStepBuilders[j+1]);
		}
	}
}
} (window, document, jQuery, mediaWiki, mediaWiki.guidedTour ) ) ;