jenkins-bot has submitted this change and it was merged.
Change subject: Make page heading markup uniform
......................................................................
Make page heading markup uniform
Same HTML, both when loading dynamically and when not.
Change-Id: Id42f3e990a73e44f073049c78d98c4bd8e752414
---
M javascripts/views/page.js
M templates/page.html
M templates/section.html
3 files changed, 9 insertions(+), 3 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/javascripts/views/page.js b/javascripts/views/page.js
index 6090748..db44402 100644
--- a/javascripts/views/page.js
+++ b/javascripts/views/page.js
@@ -18,6 +18,7 @@
// flag for references
this.hasReferences = options.hasReferences || false;
this.id = options.id || null;
+ this.anchor = options.anchor;
this._super( options );
}
} );
@@ -101,7 +102,7 @@
lastId = s.id;
this._anchorSection[ 'section_' +
sectionNum ] = lastId;
sectionData[ sectionNum ] = { content:
text,
- id: lastId, heading: s.line };
+ id: lastId, heading: s.line,
anchor: s.anchor };
} else if ( level ) {
$tmpContainer.html( text );
$tmpContainer.prepend(
diff --git a/templates/page.html b/templates/page.html
index 8f77bb1..ed37670 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -9,7 +9,7 @@
{{#sections}}
<div class="section">
<h2 class="section_heading" id="section_{{index}}">
- {{{heading}}}
+ <span id="{{anchor}}">{{{heading}}}</span>
<span class="mw-editsection"><a
href="?section={{id}}"></a></span>
</h2>
<div class="content_block" id="content_{{index}}"
diff --git a/templates/section.html b/templates/section.html
index 089ce7c..f63c4f6 100644
--- a/templates/section.html
+++ b/templates/section.html
@@ -1,5 +1,10 @@
<div class="section">
- {{#heading}}<h2 id="section_{{index}}">{{{heading}}}</h2>{{/heading}}
+ {{#heading}}
+ <h2 class="section_heading" id="section_{{index}}">
+ <span id="{{anchor}}">{{{heading}}}</span>
+ <span class="mw-editsection"><a
href="?section={{id}}"></a></span>
+ </h2>
+ {{/heading}}
<div class="content_block openSection"
id="content_{{index}}">
{{{content}}}
--
To view, visit https://gerrit.wikimedia.org/r/80131
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id42f3e990a73e44f073049c78d98c4bd8e752414
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits