mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
ve.ui.MWTemplatePage: Use <p> instead of <hr> in the description
I've never liked how this looked, it feels so 1995. Let's just use multiple paragraphs instead of a <hr> to separate the text, similar to what we do in ve.ui.MWParameterPage. The second paragraph is already emphasized with italics. Change-Id: I324cd1d81e61cf8a23095b4f8aed68040eb1bd8d
This commit is contained in:
parent
fe77d35c36
commit
1165a06f47
|
@ -41,8 +41,12 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
|
|||
} );
|
||||
|
||||
// Initialization
|
||||
this.$description
|
||||
.text( this.spec.getDescription() );
|
||||
var description = this.spec.getDescription();
|
||||
if ( description ) {
|
||||
this.$description.append(
|
||||
$( '<p>' ).text( description )
|
||||
);
|
||||
}
|
||||
|
||||
// The transcluded page may be dynamically generated or unspecified in the DOM
|
||||
// for other reasons (T68724). In that case we can't tell the user what the
|
||||
|
@ -52,13 +56,10 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
|
|||
knownAsMissing = link && linkData && linkData.missing;
|
||||
|
||||
var key,
|
||||
messageStyle = 've-ui-mwTemplatePage-description-missing',
|
||||
$addMessageHere = this.$description;
|
||||
if ( this.spec.getDescription() ) {
|
||||
messageStyle = 've-ui-mwTemplatePage-description-missing';
|
||||
if ( description ) {
|
||||
key = 'visualeditor-dialog-transclusion-see-template';
|
||||
messageStyle = 've-ui-mwTemplatePage-description-extra';
|
||||
$addMessageHere = $( '<span>' );
|
||||
this.$description.append( $( '<hr>' ), $addMessageHere );
|
||||
} else if ( !link || knownAsMissing ) {
|
||||
var title;
|
||||
try {
|
||||
|
@ -74,6 +75,7 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
|
|||
}
|
||||
|
||||
if ( key ) {
|
||||
var $addMessageHere = $( '<p>' );
|
||||
// The following messages are used here:
|
||||
// * visualeditor-dialog-transclusion-no-template-description
|
||||
// * visualeditor-dialog-transclusion-see-template
|
||||
|
@ -85,6 +87,7 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
|
|||
// * ve-ui-mwTemplatePage-description-missing
|
||||
$addMessageHere.addClass( messageStyle ).append( $msg );
|
||||
ve.targetLinksToNewWindow( $addMessageHere[ 0 ] );
|
||||
this.$description.append( $addMessageHere );
|
||||
}
|
||||
|
||||
this.$description.find( 'a[href]' )
|
||||
|
|
Loading…
Reference in a new issue