TagSpaces is an offline, open source, document manager with tagging support
refactoring
kristiyandd5d1e2a7249ad
diff --git a/data/js/options.ui.js b/data/js/options.ui.jsindex 36bf7d7be..4249ed7c7 100644--- a/data/js/options.ui.js+++ b/data/js/options.ui.js@@ -93,7 +93,7 @@ define(function(require, exports, module) {$tagForegroundColor.val($tagForegroundColorChooser.val());});$tagForegroundColor.val(defaultTagTextColor);-+$('#addFileTypeButton').click(function(e) {// Fixes reloading of the application by click@@ -260,6 +260,8 @@ define(function(require, exports, module) {TSCORE.Config.setSearchKeyBinding(parseKeyBinding($('#showSearchKeyBinding').val()));TSCORE.Config.setSelectAllKeyBinding(parseKeyBinding($('#selectAllKeyBinding').val()));TSCORE.Config.setRenamingFileKeyBinding(parseKeyBinding($('#renamingFileKeyBinding').val()));+ TSCORE.Config.setDefaultTagColor($('#tagsBackgroundColor').val());+ TSCORE.Config.setDefaultTagTextColor($('#tagsForegroundColor').val());if (TSCORE.PRO) {TSCORE.Config.setEnableMetaData($('#enableMetaData').is(':checked'));TSCORE.Config.setUseTrashCan($('#useTrashCan').is(':checked'));diff --git a/data/js/settings.api.js b/data/js/settings.api.jsindex 25e10436e..62e9b919e 100644--- a/data/js/settings.api.js+++ b/data/js/settings.api.js@@ -891,6 +891,7 @@ define(function(require, exports, module) {exports.Settings.useDefaultLocation = value;}+function getColoredFileExtensionsEnabled() {if (exports.Settings.coloredFileExtensionsEnabled === undefined) {exports.Settings.coloredFileExtensionsEnabled = exports.DefaultSettings.coloredFileExtensionsEnabled;@@ -912,7 +913,7 @@ define(function(require, exports, module) {return exports.Settings.defaultTagsColor;}- function setDefaultTagColor(value){+ function setDefaultTagColor(value) {exports.Settings.defaultTagsColor = value;}@@ -924,7 +925,7 @@ define(function(require, exports, module) {return exports.Settings.defaultTagsTextColor;}- function setDefaultTagTextColor(value){+ function setDefaultTagTextColor(value) {exports.Settings.defaultTagsTextColor = value;}@@ -1064,8 +1065,13 @@ define(function(require, exports, module) {if (!tagExistsInGroup && newTagName.length >= 1) {var newTagModel = JSON.parse(JSON.stringify(tagTemplate));newTagModel.title = newTagName;- newTagModel.color = newTagColor;- newTagModel.textcolor = newTagTextColor;+ if (newTagColor !== undefined || newTagTextColor !== undefined) {+ newTagModel.color = newTagColor;+ newTagModel.textcolor = newTagTextColor;+ } else {+ newTagModel.color = getDefaultTagColor();+ newTagModel.textcolor = getDefaultTagTextColor();+ }value.children.push(newTagModel);} else {console.log('Tag with the same name already exist in this group or tag length is not correct');diff --git a/data/loader.js b/data/loader.jsindex 48fb318d4..f37dce8fc 100644--- a/data/loader.js+++ b/data/loader.js@@ -53,7 +53,7 @@ var isWin = navigator.appVersion.indexOf("Win")!==-1;console.log(e.message);}var PRO_JS = "pro/js/pro.api";- if(PRO.indexOf("@@PROVERS") == 0 || PRO == "false") { PRO_JS = 'js/pro'; }+ //if(PRO.indexOf("@@PROVERS") == 0 || PRO == "false") { PRO_JS = 'js/pro'; }// Setting up the IO functionality according to the platformvar IO_JS = "web/web.api";