From 4a58f968b2dc45cf64daed992604e9ee83984a49 Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Mon, 2 Dec 2024 14:02:26 -0500 Subject: [PATCH 1/2] Add link and messaging about search and legacy mode --- src/lib/components/layouts/DocumentLayout.svelte | 2 +- src/lib/components/sidebar/ViewerActions.svelte | 15 ++++++++++++++- src/lib/components/viewer/ReadingToolbar.svelte | 9 +++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/lib/components/layouts/DocumentLayout.svelte b/src/lib/components/layouts/DocumentLayout.svelte index e2a26123f..79ceaac11 100644 --- a/src/lib/components/layouts/DocumentLayout.svelte +++ b/src/lib/components/layouts/DocumentLayout.svelte @@ -6,7 +6,6 @@ Assumes it's a child of a ViewerContext import type { Project } from "$lib/api/types"; import { _ } from "svelte-i18n"; - import ViewerActions from "$lib/components/sidebar/ViewerActions.svelte"; import AddOns from "$lib/components/sidebar/AddOns.svelte"; import Avatar from "../accounts/Avatar.svelte"; import Data from "../documents/Data.svelte"; @@ -18,6 +17,7 @@ Assumes it's a child of a ViewerContext import Projects from "../documents/Projects.svelte"; import SidebarLayout from "./SidebarLayout.svelte"; import Viewer from "../viewer/Viewer.svelte"; + import ViewerActions from "$lib/components/sidebar/ViewerActions.svelte"; import { getCurrentUser } from "$lib/utils/permissions"; import { isOrg } from "$lib/api/accounts"; diff --git a/src/lib/components/sidebar/ViewerActions.svelte b/src/lib/components/sidebar/ViewerActions.svelte index 2afc6d3b4..7a221263f 100644 --- a/src/lib/components/sidebar/ViewerActions.svelte +++ b/src/lib/components/sidebar/ViewerActions.svelte @@ -9,6 +9,7 @@ Pencil16, Share16, Trash16, + Undo16, } from "svelte-octicons"; import Button from "$lib/components/common/Button.svelte"; @@ -26,7 +27,7 @@ import Share from "$lib/components/documents/Share.svelte"; import { getUpgradeUrl } from "$lib/api/accounts"; - import { pdfUrl } from "$lib/api/documents"; + import { pdfUrl, canonicalUrl } from "$lib/api/documents"; export let document: Document; export let user: User; @@ -41,6 +42,11 @@ $: organization = typeof user?.organization === "object" ? (user.organization as Org) : null; $: plan = organization?.plan ?? "Free"; + $: canonical = canonicalUrl(document); + $: legacy = new URL( + canonical.pathname, + "https://legacy.www.documentcloud.org", + );
@@ -53,6 +59,10 @@ {$_("sidebar.shareEmbed")} +
{#if document.edit_access}
@@ -170,4 +180,7 @@ .wideGap { gap: 1rem; } + .legacy { + text-align: left; + } diff --git a/src/lib/components/viewer/ReadingToolbar.svelte b/src/lib/components/viewer/ReadingToolbar.svelte index 6c5220b3c..97c7358ee 100644 --- a/src/lib/components/viewer/ReadingToolbar.svelte +++ b/src/lib/components/viewer/ReadingToolbar.svelte @@ -25,9 +25,10 @@ Assumes it's a child of a ViewerContext import Menu from "$lib/components/common/Menu.svelte"; import MenuItem from "$lib/components/common/MenuItem.svelte"; import PageToolbar from "$lib/components/common/PageToolbar.svelte"; - import Tab from "$lib/components/common/Tab.svelte"; import Search from "$lib/components/forms/Search.svelte"; import SidebarItem from "../sidebar/SidebarItem.svelte"; + import Tab from "$lib/components/common/Tab.svelte"; + import Tooltip from "../common/Tooltip.svelte"; import { remToPx } from "$lib/utils/layout"; import { getViewerHref } from "$lib/utils/viewer"; @@ -147,7 +148,11 @@ Assumes it's a child of a ViewerContext {:else} - + + + {/if} From b5365b831374010667332287871e57fc1bfb2d1a Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Mon, 2 Dec 2024 14:22:35 -0500 Subject: [PATCH 2/2] tighten language --- src/lib/components/viewer/ReadingToolbar.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/viewer/ReadingToolbar.svelte b/src/lib/components/viewer/ReadingToolbar.svelte index 97c7358ee..2259cd7ea 100644 --- a/src/lib/components/viewer/ReadingToolbar.svelte +++ b/src/lib/components/viewer/ReadingToolbar.svelte @@ -149,7 +149,7 @@ Assumes it's a child of a ViewerContext {:else}