Merge "EditPage: Only update title part of firstHeading on live preview"
This commit is contained in:
commit
a8609a0a6c
3 changed files with 10 additions and 34 deletions
|
|
@ -2662,12 +2662,18 @@ class EditPage implements IEditObject {
|
|||
} else {
|
||||
$out->setDisplayTitle( $displayTitle );
|
||||
}
|
||||
|
||||
// Enclose the title with an element. This is used on live preview to update the
|
||||
// preview of the display title.
|
||||
$displayTitle = Html::rawElement( 'span', [ 'id' => 'firstHeadingTitle' ], $displayTitle );
|
||||
|
||||
$out->setPageTitle( $this->context->msg( $msg, $displayTitle ) );
|
||||
|
||||
$config = $this->context->getConfig();
|
||||
|
||||
# Transmit the name of the message to JavaScript for live preview
|
||||
# Keep Resources.php/mediawiki.action.edit.preview in sync with the possible keys
|
||||
# Transmit the name of the message to JavaScript. This was added for live preview.
|
||||
# Live preview doesn't use this anymore. The variable is still transmitted because
|
||||
# other scripts uses this variable.
|
||||
$out->addJsConfigVars( [
|
||||
'wgEditMessage' => $msg,
|
||||
] );
|
||||
|
|
|
|||
|
|
@ -1290,16 +1290,9 @@ return [
|
|||
'oojs-ui-core',
|
||||
],
|
||||
'messages' => [
|
||||
// Keep these message keys in sync with EditPage#setHeaders
|
||||
'continue-editing',
|
||||
'creating',
|
||||
'currentrev',
|
||||
'diff-empty',
|
||||
'editconflict',
|
||||
'editing',
|
||||
'editingcomment',
|
||||
'editingsection',
|
||||
'pagetitle',
|
||||
'otherlanguages',
|
||||
'summary-preview',
|
||||
'subject-preview',
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
* @param {Object} response Response data
|
||||
*/
|
||||
function parsePreviewRequest( response ) {
|
||||
var indicators, newList, $displaytitle, $content, $parent, $list, arrow, $previewHeader, $wikiPreview, $editform;
|
||||
var indicators, newList, $content, $parent, $list, arrow, $previewHeader, $wikiPreview, $editform;
|
||||
|
||||
$editform = $( '#editform' );
|
||||
$wikiPreview = $( '#wikiPreview' );
|
||||
|
|
@ -48,30 +48,7 @@
|
|||
$( '.mw-indicators' ).empty().append( newList );
|
||||
|
||||
if ( response.parse.displaytitle ) {
|
||||
$displaytitle = $( $.parseHTML( response.parse.displaytitle ) );
|
||||
// The following messages can be used here:
|
||||
// * editconflict
|
||||
// * editingcomment
|
||||
// * editingsection
|
||||
// * editing
|
||||
// * creating
|
||||
$( '#firstHeading' ).msg(
|
||||
mw.config.get( 'wgEditMessage', 'editing' ),
|
||||
$displaytitle
|
||||
);
|
||||
document.title = mw.msg(
|
||||
'pagetitle',
|
||||
// The following messages can be used here:
|
||||
// * editconflict
|
||||
// * editingcomment
|
||||
// * editingsection
|
||||
// * editing
|
||||
// * creating
|
||||
mw.msg(
|
||||
mw.config.get( 'wgEditMessage', 'editing' ),
|
||||
$displaytitle.text()
|
||||
)
|
||||
);
|
||||
$( '#firstHeadingTitle' ).html( response.parse.displaytitle );
|
||||
}
|
||||
if ( response.parse.categorieshtml ) {
|
||||
$content = $( $.parseHTML( response.parse.categorieshtml ) );
|
||||
|
|
|
|||
Loading…
Reference in a new issue