mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
copy paste, undo, redo, select all shortcuts supported on mac build
This commit is contained in:
parent
c87b592277
commit
b8a74c727e
17
src/public/javascripts/services/bootstrap.js
vendored
17
src/public/javascripts/services/bootstrap.js
vendored
@ -104,6 +104,21 @@ if (utils.isElectron()) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exec(cmd) {
|
||||||
|
document.execCommand(cmd);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (utils.isElectron() && utils.isMac()) {
|
||||||
|
utils.bindShortcut('ctrl+c', () => exec("copy"));
|
||||||
|
utils.bindShortcut('ctrl+v', () => exec('paste'));
|
||||||
|
utils.bindShortcut('ctrl+x', () => exec('cut'));
|
||||||
|
utils.bindShortcut('ctrl+a', () => exec('selectAll'));
|
||||||
|
utils.bindShortcut('ctrl+z', () => exec('undo'));
|
||||||
|
utils.bindShortcut('ctrl+y', () => exec('redo'));
|
||||||
|
}
|
||||||
|
|
||||||
$("#export-note-button").click(function () {
|
$("#export-note-button").click(function () {
|
||||||
if ($(this).hasClass("disabled")) {
|
if ($(this).hasClass("disabled")) {
|
||||||
return;
|
return;
|
||||||
@ -118,4 +133,4 @@ entrypoints.registerEntrypoints();
|
|||||||
|
|
||||||
tooltip.setupTooltip();
|
tooltip.setupTooltip();
|
||||||
|
|
||||||
bundle.executeStartupBundles();
|
bundle.executeStartupBundles();
|
||||||
|
@ -46,6 +46,10 @@ function isElectron() {
|
|||||||
return window && window.process && window.process.type;
|
return window && window.process && window.process.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isMac() {
|
||||||
|
return navigator.platform.indexOf('Mac') > -1;
|
||||||
|
}
|
||||||
|
|
||||||
function assertArguments() {
|
function assertArguments() {
|
||||||
for (const i in arguments) {
|
for (const i in arguments) {
|
||||||
if (!arguments[i]) {
|
if (!arguments[i]) {
|
||||||
@ -150,6 +154,7 @@ export default {
|
|||||||
formatDateTime,
|
formatDateTime,
|
||||||
now,
|
now,
|
||||||
isElectron,
|
isElectron,
|
||||||
|
isMac,
|
||||||
assertArguments,
|
assertArguments,
|
||||||
isTopLevelNode,
|
isTopLevelNode,
|
||||||
isRootNode,
|
isRootNode,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user