2023-01-29 18:17:33 +00:00
import { backdropLink , celebrationsEmoji , checkbox , collapsibleList , explanation , footerButtons , multiPagePopup , popup , popupWithBottomButtons , sep , settingsCategory , switcher , socialLink } from "./elements.js" ;
2023-02-26 16:49:25 +00:00
import { services as s , appName , authorInfo , version , repo , donations , supportedAudio } from "../config.js" ;
2022-08-12 14:36:19 +01:00
import { getCommitInfo } from "../sub/currentCommit.js" ;
import loc from "../../localization/manager.js" ;
import emoji from "../emoji.js" ;
2022-09-11 16:04:06 +01:00
import changelogManager from "../changelog/changelogManager.js" ;
2022-08-12 14:36:19 +01:00
let com = getCommitInfo ( ) ;
let enabledServices = Object . keys ( s ) . filter ( ( p ) => {
if ( s [ p ] . enabled ) return true ;
} ) . sort ( ) . map ( ( p ) => {
2022-12-06 19:21:07 +00:00
return ` <br>• ${ s [ p ] . alias ? s [ p ] . alias : p } `
2023-01-29 18:17:33 +00:00
} ) . join ( '' ) . substring ( 4 )
2022-08-12 14:36:19 +01:00
let donate = ` `
let donateLinks = ` `
let audioFormats = supportedAudio . map ( ( p ) => {
2022-08-16 08:14:19 +01:00
return { "action" : p }
2022-08-12 14:36:19 +01:00
} )
audioFormats . unshift ( { "action" : "best" } )
2022-11-20 13:46:08 +00:00
for ( let i in donations [ "links" ] ) {
donateLinks += ` <a id="don- ${ i } " class="switch autowidth" href=" ${ donations [ "links" ] [ i ] } " target="_blank">REPLACEME ${ i } </a> `
2022-08-12 14:36:19 +01:00
}
let extr = ''
for ( let i in donations [ "crypto" ] ) {
donate += ` <div class="subtitle ${ extr } "> ${ i } (REPLACEME)</div><div id="don- ${ i } " class="text-to-copy" onClick="copy('don- ${ i } ')"> ${ donations [ "crypto" ] [ i ] } </div> `
2022-09-28 13:21:36 +01:00
extr = ' top-margin'
2022-08-12 14:36:19 +01:00
}
2023-01-13 18:34:48 +00:00
2022-08-12 14:36:19 +01:00
export default function ( obj ) {
2023-01-13 18:34:48 +00:00
const t = ( str , replace ) => { return loc ( obj . lang , str , replace ) } ;
2022-09-08 17:02:55 +01:00
let ua = obj . useragent . toLowerCase ( ) ;
let isIOS = ua . match ( "iphone os" ) ;
let isMobile = ua . match ( "android" ) || ua . match ( "iphone os" ) ;
2023-03-09 18:41:17 +00:00
let platform = isMobile ? "m" : "p" ;
if ( isMobile && isIOS ) platform = "i" ;
2023-01-13 18:34:48 +00:00
audioFormats [ 0 ] [ "text" ] = t ( 'SettingsAudioFormatBest' ) ;
2022-08-12 14:36:19 +01:00
try {
return ` <!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "utf-8" / >
< meta name = "viewport" content = "width=device-width, initial-scale=1, maximum-scale=${isIOS ? `1` : `5`}" / >
< title > $ { appName } < / t i t l e >
< meta property = "og:url" content = "${process.env.selfURL}" / >
< meta property = "og:title" content = "${appName}" / >
2023-01-13 18:34:48 +00:00
< meta property = "og:description" content = "${t('EmbedBriefDescription')}" / >
2023-04-09 05:42:18 +01:00
< meta property = "og:image" content = "icons/generic.png" / >
2022-08-12 14:36:19 +01:00
< meta name = "title" content = "${appName}" / >
2023-01-13 18:34:48 +00:00
< meta name = "description" content = "${t('AboutSummary')}" / >
2022-08-12 14:36:19 +01:00
< meta name = "theme-color" content = "#000000" / >
< meta name = "twitter:card" content = "summary" / >
< link rel = "icon" type = "image/x-icon" href = "icons/favicon.ico" / >
< link rel = "icon" type = "image/png" sizes = "32x32" href = "icons/favicon-32x32.png" / >
< link rel = "icon" type = "image/png" sizes = "16x16" href = "icons/favicon-16x16.png" / >
< link rel = "apple-touch-icon" sizes = "180x180" href = "icons/apple-touch-icon.png" / >
< link rel = "manifest" href = "manifest.webmanifest" / >
< link rel = "stylesheet" href = "cobalt.css" / >
< link rel = "stylesheet" href = "fonts/notosansmono.css" / >
2023-01-13 18:34:48 +00:00
< noscript > < div style = "margin: 2rem;" > $ { t ( 'NoScriptMessage' ) } < / d i v > < / n o s c r i p t >
2022-08-12 14:36:19 +01:00
< / h e a d >
2023-03-29 17:08:41 +01:00
< body id = "cobalt-body" $ { platform === "p" ? 'class="desktop"' : '' } data - nosnippet ontouchstart >
2022-08-12 14:36:19 +01:00
$ { multiPagePopup ( {
name : "about" ,
2023-01-13 18:34:48 +00:00
closeAria : t ( 'AccessibilityClosePopup' ) ,
2022-08-12 14:36:19 +01:00
tabs : [ {
name : "about" ,
2023-01-13 18:34:48 +00:00
title : ` ${ emoji ( "🐲" ) } ${ t ( 'AboutTab' ) } ` ,
2022-08-12 14:36:19 +01:00
content : popup ( {
name : "about" ,
header : {
aboveTitle : {
2023-01-13 18:34:48 +00:00
text : t ( 'MadeWithLove' ) ,
2022-08-12 14:36:19 +01:00
url : authorInfo . link
} ,
2023-01-13 18:34:48 +00:00
closeAria : t ( 'AccessibilityClosePopup' ) ,
2023-01-29 18:17:33 +00:00
title : ` ${ emoji ( "🔮" , 30 ) } ${ t ( 'TitlePopupAbout' ) } `
2022-08-12 14:36:19 +01:00
} ,
body : [ {
2023-01-13 18:34:48 +00:00
text : t ( 'AboutSummary' )
2022-08-12 14:36:19 +01:00
} , {
2023-01-29 18:17:33 +00:00
text : collapsibleList ( [ {
"name" : "services" ,
"title" : t ( "CollapseServices" ) ,
"body" : ` ${ enabledServices } <br/><br/> ${ t ( "ServicesNote" ) } `
} , {
"name" : "support" ,
"title" : t ( "CollapseSupport" ) ,
"body" : ` ${ t ( "FollowSupport" ) } <br/>
$ { socialLink ( emoji ( "🐘" ) , "mastodon" , authorInfo . support . mastodon . handle , authorInfo . support . mastodon . url ) }
$ { socialLink ( emoji ( "🐦" ) , "twitter" , authorInfo . support . twitter . handle , authorInfo . support . twitter . url ) } < br / >
$ { t ( "SourceCode" ) } < br / >
$ { socialLink ( emoji ( "🐙" ) , "github" , repo . replace ( "https://github.com/" , '' ) , repo ) } < br / >
$ { t ( "SupportNote" ) } `
} , {
"name" : "privacy" ,
"title" : t ( "CollapsePrivacy" ) ,
"body" : t ( "PrivacyPolicy" )
} ] )
2023-04-09 06:58:29 +01:00
+ ` ${ process . env . DEPLOYMENT _ID && process . env . INTERNAL _IP ? '<a id="hop-attribution" class="explanation" href="https://hop.io/" target="_blank">powered by hop.io</a>' : '' } `
2022-08-12 14:36:19 +01:00
} ]
} )
} , {
name : "changelog" ,
2023-01-13 18:34:48 +00:00
title : ` ${ emoji ( "🎉" ) } ${ t ( 'ChangelogTab' ) } ` ,
2022-08-12 14:36:19 +01:00
content : popup ( {
name : "changelog" ,
header : {
2023-01-13 18:34:48 +00:00
closeAria : t ( 'AccessibilityClosePopup' ) ,
title : ` ${ emoji ( "🪄" , 30 ) } ${ t ( 'TitlePopupChangelog' ) } `
2022-08-12 14:36:19 +01:00
} ,
body : [ {
2023-01-13 18:34:48 +00:00
text : ` <div class="category-title"> ${ t ( 'ChangelogLastMajor' ) } </div> ` ,
2022-08-12 14:36:19 +01:00
raw : true
2022-11-12 16:40:11 +00:00
} , {
text : changelogManager ( "banner" ) ? ` <div class="changelog-banner"><img class="changelog-img" src=" ${ changelogManager ( "banner" ) } " onerror="this.style.display='none'"></img></div> ` : '' ,
raw : true
2022-08-12 14:36:19 +01:00
} , {
2022-09-11 16:04:06 +01:00
text : changelogManager ( "title" ) ,
2022-08-12 14:36:19 +01:00
classes : [ "changelog-subtitle" ] ,
nopadding : true
2022-08-19 18:54:20 +01:00
} , {
2022-10-02 15:13:33 +01:00
text : changelogManager ( "content" )
2022-08-12 14:36:19 +01:00
} , {
2022-12-17 11:09:49 +00:00
text : ` ${ sep ( ) } <span class="text-backdrop"> ${ obj . hash } :</span> ${ com [ 0 ] } ` ,
2022-08-12 14:36:19 +01:00
classes : [ "changelog-subtitle" ] ,
nopadding : true
} , {
text : com [ 1 ]
} , {
2023-01-13 18:34:48 +00:00
text : backdropLink ( ` ${ repo } /commits ` , t ( 'LinkGitHubChanges' ) ) ,
2022-08-12 14:36:19 +01:00
classes : [ "bottom-link" ]
2022-09-11 16:04:06 +01:00
} , {
2023-01-13 18:34:48 +00:00
text : ` <div class="category-title"> ${ t ( 'ChangelogOlder' ) } </div> ` ,
2022-09-11 16:04:06 +01:00
raw : true
} , {
2023-01-13 18:34:48 +00:00
text : ` <div id="changelog-history"><button class="switch bottom-margin" onclick="loadOnDemand('changelog-history', '0')"> ${ t ( "ChangelogPressToExpand" ) } </button></div> ` ,
2022-09-11 16:04:06 +01:00
raw : true
2022-08-12 14:36:19 +01:00
} ]
} )
} , {
name : "donate" ,
2023-01-13 18:34:48 +00:00
title : ` ${ emoji ( "💰" ) } ${ t ( 'DonationsTab' ) } ` ,
2022-08-12 14:36:19 +01:00
content : popup ( {
name : "donate" ,
header : {
2023-01-13 18:34:48 +00:00
closeAria : t ( 'AccessibilityClosePopup' ) ,
title : emoji ( "💸" , 30 ) + t ( 'TitlePopupDonate' )
2022-08-12 14:36:19 +01:00
} ,
body : [ {
2023-01-13 18:34:48 +00:00
text : ` <div class="category-title"> ${ t ( 'DonateSub' ) } </div> ` ,
raw : true
} , {
2022-11-20 13:46:08 +00:00
text : ` <div class="changelog-banner"><img class="changelog-img" src="updateBanners/catsleep.webp" onerror="this.style.display='none'"></img></div> ` ,
raw : true
} , {
2023-01-13 18:34:48 +00:00
text : t ( 'DonateExplanation' )
} , {
text : donateLinks . replace ( /REPLACEME/g , t ( 'DonateVia' ) ) ,
2022-08-12 14:36:19 +01:00
raw : true
} , {
2023-01-13 18:34:48 +00:00
text : t ( 'DonateLinksDescription' ) ,
2022-08-12 14:36:19 +01:00
classes : [ "explanation" ]
} , {
2022-12-17 11:09:49 +00:00
text : sep ( ) ,
2022-11-20 13:46:08 +00:00
raw : true
2022-08-12 14:36:19 +01:00
} , {
2023-01-13 18:34:48 +00:00
text : donate . replace ( /REPLACEME/g , t ( 'ClickToCopy' ) ) ,
2022-11-20 13:46:08 +00:00
classes : [ "desc-padding" ]
2022-08-12 14:36:19 +01:00
} , {
2022-12-17 11:09:49 +00:00
text : sep ( ) ,
2022-11-20 13:46:08 +00:00
raw : true
} , {
2023-01-13 18:34:48 +00:00
text : t ( 'DonateHireMe' , authorInfo . link ) ,
2022-11-20 13:46:08 +00:00
classes : [ "desc-padding" ]
2022-08-12 14:36:19 +01:00
} ]
} )
} ] ,
} ) }
$ { multiPagePopup ( {
name : "settings" ,
2023-01-13 18:34:48 +00:00
closeAria : t ( 'AccessibilityClosePopup' ) ,
2022-08-12 14:36:19 +01:00
header : {
aboveTitle : {
2023-03-09 18:41:17 +00:00
text : ` v. ${ version } - ${ obj . hash } ${ platform } ( ${ obj . branch } ) ` ,
2022-08-22 15:10:54 +01:00
url : ` ${ repo } /commit/ ${ obj . hash } `
2022-08-12 14:36:19 +01:00
} ,
2023-01-13 18:34:48 +00:00
title : ` ${ emoji ( "⚙️" , 30 ) } ${ t ( 'TitlePopupSettings' ) } `
2022-08-12 14:36:19 +01:00
} ,
tabs : [ {
name : "video" ,
2023-01-13 18:34:48 +00:00
title : ` ${ emoji ( "🎬" ) } ${ t ( 'SettingsVideoTab' ) } ` ,
2022-08-12 14:36:19 +01:00
content : settingsCategory ( {
name : "downloads" ,
2023-02-26 16:49:25 +00:00
title : t ( 'SettingsQualitySubtitle' ) ,
2022-08-12 14:36:19 +01:00
body : switcher ( {
2022-11-04 08:49:58 +00:00
name : "vQuality" ,
2023-01-13 18:34:48 +00:00
explanation : t ( 'SettingsQualityDescription' ) ,
2022-08-12 14:36:19 +01:00
items : [ {
"action" : "max" ,
2023-02-26 16:49:25 +00:00
"text" : "4320p+"
2022-08-12 14:36:19 +01:00
} , {
2023-02-26 16:49:25 +00:00
"action" : "2160" ,
"text" : "2160p"
2022-08-12 14:36:19 +01:00
} , {
2023-02-26 16:49:25 +00:00
"action" : "1440" ,
"text" : "1440p"
2022-08-12 14:36:19 +01:00
} , {
2023-02-26 16:49:25 +00:00
"action" : "1080" ,
"text" : "1080p"
} , {
"action" : "720" ,
"text" : "720p"
} , {
"action" : "480" ,
"text" : "480p"
} , {
"action" : "360" ,
"text" : "360p"
2022-08-12 14:36:19 +01:00
} ]
} )
2023-01-13 18:34:48 +00:00
} )
+ settingsCategory ( {
name : "tiktok" ,
title : "tiktok & douyin" ,
2023-01-29 18:17:33 +00:00
body : checkbox ( "disableTikTokWatermark" , t ( 'SettingsRemoveWatermark' ) , 3 )
2023-01-13 18:34:48 +00:00
} )
+ settingsCategory ( {
2023-02-26 16:49:25 +00:00
name : t ( 'SettingsCodecSubtitle' ) ,
2023-01-13 18:34:48 +00:00
body : switcher ( {
2023-02-26 16:49:25 +00:00
name : "vCodec" ,
explanation : t ( 'SettingsCodecDescription' ) ,
2023-01-13 18:34:48 +00:00
items : [ {
2023-02-26 16:49:25 +00:00
"action" : "h264" ,
"text" : "h264 (mp4)"
} , {
"action" : "av1" ,
"text" : "av1 (mp4)"
2023-01-13 18:34:48 +00:00
} , {
2023-02-26 16:49:25 +00:00
"action" : "vp9" ,
"text" : "vp9 (webm)"
2023-01-13 18:34:48 +00:00
} ]
2022-08-16 11:31:41 +01:00
} )
2023-01-13 18:34:48 +00:00
} )
2023-03-15 16:18:31 +00:00
+ settingsCategory ( {
name : t ( 'SettingsVimeoPrefer' ) ,
body : switcher ( {
name : "vimeoDash" ,
explanation : t ( 'SettingsVimeoPreferDescription' ) ,
items : [ {
"action" : "false" ,
"text" : "progressive"
} , {
"action" : "true" ,
"text" : "dash"
} ]
} )
} )
2022-08-12 14:36:19 +01:00
} , {
name : "audio" ,
2023-01-13 18:34:48 +00:00
title : ` ${ emoji ( "🎶" ) } ${ t ( 'SettingsAudioTab' ) } ` ,
2022-08-12 14:36:19 +01:00
content : settingsCategory ( {
name : "general" ,
2023-02-26 16:49:25 +00:00
title : t ( 'SettingsFormatSubtitle' ) ,
body :
switcher ( {
name : "aFormat" ,
explanation : t ( 'SettingsAudioFormatDescription' ) ,
items : audioFormats
} ) + sep ( 0 ) + checkbox ( "muteAudio" , t ( 'SettingsVideoMute' ) , 3 ) + explanation ( t ( 'SettingsVideoMuteExplanation' ) )
} ) + settingsCategory ( {
name : "dub" ,
title : t ( "SettingsAudioDub" ) ,
body : switcher ( {
name : "dubLang" ,
explanation : t ( 'SettingsAudioDubDescription' ) ,
items : [ {
"action" : "original" ,
"text" : t ( 'SettingsDubDefault' )
} , {
"action" : "auto" ,
"text" : t ( 'SettingsDubAuto' )
} ]
} )
} ) + settingsCategory ( {
name : "tiktok" ,
title : "tiktok & douyin" ,
body : checkbox ( "fullTikTokAudio" , t ( 'SettingsAudioFullTikTok' ) , 3 ) + explanation ( t ( 'SettingsAudioFullTikTokDescription' ) )
} )
2022-08-12 14:36:19 +01:00
} , {
name : "other" ,
2023-01-13 18:34:48 +00:00
title : ` ${ emoji ( "🪅" ) } ${ t ( 'SettingsOtherTab' ) } ` ,
2022-08-12 14:36:19 +01:00
content : settingsCategory ( {
name : "appearance" ,
2023-01-13 18:34:48 +00:00
title : t ( 'SettingsAppearanceSubtitle' ) ,
2022-08-12 14:36:19 +01:00
body : switcher ( {
name : "theme" ,
2023-01-13 18:34:48 +00:00
subtitle : t ( 'SettingsThemeSubtitle' ) ,
2022-08-12 14:36:19 +01:00
items : [ {
"action" : "auto" ,
2023-01-13 18:34:48 +00:00
"text" : t ( 'SettingsThemeAuto' )
2022-08-16 08:14:19 +01:00
} , {
2022-08-12 14:36:19 +01:00
"action" : "dark" ,
2023-01-13 18:34:48 +00:00
"text" : t ( 'SettingsThemeDark' )
2022-08-16 08:14:19 +01:00
} , {
2022-08-12 14:36:19 +01:00
"action" : "light" ,
2023-01-13 18:34:48 +00:00
"text" : t ( 'SettingsThemeLight' )
2022-08-12 14:36:19 +01:00
} ]
2023-04-03 17:36:23 +01:00
} ) + checkbox ( "alwaysVisibleButton" , t ( 'SettingsKeepDownloadButton' ) , 4 , t ( 'AccessibilityKeepDownloadButton' ) )
2022-09-28 13:21:36 +01:00
} ) + settingsCategory ( {
name : "miscellaneous" ,
2023-01-13 18:34:48 +00:00
title : t ( 'Miscellaneous' ) ,
2023-01-29 18:17:33 +00:00
body : checkbox ( "disableChangelog" , t ( 'SettingsDisableNotifications' ) ) + ` ${ ! isIOS ? checkbox ( "downloadPopup" , t ( 'SettingsEnableDownloadPopup' ) , 1 , t ( 'AccessibilityEnableDownloadPopup' ) ) : '' } `
2022-09-08 17:02:55 +01:00
} )
2022-08-12 14:36:19 +01:00
} ] ,
} ) }
$ { popup ( {
name : "download" ,
2022-08-19 18:54:20 +01:00
standalone : true ,
2022-08-12 14:36:19 +01:00
header : {
2023-01-13 18:34:48 +00:00
closeAria : t ( 'AccessibilityClosePopup' ) ,
subtitle : t ( 'TitlePopupDownload' )
2022-08-12 14:36:19 +01:00
} ,
body : switcher ( {
name : "download" ,
2023-01-13 18:34:48 +00:00
subtitle : t ( 'DownloadPopupWayToSave' ) ,
explanation : ` ${ ! isIOS ? t ( 'DownloadPopupDescription' ) : t ( 'DownloadPopupDescriptionIOS' ) } ` ,
2023-04-08 17:55:44 +01:00
items : ` <a id="pd-download" class="switch full" target="_blank" href="/"> ${ t ( 'Download' ) } </a>
< div id = "pd-share" class = "switch full" > $ { t ( 'ShareURL' ) } < / d i v >
2023-01-13 18:34:48 +00:00
< div id = "pd-copy" class = "switch full" > $ { t ( 'CopyURL' ) } < / d i v > `
2022-08-12 14:36:19 +01:00
} )
} ) }
2022-09-03 16:32:39 +01:00
$ { popupWithBottomButtons ( {
2022-10-09 18:44:00 +01:00
name : "picker" ,
2023-01-13 18:34:48 +00:00
closeAria : t ( 'AccessibilityClosePopup' ) ,
2022-09-03 16:32:39 +01:00
header : {
2022-10-09 18:44:00 +01:00
title : ` <div id="picker-title"></div> ` ,
explanation : ` <div id="picker-subtitle"></div> ` ,
2022-09-03 16:32:39 +01:00
} ,
2023-01-13 18:34:48 +00:00
buttons : [ ` <a id="picker-download" class="switch" target="_blank" href="/"> ${ t ( 'ImagePickerDownloadAudio' ) } </a> ` ] ,
2022-10-09 18:44:00 +01:00
content : '<div id="picker-holder"></div>'
2022-09-03 16:32:39 +01:00
} ) }
2022-08-12 14:36:19 +01:00
$ { popup ( {
name : "error" ,
2022-08-19 18:54:20 +01:00
standalone : true ,
buttonOnly : true ,
classes : [ "small" ] ,
2023-01-13 18:34:48 +00:00
buttonText : t ( 'ErrorPopupCloseButton' ) ,
2022-08-12 14:36:19 +01:00
header : {
2023-01-13 18:34:48 +00:00
closeAria : t ( 'AccessibilityClosePopup' ) ,
2023-01-29 18:17:33 +00:00
title : t ( 'TitlePopupError' ) ,
emoji : emoji ( "☹️" , 64 , 1 ) ,
2022-08-12 14:36:19 +01:00
} ,
2022-08-19 18:54:20 +01:00
body : ` <div id="desc-error" class="desc-padding subtext"></div> `
2022-08-12 14:36:19 +01:00
} ) }
< div id = "popup-backdrop" style = "visibility: hidden;" onclick = "hideAllPopups()" > < / d i v >
2022-09-08 17:02:55 +01:00
< div id = "cobalt-main-box" class = "center" style = "visibility: hidden;" >
2023-04-03 17:36:23 +01:00
< div id = "logo" > $ { appName } < / d i v >
< div id = "download-area" >
2022-09-08 17:02:55 +01:00
< div id = "top" >
2023-01-13 18:34:48 +00:00
< input id = "url-input-area" class = "mono" type = "text" autocorrect = "off" maxlength = "128" autocapitalize = "off" placeholder = "${t('LinkInput')}" aria - label = "${t('AccessibilityInputArea')}" oninput = "button()" > < / i n p u t >
2022-09-08 17:02:55 +01:00
< button id = "url-clear" onclick = "clearInput()" style = "display:none;" > x < / b u t t o n >
2023-01-13 18:34:48 +00:00
< input id = "download-button" class = "mono dontRead" onclick = "download(document.getElementById('url-input-area').value)" type = "submit" value = "" disabled = true aria - label = "${t('AccessibilityDownloadButton')}" >
2022-09-08 17:02:55 +01:00
< / d i v >
2022-09-28 13:21:36 +01:00
< div id = "bottom" >
2023-04-03 17:36:23 +01:00
< button id = "paste" class = "switch" onclick = "pasteClipboard()" aria - label = "${t('PasteFromClipboard')}" > $ { emoji ( "📋" , 22 ) } $ { t ( 'PasteFromClipboard' ) } < / b u t t o n >
$ { switcher ( {
name : "audioMode" ,
noParent : true ,
items : [ {
"action" : "false" ,
"text" : ` ${ emoji ( "✨" ) } ${ t ( "ModeToggleAuto" ) } `
} , {
"action" : "true" ,
"text" : ` ${ emoji ( "🎶" ) } ${ t ( "ModeToggleAudio" ) } `
} ]
} ) }
2022-09-28 13:21:36 +01:00
< / d i v >
2022-08-12 14:36:19 +01:00
< / d i v >
< / d i v >
< footer id = "footer" style = "visibility: hidden;" >
2022-09-08 17:02:55 +01:00
$ { /* big action buttons are ALWAYS either first or last, because usual buttons are bundled in pairs and are sandwiched between bigger buttons for mobile view */
footerButtons ( [ {
2022-08-16 08:14:19 +01:00
name : "about" ,
type : "popup" ,
2023-01-13 18:34:48 +00:00
text : ` ${ emoji ( celebrationsEmoji ( ) , 22 ) } ${ t ( 'AboutTab' ) } ` ,
aria : t ( 'AccessibilityOpenAbout' )
2022-11-20 13:46:08 +00:00
} , {
name : "about" ,
type : "popup" ,
context : "donate" ,
2023-01-13 18:34:48 +00:00
text : ` ${ emoji ( "💰" , 22 ) } ${ t ( 'Donate' ) } ` ,
aria : t ( 'AccessibilityOpenDonate' )
2022-08-16 08:14:19 +01:00
} , {
name : "settings" ,
type : "popup" ,
2023-01-13 18:34:48 +00:00
text : ` ${ emoji ( "⚙️" , 22 ) } ${ t ( 'TitlePopupSettings' ) } ` ,
aria : t ( 'AccessibilityOpenSettings' )
} ] ) }
2022-08-12 14:36:19 +01:00
< / f o o t e r >
< / b o d y >
2022-08-22 15:10:54 +01:00
< script type = "text/javascript" > const loc = {
2023-01-13 18:34:48 +00:00
noInternet : ` + " ` " + t('ErrorNoInternet') + " ` " + ` ,
noURLReturned : ` + " ` " + t('ErrorNoUrlReturned') + " ` " + ` ,
unknownStatus : ` + " ` " + t('ErrorUnknownStatus') + " ` " + ` ,
collapseHistory : ` + " ` " + t('ChangelogPressToHide') + " ` " + ` ,
pickerDefault : ` + " ` " + t('MediaPickerTitle') + " ` " + ` ,
pickerImages : ` + " ` " + t('ImagePickerTitle') + " ` " + ` ,
pickerImagesExpl : ` + " ` " + t(`ImagePickerExplanation${isMobile ? " Phone " : " PC "}`) + " ` " + ` ,
pickerDefaultExpl : ` + " ` " + t(`MediaPickerExplanation${isMobile ? `Phone${isIOS ? " IOS " : " "}` : " PC "}`) + " ` " + ` ,
2022-08-22 15:10:54 +01:00
} ; < / s c r i p t >
2022-08-12 14:36:19 +01:00
< script type = "text/javascript" src = "cobalt.js" > < / s c r i p t >
< / h t m l > ` ;
} catch ( err ) {
2023-01-13 18:34:48 +00:00
return ` ${ t ( 'ErrorPageRenderFail' , obj . hash ) } ` ;
2022-08-12 14:36:19 +01:00
}
}