- 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:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
8
editor/no-module-support-redirect.js
Normal file
8
editor/no-module-support-redirect.js
Normal 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');
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user