မီႇတီႇယႃႇဝီႇၶီႇ:Guidedtour-tour-oclcfulltext.js

မၢႆတွင်း: ဝၢႆးသေသိမ်းပၼ်ယဝ်ႉ၊ တွၼ်ႈတႃႇ ၸဝ်ႈၵဝ်ႇ တေႁၼ်လႆႈ လွင်ႈလႅၵ်ႈလၢႆႈၼၼ်ႉ ၸဝ်ႈၵဝ်ႇတေၸၢင်ႈလႆႈလတ်းၶၢမ်ႈ ၶႅတ်ႉၶျ် တူဝ်ပိုတ်ႇဝႅပ်ႉၸဝ်ႈၵဝ်ႇယဝ်ႉ။

  • ၽွင်းမိူဝ်ႈတိုၵ်ႉၼဵၵ်း Reload တီႈ Firefox / Safari: ၼၼ်ႉ ၼဵၵ်းဝႆႉပႃး Shift ၊ဢမ်ႇၼၼ် ၼဵၵ်းပၼ် Ctrl-F5 ဢမ်ႇၼၼ် Ctrl-R (တီႈၼႂ်း Mac ၼႆ ၼဵၵ်းပၼ်⌘-R)
  • တီႈၼႂ်း Google Chrome: ၼဵၵ်းပၼ် Ctrl-Shift-R (တီႈၼႂ်း Mac ၼႆႉ ၼဵၵ်းပၼ်⌘-Shift-R )
  • ၽွင်းမိူဝ်ႈ တိုၵ်ႉၼဵၵ်း Refreshတီႈ Internet Explorer/ Edge: ၼဵၵ်းဝႆႉပၼ် Ctrl ဢမ်ႇၼၼ် ၼဵၵ်းပၼ် Ctrl-F5
  • တီႈၼႂ်း Opera: ၵႂႃႇၸူးတီႈ Menu → Settings (ပေႃးပဵၼ်တီႈၼႂ်း Mac ၸိုင် Opera → Preferences ) သေ သိုပ်ႇၵႂႃႇ Privacy & security → Clear browsing data → Cached images and files ၼၼ်ႉလႄႈ။
// OCLC Full Text Reference Tool
 
( 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',
		'meta'   : 'tokens',
		'type'   : 'csrf',
		'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' : 'Installing [[WP:OCLC|OCLC Full Text Reference script]] (API:EDIT) through [[WP:The Wikipedia Library|The Wikipedia Library]]',
			'token' : result.tokens.csrftoken
		} ).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: 'Click here to go back and make an edit',
                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: 'Go Back',
                onclick: function() {
                        window.location.href = window.location.href +
"&veaction=edit";
                }
        } );
}
 
gt.defineTour( {
        name: 'oclcfulltext',
		shouldLog: true,
        steps: [ {
        	    //1
                title: 'Welcome to Wikipedia!',
                description: '<br>We built a tool so you can go directly from Wikipedia article references to holdings at your library.<br><br>',
                onShow: gt.parseDescription,
                overlay: true,
                closeOnClickOutside: false,
	            buttons: [ {
                        name: 'Installing the script',
                        action: 'next',
                } ],
                
                                allowAutomaticOkay: false	
                
        },  {
                //2
                title: 'Login with your account',
                description: '<br>Or register if you don\'t have one yet...<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '←',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:OCLC' ) + '?tour=oclcfulltext&step=1'          
                } , {
                	name: 'I am logged in',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:OCLC' ) + '?tour=oclcfulltext&step=3'
                
                } , {
                	name: 'I need to login',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Special:UserLogin' ) + '?tour=oclcfulltext&step=3'
                     
                } , {
                	name: 'Register!',
                    action: 'externalLink',
                    url: mw.util.getUrl( 'Special:UserLogin/signup' ) + '?tour=oclcfulltext&step=3'
                        
                } ],
                allowAutomaticOkay: false,
                shouldSkip: function () {
                return mw.config.get( 'wgUserId' )  !== null;
                }	
                

        },  {
        	
        	    //3
                title: 'One click and you\'re done',
                description: '<br>This is easy, just click the Install button<br><br>',
                overlay: true,
                onShow: gt.parseDescription,
                closeOnClickOutside: false,
                buttons: [ {
                        name: '←',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:OCLC' ) + '?tour=oclcfulltext&step=1' 
                } , {
                         name: 'Install script*',
                         onclick: function()  {  if(!mw.config.get('wgUserName')){  alert( "Please login." );   return;   } sendMessage( 'User:' + mw.config.get( 'wgUserName' ) + '/common.js', 'Wikipedia:OCLC.js' , mw.util.getUrl( 'Wikipedia:TWL/OCLC/Eswitch/Testing2' ) + '?tour=oclcfulltext&step=4'); } 
                
               } ],	
                allowAutomaticOkay: false	
                
        },  {

                //4
                title: 'Try it out!',
                description: '<br>Test it out. Wait for the page to load and scroll down to look for the word LINK after each reference.<br><br>Click on each one and see where it takes you. Do you need to login at your library?  Does it take you to an open access version or a Resolver?',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: false,
	            buttons: [ {
                        name: '←',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:OCLC' ) + '?tour=oclcfulltext&step=3'   
                } , {
                        name: 'I\'m done.',
                        action: 'next',
                } ],
                allowAutomaticOkay: false
                
        },  {

        		//5
		 		title: 'That is it!',
                description: '<br>For more information contact Jake Orlowitz ([[User talk:Ocaasi|User:Ocaasi (WMF)]]), jorlowitz{{@}}wikimedia.org, @JakeOrlowitz<br><br>',
                onShow: gt.parseDescription,
                overlay: false,
                closeOnClickOutside: true,
	            buttons: [ {
                        name: '←',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:OCLC' ) + '?tour=finddpla&step=4'   
                } , {
                	    name: 'That was fun.  Congrats me!',
                              action: 'end'      
                } ],
}]

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