TagSpaces is an offline, open source, document manager with tagging support
Apply color changes to all tags of the group
kristiyanddd2f867d8464a
diff --git a/data/index.html b/data/index.htmlindex 3f7659a8d..a74679210 100644--- a/data/index.html+++ b/data/index.html@@ -888,6 +888,14 @@pattern='^([^"]){1,}$' data-i18n="[data-error]ns.dialogs:tagGroupNameHelp" required/><p class="help-block with-errors"></p></div>+ <div class="form-group">+ <div class="col-sm-12 checkbox">+ <label for="colorChangesToAllTags">+ <input type="checkbox" id="colorChangesToAllTags">+ <span data-i18n="ns.dialogs:colorChangesToAllTags"></span>+ </label>+ </div>+ </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">diff --git a/data/js/settings.api.js b/data/js/settings.api.jsindex 9ed286afd..e63578383 100644--- a/data/js/settings.api.js+++ b/data/js/settings.api.js@@ -1094,17 +1094,18 @@ define(function(require, exports, module) {return true;}- function editTagGroup(tagData, tagGroupName, tagGroupColor, tagGroupTextColor) {+ function editTagGroup(tagData, tagGroupName, tagGroupColor, tagGroupTextColor, checkAllTags) {for (var i = 0; i < exports.Settings.tagGroups.length; i++) {if (exports.Settings.tagGroups[i].key === tagData.key) {exports.Settings.tagGroups[i].title = tagGroupName;exports.Settings.tagGroups[i].color = tagGroupColor;exports.Settings.tagGroups[i].textcolor = tagGroupTextColor;for (var j = 0; j < exports.Settings.tagGroups[i].children.length; j++) {- if (exports.Settings.tagGroups[i].children[j].color !== tagData.color) {+ if (checkAllTags === true && (exports.Settings.tagGroups[i].children[j].color !== tagData.color ||+ exports.Settings.tagGroups[i].children[j].textcolor !== tagData.textcolor)) {exports.Settings.tagGroups[i].children[j].color = tagGroupColor;exports.Settings.tagGroups[i].children[j].textcolor = tagGroupTextColor;- }+ } else {break;}}break;}diff --git a/data/js/tags.ui.js b/data/js/tags.ui.jsindex 1546dc208..cfd6f3400 100644--- a/data/js/tags.ui.js+++ b/data/js/tags.ui.js@@ -15,6 +15,8 @@ define(function(require, exports, module) {var defaultTagTextColor = "#ffffff";var TSCORE = require('tscore');+ var checkedColorToAllTags;+var tagGroupsTmpl = Handlebars.compile('{{#each tagGroups}}' +@@ -175,8 +177,12 @@ define(function(require, exports, module) {$('#createTagGroupButton').on("click", createTagGroup);+ $('#colorChangesToAllTags').on('change', function(){+ checkedColorToAllTags = $('#colorChangesToAllTags').prop('checked');+ });+$('#editTagGroupButton').click(function() {- TSCORE.Config.editTagGroup(TSCORE.selectedTagData, $('#tagGroupName').val(), $('#editTagGroupBackgroundColorChooser').val(), $('#editTagGroupForegroundColorChooser').val());+ TSCORE.Config.editTagGroup(TSCORE.selectedTagData, $('#tagGroupName').val(), $('#editTagGroupBackgroundColorChooser').val(), $('#editTagGroupForegroundColorChooser').val(), checkedColorToAllTags);generateTagGroups();});}diff --git a/data/locales/en_US/ns.dialogs.json b/data/locales/en_US/ns.dialogs.jsonindex e1649d528..5198bb9b3 100644--- a/data/locales/en_US/ns.dialogs.json+++ b/data/locales/en_US/ns.dialogs.json@@ -197,5 +197,6 @@"showTagAreaOnStartup":"Always show tag area on startup","tagBackgroundColor":"Default tag background color","tagForegroundColor":"Default tag text color",+ "colorChangesToAllTags":"Apply color changes to all tags of the group","-": "-"}