Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
fix(auth): guarantee all login links are hidden when user is logged in (v1.4.24)
This commit is contained in:
@@ -365,18 +365,24 @@ try {
|
||||
var uEmail = localStorage.getItem('email');
|
||||
var displayName = localStorage.getItem('displayName') || uName || '';
|
||||
var emailStr = uEmail || '';
|
||||
var isAuth = !!token && !!uName;
|
||||
var isAuth =
|
||||
(!!token && !!uName) ||
|
||||
(liveWidget && liveWidget.querySelector('yaknet-account[authenticated="true"]')) ||
|
||||
!!document.querySelector('yaknet-account[authenticated="true"]');
|
||||
|
||||
if (headerRight) {
|
||||
var defaultLoginLink = headerRight.querySelector('my-login-link, a[href*="/login"], .login-button');
|
||||
var liveWidget = headerRight.querySelector('#yaknet-header-account-widget');
|
||||
|
||||
if (isAuth) {
|
||||
// 1. AUTHENTICATED: Hide native login link, Show YakNet Account Profile Menu
|
||||
if (defaultLoginLink) {
|
||||
defaultLoginLink.style.display = 'none';
|
||||
defaultLoginLink.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
// 1. AUTHENTICATED: Add class to body & Hide ALL native login links completely
|
||||
document.body.classList.add('yaktube-user-logged-in');
|
||||
document
|
||||
.querySelectorAll('my-login-link, a[href*="/login"], .login-button, [class*="login-link"]')
|
||||
.forEach(function (btn) {
|
||||
btn.style.setProperty('display', 'none', 'important');
|
||||
btn.setAttribute('aria-hidden', 'true');
|
||||
btn.setAttribute('tabindex', '-1');
|
||||
});
|
||||
|
||||
if (!liveWidget) {
|
||||
var widgetWrap = document.createElement('div');
|
||||
@@ -449,18 +455,19 @@ try {
|
||||
}
|
||||
} else {
|
||||
// 2. GUEST / NOT LOGGED IN:
|
||||
// A. Physically remove any <yaknet-account> widget from DOM to guarantee zero shadow DOM duplicate buttons
|
||||
document.body.classList.remove('yaktube-user-logged-in');
|
||||
if (liveWidget) {
|
||||
liveWidget.remove();
|
||||
}
|
||||
|
||||
// B. Ensure PeerTube's native login link is the ONLY single accessible login element
|
||||
if (defaultLoginLink) {
|
||||
defaultLoginLink.style.display = '';
|
||||
defaultLoginLink.removeAttribute('aria-hidden');
|
||||
document
|
||||
.querySelectorAll('my-login-link, a[href*="/login"], .login-button, [class*="login-link"]')
|
||||
.forEach(function (btn) {
|
||||
btn.style.display = '';
|
||||
btn.removeAttribute('aria-hidden');
|
||||
btn.removeAttribute('tabindex');
|
||||
|
||||
var loginAnchor =
|
||||
defaultLoginLink.tagName.toLowerCase() === 'a' ? defaultLoginLink : defaultLoginLink.querySelector('a');
|
||||
var loginAnchor = btn.tagName.toLowerCase() === 'a' ? btn : btn.querySelector('a');
|
||||
if (loginAnchor) {
|
||||
loginAnchor.setAttribute('aria-label', 'YakNet ile Giriş Yap');
|
||||
loginAnchor.setAttribute('title', 'YakNet ile Giriş Yap');
|
||||
@@ -471,7 +478,7 @@ try {
|
||||
loginAnchor.textContent = 'YakNet ile Giriş Yap';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -571,7 +578,16 @@ try {
|
||||
|
||||
injectYakNetSSO();
|
||||
|
||||
// Replace all login buttons labels and titles
|
||||
// Check auth status for login button rendering
|
||||
var tokenVal = localStorage.getItem('access_token');
|
||||
var userVal = localStorage.getItem('username');
|
||||
var isAlreadyAuth =
|
||||
(!!tokenVal && !!userVal) ||
|
||||
document.body.classList.contains('yaktube-user-logged-in') ||
|
||||
!!document.querySelector('yaknet-account[authenticated="true"]');
|
||||
|
||||
if (!isAlreadyAuth) {
|
||||
// Replace all login buttons labels and titles ONLY for guests
|
||||
document
|
||||
.querySelectorAll(
|
||||
'my-login-link, a[href*="/login"], a[title*="Giriş sayfasına git"], [aria-label*="Giriş sayfasına git"]'
|
||||
@@ -599,6 +615,18 @@ try {
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Guarantee all login links are hidden when user is logged in
|
||||
document
|
||||
.querySelectorAll(
|
||||
'my-login-link, a[href*="/login"], .login-button, [class*="login-link"]'
|
||||
)
|
||||
.forEach(function (el) {
|
||||
el.style.setProperty('display', 'none', 'important');
|
||||
el.setAttribute('aria-hidden', 'true');
|
||||
el.setAttribute('tabindex', '-1');
|
||||
});
|
||||
}
|
||||
|
||||
// Aggressively remove generic Framasoft Open-in-App / Play Store banners
|
||||
document
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "peertube-plugin-yaktube-ondemand",
|
||||
"version": "1.4.23",
|
||||
"version": "1.4.24",
|
||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
||||
"main": "main.js",
|
||||
"library": "./main.js",
|
||||
|
||||
@@ -24,6 +24,27 @@ button[title*='Dismiss'],
|
||||
clip: rect(0, 0, 0, 0) !important;
|
||||
}
|
||||
|
||||
/* Permanent suppression of native login links when user is authenticated */
|
||||
body.yaktube-user-logged-in my-login-link,
|
||||
body.yaktube-user-logged-in a[href*="/login"],
|
||||
body.yaktube-user-logged-in .login-button,
|
||||
body.yaktube-user-logged-in [class*="login-link"],
|
||||
body.yaktube-user-logged-in .peertube-button-link[href*="/login"],
|
||||
body.yaktube-user-logged-in a[title*="Giriş"],
|
||||
body.yaktube-user-logged-in a[aria-label*="Giriş"] {
|
||||
display: none !important;
|
||||
visibility: hidden !important;
|
||||
height: 0 !important;
|
||||
width: 0 !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
pointer-events: none !important;
|
||||
opacity: 0 !important;
|
||||
position: absolute !important;
|
||||
z-index: -99999 !important;
|
||||
clip: rect(0, 0, 0, 0) !important;
|
||||
}
|
||||
|
||||
/* Permanent Aggressive Suppression of Generic JoinPeerTube / Framasoft Open-in-App Banners */
|
||||
my-open-app,
|
||||
my-open-in-app,
|
||||
|
||||
Reference in New Issue
Block a user