MediaWiki:Iubenda.js: Różnice pomiędzy wersjami
Przejdź do nawigacji
Przejdź do wyszukiwania
skonfigurowano sygnał trybu zgody dla analityki Matomo |
naprawiono błąd "Uncaught SyntaxError: redeclaration of const gtagConsent" indukowany gadżetem "UserProfile"; drobne zmiany w zakresie funkcji przypisanej do deklaracji "gtagConsent" |
||
| Linia 3: | Linia 3: | ||
mw.loader.load("//cdn.iubenda.com/cs/gpp/stub.js"); // ["https://cs.iubenda.com/autoblocking/3887547.js", "//cdn.iubenda.com/cs/gpp/stub.js", "//cdn.iubenda.com/cs/iubenda_cs.js"].forEach(value => mw.loader.load(value)); | mw.loader.load("//cdn.iubenda.com/cs/gpp/stub.js"); // ["https://cs.iubenda.com/autoblocking/3887547.js", "//cdn.iubenda.com/cs/gpp/stub.js", "//cdn.iubenda.com/cs/iubenda_cs.js"].forEach(value => mw.loader.load(value)); | ||
document.querySelectorAll('button.iubenda-tp-btn.iubenda-cs-preferences-link').forEach(button => button.remove()); | document.querySelectorAll('button.iubenda-tp-btn.iubenda-cs-preferences-link').forEach(button => button.remove()); | ||
if(typeof gtagConsent == 'undefined') | |||
var gtagConsent = function(value) | |||
{ | { | ||
'analytics_storage': | const text = value ? 'granted' : 'denied'; | ||
gtag('consent', 'update', | |||
{ | |||
'analytics_storage': text, | |||
'ad_storage': text, | |||
}; | 'ad_user_data': text, | ||
'ad_personalization': text | |||
}); | |||
}; | |||
var policy = localStorage.getItem('minewiki-policy'); | var policy = localStorage.getItem('minewiki-policy'); | ||
if(policy == null) | if(policy == null) | ||
| Linia 38: | Linia 40: | ||
localStorage.setItem('minewiki-policy', value); | localStorage.setItem('minewiki-policy', value); | ||
$('div.minewiki-policy-notice').fadeOut(); | $('div.minewiki-policy-notice').fadeOut(); | ||
gtagConsent(value > 0 | gtagConsent(value > 0); | ||
_paq.push([(value > 0 ? 'remember' : 'forget') + 'ConsentGiven']); | _paq.push([(value > 0 ? 'remember' : 'forget') + 'ConsentGiven']); | ||
}; | }; | ||
| Linia 50: | Linia 52: | ||
const isHidden = value => getComputedStyle(document.querySelector('.minewiki-policy-' + value)).display == 'none'; | const isHidden = value => getComputedStyle(document.querySelector('.minewiki-policy-' + value)).display == 'none'; | ||
if(isHidden('notice') || isHidden('content') || isHidden('button')) | if(isHidden('notice') || isHidden('content') || isHidden('button')) | ||
gtagConsent( | gtagConsent(true); | ||
} | } | ||
else if(policy == 0) | else if(policy == 0) | ||
| Linia 59: | Linia 61: | ||
sessionStorage.clear(); | sessionStorage.clear(); | ||
localStorage.setItem('minewiki-policy', 0); | localStorage.setItem('minewiki-policy', 0); | ||
gtagConsent( | gtagConsent(false); | ||
} | } | ||
else | else | ||
gtagConsent( | gtagConsent(true); | ||
Aktualna wersja na dzień 19:54, 18 cze 2025
var _iub = _iub || [];
_iub.csConfiguration = { "siteId": 3887547, "cookiePolicyId": 69596227, "lang": "pl", "storage": { "useSiteId": true } };
mw.loader.load("//cdn.iubenda.com/cs/gpp/stub.js"); // ["https://cs.iubenda.com/autoblocking/3887547.js", "//cdn.iubenda.com/cs/gpp/stub.js", "//cdn.iubenda.com/cs/iubenda_cs.js"].forEach(value => mw.loader.load(value));
document.querySelectorAll('button.iubenda-tp-btn.iubenda-cs-preferences-link').forEach(button => button.remove());
if(typeof gtagConsent == 'undefined')
var gtagConsent = function(value)
{
const text = value ? 'granted' : 'denied';
gtag('consent', 'update',
{
'analytics_storage': text,
'ad_storage': text,
'ad_user_data': text,
'ad_personalization': text
});
};
var policy = localStorage.getItem('minewiki-policy');
if(policy == null)
{
$('body').append(`
<div class="minewiki-policy-notice">
<div class="minewiki-policy-content">
<p>
<b>Stowarzyszenie Minecraft Wiki Polska</b>, wraz z zaufanymi stronami trzecimi, gromadzi dane osobowe zgodnie z postanowieniami
<a href="https://www.iubenda.com/privacy-policy/69596227/legal">polityki prywatności</a>,
a także używa plików cookie i podobnych technologii w celach technicznych oraz statystycznych i reklamowych, na zasadach określonych w
<a href="https://www.iubenda.com/privacy-policy/69596227/cookie-policy">polityce cookie</a>.
Użytkownik ma prawo swobodnie udzielić lub odmówić swojej zgody, jednakże odmowa może uniemożliwić w pełni funkcjonalne korzystanie z <b>Minecraft Wiki Polska</b>.
</p>
<p>Użyj przycisku „Akceptuj” w celu wyrażenia zgody lub przycisku „Odrzuć”, aby kontynuować bez akceptacji.</p>
<div class="minewiki-policy-button">
<button id="minewiki-policy-reject"><b>Odrzuć</b></button>
<button id="minewiki-policy-accept"><b>Akceptuj</b></button>
</div>
</div>
</div>
`);
const finish = function(value)
{
localStorage.setItem('minewiki-policy', value);
$('div.minewiki-policy-notice').fadeOut();
gtagConsent(value > 0);
_paq.push([(value > 0 ? 'remember' : 'forget') + 'ConsentGiven']);
};
$('button#minewiki-policy-accept').on('click', () => finish(Date.now()));
$('button#minewiki-policy-reject').on('click', () =>
{
if(mw.config.get('wgUserName'))
window.location.href = 'https://minewiki.pl/index.php?title=Specjalna:Wyloguj&returnto=' + mw.config.get('wgPageName');
finish(0);
});
const isHidden = value => getComputedStyle(document.querySelector('.minewiki-policy-' + value)).display == 'none';
if(isHidden('notice') || isHidden('content') || isHidden('button'))
gtagConsent(true);
}
else if(policy == 0)
{
document.cookie.split(';').forEach(cookie =>
document.cookie = cookie.split('=')[0].trim() + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;");
localStorage.clear();
sessionStorage.clear();
localStorage.setItem('minewiki-policy', 0);
gtagConsent(false);
}
else
gtagConsent(true);