Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/231462
Change subject: Remove errorReport from MobileFrontend
......................................................................
Remove errorReport from MobileFrontend
Talk is now in stable.
Bug: T100704
Change-Id: I858cf7caf56ef5268dc529b854518d561094eac2
---
M i18n/en.json
M includes/Resources.php
D resources/mobile.errorReport.overlay/ErrorReportOverlay.hogan
D resources/mobile.errorReport.overlay/ErrorReportOverlay.js
D resources/mobile.errorReport.overlay/errorReportOverlay.less
D resources/mobile.errorReport/init.js
6 files changed, 0 insertions(+), 251 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/62/231462/1
diff --git a/i18n/en.json b/i18n/en.json
index faf4172..321a113 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -151,15 +151,6 @@
"mobile-frontend-editor-reference-placeholder": "Which source do you
refer to?",
"mobile-frontend-editor-add-reference": "Add",
"mobile-frontend-enable-images": "Enable images on mobile site",
- "mobile-frontend-errorreport-button-label": "Report an error",
- "mobile-frontend-errorreport-error": "Error, feedback could not be
posted.",
- "mobile-frontend-errorreport-feedback": "Thanks for your feedback!",
- "mobile-frontend-errorreport-heading": "Report an error",
- "mobile-frontend-errorreport-instructions": "<p>This form is only for
reporting errors in Wikipedia articles. Please do not report missing
information.</p><p>If you found an error, please try to fix it yourself by
editing the page. If you cannot fix the error, then report it using the
following form.</p><p>Do not leave your phone number or email address.</p>",
- "mobile-frontend-errorreport-placeholder": "Enter error report here.",
- "mobile-frontend-errorreport-section-title": "Suggested correction",
- "mobile-frontend-errorreport-submit": "Submit",
- "mobile-frontend-errorreport-summary": "Reporting an error",
"mobile-frontend-expand-sections-description": "Always expand all
sections when navigating to a new page.",
"mobile-frontend-expand-sections-status": "Expand all sections",
"mobile-frontend-fontchanger-link": "Font size",
diff --git a/includes/Resources.php b/includes/Resources.php
index 3de8c4e..e9dd0fc 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -1141,47 +1141,6 @@
),
),
- 'mobile.errorReport' => $wgMFResourceFileModuleBoilerplate + array(
- 'dependencies' => array(
- 'mobile.startup',
- 'mobile.overlays',
- 'mobile.buttonWithSpinner',
- ),
- 'scripts' => array(
- 'resources/mobile.errorReport/init.js',
- ),
- 'messages' => array(
- 'mobile-frontend-errorreport-button-label',
- ),
- ),
-
- 'mobile.errorReport.overlay' => $wgMFResourceFileModuleBoilerplate +
array(
- 'dependencies' => array(
- 'mobile.overlays',
- 'mobile.toast',
- ),
- 'scripts' => array(
-
'resources/mobile.errorReport.overlay/ErrorReportOverlay.js',
- ),
- 'styles' => array(
-
'resources/mobile.errorReport.overlay/errorReportOverlay.less',
- ),
- 'messages' => array(
- 'mobile-frontend-editor-licensing',
- 'mobile-frontend-errorreport-error',
- 'mobile-frontend-errorreport-feedback',
- 'mobile-frontend-errorreport-heading',
- 'mobile-frontend-errorreport-instructions',
- 'mobile-frontend-errorreport-placeholder',
- 'mobile-frontend-errorreport-section-title',
- 'mobile-frontend-errorreport-submit',
- 'mobile-frontend-errorreport-summary',
- ),
- 'templates' => array(
- 'ErrorReportOverlay.hogan' =>
'resources/mobile.errorReport.overlay/ErrorReportOverlay.hogan',
- ),
- ),
-
'mobile.quickLookup' => $wgMFResourceParsedMessageModuleBoilerplate +
array(
'dependencies' => array(
'mobile.startup',
@@ -1792,7 +1751,6 @@
'dependencies' => array(
'skins.minerva.beta.scripts',
// Feature modules that should be loaded in alpha
should be listed below here.
- 'mobile.errorReport',
'mobile.quickLookup',
),
'scripts' => array(
diff --git a/resources/mobile.errorReport.overlay/ErrorReportOverlay.hogan
b/resources/mobile.errorReport.overlay/ErrorReportOverlay.hogan
deleted file mode 100644
index b42ac77..0000000
--- a/resources/mobile.errorReport.overlay/ErrorReportOverlay.hogan
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="license-panel panel">
- <p class="license">{{{licenseMsg}}}</p>
-</div>
-<div class="content">
- {{{spinner}}}
- <div class="instructions">{{{instructions}}}</div>
- <textarea class="error-field mw-ui-input" cols="40" rows="8"
placeholder="{{placeHolder}}"></textarea>
-</div>
diff --git a/resources/mobile.errorReport.overlay/ErrorReportOverlay.js
b/resources/mobile.errorReport.overlay/ErrorReportOverlay.js
deleted file mode 100644
index 4977f63..0000000
--- a/resources/mobile.errorReport.overlay/ErrorReportOverlay.js
+++ /dev/null
@@ -1,136 +0,0 @@
-( function ( M, $ ) {
-
- var ErrorReportOverlay,
- Overlay = M.require( 'Overlay' ),
- api = M.require( 'api' ),
- toast = M.require( 'toast' );
-
- /**
- * @class ErrorReportOverlay
- * @extends Overlay
- */
- ErrorReportOverlay = Overlay.extend( {
- /**
- * @inheritdoc
- * @cfg {Object} defaults Default options hash.
- * @cfg {String} defaults.heading Title of the error reporting
interface
- * @cfg {String} defaults.placeHolder Placeholder text for
error field
- * @cfg {String} defaults.instructions Instructions about how
to use the form
- * @cfg {String} defaults.licenseMsg Licensing notice
- * FIXME: move messages to i18n once copy is approved
- */
- defaults: {
- heading: mw.msg( 'mobile-frontend-errorreport-heading'
),
- headerButtonsListClassName: 'overlay-action',
- headerButtons: [ {
- className: 'continue',
- msg: mw.msg( 'mobile-frontend-overlay-continue'
)
- } ],
- placeHolder: mw.msg(
'mobile-frontend-errorreport-placeholder' ),
- instructions: mw.msg(
'mobile-frontend-errorreport-instructions' ),
- licenseMsg: undefined
- },
- /**
- * @inheritdoc
- */
- templatePartials: {
- content: mw.template.get( 'mobile.errorReport.overlay',
'ErrorReportOverlay.hogan' )
- },
- /**
- * @inheritdoc
- */
- className: 'error-reporting-overlay overlay',
- /**
- * @inheritdoc
- */
- events: $.extend( {}, Overlay.prototype.events, {
- 'click button.continue': 'onContinueClick',
- 'click button.submit': 'onSubmitClick',
- 'keyup .error-field': 'onErrorFieldChange',
- 'paste .error-field': 'onErrorFieldChange',
- 'drop .error-field': 'onErrorFieldChange'
- } ),
-
- /**
- * Show the actual error reporting form
- * @method
- * @private
- * @param {Object} options The options for the overlay
- */
- _showForm: function ( options ) {
- options.headerButtons = [ {
- className: 'submit',
- msg: mw.msg(
'mobile-frontend-errorreport-submit' )
- } ];
- this.render( options );
- this.$( '.instructions' ).hide();
- this.$( '.error-field, .license-panel' ).show();
- this.$( 'button.submit' ).prop( 'disabled', true );
- },
-
- /**
- * Post the error report to the talk page and close the overlay
- * @method
- * @private
- * @param {String} text The text of the error report
- * @param {String} title The title of the page to post the
report to
- */
- _postErrorReport: function ( text, title ) {
- var self = this;
- api.postWithToken( 'edit', {
- action: 'edit',
- section: 'new',
- sectiontitle: mw.msg(
'mobile-frontend-errorreport-section-title' ),
- title: title,
- summary: mw.msg(
'mobile-frontend-errorreport-summary' ),
- text: text + ' ~~~~'
- } ).done( function () {
- self.hide();
- toast.show( mw.msg(
'mobile-frontend-errorreport-feedback' ), 'toast' );
- } ).fail( function () {
- self.hide();
- toast.show( mw.msg(
'mobile-frontend-errorreport-error' ), 'toast' );
- } );
- },
-
- /**
- * Continue button click handler
- */
- onContinueClick: function () {
- this._showForm( this.options );
- },
- /**
- * Submit button click handler
- */
- onSubmitClick: function () {
- var text = this.$( '.error-field' ).val(),
- $talk = $( '.talk' );
-
- if ( text.length > 15 && $talk !== undefined ) {
- // Hide the textarea, show a spinner, and post
the report
- this.$( '.error-field' ).hide();
- this.$( '.spinner' ).show();
- this._postErrorReport( text, $talk.data(
'title' ) );
- } else {
- // Close overlay and show error notification
- window.history.back();
- toast.show( mw.msg(
'mobile-frontend-errorreport-error' ), 'toast' );
- }
- },
- /**
- * Error field change handler
- * Enable the submit button when the error report is at least
15 characters
- */
- onErrorFieldChange: function () {
- var self = this;
-
- // Force length check to be asynchronous in order to
handle paste events
- setTimeout( function () {
- self.$( 'button.submit' ).prop( 'disabled',
self.$( '.error-field' ).val().length <= 15 );
- }, 0 );
- }
- } );
-
- M.define( 'errorReport/ErrorReportOverlay', ErrorReportOverlay );
-
-}( mw.mobileFrontend, jQuery ) );
diff --git a/resources/mobile.errorReport.overlay/errorReportOverlay.less
b/resources/mobile.errorReport.overlay/errorReportOverlay.less
deleted file mode 100644
index 33d98be..0000000
--- a/resources/mobile.errorReport.overlay/errorReportOverlay.less
+++ /dev/null
@@ -1,7 +0,0 @@
-.overlay-content {
- .license-panel,
- .spinner,
- .error-field {
- display: none;
- }
-}
diff --git a/resources/mobile.errorReport/init.js
b/resources/mobile.errorReport/init.js
deleted file mode 100644
index 18b1bbf..0000000
--- a/resources/mobile.errorReport/init.js
+++ /dev/null
@@ -1,49 +0,0 @@
-( function ( M, $ ) {
- // Run only in alpha mode
- M.require( 'context' ).assertMode( [ 'alpha' ] );
-
- var user = M.require( 'user' ),
- router = M.require( 'router' ),
- page = M.getCurrentPage(),
- skin = M.require( 'skin' ),
- loader = M.require( 'loader' ),
- overlayManager = M.require( 'overlayManager' ),
- editorConfig = mw.config.get( 'wgMFEditorOptions' ),
- ButtonWithSpinner = M.require( 'ButtonWithSpinner' ),
- errorButton;
-
- // Make sure we are not on the Main Page, are in main namespace, and
either the user
- // is logged in or anonymous editing is allowed.
- if ( !page.isMainPage() &&
- // FIXME: Use Page object.
- mw.config.get( 'wgNamespaceNumber' ) === 0 &&
- ( !user.isAnon() || editorConfig.anonymousEditing )
- ) {
-
- // Make overlayManager handle URL for 'Report an error' button
- overlayManager.add( /^\/error-report$/, function () {
- var result = $.Deferred();
- loader.loadModule( 'mobile.errorReport.overlay', true,
false )
- .done( function () {
- var ErrorReportOverlay = M.require(
'errorReport/ErrorReportOverlay' );
- result.resolve( new ErrorReportOverlay(
{
- licenseMsg: skin.getLicenseMsg()
- } ) );
- errorButton.hideSpinner();
- } );
- return result;
- } );
-
- // Add 'Report an error' button into page
- $( function () {
- errorButton = new ButtonWithSpinner( {
- label: mw.msg(
'mobile-frontend-errorreport-button-label' )
- } );
- errorButton.on( 'click', function () {
- errorButton.showSpinner();
- router.navigate( '#/error-report' );
- } );
- $( '#page-secondary-actions' ).append(
errorButton.$element );
- } );
- }
-}( mw.mobileFrontend, jQuery ) );
--
To view, visit https://gerrit.wikimedia.org/r/231462
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I858cf7caf56ef5268dc529b854518d561094eac2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits