mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-27 15:50:29 +00:00
Remove $wgVisualEditorTransclusionDialogInlineDescriptions feature flag
The feature is always enabled now. Bug: T307188 Change-Id: Id8b39d44901dee9118837fc4670d7faa4ef19b43
This commit is contained in:
parent
9026cf60db
commit
1b4c81c27d
|
@ -174,10 +174,6 @@
|
|||
"VisualEditorUseSingleEditTab": {
|
||||
"value": false
|
||||
},
|
||||
"VisualEditorTransclusionDialogInlineDescriptions": {
|
||||
"description": "Temporary flag to enable inline parameter descriptions in the transclusion dialog.",
|
||||
"value": false
|
||||
},
|
||||
"VisualEditorTransclusionDialogNewSidebar": {
|
||||
"description": "Temporary flag to enable the new sidebar in the transclusion dialog.",
|
||||
"value": false
|
||||
|
@ -2243,10 +2239,7 @@
|
|||
"visualeditor-dialog-transclusion-no-template-parameters",
|
||||
"visualeditor-dialog-transclusion-options",
|
||||
"visualeditor-dialog-transclusion-param-default",
|
||||
"visualeditor-dialog-transclusion-param-example",
|
||||
"visualeditor-dialog-transclusion-param-example-long",
|
||||
"visualeditor-dialog-transclusion-param-info",
|
||||
"visualeditor-dialog-transclusion-param-info-missing",
|
||||
"visualeditor-dialog-transclusion-param-selection-aria-description",
|
||||
"visualeditor-dialog-transclusion-param-selection-aria-label",
|
||||
"visualeditor-dialog-transclusion-param-undocumented",
|
||||
|
|
|
@ -219,10 +219,7 @@
|
|||
"visualeditor-dialog-transclusion-no-template-parameters": "This template has no documented parameters and may be intended for use without them.",
|
||||
"visualeditor-dialog-transclusion-options": "Options",
|
||||
"visualeditor-dialog-transclusion-param-default": "Default: $1",
|
||||
"visualeditor-dialog-transclusion-param-example": "e.g. $1",
|
||||
"visualeditor-dialog-transclusion-param-example-long": "Example: $1",
|
||||
"visualeditor-dialog-transclusion-param-info": "Field description",
|
||||
"visualeditor-dialog-transclusion-param-info-missing": "No field description available",
|
||||
"visualeditor-dialog-transclusion-param-selection-aria-description": "Press Space to add or remove parameters. Press Enter to add a parameter and immediately edit its value. When a parameter is already selected, press Enter to edit the value.",
|
||||
"visualeditor-dialog-transclusion-param-selection-aria-label": "Parameters in $1",
|
||||
"visualeditor-dialog-transclusion-param-undocumented": "(Undocumented parameter)",
|
||||
|
|
|
@ -239,10 +239,7 @@
|
|||
"visualeditor-dialog-transclusion-no-template-parameters": "Message to user that no documented parameters were found for the template.",
|
||||
"visualeditor-dialog-transclusion-options": "Label for section with options for templates, content or parameters.\n{{Identical|Options}}",
|
||||
"visualeditor-dialog-transclusion-param-default": "Label for parameter's default value in the template dialog. $1 - Parameter's default value.\n{{Identical|Default}}",
|
||||
"visualeditor-dialog-transclusion-param-example": "Label for parameter's example value in the template dialog. $1 - Parameter's example value.",
|
||||
"visualeditor-dialog-transclusion-param-example-long": "Label for parameter's example value in the template dialog. If feasible without abbreviation. $1 - Parameter's example value.\n{{Identical|Example}}",
|
||||
"visualeditor-dialog-transclusion-param-info": "Title of button that hides and shows parameter descriptions",
|
||||
"visualeditor-dialog-transclusion-param-info-missing": "Title of button that hides and shows parameter descriptions when no description is available",
|
||||
"visualeditor-dialog-transclusion-param-selection-aria-description": "ARIA description for screen readers on the template parameter selection menu for the keyboard controls.",
|
||||
"visualeditor-dialog-transclusion-param-selection-aria-label": "ARIA label for screen readers on template parameter selection menu.\n\nParameters:\n* $1 - The title of the related template.",
|
||||
"visualeditor-dialog-transclusion-param-undocumented": "Label shown next to a parameter's name indicating that the parameter is undocumented.",
|
||||
|
|
|
@ -1119,8 +1119,6 @@ class Hooks {
|
|||
'feedbackApiUrl' => $veConfig->get( 'VisualEditorFeedbackAPIURL' ),
|
||||
'feedbackTitle' => $veConfig->get( 'VisualEditorFeedbackTitle' ),
|
||||
'sourceFeedbackTitle' => $veConfig->get( 'VisualEditorSourceFeedbackTitle' ),
|
||||
'transclusionDialogInlineDescriptions' =>
|
||||
$veConfig->get( 'VisualEditorTransclusionDialogInlineDescriptions' ),
|
||||
'transclusionDialogNewSidebar' => $veConfig->get( 'VisualEditorTransclusionDialogNewSidebar' ),
|
||||
'cirrusSearchLookup' => $extensionRegistry->isLoaded( 'CirrusSearch' ),
|
||||
];
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
// Set config variable to activate new sidebar feature
|
||||
// TODO: remove this when sidebar feature will be default
|
||||
wgVisualEditorConfig: ve.extendObject( {}, mw.config.get( 'wgVisualEditorConfig' ), {
|
||||
transclusionDialogNewSidebar: true,
|
||||
transclusionDialogInlineDescriptions: true
|
||||
transclusionDialogNewSidebar: true
|
||||
} )
|
||||
}
|
||||
} ) );
|
||||
|
|
|
@ -29,13 +29,9 @@ ve.ui.MWTransclusionDialog = function VeUiMWTransclusionDialog( config ) {
|
|||
this.isSidebarExpanded = null;
|
||||
|
||||
// Temporary feature flags
|
||||
this.useInlineDescriptions = veConfig.transclusionDialogInlineDescriptions;
|
||||
this.useBackButton = true;
|
||||
this.useNewSidebar = veConfig.transclusionDialogNewSidebar;
|
||||
|
||||
if ( this.useInlineDescriptions ) {
|
||||
this.$element.addClass( 've-ui-mwTransclusionDialog-bigger' );
|
||||
}
|
||||
if ( this.useNewSidebar ) {
|
||||
this.$element.addClass( 've-ui-mwTransclusionDialog-newSidebar' );
|
||||
}
|
||||
|
@ -176,9 +172,7 @@ ve.ui.MWTransclusionDialog.prototype.addParameter = function () {
|
|||
part.addParameter( placeholderParameter );
|
||||
this.focusPart( placeholderParameter.getId() );
|
||||
|
||||
if ( this.useInlineDescriptions ) {
|
||||
this.autoExpandSidebar();
|
||||
}
|
||||
this.autoExpandSidebar();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -337,36 +331,32 @@ ve.ui.MWTransclusionDialog.prototype.getPageFromPart = function ( part ) {
|
|||
ve.ui.MWTransclusionDialog.prototype.autoExpandSidebar = function () {
|
||||
var expandSidebar;
|
||||
|
||||
if ( this.useInlineDescriptions ) {
|
||||
var isSmallScreen = this.constructor.static.isSmallScreen();
|
||||
var isSmallScreen = this.constructor.static.isSmallScreen();
|
||||
|
||||
var showOtherActions = isSmallScreen ||
|
||||
this.actions.getOthers().some( function ( action ) {
|
||||
// Check for unknown actions, show the toolbar if any are available.
|
||||
return action.action !== 'mode';
|
||||
} );
|
||||
this.actions.forEach( { actions: [ 'mode' ] }, function ( action ) {
|
||||
action.toggle( isSmallScreen );
|
||||
var showOtherActions = isSmallScreen ||
|
||||
this.actions.getOthers().some( function ( action ) {
|
||||
// Check for unknown actions, show the toolbar if any are available.
|
||||
return action.action !== 'mode';
|
||||
} );
|
||||
this.$otherActions.toggleClass( 'oo-ui-element-hidden', !showOtherActions );
|
||||
this.actions.forEach( { actions: [ 'mode' ] }, function ( action ) {
|
||||
action.toggle( isSmallScreen );
|
||||
} );
|
||||
this.$otherActions.toggleClass( 'oo-ui-element-hidden', !showOtherActions );
|
||||
|
||||
if ( isSmallScreen && this.transclusionModel.isEmpty() ) {
|
||||
expandSidebar = false;
|
||||
} else if ( isSmallScreen &&
|
||||
// eslint-disable-next-line no-jquery/no-class-state
|
||||
this.$content.hasClass( 've-ui-mwTransclusionDialog-small-screen' )
|
||||
) {
|
||||
// We did this already. If the sidebar is visible or not is now the user's decision.
|
||||
return;
|
||||
} else {
|
||||
expandSidebar = !isSmallScreen;
|
||||
}
|
||||
|
||||
this.$content.toggleClass( 've-ui-mwTransclusionDialog-small-screen', isSmallScreen );
|
||||
if ( isSmallScreen && this.transclusionModel.isEmpty() ) {
|
||||
expandSidebar = false;
|
||||
} else if ( isSmallScreen &&
|
||||
// eslint-disable-next-line no-jquery/no-class-state
|
||||
this.$content.hasClass( 've-ui-mwTransclusionDialog-small-screen' )
|
||||
) {
|
||||
// We did this already. If the sidebar is visible or not is now the user's decision.
|
||||
return;
|
||||
} else {
|
||||
expandSidebar = !this.transclusionModel.isSingleTemplate();
|
||||
expandSidebar = !isSmallScreen;
|
||||
}
|
||||
|
||||
this.$content.toggleClass( 've-ui-mwTransclusionDialog-small-screen', isSmallScreen );
|
||||
|
||||
this.toggleSidebar( expandSidebar );
|
||||
};
|
||||
|
||||
|
@ -386,7 +376,7 @@ ve.ui.MWTransclusionDialog.prototype.toggleSidebar = function ( expandSidebar )
|
|||
.toggleClass( 've-ui-mwTransclusionDialog-collapsed', !expandSidebar )
|
||||
.toggleClass( 've-ui-mwTransclusionDialog-expanded', expandSidebar );
|
||||
|
||||
var dialogSizeSidebarExpanded = this.useInlineDescriptions ? 'larger' : 'large';
|
||||
var dialogSizeSidebarExpanded = 'larger';
|
||||
var dialogSizeSidebarCollapsed = this.useNewSidebar ? dialogSizeSidebarExpanded : 'medium';
|
||||
this.ignoreNextWindowResizeEvent = true;
|
||||
this.setSize( expandSidebar ? dialogSizeSidebarExpanded : dialogSizeSidebarCollapsed );
|
||||
|
@ -399,7 +389,7 @@ ve.ui.MWTransclusionDialog.prototype.toggleSidebar = function ( expandSidebar )
|
|||
// up being mispositioned
|
||||
this.$content.find( 'input:focus' ).trigger( 'blur' );
|
||||
|
||||
if ( this.useInlineDescriptions && this.pocSidebar && this.loaded && this.constructor.static.isSmallScreen() ) {
|
||||
if ( this.pocSidebar && this.loaded && this.constructor.static.isSmallScreen() ) {
|
||||
var dialog = this;
|
||||
|
||||
// Updates the page sizes when the menu is toggled using the button. This needs
|
||||
|
@ -465,8 +455,7 @@ ve.ui.MWTransclusionDialog.prototype.updateModeActionState = function () {
|
|||
// New sidebar: The button is only visible on very narrow screens, {@see autoExpandSidebar}.
|
||||
// It's always needed, except in the initial placeholder state.
|
||||
var isInitialState = !isExpanded && this.transclusionModel.isEmpty(),
|
||||
canCollapse = ( this.transclusionModel.isSingleTemplate() || this.useInlineDescriptions ) &&
|
||||
!isInitialState;
|
||||
canCollapse = !isInitialState;
|
||||
this.actions.setAbilities( { mode: canCollapse } );
|
||||
};
|
||||
|
||||
|
@ -609,30 +598,26 @@ ve.ui.MWTransclusionDialog.prototype.initialize = function () {
|
|||
} );
|
||||
ve.targetLinksToNewWindow( this.multipartMessage.$element[ 0 ] );
|
||||
|
||||
if ( this.useNewSidebar || this.useInlineDescriptions ) {
|
||||
var helpPopup = new ve.ui.MWFloatingHelpElement( {
|
||||
label: mw.message( 'visualeditor-dialog-transclusion-help-title' ).text(),
|
||||
title: mw.message( 'visualeditor-dialog-transclusion-help-title' ).text(),
|
||||
$message: new OO.ui.FieldsetLayout( {
|
||||
items: [
|
||||
new OO.ui.LabelWidget( {
|
||||
label: mw.message( 'visualeditor-dialog-transclusion-help-message' ).text()
|
||||
} ),
|
||||
this.getMessageButton( 'visualeditor-dialog-transclusion-help-page-help', 'helpNotice' ),
|
||||
this.getMessageButton( 'visualeditor-dialog-transclusion-help-page-shortcuts', 'keyboard' ),
|
||||
this.getMessageButton( 'visualeditor-dialog-transclusion-help-page-feedback', 'feedback' )
|
||||
],
|
||||
classes: [ 've-ui-mwTransclusionDialog-floatingHelpElement-fieldsetLayout' ]
|
||||
} ).$element
|
||||
} );
|
||||
helpPopup.$element.addClass( 've-ui-mwTransclusionDialog-floatingHelpElement' );
|
||||
helpPopup.$element.appendTo( this.$body );
|
||||
}
|
||||
var helpPopup = new ve.ui.MWFloatingHelpElement( {
|
||||
label: mw.message( 'visualeditor-dialog-transclusion-help-title' ).text(),
|
||||
title: mw.message( 'visualeditor-dialog-transclusion-help-title' ).text(),
|
||||
$message: new OO.ui.FieldsetLayout( {
|
||||
items: [
|
||||
new OO.ui.LabelWidget( {
|
||||
label: mw.message( 'visualeditor-dialog-transclusion-help-message' ).text()
|
||||
} ),
|
||||
this.getMessageButton( 'visualeditor-dialog-transclusion-help-page-help', 'helpNotice' ),
|
||||
this.getMessageButton( 'visualeditor-dialog-transclusion-help-page-shortcuts', 'keyboard' ),
|
||||
this.getMessageButton( 'visualeditor-dialog-transclusion-help-page-feedback', 'feedback' )
|
||||
],
|
||||
classes: [ 've-ui-mwTransclusionDialog-floatingHelpElement-fieldsetLayout' ]
|
||||
} ).$element
|
||||
} );
|
||||
helpPopup.$element.addClass( 've-ui-mwTransclusionDialog-floatingHelpElement' );
|
||||
helpPopup.$element.appendTo( this.$body );
|
||||
|
||||
// Events
|
||||
if ( this.useInlineDescriptions ) {
|
||||
this.getManager().connect( this, { resize: ve.debounce( this.onWindowResize.bind( this ) ) } );
|
||||
}
|
||||
this.getManager().connect( this, { resize: ve.debounce( this.onWindowResize.bind( this ) ) } );
|
||||
this.bookletLayout.connect( this, { set: 'onBookletLayoutSetPage' } );
|
||||
this.bookletLayout.$menu.find( '[ role="listbox" ]' ).first()
|
||||
.attr( 'aria-label', ve.msg( 'visualeditor-dialog-transclusion-templates-menu-aria-label' ) );
|
||||
|
@ -691,30 +676,23 @@ ve.ui.MWTransclusionDialog.prototype.onWindowResize = function () {
|
|||
if ( this.transclusionModel && !this.ignoreNextWindowResizeEvent ) {
|
||||
this.autoExpandSidebar();
|
||||
|
||||
if ( this.useInlineDescriptions ) {
|
||||
this.bookletLayout.stackLayout.getItems().forEach( function ( page ) {
|
||||
if ( page instanceof ve.ui.MWParameterPage ) {
|
||||
page.updateSize();
|
||||
}
|
||||
} );
|
||||
}
|
||||
this.bookletLayout.stackLayout.getItems().forEach( function ( page ) {
|
||||
if ( page instanceof ve.ui.MWParameterPage ) {
|
||||
page.updateSize();
|
||||
}
|
||||
} );
|
||||
}
|
||||
this.ignoreNextWindowResizeEvent = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*
|
||||
* Temporary override to increase dialog size when a feature flag is enabled.
|
||||
*/
|
||||
ve.ui.MWTransclusionDialog.prototype.getSizeProperties = function () {
|
||||
var sizeProps = ve.ui.MWTransclusionDialog.super.prototype.getSizeProperties.call( this );
|
||||
|
||||
if ( this.useInlineDescriptions ) {
|
||||
sizeProps = ve.extendObject( { height: '90%' }, sizeProps );
|
||||
}
|
||||
|
||||
return sizeProps;
|
||||
return ve.extendObject(
|
||||
{ height: '90%' },
|
||||
ve.ui.MWTransclusionDialog.super.prototype.getSizeProperties.call( this )
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -42,7 +42,6 @@ ve.ui.MWParameterPage = function VeUiMWParameterPage( parameter, name, config )
|
|||
this.$field = $( '<div>' );
|
||||
|
||||
// Temporary feature flags
|
||||
this.useInlineDescriptions = veConfig.transclusionDialogInlineDescriptions;
|
||||
this.useNewSidebar = veConfig.transclusionDialogNewSidebar;
|
||||
|
||||
// Construct the field docs for the template description
|
||||
|
@ -110,9 +109,7 @@ ve.ui.MWParameterPage = function VeUiMWParameterPage( parameter, name, config )
|
|||
$( '<p>' )
|
||||
.addClass( 've-ui-mwParameterPage-doc-example' )
|
||||
.text( ve.msg(
|
||||
this.useInlineDescriptions ?
|
||||
'visualeditor-dialog-transclusion-param-example-long' :
|
||||
'visualeditor-dialog-transclusion-param-example',
|
||||
'visualeditor-dialog-transclusion-param-example-long',
|
||||
this.exampleValue
|
||||
) )
|
||||
.appendTo( $doc );
|
||||
|
@ -131,30 +128,6 @@ ve.ui.MWParameterPage = function VeUiMWParameterPage( parameter, name, config )
|
|||
this.rawFallbackButton.$element.appendTo( $actions );
|
||||
}
|
||||
|
||||
if ( !this.useInlineDescriptions ) {
|
||||
if ( !$doc.children().length ) {
|
||||
this.infoButton = new OO.ui.ButtonWidget( {
|
||||
disabled: true,
|
||||
title: ve.msg( 'visualeditor-dialog-transclusion-param-info-missing' ),
|
||||
framed: false,
|
||||
icon: 'info',
|
||||
classes: [ 've-ui-mwParameterPage-infoButton' ]
|
||||
} );
|
||||
} else {
|
||||
this.infoButton = new OO.ui.PopupButtonWidget( {
|
||||
$overlay: config.$overlay,
|
||||
popup: {
|
||||
$content: $doc
|
||||
},
|
||||
title: ve.msg( 'visualeditor-dialog-transclusion-param-info' ),
|
||||
framed: false,
|
||||
icon: 'info',
|
||||
classes: [ 've-ui-mwParameterPage-infoButton' ]
|
||||
} );
|
||||
}
|
||||
this.infoButton.$element.appendTo( $actions );
|
||||
}
|
||||
|
||||
if ( !this.parameter.isRequired() && !config.readOnly && !this.useNewSidebar ) {
|
||||
var removeButton = new OO.ui.ButtonWidget( {
|
||||
framed: false,
|
||||
|
@ -196,7 +169,7 @@ ve.ui.MWParameterPage = function VeUiMWParameterPage( parameter, name, config )
|
|||
.appendTo( this.$element );
|
||||
}
|
||||
|
||||
if ( this.useInlineDescriptions && $doc.children().length ) {
|
||||
if ( $doc.children().length ) {
|
||||
this.$field.addClass( 've-ui-mwParameterPage-inlineDescription' );
|
||||
this.collapsibleDoc = new ve.ui.MWExpandableContentElement( {
|
||||
classes: [ 've-ui-mwParameterPage-inlineDescription' ],
|
||||
|
@ -251,13 +224,6 @@ ve.ui.MWParameterPage.prototype.getDefaultInputConfig = function () {
|
|||
'visualeditor-dialog-transclusion-param-default',
|
||||
this.defaultValue
|
||||
);
|
||||
} else if ( this.exampleValue && !this.useInlineDescriptions ) {
|
||||
valueInputConfig.placeholder = ve.msg(
|
||||
this.useInlineDescriptions ?
|
||||
'visualeditor-dialog-transclusion-param-example-long' :
|
||||
'visualeditor-dialog-transclusion-param-example',
|
||||
this.exampleValue
|
||||
);
|
||||
}
|
||||
|
||||
return valueInputConfig;
|
||||
|
|
|
@ -142,20 +142,20 @@
|
|||
transition: all 250ms ease-in-out;
|
||||
}
|
||||
|
||||
.ve-ui-mwTransclusionDialog-bigger .oo-ui-menuLayout > .oo-ui-menuLayout-menu {
|
||||
.ve-ui-mwTemplateDialog .oo-ui-menuLayout > .oo-ui-menuLayout-menu {
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
.ve-ui-mwTransclusionDialog-bigger .oo-ui-menuLayout > .oo-ui-menuLayout-content {
|
||||
.ve-ui-mwTemplateDialog .oo-ui-menuLayout > .oo-ui-menuLayout-content {
|
||||
left: 240px;
|
||||
}
|
||||
|
||||
.ve-ui-mwTransclusionDialog-bigger .ve-ui-mwTransclusionDialog-small-screen.ve-ui-mwTransclusionDialog-expanded .oo-ui-menuLayout > .oo-ui-menuLayout-menu {
|
||||
.ve-ui-mwTemplateDialog.ve-ui-mwTransclusionDialog-small-screen.ve-ui-mwTransclusionDialog-expanded .oo-ui-menuLayout > .oo-ui-menuLayout-menu {
|
||||
border-right: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ve-ui-mwTransclusionDialog-bigger .ve-ui-mwTransclusionDialog-small-screen.ve-ui-mwTransclusionDialog-expanded .oo-ui-menuLayout > .oo-ui-menuLayout-content {
|
||||
.ve-ui-mwTemplateDialog.ve-ui-mwTransclusionDialog-small-screen.ve-ui-mwTransclusionDialog-expanded .oo-ui-menuLayout > .oo-ui-menuLayout-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,17 +65,10 @@
|
|||
color: #54595d;
|
||||
}
|
||||
|
||||
.ve-ui-mwParameterPage-infoButton,
|
||||
.ve-ui-mwParameterPage-removeButton {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ve-ui-mwParameterPage-infoButton .oo-ui-popupWidget {
|
||||
z-index: 100;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.oo-ui-pageLayout-active .ve-ui-mwParameterPage-infoButton,
|
||||
.oo-ui-pageLayout-active .ve-ui-mwParameterPage-removeButton {
|
||||
display: inline-block;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
right: 0;
|
||||
}
|
||||
|
||||
.ve-ui-mwParameterPage-infoButton,
|
||||
.ve-ui-mwParameterPage-removeButton {
|
||||
display: none;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue