Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version and move vendor JS into assets/js/vendor/ #2537

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
www/chrome
www/assets/css/vendor
www/assets/js/catchpoint-rum.js
www/assets/js/dygraph-combined.js
www/assets/js/codeflask.module.js
www/assets/js/jquery.js
www/assets/js/prism.js
www/assets/js/vendor
File renamed without changes.
2 changes: 0 additions & 2 deletions www/assets/js/dygraph-combined.js

This file was deleted.

8 changes: 5 additions & 3 deletions www/assets/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ async function initCodeField(source, language = "js") {
return; // already initialized
}
// load Flask
const { default: CodeFlask } = await import("/assets/js/codeflask.module.js");
const { default: CodeFlask } = await import(
"/assets/js/vendor/codeflask-1.4.1.module.js"
);
const originalTextarea = document.getElementById(source);
// editor container
const codeEl = document.createElement("div");
Expand Down Expand Up @@ -311,10 +313,10 @@ async function loadPrism() {
const ss = document.createElement("link");
ss.rel = "stylesheet";
ss.type = "text/css";
ss.href = "/assets/css/vendor/prism.css";
ss.href = "/assets/css/vendor/prism-1.29.0.css";
document.head.appendChild(ss);

// todo: find a Prism distro that is a proper module
await import("/assets/js/prism.js");
await import("/assets/js/vendor/prism-1.29.0.js");
return window.Prism;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion www/footer.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</footer>
<?php
if (!isset($site_js_loaded) || !$site_js_loaded) {
echo "<script src=\"{$GLOBALS['cdnPath']}/assets/js/jquery.js\"></script>\n";
echo "<script src=\"{$GLOBALS['cdnPath']}/assets/js/vendor/jquery-1.7.1.js\"></script>\n";
echo "<script src=\"{$GLOBALS['cdnPath']}/assets/js/site.js?v=" . VER_JS . "\"></script>\n";
$hasJquery = true;
}
Expand Down
2 changes: 1 addition & 1 deletion www/head.inc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ echo "\n</style>\n";
// include the analytics code if it is appropriate
if (!isset($noanalytics)) {
echo "<script>";
require_once WWW_PATH . '/assets/js/catchpoint-rum.js';
require_once WWW_PATH . '/assets/js/vendor/catchpoint-rum.js';
echo "</script>";
}

Expand Down
2 changes: 1 addition & 1 deletion www/templates/layouts/footer.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (!strcasecmp('Test Result', $tab) && (!isset($nosubheader) || !@$nosubheader)

<?php
if (!isset($site_js_loaded) || !$site_js_loaded) {
echo "<script src=\"{$GLOBALS['cdnPath']}/assets/js/jquery.js\"></script>\n";
echo "<script src=\"{$GLOBALS['cdnPath']}/assets/js/vendor/jquery-1.7.1.js\"></script>\n";
echo "<script src=\"{$GLOBALS['cdnPath']}/assets/js/site.js?v=" . constant('VER_JS') . "\"></script>\n";
$hasJquery = true;
}
Expand Down
2 changes: 1 addition & 1 deletion www/templates/layouts/head.inc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ echo "\n</style>\n";
// include the analytics code if it is appropriate
if (!isset($noanalytics)) {
echo '<script>';
require_once __DIR__ . '/../../assets/js/catchpoint-rum.js';
require_once __DIR__ . '/../../assets/js/vendor/catchpoint-rum.js';
echo '</script>';
}

Expand Down