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 javascript/commons/Analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ liquipedia.analytics = {

setupButtonClickAnalytics: function() {
liquipedia.analytics.clickTrackers.push( {
selector: '.btn:not(a *), button:not(a *)',
selector: '.btn:not(a *), .button:not(a *), button:not(a *)',
trackerName: BUTTON_CLICKED,
propertiesBuilder: ( link ) => ( {
title: link.innerText,
Expand Down
6 changes: 3 additions & 3 deletions javascript/commons/Collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ liquipedia.collapse = {
makeDesignButton: function( collapsible, isShow ) {
const title = ( isShow ? 'Show' : 'Hide' );
const button = document.createElement( 'button' );
button.classList.add( 'collapseButton', 'btn', 'btn-secondary', 'btn-extrasmall' );
button.classList.add( 'collapseButton', 'button', 'button--secondary', 'button--extrasmall' );
button.classList.add( isShow ? 'collapseButtonShow' : 'collapseButtonHide' );
button.setAttribute( 'role', 'button' );
button.setAttribute( 'aria-label', title );
Expand Down Expand Up @@ -174,7 +174,7 @@ liquipedia.collapse = {
hideAllText = 'Hide all';
}
const button = document.createElement( 'button' );
button.classList.add( 'btn', 'btn-secondary', 'btn-small' );
button.classList.add( 'button', 'button--secondary', 'button--small' );
if ( toggleGroup.classList.contains( 'toggle-state-hide' ) ) {
button.innerHTML = this.makeIcon( false ) + ' ' + hideAllText;
} else {
Expand Down Expand Up @@ -219,7 +219,7 @@ liquipedia.collapse = {
} else {
box.classList.add( 'dropdown-box-visible' );
toggleActive = true;
box.querySelectorAll( '.btn' ).forEach( ( btn ) => {
box.querySelectorAll( '.button' ).forEach( ( btn ) => {
btn.addEventListener( 'click', () => {
dropdownButton.innerHTML = btn.textContent + ' <span class="caret"></span>';
box.classList.remove( 'dropdown-box-visible' );
Expand Down
8 changes: 4 additions & 4 deletions javascript/commons/Commons_tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ liquipedia.commonstools = {
createForms: function() {
const checkForPageExistenceForm = document.getElementById( 'checkforpageexistence' );
if ( checkForPageExistenceForm !== null ) {
checkForPageExistenceForm.innerHTML = '<form id="checkforpageexistenceform"><input id="checkforpageexistenceinput" placeholder="Name of page" class="form-control"><button id="checkforpageexistencebutton" class="btn btn-primary" type="submit">Search</button></form><div id="checkforpageexistenceresult"></div>';
checkForPageExistenceForm.innerHTML = '<form id="checkforpageexistenceform"><input id="checkforpageexistenceinput" placeholder="Name of page" class="form-control"><button id="checkforpageexistencebutton" class="button button--primary" type="submit">Search</button></form><div id="checkforpageexistenceresult"></div>';
}
const checkPageTextForm = document.getElementById( 'checkpagetext' );
if ( checkPageTextForm !== null ) {
checkPageTextForm.innerHTML = '<form id="checkpagetextform"><input id="checkpagetextforminputname" placeholder="Name of page" class="form-control"><input id="checkpagetextforminputsource" placeholder="Source wiki" class="form-control"><button id="checkpagetextbutton" class="btn btn-primary" type="submit">Search</button></form><div id="checkpagetextresult"></div>';
checkPageTextForm.innerHTML = '<form id="checkpagetextform"><input id="checkpagetextforminputname" placeholder="Name of page" class="form-control"><input id="checkpagetextforminputsource" placeholder="Source wiki" class="form-control"><button id="checkpagetextbutton" class="button button--primary" type="submit">Search</button></form><div id="checkpagetextresult"></div>';
}
},
createCallbacks: function() {
Expand Down Expand Up @@ -178,8 +178,8 @@ liquipedia.commonstools = {
const page = data.query.pages[ 0 ];
const link = document.createElement( 'a' );
const postButton = document.createElement( 'button' );
postButton.classList.add( 'btn' );
postButton.classList.add( 'btn-primary' );
postButton.classList.add( 'button' );
postButton.classList.add( 'button--primary' );
const span = document.createElement( 'span' );
link.href = '/' + wiki + '/' + page.title;
postButton.type = 'button';
Expand Down
2 changes: 1 addition & 1 deletion javascript/commons/ExportImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ class DropdownWidget {
'<span style="line-height: 1">Share</span>';

const button = this.createElement( 'button', {
class: 'btn btn-ghost btn-extrasmall dropdown-widget__toggle',
class: 'button button--ghost button--extrasmall dropdown-widget__toggle',
type: 'button',
title: 'Share',
'aria-label': 'Share this content',
Expand Down
12 changes: 6 additions & 6 deletions javascript/commons/Miscellaneous.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ liquipedia.teamcard = {
hideplayers = 'Hide Players';
}
const button = document.createElement( 'button' );
button.classList.add( 'btn' );
button.classList.add( 'btn-secondary' );
button.classList.add( 'btn-small' );
button.classList.add( 'button' );
button.classList.add( 'button--secondary' );
button.classList.add( 'button--small' );
button.innerHTML = showplayers;
button.addEventListener( 'click', () => {
if ( teamcardsopened ) {
Expand Down Expand Up @@ -67,7 +67,7 @@ liquipedia.teamcard = {
document.querySelectorAll( '.teamcard-former-toggle-button' ).forEach( ( wrap ) => {
const teamcard = wrap.closest( '.teamcard' );
const button = document.createElement( 'button' );
button.classList.add( 'btn', 'btn-secondary', 'btn-small' );
button.classList.add( 'button', 'button--secondary', 'button--small' );
let width = 156;
if ( typeof wrap.dataset.width !== 'undefined' ) {
width = parseInt( wrap.dataset.width );
Expand Down Expand Up @@ -118,7 +118,7 @@ liquipedia.teamcard = {
document.querySelectorAll( '.teamcard-subs-toggle-button' ).forEach( ( wrap ) => {
const teamcard = wrap.closest( '.teamcard' );
const button = document.createElement( 'button' );
button.classList.add( 'btn', 'btn-secondary', 'btn-small' );
button.classList.add( 'button', 'button--secondary', 'button--small' );
let width = 156;
if ( typeof wrap.dataset.width !== 'undefined' ) {
width = parseInt( wrap.dataset.width );
Expand Down Expand Up @@ -170,7 +170,7 @@ liquipedia.teamcard = {
document.querySelectorAll( '.teamcard-active-toggle-button' ).forEach( ( wrap ) => {
const teamcard = wrap.closest( '.teamcard' );
const button = document.createElement( 'button' );
button.classList.add( 'btn', 'btn-secondary', 'btn-small' );
button.classList.add( 'button', 'button--secondary', 'button--small' );
let width = 156;
if ( typeof wrap.dataset.width !== 'undefined' ) {
width = parseInt( wrap.dataset.width );
Expand Down
8 changes: 4 additions & 4 deletions javascript/commons/Selectall.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ class SelectAllContainer {

createSelectButton() {
const selectButton = document.createElement( 'button' );
selectButton.classList.add( 'btn' );
selectButton.classList.add( 'btn-secondary' );
selectButton.classList.add( 'button' );
selectButton.classList.add( 'button--secondary' );
selectButton.innerHTML = 'Select';
selectButton.addEventListener( 'click', () => this.selectElementText() );
return selectButton;
}

createSelectAllButton() {
const selectCopyButton = document.createElement( 'button' );
selectCopyButton.classList.add( 'btn' );
selectCopyButton.classList.add( 'btn-primary' );
selectCopyButton.classList.add( 'button' );
selectCopyButton.classList.add( 'button--primary' );
selectCopyButton.innerHTML = 'Select and copy';

selectCopyButton.addEventListener( 'click', async () => {
Expand Down
2 changes: 1 addition & 1 deletion javascript/commons/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ liquipedia.slider = {
initSlider: function ( container ) {
const makeButton = ( faIcon ) => {
const button = document.createElement( 'div' );
button.className = `btn btn-secondary btn-extrasmall fas fa-${ faIcon }`;
button.className = `button button--secondary button--extrasmall fas fa-${ faIcon }`;
return button;
};

Expand Down
6 changes: 3 additions & 3 deletions lua/spec/dropdown_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Dropdown', function()
assert.truthy(html:find('dropdown%-widget__menu'))
assert.truthy(html:find('dropdown%-widget__label'))
assert.truthy(html:find('dropdown%-widget__indicator'))
assert.truthy(html:find('btn%-secondary'))
assert.truthy(html:find('button%-%-secondary'))
end)

it('should render dropdown items', function()
Expand Down Expand Up @@ -57,7 +57,7 @@ describe('Dropdown', function()
local html = tostring(widget)
assert.truthy(html:find('dropdown%-widget%-%-form'))
assert.truthy(html:find('custom%-dropdown'))
assert.truthy(html:find('btn%-secondary'))
assert.truthy(html:find('button%-%-secondary'))
assert.truthy(html:find('Choose option'))
assert.truthy(html:find('aria%-haspopup="menu"'))
assert.truthy(html:find('aria%-hidden="true"'))
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('Dropdown', function()
}
local html = tostring(widget)
assert.truthy(html:find('dropdown%-widget%-%-inline'))
assert.truthy(html:find('btn%-ghost'))
assert.truthy(html:find('button%-%-ghost'))
assert.truthy(html:find('dropdown%-widget__prefix'))
assert.truthy(html:find('dropdown%-widget__label'))
assert.truthy(html:find('dropdown%-widget__indicator'))
Expand Down
Binary file modified lua/spec/snapshots/LeagueIcon.generate_copy_paste_gen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/Slider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_counterstrike.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_dota2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_leagueoflegends.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_mobilelegends.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_overwatch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_rainbowsix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_rocketleague.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_starcraft2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_valorant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/standings_legend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/team_participant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/teamcard_legacy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lua/wikis/ageofempires/ParticipantTable/Custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function AoEParticipantTable:_createTitle(tabletitle, buttontitle, togglearea, b
:css('width', width or self.config.width)
:css('vertical-align', 'middle')
:tag('span')
:addClass('toggle-area-button btn btn-small btn-primary')
:addClass('toggle-area-button button button--small button--primary')
:attr('data-toggle-area-btn', buttonarea)
:css('position', 'absolute')
:wikitext(buttontitle)
Expand Down
2 changes: 1 addition & 1 deletion lua/wikis/commons/MatchTicker/DisplayComponents.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function Details:_matchPageIcon()
if Logic.isEmpty(matchPage) then return end

local display = mw.html.create('div')
:addClass('btn-secondary btn btn-extrasmall')
:addClass('button--secondary button button--extrasmall')
:wikitext(Icon.makeIcon{iconName = 'matchpopup'})

return Page.makeInternalLink(tostring(display), matchPage)
Expand Down
18 changes: 9 additions & 9 deletions lua/wikis/commons/Widget/Basic/Button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,25 @@ local defaultProps = {
---@return HtmlNode
local function Button(props)
--- MW Parser does not allowed the <button> tag, so we use a <div>
local cssClasses = {'btn'}
local cssClasses = {'button'}
if props.variant == 'primary' then
Comment thread
fikrydev marked this conversation as resolved.
table.insert(cssClasses, 'btn-primary')
table.insert(cssClasses, 'button--primary')
elseif props.variant == 'secondary' then
table.insert(cssClasses, 'btn-secondary')
table.insert(cssClasses, 'button--secondary')
elseif props.variant == 'themed' then
table.insert(cssClasses, 'btn-themed')
table.insert(cssClasses, 'button--themed')
elseif props.variant == 'ghost' then
table.insert(cssClasses, 'btn-ghost')
table.insert(cssClasses, 'button--ghost')
elseif props.variant == 'destructive' then
table.insert(cssClasses, 'btn-destructive')
table.insert(cssClasses, 'button--destructive')
end

if props.size == 'xs' then
table.insert(cssClasses, 'btn-extrasmall')
table.insert(cssClasses, 'button--extrasmall')
elseif props.size == 'sm' then
table.insert(cssClasses, 'btn-small')
table.insert(cssClasses, 'button--small')
elseif props.size == 'lg' then
table.insert(cssClasses, 'btn-large')
table.insert(cssClasses, 'button--large')
end

local cssTable = {}
Expand Down
2 changes: 1 addition & 1 deletion lua/wikis/commons/Widget/Match/VodsDropdownButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function VodsDropdownButton:render()
variant = 'secondary',
}
local hideButton = Button{
classes = {'general-collapsible-collapse-button', 'btn--active'},
classes = {'general-collapsible-collapse-button', 'button--active'},
children = Span{
children = {
ImageIcon{imageLight = VodLink.getIcon()},
Expand Down
2 changes: 1 addition & 1 deletion stylesheets/commons/Mainpage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ div.match-countdown-wrapper {
width: calc( 50% + 18px );
}

.infobox_matches_content .has-matchpage .match-countdown-wrapper .btn-secondary {
.infobox_matches_content .has-matchpage .match-countdown-wrapper .button--secondary {
min-height: 1.5rem;
padding: 0 0.75rem;
}
Expand Down
4 changes: 2 additions & 2 deletions stylesheets/commons/Match.scss
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ $team-icon-size: 22px;
flex: 1;
}

& .btn {
& .button {
width: 100%;
}

Expand Down Expand Up @@ -272,7 +272,7 @@ $team-icon-size: 22px;
background-color: var( --clr-on-surface-dark-primary-8 );
}

.btn {
.button {
.theme--light & {
background-color: var( --clr-secondary-100 );
}
Expand Down
Loading