TagSpaces is an offline, open source, document manager with tagging support
Keybindings for renaming file (F2)
kristiyanddaef9fee573f9
diff --git a/data/js/core.api.js b/data/js/core.api.jsindex 0ed1ae4d5..8b5e0d213 100644--- a/data/js/core.api.js+++ b/data/js/core.api.js@@ -211,6 +211,9 @@ define(function(require, exports, module) {Mousetrap.bind(tsSettings.getSearchKeyBinding(), function() {tsSearchUI.showSearchArea();});+ Mousetrap.bind(tsSettings.getRenamingFileKeyBinding(), function() {+ tsCoreUI.showRenameFileDialog();+ });}function checkForNewVersion() {@@ -528,6 +531,7 @@ define(function(require, exports, module) {exports.createHTMLFile = tsCoreUI.createHTMLFile;exports.createMDFile = tsCoreUI.createMDFile;exports.createTXTFile = tsCoreUI.createTXTFile;+ exports.showRenameFileDialog = tsCoreUI.showRenameFileDialog;// Proxying functions from tsSearchUIexports.clearSearchFilter = tsSearchUI.clearSearchFilter;diff --git a/data/js/options.ui.js b/data/js/options.ui.jsindex 8ab46069c..b33a43591 100644--- a/data/js/options.ui.js+++ b/data/js/options.ui.js@@ -166,6 +166,7 @@ define(function(require, exports, module) {$('#writeMetaToSidecarFile').attr('checked', TSCORE.Config.getWriteMetaToSidecarFile());$('#useDefaultLocationCheckbox').attr('checked', TSCORE.Config.getUseDefaultLocation());$('#selectAllKeyBinding').val(TSCORE.Config.getSelectAllKeyBinding());+ $('#renamingFileKeyBinding').val(TSCORE.Config.getRenamingFileKeyBinding());if (TSCORE.PRO) {$('#enableMetaData').attr('checked', TSCORE.Config.getEnableMetaData());$('#useTrashCan').attr('checked', TSCORE.Config.getUseTrashCan());@@ -241,6 +242,7 @@ define(function(require, exports, module) {TSCORE.Config.setPropertiesDocumentKeyBinding(parseKeyBinding($('#documentPropertiesKeyBinding').val()));TSCORE.Config.setSearchKeyBinding(parseKeyBinding($('#showSearchKeyBinding').val()));TSCORE.Config.setSelectAllKeyBinding(parseKeyBinding($('#selectAllKeyBinding').val()));+ TSCORE.Config.setRenamingFileKeyBinding(parseKeyBinding($('#renamingFileKeyBinding').val()));if (TSCORE.PRO) {TSCORE.Config.setEnableMetaData($('#enableMetaData').is(':checked'));TSCORE.Config.setUseTrashCan($('#useTrashCan').is(':checked'));diff --git a/data/js/settings.api.js b/data/js/settings.api.jsindex 3f5fa2362..cf4bee89c 100644--- a/data/js/settings.api.js+++ b/data/js/settings.api.js@@ -483,6 +483,18 @@ define(function(require, exports, module) {return exports.Settings.keyBindings.selectAll;}+ function getRenamingFileKeyBinding() {+ updateKeyBindingsSetting;+ if(exports.Settings.keyBindings.renameFile === undefined){+ exports.Settings.keyBindings.renameFile = exports.DefaultSettings.keyBindings.renameFile;+ saveSettings();+ }+ return exports.Settings.keyBindings.renameFile;+ }+ function setRenamingFileKeyBinding(value) {+ exports.Settings.keyBindings.renameFile = value;+ }+function getDeleteDocumentKeyBinding() {updateKeyBindingsSetting();if (exports.Settings.keyBindings.deleteDocument === undefined) {@@ -1266,6 +1278,8 @@ define(function(require, exports, module) {exports.setReloadDocumentKeyBinding = setReloadDocumentKeyBinding;exports.getSelectAllKeyBinding = getSelectAllKeyBinding;exports.setSelectAllKeyBinding = setSelectAllKeyBinding;+ exports.getRenamingFileKeyBinding = getRenamingFileKeyBinding;+ exports.setRenamingFileKeyBinding = setRenamingFileKeyBinding;exports.getDeleteDocumentKeyBinding = getDeleteDocumentKeyBinding;exports.setDeleteDocumentKeyBinding = setDeleteDocumentKeyBinding;exports.getPropertiesDocumentKeyBinding = getPropertiesDocumentKeyBinding;diff --git a/data/js/settings.default.js b/data/js/settings.default.jsindex 3736775a0..a286940d5 100644--- a/data/js/settings.default.js+++ b/data/js/settings.default.js@@ -86,6 +86,7 @@ define(function (require, exports, module) {"nextDocument": ['right', 'down'],"prevDocument": ['left', 'up'],"showHelp": "f1",+ "renameFile": "f2","reloadApplication": "r a","toggleFullScreen": "f11","openDevTools": "f12",diff --git a/data/locales/en_US/ns.dialogs.json b/data/locales/en_US/ns.dialogs.jsonindex 90d9d341c..bae72c5fa 100644--- a/data/locales/en_US/ns.dialogs.json+++ b/data/locales/en_US/ns.dialogs.json@@ -166,5 +166,6 @@"useSearchInSubfolders": "Search in sub-folders by default","maxSearchResultCount": "Limit files found to","watchCurrentDirectory": "Watch current directory for changes",+ "renamingFileKeyBinding": "Rename File","-": "-"}diff --git a/data/templates/OptionsDialog.html b/data/templates/OptionsDialog.htmlindex bd1da8677..ab862d6e4 100644--- a/data/templates/OptionsDialog.html+++ b/data/templates/OptionsDialog.html@@ -293,6 +293,13 @@<input type='text' class='form-control' id='showSearchKeyBinding' placeholder='ctrl+f | command+f'/></div></div>+ <div class='form-group'>+ <label class="col-sm-4 control-label" data-i18n="ns.dialogs:renamingFileKeyBinding"></label>++ <div class="col-sm-7">+ <input type='text' class='form-control' id='renamingFileKeyBinding' placeholder='f2 | f2'/>+ </div>+ </div></form></div></div>