Skip to content

Commit

Permalink
cdn rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
btopro committed Aug 23, 2024
1 parent 1ef6374 commit fcde928
Show file tree
Hide file tree
Showing 46 changed files with 614 additions and 0 deletions.
Binary file added cdn/assets/android-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/android-icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/android-icon-36x36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/android-icon-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/android-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/android-icon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/apple-icon-114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/apple-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/apple-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/apple-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/apple-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/apple-icon-57x57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/apple-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/apple-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/apple-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/apple-icon-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/apple-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions cdn/assets/babel-bottom.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 105 additions & 0 deletions cdn/assets/babel-top.js

Large diffs are not rendered by default.

Binary file added cdn/assets/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/favicon.ico
Binary file not shown.
Binary file added cdn/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/ms-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/ms-icon-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/ms-icon-310x310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cdn/assets/ms-icon-70x70.png
Binary file added cdn/assets/pwa-icon.png
136 changes: 136 additions & 0 deletions cdn/assets/upgrade-browser.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Modern browser required</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" crossorigin>
<style>
body {
margin: 0;
min-height: 100vh;
}
.header--lg {
color: #444;
font-size: 1.75rem;
font-weight: bold;
padding: 10px;
margin: 0;
}

.check-browser {
text-align: center;
padding: 1rem;
}

.check-browser .message--warning {
background-color: #BB0000;
color: #ffffff;
padding: 2rem;
font-size: 26px;
}

.check-browser__icon-container {
display: inline-block;
color: #000000;
text-align: center;
}

a {
float: left;
width: 150px;
height: 150px;
display: block;
text-decoration: none;
margin: 1rem .5rem;
padding: 0;
outline-width: 10px;
outline-color: blueviolet;
color: black;
}

a .check-browser__icon {
clear: both;
padding: 2.5rem 2rem;
text-decoration: none;
}

.check-browser--chrome {
background-color: #ffb31a;
}

.check-browser--firefox {
background-color: #f78009;
}

.check-browser--edge {
background-color: #33ccff;
}

.check-browser--safari {
background-color: #0099ff;
}

.check-browser--opera {
background-color: #ff4d4d;
}

.icon--browser {
color: #fff;
font-size: 3rem;
padding-bottom: 1rem;
}
</style>
</head>
<body>
<div class="check-browser">
<h1 class="header--lg">Outdated browser detected</h1>

<p class="message--warning">
This website requires a modern browser to give the best experience possible.
</p>
<p>
Upgrade your browser to the latest version or download one of these browsers:
</p>

<div class="check-browser__icon-container">
<a href="http://www.mozilla.com/firefox" target="_blank" rel="noopener noreferrer">
<div class="check-browser__icon check-browser--firefox">
<span><i class="fa fa-firefox icon--browser"></i></span>
<br>Firefox
<br>(Mozilla)
</div>
</a>
<a href="https://www.google.com/chrome" target="_blank" rel="noopener noreferrer">
<div class="check-browser__icon check-browser--chrome">
<span><i class="fa fa-chrome icon--browser"></i></span>
<br>
Chrome
<br>(Google)
</div>
</a>
<a href="https://www.microsoftedgeinsider.com/en-us/" target="_blank" rel="noopener noreferrer">
<div class="check-browser__icon check-browser--edge">
<span><i class="fa fa-edge icon--browser"></i></span>
<br>Edge
<br>(Microsoft)
</div>
</a>
<a href="https://support.apple.com/downloads/safari" target="_blank" rel="noopener noreferrer">
<div class="check-browser__icon check-browser--safari">
<span><i class="fa fa-safari icon--browser"></i></span>
<br>Safari
<br>(Apple)
</div>
</a>
<a href="http://www.opera.com/download/">
<div class="check-browser__icon check-browser--opera" target="_blank" rel="noopener noreferrer">
<span><i class="fa fa-opera icon--browser"></i></span>

<br> Opera
<br> &nbsp;
</div>
</a>
</div>
</div>
</body>
</html>
130 changes: 130 additions & 0 deletions cdn/build-haxcms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
// overload how define works so that we can prevent bricking issues
// when classes get loaded from multiple sources with the same name space
// this is a copy of the dedup-fix.js script we use in local testing / es5 routines
const _customElementsDefine = window.customElements.define;
window.customElements.define = (name, cl, conf) => {
if (!customElements.get(name)) {
_customElementsDefine.call(window.customElements, name, cl, conf);
} else {
console.warn(`${name} has been defined twice`);
}
};
// HAXcms specific clean up and platforn integration
// this ties in custom theme files as well as removes DOM nodes related
// to serving a legacy audience in the event this is evergreen (most times)
if (/^h/.test(document.location)) {
try {
var scriptDef = document.getElementsByTagName('script')[0];
// if a dynamic import fails, we bail over to the compiled version
new Function('import("");');
// remove fallback cause if we passed dynamic import then we are evergreen
if (document.getElementById("haxcmsoutdatedfallback")) {
document.body.removeChild(document.getElementById("haxcmsoutdatedfallback"));
}
if (!window.__appCustomEnv) {
var build2 = document.createElement('script');
build2.src = './custom/build/custom.es6.js';
build2.type = 'module';
scriptDef.parentNode.insertBefore(build2, scriptDef);
}
} catch (err) {
var ancient=false;
try {
if (typeof Symbol == "undefined") { // IE 11, at least try to serve a watered down site
ancient = true;
}
new Function('let a;'); // bizarre but needed for Safari 9 bc of when it was made
}
catch (err) {
ancient = true;
}
if (!ancient) {
// remove fallback cause if we passed dynamic import then we are evergreen
if (document.getElementById("haxcmsoutdatedfallback")) {
document.body.removeChild(document.getElementById("haxcmsoutdatedfallback"));
}
}
else {
// we bombed somewhere above, this implies that it's some odd between version
// most likely Safari 9ish, IE pre 11 and anything uber old. Serve no JS variation
if (document.getElementById('site')) {
document.getElementById('site').style.display = 'none';
document.getElementById('haxcmsoutdatedfallbacksuperold').style.display = 'block';
}
}
}
} else {
// this implies we are offline, viewing the files locally
// so let's show the simplistic site viewer / iframe theme
if (document.getElementById('site')) {
document.getElementById('site').style.display = 'none';
document.getElementById('haxcmsoutdatedfallbacksuperold').style.display = 'block';
}
}
var cdn = "./";
if (window.__appCDN) {
cdn = window.__appCDN;
}
// reset styles that we apply to all hax sites for some level of normalization
// across base HTML tags as well as css vars for styling system wide things from 1 place
var baseResetStyles = 'build/es6/node_modules/@haxtheweb/haxcms-elements/lib/base.css';
// css files load faster when implemented this way
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = cdn + baseResetStyles;
link.type = 'text/css';
link.onerror = (e) => { haxcmsFallbackStylesError(e);};
// get first link in the document
var linkDef = document.getElementsByTagName('link')[0];
linkDef.parentNode.insertBefore(link, linkDef);
if (!window.__appCustomEnv) {
var link2 = document.createElement('link');
link2.rel = 'stylesheet';
link2.href = './theme/theme.css';
link2.type = 'text/css';
linkDef.parentNode.insertBefore(link2, linkDef);
}
// if we fail to load the module, we need to fall back to known sources
// and reattempt to inject the CDN location. This is a last ditch effort
// though opens the ability for us to download user sites and if plugged
// into other hax housing then it'll work but also just work stand alone
// as a downloaded package
var haxCdn = cdn;
function haxcmsFallbackStylesError(e) {
var cdn = haxCdn;
if (!window.__appCDNBlockFallback) {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.onerror = (e) => { haxcmsFallbackStylesError(e);};
// if the module fails to load at the set CDN location, try to fail back to known sources
if (cdn === "./") {
// hax cloud fallback
haxCdn = "https://cdn.hax.cloud/cdn/";
link.href = haxCdn + baseResetStyles;
linkDef.parentNode.insertBefore(link, linkDef);
console.warn(cdn + " failed to respond, styles back to alternative: " + haxCdn);
}
else if (cdn === "https://cdn.hax.cloud/cdn/") {
// psu mirror
haxCdn = "https://cdn.webcomponents.psu.edu/cdn/";
link.href = haxCdn + baseResetStyles;
linkDef.parentNode.insertBefore(link, linkDef);
console.warn(cdn + " failed to respond, styles back to alternative: " + haxCdn);
}
else if (cdn === "https://cdn.webcomponents.psu.edu/cdn/") {
// known mirror
haxCdn = "https://cdn.waxam.io/";
link.href = haxCdn + baseResetStyles;
linkDef.parentNode.insertBefore(link, linkDef);
console.warn(cdn + " failed to respond, styles back to alternative: " + haxCdn);
}
else {
// :( we're out of options, just reset these values to default
// but we aren't working in this scenario bc both CDNs failed
// and local delivery could not be found
haxCdn = "./";
console.error("Styles Local delivery failed and all alternative CDNs failed to load. You might be offline, in a secure environment or doing testing intentionally to generate this *shrug*");
}
}
}
1 change: 1 addition & 0 deletions cdn/build-legacy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cdn/build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cdn/build/es6/build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cdn/build/es6/dist/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import"./build-cms.js";
1 change: 1 addition & 0 deletions cdn/build/es6/dist/build-cms.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fcde928

Please sign in to comment.