aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-03-04 18:21:47 -0500
committerbobzel <zzzman@gmail.com>2025-03-04 18:21:47 -0500
commitdbe3a3cf1944a69a3ce492481bc22b8f1a8d53e8 (patch)
tree6669b5a6688fa7ea3ec96a266191855ffc1e7fbe
parent1fe6548a909d63566f0fe37b02ba9cb5eb913caa (diff)
added link cretor button to text anchor menu
-rw-r--r--src/client/util/SharingManager.tsx6
-rw-r--r--src/client/views/AntimodeMenu.scss1
-rw-r--r--src/client/views/MainView.tsx2
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx14
-rw-r--r--src/client/views/pdf/AnchorMenu.tsx2
5 files changed, 15 insertions, 10 deletions
diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx
index efc8e79a6..3a248400b 100644
--- a/src/client/util/SharingManager.tsx
+++ b/src/client/util/SharingManager.tsx
@@ -502,7 +502,6 @@ export class SharingManager extends React.Component<object> {
}
};
- // eslint-disable-next-line react/sort-comp
public close = action(() => {
this.isOpen = false;
this.selectedUsers = null; // resets the list of users and selected users (in the react-select component)
@@ -517,7 +516,6 @@ export class SharingManager extends React.Component<object> {
this.layoutDocAcls = false;
});
- // eslint-disable-next-line react/no-unused-class-component-methods
public open = (target?: DocumentView, targetDoc?: Doc) => {
this.populateUsers();
runInAction(() => {
@@ -534,7 +532,6 @@ export class SharingManager extends React.Component<object> {
* @param group
* @param emailId
*/
- // eslint-disable-next-line react/no-unused-class-component-methods
shareWithAddedMember = (group: Doc, emailId: string, retry: boolean = true) => {
const user = this.users.find(({ user: { email } }) => email === emailId)!;
if (group.docsShared) {
@@ -559,7 +556,6 @@ export class SharingManager extends React.Component<object> {
/**
* Called from the properties sidebar to change permissions of a user.
*/
- // eslint-disable-next-line react/no-unused-class-component-methods
shareFromPropertiesSidebar = undoable((shareWith: string, permission: SharingPermissions, docs: Doc[], layout: boolean) => {
if (layout) this.layoutDocAcls = true;
if (shareWith !== 'Guest') {
@@ -583,7 +579,6 @@ export class SharingManager extends React.Component<object> {
* @param group
* @param emailId
*/
- // eslint-disable-next-line react/no-unused-class-component-methods
removeMember = (group: Doc, emailId: string) => {
const user: ValidatedUser = this.users.find(({ user: { email } }) => email === emailId)!;
@@ -607,7 +602,6 @@ export class SharingManager extends React.Component<object> {
* Removes a group's permissions from documents that have been shared with it.
* @param group
*/
- // eslint-disable-next-line react/no-unused-class-component-methods
removeGroup = (group: Doc) => {
if (group.docsShared) {
DocListCast(group.docsShared).forEach(doc => {
diff --git a/src/client/views/AntimodeMenu.scss b/src/client/views/AntimodeMenu.scss
index 48fa86276..c2f6ae62d 100644
--- a/src/client/views/AntimodeMenu.scss
+++ b/src/client/views/AntimodeMenu.scss
@@ -6,7 +6,6 @@
height: global.$antimodemenu-height;
width: fit-content;
border-radius: global.$standard-border-radius;
- overflow: hidden;
// box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.25);
// border-radius: 0px 6px 6px 6px;
display: flex;
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 631c10b89..cc7c1a42b 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -75,10 +75,8 @@ import { RichTextMenu } from './nodes/formattedText/RichTextMenu';
import ImageEditorBox from './nodes/imageEditor/ImageEditor';
import { PresBox } from './nodes/trails';
import { AnchorMenu } from './pdf/AnchorMenu';
-import { GPTPopup } from './pdf/GPTPopup/GPTPopup';
import { SmartDrawHandler } from './smartdraw/SmartDrawHandler';
import { TopBar } from './topbar/TopBar';
-import { OverlayView } from './OverlayView';
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { LEFT_MENU_WIDTH, TOPBAR_HEIGHT } = require('./global/globalCssVariables.module.scss'); // prettier-ignore
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index e9c521aa0..c2a2caecf 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -1669,7 +1669,19 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FormattedTextB
for (let target: HTMLElement | Element | null = clickTarget as HTMLElement; target instanceof HTMLElement && !target.dataset?.targethrefs; target = target.parentElement);
while (clickTarget instanceof HTMLElement && !clickTarget.dataset?.targethrefs) clickTarget = clickTarget.parentElement;
const dataset = clickTarget instanceof HTMLElement ? clickTarget?.dataset : undefined;
- FormattedTextBoxComment.update(this, this.EditorView!, undefined, dataset?.targethrefs, dataset?.linkdoc, dataset?.nopreview === 'true');
+
+ if (dataset?.targethrefs)
+ window
+ .open(
+ dataset?.targethrefs
+ ?.trim()
+ .split(' ')
+ .filter(h => h)
+ .lastElement(),
+ '_blank'
+ )
+ ?.focus();
+ else FormattedTextBoxComment.update(this, this.EditorView!, undefined, dataset?.targethrefs, dataset?.linkdoc, dataset?.nopreview === 'true');
}
};
@action
diff --git a/src/client/views/pdf/AnchorMenu.tsx b/src/client/views/pdf/AnchorMenu.tsx
index 28371594e..9aa8fe649 100644
--- a/src/client/views/pdf/AnchorMenu.tsx
+++ b/src/client/views/pdf/AnchorMenu.tsx
@@ -18,6 +18,7 @@ import { DocumentView } from '../nodes/DocumentView';
import { DrawingOptions, SmartDrawHandler } from '../smartdraw/SmartDrawHandler';
import './AnchorMenu.scss';
import { GPTPopup } from './GPTPopup/GPTPopup';
+import { RichTextMenu } from '../nodes/formattedText/RichTextMenu';
@observer
export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> {
@@ -241,6 +242,7 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> {
color={SettingsManager.userColor}
/>
)}
+ {this._selectedText && RichTextMenu.Instance?.createLinkButton()}
{AnchorMenu.Instance.OnAudio === unimplementedFunction ? null : (
<IconButton
tooltip="Click to Record Annotation" //