mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
Rename title to tooltip across editor toolbar components
This commit is contained in:
parent
8e1092d2c4
commit
a2d37206ea
16 changed files with 50 additions and 50 deletions
2
ts/editor-toolbar/ColorPicker.d.ts
vendored
2
ts/editor-toolbar/ColorPicker.d.ts
vendored
|
@ -1,6 +1,6 @@
|
||||||
export interface ColorPickerProps {
|
export interface ColorPickerProps {
|
||||||
id?: string;
|
id?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
title: string;
|
tooltip: string;
|
||||||
onChange: (event: Event) => void;
|
onChange: (event: Event) => void;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
export let id = "";
|
export let id = "";
|
||||||
export let className = "";
|
export let className = "";
|
||||||
export let props: Record<string, string> = {};
|
export let props: Record<string, string> = {};
|
||||||
export let title: string;
|
export let tooltip: string;
|
||||||
|
|
||||||
export let onChange: (event: Event) => void;
|
export let onChange: (event: Event) => void;
|
||||||
</script>
|
</script>
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
{id}
|
{id}
|
||||||
class={className}
|
class={className}
|
||||||
{...props}
|
{...props}
|
||||||
{title}
|
title={tooltip}
|
||||||
on:mousedown|preventDefault>
|
on:mousedown|preventDefault>
|
||||||
<span> <input type="color" on:change={onChange} /> </span>
|
<span> <input type="color" on:change={onChange} /> </span>
|
||||||
</button>
|
</button>
|
||||||
|
|
2
ts/editor-toolbar/CommandIconButton.d.ts
vendored
2
ts/editor-toolbar/CommandIconButton.d.ts
vendored
|
@ -1,7 +1,7 @@
|
||||||
export interface CommandIconButtonProps {
|
export interface CommandIconButtonProps {
|
||||||
id?: string;
|
id?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
title: string;
|
tooltip: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
command: string;
|
command: string;
|
||||||
activatable?: boolean;
|
activatable?: boolean;
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
export let id = "";
|
export let id = "";
|
||||||
export let className = "";
|
export let className = "";
|
||||||
export let props: Record<string, string> = {};
|
export let props: Record<string, string> = {};
|
||||||
export let title: string;
|
export let tooltip: string;
|
||||||
|
|
||||||
export let icon;
|
export let icon;
|
||||||
export let command: string;
|
export let command: string;
|
||||||
|
@ -62,6 +62,6 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<SquareButton {id} {className} {props} {title} {active} {onClick} on:mount>
|
<SquareButton {id} {className} {props} {tooltip} {active} {onClick} on:mount>
|
||||||
{@html icon}
|
{@html icon}
|
||||||
</SquareButton>
|
</SquareButton>
|
||||||
|
|
2
ts/editor-toolbar/DropdownItem.d.ts
vendored
2
ts/editor-toolbar/DropdownItem.d.ts
vendored
|
@ -1,7 +1,7 @@
|
||||||
export interface DropdownItemProps {
|
export interface DropdownItemProps {
|
||||||
id?: string;
|
id?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
title: string;
|
tooltip: string;
|
||||||
|
|
||||||
onClick: (event: MouseEvent) => void;
|
onClick: (event: MouseEvent) => void;
|
||||||
label: string;
|
label: string;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
export let id = "";
|
export let id = "";
|
||||||
export let className = "";
|
export let className = "";
|
||||||
export let props: Record<string, string> = {};
|
export let props: Record<string, string> = {};
|
||||||
export let title: string;
|
export let tooltip: string;
|
||||||
|
|
||||||
export let onClick: (event: MouseEvent) => void;
|
export let onClick: (event: MouseEvent) => void;
|
||||||
export let label: string;
|
export let label: string;
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
{id}
|
{id}
|
||||||
class={`dropdown-item ${className}`}
|
class={`dropdown-item ${className}`}
|
||||||
{...props}
|
{...props}
|
||||||
{title}
|
title={tooltip}
|
||||||
on:click={onClick}
|
on:click={onClick}
|
||||||
on:mousedown|preventDefault>
|
on:mousedown|preventDefault>
|
||||||
<span class="float-start">{label}</span>
|
<span class="float-start">{label}</span>
|
||||||
|
|
2
ts/editor-toolbar/IconButton.d.ts
vendored
2
ts/editor-toolbar/IconButton.d.ts
vendored
|
@ -1,7 +1,7 @@
|
||||||
export interface IconButtonProps {
|
export interface IconButtonProps {
|
||||||
id?: string;
|
id?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
title: string;
|
tooltip: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
onClick: (event: MouseEvent) => void;
|
onClick: (event: MouseEvent) => void;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
export let id = "";
|
export let id = "";
|
||||||
export let className = "";
|
export let className = "";
|
||||||
export let props: Record<string, string> = {};
|
export let props: Record<string, string> = {};
|
||||||
export let title: string;
|
export let tooltip: string;
|
||||||
|
|
||||||
export let icon = "";
|
export let icon = "";
|
||||||
export let onClick: (event: MouseEvent) => void;
|
export let onClick: (event: MouseEvent) => void;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<SquareButton {id} {className} {props} {title} {onClick} on:mount>
|
<SquareButton {id} {className} {props} {tooltip} {onClick} on:mount>
|
||||||
{@html icon}
|
{@html icon}
|
||||||
</SquareButton>
|
</SquareButton>
|
||||||
|
|
2
ts/editor-toolbar/LabelButton.d.ts
vendored
2
ts/editor-toolbar/LabelButton.d.ts
vendored
|
@ -3,7 +3,7 @@ export interface LabelButtonProps {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
|
||||||
label: string;
|
label: string;
|
||||||
title: string;
|
tooltip: string;
|
||||||
onClick: (event: MouseEvent) => void;
|
onClick: (event: MouseEvent) => void;
|
||||||
disables?: boolean;
|
disables?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
export let props: Record<string, string> = {};
|
export let props: Record<string, string> = {};
|
||||||
|
|
||||||
export let label: string;
|
export let label: string;
|
||||||
export let title: string;
|
export let tooltip: string;
|
||||||
export let onClick: (event: MouseEvent) => void;
|
export let onClick: (event: MouseEvent) => void;
|
||||||
export let disables = true;
|
export let disables = true;
|
||||||
|
|
||||||
|
@ -60,6 +60,6 @@
|
||||||
{...props}
|
{...props}
|
||||||
on:click={onClick}
|
on:click={onClick}
|
||||||
on:mousedown|preventDefault
|
on:mousedown|preventDefault
|
||||||
{title}>
|
title={tooltip}>
|
||||||
{label}
|
{label}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
export let id = "";
|
export let id = "";
|
||||||
export let className = "";
|
export let className = "";
|
||||||
export let props: Record<string, string> = {};
|
export let props: Record<string, string> = {};
|
||||||
export let title: string;
|
export let tooltip: string;
|
||||||
|
|
||||||
function extendClassName(classes: string) {
|
function extendClassName(classes: string) {
|
||||||
return `form-select ${classes}`;
|
return `form-select ${classes}`;
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
{id}
|
{id}
|
||||||
class={extendClassName(className)}
|
class={extendClassName(className)}
|
||||||
{...props}
|
{...props}
|
||||||
{title}>
|
title={tooltip}>
|
||||||
{#each options as option}
|
{#each options as option}
|
||||||
<SelectOption {...option} />
|
<SelectOption {...option} />
|
||||||
{/each}
|
{/each}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
export let id = "";
|
export let id = "";
|
||||||
export let className = "";
|
export let className = "";
|
||||||
export let props: Record<string, string> = {};
|
export let props: Record<string, string> = {};
|
||||||
export let title: string;
|
export let tooltip: string;
|
||||||
|
|
||||||
export let onClick: (event: MouseEvent) => void;
|
export let onClick: (event: MouseEvent) => void;
|
||||||
export let active = false;
|
export let active = false;
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
{id}
|
{id}
|
||||||
class={className}
|
class={className}
|
||||||
{...props}
|
{...props}
|
||||||
{title}
|
title={tooltip}
|
||||||
class:active
|
class:active
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
disabled={_disabled}
|
disabled={_disabled}
|
||||||
|
|
|
@ -24,26 +24,26 @@ function wrapWithForecolor(color: string): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
const iconButton = dynamicComponent(IconButton);
|
const iconButton = dynamicComponent(IconButton);
|
||||||
const forecolorButton = iconButton<IconButtonProps, "title">(
|
const forecolorButton = iconButton<IconButtonProps, "tooltip">(
|
||||||
{
|
{
|
||||||
icon: squareFillIcon,
|
icon: squareFillIcon,
|
||||||
className: "forecolor",
|
className: "forecolor",
|
||||||
onClick: () => wrapWithForecolor(getForecolor()),
|
onClick: () => wrapWithForecolor(getForecolor()),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: tr.editingSetForegroundColourF7,
|
tooltip: tr.editingSetForegroundColourF7,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const colorPicker = dynamicComponent(ColorPicker);
|
const colorPicker = dynamicComponent(ColorPicker);
|
||||||
const colorpickerButton = colorPicker<ColorPickerProps, "title">(
|
const colorpickerButton = colorPicker<ColorPickerProps, "tooltip">(
|
||||||
{
|
{
|
||||||
className: "rainbow",
|
className: "rainbow",
|
||||||
onChange: ({ currentTarget }) =>
|
onChange: ({ currentTarget }) =>
|
||||||
setForegroundColor((currentTarget as HTMLInputElement).value),
|
setForegroundColor((currentTarget as HTMLInputElement).value),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: tr.editingChangeColourF8,
|
tooltip: tr.editingChangeColourF8,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -13,64 +13,64 @@ import eraserIcon from "./eraser.svg";
|
||||||
|
|
||||||
const commandIconButton = dynamicComponent(CommandIconButton);
|
const commandIconButton = dynamicComponent(CommandIconButton);
|
||||||
|
|
||||||
const boldButton = commandIconButton<CommandIconButtonProps, "title">(
|
const boldButton = commandIconButton<CommandIconButtonProps, "tooltip">(
|
||||||
{
|
{
|
||||||
icon: boldIcon,
|
icon: boldIcon,
|
||||||
command: "bold",
|
command: "bold",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: tr.editingBoldTextCtrlandb,
|
tooltip: tr.editingBoldTextCtrlandb,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const italicButton = commandIconButton<CommandIconButtonProps, "title">(
|
const italicButton = commandIconButton<CommandIconButtonProps, "tooltip">(
|
||||||
{
|
{
|
||||||
icon: italicIcon,
|
icon: italicIcon,
|
||||||
command: "italic",
|
command: "italic",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: tr.editingItalicTextCtrlandi,
|
tooltip: tr.editingItalicTextCtrlandi,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const underlineButton = commandIconButton<CommandIconButtonProps, "title">(
|
const underlineButton = commandIconButton<CommandIconButtonProps, "tooltip">(
|
||||||
{
|
{
|
||||||
icon: underlineIcon,
|
icon: underlineIcon,
|
||||||
command: "underline",
|
command: "underline",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: tr.editingUnderlineTextCtrlandu,
|
tooltip: tr.editingUnderlineTextCtrlandu,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const superscriptButton = commandIconButton<CommandIconButtonProps, "title">(
|
const superscriptButton = commandIconButton<CommandIconButtonProps, "tooltip">(
|
||||||
{
|
{
|
||||||
icon: superscriptIcon,
|
icon: superscriptIcon,
|
||||||
command: "superscript",
|
command: "superscript",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: tr.editingSuperscriptCtrlandand,
|
tooltip: tr.editingSuperscriptCtrlandand,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const subscriptButton = commandIconButton<CommandIconButtonProps, "title">(
|
const subscriptButton = commandIconButton<CommandIconButtonProps, "tooltip">(
|
||||||
{
|
{
|
||||||
icon: subscriptIcon,
|
icon: subscriptIcon,
|
||||||
command: "subscript",
|
command: "subscript",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: tr.editingSubscriptCtrland,
|
tooltip: tr.editingSubscriptCtrland,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const removeFormatButton = commandIconButton<CommandIconButtonProps, "title">(
|
const removeFormatButton = commandIconButton<CommandIconButtonProps, "tooltip">(
|
||||||
{
|
{
|
||||||
icon: eraserIcon,
|
icon: eraserIcon,
|
||||||
command: "removeFormat",
|
command: "removeFormat",
|
||||||
activatable: false,
|
activatable: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: tr.editingRemoveFormattingCtrlandr,
|
tooltip: tr.editingRemoveFormattingCtrlandr,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -6,25 +6,25 @@ import { bridgeCommand } from "anki/bridgecommand";
|
||||||
import * as tr from "anki/i18n";
|
import * as tr from "anki/i18n";
|
||||||
|
|
||||||
const labelButton = dynamicComponent(LabelButton);
|
const labelButton = dynamicComponent(LabelButton);
|
||||||
const fieldsButton = labelButton<LabelButtonProps, "label" | "title">(
|
const fieldsButton = labelButton<LabelButtonProps, "label" | "tooltip">(
|
||||||
{
|
{
|
||||||
onClick: () => bridgeCommand("fields"),
|
onClick: () => bridgeCommand("fields"),
|
||||||
disables: false,
|
disables: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: () => `${tr.editingFields()}...`,
|
label: () => `${tr.editingFields()}...`,
|
||||||
title: tr.editingCustomizeFields,
|
tooltip: tr.editingCustomizeFields,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const cardsButton = labelButton<LabelButtonProps, "label" | "title">(
|
const cardsButton = labelButton<LabelButtonProps, "label" | "tooltip">(
|
||||||
{
|
{
|
||||||
onClick: () => bridgeCommand("cards"),
|
onClick: () => bridgeCommand("cards"),
|
||||||
disables: false,
|
disables: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: () => `${tr.editingCards()}...`,
|
label: () => `${tr.editingCards()}...`,
|
||||||
title: tr.editingCustomizeCardTemplatesCtrlandl,
|
tooltip: tr.editingCustomizeCardTemplatesCtrlandl,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -39,34 +39,34 @@ const withDropdownMenu = dynamicComponent(WithDropdownMenu);
|
||||||
const dropdownMenu = dynamicComponent(DropdownMenu);
|
const dropdownMenu = dynamicComponent(DropdownMenu);
|
||||||
const dropdownItem = dynamicComponent(DropdownItem);
|
const dropdownItem = dynamicComponent(DropdownItem);
|
||||||
|
|
||||||
const attachmentButton = iconButton<IconButtonProps, "title">(
|
const attachmentButton = iconButton<IconButtonProps, "tooltip">(
|
||||||
{
|
{
|
||||||
icon: paperclipIcon,
|
icon: paperclipIcon,
|
||||||
onClick: onAttachment,
|
onClick: onAttachment,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: tr.editingAttachPicturesaudiovideoF3,
|
tooltip: tr.editingAttachPicturesaudiovideoF3,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const recordButton = iconButton(
|
const recordButton = iconButton(
|
||||||
{ icon: micIcon, onClick: onRecord },
|
{ icon: micIcon, onClick: onRecord },
|
||||||
{
|
{
|
||||||
title: tr.editingRecordAudioF5,
|
tooltip: tr.editingRecordAudioF5,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const clozeButton = iconButton<IconButtonProps, "title">(
|
const clozeButton = iconButton<IconButtonProps, "tooltip">(
|
||||||
{
|
{
|
||||||
icon: bracketsIcon,
|
icon: bracketsIcon,
|
||||||
onClick: onCloze,
|
onClick: onCloze,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: tr.editingClozeDeletionCtrlandshiftandc,
|
tooltip: tr.editingClozeDeletionCtrlandshiftandc,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const mathjaxButton = iconButton<Omit<IconButtonProps, "onClick" | "title">>(
|
const mathjaxButton = iconButton<Omit<IconButtonProps, "onClick" | "tooltip">>(
|
||||||
{
|
{
|
||||||
icon: functionIcon,
|
icon: functionIcon,
|
||||||
},
|
},
|
||||||
|
@ -82,7 +82,7 @@ const mathjaxMenu = dropdownMenu<DropdownMenuProps>(
|
||||||
dropdownItem<DropdownItemProps, "label">(
|
dropdownItem<DropdownItemProps, "label">(
|
||||||
{
|
{
|
||||||
onClick: () => bridgeCommand("mathjaxInline"),
|
onClick: () => bridgeCommand("mathjaxInline"),
|
||||||
title: "test",
|
tooltip: "test",
|
||||||
endLabel: "test",
|
endLabel: "test",
|
||||||
},
|
},
|
||||||
{ label: tr.editingMathjaxInline }
|
{ label: tr.editingMathjaxInline }
|
||||||
|
@ -90,7 +90,7 @@ const mathjaxMenu = dropdownMenu<DropdownMenuProps>(
|
||||||
dropdownItem<DropdownItemProps, "label">(
|
dropdownItem<DropdownItemProps, "label">(
|
||||||
{
|
{
|
||||||
onClick: () => bridgeCommand("mathjaxBlock"),
|
onClick: () => bridgeCommand("mathjaxBlock"),
|
||||||
title: "test",
|
tooltip: "test",
|
||||||
endLabel: "test",
|
endLabel: "test",
|
||||||
},
|
},
|
||||||
{ label: tr.editingMathjaxBlock }
|
{ label: tr.editingMathjaxBlock }
|
||||||
|
@ -98,7 +98,7 @@ const mathjaxMenu = dropdownMenu<DropdownMenuProps>(
|
||||||
dropdownItem<DropdownItemProps, "label">(
|
dropdownItem<DropdownItemProps, "label">(
|
||||||
{
|
{
|
||||||
onClick: () => bridgeCommand("mathjaxChemistry"),
|
onClick: () => bridgeCommand("mathjaxChemistry"),
|
||||||
title: "test",
|
tooltip: "test",
|
||||||
endLabel: "test",
|
endLabel: "test",
|
||||||
},
|
},
|
||||||
{ label: tr.editingMathjaxChemistry }
|
{ label: tr.editingMathjaxChemistry }
|
||||||
|
@ -116,13 +116,13 @@ const mathjaxButtonWithMenu = withDropdownMenu<WithDropdownMenuProps>(
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
|
||||||
const htmlButton = iconButton<IconButtonProps, "title">(
|
const htmlButton = iconButton<IconButtonProps, "tooltip">(
|
||||||
{
|
{
|
||||||
icon: xmlIcon,
|
icon: xmlIcon,
|
||||||
onClick: onHtmlEdit,
|
onClick: onHtmlEdit,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: tr.editingHtmlEditor,
|
tooltip: tr.editingHtmlEditor,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue