jenkins-bot has submitted this change and it was merged.

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
M modules/ve-mw/i18n/qqq.json
D modules/ve-mw/ui/dialogs/ve.ui.MWGeneralReferenceDialog.js
D modules/ve-mw/ui/styles/dialogs/ve.ui.MWGeneralReferenceDialog.css
6 files changed, 1 insertion(+), 185 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/VisualEditor.php b/VisualEditor.php
index 66bb39c..efd4a3b 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -1317,7 +1317,6 @@
                        'modules/ve-mw/ui/dialogs/ve.ui.MWCitationDialog.js',
                        
'modules/ve-mw/ui/dialogs/ve.ui.MWReferencesListDialog.js',
                        'modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js',
-                       
'modules/ve-mw/ui/dialogs/ve.ui.MWGeneralReferenceDialog.js',
 
                        
'modules/ve-mw/ui/widgets/ve.ui.MWReferenceSourceSelectWidget.js',
 
@@ -1333,7 +1332,6 @@
                        
'modules/ve-mw/ui/styles/widgets/ve.ui.MWReferenceGroupInputWidget.css',
                        
'modules/ve-mw/ui/styles/widgets/ve.ui.MWReferenceResultWidget.css',
                        
'modules/ve-mw/ui/styles/widgets/ve.ui.MWReferenceSearchWidget.css',
-                       
'modules/ve-mw/ui/styles/dialogs/ve.ui.MWGeneralReferenceDialog.css',
                ),
                'dependencies' => array(
                        'ext.visualEditor.mwreference.core',
@@ -1341,8 +1339,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..7b9623e 100644
--- a/extension.json
+++ b/extension.json
@@ -1338,7 +1338,6 @@
                                
"modules/ve-mw/ui/dialogs/ve.ui.MWCitationDialog.js",
                                
"modules/ve-mw/ui/dialogs/ve.ui.MWReferencesListDialog.js",
                                
"modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js",
-                               
"modules/ve-mw/ui/dialogs/ve.ui.MWGeneralReferenceDialog.js",
                                
"modules/ve-mw/ui/widgets/ve.ui.MWReferenceSourceSelectWidget.js",
                                
"modules/ve-mw/ui/tools/ve.ui.MWReferenceDialogTool.js",
                                
"modules/ve-mw/ui/tools/ve.ui.MWCitationDialogTool.js",
@@ -1350,8 +1349,7 @@
                        "styles": [
                                
"modules/ve-mw/ui/styles/widgets/ve.ui.MWReferenceGroupInputWidget.css",
                                
"modules/ve-mw/ui/styles/widgets/ve.ui.MWReferenceResultWidget.css",
-                               
"modules/ve-mw/ui/styles/widgets/ve.ui.MWReferenceSearchWidget.css",
-                               
"modules/ve-mw/ui/styles/dialogs/ve.ui.MWGeneralReferenceDialog.css"
+                               
"modules/ve-mw/ui/styles/widgets/ve.ui.MWReferenceSearchWidget.css"
                        ],
                        "dependencies": [
                                "ext.visualEditor.mwreference.core",
@@ -1359,8 +1357,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/i18n/qqq.json b/modules/ve-mw/i18n/qqq.json
index 0a86d66..96001a6 100644
--- a/modules/ve-mw/i18n/qqq.json
+++ b/modules/ve-mw/i18n/qqq.json
@@ -79,8 +79,6 @@
        "visualeditor-dialog-beta-welcome-action-continue": "Used as label for 
the Continue button which is used to close the dialog and continue using 
VisualEditor.\n{{Identical|Continue}}",
        "visualeditor-dialog-beta-welcome-content": "Text explaining 
VisualEditor is in beta.\n\nRefers to 
{{msg-mw|Visualeditor-help-tool}}.\n\nParameters:\n* $1 - {{msg-mw|Edit}}",
        "visualeditor-dialog-beta-welcome-title": "Title of the beta welcome 
dialog. Parameters:\n* $1 - username or empty string, for GENDER support",
-       "visualeditor-dialog-generalreference-intro": "Introduction text to the 
general reference dialog, requesting the user to choose the type of source to 
add",
-       "visualeditor-dialog-generalreference-title": "Title of the general 
references dialog.",
        "visualeditor-dialog-media-alttext-section": "Label for the image 
alternative text sub-section.",
        "visualeditor-dialog-media-alttext-section-help": "Message displayed as 
contextual help about the alternative text box to editors in the media editing 
dialog.",
        "visualeditor-dialog-media-change-image": "Label for the button to 
change the current image in the media edit dialog.",
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: merged
Gerrit-Change-Id: Ic6fb3f3675de238f606acecc163ceda04ca78fb4
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to