-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperl21.pl
82 lines (71 loc) · 2.23 KB
/
perl21.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/perl
use strict;
use warnings;
# Update HTML
my $html_file = 'index_integrated_2.html';
my $html_content = do {
local $/;
open my $fh, '<', $html_file or die "Can't open $html_file: $!";
<$fh>
};
# Replace head section
$html_content =~ s{<head>.*?</head>}{<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ApproVideo - DIY Solutions Portal</title>
<!-- Load Tailwind first -->
<script src="https://cdn.tailwindcss.com"></script>
<script>
window.tailwind.config = {
darkMode: 'class',
theme: {
extend: {},
},
plugins: [],
}
</script>
<!-- Other resources -->
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link href="stylenew.css" rel="stylesheet">
<!-- Load Supabase -->
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
</head>}s;
# Write updated HTML
open my $html_out, '>', $html_file or die "Can't write to $html_file: $!";
print $html_out $html_content;
close $html_out;
# Update JS
my $js_file = 'index_integrated_2.js';
my $js_content = do {
local $/;
open my $fh, '<', $js_file or die "Can't open $js_file: $!";
<$fh>
};
# Add initialization wrapper
$js_content = qq{document.addEventListener('DOMContentLoaded', async () => {
// Wait for external resources to load
await Promise.all([
new Promise(resolve => {
if (window.tailwind) resolve();
else window.addEventListener('load', resolve);
}),
new Promise(resolve => {
if (window.supabase) resolve();
else window.addEventListener('load', resolve);
})
]);
try {
// Initialize your classes
const mondrianGrid = new MondrianGrid();
const videoPortal = new PublicVideoPortal();
const categoryManager = new CategoryManager();
} catch (error) {
console.error('Initialization error:', error);
}
});\n\n} . $js_content;
# Write updated JS
open my $js_out, '>', $js_file or die "Can't write to $js_file: $!";
print $js_out $js_content;
close $js_out;
print "Files updated successfully.\n";