Skip to content

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

edit color tags

kristiyandd123444887a9f
diff --git a/data/index.html b/data/index.html
index 5964c9395..b15a37396 100644
--- a/data/index.html
+++ b/data/index.html
@@ -866,6 +866,47 @@
pattern='^([^"]){1,}$' data-i18n="[data-error]ns.dialogs:tagGroupNameHelp" required/>
<p class="help-block with-errors"></p>
</div>
+ <div class="form-group">
+ <label class="control-label" for="editTagGroupBackgroundColor" data-i18n="ns.dialogs:tagBackgroundColor"></label>
+ <input type="color" class="form-control" id="editTagGroupBackgroundColor" style="padding: 0">
+ <select class="form-control" id="editTagGroupBackgroundColorChooser">
+ <option value="#ffffff">#ffffff</option>
+ <option value="#000000">#000000</option>
+ <option value="#ac725e">#ac725e</option>
+ <option value="#d06b64">#d06b64</option>
+ <option value="#f83a22">#f83a22</option>
+ <option value="#fa573c">#fa573c</option>
+ <option value="#ff7537">#ff7537</option>
+ <option value="#ffad46">#ffad46</option>
+ <option value="#42d692">#42d692</option>
+ <option value="#008000">#008000</option>
+ <option value="#7bd148">#7bd148</option>
+ <option value="#fad165">#fad165</option>
+ <option value="#FFCC24">#FFCC24</option>
+ <option value="#92e1c0">#92e1c0</option>
+ <option value="#9fe1e7">#9fe1e7</option>
+ <option value="#9fc6e7">#9fc6e7</option>
+ <option value="#4986e7">#4986e7</option>
+ <option value="#9a9cff">#9a9cff</option>
+ <option value="#b99aff">#b99aff</option>
+ <option value="#c2c2c2">#c2c2c2</option>
+ <option value="#cabdbf">#cabdbf</option>
+ <option value="#cca6ac">#cca6ac</option>
+ <option value="#f691b2">#f691b2</option>
+ <option value="#cd74e6">#cd74e6</option>
+ <option value="#a47ae2">#a47ae2</option>
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="control-label" for="editTagGroupForegroundColor" data-i18n="ns.dialogs:tagForegroundColor"></label>
+ <input type="color" class="form-control" id="editTagGroupForegroundColor" style="padding: 0">
+ <select class="form-control" id="editTagGroupForegroundColorChooser">
+ <option value="#ffffff">#ffffff</option>
+ <option value="#cccccc">#cccccc</option>
+ <option value="#333333">#333333</option>
+ <option value="#000000">#000000</option>
+ </select>
+ </div>
</form>
</div>
<div class="modal-footer">
diff --git a/data/js/tags.ui.js b/data/js/tags.ui.js
index 5acda917a..6e40e20e2 100644
--- a/data/js/tags.ui.js
+++ b/data/js/tags.ui.js
@@ -176,7 +176,7 @@ define(function(require, exports, module) {
$('#createTagGroupButton').on("click", createTagGroup);
$('#editTagGroupButton').click(function() {
- TSCORE.Config.editTagGroup(TSCORE.selectedTagData, $('#tagGroupName').val());
+ TSCORE.Config.editTagGroup(TSCORE.selectedTagData, $('#tagGroupName').val(), $('#editTagGroupBackgroundColor').val(), $('#editTagGroupForegroundColor').val());
generateTagGroups();
});
}
@@ -514,7 +514,6 @@ define(function(require, exports, module) {
}
function showImportTagsDialog(tagGroups) {
-
require(['text!templates/ImportTagsDialog.html'], function(uiTPL) {
if ($('#dialogImportTags').length < 1) {
@@ -542,6 +541,27 @@ define(function(require, exports, module) {
}
function showDialogEditTagGroup() {
+ var $editTagGroupBackgroundColorChooser = $('#editTagGroupBackgroundColorChooser');
+ var $editTagGroupBackgroundColor = $('#editTagGroupBackgroundColor');
+ $editTagGroupBackgroundColorChooser.simplecolorpicker({
+ picker: false
+ });
+ $editTagGroupBackgroundColorChooser.on('change', function() {
+ $editTagGroupBackgroundColor.val($editTagGroupBackgroundColorChooser.val());
+ });
+
+ $editTagGroupBackgroundColor.val(TSCORE.Config.getDefaultTagColor());
+
+ var $editTagGroupForegroundColorChooser = $('#editTagGroupForegroundColorChooser');
+ var $editTagGroupForegroundColor = $('#editTagGroupForegroundColor');
+ $editTagGroupForegroundColorChooser.simplecolorpicker({
+ picker: false
+ });
+ $editTagGroupForegroundColorChooser.on('change', function() {
+ $editTagGroupForegroundColor.val($editTagGroupForegroundColorChooser.val());
+ });
+ $editTagGroupForegroundColor.val(TSCORE.Config.getDefaultTagTextColor());
+
$('#tagGroupName').val(TSCORE.selectedTagData.title);
$('#formTagGroupEdit').validator();
$('#formTagGroupEdit').submit(function(e) {
@@ -569,7 +589,6 @@ define(function(require, exports, module) {
}
function showDialogTagGroupCreate() {
-
var $tagGroupBackgroundColorChooser = $('#tagGroupBackgroundColorChooser');
var $tagGroupBackgroundColor = $('#tagGroupBackgroundColor');
$tagGroupBackgroundColorChooser.simplecolorpicker({