spiros

  • Administrator
  • Hero Member
  • *****
    • Posts: 857398
    • Gender:Male
  • point d’amour
The notice "Remember that this is only a preview. Your changes have not yet been published!" appears when simply editing a page (message can be found in MediaWiki:Previewnote). It also appears when clicking the Preview button.

Two ways to get rid of it:

1. Add in css (easier and safer, applies for both scenarios)

Code: [Select]
.previewnote {
    display: none;
}

2. Find the following code in resources/Resources.php and delete it (applies to first scenario, i.e. when editing)

Code: [Select]
[
'name' => 'resources/src/mediawiki.action/mediawiki.action.edit.preview.parsedMessages.json',
'callback' => static function ( MessageLocalizer $messageLocalizer ) {
return [
'previewnote' => $messageLocalizer->msg( 'previewnote' )->parse(),
];
},
// Use versionCallback to avoid calling the parser from version invalidation code.
'versionCallback' => static function ( MessageLocalizer $messageLocalizer ) {
return [
'previewnote' => [
// Include the text of the message, in case the canonical translation changes
$messageLocalizer->msg( 'previewnote' )->plain(),
// Include the page touched time, in case the on-wiki override is invalidated
Title::makeTitle( NS_MEDIAWIKI, 'Previewnote' )->getTouched(),
],
];
},
]

Tested in Mediawiki 1.39.10
« Last Edit: 15 Oct, 2024, 14:59:22 by spiros »
Look up Multiple Greek, Ancient Greek and Latin dictionaries — Οὕτω τι βαθὺ καὶ μυστηριῶδες ἡ σιγὴ καὶ νηφάλιον, ἡ δὲ μέθη λάλον· ἄνουν γὰρ καὶ ὀλιγόφρον, διὰ τοῦτο καὶ πολύφωνον (Plutarch)


 

Search Tools