Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can use several variables to modify extension's behaviour:
- `$wgAllInfoboxesExcludedSubpages` (array) - list of subpages in template namespace to omit by AllInfoboxes query. (default: [ "doc", "draft", "test" ])
- `$wgPortableInfoboxCacheRenderers` (bool) - cache internal infobox renderers. (default: true)
- `$wgPortableInfoboxCustomImageWidth` (int) - size of image thumbnails used in infoboxes. (default: 300)
- `$wgPortableInfoboxUseHeadings` (bool) - use heading tags for infobox titles and group headers, it may cause incompatibilities with other extensions. (default: true)
- `$wgPortableInfoboxUseHeadings` (bool) - use heading tags for infobox titles and group headers, it may cause incompatibilities with other extensions as well as Parsoid. This config previously defaulted to true. (default: false)
- `$wgPortableInfoboxUseTidy` (bool) - use [RemexHtml](https://www.mediawiki.org/wiki/RemexHtml) for validating HTML in infoboxes (default: true)
- `$wgPortableInfoboxResponsiblyOpenCollapsed` (bool) - open collapsed groups when the screen is narrow. (default: true)
- `$wgPortableInfoboxUseFileDescriptionPage` (bool) - control whether or not embedded images in the infobox will link to their file description page instead of directly to the file. (default: false)
Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"value": 300
},
"PortableInfoboxUseHeadings": {
"value": true
"value": false
},
"PortableInfoboxUseTidy": {
"value": true
Expand Down
6 changes: 3 additions & 3 deletions resources/PortableInfoboxBuilderNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
super.html();

if ( this.params.label ) {
let label = document.createElement( 'h3' );
let label = document.createElement( 'div' );
label.className = 'pi-data-label pi-secondary-font';
label.textContent = this.params.label;
this.element.appendChild( label );
Expand Down Expand Up @@ -267,7 +267,7 @@
class NodeTitle extends PINode {
constructor( markupDoc, params ) {
super( markupDoc, params );
this.elementTag = 'h2';
this.elementTag = 'div';
this.elementClasses += 'pi-item-spacing pi-title';
this.markupTag = 'title';
}
Expand Down Expand Up @@ -342,7 +342,7 @@
class NodeHeader extends PINode {
constructor( markupDoc, params ) {
super( markupDoc, params );
this.elementTag = 'h2';
this.elementTag = 'div';
this.elementClasses += 'pi-item-spacing pi-header pi-secondary-font pi-secondary-background';
this.markupTag = 'header';
this.markupContentTag = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public static function getColorDataProvider() {
[
[ 'accent-color-default' => '#fff' ],
'<aside class="portable-infobox noexcerpt searchaux pi-background pi-theme-default pi-layout-default">
<h2 class="pi-item pi-item-spacing pi-title" style="background-color:#fff;">test</h2>
<div class="pi-item pi-item-spacing pi-title" style="background-color:#fff;">test</div>
</aside>',
'<title><default>test</default></title>',
[],
Expand All @@ -241,7 +241,7 @@ public static function getColorDataProvider() {
[
[ 'accent-color-source' => 'color-source' ],
'<aside class="portable-infobox noexcerpt searchaux pi-background pi-theme-default pi-layout-default">
<h2 class="pi-item pi-item-spacing pi-title" style="background-color:#000;">test</h2>
<div class="pi-item pi-item-spacing pi-title" style="background-color:#000;">test</div>
</aside>',
'<title><default>test</default></title>',
[ 'color-source' => '#000' ],
Expand All @@ -253,7 +253,7 @@ public static function getColorDataProvider() {
'accent-color-source' => 'color-source'
],
'<aside class="portable-infobox noexcerpt searchaux pi-background pi-theme-default pi-layout-default">
<h2 class="pi-item pi-item-spacing pi-title" style="background-color:#000;">test</h2>
<div class="pi-item pi-item-spacing pi-title" style="background-color:#000;">test</div>
</aside>',
'<title><default>test</default></title>',
[ 'color-source' => '#000' ],
Expand All @@ -262,7 +262,7 @@ public static function getColorDataProvider() {
[
[ 'accent-color-text-default' => '#fff' ],
'<aside class="portable-infobox noexcerpt searchaux pi-background pi-theme-default pi-layout-default">
<h2 class="pi-item pi-item-spacing pi-title" style="color:#fff;">test</h2>
<div class="pi-item pi-item-spacing pi-title" style="color:#fff;">test</div>
</aside>',
'<title><default>test</default></title>',
[],
Expand All @@ -274,7 +274,7 @@ public static function getColorDataProvider() {
'accent-color-text-source' => 'color-source'
],
'<aside class="portable-infobox noexcerpt searchaux pi-background pi-theme-default pi-layout-default">
<h2 class="pi-item pi-item-spacing pi-title" style="color:#000;">test</h2>
<div class="pi-item pi-item-spacing pi-title" style="color:#000;">test</div>
</aside>',
'<title><default>test</default></title>',
[ 'color-source' => '#000' ],
Expand All @@ -286,7 +286,7 @@ public static function getColorDataProvider() {
'accent-color-text-source' => 'color-source'
],
'<aside class="portable-infobox noexcerpt searchaux pi-background pi-theme-default pi-layout-default">
<h2 class="pi-item pi-item-spacing pi-title" style="color:#000;">test</h2>
<div class="pi-item pi-item-spacing pi-title" style="color:#000;">test</div>
</aside>',
'<title><default>test</default></title>',
[ 'color-source' => '#000' ],
Expand All @@ -300,8 +300,8 @@ public static function getColorDataProvider() {
'accent-color-source' => 'color-source2'
],
'<aside class="portable-infobox noexcerpt searchaux pi-background pi-theme-default pi-layout-default">
<h2 class="pi-item pi-item-spacing pi-title"
style="background-color:#001;color:#000;">test</h2>
<div class="pi-item pi-item-spacing pi-title"
style="background-color:#001;color:#000;">test</div>
</aside>',
'<title><default>test</default></title>',
[
Expand All @@ -319,8 +319,8 @@ public static function getColorDataProvider() {
'accent-color-source' => 'color-source2'
],
'<aside class="portable-infobox noexcerpt searchaux pi-background pi-theme-default pi-layout-default">
<h2 class="pi-item pi-item-spacing pi-title"
style="background-color:#001;color:#000;">test</h2>
<div class="pi-item pi-item-spacing pi-title"
style="background-color:#001;color:#000;">test</div>
</aside>',
'<title><default>test</default></title>',
'templateInvocation' => [
Expand Down Expand Up @@ -350,7 +350,7 @@ public function testParamsParsing( $expected, $params ) {
$dataNodes = $xpath->query( '//aside/div[contains(@class,\'pi-data\')]' );
for ( $i = 0; $i < $dataNodes->length; $i++ ) {
// get map of label => value from parsed data node
$result[$xpath->query( 'h3[contains(@class, \'pi-data-label\')]', $dataNodes->item( $i ) )
$result[$xpath->query( 'div[contains(@class, \'pi-data-label\')]', $dataNodes->item( $i ) )
->item( 0 )->nodeValue] =
$xpath->query( 'div[contains(@class, \'pi-data-value\')]', $dataNodes->item( $i ) )
->item( 0 )->nodeValue;
Expand Down
Loading