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 | |
|---|---|---|---|
|
|
b5c2c97559 | ||
|
|
b71e2a83a0 | ||
|
|
85340b85c6 | ||
|
|
efa61318f6 | ||
|
|
7572ddb565 | ||
|
|
8bc648a6bd | ||
|
|
f17b1a3ecc | ||
|
|
1342281bef | ||
|
|
51979ed8eb | ||
|
|
485e6923a8 |
@@ -576,13 +576,13 @@
|
||||
|
||||
setInterval(autoFixDOM, 1000);
|
||||
|
||||
// 3. Keyboard Shortcuts Modal
|
||||
// 3. Keyboard Shortcuts Modal & Quick Info Engine (v1.4.0)
|
||||
function toggleShortcutsModal() {
|
||||
var modal = document.getElementById('yaktube-shortcuts-dialog');
|
||||
if (modal) {
|
||||
if (modal.style.display === 'none' || !modal.style.display) {
|
||||
modal.style.display = 'flex';
|
||||
announce('Klavye kısayolları yardım penceresi açıldı. Kapatmak i�in Escape tuşuna basın.');
|
||||
announce('Klavye kısayolları yardım penceresi açıldı. Kapatmak için Escape tuşuna basın.');
|
||||
var closeBtn = document.getElementById('yaktube-shortcuts-close');
|
||||
if (closeBtn) closeBtn.focus();
|
||||
} else {
|
||||
@@ -597,35 +597,43 @@
|
||||
modal.setAttribute('aria-modal', 'true');
|
||||
modal.setAttribute('aria-labelledby', 'yaktube-shortcuts-title');
|
||||
modal.innerHTML =
|
||||
'<div class="yaktube-modal-card" style="max-width: 520px;">' +
|
||||
'<h3 id="yaktube-shortcuts-title" class="yaktube-modal-title" style="margin-top:0;">?? YakTube Klavye K�sayollar�</h3>' +
|
||||
'<table class="yaktube-shortcuts-table">' +
|
||||
'<thead><tr><th>Kısayol</th><th>İşlev</th></tr></thead>' +
|
||||
'<div class="yaktube-modal-card" style="max-width: 560px; background:#1e1e24; border-radius:18px; padding:24px; color:#fff; box-shadow:0 16px 40px rgba(0,0,0,0.8);">' +
|
||||
'<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:16px;">' +
|
||||
'<h3 id="yaktube-shortcuts-title" style="margin:0; font-size:18px; color:#ff8f37;">⌨️ Video Oynatıcı & Gezinme Kısayolları</h3>' +
|
||||
'<button id="yaktube-shortcuts-close" class="yaktube-voice-modal-close-btn" aria-label="Kapat">✕</button>' +
|
||||
'</div>' +
|
||||
'<table class="yaktube-shortcuts-table" style="width:100%; border-collapse:collapse; font-size:13px;">' +
|
||||
'<thead><tr style="border-bottom:1px solid rgba(255,255,255,0.1); text-align:left; color:#aaa;"><th style="padding:6px 0;">Kısayol</th><th style="padding:6px 0;">İşlev</th></tr></thead>' +
|
||||
'<tbody>' +
|
||||
'<tr><td><span class="yaktube-kbd">Space</span> veya <span class="yaktube-kbd">K</span></td><td>Oynat / Duraklat</td></tr>' +
|
||||
'<tr><td><span class="yaktube-kbd">Sol Ok</span> veya <span class="yaktube-kbd">J</span></td><td>5 saniye geri sar</td></tr>' +
|
||||
'<tr><td><span class="yaktube-kbd">Sağ Ok</span> veya <span class="yaktube-kbd">L</span></td><td>5 saniye ileri sar</td></tr>' +
|
||||
'<tr><td><span class="yaktube-kbd">Yukarı / Aşağı Ok</span></td><td>Sesi %5 artır / azalt</td></tr>' +
|
||||
'<tr><td><span class="yaktube-kbd">M</span></td><td>Sesi Kapat / A� (Mute)</td></tr>' +
|
||||
'<tr><td><span class="yaktube-kbd">F</span></td><td>Tam Ekran</td></tr>' +
|
||||
'<tr><td><span class="yaktube-kbd">C</span></td><td>Altyazıları A� / Kapat</td></tr>' +
|
||||
'<tr><td><span class="yaktube-kbd">/</span> (Bölü)</td><td>Arama kutusuna hızlı git</td></tr>' +
|
||||
'<tr><td><span class="yaktube-kbd">0 - 9</span></td><td>Videonun %0 - %90 noktasına atla</td></tr>' +
|
||||
'<tr><td><span class="yaktube-kbd">?</span> (Shift+/)</td><td>Bu yardım kılavuzunu aç / kapat</td></tr>' +
|
||||
'<tr><td><span class="yaktube-kbd">Esc</span></td><td>Pencereleri kapat</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">Space</span> veya <span class="yaktube-kbd">K</span></td><td>Oynat / Duraklat</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">J</span> / <span class="yaktube-kbd">L</span></td><td>10 saniye geri / ileri sar</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">Sol</span> / <span class="yaktube-kbd">Sağ Ok</span></td><td>5 saniye geri / ileri sar</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">Yukarı</span> / <span class="yaktube-kbd">Aşağı Ok</span></td><td>Sesi %5 artır / azalt</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">M</span></td><td>Sesi Kapat / Aç (Mute)</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">F</span></td><td>Tam Ekran</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">T</span></td><td>Sinema / Tiyatro Modu</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">C</span></td><td>Altyazıları Aç / Kapat</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">I</span></td><td>Hızlı Video Bilgisi & İstatistikler</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">></span> / <span class="yaktube-kbd"><</span> (Shift+.)</td><td>Oynatma hızını artır / azalt</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">0 - 9</span></td><td>Videonun %0 - %90 noktasına atla</td></tr>' +
|
||||
'<tr style="border-bottom:1px solid rgba(255,255,255,0.05);"><td style="padding:8px 0;"><span class="yaktube-kbd">/</span></td><td>Arama penceresini aç</td></tr>' +
|
||||
'<tr><td style="padding:8px 0;"><span class="yaktube-kbd">Shift + V</span></td><td>Sesli aramayı başlat</td></tr>' +
|
||||
'</tbody>' +
|
||||
'</table>' +
|
||||
'<button id="yaktube-shortcuts-close" class="yaktube-modal-close-btn" aria-label="Kılavuzu Kapat">Kılavuzu Kapat (Esc)</button>' +
|
||||
'</div>';
|
||||
document.body.appendChild(modal);
|
||||
|
||||
document.getElementById('yaktube-shortcuts-close').addEventListener('click', function () {
|
||||
var closeBtn = modal.querySelector('#yaktube-shortcuts-close');
|
||||
if (closeBtn) {
|
||||
closeBtn.addEventListener('click', function () {
|
||||
modal.style.display = 'none';
|
||||
});
|
||||
}
|
||||
modal.addEventListener('click', function (e) {
|
||||
if (e.target === modal) modal.style.display = 'none';
|
||||
});
|
||||
|
||||
var closeBtn = document.getElementById('yaktube-shortcuts-close');
|
||||
if (closeBtn) closeBtn.focus();
|
||||
announce('Klavye kısayolları yardım penceresi açıldı. Kapatmak i�in Escape tuşuna basın.');
|
||||
announce('Klavye kısayolları yardım penceresi açıldı. Kapatmak için Escape tuşuna basın.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -648,7 +656,77 @@
|
||||
return mins + ' dakika ' + secs + ' saniye';
|
||||
}
|
||||
|
||||
// 4. Global Keydown Listener
|
||||
function showQuickVideoInfo() {
|
||||
var video = getVideoElement();
|
||||
if (!video) {
|
||||
announce('Şu anda aktif oynatılan bir video bulunmuyor.');
|
||||
return;
|
||||
}
|
||||
|
||||
var titleEl = document.querySelector('h1.video-title, .video-name, my-video-watch h1, .title');
|
||||
var title = titleEl ? titleEl.textContent.trim() : 'Video';
|
||||
var curTime = formatTime(video.currentTime);
|
||||
var totalTime = formatTime(video.duration || 0);
|
||||
var remaining = formatTime((video.duration || 0) - video.currentTime);
|
||||
var speed = video.playbackRate + 'x';
|
||||
var volume = Math.round(video.volume * 100) + '%';
|
||||
var quality = video.videoHeight ? video.videoHeight + 'p' : 'Otomatik';
|
||||
|
||||
// Visual Toast
|
||||
var existingToast = document.querySelector('.yaktube-video-info-toast');
|
||||
if (existingToast) existingToast.remove();
|
||||
|
||||
var toast = document.createElement('div');
|
||||
toast.className = 'yaktube-video-info-toast';
|
||||
toast.innerHTML =
|
||||
'<div class="yaktube-info-toast-title">📊 Video Bilgisi & Durum</div>' +
|
||||
'<div class="yaktube-info-toast-row"><span>Başlık:</span> <b>' +
|
||||
(title.length > 28 ? title.substring(0, 28) + '...' : title) +
|
||||
'</b></div>' +
|
||||
'<div class="yaktube-info-toast-row"><span>Konum / Süre:</span> <b>' +
|
||||
curTime +
|
||||
' / ' +
|
||||
totalTime +
|
||||
'</b></div>' +
|
||||
'<div class="yaktube-info-toast-row"><span>Kalan Süre:</span> <b>' +
|
||||
remaining +
|
||||
'</b></div>' +
|
||||
'<div class="yaktube-info-toast-row"><span>Çözünürlük:</span> <b>' +
|
||||
quality +
|
||||
'</b></div>' +
|
||||
'<div class="yaktube-info-toast-row"><span>Hız & Ses:</span> <b>' +
|
||||
speed +
|
||||
' | ' +
|
||||
volume +
|
||||
'</b></div>';
|
||||
|
||||
document.body.appendChild(toast);
|
||||
setTimeout(function () {
|
||||
if (toast.parentElement) toast.remove();
|
||||
}, 4000);
|
||||
|
||||
announce(
|
||||
'Video Bilgisi: ' +
|
||||
title +
|
||||
'. Konum: ' +
|
||||
curTime +
|
||||
', Toplam Süre: ' +
|
||||
totalTime +
|
||||
', Kalan: ' +
|
||||
remaining +
|
||||
', Oynatma Hızı: ' +
|
||||
speed +
|
||||
', Ses: yüzde ' +
|
||||
Math.round(video.volume * 100) +
|
||||
', Çözünürlük: ' +
|
||||
quality,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
var speedSteps = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
|
||||
|
||||
// 4. Global Keydown Listener (Pro Video Player Engine)
|
||||
window.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'Escape') {
|
||||
var shortcutsModal = document.getElementById('yaktube-shortcuts-dialog');
|
||||
@@ -677,21 +755,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (e.key === '/' && !isInputFocused()) {
|
||||
e.preventDefault();
|
||||
var searchInput =
|
||||
document.querySelector('input[type="search"]') ||
|
||||
document.querySelector('input[name="search"]') ||
|
||||
document.querySelector('.search-input') ||
|
||||
document.querySelector('input');
|
||||
if (searchInput) {
|
||||
searchInput.focus();
|
||||
if (searchInput.select) searchInput.select();
|
||||
announce('Arama kutusuna odaklanıldı.');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (isInputFocused()) {
|
||||
return;
|
||||
}
|
||||
@@ -701,6 +764,7 @@
|
||||
|
||||
var key = e.key.toLowerCase();
|
||||
|
||||
// Play / Pause (Space / K)
|
||||
if (key === ' ' || key === 'k') {
|
||||
e.preventDefault();
|
||||
if (video.paused) {
|
||||
@@ -710,15 +774,29 @@
|
||||
video.pause();
|
||||
announce('Video duraklatıldı.');
|
||||
}
|
||||
} else if (key === 'j' || e.key === 'ArrowLeft') {
|
||||
}
|
||||
// Seek 10s Back / Forward (J / L)
|
||||
else if (key === 'j') {
|
||||
e.preventDefault();
|
||||
video.currentTime = Math.max(0, video.currentTime - 10);
|
||||
announce('10 saniye geri sarıldı. Konum: ' + formatTime(video.currentTime));
|
||||
} else if (key === 'l') {
|
||||
e.preventDefault();
|
||||
video.currentTime = Math.min(video.duration || 99999, video.currentTime + 10);
|
||||
announce('10 saniye ileri sarıldı. Konum: ' + formatTime(video.currentTime));
|
||||
}
|
||||
// Seek 5s Back / Forward (Left / Right Arrow)
|
||||
else if (e.key === 'ArrowLeft') {
|
||||
e.preventDefault();
|
||||
video.currentTime = Math.max(0, video.currentTime - 5);
|
||||
announce('5 saniye geri sarıldı. Åu an: ' + formatTime(video.currentTime));
|
||||
} else if (key === 'l' || e.key === 'ArrowRight') {
|
||||
announce('5 saniye geri sarıldı. Konum: ' + formatTime(video.currentTime));
|
||||
} else if (e.key === 'ArrowRight') {
|
||||
e.preventDefault();
|
||||
video.currentTime = Math.min(video.duration || 99999, video.currentTime + 5);
|
||||
announce('5 saniye ileri sarıldı. Åu an: ' + formatTime(video.currentTime));
|
||||
} else if (e.key === 'ArrowUp') {
|
||||
announce('5 saniye ileri sarıldı. Konum: ' + formatTime(video.currentTime));
|
||||
}
|
||||
// Volume Up / Down (Up / Down Arrow)
|
||||
else if (e.key === 'ArrowUp') {
|
||||
e.preventDefault();
|
||||
video.volume = Math.min(1, video.volume + 0.05);
|
||||
announce('Ses seviyesi yüzde ' + Math.round(video.volume * 100));
|
||||
@@ -726,11 +804,15 @@
|
||||
e.preventDefault();
|
||||
video.volume = Math.max(0, video.volume - 0.05);
|
||||
announce('Ses seviyesi yüzde ' + Math.round(video.volume * 100));
|
||||
} else if (key === 'm') {
|
||||
}
|
||||
// Mute (M)
|
||||
else if (key === 'm') {
|
||||
e.preventDefault();
|
||||
video.muted = !video.muted;
|
||||
announce(video.muted ? 'Ses kapatıldı (Sessiz).' : 'Ses açıldı.');
|
||||
} else if (key === 'f') {
|
||||
}
|
||||
// Fullscreen (F)
|
||||
else if (key === 'f') {
|
||||
e.preventDefault();
|
||||
if (!document.fullscreenElement) {
|
||||
var container = video.closest('.video-js') || video.parentElement || video;
|
||||
@@ -740,7 +822,21 @@
|
||||
if (document.exitFullscreen) document.exitFullscreen();
|
||||
announce('Tam ekrandan çıkıldı.');
|
||||
}
|
||||
} else if (key === 'c') {
|
||||
}
|
||||
// Theater Mode (T)
|
||||
else if (key === 't') {
|
||||
e.preventDefault();
|
||||
document.body.classList.toggle('yaktube-theater-mode');
|
||||
var isTheater = document.body.classList.contains('yaktube-theater-mode');
|
||||
announce(isTheater ? 'Sinema modu açıldı.' : 'Sinema modundan çıkıldı.');
|
||||
}
|
||||
// Quick Video Info (I)
|
||||
else if (key === 'i') {
|
||||
e.preventDefault();
|
||||
showQuickVideoInfo();
|
||||
}
|
||||
// Subtitles (C)
|
||||
else if (key === 'c') {
|
||||
e.preventDefault();
|
||||
var tracks = video.textTracks;
|
||||
if (tracks && tracks.length > 0) {
|
||||
@@ -750,12 +846,40 @@
|
||||
} else {
|
||||
announce('Bu videoda altyazı bulunmuyor.');
|
||||
}
|
||||
} else if (key >= '0' && key <= '9' && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
||||
}
|
||||
// Speed Controls (< and > / Shift+, and Shift+.)
|
||||
else if (e.key === '>' || (e.shiftKey && e.key === '.')) {
|
||||
e.preventDefault();
|
||||
var curSpeed = video.playbackRate || 1;
|
||||
var nextIdx = speedSteps.findIndex(function (s) {
|
||||
return s > curSpeed;
|
||||
});
|
||||
if (nextIdx !== -1) {
|
||||
video.playbackRate = speedSteps[nextIdx];
|
||||
} else {
|
||||
video.playbackRate = 2;
|
||||
}
|
||||
announce('Oynatma hızı ' + video.playbackRate + ' katına çıkarıldı.');
|
||||
} else if (e.key === '<' || (e.shiftKey && e.key === ',')) {
|
||||
e.preventDefault();
|
||||
var curSpeed = video.playbackRate || 1;
|
||||
var prevSteps = speedSteps.filter(function (s) {
|
||||
return s < curSpeed;
|
||||
});
|
||||
if (prevSteps.length > 0) {
|
||||
video.playbackRate = prevSteps[prevSteps.length - 1];
|
||||
} else {
|
||||
video.playbackRate = 0.25;
|
||||
}
|
||||
announce('Oynatma hızı ' + video.playbackRate + ' katına düşürüldü.');
|
||||
}
|
||||
// Percentage Jumps (0 - 9)
|
||||
else if (key >= '0' && key <= '9' && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
||||
e.preventDefault();
|
||||
var percent = parseInt(key, 10) * 10;
|
||||
if (video.duration) {
|
||||
video.currentTime = (video.duration * percent) / 100;
|
||||
announce('Videonun yüzde ' + percent + ' noktasına atlandı. Åu an: ' + formatTime(video.currentTime));
|
||||
announce('Videonun yüzde ' + percent + ' noktasına atlandı. Konum: ' + formatTime(video.currentTime));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1398,173 +1522,341 @@
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// 8. VOICE SEARCH, CLEAR BUTTON & ACCESSIBLE SEARCH UX (YouTube Style)
|
||||
// --------------------------------------------------------------------------
|
||||
var activeRecognition = null;
|
||||
// --------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
// 8. FULL YOUTUBE SEARCH & VOICE MODAL ENGINE (v1.3.3 - Guaranteed Close Fix)
|
||||
// --------------------------------------------------------------------------
|
||||
var activeVoiceRec = null;
|
||||
var isVoiceListening = false;
|
||||
|
||||
function initVoiceSearch(searchInp, searchWrap) {
|
||||
var SpeechRec = window.SpeechRecognition || window.webkitSpeechRecognition;
|
||||
var voiceBtn = searchWrap.querySelector('#yaktube-voice-search-btn');
|
||||
function createFullSearchModal() {
|
||||
var existingModal = document.getElementById('yaktube-full-search-modal');
|
||||
if (existingModal) return existingModal;
|
||||
|
||||
var modal = document.createElement('div');
|
||||
modal.id = 'yaktube-full-search-modal';
|
||||
modal.className = 'yaktube-full-search-modal';
|
||||
modal.setAttribute('role', 'dialog');
|
||||
modal.setAttribute('aria-modal', 'true');
|
||||
modal.setAttribute('aria-labelledby', 'yaktube-modal-search-title');
|
||||
|
||||
modal.innerHTML =
|
||||
'<div class="yaktube-modal-search-card">' +
|
||||
'<div class="yaktube-modal-search-bar">' +
|
||||
'<button id="yaktube-modal-back-btn" class="yaktube-modal-back-btn" aria-label="Aramadan Çık (Escape)" title="Aramadan Çık (Escape)">←</button>' +
|
||||
'<div class="yaktube-modal-input-wrap">' +
|
||||
'<input id="yaktube-modal-input" type="search" placeholder="Video veya kanal ara..." aria-label="Arama Metni">' +
|
||||
'<button id="yaktube-modal-clear-btn" class="yaktube-modal-clear-btn" aria-label="Metni Temizle">✕</button>' +
|
||||
'</div>' +
|
||||
'<button id="yaktube-modal-submit-btn" class="yaktube-modal-search-action-btn" aria-label="Ara">🔍 Ara</button>' +
|
||||
'<button id="yaktube-modal-voice-btn" class="yaktube-modal-voice-btn" aria-label="Sesle Ara (Shift+V)" title="Sesle Ara">🎙️</button>' +
|
||||
'</div>' +
|
||||
'<div class="yaktube-modal-body">' +
|
||||
'<div id="yaktube-modal-voice-section" class="yaktube-modal-voice-section">' +
|
||||
'<div id="yaktube-modal-voice-status" class="yaktube-modal-voice-status">🎙️ Dinleniyor...</div>' +
|
||||
'<div id="yaktube-modal-voice-transcript" class="yaktube-modal-voice-transcript">Lütfen aramak istediğiniz videoyu söyleyin...</div>' +
|
||||
'<button id="yaktube-modal-mic-pulse" class="yaktube-modal-mic-pulse-btn" aria-label="Mikrofonu durdur">🎙️</button>' +
|
||||
'</div>' +
|
||||
'<div class="yaktube-modal-section-title">🔥 Hızlı ve Popüler Aramalar</div>' +
|
||||
'<div class="yaktube-modal-chips-grid">' +
|
||||
'<button class="yaktube-modal-chip" data-query="Tarkan">🎵 Tarkan</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Barış Manço">🎸 Barış Manço</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Python Dersleri">💻 Python Dersleri</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Yapay Zeka">🤖 Yapay Zeka</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Sesli Kitap">🎧 Sesli Kitap</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Canlı Haber">📺 Canlı Haber</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Gitar Dersi">🎼 Gitar Dersi</button>' +
|
||||
'<button class="yaktube-modal-chip" data-query="Bilim Belgeseli">🌍 Bilim Belgeseli</button>' +
|
||||
'</div>' +
|
||||
'<div class="yaktube-modal-hint-footer">' +
|
||||
'<span>💡 <b>Enter</b> ile ara, <b>Shift+V</b> ile sesli ara</span>' +
|
||||
'<span><b>Escape</b> ile kapat</span>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
document.body.appendChild(modal);
|
||||
|
||||
var inp = modal.querySelector('#yaktube-modal-input');
|
||||
var clearBtn = modal.querySelector('#yaktube-modal-clear-btn');
|
||||
var backBtn = modal.querySelector('#yaktube-modal-back-btn');
|
||||
var submitBtn = modal.querySelector('#yaktube-modal-submit-btn');
|
||||
var voiceBtn = modal.querySelector('#yaktube-modal-voice-btn');
|
||||
var micPulseBtn = modal.querySelector('#yaktube-modal-mic-pulse');
|
||||
|
||||
// Input typing & clear
|
||||
inp.addEventListener('input', function () {
|
||||
if (inp.value && inp.value.trim().length > 0) {
|
||||
clearBtn.style.display = 'inline-flex';
|
||||
} else {
|
||||
clearBtn.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
clearBtn.addEventListener('click', function () {
|
||||
inp.value = '';
|
||||
clearBtn.style.display = 'none';
|
||||
inp.focus();
|
||||
announce('Arama metni temizlendi.');
|
||||
});
|
||||
|
||||
// Close on Back button or Escape
|
||||
backBtn.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
closeFullSearchModal();
|
||||
});
|
||||
|
||||
modal.addEventListener('click', function (e) {
|
||||
if (e.target === modal) {
|
||||
closeFullSearchModal();
|
||||
}
|
||||
});
|
||||
|
||||
// Search execute
|
||||
function executeSearch(query) {
|
||||
var q = (query || inp.value || '').trim();
|
||||
if (q) {
|
||||
announce('"' + q + '" için arama yapılıyor...', true);
|
||||
closeFullSearchModal();
|
||||
window.location.href = '/search/videos?search=' + encodeURIComponent(q);
|
||||
}
|
||||
}
|
||||
|
||||
submitBtn.addEventListener('click', function () {
|
||||
executeSearch();
|
||||
});
|
||||
|
||||
inp.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
executeSearch();
|
||||
} else if (e.key === 'Escape') {
|
||||
e.preventDefault();
|
||||
closeFullSearchModal();
|
||||
}
|
||||
});
|
||||
|
||||
// Chips click
|
||||
modal.querySelectorAll('.yaktube-modal-chip').forEach(function (chip) {
|
||||
chip.addEventListener('click', function () {
|
||||
var query = chip.getAttribute('data-query');
|
||||
executeSearch(query);
|
||||
});
|
||||
});
|
||||
|
||||
// Voice button click
|
||||
voiceBtn.addEventListener('click', function () {
|
||||
toggleVoiceInsideModal();
|
||||
});
|
||||
|
||||
micPulseBtn.addEventListener('click', function () {
|
||||
toggleVoiceInsideModal();
|
||||
});
|
||||
|
||||
return modal;
|
||||
}
|
||||
|
||||
function openFullSearchModal(initialQuery, autoStartVoice) {
|
||||
var modal = createFullSearchModal();
|
||||
modal.classList.add('yaktube-modal-open');
|
||||
modal.style.display = 'flex';
|
||||
|
||||
var inp = modal.querySelector('#yaktube-modal-input');
|
||||
var clearBtn = modal.querySelector('#yaktube-modal-clear-btn');
|
||||
if (inp) {
|
||||
inp.value = initialQuery || '';
|
||||
if (inp.value) clearBtn.style.display = 'inline-flex';
|
||||
setTimeout(function () {
|
||||
inp.focus();
|
||||
inp.select();
|
||||
}, 50);
|
||||
}
|
||||
|
||||
announce('Arama penceresi açıldı. Arayacağınız konuyu yazın veya sesle arayın.', true);
|
||||
|
||||
if (autoStartVoice) {
|
||||
startVoiceInsideModal();
|
||||
}
|
||||
}
|
||||
|
||||
function closeFullSearchModal() {
|
||||
var modal = document.getElementById('yaktube-full-search-modal');
|
||||
if (modal) {
|
||||
modal.classList.remove('yaktube-modal-open');
|
||||
modal.style.display = 'none';
|
||||
}
|
||||
stopVoiceInsideModal();
|
||||
announce('Arama penceresi kapatıldı.');
|
||||
|
||||
var trigger = document.querySelector('.yaktube-search-trigger-pill');
|
||||
if (trigger) {
|
||||
try {
|
||||
trigger.focus();
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
function toggleVoiceInsideModal() {
|
||||
if (isVoiceListening) {
|
||||
stopVoiceInsideModal();
|
||||
} else {
|
||||
startVoiceInsideModal();
|
||||
}
|
||||
}
|
||||
|
||||
function startVoiceInsideModal() {
|
||||
var SpeechRec = window.SpeechRecognition || window.webkitSpeechRecognition;
|
||||
var modal = document.getElementById('yaktube-full-search-modal');
|
||||
if (!modal) return;
|
||||
|
||||
var voiceSec = modal.querySelector('#yaktube-modal-voice-section');
|
||||
var statusText = modal.querySelector('#yaktube-modal-voice-status');
|
||||
var transcriptEl = modal.querySelector('#yaktube-modal-voice-transcript');
|
||||
var inp = modal.querySelector('#yaktube-modal-input');
|
||||
|
||||
if (voiceSec) voiceSec.style.display = 'block';
|
||||
if (statusText) statusText.textContent = '🎙️ Dinleniyor...';
|
||||
if (transcriptEl) transcriptEl.textContent = 'Lütfen aramak istediğiniz videoyu söyleyin...';
|
||||
|
||||
if (!SpeechRec) {
|
||||
if (statusText) statusText.textContent = 'Tarayıcıda Ses Tanıma Desteklenmiyor';
|
||||
if (transcriptEl) transcriptEl.textContent = 'Lütfen Google Chrome veya Microsoft Edge kullanın.';
|
||||
announce('Tarayıcınız ses tanımayı desteklemiyor. Lütfen Chrome veya Edge kullanın.');
|
||||
return;
|
||||
}
|
||||
|
||||
announce('Sesli arama dinleniyor, lütfen aramak istediğiniz videoyu söyleyin.', true);
|
||||
|
||||
try {
|
||||
activeVoiceRec = new SpeechRec();
|
||||
activeVoiceRec.lang = navigator.language || 'tr-TR';
|
||||
activeVoiceRec.continuous = false;
|
||||
activeVoiceRec.interimResults = true;
|
||||
activeVoiceRec.maxAlternatives = 1;
|
||||
|
||||
isVoiceListening = true;
|
||||
|
||||
activeVoiceRec.onresult = function (ev) {
|
||||
if (ev.results && ev.results[0]) {
|
||||
var transcript = ev.results[0][0].transcript.trim();
|
||||
if (transcriptEl) transcriptEl.textContent = '"' + transcript + '"';
|
||||
if (inp) inp.value = transcript;
|
||||
|
||||
if (ev.results[0].isFinal) {
|
||||
announce('"' + transcript + '" için arama başlatılıyor...', true);
|
||||
setTimeout(function () {
|
||||
closeFullSearchModal();
|
||||
window.location.href = '/search/videos?search=' + encodeURIComponent(transcript);
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
activeVoiceRec.onerror = function (ev) {
|
||||
if (statusText) statusText.textContent = 'Ses Algılanamadı';
|
||||
if (transcriptEl) transcriptEl.textContent = 'Tekrar denemek için mikrofona dokunun.';
|
||||
stopVoiceInsideModal();
|
||||
};
|
||||
|
||||
activeVoiceRec.onend = function () {
|
||||
stopVoiceInsideModal();
|
||||
};
|
||||
|
||||
activeVoiceRec.start();
|
||||
} catch (err) {
|
||||
stopVoiceInsideModal();
|
||||
}
|
||||
}
|
||||
|
||||
function stopVoiceInsideModal() {
|
||||
isVoiceListening = false;
|
||||
if (activeVoiceRec) {
|
||||
try {
|
||||
activeVoiceRec.stop();
|
||||
} catch (e) {}
|
||||
activeVoiceRec = null;
|
||||
}
|
||||
var modal = document.getElementById('yaktube-full-search-modal');
|
||||
if (modal) {
|
||||
var voiceSec = modal.querySelector('#yaktube-modal-voice-section');
|
||||
if (voiceSec) voiceSec.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function transformToYouTubeSearchBar(searchInp, searchContainer) {
|
||||
if (searchContainer.hasAttribute('data-yaktube-trigger-styled')) return;
|
||||
searchContainer.setAttribute('data-yaktube-trigger-styled', 'true');
|
||||
|
||||
// Hide original native inputs
|
||||
searchInp.style.display = 'none';
|
||||
searchInp.setAttribute('tabindex', '-1');
|
||||
searchInp.setAttribute('aria-hidden', 'true');
|
||||
|
||||
var nativeInputs = searchContainer.querySelectorAll('input, button');
|
||||
nativeInputs.forEach(function (el) {
|
||||
if (!el.classList.contains('yaktube-search-trigger-pill') && !el.classList.contains('yaktube-voice-search-btn')) {
|
||||
el.style.display = 'none';
|
||||
el.setAttribute('tabindex', '-1');
|
||||
el.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
});
|
||||
|
||||
// 1. Create Outer Wrapper
|
||||
var outerWrap = searchContainer.querySelector('.yaktube-search-outer-wrap');
|
||||
if (!outerWrap) {
|
||||
outerWrap = document.createElement('div');
|
||||
outerWrap.className = 'yaktube-search-outer-wrap';
|
||||
searchContainer.appendChild(outerWrap);
|
||||
}
|
||||
|
||||
// 2. Create Single Sleek Pill Trigger
|
||||
var triggerPill = outerWrap.querySelector('.yaktube-search-trigger-pill');
|
||||
if (!triggerPill) {
|
||||
triggerPill = document.createElement('button');
|
||||
triggerPill.type = 'button';
|
||||
triggerPill.className = 'yaktube-search-trigger-pill';
|
||||
triggerPill.setAttribute('aria-label', 'Ara');
|
||||
triggerPill.setAttribute('title', 'Arama Yap (/)');
|
||||
|
||||
triggerPill.innerHTML =
|
||||
'<span class="yaktube-search-trigger-icon">🔍</span>' +
|
||||
'<span class="yaktube-search-trigger-text">Ara...</span>' +
|
||||
'<span class="yaktube-search-trigger-shortcut">/</span>';
|
||||
|
||||
outerWrap.appendChild(triggerPill);
|
||||
|
||||
triggerPill.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
openFullSearchModal('', false);
|
||||
});
|
||||
}
|
||||
|
||||
// 3. YouTube Circular Voice Button (🎙️) Beside the Pill Box
|
||||
var voiceBtn = outerWrap.querySelector('.yaktube-voice-search-btn');
|
||||
if (!voiceBtn) {
|
||||
voiceBtn = document.createElement('button');
|
||||
voiceBtn.id = 'yaktube-voice-search-btn';
|
||||
voiceBtn.type = 'button';
|
||||
voiceBtn.className = 'yaktube-voice-search-btn';
|
||||
voiceBtn.setAttribute('aria-label', 'Sesle Ara (Shift+V)');
|
||||
voiceBtn.setAttribute('title', 'Sesle Ara (Shift+V)');
|
||||
voiceBtn.innerHTML = '🎙️';
|
||||
voiceBtn.style.cssText =
|
||||
'background: rgba(255, 143, 55, 0.12); color: #ff8f37; border: 1px solid rgba(255, 143, 55, 0.35); border-radius: 50%; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; margin-left: 6px; transition: all 0.2s ease; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,0.2);';
|
||||
|
||||
searchWrap.appendChild(voiceBtn);
|
||||
outerWrap.appendChild(voiceBtn);
|
||||
|
||||
voiceBtn.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
toggleVoiceSearch(searchInp, voiceBtn);
|
||||
openFullSearchModal('', true);
|
||||
});
|
||||
}
|
||||
|
||||
// Clear Button (✖️)
|
||||
var clearBtn = searchWrap.querySelector('#yaktube-clear-search-btn');
|
||||
if (!clearBtn) {
|
||||
clearBtn = document.createElement('button');
|
||||
clearBtn.id = 'yaktube-clear-search-btn';
|
||||
clearBtn.type = 'button';
|
||||
clearBtn.className = 'yaktube-clear-search-btn';
|
||||
clearBtn.setAttribute('aria-label', 'Arama Metnini Temizle (Escape)');
|
||||
clearBtn.setAttribute('title', 'Arama Metnini Temizle (Escape)');
|
||||
clearBtn.innerHTML = '✕';
|
||||
clearBtn.style.cssText =
|
||||
'background: rgba(255, 255, 255, 0.12); color: #cbd5e1; border: none; border-radius: 50%; width: 22px; height: 22px; display: none; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; cursor: pointer; margin-right: 4px; transition: all 0.2s ease; flex-shrink: 0;';
|
||||
|
||||
searchInp.insertAdjacentElement('afterend', clearBtn);
|
||||
|
||||
clearBtn.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
searchInp.value = '';
|
||||
searchInp.dispatchEvent(new Event('input', { bubbles: true }));
|
||||
searchInp.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
clearBtn.style.display = 'none';
|
||||
searchInp.focus();
|
||||
announce('Arama metni temizlendi.');
|
||||
});
|
||||
}
|
||||
|
||||
function updateClearBtnVisibility() {
|
||||
if (searchInp.value && searchInp.value.trim().length > 0) {
|
||||
clearBtn.style.display = 'inline-flex';
|
||||
} else {
|
||||
clearBtn.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
searchInp.addEventListener('input', updateClearBtnVisibility);
|
||||
searchInp.addEventListener('focus', updateClearBtnVisibility);
|
||||
updateClearBtnVisibility();
|
||||
|
||||
// Escape Key Exit
|
||||
searchInp.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'Escape' || e.keyCode === 27) {
|
||||
if (searchInp.value && searchInp.value.trim().length > 0) {
|
||||
searchInp.value = '';
|
||||
searchInp.dispatchEvent(new Event('input', { bubbles: true }));
|
||||
clearBtn.style.display = 'none';
|
||||
announce('Arama metni temizlendi.');
|
||||
} else {
|
||||
searchInp.blur();
|
||||
announce('Arama kutusundan çıkıldı.');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function toggleVoiceSearch(searchInp, voiceBtn) {
|
||||
var SpeechRec = window.SpeechRecognition || window.webkitSpeechRecognition;
|
||||
if (!SpeechRec) {
|
||||
announce('Tarayıcınız sesli arama özelliğini desteklemiyor. Lütfen Chrome veya Edge kullanın.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (isVoiceListening) {
|
||||
if (activeRecognition) {
|
||||
try {
|
||||
activeRecognition.stop();
|
||||
} catch (err) {}
|
||||
}
|
||||
stopVoiceState(voiceBtn);
|
||||
announce('Sesli arama durduruldu.');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
activeRecognition = new SpeechRec();
|
||||
activeRecognition.lang = navigator.language || 'tr-TR';
|
||||
activeRecognition.continuous = false;
|
||||
activeRecognition.interimResults = false;
|
||||
activeRecognition.maxAlternatives = 1;
|
||||
|
||||
isVoiceListening = true;
|
||||
voiceBtn.classList.add('yaktube-voice-recording');
|
||||
voiceBtn.innerHTML = '🔴';
|
||||
voiceBtn.setAttribute('aria-label', 'Dinleniyor... Konuşun (Durdurmak için tıklayın)');
|
||||
announce('Sesli arama dinleniyor, lütfen aramak istediğiniz videoyu söyleyin...', true);
|
||||
|
||||
activeRecognition.onresult = function (ev) {
|
||||
if (ev.results && ev.results[0] && ev.results[0][0]) {
|
||||
var transcript = ev.results[0][0].transcript.trim();
|
||||
if (transcript) {
|
||||
searchInp.value = transcript;
|
||||
searchInp.dispatchEvent(new Event('input', { bubbles: true }));
|
||||
searchInp.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
|
||||
announce('"' + transcript + '" için aranıyor...', true);
|
||||
|
||||
// Trigger search submission
|
||||
var form = searchInp.closest('form');
|
||||
if (form) {
|
||||
form.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true }));
|
||||
} else {
|
||||
window.location.href = '/search/videos?search=' + encodeURIComponent(transcript);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
activeRecognition.onerror = function (ev) {
|
||||
console.warn('[YakTube] Voice search error:', ev.error);
|
||||
if (ev.error === 'not-allowed') {
|
||||
announce('Mikrofon izni verilmedi. Lütfen tarayıcı ayarlarından mikrofona izin verin.');
|
||||
} else if (ev.error === 'no-speech') {
|
||||
announce('Ses algılanamadı, lütfen tekrar deneyin.');
|
||||
} else {
|
||||
announce('Sesli arama sırasında bir sorun oluştu: ' + ev.error);
|
||||
}
|
||||
stopVoiceState(voiceBtn);
|
||||
};
|
||||
|
||||
activeRecognition.onend = function () {
|
||||
stopVoiceState(voiceBtn);
|
||||
};
|
||||
|
||||
activeRecognition.start();
|
||||
} catch (err) {
|
||||
console.error('[YakTube] Failed to start speech recognition:', err);
|
||||
announce('Sesli arama başlatılamadı.');
|
||||
stopVoiceState(voiceBtn);
|
||||
}
|
||||
}
|
||||
|
||||
function stopVoiceState(voiceBtn) {
|
||||
isVoiceListening = false;
|
||||
if (voiceBtn) {
|
||||
voiceBtn.classList.remove('yaktube-voice-recording');
|
||||
voiceBtn.innerHTML = '🎙️';
|
||||
voiceBtn.setAttribute('aria-label', 'Sesle Ara (Shift+V)');
|
||||
}
|
||||
}
|
||||
|
||||
function injectSearchEnhancements() {
|
||||
@@ -1573,54 +1865,51 @@
|
||||
);
|
||||
searchContainers.forEach(function (container) {
|
||||
var searchInp = container.querySelector('input[type="search"], input[type="text"], input');
|
||||
if (searchInp && !searchInp.hasAttribute('data-yaktube-enhanced')) {
|
||||
searchInp.setAttribute('data-yaktube-enhanced', 'true');
|
||||
initVoiceSearch(searchInp, container);
|
||||
if (searchInp) {
|
||||
transformToYouTubeSearchBar(searchInp, container);
|
||||
}
|
||||
});
|
||||
|
||||
// Also check generic header inputs
|
||||
var headerInputs = document.querySelectorAll('my-header input:not([data-yaktube-enhanced])');
|
||||
headerInputs.forEach(function (inp) {
|
||||
var parent = inp.parentElement;
|
||||
if (
|
||||
parent &&
|
||||
(inp.type === 'search' ||
|
||||
inp.type === 'text' ||
|
||||
inp.placeholder.toLowerCase().includes('ara') ||
|
||||
inp.placeholder.toLowerCase().includes('search'))
|
||||
) {
|
||||
inp.setAttribute('data-yaktube-enhanced', 'true');
|
||||
initVoiceSearch(inp, parent);
|
||||
// Clean up repetitive card titles and strange relative date buttons
|
||||
document.querySelectorAll('my-video-miniature, .video-miniature').forEach(function (card) {
|
||||
var thumbLink = card.querySelector('a.thumbnail-link, .video-thumbnail a, a.thumbnail');
|
||||
if (thumbLink && !thumbLink.hasAttribute('aria-hidden')) {
|
||||
thumbLink.setAttribute('aria-hidden', 'true');
|
||||
thumbLink.setAttribute('tabindex', '-1');
|
||||
}
|
||||
|
||||
var dateBtn = card.querySelector('.video-date-line button, .video-date button, button[title*="tarih"]');
|
||||
if (dateBtn && !dateBtn.hasAttribute('data-cleaned')) {
|
||||
dateBtn.setAttribute('data-cleaned', 'true');
|
||||
var dateText = dateBtn.textContent.trim();
|
||||
dateBtn.setAttribute('aria-label', dateText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Global Keyboard Shortcut: Shift+V for Voice Search, / for search focus
|
||||
// Global Keyboard Shortcuts
|
||||
document.addEventListener('keydown', function (e) {
|
||||
var activeTag = document.activeElement ? document.activeElement.tagName.toLowerCase() : '';
|
||||
var isInputActive = activeTag === 'input' || activeTag === 'textarea';
|
||||
|
||||
// Shift + V: Open YouTube Voice Search Modal
|
||||
if (e.shiftKey && (e.key === 'V' || e.key === 'v') && !isInputActive) {
|
||||
e.preventDefault();
|
||||
var mainVoiceBtn = document.querySelector('#yaktube-voice-search-btn');
|
||||
var searchInp = document.querySelector(
|
||||
'my-search-typeahead input, my-header input[type="search"], input[type="search"]'
|
||||
);
|
||||
if (mainVoiceBtn && searchInp) {
|
||||
toggleVoiceSearch(searchInp, mainVoiceBtn);
|
||||
openFullSearchModal('', true);
|
||||
}
|
||||
} else if (e.key === '/' && !isInputActive && !e.ctrlKey && !e.metaKey) {
|
||||
// Escape: Close Full Search Modal
|
||||
else if (e.key === 'Escape' || e.keyCode === 27) {
|
||||
var modal = document.getElementById('yaktube-full-search-modal');
|
||||
if (modal && modal.classList.contains('yaktube-modal-open')) {
|
||||
e.preventDefault();
|
||||
var searchInp = document.querySelector(
|
||||
'my-search-typeahead input, my-header input[type="search"], input[type="search"]'
|
||||
);
|
||||
if (searchInp) {
|
||||
searchInp.focus();
|
||||
searchInp.select();
|
||||
announce('Arama kutusuna odaklanıldı.');
|
||||
closeFullSearchModal();
|
||||
}
|
||||
}
|
||||
// / or S: Open Search Modal
|
||||
else if ((e.key === '/' || e.key === 's' || e.key === 'S') && !isInputActive && !e.ctrlKey && !e.metaKey) {
|
||||
e.preventDefault();
|
||||
openFullSearchModal('', false);
|
||||
}
|
||||
});
|
||||
|
||||
// 7.5. Reactive Hybrid Related Videos Engine (Watch Page)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "peertube-plugin-yaktube-ondemand",
|
||||
"version": "1.1.0",
|
||||
"version": "1.4.0",
|
||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
||||
"main": "main.js",
|
||||
"clientScripts": [
|
||||
|
||||
@@ -405,3 +405,441 @@ my-header .action-buttons {
|
||||
.yaktube-admin-login-link a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* YOUTUBE FULL SEARCH & VOICE MODAL (v1.3.3 - Display Fix) */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/* Header Search Trigger Container */
|
||||
my-search-typeahead,
|
||||
.search-container,
|
||||
.header-search {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
position: relative !important;
|
||||
width: 100% !important;
|
||||
max-width: 540px !important;
|
||||
margin: 0 auto !important;
|
||||
}
|
||||
|
||||
.yaktube-search-outer-wrap {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* Clickable Pill Button in Header */
|
||||
.yaktube-search-trigger-pill {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
background: #121212 !important;
|
||||
border: 1px solid #303030 !important;
|
||||
border-radius: 40px !important;
|
||||
padding: 8px 18px !important;
|
||||
transition: all 0.2s ease !important;
|
||||
width: 100% !important;
|
||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4) !important;
|
||||
cursor: pointer !important;
|
||||
color: #888 !important;
|
||||
font-size: 15px !important;
|
||||
user-select: none !important;
|
||||
gap: 10px !important;
|
||||
}
|
||||
|
||||
.yaktube-search-trigger-pill:hover,
|
||||
.yaktube-search-trigger-pill:focus {
|
||||
border-color: #ff8f37 !important;
|
||||
background: #18181c !important;
|
||||
color: #f1f1f1 !important;
|
||||
box-shadow: 0 0 12px rgba(255, 143, 55, 0.25) !important;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.yaktube-search-trigger-icon {
|
||||
font-size: 15px !important;
|
||||
color: #ff8f37 !important;
|
||||
}
|
||||
|
||||
.yaktube-search-trigger-text {
|
||||
flex: 1 !important;
|
||||
white-space: nowrap !important;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
.yaktube-search-trigger-shortcut {
|
||||
font-size: 11px !important;
|
||||
background: #252530 !important;
|
||||
color: #aaa !important;
|
||||
padding: 2px 6px !important;
|
||||
border-radius: 6px !important;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1) !important;
|
||||
}
|
||||
|
||||
/* Circular Voice Button in Header */
|
||||
.yaktube-voice-search-btn {
|
||||
background: #1f1f1f !important;
|
||||
color: #f1f1f1 !important;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08) !important;
|
||||
border-radius: 50% !important;
|
||||
width: 40px !important;
|
||||
height: 40px !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
font-size: 18px !important;
|
||||
cursor: pointer !important;
|
||||
margin-left: 8px !important;
|
||||
transition: all 0.25s ease !important;
|
||||
flex-shrink: 0 !important;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
|
||||
}
|
||||
|
||||
.yaktube-voice-search-btn:hover,
|
||||
.yaktube-voice-search-btn:focus {
|
||||
background: #2a2a2a !important;
|
||||
border-color: #ff8f37 !important;
|
||||
color: #ff8f37 !important;
|
||||
transform: scale(1.06) !important;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* FULL YOUTUBE SEARCH & VOICE MODAL OVERLAY */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
.yaktube-full-search-modal {
|
||||
position: fixed !important;
|
||||
top: 0 !important;
|
||||
left: 0 !important;
|
||||
width: 100vw !important;
|
||||
height: 100vh !important;
|
||||
background: rgba(0, 0, 0, 0.82) !important;
|
||||
backdrop-filter: blur(12px) !important;
|
||||
z-index: 999999 !important;
|
||||
display: none;
|
||||
flex-direction: column !important;
|
||||
align-items: center !important;
|
||||
justify-content: flex-start !important;
|
||||
padding-top: 40px !important;
|
||||
}
|
||||
|
||||
.yaktube-full-search-modal.yaktube-modal-open {
|
||||
display: flex !important;
|
||||
animation: yaktube-fade-in 0.2s ease-out !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-search-card {
|
||||
background: #1e1e24 !important;
|
||||
border: 1px solid rgba(255, 143, 55, 0.3) !important;
|
||||
border-radius: 20px !important;
|
||||
width: 92% !important;
|
||||
max-width: 680px !important;
|
||||
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8) !important;
|
||||
overflow: hidden !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
/* Modal Search Bar */
|
||||
.yaktube-modal-search-bar {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
padding: 10px 14px !important;
|
||||
background: #141418 !important;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-back-btn {
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
color: #aaa !important;
|
||||
font-size: 22px !important;
|
||||
width: 40px !important;
|
||||
height: 40px !important;
|
||||
border-radius: 50% !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
cursor: pointer !important;
|
||||
margin-right: 8px !important;
|
||||
flex-shrink: 0 !important;
|
||||
transition: all 0.2s ease !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-back-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.1) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-input-wrap {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
flex: 1 !important;
|
||||
background: #22222a !important;
|
||||
border: 1px solid #33333f !important;
|
||||
border-radius: 30px !important;
|
||||
padding: 2px 8px 2px 14px !important;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-input-wrap:focus-within {
|
||||
border-color: #ff8f37 !important;
|
||||
box-shadow: 0 0 10px rgba(255, 143, 55, 0.3) !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-input-wrap input {
|
||||
flex: 1 !important;
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
color: #fff !important;
|
||||
font-size: 16px !important;
|
||||
padding: 8px 4px !important;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-clear-btn {
|
||||
background: rgba(255, 255, 255, 0.12) !important;
|
||||
color: #aaa !important;
|
||||
border: none !important;
|
||||
border-radius: 50% !important;
|
||||
width: 24px !important;
|
||||
height: 24px !important;
|
||||
display: none;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: 700 !important;
|
||||
cursor: pointer !important;
|
||||
margin-right: 4px !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-clear-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.25) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-search-action-btn {
|
||||
background: linear-gradient(135deg, #ff8f37 0%, #ff5e3a 100%) !important;
|
||||
color: #fff !important;
|
||||
border: none !important;
|
||||
border-radius: 30px !important;
|
||||
padding: 8px 18px !important;
|
||||
font-size: 14px !important;
|
||||
font-weight: 700 !important;
|
||||
cursor: pointer !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
gap: 6px !important;
|
||||
transition: all 0.2s ease !important;
|
||||
flex-shrink: 0 !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-search-action-btn:hover {
|
||||
transform: scale(1.03) !important;
|
||||
box-shadow: 0 4px 14px rgba(255, 143, 55, 0.4) !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-voice-btn {
|
||||
background: #2a2a34 !important;
|
||||
color: #ff8f37 !important;
|
||||
border: 1px solid rgba(255, 143, 55, 0.3) !important;
|
||||
border-radius: 50% !important;
|
||||
width: 40px !important;
|
||||
height: 40px !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
font-size: 18px !important;
|
||||
cursor: pointer !important;
|
||||
margin-left: 8px !important;
|
||||
transition: all 0.2s ease !important;
|
||||
flex-shrink: 0 !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-voice-btn:hover {
|
||||
background: #ff8f37 !important;
|
||||
color: #fff !important;
|
||||
transform: scale(1.06) !important;
|
||||
}
|
||||
|
||||
/* Modal Body Content */
|
||||
.yaktube-modal-body {
|
||||
padding: 20px 24px 28px 24px !important;
|
||||
}
|
||||
|
||||
/* Voice Recognition Banner Inside Modal */
|
||||
.yaktube-modal-voice-section {
|
||||
display: none;
|
||||
background: #141418 !important;
|
||||
border: 1px solid rgba(255, 143, 55, 0.3) !important;
|
||||
border-radius: 14px !important;
|
||||
padding: 20px !important;
|
||||
text-align: center !important;
|
||||
margin-bottom: 20px !important;
|
||||
animation: yaktube-fade-in 0.2s ease !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-voice-status {
|
||||
font-size: 18px !important;
|
||||
font-weight: 700 !important;
|
||||
color: #f1f1f1 !important;
|
||||
margin-bottom: 12px !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-voice-transcript {
|
||||
font-size: 16px !important;
|
||||
color: #ff8f37 !important;
|
||||
font-weight: 600 !important;
|
||||
min-height: 24px !important;
|
||||
margin-bottom: 16px !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-mic-pulse-btn {
|
||||
background: #cc0000 !important;
|
||||
color: #fff !important;
|
||||
border: none !important;
|
||||
border-radius: 50% !important;
|
||||
width: 64px !important;
|
||||
height: 64px !important;
|
||||
font-size: 28px !important;
|
||||
cursor: pointer !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
box-shadow: 0 4px 20px rgba(204, 0, 0, 0.5) !important;
|
||||
animation: yaktube-pulse-recording 1.5s infinite !important;
|
||||
}
|
||||
|
||||
/* Popular Topics & Chips */
|
||||
.yaktube-modal-section-title {
|
||||
font-size: 13px !important;
|
||||
font-weight: 700 !important;
|
||||
text-transform: uppercase !important;
|
||||
letter-spacing: 0.5px !important;
|
||||
color: #888 !important;
|
||||
margin-bottom: 12px !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
gap: 6px !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-chips-grid {
|
||||
display: flex !important;
|
||||
flex-wrap: wrap !important;
|
||||
gap: 8px !important;
|
||||
margin-bottom: 18px !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-chip {
|
||||
background: #252530 !important;
|
||||
color: #e2e8f0 !important;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08) !important;
|
||||
border-radius: 20px !important;
|
||||
padding: 8px 14px !important;
|
||||
font-size: 13px !important;
|
||||
font-weight: 600 !important;
|
||||
cursor: pointer !important;
|
||||
transition: all 0.2s ease !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
gap: 6px !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-chip:hover {
|
||||
background: rgba(255, 143, 55, 0.2) !important;
|
||||
border-color: #ff8f37 !important;
|
||||
color: #fff !important;
|
||||
transform: translateY(-1px) !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-hint-footer {
|
||||
display: flex !important;
|
||||
justify-content: space-between !important;
|
||||
align-items: center !important;
|
||||
font-size: 12px !important;
|
||||
color: #777 !important;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
|
||||
padding-top: 12px !important;
|
||||
margin-top: 8px !important;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* YOUTUBE THEATER MODE & QUICK VIDEO INFO TOAST (v1.4.0) */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/* Theater / Cinema Mode (T) */
|
||||
body.yaktube-theater-mode my-video-watch,
|
||||
body.yaktube-theater-mode .video-watch,
|
||||
body.yaktube-theater-mode .watch-container {
|
||||
max-width: 100% !important;
|
||||
width: 100% !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
body.yaktube-theater-mode .player-container,
|
||||
body.yaktube-theater-mode .video-player-container,
|
||||
body.yaktube-theater-mode .player-wrapper {
|
||||
max-height: 82vh !important;
|
||||
height: 82vh !important;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
background: #000 !important;
|
||||
display: flex !important;
|
||||
justify-content: center !important;
|
||||
align-items: center !important;
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
|
||||
body.yaktube-theater-mode video,
|
||||
body.yaktube-theater-mode .video-js {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
max-height: 82vh !important;
|
||||
}
|
||||
|
||||
/* Quick Video Info Toast (I) */
|
||||
.yaktube-video-info-toast {
|
||||
position: fixed !important;
|
||||
top: 70px !important;
|
||||
right: 20px !important;
|
||||
background: rgba(20, 20, 26, 0.95) !important;
|
||||
backdrop-filter: blur(12px) !important;
|
||||
border: 1px solid rgba(255, 143, 55, 0.4) !important;
|
||||
border-radius: 14px !important;
|
||||
padding: 16px 20px !important;
|
||||
color: #fff !important;
|
||||
font-size: 14px !important;
|
||||
z-index: 99999 !important;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7) !important;
|
||||
max-width: 380px !important;
|
||||
animation: yaktube-fade-in 0.25s ease-out !important;
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
.yaktube-info-toast-title {
|
||||
font-size: 15px !important;
|
||||
font-weight: 700 !important;
|
||||
color: #ff8f37 !important;
|
||||
margin-bottom: 8px !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
gap: 6px !important;
|
||||
}
|
||||
|
||||
.yaktube-info-toast-row {
|
||||
display: flex !important;
|
||||
justify-content: space-between !important;
|
||||
margin: 4px 0 !important;
|
||||
font-size: 13px !important;
|
||||
color: #ccc !important;
|
||||
}
|
||||
|
||||
.yaktube-info-toast-row b {
|
||||
color: #fff !important;
|
||||
}
|
||||
Reference in New Issue
Block a user