Skip to content

Commit

Permalink
better ES5 support
Browse files Browse the repository at this point in the history
though we're kinda hitting a ceiling of support on it because... reasons.
  • Loading branch information
btopro committed Feb 25, 2019
1 parent cf49148 commit 46a9707
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
6 changes: 3 additions & 3 deletions dist/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
<body>
<haxcms-site-builder file="site.json"><div>HAXcms</div><div>loading<div></haxcms-site-builder>
<noscript>Please enable JavaScript to view this website.</noscript>
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script async src="node_modules/web-animations-js/web-animations-next-lite.min.js"></script>
<script async src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script type="module" src="dist/build.js"></script>
<script>
// set this in order to simulate the published form of the site
Expand All @@ -102,11 +102,11 @@
}
};
// append global base styles
let link = document.createElement('link');
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'node_modules/@lrnwebcomponents/haxcms-elements/lib/base.css';
link.type = 'text/css';
let def = document.getElementsByTagName('link')[0];
var def = document.getElementsByTagName('link')[0];
def.parentNode.insertBefore(link, def);
</script>
</body>
Expand Down
20 changes: 10 additions & 10 deletions system/boilerplate/cdns/cdn.waxam.io.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
registration.onupdatefound = function () {
// The updatefound event implies that registration.installing is set; see
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-container-updatefound-event
const installingWorker = registration.installing;
var installingWorker = registration.installing;
installingWorker.onstatechange = function () {
switch (installingWorker.state) {
case 'installed':
Expand Down Expand Up @@ -111,10 +111,10 @@
if (navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.onstatechange = function(event) {
if (event.target.state === 'redundant') {
let b = document.createElement('paper-button');
var b = document.createElement('paper-button');
b.appendChild(document.createTextNode('Reload'));
b.raised = true;
b.addEventListener('click', (e) => { window.location.reload(true); });
b.addEventListener('click', function(e){ window.location.reload(true); });
window.dispatchEvent(new CustomEvent("simple-toast-show", {
bubbles: true,
cancelable: false,
Expand Down Expand Up @@ -165,15 +165,15 @@
<body>
<haxcms-site-builder file="site.json"><div>{{ title }}</div><div>loading<div></haxcms-site-builder>
<noscript>Please enable JavaScript to view this website.</noscript>
<script async src="https://cdn.waxam.io/build/es6/node_modules/web-animations-js/web-animations-next-lite.min.js"></script>
<script async src="https://cdn.waxam.io/build/es6/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="https://cdn.waxam.io/assets/babel-top.js"></script>
<script src="https://cdn.waxam.io/assets/babel-bottom.js"></script>
<script>function supportsImports() { try { new Function('import("")'); return true; } catch (err) { return false; } }</script>
<script nomodule>window.nomodule = true;</script>
<script>if (!window.customElements) { document.write("<!--") }</script>
<script src="https://cdn.waxam.io/build/es6/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
<!--! do not remove -->
<script src="https://cdn.waxam.io/build/es6/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script async src="https://cdn.waxam.io/build/es6/node_modules/web-animations-js/web-animations-next-lite.min.js"></script>
<script src="https://cdn.waxam.io/assets/babel-bottom.js"></script>
<script>function supportsImports() { try { new Function('import("")'); return true; } catch (err) { return false; } }</script>
<script nomodule>window.nomodule = true;</script>
<script>
// anything not supporting modules needs to use es5 and amd
// anything supporting modules at this point also supports ES2015 spec!
Expand All @@ -188,11 +188,11 @@
// indicate to HAXcms this is PUBLISHED
window.__haxCMSContextPublished = true;
// append global base styles
let link = document.createElement('link');
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://cdn.waxam.io/build/es6/node_modules/@lrnwebcomponents/haxcms-elements/lib/base.css';
link.type = 'text/css';
let def = document.getElementsByTagName('link')[0];
var def = document.getElementsByTagName('link')[0];
def.parentNode.insertBefore(link, def);
</script>
</body>
Expand Down
22 changes: 11 additions & 11 deletions system/boilerplate/cdns/haxtheweb.org.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
registration.onupdatefound = function () {
// The updatefound event implies that registration.installing is set; see
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-container-updatefound-event
const installingWorker = registration.installing;
var installingWorker = registration.installing;
installingWorker.onstatechange = function () {
switch (installingWorker.state) {
case 'installed':
Expand Down Expand Up @@ -111,10 +111,10 @@
if (navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.onstatechange = function (event) {
if (event.target.state === 'redundant') {
let b = document.createElement('paper-button');
var b = document.createElement('paper-button');
b.appendChild(document.createTextNode('Reload'));
b.raised = true;
b.addEventListener('click', (e) => { window.location.reload(true); });
b.addEventListener('click', function(e) { window.location.reload(true); });
window.dispatchEvent(new CustomEvent("simple-toast-show", {
bubbles: true,
cancelable: false,
Expand Down Expand Up @@ -165,15 +165,15 @@
<body>
<haxcms-site-builder file="site.json"><div>{{ title }}</div><div>loading<div></haxcms-site-builder>
<noscript>Please enable JavaScript to view this website.</noscript>
<script async src="https://cdn.waxam.io/build/es6/node_modules/web-animations-js/web-animations-next-lite.min.js"></script>
<script async src="https://cdn.waxam.io/build/es6/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="https://cdn.waxam.io/assets/babel-top.js"></script>
<script src="https://cdn.waxam.io/assets/babel-bottom.js"></script>
<script>function supportsImports() { try { new Function('import("")'); return true; } catch (err) { return false; } }</script>
<script nomodule>window.nomodule = true;</script>
<script>if (!window.customElements) { document.write("<!--") }</script>
<script src="https://cdn.waxam.io/build/es6/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
<!--! do not remove -->
<script src="https://cdn.waxam.io/build/es6/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script async src="https://cdn.waxam.io/build/es6/node_modules/web-animations-js/web-animations-next-lite.min.js"></script>
<script src="https://cdn.waxam.io/assets/babel-bottom.js"></script>
<script>function supportsImports() { try { new Function('import("")'); return true; } catch (err) { return false; } }</script>
<script nomodule>window.nomodule = true;</script>
<script>
// anything not supporting modules needs to use es5 and amd
// anything supporting modules at this point also supports ES2015 spec!
Expand All @@ -185,14 +185,14 @@
<script type="module" src="https://cdn.waxam.io/build/es6/dist/build.js"></script>
<!--! do not remove -->
<script>
// indicate to HAXcms this is a demo
// indicate to HAXcms this is a DEMO
window.__haxCMSContextDemo = true;
// append global base styles
let link = document.createElement('link');
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://cdn.waxam.io/build/es6/node_modules/@lrnwebcomponents/haxcms-elements/lib/base.css';
link.type = 'text/css';
let def = document.getElementsByTagName('link')[0];
var def = document.getElementsByTagName('link')[0];
def.parentNode.insertBefore(link, def);
// this is in order to fake a connection for development purposes
window.appSettings = {
Expand Down
20 changes: 10 additions & 10 deletions system/boilerplate/cdns/webcomponents.psu.edu.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
registration.onupdatefound = function () {
// The updatefound event implies that registration.installing is set; see
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-container-updatefound-event
const installingWorker = registration.installing;
var installingWorker = registration.installing;
installingWorker.onstatechange = function () {
switch (installingWorker.state) {
case 'installed':
Expand Down Expand Up @@ -111,10 +111,10 @@
if (navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.onstatechange = function (event) {
if (event.target.state === 'redundant') {
let b = document.createElement('paper-button');
var b = document.createElement('paper-button');
b.appendChild(document.createTextNode('Reload'));
b.raised = true;
b.addEventListener('click', (e) => { window.location.reload(true); });
b.addEventListener('click', function (e) { window.location.reload(true); });
window.dispatchEvent(new CustomEvent("simple-toast-show", {
bubbles: true,
cancelable: false,
Expand Down Expand Up @@ -165,15 +165,15 @@
<body>
<haxcms-site-builder file="site.json"><div>{{ title }}</div><div>loading<div></haxcms-site-builder>
<noscript>Please enable JavaScript to view this website.</noscript>
<script async src="https://webcomponents.psu.edu/cdn/build/es6/node_modules/web-animations-js/web-animations-next-lite.min.js"></script>
<script async src="https://webcomponents.psu.edu/cdn/build/es6/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="https://webcomponents.psu.edu/cdn/assets/babel-top.js"></script>
<script src="https://webcomponents.psu.edu/cdn/assets/babel-bottom.js"></script>
<script>function supportsImports() { try { new Function('import("")'); return true; } catch (err) { return false; } }</script>
<script nomodule>window.nomodule = true;</script>
<script>if (!window.customElements) { document.write("<!--") }</script>
<script src="https://webcomponents.psu.edu/cdn/build/es6/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
<!--! do not remove -->
<script src="https://webcomponents.psu.edu/cdn/build/es6/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script async src="https://webcomponents.psu.edu/cdn/build/es6/node_modules/web-animations-js/web-animations-next-lite.min.js"></script>
<script src="https://webcomponents.psu.edu/cdn/assets/babel-bottom.js"></script>
<script>function supportsImports() { try { new Function('import("")'); return true; } catch (err) { return false; } }</script>
<script nomodule>window.nomodule = true;</script>
<script>
if (window.nomodule || !supportsImports()) {
define(["https://webcomponents.psu.edu/cdn/build/es5-amd/dist/build.js"], function () { "use strict" });
Expand All @@ -186,11 +186,11 @@
// indicate to HAXcms this is PUBLISHED
window.__haxCMSContextPublished = true;
// append global base styles
let link = document.createElement('link');
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://webcomponents.psu.edu/cdn/build/es6/node_modules/@lrnwebcomponents/haxcms-elements/lib/base.css';
link.type = 'text/css';
let def = document.getElementsByTagName('link')[0];
var def = document.getElementsByTagName('link')[0];
def.parentNode.insertBefore(link, def);
</script>
</body>
Expand Down

0 comments on commit 46a9707

Please sign in to comment.