Skip to content

TagSpaces is an offline, open source, document manager with tagging support

Select all key bindig

Borislav Sapundzhiev26c7d6743c16
diff --git a/data/ext/perspectiveGrid/perspectiveUI.js b/data/ext/perspectiveGrid/perspectiveUI.js
index 8a4ea12f8..303bca0b0 100644
--- a/data/ext/perspectiveGrid/perspectiveUI.js
+++ b/data/ext/perspectiveGrid/perspectiveUI.js
@@ -499,8 +499,8 @@ define(function(require, exports, module) {
TSCORE.openTagMenu(this, $(this).attr("tag"), $(this).attr("filepath"));
});
- Mousetrap.unbind("mod+a");
- Mousetrap.bindGlobal("mod+a", function() {
+ Mousetrap.unbind(TSCORE.Config.getSelectAllKeyBinding());
+ Mousetrap.bindGlobal(TSCORE.Config.getSelectAllKeyBinding(), function() {
self.toggleSelectAll();
});
};
diff --git a/data/ext/perspectiveList/perspectiveUI.js b/data/ext/perspectiveList/perspectiveUI.js
index 3de71cc44..726e8155d 100644
--- a/data/ext/perspectiveList/perspectiveUI.js
+++ b/data/ext/perspectiveList/perspectiveUI.js
@@ -395,8 +395,8 @@ define(function(require, exports, module) {
}
}
- Mousetrap.unbind("mod+a");
- Mousetrap.bindGlobal("mod+a", function() {
+ Mousetrap.unbind(TSCORE.Config.getSelectAllKeyBinding());
+ Mousetrap.bindGlobal(TSCORE.Config.getSelectAllKeyBinding(), function() {
self.toggleSelectAll();
});
diff --git a/data/js/options.ui.js b/data/js/options.ui.js
index f9747ccdb..f509efc70 100644
--- a/data/js/options.ui.js
+++ b/data/js/options.ui.js
@@ -123,6 +123,8 @@ define(function(require, exports, module) {
$('#perspectiveList').empty();
$('#writeMetaToSidecarFile').attr('checked', TSCORE.Config.getWriteMetaToSidecarFile());
$('#useDefaultLocationCheckbox').attr('checked', TSCORE.Config.getUseDefaultLocation());
+ $('#selectAllKeyBinding').val(TSCORE.Config.getSelectAllKeyBinding());
+
TSCORE.Config.getPerspectives().forEach(function(value) {
addPerspective($('#perspectiveList'), value.id);
});
@@ -182,6 +184,7 @@ define(function(require, exports, module) {
TSCORE.Config.setSaveDocumentKeyBinding(parseKeyBinding($('#saveDocumentKeyBinding').val()));
TSCORE.Config.setPropertiesDocumentKeyBinding(parseKeyBinding($('#documentPropertiesKeyBinding').val()));
TSCORE.Config.setSearchKeyBinding(parseKeyBinding($('#showSearchKeyBinding').val()));
+ TSCORE.Config.getSelectAllKeyBinding(parseKeyBinding($('#selectAllKeyBinding').val()));
var interfaceLang = $('#languagesList').val();
TSCORE.Config.setInterfaceLangauge(interfaceLang);
TSCORE.switchInterfaceLanguage(interfaceLang);
diff --git a/data/js/settings.api.js b/data/js/settings.api.js
index fd79375fe..b6b6eb8cf 100644
--- a/data/js/settings.api.js
+++ b/data/js/settings.api.js
@@ -424,6 +424,18 @@ define(function(require, exports, module) {
var setReloadDocumentKeyBinding = function(value) {
exports.Settings.keyBindings.reloadDocument = value;
};
+ var setSelectAllKeyBinding = function(value) {
+ exports.Settings.keyBindings.selectAll = value;
+ };
+
+ var getSelectAllKeyBinding = function() {
+ updateKeyBindingsSetting();
+ if (exports.Settings.keyBindings.selectAll === undefined) {
+ exports.Settings.keyBindings.selectAll = exports.DefaultSettings.keyBindings.selectAll;
+ saveSettings();
+ }
+ return exports.Settings.keyBindings.selectAll;
+ };
var getDeleteDocumentKeyBinding = function() {
updateKeyBindingsSetting();
if (exports.Settings.keyBindings.deleteDocument === undefined) {
@@ -1040,6 +1052,8 @@ define(function(require, exports, module) {
exports.setSaveDocumentKeyBinding = setSaveDocumentKeyBinding;
exports.getReloadDocumentKeyBinding = getReloadDocumentKeyBinding;
exports.setReloadDocumentKeyBinding = setReloadDocumentKeyBinding;
+ exports.getSelectAllKeyBinding = getSelectAllKeyBinding;
+ exports.setSelectAllKeyBinding = setSelectAllKeyBinding;
exports.getDeleteDocumentKeyBinding = getDeleteDocumentKeyBinding;
exports.setDeleteDocumentKeyBinding = setDeleteDocumentKeyBinding;
exports.getPropertiesDocumentKeyBinding = getPropertiesDocumentKeyBinding;
diff --git a/data/js/settings.default.js b/data/js/settings.default.js
index 8875cbe58..63fe372a0 100644
--- a/data/js/settings.default.js
+++ b/data/js/settings.default.js
@@ -63,6 +63,7 @@ define(function (require, exports, module) {
{ "iso": "id_ID", "title": "bahasa Indonesia (Indonesian)" },
],
"keyBindings": {
+ "selectAll": "mod+a",
"closeViewer": "mod+w",
"saveDocument": "mod+s",
"reloadDocument": "mod+r",
diff --git a/data/locales/en_US/ns.dialogs.json b/data/locales/en_US/ns.dialogs.json
index 3976b58cf..53bb0a362 100644
--- a/data/locales/en_US/ns.dialogs.json
+++ b/data/locales/en_US/ns.dialogs.json
@@ -119,6 +119,7 @@
"keyBindingInstructions3": "Any other key you should be able to reference by name like",
"keyBindingInstructions4": "You can assign many keys to a single operation, simply by separating them by",
"reloadDocumentKeyBinding": "Reload Document",
+ "selectAll": "Select All",
"closeDocumentKeyBinding": "Close Document",
"documentPropertiesKeyBinding": "Document Properties",
"saveDocumentKeyBinding": "Save Document",
diff --git a/data/templates/OptionsDialog.html b/data/templates/OptionsDialog.html
index b68d633f8..2a0872dd2 100644
--- a/data/templates/OptionsDialog.html
+++ b/data/templates/OptionsDialog.html
@@ -134,6 +134,12 @@
<p class="help-block"><span data-i18n="ns.dialogs:keyBindingInstructions3">Any other key you should be able to reference by name like</span>&nbsp;<code>a</code>, <code>/</code>, <code>$</code>, <code>*</code>, <code>=</code>.</p>
<p class="help-block"><span data-i18n="ns.dialogs:keyBindingInstructions4">You can assign many keys to a single operation, simply by separating them by</span>&nbsp;<code>,</code>.</p>
</div>
+ <div class='form-group'>
+ <label class="col-sm-4 control-label" data-i18n="ns.dialogs:selectAll"></label>
+ <div class="col-sm-7">
+ <input type='text' class='form-control' id='selectAllKeyBinding' placeholder='ctrl+a | command+a'/>
+ </div>
+ </div>
<div class='form-group'>
<label class="col-sm-4 control-label" data-i18n="ns.dialogs:reloadDocumentKeyBinding"></label>
<div class="col-sm-7">
diff --git a/default.settings.tmpl.js b/default.settings.tmpl.js
index 3ca8d1e20..2d213e660 100644
--- a/default.settings.tmpl.js
+++ b/default.settings.tmpl.js
@@ -63,6 +63,7 @@ define(function (require, exports, module) {
{ "iso": "id_ID", "title": "bahasa Indonesia (Indonesian)" },
],
"keyBindings": {
+ "selectAll": "mod+a",
"closeViewer": "mod+w",
"saveDocument": "mod+s",
"reloadDocument": "mod+r",