Skip to content

Commit 71debb3

Browse files
authored
refactor scripts (#468)
1 parent 563a0d9 commit 71debb3

File tree

3 files changed

+15
-25
lines changed

3 files changed

+15
-25
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
"copyFiles": [
1212
{
1313
"from": "node_modules/jquery/dist/jquery.min.js",
14-
"to": "webroot/js/jquery-3.7.1.min.js"
14+
"to": "webroot/js/jquery.min.js"
1515
},
1616
{
1717
"from": "node_modules/ckeditor5/dist/browser/ckeditor5.umd.js",
18-
"to": "webroot/js/ckeditor5-47.3.0.min.js"
18+
"to": "webroot/js/ckeditor5.umd.js"
1919
},
2020
{
2121
"from": "node_modules/ckeditor5/dist/browser/ckeditor5.css",
22-
"to": "webroot/css/ckeditor5-47.3.0.css"
22+
"to": "webroot/css/ckeditor5.css"
2323
}
2424
]
2525
}

resources/templates/footer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</body>
3232
<?php
3333
foreach (["filter", "sort", "global-late", "tables", "messages"] as $x) {
34-
$url = getURL("js/$x.js?v=" . CONFIG["upstream"]["version"]);
34+
$url = getURL("js/$x.js?cache_bust_increment_me=" . CONFIG["upstream"]["version"]);
3535
echo "<script src='$url'></script>";
3636
}
3737
?>

resources/templates/header.php

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,12 @@
3636
<html lang="en">
3737

3838
<head>
39-
<script
40-
src="<?php echo getURL("js/jquery-3.7.1.min.js"); ?>"
41-
integrity="sha384-1H217gwSVyLSIfaLxHbE7dRb3v4mYCKbpQvzx0cegeju1MVsGrX5xXxAvs/HgeFs"
42-
crossorigin="anonymous"
43-
>
44-
</script>
45-
<script
46-
src="<?php echo getURL("js/ckeditor5-47.3.0.min.js"); ?>"
47-
integrity="sha384-vfrZDzuxNDOwwU8jB6WLBRm2Y37beBm82JEKPRi7i0ntHlWOiXcKCD/d9TEJldOb"
48-
crossorigin="anonymous"
49-
>
50-
</script>
51-
<link rel='stylesheet' type='text/css' href='<?php echo getURL("css/ckeditor5-47.3.0.css") ?>' />
39+
<?php
40+
foreach (["jquery.min", "global-early", "ckeditor5.umd"] as $x) {
41+
$url = getURL("js/$x.js?cache_bust_increment_me=" . CONFIG["upstream"]["version"]);
42+
echo "<script src='$url'></script>";
43+
}
44+
?>
5245
<style>
5346
<?php
5447
// set global css variables from branding
@@ -61,8 +54,8 @@
6154
</style>
6255

6356
<?php
64-
foreach (["global", "navbar", "modal", "tables", "filters", "messages"] as $x) {
65-
$url = getURL("css/$x.css?v=" . CONFIG["upstream"]["version"]);
57+
foreach (["global", "navbar", "modal", "tables", "filters", "messages", "ckeditor5"] as $x) {
58+
$url = getURL("css/$x.css?cache_bust_increment_me=" . CONFIG["upstream"]["version"]);
6659
echo "<link rel='stylesheet' type='text/css' href='$url' />";
6760
}
6861
?>
@@ -142,12 +135,9 @@
142135
<div class="modalBody"></div>
143136
</div>
144137
</div>
145-
<?php
146-
foreach (["modal", "global-early"] as $x) {
147-
$url = getURL("js/$x.js?v=" . CONFIG["upstream"]["version"]);
148-
echo "<script src='$url'></script>";
149-
}
150-
?>
138+
<script
139+
src="<?php echo getURL("js/modal.js?cache_bust_increment_me=" . CONFIG["upstream"]["version"]) ?>"
140+
></script>
151141
<main>
152142

153143
<?php

0 commit comments

Comments
 (0)