mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 15:17:12 -05:00
Install Ctrl+Shfit+V paste only on Apple platforms
This commit is contained in:
parent
61e38a8bc9
commit
ed496c097f
1 changed files with 7 additions and 0 deletions
|
|
@ -8,6 +8,9 @@
|
||||||
import { filterHTML } from "html-filter";
|
import { filterHTML } from "html-filter";
|
||||||
import { updateActiveButtons } from "./toolbar";
|
import { updateActiveButtons } from "./toolbar";
|
||||||
import { setupI18n, ModuleName } from "lib/i18n";
|
import { setupI18n, ModuleName } from "lib/i18n";
|
||||||
|
import { isApplePlatform } from "lib/platform";
|
||||||
|
import { registerShortcut } from "lib/shortcuts";
|
||||||
|
import { bridgeCommand } from "lib/bridgecommand";
|
||||||
|
|
||||||
import "./fields.css";
|
import "./fields.css";
|
||||||
|
|
||||||
|
|
@ -41,6 +44,10 @@ customElements.define("anki-editing-area", EditingArea, { extends: "div" });
|
||||||
customElements.define("anki-label-container", LabelContainer, { extends: "div" });
|
customElements.define("anki-label-container", LabelContainer, { extends: "div" });
|
||||||
customElements.define("anki-editor-field", EditorField, { extends: "div" });
|
customElements.define("anki-editor-field", EditorField, { extends: "div" });
|
||||||
|
|
||||||
|
if (isApplePlatform()) {
|
||||||
|
registerShortcut(() => bridgeCommand("paste"), "Control+Shift+V");
|
||||||
|
}
|
||||||
|
|
||||||
export function getCurrentField(): EditingArea | null {
|
export function getCurrentField(): EditingArea | null {
|
||||||
return document.activeElement instanceof EditingArea
|
return document.activeElement instanceof EditingArea
|
||||||
? document.activeElement
|
? document.activeElement
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue