Only loading fallback CSS if needed

This commit is contained in:
mibi88 2023-07-18 22:20:54 +02:00
parent aa8da06510
commit bcabd9952b
2 changed files with 9 additions and 5 deletions

View File

@ -4,11 +4,11 @@
<meta charset="utf-8">
<title>Planète Casio Websocket IRC</title>
<script src="v5shoutbox.js"></script>
<link href="fallback.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
<link href="/static/css/themes/default_theme.css" rel="stylesheet">
<link href="/static/css/global.css" rel="stylesheet">
<link href="/static/css/form.css" rel="stylesheet">
<script src="style.js"></script>
<link href="style.css" onerror="cssLoadingError(this);" rel="stylesheet">
<link href="/static/css/themes/default_theme.css" onerror="cssLoadingError(this);" rel="stylesheet">
<link href="/static/css/global.css" onerror="cssLoadingError(this);" rel="stylesheet">
<link href="/static/css/form.css" onerror="cssLoadingError(this);" rel="stylesheet">
</head>
<body>
<div id="v5shoutbox">

4
style.js Normal file
View File

@ -0,0 +1,4 @@
function cssLoadingError(link) {
fallback=true;
link.href = 'fallback.css'
}