Microchip08 has uploaded a new change for review. https://gerrit.wikimedia.org/r/154397
Change subject: Surround edit notices with appropriate classes ...................................................................... Surround edit notices with appropriate classes This commit adds a <div> around edit notices with relevant classes to aid in the creation of user scripts, following an earlier change (bug 30959) for edit intros. It adds an .editnotice class to each edit notice, and because classes are fairly cheap, a second mirroring the edit notice's message key, and a third depending on the edit notice type: .editnotice-namespace for a namespace-wide edit notice .editnotice-base for a edit notice for the subpage's base page .editnotice-page for an edit notice set explicitly for the page Bug: 68749 Change-Id: Idf44f2a344d64893f799286914bda3f8d4aff6bf --- M includes/Title.php 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/97/154397/1 diff --git a/includes/Title.php b/includes/Title.php index a1b2352..d320e5c 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -5007,7 +5007,8 @@ $editnotice_ns = 'editnotice-' . $this->getNamespace(); $editnotice_ns_message = wfMessage( $editnotice_ns ); if ( $editnotice_ns_message->exists() ) { - $notices[$editnotice_ns] = $editnotice_ns_message->parseAsBlock(); + $notices[$editnotice_ns] = "<div class=\"editnotice editnotice-namespace $editnotice_ns\">"; + $notices[$editnotice_ns] .= $editnotice_ns_message->parseAsBlock() . '</div>'; } if ( MWNamespace::hasSubpages( $this->getNamespace() ) ) { $parts = explode( '/', $this->getDBkey() ); @@ -5016,7 +5017,8 @@ $editnotice_base .= '-' . array_shift( $parts ); $editnotice_base_msg = wfMessage( $editnotice_base ); if ( $editnotice_base_msg->exists() ) { - $notices[$editnotice_base] = $editnotice_base_msg->parseAsBlock(); + $notices[$editnotice_base] = "<div class=\"editnotice editnotice-base $editnotice_base\">"; + $notices[$editnotice_base] .= $editnotice_base_msg->parseAsBlock() . '</div>'; } } } else { @@ -5024,7 +5026,8 @@ $editnoticeText = $editnotice_ns . '-' . str_replace( '/', '-', $this->getDBkey() ); $editnoticeMsg = wfMessage( $editnoticeText ); if ( $editnoticeMsg->exists() ) { - $notices[$editnoticeText] = $editnoticeMsg->parseAsBlock(); + $notices[$editnoticeText] = "<div class=\"editnotice editnotice-page $editnoticeText\">"; + $notices[$editnoticeText] .= $editnoticeMsg->parseAsBlock() . '</div>'; } } -- To view, visit https://gerrit.wikimedia.org/r/154397 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf44f2a344d64893f799286914bda3f8d4aff6bf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Microchip08 <doug...@chippy.ch> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits