MediaWiki:Guidedtour-tour-inicio.js

De CNB
Ir a la navegación Ir a la búsqueda
Busca en cnbGuatemala con Google

Nota: tras guardar, quizás necesites actualizar la caché de tu navegador para ver los cambios.

  • Firefox/Safari: Mantén presionada la tecla Mayús mientras pulsas el botón Actualizar, o presiona Ctrl+F5 o Ctrl+R (⌘+R en Mac)
  • Google Chrome: presiona Ctrl+Shift+R (⌘+Mayús+R en Mac)
  • Internet Explorer: mantén presionada Ctrl mientras pulsas Actualizar, o presiona Ctrl+F5
  • Opera: dirígete a Menú → Configuración (Opera → Preferencias en Mac) y luego a Privacidad y seguridad → Borrar datos de navegación → Imágenes y archivos en caché.
/*
 * Guided Tour to test guided tour features.
 */
(function (window, document, $, mw, gt) {

	// XXX (mattflaschen, 2012-01-02): See GuidedTourHooks.php
	var pageName = mw.config.get('wgGuidedTourHelpGuiderUrl'),
		msgs = {
				'guidedtour-tour-nominatefordeletion-title': "Nominating content for deletion",
				'guidedtour-tour-nominatefordeletion-description': "This short interactive tutorial will show you how to nominate content for deletion at {{SITENAME}}.",
				'guidedtour-tour-nominatefordeletion-link-title': "Click this link",
				'guidedtour-tour-nominatefordeletion-link-description': "to start the deletion procedure for the current page."
			};
	

	// Again a crappy extension that does not support i18n!!!
	switch (mw.config.get('wgUserLanguage').toLowerCase()) {
		case 'de':
		case 'de-at':
		case 'de-ch':
		case 'de-formal':
		case 'gsw':
		case 'als':
		case 'bar':
			$.extend(msgs, {
				'guidedtour-tour-nominatefordeletion-title': "Einen Löschantrag stellen",
				'guidedtour-tour-nominatefordeletion-description': "Diese kurze, interaktive Tour wird aufzeigen, wie Du Löschanträge für Inhalte auf {{SITENAME}} stellen kannst.",
				'guidedtour-tour-nominatefordeletion-link-title': "Klicke auf diesen Link",
				'guidedtour-tour-nominatefordeletion-link-description': "um die Löschprozedur für die aktuelle Seite zu starten."
			});
			break;
	}
	mw.messages.set(msgs);

	gt.defineTour({
		/*
		 * This is the name of the tour.  It must be lowercase, without any hyphen (-) or
		 * period (.) characters.
		 *
		 * If this is an on-wiki tour, it should match the MediaWiki page.  For instance,
		 * if this were on-wiki, it would be MediaWiki:Guidedtour-tour-test.js
		 *
		 * The IDs below should use the same name in the middle (e.g. gt-test-2).
		 */
		name: 'nominatefordeletion',

		isSinglePage: true,
		shouldLog: false,

		/*
		 * This is a list of the tour steps, in order.
		 */
		steps: [{
			/*
			 * Show overlay at start of tour
			 */
			titlemsg: 'guidedtour-tour-nominatefordeletion-title',
			descriptionmsg: 'guidedtour-tour-nominatefordeletion-description',
			onShow: function () {
				if (!$('#p-tb').hasClass('expanded')) {
					mw.log("Expanding");
					$('#p-tb-label').mousedown().click().mouseup();
				}
			},
			overlay: true,
			buttons: [{
				action: 'next',
				onclick: function() {
					console.log("Test Ok.");
				}
			}]
		}, {
			/*
			 * Callout of sidebar menu
			 */
			titlemsg: 'guidedtour-tour-nominatefordeletion-link-title',
			descriptionmsg: 'guidedtour-tour-nominatefordeletion-link-description',

			// This positions the guider next to a page element, in this
			// case the portal link (which is "Community portal" on English
			// Wikipedia, but varies by site).
			// The string is a jQuery selector.  "#n-portal" means the HTML
			// element with this id attribute, and "a" means an a, or link,
			// element inside that.
			attachTo: '#t-ajaxquickdelete',

			// This means the guider shows to the right of the Community Portal link
			position: 'right',

			buttons: [{
				action: 'end'
			}]
		}]
	});

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