Files
btcpayserver/BTCPayServer/Views/Shared/LayoutHeadTheme.cshtml
d11n 20e8db7307 App: Allow receipt to be shown in iframe (#6574)
Also detects if the checkout page is shown within an iframe and hides the back to store link in that case.
2025-01-21 23:50:27 +09:00

30 lines
1.4 KiB
Plaintext

@using BTCPayServer.Services
@inject ThemeSettings Theme
@inject UriResolver UriResolver
<script>
if (window.localStorage.getItem('btcpay-hide-sensitive-info') === 'true') { document.documentElement.setAttribute('data-hide-sensitive-info', 'true')}
if (window.location !== window.parent.location) { document.documentElement.setAttribute('data-within-iframe', 'true')}
</script>
@if (Theme.CustomTheme && Theme.CustomThemeCssUrl is not null)
{ // new customization uses theme file id provided by upload
@if (Theme.CustomThemeExtension != ThemeExtension.Custom)
{ // needs to be added for light and dark, because dark extends light
<link href="~/main/themes/default.css" rel="stylesheet" asp-append-version="true" />
}
@if (Theme.CustomThemeExtension == ThemeExtension.Dark)
{
<link href="~/main/themes/default-dark.css" rel="stylesheet" asp-append-version="true" />
}
var themeUrl = await UriResolver.Resolve(this.Context.Request.GetAbsoluteRootUri(), Theme.CustomThemeCssUrl);
<link href="@themeUrl" rel="stylesheet" asp-append-version="true" />
}
else
{
<link href="~/main/themes/default.css" asp-append-version="true" rel="stylesheet" />
<link href="~/main/themes/default-dark.css" asp-append-version="true" rel="stylesheet" id="DarkThemeLinkTag" />
<script src="~/js/theme-switch.js" asp-append-version="true"></script>
<noscript><style>.btcpay-theme-switch { display: none !important; }</style></noscript>
}