TagSpaces is an offline, open source, document manager with tagging support
TS356 - Add new keyboard shortcuts
mladensap2a2263dcaa61
diff --git a/data/js/core.api.js b/data/js/core.api.jsindex e672a3d25..26e09a866 100644--- a/data/js/core.api.js+++ b/data/js/core.api.js@@ -230,6 +230,12 @@ define(function(require, exports, module) {Mousetrap.bind(tsSettings.getRenamingFileKeyBinding(), function() {tsCoreUI.showFileRenameDialog(TSCORE.selectedFiles[0]);});+ Mousetrap.bind(tsSettings.getDeleteDocumentKeyBinding(), function() {+ tsCoreUI.showDeleteFilesDialog(TSCORE.selectedFiles[0]);+ });+ Mousetrap.bind(tsSettings.getOpenFileKeyBinding(), function() {+ tsFileOpener.openFile(TSCORE.selectedFiles[0]);+ });}function checkForNewVersion() {diff --git a/data/js/options.ui.js b/data/js/options.ui.jsindex e02b45e13..452f8c532 100644--- a/data/js/options.ui.js+++ b/data/js/options.ui.js@@ -180,6 +180,8 @@ define(function(require, exports, module) {$('#renamingFileKeyBinding').val(TSCORE.Config.getRenamingFileKeyBinding());$('#selectAllKeyBinding').val(TSCORE.Config.getSelectAllKeyBinding());$('#showSearchKeyBinding').val(TSCORE.Config.getSearchKeyBinding());+ $('#deleteDocumentKeyBinding').val(TSCORE.Config.getDeleteDocumentKeyBinding());+ $('#openFileKeyBinding').val(TSCORE.Config.getOpenFileKeyBinding());$('#perspectiveList').empty();$('#writeMetaToSidecarFile').attr('checked', TSCORE.Config.getWriteMetaToSidecarFile());$('#useDefaultLocationCheckbox').attr('checked', TSCORE.Config.getUseDefaultLocation());@@ -284,6 +286,8 @@ define(function(require, exports, module) {TSCORE.Config.setSearchKeyBinding(parseKeyBinding($('#showSearchKeyBinding').val()));TSCORE.Config.setSelectAllKeyBinding(parseKeyBinding($('#selectAllKeyBinding').val()));TSCORE.Config.setRenamingFileKeyBinding(parseKeyBinding($('#renamingFileKeyBinding').val()));+ TSCORE.Config.setDeleteDocumentKeyBinding(parseKeyBinding($('#deleteDocumentKeyBinding').val()));+ TSCORE.Config.setOpenFileKeyBinding(parseKeyBinding($('#openFileKeyBinding').val()));TSCORE.Config.setDefaultTagColor($('#tagsBackgroundColor').val());TSCORE.Config.setDefaultTagTextColor($('#tagsForegroundColor').val());if (TSCORE.PRO) {diff --git a/data/js/settings.api.js b/data/js/settings.api.jsindex 643b78ccb..608093be8 100644--- a/data/js/settings.api.js+++ b/data/js/settings.api.js@@ -533,6 +533,20 @@ define(function(require, exports, module) {exports.Settings.keyBindings.deleteDocument = value;}+ function getOpenFileKeyBinding() {+ updateKeyBindingsSetting();+ if (exports.Settings.keyBindings.openFile === undefined) {+ exports.Settings.keyBindings.openFile = exports.DefaultSettings.keyBindings.openFile;+ saveSettings();+ }+ return exports.Settings.keyBindings.openFile;+ }++ function setOpenFileKeyBinding(value) {++ exports.Settings.keyBindings.openFile = value;+ }+function getPropertiesDocumentKeyBinding() {updateKeyBindingsSetting();if (exports.Settings.keyBindings.propertiesDocument === undefined) {@@ -1422,6 +1436,8 @@ define(function(require, exports, module) {exports.setRenamingFileKeyBinding = setRenamingFileKeyBinding;exports.getDeleteDocumentKeyBinding = getDeleteDocumentKeyBinding;exports.setDeleteDocumentKeyBinding = setDeleteDocumentKeyBinding;+ exports.getOpenFileKeyBinding = getOpenFileKeyBinding;+ exports.setOpenFileKeyBinding = setOpenFileKeyBinding;exports.getPropertiesDocumentKeyBinding = getPropertiesDocumentKeyBinding;exports.setPropertiesDocumentKeyBinding = setPropertiesDocumentKeyBinding;exports.getNextDocumentKeyBinding = getNextDocumentKeyBinding;diff --git a/data/js/settings.default.js b/data/js/settings.default.jsindex a4f76d8e1..253f77a02 100644--- a/data/js/settings.default.js+++ b/data/js/settings.default.js@@ -100,7 +100,8 @@ define(function (require, exports, module) {"reloadApplication": "r a","toggleFullScreen": "f11","openDevTools": "f12",- "openSearch": "mod+f"+ "openSearch": "mod+f",+ "openFile": "enter"},"supportedFileTypes": [{ "type": "jpg", "viewer": "viewerImage", "editor": "false" },diff --git a/data/locales/en_US/ns.dialogs.json b/data/locales/en_US/ns.dialogs.jsonindex 8c261a6fe..5adc2fbe0 100644--- a/data/locales/en_US/ns.dialogs.json+++ b/data/locales/en_US/ns.dialogs.json@@ -136,6 +136,8 @@"editDocumentKeyBinding": "Edit Document","addRemoveTagsKeyBinding": "Add / Remove Tags","showSearchKeyBinding": "Show Search",+ "deleteDocumentKeyBinding": "Delete Document",+ "openFileKeyBinding": "Open File","perspectivesHelp": "The changes made in this tab will take effect after restarting the application.","addPerspectiveButton": "Add new perspective","addNewFileExtensionButton": "Add new file extension",diff --git a/data/templates/OptionsDialog.html b/data/templates/OptionsDialog.htmlindex 7c9a7a683..bdefea6e4 100644--- a/data/templates/OptionsDialog.html+++ b/data/templates/OptionsDialog.html@@ -317,6 +317,20 @@<input type='text' class='form-control' id='closeDocumentKeyBinding' placeholder='esc'/></div></div>+ <div class='form-group'>+ <label class="col-sm-4 control-label" data-i18n="ns.dialogs:deleteDocumentKeyBinding"></label>++ <div class="col-sm-7">+ <input type='text' class='form-control' id='deleteDocumentKeyBinding' placeholder='esc'/>+ </div>+ </div>+ <div class='form-group'>+ <label class="col-sm-4 control-label" data-i18n="ns.dialogs:openFileKeyBinding"></label>++ <div class="col-sm-7">+ <input type='text' class='form-control' id='openFileKeyBinding' placeholder='esc'/>+ </div>+ </div><div class='form-group'><label class="col-sm-4 control-label" data-i18n="ns.dialogs:documentPropertiesKeyBinding"></label>diff --git a/default.settings.tmpl.js b/default.settings.tmpl.jsindex 4c32e6b2c..5b3351916 100644--- a/default.settings.tmpl.js+++ b/default.settings.tmpl.js@@ -100,7 +100,8 @@ define(function (require, exports, module) {"reloadApplication": "r a","toggleFullScreen": "f11","openDevTools": "f12",- "openSearch": "mod+f"+ "openSearch": "mod+f",+ "openFile": "enter"},"supportedFileTypes": [{ "type": "jpg", "viewer": "viewerImage", "editor": "false" },