MediaWiki:Guidedtour-tour-twa1.js

维基百科,自由的百科全书

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。

// The Wikipedia Adventure Mission 1

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

//automatic api:edit function to send yourself messages
function sendMessage( targetPage, msgPage, linkTo ) {
	var api = new mw.Api();
	// 請勿再從英文維基百科複製 query revisions 的用法,那是錯誤的!
	api.postWithEditToken( {
		'action' : 'edit',
		'title' : targetPage,
		'appendtext' : "\n{{subst:" + msgPage + "}}",
		'summary' : '新訊息([[WP:TWA|維基百科大歷險]]自動模擬[[MediaWiki:Guidedtour-tour-twa1.js|1]])',
	} ).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: '按此返回並進行編輯',
                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: '返回',
                onclick: function() {
                        window.location.href = window.location.href +
"&veaction=edit";
                }
        } );
}

gt.defineTour( {
        name: 'twa1',
		shouldLog: true,
        steps: [ {
                //1
                title: '歡迎來到維基百科!',
                description: '<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>維基百科是一部<b>人人都能編輯</b>的自由百科全書。在這裏,我們要和您踏上這段互動的編輯之旅,探索我們的宇宙。<br><br>一路上共有7道關卡,我們會在每一道關卡為您帶來驚喜,同時教授新的編輯技能,令您成為一位優秀的維基百科編輯。<br><br>',
                onShow: gt.parseDescription,
                overlay: true,
                closeOnClickOutside: false,
	            buttons: [ {
                        name: '為旅途做好準備',
                        action: 'next',
                } ],
                allowAutomaticOkay: false	

				
        },  {
                //2
                title: '行前準備',
                description: '<br><b>不要按[x]</b><br>這個對話方塊就是您的太空衣,如果您在完成關卡之前關閉了它,您就會離開這段旅程,需要重新開始。<br><br><b>自動訊息</b><br> 旅途中,驅動腳本會向您在維基百科的個人專頁發送訊息。如果它要這樣做的話,您會在藍色按鈕上看到星號(<big><b>*</b></big>)。<br><br>',
                onShow: gt.parseDescription,
                overlay: true,
                closeOnClickOutside: false,
		        buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/1/Start' ) + '?tour=twa1&step=1'          
                } , {
                        name: '跟我上路',
                        action: 'next',
                         } ],
                allowAutomaticOkay: false		

        },  {
                //3
                title: '為甚麼參加維基百科?',
                description: '<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>我們的確有個厲害的目標。<br><br><b>試想像世界上每一個人,都能自由存取全人類知識的總集。</b><br><br>最神奇的是⋯⋯<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/1/Start' ) + '?tour=twa1&step=2'          
                } , {
                         name: '這些事情在發生',
                         action: 'next',
                         } ],
                allowAutomaticOkay: false				

        },  {
                //4
                title: '這些事情在發生',
                description: '<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>每一秒的時間,就有超過8,000名讀者瀏覽維基百科。我們是全球第七大網站。而且,我們只有20多年的歷史!<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/1/Start' ) + '?tour=twa1&step=3'          
                } , {
                        name: '維基百科是由誰編寫的?',
                        action: 'next',
                         } ],
	            allowAutomaticOkay: false
        },  {
                //5
                title: '維基百科是由誰編寫的?',
                description: '<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>不就是您嗎? :) 目前中文維基百科約有300萬多名註冊用戶。最重要的是,這裏大部分編輯都是-{zh-hans:志愿者; zh-hant:義工; zh-tw:志工;}-,換言之就算您不是專家,也可以為維基百科貢獻。<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/1/Start' ) + '?tour=twa1&step=4'          
                } , {
                        name: '他們為甚麼編輯?',
                        action: 'next',
                         } ],
		        allowAutomaticOkay: false
        },  {

                //6
                title: '發現我們的特別作用',
                description: '<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>維基百科最神奇的地方是您會在參加的過程中意識到自己參與編輯的目的和方向。不過每個人的付出都能成就巨大的改變——您的影響足以改變世界。<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/1/Start' ) + '?tour=twa1&step=5'          
                } , {
                        name: '準備好了嗎?',
                        action: 'next',
                         } ],
                allowAutomaticOkay: false,
},  {
                //7
                title: '登入或建立帳號',
                description: '<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>建立帳號會為您帶來很多好處。去吧!<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/1/Start' ) + '?tour=twa1&step=6'  
                } , {
                	name: '我登入了',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/1/Start' ) + '?tour=twa1&step=8'
                        
                } , {
                	name: '我要登入',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:UserLogin' ) + '?tour=twa1&step=7'
                     
                } , {
                	name: '註冊',
                    action: 'externalLink',
                    url: mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=Special:UserLogin&returnto=Wikipedia:TWA/1/Start&returntoquery=tour%3Dtwa1%26step%3D8%26showGettingStarted%3Dfalse&type=signup'
                        
                } ],
                allowAutomaticOkay: false,
                shouldSkip: function () {
                return mw.config.get( 'wgUserId' )  !== null;
                }
				
} , {
                //8
                title: '跟維基百科說聲好',
                description: '<br>不如先向社群介紹自己吧。<br><br>載入宇宙只需要幾秒的時間——光速旅遊就是這麼快。<br><br>(您必須在旅途餘下的所有部分保持登入。)<br><br>',
                overlay: true,
                onShow: gt.parseDescription,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/1/Start' ) + '?tour=twa1&step=6'          
                } , {
                         name: '說聲好*',
                         onclick: function()  {  if(!mw.config.get('wgUserName')){  alert( "請登入。" );   return;   } sendMessage( 'User talk:' + mw.config.get( 'wgUserName' ), 'Wikipedia:TWA/Welcome' , mw.util.getUrl( 'Special:MyPage' ) + '?tour=twa1&step=9'); } 
                } ],	
                allowAutomaticOkay: false
				
} , {
                //9
                title: '您的用戶頁',
                description: '<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>用戶頁是您向其他讀者和編輯介紹自己的地方。你可以談談您的背景、興趣,還有您希望為這個計劃貢獻甚麼——多多益善,少少無拘。<br><br><i>要記住這份自述是公開的,所以您的個人-{zh-hans:隐私; zh-tw:隱私; zh-hk:私隱}-還是保密比較好。</i><br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/1/Start' ) + '?tour=twa1&step=8'          
                } , {
                        name: '好的用戶頁是怎樣的?',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:TWA/1/Bio' ) + '?tour=twa1&step=10'
                } ],
		allowAutomaticOkay: false
		
} , {
                //10
                title: '問答',
                description: '提示:不論是答對還是答錯,您都可以學會同等的知識。而且您可以不斷嘗試!',
                attachTo:'#contentSub',
                position: 'bottom',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false, 
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage' ) + '?tour=twa1&step=9'          
                } ],
               
} , {
                //11
                title: '到您來了!',
                description: '<br>只要編輯一下,就能夠在維基百科創建自己的用戶頁了,就是這麼簡單。<br><br>請在上面按下名為<b>建立</b>或<b>編輯-{zh-hans:源代码; zh-hant:原始碼;}-</b>的連結。<br><br>(這場探險會採用-{zh-hans:源代码; zh-hant:原始碼;}-編輯器。)<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( 'Special:MyPage' ) + '?tour=twa1&step=9'          
                } ],
                shouldSkip: function() {
                        return gt.hasQuery( { action: 'edit' } );
                }

}, {
                //12
                title: '編輯界面',
                description: '<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>這就是奇蹟發生的地方。<br><br>請在左上方的大型文字方塊中寫下您的用戶名,出身國家/地區和城市、教育程度、技能和興趣。有甚麼事情令您對這裏的<b>工作</u>感到興奮呢?想說多少就說多少吧,作出<b>一次</b>編輯就好。<br><br>如果您已經有自己的用戶頁,那就請您作出至少<b>一項</b>改善。<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                attachTo: '#wpTextbox1', 
                position: 'bottomRight',
                closeOnClickOutside: false,
	            buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage' ) + '?tour=twa1&step=11'          
                } , {
                        name: '打好了',
                        action: 'next'
               } ],
               
} , {
                //13
                title: '編輯摘要和儲存',
                description: '<br>-{zh-hans:挺; zh-hant:挺; zh-tw:蠻;}-好的!在按儲存按鈕之前,請稍微紀錄一下您的編輯,這項紀錄就叫做編輯摘要。其他人可以由此知道您的編輯大綱。<br><br>不如寫「介紹自己」吧。<br><br>現在您只要儲存就行了。之後您的編輯就會上線和公開發佈。準備好了以後,就「儲存」。<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                attachTo:  '#wpSave', 
                position: 'bottomRight',
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                shouldSkip: function() {
                        return gt.isPostEdit();
                },
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage' ) + '?tour=twa1&step=12&action=edit'          
                } ],
                buttons: postEditButtons

} , {
                //14
                title: '恭喜!',
                description: '獲得新工具:  <b>編輯獎章</b><center>[[File:TWA badge 1.png|250px|link=]]</center><br>您已經成為維基百科的編輯了!覺得如何呢?您能介紹自己,那真棒。<br>',
                overlay: false,
                onShow: gt.parseDescription,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage' ) + '?tour=twa1&step=13&action=edit'          
                } , {
                        name: '做得更好*',
                        onclick: function()  {  if(!mw.config.get('wgUserName')){  alert( "請登入。" );   return;   } sendMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Wikipedia:TWA/Badge/1template2' , mw.util.getUrl( 'Special:MyPage' ) + '?tour=twa1&step=15'); } 
                } ],

} , {
                //15
                title: '做得更好',
                description: '<br>一起回去對文本作出一些修改吧。按<b>「編輯-{zh-hans:源代码; zh-hant:原始碼;}-」</b>。<br><br>',
                overlay: false,
                attachTo: '#ca-edit',
                position: 'bottom',
                onShow: gt.parseDescription,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage' ) + '?tour=twa1&step=14'          
                } ],
                shouldSkip: function() {
                        return gt.hasQuery( { action: 'edit' } );
                }

} , {
                //16
                title: '加粗',
                description: '<br><div align="right">[[File:TWA guide right top.png|link=]]</div>請用滑鼠把自己的用戶名、興趣(或者其他關鍵詞)加亮。<br><br>接著在編輯欄上方的編輯工具列按下[[File:Toolbaricon_bold_B-1.png]]按鈕。<br><br>編輯工具列可以自己完成一些格式修改的功能,令編輯過程變得更為方便。',
                attachTo: '#wpTextbox1', 
                position: 'bottomRight',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage' ) + '?tour=twa1&step=15'          
                } , {
                	    name: '已加粗',
                        action: 'next'
                } ],

} , {
                //18(鑑於中文的排版習慣,因此省略17)
                title: '加入維基連結',
                description: '<br><div align="right">[[File:TWA guide right top.png|link=]]</div>您可以把維基百科其他頁面起來,去形成一個超-{zh-hans:链接; zh-hant:連結;}-網絡,這樣您就可以把工作拋諸腦後,盡情穿梭於條目之間了。 ;)<br><br>先把自己的出身國家/地區和城市加亮。<br><br>接着在編輯工具列按下[[File:Toolbar_Insert_link.png]] 這個看似鎖鏈的按鈕。<br><br>然後加入連結。<br><br>',
                attachTo: '#wpTextbox1', 
                position: 'bottomRight',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage' ) + '?tour=twa1&step=17&action=edit'          
                } , {
                	    name: '已加入連結',
                        action: 'next'
                } ],

} , {
                //19
                title: '編輯摘要和儲存',
                description: '<br>告訴大家您「把字詞加粗,並加入維基連結」。按「儲存」,之後您的編輯就會上線了。<br><br>',
                attachTo: '#wpSave',
                position: 'bottomRight',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                allowAutomaticOkay: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage' ) + '?tour=twa1&step=18&action=edit'          
                } ],
                shouldSkip: function() {
                        return gt.isPostEdit();
                },
                buttons: postEditButtons

} , {
                //20
                title: '您做到了 :)',
                description: '獲得新工具:<b>格式審查員獎章</b><center>[[File:TWA badge 2.png|250px|link=]]</center><br>您學得很快,很了不起。我們才剛剛開始,您就已經練好基本功,準備迎接接下來的旅途。在不斷提升實力之際,也請留意一下頁底的能力值報表。<br>',
                overlay: true,
                onShow: gt.parseDescription,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '<big>←</big>',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:MyPage' ) + '?tour=twa1&step=19&action=edit'          
                } , {
                        name: '然後呢??*',
                        onclick: function()  {  if(!mw.config.get('wgUserName')){  alert( "請登入。" );   return;   } sendMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Wikipedia:TWA/Badge/2template2' , mw.util.getUrl( 'Wikipedia:TWA/1/End' ) + '?tour=twa1&step=21'); } 
                } ],
                allowAutomaticOkay: false

} , {
                //21
                title: '第一關完成!',
                description: '<br>[[File:Carl Czerny - Duo Concertante - 1. Allegro (short).ogg]]<br><b>踏入第二關⋯⋯</b>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                	    name: '恭喜自己!',
                        action: 'end'      
                } ],


}]

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