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