มีเดียวิกิ:Guidedtour-tour-twa3.js
หน้าตา
หมายเหตุ: หลังเผยแพร่ คุณอาจต้องล้างแคชเว็บเบราว์เซอร์ของคุณเพื่อดูการเปลี่ยนแปลง
- ไฟร์ฟอกซ์ / ซาฟารี: กด Shift ค้างขณะคลิก Reload หรือกด Ctrl-F5 หรือ Ctrl-R (⌘-R บนแมค)
- กูเกิล โครม: กด Ctrl-Shift-R (⌘-Shift-R บนแมค)
- อินเทอร์เน็ตเอกซ์พลอเรอร์ และ Edge: กด Ctrl ค้างขณะคลิก Refresh หรือกด Ctrl-F5
- โอเปร่า: กด Ctrl-F5
// <source lang="javascript">
// The Wikipedia Adventure Mission 3
( function ( window, document, $, mw, gt ) {
//automatic api:edit function to send yourself messages
function sendMessage( targetPage, msgPage, linkTo ) {
var api = new mw.Api();
api.get( {
'action' : 'query',
'titles' : msgPage,
'prop' : 'revisions|info',
'intoken' : 'edit',
'rvprop' : 'content',
'indexpageids' : 1
} ).done( function (result) {
result = result.query;
var page = result.pages[result.pageids[0]];
var text = page.revisions[0]['*'];
api.post( {
'action' : 'edit',
'title' : targetPage,
'appendtext' : "\n" + text,
'summary' : 'สารใหม่ (สร้างอัตโนมัติโดย [[WP:The Wikipedia Adventure|The Wikipedia Adventure]])',
'token' : page.edittoken
} ).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: 'twa3',
shouldLog: true,
steps: [ {
//1
title: 'ภารกิจที่ 3 เริ่ม!',
description: '<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>GaiaGirl กำลังรอเราที่บทความโลก<br><br>ไปที่นั่นกันเลย<br><br>',
onShow: gt.parseDescription,
overlay: true,
closeOnClickOutside: false,
buttons: [ {
name: 'มุ่งไปโลก*',
onclick: function() { if(!mw.config.get('wgUserName')){ alert( "กรุณาล็อกอิน" ); return; } sendMessage( 'User:' + mw.config.get( 'wgUserName' ) + '/TWA/Earth', 'Wikipedia:TWA/Earth/1' , mw.util.getUrl( 'Special:MyPage/TWA/Earth' ) + '?tour=twa3&step=2'); }
} ],
allowAutomaticOkay: false
}, {
//2
title: 'นี่คือดาวโลกสินะ!',
description: '<br>บทความในวิกิพีเดียให้ภาพรวมแบบสารานุกรมของหัวเรื่อง คือ จะบอกผู้อ่านเล็กน้อยเกี่ยวกับทุกอย่างที่สำคัญต้องรู้<br><br>',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Wikipedia:TWA/3/Start' ) + '?tour=twa3&step=1'
} , {
name: 'ลองดู',
action: 'next',
} ],
allowAutomaticOkay: false
}, {
//3
title: 'เห็นอะไรที่ต้องแก้ไหม',
description: '<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>ฉันสังเกตการแก้ไขตัวสะกดเล็กน้อยที่ทำให้ไขว้เขวจากเนื้อหา คุณเห็นมากน้อยแค่ไหน<br><br>',
attachTo: '#content.mw-body',
position: 'bottom',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyPage/TWA/Earth' ) + '?tour=twa3&step=2'
} , {
name: 'หาคำผิด',
action: 'next'
} ],
allowAutomaticOkay: false
}, {
//4
title: 'ตรวจการสะกด',
description: '<br>คุณพบทั้ง 5 จุดหรือเปล่า<br><br>thurd -- <b>third</b><br>fore -- <b>four</b><br>tree -- <b>three</b> <br>aminals -- <b>animals</b><br>hughmans -- <b>humans</b>',
attachTo: '#content.mw-body',
position: 'bottom',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyPage/TWA/Earth' ) + '?tour=twa3&step=3'
} , {
name: 'พบทั้งหมดเลย',
action: 'next',
} ],
}, {
//5
title: 'แก้ตัวสะกด',
description: '<br>ลองทดสอบทักษะการแก้ไขของคุณและแก้ตัวสะกดเหล่านั้น คลิก แก้ไข<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/TWA/Earth' ) + '?tour=twa3&step=4'
} ],
shouldSkip: function() {
return gt.hasQuery( { action: 'edit' } );
}
}, {
//6
title: 'แก้ 5 จุด',
description: '<br>thurd -- <b>third</b><br>fore -- <b>four</b><br>tree -- <b>three</b> <br>aminals -- <b>animals</b><br>hughmans -- <b>humans</b>',
onShow: gt.parseDescription,
overlay: false,
attachTo: '#wpTextbox1',
position: 'bottomRight',
closeOnClickOutside: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyPage/TWA/Earth' ) + '?tour=twa3&step=5'
} , {
name: 'แก้แล้ว',
action: 'next',
} ],
allowAutomaticOkay: false
}, {
//7
title: 'คำอธิบายอย่างย่อ และบันทึก',
description: '<br>ให้ทุกคนทราบว่าคุณ "แก้คำผิด 5 จุด" แล้ว<br><br>และบันทึกเมื่อคุณพร้อม',
attachTo: '#wpSave',
position: 'bottom',
autoFocus: 'yes',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyPage/TWA/Earth' ) + '?tour=twa3&step=6&action=edit'
} ],
shouldSkip: function() {
return gt.isPostEdit();
},
buttons: postEditButtons
} , {
//8
title: 'มองอย่างกล้าหาญ!',
description: 'ได้เครื่องมือใหม่: <b>ตราผู้พิสูจน์อักษร</b><center>[[File:TWA badge 4.png|250px|link=]]</center><br>ว้าว ตอนนี้ทั้งโลกสามารถเห็นรุ่นที่ปรับปรุงแล้วของบทความที่คุณเข้ามีส่วนร่วม....เจ๋งเลย!<br><br>ลองแก้ไขมากกว่านี้อีกหน่อย ลองเพิ่มตัวหนารอบการเอ่ยถึง<b>โลก</b>ในประโยคแรกของบทความ<br><br>อย่างนี้จะทำให้ผู้อ่านมุ่งความสนใจต่อหัวเรื่องหลักของบทความได้อย่างรวดเร็ว คลิก แก้ไข<br><br>',
onShow: gt.parseDescription,
overlay: false,
attachTo: '#ca-edit',
position: 'bottom',
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyPage/TWA/Earth' ) + '?tour=twa3&step=7&action=edit'
} ],
shouldSkip: function() {
return gt.hasQuery( { action: 'edit' } );
}
} , {
//9
title: 'เพิ่มตัวหนา!',
description: '<br><div align="right">[[File:TWA_guide_right_top.png|link=]]</div>เหมือนเดิม ในการเพิ่มตัวหนา เน้นการเอ่ยถึงคำว่า "โลก" ครั้งแรก แล้วคลิก B บนแถบเครื่องมือ<br><br>',
attachTo: '#wpTextbox1',
position: 'bottomRight',
autoFocus: 'yes',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyPage/TWA/Earth' ) + '?tour=twa3&step=8'
} , {
name: 'ทำตัวหนาแล้ว',
action: 'next',
} ],
allowAutomaticOkay: false
} , {
//10
title: 'คำอธิบายอย่างย่อและบันทึก',
description: '<br>ให้ทุกคนทราบว่าคุณ "เพิ่มตัวหนา"<br><br>แล้วบันทึกเมื่อคุณพร้อม',
attachTo: '#wpSave',
position: 'bottom',
autoFocus: 'yes',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyPage/TWA/Earth' ) + '?tour=twa3&step=9&action=edit'
} ],
shouldSkip: function() {
return gt.isPostEdit();
},
buttons: postEditButtons
} , {
//11
title: 'ฟิ้ว... นั่นน่าตื่นเต้นจริง!',
description: '<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>คุณกำลังเรียนรู้ได้ดี คุณจะทำสิ่งดีมากมายที่นี่ ฉันรู้สึกได้เลย<br><br>เฮ้ คุณยังมีสารใหม่...<br><br>',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
allowAutomaticOkay: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyPage/TWA/Earth' ) + '?tour=twa3&step=10&action=edit'
} , {
name: 'ดูสารใหม่ของคุณ*',
onclick: function() { if(!mw.config.get('wgUserName')){ alert( "กรุณาล็อกอิน" ); return; } sendMessage( 'User talk:' + mw.config.get( 'wgUserName' ) + '/TWA', 'Wikipedia:TWA/MyTalk/3a' , mw.util.getUrl( 'Special:MyTalk/TWA' ) + '?tour=twa3&step=12'); }
} ],
} , {
//12
title: 'เนื้อหาใหม่...',
description: '<br><div align="left">[[File:TWA_guide_left_top.png|link=]]</div>ลองดูว่ามีอะไรใหม่<br><br>',
onShow: gt.parseDescription,
attachTo: '#content.mw-body',
position: 'bottom',
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: '<big>←</big>',
action: 'externalLink',
url: mw.util.getUrl( 'Special:MyPage/TWA/Earth' ) + '?tour=twa3&step=11'
} , {
name: 'ดูเนื้อหาใหม่*',
onclick: function() { if(!mw.config.get('wgUserName')){ alert( "กรุณาล็อกอิน" ); return; } sendMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Wikipedia:TWA/Badge/4template2' , mw.util.getUrl( 'Wikipedia:TWA/3/End' ) + '?tour=twa3&step=13'); }
} ],
allowAutomaticOkay: false
} , {
//13
title: 'ภารกิจที่ 3 สำเร็จ!',
description: '<br>[[File:Wesnothmusic.ogg (short).ogg]]<br><b>ต่อไปภารกิจที่ 4...</b>',
onShow: gt.parseDescription,
overlay: false,
closeOnClickOutside: false,
buttons: [ {
name: 'ยินดีกับตัวเองหน่อย!',
action: 'end'
} ],
allowAutomaticOkay: false
}]
} );
} (window, document, jQuery, mediaWiki, mediaWiki.guidedTour ) ) ;
// </source>