[KiRi] Added check for local file system fail
We then explain why is failing
This commit is contained in:
parent
cdad14bd36
commit
0a121cf5a1
|
|
@ -16,6 +16,10 @@
|
||||||
<span>Server is offline, waiting ...</span>
|
<span>Server is offline, waiting ...</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="no_file_access" style="display: none; ">
|
||||||
|
<span>The browser can't read local files. Enable it to continue. I.e. use <i>--allow-file-access-from-files</i> on Chrome</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- User Interface -->
|
<!-- User Interface -->
|
||||||
<div id="main_ui" class="container fill no-gutters ui-style">
|
<div id="main_ui" class="container fill no-gutters ui-style">
|
||||||
<div class="row fill align-items-start no-gutters ui-row-style">
|
<div class="row fill align-items-start no-gutters ui-row-style">
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ label#layers, label#pages {
|
||||||
vertical-align:top;
|
vertical-align:top;
|
||||||
}
|
}
|
||||||
|
|
||||||
#server_offline {
|
#server_offline, #no_file_access {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
display: none;
|
display: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -213,7 +213,7 @@ label#layers, label#pages {
|
||||||
line-height: 100%;
|
line-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#server_offline span {
|
#server_offline, #no_file_access span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
|
|
|
||||||
|
|
@ -1040,6 +1040,15 @@ var old_server_status = -1;
|
||||||
|
|
||||||
function check_server_status()
|
function check_server_status()
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
|
loadFile("project");
|
||||||
|
} catch(error) {
|
||||||
|
if (window.location.protocol === "file:") {
|
||||||
|
no_file_access();
|
||||||
|
}
|
||||||
|
throw(error);
|
||||||
|
}
|
||||||
|
|
||||||
var img;
|
var img;
|
||||||
|
|
||||||
img = document.getElementById("server_status_img");
|
img = document.getElementById("server_status_img");
|
||||||
|
|
@ -1081,6 +1090,11 @@ function server_is_offline() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function no_file_access() {
|
||||||
|
document.getElementById("no_file_access").style.display = "block";
|
||||||
|
console.log("Failed to load local files, enable access to them");
|
||||||
|
}
|
||||||
|
|
||||||
// ==================================================================
|
// ==================================================================
|
||||||
|
|
||||||
function createNewEmbed(src1, src2)
|
function createNewEmbed(src1, src2)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue