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
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4fc917677 | ||
|
|
551b6d1ab6 | ||
|
|
51e41df3ca | ||
|
|
97079931f2 | ||
|
|
22ed7a4bda |
@@ -152,6 +152,117 @@
|
||||
true
|
||||
);
|
||||
|
||||
// 2.3 Dedicated Local Admin Login Modal (Alt+A)
|
||||
function openLocalAdminLoginModal() {
|
||||
var existingModal = document.getElementById('yaktube-admin-login-modal');
|
||||
if (existingModal) {
|
||||
existingModal.style.display = 'flex';
|
||||
var uInput = existingModal.querySelector('#yaktube-admin-username');
|
||||
if (uInput) uInput.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
var modal = document.createElement('div');
|
||||
modal.id = 'yaktube-admin-login-modal';
|
||||
modal.className = 'yaktube-modal-overlay';
|
||||
modal.setAttribute('role', 'dialog');
|
||||
modal.setAttribute('aria-modal', 'true');
|
||||
modal.setAttribute('aria-labelledby', 'yaktube-admin-modal-title');
|
||||
|
||||
modal.innerHTML =
|
||||
'<div class="yaktube-modal-card" style="max-width: 420px; background:#181824; border:1px solid rgba(255,143,55,0.4); border-radius:18px; padding:26px; color:#fff; box-shadow:0 16px 40px rgba(0,0,0,0.8); text-align:left;">' +
|
||||
'<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:18px;">' +
|
||||
'<h3 id="yaktube-admin-modal-title" style="margin:0; font-size:18px; color:#ff8f37;">⚙️ Sunucu Yöneticisi Girişi</h3>' +
|
||||
'<button id="yaktube-admin-modal-close" class="yaktube-voice-modal-close-btn" aria-label="Kapat">✕</button>' +
|
||||
'</div>' +
|
||||
'<p style="font-size:13px; color:#aaa; margin-bottom:16px;">Yerel yönetici (admin) kullanıcı adı ve şifrenizle giriş yaparak PeerTube yönetim paneline erişebilirsiniz.</p>' +
|
||||
'<form id="yaktube-admin-direct-form" style="display:flex; flex-direction:column; gap:12px;">' +
|
||||
'<div style="display:flex; flex-direction:column; gap:4px;">' +
|
||||
'<label for="yaktube-admin-username" style="font-size:13px; font-weight:600; color:#ddd;">Kullanıcı Adı veya E-posta:</label>' +
|
||||
'<input type="text" id="yaktube-admin-username" required style="background:#22222e; border:1px solid #444; border-radius:8px; padding:10px 12px; color:#fff; font-size:14px; outline:none;" />' +
|
||||
'</div>' +
|
||||
'<div style="display:flex; flex-direction:column; gap:4px;">' +
|
||||
'<label for="yaktube-admin-password" style="font-size:13px; font-weight:600; color:#ddd;">Şifre:</label>' +
|
||||
'<input type="password" id="yaktube-admin-password" required style="background:#22222e; border:1px solid #444; border-radius:8px; padding:10px 12px; color:#fff; font-size:14px; outline:none;" />' +
|
||||
'</div>' +
|
||||
'<div id="yaktube-admin-login-error" style="color:#ef4444; font-size:13px; display:none; margin-top:4px;"></div>' +
|
||||
'<button type="submit" id="yaktube-admin-login-submit" style="background:linear-gradient(135deg, #ff8f37 0%, #ff5e3a 100%); color:#fff; border:none; border-radius:8px; padding:12px; font-weight:700; font-size:14px; cursor:pointer; margin-top:6px;">Yönetici Olarak Giriş Yap</button>' +
|
||||
'</form>' +
|
||||
'</div>';
|
||||
|
||||
document.body.appendChild(modal);
|
||||
|
||||
modal.querySelector('#yaktube-admin-modal-close').addEventListener('click', function () {
|
||||
modal.style.display = 'none';
|
||||
});
|
||||
modal.addEventListener('click', function (e) {
|
||||
if (e.target === modal) modal.style.display = 'none';
|
||||
});
|
||||
|
||||
var form = modal.querySelector('#yaktube-admin-direct-form');
|
||||
var errEl = modal.querySelector('#yaktube-admin-login-error');
|
||||
var uInput = modal.querySelector('#yaktube-admin-username');
|
||||
var pInput = modal.querySelector('#yaktube-admin-password');
|
||||
var sBtn = modal.querySelector('#yaktube-admin-login-submit');
|
||||
|
||||
uInput.focus();
|
||||
|
||||
form.addEventListener('submit', async function (ev) {
|
||||
ev.preventDefault();
|
||||
errEl.style.display = 'none';
|
||||
sBtn.disabled = true;
|
||||
sBtn.innerText = 'Giriş Yapılıyor...';
|
||||
|
||||
try {
|
||||
var clientRes = await fetch('/api/v1/oauth-clients/local');
|
||||
var clientData = await clientRes.json();
|
||||
|
||||
var bodyParams = new URLSearchParams({
|
||||
client_id: clientData.client_id,
|
||||
client_secret: clientData.client_secret,
|
||||
grant_type: 'password',
|
||||
username: uInput.value.trim(),
|
||||
password: pInput.value
|
||||
});
|
||||
|
||||
var tokenRes = await fetch('/api/v1/users/token', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
body: bodyParams.toString()
|
||||
});
|
||||
|
||||
var tokenData = await tokenRes.json();
|
||||
if (!tokenRes.ok || !tokenData.access_token) {
|
||||
throw new Error(tokenData.error_description || tokenData.error || 'Kullanıcı adı veya şifre hatalı.');
|
||||
}
|
||||
|
||||
// Store tokens
|
||||
localStorage.setItem('access_token', tokenData.access_token);
|
||||
localStorage.setItem('refresh_token', tokenData.refresh_token);
|
||||
localStorage.setItem('token_type', tokenData.token_type || 'Bearer');
|
||||
localStorage.setItem('username', uInput.value.trim());
|
||||
|
||||
// Get user details
|
||||
var meRes = await fetch('/api/v1/users/me', {
|
||||
headers: { Authorization: 'Bearer ' + tokenData.access_token }
|
||||
});
|
||||
if (meRes.ok) {
|
||||
var meData = await meRes.json();
|
||||
localStorage.setItem('email', meData.email || '');
|
||||
localStorage.setItem('displayName', meData.displayName || meData.username || '');
|
||||
}
|
||||
|
||||
announce('Yönetici girişi başarılı! Yönetim paneline yönlendiriliyorsunuz.', true);
|
||||
window.location.href = '/admin';
|
||||
} catch (err) {
|
||||
errEl.innerText = err.message;
|
||||
errEl.style.display = 'block';
|
||||
sBtn.disabled = false;
|
||||
sBtn.innerText = 'Yönetici Olarak Giriş Yap';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 2. YakNet SSO Header & Login Flow
|
||||
function injectYakNetSSO() {
|
||||
// 2.1 Header: Place YakNet Account widget in top-right .buttons-container
|
||||
@@ -172,86 +283,104 @@
|
||||
var isAuth = !!token && !!uName;
|
||||
|
||||
if (headerRight) {
|
||||
var defaultLoginLink = headerRight.querySelector('my-login-link, a[href*="/login"], .login-button');
|
||||
var liveWidget = headerRight.querySelector('#yaknet-header-account-widget');
|
||||
if (!liveWidget) {
|
||||
var widgetWrap = document.createElement('div');
|
||||
widgetWrap.id = 'yaknet-header-account-widget';
|
||||
widgetWrap.className = 'yaknet-header-widget';
|
||||
widgetWrap.style.display = 'inline-flex';
|
||||
widgetWrap.style.alignItems = 'center';
|
||||
widgetWrap.style.marginRight = '8px';
|
||||
|
||||
widgetWrap.innerHTML =
|
||||
'<yaknet-account ' +
|
||||
'client-id="01a03c41-f758-721e-b927-619bffde5c23" ' +
|
||||
'redirect-uri="https://yaktube.yakhub.com.tr/plugins/peertube-plugin-auth-yaknet/router/auth-callback" ' +
|
||||
'base-url="https://auth.yakhub.com.tr" ' +
|
||||
'login-url="/login" ' +
|
||||
'authenticated="' +
|
||||
(isAuth ? 'true' : 'false') +
|
||||
'" ' +
|
||||
'user-name="' +
|
||||
(isAuth ? displayName.replace(/"/g, '"') : '') +
|
||||
'" ' +
|
||||
'user-email="' +
|
||||
(isAuth ? emailStr.replace(/"/g, '"') : '') +
|
||||
'" ' +
|
||||
'theme="dark">' +
|
||||
'</yaknet-account>';
|
||||
|
||||
var targetSibling =
|
||||
headerRight.querySelector('my-user-menu') ||
|
||||
headerRight.querySelector('my-login-link') ||
|
||||
headerRight.querySelector('.user-menu') ||
|
||||
headerRight.querySelector('.settings-button') ||
|
||||
headerRight.querySelector('my-user-notifications') ||
|
||||
headerRight.querySelector('my-notification-bell');
|
||||
|
||||
if (targetSibling && targetSibling.parentElement === headerRight) {
|
||||
headerRight.insertBefore(widgetWrap, targetSibling);
|
||||
} else {
|
||||
headerRight.prepend(widgetWrap);
|
||||
}
|
||||
|
||||
var defaultLoginLink = headerRight.querySelector('my-login-link');
|
||||
if (isAuth) {
|
||||
// Logged In: Show YakNet Profile Menu, Hide default login link
|
||||
if (defaultLoginLink) {
|
||||
defaultLoginLink.setAttribute('aria-hidden', 'true');
|
||||
defaultLoginLink.setAttribute('tabindex', '-1');
|
||||
defaultLoginLink.style.display = 'none';
|
||||
defaultLoginLink.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
} else {
|
||||
// Sync widget attributes dynamically if auth state changed
|
||||
var el = liveWidget.querySelector('yaknet-account');
|
||||
if (el) {
|
||||
if (el.shadowRoot) {
|
||||
var shadowLogoutBtn =
|
||||
el.shadowRoot.getElementById('logoutBtn') ||
|
||||
el.shadowRoot.querySelector('.yn-logout-btn') ||
|
||||
el.shadowRoot.querySelector('button[title*="Çıkış"], button[aria-label*="Çıkış"]');
|
||||
if (shadowLogoutBtn && !shadowLogoutBtn.hasAttribute('data-yaktube-hooked')) {
|
||||
shadowLogoutBtn.setAttribute('data-yaktube-hooked', 'true');
|
||||
shadowLogoutBtn.addEventListener(
|
||||
'click',
|
||||
function (ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
performUnifiedLogout();
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
if (!liveWidget) {
|
||||
var widgetWrap = document.createElement('div');
|
||||
widgetWrap.id = 'yaknet-header-account-widget';
|
||||
widgetWrap.className = 'yaknet-header-widget';
|
||||
widgetWrap.style.display = 'inline-flex';
|
||||
widgetWrap.style.alignItems = 'center';
|
||||
widgetWrap.style.marginRight = '8px';
|
||||
|
||||
widgetWrap.innerHTML =
|
||||
'<yaknet-account ' +
|
||||
'client-id="01a03c41-f758-721e-b927-619bffde5c23" ' +
|
||||
'redirect-uri="https://yaktube.yakhub.com.tr/plugins/peertube-plugin-auth-yaknet/router/auth-callback" ' +
|
||||
'base-url="https://auth.yakhub.com.tr" ' +
|
||||
'login-url="/login" ' +
|
||||
'authenticated="true" ' +
|
||||
'user-name="' +
|
||||
displayName.replace(/"/g, '"') +
|
||||
'" ' +
|
||||
'user-email="' +
|
||||
emailStr.replace(/"/g, '"') +
|
||||
'" ' +
|
||||
'theme="dark">' +
|
||||
'</yaknet-account>';
|
||||
|
||||
var targetSibling =
|
||||
headerRight.querySelector('my-user-menu') ||
|
||||
headerRight.querySelector('.user-menu') ||
|
||||
headerRight.querySelector('.settings-button') ||
|
||||
headerRight.querySelector('my-user-notifications') ||
|
||||
headerRight.querySelector('my-notification-bell');
|
||||
|
||||
if (targetSibling && targetSibling.parentElement === headerRight) {
|
||||
headerRight.insertBefore(widgetWrap, targetSibling);
|
||||
} else {
|
||||
headerRight.prepend(widgetWrap);
|
||||
}
|
||||
} else {
|
||||
var el = liveWidget.querySelector('yaknet-account');
|
||||
if (el) {
|
||||
if (el.shadowRoot) {
|
||||
var shadowLogoutBtn =
|
||||
el.shadowRoot.getElementById('logoutBtn') ||
|
||||
el.shadowRoot.querySelector('.yn-logout-btn') ||
|
||||
el.shadowRoot.querySelector('button[title*="Çıkış"], button[aria-label*="Çıkış"]');
|
||||
if (shadowLogoutBtn && !shadowLogoutBtn.hasAttribute('data-yaktube-hooked')) {
|
||||
shadowLogoutBtn.setAttribute('data-yaktube-hooked', 'true');
|
||||
shadowLogoutBtn.addEventListener(
|
||||
'click',
|
||||
function (ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
performUnifiedLogout();
|
||||
},
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (el.getAttribute('authenticated') !== 'true' || el.getAttribute('user-name') !== displayName) {
|
||||
el.setAttribute('authenticated', 'true');
|
||||
el.setAttribute('user-name', displayName);
|
||||
el.setAttribute('user-email', emailStr);
|
||||
if (typeof el.syncStateFromAttributes === 'function') {
|
||||
el.syncStateFromAttributes();
|
||||
el.render();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Not Logged In: Remove YakNet widget to eliminate duplicate button, keep PeerTube native login button clean
|
||||
if (liveWidget) {
|
||||
liveWidget.remove();
|
||||
}
|
||||
if (defaultLoginLink) {
|
||||
defaultLoginLink.style.display = '';
|
||||
defaultLoginLink.removeAttribute('aria-hidden');
|
||||
|
||||
var expectedAuth = isAuth ? 'true' : 'false';
|
||||
var expectedName = isAuth ? displayName : '';
|
||||
var expectedEmail = isAuth ? emailStr : '';
|
||||
if (el.getAttribute('authenticated') !== expectedAuth || el.getAttribute('user-name') !== expectedName) {
|
||||
el.setAttribute('authenticated', expectedAuth);
|
||||
el.setAttribute('user-name', expectedName);
|
||||
el.setAttribute('user-email', expectedEmail);
|
||||
if (typeof el.syncStateFromAttributes === 'function') {
|
||||
el.syncStateFromAttributes();
|
||||
el.render();
|
||||
var loginAnchor =
|
||||
defaultLoginLink.tagName.toLowerCase() === 'a' ? defaultLoginLink : defaultLoginLink.querySelector('a');
|
||||
if (loginAnchor) {
|
||||
loginAnchor.setAttribute('aria-label', 'YakNet ile Giriş Yap');
|
||||
loginAnchor.setAttribute('title', 'YakNet Hesabınız ile Giriş Yapın');
|
||||
var spanText = loginAnchor.querySelector('span');
|
||||
if (spanText) {
|
||||
spanText.textContent = 'YakNet ile Giriş Yap';
|
||||
} else {
|
||||
loginAnchor.textContent = 'YakNet ile Giriş Yap';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,11 +455,7 @@
|
||||
if (showAdminBtn) {
|
||||
showAdminBtn.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
subElements.forEach(function (el) {
|
||||
el.style.display = '';
|
||||
});
|
||||
showAdminBtn.style.display = 'none';
|
||||
announce('Yönetici kullanıcı adı ve şifre giriş formu açıldı.');
|
||||
openLocalAdminLoginModal();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -340,8 +465,51 @@
|
||||
// 3. Intelligent Branding & A11y DOM Auto-Fixer
|
||||
function autoFixDOM() {
|
||||
injectAccessiblePlayerBar();
|
||||
|
||||
// Check if on 403 / unauthorized page and provide admin login button
|
||||
var notAuthorizedEl = document.querySelector('my-not-found, .not-found, .forbidden, my-forbidden, .error-page');
|
||||
if (notAuthorizedEl && !document.getElementById('yaktube-403-admin-btn')) {
|
||||
var btn403 = document.createElement('div');
|
||||
btn403.id = 'yaktube-403-admin-btn';
|
||||
btn403.style.margin = '20px auto';
|
||||
btn403.style.textAlign = 'center';
|
||||
btn403.innerHTML =
|
||||
'<button style="background:linear-gradient(135deg, #ff8f37 0%, #ff5e3a 100%); color:#fff; border:none; padding:12px 24px; border-radius:10px; font-weight:700; cursor:pointer; font-size:15px;">🔑 Sunucu Yöneticisi Olarak Giriş Yap (Alt+A)</button>';
|
||||
btn403.querySelector('button').addEventListener('click', openLocalAdminLoginModal);
|
||||
notAuthorizedEl.appendChild(btn403);
|
||||
}
|
||||
|
||||
injectYakNetSSO();
|
||||
|
||||
// Replace all login buttons labels and titles
|
||||
document
|
||||
.querySelectorAll(
|
||||
'my-login-link, a[href*="/login"], a[title*="Giriş sayfasına git"], [aria-label*="Giriş sayfasına git"]'
|
||||
)
|
||||
.forEach(function (el) {
|
||||
if (el.getAttribute('title') && el.getAttribute('title').includes('Giriş sayfasına git')) {
|
||||
el.setAttribute('title', 'YakNet ile Giriş Yap');
|
||||
}
|
||||
if (el.getAttribute('aria-label') && el.getAttribute('aria-label').includes('Giriş sayfasına git')) {
|
||||
el.setAttribute('aria-label', 'YakNet ile Giriş Yap');
|
||||
}
|
||||
var anchor = el.tagName.toLowerCase() === 'a' ? el : el.querySelector('a');
|
||||
if (anchor) {
|
||||
anchor.setAttribute('title', 'YakNet ile Giriş Yap');
|
||||
anchor.setAttribute('aria-label', 'YakNet ile Giriş Yap');
|
||||
var spans = anchor.querySelectorAll('span');
|
||||
spans.forEach(function (s) {
|
||||
if (
|
||||
s.textContent.includes('Giriş sayfasına git') ||
|
||||
s.textContent.trim() === 'Giriş' ||
|
||||
s.textContent.trim() === 'Giriş yap'
|
||||
) {
|
||||
s.textContent = 'YakNet ile Giriş Yap';
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Aggressively remove generic Framasoft Open-in-App / Play Store banners
|
||||
var genericAppBanners = document.querySelectorAll(
|
||||
'my-open-app, my-client-app-banner, .open-app-container, .app-banner, [class*="open-app"], [class*="open-in-app"], .mobile-app-banner, my-open-in-app, .app-promotion, a[href*="play.google.com/store/apps/details?id=app.joinpeertube"], a[href*="f-droid.org"]'
|
||||
@@ -380,7 +548,8 @@
|
||||
.replace(/PeerTube hakkında/gi, 'YakTube Hakkında')
|
||||
.replace(/PeerTube'a katılın/gi, "YakTube'a Katılın")
|
||||
.replace(/PeerTube örneği/gi, 'YakTube Sunucusu')
|
||||
.replace(/PeerTube/g, 'YakTube');
|
||||
.replace(/PeerTube/g, 'YakTube')
|
||||
.replace(/Giriş sayfasına git/gi, 'YakNet ile Giriş Yap');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -852,6 +1021,13 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Admin Login: Alt+A
|
||||
if (e.altKey && (e.key === 'a' || e.key === 'A') && !isInputFocused()) {
|
||||
e.preventDefault();
|
||||
openLocalAdminLoginModal();
|
||||
return;
|
||||
}
|
||||
|
||||
// Help Dialog: Alt+H, F1 or '?' key
|
||||
if ((e.altKey && (e.key === 'h' || e.key === 'H')) || e.key === 'F1' || e.key === '?') {
|
||||
if (!isInputFocused()) {
|
||||
|
||||
+8
-4
@@ -1,14 +1,17 @@
|
||||
{
|
||||
"name": "peertube-plugin-yaktube-ondemand",
|
||||
"version": "1.4.1",
|
||||
"version": "1.4.5",
|
||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
||||
"main": "main.js",
|
||||
"library": "./main.js",
|
||||
"staticDirs": {},
|
||||
"translations": {},
|
||||
"clientScripts": [
|
||||
{
|
||||
"script": "client.js",
|
||||
"scopes": [
|
||||
"common"
|
||||
],
|
||||
"script": "client.js"
|
||||
]
|
||||
}
|
||||
],
|
||||
"css": [
|
||||
@@ -36,8 +39,9 @@
|
||||
"author": "Enes Yakıştır <[email protected]>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/enesyakistir/peertube-plugin-yaktube-ondemand.git"
|
||||
"url": "https://github.com/yakistir98/peertube-plugin-yaktube-ondemand.git"
|
||||
},
|
||||
"homepage": "https://yaktube.yakhub.com.tr",
|
||||
"bugs": "https://github.com/yakistir98/peertube-plugin-yaktube-ondemand/issues",
|
||||
"license": "AGPL-3.0-or-later"
|
||||
}
|
||||
Reference in New Issue
Block a user