Rename template variables to mirror SkinMustache

The renames made in this patch mirror the upstream change in
I3f7b2e5f07d03ac04ecdcba585194d619abe35e0 in preparation for adopting
the SkinMustache class.

Renames:
* 'data-indicators => 'array-indicators'
* 'html-bodycontent' => 'html-body-content'
* 'html-undelete' => 'html-undelete-link'
* 'html-sitenotice' => 'html-site-notice'
* 'html-catlinks' =>  'html-categories'
* 'html-dataaftercontent' => 'html-after-content'
* 'html-userlangattributes' => 'html-user-language-attributes'

Adjustments
* 'html-debuglog' is moved into html-printtail for consistency with
SkinMustache in core
* html-printfooter is now a part of html-bodycontent for consistency with
SkinMustache in core
Note: the activity of removing html-printtail and html-headelement from
the templates will be done when we adopt SkinMustache.

Bug: T257630
Depends-On: Ibac9729eaa96a38bc730a0132b102a894f6a172d
Change-Id: Ie92bda7846767c3cc9a1937c96a7fc08415b1bae
This commit is contained in:
jdlrobson 2020-07-09 09:32:45 -07:00 committed by VolkerE
parent c405ffb155
commit 7a16ae249e
6 changed files with 47 additions and 51 deletions

View File

@ -104,23 +104,23 @@ class SkinVector extends SkinTemplate {
return [
// Data objects:
'data-indicators' => $indicators,
'array-indicators' => $indicators,
// HTML strings:
'html-printtail' => WrappedString::join( "\n", [
MWDebug::getHTMLDebugLog(),
MWDebug::getDebugHTML( $this->getContext() ),
$this->bottomScripts(),
wfReportTime( $out->getCSP()->getNonce() )
] ) . '</body></html>',
'html-sitenotice' => $this->getSiteNotice(),
'html-site-notice' => $this->getSiteNotice(),
'html-userlangattributes' => $this->prepareUserLanguageAttributes(),
'html-subtitle' => $this->prepareSubtitle(),
// Always returns string, cast to null if empty.
'html-undelete' => $this->prepareUndeleteLink() ?: null,
'html-undelete-link' => $this->prepareUndeleteLink() ?: null,
// Result of OutputPage::addHTML calls
'html-bodycontent' => $this->wrapHTML( $title, $out->mBodytext ),
'html-dataAfterContent' => $this->afterContentHook(),
// When $wgShowDebug is enabled
'html-debuglog' => MWDebug::getHTMLDebugLog(),
'html-body-content' => $this->wrapHTML( $title, $out->mBodytext )
. $this->printSource(),
'html-after-content' => $this->afterContentHook(),
];
}

View File

@ -153,7 +153,7 @@ class VectorTemplate extends BaseTemplate {
'msg-vector-jumptosearch' => $skin->msg( 'vector-jumptosearch' )->text(),
'html-printfooter' => $skin->printSource(),
'html-catlinks' => $skin->getCategories(),
'html-categories' => $skin->getCategories(),
'data-footer' => $this->getFooterData(),
'html-navigation-heading' => $skin->msg( 'navigation-heading' ),
'data-search-box' => $this->buildSearchProps(),

View File

@ -1,6 +1,6 @@
{{! @typedef Indicator[]}}
<div class="mw-indicators mw-body-content">
{{#data-indicators}}
{{#array-indicators}}
<div id="{{id}}" class="{{class}}">{{{html}}}</div>
{{/data-indicators}}
{{/array-indicators}}
</div>

View File

@ -1,24 +1,22 @@
{{!
string html-headelement a string of attribute HTML that begins with `<html>` and ends with
`</head>` and contains `meta` tags and ResourceLoader internals.
string|null html-sitenotice the contents of a banner defined in MediaWiki:Sitenotice.
string|null html-site-notice the contents of a banner defined in MediaWiki:Sitenotice.
Also used by CentralNotice to inject banners into Vector.
Indicator[] data-indicators wiki-defined badges such as "good article",
Indicator[] array-indicators wiki-defined badges such as "good article",
"featured article". An empty array if none are defined.
string page-langcode the content language of the article. Assumed to be escaped HTML.
string html-title
bool page-isarticle
string msg-tagline
string html-subtitle
string html-undelete
string html-undelete-link
string html-newtalk
string msg-vector-jumptonavigation
string msg-vector-jumptosearch
string html-bodycontent
string html-printfooter
string html-catlinks
string html-debuglog
string html-dataAfterContent
string html-body-content
string html-categories
string html-after-content
string html-navigation-heading heading for entire navigation that is
usually hidden to screen readers
MenuDefinition data-personal-menu
@ -38,13 +36,13 @@
<div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body" role="main">
<a id="top"></a>
<div id="siteNotice" class="mw-body-content">{{{html-sitenotice}}}</div>
<div id="siteNotice" class="mw-body-content">{{{html-site-notice}}}</div>
{{>Indicators}}
<h1 id="firstHeading" class="firstHeading" lang="{{page-langcode}}">{{{html-title}}}</h1>
<div id="bodyContent" class="mw-body-content">
{{#page-isarticle}}<div id="siteSub" class="noprint">{{msg-tagline}}</div>{{/page-isarticle}}
<div id="contentSub"{{{html-userlangattributes}}}>{{{html-subtitle}}}</div>
<div id="contentSub2">{{{html-undelete}}}</div>
<div id="contentSub2">{{{html-undelete-link}}}</div>
{{{html-newtalk}}}
{{!
Keep this empty `div` for compatibility with gadgets and user scripts
@ -53,13 +51,11 @@
<div id="jump-to-nav"></div>
<a class="mw-jump-link" href="#mw-head">{{msg-vector-jumptonavigation}}</a>
<a class="mw-jump-link" href="#searchInput">{{msg-vector-jumptosearch}}</a>
{{{html-bodycontent}}}
<div class="printfooter">{{{html-printfooter}}}</div>
{{{html-catlinks}}}
{{{html-debuglog}}}
{{{html-body-content}}}
{{{html-categories}}}
</div>
</div>
{{{html-dataAfterContent}}}
{{{html-after-content}}}
<div id="mw-navigation">
<h2>{{{html-navigation-heading}}}</h2>
<div id="mw-head">

View File

@ -1,24 +1,22 @@
{{!
string html-headelement a string of attribute HTML that begins with `<html>` and ends with
`</head>` and contains `meta` tags and ResourceLoader internals.
string|null html-sitenotice the contents of a banner defined in MediaWiki:Sitenotice.
string|null html-site-notice the contents of a banner defined in MediaWiki:Sitenotice.
Also used by CentralNotice to inject banners into Vector.
Indicator[] data-indicators wiki-defined badges such as "good article",
Indicator[] array-indicators wiki-defined badges such as "good article",
"featured article". An empty array if none are defined.
string page-langcode the content language of the article. Assumed to be escaped HTML.
string html-title
bool page-isarticle
string msg-tagline
string html-subtitle
string html-undelete
string html-undelete-link
string html-newtalk
string msg-vector-jumptonavigation
string msg-vector-jumptosearch
string html-bodycontent
string html-printfooter
string html-catlinks
string html-debuglog
string html-dataAfterContent
string html-body-content
string html-categories
string html-after-content
string html-navigation-heading heading for entire navigation that is usually hidden to screen
readers
LogoOptions data-logos
@ -56,13 +54,13 @@
<!-- Please do not use role attribute as CSS selector, it is deprecated. -->
<main id="content" class="mw-body" role="main">
<a id="top"></a>
<div id="siteNotice" class="mw-body-content">{{{html-sitenotice}}}</div>
<div id="siteNotice" class="mw-body-content">{{{html-site-notice}}}</div>
{{>Indicators}}
<h1 id="firstHeading" class="firstHeading" lang="{{page-langcode}}">{{{html-title}}}</h1>
<div id="bodyContent" class="mw-body-content">
{{#page-isarticle}}<div id="siteSub" class="noprint">{{msg-tagline}}</div>{{/page-isarticle}}
<div id="contentSub"{{{html-userlangattributes}}}>{{{html-subtitle}}}</div>
<div id="contentSub2">{{{html-undelete}}}</div>
<div id="contentSub2">{{{html-undelete-link}}}</div>
{{{html-newtalk}}}
{{!
Keep this empty `div` for compatibility with gadgets and user scripts
@ -71,13 +69,11 @@
<div id="jump-to-nav"></div>
<a class="mw-jump-link" href="#mw-sidebar-button">{{msg-vector-jumptonavigation}}</a>
<a class="mw-jump-link" href="#searchInput">{{msg-vector-jumptosearch}}</a>
{{{html-bodycontent}}}
<div class="printfooter">{{{html-printfooter}}}</div>
{{{html-catlinks}}}
{{{html-debuglog}}}
{{{html-body-content}}}
{{{html-categories}}}
</div>
</main>
{{{html-dataAfterContent}}}
{{{html-after-content}}}
</div> {{! END mw-content-container }}
</div> {{! END mw-workspace-container }}

View File

@ -92,17 +92,19 @@ export const LEGACY_TEMPLATE_DATA = {
// site specific
'data-footer': FOOTER_TEMPLATE_DATA,
'html-sitenotice': placeholder( 'a site notice or central notice banner may go here', 70 ),
'html-site-notice': placeholder( 'a site notice or central notice banner may go here', 70 ),
// article dependent
'html-bodycontent': placeholder( 'Article content goes here' ),
'html-printfooter': `Retrieved from <a dir="ltr" href="#">https://en.wikipedia.org/w/index.php?title=this&oldid=blah</a>`,
'html-catlinks': placeholder( 'Category links component from mediawiki core', 50 ),
'html-body-content': `${placeholder( 'Article content goes here' )}
<div class="printfooter">
Retrieved from <a dir="ltr" href="#">https://en.wikipedia.org/w/index.php?title=this&oldid=blah</a>
</div>`,
'html-categories': placeholder( 'Category links component from mediawiki core', 50 ),
// extension dependent..
'html-hook-vector-before-footer': placeholder( 'VectorBeforeFooter hook output', 100 ),
'html-dataAfterContent': placeholder( 'Extensions can add here e.g. Related Articles.', 100 ),
'data-indicators': DATA_INDICATORS,
'html-after-content': placeholder( 'Extensions can add here e.g. Related Articles.', 100 ),
'array-indicators': DATA_INDICATORS,
'html-subtitle': placeholder( 'Extensions can configure subtitle', 20 )
};
@ -116,11 +118,13 @@ export const MODERN_TEMPLATE_DATA = {
// site specific
'data-footer': FOOTER_TEMPLATE_DATA,
'html-sitenotice': placeholder( 'a site notice or central notice banner may go here', 70 ),
'html-site-notice': placeholder( 'a site notice or central notice banner may go here', 70 ),
// article dependent
'data-indicators': DATA_INDICATORS,
'html-bodycontent': placeholder( 'Article content goes here' ),
'html-printfooter': `Retrieved from <a dir="ltr" href="#">https://en.wikipedia.org/w/index.php?title=this&oldid=blah</a>`,
'html-catlinks': placeholder( 'Category links component from mediawiki core', 50 )
'array-indicators': DATA_INDICATORS,
'html-body-content': `${placeholder( 'Article content goes here' )}
<div class="printfooter">
Retrieved from <a dir="ltr" href="#">https://en.wikipedia.org/w/index.php?title=this&oldid=blah</a>
</div>`,
'html-categories': placeholder( 'Category links component from mediawiki core', 50 )
};