bookmarks
This commit is contained in:
23
web/app.js
23
web/app.js
@@ -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(/[?&]$/, '');
|
||||
|
||||
Reference in New Issue
Block a user