bookmarks

This commit is contained in:
MDeeApp
2025-10-24 18:17:34 +02:00
parent 9d85044b7f
commit c7cb02cf2d
3 changed files with 61 additions and 0 deletions

View File

@@ -626,6 +626,7 @@ function openBookmark(bookmark) {
window.open(url, '_blank', 'noopener');
}
});
}
async function markBookmarkClick(bookmarkId) {
@@ -894,6 +895,7 @@ function toggleBookmarkPanel(forceVisible) {
bookmarkPanelVisible = shouldShow;
bookmarkPanel.hidden = !bookmarkPanelVisible;
bookmarkPanel.style.display = bookmarkPanelVisible ? 'flex' : 'none';
bookmarkPanel.setAttribute('aria-hidden', bookmarkPanelVisible ? 'false' : 'true');
bookmarkPanelToggle.setAttribute('aria-expanded', bookmarkPanelVisible ? 'true' : 'false');
@@ -993,6 +995,8 @@ function initializeBookmarks() {
if (bookmarkPanel) {
bookmarkPanel.setAttribute('aria-hidden', 'true');
bookmarkPanel.hidden = true;
bookmarkPanel.style.display = 'none';
}
if (bookmarkPanelToggle) {
@@ -1338,6 +1342,20 @@ function normalizeFacebookPostUrl(rawValue) {
return null;
}
const normalizedPathBeforeTrim = parsed.pathname.replace(/\/+$/, '') || '/';
const lowerPathBeforeTrim = normalizedPathBeforeTrim.toLowerCase();
const watchId = parsed.searchParams.get('v') || parsed.searchParams.get('video_id');
if ((lowerPathBeforeTrim === '/watch' || lowerPathBeforeTrim === '/video.php') && watchId) {
parsed.pathname = `/reel/${watchId}/`;
parsed.search = '';
} else {
const reelMatch = lowerPathBeforeTrim.match(/^\/reel\/([^/]+)$/);
if (reelMatch) {
parsed.pathname = `/reel/${reelMatch[1]}/`;
parsed.search = '';
}
}
const cleanedParams = new URLSearchParams();
parsed.searchParams.forEach((paramValue, paramKey) => {
const lowerKey = paramKey.toLowerCase();
@@ -1349,6 +1367,11 @@ function normalizeFacebookPostUrl(rawValue) {
cleanedParams.append(paramKey, paramValue);
});
const normalizedPath = parsed.pathname.replace(/\/+$/, '').toLowerCase();
if (normalizedPath.startsWith('/hashtag/') || normalizedPath.startsWith('/watch/hashtag/')) {
return '';
}
const search = cleanedParams.toString();
const formatted = `${parsed.origin}${parsed.pathname}${search ? `?${search}` : ''}`;
return formatted.replace(/[?&]$/, '');