Skip to content

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

tab for default font color tags

kristiyanddf6e527af0322
diff --git a/data/js/options.ui.js b/data/js/options.ui.js
index b34966b9c..0ae76fe8c 100644
--- a/data/js/options.ui.js
+++ b/data/js/options.ui.js
@@ -69,7 +69,38 @@ define(function(require, exports, module) {
$('#useGenerateThumbnails').attr('disabled', !isMetaEnabled);
}
+
function initUI() {
+ var defaultTagColor = TSCORE.Config.DefaultSettings.defaultTagsColor; // "#008000";
+ var defaultTagTextColor = TSCORE.Config.DefaultSettings.defaultTagsTextColor; //"#ffffff";
+
+ var $tagsBackgroundColorChooser = $('#tagsBackgroundColorChooser');
+ var $tagsBackgroundColor = $('#tagsBackgroundColor');
+ var $tagForegroundColor = $('#tagsForegroundColor');
+ $tagsBackgroundColorChooser.simplecolorpicker({
+ picker: false
+ });
+ $tagsBackgroundColorChooser.on('change', function() {
+ $tagsBackgroundColor.val($tagsBackgroundColorChooser.val());
+ });
+ //if (TSCORE.selectedTagData.color === undefined || TSCORE.selectedTagData.color.length < 1) {
+ $tagsBackgroundColor.val(defaultTagColor);
+ //} else {
+ // $tagsBackgroundColor.val(TSCORE.selectedTagData.color);
+ //}
+ var $tagForegroundColorChooser = $('#tagForegroundColorChooser');
+ $tagForegroundColorChooser.simplecolorpicker({
+ picker: false
+ });
+ $tagForegroundColorChooser.on('change', function() {
+ $tagForegroundColor.val($tagForegroundColorChooser.val());
+ });
+ //if (TSCORE.selectedTagData.textcolor === undefined || TSCORE.selectedTagData.textcolor.length < 1) {
+ $tagForegroundColor.val(defaultTagTextColor);
+ //} else {
+ // tagForegroundColor.val(TSCORE.selectedTagData.textcolor);
+ //}
+
$('#addFileTypeButton').click(function(e) {
// Fixes reloading of the application by click
e.preventDefault();
@@ -91,10 +122,10 @@ define(function(require, exports, module) {
});
$('#defaultSettingsButton').click(function() {
TSCORE.showConfirmDialog(
- $.i18n.t('ns.dialogs:restoreDefaulSettingTitleConfirm'),
- $.i18n.t('ns.dialogs:restoreDefaulSettingMessageConfirm'), function() {
- TSCORE.Config.loadDefaultSettings();
- });
+ $.i18n.t('ns.dialogs:restoreDefaulSettingTitleConfirm'),
+ $.i18n.t('ns.dialogs:restoreDefaulSettingMessageConfirm'), function() {
+ TSCORE.Config.loadDefaultSettings();
+ });
});
$('#keyBindingInstructions').toggle();
$('#keyBindingInstructionsToggle').on('click', function() {
@@ -120,10 +151,10 @@ define(function(require, exports, module) {
function exportTagGroups() {
var jsonFormat = '{ "appName": "' + TSCORE.Config.DefaultSettings.appName +
- '", "appVersion": "' + TSCORE.Config.DefaultSettings.appVersion +
- '", "appBuild": "' + TSCORE.Config.DefaultSettings.appBuild +
- '", "settingsVersion": ' + TSCORE.Config.DefaultSettings.settingsVersion +
- ', "tagGroups": ';
+ '", "appVersion": "' + TSCORE.Config.DefaultSettings.appVersion +
+ '", "appBuild": "' + TSCORE.Config.DefaultSettings.appBuild +
+ '", "settingsVersion": ' + TSCORE.Config.DefaultSettings.settingsVersion +
+ ', "tagGroups": ';
var blob = new Blob([jsonFormat + JSON.stringify(TSCORE.Config.getAllTagGroupData()) + '}'], {
type: 'application/json'
});
@@ -250,6 +281,8 @@ define(function(require, exports, module) {
TSCORE.Config.setWriteMetaToSidecarFile($('#writeMetaToSidecarFile').is(':checked'));
TSCORE.Config.setUseDefaultLocation($('#useDefaultLocationCheckbox').is(':checked'));
TSCORE.Config.setColoredFileExtensionsEnabled($('#coloredFileExtensionsEnabledCheckbox').is(':checked'));
+ TSCORE.Config.setDefaultTagsColor($('#tagsBackgroundColor').val());
+ TSCORE.Config.setDefaultTagsTextColor($('#tagsForegroundColor').val());
TSCORE.Config.saveSettings();
}
diff --git a/data/js/settings.api.js b/data/js/settings.api.js
index 24338e997..cfa50c7b5 100644
--- a/data/js/settings.api.js
+++ b/data/js/settings.api.js
@@ -904,6 +904,30 @@ define(function(require, exports, module) {
exports.Settings.coloredFileExtensionsEnabled = value;
}
+ function getDefaultTagsColor() {
+ if (exports.Settings.defaultTagsColor === undefined) {
+ exports.Settings.defaultTagsColor = exports.DefaultSettings.defaultTagsColor;
+ saveSettings();
+ }
+ return exports.Settings.defaultTagsColor;
+ }
+
+ function setDefaultTagsColor(value){
+ exports.Settings.defaultTagsColor = value;
+ }
+
+ function getDefaultTagsTextColor() {
+ if (exports.Settings.defaultTagsTextColor === undefined) {
+ exports.Settings.defaultTagsTextColor = exports.DefaultSettings.defaultTagsTextColor;
+ saveSettings();
+ }
+ return exports.Settings.defaultTagsTextColor;
+ }
+
+ function setDefaultTagsTextColor(value){
+ exports.Settings.defaultTagsTextColor = value;
+ }
+
//////////////////// API methods ///////////////////
function getFileTypeEditor(fileTypeExt) {
for (var i = 0; i < exports.Settings.supportedFileTypes.length; i++) {
@@ -1398,4 +1422,8 @@ define(function(require, exports, module) {
exports.setUseDefaultLocation = setUseDefaultLocation;
exports.getColoredFileExtensionsEnabled = getColoredFileExtensionsEnabled;
exports.setColoredFileExtensionsEnabled = setColoredFileExtensionsEnabled;
+ exports.getDefaultTagsColor = getDefaultTagsColor;
+ exports.setDefaultTagsColor = setDefaultTagsColor;
+ exports.getDefaultTagsTextColor = getDefaultTagsTextColor;
+ exports.setDefaultTagsTextColor = setDefaultTagsTextColor;
});
diff --git a/data/js/settings.default.js b/data/js/settings.default.js
index ee9f20dfb..5ad63a23a 100644
--- a/data/js/settings.default.js
+++ b/data/js/settings.default.js
@@ -46,6 +46,8 @@ define(function (require, exports, module) {
"useTextExtraction": false,
"useGenerateThumbnails": false,
"watchCurrentDirectory": false,
+ "defaultTagsTextColor": "#ffffff",
+ "defaultTagsColor": "#008000",
"supportedLanguages": [
{ "iso": "en_US", "title": "English" },
{ "iso": "de_DE", "title": "Deutsch (German)" },
diff --git a/data/locales/en_US/ns.dialogs.json b/data/locales/en_US/ns.dialogs.json
index 83b4606ab..4a2afbc5b 100644
--- a/data/locales/en_US/ns.dialogs.json
+++ b/data/locales/en_US/ns.dialogs.json
@@ -194,5 +194,8 @@
"save":"Save",
"delete":"Delete",
"coloredFileExtensionsEnabled":"Enable colored file type extensions",
+ "fontColorTags":"Color Tags",
+ "backgroundColor":"Background Color Tags",
+ "foregroundColor":"Foreground Color Tags",
"-": "-"
}
diff --git a/data/templates/OptionsDialog.html b/data/templates/OptionsDialog.html
index 268bcc7a3..d894fc8ee 100644
--- a/data/templates/OptionsDialog.html
+++ b/data/templates/OptionsDialog.html
@@ -17,6 +17,7 @@
<li><a href="#filetypes" data-toggle="tab" class="optionsTitle" data-i18n="ns.dialogs:fileTypeTab"></a></li>
<li><a href="#keyBindings" data-toggle="tab" class="optionsTitle" data-i18n="ns.dialogs:keyBindingsTab"></a>
</li>
+ <li><a href="#fontColorTags" data-toggle="tab" class="optionsTitle" data-i18n="ns.dialogs:fontColorTags"></a></li>
</ul>
</div>
<div class="modal-body form tab-content" id="optionsAccordion">
@@ -310,6 +311,51 @@
</div>
</form>
</div>
+ <div class="tab-pane" id="fontColorTags">
+ <form role="form" data-toggle="validator" id="formDefaultColorTags">
+ <div class="form-group">
+ <label class="control-label" for="tagsBackgroundColor" data-i18n="ns.dialogs:backgroundColor"></label>
+ <input type="color" class="form-control" id="tagsBackgroundColor" style="padding: 0">
+ <select class="form-control" id="tagsBackgroundColorChooser">
+ <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="tagsForegroundColor" data-i18n="ns.dialogs:foregroundColor"></label>
+ <input type="color" class="form-control" id="tagsForegroundColor" style="padding: 0">
+ <select class="form-control" id="tagForegroundColorChooser">
+ <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>
<div class="modal-footer">
<!--button class="btn cancelButton" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times fa-lg"></i></button-->