0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-03-01 01:54:24 +01:00

Clean up classes and lint JS.

This commit is contained in:
XhmikosR 2019-06-08 14:34:37 +03:00
parent 9f72bbae7c
commit 9febb30c19

View File

@ -38,6 +38,9 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap.
</div>
<script>
(function () {
'use strict'
function displaySponsors(sponsorList) {
var sponsorListEl = document.getElementById('sponsorList')
var output = []
@ -45,10 +48,8 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap.
sponsorList.forEach(function (sponsor) {
output.push(
'<div class="m-2 position-relative">',
' <div style="width:100px; height: 100px;" class="img-thumbnail d-flex align-items-center justify-content-center overflow-hidden">',
' <div class="w-100">',
' <img src="' + sponsor.avatar + '" alt="' + sponsor.name + '" class="mh-100 mw-100">',
' </div>',
' <div class="img-thumbnail mx-auto d-flex align-items-center justify-content-center overflow-hidden" style="width:100px; height: 100px;">',
' <img class="img-fluid d-block" src="' + sponsor.avatar + '" alt="' + sponsor.name + '">',
' </div>',
' <h3 class="h6 pt-2">',
)
@ -75,7 +76,7 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap.
backerList.forEach(function (backer) {
output.push(
'<div class="m-1 position-relative">',
' <div style="width:50px; height: 50px;" class="img-thumbnail d-flex align-items-center justify-content-center overflow-hidden">'
' <div class="img-thumbnail d-flex align-items-center justify-content-center overflow-hidden" style="width:50px; height: 50px;">'
)
if (backer.website) {
@ -84,7 +85,7 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap.
)
}
output.push('<img src="' + backer.avatar + '" alt="' + backer.name + '" class="mh-100 mw-100">')
output.push('<img src="' + backer.avatar + '" alt="' + backer.name + '" class=""img-fluid d-block>')
if (backer.website) {
output.push('</a>')
@ -104,7 +105,7 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap.
var xhr = new XMLHttpRequest()
xhr.open('GET', ocURL, true)
xhr.onload = function () {
xhr.addEventListener('load', function () {
if (xhr.readyState !== 4) {
return
}
@ -114,27 +115,37 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap.
} else {
cb(null, xhr.statusText)
}
}
})
xhr.send()
}
(function () {
requestOC(function (allBackerList, error) {
var backerList = allBackerList.filter(function (backer) { return backer.tier === 'backer' })
var sponsorList = allBackerList.filter(function (backer) { return backer.tier === 'sponsor' })
requestOC(function (allBackerList) {
var backerList = allBackerList.filter(function (backer) {
return backer.tier === 'backer'
})
var sponsorList = allBackerList.filter(function (backer) {
return backer.tier === 'sponsor'
})
// Sort by total amount donated
sponsorList.sort(function (sponsor1, sponsor2) { return sponsor2.directDonations - sponsor1.directDonations })
sponsorList.sort(function (sponsor1, sponsor2) {
return sponsor2.directDonations - sponsor1.directDonations
})
sponsorList = sponsorList.slice(0, 10)
displaySponsors(sponsorList)
// Sort by total amount donated
backerList.sort(function (backer1, backer2) { return backer2.directDonations - backer1.directDonations })
backerList.sort(function (backer1, backer2) {
return backer2.directDonations - backer1.directDonations
})
backerList = backerList.slice(0, 10)
displayBackers(backerList)
})
})()
})()
</script>
{{< /services.inline >}}