4.4: new donations popup
this was done in my ongoing effort to renovate and simplify all parts of cobalt web interface
This commit is contained in:
@@ -129,7 +129,13 @@ export function footerButtons(obj) {
|
||||
items += `<button id="${obj[i]["name"]}-footer" class="switch footer-button" onclick="${obj[i]["action"]}()" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button>`;
|
||||
break;
|
||||
case "popup":
|
||||
items += `<div class="footer-pair"><button id="${obj[i]["name"]}-footer" class="switch footer-button" onclick="popup('${obj[i]["name"]}', 1)" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button><button id="${obj[i+1]["name"]}-footer" class="switch footer-button" onclick="popup('${obj[i+1]["name"]}', 1)" aria-label="${obj[i+1]["aria"]}">${obj[i+1]["text"]}</button></div>`;
|
||||
let context = obj[i]["context"] ? `, '${obj[i]["context"]}'` : ''
|
||||
let context2 = obj[i+1] && obj[i+1]["context"] ? `, '${obj[i+1]["context"]}'` : ''
|
||||
items += `
|
||||
<div class="footer-pair">
|
||||
<button id="${obj[i]["name"]}-footer" class="switch footer-button" onclick="popup('${obj[i]["name"]}', 1${context})" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button>
|
||||
${obj[i+1] ? `<button id="${obj[i+1]["name"]}-footer" class="switch footer-button" onclick="popup('${obj[i+1]["name"]}', 1${context2})" aria-label="${obj[i+1]["aria"]}">${obj[i+1]["text"]}</button>`: ''}
|
||||
</div>`;
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ let audioFormats = supportedAudio.map((p) => {
|
||||
return { "action": p }
|
||||
})
|
||||
audioFormats.unshift({ "action": "best" })
|
||||
for (let i in donations["other"]) {
|
||||
donateLinks += `<a id="don-${i}" class="switch autowidth" href="${donations["other"][i]}" target="_blank">${i}</a>`
|
||||
for (let i in donations["links"]) {
|
||||
donateLinks += `<a id="don-${i}" class="switch autowidth" href="${donations["links"][i]}" target="_blank">REPLACEME ${i}</a>`
|
||||
}
|
||||
let extr = ''
|
||||
for (let i in donations["crypto"]) {
|
||||
@@ -135,22 +135,31 @@ export default function(obj) {
|
||||
header: {
|
||||
closeAria: loc(obj.lang, 'AccessibilityClosePopup'),
|
||||
title: emoji("💸", 30) + loc(obj.lang, 'TitlePopupDonate'),
|
||||
subtitle: loc(obj.lang, 'DonateSubtitle')
|
||||
subtitle: loc(obj.lang, 'DonateSub')
|
||||
},
|
||||
body: [{
|
||||
text: donateLinks,
|
||||
text: `<div class="changelog-banner"><img class="changelog-img" src="updateBanners/catsleep.webp" onerror="this.style.display='none'"></img></div>`,
|
||||
raw: true
|
||||
},{
|
||||
text: loc(obj.lang, 'DonateExplanation')
|
||||
}, {
|
||||
text: donateLinks.replace(/REPLACEME/g, loc(obj.lang, 'DonateVia')),
|
||||
raw: true
|
||||
}, {
|
||||
text: loc(obj.lang, 'DonateLinksDescription'),
|
||||
classes: ["explanation"]
|
||||
}, {
|
||||
text: donate.replace(/REPLACEME/g, loc(obj.lang, 'ClickToCopy'))
|
||||
text: `<div class="separator"></div>`,
|
||||
raw: true
|
||||
}, {
|
||||
text: loc(obj.lang, 'DonateDescription'),
|
||||
classes: ["explanation", "no-top-padding"]
|
||||
text: donate.replace(/REPLACEME/g, loc(obj.lang, 'ClickToCopy')),
|
||||
classes: ["desc-padding"]
|
||||
}, {
|
||||
text: backdropLink(authorInfo.contact, loc(obj.lang, 'LinkDonateContact')),
|
||||
classes: ["bottom-link"]
|
||||
text: `<div class="separator"></div>`,
|
||||
raw: true
|
||||
}, {
|
||||
text: loc(obj.lang, 'DonateHireMe', authorInfo.link),
|
||||
classes: ["desc-padding"]
|
||||
}]
|
||||
})
|
||||
}],
|
||||
@@ -314,6 +323,12 @@ export default function(obj) {
|
||||
type: "popup",
|
||||
text: `${emoji(celebrationsEmoji() , 22)} ${loc(obj.lang, 'AboutTab')}`,
|
||||
aria: loc(obj.lang, 'AccessibilityOpenAbout')
|
||||
}, {
|
||||
name: "about",
|
||||
type: "popup",
|
||||
context: "donate",
|
||||
text: `${emoji("💰", 22)} ${loc(obj.lang, 'Donate')}`,
|
||||
aria: loc(obj.lang, 'AccessibilityOpenDonate')
|
||||
}, {
|
||||
name: "settings",
|
||||
type: "popup",
|
||||
|
||||
Reference in New Issue
Block a user