-
Notifications
You must be signed in to change notification settings - Fork 356
Fixes Partial web interface #231 #247
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
Open
tobi01001
wants to merge
1
commit into
jasoncoon:main
Choose a base branch
from
tobi01001:CssJsFallback
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,45 @@ | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>ESP8266 + FastLED</title> | ||
|
||
<!-- request CSS from internet CDN --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-minicolors/2.3.6/jquery.minicolors.min.css" integrity="sha512-BVeRnUOL0G7d4gXmj+0VxpoiQuEibKQtlkclADKvCdNrESs0LA6+H8s1lU455VqWFtHBfF/pKDGw/CMat2hqOg==" crossorigin="anonymous" referrerpolicy="no-referrer" /> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css"> | ||
<!-- Fallback to load resources from FileSystem if not available online --> | ||
<script> | ||
function CssJsFallback(el) { | ||
if (el instanceof HTMLScriptElement || el instanceof HTMLLinkElement) { | ||
let Url = el.getAttribute('data-fallback'); | ||
if (Url) { | ||
henrygab marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if(el instanceof HTMLScriptElement) | ||
{ | ||
document.write('<script src="'+Url+'">\x3C/script>'); | ||
henrygab marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
else | ||
{ | ||
el.setAttribute('href', Url); | ||
} | ||
} | ||
// No integrity check for local resource | ||
let integrity = el.getAttribute('integrity'); | ||
if(integrity) { | ||
el.removeAttribute('integrity'); | ||
} | ||
} | ||
} | ||
</script> | ||
henrygab marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<!-- request CSS from internet CDN or the webserver if internet cannot be reached --> | ||
<link onerror='CssJsFallback(this)' | ||
data-fallback='css/bootstrap-5.1.3.min.css' | ||
rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"/> | ||
<link onerror='CssJsFallback(this)' | ||
data-fallback='css/minicolors-2.3.6.min.css' | ||
rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-minicolors/2.3.6/jquery.minicolors.min.css" | ||
integrity="sha512-BVeRnUOL0G7d4gXmj+0VxpoiQuEibKQtlkclADKvCdNrESs0LA6+H8s1lU455VqWFtHBfF/pKDGw/CMat2hqOg==" crossorigin="anonymous" | ||
referrerpolicy="no-referrer" /> | ||
<link onerror='CssJsFallback(this)' | ||
data-fallback='css/bootstrap-icons-1.7.2.min.css' | ||
rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css"/> | ||
|
||
<!-- request CSS from the ESP8266 web server --> | ||
<!-- request CSS from the ESP8266 web server ONLY --> | ||
<!-- <link rel="stylesheet" href="css/bootstrap-5.1.3.min.css"> --> | ||
<!-- <link rel="stylesheet" href="css/minicolors-2.3.6.min.css"> --> | ||
<!-- <link rel="stylesheet" href="css/bootstrap-icons-1.7.2.min.css"> --> | ||
|
@@ -420,17 +453,41 @@ <h2 class="accordion-header" id="headingImportExport"> | |
</nav> | ||
|
||
<!-- request js from internet CDN --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-minicolors/2.3.6/jquery.minicolors.min.js" integrity="sha512-vBqPkpOdZM0O7YezzE8xaoUdyt4Z2d+gLrY0AMvmNPLdLuNzvreTopyuaM9/FiRzHs1bwWzYDJgH6STcuNXpqg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.min.js" integrity="sha512-B4skI5FiLurS86aioJx9VfozI1wjqrn6aTdJH+YQUmCZum/ZibPBTX55k5d9XM6EsKePDInkLVrN7vPmJxc1qA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js" integrity="sha512-Qlv6VSKh1gDKGoJbnyA5RMXYcvnpIqhO++MhIM2fStMcGT9i2T//tSwYFlcyoRRDcDZ+TYHpH8azBBCyhpSeqw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
|
||
<!-- request js from the ESP8266 web server --> | ||
<script onerror='CssJsFallback(this)' | ||
data-fallback='js/jquery-3.6.0.min.js' | ||
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" | ||
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" | ||
crossorigin="anonymous" | ||
referrerpolicy="no-referrer"></script> | ||
<script onerror='CssJsFallback(this)' | ||
data-fallback='js/bootstrap-5.1.3.min.js' | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" | ||
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" | ||
crossorigin="anonymous"></script> | ||
<script onerror='CssJsFallback(this)' | ||
data-fallback='js/jquery.minicolors-2.3.6.min.js' | ||
src="https://cdnjs.cloudflare.com/ajax/libs/jquery-minicolors/2.3.6/jquery.minicolors.min.js" | ||
integrity="sha512-vBqPkpOdZM0O7YezzE8xaoUdyt4Z2d+gLrY0AMvmNPLdLuNzvreTopyuaM9/FiRzHs1bwWzYDJgH6STcuNXpqg==" | ||
crossorigin="anonymous" | ||
referrerpolicy="no-referrer"></script> | ||
<!-- Websocket currently not implemented --> | ||
<!-- <script onerror='CssJsFallback(this)' | ||
data-fallback='js/r-websocket-1.0.0.min.js' | ||
src="https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.min.js" | ||
integrity="sha512-B4skI5FiLurS86aioJx9VfozI1wjqrn6aTdJH+YQUmCZum/ZibPBTX55k5d9XM6EsKePDInkLVrN7vPmJxc1qA==" | ||
crossorigin="anonymous" referrerpolicy="no-referrer"></script> --> | ||
<script onerror='CssJsFallback(this)' | ||
data-fallback='js/FileSaver-2.0.5.min.js' | ||
src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js" | ||
integrity="sha512-Qlv6VSKh1gDKGoJbnyA5RMXYcvnpIqhO++MhIM2fStMcGT9i2T//tSwYFlcyoRRDcDZ+TYHpH8azBBCyhpSeqw==" | ||
crossorigin="anonymous" | ||
referrerpolicy="no-referrer"></script> | ||
|
||
<!-- request js from the ESP8266 web server ONLY --> | ||
<!-- <script src="js/jquery-3.6.0.min.js"></script> --> | ||
<!-- <script src="js/bootstrap-5.1.3.min.js"></script> --> | ||
<!-- <script src="js/jquery.minicolors-2.3.6.min.js"></script> --> | ||
<!-- <script src="js/r-websocket-1.0.0.min.js"></script> --> | ||
<!-- Websocket currently not implemented --> <!-- <script src="js/r-websocket-1.0.0.min.js"></script> --> | ||
<!-- <script src="js/FileSaver-2.0.5.min.js"></script> --> | ||
|
||
<script src="js/app.js"></script> | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,37 @@ | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>ESP8266 + FastLED by Evil Genius Labs</title> | ||
|
||
<!-- request CSS from internet CDN --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | ||
|
||
<!-- request CSS from the ESP8266 web server --> | ||
<script> | ||
function CssJsFallback(el) { | ||
if (el instanceof HTMLScriptElement || el instanceof HTMLLinkElement) { | ||
let Url = el.getAttribute('data-fallback'); | ||
if (Url) { | ||
if(el instanceof HTMLScriptElement) | ||
{ | ||
document.write('<script src="'+Url+'">\x3C/script>'); | ||
} | ||
else | ||
{ | ||
el.setAttribute('href', Url); | ||
} | ||
} | ||
// No integrity check for local resource | ||
let integrity = el.getAttribute('integrity'); | ||
if(integrity) { | ||
el.removeAttribute('integrity'); | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<!-- request CSS from internet CDN or the webserver if internet cannot be reached --> | ||
<link onerror='CssJsFallback(this)' | ||
data-fallback='css/bootstrap-5.1.3.min.css' | ||
rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"/> | ||
|
||
<!-- request CSS from the ESP8266 web server ONLY --> | ||
<!-- <link rel="stylesheet" href="css/bootstrap-5.1.3.min.css"> --> | ||
|
||
<link rel="stylesheet" href="css/styles.css"> | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,36 @@ | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>ESP8266 + FastLED by Evil Genius Labs</title> | ||
|
||
<!-- request CSS from internet CDN --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | ||
|
||
<!-- request CSS from the ESP8266 web server --> | ||
<script> | ||
function CssJsFallback(el) { | ||
if (el instanceof HTMLScriptElement || el instanceof HTMLLinkElement) { | ||
let Url = el.getAttribute('data-fallback'); | ||
if (Url) { | ||
if(el instanceof HTMLScriptElement) | ||
{ | ||
document.write('<script src="'+Url+'">\x3C/script>'); | ||
} | ||
else | ||
{ | ||
el.setAttribute('href', Url); | ||
} | ||
} | ||
// No integrity check for local resource | ||
let integrity = el.getAttribute('integrity'); | ||
if(integrity) { | ||
el.removeAttribute('integrity'); | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<!-- request CSS from internet CDN or the webserver if internet cannot be reached --> | ||
<link onerror='CssJsFallback(this)' | ||
data-fallback='css/bootstrap-5.1.3.min.css' | ||
rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"/> | ||
|
||
<!-- request CSS from the ESP8266 web server ONLY --> | ||
<!-- <link rel="stylesheet" href="css/bootstrap-5.1.3.min.css"> --> | ||
|
||
<link rel="stylesheet" href="css/simple.css"> | ||
|
@@ -44,8 +70,21 @@ | |
</div> | ||
|
||
<!-- request js from internet CDN --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> | ||
<script | ||
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" | ||
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" | ||
crossorigin="anonymous" | ||
referrerpolicy="no-referrer" | ||
onerror='CssJsFallback(this)' | ||
data-fallback='js/jquery-3.1.1.min.js'> | ||
</script> | ||
<script | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" | ||
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" | ||
crossorigin="anonymous" | ||
onerror='CssJsFallback(this)' | ||
data-fallback='js/bootstrap-5.1.3.min.js'> | ||
</script> | ||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.min.js" integrity="sha512-B4skI5FiLurS86aioJx9VfozI1wjqrn6aTdJH+YQUmCZum/ZibPBTX55k5d9XM6EsKePDInkLVrN7vPmJxc1qA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> --> | ||
|
||
<!-- request js from the ESP8266 web server --> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question:
Would it make sense to have a common
.js
file, which has the common script functions?