mirror of https://github.com/SuperBFG7/ympd
Fix: improve wpa compatibility
This commit is contained in:
parent
d3ff64db13
commit
ef33423c1d
|
@ -6014,7 +6014,6 @@ static const struct {
|
|||
size_t ext_len;
|
||||
const char *mime_type;
|
||||
} mg_static_builtin_mime_types[] = {
|
||||
MIME_ENTRY("html", "text/html"),
|
||||
MIME_ENTRY("html", "text/html"),
|
||||
MIME_ENTRY("htm", "text/html"),
|
||||
MIME_ENTRY("shtm", "text/html"),
|
||||
|
@ -6062,6 +6061,9 @@ static const struct {
|
|||
MIME_ENTRY("asf", "video/x-ms-asf"),
|
||||
MIME_ENTRY("avi", "video/x-msvideo"),
|
||||
MIME_ENTRY("bmp", "image/bmp"),
|
||||
MIME_ENTRY("woff", "font/woff"),
|
||||
MIME_ENTRY("woff2", "font/woff2"),
|
||||
MIME_ENTRY("webmanifest", "application/manifest+json"),
|
||||
{NULL, 0, NULL}};
|
||||
|
||||
static struct mg_str mg_get_mime_type(const char *path, const char *dflt,
|
||||
|
|
Binary file not shown.
|
@ -112,9 +112,7 @@ small {
|
|||
font-family: 'Material Icons';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(/assets/MaterialIcons-Regular.woff2) format('woff2'),
|
||||
url(/assets/MaterialIcons-Regular.woff) format('woff'),
|
||||
url(/assets/MaterialIcons-Regular.ttf) format('truetype');
|
||||
src: url(/assets/MaterialIcons-Regular.woff2) format('woff2');
|
||||
}
|
||||
|
||||
.material-icons {
|
||||
|
|
|
@ -10,10 +10,11 @@
|
|||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="theme-color" content="#343a40">
|
||||
<link href="/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/assets/MaterialIcons-Regular.woff2" rel="preload" as="font" type="font/woff2" crossorigin="anonymous">
|
||||
<link href="/css/mympd.min.css" rel="stylesheet">
|
||||
<link href="/assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
|
||||
<link rel="manifest" href="/mympd.webmanifest">
|
||||
<link rel="apple-touch-icon" href="/assets/appicon-167.png">
|
||||
<link href="/assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
|
||||
<link href="/mympd.webmanifest" rel="manifest" crossorigin="anonymous">
|
||||
<link href="/assets/appicon-167.png" rel="apple-touch-icon">
|
||||
</head>
|
||||
<body>
|
||||
<header class="hide">
|
||||
|
|
|
@ -395,6 +395,20 @@ function showAppInitAlert(text) {
|
|||
}
|
||||
|
||||
function appInitStart() {
|
||||
//register serviceworker
|
||||
if ('serviceWorker' in navigator && document.URL.substring(0, 5) == 'https') {
|
||||
window.addEventListener('load', function() {
|
||||
navigator.serviceWorker.register('/sw.min.js', {scope: '/'}).then(function(registration) {
|
||||
// Registration was successful
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
registration.update();
|
||||
}, function(err) {
|
||||
// Registration failed
|
||||
console.log('ServiceWorker registration failed: ', err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
appInited = false;
|
||||
document.getElementsByTagName('header')[0].classList.add('hide');
|
||||
document.getElementsByTagName('main')[0].classList.add('hide');
|
||||
|
@ -851,18 +865,7 @@ function appInit() {
|
|||
|
||||
}, false);
|
||||
|
||||
if ('serviceWorker' in navigator && document.URL.substring(0, 5) == 'https') {
|
||||
window.addEventListener('load', function() {
|
||||
navigator.serviceWorker.register('/sw.min.js', {scope: '/'}).then(function(registration) {
|
||||
// Registration was successful
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
registration.update();
|
||||
}, function(err) {
|
||||
// Registration failed
|
||||
console.log('ServiceWorker registration failed: ', err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
window.addEventListener('beforeinstallprompt', function(event) {
|
||||
// Prevent Chrome 67 and earlier from automatically showing the prompt
|
||||
|
@ -1646,9 +1649,9 @@ function setCounter(currentSongId, totalTime, elapsedTime) {
|
|||
domCache.progressBar.value = Math.floor(1000 * elapsedTime / totalTime);
|
||||
|
||||
var counterText = elapsed_minutes + ":" +
|
||||
(elapsed_seconds < 10 ? '0' : '') + elapsed_seconds + " / " +
|
||||
(elapsed_seconds < 10 ? '0' : '') + elapsed_seconds + " / " +
|
||||
total_minutes + ":" + (total_seconds < 10 ? '0' : '') + total_seconds;
|
||||
domCache.counter.innerText = counterText;
|
||||
domCache.counter.innerHTML = counterText;
|
||||
|
||||
//Set playing track in queue view
|
||||
if (lastState) {
|
||||
|
@ -1671,7 +1674,7 @@ function setCounter(currentSongId, totalTime, elapsedTime) {
|
|||
if (tr) {
|
||||
var durationTd = tr.querySelector('[data-col=Duration]');
|
||||
if (durationTd)
|
||||
durationTd.innerText = counterText;
|
||||
durationTd.innerHTML = counterText;
|
||||
var posTd = tr.querySelector('[data-col=Pos]');
|
||||
if (posTd) {
|
||||
if (!posTd.classList.contains('material-icons')) {
|
||||
|
@ -3163,8 +3166,10 @@ function notificationsSupported() {
|
|||
}
|
||||
|
||||
function songChange(obj) {
|
||||
if (obj.type == 'error' || obj.type == 'result')
|
||||
if (obj.type != 'song_change') {
|
||||
console.log(JSON.stringify(obj));
|
||||
return;
|
||||
}
|
||||
var curSong = obj.data.Title + obj.data.Artist + obj.data.Album + obj.data.uri + obj.data.currentSongId;
|
||||
if (lastSong == curSong)
|
||||
return;
|
||||
|
@ -3172,6 +3177,7 @@ function songChange(obj) {
|
|||
var htmlNotification = '';
|
||||
var pageTitle = 'myMPD: ';
|
||||
|
||||
|
||||
domCache.currentCover.style.backgroundImage = 'url("' + obj.data.cover + '")';
|
||||
|
||||
if (typeof obj.data.Artist != 'undefined' && obj.data.Artist.length > 0 && obj.data.Artist != '-') {
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
User-agent: *
|
||||
Disallow: /
|
|
@ -15,9 +15,7 @@ var urlsToCache = [
|
|||
'/assets/coverimage-notavailable.png',
|
||||
'/assets/coverimage-loading.png',
|
||||
'/assets/favicon.ico',
|
||||
'/assets/MaterialIcons-Regular.ttf',
|
||||
'/assets/MaterialIcons-Regular.woff',
|
||||
'/assets/MaterialIcons-Regular.woff2'
|
||||
'/assets/MaterialIcons-Regular.woff'
|
||||
];
|
||||
|
||||
self.addEventListener('install', function(event) {
|
||||
|
|
Loading…
Reference in New Issue