mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 16:30:12 +00:00
Revert "Add extends warning to reference dialog"
This reverts commitda30b2b626
. Reason for revert: Caused a regression. Feature is not enabled on public wikis so reverting is harmless for now. Bug: T247922 Bug: T340757 Change-Id: I83434afaf1b76425bddb575dd724f462a247c83d (cherry picked from commit42e13cb3c3
)
This commit is contained in:
parent
72b94c9244
commit
81e4f455ba
|
@ -156,7 +156,6 @@
|
||||||
"cite-ve-dialog-reference-editing-reused",
|
"cite-ve-dialog-reference-editing-reused",
|
||||||
"cite-ve-dialog-reference-editing-reused-long",
|
"cite-ve-dialog-reference-editing-reused-long",
|
||||||
"cite-ve-dialog-reference-editing-extends",
|
"cite-ve-dialog-reference-editing-extends",
|
||||||
"cite-ve-dialog-reference-editing-extends-long",
|
|
||||||
"cite-ve-dialog-reference-options-group-label",
|
"cite-ve-dialog-reference-options-group-label",
|
||||||
"cite-ve-dialog-reference-options-group-placeholder",
|
"cite-ve-dialog-reference-options-group-placeholder",
|
||||||
"cite-ve-dialog-reference-options-name-label",
|
"cite-ve-dialog-reference-options-name-label",
|
||||||
|
|
|
@ -261,8 +261,8 @@ ve.ui.MWReferenceDialog.prototype.useReference = function ( ref ) {
|
||||||
this.referenceGroupInput.setValue( this.originalGroup );
|
this.referenceGroupInput.setValue( this.originalGroup );
|
||||||
this.referenceGroupInput.setDisabled( false );
|
this.referenceGroupInput.setDisabled( false );
|
||||||
|
|
||||||
var list = this.getFragment().getDocument().getInternalList();
|
var group = this.getFragment().getDocument().getInternalList()
|
||||||
var group = list.getNodeGroup( this.referenceModel.getListGroup() );
|
.getNodeGroup( this.referenceModel.getListGroup() );
|
||||||
var nodes = ve.getProp( group, 'keyedNodes', this.referenceModel.getListKey() );
|
var nodes = ve.getProp( group, 'keyedNodes', this.referenceModel.getListKey() );
|
||||||
var usages = nodes ? nodes.filter( function ( node ) {
|
var usages = nodes ? nodes.filter( function ( node ) {
|
||||||
return !node.findParent( ve.dm.MWReferencesListNode );
|
return !node.findParent( ve.dm.MWReferencesListNode );
|
||||||
|
@ -271,14 +271,6 @@ ve.ui.MWReferenceDialog.prototype.useReference = function ( ref ) {
|
||||||
this.reuseWarning.toggle( usages > 1 )
|
this.reuseWarning.toggle( usages > 1 )
|
||||||
.setLabel( mw.msg( 'cite-ve-dialog-reference-editing-reused-long', usages ) );
|
.setLabel( mw.msg( 'cite-ve-dialog-reference-editing-reused-long', usages ) );
|
||||||
|
|
||||||
this.extendsWarning.toggle( !!this.referenceModel.extendsRef );
|
|
||||||
|
|
||||||
if ( this.referenceModel.extendsRef !== undefined ) {
|
|
||||||
var index = list.keys.indexOf( 'literal/' + this.referenceModel.extendsRef );
|
|
||||||
var parentRef = list.getItemNode( index ).element.attributes.originalHtml;
|
|
||||||
this.extendsWarning.setLabel( mw.msg( 'cite-ve-dialog-reference-editing-extends-long', parentRef ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -299,13 +291,7 @@ ve.ui.MWReferenceDialog.prototype.initialize = function () {
|
||||||
this.reuseWarning = new OO.ui.MessageWidget( {
|
this.reuseWarning = new OO.ui.MessageWidget( {
|
||||||
inline: true,
|
inline: true,
|
||||||
icon: 'alert',
|
icon: 'alert',
|
||||||
classes: [ 've-ui-mwReferenceDialog-warning' ]
|
classes: [ 've-ui-mwReferenceDialog-reuseWarning' ]
|
||||||
} );
|
|
||||||
|
|
||||||
this.extendsWarning = new OO.ui.MessageWidget( {
|
|
||||||
inline: true,
|
|
||||||
icon: 'alert',
|
|
||||||
classes: [ 've-ui-mwReferenceDialog-warning' ]
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
var citeCommands = Object.keys( ve.init.target.getSurface().commandRegistry.registry ).filter( function ( command ) {
|
var citeCommands = Object.keys( ve.init.target.getSurface().commandRegistry.registry ).filter( function ( command ) {
|
||||||
|
@ -345,7 +331,7 @@ ve.ui.MWReferenceDialog.prototype.initialize = function () {
|
||||||
|
|
||||||
// Initialization
|
// Initialization
|
||||||
this.panels.addItems( [ this.editPanel, this.searchPanel ] );
|
this.panels.addItems( [ this.editPanel, this.searchPanel ] );
|
||||||
this.editPanel.$element.append( this.reuseWarning.$element, this.extendsWarning.$element, this.contentFieldset.$element, this.optionsFieldset.$element );
|
this.editPanel.$element.append( this.reuseWarning.$element, this.contentFieldset.$element, this.optionsFieldset.$element );
|
||||||
this.optionsFieldset.addItems( [ this.referenceGroupField ] );
|
this.optionsFieldset.addItems( [ this.referenceGroupField ] );
|
||||||
this.searchPanel.$element.append( this.search.$element );
|
this.searchPanel.$element.append( this.search.$element );
|
||||||
this.$body.append( this.panels.$element );
|
this.$body.append( this.panels.$element );
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.ve-ui-mwReferenceDialog-warning {
|
.ve-ui-mwReferenceDialog-reuseWarning {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue