Skip to content

Commit 48d0490

Browse files
authored
Merge branch 'main' into claude/match-column-w-d-l-draws-044e20
2 parents f4d305e + 403e5af commit 48d0490

35 files changed

Lines changed: 507 additions & 287 deletions

‎javascript/commons/Miscellaneous.js‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -236,49 +236,6 @@ liquipedia.tournamentstable = {
236236
};
237237
liquipedia.core.modules.push( 'tournamentstable' );
238238

239-
/*******************************************************************************
240-
* Template(s): Participants Tables
241-
* Author(s): FO-nTTaX
242-
******************************************************************************/
243-
liquipedia.participantstable = {
244-
init: function() {
245-
if ( document.querySelector( '.participants-table-scroller' ) !== null ) {
246-
document.querySelectorAll( '.participants-table-button-left' ).forEach( ( buttonLeft ) => {
247-
buttonLeft.classList.add( 'inactive' );
248-
buttonLeft.addEventListener( 'click', function() {
249-
if ( window.innerWidth < 600 ) {
250-
const scroller = this.closest( '.participants-table-wrapper' ).querySelector( '.participants-table-scroller' );
251-
scroller.scrollLeft = scroller.scrollLeft - 0.83 * window.innerWidth;
252-
}
253-
} );
254-
} );
255-
document.querySelectorAll( '.participants-table-button-right' ).forEach( ( buttonRight ) => {
256-
buttonRight.addEventListener( 'click', function() {
257-
if ( window.innerWidth < 600 ) {
258-
const scroller = this.closest( '.participants-table-wrapper' ).querySelector( '.participants-table-scroller' );
259-
scroller.scrollLeft = scroller.scrollLeft + 0.83 * window.innerWidth;
260-
}
261-
} );
262-
} );
263-
document.querySelectorAll( '.participants-table-scroller' ).forEach( ( scroller ) => {
264-
scroller.addEventListener( 'scroll', function() {
265-
const buttonLeft = this.closest( '.participants-table-wrapper' ).querySelector( '.participants-table-button-left' );
266-
buttonLeft.classList.remove( 'inactive' );
267-
const buttonRight = this.closest( '.participants-table-wrapper' ).querySelector( '.participants-table-button-right' );
268-
buttonRight.classList.remove( 'inactive' );
269-
if ( this.scrollLeft === 0 ) {
270-
buttonLeft.classList.add( 'inactive' );
271-
}
272-
if ( this.scrollLeft === this.scrollWidth - this.clientWidth ) {
273-
buttonRight.classList.add( 'inactive' );
274-
}
275-
} );
276-
} );
277-
}
278-
}
279-
};
280-
liquipedia.core.modules.push( 'participantstable' );
281-
282239
/*******************************************************************************
283240
* Template(s): Heroes portal on the Heroes of the Storm wiki
284241
* Author(s): FO-nTTaX

‎lua/spec/participant_table_spec.lua‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,26 @@ describe('Participant Table', function()
7474
stub(mw.ext.LiquipediaDB, "lpdb_placement")
7575
InfoboxLeague.run(tournamentData)
7676

77+
local make = function(args)
78+
return tostring(ParticipantTable.run(args))
79+
end
80+
7781
local notAsFactionTable = function(args)
78-
return Table.merge(args, {soloAsFactionTable = false})
82+
return make(Table.merge(args, {soloAsFactionTable = false}))
83+
end
84+
85+
local showSeedingFirst = function(args)
86+
return Table.merge(args, {showSeedingFirst = true})
7987
end
8088

81-
GoldenTest('participant_table', tostring(ParticipantTable.run(notAsFactionTable(argsPlain))))
82-
GoldenTest('participant_faction_table', tostring(ParticipantTable.run(argsPlain)))
83-
GoldenTest('participant_table_with_seed', tostring(ParticipantTable.run(notAsFactionTable(argsWithSeed))))
84-
-- doesn't work yet due to it not being implemented yet
85-
--GoldenTest('participant_faction_table_with_seed', tostring(ParticipantTable.run(argsWithSeed)))
86-
GoldenTest('participant_table_with_duo', tostring(ParticipantTable.run(argsDuoOpponent)))
87-
GoldenTest('participant_table_with_section', tostring(ParticipantTable.run(notAsFactionTable(argsWithSections))))
88-
GoldenTest('participant_faction_table_with_section', tostring(ParticipantTable.run(argsWithSections)))
89+
GoldenTest('participant_table', notAsFactionTable(argsPlain))
90+
GoldenTest('participant_faction_table', make(argsPlain))
91+
GoldenTest('participant_table_with_seed', notAsFactionTable(argsWithSeed))
92+
GoldenTest('participant_faction_table_with_seed', make(argsWithSeed))
93+
GoldenTest('participant_table_seed_list', make(showSeedingFirst(argsWithSeed)))
94+
GoldenTest('participant_table_with_duo', make(argsDuoOpponent))
95+
GoldenTest('participant_table_with_section', notAsFactionTable(argsWithSections))
96+
GoldenTest('participant_faction_table_with_section', make(argsWithSections))
8997

9098
mw.ext.LiquipediaDB.lpdb_tournament:revert()
9199
---@diagnostic disable-next-line: undefined-field
977 Bytes
Loading
866 Bytes
Loading
31.6 KB
Loading
861 Bytes
Loading
30.4 KB
Loading
900 Bytes
Loading
770 Bytes
Loading
2.78 KB
Loading

0 commit comments

Comments
 (0)