Help the gay community become stronger. Support DoberMan MediaBecome a DoberMan sponsorBeing gay is cool. Supporting gay people is even coolerGenerosity is a turn-on. Donate and be sexyBeing gay is cool. Supporting gay people is even coolerGenerosity looks good on you. Support DoberManHelp the gay community become stronger. Support DoberMan MediaSexiness starts with generosityGenerous men are sexier. Support DoberMan❤
'
+ '';
return;
}
var html = '';
for (var i = 0; i < items.length; i++) {
var a = items[i];
html += ''
+ '' + (i + 1) + ''
+ ''
+ '' + dpwaEsc(a.title) + ''
+ '' + dpwaAgo(a.ts) + ''
+ ''
+ '›'
+ '';
}
listEl.innerHTML = html;
var links = listEl.querySelectorAll('a[data-ourl]');
for (var j = 0; j < links.length; j++) {
(function(link) {
link.addEventListener('click', function(e) {
if (navigator.onLine) return true;
e.preventDefault();
window.location.href = link.getAttribute('data-ourl');
});
})(links[j]);
}
}
function dpwaUpdateOfflineStats(n) {
var sc = document.getElementById('dpwa-stat-count');
var ss = document.getElementById('dpwa-stat-status');
var sz = document.getElementById('dpwa-stat-size');
if (sc) sc.textContent = n;
if (ss) ss.textContent = navigator.onLine ? '🟢' : '🔴';
if (sz && navigator.storage && navigator.storage.estimate) {
navigator.storage.estimate().then(function(est) {
var mb = ((est.usage || 0) / 1024 / 1024);
sz.textContent = mb < 1 ? Math.round(mb * 1024) + ' KB' : mb.toFixed(1) + ' MB';
}).catch(function() {});
}
}
function dpwaUpdateOfflineBadge(n) {
var badge = document.getElementById('dpwa-offline-badge');
if (!badge) return;
if (n > 0) { badge.style.display = 'flex'; badge.textContent = n > 99 ? '99+' : String(n); }
else badge.style.display = 'none';
}
function dpwaGoOfflinePage(url) { window.location.href = url; }
// ── SW: circular progress indicator in the offline button ───────────────────────────────────
if ('serviceWorker' in navigator) {
navigator.serviceWorker.addEventListener('message', function(e) {
var d = e.data; if (!d || !d.type) return;
var ring = document.getElementById('dpwa-cache-ring');
var ringBar = document.getElementById('dpwa-cache-ring-bar');
var label = document.getElementById('dpwa-offline-label');
var icon = document.getElementById('dpwa-offline-icon');
var rbtn = document.getElementById('dpwa-offline-refresh');
var CIRC = 94.2;
if (d.type === 'dpwa-cache-start') {
if (ring) ring.style.display = 'block';
if (ringBar) ringBar.style.strokeDashoffset = String(CIRC);
if (icon) icon.style.opacity = '0.2';
if (label) label.textContent = '0%';
}
if (d.type === 'dpwa-cache-progress') {
var pct = d.total > 0 ? d.done / d.total : 0;
if (ringBar) ringBar.style.strokeDashoffset = String(CIRC * (1 - pct));
if (label) label.textContent = Math.round(pct * 100) + '%';
}
if (d.type === 'dpwa-cache-done' || d.type === 'dpwa-cache-error') {
if (ringBar) { ringBar.style.strokeDashoffset = '0'; ringBar.style.stroke = '#22c55e'; }
if (label) label.textContent = '✓';
setTimeout(function() {
if (ring) ring.style.display = 'none';
if (ringBar) { ringBar.style.stroke = '#818cf8'; ringBar.style.strokeDashoffset = String(CIRC); }
if (icon) icon.style.opacity = '';
if (label) label.textContent = 'Offline';
}, 1500);
if (rbtn) { rbtn.textContent = '🔄'; rbtn.disabled = false; }
if (d.type === 'dpwa-cache-done') dpwaLoadOfflineArticles();
}
});
}
// ── Wire up: close, overlay, refresh, search ─────────────────────────────────
document.addEventListener('DOMContentLoaded', function() {
var closeBtn = document.getElementById('dpwa-offline-close');
var overlay2 = document.getElementById('dpwa-offline-overlay');
var refreshBtn = document.getElementById('dpwa-offline-refresh');
var searchEl = document.getElementById('dpwa-lib-search');
if (closeBtn) closeBtn.addEventListener('click', dpwaCloseOfflineLib);
if (overlay2) overlay2.addEventListener('click', dpwaCloseOfflineLib);
if (refreshBtn) {
refreshBtn.addEventListener('click', function() {
if (!navigator.onLine) { alert('No internet connection.'); return; }
if (!('serviceWorker' in navigator)) { return; }
refreshBtn.textContent = '⏳'; refreshBtn.disabled = true;
navigator.serviceWorker.ready.then(function(reg) {
var sw = reg.active || navigator.serviceWorker.controller;
if (sw) sw.postMessage({ type: 'dpwa-refresh-cache', force: true });
else { refreshBtn.textContent = '🔄'; refreshBtn.disabled = false; }
}).catch(function() { refreshBtn.textContent = '🔄'; refreshBtn.disabled = false; });
});
}
if (searchEl) {
searchEl.addEventListener('input', function() {
var q = searchEl.value.trim().toLowerCase();
var listEl = document.getElementById('dpwa-lib-list');
dpwaRenderOfflineList(q ? dpwaAllArts.filter(function(a) { return a.title.toLowerCase().indexOf(q) !== -1; }) : dpwaAllArts, listEl);
});
}
window.addEventListener('online', function() { dpwaUpdateOfflineStats(dpwaAllArts.length); });
window.addEventListener('offline', function() { dpwaUpdateOfflineStats(dpwaAllArts.length); });
// Auto-prefetch once per PWA session
if ('serviceWorker' in navigator && navigator.onLine) {
var isStandalone = window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone === true;
if (isStandalone && !sessionStorage.getItem('dpwa_prefetched')) {
sessionStorage.setItem('dpwa_prefetched', '1');
navigator.serviceWorker.ready.then(function(reg) {
var sw = reg.active || navigator.serviceWorker.controller;
if (sw) sw.postMessage({ type: 'dpwa-refresh-cache' });
}).catch(function() {});
}
}
});
Podcasts
Loading...
🍪 We use cookies
We use necessary cookies for the operation of the site and, with your consent, analytical cookies to understand how visitors use our site. Your data is processed in accordance with the Our Privacy Policy and EU Regulation 2016/679 (GDPR).