Skip to content

Commit 7b38767

Browse files
committed
Update to v6.3.93, Update 5 files
2025-05-17 10:07 - Update: "notes/info/index/0 minify.ps1" - Update: js/navbar.js - Update: js/navbar.min.js - Update: notes/info/index/index-uc.html - Update: notes/info/index/index.html
1 parent adbb7b3 commit 7b38767

File tree

5 files changed

+281
-15
lines changed

5 files changed

+281
-15
lines changed

js/navbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// this was initially just navbar code, but then i added other snippets i needed on every page, but not the dt stuff
22

3-
var hmvVersionNo = "6.3.92";
3+
var hmvVersionNo = "6.3.93";
44
// changed from 4.1.43 to 6.2.88, to match number of commits
55

66
// cant be 4.0, has to be like 4.1 or 4.01, as empty zeros will get removes

js/navbar.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

notes/info/index/0 minify.ps1

Lines changed: 260 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,261 @@
1-
Set-Location -Path $PSScriptRoot #C:/Users/ashraaf/Downloads/VScode/hadithmv.github.io/notes/info
1+
# HTML Minification Script
2+
try {
3+
# Store the initial location to return to it at the end if needed
4+
$initialLocation = Get-Location
5+
Set-Location -Path $PSScriptRoot -ErrorAction Stop
6+
$startTime = Get-Date
7+
$processedFiles = 0
8+
$successfulFiles = 0
9+
$failedFiles = 0
10+
}
11+
catch {
12+
Write-Error "Failed to initialize script: $_"
13+
exit 1
14+
}
215

3-
html-minifier --collapse-boolean-attributes --collapse-whitespace --decode-entities --minify-css true --minify-js true --process-scripts [text/html] --remove-attribute-quotes --remove-comments --remove-empty-attributes --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-style-link-type-attributes --remove-tag-whitespace --sort-attributes --sort-class-name --trim-custom-fragments --use-short-doctype index-uc.html -o index.html
16+
function Run-MinifierCommand {
17+
param (
18+
[string]$InputFile,
19+
[string]$OutputFile,
20+
[string[]]$Options
21+
)
22+
23+
try {
24+
Write-Host "DEBUG: Running minifier on: $InputFile" -ForegroundColor Gray
25+
26+
# Create process info
27+
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
28+
$pinfo.FileName = "html-minifier"
29+
$pinfo.RedirectStandardError = $true
30+
$pinfo.RedirectStandardOutput = $true
31+
$pinfo.UseShellExecute = $false
32+
33+
# Build arguments
34+
$args = $Options + @($InputFile, "-o", $OutputFile)
35+
$pinfo.Arguments = $args
36+
37+
# Create and start the process
38+
$p = New-Object System.Diagnostics.Process
39+
$p.StartInfo = $pinfo
40+
$p.Start() | Out-Null
41+
42+
# Wait for the process to exit and capture output
43+
$output = $p.StandardOutput.ReadToEnd()
44+
$errorOutput = $p.StandardError.ReadToEnd()
45+
$p.WaitForExit()
46+
47+
if ($p.ExitCode -ne 0) {
48+
Write-Host "Error executing html-minifier command" -ForegroundColor Red
49+
Write-Host "Error output: $errorOutput" -ForegroundColor Red
50+
return $false
51+
}
52+
53+
# Check file sizes for reporting
54+
$originalSize = (Get-Item $InputFile).Length
55+
$minifiedSize = (Get-Item $OutputFile).Length
56+
$savingsBytes = $originalSize - $minifiedSize
57+
$savingsPercent = if ($originalSize -gt 0) { [math]::Round(($savingsBytes / $originalSize) * 100, 2) } else { 0 }
58+
59+
# Store info for reporting
60+
$script:fileStats += @{
61+
InputFile = $InputFile
62+
OutputFile = $OutputFile
63+
OriginalSize = $originalSize
64+
MinifiedSize = $minifiedSize
65+
SavingsBytes = $savingsBytes
66+
SavingsPercent = $savingsPercent
67+
}
68+
69+
return $true
70+
}
71+
catch {
72+
Write-Host "Exception occurred: $_" -ForegroundColor Red
73+
return $false
74+
}
75+
}
76+
77+
function Process-Files {
78+
param (
79+
[array]$FilesToProcess
80+
)
81+
82+
try {
83+
Write-Host "`n🔄 Starting HTML Minification Process..." -ForegroundColor Cyan
84+
Write-Host "🔍 Found $($FilesToProcess.Count) files to process" -ForegroundColor Cyan
85+
Write-Host "═══════════════════════════════════════════════════" -ForegroundColor DarkGray
86+
87+
$script:fileStats = @()
88+
$totalFiles = $FilesToProcess.Count
89+
$script:processedFiles = 0
90+
$script:successfulFiles = 0
91+
$script:failedFiles = 0
92+
93+
# Process each file
94+
foreach ($file in $FilesToProcess) {
95+
$script:processedFiles++
96+
$percentComplete = [math]::Round(($script:processedFiles / $totalFiles) * 100)
97+
98+
$inputFile = $file.InputFile
99+
$outputFile = $file.OutputFile
100+
$options = $file.Options
101+
102+
$fileName = Split-Path $inputFile -Leaf
103+
104+
Write-Host "[$script:processedFiles/$totalFiles] $percentComplete% " -NoNewline
105+
Write-Host "$fileName " -NoNewline
106+
107+
try {
108+
# Check if file exists
109+
if (-not (Test-Path $inputFile)) {
110+
Write-Host "❌ (File not found)" -ForegroundColor Red
111+
$script:failedFiles++
112+
continue
113+
}
114+
115+
# Run minifier command
116+
$success = Run-MinifierCommand -InputFile $inputFile -OutputFile $outputFile -Options $options
117+
118+
if ($success) {
119+
Write-Host "" -ForegroundColor Green -NoNewline
120+
121+
# Get the last added stats
122+
$stats = $script:fileStats[-1]
123+
Write-Host "(Saved $($stats.SavingsPercent)%, $($stats.SavingsBytes) bytes)" -ForegroundColor Cyan
124+
$script:successfulFiles++
125+
}
126+
else {
127+
Write-Host "❌ (Minification failed)" -ForegroundColor Red
128+
$script:failedFiles++
129+
}
130+
}
131+
catch {
132+
Write-Host "" -ForegroundColor Red
133+
Write-Error "Error processing $fileName : $_"
134+
$script:failedFiles++
135+
}
136+
}
137+
138+
# Display summary for minification
139+
Write-Host "`n═══════════════════════════════════════════════════" -ForegroundColor DarkGray
140+
Write-Host "📊 HTML MINIFICATION SUMMARY" -ForegroundColor Cyan
141+
Write-Host "───────────────────────────────────────────────────" -ForegroundColor DarkGray
142+
143+
# Overall statistics
144+
$totalOriginalSize = ($script:fileStats | Measure-Object -Property OriginalSize -Sum).Sum
145+
$totalMinifiedSize = ($script:fileStats | Measure-Object -Property MinifiedSize -Sum).Sum
146+
$totalSavings = $totalOriginalSize - $totalMinifiedSize
147+
$overallSavingsPercent = if ($totalOriginalSize -gt 0) { [math]::Round(($totalSavings / $totalOriginalSize) * 100, 2) } else { 0 }
148+
149+
Write-Host "📏 Original Size: " -ForegroundColor Cyan -NoNewline
150+
Write-Host "$([math]::Round($totalOriginalSize / 1KB, 2)) KB" -ForegroundColor White
151+
Write-Host "📏 Minified Size: " -ForegroundColor Cyan -NoNewline
152+
Write-Host "$([math]::Round($totalMinifiedSize / 1KB, 2)) KB" -ForegroundColor White
153+
Write-Host "💾 Space Saved: " -ForegroundColor Green -NoNewline
154+
Write-Host "$([math]::Round($totalSavings / 1KB, 2)) KB ($overallSavingsPercent%)" -ForegroundColor White
155+
Write-Host "───────────────────────────────────────────────────" -ForegroundColor DarkGray
156+
Write-Host "✅ Successful: " -ForegroundColor Green -NoNewline
157+
Write-Host "$script:successfulFiles files" -ForegroundColor White
158+
Write-Host "❌ Failed: " -ForegroundColor Red -NoNewline
159+
Write-Host "$script:failedFiles files" -ForegroundColor White
160+
Write-Host "───────────────────────────────────────────────────" -ForegroundColor DarkGray
161+
162+
if ($script:failedFiles -eq 0 -and $script:successfulFiles -gt 0) {
163+
Write-Host "✅ HTML MINIFICATION COMPLETED SUCCESSFULLY ✅" -ForegroundColor Green
164+
return $true
165+
}
166+
elseif ($script:failedFiles -gt 0 -and $script:successfulFiles -gt 0) {
167+
Write-Host "⚠️ HTML MINIFICATION COMPLETED WITH ERRORS ⚠️" -ForegroundColor Yellow
168+
return $true
169+
}
170+
else {
171+
Write-Host "❌ HTML MINIFICATION FAILED ❌" -ForegroundColor Red
172+
return $false
173+
}
174+
}
175+
catch {
176+
Write-Error "HTML minification failed: $_"
177+
return $false
178+
}
179+
}
180+
181+
# Main execution block
182+
try {
183+
# Define the files to process with their options
184+
$filesToProcess = @(
185+
@{
186+
InputFile = "index-uc.html"
187+
OutputFile = "index.html"
188+
Options = @(
189+
"--collapse-boolean-attributes",
190+
"--collapse-whitespace",
191+
"--decode-entities",
192+
"--minify-css", "true",
193+
"--minify-js", "true",
194+
"--process-scripts", "[text/html]",
195+
"--remove-attribute-quotes",
196+
"--remove-comments",
197+
"--remove-empty-attributes",
198+
"--remove-optional-tags",
199+
"--remove-redundant-attributes",
200+
"--remove-script-type-attributes",
201+
"--remove-style-link-type-attributes",
202+
"--remove-tag-whitespace",
203+
"--sort-attributes",
204+
"--sort-class-name",
205+
"--trim-custom-fragments",
206+
"--use-short-doctype"
207+
)
208+
}
209+
# Add more files here as needed, for example:
210+
# @{
211+
# InputFile = "about-uc.html"
212+
# OutputFile = "about.html"
213+
# Options = @( ... same options ... )
214+
# }
215+
)
216+
217+
# Process the files
218+
$success = Process-Files -FilesToProcess $filesToProcess
219+
220+
# Calculate execution time
221+
$endTime = Get-Date
222+
$executionTime = ($endTime - $startTime).TotalSeconds
223+
224+
# Display final summary
225+
Write-Host "`n═══════════════════════════════════════════════════" -ForegroundColor DarkGray
226+
Write-Host "📊 FINAL SUMMARY" -ForegroundColor Cyan
227+
Write-Host "───────────────────────────────────────────────────" -ForegroundColor DarkGray
228+
229+
Write-Host "🕒 Total time: " -ForegroundColor Cyan -NoNewline
230+
Write-Host "$([math]::Round($executionTime, 2)) seconds" -ForegroundColor White
231+
232+
if ($success) {
233+
$totalSavings = ($script:fileStats | Measure-Object -Property SavingsBytes -Sum).Sum
234+
$totalSavingsKB = [math]::Round($totalSavings / 1KB, 2)
235+
236+
Write-Host "💾 Total space saved: " -ForegroundColor Green -NoNewline
237+
Write-Host "$totalSavingsKB KB" -ForegroundColor White
238+
Write-Host "───────────────────────────────────────────────────" -ForegroundColor DarkGray
239+
Write-Host "✅ HTML MINIFICATION COMPLETED SUCCESSFULLY ✅" -ForegroundColor Green
240+
}
241+
else {
242+
Write-Host "───────────────────────────────────────────────────" -ForegroundColor DarkGray
243+
Write-Host "⚠️ HTML MINIFICATION COMPLETED WITH ERRORS ⚠️" -ForegroundColor Yellow
244+
}
245+
246+
# Return to initial location
247+
Set-Location -Path $initialLocation
248+
}
249+
catch {
250+
Write-Host "`n❌ Script execution failed: $_" -ForegroundColor Red
251+
252+
# Try to return to initial location
253+
try {
254+
Set-Location -Path $initialLocation
255+
}
256+
catch {
257+
# Ignore errors when returning to initial location
258+
}
259+
260+
exit 1
261+
}

notes/info/index/index-uc.html

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -899,19 +899,21 @@ <h3 class="iTitle">އެފްރިކާ ބަކަރި</h3>
899899
</div>
900900
<br />
901901
<div class="Pr">
902+
<style>/*
902903
<h3 class="price" onclick="openModal()">
903904
<!-- UDHIYA CHANGE123 -->
904905
<b><s>749/- MVR</s></b>
905906
<!-- <b>949/- MVR</b> -->
906907
</h3>
907908
<br />
909+
*/</style>
908910
<div class="Pr">
909911
<h3 class="price" onclick="openModal()">
910912
<!-- UDHIYA CHANGE123 -->
911-
<b>649/- MVR</b>
912-
<!-- <b>949/- MVR</b> -->
913+
<!-- <b>649/- MVR</b> -->
914+
<b>989/- MVR</b>
913915
</h3>
914-
(Promotional offer for a limited time)
916+
<!-- (Promotional offer for a limited time) -->
915917
</div>
916918
<br />
917919
<hr />
@@ -933,8 +935,8 @@ <h3 class="iTitle">އެފްރިކާ ކަންބަޅި</h3>
933935
<div class="Pr">
934936
<h3 class="price" onclick="openModal()">
935937
<!-- UDHIYA CHANGE123 -->
936-
<b>949/- MVR</b>
937-
<!-- <b>1095/- MVR</b> -->
938+
<!-- <b>949/- MVR</b> -->
939+
<b>1295/- MVR</b>
938940
</h3>
939941
</div>
940942
<br />
@@ -953,28 +955,32 @@ <h3 class="iTitle">ގެރި</h3>
953955
</div>
954956
</div>
955957
<br />
956-
<div class="Pr">
958+
<!-- <div class="Pr">
957959
<h3 class="price" onclick="openModal()">
958960
<b>5650/- MVR</b>
959961
</h3>
960-
</div>
962+
</div> -->
961963
<!-- UDHIYA CHANGE123
964+
-->
962965
<div class="Pr">
963966
<h3 class="price" onclick="openModal()">
964-
<b>1/7th Share 1195/-</b>
967+
<b>1/7th Share 1300/-</b>
965968
</h3>
966969
</div>
967970
<br />
968971
<div class="Pr">
969972
<h3 class="price" onclick="openModal()">
970-
<b>Full Cow 7995/-</b>
973+
<b>Full Cow 8695/-</b>
971974
</h3>
972975
</div>
973-
-->
974976
<!-- -->
975977
<br />
976978
<hr />
979+
977980
<br />
981+
982+
<style>
983+
/*
978984
<div class="flexRow">
979985
<img loading="lazy" width="500" class="flexItem" alt="sadaqa" src="img/camel-africa-500px.webp" />
980986
</div>
@@ -1024,6 +1030,8 @@ <h4>*&#160;Full Cow&#160;*</h4>
10241030
-->
10251031
<br />
10261032
<hr />
1033+
*/
1034+
</style>
10271035
<br />
10281036
<style>
10291037
.showOnClick2 {

notes/info/index/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)