Skip to content

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

setting the min lenght of a tag to 1 character

uggrock05bd48324c62
diff --git a/data/chromium/popup.js b/data/chromium/popup.js
index c0347a837..8cb04b458 100644
--- a/data/chromium/popup.js
+++ b/data/chromium/popup.js
@@ -41,7 +41,7 @@
multiple: true,
tags: tagList,
tokenSeparators: [",", " "],
- minimumInputLength: 2,
+ minimumInputLength: 1,
selectOnBlur: true
});
diff --git a/data/index.html b/data/index.html
index f56283039..651107f31 100644
--- a/data/index.html
+++ b/data/index.html
@@ -543,7 +543,7 @@
<form role="form" data-toggle="validator" id="formEditTag">
<div class="form-group">
<label class="control-label" for="newTagName" data-i18n="ns.dialogs:editTagNewName"></label>
- <input class="form-control" pattern="^([^\ #/\\]){2,}$" type="text" name="newTagName" id="newTagName"
+ <input class="form-control" pattern="^([^\ #/\\]){1,}$" type="text" name="newTagName" id="newTagName"
data-i18n="[data-error]ns.dialogs:editTagNamesRestrictionsHelp" required/>
<p class="help-block with-errors"></p>
</div>
@@ -601,14 +601,14 @@
<form role="form" data-toggle="validator" id="formEditInTreeTag">
<div class="form-group">
<label class="control-label" for="tagInTreeName" data-i18n="ns.dialogs:editTagMasterName"></label>*
- <input class="form-control" pattern="^([^\ #/\\]){2,}$" type="text" name="tagInTreeName" id="tagInTreeName"
+ <input class="form-control" pattern="^([^\ #/\\]){1,}$" type="text" name="tagInTreeName" id="tagInTreeName"
data-i18n="[data-error]ns.dialogs:editTagNamesRestrictionsHelp" required/>
<p class="help-block with-errors"></p>
</div>
<div class="form-group">
<label class="control-label" for="tagInTreeKeyBinding"
data-i18n="ns.dialogs:editTagInTreeKeyBinding"></label>
- <input class="form-control" pattern="^([+\ A-z0-9]){2,}$" type="text" name="tagInTreeKeyBinding"
+ <input class="form-control" pattern="^([+\ A-z0-9]){1,}$" type="text" name="tagInTreeKeyBinding"
id="tagInTreeKeyBinding"/>
<p class="help-block with-errors"></p>
<p class="help-block" data-i18n="ns.dialogs:editTagInTreeKeyBindingHelp"></p>
@@ -677,7 +677,7 @@
<form role="form" data-toggle="validator" id="formAddTags">
<div class="form-group">
<label class="control-label" for="newTagTitle" data-i18n="ns.dialogs:addTagsToGroupTags"></label>
- <input pattern="^([^#/\\\ ]){2,}$" class="form-control" type="text" name="newTagTitle"
+ <input pattern="^([^#/\\\ ]){1,}$" class="form-control" type="text" name="newTagTitle"
id="newTagTitle"
data-i18n="[placeholder]ns.dialogs:addTagsToGroupTagsPlaceholder;[data-error]ns.dialogs:editTagNamesRestrictionsHelp"/>
<p class="help-block with-errors"></p>
diff --git a/data/js/core.ui.js b/data/js/core.ui.js
index fed6d38c1..9fd66ea6e 100644
--- a/data/js/core.ui.js
+++ b/data/js/core.ui.js
@@ -553,7 +553,7 @@ define(function(require, exports, module) {
',',
' '
],
- minimumInputLength: 2,
+ minimumInputLength: 1,
selectOnBlur: true
});
$('#newFileName').val('');
diff --git a/data/js/settings.api.js b/data/js/settings.api.js
index e8e9b11d6..7fc4f87ac 100644
--- a/data/js/settings.api.js
+++ b/data/js/settings.api.js
@@ -1026,7 +1026,7 @@ define(function(require, exports, module) {
});
// Create tag if it is not existing in the current group
// And is at least 2 characters long
- if (!tagExistsInGroup && newTagName.length >= 2) {
+ if (!tagExistsInGroup && newTagName.length >= 1) {
var newTagModel = JSON.parse(JSON.stringify(tagTemplate));
newTagModel.title = newTagName;
newTagModel.color = newTagColor;
diff --git a/data/js/tags.ui.js b/data/js/tags.ui.js
index 43725a121..c7f55e99f 100644
--- a/data/js/tags.ui.js
+++ b/data/js/tags.ui.js
@@ -627,7 +627,7 @@ define(function(require, exports, module) {
',',
' '
],
- minimumInputLength: 2,
+ minimumInputLength: 1,
selectOnBlur: true,
formatSelectionCssClass: function(tag, container) {
var style = generateTagStyle(TSCORE.Config.findTag(tag.text));
diff --git a/data/mozilla/popup.js b/data/mozilla/popup.js
index b4412cca8..27c33548e 100644
--- a/data/mozilla/popup.js
+++ b/data/mozilla/popup.js
@@ -116,7 +116,7 @@
multiple: true,
tags: tagList,
tokenSeparators: [",", " "],
- minimumInputLength: 2,
+ minimumInputLength: 1,
selectOnBlur: true
});