- Enhancement: For anyone visiting the ES6 modules entrance file without ESM

support, redirect to non-modular vesion
- Build: Add comment not to edit xdomain editor directly
This commit is contained in:
Brett Zamir
2018-10-24 10:55:46 +08:00
parent 25f02d99f2
commit 4a0889c7e5
12 changed files with 67 additions and 19 deletions

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8" />
<title>-</title>
<link rel="icon" type="image/png" href="../../images/logo.png"/>
<script nomodule="" src="no-module-support-redirect.js"></script>
<script src="../../jquery.min.js"></script>
<script src="../../external/@babel/polyfill/polyfill.min.js"></script>
<script type="module" src="index.js"></script>

View File

@@ -5,6 +5,7 @@
<meta charset="utf-8" />
<title>-</title>
<link rel="icon" type="image/png" href="../../images/logo.png"/>
<script src="../../jquery.min.js"></script>
<script src="../../external/@babel/polyfill/polyfill.min.js"></script>
<script defer="defer" src="../../../dist/extensions/imagelib/index.js"></script>

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>-</title>
<link rel="icon" type="image/png" href="../../images/logo.png"/>
<script nomodule="" src="no-module-support-redirect.js"></script>
<script src="../../external/dom-polyfill/dom-polyfill.js"></script>
<script src="../../external/@babel/polyfill/polyfill.min.js"></script>
<script type="module" src="openclipart.js"></script>

View File

@@ -5,6 +5,7 @@
<meta charset="utf-8">
<title>-</title>
<link rel="icon" type="image/png" href="../../images/logo.png"/>
<script src="../../../dist/dom-polyfill.js"></script>
<script src="../../external/@babel/polyfill/polyfill.min.js"></script>
<script defer="defer" src="../../../dist/extensions/imagelib/openclipart.js"></script>

View File

@@ -0,0 +1,8 @@
// This file should only load if the user's browser doesn't support ESM
// This file will be stripped from the non-modular versions
// We only need to replace the first instance
location.href = location.href
.replace(/(xdomain-)?svg-editor-es\.html/, 'svg-editor.html')
.replace('openclipart-es.html', 'openclipart.html')
.replace('imagelib/index-es.html', 'imagelib/index.html');

View File

@@ -15,6 +15,7 @@
<!{else}-->
<script src="jquery.min.js"></script>
<!--{endif}-->
<script nomodule="" src="no-module-support-redirect.js"></script>
<!-- We keep this next module external to avoid the need to
load further scripts if not supported -->
<script type="module" src="redirect-on-lacking-support.js"></script>

View File

@@ -16,6 +16,7 @@
<!{else}-->
<script src="jquery.min.js"></script>
<!--{endif}-->
<!-- We keep this next module external to avoid the need to
load further scripts if not supported -->
<script defer="defer" src="../dist/redirect-on-lacking-support.js"></script>

View File

@@ -1,4 +1,5 @@
<!DOCTYPE html>
<!-- AUTO-GENERATED FROM svg-editor-es.html; DO NOT EDIT; use build-html.js to build -->
<html>
<head>
<meta charset="utf-8"/>
@@ -15,6 +16,7 @@
<!{else}-->
<script src="jquery.min.js"></script>
<!--{endif}-->
<script nomodule="" src="no-module-support-redirect.js"></script>
<!-- We keep this next module external to avoid the need to
load further scripts if not supported -->
<script type="module" src="redirect-on-lacking-support.js"></script>

View File

@@ -16,6 +16,7 @@
<!{else}-->
<script src="jquery.min.js"></script>
<!--{endif}-->
<!-- We keep this next module external to avoid the need to
load further scripts if not supported -->
<script defer="defer" src="../dist/redirect-on-lacking-support.js"></script>