Update samy.ps1
This commit is contained in:
18
samy.ps1
18
samy.ps1
@@ -247,7 +247,7 @@ $ConfirmPreference = 'None'
|
||||
$Script:SamyTopLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_logo.svg"
|
||||
|
||||
# Background SAMY image used in CSS
|
||||
$Script:SamyBgLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SAMY5.png"
|
||||
$Script:SamyBgLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SAMY.png"
|
||||
|
||||
$Script:SamyFaviconUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_Favicon.ico"
|
||||
$Script:SamyCssUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.css?raw=1"
|
||||
@@ -1068,15 +1068,13 @@ function Get-UIHtml {
|
||||
$cssContent = Get-RemoteText -Url $Script:SamyCssUrl
|
||||
$jsContent = Get-RemoteText -Url $Script:SamyJsUrl
|
||||
|
||||
if ($cssContent) {
|
||||
$cssContent += @"
|
||||
|
||||
/* SAMY background override injected by script */
|
||||
.sidebar::after {
|
||||
background-image: url('$Script:SamyBgLogoUrl') !important;
|
||||
}
|
||||
"@
|
||||
}
|
||||
# Make the CSS background-image follow $Script:SamyBgLogoUrl
|
||||
if ($cssContent) {
|
||||
$pattern = 'background-image:\s*url\("SAMY\.png"\);?' # matches with or without extra spaces/semicolon
|
||||
$replacement = "background-image: url('$Script:SamyBgLogoUrl');"
|
||||
$cssContent = [regex]::Replace($cssContent, $pattern, $replacement)
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# 4) HTML template - **no external link/script src** anymore, all inlined
|
||||
|
||||
Reference in New Issue
Block a user