Fix: wrong revision on content files / Blinking Icon in regattas list
This commit is contained in:
@@ -1331,7 +1331,6 @@ $(document).ready(function(){
|
||||
colorsArray.forEach(function (gradientBodyValue) {$('.generated-styles').append('.body-'+gradientBodyValue[0]+'{background-image: linear-gradient(to bottom, '+gradientBodyValue[1]+' 0, '+gradientBodyValue[3]+' 100%)}')});
|
||||
}
|
||||
|
||||
// TODO: Hier den site-specific code ausführen
|
||||
initRegatten();
|
||||
|
||||
hideLoader();
|
||||
|
||||
@@ -74,9 +74,9 @@ $(document).ready(function(){
|
||||
deferredPrompt.userChoice
|
||||
.then((choiceResult) => {
|
||||
if (choiceResult.outcome === 'accepted') {
|
||||
//console.log('User accepted the A2HS prompt');
|
||||
console.log('User accepted the A2HS prompt');
|
||||
} else {
|
||||
//console.log('User dismissed the A2HS prompt');
|
||||
console.log('User dismissed the A2HS prompt');
|
||||
}
|
||||
deferredPrompt = null;
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/*** REGATTAS LIST ***/
|
||||
.regattas-list > div {
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
@@ -40,4 +41,20 @@
|
||||
.regattas-list > div > div:nth-child(3) > div:nth-child(2) {
|
||||
width: 25%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/*** BLINKING ICONS ***/
|
||||
@keyframes fa-blink {
|
||||
0% { opacity: 1; }
|
||||
25% { opacity: 0.25; }
|
||||
50% { opacity: 0.5; }
|
||||
75% { opacity: 0.75; }
|
||||
100% { opacity: 0; }
|
||||
}
|
||||
.fa-blink {
|
||||
-webkit-animation: fa-blink .75s linear infinite;
|
||||
-moz-animation: fa-blink .75s linear infinite;
|
||||
-ms-animation: fa-blink .75s linear infinite;
|
||||
-o-animation: fa-blink .75s linear infinite;
|
||||
animation: fa-blink .75s linear infinite;
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
?>
|
||||
{
|
||||
"version": "1.0",
|
||||
"version": "<?php echo PWA_VERSION; ?>",
|
||||
"lang" : "de",
|
||||
"name" : "Regatten.net <?php echo $_CLASS['name'] ?>",
|
||||
"scope" : "<?php echo SERVER_ADDR; ?>/",
|
||||
|
||||
@@ -32,29 +32,21 @@ var rows = [];
|
||||
var today;
|
||||
|
||||
async function drawTable () {
|
||||
//setLoading(true, 'loading');
|
||||
|
||||
window.setTimeout(function () {
|
||||
var list = '';
|
||||
rows.forEach(function (entry) {
|
||||
if (entry == null) {
|
||||
list += '<div><div align="center" class="color-highlight"><b>Heute ist der ' + formatDate('d.m.Y', today) + '</b></div></div>';
|
||||
//tbody += '<tr><td colspan="' + heuteLen + '" class="bg-highlight color-white">';
|
||||
//tbody += 'Heute ist der ' + formatDate('d.m.Y', today);
|
||||
//tbody += '</td></tr>';
|
||||
} else if (search($('#input-search').val(), entry.keywords)) {
|
||||
list += entry.content;
|
||||
}
|
||||
});
|
||||
$('#div-regattas').html(list);
|
||||
|
||||
//setLoading(false, 'loading');
|
||||
}, 0);
|
||||
}
|
||||
|
||||
async function regattaClicked(id) {
|
||||
var regatta = await dbGetData('regattas', id);
|
||||
console.log(regatta);
|
||||
|
||||
$('#menu-regatta').find('.menu-title').find('p').text(regatta.name);
|
||||
|
||||
@@ -277,10 +269,32 @@ var siteScript = async function() {
|
||||
if ((entry['meldung'] != '') && (dateTo >= today) && (entry['meldungOffen'] == '1')) {
|
||||
var color = '';
|
||||
if (entry['meldungSchluss'] != null) {
|
||||
var ms = parseDate(entry['meldungSchluss']);
|
||||
var diff = Math.round((ms - today) / 86400000);
|
||||
if ((ms >= today) && (diff < 7))
|
||||
color = ' color-red2-dark';
|
||||
var planning = null;
|
||||
if (isLoggedIn()) {
|
||||
var plannings = await dbGetDataIndex('plannings', 'regatta', entry['id']);
|
||||
for (id in plannings) {
|
||||
if (plannings[id]['user'] == USER_ID) {
|
||||
planning = plannings[id];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((planning == null) || (planning['gemeldet'] == '0')) {
|
||||
var ms = 0;
|
||||
if (entry['meldungEarly'] != null) {
|
||||
ms = parseDate(entry['meldungEarly']);
|
||||
}
|
||||
if (ms < today) {
|
||||
ms = parseDate(entry['meldungSchluss']);
|
||||
}
|
||||
var diff = Math.round((ms - today) / 86400000);
|
||||
if ((ms >= today) && (diff < 7)) {
|
||||
color = ' color-red2-dark';
|
||||
if (planning != null) {
|
||||
color += ' fa-blink';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
icons.push('<i class="fas fa-file-signature' + color + '"></i>');
|
||||
}
|
||||
|
||||
@@ -24,13 +24,30 @@ workbox.core.setCacheNameDetails({
|
||||
workbox.precaching.precacheAndRoute([
|
||||
<?php
|
||||
// CONTENT
|
||||
function getDirHash($path) {
|
||||
$hash = '';
|
||||
if ($dir = opendir($path)) {
|
||||
while (($file = readdir($dir)) !== false) {
|
||||
if ($file == '.') continue;
|
||||
if ($file == '..') continue;
|
||||
if (is_dir($path . '/' . $file)) {
|
||||
$hash .= getDirHash($path . '/' . $file);
|
||||
} else {
|
||||
$hash .= md5_file($path . '/' . $file);
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
return $hash;
|
||||
}
|
||||
$hash = md5(getDirHash(__DIR__));
|
||||
|
||||
$path = __DIR__ . '/content/';
|
||||
$dir = opendir($path);
|
||||
while ($file = readdir($dir)) {
|
||||
if (($file == '.') or ($file == '..') or (pathinfo($file, PATHINFO_EXTENSION) != 'php')) continue;
|
||||
$revision = filemtime($path . $file);
|
||||
$file = SERVER_ADDR . '/' . pathinfo($file, PATHINFO_FILENAME);
|
||||
echo "\t{url: '$file', revision: '$revision'},\n";
|
||||
echo "\t{url: '$file', revision: '$hash'},\n";
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
@@ -63,7 +80,7 @@ workbox.precaching.precacheAndRoute([
|
||||
}
|
||||
|
||||
foreach ($filesToCache as $file) {
|
||||
$revision = filemtime(__DIR__ . $file);
|
||||
$revision = md5_file(__DIR__ . $file);
|
||||
$file = SERVER_ADDR . $file;
|
||||
echo "\t{url: '$file', revision: '$revision'},\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user