Diferencia entre revisiones de «MediaWiki:Guidedtour-tour-inicio.js»
Ir a la navegación
Ir a la búsqueda
Busca en cnbGuatemala con Google
(Página creada con «→* Guided Tour to test guided tour features.: // Copy the next line into the start of your tour. ( function ( window, document, $, mw, gt ) { // Declare a variable...») |
|||
Línea 2: | Línea 2: | ||
* Guided Tour to test guided tour features. | * Guided Tour to test guided tour features. | ||
*/ | */ | ||
− | + | (function (window, document, $, mw, gt) { | |
− | ( function ( window, document, $, mw, gt ) { | ||
− | // | + | // XXX (mattflaschen, 2012-01-02): See GuidedTourHooks.php |
− | var pageName = ' | + | 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." | ||
+ | }; | ||
+ | |||
− | tour | + | // 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 | * This is the name of the tour. It must be lowercase, without any hyphen (-) or | ||
* period (.) characters. | * period (.) characters. | ||
* | * | ||
− | * | + | * If this is an on-wiki tour, it should match the MediaWiki page. For instance, |
− | * MediaWiki:Guidedtour-tour- | + | * 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: ' | + | 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)); | |
− | } ( window, document, jQuery, mediaWiki, mediaWiki.guidedTour ) ); |
Revisión del 17:27 8 ago 2016
/* * 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));