Merge branch 'stable'

# Conflicts:
#	package-lock.json
#	package.json
This commit is contained in:
zadam 2019-08-15 08:52:34 +02:00
commit 61520bc3b3
14 changed files with 126 additions and 116 deletions

138
package-lock.json generated
View File

@ -795,27 +795,27 @@
"integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg=="
},
"app-builder-bin": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-3.4.3.tgz",
"integrity": "sha512-qMhayIwi3juerQEVJMQ76trObEbfQT0nhUdxZz9a26/3NLT3pE6awmQ8S1cEnrGugaaM5gYqR8OElcDezfmEsg==",
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-3.4.2.tgz",
"integrity": "sha512-E9VvUrZm60oLl0rvLw/ErvZiEOIHkulZbJ9C9TWMD4ftNrkXFc2+a5JGlD19Bwvj329d4qz91zs/hWD01q18TQ==",
"dev": true
},
"app-builder-lib": {
"version": "21.2.0",
"resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-21.2.0.tgz",
"integrity": "sha512-aOX/nv77/Bti6NymJDg7p9T067xD8m1ipIEJR7B4Mm1GsJWpMm9PZdXtCRiMNRjHtQS5KIljT0g17781y6qn5A==",
"version": "21.1.5",
"resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-21.1.5.tgz",
"integrity": "sha512-hLsSVSstMTq33a9jbBStrF0e+fa6eWXWIpsatPvHnJlkjx7dAZ5d2cZPe/1bAO3bCL3afpRl5j+HU853eGfDCg==",
"dev": true,
"requires": {
"7zip-bin": "~5.0.3",
"@develar/schema-utils": "~2.1.0",
"async-exit-hook": "^2.0.1",
"bluebird-lst": "^1.0.9",
"builder-util": "21.2.0",
"builder-util": "21.1.5",
"builder-util-runtime": "8.3.0",
"chromium-pickle-js": "^0.2.0",
"debug": "^4.1.1",
"ejs": "^2.6.2",
"electron-publish": "21.2.0",
"electron-publish": "21.1.5",
"fs-extra": "^8.1.0",
"hosted-git-info": "^2.7.1",
"is-ci": "^2.0.0",
@ -825,7 +825,7 @@
"minimatch": "^3.0.4",
"normalize-package-data": "^2.5.0",
"read-config-file": "5.0.0",
"sanitize-filename": "^1.6.2",
"sanitize-filename": "^1.6.1",
"semver": "^6.3.0",
"temp-file": "^3.3.4"
},
@ -889,6 +889,12 @@
"requires": {
"path-parse": "^1.0.6"
}
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
}
},
@ -1603,14 +1609,14 @@
}
},
"builder-util": {
"version": "21.2.0",
"resolved": "https://registry.npmjs.org/builder-util/-/builder-util-21.2.0.tgz",
"integrity": "sha512-Nd6CUb6YgDY8EXAXEIegx+1kzKqyFQ5ZM5BoYkeunAlwz/zDJoH1UCyULjoS5wQe5czNClFQy07zz2bzYD0Z4A==",
"version": "21.1.5",
"resolved": "https://registry.npmjs.org/builder-util/-/builder-util-21.1.5.tgz",
"integrity": "sha512-RBr06OnoTKTkg0W7Om2dnuKe8I82CiciU9EdsNnLO8DAfH0ZVCPsVpc3qYmr7g/7cH3zXA3yyQP73QDGNpbVYQ==",
"dev": true,
"requires": {
"7zip-bin": "~5.0.3",
"@types/debug": "^4.1.4",
"app-builder-bin": "3.4.3",
"app-builder-bin": "3.4.2",
"bluebird-lst": "^1.0.9",
"builder-util-runtime": "8.3.0",
"chalk": "^2.4.2",
@ -1618,7 +1624,7 @@
"fs-extra": "^8.1.0",
"is-ci": "^2.0.0",
"js-yaml": "^3.13.1",
"source-map-support": "^0.5.13",
"source-map-support": "^0.5.12",
"stat-mode": "^0.3.0",
"temp-file": "^3.3.4"
},
@ -2269,9 +2275,9 @@
}
},
"content-security-policy-builder": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/content-security-policy-builder/-/content-security-policy-builder-2.1.0.tgz",
"integrity": "sha512-/MtLWhJVvJNkA9dVLAp6fg9LxD2gfI6R2Fi1hPmfjYXSahJJzcfvoeDOxSyp4NvxMuwWv3WMssE9o31DoULHrQ=="
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/content-security-policy-builder/-/content-security-policy-builder-2.0.0.tgz",
"integrity": "sha512-j+Nhmj1yfZAikJLImCvPJFE29x/UuBi+/MWqggGGc515JKaZrjuei2RhULJmy0MsstW3E3htl002bwmBNMKr7w=="
},
"content-type": {
"version": "1.0.4",
@ -2895,18 +2901,18 @@
}
},
"dmg-builder": {
"version": "21.2.0",
"resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-21.2.0.tgz",
"integrity": "sha512-9cJEclnGy7EyKFCoHDYDf54pub/t92CQapyiUxU0w9Bj2vUvfoDagP1PMiX4XD5rPp96141h9A+QN0OB4VgvQg==",
"version": "21.1.5",
"resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-21.1.5.tgz",
"integrity": "sha512-o9rZua7mzNzZIo9SZJi57ZXe4zjNaajxEJ0LO/8k2z8Q2CL57RIaJZ95sA6G0dC1/g5Gm4cmW3O5nv9Ur8Ayow==",
"dev": true,
"requires": {
"app-builder-lib": "~21.2.0",
"app-builder-lib": "~21.1.5",
"bluebird-lst": "^1.0.9",
"builder-util": "~21.2.0",
"builder-util": "~21.1.5",
"fs-extra": "^8.1.0",
"iconv-lite": "^0.5.0",
"js-yaml": "^3.13.1",
"sanitize-filename": "^1.6.2"
"sanitize-filename": "^1.6.1"
},
"dependencies": {
"esprima": {
@ -3102,9 +3108,9 @@
"integrity": "sha512-PcW2a0tyTuPHz3tWyYqtK6r1fZ3gp+3Sop8Ph+ZYN81Ob5rwmbHEzaqs10N3BEsaGTkh/ooniXK+WwszGlc2+Q=="
},
"electron": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/electron/-/electron-6.0.1.tgz",
"integrity": "sha512-XY69rI5IThIxsOS2BD+1ZkHE9hqkm4xN5a3WQFSmFRr2by4q5CnIe9vXmptlouGPTLs3tb7ySX/+K9CvH3szvg==",
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/electron/-/electron-6.0.2.tgz",
"integrity": "sha512-2SV10JlUsEGZ8CePeQIllFBwrOmm1EONne3Ev7Ro1F4tuS9sF184d3/3wZjEtwOs7hsM6elceYnNuZfx93++YA==",
"dev": true,
"requires": {
"@types/node": "^10.12.18",
@ -3113,22 +3119,22 @@
}
},
"electron-builder": {
"version": "21.2.0",
"resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-21.2.0.tgz",
"integrity": "sha512-x8EXrqFbAb2L3N22YlGar3dGh8vwptbB3ovo3OF6K7NTpcsmM2zEoJv7GhFyX73rNzSG2HaWpXwGAtOp2JWiEw==",
"version": "21.1.5",
"resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-21.1.5.tgz",
"integrity": "sha512-2tEgBESGWQ661dC9/rZlpbtmhlofoNPwnkO6KUuCZUBYpFMRvpMzH2IF7vQYsCst78yxnrV0CtiBePhM1i+DfA==",
"dev": true,
"requires": {
"app-builder-lib": "21.2.0",
"app-builder-lib": "21.1.5",
"bluebird-lst": "^1.0.9",
"builder-util": "21.2.0",
"builder-util": "21.1.5",
"builder-util-runtime": "8.3.0",
"chalk": "^2.4.2",
"dmg-builder": "21.2.0",
"dmg-builder": "21.1.5",
"fs-extra": "^8.1.0",
"is-ci": "^2.0.0",
"lazy-val": "^1.0.4",
"read-config-file": "5.0.0",
"sanitize-filename": "^1.6.2",
"sanitize-filename": "^1.6.1",
"update-notifier": "^3.0.1",
"yargs": "^13.3.0"
},
@ -3642,9 +3648,9 @@
}
},
"electron-context-menu": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/electron-context-menu/-/electron-context-menu-0.14.0.tgz",
"integrity": "sha512-7PuDz0Z3Eebhg/OS3JfPqHrQYl5ApokT/05PPUbNELk0EHBfFZwVcVneOJ05SlaGagK1bfQIXf75WSZt/K23VA==",
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/electron-context-menu/-/electron-context-menu-0.13.0.tgz",
"integrity": "sha512-a98UDykOn+tiyb2mQEz710ZNWj/L85wHv6jRUJFE9GNLSaRH5I5BR022RYoWInLTj1Mns66vh9SueyMPWc+aTQ==",
"requires": {
"cli-truncate": "^2.0.0",
"electron-dl": "^1.2.0",
@ -3714,9 +3720,9 @@
"dev": true
},
"semver": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
}
}
@ -3926,13 +3932,13 @@
}
},
"electron-publish": {
"version": "21.2.0",
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-21.2.0.tgz",
"integrity": "sha512-mWavuoWJe87iaeKd0I24dNWIaR+0yRzshjNVqGyK019H766fsPWl3caQJnVKFaEyrZRP397v4JZVG0e7s16AxA==",
"version": "21.1.5",
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-21.1.5.tgz",
"integrity": "sha512-EgFxZJBrb+EBUcEwg8RNKouoBaOEpACnjLi+ipUsk72x+/6kzhcofAYBchIkGns7meengoXy7QdoiThgpr6rew==",
"dev": true,
"requires": {
"bluebird-lst": "^1.0.9",
"builder-util": "~21.2.0",
"builder-util": "~21.1.5",
"builder-util-runtime": "8.3.0",
"chalk": "^2.4.2",
"fs-extra": "^8.1.0",
@ -5451,9 +5457,9 @@
}
},
"file-type": {
"version": "12.1.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-12.1.0.tgz",
"integrity": "sha512-aZkf42yWGiH+vSOpbVgvbnoRuX4JiitMX9pHYqTHemNQ3lrx64iHi33YGAP7TSJSno56kxQY1lHmw8S6ujlFUg=="
"version": "12.0.1",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-12.0.1.tgz",
"integrity": "sha512-YIs1E51cmqcmgF38ODjy0+M/l5DyfIIy3vngTOujQr/lXqkaSskfBniaZoZ1HVIpa5FTf5e7hCXS4TzxfNGMRQ=="
},
"filename-regex": {
"version": "2.0.1",
@ -6513,9 +6519,9 @@
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="
},
"helmet": {
"version": "3.20.0",
"resolved": "https://registry.npmjs.org/helmet/-/helmet-3.20.0.tgz",
"integrity": "sha512-Ob+TqmQFZ5f7WgP8kBbAzNPsbf6p1lOj5r+327/ymw/IILWih3wcx9u/u/S8Mwv5wbBkO7Li6x5s23t3COhUKw==",
"version": "3.19.0",
"resolved": "https://registry.npmjs.org/helmet/-/helmet-3.19.0.tgz",
"integrity": "sha512-l58Q3unSpYatlurvFzkCbTRQ8oWUmdXbOs7h+pnwQbFJRhRJDjER6UMyqHxp9iFtWPcVA05VLcUGSi0EXIv7GA==",
"requires": {
"depd": "2.0.0",
"dns-prefetch-control": "0.2.0",
@ -6524,7 +6530,7 @@
"feature-policy": "0.3.0",
"frameguard": "3.1.0",
"helmet-crossdomain": "0.4.0",
"helmet-csp": "2.8.0",
"helmet-csp": "2.7.1",
"hide-powered-by": "1.1.0",
"hpkp": "2.0.0",
"hsts": "2.2.0",
@ -6547,12 +6553,12 @@
"integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA=="
},
"helmet-csp": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.8.0.tgz",
"integrity": "sha512-MlCPeM0Sm3pS9RACRihx70VeTHmkQwa7sum9EK1tfw1VZyvFU0dBWym9nHh3CRkTRNlyNm/WFCMvuh9zXkOjNw==",
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.7.1.tgz",
"integrity": "sha512-sCHwywg4daQ2mY0YYwXSZRsgcCeerUwxMwNixGA7aMLkVmPTYBl7gJoZDHOZyXkqPrtuDT3s2B1A+RLI7WxSdQ==",
"requires": {
"camelize": "1.0.0",
"content-security-policy-builder": "2.1.0",
"content-security-policy-builder": "2.0.0",
"dasherize": "2.0.0",
"platform": "1.3.5"
}
@ -11385,9 +11391,9 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sanitize-filename": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.2.tgz",
"integrity": "sha512-cmTzND7RMxUB+f7gI+4+KAVHWEg0lfXvQJdko+FXDP5bNbGIdx4KMP5pX6lv5jfT9jSf6OBbjyxjFtZQwYA/ig==",
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.1.tgz",
"integrity": "sha1-YS2hyWRz+gLczaktzVtKsWSmdyo=",
"requires": {
"truncate-utf8-bytes": "^1.0.0"
}
@ -11406,9 +11412,9 @@
}
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz",
"integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A=="
},
"semver-diff": {
"version": "2.1.0",
@ -11828,9 +11834,9 @@
}
},
"source-map-support": {
"version": "0.5.13",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
"version": "0.5.12",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
@ -13317,9 +13323,9 @@
}
},
"ws": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.1.1.tgz",
"integrity": "sha512-o41D/WmDeca0BqYhsr3nJzQyg9NF5X8l/UdnFNux9cS3lwB+swm8qGWX5rn+aD6xfBU3rGmtHij7g7x6LxFU3A==",
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.1.0.tgz",
"integrity": "sha512-Swie2C4fs7CkwlHu1glMePLYJJsWjzhl1vm3ZaLplD0h7OMkZyZ6kLTB/OagiU923bZrPFXuDTeEqaEN4NWG4g==",
"requires": {
"async-limiter": "^1.0.0"
}

View File

@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.34.2",
"version": "0.34.3",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {
@ -78,7 +78,7 @@
},
"devDependencies": {
"devtron": "1.4.0",
"electron": "6.0.1",
"electron": "6.0.2",
"electron-builder": "21.2.0",
"electron-compile": "6.4.4",
"electron-installer-debian": "2.0.0",

View File

@ -45,7 +45,7 @@ function showInFullText(e) {
$showInFullTextButton.click(showInFullText);
$dialog.bind('keydown', 'ctrl+return', showInFullText);
utils.bindElShortcut($dialog, 'ctrl+return', showInFullText);
export default {
showDialog

View File

@ -53,7 +53,7 @@ async function sendForm() {
$importButton.click(sendForm);
$dialog.bind('keydown', 'ctrl+return', sendForm);
utils.bindElShortcut($dialog, 'ctrl+return', sendForm);
// for CKEditor integration (button on block toolbar)
window.glob.importMarkdownInline = importMarkdownInline;

View File

@ -127,7 +127,7 @@ async function showTables() {
}
}
$query.bind('keydown', 'ctrl+return', execute);
utils.bindElShortcut($query, 'ctrl+return', execute);
$executeButton.click(execute);

View File

@ -23,11 +23,11 @@ function registerEntrypoints() {
jQuery.hotkeys.options.filterContentEditable = false;
jQuery.hotkeys.options.filterTextInputs = false;
utils.bindShortcut('ctrl+l', addLinkDialog.showDialog);
utils.bindShortcut('ctrl+shift+l', addLinkDialog.showDialogForClone);
utils.bindGlobalShortcut('ctrl+l', addLinkDialog.showDialog);
utils.bindGlobalShortcut('ctrl+shift+l', addLinkDialog.showDialogForClone);
$("#jump-to-note-dialog-button").click(jumpToNoteDialog.showDialog);
utils.bindShortcut('ctrl+j', jumpToNoteDialog.showDialog);
utils.bindGlobalShortcut('ctrl+j', jumpToNoteDialog.showDialog);
$("#recent-changes-button").click(recentChangesDialog.showDialog);
@ -35,11 +35,11 @@ function registerEntrypoints() {
$("#leave-protected-session-button").click(protectedSessionService.leaveProtectedSession);
$("#toggle-search-button").click(searchNotesService.toggleSearch);
utils.bindShortcut('ctrl+s', searchNotesService.toggleSearch);
utils.bindGlobalShortcut('ctrl+s', searchNotesService.toggleSearch);
const $noteTabContainer = $("#note-tab-container");
$noteTabContainer.on("click", ".show-attributes-button", attributesDialog.showDialog);
utils.bindShortcut('alt+a', attributesDialog.showDialog);
utils.bindGlobalShortcut('alt+a', attributesDialog.showDialog);
$noteTabContainer.on("click", ".show-note-info-button", noteInfoDialog.showDialog);
@ -66,10 +66,10 @@ function registerEntrypoints() {
$("#options-button").click(optionsDialog.showDialog);
$("#show-help-button").click(helpDialog.showDialog);
utils.bindShortcut('f1', helpDialog.showDialog);
utils.bindGlobalShortcut('f1', helpDialog.showDialog);
$("#open-sql-console-button").click(sqlConsoleDialog.showDialog);
utils.bindShortcut('alt+o', sqlConsoleDialog.showDialog);
utils.bindGlobalShortcut('alt+o', sqlConsoleDialog.showDialog);
$("#show-about-dialog-button").click(aboutDialog.showDialog);
@ -80,32 +80,32 @@ function registerEntrypoints() {
if (utils.isMac()) {
// Mac has a different history navigation shortcuts - https://github.com/zadam/trilium/issues/376
utils.bindShortcut('meta+left', window.history.back);
utils.bindShortcut('meta+right', window.history.forward);
utils.bindGlobalShortcut('meta+left', window.history.back);
utils.bindGlobalShortcut('meta+right', window.history.forward);
}
else {
utils.bindShortcut('alt+left', window.history.back);
utils.bindShortcut('alt+right', window.history.forward);
utils.bindGlobalShortcut('alt+left', window.history.back);
utils.bindGlobalShortcut('alt+right', window.history.forward);
}
}
utils.bindShortcut('alt+m', e => {
utils.bindGlobalShortcut('alt+m', e => {
$(".hide-toggle").toggle();
$("#container").toggleClass("distraction-free-mode");
});
// hide (toggle) everything except for the note content for distraction free writing
utils.bindShortcut('alt+t', e => {
utils.bindGlobalShortcut('alt+t', e => {
const date = new Date();
const dateString = utils.formatDateTime(date);
linkService.addTextToEditor(dateString);
});
utils.bindShortcut('f5', utils.reloadApp);
utils.bindGlobalShortcut('f5', utils.reloadApp);
$("#reload-frontend-button").click(utils.reloadApp);
utils.bindShortcut('ctrl+r', utils.reloadApp);
utils.bindGlobalShortcut('ctrl+r', utils.reloadApp);
$("#open-dev-tools-button").toggle(utils.isElectron());
@ -116,7 +116,7 @@ function registerEntrypoints() {
return false;
};
utils.bindShortcut('ctrl+shift+i', openDevTools);
utils.bindGlobalShortcut('ctrl+shift+i', openDevTools);
$("#open-dev-tools-button").click(openDevTools);
}
@ -141,7 +141,7 @@ function registerEntrypoints() {
}
if (utils.isElectron()) {
utils.bindShortcut('ctrl+f', () => {
utils.bindGlobalShortcut('ctrl+f', () => {
findInPage.openFindWindow();
return false;
@ -161,7 +161,7 @@ function registerEntrypoints() {
$("#toggle-fullscreen-button").click(toggleFullscreen);
utils.bindShortcut('f11', toggleFullscreen);
utils.bindGlobalShortcut('f11', toggleFullscreen);
}
else {
// outside of electron this is handled by the browser
@ -169,8 +169,8 @@ function registerEntrypoints() {
}
if (utils.isElectron()) {
utils.bindShortcut('ctrl+-', zoomService.decreaseZoomFactor);
utils.bindShortcut('ctrl+=', zoomService.increaseZoomFactor);
utils.bindGlobalShortcut('ctrl+-', zoomService.decreaseZoomFactor);
utils.bindGlobalShortcut('ctrl+=', zoomService.increaseZoomFactor);
}
}

View File

@ -40,9 +40,13 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
* @returns {Promise<void>}
*/
this.activateNote = async (notePath, noteLoadedListener) => {
await treeService.activateNote(notePath, noteLoadedListener);
await treeService.activateNote(notePath, async () => {
await treeService.scrollToActiveNote();
await treeService.scrollToActiveNote();
if (noteLoadedListener) {
noteLoadedListener();
}
});
};
/**
@ -91,7 +95,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
}
if (opts.shortcut) {
$(document).bind('keydown', opts.shortcut, opts.action);
utils.bindGlobalShortcut(opts.shortcut, opts.action);
button.attr("title", "Shortcut " + opts.shortcut);
}

View File

@ -5,12 +5,12 @@ import utils from "./utils.js";
function init() {
if (utils.isElectron() && utils.isMac()) {
utils.bindShortcut('meta+c', () => exec("copy"));
utils.bindShortcut('meta+v', () => exec('paste'));
utils.bindShortcut('meta+x', () => exec('cut'));
utils.bindShortcut('meta+a', () => exec('selectAll'));
utils.bindShortcut('meta+z', () => exec('undo'));
utils.bindShortcut('meta+y', () => exec('redo'));
utils.bindGlobalShortcut('meta+c', () => exec("copy"));
utils.bindGlobalShortcut('meta+v', () => exec('paste'));
utils.bindGlobalShortcut('meta+x', () => exec('cut'));
utils.bindGlobalShortcut('meta+a', () => exec('selectAll'));
utils.bindGlobalShortcut('meta+z', () => exec('undo'));
utils.bindGlobalShortcut('meta+y', () => exec('redo'));
}
}

View File

@ -464,17 +464,17 @@ $(tabRow.el).on('contextmenu', '.note-tab', e => {
});
if (utils.isElectron()) {
utils.bindShortcut('ctrl+t', () => {
utils.bindGlobalShortcut('ctrl+t', () => {
openEmptyTab();
});
utils.bindShortcut('ctrl+w', () => {
utils.bindGlobalShortcut('ctrl+w', () => {
if (tabRow.activeTabEl) {
tabRow.removeTab(tabRow.activeTabEl);
}
});
utils.bindShortcut('ctrl+tab', () => {
utils.bindGlobalShortcut('ctrl+tab', () => {
const nextTab = tabRow.nextTabEl;
if (nextTab) {
@ -482,7 +482,7 @@ if (utils.isElectron()) {
}
});
utils.bindShortcut('ctrl+shift+tab', () => {
utils.bindGlobalShortcut('ctrl+shift+tab', () => {
const prevTab = tabRow.previousTabEl;
if (prevTab) {

View File

@ -85,7 +85,7 @@ class TabContext {
if (utils.isDesktop()) {
// keyboard plugin is not loaded in mobile
this.$noteTitle.bind('keydown', 'return', () => {
utils.bindElShortcut(this.$noteTitle, 'return', () => {
this.getComponent().focus();
return false; // to not propagate the enter into the editor (causes issues with codemirror)

View File

@ -562,7 +562,7 @@ async function collapseTree(node = null) {
}
function focusTree() {
$tree.find('.fancytree-container').focus();
getTree().setFocus();
}
async function scrollToActiveNote() {
@ -573,8 +573,8 @@ async function scrollToActiveNote() {
const node = await expandToNote(activeContext.notePath);
node.makeVisible({scrollIntoView: true});
node.setFocus(true);
await node.makeVisible({scrollIntoView: true});
node.setFocus();
}
}
@ -769,7 +769,7 @@ messagingService.subscribeToOutsideSyncMessages(syncData => {
}
});
utils.bindShortcut('ctrl+o', async () => {
utils.bindGlobalShortcut('ctrl+o', async () => {
const node = getActiveNode();
const parentNoteId = node.data.parentNoteId;
const isProtected = await treeUtils.getParentProtectedStatus(node);
@ -815,9 +815,9 @@ async function reloadNote(noteId) {
window.glob.createNoteInto = createNoteInto;
utils.bindShortcut('ctrl+p', createNoteInto);
utils.bindGlobalShortcut('ctrl+p', createNoteInto);
utils.bindShortcut('ctrl+.', scrollToActiveNote);
utils.bindGlobalShortcut('ctrl+.', scrollToActiveNote);
$(window).bind('hashchange', async function() {
if (isNotePathInAddress()) {
@ -845,7 +845,7 @@ $tree.on('mousedown', '.fancytree-title', e => {
}
});
utils.bindShortcut('alt+c', () => collapseTree()); // don't use shortened form since collapseTree() accepts argument
utils.bindGlobalShortcut('alt+c', () => collapseTree()); // don't use shortened form since collapseTree() accepts argument
$collapseTreeButton.click(() => collapseTree());
$createTopLevelNoteButton.click(createNewTopLevelNote);

View File

@ -129,7 +129,7 @@ function randomString(len) {
return text;
}
function bindShortcut(keyboardShortcut, handler) {
function bindGlobalShortcut(keyboardShortcut, handler) {
bindElShortcut($(document), keyboardShortcut, handler);
}
@ -221,7 +221,7 @@ export default {
download,
toObject,
randomString,
bindShortcut,
bindGlobalShortcut,
bindElShortcut,
isMobile,
isDesktop,

View File

@ -1 +1 @@
module.exports = { buildDate:"2019-08-01T21:37:59+02:00", buildRevision: "4dd6352aec73db55852068ec146ee0f39bce4027" };
module.exports = { buildDate:"2019-08-13T21:48:56+02:00", buildRevision: "90f1bfb3e4838cfea676c7968473c6978ecbed1b" };

View File

@ -11,7 +11,7 @@ function ScriptContext(allNotes, apiParams = {}) {
const note = candidates.find(c => c.title === moduleName);
if (!note) {
throw new Error("Could not find module note " + moduleName);
return require(moduleName);
}
return this.modules[note.noteId].exports;