jenkins-bot has submitted this change and it was merged.

Change subject: EditPage: Implement 'editnotice-notext' message
......................................................................


EditPage: Implement 'editnotice-notext' message

Bug: T91715
Change-Id: Iff6735d93da8b877063690ff67bda652a03d4906
(cherry picked from commit ca9f3f983f2663ee7e48e570b7fff8a23014471c)
---
M RELEASE-NOTES-1.25
M includes/EditPage.php
M languages/i18n/en.json
M languages/i18n/qqq.json
4 files changed, 17 insertions(+), 1 deletion(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25
index 88bfc15..00ce6b1 100644
--- a/RELEASE-NOTES-1.25
+++ b/RELEASE-NOTES-1.25
@@ -115,6 +115,8 @@
   interface, reachable via IContextSource::getStats().
 * Move the jQuery Client library from being mastered in MediaWiki as v0.1.0 to 
a
   proper, published library, which is now tagged as v1.0.0.
+* A new message (defaulting to blank), 'editnotice-notext', can be shown to 
users
+  when they are editing if no edit notices apply to the page being edited.
 
 ==== External libraries ====
 * MediaWiki now requires certain external libraries to be installed. In the 
past
diff --git a/includes/EditPage.php b/includes/EditPage.php
index 5eb07d1..94ed903 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2555,7 +2555,19 @@
                }
 
                // Add edit notices
-               $wgOut->addHTML( implode( "\n", $this->mTitle->getEditNotices( 
$this->oldid ) ) );
+               $editNotices = $this->mTitle->getEditNotices( $this->oldid );
+               if ( count( $editNotices ) ) {
+                       $wgOut->addHTML( implode( "\n", $editNotices ) );
+               } else {
+                       $msg = wfMessage( 'editnotice-notext' );
+                       if ( !$msg->isDisabled() ) {
+                               $wgOut->addHTML(
+                                       '<div class="mw-editnotice-notext">'
+                                       . $msg->parseAsBlock()
+                                       . '</div>'
+                               );
+                       }
+               }
 
                if ( $this->isConflict ) {
                        $wgOut->wrapWikiMsg( "<div 
class='mw-explainconflict'>\n$1\n</div>", 'explainconflict' );
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index b40dadb..56bfbbc 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -645,6 +645,7 @@
        "editingsection": "Editing $1 (section)",
        "editingcomment": "Editing $1 (new section)",
        "editconflict": "Edit conflict: $1",
+       "editnotice-notext": "-",
        "explainconflict": "Someone else has changed this page since you 
started editing it.\nThe upper text area contains the page text as it currently 
exists.\nYour changes are shown in the lower text area.\nYou will have to merge 
your changes into the existing text.\n<strong>Only</strong> the text in the 
upper text area will be saved when you press \"{{int:savearticle}}\".",
        "yourtext": "Your text",
        "storedversion": "Stored revision",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 6ac333c..1484107 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -810,6 +810,7 @@
        "editingsection": "This message displays at the top of the page when a 
user is editing a page section. Parameters:\n* $1 - page 
name\n{{Related|Editing}}",
        "editingcomment": "This message displays at the top of the page when a 
user is creating a new section. Parameters:\n* $1 - page 
name\n{{Related|Editing}}",
        "editconflict": "Used as title of error message. Parameters:\n* $1 - 
page title",
+       "editnotice-notext": "{{ignored}}\nCustom message on top of the edit 
page if no edit notices apply to this page.",
        "explainconflict": "Appears at the top of a page when there is an edit 
conflict.\n\nSee also:\n* {{msg-mw|Savearticle}}",
        "yourtext": "Used in Diff Preview page. The diff is between 
{{msg-mw|currentrev}} and {{msg-mw|yourtext}}.\n\nAlso used in Edit Conflict 
page; the diff between {{msg-mw|yourtext}} and {{msg-mw|storedversion}}.",
        "storedversion": "This is used in an edit conflict as the label for the 
top revision that has been stored, as opposed to your version 
{{msg-mw|yourtext}} that has not been stored which is shown at the bottom of 
the page.",

-- 
To view, visit https://gerrit.wikimedia.org/r/198436
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iff6735d93da8b877063690ff67bda652a03d4906
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.25wmf22
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: Tpt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to