jenkins-bot has submitted this change and it was merged. Change subject: Remove unused code/messages ......................................................................
Remove unused code/messages Remove the following: * Unused category-based tasks * GettingStarted.i18n.php shim * GettingStartedNavbarNoArticle instrumentation [0],[1] * Anonymous Editor Acquisition controller and tours * "getting started" revision tagging * GettingStarted\Hooks::hasEditedMainNamespace method [0] https://trello.com/c/c45DXjZF/288-updates-for-gettingstartednosuggestedarticle [1] https://trello.com/c/Um8MWlpa/339-measure-gettingstarted-api-usage Change-Id: I9ec9b0295acd51ad37f227182f65f47aad3d3c1b --- D GettingStarted.i18n.php M GettingStarted.php M Hooks.php M i18n/en.json M maintenance/generate_config.php D resources/ext.gettingstarted.anonymousEditorAcquisition.js M resources/ext.gettingstarted.return.js D resources/tours/anonymouseditoracquisitionpreeditv1.js D resources/tours/anonymouseditoracquisitionpreeditv2.js 9 files changed, 1 insertion(+), 556 deletions(-) Approvals: Mattflaschen: Looks good to me, but someone else must approve Phuedx: Looks good to me, approved jenkins-bot: Verified diff --git a/GettingStarted.i18n.php b/GettingStarted.i18n.php deleted file mode 100644 index c2006ab..0000000 --- a/GettingStarted.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * This is a backwards-compatibility shim, generated by: - * https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShimf34dc99382764a55' ) ) { - function wfJsonI18nShimf34dc99382764a55( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShimf34dc99382764a55'; -} diff --git a/GettingStarted.php b/GettingStarted.php index 16ba0e3..ffa4594 100644 --- a/GettingStarted.php +++ b/GettingStarted.php @@ -29,14 +29,6 @@ 'copyedit' => array( 'toolbarDescription' => 'gettingstarted-task-copyedit-toolbar-description', 'toolbarTryAnotherTitle' => 'gettingstarted-task-copyedit-toolbar-try-another-title', - ), - 'clarify' => array( - 'toolbarDescription' => 'gettingstarted-task-clarify-toolbar-description', - 'toolbarTryAnotherTitle' => 'gettingstarted-task-clarify-toolbar-try-another-title', - ), - 'addlinks' => array( - 'toolbarDescription' => 'gettingstarted-task-addlinks-toolbar-description', - 'toolbarTryAnotherTitle' => 'gettingstarted-task-addlinks-toolbar-try-another-title', ) ); @@ -99,7 +91,6 @@ ); $wgMessagesDirs['GettingStarted'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles[ 'GettingStarted' ] = __DIR__ . '/GettingStarted.i18n.php'; // APIs $wgAPIListModules['gettingstartedgetpages'] = 'GettingStarted\ApiGettingStartedGetPages'; @@ -110,12 +101,6 @@ $gettingStartedModuleInfo = array( 'localBasePath' => __DIR__ . '/resources', 'remoteExtPath' => 'GettingStarted/resources', -); - -$wgResourceModules[ 'schema.GettingStartedNavbarNoArticle' ] = array( - 'class' => 'ResourceLoaderSchemaModule', - 'schema' => 'GettingStartedNavbarNoArticle', - 'revision' => 5483117 ); $wgResourceModules[ 'schema.GettingStartedRedirectImpression' ] = array( @@ -292,10 +277,6 @@ 'gettingstarted-task-toolbar-no-suggested-page', 'gettingstarted-task-copyedit-toolbar-description', 'gettingstarted-task-copyedit-toolbar-try-another-title', - 'gettingstarted-task-clarify-toolbar-description', - 'gettingstarted-task-clarify-toolbar-try-another-title', - 'gettingstarted-task-addlinks-toolbar-description', - 'gettingstarted-task-addlinks-toolbar-try-another-title', ), ) + $gettingStartedModuleInfo; @@ -317,7 +298,6 @@ 'dependencies' => array( 'ext.gettingstarted.api', 'ext.gettingstarted.logging', - 'schema.GettingStartedNavbarNoArticle', 'schema.GettingStartedRedirectImpression', // Needed for isEditing() and tour launching. 'ext.guidedTour.lib', @@ -340,53 +320,6 @@ 'jquery.cookie', ), ) + $gettingStartedModuleInfo; - -// Tours for the Anonymous Editor Acquisition project (see -// https://www.mediawiki.org/wiki/Anonymous_editor_acquisition). - -$anonymousEditorAcquisitionPreEditTourInfo = array( - 'dependencies' => array( - 'ext.gettingstarted.anonymousEditorAcquisition', - 'ext.guidedTour', - 'schema.SignupExpCTAImpression', - ), -) + $gettingStartedModuleInfo; - -$wgResourceModules[ 'ext.guidedTour.tour.anonymouseditoracquisitionpreeditv1' ] = array( - 'scripts' => 'tours/anonymouseditoracquisitionpreeditv1.js', - 'messages' => array( - 'guidedtour-tour-anonymouseditoracquisitionpreeditv1-title', - 'guidedtour-tour-anonymouseditoracquisitionpreeditv1-description', - 'guidedtour-tour-anonymouseditoracquisitionpreeditv1-sign-up', - 'guidedtour-tour-anonymouseditoracquisitionpreeditv1-continue', - ), -) + $anonymousEditorAcquisitionPreEditTourInfo; - -$wgResourceModules[ 'ext.guidedTour.tour.anonymouseditoracquisitionpreeditv2' ] = array( - 'scripts' => 'tours/anonymouseditoracquisitionpreeditv2.js', - 'messages' => array( - 'guidedtour-tour-anonymouseditoracquisitionpreeditv2-title', - 'guidedtour-tour-anonymouseditoracquisitionpreeditv2-description', - 'guidedtour-tour-anonymouseditoracquisitionpreeditv2-sign-up', - 'guidedtour-tour-anonymouseditoracquisitionpreeditv2-continue', - ), -) + $anonymousEditorAcquisitionPreEditTourInfo; - -$wgResourceModules[ 'ext.gettingstarted.anonymousEditorAcquisition' ] = array( - 'scripts' => 'ext.gettingstarted.anonymousEditorAcquisition.js', - 'dependencies' => array( - 'mediawiki.Title', - 'mediawiki.Uri', - 'mediawiki.cookie', - 'ext.gettingstarted.user', - 'ext.gettingstarted.logging', - 'schema.SignupExpPageLinkClick', - 'schema.SignupExpCTAButtonClick', - 'ext.guidedTour.launcher', - ), -) + $gettingStartedModuleInfo; - - // Events for the Anonymous Edit Acquisition project. @@ -444,11 +377,9 @@ $wgDefaultUserOptions[ GettingStarted\Hooks::INTRO_OPTION ] = true; $wgHooks[ 'BeforePageDisplay' ][] = 'GettingStarted\Hooks::onBeforePageDisplay'; -$wgHooks[ 'RecentChange_save' ][] = 'GettingStarted\Hooks::onRecentChange_save'; $wgHooks[ 'CategoryAfterPageAdded' ][] = 'GettingStarted\RedisCategorySync::onCategoryAfterPageAdded'; $wgHooks[ 'CategoryAfterPageRemoved' ][] = 'GettingStarted\RedisCategorySync::onCategoryAfterPageRemoved'; $wgHooks[ 'ArticleDeleteComplete' ][] = 'GettingStarted\RedisCategorySync::onArticleDeleteComplete'; -$wgHooks[ 'ListDefinedTags' ][] = 'GettingStarted\Hooks::onListDefinedTags'; $wgHooks[ 'MakeGlobalVariablesScript' ][] = 'GettingStarted\Hooks::onMakeGlobalVariablesScript'; $wgHooks[ 'ResourceLoaderGetConfigVars' ][] = 'GettingStarted\Hooks::onResourceLoaderGetConfigVars'; $wgHooks[ 'GetPreferences' ][] = 'GettingStarted\Hooks::onGetPreferences'; diff --git a/Hooks.php b/Hooks.php index 79c099b..e1d4772 100644 --- a/Hooks.php +++ b/Hooks.php @@ -103,7 +103,7 @@ /** * Gets the unprefixed GettingStarted task, if any. E.g. if the full task in the - * cookie is 'gettingstarted-addlinks', this will return 'addlinks'. + * cookie is 'gettingstarted-copyedit', this will return 'copyedit'. * * @param WebRequest $request current request * @param Title $title title to check @@ -299,72 +299,6 @@ return true; } - /** - * Look for page edits where there's an item in the user's openTask cookie - * matching the title whose task is 'gettingstarted' - * Approach comes from AbuseFilter and MobileFrontend extensions. - * @param RecentChange $recentChange RecentChanges entry - * @return bool - */ - public static function onRecentChange_save( \RecentChange $recentChange ) { - global $wgRequest; - - if ( $recentChange->getAttribute( 'rc_type' ) !== RC_EDIT ) { - return true; - } - - $titleObj = $recentChange->getTitle(); - $task = self::getPageTask( $wgRequest, $titleObj ); - - // When they are assisted by GettingStarted, a cookie with that title - // is set. All edits to the page are then tagged, until the cookie - // expires at the end of the browser session. - if ( strpos( $task, 'gettingstarted' ) === 0 || - strpos( $task, 'redirect' ) === 0 ) { - \ChangeTags::addTags( - 'gettingstarted edit', - $recentChange->getAttribute( 'rc_id' ), - $recentChange->getAttribute( 'rc_this_oldid' ), - $recentChange->getAttribute( 'rc_logid' ) - ); - } - return true; - } - - public static function onListDefinedTags( &$tags ) { - $tags[] = 'gettingstarted edit'; - return true; - } - - /** - * Checks if they have edited the main namespace - * - * @param User $user user to check - * @return true if they have, false otherwise - */ - protected static function hasEditedMainNamespace( User $user ) { - global $wgRequest; - - $api = new \ApiMain( - new \DerivativeRequest( - $wgRequest, - array( - 'action' => 'query', - 'list' => 'usercontribs', - 'ucuser' => $user->getName(), - 'uclimit' => 1, - 'ucnamespace' => NS_MAIN, - ), - false // not posted - ), - false // disable write - ); - - $api->execute(); - $result = $api->getResultData(); - return isset( $result['query']['usercontribs'] ) && count( $result['query']['usercontribs'] ) >= 1; - } - public static function onGetPreferences( User $user, array &$preferences ) { // Show tour and fade in navbar and help button $preferences[self::INTRO_OPTION] = array( @@ -487,10 +421,6 @@ "gettingstarted-task-toolbar-no-suggested-page", "gettingstarted-task-copyedit-toolbar-description", "gettingstarted-task-copyedit-toolbar-try-another-title", - "gettingstarted-task-clarify-toolbar-description", - "gettingstarted-task-clarify-toolbar-try-another-title", - "gettingstarted-task-addlinks-toolbar-description", - "gettingstarted-task-addlinks-toolbar-try-another-title", "guidedtour-tour-gettingstartedtasktoolbarintro-description", "guidedtour-tour-gettingstartedtasktoolbar-ambox-description", "guidedtour-tour-gettingstartedtasktoolbar-edit-article-title", diff --git a/i18n/en.json b/i18n/en.json index f076531..0749798 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -6,9 +6,6 @@ }, "gettingstarted": "Getting started", "gettingstarted-desc": "Helps new users become editors", - "gettingstarted-project-link": "{{ns:Project}}:GettingStarted", - "tag-gettingstarted_edit": "via [[{{MediaWiki:gettingstarted-project-link}}|Getting Started]] edit suggestions", - "tag-gettingstarted_edit-description": "Edit made via the [[{{MediaWiki:gettingstarted-project-link}}|GettingStarted]] system, which suggests easy tasks to editors and shows them how to complete them.", "gettingstarted-task-toolbar-editing-help-text": "Show me how", "gettingstarted-task-toolbar-editing-help-title": "Show a guide on how to edit", "gettingstarted-task-toolbar-try-another-text": "Try another page ►", @@ -16,10 +13,6 @@ "gettingstarted-task-toolbar-no-suggested-page": "Sorry. We couldn't find more pages to be improved at the moment. Try again in a moment or search for your own topics of interest.", "gettingstarted-task-copyedit-toolbar-description": "This page may have spelling or grammar errors you can fix.", "gettingstarted-task-copyedit-toolbar-try-another-title": "Go to a random page you can improve by copyediting", - "gettingstarted-task-clarify-toolbar-description": "This page may be confusing or vague. Look for ways you can make it clearer.", - "gettingstarted-task-clarify-toolbar-try-another-title": "Go to a random page you can clarify", - "gettingstarted-task-addlinks-toolbar-description": "This page may need more links. Look for terms that have a {{SITENAME}} page.", - "gettingstarted-task-addlinks-toolbar-try-another-title": "Go to a random page you can add links to", "guidedtour-tour-gettingstartedtasktoolbarintro-title": "Let's get started", "guidedtour-tour-gettingstartedtasktoolbarintro-description": "This page is identified by other {{SITENAME}} users as needing improvement. You don't have to be an expert in the subject to help.", "guidedtour-tour-gettingstartedtasktoolbar-ambox-title": "Ideas on what to do", @@ -42,22 +35,10 @@ "gettingstarted-cta-fix-pages": "Edit a suggested page", "gettingstarted-cta-fix-pages-sub": "We'll pick something easy", "gettingstarted-cta-leave": "No thanks, maybe later", - "guidedtour-tour-anonymouseditoracquisitionpreeditv1-title": "Sign up to edit {{SITENAME}}", - "guidedtour-tour-anonymouseditoracquisitionpreeditv1-description": "We recommend you create an account to edit {{SITENAME}}. It's free, easy, and requires no personal information.", - "guidedtour-tour-anonymouseditoracquisitionpreeditv1-sign-up": "Sign up and edit", - "guidedtour-tour-anonymouseditoracquisitionpreeditv1-continue": "No thanks", - "guidedtour-tour-anonymouseditoracquisitionpreeditv2-title": "Sign up or continue editing", - "guidedtour-tour-anonymouseditoracquisitionpreeditv2-description": "Signing up is not required to edit {{SITENAME}}, but it's easy and requires no personal information.", - "guidedtour-tour-anonymouseditoracquisitionpreeditv2-sign-up": "Sign up", - "guidedtour-tour-anonymouseditoracquisitionpreeditv2-continue": "Continue editing", "gettingstarted-task-toolbar-try-another-text-wikipedia": "Try another article ►", "gettingstarted-task-toolbar-no-suggested-page-wikipedia": "Sorry. We couldn't find more articles to be improved at the moment. Try again in a moment or search for your own topics of interest.", "gettingstarted-task-copyedit-toolbar-description-wikipedia": "This article may have spelling or grammar errors you can fix.", "gettingstarted-task-copyedit-toolbar-try-another-title-wikipedia": "Go to a random article you can improve by copyediting", - "gettingstarted-task-clarify-toolbar-description-wikipedia": "This article may be confusing or vague. Look for ways you can make it clearer.", - "gettingstarted-task-clarify-toolbar-try-another-title-wikipedia": "Go to a random article you can clarify", - "gettingstarted-task-addlinks-toolbar-description-wikipedia": "This article may need more links. Look for terms that have a {{SITENAME}} article.", - "gettingstarted-task-addlinks-toolbar-try-another-title-wikipedia": "Go to a random article you can add links to", "guidedtour-tour-gettingstartedtasktoolbarintro-description-wikipedia": "This article is identified by other {{SITENAME}} users as needing improvement. You don't have to be an expert in the subject to help.", "guidedtour-tour-gettingstartedtasktoolbar-ambox-description-wikipedia": "These banners identify problems with this article. You don't need to fix them all, just stick with what you're comfortable doing.", "guidedtour-tour-gettingstartedtasktoolbar-edit-article-title-wikipedia": "Edit the whole article…", diff --git a/maintenance/generate_config.php b/maintenance/generate_config.php index a9fd061..2b0b845 100644 --- a/maintenance/generate_config.php +++ b/maintenance/generate_config.php @@ -34,8 +34,6 @@ */ private $qidsForTaskTypes = array( 'copyedit' => 'Q9125773', // Category:Wikipedia articles needing copy edit - 'clarify' => 'Q8235653', // Category:All Wikipedia articles needing clarification - 'addlinks' => 'Q8235714', // Category:All articles with too few wikilinks ); public function __construct() { diff --git a/resources/ext.gettingstarted.anonymousEditorAcquisition.js b/resources/ext.gettingstarted.anonymousEditorAcquisition.js deleted file mode 100644 index 5e1ed69..0000000 --- a/resources/ext.gettingstarted.anonymousEditorAcquisition.js +++ /dev/null @@ -1,261 +0,0 @@ -( function ( mw, $, gt ) { - - 'use strict'; - - var $currentGuiderTarget, - user = mw.gettingStarted.user, - token = user.getToken(), - bucket = user.getBucket(), - ctaFlagKey = '-gettingStartedHasShownAnonymousEditorAcquisitionCTA', - isVeAvailable = mw.libs.ve && mw.libs.ve.isAvailable, - currentUri = new mw.Uri(), - // isViewPage code is from VE and is used to determine whether VE can be loaded without a full page load - isViewPage = ( - mw.config.get( 'wgIsArticle' ) && - !( 'diff' in currentUri.query ) - ), - namespace = mw.config.get( 'wgNamespaceNumber' ), - self, - isLinkClickLoggingDisabled = false, - Bucket = mw.gettingStarted.Bucket, - targetElementsSelector = '#ca-edit, #ca-ve-edit, .mw-editsection a', - logEventOrTimeout = mw.gettingStarted.logging.logEventOrTimeout; - - /** - * Registers a click listener on links corresponding to one or more selectors. - * When event occurs, logs a SignupExpPageLinkClick event. - * - * If `shouldDelay` is false, it will allow the normal link navigation to work. - * - * If `shouldDelay` is true, it will prevent normal navigation and wait for logging. When - * logging completes, or after a 500 millisecond timeout, it will navigate then. - * - * @private - * - * @param {string} selector The link selector - * @param {string} link Identifier for link, for logging - * @param {boolean} shouldDelay True to delay the default link navigation, false otherwise - */ - function logLinkClick( selector, link, shouldDelay ) { - if ( shouldDelay === undefined ) { - shouldDelay = true; - } - - $( selector ).click( function ( event ) { - var schemaName, eventInstance; - - if ( isLinkClickLoggingDisabled ) { - return; - } - - schemaName = 'SignupExpPageLinkClick'; - eventInstance = { - token: token, - bucket: bucket, - link: link, - namespace: namespace - }; - - if ( shouldDelay ) { - event.preventDefault(); - - logEventOrTimeout( schemaName, eventInstance ).always( function () { - window.location.href = getHrefFromTarget( $( event.currentTarget ) ); - } ); - } else { - mw.eventLog.logEvent( schemaName, eventInstance ); - } - } ); - } - - function unregisterVariants() { - $( targetElementsSelector ).off( 'click.mw-gettingstarted' ); - - if ( isVeAvailable && isViewPage ) { - $( '#ca-ve-edit' ).on( 'click', mw.libs.ve.onEditTabClick ); - $( '.mw-editsection-visualeditor' ).on( 'click', mw.libs.ve.onEditSectionLinkClick ); - } - } - - function initVariants() { - var baseTourName = 'anonymouseditoracquisitionpreedit', - tourName = baseTourName; - - if ( isVeAvailable ) { - $( '#ca-ve-edit' ).off( 'click', mw.libs.ve.onEditTabClick ); - $( '.mw-editsection-visualeditor' ).off( 'click', mw.libs.ve.onEditSectionLinkClick ); - } - - if ( bucket === Bucket.PRE_EDIT_V1 ) { - tourName += 'v1'; - } else if ( bucket === Bucket.PRE_EDIT_V2 ) { - tourName += 'v2'; - } - - $( targetElementsSelector ).on( 'click.mw-gettingstarted', function ( event ) { - // Unregister and prevent dead click by returning true - if( mw.cookie.get( ctaFlagKey ) !== null ) { - unregisterVariants(); - return true; - } - event.preventDefault(); - event.stopPropagation(); - - $currentGuiderTarget = $( this ); - $currentGuiderTarget.addClass( 'mw-gettingstarted-anonymouseditoracquisition-guider-target' ); - - unregisterVariants(); - - if ( mw.libs.guiders ) { - mw.libs.guiders.reposition(); - } - - launchTour( tourName ); - } ); - } - - // Wrapper for launching the experiment tour - function launchTour( tourName ) { - // Set cookie so we know when not to show the tour - mw.cookie.set( ctaFlagKey, 'true' ); - gt.launcher.launchTour( tourName ); - } - - /** - * Returns the href of a link, from the given target. This is either from the target - * itself (section links), or the link descendant (tabs). - * - * @return {string} href attribute from target's link - */ - function getHrefFromTarget( $target ) { - if ( !$target.is( 'a' ) ) { - $target = $target.find( 'a' ); - } - return $target.attr( 'href' ); - } - - function logContinueAndClickTarget() { - gt.hideAll(); - - mw.eventLog.logEvent( 'SignupExpCTAButtonClick', { - token: token, - cta: bucket, - button: 'edit', - namespace: namespace - } ); - - // Load VE without a full page load. - - // NOTE (phuedx, 2014-05-14) Because we're triggering the click event of - // the Edit link, we have to temporarily disable logging the - // SignupExpPageLinkClick event. - isLinkClickLoggingDisabled = true; - $currentGuiderTarget.click(); - isLinkClickLoggingDisabled = false; - } - - function logContinueAndFollowTarget() { - logEventOrTimeout( 'SignupExpCTAButtonClick', { - token: token, - cta: bucket, - button: 'edit', - namespace: namespace - } ).always( function () { - window.location.href = getHrefFromTarget( $currentGuiderTarget ); - } ); - } - - /** - * Public anonymous editor acquisition API - * - * @class mw.gettingStarted.anonymousEditorAcquisition - * @singleton - */ - mw.gettingStarted.anonymousEditorAcquisition = self = { - - /** - * Handles the 'No thanks' and 'Continue editing' selection. - */ - handleContinue: function () { - var isTargetVEEditLink = - $currentGuiderTarget.is( '#ca-ve-edit' ) || $currentGuiderTarget.is( '.mw-editsection-visualeditor' ); - - if ( isTargetVEEditLink && isViewPage ) { - logContinueAndClickTarget(); - } else { - logContinueAndFollowTarget(); - } - }, - - /** - * Handles the 'Sign up and edit' and 'Sign up' selections from the - * pre-edit v1 and v2 variants respectively. Goes to the signup page, - * using the current page as the returnto and the query string from the - * edit tab/link as the returntoquery. - */ - handleSignup: function () { - var uri = new mw.Uri( getHrefFromTarget( $currentGuiderTarget ) ); - - delete uri.query.title; - - logEventOrTimeout( 'SignupExpCTAButtonClick', { - token: token, - cta: bucket, - button: 'signup', - namespace: namespace - } ).always( function () { - window.location.href = new mw.Title( 'Special:UserLogin' ).getUrl( { - type: 'signup', - returnto: mw.config.get( 'wgPageName' ), - returntoquery: uri.getQueryString() - } ); - } ); - }, - - /** - * Handles dismissal of either version of the pre-edit CTA. - */ - handleClose: function () { - mw.eventLog.logEvent( 'SignupExpCTAButtonClick', { - token: token, - cta: bucket, - button: 'dismiss', - namespace: namespace - } ); - }, - - /** - * Handles the display of the pre-edit CTA. - */ - handleShow: function () { - mw.eventLog.logEvent( 'SignupExpCTAImpression', { - token: token, - cta: bucket, - namespace: mw.config.get( 'wgNamespaceNumber' ) - } ); - } - }; - - $( function () { - var shouldShowCta = mw.cookie.get( ctaFlagKey ) === null && bucket !== Bucket.CONTROL; - - // If clicking "edit" or "edit source" shows a guider, then don't follow - // the link and allow the SignupExpPageLinkClick event to be logged - // asynchronously. - logLinkClick( '#ca-edit', 'edit page', !shouldShowCta ); - logLinkClick( '.mw-editsection a:not(.mw-editsection-visualeditor)', 'edit section', !shouldShowCta ); - - // That said, if the user is activating the Visual Editor, and that - // doesn't require a page reload, then allow the event to be logged - // asynchronously. - logLinkClick( '#ca-ve-edit', 'edit page', !isViewPage && !shouldShowCta ); - logLinkClick( '.mw-editsection-visualeditor', 'edit section', !isViewPage && !shouldShowCta ); - - logLinkClick( '#pt-createaccount', 'create account' ); - - if ( shouldShowCta ) { - initVariants(); - } - } ); - -} ( mediaWiki, jQuery, mediaWiki.guidedTour ) ); diff --git a/resources/ext.gettingstarted.return.js b/resources/ext.gettingstarted.return.js index db62b74..3dee6d8 100644 --- a/resources/ext.gettingstarted.return.js +++ b/resources/ext.gettingstarted.return.js @@ -19,13 +19,6 @@ CTA_TYPE_EDIT_CURRENT = 'edit current', CTA_TYPE_EDIT_CURRENT_OR_SUGGESTED = 'edit current or suggested'; - function logMissingSuggestedArticle() { - mw.eventLog.logEvent( 'GettingStartedNavbarNoArticle', { - version: 1, - funnel: fullTaskType - } ); - } - function logRedirectImpression( ctaType ) { var event; @@ -265,13 +258,11 @@ ]; ctaType = CTA_TYPE_EDIT_CURRENT_OR_SUGGESTED; } else { - logMissingSuggestedArticle(); dialogSpec.buttons = [ editCurrentPrimaryButton ]; ctaType = CTA_TYPE_EDIT_CURRENT; } } else if ( pageKind === 'other' ) { if ( !suggestedTitle) { - logMissingSuggestedArticle(); logRedirectImpression( CTA_TYPE_NONE ); // Nothing to show in dialog return; diff --git a/resources/tours/anonymouseditoracquisitionpreeditv1.js b/resources/tours/anonymouseditoracquisitionpreeditv1.js deleted file mode 100644 index 91cc953..0000000 --- a/resources/tours/anonymouseditoracquisitionpreeditv1.js +++ /dev/null @@ -1,45 +0,0 @@ -( function ( mw, $, gt ) { - - 'use strict'; - - gt.defineTour( { - name: 'anonymouseditoracquisitionpreeditv1', - shouldLog: true, - isSinglePage: true, - steps: [ { - titlemsg: 'guidedtour-tour-anonymouseditoracquisitionpreeditv1-title', - descriptionmsg: 'guidedtour-tour-anonymouseditoracquisitionpreeditv1-description', - position: 'top', - allowAutomaticOkay: false, - attachTo: '.mw-gettingstarted-anonymouseditoracquisition-guider-target', - onShow: function () { - mw.gettingStarted.anonymousEditorAcquisition.handleShow(); - }, - onClose: function () { - mw.gettingStarted.anonymousEditorAcquisition.handleClose(); - }, - buttons: [ - - // "No thanks" - { - namemsg: 'guidedtour-tour-anonymouseditoracquisitionpreeditv1-continue', - onclick: function () { - mw.gettingStarted.anonymousEditorAcquisition.handleContinue(); - }, - classString: 'mw-ui-quiet' - }, - - // "Sign up and edit" - { - namemsg: 'guidedtour-tour-anonymouseditoracquisitionpreeditv1-sign-up', - onclick: function () { - mw.gettingStarted.anonymousEditorAcquisition.handleSignup(); - }, - classString: 'mw-ui-progressive' - } - ], - closeOnClickOutside: false - } ] - } ); - -} ( mediaWiki, jQuery, mediaWiki.guidedTour ) ); diff --git a/resources/tours/anonymouseditoracquisitionpreeditv2.js b/resources/tours/anonymouseditoracquisitionpreeditv2.js deleted file mode 100644 index 3e5c600..0000000 --- a/resources/tours/anonymouseditoracquisitionpreeditv2.js +++ /dev/null @@ -1,45 +0,0 @@ -( function ( mw, $, gt ) { - - 'use strict'; - - gt.defineTour( { - name: 'anonymouseditoracquisitionpreeditv2', - shouldLog: true, - isSinglePage: true, - steps: [ { - titlemsg: 'guidedtour-tour-anonymouseditoracquisitionpreeditv2-title', - descriptionmsg: 'guidedtour-tour-anonymouseditoracquisitionpreeditv2-description', - position: 'top', - allowAutomaticOkay: false, - attachTo: '.mw-gettingstarted-anonymouseditoracquisition-guider-target', - onShow: function () { - mw.gettingStarted.anonymousEditorAcquisition.handleShow(); - }, - onClose: function () { - mw.gettingStarted.anonymousEditorAcquisition.handleClose(); - }, - buttons: [ - - // "Continue editing" - { - namemsg: 'guidedtour-tour-anonymouseditoracquisitionpreeditv2-continue', - onclick: function () { - mw.gettingStarted.anonymousEditorAcquisition.handleContinue(); - }, - type: 'neutral' - }, - - // "Sign up" - { - namemsg: 'guidedtour-tour-anonymouseditoracquisitionpreeditv2-sign-up', - onclick: function () { - mw.gettingStarted.anonymousEditorAcquisition.handleSignup(); - }, - classString: 'mw-ui-progressive' - } - ], - closeOnClickOutside: false - } ] - } ); - -} ( mediaWiki, jQuery, mediaWiki.guidedTour ) ); -- To view, visit https://gerrit.wikimedia.org/r/161969 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9ec9b0295acd51ad37f227182f65f47aad3d3c1b Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/GettingStarted Gerrit-Branch: master Gerrit-Owner: Phuedx <[email protected]> Gerrit-Reviewer: Halfak <[email protected]> Gerrit-Reviewer: Mattflaschen <[email protected]> Gerrit-Reviewer: Phuedx <[email protected]> Gerrit-Reviewer: Robmoen <[email protected]> Gerrit-Reviewer: Siebrand <[email protected]> Gerrit-Reviewer: Swalling <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
