Línea 1: |
Línea 1: |
− | /* | + | // Guided Tour to help users start editing |
− | * Guided Tour to test guided tour features.
| + | |
− | */ | + | ( function ( window, document, $, mw, gt ) { |
− | (function (window, document, $, mw, gt) { | + | gt.defineTour( { |
| + | name: 'GTA1', |
| + | steps: [ { |
| + | title: 'Upload your image', |
| + | description: 'Welcome to the Wiki Loves Monuments 2013 United States Upload Wizard.', |
| + | overlay: true, |
| + | buttons: [ { |
| + | action: 'next' |
| + | } ], |
| + | |
| + | // shouldSkip is a general tool to skip a step based on their progress towards some goal. This is used to ensure this step will not be shown once they have started editing. |
| + | // shouldSkip always returns true to skip, or false otherwise. |
| + | shouldSkip: function() { |
| + | return gt.hasQuery( { action: 'edit' } ); |
| + | } |
| + | }, |
| + | { |
| + | title: 'Upload your file', |
| + | description: 'Follow the instructions on the screen to upload your file. When you are finished uploading, click 'next'.', |
| + | attachTo: '#p-participate', |
| + | position: 'right', |
| + | // Same as above. We plan to make this less repetitive in the future. |
| + | // shouldSkip is a general tool to skip a step based on their progress towards some goal. This is used to ensure this step will not be shown once they have started editing. |
| + | // shouldSkip always returns true to skip, or false otherwise. |
| + | shouldSkip: function() { |
| + | return gt.isPage( 'Special:ChangeEmail' ); |
| + | } |
| | | |
− | // XXX (mattflaschen, 2012-01-02): See GuidedTourHooks.php
| + | }, |
− | var pageName = mw.config.get('wgGuidedTourHelpGuiderUrl'),
| + | { |
− | msgs = {
| + | title: 'Confirm your email', |
− | 'guidedtour-tour-nominatefordeletion-title': "Nominating content for deletion",
| + | description: 'Please <a href="https://commons.wikimedia.org/wiki/Special:ChangeEmail">confirm your email</a>. Without it, we cannot contact you if you win. <a href="https://commons.wikimedia.org/wiki/Special:ChangeEmail">Click here to confirm your email.</a>', |
− | 'guidedtour-tour-nominatefordeletion-description': "This short interactive tutorial will show you how to nominate content for deletion at {{SITENAME}}.",
| + | attachTo: '#pt-userpage', |
− | 'guidedtour-tour-nominatefordeletion-link-title': "Click this link",
| + | position: 'bottom', |
− | 'guidedtour-tour-nominatefordeletion-link-description': "to start the deletion procedure for the current page."
| + | closeOnClickOutside: false, |
− | };
| + | buttons: [ { |
− |
| + | action: 'end' |
| + | } ] |
| + | |
| + | shouldSkip: function() { |
| + | return gt.isPage( 'Special:ChangeEmail' ); |
| + | } |
| + | }, |
| | | |
− | // Again a crappy extension that does not support i18n!!!
| + | } ); |
− | switch (mw.config.get('wgUserLanguage').toLowerCase()) {
| + | |
− | case 'de':
| + | } (window, document, jQuery, mediaWiki, mediaWiki.guidedTour ) ); |
− | 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)); | |