Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/209694

Change subject: Remove MWGeneralReferenceDialog
......................................................................

Remove MWGeneralReferenceDialog

This was only opened by the Citoid inspector, which now
embeds a MWReferenceSourceSelectWidget.

Change-Id: Ic6fb3f3675de238f606acecc163ceda04ca78fb4
---
M VisualEditor.php
M extension.json
M modules/ve-mw/i18n/en.json
D modules/ve-mw/ui/dialogs/ve.ui.MWGeneralReferenceDialog.js
D modules/ve-mw/ui/styles/dialogs/ve.ui.MWGeneralReferenceDialog.css
5 files changed, 0 insertions(+), 178 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/94/209694/1

diff --git a/VisualEditor.php b/VisualEditor.php
index 66bb39c..a81334b 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -1341,8 +1341,6 @@
                        'ext.visualEditor.mediawiki'
                ),
                'messages' => array(
-                       'visualeditor-dialog-generalreference-intro',
-                       'visualeditor-dialog-generalreference-title',
                        'visualeditor-dialog-reference-editing-reused',
                        'visualeditor-dialog-reference-options-group-label',
                        
'visualeditor-dialog-reference-options-group-placeholder',
diff --git a/extension.json b/extension.json
index 433d995..c8e6e7e 100644
--- a/extension.json
+++ b/extension.json
@@ -1359,8 +1359,6 @@
                                "ext.visualEditor.mediawiki"
                        ],
                        "messages": [
-                               "visualeditor-dialog-generalreference-intro",
-                               "visualeditor-dialog-generalreference-title",
                                "visualeditor-dialog-reference-editing-reused",
                                
"visualeditor-dialog-reference-options-group-label",
                                
"visualeditor-dialog-reference-options-group-placeholder",
diff --git a/modules/ve-mw/i18n/en.json b/modules/ve-mw/i18n/en.json
index a854c1d..6a60d38 100644
--- a/modules/ve-mw/i18n/en.json
+++ b/modules/ve-mw/i18n/en.json
@@ -70,8 +70,6 @@
        "visualeditor-dialog-beta-welcome-action-continue": "Continue",
        "visualeditor-dialog-beta-welcome-content": "This is our new, easier 
way to edit. It's still in beta, which means you might find parts of the page 
you can't edit, or encounter issues that need to be fixed. We encourage you to 
review your changes, and we welcome reports about any issues you might 
encounter in using VisualEditor (click the \"{{int:visualeditor-help-tool}}\" 
button to submit feedback). You can switch to the wikitext editor at any time 
by clicking on the \"$1\" tab, keeping any changes you have made.",
        "visualeditor-dialog-beta-welcome-title": "{{GENDER:$1|Welcome}} to 
VisualEditor",
-       "visualeditor-dialog-generalreference-intro": "Choose a type of 
source:",
-       "visualeditor-dialog-generalreference-title": "Add reference",
        "visualeditor-dialog-media-alttext-section": "Alternative text",
        "visualeditor-dialog-media-alttext-section-help": "You can use this to 
give a text description which is used for people who can't see the item. The 
description should be good enough for them to understand the purpose and 
information given by the media item. This is vital for blind users and other 
people using screen-reader software or text-only browsers.",
        "visualeditor-dialog-media-change-image": "Change image",
diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWGeneralReferenceDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWGeneralReferenceDialog.js
deleted file mode 100644
index 9b215f3..0000000
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWGeneralReferenceDialog.js
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * VisualEditor user interface MWGeneralReferenceDialog class.
- *
- * @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
- * @license The MIT License (MIT); see LICENSE.txt
- */
-
-/**
- * Dialog for inserting and editing MediaWiki references by type.
- *
- * @class
- * @abstract
- * @extends ve.ui.NodeDialog
- *
- * @constructor
- * @param {Object} [config] Configuration options
- */
-ve.ui.MWGeneralReferenceDialog = function VeUiMWGeneralReferenceDialog( config 
) {
-       // Parent constructor
-       ve.ui.MWGeneralReferenceDialog.super.call( this, config );
-};
-
-/* Inheritance */
-
-OO.inheritClass( ve.ui.MWGeneralReferenceDialog, ve.ui.NodeDialog );
-
-/* Static Properties */
-
-ve.ui.MWGeneralReferenceDialog.static.name = 'generalreference';
-
-ve.ui.MWGeneralReferenceDialog.static.title =
-       OO.ui.deferMsg( 'visualeditor-dialog-generalreference-title' );
-
-ve.ui.MWGeneralReferenceDialog.static.icon = 'reference';
-
-ve.ui.MWGeneralReferenceDialog.static.actions = [
-       {
-               label: OO.ui.deferMsg( 'visualeditor-dialog-action-cancel' ),
-               flags: 'safe'
-       }
-];
-
-/**
- * @inheritdoc
- */
-ve.ui.MWGeneralReferenceDialog.prototype.getBodyHeight = function () {
-       return 400;
-};
-
-/**
- * @inheritdoc
- */
-ve.ui.MWGeneralReferenceDialog.prototype.initialize = function () {
-       var sourceField;
-
-       // Parent method
-       ve.ui.MWGeneralReferenceDialog.super.prototype.initialize.apply( this, 
arguments );
-
-       this.panel = new OO.ui.PanelLayout( {
-               classes: [ 've-ui-mwGeneralReferenceDialog-panel' ],
-               padded: true,
-               expanded: false
-       } );
-
-       this.sourceSelect = new ve.ui.MWReferenceSourceSelectWidget( {
-               classes: [ 've-ui-mwGeneralReferenceDialog-select' ],
-               showExisting: true
-       } );
-       $( '<div>' ).addClass( 've-ui-mwGeneralReferenceDialog-spacer' 
).insertBefore(
-               this.sourceSelect.getRefBasic().$element
-       );
-       sourceField = new OO.ui.FieldLayout( this.sourceSelect, {
-               align: 'top',
-               label: ve.msg( 'visualeditor-dialog-generalreference-intro' )
-       } );
-
-       // Events
-       this.sourceSelect.connect( this, { choose: 'onSourceSelectChoose' } );
-
-       // Assemble the panel
-       this.panel.$element.append( sourceField.$element );
-
-       this.$body
-               .addClass( 've-ui-mwGeneralReferenceDialog' )
-               .append( this.panel.$element );
-};
-
-/**
- * @inheritdoc
- */
-ve.ui.MWGeneralReferenceDialog.prototype.getSetupProcess = function ( data ) {
-       return 
ve.ui.MWGeneralReferenceDialog.super.prototype.getSetupProcess.call( this, data 
)
-               .next( function () {
-                       if ( this.manager.surface.getInDialog() === 'reference' 
) {
-                               // Hide basic reference if we are already in 
the basic reference menu
-                               this.sourceSelect.getRefBasic().setDisabled( 
true );
-                               this.sourceSelect.getRefExisting().setDisabled( 
true );
-                       } else {
-                               // Check if the 'use existing' button should be 
enabled
-                               this.sourceSelect.getRefExisting().setDisabled( 
!this.doReferencesExist() );
-                       }
-               }, this );
-};
-
-/**
- * @inheritdoc
- */
-ve.ui.MWGeneralReferenceDialog.prototype.getTeardownProcess = function ( data 
) {
-       return 
ve.ui.MWGeneralReferenceDialog.super.prototype.getTeardownProcess.call( this, 
data )
-               .next( function () {
-                       // Clear selection
-                       this.sourceSelect.selectItem();
-               }, this );
-};
-
-/**
- * Check if there are any references in the current page.
- *
- * @return {boolean} There are references
- */
-ve.ui.MWGeneralReferenceDialog.prototype.doReferencesExist = function () {
-       var groupName,
-               groups = 
this.getFragment().getDocument().getInternalList().getNodeGroups();
-
-       for ( groupName in groups ) {
-               if ( groupName.lastIndexOf( 'mwReference/' ) === 0 && 
groups[groupName].indexOrder.length ) {
-                       return true;
-               }
-       }
-       return false;
-};
-
-/**
- * Handle source select widget choose events
- *
- * @param {OO.ui.OptionWidget} item Chosen item
- */
-ve.ui.MWGeneralReferenceDialog.prototype.onSourceSelectChoose = function ( 
item ) {
-       var data = item.getData(),
-               // Closing the dialog may unset some properties, so cache the 
ones we want
-               fragment = this.getFragment(),
-               manager = this.getManager();
-
-       // Close this dialog then open the new dialog
-       this.close().then( function () {
-               manager.getSurface().execute( 'mwcite', 'open', 
data.windowName, $.extend( {
-                       fragment: fragment
-               }, data.dialogData ) );
-       } );
-};
-
-/* Registration */
-
-ve.ui.windowFactory.register( ve.ui.MWGeneralReferenceDialog );
diff --git a/modules/ve-mw/ui/styles/dialogs/ve.ui.MWGeneralReferenceDialog.css 
b/modules/ve-mw/ui/styles/dialogs/ve.ui.MWGeneralReferenceDialog.css
deleted file mode 100644
index 4958531..0000000
--- a/modules/ve-mw/ui/styles/dialogs/ve.ui.MWGeneralReferenceDialog.css
+++ /dev/null
@@ -1,18 +0,0 @@
-/*!
- * VisualEditor MediaWiki UserInterface MWGeneralReferenceDialog styles.
- *
- * @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
- * @license The MIT License (MIT); see LICENSE.txt
- */
-
-.ve-ui-mwGeneralReferenceDialog-panel {
-       margin: 1em 3em;
-}
-
-.ve-ui-mwGeneralReferenceDialog-select .oo-ui-optionWidget {
-       margin: 1em 0;
-}
-
-.ve-ui-mwGeneralReferenceDialog-select 
.ve-ui-mwGeneralReferenceDialog-spacer:not(:first-child) {
-       border-top: 1px solid #cccccc;
-}

-- 
To view, visit https://gerrit.wikimedia.org/r/209694
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6fb3f3675de238f606acecc163ceda04ca78fb4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to