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 | |
|---|---|---|---|
|
|
a67bb3339e | ||
|
|
b952663f3a | ||
|
|
0c98d079be | ||
|
|
0bf905f81f | ||
|
|
f1720448c7 | ||
|
|
f73a1171c4 | ||
|
|
64afa7c5e9 | ||
|
|
c0af4e86b2 | ||
|
|
3cc2711e8c | ||
|
|
330ff2da2e | ||
|
|
80ea826948 | ||
|
|
e7dc5136e5 | ||
|
|
1aba41c992 | ||
|
|
afaf4ef856 | ||
|
|
52480401c8 | ||
|
|
46a9c8ab8c | ||
|
|
a5568de3cc | ||
|
|
d629c97dd8 |
@@ -0,0 +1,4 @@
|
|||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
package-lock.json
|
||||||
|
pnpm-lock.yaml
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"printWidth": 120,
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"endOfLine": "auto"
|
||||||
|
}
|
||||||
@@ -1,7 +1,55 @@
|
|||||||
|
// 100% Incompatible Browser Suppression & Error Guardian
|
||||||
|
// CRITICAL: PeerTube's Angular app (my-app ngOnInit) relies on document.getElementById('incompatible-browser')
|
||||||
|
// to exist so it can do .className += " browser-ok" before calling this.loadUser()!
|
||||||
|
// Removing it from DOM causes a null pointer crash that breaks user session initialization!
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
try {
|
||||||
|
window.displayIncompatibleBrowser = function () {};
|
||||||
|
var neuterIncompatible = function () {
|
||||||
|
var el = document.getElementById('incompatible-browser');
|
||||||
|
if (el) {
|
||||||
|
if (!el.classList.contains('browser-ok')) {
|
||||||
|
el.classList.add('browser-ok');
|
||||||
|
}
|
||||||
|
el.style.setProperty('display', 'none', 'important');
|
||||||
|
el.style.setProperty('visibility', 'hidden', 'important');
|
||||||
|
el.style.setProperty('height', '0px', 'important');
|
||||||
|
el.style.setProperty('width', '0px', 'important');
|
||||||
|
el.style.setProperty('opacity', '0', 'important');
|
||||||
|
el.style.setProperty('pointer-events', 'none', 'important');
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
var dummy = document.createElement('div');
|
||||||
|
dummy.id = 'incompatible-browser';
|
||||||
|
dummy.className = 'browser-ok';
|
||||||
|
dummy.style.display = 'none';
|
||||||
|
(document.body || document.documentElement).appendChild(dummy);
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
neuterIncompatible();
|
||||||
|
if (document.readyState === 'loading') {
|
||||||
|
document.addEventListener('DOMContentLoaded', neuterIncompatible);
|
||||||
|
}
|
||||||
|
setInterval(neuterIncompatible, 1000);
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Immediate URL rewrite: redirect legacy /search/videos to /search
|
||||||
|
if (typeof window !== 'undefined' && window.location) {
|
||||||
|
if (window.location.pathname === '/search/videos' || window.location.pathname.startsWith('/search/videos/')) {
|
||||||
|
var targetSearch = window.location.search || '';
|
||||||
|
window.location.replace('/search' + targetSearch);
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
(function () {
|
(function () {
|
||||||
if (window.__YAKTUBE_ENGINE_LOADED__) return;
|
if (window.__YAKTUBE_ENGINE_LOADED__) return;
|
||||||
window.__YAKTUBE_ENGINE_LOADED__ = true;
|
window.__YAKTUBE_ENGINE_LOADED__ = true;
|
||||||
|
try {
|
||||||
|
localStorage.setItem('hide-mobile-msg', 'true');
|
||||||
|
sessionStorage.setItem('hide-mobile-msg', 'true');
|
||||||
|
} catch (e) {}
|
||||||
console.log('[YakTube] YakNet SSO, Custom Branding, A11y & On-Demand Engine Active');
|
console.log('[YakTube] YakNet SSO, Custom Branding, A11y & On-Demand Engine Active');
|
||||||
|
|
||||||
// Dynamic Instance Name Helper
|
// Dynamic Instance Name Helper
|
||||||
@@ -50,6 +98,52 @@ try {
|
|||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load official YakNet Web Component definition
|
||||||
|
if (
|
||||||
|
typeof customElements !== 'undefined' &&
|
||||||
|
!customElements.get('yaknet-account') &&
|
||||||
|
!document.getElementById('yaknet-account-script')
|
||||||
|
) {
|
||||||
|
var s = document.createElement('script');
|
||||||
|
s.id = 'yaknet-account-script';
|
||||||
|
s.src = 'https://auth.yakhub.com.tr/js/yaknet-account.js';
|
||||||
|
s.async = true;
|
||||||
|
document.head.appendChild(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Silent background SSO Probe Engine
|
||||||
|
function initSilentSSOProbe() {
|
||||||
|
var token = localStorage.getItem('access_token');
|
||||||
|
var isManualLogout = sessionStorage.getItem('yaknet_manual_logout');
|
||||||
|
if (
|
||||||
|
token ||
|
||||||
|
isManualLogout ||
|
||||||
|
window.location.search.includes('local=true') ||
|
||||||
|
window.location.search.includes('externalAuthError') ||
|
||||||
|
window.location.pathname.includes('/login')
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var iframeId = 'yaknet-sso-iframe-instance';
|
||||||
|
if (!document.getElementById(iframeId)) {
|
||||||
|
var iframe = document.createElement('iframe');
|
||||||
|
iframe.id = iframeId;
|
||||||
|
iframe.src = 'https://auth.yakhub.com.tr/sdk/sso-frame';
|
||||||
|
iframe.title = 'YakNet Oturum Kontrolü';
|
||||||
|
iframe.setAttribute('aria-hidden', 'true');
|
||||||
|
iframe.tabIndex = -1;
|
||||||
|
iframe.style.cssText =
|
||||||
|
'display:none!important;width:0!important;height:0!important;border:0!important;position:absolute!important;pointer-events:none!important;';
|
||||||
|
document.body.appendChild(iframe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (document.readyState === 'loading') {
|
||||||
|
document.addEventListener('DOMContentLoaded', initSilentSSOProbe);
|
||||||
|
} else {
|
||||||
|
initSilentSSOProbe();
|
||||||
|
}
|
||||||
|
|
||||||
function triggerYakNetOAuth() {
|
function triggerYakNetOAuth() {
|
||||||
sessionStorage.removeItem('yaknet_manual_logout');
|
sessionStorage.removeItem('yaknet_manual_logout');
|
||||||
var callbackUrl = 'https://yaktube.yakhub.com.tr/plugins/peertube-plugin-auth-yaknet/router/auth-callback';
|
var callbackUrl = 'https://yaktube.yakhub.com.tr/plugins/peertube-plugin-auth-yaknet/router/auth-callback';
|
||||||
@@ -77,10 +171,7 @@ try {
|
|||||||
var hasToken = localStorage.getItem('access_token') || localStorage.getItem('username');
|
var hasToken = localStorage.getItem('access_token') || localStorage.getItem('username');
|
||||||
if (hasToken) {
|
if (hasToken) {
|
||||||
console.log('[YakTube] YakNet session ended elsewhere. Clearing YakTube...');
|
console.log('[YakTube] YakNet session ended elsewhere. Clearing YakTube...');
|
||||||
try {
|
clearYakTubeAuthSession();
|
||||||
localStorage.clear();
|
|
||||||
sessionStorage.clear();
|
|
||||||
} catch (e) {}
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,20 +194,32 @@ try {
|
|||||||
} else if (e.detail && e.detail.authenticated === false) {
|
} else if (e.detail && e.detail.authenticated === false) {
|
||||||
var hasToken = localStorage.getItem('access_token') || localStorage.getItem('username');
|
var hasToken = localStorage.getItem('access_token') || localStorage.getItem('username');
|
||||||
if (hasToken) {
|
if (hasToken) {
|
||||||
try {
|
clearYakTubeAuthSession();
|
||||||
localStorage.clear();
|
|
||||||
sessionStorage.clear();
|
|
||||||
} catch (err) {}
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Clear YakTube auth session and cloud search cache safely
|
||||||
|
function clearYakTubeAuthSession() {
|
||||||
|
try {
|
||||||
|
localStorage.removeItem('access_token');
|
||||||
|
localStorage.removeItem('refresh_token');
|
||||||
|
localStorage.removeItem('token_type');
|
||||||
|
localStorage.removeItem('id');
|
||||||
|
localStorage.removeItem('username');
|
||||||
|
localStorage.removeItem('displayName');
|
||||||
|
localStorage.removeItem('email');
|
||||||
|
localStorage.removeItem('role');
|
||||||
|
localStorage.removeItem('yaktube_recent_searches');
|
||||||
|
sessionStorage.clear();
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
// Unified single sign-out for YakTube and YakNet
|
// Unified single sign-out for YakTube and YakNet
|
||||||
function performUnifiedLogout() {
|
function performUnifiedLogout() {
|
||||||
|
clearYakTubeAuthSession();
|
||||||
try {
|
try {
|
||||||
localStorage.clear();
|
|
||||||
sessionStorage.clear();
|
|
||||||
sessionStorage.setItem('yaknet_manual_logout', 'true');
|
sessionStorage.setItem('yaknet_manual_logout', 'true');
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
window.location.replace(
|
window.location.replace(
|
||||||
@@ -284,84 +387,114 @@ try {
|
|||||||
var isAuth = !!token && !!uName;
|
var isAuth = !!token && !!uName;
|
||||||
|
|
||||||
if (headerRight) {
|
if (headerRight) {
|
||||||
var defaultLoginLink = headerRight.querySelector('my-login-link, a[href*="/login"], .login-button');
|
|
||||||
var liveWidget = headerRight.querySelector('#yaknet-header-account-widget');
|
var liveWidget = headerRight.querySelector('#yaknet-header-account-widget');
|
||||||
|
|
||||||
// Always hide duplicate native login link in favor of unified YakNet component
|
if (isAuth) {
|
||||||
if (defaultLoginLink) {
|
// 1. AUTHENTICATED: Add class to body & Hide ALL native login links completely
|
||||||
defaultLoginLink.style.display = 'none';
|
document.body.classList.add('yaktube-user-logged-in');
|
||||||
defaultLoginLink.setAttribute('aria-hidden', 'true');
|
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) {
|
if (!liveWidget) {
|
||||||
var widgetWrap = document.createElement('div');
|
var widgetWrap = document.createElement('div');
|
||||||
widgetWrap.id = 'yaknet-header-account-widget';
|
widgetWrap.id = 'yaknet-header-account-widget';
|
||||||
widgetWrap.className = 'yaknet-header-widget';
|
widgetWrap.className = 'yaknet-header-widget';
|
||||||
widgetWrap.style.display = 'inline-flex';
|
widgetWrap.style.display = 'inline-flex';
|
||||||
widgetWrap.style.alignItems = 'center';
|
widgetWrap.style.alignItems = 'center';
|
||||||
widgetWrap.style.marginRight = '8px';
|
widgetWrap.style.marginRight = '8px';
|
||||||
|
|
||||||
widgetWrap.innerHTML =
|
widgetWrap.innerHTML =
|
||||||
'<yaknet-account ' +
|
'<yaknet-account ' +
|
||||||
'client-id="01a03c41-f758-721e-b927-619bffde5c23" ' +
|
'client-id="01a03c41-f758-721e-b927-619bffde5c23" ' +
|
||||||
'redirect-uri="https://yaktube.yakhub.com.tr/plugins/peertube-plugin-auth-yaknet/router/auth-callback" ' +
|
'redirect-uri="https://yaktube.yakhub.com.tr/plugins/peertube-plugin-auth-yaknet/router/auth-callback" ' +
|
||||||
'base-url="https://auth.yakhub.com.tr" ' +
|
'base-url="https://auth.yakhub.com.tr" ' +
|
||||||
'login-url="https://auth.yakhub.com.tr/oauth/authorize?client_id=01a03c41-f758-721e-b927-619bffde5c23&redirect_uri=https%3A%2F%2Fyaktube.yakhub.com.tr%2Fplugins%2Fpeertube-plugin-auth-yaknet%2Frouter%2Fauth-callback&response_type=code&scope=" ' +
|
'login-url="/login" ' +
|
||||||
(isAuth ? 'authenticated="true" ' : 'authenticated="false" ') +
|
'authenticated="true" ' +
|
||||||
'user-name="' +
|
'user-name="' +
|
||||||
displayName.replace(/"/g, '"') +
|
displayName.replace(/"/g, '"') +
|
||||||
'" ' +
|
'" ' +
|
||||||
'user-email="' +
|
'user-email="' +
|
||||||
emailStr.replace(/"/g, '"') +
|
emailStr.replace(/"/g, '"') +
|
||||||
'" ' +
|
'" ' +
|
||||||
'theme="dark">' +
|
'theme="dark">' +
|
||||||
'</yaknet-account>';
|
'</yaknet-account>';
|
||||||
|
|
||||||
var targetSibling =
|
var targetSibling =
|
||||||
headerRight.querySelector('my-user-menu') ||
|
headerRight.querySelector('my-user-menu') ||
|
||||||
headerRight.querySelector('.user-menu') ||
|
headerRight.querySelector('.user-menu') ||
|
||||||
headerRight.querySelector('.settings-button') ||
|
headerRight.querySelector('.settings-button') ||
|
||||||
headerRight.querySelector('my-user-notifications') ||
|
headerRight.querySelector('my-user-notifications') ||
|
||||||
headerRight.querySelector('my-notification-bell');
|
headerRight.querySelector('my-notification-bell');
|
||||||
|
|
||||||
if (targetSibling && targetSibling.parentElement === headerRight) {
|
if (targetSibling && targetSibling.parentElement === headerRight) {
|
||||||
headerRight.insertBefore(widgetWrap, targetSibling);
|
headerRight.insertBefore(widgetWrap, targetSibling);
|
||||||
|
} else {
|
||||||
|
headerRight.prepend(widgetWrap);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
headerRight.prepend(widgetWrap);
|
var el = liveWidget.querySelector('yaknet-account');
|
||||||
|
if (el) {
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var el = liveWidget.querySelector('yaknet-account');
|
// 2. GUEST / NOT LOGGED IN:
|
||||||
if (el) {
|
document.body.classList.remove('yaktube-user-logged-in');
|
||||||
var authAttr = isAuth ? 'true' : 'false';
|
if (liveWidget) {
|
||||||
if (el.getAttribute('authenticated') !== authAttr || el.getAttribute('user-name') !== displayName) {
|
liveWidget.remove();
|
||||||
el.setAttribute('authenticated', authAttr);
|
|
||||||
el.setAttribute('user-name', displayName);
|
|
||||||
el.setAttribute('user-email', emailStr);
|
|
||||||
if (typeof el.syncStateFromAttributes === 'function') {
|
|
||||||
el.syncStateFromAttributes();
|
|
||||||
el.render();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 = 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');
|
||||||
|
var spanText = loginAnchor.querySelector('span');
|
||||||
|
if (spanText) {
|
||||||
|
spanText.textContent = 'YakNet ile Giriş Yap';
|
||||||
|
} else {
|
||||||
|
loginAnchor.textContent = 'YakNet ile Giriş Yap';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,36 +594,50 @@ try {
|
|||||||
|
|
||||||
injectYakNetSSO();
|
injectYakNetSSO();
|
||||||
|
|
||||||
// Replace all login buttons labels and titles
|
// Check auth status for login button rendering
|
||||||
document
|
var tokenVal = localStorage.getItem('access_token');
|
||||||
.querySelectorAll(
|
var userVal = localStorage.getItem('username');
|
||||||
'my-login-link, a[href*="/login"], a[title*="Giriş sayfasına git"], [aria-label*="Giriş sayfasına git"]'
|
var isAlreadyAuth = !!tokenVal && !!userVal;
|
||||||
)
|
|
||||||
.forEach(function (el) {
|
if (!isAlreadyAuth) {
|
||||||
if (el.getAttribute('title') && el.getAttribute('title').includes('Giriş sayfasına git')) {
|
// Replace all login buttons labels and titles ONLY for guests
|
||||||
el.setAttribute('title', 'YakNet ile Giriş Yap');
|
document
|
||||||
}
|
.querySelectorAll(
|
||||||
if (el.getAttribute('aria-label') && el.getAttribute('aria-label').includes('Giriş sayfasına git')) {
|
'my-login-link, a[href*="/login"], a[title*="Giriş sayfasına git"], [aria-label*="Giriş sayfasına git"]'
|
||||||
el.setAttribute('aria-label', 'YakNet ile Giriş Yap');
|
)
|
||||||
}
|
.forEach(function (el) {
|
||||||
var anchor = el.tagName.toLowerCase() === 'a' ? el : el.querySelector('a');
|
if (el.getAttribute('title') && el.getAttribute('title').includes('Giriş sayfasına git')) {
|
||||||
if (anchor) {
|
el.setAttribute('title', 'YakNet ile Giriş Yap');
|
||||||
anchor.setAttribute('title', 'YakNet ile Giriş Yap');
|
}
|
||||||
anchor.setAttribute('aria-label', 'YakNet ile Giriş Yap');
|
if (el.getAttribute('aria-label') && el.getAttribute('aria-label').includes('Giriş sayfasına git')) {
|
||||||
var spans = anchor.querySelectorAll('span');
|
el.setAttribute('aria-label', 'YakNet ile Giriş Yap');
|
||||||
spans.forEach(function (s) {
|
}
|
||||||
if (
|
var anchor = el.tagName.toLowerCase() === 'a' ? el : el.querySelector('a');
|
||||||
s.textContent.includes('Giriş sayfasına git') ||
|
if (anchor) {
|
||||||
s.textContent.trim() === 'Giriş' ||
|
anchor.setAttribute('title', 'YakNet ile Giriş Yap');
|
||||||
s.textContent.trim() === 'Giriş yap'
|
anchor.setAttribute('aria-label', 'YakNet ile Giriş Yap');
|
||||||
) {
|
var spans = anchor.querySelectorAll('span');
|
||||||
s.textContent = 'YakNet ile Giriş Yap';
|
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
|
// Aggressively remove generic Framasoft Open-in-App / Play Store banners
|
||||||
|
document
|
||||||
|
.querySelectorAll(
|
||||||
|
'.mobile-msg, [class*="mobile-msg"], button[title*="Bu mesajı kapat"], button[aria-label*="Bu mesajı kapat"]'
|
||||||
|
)
|
||||||
|
.forEach(function (m) {
|
||||||
|
m.remove();
|
||||||
|
});
|
||||||
var genericAppBanners = document.querySelectorAll(
|
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"]'
|
'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"]'
|
||||||
);
|
);
|
||||||
@@ -797,7 +944,22 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getVideoElement() {
|
function getVideoElement() {
|
||||||
return document.querySelector('video');
|
// 1. Direct video tag in DOM
|
||||||
|
var v = document.querySelector('video');
|
||||||
|
if (v) return v;
|
||||||
|
|
||||||
|
// 2. Video inside iframes (e.g. embed player)
|
||||||
|
var iframes = document.querySelectorAll('iframe');
|
||||||
|
for (var i = 0; i < iframes.length; i++) {
|
||||||
|
try {
|
||||||
|
var doc = iframes[i].contentDocument || (iframes[i].contentWindow && iframes[i].contentWindow.document);
|
||||||
|
if (doc) {
|
||||||
|
var iv = doc.querySelector('video');
|
||||||
|
if (iv) return iv;
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatTime(seconds) {
|
function formatTime(seconds) {
|
||||||
@@ -1528,6 +1690,20 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkAndInjectSearchResults() {
|
function checkAndInjectSearchResults() {
|
||||||
|
// Clean up stray 404 error mascot pages if on search
|
||||||
|
try {
|
||||||
|
var errPages = document.querySelectorAll('my-error-page');
|
||||||
|
errPages.forEach(function (ep) {
|
||||||
|
ep.remove();
|
||||||
|
});
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
|
// Instant URL fixer: redirect legacy /search/videos to native /search
|
||||||
|
if (window.location.pathname === '/search/videos' || window.location.pathname.startsWith('/search/videos/')) {
|
||||||
|
window.location.replace('/search' + window.location.search);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var url = new URL(window.location.href);
|
var url = new URL(window.location.href);
|
||||||
var searchParam = url.searchParams.get('search');
|
var searchParam = url.searchParams.get('search');
|
||||||
|
|
||||||
@@ -1808,7 +1984,27 @@ try {
|
|||||||
var activeVoiceRec = null;
|
var activeVoiceRec = null;
|
||||||
var isVoiceListening = false;
|
var isVoiceListening = false;
|
||||||
|
|
||||||
// Dynamic Search History & Trending Helpers
|
// Dynamic Search History & Trending Helpers with YakNet Cloud Sync
|
||||||
|
function isUserLoggedIn() {
|
||||||
|
try {
|
||||||
|
var token = localStorage.getItem('access_token');
|
||||||
|
var username = localStorage.getItem('username');
|
||||||
|
return Boolean(token || username);
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isAccountSyncEnabled() {
|
||||||
|
try {
|
||||||
|
var userPref = localStorage.getItem('yaktube_sync_search_history');
|
||||||
|
if (userPref === 'false') return false;
|
||||||
|
return isUserLoggedIn();
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getRecentSearches() {
|
function getRecentSearches() {
|
||||||
try {
|
try {
|
||||||
var data = localStorage.getItem('yaktube_recent_searches');
|
var data = localStorage.getItem('yaktube_recent_searches');
|
||||||
@@ -1819,12 +2015,81 @@ try {
|
|||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
// Default initial recent searches for first-time visitors
|
// Default initial recent searches for first-time visitors
|
||||||
var defaults = ['Tarkan', 'Barış Manço', 'Yapay Zeka', 'Canlı Haber'];
|
var defaults = ['Tarkan', 'Barış Manço', 'Yapay Zeka', 'Canlı Haber'];
|
||||||
try {
|
if (!isUserLoggedIn()) {
|
||||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(defaults));
|
try {
|
||||||
} catch (e) {}
|
localStorage.setItem('yaktube_recent_searches', JSON.stringify(defaults));
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
return defaults;
|
return defaults;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function callCloudSearchHistory(method, queryParams, body, onSuccess, onError) {
|
||||||
|
var token = localStorage.getItem('access_token');
|
||||||
|
var email = localStorage.getItem('email');
|
||||||
|
var username = localStorage.getItem('username');
|
||||||
|
var headers = {};
|
||||||
|
if (body) headers['Content-Type'] = 'application/json';
|
||||||
|
if (token) headers['Authorization'] = 'Bearer ' + token;
|
||||||
|
if (email) headers['X-User-Email'] = email;
|
||||||
|
if (username) headers['X-User-Username'] = username;
|
||||||
|
|
||||||
|
var authUrl = 'https://auth.yakhub.com.tr/api/yaktube/search-history' + (queryParams || '');
|
||||||
|
var bridgeUrl = '/api-custom/search-history' + (queryParams || '');
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
method: method,
|
||||||
|
headers: headers,
|
||||||
|
credentials: 'include'
|
||||||
|
};
|
||||||
|
if (body) options.body = JSON.stringify(body);
|
||||||
|
|
||||||
|
fetch(authUrl, options)
|
||||||
|
.then(function (res) {
|
||||||
|
if (!res.ok) throw new Error('Auth server status ' + res.status);
|
||||||
|
return res.json();
|
||||||
|
})
|
||||||
|
.then(function (data) {
|
||||||
|
if (typeof onSuccess === 'function') onSuccess(data);
|
||||||
|
})
|
||||||
|
.catch(function () {
|
||||||
|
// Fallback to local PeerTube bridge proxy
|
||||||
|
fetch(bridgeUrl, options)
|
||||||
|
.then(function (res) {
|
||||||
|
return res.json();
|
||||||
|
})
|
||||||
|
.then(function (data) {
|
||||||
|
if (typeof onSuccess === 'function') onSuccess(data);
|
||||||
|
})
|
||||||
|
.catch(function (e) {
|
||||||
|
if (typeof onError === 'function') onError(e);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var isSyncingHistory = false;
|
||||||
|
function syncCloudSearchHistory(callback) {
|
||||||
|
if (!isAccountSyncEnabled() || isSyncingHistory) return;
|
||||||
|
isSyncingHistory = true;
|
||||||
|
|
||||||
|
callCloudSearchHistory(
|
||||||
|
'GET',
|
||||||
|
'',
|
||||||
|
null,
|
||||||
|
function (data) {
|
||||||
|
isSyncingHistory = false;
|
||||||
|
if (data && data.status === 'success' && Array.isArray(data.history)) {
|
||||||
|
if (data.history.length > 0) {
|
||||||
|
localStorage.setItem('yaktube_recent_searches', JSON.stringify(data.history));
|
||||||
|
}
|
||||||
|
if (typeof callback === 'function') callback();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function () {
|
||||||
|
isSyncingHistory = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function saveRecentSearch(query) {
|
function saveRecentSearch(query) {
|
||||||
if (!query || query.trim().length < 2) return;
|
if (!query || query.trim().length < 2) return;
|
||||||
var q = query.trim();
|
var q = query.trim();
|
||||||
@@ -1834,15 +2099,25 @@ try {
|
|||||||
return item.toLowerCase() !== q.toLowerCase();
|
return item.toLowerCase() !== q.toLowerCase();
|
||||||
});
|
});
|
||||||
list.unshift(q);
|
list.unshift(q);
|
||||||
if (list.length > 8) list = list.slice(0, 8);
|
if (list.length > 12) list = list.slice(0, 12);
|
||||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(list));
|
localStorage.setItem('yaktube_recent_searches', JSON.stringify(list));
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
|
// If user is logged in and sync is active, sync with YakNet account
|
||||||
|
if (isAccountSyncEnabled()) {
|
||||||
|
callCloudSearchHistory('POST', '', { query: q, device_name: 'YakTube Web' });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearRecentSearches() {
|
function clearRecentSearches() {
|
||||||
try {
|
try {
|
||||||
localStorage.removeItem('yaktube_recent_searches');
|
localStorage.removeItem('yaktube_recent_searches');
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
|
if (isAccountSyncEnabled()) {
|
||||||
|
callCloudSearchHistory('DELETE', '', null);
|
||||||
|
}
|
||||||
|
|
||||||
renderDynamicSearchChips();
|
renderDynamicSearchChips();
|
||||||
announce('Arama geçmişi temizlendi.');
|
announce('Arama geçmişi temizlendi.');
|
||||||
}
|
}
|
||||||
@@ -1880,17 +2155,49 @@ try {
|
|||||||
if (!container) return;
|
if (!container) return;
|
||||||
|
|
||||||
var recent = getRecentSearches();
|
var recent = getRecentSearches();
|
||||||
|
var loggedIn = isUserLoggedIn();
|
||||||
|
var syncEnabled = isAccountSyncEnabled();
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
// 1. Recent searches section (if any)
|
// 1. Recent searches section
|
||||||
|
html +=
|
||||||
|
'<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px;">' +
|
||||||
|
'<div class="yaktube-modal-section-title" style="margin-bottom: 0;">🕒 Son Aramalarınız</div>' +
|
||||||
|
'<div style="display: flex; align-items: center; gap: 8px;">';
|
||||||
|
|
||||||
|
if (loggedIn) {
|
||||||
|
var syncTitle = syncEnabled
|
||||||
|
? 'YakNet Bulut Eşitlemesi Aktif (Tüm cihazlarınızda senkronize edilir. Kapatmak için tıklayın.)'
|
||||||
|
: 'Eşitleme Kapalı (Aramalar sadece bu cihazda saklanır. Açmak için tıklayın.)';
|
||||||
|
var syncText = syncEnabled ? '☁️ Eşitleme: Açık' : '☁️ Eşitleme: Kapalı';
|
||||||
|
var syncBg = syncEnabled ? '#0f766e' : '#334155';
|
||||||
|
var syncColor = syncEnabled ? '#5eead4' : '#94a3b8';
|
||||||
|
html +=
|
||||||
|
'<button id="yaktube-sync-toggle-btn" style="background: ' +
|
||||||
|
syncBg +
|
||||||
|
'; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; padding: 2px 8px; color: ' +
|
||||||
|
syncColor +
|
||||||
|
'; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.2s ease;" title="' +
|
||||||
|
syncTitle +
|
||||||
|
'" aria-label="' +
|
||||||
|
syncTitle +
|
||||||
|
'">' +
|
||||||
|
syncText +
|
||||||
|
'</button>';
|
||||||
|
} else {
|
||||||
|
html +=
|
||||||
|
'<span style="font-size: 11px; color: #94a3b8; background: #1e293b; border-radius: 6px; padding: 2px 8px;" title="Misafir modundasınız, aramalar sadece bu cihazda saklanır">🔒 Bu Cihazda</span>';
|
||||||
|
}
|
||||||
|
|
||||||
if (recent.length > 0) {
|
if (recent.length > 0) {
|
||||||
html +=
|
html +=
|
||||||
'<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">' +
|
'<button id="yaktube-clear-recent-btn" style="background: transparent; border: none; color: #ff8f37; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline;" aria-label="Arama geçmişini temizle">Geçmişi Temizle</button>';
|
||||||
'<div class="yaktube-modal-section-title" style="margin-bottom: 0;">🕒 Son Aramalarınız</div>' +
|
}
|
||||||
'<button id="yaktube-clear-recent-btn" style="background: transparent; border: none; color: #ff8f37; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline;" aria-label="Arama geçmişini temizle">Geçmişi Temizle</button>' +
|
|
||||||
'</div>' +
|
|
||||||
'<div class="yaktube-modal-chips-grid" style="margin-bottom: 18px;">';
|
|
||||||
|
|
||||||
|
html += '</div></div>';
|
||||||
|
|
||||||
|
if (recent.length > 0) {
|
||||||
|
html += '<div class="yaktube-modal-chips-grid" style="margin-bottom: 18px;">';
|
||||||
recent.forEach(function (term) {
|
recent.forEach(function (term) {
|
||||||
var safeTerm = term.replace(/"/g, '"');
|
var safeTerm = term.replace(/"/g, '"');
|
||||||
html +=
|
html +=
|
||||||
@@ -1945,6 +2252,24 @@ try {
|
|||||||
clearRecentSearches();
|
clearRecentSearches();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var syncToggleBtn = container.querySelector('#yaktube-sync-toggle-btn');
|
||||||
|
if (syncToggleBtn) {
|
||||||
|
syncToggleBtn.addEventListener('click', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
var current = localStorage.getItem('yaktube_sync_search_history') !== 'false';
|
||||||
|
var next = !current;
|
||||||
|
localStorage.setItem('yaktube_sync_search_history', next ? 'true' : 'false');
|
||||||
|
if (next) {
|
||||||
|
announce('YakNet arama geçmişi eşitlemesi açıldı.');
|
||||||
|
syncCloudSearchHistory(renderDynamicSearchChips);
|
||||||
|
} else {
|
||||||
|
announce('Arama geçmişi eşitlemesi kapatıldı. Aramalar sadece bu cihazda saklanacak.');
|
||||||
|
}
|
||||||
|
renderDynamicSearchChips();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createFullSearchModal() {
|
function createFullSearchModal() {
|
||||||
@@ -2028,7 +2353,7 @@ try {
|
|||||||
saveRecentSearch(q);
|
saveRecentSearch(q);
|
||||||
announce('"' + q + '" için arama yapılıyor...', true);
|
announce('"' + q + '" için arama yapılıyor...', true);
|
||||||
closeFullSearchModal();
|
closeFullSearchModal();
|
||||||
window.location.href = '/search/videos?search=' + encodeURIComponent(q);
|
window.location.href = '/search?search=' + encodeURIComponent(q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.__yaktube_execute_search__ = executeSearch;
|
window.__yaktube_execute_search__ = executeSearch;
|
||||||
@@ -2073,6 +2398,7 @@ try {
|
|||||||
modal.classList.add('yaktube-modal-open');
|
modal.classList.add('yaktube-modal-open');
|
||||||
modal.style.display = 'flex';
|
modal.style.display = 'flex';
|
||||||
renderDynamicSearchChips();
|
renderDynamicSearchChips();
|
||||||
|
syncCloudSearchHistory(renderDynamicSearchChips);
|
||||||
|
|
||||||
var inp = modal.querySelector('#yaktube-modal-input');
|
var inp = modal.querySelector('#yaktube-modal-input');
|
||||||
var clearBtn = modal.querySelector('#yaktube-modal-clear-btn');
|
var clearBtn = modal.querySelector('#yaktube-modal-clear-btn');
|
||||||
@@ -2159,7 +2485,7 @@ try {
|
|||||||
announce('"' + transcript + '" için arama başlatılıyor...', true);
|
announce('"' + transcript + '" için arama başlatılıyor...', true);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
closeFullSearchModal();
|
closeFullSearchModal();
|
||||||
window.location.href = '/search/videos?search=' + encodeURIComponent(transcript);
|
window.location.href = '/search?search=' + encodeURIComponent(transcript);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2320,6 +2646,13 @@ try {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Automatically trigger cloud search history pull on startup if logged in
|
||||||
|
try {
|
||||||
|
if (isAccountSyncEnabled()) {
|
||||||
|
syncCloudSearchHistory();
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
// 7.5. Reactive Hybrid Related Videos Engine (Watch Page)
|
// 7.5. Reactive Hybrid Related Videos Engine (Watch Page)
|
||||||
var currentActiveVideoKey = null;
|
var currentActiveVideoKey = null;
|
||||||
var isFetchingRelated = false;
|
var isFetchingRelated = false;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "peertube-plugin-yaktube-ondemand",
|
"name": "peertube-plugin-yaktube-ondemand",
|
||||||
"version": "1.4.11",
|
"version": "1.4.28",
|
||||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"library": "./main.js",
|
"library": "./main.js",
|
||||||
|
|||||||
@@ -1,3 +1,29 @@
|
|||||||
|
/* 100% Elimination of PeerTube Mobile Open-in-App & Incompatible Browser Banners */
|
||||||
|
#incompatible-browser,
|
||||||
|
.alert-light#incompatible-browser,
|
||||||
|
div[id='incompatible-browser'],
|
||||||
|
.incompatible-browser,
|
||||||
|
.mobile-msg,
|
||||||
|
my-header .mobile-msg,
|
||||||
|
[class*='mobile-msg'],
|
||||||
|
button[title*='Bu mesajı kapat'],
|
||||||
|
button[aria-label*='Bu mesajı kapat'],
|
||||||
|
button[title*='Dismiss'],
|
||||||
|
.msg.ellipsis,
|
||||||
|
.peertube-button-link.secondary-button {
|
||||||
|
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: -999999 !important;
|
||||||
|
clip: rect(0, 0, 0, 0) !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* Permanent Aggressive Suppression of Generic JoinPeerTube / Framasoft Open-in-App Banners */
|
/* Permanent Aggressive Suppression of Generic JoinPeerTube / Framasoft Open-in-App Banners */
|
||||||
my-open-app,
|
my-open-app,
|
||||||
my-open-in-app,
|
my-open-in-app,
|
||||||
@@ -920,3 +946,17 @@ body.yaktube-theater-mode .video-js {
|
|||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Suppress 404 Mascot and Error Page on Search results */
|
||||||
|
body:has(#yaktube-ondemand-container) my-error-page,
|
||||||
|
#yaktube-ondemand-container ~ my-error-page,
|
||||||
|
my-error-page:has(~ #yaktube-ondemand-container),
|
||||||
|
my-error-page {
|
||||||
|
/* Only hide if search param is active */
|
||||||
|
}
|
||||||
|
body:has(#yaktube-ondemand-container) my-error-page {
|
||||||
|
display: none !important;
|
||||||
|
visibility: hidden !important;
|
||||||
|
height: 0 !important;
|
||||||
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user