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 | |
|---|---|---|---|
|
|
c6e5abf87e | ||
|
|
e161dea9da | ||
|
|
6fc0f0ef97 | ||
|
|
c4fc917677 |
+1
-1
@@ -1,4 +1,4 @@
|
||||
node_modules/
|
||||
docs/
|
||||
*.log
|
||||
.DS_Store
|
||||
dist/
|
||||
@@ -0,0 +1,4 @@
|
||||
docs/
|
||||
*.log
|
||||
.git
|
||||
.github
|
||||
@@ -481,6 +481,35 @@
|
||||
|
||||
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"]'
|
||||
@@ -519,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');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1793,6 +1823,125 @@
|
||||
var activeVoiceRec = null;
|
||||
var isVoiceListening = false;
|
||||
|
||||
// Dynamic Search History & Trending Helpers
|
||||
function getRecentSearches() {
|
||||
try {
|
||||
var data = localStorage.getItem('yaktube_recent_searches');
|
||||
return data ? JSON.parse(data) : [];
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function saveRecentSearch(query) {
|
||||
if (!query || query.trim().length < 2) return;
|
||||
var q = query.trim();
|
||||
try {
|
||||
var list = getRecentSearches();
|
||||
list = list.filter(function (item) {
|
||||
return item.toLowerCase() !== q.toLowerCase();
|
||||
});
|
||||
list.unshift(q);
|
||||
if (list.length > 8) list = list.slice(0, 8);
|
||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(list));
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function clearRecentSearches() {
|
||||
try {
|
||||
localStorage.removeItem('yaktube_recent_searches');
|
||||
} catch (e) {}
|
||||
renderDynamicSearchChips();
|
||||
announce('Arama geçmişi temizlendi.');
|
||||
}
|
||||
|
||||
var popularTrendingQueries = [
|
||||
{ title: '🎵 Türkçe Pop', q: 'Türkçe Pop' },
|
||||
{ title: '🎸 Anadolu Rock', q: 'Anadolu Rock' },
|
||||
{ title: '🤖 Yapay Zeka', q: 'Yapay Zeka' },
|
||||
{ title: '💻 Yazılım Dersleri', q: 'Yazılım Dersleri' },
|
||||
{ title: '🎧 Sesli Kitap & Radyo Tiyatrosu', q: 'Sesli Kitap' },
|
||||
{ title: '📺 Canlı Haber', q: 'Canlı Haber' },
|
||||
{ title: '🌍 Bilim & Belgesel', q: 'Bilim Belgeseli' },
|
||||
{ title: '🎼 Akustik Canlı Performans', q: 'Akustik Canlı' },
|
||||
{ title: '🎙️ Podcast & Söyleşi', q: 'Podcast Türkçe' }
|
||||
];
|
||||
|
||||
function renderDynamicSearchChips() {
|
||||
var modal = document.getElementById('yaktube-full-search-modal');
|
||||
if (!modal) return;
|
||||
|
||||
var container = modal.querySelector('#yaktube-modal-dynamic-chips-section');
|
||||
if (!container) return;
|
||||
|
||||
var recent = getRecentSearches();
|
||||
var html = '';
|
||||
|
||||
// 1. Recent searches section (if any)
|
||||
if (recent.length > 0) {
|
||||
html +=
|
||||
'<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">' +
|
||||
'<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;">';
|
||||
|
||||
recent.forEach(function (term) {
|
||||
var safeTerm = term.replace(/"/g, '"');
|
||||
html +=
|
||||
'<button class="yaktube-modal-chip yaktube-recent-chip" data-query="' +
|
||||
safeTerm +
|
||||
'" aria-label="Son arama: ' +
|
||||
safeTerm +
|
||||
'">🕒 ' +
|
||||
safeTerm +
|
||||
'</button>';
|
||||
});
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
// 2. Popular & Trending searches section
|
||||
html +=
|
||||
'<div class="yaktube-modal-section-title">🔥 Hızlı ve Popüler Aramalar</div>' +
|
||||
'<div class="yaktube-modal-chips-grid">';
|
||||
|
||||
popularTrendingQueries.forEach(function (item) {
|
||||
var safeQ = item.q.replace(/"/g, '"');
|
||||
html +=
|
||||
'<button class="yaktube-modal-chip" data-query="' +
|
||||
safeQ +
|
||||
'" aria-label="Popüler arama: ' +
|
||||
safeQ +
|
||||
'">' +
|
||||
item.title +
|
||||
'</button>';
|
||||
});
|
||||
html += '</div>';
|
||||
|
||||
container.innerHTML = html;
|
||||
|
||||
// Attach click events
|
||||
container.querySelectorAll('.yaktube-modal-chip').forEach(function (chip) {
|
||||
chip.addEventListener('click', function () {
|
||||
var query = chip.getAttribute('data-query');
|
||||
var inp = modal.querySelector('#yaktube-modal-input');
|
||||
if (inp) inp.value = query;
|
||||
if (typeof window.__yaktube_execute_search__ === 'function') {
|
||||
window.__yaktube_execute_search__(query);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var clearBtn = container.querySelector('#yaktube-clear-recent-btn');
|
||||
if (clearBtn) {
|
||||
clearBtn.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
clearRecentSearches();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function createFullSearchModal() {
|
||||
var existingModal = document.getElementById('yaktube-full-search-modal');
|
||||
if (existingModal) return existingModal;
|
||||
@@ -1881,11 +2030,14 @@
|
||||
function executeSearch(query) {
|
||||
var q = (query || inp.value || '').trim();
|
||||
if (q) {
|
||||
saveRecentSearch(q);
|
||||
announce('"' + q + '" için arama yapılıyor...', true);
|
||||
closeFullSearchModal();
|
||||
window.location.href = '/search/videos?search=' + encodeURIComponent(q);
|
||||
}
|
||||
}
|
||||
window.__yaktube_execute_search__ = executeSearch;
|
||||
renderDynamicSearchChips();
|
||||
|
||||
submitBtn.addEventListener('click', function () {
|
||||
executeSearch();
|
||||
@@ -1925,6 +2077,7 @@
|
||||
var modal = createFullSearchModal();
|
||||
modal.classList.add('yaktube-modal-open');
|
||||
modal.style.display = 'flex';
|
||||
renderDynamicSearchChips();
|
||||
|
||||
var inp = modal.querySelector('#yaktube-modal-input');
|
||||
var clearBtn = modal.querySelector('#yaktube-modal-clear-btn');
|
||||
@@ -2736,7 +2889,12 @@
|
||||
headerButtons.prepend(installBtn);
|
||||
}
|
||||
|
||||
function isYakTubeInstance() {
|
||||
return window.location.hostname.includes('yaktube.yakhub.com.tr') || getInstanceName() === 'YakTube';
|
||||
}
|
||||
|
||||
function injectApkDownloadButton() {
|
||||
if (!isYakTubeInstance()) return;
|
||||
// 1. If inside APK: NEVER show APK button
|
||||
if (isInsideYakTubeApp) {
|
||||
var existBtnApp = document.getElementById('yaktube-apk-download-btn');
|
||||
@@ -2781,6 +2939,7 @@
|
||||
}
|
||||
|
||||
function injectSidebarApkLink() {
|
||||
if (!isYakTubeInstance()) return;
|
||||
// If inside APK: NEVER show in sidebar
|
||||
if (isInsideYakTubeApp) {
|
||||
var existLink = document.getElementById('yaktube-sidebar-apk-link');
|
||||
@@ -2828,3 +2987,132 @@
|
||||
});
|
||||
checkAndInjectWatchPageComments();
|
||||
})();
|
||||
|
||||
// 5. Background Play (Screen-Off / Minimize) & MediaSession Lock-Screen Controls
|
||||
(function initBackgroundPlaybackEngine() {
|
||||
var videoState = {
|
||||
hasPlayed: false,
|
||||
pausedByUser: false,
|
||||
pausedAt: null
|
||||
};
|
||||
|
||||
function attachVideoListeners(video) {
|
||||
if (!video || video.hasAttribute('data-yaktube-bgplay-hooked')) return;
|
||||
video.setAttribute('data-yaktube-bgplay-hooked', 'true');
|
||||
|
||||
video.addEventListener('play', function () {
|
||||
videoState.hasPlayed = true;
|
||||
videoState.pausedByUser = false;
|
||||
updateMediaSessionMetadata(video);
|
||||
});
|
||||
|
||||
video.addEventListener('pause', function () {
|
||||
videoState.pausedAt = Date.now();
|
||||
// If document is visible when paused, it was paused manually by the user
|
||||
if (!document.hidden) {
|
||||
videoState.pausedByUser = true;
|
||||
}
|
||||
});
|
||||
|
||||
video.addEventListener('ended', function () {
|
||||
videoState.hasPlayed = false;
|
||||
videoState.pausedByUser = true;
|
||||
});
|
||||
|
||||
video.addEventListener('timeupdate', function () {
|
||||
updateMediaSessionPosition(video);
|
||||
});
|
||||
}
|
||||
|
||||
function handleVisibilityChange() {
|
||||
if (!document.hidden) return; // Screen is active
|
||||
|
||||
var video = getVideoElement();
|
||||
if (!video) return;
|
||||
|
||||
// If user hasn't played or deliberately paused, do not auto-resume
|
||||
if (!videoState.hasPlayed || videoState.pausedByUser) return;
|
||||
|
||||
var now = Date.now();
|
||||
if (videoState.pausedAt && now - videoState.pausedAt > 1500 && videoState.pausedByUser) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Resume playback when screen locks or tab switches
|
||||
setTimeout(function () {
|
||||
if (video.paused && !videoState.pausedByUser) {
|
||||
video.play().catch(function () {});
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
|
||||
document.addEventListener('visibilitychange', handleVisibilityChange, false);
|
||||
document.addEventListener('webkitvisibilitychange', handleVisibilityChange, false);
|
||||
|
||||
// MediaSession API Integration (Lock Screen, Bluetooth, Smart Watches)
|
||||
function updateMediaSessionMetadata(video) {
|
||||
if (!('mediaSession' in navigator)) return;
|
||||
|
||||
var titleEl = document.querySelector('h1.video-title, .video-name, my-video-watch h1, .title');
|
||||
var title = titleEl ? titleEl.textContent.trim() : 'YakTube Video';
|
||||
var authorEl = document.querySelector('.actor-name, .channel-name, .video-channel-name, a.actor-link');
|
||||
var artist = authorEl ? authorEl.textContent.trim() : 'YakTube';
|
||||
|
||||
var artwork = [];
|
||||
var thumbEl = document.querySelector('meta[property="og:image"]');
|
||||
if (thumbEl && thumbEl.content) {
|
||||
artwork.push({ src: thumbEl.content, sizes: '512x512', type: 'image/jpeg' });
|
||||
}
|
||||
|
||||
try {
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
title: title,
|
||||
artist: artist,
|
||||
album: 'YakTube',
|
||||
artwork: artwork
|
||||
});
|
||||
|
||||
navigator.mediaSession.setActionHandler('play', function () {
|
||||
video.play();
|
||||
announce('Video oynatılıyor.');
|
||||
});
|
||||
navigator.mediaSession.setActionHandler('pause', function () {
|
||||
videoState.pausedByUser = true;
|
||||
video.pause();
|
||||
announce('Video duraklatıldı.');
|
||||
});
|
||||
navigator.mediaSession.setActionHandler('seekbackward', function (details) {
|
||||
var skipTime = details.seekOffset || 10;
|
||||
video.currentTime = Math.max(0, video.currentTime - skipTime);
|
||||
announce(skipTime + ' saniye geri sarıldı.');
|
||||
});
|
||||
navigator.mediaSession.setActionHandler('seekforward', function (details) {
|
||||
var skipTime = details.seekOffset || 10;
|
||||
video.currentTime = Math.min(video.duration || 99999, video.currentTime + skipTime);
|
||||
announce(skipTime + ' saniye ileri sarıldı.');
|
||||
});
|
||||
navigator.mediaSession.setActionHandler('stop', function () {
|
||||
videoState.pausedByUser = true;
|
||||
video.pause();
|
||||
});
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function updateMediaSessionPosition(video) {
|
||||
if (!('mediaSession' in navigator) || !navigator.mediaSession.setPositionState) return;
|
||||
if (isNaN(video.duration) || isNaN(video.currentTime) || video.duration <= 0) return;
|
||||
try {
|
||||
navigator.mediaSession.setPositionState({
|
||||
duration: video.duration,
|
||||
playbackRate: video.playbackRate || 1,
|
||||
position: Math.min(video.currentTime, video.duration)
|
||||
});
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
// Auto-hook active video elements
|
||||
setInterval(function () {
|
||||
var video = getVideoElement();
|
||||
if (video) attachVideoListeners(video);
|
||||
}, 1000);
|
||||
})();
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "peertube-plugin-yaktube-ondemand",
|
||||
"version": "1.4.4",
|
||||
"version": "1.4.8",
|
||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
||||
"main": "main.js",
|
||||
"library": "./main.js",
|
||||
|
||||
Reference in New Issue
Block a user