feat(social): supprime le code Social mort (jamais branché)
- suppression social-core/views/auth/privacy/css (0 référence dans src/, aucune page) - suppression branches isSocial() mortes dans components.js - nettoyage isFpTest() mort + footer-back CSS orphelin - simplification isTorBrowser() (suppression debug logs + conditions redondantes)
This commit is contained in:
parent
d7ec32a458
commit
efc6fc07d2
8 changed files with 14 additions and 3401 deletions
|
|
@ -10,8 +10,6 @@
|
|||
function path() { return location.pathname; }
|
||||
function lang() { return /^\/en(\/|$)/.test(path()) ? 'en' : 'fr'; }
|
||||
function isHome() { var p = path(); return p === '/' || p === '/index.html' || p === '/en/' || p === '/en/index.html'; }
|
||||
function isFpTest() { return /\/fingerprint-test/.test(path()); }
|
||||
function isSocial() { return /\/social/.test(path()); }
|
||||
|
||||
function frLink() {
|
||||
var p = path();
|
||||
|
|
@ -39,16 +37,7 @@
|
|||
html += '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>';
|
||||
html += '</label>';
|
||||
|
||||
if (isSocial()) {
|
||||
html += '<nav id="nav" class="site-nav" aria-label="Navigation">';
|
||||
html += '<div class="lang-switch" role="group" aria-label="Langue / Language">';
|
||||
html += '<button type="button" data-lang="fr" class="lang-btn' + (h === 'fr' ? ' active' : '') + '">' + (h === 'fr' ? '<strong>FR</strong>' : 'FR') + '</button>';
|
||||
html += '<button type="button" data-lang="en" class="lang-btn' + (h === 'en' ? ' active' : '') + '">' + (h === 'en' ? '<strong>EN</strong>' : 'EN') + '</button>';
|
||||
html += '</div>';
|
||||
html += THEME_BTN;
|
||||
html += '</nav>';
|
||||
} else {
|
||||
html += '<nav class="site-nav" aria-label="Navigation">';
|
||||
html += '<nav class="site-nav" aria-label="Navigation">';
|
||||
|
||||
html += '<a href="/blog" data-lang-path="/blog" data-i18n="nav.blog">Blog</a>';
|
||||
html += '<a href="/projets" data-lang-path="/projets" data-i18n="nav.projects">Projets</a>';
|
||||
|
|
@ -65,7 +54,6 @@
|
|||
html += '</div>';
|
||||
html += THEME_BTN;
|
||||
html += '</nav>';
|
||||
}
|
||||
|
||||
return '<header class="site-header">' + html + '</header>';
|
||||
}
|
||||
|
|
@ -79,10 +67,6 @@
|
|||
var privHref = h === 'fr' ? '/privacy-policy' : '/en/privacy-policy';
|
||||
|
||||
var html = '';
|
||||
if (isSocial()) {
|
||||
var backText = h === 'fr' ? 'Retour au site' : 'Back to site';
|
||||
html += '<p><a href="/" class="footer-back">' + backText + ' \u2190</a></p>';
|
||||
}
|
||||
html += '<p>Zektyc \u00b7 France</p>';
|
||||
html += '<p class="footer-note">' + note + '</p>';
|
||||
html += '<nav class="footer-nav" aria-label="Legal">';
|
||||
|
|
@ -116,69 +100,19 @@
|
|||
}
|
||||
|
||||
function isTorBrowser() {
|
||||
var dbg = {
|
||||
hostname: location.hostname,
|
||||
userAgent: navigator.userAgent,
|
||||
hasTorSensor: !!window.TorSensor,
|
||||
uaMatch: /TorBrowser|Tor\/|Tor Project/i.test(navigator.userAgent),
|
||||
timezoneOffset: new Date().getTimezoneOffset(),
|
||||
gmt: (new Date().getTimezoneOffset() === 0),
|
||||
screenW: window.screen && window.screen.width,
|
||||
screenH: window.screen && window.screen.height,
|
||||
innerW: window.innerWidth,
|
||||
innerH: window.innerHeight,
|
||||
letterboxed: !!(window.screen &&
|
||||
window.screen.width === window.innerWidth &&
|
||||
window.screen.height === window.innerHeight),
|
||||
pluginCount: (navigator.plugins && navigator.plugins.length) || 0,
|
||||
noPlugins: !navigator.plugins || navigator.plugins.length === 0,
|
||||
vendor: navigator.vendor
|
||||
};
|
||||
if (isOnion()) return true;
|
||||
if (window.TorSensor) return true;
|
||||
if (/TorBrowser|Tor\/|Tor Project/i.test(navigator.userAgent)) return true;
|
||||
|
||||
if (isOnion()) {
|
||||
dbg.result = 'onion:' + location.hostname;
|
||||
console.log('[TorToast] on .onion, skip', dbg);
|
||||
return true;
|
||||
}
|
||||
var gmt = new Date().getTimezoneOffset() === 0;
|
||||
var letterboxed = !!(window.screen &&
|
||||
window.screen.width === window.innerWidth &&
|
||||
window.screen.height === window.innerHeight);
|
||||
var noPlugins = !navigator.plugins || navigator.plugins.length === 0;
|
||||
var vendor = navigator.vendor;
|
||||
|
||||
if (dbg.hasTorSensor) {
|
||||
dbg.result = 'TorSensor';
|
||||
console.log('[TorToast] detected via TorSensor', dbg);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (dbg.uaMatch) {
|
||||
dbg.result = 'userAgent';
|
||||
console.log('[TorToast] detected via userAgent', dbg);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (dbg.gmt && dbg.letterboxed) {
|
||||
dbg.result = 'gmt+letterbox';
|
||||
console.log('[TorToast] detected via gmt+letterbox', dbg);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (dbg.gmt && dbg.letterboxed && dbg.noPlugins) {
|
||||
dbg.result = 'gmt+letterbox+noPlugins';
|
||||
console.log('[TorToast] detected via gmt+letterbox+noPlugins', dbg);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (dbg.vendor === '' && dbg.gmt && dbg.noPlugins) {
|
||||
dbg.result = 'vendorEmpty+gmt+noPlugins';
|
||||
console.log('[TorToast] detected via vendorEmpty+gmt+noPlugins', dbg);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (dbg.gmt && dbg.letterboxed && dbg.vendor === '') {
|
||||
dbg.result = 'gmt+letterbox+vendorEmpty';
|
||||
console.log('[TorToast] detected via gmt+letterbox+vendorEmpty', dbg);
|
||||
return true;
|
||||
}
|
||||
|
||||
dbg.result = 'NOT tor';
|
||||
console.log('[TorToast] not detected as Tor', dbg);
|
||||
if (gmt && letterboxed) return true;
|
||||
if (vendor === '' && gmt && noPlugins) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue